@stackstackstack/dsh-commands 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,502 @@
1
+ /* Generated by @stackstackstack/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const _stackstackstack_dsh_commands_commands_execute_parameter_0$schema = z.intersection(z.string(), z.unknown())
5
+ const _stackstackstack_dsh_commands_commands_execute_parameter_1$schema = z.string()
6
+ const _stackstackstack_dsh_commands_commands_execute_result$schema = z.union([z.undefined(), z.object({
7
+ 'commandId': z.intersection(z.string(), z.unknown()).readonly(),
8
+ 'result': z.union([z.object({
9
+ 'kind': z.literal("success").readonly(),
10
+ 'text': z.string().readonly().optional(),
11
+ 'sourceEventSeq': z.number().readonly().optional(),
12
+ }), z.object({
13
+ 'kind': z.literal("error").readonly(),
14
+ 'text': z.string().readonly(),
15
+ })]).readonly(),
16
+ })])
17
+ const _stackstackstack_dsh_commands_commands_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
18
+ const _stackstackstack_dsh_commands_commands_list_result$schema = z.array(z.object({
19
+ 'name': z.string().readonly(),
20
+ 'description': z.string().readonly(),
21
+ 'input': z.object({
22
+ 'hint': z.string().readonly(),
23
+ }).readonly().optional(),
24
+ }))
25
+
26
+ export const TYPERT = {
27
+ package: '@stackstackstack/dsh-commands',
28
+ face: 'host',
29
+ schemas: [
30
+ ],
31
+ invocations: [
32
+ {
33
+ id: '@stackstackstack/dsh-commands#commands/execute',
34
+ service: 'commands',
35
+ namespace: 'commands',
36
+ method: 'execute',
37
+ invocation: { kind: 'direct' },
38
+ scope: {
39
+ context: 'agent',
40
+ wire: 'agentId',
41
+ },
42
+ parameters: [
43
+ {
44
+ name: 'agent',
45
+ wire: 'agentId',
46
+ source: 'lookup',
47
+ lookup: 'agent',
48
+ codec: {
49
+ mode: 'strict',
50
+ typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
51
+ schema: _stackstackstack_dsh_commands_commands_execute_parameter_0$schema,
52
+ },
53
+ },
54
+ {
55
+ name: 'line',
56
+ wire: 'line',
57
+ source: 'json',
58
+ codec: {
59
+ mode: 'strict',
60
+ typeSymbol: '@stackstackstack/dsh-commands#commands/execute:line',
61
+ schema: _stackstackstack_dsh_commands_commands_execute_parameter_1$schema,
62
+ },
63
+ },
64
+ ],
65
+ cancellation: { parameter: 'signal' },
66
+ result: {
67
+ mode: 'strict',
68
+ typeSymbol: '@stackstackstack/dsh-commands#commands/execute:result',
69
+ schema: _stackstackstack_dsh_commands_commands_execute_result$schema,
70
+ },
71
+ sourceLocation: {"file":"packages/interaction/commands/src/index.ts","line":297,"column":9},
72
+ },
73
+ {
74
+ id: '@stackstackstack/dsh-commands#commands/list',
75
+ service: 'commands',
76
+ namespace: 'commands',
77
+ method: 'list',
78
+ invocation: { kind: 'direct' },
79
+ scope: {
80
+ context: 'agent',
81
+ wire: 'agentId',
82
+ },
83
+ parameters: [
84
+ {
85
+ name: 'agent',
86
+ wire: 'agentId',
87
+ source: 'lookup',
88
+ lookup: 'agent',
89
+ codec: {
90
+ mode: 'strict',
91
+ typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
92
+ schema: _stackstackstack_dsh_commands_commands_list_parameter_0$schema,
93
+ },
94
+ },
95
+ ],
96
+ result: {
97
+ mode: 'strict',
98
+ typeSymbol: '@stackstackstack/dsh-commands#commands/list:result',
99
+ schema: _stackstackstack_dsh_commands_commands_list_result$schema,
100
+ },
101
+ sourceLocation: {"file":"packages/interaction/commands/src/index.ts","line":260,"column":3},
102
+ },
103
+ ],
104
+ model: {
105
+ "services": [
106
+ {
107
+ "description": "Human-command registry. Plain-context definitions are global; definitions registered through a command-injected child of an agent context shadow globals for that agent.",
108
+ "summary": "Human-command registry.",
109
+ "tags": [],
110
+ "jsDoc": "/**\n * Human-command registry. Plain-context definitions are global; definitions\n * registered through a command-injected child of an agent context shadow\n * globals for that agent.\n */",
111
+ "key": "commands",
112
+ "exportName": "CommandRuntime",
113
+ "members": [
114
+ {
115
+ "kind": "method",
116
+ "name": "register",
117
+ "signature": "register(definition: CommandDefinition): () => void",
118
+ "summary": "Register a global or calling-agent-scoped command.",
119
+ "jsDoc": "/**\n * Register a global or calling-agent-scoped command.\n * @param definition - discovery metadata and direct UI handler.\n * @returns the exact effect disposer that unregisters this definition.\n */"
120
+ },
121
+ {
122
+ "kind": "method",
123
+ "name": "list",
124
+ "signature": "@Remote list(agent: Agent): readonly CommandDescriptor[]",
125
+ "summary": "List the effective immutable command descriptors for one agent.",
126
+ "jsDoc": "/**\n * List the effective immutable command descriptors for one agent.\n * @param agent - exact receiving agent and scoped-layer key.\n * @returns name-sorted descriptors after scoped shadowing.\n */"
127
+ },
128
+ {
129
+ "kind": "method",
130
+ "name": "find",
131
+ "signature": "find(agent: Agent, name: string): CommandDefinition | undefined",
132
+ "summary": "Resolve one effective command definition.",
133
+ "jsDoc": "/**\n * Resolve one effective command definition.\n * @param agent - exact receiving agent and scoped-layer key.\n * @param name - command name without a slash.\n * @returns the scoped shadow or global definition.\n */"
134
+ },
135
+ {
136
+ "kind": "method",
137
+ "name": "execute",
138
+ "signature": "@Remote async execute( agent: Agent, line: string, signal: AbortSignal, ): Promise<CommandExecution | undefined>",
139
+ "summary": "Parse and execute a known command without sending it to the model.",
140
+ "jsDoc": "/**\n * Parse and execute a known command without sending it to the model.\n *\n * A resolved command's lifecycle is logged: `command/run` is appended\n * before the handler is invoked and `command/done` after settlement (a\n * thrown or aborted handler settles as `kind: 'error'`). Both are direct\n * log-only appends — no turn wraps them, and persistence drains them at\n * ordinary checkpoints. Admission misses (syntax or unknown name) log\n * nothing — they never entered a handler. A `command/run` append failure\n * fails the execution loud; a `command/done` append failure on the\n * handler-failure path is contained so the handler's own error stays the\n * reported failure.\n *\n * @param agent - exact receiving agent.\n * @param line - complete slash-command line.\n * @param signal - cancellation signal owned by the UI request.\n * @returns the settled execution (result + lifecycle pairing id), or\n * `undefined` when syntax or name does not resolve.\n */"
141
+ }
142
+ ],
143
+ "types": [
144
+ {
145
+ "name": "Agent",
146
+ "declaration": "export interface Agent {\n readonly id: SessionId;\n readonly options: AgentOptions;\n readonly session: Session;\n readonly inbox: Inbox;\n readonly status: AgentStatus;\n readonly ctx: Context;\n cancel(cause: AgentCancelCause, options?: CancelOptions): void;\n whenIdle(): Promise<void>;\n runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;\n send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;\n followup(message: UserMessage): void;\n steer(message: UserMessage): void;\n inject(message: UserMessage): void;\n}"
147
+ },
148
+ {
149
+ "name": "AgentCancelCause",
150
+ "declaration": "export type AgentCancelCause = { readonly kind: 'user'; } | { readonly kind: 'parent'; } | { readonly kind: 'hook'; readonly reason: string; } | { readonly kind: 'disposed'; };"
151
+ },
152
+ {
153
+ "name": "AgentOptions",
154
+ "declaration": "export interface AgentOptions {\n provider?: string;\n model?: string;\n maxTokens?: number;\n}"
155
+ },
156
+ {
157
+ "name": "AgentStatus",
158
+ "declaration": "export type AgentStatus = 'idle' | 'running';"
159
+ },
160
+ {
161
+ "name": "ApprovalOutcome",
162
+ "declaration": "export type ApprovalOutcome = 'allowed-once' | 'rejected' | 'cancelled' | 'unavailable';"
163
+ },
164
+ {
165
+ "name": "ApprovalPolicy",
166
+ "declaration": "export type ApprovalPolicy = 'ask' | 'never';"
167
+ },
168
+ {
169
+ "name": "ApprovalRequestId",
170
+ "declaration": "export type ApprovalRequestId = Branded<'ApprovalRequestId'>;"
171
+ },
172
+ {
173
+ "name": "AssistantMessage",
174
+ "declaration": "export interface AssistantMessage extends Message {\n readonly role: 'assistant';\n readonly source: ModelMessageSource;\n}"
175
+ },
176
+ {
177
+ "name": "AssistantProvenance",
178
+ "declaration": "export interface AssistantProvenance {\n provider: string;\n model: string;\n replayState?: unknown;\n}"
179
+ },
180
+ {
181
+ "name": "AttachmentId",
182
+ "declaration": "export type AttachmentId = Branded<'AttachmentId'>;"
183
+ },
184
+ {
185
+ "name": "Branded",
186
+ "declaration": "export type Branded<B extends string> = string & { readonly [BRAND]: B; };"
187
+ },
188
+ {
189
+ "name": "CallId",
190
+ "declaration": "export type CallId = Branded<'CallId'>;"
191
+ },
192
+ {
193
+ "name": "CancelOptions",
194
+ "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
195
+ },
196
+ {
197
+ "name": "CodeDispatchEventData",
198
+ "declaration": "export interface CodeDispatchEventData extends CodeDispatchStartEventData {\n isError: boolean;\n content: ContentBlock[];\n}"
199
+ },
200
+ {
201
+ "name": "CodeDispatchStartEventData",
202
+ "declaration": "export interface CodeDispatchStartEventData {\n rootCallId: CallId;\n parentCallId: CallId;\n subCallId: CallId;\n name: string;\n arguments: unknown;\n}"
203
+ },
204
+ {
205
+ "name": "CommandDefinition",
206
+ "declaration": "export interface CommandDefinition {\n readonly name: string;\n readonly description: string;\n readonly input?: CommandInputDescriptor;\n readonly recordInput?: boolean;\n readonly handler: (invocation: CommandInvocation) => CommandResult | Promise<CommandResult>;\n}"
207
+ },
208
+ {
209
+ "name": "CommandDescriptor",
210
+ "declaration": "export interface CommandDescriptor {\n readonly name: string;\n readonly description: string;\n readonly input?: CommandInputDescriptor;\n}"
211
+ },
212
+ {
213
+ "name": "CommandExecution",
214
+ "declaration": "export interface CommandExecution {\n readonly commandId: CommandId;\n readonly result: CommandResult;\n}"
215
+ },
216
+ {
217
+ "name": "CommandId",
218
+ "declaration": "export type CommandId = Branded<'CommandId'>;"
219
+ },
220
+ {
221
+ "name": "CommandInputDescriptor",
222
+ "declaration": "export interface CommandInputDescriptor {\n readonly hint: string;\n}"
223
+ },
224
+ {
225
+ "name": "CommandInvocation",
226
+ "declaration": "export interface CommandInvocation {\n readonly commandId: CommandId;\n readonly agent: Agent;\n readonly rawInput: string;\n readonly signal: AbortSignal;\n}"
227
+ },
228
+ {
229
+ "name": "CommandResult",
230
+ "declaration": "export type CommandResult = { readonly kind: 'success'; readonly text?: string; readonly sourceEventSeq?: number; } | { readonly kind: 'error'; readonly text: string; };"
231
+ },
232
+ {
233
+ "name": "CommandSource",
234
+ "declaration": "export type CommandSource = CommandSourceMap[keyof CommandSourceMap];"
235
+ },
236
+ {
237
+ "name": "CommandSourceMap",
238
+ "declaration": "export interface CommandSourceMap {\n user: { kind: 'user'; };\n}"
239
+ },
240
+ {
241
+ "name": "ContentBlock",
242
+ "declaration": "export type ContentBlock = ContentBlockMap[ContentBlockType];"
243
+ },
244
+ {
245
+ "name": "ContentBlockMap",
246
+ "declaration": "export interface ContentBlockMap {\n text: TextBlock;\n reasoning: ReasoningBlock;\n image: ImageBlock;\n 'tool-call': ToolCallBlock;\n 'tool-result': ToolResultBlock;\n}"
247
+ },
248
+ {
249
+ "name": "ContentBlockType",
250
+ "declaration": "export type ContentBlockType = keyof ContentBlockMap;"
251
+ },
252
+ {
253
+ "name": "ContextFormed",
254
+ "declaration": "export type ContextFormed = { readonly form?: never; } | { readonly form: 'instructions'; } | { readonly form: 'catalog'; } | { readonly form: 'snapshot'; readonly sections: readonly ContextSnapshotSection[]; } | { readonly form: 'notice'; readonly summary: string; } | { readonly form: 'relay'; } | { readonly form: 'recall'; };"
255
+ },
256
+ {
257
+ "name": "ContextSnapshotSection",
258
+ "declaration": "export interface ContextSnapshotSection {\n readonly name: string;\n readonly text: string;\n}"
259
+ },
260
+ {
261
+ "name": "EpochHeader",
262
+ "declaration": "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
263
+ },
264
+ {
265
+ "name": "FinishReason",
266
+ "declaration": "export type FinishReason = FinishReasonMap[keyof FinishReasonMap];"
267
+ },
268
+ {
269
+ "name": "FinishReasonMap",
270
+ "declaration": "export interface FinishReasonMap {\n stop: { kind: 'stop'; };\n 'tool-calls': { kind: 'tool-calls'; };\n 'max-tokens': { kind: 'max-tokens'; };\n aborted: { kind: 'aborted'; failure: LlmFailure; };\n error: { kind: 'error'; failure: LlmFailure; };\n}"
271
+ },
272
+ {
273
+ "name": "GoalBlockReason",
274
+ "declaration": "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
275
+ },
276
+ {
277
+ "name": "GoalChangeMeta",
278
+ "declaration": "export type GoalChangeMeta = GoalSnapshotChangeMeta | GoalClearChangeMeta;"
279
+ },
280
+ {
281
+ "name": "GoalClearChangeMeta",
282
+ "declaration": "export interface GoalClearChangeMeta {\n readonly kind: 'goal/change';\n readonly version: 1;\n readonly operation: 'clear';\n readonly cleared: GoalRef;\n readonly clearedAt: number;\n}"
283
+ },
284
+ {
285
+ "name": "GoalId",
286
+ "declaration": "export type GoalId = Branded<'GoalId'>;"
287
+ },
288
+ {
289
+ "name": "GoalMessageSource",
290
+ "declaration": "export interface GoalMessageSource {\n readonly kind: 'goal';\n readonly goalId: GoalId;\n readonly revision: number;\n readonly round: number;\n}"
291
+ },
292
+ {
293
+ "name": "GoalOperation",
294
+ "declaration": "export type GoalOperation = 'create' | 'edit' | 'pause' | 'resume' | 'complete' | 'block' | 'clear';"
295
+ },
296
+ {
297
+ "name": "GoalPhase",
298
+ "declaration": "export type GoalPhase = 'active' | 'paused' | 'blocked' | 'complete';"
299
+ },
300
+ {
301
+ "name": "GoalRef",
302
+ "declaration": "export interface GoalRef {\n readonly id: GoalId;\n readonly revision: number;\n}"
303
+ },
304
+ {
305
+ "name": "GoalSnapshot",
306
+ "declaration": "export interface GoalSnapshot extends GoalRef {\n readonly objective: string;\n readonly phase: GoalPhase;\n readonly blockedReason?: GoalBlockReason;\n readonly maxGoalRounds: number;\n}"
307
+ },
308
+ {
309
+ "name": "GoalSnapshotChangeMeta",
310
+ "declaration": "export interface GoalSnapshotChangeMeta {\n readonly kind: 'goal/change';\n readonly version: 1;\n readonly operation: Exclude<GoalOperation, 'clear'>;\n readonly goal: GoalSnapshot;\n readonly roundsStarted: number;\n readonly createdAt: number;\n readonly updatedAt: number;\n}"
311
+ },
312
+ {
313
+ "name": "ImageAttachmentRef",
314
+ "declaration": "export interface ImageAttachmentRef {\n attachmentId: AttachmentId;\n mediaType: ImageMediaType;\n bytes: number;\n width: number;\n height: number;\n name?: string;\n}"
315
+ },
316
+ {
317
+ "name": "ImageBlock",
318
+ "declaration": "export interface ImageBlock {\n type: 'image';\n attachment: ImageAttachmentRef;\n}"
319
+ },
320
+ {
321
+ "name": "ImageMediaType",
322
+ "declaration": "export type ImageMediaType = 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif';"
323
+ },
324
+ {
325
+ "name": "Inbox",
326
+ "declaration": "export class Inbox {\n get nextTurn(): readonly UserMessage[];\n get nextStep(): readonly UserMessage[];\n get hasPending(): boolean;\n clear(): void;\n claim(target: InboxTarget, turn: number): UserMessage[];\n append(target: InboxTarget, message: UserMessage): void;\n prepend(target: InboxTarget, message: UserMessage): void;\n replace(messageId: MessageId, newMessage: UserMessage): boolean;\n remove(messageId: MessageId): boolean;\n splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];\n}"
327
+ },
328
+ {
329
+ "name": "InboxTarget",
330
+ "declaration": "export type InboxTarget = 'next-turn' | 'next-step';"
331
+ },
332
+ {
333
+ "name": "JsonValue",
334
+ "declaration": "export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue; };"
335
+ },
336
+ {
337
+ "name": "LlmCallConfig",
338
+ "declaration": "export interface LlmCallConfig {\n provider: string;\n model: string;\n reasoningEffort?: ReasoningEffortId;\n temperature?: number;\n maxTokens?: number;\n stop?: string[];\n}"
339
+ },
340
+ {
341
+ "name": "LlmCallConfigAdapterDefaults",
342
+ "declaration": "export interface LlmCallConfigAdapterDefaults {\n reasoningEffort?: true;\n maxTokens?: true;\n}"
343
+ },
344
+ {
345
+ "name": "LlmFailure",
346
+ "declaration": "export interface LlmFailure {\n readonly message: string;\n readonly code: string;\n readonly status?: number;\n readonly providerRetryAfterMs?: number;\n readonly requestId?: ProviderRequestId;\n}"
347
+ },
348
+ {
349
+ "name": "Message",
350
+ "declaration": "export interface Message {\n readonly id: MessageId;\n readonly role: 'system' | 'user' | 'assistant';\n readonly content: ContentBlock[];\n readonly source: MessageSource;\n}"
351
+ },
352
+ {
353
+ "name": "MessageId",
354
+ "declaration": "export type MessageId = Branded<'MessageId'>;"
355
+ },
356
+ {
357
+ "name": "MessageSource",
358
+ "declaration": "export type MessageSource = MessageSourceMap[keyof MessageSourceMap];"
359
+ },
360
+ {
361
+ "name": "MessageSourceMap",
362
+ "declaration": "export interface MessageSourceMap {\n user: { kind: 'user'; };\n plugin: { kind: 'plugin'; plugin: string; } & ContextFormed;\n model: ModelMessageSource;\n tool: ToolMessageSource;\n goal: GoalMessageSource;\n}"
363
+ },
364
+ {
365
+ "name": "ModelMessageSource",
366
+ "declaration": "export interface ModelMessageSource extends AssistantProvenance {\n kind: 'model';\n}"
367
+ },
368
+ {
369
+ "name": "ProviderRequestId",
370
+ "declaration": "export type ProviderRequestId = Branded<'ProviderRequestId'>;"
371
+ },
372
+ {
373
+ "name": "ReasoningBlock",
374
+ "declaration": "export interface ReasoningBlock {\n type: 'reasoning';\n text: string;\n}"
375
+ },
376
+ {
377
+ "name": "ReasoningEffortId",
378
+ "declaration": "export type ReasoningEffortId = Branded<'ReasoningEffortId'>;"
379
+ },
380
+ {
381
+ "name": "RequestContext",
382
+ "declaration": "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n}"
383
+ },
384
+ {
385
+ "name": "RequestHeaderReason",
386
+ "declaration": "export type RequestHeaderReason = 'initial' | 'resume' | 'change';"
387
+ },
388
+ {
389
+ "name": "Session",
390
+ "declaration": "export class Session {\n get surface(): SessionSurface;\n readonly header: SessionHeader;\n get id(): SessionId;\n readonly firstLiveSeq: number;\n get events(): readonly SessionEvent[];\n get seq(): number;\n append<T extends SessionEventType>(type: T, data: SessionEventMap[T], ...opts: T extends SurfaceEventType ? [opts: SurfaceIntent] : []): SessionEvent<T>;\n requestHeader(): EpochHeader | undefined;\n requestContext(): RequestContext | undefined;\n deriveMessages(): Message[];\n deriveEventMessage(event: SessionEvent): Message | null;\n}"
391
+ },
392
+ {
393
+ "name": "SessionEvent",
394
+ "declaration": "export type SessionEvent<T extends SessionEventType = SessionEventType> = { [K in SessionEventType]: { type: K; seq: number; time: number; data: SessionEventMap[K]; ignorable?: true; } & (K extends SurfaceEventType ? { sourceEventSeqs?: number[]; surfaceOp?: SurfaceOp; } : object) }[T];"
395
+ },
396
+ {
397
+ "name": "SessionEventMap",
398
+ "declaration": "export interface SessionEventMap {\n 'turn/start': { turn: number; };\n 'turn/end': { turn: number; reason: TurnEndReason; };\n 'step/start': { turn: number; step: number; };\n 'step/end': { turn: number; step: number; };\n 'user/message': UserMessage;\n 'assistant/chunk': { turn: number; step: number; chunk: StreamChunk; };\n 'assistant/message': { turn: number; step: number; message: AssistantMessage; usage?: TokenUsage; };\n 'tool/call': { turn: number; step: number; callId: CallId; name: string; arguments: string; };\n 'tool/result': { turn: number; step: number; message: ToolResultMessage; error?: { name: string; code: string; }; meta?: JsonValue; };\n 'todo/write': { todos: TodoItem[]; };\n 'request/header': { header: EpochHeader; reason: RequestHeaderReason; };\n 'request/context': RequestContext;\n 'session/end-seed': Record<string, never>;\n 'agent/inbox/spliced': { target: InboxTarget; start: number; removedCount?: number; inserted: UserMessage[]; outcome?: 'canceled'; };\n 'command/run': { commandId: CommandId; name: string; args?: string; source: CommandSource; };\n 'command/done': { commandId: CommandId; kind: 'success' | 'error'; text?: string; sourceEventSeq?: number; };\n 'approval/asked': { id: ApprovalRequestId; toolName: string; callId?: CallId; reason?: string; };\n 'approval/decided': { id: ApprovalRequestId; outcome: ApprovalOutcome; };\n 'approval/policy': { policy: ApprovalPolicy; source?: 'delegation'; };\n 'tool/code-dispatch-start': CodeDispatchStartEventData;\n 'tool/code-dispatch': CodeDispatchEventData;\n 'goal/change': GoalChangeMeta;\n}"
399
+ },
400
+ {
401
+ "name": "SessionEventType",
402
+ "declaration": "export type SessionEventType = keyof SessionEventMap;"
403
+ },
404
+ {
405
+ "name": "SessionHeader",
406
+ "declaration": "export interface SessionHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly seedLength?: number;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
407
+ },
408
+ {
409
+ "name": "SessionId",
410
+ "declaration": "export type SessionId = Branded<'SessionId'>;"
411
+ },
412
+ {
413
+ "name": "SessionSurface",
414
+ "declaration": "export interface SessionSurface {\n readonly nodes: readonly number[];\n readonly replaceGeneration: number;\n}"
415
+ },
416
+ {
417
+ "name": "StreamChunk",
418
+ "declaration": "export type StreamChunk = { type: 'block-start'; index: number; blockType: ContentBlockType; } | { type: 'text-delta'; index: number; text: string; } | { type: 'reasoning-delta'; index: number; text: string; } | { type: 'tool-call-delta'; index: number; id: CallId; name?: string; argumentsDelta: string; } | { type: 'block-end'; index: number; block: ContentBlock; } | { type: 'usage'; usage: TokenUsage; } | { type: 'finish'; reason: FinishReason; replayState?: unknown; };"
419
+ },
420
+ {
421
+ "name": "SurfaceEventType",
422
+ "declaration": "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
423
+ },
424
+ {
425
+ "name": "SurfaceIntent",
426
+ "declaration": "export interface SurfaceIntent {\n surfaceOp: SurfaceOp;\n sourceEventSeqs?: number[];\n}"
427
+ },
428
+ {
429
+ "name": "SurfaceOp",
430
+ "declaration": "export type SurfaceOp = 'append' | { op: 'replace'; start: number; end: number; };"
431
+ },
432
+ {
433
+ "name": "TextBlock",
434
+ "declaration": "export interface TextBlock {\n type: 'text';\n text: string;\n}"
435
+ },
436
+ {
437
+ "name": "TodoItem",
438
+ "declaration": "export interface TodoItem {\n content: string;\n status: 'pending' | 'in_progress' | 'completed';\n}"
439
+ },
440
+ {
441
+ "name": "TokenUsage",
442
+ "declaration": "export interface TokenUsage {\n inputTokens: number;\n outputTokens: number;\n cacheReadTokens?: number;\n cacheWriteTokens?: number;\n reasoningTokens?: number;\n}"
443
+ },
444
+ {
445
+ "name": "ToolCallBlock",
446
+ "declaration": "export interface ToolCallBlock {\n type: 'tool-call';\n id: CallId;\n name: string;\n arguments: string;\n}"
447
+ },
448
+ {
449
+ "name": "ToolMessageSource",
450
+ "declaration": "export interface ToolMessageSource {\n kind: 'tool';\n callId: CallId;\n}"
451
+ },
452
+ {
453
+ "name": "ToolResultBlock",
454
+ "declaration": "export interface ToolResultBlock {\n type: 'tool-result';\n toolCallId: CallId;\n content: ContentBlock[];\n isError?: boolean;\n}"
455
+ },
456
+ {
457
+ "name": "ToolResultMessage",
458
+ "declaration": "export interface ToolResultMessage extends Message {\n readonly role: 'user';\n readonly content: [ToolResultBlock];\n readonly source: ToolMessageSource;\n}"
459
+ },
460
+ {
461
+ "name": "ToolSchema",
462
+ "declaration": "export interface ToolSchema {\n name: string;\n description: string;\n parameters: Record<string, unknown>;\n}"
463
+ },
464
+ {
465
+ "name": "TurnEndCancelCause",
466
+ "declaration": "export type TurnEndCancelCause = AgentCancelCause | { readonly kind: 'legacy'; };"
467
+ },
468
+ {
469
+ "name": "TurnEndReason",
470
+ "declaration": "export type TurnEndReason = TurnEndReasonMap[keyof TurnEndReasonMap];"
471
+ },
472
+ {
473
+ "name": "TurnEndReasonMap",
474
+ "declaration": "export interface TurnEndReasonMap {\n completed: { kind: 'completed'; };\n aborted: { kind: 'aborted'; reason: TurnEndCancelCause; };\n blocked: { kind: 'blocked'; };\n error: { kind: 'error'; error: LlmFailure; };\n 'max-tokens': { kind: 'max-tokens'; };\n interrupted: { kind: 'interrupted'; };\n}"
475
+ },
476
+ {
477
+ "name": "UserMessage",
478
+ "declaration": "export interface UserMessage extends Message {\n readonly role: 'user';\n}"
479
+ }
480
+ ]
481
+ }
482
+ ],
483
+ "events": [
484
+ {
485
+ "description": "A command was registered or unregistered. This is an unfiltered registry notification because a global or scoped change may affect any UI view. Observer failures are contained and cannot veto the registry mutation.",
486
+ "summary": "A command was registered or unregistered.",
487
+ "tags": [
488
+ {
489
+ "name": "mode",
490
+ "comment": "emit",
491
+ "text": "@mode emit"
492
+ }
493
+ ],
494
+ "jsDoc": "/**\n * A command was registered or unregistered. This is an unfiltered registry\n * notification because a global or scoped change may affect any UI view.\n * Observer failures are contained and cannot veto the registry mutation.\n * @mode emit\n */",
495
+ "name": "commands/change",
496
+ "mode": "emit",
497
+ "signature": "'commands/change'(): void"
498
+ }
499
+ ],
500
+ "objects": []
501
+ },
502
+ }
@@ -0,0 +1,29 @@
1
+ /* Generated by @stackstackstack/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ TypertRemoteContribution,
5
+ } from '@stackstackstack/dsh-typert-protocol'
6
+ import type { CommandDescriptor, CommandExecution } from '@stackstackstack/dsh-commands/types'
7
+ import type { SessionId } from '@stackstackstack/dsh-session/types'
8
+
9
+ declare module '@stackstackstack/dsh-typert-protocol' {
10
+ interface TypertRemoteNamespace$636f6d6d616e6473 {
11
+ execute: (agentId: SessionId, line: string, signal?: AbortSignal) => Promise<RemoteResult<CommandExecution | undefined>>
12
+ list: (agentId: SessionId) => Promise<RemoteResult<readonly CommandDescriptor[]>>
13
+ }
14
+ interface TypertRemoteMap {
15
+ 'commands/execute': (agentId: SessionId, line: string, signal?: AbortSignal) => Promise<RemoteResult<CommandExecution | undefined>>
16
+ 'commands/list': (agentId: SessionId) => Promise<RemoteResult<readonly CommandDescriptor[]>>
17
+ }
18
+ interface TypertRemoteNamespaceMap {
19
+ 'commands': TypertRemoteNamespace$636f6d6d616e6473
20
+ }
21
+ interface TypertRemoteScopeMap {
22
+ 'agent:commands/execute': (line: string, signal?: AbortSignal) => Promise<RemoteResult<CommandExecution | undefined>>
23
+ 'agent:commands/list': () => Promise<RemoteResult<readonly CommandDescriptor[]>>
24
+ }
25
+ }
26
+
27
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
28
+ export default TYPERT_REMOTE
29
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,103 @@
1
+ /* Generated by @stackstackstack/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ const _stackstackstack_dsh_commands_commands_execute_parameter_0$schema = z.intersection(z.string(), z.unknown())
5
+ const _stackstackstack_dsh_commands_commands_execute_parameter_1$schema = z.string()
6
+ const _stackstackstack_dsh_commands_commands_execute_result$schema = z.union([z.undefined(), z.object({
7
+ 'commandId': z.intersection(z.string(), z.unknown()).readonly(),
8
+ 'result': z.union([z.object({
9
+ 'kind': z.literal("success").readonly(),
10
+ 'text': z.string().readonly().optional(),
11
+ 'sourceEventSeq': z.number().readonly().optional(),
12
+ }), z.object({
13
+ 'kind': z.literal("error").readonly(),
14
+ 'text': z.string().readonly(),
15
+ })]).readonly(),
16
+ })])
17
+ const _stackstackstack_dsh_commands_commands_list_parameter_0$schema = z.intersection(z.string(), z.unknown())
18
+ const _stackstackstack_dsh_commands_commands_list_result$schema = z.array(z.object({
19
+ 'name': z.string().readonly(),
20
+ 'description': z.string().readonly(),
21
+ 'input': z.object({
22
+ 'hint': z.string().readonly(),
23
+ }).readonly().optional(),
24
+ }))
25
+
26
+ export const TYPERT_REMOTE = {
27
+ package: '@stackstackstack/dsh-commands',
28
+ descriptors: [
29
+ {
30
+ id: '@stackstackstack/dsh-commands#commands/execute',
31
+ service: 'commands',
32
+ namespace: 'commands',
33
+ method: 'execute',
34
+ invocation: { kind: 'direct' },
35
+ scope: {
36
+ context: 'agent',
37
+ wire: 'agentId',
38
+ },
39
+ parameters: [
40
+ {
41
+ name: 'agent',
42
+ wire: 'agentId',
43
+ source: 'lookup',
44
+ lookup: 'agent',
45
+ codec: {
46
+ mode: 'strict',
47
+ typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
48
+ schema: _stackstackstack_dsh_commands_commands_execute_parameter_0$schema,
49
+ },
50
+ },
51
+ {
52
+ name: 'line',
53
+ wire: 'line',
54
+ source: 'json',
55
+ codec: {
56
+ mode: 'strict',
57
+ typeSymbol: '@stackstackstack/dsh-commands#commands/execute:line',
58
+ schema: _stackstackstack_dsh_commands_commands_execute_parameter_1$schema,
59
+ },
60
+ },
61
+ ],
62
+ cancellation: { parameter: 'signal' },
63
+ result: {
64
+ mode: 'strict',
65
+ typeSymbol: '@stackstackstack/dsh-commands#commands/execute:result',
66
+ schema: _stackstackstack_dsh_commands_commands_execute_result$schema,
67
+ },
68
+ sourceLocation: {"file":"packages/interaction/commands/src/index.ts","line":297,"column":9},
69
+ },
70
+ {
71
+ id: '@stackstackstack/dsh-commands#commands/list',
72
+ service: 'commands',
73
+ namespace: 'commands',
74
+ method: 'list',
75
+ invocation: { kind: 'direct' },
76
+ scope: {
77
+ context: 'agent',
78
+ wire: 'agentId',
79
+ },
80
+ parameters: [
81
+ {
82
+ name: 'agent',
83
+ wire: 'agentId',
84
+ source: 'lookup',
85
+ lookup: 'agent',
86
+ codec: {
87
+ mode: 'strict',
88
+ typeSymbol: '@stackstackstack/dsh-session/types#SessionId',
89
+ schema: _stackstackstack_dsh_commands_commands_list_parameter_0$schema,
90
+ },
91
+ },
92
+ ],
93
+ result: {
94
+ mode: 'strict',
95
+ typeSymbol: '@stackstackstack/dsh-commands#commands/list:result',
96
+ schema: _stackstackstack_dsh_commands_commands_list_result$schema,
97
+ },
98
+ sourceLocation: {"file":"packages/interaction/commands/src/index.ts","line":260,"column":3},
99
+ },
100
+ ],
101
+ }
102
+
103
+ export default TYPERT_REMOTE