From 59d0d64a6bc7e4673791c6b42b4ecb5a83f85565 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Sun, 23 Aug 2026 18:01:44 -0400 Subject: [PATCH] chore: upgrade Effect to rc.111 (#44518) --- bun.lock | 28 +- package.json | 10 +- packages/client/package.json | 2 +- .../client/src/promise/generated/types.ts | 1486 ++++++++--------- packages/core/src/session/run-coordinator.ts | 21 +- .../core/test/session-run-coordinator.test.ts | 12 +- packages/core/test/tool-schema.test.ts | 2 +- packages/desktop/src/main/ipc-transport.ts | 1 + packages/http-recorder/package.json | 2 +- 9 files changed, 772 insertions(+), 792 deletions(-) diff --git a/bun.lock b/bun.lock index 08319ccb7d8..43b3eac0d95 100644 --- a/bun.lock +++ b/bun.lock @@ -54,12 +54,12 @@ "name": "@opencode-ai/app", "version": "1.18.15", "dependencies": { - "@ibm/plex": "6.4.1", "@corvu/drawer": "catalog:", "@dnd-kit/abstract": "0.5.0", "@dnd-kit/dom": "0.5.0", "@dnd-kit/helpers": "0.5.0", "@dnd-kit/solid": "0.5.0", + "@ibm/plex": "6.4.1", "@kobalte/core": "catalog:", "@opencode-ai/client": "workspace:*", "@opencode-ai/schema": "workspace:*", @@ -191,7 +191,7 @@ "solid-js": "catalog:", }, "peerDependencies": { - "effect": "4.0.0-rc.110", + "effect": "4.0.0-rc.111", "solid-js": ">=1.9.0", }, "optionalPeers": [ @@ -525,7 +525,7 @@ "name": "@opencode-ai/http-recorder", "version": "1.18.15", "dependencies": { - "@effect/platform-node-shared": "4.0.0-rc.110", + "@effect/platform-node-shared": "4.0.0-rc.111", }, "devDependencies": { "@effect/platform-node": "catalog:", @@ -1078,10 +1078,10 @@ "catalog": { "@cloudflare/workers-types": "4.20251008.0", "@corvu/drawer": "0.2.4", - "@effect/opentelemetry": "4.0.0-rc.110", - "@effect/platform-node": "4.0.0-rc.110", - "@effect/platform-node-shared": "4.0.0-rc.110", - "@effect/sql-sqlite-bun": "4.0.0-rc.110", + "@effect/opentelemetry": "4.0.0-rc.111", + "@effect/platform-node": "4.0.0-rc.111", + "@effect/platform-node-shared": "4.0.0-rc.111", + "@effect/sql-sqlite-bun": "4.0.0-rc.111", "@hono/standard-validator": "0.2.0", "@hono/zod-validator": "0.4.2", "@kobalte/core": "0.13.11", @@ -1118,7 +1118,7 @@ "dompurify": "3.3.1", "drizzle-kit": "1.0.0-rc.2", "drizzle-orm": "1.0.0-rc.2", - "effect": "4.0.0-rc.110", + "effect": "4.0.0-rc.111", "fuzzysort": "3.1.0", "get-east-asian-width": "1.6.0", "hono": "4.10.7", @@ -1685,13 +1685,13 @@ "@drizzle-team/brocli": ["@drizzle-team/brocli@0.11.0", "", {}, "sha512-hD3pekGiPg0WPCCGAZmusBBJsDqGUR66Y452YgQsZOnkdQ7ViEPKuyP4huUGEZQefp8g34RRodXYmJ2TbCH+tg=="], - "@effect/opentelemetry": ["@effect/opentelemetry@4.0.0-rc.110", "", { "peerDependencies": { "@opentelemetry/api": ">=1.9.0 <2.0.0", "@opentelemetry/api-logs": ">=0.203.0 <0.300.0", "@opentelemetry/resources": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-logs": ">=0.203.0 <0.300.0", "@opentelemetry/sdk-metrics": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-base": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-node": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-web": ">=2.0.0 <3.0.0", "@opentelemetry/semantic-conventions": ">=1.33.0 <2.0.0", "effect": "^4.0.0-rc.110" }, "optionalPeers": ["@opentelemetry/api", "@opentelemetry/api-logs", "@opentelemetry/resources", "@opentelemetry/sdk-logs", "@opentelemetry/sdk-metrics", "@opentelemetry/sdk-trace-base", "@opentelemetry/sdk-trace-node", "@opentelemetry/sdk-trace-web"] }, "sha512-8Uum1ikIAK2DjATeLseS71HZKVI/dduFYypvMhiO68RTli1xq9yaoTI1Y0IThPn2sI0i86ZdpFaKQx1hdw2tWw=="], + "@effect/opentelemetry": ["@effect/opentelemetry@4.0.0-rc.111", "", { "peerDependencies": { "@opentelemetry/api": ">=1.9.0 <2.0.0", "@opentelemetry/api-logs": ">=0.203.0 <0.300.0", "@opentelemetry/resources": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-logs": ">=0.203.0 <0.300.0", "@opentelemetry/sdk-metrics": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-base": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-node": ">=2.0.0 <3.0.0", "@opentelemetry/sdk-trace-web": ">=2.0.0 <3.0.0", "@opentelemetry/semantic-conventions": ">=1.33.0 <2.0.0", "effect": "^4.0.0-rc.111" }, "optionalPeers": ["@opentelemetry/api", "@opentelemetry/api-logs", "@opentelemetry/resources", "@opentelemetry/sdk-logs", "@opentelemetry/sdk-metrics", "@opentelemetry/sdk-trace-base", "@opentelemetry/sdk-trace-node", "@opentelemetry/sdk-trace-web"] }, "sha512-bztAYpWoipn/a4tFjECMNvtWLkf2TS+Qn23PBI+f4q5DP9cBKfV00uhX8cwEVcfAtZd+lflSbGURHa4xlSewOA=="], - "@effect/platform-node": ["@effect/platform-node@4.0.0-rc.110", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-rc.110", "mime": "^4.1.0", "undici": "^8.7.0" }, "peerDependencies": { "effect": "^4.0.0-rc.110", "redis": ">=5.0.0 <7.0.0" } }, "sha512-poj6VxTc2kRDowUHgjGXAZL2nWHTyGi/18607jK+pV9A9CH/wqZ4NeYj38rij95j5SiZ3U7Y1iOsk2Vfnr4GEw=="], + "@effect/platform-node": ["@effect/platform-node@4.0.0-rc.111", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-rc.111", "mime": "^4.1.0", "undici": "^8.10.0" }, "peerDependencies": { "effect": "^4.0.0-rc.111", "redis": ">=5.0.0 <7.0.0" } }, "sha512-oy1i7HsOGg/5r+DuBe5+ddmnUhnXmyZFPFPXZCBdO/RQpHK3PIFe1/2UMGxZE+ngDymrSksuQTSgQLF6P+MLqw=="], - "@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-rc.110", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.21.0" }, "peerDependencies": { "effect": "^4.0.0-rc.110" } }, "sha512-P8EZloxS7RtCOSL3VSBPyqSenUm93xLbXf9jkWoy67cibZ2wgZ9nAou9iN8f1i4vzgxUsWtDuy6BEmg67np6Zw=="], + "@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-rc.111", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.21.3" }, "peerDependencies": { "effect": "^4.0.0-rc.111" } }, "sha512-iES0Q9vmjhaUKqeW9ceonuD45MUg/Ouk08LzRSptZ+B5qB0w9WlRjDmUz5TJmY2betNop5FRI5k4AD4mtQt3Bw=="], - "@effect/sql-sqlite-bun": ["@effect/sql-sqlite-bun@4.0.0-rc.110", "", { "peerDependencies": { "effect": "^4.0.0-rc.110" } }, "sha512-Lam3gY1xszjQS/cebdLbWbtR21FtQI4ke7QHqbBQ6AyVJF0CGUtS/ePL9zNq6wHNmJ95FUDGS6W+Qx/l6RPSzA=="], + "@effect/sql-sqlite-bun": ["@effect/sql-sqlite-bun@4.0.0-rc.111", "", { "peerDependencies": { "effect": "^4.0.0-rc.111" } }, "sha512-u5HqWLYISTH5ydsCr45nOGmkspmAeNzK4q+plMrJntDoG8sQttwizC4akGfbQDgoSxyYfyBzi3YyVW/NvhvSQQ=="], "@electron/asar": ["@electron/asar@3.4.1", "", { "dependencies": { "commander": "^5.0.0", "glob": "^7.1.6", "minimatch": "^3.0.4" }, "bin": { "asar": "bin/asar.js" } }, "sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA=="], @@ -3853,7 +3853,7 @@ "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], - "effect": ["effect@4.0.0-rc.110", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.9.0", "msgpackr": "^2.0.4" } }, "sha512-ega6FTJ8CS2of7tHZiADvgyJyV999Q6tZ9juE56V81O0jw6flRwydaPNtyfvP2a5LL9PZrse8A1jnNUD5sWVHg=="], + "effect": ["effect@4.0.0-rc.111", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.9.0", "msgpackr": "^2.0.5" } }, "sha512-ASd5L58EIR0CUNueZNKKjSsyOCd+2alxOAIaTcHaqkJkPsaYSsw5Cg/cfANk5K4Jr2YsX756xvX11shzqsreWA=="], "ejs": ["ejs@3.1.10", "", { "dependencies": { "jake": "^10.8.5" }, "bin": { "ejs": "bin/cli.js" } }, "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA=="], @@ -6173,6 +6173,8 @@ "@dot/log/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + "@effect/platform-node-shared/ws": ["ws@8.21.3", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw=="], + "@electron/asar/commander": ["commander@5.1.0", "", {}, "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg=="], "@electron/asar/glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], diff --git a/package.json b/package.json index 33b4e4ec5fd..b7c0311c124 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "packages/stats/*" ], "catalog": { - "@effect/opentelemetry": "4.0.0-rc.110", - "@effect/platform-node": "4.0.0-rc.110", - "@effect/platform-node-shared": "4.0.0-rc.110", - "@effect/sql-sqlite-bun": "4.0.0-rc.110", + "@effect/opentelemetry": "4.0.0-rc.111", + "@effect/platform-node": "4.0.0-rc.111", + "@effect/platform-node-shared": "4.0.0-rc.111", + "@effect/sql-sqlite-bun": "4.0.0-rc.111", "@npmcli/arborist": "9.4.0", "@types/bun": "1.3.13", "@types/cross-spawn": "6.0.6", @@ -73,7 +73,7 @@ "dompurify": "3.3.1", "drizzle-kit": "1.0.0-rc.2", "drizzle-orm": "1.0.0-rc.2", - "effect": "4.0.0-rc.110", + "effect": "4.0.0-rc.111", "ai": "6.0.168", "cross-spawn": "7.0.6", "hono": "4.10.7", diff --git a/packages/client/package.json b/packages/client/package.json index 3d5349f289b..259607678e1 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -37,7 +37,7 @@ "@opencode-ai/protocol": "workspace:*" }, "peerDependencies": { - "effect": "4.0.0-rc.110", + "effect": "4.0.0-rc.111", "solid-js": ">=1.9.0" }, "peerDependenciesMeta": { diff --git a/packages/client/src/promise/generated/types.ts b/packages/client/src/promise/generated/types.ts index fba66256cbd..2af0d4d96f2 100644 --- a/packages/client/src/promise/generated/types.ts +++ b/packages/client/src/promise/generated/types.ts @@ -20,6 +20,13 @@ export type SessionForkBoundary = { type: "before"; messageID: string } | { type export type MoneyUSD = number +export type TokenUsageInfo = { + input: number + output: number + reasoning: number + cache: { read: number; write: number } +} + export type LocationRef = { directory: string; workspaceID?: string } export type FileDiffInfo = { @@ -30,22 +37,105 @@ export type FileDiffInfo = { status: "added" | "deleted" | "modified" } +export type SessionMessageAgentSelected = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "agent-switched" + agent: string + previous?: string +} + export type PromptBase64 = string export type PromptFileSource = { type: "inline" } | { type: "uri"; uri: string } export type PromptMention = { start: number; end: number; text: string } +export type SessionMessageSynthetic = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + description?: string + type: "synthetic" +} + +export type SessionMessageSystem = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "system" + text: string + description?: string +} + +export type SessionMessageSkill = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "skill" + skill: string + name: string + text: string +} + +export type SessionMessageShell = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number; completed?: number } + type: "shell" + shellID: string + command: string + status: "running" | "exited" | "timeout" | "killed" + exit?: number | "Infinity" | "-Infinity" | "NaN" + output?: { output: string; cursor: number; size: number; truncated: boolean } +} + +export type SessionMessageProviderState = { [x: string]: JsonValue } + export type SessionMessageToolStateStreaming = { status: "streaming"; input: string } +export type SessionMessageToolStateRunning = { + status: "running" + input: { [x: string]: JsonValue } + metadata: { [x: string]: JsonValue } +} + export type ToolTextContent = { type: "text"; text: string } +export type ToolFileContent = { type: "file"; uri: string; mime: string; name?: string | null } + export type SessionStructuredError = { type: string; message: string; status?: number } +export type SessionMessageCompactionRunning = { + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "running" + reason: "auto" | "manual" + summary: string + recent: string +} + +export type SessionMessageCompactionCompleted = { + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "completed" + reason: "auto" | "manual" + summary: string + recent: string +} + export type SessionActive = { type: "running" } export type SessionInboxDelivery = "steer" | "queue" +export type SessionInboxSyntheticPayload = { text: string; description?: string; metadata?: { [x: string]: JsonValue } } + export type SessionInboxCompactionPayload = {} export type InstructionEntryKey = string @@ -54,6 +144,19 @@ export type SessionGenerateResponse = { data: { text: string } } export type SessionInboxSyntheticPayload1 = { text: string; description?: string; metadata?: { [x: string]: any } } +export type ShellInfo = { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: any } + time: { started: number; completed?: number } +} + export type SessionMessageProviderState1 = { [x: string]: any } export type ToolFileContent1 = { type: "file"; uri: string; mime: string; name?: string | undefined } @@ -64,10 +167,41 @@ export type ModelReasoningField = "reasoning" | "reasoning_content" | "reasoning export type ModelMaxTokensField = "max_completion_tokens" | "max_tokens" +export type ModelCapabilities = { + tools: boolean + input: Array + output: Array + responsesWebsockets?: boolean +} + +export type ModelVariant = { + id: string + settings?: { [x: string]: any } + headers?: { [x: string]: string } + body?: { [x: string]: any } +} + export type MoneyUSDPerMillionTokens = number export type GenerateTextResponse = { data: { text: string } } +export type ProviderInfo = { + id: string + integrationID?: string + name: string + activation: "auto" | "enabled" | "disabled" + package: string + settings?: { [x: string]: any } + headers?: { [x: string]: string } + body?: { [x: string]: any } +} + +export type FormWhen = { + key: string + op: "eq" | "neq" + value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean +} + export type FormOption = { value: string; label: string; description?: string } export type FormExternalField = { key: string; type: "external"; url: string; title?: string; description?: string } @@ -80,6 +214,50 @@ export type ConnectionCredentialInfo = { type: "credential"; id: string; label: export type ConnectionEnvInfo = { type: "env"; name: string } +export type IntegrationAttemptStatus = + | { + status: "pending" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + | { + status: "complete" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + | { + status: "failed" + message: string + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + | { + status: "expired" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + +export type IntegrationCommandAttempt = { + attemptID: string + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } +} + +export type IntegrationCommandAttemptStatus = + | { + status: "pending" + message?: string + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + | { + status: "complete" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + | { + status: "failed" + message: string + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + | { + status: "expired" + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } + } + export type McpStatusConnected = { status: "connected" } export type McpStatusPending = { status: "pending" } @@ -110,6 +288,8 @@ export type ProjectTime = { created: number; updated: number; initialized?: numb export type ProjectCurrent = { id: string; directory: string; canonical: string } +export type FormMetadata = { [x: string]: JsonValue } + export type FormValue = string | number | boolean | Array export type PermissionSource = { type: "tool"; messageID: string; id: string } @@ -158,6 +338,19 @@ export type SessionStatus = export type PtyTicketConnectToken = { ticket: string; expires_in: number } +export type ShellInfo1 = { + id: string + status: "running" | "exited" | "timeout" | "killed" + command: string + cwd: string + shell: string + file: string + pid?: number + exit?: number + metadata: { [x: string]: JsonValue } + time: { started: number; completed?: number } +} + export type ReferenceLocalSource = { type: "local"; path: string; description?: string; hidden?: boolean } export type ReferenceGitSource = { @@ -206,11 +399,15 @@ export type PluginInfo = | { id: string; source: PluginSource; status: "active"; tui: boolean } | { id?: string; source: PluginSource; status: "failed"; error: string; tui: boolean } -export type TokenUsageInfo = { - input: number - output: number - reasoning: number - cache: { read: number; write: number } +export type SessionMessageLocationSwitched = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "location-switched" + location: LocationRef + projectID?: string + subpath?: string + previous?: { location: LocationRef; projectID?: string; subpath?: string } } export type SessionInboxMovePayload = { location: LocationRef; projectID: string; subpath?: string } @@ -223,18 +420,17 @@ export type V2EventServerConnected = { data: {} } -export type SessionMessageProviderState = { [x: string]: JsonValue } +export type SessionRevert = { messageID: string; partID?: string; snapshot?: string; files?: Array } -export type SessionMessageToolStateRunning = { - status: "running" - input: { [x: string]: JsonValue } - metadata: { [x: string]: JsonValue } +export type SessionMessageModelSelected = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + type: "model-switched" + model: ModelRef + previous?: ModelRef } -export type SessionInboxSyntheticPayload = { text: string; description?: string; metadata?: { [x: string]: JsonValue } } - -export type FormMetadata = { [x: string]: JsonValue } - export type PromptFileAttachment = { data: PromptBase64 mime: string @@ -248,10 +444,38 @@ export type PromptAgentAttachment = { name: string; mention?: PromptMention } export type PromptSkillAttachment = { id: string; name: string; mention?: PromptMention } -export type ToolFileContent = { type: "file"; uri: string; mime: string; name?: string | null } +export type SessionMessageAssistantText = { type: "text"; text: string; state?: SessionMessageProviderState } + +export type SessionMessageAssistantReasoning = { + type: "reasoning" + text: string + state?: SessionMessageProviderState + time?: { created: number; completed?: number } +} + +export type ToolContent = ToolTextContent | ToolFileContent export type SessionMessageAssistantRetry = { attempt: number; at: number; error: SessionStructuredError } +export type SessionMessageCompactionFailed = { + type: "compaction" + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + status: "failed" + reason: "auto" | "manual" + error: SessionStructuredError +} + +export type SessionInboxSynthetic = { + id: string + sessionID: string + timeCreated: number + type: "synthetic" + payload: SessionInboxSyntheticPayload + delivery: SessionInboxDelivery +} + export type SessionInboxCompaction = { id: string sessionID: string @@ -496,6 +720,36 @@ export type SessionRetryScheduled = { data: { sessionID: string; assistantMessageID: string; attempt: number; at: number; error: SessionStructuredError } } +export type SessionCompactionStarted = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.compaction.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; reason: "auto" | "manual"; recent: string; inputID?: string } +} + +export type SessionCompactionEnded = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.compaction.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; reason: "auto" | "manual"; text: string; recent: string } +} + +export type SessionCompactionFailed = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.compaction.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; reason: "auto" | "manual"; error: SessionStructuredError; inputID?: string } +} + export type SessionRevertCleared = { id: string created: number @@ -516,6 +770,16 @@ export type SessionRevertCommitted = { data: { sessionID: string; to: string } } +export type SessionUsageRecorded = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.usage.recorded" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; source: "title" | "compaction"; cost: MoneyUSD; tokens: TokenUsageInfo } +} + export type ModelsDevRefreshed = { id: string created: number @@ -561,6 +825,15 @@ export type AgentUpdated = { data: {} } +export type SessionUsageUpdated = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.usage.updated" + location?: LocationRef + data: { sessionID: string; cost: MoneyUSD; tokens: TokenUsageInfo } +} + export type SessionTextDelta = { id: string created: number @@ -857,30 +1130,78 @@ export type McpResourcesChanged = { data: { server: string } } -export type ShellInfo = { +export type SessionShellStarted = { id: string - status: "running" | "exited" | "timeout" | "killed" - command: string - cwd: string - shell: string - file: string - pid?: number - exit?: number - metadata: { [x: string]: any } - time: { started: number; completed?: number } + created: number + metadata?: { [x: string]: any } + type: "session.shell.started" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; shell: ShellInfo } } -export type ShellInfo1 = { +export type SessionShellEnded = { id: string - status: "running" | "exited" | "timeout" | "killed" - command: string - cwd: string - shell: string - file: string - pid?: number - exit?: number - metadata: { [x: string]: JsonValue } - time: { started: number; completed?: number } + created: number + metadata?: { [x: string]: any } + type: "session.shell.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { + sessionID: string + shell: ShellInfo + output: { output: string; cursor: number; size: number; truncated: boolean } + } +} + +export type ShellCreated = { + id: string + created: number + metadata?: { [x: string]: any } + type: "shell.created" + location?: LocationRef + data: { info: ShellInfo } +} + +export type SessionStepEnded = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.step.ended" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { + sessionID: string + assistantMessageID: string + finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" + rawFinish?: string + providerState?: SessionMessageProviderState1 + cost: MoneyUSD + tokens: TokenUsageInfo + snapshot?: string + files?: Array + } +} + +export type SessionStepFailed = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.step.failed" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { + sessionID: string + assistantMessageID: string + error: SessionStructuredError + finish?: "content-filter" + rawFinish?: string + providerState?: SessionMessageProviderState1 + cost?: MoneyUSD + tokens?: TokenUsageInfo + snapshot?: string + files?: Array + } } export type SessionTextEnded = { @@ -944,67 +1265,12 @@ export type SessionToolCalled = { export type ToolContent1 = ToolTextContent | ToolFileContent1 -export type SessionCompactionStarted = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.compaction.started" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; reason: "auto" | "manual"; recent: string; inputID?: string } -} - -export type SessionCompactionEnded = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.compaction.ended" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; reason: "auto" | "manual"; text: string; recent: string } -} - -export type SessionCompactionFailed = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.compaction.failed" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; reason: "auto" | "manual"; error: SessionStructuredError; inputID?: string } -} - export type ModelCompatibility = { reasoningField?: ModelReasoningField maxTokensField?: ModelMaxTokensField requireFinishReason?: boolean } -export type ModelVariant = { - id: string - settings?: { [x: string]: any } - headers?: { [x: string]: string } - body?: { [x: string]: any } -} - -export type ProviderInfo = { - id: string - integrationID?: string - name: string - activation: "auto" | "enabled" | "disabled" - package: string - settings?: { [x: string]: any } - headers?: { [x: string]: string } - body?: { [x: string]: any } -} - -export type ModelCapabilities = { - tools: boolean - input: Array - output: Array - responsesWebsockets?: boolean -} - export type ModelCost = { tier?: { type: "context"; size: number } input: MoneyUSDPerMillionTokens @@ -1012,6 +1278,71 @@ export type ModelCost = { cache: { read: MoneyUSDPerMillionTokens; write: MoneyUSDPerMillionTokens } } +export type FormNumberField = { + key: string + title?: string + description?: string + required?: boolean + when?: Array + type: "number" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" +} + +export type FormIntegerField = { + key: string + title?: string + description?: string + required?: boolean + when?: Array + type: "integer" + minimum?: number | "Infinity" | "-Infinity" | "NaN" + maximum?: number | "Infinity" | "-Infinity" | "NaN" + default?: number | "Infinity" | "-Infinity" | "NaN" +} + +export type FormBooleanField = { + key: string + title?: string + description?: string + required?: boolean + when?: Array + type: "boolean" + default?: boolean +} + +export type FormStringField = { + key: string + title?: string + description?: string + required?: boolean + when?: Array + type: "string" + format?: "email" | "uri" | "date" | "date-time" + minLength?: number + maxLength?: number + pattern?: string + placeholder?: string + default?: string + options?: Array + custom?: boolean +} + +export type FormMultiselectField = { + key: string + title?: string + description?: string + required?: boolean + when?: Array + type: "multiselect" + options: Array + minItems?: number + maxItems?: number + custom?: boolean + default?: Array +} + export type ConnectionInfo = ConnectionCredentialInfo | ConnectionEnvInfo export type McpServer = { @@ -1089,338 +1420,6 @@ export type PtyUpdated = { data: { info: Pty } } -export type SessionStatusUpdated = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.status" - location?: LocationRef - data: { sessionID: string; status: SessionStatus } -} - -export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource - -export type WorktreeList = Array - -export type VcsInfo = { branch: VcsBranch } - -export type PermissionRuleset = Array - -export type SessionStepEnded = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.step.ended" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown" - rawFinish?: string - providerState?: SessionMessageProviderState1 - cost: MoneyUSD - tokens: TokenUsageInfo - snapshot?: string - files?: Array - } -} - -export type SessionUsageRecorded = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.usage.recorded" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; source: "title" | "compaction"; cost: MoneyUSD; tokens: TokenUsageInfo } -} - -export type SessionUsageUpdated = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.usage.updated" - location?: LocationRef - data: { sessionID: string; cost: MoneyUSD; tokens: TokenUsageInfo } -} - -export type SessionStepFailed = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.step.failed" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - error: SessionStructuredError - finish?: "content-filter" - rawFinish?: string - providerState?: SessionMessageProviderState1 - cost?: MoneyUSD - tokens?: TokenUsageInfo - snapshot?: string - files?: Array - } -} - -export type SessionInboxMove = { - id: string - sessionID: string - timeCreated: number - type: "move" - payload: SessionInboxMovePayload - delivery: SessionInboxDelivery -} - -export type SessionRevert = { messageID: string; partID?: string; snapshot?: string; files?: Array } - -export type SessionMessageAgentSelected = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - type: "agent-switched" - agent: string - previous?: string -} - -export type SessionMessageModelSelected = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - type: "model-switched" - model: ModelRef - previous?: ModelRef -} - -export type SessionMessageLocationSwitched = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - type: "location-switched" - location: LocationRef - projectID?: string - subpath?: string - previous?: { location: LocationRef; projectID?: string; subpath?: string } -} - -export type SessionMessageSynthetic = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - text: string - description?: string - type: "synthetic" -} - -export type SessionMessageSystem = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - type: "system" - text: string - description?: string -} - -export type SessionMessageSkill = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - type: "skill" - skill: string - name: string - text: string -} - -export type SessionMessageShell = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number; completed?: number } - type: "shell" - shellID: string - command: string - status: "running" | "exited" | "timeout" | "killed" - exit?: number | ("Infinity" | "-Infinity" | "NaN") - output?: { output: string; cursor: number; size: number; truncated: boolean } -} - -export type SessionMessageCompactionRunning = { - type: "compaction" - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - status: "running" - reason: "auto" | "manual" - summary: string - recent: string -} - -export type SessionMessageCompactionCompleted = { - type: "compaction" - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - status: "completed" - reason: "auto" | "manual" - summary: string - recent: string -} - -export type SessionMessageCompactionFailed = { - type: "compaction" - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - status: "failed" - reason: "auto" | "manual" - error: SessionStructuredError -} - -export type SessionMessageAssistantText = { type: "text"; text: string; state?: SessionMessageProviderState } - -export type SessionMessageAssistantReasoning = { - type: "reasoning" - text: string - state?: SessionMessageProviderState - time?: { created: number; completed?: number } -} - -export type SessionInboxSynthetic = { - id: string - sessionID: string - timeCreated: number - type: "synthetic" - payload: SessionInboxSyntheticPayload - delivery: SessionInboxDelivery -} - -export type FormWhen = { - key: string - op: "eq" | "neq" - value: string | (number | ("Infinity" | "-Infinity" | "NaN")) | boolean -} - -export type ToolContent = ToolTextContent | ToolFileContent - -export type SessionForked = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.forked" - durable: { aggregateID: string; seq: number; version: 2 } - location?: LocationRef - data: { - sessionID: string - parentID: string - boundary: SessionForkBoundary - instructions?: { [x: string]: string } - instructionEntries?: InstructionEntrySnapshot - } -} - -export type SessionShellStarted = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.shell.started" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; shell: ShellInfo } -} - -export type SessionShellEnded = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.shell.ended" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { - sessionID: string - shell: ShellInfo - output: { output: string; cursor: number; size: number; truncated: boolean } - } -} - -export type ShellCreated = { - id: string - created: number - metadata?: { [x: string]: any } - type: "shell.created" - location?: LocationRef - data: { info: ShellInfo } -} - -export type SessionToolSuccess = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.tool.success" - durable: { aggregateID: string; seq: number; version: 2 } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - id: string - content: [ToolContent1, ...Array] - metadata?: { [x: string]: JsonValue } - executed: boolean - resultState?: SessionMessageProviderState1 - } -} - -export type SessionToolFailed = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.tool.failed" - durable: { aggregateID: string; seq: number; version: 2 } - location?: LocationRef - data: { - sessionID: string - assistantMessageID: string - id: string - error: SessionStructuredError - content?: [ToolContent1, ...Array] - metadata?: { [x: string]: JsonValue } - executed: boolean - resultState?: SessionMessageProviderState1 - } -} - -export type ModelInfo = { - id: string - modelID: string - providerID: string - family?: string - name: string - compatibility?: ModelCompatibility - package?: string - settings?: { [x: string]: any } - headers?: { [x: string]: string } - body?: { [x: string]: any } - capabilities: ModelCapabilities - variants: Array - time: { released: number } - cost: Array - status: "alpha" | "beta" | "deprecated" | "active" - enabled: boolean - limit: { context: number; input?: number; output: number } -} - -export type FormState = { status: "pending" } | { status: "answered"; answer: FormAnswer } | { status: "cancelled" } - -export type FormReplied = { - id: string - created: number - metadata?: { [x: string]: any } - type: "form.replied" - location?: LocationRef - data: { id: string; sessionID: string; answer: FormAnswer } -} - export type FormStringField1 = { key: string title?: string @@ -1486,6 +1485,206 @@ export type FormMultiselectField1 = { default?: Array } +export type SessionStatusUpdated = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.status" + location?: LocationRef + data: { sessionID: string; status: SessionStatus } +} + +export type ReferenceSource = ReferenceLocalSource | ReferenceGitSource + +export type WorktreeList = Array + +export type VcsInfo = { branch: VcsBranch } + +export type PermissionRuleset = Array + +export type SessionInboxMove = { + id: string + sessionID: string + timeCreated: number + type: "move" + payload: SessionInboxMovePayload + delivery: SessionInboxDelivery +} + +export type SessionInfo = { + id: string + parentID?: string + fork?: { sessionID: string; boundary: SessionForkBoundary } + projectID: string + agent?: string + model?: ModelRef + cost: MoneyUSD + tokens: TokenUsageInfo + outcome?: "succeeded" | "failed" | "interrupted" + time: { created: number; updated: number; idle?: number; viewed?: number; archived?: number } + title?: string + location: LocationRef + subpath?: string + revert?: SessionRevert +} + +export type SessionRevertStaged = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.revert.staged" + durable: { aggregateID: string; seq: number; version: 1 } + location?: LocationRef + data: { sessionID: string; revert: SessionRevert } +} + +export type SessionMessageUser = { + id: string + metadata?: { [x: string]: JsonValue } + time: { created: number } + text: string + files?: Array + agents?: Array + skills?: Array + type: "user" +} + +export type SessionInboxUserPayload = { + text: string + files?: Array + agents?: Array + skills?: Array + metadata?: { [x: string]: JsonValue } +} + +export type SessionInboxUserPayload1 = { + text: string + files?: Array + agents?: Array + skills?: Array + metadata?: { [x: string]: any } +} + +export type SessionMessageToolStateCompleted = { + status: "completed" + input: { [x: string]: JsonValue } + content: [ToolContent, ...Array] + metadata?: { [x: string]: JsonValue } +} + +export type SessionMessageToolStateError = { + status: "error" + input: { [x: string]: JsonValue } + error: SessionStructuredError + content?: [ToolContent, ...Array] + metadata?: { [x: string]: JsonValue } +} + +export type SessionMessageCompaction = + | SessionMessageCompactionRunning + | SessionMessageCompactionCompleted + | SessionMessageCompactionFailed + +export type SessionForked = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.forked" + durable: { aggregateID: string; seq: number; version: 2 } + location?: LocationRef + data: { + sessionID: string + parentID: string + boundary: SessionForkBoundary + instructions?: { [x: string]: string } + instructionEntries?: InstructionEntrySnapshot + } +} + +export type SessionToolSuccess = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.tool.success" + durable: { aggregateID: string; seq: number; version: 2 } + location?: LocationRef + data: { + sessionID: string + assistantMessageID: string + id: string + content: [ToolContent1, ...Array] + metadata?: { [x: string]: JsonValue } + executed: boolean + resultState?: SessionMessageProviderState1 + } +} + +export type SessionToolFailed = { + id: string + created: number + metadata?: { [x: string]: any } + type: "session.tool.failed" + durable: { aggregateID: string; seq: number; version: 2 } + location?: LocationRef + data: { + sessionID: string + assistantMessageID: string + id: string + error: SessionStructuredError + content?: [ToolContent1, ...Array] + metadata?: { [x: string]: JsonValue } + executed: boolean + resultState?: SessionMessageProviderState1 + } +} + +export type ModelInfo = { + id: string + modelID: string + providerID: string + family?: string + name: string + compatibility?: ModelCompatibility + package?: string + settings?: { [x: string]: any } + headers?: { [x: string]: string } + body?: { [x: string]: any } + capabilities: ModelCapabilities + variants: Array + time: { released: number } + cost: Array + status: "alpha" | "beta" | "deprecated" | "active" + enabled: boolean + limit: { context: number; input?: number; output: number } +} + +export type FormField = + | FormStringField + | FormNumberField + | FormIntegerField + | FormBooleanField + | FormMultiselectField + | FormExternalField + +export type FormState = { status: "pending" } | { status: "answered"; answer: FormAnswer } | { status: "cancelled" } + +export type FormReplied = { + id: string + created: number + metadata?: { [x: string]: any } + type: "form.replied" + location?: LocationRef + data: { id: string; sessionID: string; answer: FormAnswer } +} + +export type FormField1 = + | FormStringField1 + | FormNumberField1 + | FormIntegerField1 + | FormBooleanField1 + | FormMultiselectField1 + | FormExternalField + export type ReferenceInfo = { name: string path: string @@ -1673,156 +1872,6 @@ export type ConfigEntry = | { type: "agents"; path: string } | { type: "claude"; path: string } -export type SessionInfo = { - id: string - parentID?: string - fork?: { sessionID: string; boundary: SessionForkBoundary } - projectID: string - agent?: string - model?: ModelRef - cost: MoneyUSD - tokens: TokenUsageInfo - outcome?: "succeeded" | "failed" | "interrupted" - time: { created: number; updated: number; idle?: number; viewed?: number; archived?: number } - title?: string - location: LocationRef - subpath?: string - revert?: SessionRevert -} - -export type SessionRevertStaged = { - id: string - created: number - metadata?: { [x: string]: any } - type: "session.revert.staged" - durable: { aggregateID: string; seq: number; version: 1 } - location?: LocationRef - data: { sessionID: string; revert: SessionRevert } -} - -export type SessionMessageCompaction = - | SessionMessageCompactionRunning - | SessionMessageCompactionCompleted - | SessionMessageCompactionFailed - -export type SessionMessageUser = { - id: string - metadata?: { [x: string]: JsonValue } - time: { created: number } - text: string - files?: Array - agents?: Array - skills?: Array - type: "user" -} - -export type SessionInboxUserPayload = { - text: string - files?: Array - agents?: Array - skills?: Array - metadata?: { [x: string]: JsonValue } -} - -export type SessionInboxUserPayload1 = { - text: string - files?: Array - agents?: Array - skills?: Array - metadata?: { [x: string]: any } -} - -export type IntegrationAttemptStatus = - | { - status: "pending" - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - | { - status: "complete" - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - | { - status: "failed" - message: string - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - | { - status: "expired" - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - -export type IntegrationCommandAttempt = { - attemptID: string - time: { created: number | ("Infinity" | "-Infinity" | "NaN"); expires: number | ("Infinity" | "-Infinity" | "NaN") } -} - -export type IntegrationCommandAttemptStatus = - | { - status: "pending" - message?: string - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - | { - status: "complete" - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - | { - status: "failed" - message: string - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - | { - status: "expired" - time: { - created: number | ("Infinity" | "-Infinity" | "NaN") - expires: number | ("Infinity" | "-Infinity" | "NaN") - } - } - -export type SessionMessageToolStateCompleted = { - status: "completed" - input: { [x: string]: JsonValue } - content: [ToolContent, ...Array] - metadata?: { [x: string]: JsonValue } -} - -export type SessionMessageToolStateError = { - status: "error" - input: { [x: string]: JsonValue } - error: SessionStructuredError - content?: [ToolContent, ...Array] - metadata?: { [x: string]: JsonValue } -} - -export type FormField1 = - | FormStringField1 - | FormNumberField1 - | FormIntegerField1 - | FormBooleanField1 - | FormMultiselectField1 - | FormExternalField - export type SessionsResponse = { data: Array; cursor: { previous?: string | null; next?: string | null } } export type SessionInboxUser = { @@ -1840,71 +1889,6 @@ export type SessionInboxItem = | { type: "compaction"; payload: SessionInboxCompactionPayload; delivery: SessionInboxDelivery } | { type: "move"; payload: SessionInboxMovePayload; delivery: SessionInboxDelivery } -export type FormStringField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "string" - format?: "email" | "uri" | "date" | "date-time" - minLength?: number - maxLength?: number - pattern?: string - placeholder?: string - default?: string - options?: Array - custom?: boolean -} - -export type FormNumberField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "number" - minimum?: number | ("Infinity" | "-Infinity" | "NaN") - maximum?: number | ("Infinity" | "-Infinity" | "NaN") - default?: number | ("Infinity" | "-Infinity" | "NaN") -} - -export type FormIntegerField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "integer" - minimum?: number | ("Infinity" | "-Infinity" | "NaN") - maximum?: number | ("Infinity" | "-Infinity" | "NaN") - default?: number | ("Infinity" | "-Infinity" | "NaN") -} - -export type FormBooleanField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "boolean" - default?: boolean -} - -export type FormMultiselectField = { - key: string - title?: string - description?: string - required?: boolean - when?: Array - type: "multiselect" - options: Array - minItems?: number - maxItems?: number - custom?: boolean - default?: Array -} - export type SessionMessageAssistantTool = { type: "tool" id: string @@ -1920,6 +1904,8 @@ export type SessionMessageAssistantTool = { time: { created: number; ran?: number; completed?: number } } +export type FormFields = [FormField, ...Array] + export type FormFields2 = [FormField1, ...Array] export type SessionInboxInfo = SessionInboxUser | SessionInboxSynthetic | SessionInboxCompaction | SessionInboxMove @@ -1934,14 +1920,6 @@ export type SessionInboxEnqueued = { data: { sessionID: string; inboxID: string; item: SessionInboxItem } } -export type FormField = - | FormStringField - | FormNumberField - | FormIntegerField - | FormBooleanField - | FormMultiselectField - | FormExternalField - export type SessionMessageAssistant = { id: string metadata?: { [x: string]: JsonValue } @@ -1960,6 +1938,12 @@ export type SessionMessageAssistant = { retry?: SessionMessageAssistantRetry } +export type IntegrationOAuthMethod = { id: string; type: "oauth"; label: string; form?: FormFields } + +export type IntegrationKeyMethod = { type: "key"; label?: string; form?: FormFields } + +export type FormInfo = { id: string; sessionID: string; title: string; metadata?: FormMetadata; fields: FormFields } + export type FormInfo1 = { id: string; sessionID: string; title: string; metadata?: FormMetadata1; fields: FormFields2 } export type SessionEventDurable = @@ -2005,8 +1989,6 @@ export type SessionEventDurable = | SessionRevertCommitted | SessionUsageRecorded -export type FormFields = [FormField, ...Array] - export type SessionMessageInfo = | SessionMessageAgentSelected | SessionMessageModelSelected @@ -2019,6 +2001,12 @@ export type SessionMessageInfo = | SessionMessageAssistant | SessionMessageCompaction +export type IntegrationMethod = + | IntegrationOAuthMethod + | IntegrationCommandMethod + | IntegrationKeyMethod + | IntegrationEnvMethod + export type FormCreated = { id: string created: number @@ -2030,12 +2018,6 @@ export type FormCreated = { export type SessionLogItem = SessionEventDurable | EventLogSynced -export type IntegrationOAuthMethod = { id: string; type: "oauth"; label: string; form?: FormFields } - -export type IntegrationKeyMethod = { type: "key"; label?: string; form?: FormFields } - -export type FormInfo = { id: string; sessionID: string; title: string; metadata?: FormMetadata; fields: FormFields } - export type SessionTransferData = { info: SessionInfo; messages: Array } export type SessionMessagesResponse = { @@ -2043,6 +2025,13 @@ export type SessionMessagesResponse = { cursor: { previous?: string | null; next?: string | null } } +export type IntegrationInfo = { + id: string + name: string + methods: Array + connections: Array +} + export type V2Event = | ModelsDevRefreshed | IntegrationUpdated @@ -2130,19 +2119,6 @@ export type V2Event = | McpResourcesChanged | V2EventServerConnected -export type IntegrationMethod = - | IntegrationOAuthMethod - | IntegrationCommandMethod - | IntegrationKeyMethod - | IntegrationEnvMethod - -export type IntegrationInfo = { - id: string - name: string - methods: Array - connections: Array -} - export type UnauthorizedError = { readonly _tag: "UnauthorizedError"; readonly message: string } export const isUnauthorizedError = (value: unknown): value is UnauthorizedError => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnauthorizedError" @@ -4196,7 +4172,7 @@ export type IntegrationOauthConnectOutput = { url: string instructions: string mode: "auto" | "code" - time: { created: number | ("Infinity" | "-Infinity" | "NaN"); expires: number | ("Infinity" | "-Infinity" | "NaN") } + time: { created: number | "Infinity" | "-Infinity" | "NaN"; expires: number | "Infinity" | "-Infinity" | "NaN" } } } @@ -4418,7 +4394,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -4442,12 +4418,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4457,12 +4433,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4472,7 +4448,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -4485,7 +4461,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -4515,7 +4491,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -4539,12 +4515,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4554,12 +4530,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4569,7 +4545,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -4582,7 +4558,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -4619,7 +4595,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -4643,12 +4619,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4658,12 +4634,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4673,7 +4649,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -4686,7 +4662,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -4716,7 +4692,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -4740,12 +4716,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4755,12 +4731,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4770,7 +4746,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -4783,7 +4759,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -4820,7 +4796,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -4844,12 +4820,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4859,12 +4835,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4874,7 +4850,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -4887,7 +4863,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -4917,7 +4893,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -4941,12 +4917,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4956,12 +4932,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -4971,7 +4947,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -4984,7 +4960,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -5021,7 +4997,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -5045,12 +5021,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -5060,12 +5036,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -5075,7 +5051,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -5088,7 +5064,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ @@ -5118,7 +5094,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "string" readonly format?: "email" | "uri" | "date" | "date-time" @@ -5142,12 +5118,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "number" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -5157,12 +5133,12 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "integer" - readonly minimum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly maximum?: number | ("Infinity" | "-Infinity" | "NaN") - readonly default?: number | ("Infinity" | "-Infinity" | "NaN") + readonly minimum?: number | "Infinity" | "-Infinity" | "NaN" + readonly maximum?: number | "Infinity" | "-Infinity" | "NaN" + readonly default?: number | "Infinity" | "-Infinity" | "NaN" } | { readonly key: string @@ -5172,7 +5148,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "boolean" readonly default?: boolean @@ -5185,7 +5161,7 @@ export type FormCreateInput = { readonly when?: ReadonlyArray<{ readonly key: string readonly op: "eq" | "neq" - readonly value: string | number | ("Infinity" | "-Infinity" | "NaN") | boolean + readonly value: string | number | "Infinity" | "-Infinity" | "NaN" | boolean }> readonly type: "multiselect" readonly options: ReadonlyArray<{ diff --git a/packages/core/src/session/run-coordinator.ts b/packages/core/src/session/run-coordinator.ts index 548e715879b..a76fe05e552 100644 --- a/packages/core/src/session/run-coordinator.ts +++ b/packages/core/src/session/run-coordinator.ts @@ -30,13 +30,7 @@ export interface Coordinator { * with this execution's exit. */ type Execution = { - /** - * Resolves with the execution's exit as a success value. Success-valued on purpose: - * completing a Deferred with an interrupted exit interrupts suspended waiters as it - * resumes them, and can starve later waiters of their resume entirely - * (Effect-TS/effect#7364). Joiners flatten the exit; idleness waiters just await. - */ - readonly done: Deferred.Deferred> + readonly done: Deferred.Deferred owner?: Fiber.Fiber scope: Promotable pendingWake?: Promotable @@ -84,7 +78,7 @@ export const make = (options: { const start = (key: Key, force: boolean, scope: Promotable) => { const execution: Execution = { - done: Deferred.makeUnsafe>(), + done: Deferred.makeUnsafe(), scope, stopping: false, } @@ -114,7 +108,7 @@ export const make = (options: { const settle = (key: Key, execution: Execution, exit: Exit.Exit) => { if (execution.pendingWake) start(key, false, execution.pendingWake) else executions.delete(key) - Deferred.doneUnsafe(execution.done, Exit.succeed(exit)) + Deferred.doneUnsafe(execution.done, exit) } const run = (key: Key): Effect.Effect => @@ -122,10 +116,11 @@ export const make = (options: { const execution = executions.get(key) if (execution !== undefined) { // A stopping execution refuses joiners: wait out its cleanup, then run fresh. - if (execution.stopping) return Deferred.await(execution.done).pipe(Effect.andThen(run(key))) - return Deferred.await(execution.done).pipe(Effect.flatten) + if (execution.stopping) + return Deferred.await(execution.done).pipe(Effect.ignoreCause, Effect.andThen(run(key))) + return Deferred.await(execution.done) } - return Deferred.await(start(key, true, "input").done).pipe(Effect.flatten) + return Deferred.await(start(key, true, "input").done) }) const wake = (key: Key, scope: Promotable = "input") => @@ -167,7 +162,7 @@ export const make = (options: { Effect.suspend(() => { const execution = executions.get(key) if (execution === undefined) return Effect.void - return Deferred.await(execution.done).pipe(Effect.andThen(awaitIdle(key))) + return Deferred.await(execution.done).pipe(Effect.ignoreCause, Effect.andThen(awaitIdle(key))) }) return { active: Effect.sync(() => new Set(executions.keys())), run, wake, interrupt, awaitIdle } diff --git a/packages/core/test/session-run-coordinator.test.ts b/packages/core/test/session-run-coordinator.test.ts index 415de1185ba..abcc00715fb 100644 --- a/packages/core/test/session-run-coordinator.test.ts +++ b/packages/core/test/session-run-coordinator.test.ts @@ -309,14 +309,20 @@ describe("SessionRunCoordinator", () => { settled: (_key, _exit, reason) => Effect.sync(() => void reasons.push(reason)), }) - const resumed = yield* coordinator.run("session").pipe(Effect.forkChild) + const first = yield* coordinator.run("session").pipe(Effect.forkChild) yield* Deferred.await(started) + const second = yield* coordinator.run("session").pipe(Effect.forkChild) + const idle = yield* coordinator.awaitIdle("session").pipe(Effect.forkChild) + yield* Effect.yieldNow yield* coordinator.wake("session") yield* coordinator.interrupt("session", "user") yield* Deferred.await(interrupted) - const exit = yield* Fiber.await(resumed) - expect(Exit.isFailure(exit) && Cause.hasInterruptsOnly(exit.cause)).toBeTrue() + const exits = yield* Fiber.awaitAll([first, second, idle]) + expect( + exits.slice(0, 2).every((exit) => Exit.isFailure(exit) && Cause.hasInterruptsOnly(exit.cause)), + ).toBeTrue() + expect(exits.slice(2).every(Exit.isSuccess)).toBeTrue() expect(Array.from(yield* coordinator.active)).toEqual([]) expect(runs).toBe(1) expect(reasons).toEqual(["user"]) diff --git a/packages/core/test/tool-schema.test.ts b/packages/core/test/tool-schema.test.ts index a24e03b4613..bf9c9689090 100644 --- a/packages/core/test/tool-schema.test.ts +++ b/packages/core/test/tool-schema.test.ts @@ -47,7 +47,7 @@ test("Effect tool schemas use exact optional keys and flatten compatible constra type: "object", properties: { offset: { type: "integer", minimum: 0 }, - code: { type: "string", allOf: [{ pattern: "^a" }, { pattern: "z$" }] }, + code: { type: "string", pattern: "^a", allOf: [{ pattern: "z$" }] }, }, required: ["code"], additionalProperties: false, diff --git a/packages/desktop/src/main/ipc-transport.ts b/packages/desktop/src/main/ipc-transport.ts index eae96a5f253..112bc90eedb 100644 --- a/packages/desktop/src/main/ipc-transport.ts +++ b/packages/desktop/src/main/ipc-transport.ts @@ -106,6 +106,7 @@ export const IpcServerProtocolLive = Layer.unwrap( supportsAck: true, supportsTransferables: false, supportsSpanPropagation: false, + supportsNotifications: true, } }), ), diff --git a/packages/http-recorder/package.json b/packages/http-recorder/package.json index 799f7c196f6..7e530bf0ae2 100644 --- a/packages/http-recorder/package.json +++ b/packages/http-recorder/package.json @@ -52,7 +52,7 @@ "typescript": "catalog:" }, "dependencies": { - "@effect/platform-node-shared": "4.0.0-rc.110" + "@effect/platform-node-shared": "4.0.0-rc.111" }, "peerDependencies": { "effect": "catalog:"