fix(core): support unlimited shell timeouts

This commit is contained in:
Dax Raad 2026-07-06 19:32:22 -04:00
commit 59790380de
11 changed files with 213 additions and 47 deletions

View file

@ -735,7 +735,7 @@ export type Endpoint20_1Input = {
readonly location?: Endpoint20_1Request["query"]["location"]
readonly command: Endpoint20_1Request["payload"]["command"]
readonly cwd?: Endpoint20_1Request["payload"]["cwd"]
readonly timeout?: Endpoint20_1Request["payload"]["timeout"]
readonly timeout: Endpoint20_1Request["payload"]["timeout"]
readonly metadata?: Endpoint20_1Request["payload"]["metadata"]
}
export type Endpoint20_1Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.create"]>>
@ -749,28 +749,38 @@ export type Endpoint20_2Input = {
export type Endpoint20_2Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.get"]>>
export type ShellGetOperation<E = never> = (input: Endpoint20_2Input) => Effect.Effect<Endpoint20_2Output, E>
type Endpoint20_3Request = Parameters<RawClient["server.shell"]["shell.output"]>[0]
type Endpoint20_3Request = Parameters<RawClient["server.shell"]["shell.timeout"]>[0]
export type Endpoint20_3Input = {
readonly id: Endpoint20_3Request["params"]["id"]
readonly location?: Endpoint20_3Request["query"]["location"]
readonly cursor?: Endpoint20_3Request["query"]["cursor"]
readonly limit?: Endpoint20_3Request["query"]["limit"]
readonly timeout: Endpoint20_3Request["payload"]["timeout"]
}
export type Endpoint20_3Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.output"]>>
export type ShellOutputOperation<E = never> = (input: Endpoint20_3Input) => Effect.Effect<Endpoint20_3Output, E>
export type Endpoint20_3Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.timeout"]>>
export type ShellTimeoutOperation<E = never> = (input: Endpoint20_3Input) => Effect.Effect<Endpoint20_3Output, E>
type Endpoint20_4Request = Parameters<RawClient["server.shell"]["shell.remove"]>[0]
type Endpoint20_4Request = Parameters<RawClient["server.shell"]["shell.output"]>[0]
export type Endpoint20_4Input = {
readonly id: Endpoint20_4Request["params"]["id"]
readonly location?: Endpoint20_4Request["query"]["location"]
readonly cursor?: Endpoint20_4Request["query"]["cursor"]
readonly limit?: Endpoint20_4Request["query"]["limit"]
}
export type Endpoint20_4Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.remove"]>>
export type ShellRemoveOperation<E = never> = (input: Endpoint20_4Input) => Effect.Effect<Endpoint20_4Output, E>
export type Endpoint20_4Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.output"]>>
export type ShellOutputOperation<E = never> = (input: Endpoint20_4Input) => Effect.Effect<Endpoint20_4Output, E>
type Endpoint20_5Request = Parameters<RawClient["server.shell"]["shell.remove"]>[0]
export type Endpoint20_5Input = {
readonly id: Endpoint20_5Request["params"]["id"]
readonly location?: Endpoint20_5Request["query"]["location"]
}
export type Endpoint20_5Output = EffectValue<ReturnType<RawClient["server.shell"]["shell.remove"]>>
export type ShellRemoveOperation<E = never> = (input: Endpoint20_5Input) => Effect.Effect<Endpoint20_5Output, E>
export interface ShellApi<E = never> {
readonly list: ShellListOperation<E>
readonly create: ShellCreateOperation<E>
readonly get: ShellGetOperation<E>
readonly timeout: ShellTimeoutOperation<E>
readonly output: ShellOutputOperation<E>
readonly remove: ShellRemoveOperation<E>
}

View file

@ -883,7 +883,7 @@ type Endpoint20_1Input = {
readonly location?: Endpoint20_1Request["query"]["location"]
readonly command: Endpoint20_1Request["payload"]["command"]
readonly cwd?: Endpoint20_1Request["payload"]["cwd"]
readonly timeout?: Endpoint20_1Request["payload"]["timeout"]
readonly timeout: Endpoint20_1Request["payload"]["timeout"]
readonly metadata?: Endpoint20_1Request["payload"]["metadata"]
}
const Endpoint20_1 = (raw: RawClient["server.shell"]) => (input: Endpoint20_1Input) =>
@ -902,25 +902,38 @@ const Endpoint20_2 = (raw: RawClient["server.shell"]) => (input: Endpoint20_2Inp
Effect.mapError(mapClientError),
)
type Endpoint20_3Request = Parameters<RawClient["server.shell"]["shell.output"]>[0]
type Endpoint20_3Request = Parameters<RawClient["server.shell"]["shell.timeout"]>[0]
type Endpoint20_3Input = {
readonly id: Endpoint20_3Request["params"]["id"]
readonly location?: Endpoint20_3Request["query"]["location"]
readonly cursor?: Endpoint20_3Request["query"]["cursor"]
readonly limit?: Endpoint20_3Request["query"]["limit"]
readonly timeout: Endpoint20_3Request["payload"]["timeout"]
}
const Endpoint20_3 = (raw: RawClient["server.shell"]) => (input: Endpoint20_3Input) =>
raw["shell.timeout"]({
params: { id: input["id"] },
query: { location: input["location"] },
payload: { timeout: input["timeout"] },
}).pipe(Effect.mapError(mapClientError))
type Endpoint20_4Request = Parameters<RawClient["server.shell"]["shell.output"]>[0]
type Endpoint20_4Input = {
readonly id: Endpoint20_4Request["params"]["id"]
readonly location?: Endpoint20_4Request["query"]["location"]
readonly cursor?: Endpoint20_4Request["query"]["cursor"]
readonly limit?: Endpoint20_4Request["query"]["limit"]
}
const Endpoint20_4 = (raw: RawClient["server.shell"]) => (input: Endpoint20_4Input) =>
raw["shell.output"]({
params: { id: input["id"] },
query: { location: input["location"], cursor: input["cursor"], limit: input["limit"] },
}).pipe(Effect.mapError(mapClientError))
type Endpoint20_4Request = Parameters<RawClient["server.shell"]["shell.remove"]>[0]
type Endpoint20_4Input = {
readonly id: Endpoint20_4Request["params"]["id"]
readonly location?: Endpoint20_4Request["query"]["location"]
type Endpoint20_5Request = Parameters<RawClient["server.shell"]["shell.remove"]>[0]
type Endpoint20_5Input = {
readonly id: Endpoint20_5Request["params"]["id"]
readonly location?: Endpoint20_5Request["query"]["location"]
}
const Endpoint20_4 = (raw: RawClient["server.shell"]) => (input: Endpoint20_4Input) =>
const Endpoint20_5 = (raw: RawClient["server.shell"]) => (input: Endpoint20_5Input) =>
raw["shell.remove"]({ params: { id: input["id"] }, query: { location: input["location"] } }).pipe(
Effect.mapError(mapClientError),
)
@ -929,8 +942,9 @@ const adaptGroup20 = (raw: RawClient["server.shell"]) => ({
list: Endpoint20_0(raw),
create: Endpoint20_1(raw),
get: Endpoint20_2(raw),
output: Endpoint20_3(raw),
remove: Endpoint20_4(raw),
timeout: Endpoint20_3(raw),
output: Endpoint20_4(raw),
remove: Endpoint20_5(raw),
})
type Endpoint21_0Request = Parameters<RawClient["server.question"]["question.request.list"]>[0]

View file

@ -151,6 +151,8 @@ import type {
ShellCreateOutput,
ShellGetInput,
ShellGetOutput,
ShellTimeoutInput,
ShellTimeoutOutput,
ShellOutputInput,
ShellOutputOutput,
ShellRemoveInput,
@ -1313,6 +1315,19 @@ export function make(options: ClientOptions) {
},
requestOptions,
),
timeout: (input: ShellTimeoutInput, requestOptions?: RequestOptions) =>
request<ShellTimeoutOutput>(
{
method: "PATCH",
path: `/api/shell/${encodeURIComponent(input.id)}/timeout`,
query: { location: input["location"] },
body: { timeout: input["timeout"] },
successStatus: 200,
declaredStatuses: [404, 401, 400],
empty: false,
},
requestOptions,
),
output: (input: ShellOutputInput, requestOptions?: RequestOptions) =>
request<ShellOutputOutput>(
{

View file

@ -5757,25 +5757,25 @@ export type ShellCreateInput = {
readonly command: {
readonly command: string
readonly cwd?: string
readonly timeout?: number
readonly timeout: number
readonly metadata?: { readonly [x: string]: JsonValue }
}["command"]
readonly cwd?: {
readonly command: string
readonly cwd?: string
readonly timeout?: number
readonly timeout: number
readonly metadata?: { readonly [x: string]: JsonValue }
}["cwd"]
readonly timeout?: {
readonly timeout: {
readonly command: string
readonly cwd?: string
readonly timeout?: number
readonly timeout: number
readonly metadata?: { readonly [x: string]: JsonValue }
}["timeout"]
readonly metadata?: {
readonly command: string
readonly cwd?: string
readonly timeout?: number
readonly timeout: number
readonly metadata?: { readonly [x: string]: JsonValue }
}["metadata"]
}
@ -5833,6 +5833,37 @@ export type ShellGetOutput = {
}
}
export type ShellTimeoutInput = {
readonly id: { readonly id: string }["id"]
readonly location?: {
readonly location?: { readonly directory?: string | undefined; readonly workspace?: string | undefined } | undefined
}["location"]
readonly timeout: { readonly timeout: number }["timeout"]
}
export type ShellTimeoutOutput = {
readonly location: {
readonly directory: string
readonly workspaceID?: string
readonly project: { readonly id: string; readonly directory: string }
}
readonly data: {
readonly id: string
readonly status: "running" | "exited" | "timeout" | "killed"
readonly command: string
readonly cwd: string
readonly shell: string
readonly file: string
readonly pid?: number
readonly exit?: number | "Infinity" | "-Infinity" | "NaN"
readonly metadata: { readonly [x: string]: JsonValue }
readonly time: {
readonly started: number | "Infinity" | "-Infinity" | "NaN"
readonly completed?: number | "Infinity" | "-Infinity" | "NaN"
}
}
}
export type ShellOutputInput = {
readonly id: { readonly id: string }["id"]
readonly location?: {