fix(client): loosen opaque promise outputs

This commit is contained in:
Dax Raad 2026-07-11 16:36:49 -04:00
commit 1956497f42
3 changed files with 135 additions and 114 deletions

View file

@ -130,7 +130,7 @@ export type SessionMessageCompactionCompleted = {
export type InstructionEntryKey = string export type InstructionEntryKey = string
export type SessionPendingSyntheticData1 = { text: string; description?: string; metadata?: { [x: string]: JsonValue } } export type SessionPendingSyntheticData1 = { text: string; description?: string; metadata?: { [x: string]: any } }
export type ShellInfo = { export type ShellInfo = {
id: string id: string
@ -141,19 +141,19 @@ export type ShellInfo = {
file: string file: string
pid?: number pid?: number
exit?: number exit?: number
metadata: { [x: string]: JsonValue } metadata: { [x: string]: any }
time: { started: number; completed?: number } time: { started: number; completed?: number }
} }
export type SessionMessageProviderState3 = { [x: string]: JsonValue } export type SessionMessageProviderState3 = { [x: string]: any }
export type SessionMessageProviderState4 = { [x: string]: JsonValue } export type SessionMessageProviderState4 = { [x: string]: any }
export type SessionMessageProviderState5 = { [x: string]: JsonValue } export type SessionMessageProviderState5 = { [x: string]: any }
export type SessionMessageProviderState6 = { [x: string]: JsonValue } export type SessionMessageProviderState6 = { [x: string]: any }
export type SessionMessageProviderState7 = { [x: string]: JsonValue } export type SessionMessageProviderState7 = { [x: string]: any }
export type EventLogSynced = { type: "log.synced"; aggregateID: string; seq?: number } export type EventLogSynced = { type: "log.synced"; aggregateID: string; seq?: number }
@ -445,7 +445,7 @@ export type QuestionV2Tool = { messageID: string; callID: string }
export type QuestionV2Answer = Array<string> export type QuestionV2Answer = Array<string>
export type FormMetadata1 = { [x: string]: JsonValue } export type FormMetadata1 = { [x: string]: any }
export type FormWhen1 = { key: string; op: "eq" | "neq"; value: string | number | boolean } export type FormWhen1 = { key: string; op: "eq" | "neq"; value: string | number | boolean }
@ -527,7 +527,7 @@ export type PermissionV2Rule = { action: string; resource: string; effect: Permi
export type SessionAgentSelected = { export type SessionAgentSelected = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.agent.selected" type: "session.agent.selected"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -537,7 +537,7 @@ export type SessionAgentSelected = {
export type SessionModelSelected = { export type SessionModelSelected = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.model.selected" type: "session.model.selected"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -547,7 +547,7 @@ export type SessionModelSelected = {
export type SessionMoved = { export type SessionMoved = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.moved" type: "session.moved"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -557,7 +557,7 @@ export type SessionMoved = {
export type SessionRenamed = { export type SessionRenamed = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.renamed" type: "session.renamed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -567,7 +567,7 @@ export type SessionRenamed = {
export type SessionDeleted = { export type SessionDeleted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.deleted" type: "session.deleted"
durable: { aggregateID: string; seq: number; version: 2 } durable: { aggregateID: string; seq: number; version: 2 }
location?: LocationRef location?: LocationRef
@ -577,7 +577,7 @@ export type SessionDeleted = {
export type SessionForked = { export type SessionForked = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.forked" type: "session.forked"
durable: { aggregateID: string; seq: number; version: 2 } durable: { aggregateID: string; seq: number; version: 2 }
location?: LocationRef location?: LocationRef
@ -587,7 +587,7 @@ export type SessionForked = {
export type SessionInputPromoted = { export type SessionInputPromoted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.input.promoted" type: "session.input.promoted"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -597,7 +597,7 @@ export type SessionInputPromoted = {
export type SessionExecutionStarted = { export type SessionExecutionStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.execution.started" type: "session.execution.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -607,7 +607,7 @@ export type SessionExecutionStarted = {
export type SessionExecutionSucceeded = { export type SessionExecutionSucceeded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.execution.succeeded" type: "session.execution.succeeded"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -617,7 +617,7 @@ export type SessionExecutionSucceeded = {
export type SessionExecutionInterrupted = { export type SessionExecutionInterrupted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.execution.interrupted" type: "session.execution.interrupted"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -627,7 +627,7 @@ export type SessionExecutionInterrupted = {
export type SessionInstructionsUpdated = { export type SessionInstructionsUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.instructions.updated" type: "session.instructions.updated"
durable: { aggregateID: string; seq: number; version: 2 } durable: { aggregateID: string; seq: number; version: 2 }
location?: LocationRef location?: LocationRef
@ -637,17 +637,17 @@ export type SessionInstructionsUpdated = {
export type SessionSynthetic = { export type SessionSynthetic = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.synthetic" type: "session.synthetic"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
data: { sessionID: string; text: string; description?: string; metadata?: { [x: string]: JsonValue } } data: { sessionID: string; text: string; description?: string; metadata?: { [x: string]: any } }
} }
export type SessionSkillActivated = { export type SessionSkillActivated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.skill.activated" type: "session.skill.activated"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -657,7 +657,7 @@ export type SessionSkillActivated = {
export type SessionStepStarted = { export type SessionStepStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.step.started" type: "session.step.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -667,7 +667,7 @@ export type SessionStepStarted = {
export type SessionStepEnded = { export type SessionStepEnded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.step.ended" type: "session.step.ended"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -685,7 +685,7 @@ export type SessionStepEnded = {
export type SessionTextStarted = { export type SessionTextStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.text.started" type: "session.text.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -695,7 +695,7 @@ export type SessionTextStarted = {
export type SessionTextEnded = { export type SessionTextEnded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.text.ended" type: "session.text.ended"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -705,7 +705,7 @@ export type SessionTextEnded = {
export type SessionToolInputStarted = { export type SessionToolInputStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.input.started" type: "session.tool.input.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -715,7 +715,7 @@ export type SessionToolInputStarted = {
export type SessionToolInputEnded = { export type SessionToolInputEnded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.input.ended" type: "session.tool.input.ended"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -725,7 +725,7 @@ export type SessionToolInputEnded = {
export type SessionCompactionAdmitted = { export type SessionCompactionAdmitted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.compaction.admitted" type: "session.compaction.admitted"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -735,7 +735,7 @@ export type SessionCompactionAdmitted = {
export type SessionCompactionStarted = { export type SessionCompactionStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.compaction.started" type: "session.compaction.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -745,7 +745,7 @@ export type SessionCompactionStarted = {
export type SessionCompactionEnded = { export type SessionCompactionEnded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.compaction.ended" type: "session.compaction.ended"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -755,7 +755,7 @@ export type SessionCompactionEnded = {
export type SessionRevertCleared = { export type SessionRevertCleared = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.revert.cleared" type: "session.revert.cleared"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -765,7 +765,7 @@ export type SessionRevertCleared = {
export type SessionRevertCommitted = { export type SessionRevertCommitted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.revert.committed" type: "session.revert.committed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -775,7 +775,7 @@ export type SessionRevertCommitted = {
export type ModelsDevRefreshed = { export type ModelsDevRefreshed = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "models-dev.refreshed" type: "models-dev.refreshed"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -784,7 +784,7 @@ export type ModelsDevRefreshed = {
export type IntegrationUpdated = { export type IntegrationUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "integration.updated" type: "integration.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -793,7 +793,7 @@ export type IntegrationUpdated = {
export type IntegrationConnectionUpdated = { export type IntegrationConnectionUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "integration.connection.updated" type: "integration.connection.updated"
location?: LocationRef location?: LocationRef
data: { integrationID: string } data: { integrationID: string }
@ -802,7 +802,7 @@ export type IntegrationConnectionUpdated = {
export type CatalogUpdated = { export type CatalogUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "catalog.updated" type: "catalog.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -811,7 +811,7 @@ export type CatalogUpdated = {
export type AgentUpdated = { export type AgentUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "agent.updated" type: "agent.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -820,7 +820,7 @@ export type AgentUpdated = {
export type MessageRemoved = { export type MessageRemoved = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "message.removed" type: "message.removed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -830,7 +830,7 @@ export type MessageRemoved = {
export type MessagePartRemoved = { export type MessagePartRemoved = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "message.part.removed" type: "message.part.removed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -840,7 +840,7 @@ export type MessagePartRemoved = {
export type SessionUsageUpdated = { export type SessionUsageUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.usage.updated" type: "session.usage.updated"
location?: LocationRef location?: LocationRef
data: { sessionID: string; cost: MoneyUSD; tokens: TokenUsageInfo } data: { sessionID: string; cost: MoneyUSD; tokens: TokenUsageInfo }
@ -849,7 +849,7 @@ export type SessionUsageUpdated = {
export type SessionTextDelta = { export type SessionTextDelta = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.text.delta" type: "session.text.delta"
location?: LocationRef location?: LocationRef
data: { sessionID: string; assistantMessageID: string; ordinal: number; delta: string } data: { sessionID: string; assistantMessageID: string; ordinal: number; delta: string }
@ -858,7 +858,7 @@ export type SessionTextDelta = {
export type SessionReasoningDelta = { export type SessionReasoningDelta = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.reasoning.delta" type: "session.reasoning.delta"
location?: LocationRef location?: LocationRef
data: { sessionID: string; assistantMessageID: string; ordinal: number; delta: string } data: { sessionID: string; assistantMessageID: string; ordinal: number; delta: string }
@ -867,7 +867,7 @@ export type SessionReasoningDelta = {
export type SessionToolInputDelta = { export type SessionToolInputDelta = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.input.delta" type: "session.tool.input.delta"
location?: LocationRef location?: LocationRef
data: { sessionID: string; assistantMessageID: string; callID: string; delta: string } data: { sessionID: string; assistantMessageID: string; callID: string; delta: string }
@ -876,7 +876,7 @@ export type SessionToolInputDelta = {
export type SessionCompactionDelta = { export type SessionCompactionDelta = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.compaction.delta" type: "session.compaction.delta"
location?: LocationRef location?: LocationRef
data: { sessionID: string; text: string } data: { sessionID: string; text: string }
@ -885,7 +885,7 @@ export type SessionCompactionDelta = {
export type FilesystemChanged = { export type FilesystemChanged = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "filesystem.changed" type: "filesystem.changed"
location?: LocationRef location?: LocationRef
data: { file: string; event: "add" | "change" | "unlink" } data: { file: string; event: "add" | "change" | "unlink" }
@ -894,7 +894,7 @@ export type FilesystemChanged = {
export type ReferenceUpdated = { export type ReferenceUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "reference.updated" type: "reference.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -903,7 +903,7 @@ export type ReferenceUpdated = {
export type PluginAdded = { export type PluginAdded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "plugin.added" type: "plugin.added"
location?: LocationRef location?: LocationRef
data: { id: string } data: { id: string }
@ -912,7 +912,7 @@ export type PluginAdded = {
export type PluginUpdated = { export type PluginUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "plugin.updated" type: "plugin.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -921,7 +921,7 @@ export type PluginUpdated = {
export type ProjectDirectoriesUpdated = { export type ProjectDirectoriesUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "project.directories.updated" type: "project.directories.updated"
location?: LocationRef location?: LocationRef
data: { projectID: string } data: { projectID: string }
@ -930,7 +930,7 @@ export type ProjectDirectoriesUpdated = {
export type CommandUpdated = { export type CommandUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "command.updated" type: "command.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -939,7 +939,7 @@ export type CommandUpdated = {
export type ConfigUpdated = { export type ConfigUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "config.updated" type: "config.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -948,7 +948,7 @@ export type ConfigUpdated = {
export type SkillUpdated = { export type SkillUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "skill.updated" type: "skill.updated"
location?: LocationRef location?: LocationRef
data: {} data: {}
@ -957,7 +957,7 @@ export type SkillUpdated = {
export type PtyExited = { export type PtyExited = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "pty.exited" type: "pty.exited"
location?: LocationRef location?: LocationRef
data: { id: string; exitCode: number } data: { id: string; exitCode: number }
@ -966,7 +966,7 @@ export type PtyExited = {
export type PtyDeleted = { export type PtyDeleted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "pty.deleted" type: "pty.deleted"
location?: LocationRef location?: LocationRef
data: { id: string } data: { id: string }
@ -975,7 +975,7 @@ export type PtyDeleted = {
export type ShellExited = { export type ShellExited = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "shell.exited" type: "shell.exited"
location?: LocationRef location?: LocationRef
data: { id: string; exit?: number; status: "running" | "exited" | "timeout" | "killed" } data: { id: string; exit?: number; status: "running" | "exited" | "timeout" | "killed" }
@ -984,7 +984,7 @@ export type ShellExited = {
export type ShellDeleted = { export type ShellDeleted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "shell.deleted" type: "shell.deleted"
location?: LocationRef location?: LocationRef
data: { id: string } data: { id: string }
@ -993,7 +993,7 @@ export type ShellDeleted = {
export type QuestionV2Rejected = { export type QuestionV2Rejected = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "question.v2.rejected" type: "question.v2.rejected"
location?: LocationRef location?: LocationRef
data: { sessionID: string; requestID: string } data: { sessionID: string; requestID: string }
@ -1002,7 +1002,7 @@ export type QuestionV2Rejected = {
export type FormCancelled = { export type FormCancelled = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "form.cancelled" type: "form.cancelled"
location?: LocationRef location?: LocationRef
data: { id: string; sessionID: string } data: { id: string; sessionID: string }
@ -1011,7 +1011,7 @@ export type FormCancelled = {
export type SessionIdle = { export type SessionIdle = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.idle" type: "session.idle"
location?: LocationRef location?: LocationRef
data: { sessionID: string } data: { sessionID: string }
@ -1020,7 +1020,7 @@ export type SessionIdle = {
export type TuiPromptAppend = { export type TuiPromptAppend = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "tui.prompt.append" type: "tui.prompt.append"
location?: LocationRef location?: LocationRef
data: { text: string } data: { text: string }
@ -1029,7 +1029,7 @@ export type TuiPromptAppend = {
export type TuiCommandExecute = { export type TuiCommandExecute = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "tui.command.execute" type: "tui.command.execute"
location?: LocationRef location?: LocationRef
data: { data: {
@ -1058,7 +1058,7 @@ export type TuiCommandExecute = {
export type TuiToastShow = { export type TuiToastShow = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "tui.toast.show" type: "tui.toast.show"
location?: LocationRef location?: LocationRef
data: { data: {
@ -1072,7 +1072,7 @@ export type TuiToastShow = {
export type TuiSessionSelect = { export type TuiSessionSelect = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "tui.session.select" type: "tui.session.select"
location?: LocationRef location?: LocationRef
data: { sessionID: string } data: { sessionID: string }
@ -1081,7 +1081,7 @@ export type TuiSessionSelect = {
export type InstallationUpdated = { export type InstallationUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "installation.updated" type: "installation.updated"
location?: LocationRef location?: LocationRef
data: { version: string } data: { version: string }
@ -1090,7 +1090,7 @@ export type InstallationUpdated = {
export type InstallationUpdateAvailable = { export type InstallationUpdateAvailable = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "installation.update-available" type: "installation.update-available"
location?: LocationRef location?: LocationRef
data: { version: string } data: { version: string }
@ -1099,7 +1099,7 @@ export type InstallationUpdateAvailable = {
export type VcsBranchUpdated = { export type VcsBranchUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "vcs.branch.updated" type: "vcs.branch.updated"
location?: LocationRef location?: LocationRef
data: { branch?: string } data: { branch?: string }
@ -1108,7 +1108,7 @@ export type VcsBranchUpdated = {
export type McpStatusChanged = { export type McpStatusChanged = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "mcp.status.changed" type: "mcp.status.changed"
location?: LocationRef location?: LocationRef
data: { server: string } data: { server: string }
@ -1117,7 +1117,7 @@ export type McpStatusChanged = {
export type McpResourcesChanged = { export type McpResourcesChanged = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "mcp.resources.changed" type: "mcp.resources.changed"
location?: LocationRef location?: LocationRef
data: { server: string } data: { server: string }
@ -1126,7 +1126,7 @@ export type McpResourcesChanged = {
export type PermissionAsked = { export type PermissionAsked = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "permission.asked" type: "permission.asked"
location?: LocationRef location?: LocationRef
data: { data: {
@ -1134,7 +1134,7 @@ export type PermissionAsked = {
sessionID: string sessionID: string
permission: string permission: string
patterns: Array<string> patterns: Array<string>
metadata: { [x: string]: JsonValue } metadata: { [x: string]: any }
always: Array<string> always: Array<string>
tool?: { messageID: string; callID: string } | undefined tool?: { messageID: string; callID: string } | undefined
} }
@ -1143,7 +1143,7 @@ export type PermissionAsked = {
export type PermissionReplied = { export type PermissionReplied = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "permission.replied" type: "permission.replied"
location?: LocationRef location?: LocationRef
data: { sessionID: string; requestID: string; reply: "once" | "always" | "reject" } data: { sessionID: string; requestID: string; reply: "once" | "always" | "reject" }
@ -1152,7 +1152,7 @@ export type PermissionReplied = {
export type QuestionRejected = { export type QuestionRejected = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "question.rejected" type: "question.rejected"
location?: LocationRef location?: LocationRef
data: { sessionID: string; requestID: string } data: { sessionID: string; requestID: string }
@ -1160,7 +1160,7 @@ export type QuestionRejected = {
export type V2EventServerConnected = { export type V2EventServerConnected = {
id: string id: string
metadata?: { [x: string]: JsonValue } | undefined metadata?: { [x: string]: any } | undefined
location?: LocationRef | undefined location?: LocationRef | undefined
type: "server.connected" type: "server.connected"
data: {} data: {}
@ -1213,7 +1213,7 @@ export type SessionMessageCompactionFailed = {
export type SessionExecutionFailed = { export type SessionExecutionFailed = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.execution.failed" type: "session.execution.failed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1223,7 +1223,7 @@ export type SessionExecutionFailed = {
export type SessionStepFailed = { export type SessionStepFailed = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.step.failed" type: "session.step.failed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1239,7 +1239,7 @@ export type SessionStepFailed = {
export type SessionRetryScheduled = { export type SessionRetryScheduled = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.retry.scheduled" type: "session.retry.scheduled"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1249,7 +1249,7 @@ export type SessionRetryScheduled = {
export type SessionCompactionFailed = { export type SessionCompactionFailed = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.compaction.failed" type: "session.compaction.failed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1267,7 +1267,7 @@ export type SessionPendingSyntheticMessage = {
export type SessionShellStarted = { export type SessionShellStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.shell.started" type: "session.shell.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1277,7 +1277,7 @@ export type SessionShellStarted = {
export type SessionShellEnded = { export type SessionShellEnded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.shell.ended" type: "session.shell.ended"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1291,7 +1291,7 @@ export type SessionShellEnded = {
export type ShellCreated = { export type ShellCreated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "shell.created" type: "shell.created"
location?: LocationRef location?: LocationRef
data: { info: ShellInfo } data: { info: ShellInfo }
@ -1300,7 +1300,7 @@ export type ShellCreated = {
export type SessionReasoningStarted = { export type SessionReasoningStarted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.reasoning.started" type: "session.reasoning.started"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1310,7 +1310,7 @@ export type SessionReasoningStarted = {
export type SessionReasoningEnded = { export type SessionReasoningEnded = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.reasoning.ended" type: "session.reasoning.ended"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1326,7 +1326,7 @@ export type SessionReasoningEnded = {
export type SessionToolCalled = { export type SessionToolCalled = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.called" type: "session.tool.called"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1334,7 +1334,7 @@ export type SessionToolCalled = {
sessionID: string sessionID: string
assistantMessageID: string assistantMessageID: string
callID: string callID: string
input: { [x: string]: JsonValue } input: { [x: string]: any }
executed: boolean executed: boolean
state?: SessionMessageProviderState5 state?: SessionMessageProviderState5
} }
@ -1343,7 +1343,7 @@ export type SessionToolCalled = {
export type SessionToolFailed = { export type SessionToolFailed = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.failed" type: "session.tool.failed"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1352,7 +1352,7 @@ export type SessionToolFailed = {
assistantMessageID: string assistantMessageID: string
callID: string callID: string
error: SessionStructuredError error: SessionStructuredError
result?: JsonValue result?: any
executed: boolean executed: boolean
resultState?: SessionMessageProviderState7 resultState?: SessionMessageProviderState7
} }
@ -1490,7 +1490,7 @@ export type PermissionV2Request = {
export type PermissionV2Asked = { export type PermissionV2Asked = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "permission.v2.asked" type: "permission.v2.asked"
location?: LocationRef location?: LocationRef
data: { data: {
@ -1499,7 +1499,7 @@ export type PermissionV2Asked = {
action: string action: string
resources: Array<string> resources: Array<string>
save?: Array<string> save?: Array<string>
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
source?: PermissionV2Source source?: PermissionV2Source
} }
} }
@ -1558,7 +1558,7 @@ export type RetryPart = {
export type SessionError = { export type SessionError = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.error" type: "session.error"
location?: LocationRef location?: LocationRef
data: { data: {
@ -1592,7 +1592,7 @@ export type SymbolSource = {
export type PermissionV2Replied = { export type PermissionV2Replied = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "permission.v2.replied" type: "permission.v2.replied"
location?: LocationRef location?: LocationRef
data: { sessionID: string; requestID: string; reply: PermissionV2Reply } data: { sessionID: string; requestID: string; reply: PermissionV2Reply }
@ -1601,7 +1601,7 @@ export type PermissionV2Replied = {
export type PtyCreated = { export type PtyCreated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "pty.created" type: "pty.created"
location?: LocationRef location?: LocationRef
data: { info: Pty } data: { info: Pty }
@ -1610,7 +1610,7 @@ export type PtyCreated = {
export type PtyUpdated = { export type PtyUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "pty.updated" type: "pty.updated"
location?: LocationRef location?: LocationRef
data: { info: Pty } data: { info: Pty }
@ -1627,7 +1627,7 @@ export type QuestionV2Info = {
export type QuestionV2Replied = { export type QuestionV2Replied = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "question.v2.replied" type: "question.v2.replied"
location?: LocationRef location?: LocationRef
data: { sessionID: string; requestID: string; answers: Array<QuestionV2Answer> } data: { sessionID: string; requestID: string; answers: Array<QuestionV2Answer> }
@ -1701,7 +1701,7 @@ export type FormMultiselectField1 = {
export type SessionStatus2 = { export type SessionStatus2 = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.status" type: "session.status"
location?: LocationRef location?: LocationRef
data: { sessionID: string; status: SessionStatus } data: { sessionID: string; status: SessionStatus }
@ -1718,7 +1718,7 @@ export type QuestionInfo = {
export type QuestionReplied = { export type QuestionReplied = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "question.replied" type: "question.replied"
location?: LocationRef location?: LocationRef
data: { sessionID: string; requestID: string; answers: Array<QuestionAnswer> } data: { sessionID: string; requestID: string; answers: Array<QuestionAnswer> }
@ -1747,7 +1747,7 @@ export type SessionInfo = {
export type SessionRevertStaged = { export type SessionRevertStaged = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.revert.staged" type: "session.revert.staged"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1775,7 +1775,7 @@ export type SessionPendingUserData1 = {
text: string text: string
files?: Array<PromptFileAttachment> files?: Array<PromptFileAttachment>
agents?: Array<PromptAgentAttachment> agents?: Array<PromptAgentAttachment>
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
} }
export type SessionMessageToolStateRunning = { export type SessionMessageToolStateRunning = {
@ -1805,7 +1805,7 @@ export type SessionMessageToolStateError = {
export type SessionToolProgress = { export type SessionToolProgress = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.progress" type: "session.tool.progress"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1813,7 +1813,7 @@ export type SessionToolProgress = {
sessionID: string sessionID: string
assistantMessageID: string assistantMessageID: string
callID: string callID: string
structured: { [x: string]: JsonValue } structured: { [x: string]: any }
content: Array<LLMToolContent> content: Array<LLMToolContent>
} }
} }
@ -1821,7 +1821,7 @@ export type SessionToolProgress = {
export type SessionToolSuccess = { export type SessionToolSuccess = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.tool.success" type: "session.tool.success"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -1829,9 +1829,9 @@ export type SessionToolSuccess = {
sessionID: string sessionID: string
assistantMessageID: string assistantMessageID: string
callID: string callID: string
structured: { [x: string]: JsonValue } structured: { [x: string]: any }
content: Array<LLMToolContent> content: Array<LLMToolContent>
result?: JsonValue result?: any
executed: boolean executed: boolean
resultState?: SessionMessageProviderState6 resultState?: SessionMessageProviderState6
} }
@ -1881,7 +1881,7 @@ export type FormState = { status: "pending" } | { status: "answered"; answer: Fo
export type FormReplied = { export type FormReplied = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "form.replied" type: "form.replied"
location?: LocationRef location?: LocationRef
data: { id: string; sessionID: string; answer: FormAnswer } data: { id: string; sessionID: string; answer: FormAnswer }
@ -1907,7 +1907,7 @@ export type FilePartSource = FileSource | SymbolSource | ResourceSource
export type QuestionV2Asked = { export type QuestionV2Asked = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "question.v2.asked" type: "question.v2.asked"
location?: LocationRef location?: LocationRef
data: { id: string; sessionID: string; questions: Array<QuestionV2Info>; tool?: QuestionV2Tool } data: { id: string; sessionID: string; questions: Array<QuestionV2Info>; tool?: QuestionV2Tool }
@ -1931,7 +1931,7 @@ export type FormField1 =
export type QuestionAsked = { export type QuestionAsked = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "question.asked" type: "question.asked"
location?: LocationRef location?: LocationRef
data: { id: string; sessionID: string; questions: Array<QuestionInfo>; tool?: QuestionTool | undefined } data: { id: string; sessionID: string; questions: Array<QuestionInfo>; tool?: QuestionTool | undefined }
@ -2061,7 +2061,7 @@ export type FormInfo = { id: string; sessionID: string; title: string; metadata?
export type SessionCreated = { export type SessionCreated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.created" type: "session.created"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -2071,7 +2071,7 @@ export type SessionCreated = {
export type SessionUpdated = { export type SessionUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.updated" type: "session.updated"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -2081,7 +2081,7 @@ export type SessionUpdated = {
export type SessionDeleted1 = { export type SessionDeleted1 = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.deleted" type: "session.deleted"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -2091,7 +2091,7 @@ export type SessionDeleted1 = {
export type MessageUpdated = { export type MessageUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "message.updated" type: "message.updated"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -2113,7 +2113,7 @@ export type FormInfo1 = { id: string; sessionID: string; title: string; metadata
export type SessionInputAdmitted = { export type SessionInputAdmitted = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "session.input.admitted" type: "session.input.admitted"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef
@ -2136,7 +2136,7 @@ export type ToolState = ToolStatePending | ToolStateRunning | ToolStateCompleted
export type FormCreated = { export type FormCreated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "form.created" type: "form.created"
location?: LocationRef location?: LocationRef
data: { form: FormInfo1 } data: { form: FormInfo1 }
@ -2217,7 +2217,7 @@ export type Part =
export type MessagePartUpdated = { export type MessagePartUpdated = {
id: string id: string
created: number created: number
metadata?: { [x: string]: JsonValue } metadata?: { [x: string]: any }
type: "message.part.updated" type: "message.part.updated"
durable: { aggregateID: string; seq: number; version: 1 } durable: { aggregateID: string; seq: number; version: 1 }
location?: LocationRef location?: LocationRef

View file

@ -827,7 +827,7 @@ function structuralTypes(schemas: ReadonlyArray<Schema.Top>, mutable: boolean, r
const output = type const output = type
.replaceAll(/ & Brand\.Brand<"[^"]+">/g, "") .replaceAll(/ & Brand\.Brand<"[^"]+">/g, "")
.replaceAll("Schema.Json", "JsonValue") .replaceAll("Schema.Json", "JsonValue")
.replaceAll(/(?<!["'])\bunknown\b(?!["'])/g, "JsonValue") .replaceAll(/(?<!["'])\bunknown\b(?!["'])/g, "any")
return mutable ? mutableType(output) : output return mutable ? mutableType(output) : output
} }
return { return {

View file

@ -1097,6 +1097,27 @@ describe("HttpApiCodegen.generate", () => {
expect(output.operations[0]?.success).toBe("stream") expect(output.operations[0]?.success).toBe("stream")
}) })
test("emits opaque Promise SSE fields as any", () => {
const output = emitPromise(
compileContract(
api(
HttpApiEndpoint.get("subscribe", "/event", {
success: HttpApiSchema.StreamSse({
data: Schema.Struct({
metadata: Schema.Record(Schema.String, Schema.Unknown),
label: Schema.Literal("unknown"),
}),
}),
}),
),
),
)
const types = output.files.find((file) => file.path === "types.ts")?.content
expect(types).toContain('readonly "metadata": { readonly [x: string]: any }')
expect(types).toContain('readonly "label": "unknown"')
})
test("preserves annotated stream response statuses", () => { test("preserves annotated stream response statuses", () => {
const output = compile( const output = compile(
api( api(