Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"zod": "^3.25.0 || ^4.0.0"
},
"devDependencies": {
"@hey-api/openapi-ts": "^0.91.1",
"@types/node": "^25.2.0",
"@hey-api/openapi-ts": "^0.92.3",
"@types/node": "^25.2.1",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"concurrently": "^9.2.1",
Expand Down
6 changes: 5 additions & 1 deletion scripts/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ async function main() {
path: "./src/schema",
postProcess: ["prettier"],
},
plugins: ["@hey-api/transformers", "@hey-api/typescript", "zod"],
plugins: [
"zod",
{ bigInt: false, name: "@hey-api/transformers" },
"@hey-api/typescript",
],
});

const zodPath = "./src/schema/zod.gen.ts";
Expand Down
22 changes: 11 additions & 11 deletions src/schema/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ export type CreateTerminalRequest = {
* string output, even if this means the retained output is slightly less than the
* specified limit.
*/
outputByteLimit?: bigint | null;
outputByteLimit?: number | null;
/**
* The session ID for this request.
*/
Expand Down Expand Up @@ -1781,7 +1781,7 @@ export type ReleaseTerminalResponse = {
*
* [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
*/
export type RequestId = null | bigint | string;
export type RequestId = null | number | string;

/**
* The outcome of a permission request.
Expand Down Expand Up @@ -1864,7 +1864,7 @@ export type ResourceLink = {
description?: string | null;
mimeType?: string | null;
name: string;
size?: bigint | null;
size?: number | null;
title?: string | null;
uri: string;
};
Expand Down Expand Up @@ -2964,27 +2964,27 @@ export type Usage = {
/**
* Total cache read tokens.
*/
cachedReadTokens?: bigint | null;
cachedReadTokens?: number | null;
/**
* Total cache write tokens.
*/
cachedWriteTokens?: bigint | null;
cachedWriteTokens?: number | null;
/**
* Total input tokens across all turns.
*/
inputTokens: bigint;
inputTokens: number;
/**
* Total output tokens across all turns.
*/
outputTokens: bigint;
outputTokens: number;
/**
* Total thought/reasoning tokens
*/
thoughtTokens?: bigint | null;
thoughtTokens?: number | null;
/**
* Sum of all token types across session.
*/
totalTokens: bigint;
totalTokens: number;
};

/**
Expand Down Expand Up @@ -3014,11 +3014,11 @@ export type UsageUpdate = {
/**
* Total context window size in tokens.
*/
size: bigint;
size: number;
/**
* Tokens currently in context.
*/
used: bigint;
used: number;
};

/**
Expand Down
93 changes: 11 additions & 82 deletions src/schema/zod.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,18 +476,7 @@ export const zReleaseTerminalResponse = z.object({
*
* [2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.
*/
export const zRequestId = z.union([
z.null(),
z.coerce
.bigint()
.min(BigInt("-9223372036854775808"), {
message: "Invalid value: Expected int64 to be >= -9223372036854775808",
})
.max(BigInt("9223372036854775807"), {
message: "Invalid value: Expected int64 to be <= 9223372036854775807",
}),
z.string(),
]);
export const zRequestId = z.union([z.null(), z.number(), z.string()]);

/**
* **UNSTABLE**
Expand Down Expand Up @@ -550,20 +539,7 @@ export const zResourceLink = z.object({
description: z.union([z.string(), z.null()]).optional(),
mimeType: z.union([z.string(), z.null()]).optional(),
name: z.string(),
size: z
.union([
z.coerce
.bigint()
.min(BigInt("-9223372036854775808"), {
message:
"Invalid value: Expected int64 to be >= -9223372036854775808",
})
.max(BigInt("9223372036854775807"), {
message: "Invalid value: Expected int64 to be <= 9223372036854775807",
}),
z.null(),
])
.optional(),
size: z.union([z.number(), z.null()]).optional(),
title: z.union([z.string(), z.null()]).optional(),
uri: z.string(),
});
Expand Down Expand Up @@ -742,14 +718,7 @@ export const zCreateTerminalRequest = z.object({
command: z.string(),
cwd: z.union([z.string(), z.null()]).optional(),
env: z.array(zEnvVariable).optional(),
outputByteLimit: z
.union([
z.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
z.null(),
])
.optional(),
outputByteLimit: z.union([z.number(), z.null()]).optional(),
sessionId: zSessionId,
});

Expand Down Expand Up @@ -1534,48 +1503,12 @@ export const zAvailableCommandsUpdate = z.object({
* @experimental
*/
export const zUsage = z.object({
cachedReadTokens: z
.union([
z.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
z.null(),
])
.optional(),
cachedWriteTokens: z
.union([
z.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
z.null(),
])
.optional(),
inputTokens: z.coerce
.bigint()
.gte(BigInt(0))
.max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
outputTokens: z.coerce
.bigint()
.gte(BigInt(0))
.max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
thoughtTokens: z
.union([
z.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
z.null(),
])
.optional(),
totalTokens: z.coerce
.bigint()
.gte(BigInt(0))
.max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
cachedReadTokens: z.union([z.number(), z.null()]).optional(),
cachedWriteTokens: z.union([z.number(), z.null()]).optional(),
inputTokens: z.number(),
outputTokens: z.number(),
thoughtTokens: z.union([z.number(), z.null()]).optional(),
totalTokens: z.number(),
});

/**
Expand Down Expand Up @@ -1625,12 +1558,8 @@ export const zAgentResponse = z.union([
export const zUsageUpdate = z.object({
_meta: z.union([z.record(z.string(), z.unknown()), z.null()]).optional(),
cost: z.union([zCost, z.null()]).optional(),
size: z.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
used: z.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"), {
message: "Invalid value: Expected uint64 to be <= 18446744073709551615",
}),
size: z.number(),
used: z.number(),
});

/**
Expand Down