@grackle-ai/ahp 0.131.0

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.
Files changed (153) hide show
  1. package/dist/index.d.ts +23 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +23 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/vendor/ahp/action-origin.generated.d.ts +33 -0
  6. package/dist/vendor/ahp/action-origin.generated.d.ts.map +1 -0
  7. package/dist/vendor/ahp/action-origin.generated.js +71 -0
  8. package/dist/vendor/ahp/action-origin.generated.js.map +1 -0
  9. package/dist/vendor/ahp/actions.d.ts +14 -0
  10. package/dist/vendor/ahp/actions.d.ts.map +1 -0
  11. package/dist/vendor/ahp/actions.js +15 -0
  12. package/dist/vendor/ahp/actions.js.map +1 -0
  13. package/dist/vendor/ahp/channels-changeset/actions.d.ts +87 -0
  14. package/dist/vendor/ahp/channels-changeset/actions.d.ts.map +1 -0
  15. package/dist/vendor/ahp/channels-changeset/actions.js +9 -0
  16. package/dist/vendor/ahp/channels-changeset/actions.js.map +1 -0
  17. package/dist/vendor/ahp/channels-changeset/commands.d.ts +103 -0
  18. package/dist/vendor/ahp/channels-changeset/commands.d.ts.map +1 -0
  19. package/dist/vendor/ahp/channels-changeset/commands.js +22 -0
  20. package/dist/vendor/ahp/channels-changeset/commands.js.map +1 -0
  21. package/dist/vendor/ahp/channels-changeset/reducer.d.ts +18 -0
  22. package/dist/vendor/ahp/channels-changeset/reducer.d.ts.map +1 -0
  23. package/dist/vendor/ahp/channels-changeset/reducer.js +65 -0
  24. package/dist/vendor/ahp/channels-changeset/reducer.js.map +1 -0
  25. package/dist/vendor/ahp/channels-changeset/state.d.ts +155 -0
  26. package/dist/vendor/ahp/channels-changeset/state.d.ts.map +1 -0
  27. package/dist/vendor/ahp/channels-changeset/state.js +39 -0
  28. package/dist/vendor/ahp/channels-changeset/state.js.map +1 -0
  29. package/dist/vendor/ahp/channels-otlp/notifications.d.ts +121 -0
  30. package/dist/vendor/ahp/channels-otlp/notifications.d.ts.map +1 -0
  31. package/dist/vendor/ahp/channels-otlp/notifications.js +11 -0
  32. package/dist/vendor/ahp/channels-otlp/notifications.js.map +1 -0
  33. package/dist/vendor/ahp/channels-otlp/state.d.ts +65 -0
  34. package/dist/vendor/ahp/channels-otlp/state.d.ts.map +1 -0
  35. package/dist/vendor/ahp/channels-otlp/state.js +10 -0
  36. package/dist/vendor/ahp/channels-otlp/state.js.map +1 -0
  37. package/dist/vendor/ahp/channels-root/actions.d.ts +62 -0
  38. package/dist/vendor/ahp/channels-root/actions.d.ts.map +1 -0
  39. package/dist/vendor/ahp/channels-root/actions.js +8 -0
  40. package/dist/vendor/ahp/channels-root/actions.js.map +1 -0
  41. package/dist/vendor/ahp/channels-root/commands.d.ts +172 -0
  42. package/dist/vendor/ahp/channels-root/commands.d.ts.map +1 -0
  43. package/dist/vendor/ahp/channels-root/commands.js +10 -0
  44. package/dist/vendor/ahp/channels-root/commands.js.map +1 -0
  45. package/dist/vendor/ahp/channels-root/notifications.d.ts +136 -0
  46. package/dist/vendor/ahp/channels-root/notifications.d.ts.map +1 -0
  47. package/dist/vendor/ahp/channels-root/notifications.js +9 -0
  48. package/dist/vendor/ahp/channels-root/notifications.js.map +1 -0
  49. package/dist/vendor/ahp/channels-root/reducer.d.ts +12 -0
  50. package/dist/vendor/ahp/channels-root/reducer.d.ts.map +1 -0
  51. package/dist/vendor/ahp/channels-root/reducer.js +36 -0
  52. package/dist/vendor/ahp/channels-root/reducer.js.map +1 -0
  53. package/dist/vendor/ahp/channels-root/state.d.ts +123 -0
  54. package/dist/vendor/ahp/channels-root/state.d.ts.map +1 -0
  55. package/dist/vendor/ahp/channels-root/state.js +19 -0
  56. package/dist/vendor/ahp/channels-root/state.js.map +1 -0
  57. package/dist/vendor/ahp/channels-session/actions.d.ts +736 -0
  58. package/dist/vendor/ahp/channels-session/actions.d.ts.map +1 -0
  59. package/dist/vendor/ahp/channels-session/actions.js +8 -0
  60. package/dist/vendor/ahp/channels-session/actions.js.map +1 -0
  61. package/dist/vendor/ahp/channels-session/commands.d.ts +261 -0
  62. package/dist/vendor/ahp/channels-session/commands.d.ts.map +1 -0
  63. package/dist/vendor/ahp/channels-session/commands.js +23 -0
  64. package/dist/vendor/ahp/channels-session/commands.js.map +1 -0
  65. package/dist/vendor/ahp/channels-session/reducer.d.ts +14 -0
  66. package/dist/vendor/ahp/channels-session/reducer.d.ts.map +1 -0
  67. package/dist/vendor/ahp/channels-session/reducer.js +703 -0
  68. package/dist/vendor/ahp/channels-session/reducer.js.map +1 -0
  69. package/dist/vendor/ahp/channels-session/state.d.ts +1217 -0
  70. package/dist/vendor/ahp/channels-session/state.d.ts.map +1 -0
  71. package/dist/vendor/ahp/channels-session/state.js +229 -0
  72. package/dist/vendor/ahp/channels-session/state.js.map +1 -0
  73. package/dist/vendor/ahp/channels-terminal/actions.d.ts +185 -0
  74. package/dist/vendor/ahp/channels-terminal/actions.d.ts.map +1 -0
  75. package/dist/vendor/ahp/channels-terminal/actions.js +8 -0
  76. package/dist/vendor/ahp/channels-terminal/actions.js.map +1 -0
  77. package/dist/vendor/ahp/channels-terminal/commands.d.ts +50 -0
  78. package/dist/vendor/ahp/channels-terminal/commands.d.ts.map +1 -0
  79. package/dist/vendor/ahp/channels-terminal/commands.js +8 -0
  80. package/dist/vendor/ahp/channels-terminal/commands.js.map +1 -0
  81. package/dist/vendor/ahp/channels-terminal/reducer.d.ts +12 -0
  82. package/dist/vendor/ahp/channels-terminal/reducer.d.ts.map +1 -0
  83. package/dist/vendor/ahp/channels-terminal/reducer.js +80 -0
  84. package/dist/vendor/ahp/channels-terminal/reducer.js.map +1 -0
  85. package/dist/vendor/ahp/channels-terminal/state.d.ts +151 -0
  86. package/dist/vendor/ahp/channels-terminal/state.d.ts.map +1 -0
  87. package/dist/vendor/ahp/channels-terminal/state.js +18 -0
  88. package/dist/vendor/ahp/channels-terminal/state.js.map +1 -0
  89. package/dist/vendor/ahp/commands.d.ts +14 -0
  90. package/dist/vendor/ahp/commands.d.ts.map +1 -0
  91. package/dist/vendor/ahp/commands.js +15 -0
  92. package/dist/vendor/ahp/commands.js.map +1 -0
  93. package/dist/vendor/ahp/common/actions.d.ts +107 -0
  94. package/dist/vendor/ahp/common/actions.d.ts.map +1 -0
  95. package/dist/vendor/ahp/common/actions.js +77 -0
  96. package/dist/vendor/ahp/common/actions.js.map +1 -0
  97. package/dist/vendor/ahp/common/commands.d.ts +594 -0
  98. package/dist/vendor/ahp/common/commands.d.ts.map +1 -0
  99. package/dist/vendor/ahp/common/commands.js +32 -0
  100. package/dist/vendor/ahp/common/commands.js.map +1 -0
  101. package/dist/vendor/ahp/common/errors.d.ts +184 -0
  102. package/dist/vendor/ahp/common/errors.d.ts.map +1 -0
  103. package/dist/vendor/ahp/common/errors.js +82 -0
  104. package/dist/vendor/ahp/common/errors.js.map +1 -0
  105. package/dist/vendor/ahp/common/messages.d.ts +330 -0
  106. package/dist/vendor/ahp/common/messages.d.ts.map +1 -0
  107. package/dist/vendor/ahp/common/messages.js +11 -0
  108. package/dist/vendor/ahp/common/messages.js.map +1 -0
  109. package/dist/vendor/ahp/common/notifications.d.ts +58 -0
  110. package/dist/vendor/ahp/common/notifications.d.ts.map +1 -0
  111. package/dist/vendor/ahp/common/notifications.js +20 -0
  112. package/dist/vendor/ahp/common/notifications.js.map +1 -0
  113. package/dist/vendor/ahp/common/reducer-helpers.d.ts +24 -0
  114. package/dist/vendor/ahp/common/reducer-helpers.d.ts.map +1 -0
  115. package/dist/vendor/ahp/common/reducer-helpers.js +31 -0
  116. package/dist/vendor/ahp/common/reducer-helpers.js.map +1 -0
  117. package/dist/vendor/ahp/common/state.d.ts +286 -0
  118. package/dist/vendor/ahp/common/state.d.ts.map +1 -0
  119. package/dist/vendor/ahp/common/state.js +11 -0
  120. package/dist/vendor/ahp/common/state.js.map +1 -0
  121. package/dist/vendor/ahp/errors.d.ts +8 -0
  122. package/dist/vendor/ahp/errors.d.ts.map +1 -0
  123. package/dist/vendor/ahp/errors.js +9 -0
  124. package/dist/vendor/ahp/errors.js.map +1 -0
  125. package/dist/vendor/ahp/index.d.ts +24 -0
  126. package/dist/vendor/ahp/index.d.ts.map +1 -0
  127. package/dist/vendor/ahp/index.js +21 -0
  128. package/dist/vendor/ahp/index.js.map +1 -0
  129. package/dist/vendor/ahp/messages.d.ts +8 -0
  130. package/dist/vendor/ahp/messages.d.ts.map +1 -0
  131. package/dist/vendor/ahp/messages.js +9 -0
  132. package/dist/vendor/ahp/messages.js.map +1 -0
  133. package/dist/vendor/ahp/notifications.d.ts +11 -0
  134. package/dist/vendor/ahp/notifications.d.ts.map +1 -0
  135. package/dist/vendor/ahp/notifications.js +12 -0
  136. package/dist/vendor/ahp/notifications.js.map +1 -0
  137. package/dist/vendor/ahp/reducers.d.ts +12 -0
  138. package/dist/vendor/ahp/reducers.d.ts.map +1 -0
  139. package/dist/vendor/ahp/reducers.js +13 -0
  140. package/dist/vendor/ahp/reducers.js.map +1 -0
  141. package/dist/vendor/ahp/state.d.ts +15 -0
  142. package/dist/vendor/ahp/state.d.ts.map +1 -0
  143. package/dist/vendor/ahp/state.js +16 -0
  144. package/dist/vendor/ahp/state.js.map +1 -0
  145. package/dist/vendor/ahp/version/message-checks.d.ts +15 -0
  146. package/dist/vendor/ahp/version/message-checks.d.ts.map +1 -0
  147. package/dist/vendor/ahp/version/message-checks.js +16 -0
  148. package/dist/vendor/ahp/version/message-checks.js.map +1 -0
  149. package/dist/vendor/ahp/version/registry.d.ts +56 -0
  150. package/dist/vendor/ahp/version/registry.d.ts.map +1 -0
  151. package/dist/vendor/ahp/version/registry.js +138 -0
  152. package/dist/vendor/ahp/version/registry.js.map +1 -0
  153. package/package.json +47 -0
@@ -0,0 +1,1217 @@
1
+ /**
2
+ * Session State Types — Per-session state, turns, messages, response parts,
3
+ * tool calls, and elicitation/input requests exposed on `ahp-session:` channels.
4
+ *
5
+ * @module channels-session/state
6
+ */
7
+ import type { URI, StringOrMarkdown, Icon, ConfigPropertySchema, ContentRef, ErrorInfo, FileEdit, TextRange, TextSelection, UsageInfo } from '../common/state.js';
8
+ import type { ChangesetSummary } from '../channels-changeset/state.js';
9
+ import type { ModelSelection } from '../channels-root/state.js';
10
+ /**
11
+ * Discriminant for pending message kinds.
12
+ *
13
+ * @category Pending Message Types
14
+ */
15
+ export declare enum PendingMessageKind {
16
+ /** Injected into the current turn at a convenient point */
17
+ Steering = "steering",
18
+ /** Sent automatically as a new turn after the current turn finishes */
19
+ Queued = "queued"
20
+ }
21
+ /**
22
+ * A message queued for future delivery to the agent.
23
+ *
24
+ * Steering messages are injected into the current turn mid-flight.
25
+ * Queued messages are automatically started as new turns after the
26
+ * current turn naturally finishes.
27
+ *
28
+ * @category Pending Message Types
29
+ */
30
+ export interface PendingMessage {
31
+ /** Unique identifier for this pending message */
32
+ id: string;
33
+ /** The message content */
34
+ userMessage: UserMessage;
35
+ }
36
+ /**
37
+ * Session initialization state.
38
+ *
39
+ * @category Session State
40
+ */
41
+ export declare enum SessionLifecycle {
42
+ Creating = "creating",
43
+ Ready = "ready",
44
+ CreationFailed = "creationFailed"
45
+ }
46
+ /**
47
+ * Bitset of summary-level session status flags.
48
+ *
49
+ * Use bitwise checks instead of equality for non-terminal activity. For example,
50
+ * `status & SessionStatus.InProgress` matches both ordinary in-progress turns
51
+ * and turns that are paused waiting for input.
52
+ *
53
+ * @category Session State
54
+ */
55
+ export declare enum SessionStatus {
56
+ /** Session is idle — no turn is active. */
57
+ Idle = 1,
58
+ /** Session ended with an error. */
59
+ Error = 2,
60
+ /** A turn is actively streaming. */
61
+ InProgress = 8,
62
+ /** A turn is in progress but blocked waiting for user input or tool confirmation. */
63
+ InputNeeded = 24,
64
+ /** The client has viewed this session since its last modification. */
65
+ IsRead = 32,
66
+ /** The session has been archived by the client. */
67
+ IsArchived = 64
68
+ }
69
+ /**
70
+ * Full state for a single session, loaded when a client subscribes to the session's URI.
71
+ *
72
+ * @category Session State
73
+ */
74
+ export interface SessionState {
75
+ /** Lightweight session metadata */
76
+ summary: SessionSummary;
77
+ /** Session initialization state */
78
+ lifecycle: SessionLifecycle;
79
+ /** Error details if creation failed */
80
+ creationError?: ErrorInfo;
81
+ /** Tools provided by the server (agent host) for this session */
82
+ serverTools?: ToolDefinition[];
83
+ /** The client currently providing tools and interactive capabilities to this session */
84
+ activeClient?: SessionActiveClient;
85
+ /** Completed turns */
86
+ turns: Turn[];
87
+ /** Currently in-progress turn */
88
+ activeTurn?: ActiveTurn;
89
+ /** Message to inject into the current turn at a convenient point */
90
+ steeringMessage?: PendingMessage;
91
+ /** Messages to send automatically as new turns after the current turn finishes */
92
+ queuedMessages?: PendingMessage[];
93
+ /** Requests for user input that are currently blocking or informing session progress */
94
+ inputRequests?: SessionInputRequest[];
95
+ /** Session configuration schema and current values */
96
+ config?: SessionConfigState;
97
+ /**
98
+ * Server-provided customizations active in this session.
99
+ *
100
+ * Client-provided customizations are available on
101
+ * {@link SessionActiveClient.customizations | activeClient.customizations}.
102
+ */
103
+ customizations?: SessionCustomization[];
104
+ /**
105
+ * Additional provider-specific metadata for this session.
106
+ *
107
+ * Clients MAY look for well-known keys here to provide enhanced UI.
108
+ * For example, a `git` key may provide extra git metadata about the session's
109
+ * workingDirectory.
110
+ */
111
+ _meta?: Record<string, unknown>;
112
+ }
113
+ /**
114
+ * The client currently providing tools and interactive capabilities to a session.
115
+ *
116
+ * Only one client may be active per session at a time. The server SHOULD
117
+ * automatically unset the active client if that client disconnects.
118
+ *
119
+ * @category Session State
120
+ */
121
+ export interface SessionActiveClient {
122
+ /** Client identifier (matches `clientId` from `initialize`) */
123
+ clientId: string;
124
+ /** Human-readable client name (e.g. `"VS Code"`) */
125
+ displayName?: string;
126
+ /** Tools this client provides to the session */
127
+ tools: ToolDefinition[];
128
+ /** Customizations this client contributes to the session */
129
+ customizations?: CustomizationRef[];
130
+ }
131
+ /**
132
+ * Server-owned project metadata for a session.
133
+ *
134
+ * @category Session State
135
+ */
136
+ export interface ProjectInfo {
137
+ /** Project URI */
138
+ uri: URI;
139
+ /** Human-readable project name */
140
+ displayName: string;
141
+ }
142
+ /**
143
+ * @category Session State
144
+ */
145
+ export interface SessionSummary {
146
+ /** Session URI */
147
+ resource: URI;
148
+ /** Agent provider ID */
149
+ provider: string;
150
+ /** Session title */
151
+ title: string;
152
+ /** Current session status */
153
+ status: SessionStatus;
154
+ /** Human-readable description of what the session is currently doing */
155
+ activity?: string;
156
+ /** Creation timestamp */
157
+ createdAt: number;
158
+ /** Last modification timestamp */
159
+ modifiedAt: number;
160
+ /** Server-owned project for this session */
161
+ project?: ProjectInfo;
162
+ /** Currently selected model */
163
+ model?: ModelSelection;
164
+ /**
165
+ * Currently selected custom agent.
166
+ *
167
+ * Absent (`undefined`) means no custom agent is selected for this session
168
+ * — the session uses the provider's default behavior.
169
+ */
170
+ agent?: AgentSelection;
171
+ /** The working directory URI for this session */
172
+ workingDirectory?: URI;
173
+ /**
174
+ * Catalogue of changesets the server can produce for this session. Each
175
+ * entry advertises a subscribable view of file changes (uncommitted,
176
+ * session-wide, per-turn, etc.) and the URI template the client expands
177
+ * before subscribing. See {@link ChangesetSummary} for the full shape and
178
+ * {@link /guide/changesets | Changesets} for an overview of the model.
179
+ */
180
+ changesets?: ChangesetSummary[];
181
+ }
182
+ /**
183
+ * A selected custom agent for a session.
184
+ *
185
+ * The `uri` identifies a specific custom agent (matching a
186
+ * {@link CustomizationAgentRef.uri | `CustomizationAgentRef.uri`} exposed
187
+ * via the session's effective customizations). Consumers resolve the
188
+ * agent's display name by looking up `uri` in
189
+ * {@link SessionCustomization.agents | `SessionCustomization.agents`}.
190
+ *
191
+ * A session with no `agent` selected uses the provider's default behavior.
192
+ *
193
+ * @category Session State
194
+ */
195
+ export interface AgentSelection {
196
+ /** Stable agent URI (matches a {@link CustomizationAgentRef.uri}) */
197
+ uri: URI;
198
+ }
199
+ /**
200
+ * A session configuration property descriptor.
201
+ *
202
+ * Extends the generic {@link ConfigPropertySchema} with session-specific
203
+ * display extensions.
204
+ *
205
+ * @category Session Config Types
206
+ */
207
+ export interface SessionConfigPropertySchema extends ConfigPropertySchema {
208
+ /**
209
+ * Display extension: when `true`, the full set of allowed values is too large
210
+ * to enumerate statically. The client SHOULD use `sessionConfigCompletions`
211
+ * to fetch matching values based on user input. Any values in `enum` are
212
+ * seed/recent values for initial display.
213
+ */
214
+ enumDynamic?: boolean;
215
+ /** When `true`, the user may change this property after session creation */
216
+ sessionMutable?: boolean;
217
+ }
218
+ /**
219
+ * A JSON Schema object describing available session configuration metadata.
220
+ *
221
+ * @category Session Config Types
222
+ */
223
+ export interface SessionConfigSchema {
224
+ /** JSON Schema: always `'object'` */
225
+ type: 'object';
226
+ /** JSON Schema: property descriptors keyed by property id */
227
+ properties: Record<string, SessionConfigPropertySchema>;
228
+ /** JSON Schema: list of required property ids */
229
+ required?: string[];
230
+ }
231
+ /**
232
+ * Live session configuration metadata.
233
+ *
234
+ * The schema describes the available configuration properties and the values
235
+ * contain the current value for each resolved property.
236
+ *
237
+ * @category Session Config Types
238
+ */
239
+ export interface SessionConfigState {
240
+ /** JSON Schema describing available configuration properties */
241
+ schema: SessionConfigSchema;
242
+ /** Current configuration values */
243
+ values: Record<string, unknown>;
244
+ }
245
+ /**
246
+ * How a client completed an input request.
247
+ *
248
+ * @category Session Input Types
249
+ */
250
+ export declare enum SessionInputResponseKind {
251
+ Accept = "accept",
252
+ Decline = "decline",
253
+ Cancel = "cancel"
254
+ }
255
+ /**
256
+ * Question/input control kind.
257
+ *
258
+ * @category Session Input Types
259
+ */
260
+ export declare enum SessionInputQuestionKind {
261
+ Text = "text",
262
+ Number = "number",
263
+ Integer = "integer",
264
+ Boolean = "boolean",
265
+ SingleSelect = "single-select",
266
+ MultiSelect = "multi-select"
267
+ }
268
+ /**
269
+ * A choice in a select-style question.
270
+ *
271
+ * @category Session Input Types
272
+ */
273
+ export interface SessionInputOption {
274
+ /** Stable option identifier; for MCP enum values this is the enum string */
275
+ id: string;
276
+ /** Display label */
277
+ label: string;
278
+ /** Optional secondary text */
279
+ description?: string;
280
+ /** Whether this option is the recommended/default choice */
281
+ recommended?: boolean;
282
+ }
283
+ interface SessionInputQuestionBase {
284
+ /** Stable question identifier used as the key in `answers` */
285
+ id: string;
286
+ /** Short display title */
287
+ title?: string;
288
+ /** Prompt shown to the user */
289
+ message: string;
290
+ /** Whether the user must answer this question to accept the request */
291
+ required?: boolean;
292
+ }
293
+ /** Text question within a session input request. */
294
+ export interface SessionInputTextQuestion extends SessionInputQuestionBase {
295
+ kind: SessionInputQuestionKind.Text;
296
+ /** Format hint for text questions, such as `email`, `uri`, `date`, or `date-time` */
297
+ format?: string;
298
+ /** Minimum string length */
299
+ min?: number;
300
+ /** Maximum string length */
301
+ max?: number;
302
+ /** Default text */
303
+ defaultValue?: string;
304
+ }
305
+ /** Numeric question within a session input request. */
306
+ export interface SessionInputNumberQuestion extends SessionInputQuestionBase {
307
+ kind: SessionInputQuestionKind.Number | SessionInputQuestionKind.Integer;
308
+ /**
309
+ * Minimum value
310
+ * @format float
311
+ */
312
+ min?: number;
313
+ /**
314
+ * Maximum value
315
+ * @format float
316
+ */
317
+ max?: number;
318
+ /**
319
+ * Default numeric value
320
+ * @format float
321
+ */
322
+ defaultValue?: number;
323
+ }
324
+ /** Boolean question within a session input request. */
325
+ export interface SessionInputBooleanQuestion extends SessionInputQuestionBase {
326
+ kind: SessionInputQuestionKind.Boolean;
327
+ /** Default boolean value */
328
+ defaultValue?: boolean;
329
+ }
330
+ /** Single-select question within a session input request. */
331
+ export interface SessionInputSingleSelectQuestion extends SessionInputQuestionBase {
332
+ kind: SessionInputQuestionKind.SingleSelect;
333
+ /** Options the user may select from */
334
+ options: SessionInputOption[];
335
+ /** Whether the user may enter text instead of selecting an option */
336
+ allowFreeformInput?: boolean;
337
+ }
338
+ /** Multi-select question within a session input request. */
339
+ export interface SessionInputMultiSelectQuestion extends SessionInputQuestionBase {
340
+ kind: SessionInputQuestionKind.MultiSelect;
341
+ /** Options the user may select from */
342
+ options: SessionInputOption[];
343
+ /** Whether the user may enter text in addition to selecting options */
344
+ allowFreeformInput?: boolean;
345
+ /** Minimum selected item count */
346
+ min?: number;
347
+ /** Maximum selected item count */
348
+ max?: number;
349
+ }
350
+ /**
351
+ * One question within a session input request.
352
+ *
353
+ * @category Session Input Types
354
+ */
355
+ export type SessionInputQuestion = SessionInputTextQuestion | SessionInputNumberQuestion | SessionInputBooleanQuestion | SessionInputSingleSelectQuestion | SessionInputMultiSelectQuestion;
356
+ /**
357
+ * A live request for user input.
358
+ *
359
+ * The server creates or replaces requests with `session/inputRequested`.
360
+ * Clients sync drafts with `session/inputAnswerChanged` and complete requests
361
+ * with `session/inputCompleted`.
362
+ *
363
+ * @category Session Input Types
364
+ */
365
+ export interface SessionInputRequest {
366
+ /** Stable request identifier */
367
+ id: string;
368
+ /** Display message for the request as a whole */
369
+ message?: string;
370
+ /** URL the user should review or open, for URL-style elicitations */
371
+ url?: URI;
372
+ /** Ordered questions to ask the user */
373
+ questions?: SessionInputQuestion[];
374
+ /** Current draft or submitted answers, keyed by question ID */
375
+ answers?: Record<string, SessionInputAnswer>;
376
+ }
377
+ /**
378
+ * Answer value kind.
379
+ *
380
+ * @category Session Input Types
381
+ */
382
+ export declare enum SessionInputAnswerValueKind {
383
+ Text = "text",
384
+ Number = "number",
385
+ Boolean = "boolean",
386
+ Selected = "selected",
387
+ SelectedMany = "selected-many"
388
+ }
389
+ /**
390
+ * Value captured for one answer.
391
+ *
392
+ * @category Session Input Types
393
+ */
394
+ export interface SessionInputTextAnswerValue {
395
+ kind: SessionInputAnswerValueKind.Text;
396
+ value: string;
397
+ }
398
+ export interface SessionInputNumberAnswerValue {
399
+ kind: SessionInputAnswerValueKind.Number;
400
+ /** @format float */
401
+ value: number;
402
+ }
403
+ export interface SessionInputBooleanAnswerValue {
404
+ kind: SessionInputAnswerValueKind.Boolean;
405
+ value: boolean;
406
+ }
407
+ export interface SessionInputSelectedAnswerValue {
408
+ kind: SessionInputAnswerValueKind.Selected;
409
+ value: string;
410
+ /** Free-form text entered instead of selecting an option */
411
+ freeformValues?: string[];
412
+ }
413
+ export interface SessionInputSelectedManyAnswerValue {
414
+ kind: SessionInputAnswerValueKind.SelectedMany;
415
+ value: string[];
416
+ /** Free-form text entered in addition to selected options */
417
+ freeformValues?: string[];
418
+ }
419
+ export type SessionInputAnswerValue = SessionInputTextAnswerValue | SessionInputNumberAnswerValue | SessionInputBooleanAnswerValue | SessionInputSelectedAnswerValue | SessionInputSelectedManyAnswerValue;
420
+ export interface SessionInputAnswered {
421
+ /** Answer state */
422
+ state: SessionInputAnswerState.Draft | SessionInputAnswerState.Submitted;
423
+ /** Answer value */
424
+ value: SessionInputAnswerValue;
425
+ }
426
+ export interface SessionInputSkipped {
427
+ /** Answer state */
428
+ state: SessionInputAnswerState.Skipped;
429
+ /** Free-form reason or value captured while skipping, if any */
430
+ freeformValues?: string[];
431
+ }
432
+ /**
433
+ * Answer lifecycle state.
434
+ *
435
+ * @category Session Input Types
436
+ */
437
+ export declare enum SessionInputAnswerState {
438
+ Draft = "draft",
439
+ Submitted = "submitted",
440
+ Skipped = "skipped"
441
+ }
442
+ /**
443
+ * Draft, submitted, or skipped answer for one question.
444
+ *
445
+ * @category Session Input Types
446
+ */
447
+ export type SessionInputAnswer = SessionInputAnswered | SessionInputSkipped;
448
+ /**
449
+ * How a turn ended.
450
+ *
451
+ * @category Turn Types
452
+ */
453
+ export declare enum TurnState {
454
+ Complete = "complete",
455
+ Cancelled = "cancelled",
456
+ Error = "error"
457
+ }
458
+ /**
459
+ * Discriminant for {@link MessageAttachment} variants.
460
+ *
461
+ * @category Turn Types
462
+ */
463
+ export declare enum MessageAttachmentKind {
464
+ /** A simple, opaque attachment whose representation is described by the producer. */
465
+ Simple = "simple",
466
+ /** An attachment whose data is embedded inline as a base64 string. */
467
+ EmbeddedResource = "embeddedResource",
468
+ /** An attachment that references a resource by URI. */
469
+ Resource = "resource"
470
+ }
471
+ /**
472
+ * A completed request/response cycle.
473
+ *
474
+ * @category Turn Types
475
+ */
476
+ export interface Turn {
477
+ /** Turn identifier */
478
+ id: string;
479
+ /** The user's input */
480
+ userMessage: UserMessage;
481
+ /**
482
+ * All response content in stream order: text, tool calls, reasoning, and content refs.
483
+ *
484
+ * Consumers should derive display text by concatenating markdown parts,
485
+ * and find tool calls by filtering for `ToolCall` parts.
486
+ */
487
+ responseParts: ResponsePart[];
488
+ /** Token usage info */
489
+ usage: UsageInfo | undefined;
490
+ /** How the turn ended */
491
+ state: TurnState;
492
+ /** Error details if state is `'error'` */
493
+ error?: ErrorInfo;
494
+ }
495
+ /**
496
+ * An in-progress turn — the assistant is actively streaming.
497
+ *
498
+ * @category Turn Types
499
+ */
500
+ export interface ActiveTurn {
501
+ /** Turn identifier */
502
+ id: string;
503
+ /** The user's input */
504
+ userMessage: UserMessage;
505
+ /**
506
+ * All response content in stream order: text, tool calls, reasoning, and content refs.
507
+ *
508
+ * Tool call parts include `pendingPermissions` when permissions are awaiting user approval.
509
+ */
510
+ responseParts: ResponsePart[];
511
+ /** Token usage info */
512
+ usage: UsageInfo | undefined;
513
+ }
514
+ /**
515
+ * A user message and its associated attachments.
516
+ *
517
+ * Attachments MAY be referenced inside {@link UserMessage.text} via their
518
+ * {@link MessageAttachmentBase.range} field. Attachments without a range are
519
+ * still associated with the message but do not correspond to a specific span
520
+ * in the text.
521
+ *
522
+ * @category Turn Types
523
+ */
524
+ export interface UserMessage {
525
+ /** Message text */
526
+ text: string;
527
+ /** File/selection attachments */
528
+ attachments?: MessageAttachment[];
529
+ }
530
+ /**
531
+ * Common fields shared by all {@link MessageAttachment} variants.
532
+ *
533
+ * @category Turn Types
534
+ */
535
+ export interface MessageAttachmentBase {
536
+ /**
537
+ * A human-readable label for the attachment (e.g. the filename of a file
538
+ * attachment). Used for display in UI.
539
+ */
540
+ label: string;
541
+ /**
542
+ * If defined, the range in {@link UserMessage.text} that references this
543
+ * attachment. This is a text range, not a byte range.
544
+ */
545
+ range?: TextRange;
546
+ /**
547
+ * Advisory display hint for clients rendering this attachment. Recognized
548
+ * values include:
549
+ *
550
+ * - `'image'`: the attachment is an image
551
+ * - `'document'`: the attachment is a textual document
552
+ * - `'symbol'`: the attachment is a code symbol (e.g. a function or class)
553
+ * - `'directory'`: the attachment is a folder
554
+ * - `'selection'`: the attachment is a selection within a document
555
+ *
556
+ * Implementations MAY provide additional values; clients SHOULD fall back
557
+ * to a reasonable default when an unknown value is encountered.
558
+ */
559
+ displayKind?: string;
560
+ /**
561
+ * Additional implementation-defined metadata for the attachment.
562
+ *
563
+ * If the attachment was produced by the `completions` command, the client
564
+ * MUST preserve every property of `_meta` originally returned by the agent
565
+ * host when sending the user message containing the accepted completion.
566
+ */
567
+ _meta?: Record<string, unknown>;
568
+ }
569
+ /**
570
+ * A simple, opaque attachment whose model representation is described by
571
+ * the producer.
572
+ *
573
+ * @category Turn Types
574
+ */
575
+ export interface SimpleMessageAttachment extends MessageAttachmentBase {
576
+ /** Discriminant */
577
+ type: MessageAttachmentKind.Simple;
578
+ /**
579
+ * Representation of the attachment as it should be shown to the model.
580
+ *
581
+ * If the attachment was produced by the client, this property MUST be
582
+ * defined so the agent host can correctly interpret the attachment. This
583
+ * property MAY be omitted when the attachment originated from a
584
+ * `completions` response.
585
+ */
586
+ modelRepresentation?: string;
587
+ }
588
+ /**
589
+ * An attachment whose data is embedded inline as a base64 string.
590
+ *
591
+ * Use this for small binary payloads (e.g. a pasted image) that should be
592
+ * delivered with the user message itself rather than fetched separately.
593
+ *
594
+ * @category Turn Types
595
+ */
596
+ export interface MessageEmbeddedResourceAttachment extends MessageAttachmentBase {
597
+ /** Discriminant */
598
+ type: MessageAttachmentKind.EmbeddedResource;
599
+ /** Base64-encoded binary data */
600
+ data: string;
601
+ /** Content MIME type (e.g. `"image/png"`, `"application/pdf"`) */
602
+ contentType: string;
603
+ /**
604
+ * Optional selection within the attached textual resource.
605
+ *
606
+ * Only meaningful for textual resources.
607
+ */
608
+ selection?: TextSelection;
609
+ }
610
+ /**
611
+ * An attachment that references a resource by URI. The content is not
612
+ * delivered inline; consumers can fetch it via `resourceRead` when needed.
613
+ *
614
+ * @category Turn Types
615
+ */
616
+ export interface MessageResourceAttachment extends MessageAttachmentBase, ContentRef {
617
+ /** Discriminant */
618
+ type: MessageAttachmentKind.Resource;
619
+ /**
620
+ * Optional selection within the referenced textual resource.
621
+ *
622
+ * Only meaningful for textual resources.
623
+ */
624
+ selection?: TextSelection;
625
+ }
626
+ /**
627
+ * An attachment associated with a {@link UserMessage}.
628
+ *
629
+ * @category Turn Types
630
+ */
631
+ export type MessageAttachment = SimpleMessageAttachment | MessageEmbeddedResourceAttachment | MessageResourceAttachment;
632
+ /**
633
+ * Discriminant for response part types.
634
+ *
635
+ * @category Response Parts
636
+ */
637
+ export declare enum ResponsePartKind {
638
+ Markdown = "markdown",
639
+ ContentRef = "contentRef",
640
+ ToolCall = "toolCall",
641
+ Reasoning = "reasoning",
642
+ SystemNotification = "systemNotification"
643
+ }
644
+ /**
645
+ * @category Response Parts
646
+ */
647
+ export interface MarkdownResponsePart {
648
+ /** Discriminant */
649
+ kind: ResponsePartKind.Markdown;
650
+ /** Part identifier, used by `session/delta` to target this part for content appends */
651
+ id: string;
652
+ /** Markdown content */
653
+ content: string;
654
+ }
655
+ /**
656
+ * A content part that's a reference to large content stored outside the state tree.
657
+ *
658
+ * @category Response Parts
659
+ */
660
+ export interface ResourceReponsePart extends ContentRef {
661
+ /** Discriminant */
662
+ kind: ResponsePartKind.ContentRef;
663
+ }
664
+ /**
665
+ * A tool call represented as a response part.
666
+ *
667
+ * Tool calls are part of the response stream, interleaved with text and
668
+ * reasoning. The `toolCall.toolCallId` serves as the part identifier for
669
+ * actions that target this part.
670
+ *
671
+ * @category Response Parts
672
+ */
673
+ export interface ToolCallResponsePart {
674
+ /** Discriminant */
675
+ kind: ResponsePartKind.ToolCall;
676
+ /** Full tool call lifecycle state */
677
+ toolCall: ToolCallState;
678
+ }
679
+ /**
680
+ * Reasoning/thinking content from the model.
681
+ *
682
+ * @category Response Parts
683
+ */
684
+ export interface ReasoningResponsePart {
685
+ /** Discriminant */
686
+ kind: ResponsePartKind.Reasoning;
687
+ /** Part identifier, used by `session/reasoning` to target this part for content appends */
688
+ id: string;
689
+ /** Accumulated reasoning text */
690
+ content: string;
691
+ }
692
+ /**
693
+ * @category Response Parts
694
+ */
695
+ export type ResponsePart = MarkdownResponsePart | ResourceReponsePart | ToolCallResponsePart | ReasoningResponsePart | SystemNotificationResponsePart;
696
+ /**
697
+ * A system notification surfaced as part of the response stream.
698
+ *
699
+ * System notifications are messages authored by the agent harness
700
+ * that need to be visible to both the agent (for situational awareness) and
701
+ * the user (for transcript continuity). Examples include "background subagent
702
+ * X completed" or "task Y was cancelled".
703
+ *
704
+ * @category Response Parts
705
+ */
706
+ export interface SystemNotificationResponsePart {
707
+ /** Discriminant */
708
+ kind: ResponsePartKind.SystemNotification;
709
+ /** The text of the system notification */
710
+ content: StringOrMarkdown;
711
+ }
712
+ /**
713
+ * Status of a tool call in the lifecycle state machine.
714
+ *
715
+ * @category Tool Call Types
716
+ */
717
+ export declare enum ToolCallStatus {
718
+ Streaming = "streaming",
719
+ PendingConfirmation = "pending-confirmation",
720
+ Running = "running",
721
+ PendingResultConfirmation = "pending-result-confirmation",
722
+ Completed = "completed",
723
+ Cancelled = "cancelled"
724
+ }
725
+ /**
726
+ * How a tool call was confirmed for execution.
727
+ *
728
+ * - `NotNeeded` — No confirmation required (auto-approved)
729
+ * - `UserAction` — User explicitly approved
730
+ * - `Setting` — Approved by a persistent user setting
731
+ *
732
+ * @category Tool Call Types
733
+ */
734
+ export declare enum ToolCallConfirmationReason {
735
+ NotNeeded = "not-needed",
736
+ UserAction = "user-action",
737
+ Setting = "setting"
738
+ }
739
+ /**
740
+ * Why a tool call was cancelled.
741
+ *
742
+ * @category Tool Call Types
743
+ */
744
+ export declare enum ToolCallCancellationReason {
745
+ Denied = "denied",
746
+ Skipped = "skipped",
747
+ ResultDenied = "result-denied"
748
+ }
749
+ /**
750
+ * Whether a confirmation option represents an approval or denial action.
751
+ *
752
+ * @category Tool Call Types
753
+ */
754
+ export declare enum ConfirmationOptionKind {
755
+ Approve = "approve",
756
+ Deny = "deny"
757
+ }
758
+ /**
759
+ * A confirmation option that the server offers for a tool call awaiting
760
+ * approval. Allows richer choices beyond simple approve/deny — for example,
761
+ * "Approve in this Session" or "Deny with reason."
762
+ *
763
+ * @category Tool Call Types
764
+ */
765
+ export interface ConfirmationOption {
766
+ /** Unique identifier for the option, returned in the confirmed action */
767
+ id: string;
768
+ /** Human-readable label displayed to the user */
769
+ label: string;
770
+ /** Whether this option represents an approval or denial */
771
+ kind: ConfirmationOptionKind;
772
+ /**
773
+ * Logical group number for visual categorisation.
774
+ *
775
+ * Clients SHOULD display options in the order they are defined and MAY
776
+ * use differing group numbers to insert dividers between logical clusters
777
+ * of options.
778
+ */
779
+ group?: number;
780
+ }
781
+ /**
782
+ * Metadata common to all tool call states.
783
+ *
784
+ * @category Tool Call Types
785
+ * @remarks
786
+ * Fields like `toolName` carry agent-specific identifiers on the wire despite the
787
+ * agent-agnostic design principle. These exist for debugging and logging purposes.
788
+ * A future version may move these to a separate diagnostic channel or namespace them
789
+ * more clearly.
790
+ */
791
+ interface ToolCallBase {
792
+ /** Unique tool call identifier */
793
+ toolCallId: string;
794
+ /** Internal tool name (for debugging/logging) */
795
+ toolName: string;
796
+ /** Human-readable tool name */
797
+ displayName: string;
798
+ /**
799
+ * If this tool is provided by a client, the `clientId` of the owning client.
800
+ * Absent for server-side tools.
801
+ *
802
+ * When set, the identified client is responsible for executing the tool and
803
+ * dispatching `session/toolCallComplete` with the result.
804
+ */
805
+ toolClientId?: string;
806
+ /**
807
+ * Additional provider-specific metadata for this tool call.
808
+ *
809
+ * Clients MAY look for well-known keys here to provide enhanced UI.
810
+ * For example, a `ptyTerminal` key with `{ input: string; output: string }`
811
+ * indicates the tool operated on a terminal (both `input` and `output` may
812
+ * contain escape sequences).
813
+ */
814
+ _meta?: Record<string, unknown>;
815
+ }
816
+ /**
817
+ * Properties available once tool call parameters are fully received.
818
+ *
819
+ * @category Tool Call Types
820
+ */
821
+ interface ToolCallParameterFields {
822
+ /** Message describing what the tool will do */
823
+ invocationMessage: StringOrMarkdown;
824
+ /** Raw tool input */
825
+ toolInput?: string;
826
+ }
827
+ /**
828
+ * Tool execution result details, available after execution completes.
829
+ *
830
+ * @category Tool Call Types
831
+ */
832
+ export interface ToolCallResult {
833
+ /** Whether the tool succeeded */
834
+ success: boolean;
835
+ /** Past-tense description of what the tool did */
836
+ pastTenseMessage: StringOrMarkdown;
837
+ /**
838
+ * Unstructured result content blocks.
839
+ *
840
+ * This mirrors the `content` field of MCP `CallToolResult`.
841
+ */
842
+ content?: ToolResultContent[];
843
+ /**
844
+ * Optional structured result object.
845
+ *
846
+ * This mirrors the `structuredContent` field of MCP `CallToolResult`.
847
+ */
848
+ structuredContent?: Record<string, unknown>;
849
+ /** Error details if the tool failed */
850
+ error?: {
851
+ message: string;
852
+ code?: string;
853
+ };
854
+ }
855
+ /**
856
+ * LM is streaming the tool call parameters.
857
+ *
858
+ * @category Tool Call Types
859
+ */
860
+ export interface ToolCallStreamingState extends ToolCallBase {
861
+ status: ToolCallStatus.Streaming;
862
+ /** Partial parameters accumulated so far */
863
+ partialInput?: string;
864
+ /** Progress message shown while parameters are streaming */
865
+ invocationMessage?: StringOrMarkdown;
866
+ }
867
+ /**
868
+ * Parameters are complete, or a running tool requires re-confirmation
869
+ * (e.g. a mid-execution permission check).
870
+ *
871
+ * @category Tool Call Types
872
+ */
873
+ export interface ToolCallPendingConfirmationState extends ToolCallBase, ToolCallParameterFields {
874
+ status: ToolCallStatus.PendingConfirmation;
875
+ /** Short title for the confirmation prompt (e.g. `"Run in terminal"`, `"Write file"`) */
876
+ confirmationTitle?: StringOrMarkdown;
877
+ /** File edits that this tool call will perform, for preview before confirmation */
878
+ edits?: {
879
+ items: FileEdit[];
880
+ };
881
+ /** Whether the agent host allows the client to edit the tool's input parameters before confirming */
882
+ editable?: boolean;
883
+ /**
884
+ * Options the server offers for this confirmation. When present, the client
885
+ * SHOULD render these instead of a plain approve/deny UI. Each option
886
+ * belongs to a {@link ConfirmationOptionGroup} so the client can still
887
+ * categorise the choices.
888
+ */
889
+ options?: ConfirmationOption[];
890
+ }
891
+ /**
892
+ * Tool is actively executing.
893
+ *
894
+ * @category Tool Call Types
895
+ */
896
+ export interface ToolCallRunningState extends ToolCallBase, ToolCallParameterFields {
897
+ status: ToolCallStatus.Running;
898
+ /** How the tool was confirmed for execution */
899
+ confirmed: ToolCallConfirmationReason;
900
+ /** The confirmation option the user selected, if confirmation options were provided */
901
+ selectedOption?: ConfirmationOption;
902
+ /**
903
+ * Partial content produced while the tool is still executing.
904
+ *
905
+ * For example, a terminal content block lets clients subscribe to live
906
+ * output before the tool completes.
907
+ */
908
+ content?: ToolResultContent[];
909
+ }
910
+ /**
911
+ * Tool finished executing, waiting for client to approve the result.
912
+ *
913
+ * @category Tool Call Types
914
+ */
915
+ export interface ToolCallPendingResultConfirmationState extends ToolCallBase, ToolCallParameterFields, ToolCallResult {
916
+ status: ToolCallStatus.PendingResultConfirmation;
917
+ /** How the tool was confirmed for execution */
918
+ confirmed: ToolCallConfirmationReason;
919
+ /** The confirmation option the user selected, if confirmation options were provided */
920
+ selectedOption?: ConfirmationOption;
921
+ }
922
+ /**
923
+ * Tool completed successfully or with an error.
924
+ *
925
+ * @category Tool Call Types
926
+ */
927
+ export interface ToolCallCompletedState extends ToolCallBase, ToolCallParameterFields, ToolCallResult {
928
+ status: ToolCallStatus.Completed;
929
+ /** How the tool was confirmed for execution */
930
+ confirmed: ToolCallConfirmationReason;
931
+ /** The confirmation option the user selected, if confirmation options were provided */
932
+ selectedOption?: ConfirmationOption;
933
+ }
934
+ /**
935
+ * Tool call was cancelled before execution.
936
+ *
937
+ * @category Tool Call Types
938
+ */
939
+ export interface ToolCallCancelledState extends ToolCallBase, ToolCallParameterFields {
940
+ status: ToolCallStatus.Cancelled;
941
+ /** Why the tool was cancelled */
942
+ reason: ToolCallCancellationReason;
943
+ /** Optional message explaining the cancellation */
944
+ reasonMessage?: StringOrMarkdown;
945
+ /** What the user suggested doing instead */
946
+ userSuggestion?: UserMessage;
947
+ /** The confirmation option the user selected, if confirmation options were provided */
948
+ selectedOption?: ConfirmationOption;
949
+ }
950
+ /**
951
+ * Discriminated union of all tool call lifecycle states.
952
+ *
953
+ * See the [state model guide](/guide/state-model.html#tool-call-lifecycle)
954
+ * for the full state machine diagram.
955
+ *
956
+ * @category Tool Call Types
957
+ */
958
+ export type ToolCallState = ToolCallStreamingState | ToolCallPendingConfirmationState | ToolCallRunningState | ToolCallPendingResultConfirmationState | ToolCallCompletedState | ToolCallCancelledState;
959
+ /**
960
+ * Describes a tool available in a session, provided by either the server or the active client.
961
+ *
962
+ * @category Tool Definition Types
963
+ */
964
+ export interface ToolDefinition {
965
+ /** Unique tool identifier */
966
+ name: string;
967
+ /** Human-readable display name */
968
+ title?: string;
969
+ /** Description of what the tool does */
970
+ description?: string;
971
+ /**
972
+ * JSON Schema defining the expected input parameters.
973
+ *
974
+ * Optional because client-provided tools may not have formal schemas.
975
+ * Mirrors MCP `Tool.inputSchema`.
976
+ */
977
+ inputSchema?: {
978
+ type: 'object';
979
+ properties?: Record<string, object>;
980
+ required?: string[];
981
+ };
982
+ /**
983
+ * JSON Schema defining the structure of the tool's output.
984
+ *
985
+ * Mirrors MCP `Tool.outputSchema`.
986
+ */
987
+ outputSchema?: {
988
+ type: 'object';
989
+ properties?: Record<string, object>;
990
+ required?: string[];
991
+ };
992
+ /** Behavioral hints about the tool. All properties are advisory. */
993
+ annotations?: ToolAnnotations;
994
+ /**
995
+ * Additional provider-specific metadata.
996
+ *
997
+ * Mirrors the MCP `_meta` convention.
998
+ */
999
+ _meta?: Record<string, unknown>;
1000
+ }
1001
+ /**
1002
+ * Behavioral hints about a tool. All properties are advisory and not
1003
+ * guaranteed to faithfully describe tool behavior.
1004
+ *
1005
+ * Mirrors MCP `ToolAnnotations` from the Model Context Protocol specification.
1006
+ *
1007
+ * @category Tool Definition Types
1008
+ */
1009
+ export interface ToolAnnotations {
1010
+ /** Alternate human-readable title */
1011
+ title?: string;
1012
+ /** Tool does not modify its environment (default: false) */
1013
+ readOnlyHint?: boolean;
1014
+ /** Tool may perform destructive updates (default: true) */
1015
+ destructiveHint?: boolean;
1016
+ /** Repeated calls with the same arguments have no additional effect (default: false) */
1017
+ idempotentHint?: boolean;
1018
+ /** Tool may interact with external entities (default: true) */
1019
+ openWorldHint?: boolean;
1020
+ }
1021
+ /**
1022
+ * Discriminant for tool result content types.
1023
+ *
1024
+ * @category Tool Result Content
1025
+ */
1026
+ export declare enum ToolResultContentType {
1027
+ Text = "text",
1028
+ EmbeddedResource = "embeddedResource",
1029
+ Resource = "resource",
1030
+ FileEdit = "fileEdit",
1031
+ Terminal = "terminal",
1032
+ Subagent = "subagent"
1033
+ }
1034
+ /**
1035
+ * Text content in a tool result.
1036
+ *
1037
+ * Mirrors MCP `TextContent`.
1038
+ *
1039
+ * @category Tool Result Content
1040
+ */
1041
+ export interface ToolResultTextContent {
1042
+ type: ToolResultContentType.Text;
1043
+ /** The text content */
1044
+ text: string;
1045
+ }
1046
+ /**
1047
+ * Base64-encoded binary content embedded in a tool result.
1048
+ *
1049
+ * Mirrors MCP `EmbeddedResource` for inline binary data.
1050
+ *
1051
+ * @category Tool Result Content
1052
+ */
1053
+ export interface ToolResultEmbeddedResourceContent {
1054
+ type: ToolResultContentType.EmbeddedResource;
1055
+ /** Base64-encoded data */
1056
+ data: string;
1057
+ /** Content type (e.g. `"image/png"`, `"application/pdf"`) */
1058
+ contentType: string;
1059
+ }
1060
+ /**
1061
+ * A reference to a resource stored outside the tool result.
1062
+ *
1063
+ * Wraps {@link ContentRef} for lazy-loading large results.
1064
+ *
1065
+ * @category Tool Result Content
1066
+ */
1067
+ export interface ToolResultResourceContent extends ContentRef {
1068
+ type: ToolResultContentType.Resource;
1069
+ }
1070
+ /**
1071
+ * Describes a file modification performed by a tool.
1072
+ *
1073
+ * @category Tool Result Content
1074
+ */
1075
+ export interface ToolResultFileEditContent extends FileEdit {
1076
+ type: ToolResultContentType.FileEdit;
1077
+ }
1078
+ /**
1079
+ * A reference to a terminal whose output is relevant to this tool result.
1080
+ *
1081
+ * Clients can subscribe to the terminal's URI to stream its output in real
1082
+ * time, providing live feedback while a tool is executing.
1083
+ *
1084
+ * @category Tool Result Content
1085
+ */
1086
+ export interface ToolResultTerminalContent {
1087
+ type: ToolResultContentType.Terminal;
1088
+ /** Terminal URI (subscribable for full terminal state) */
1089
+ resource: URI;
1090
+ /** Display title for the terminal content */
1091
+ title: string;
1092
+ }
1093
+ /**
1094
+ * A reference to a subagent session spawned by a tool.
1095
+ *
1096
+ * Clients can subscribe to the subagent's session URI to stream its
1097
+ * progress in real time, including inner tool calls and responses.
1098
+ *
1099
+ * @category Tool Result Content
1100
+ */
1101
+ export interface ToolResultSubagentContent {
1102
+ type: ToolResultContentType.Subagent;
1103
+ /** Subagent session URI (subscribable for full session state) */
1104
+ resource: URI;
1105
+ /** Display title for the subagent */
1106
+ title: string;
1107
+ /** Internal agent name */
1108
+ agentName?: string;
1109
+ /** Human-readable description of the subagent's task */
1110
+ description?: string;
1111
+ }
1112
+ /**
1113
+ * Content block in a tool result.
1114
+ *
1115
+ * Mirrors the content blocks in MCP `CallToolResult.content`, plus
1116
+ * `ToolResultResourceContent` for lazy-loading large results,
1117
+ * `ToolResultFileEditContent` for file edit diffs,
1118
+ * `ToolResultTerminalContent` for live terminal output, and
1119
+ * `ToolResultSubagentContent` for subagent sessions (AHP extensions).
1120
+ *
1121
+ * @category Tool Result Content
1122
+ */
1123
+ export type ToolResultContent = ToolResultTextContent | ToolResultEmbeddedResourceContent | ToolResultResourceContent | ToolResultFileEditContent | ToolResultTerminalContent | ToolResultSubagentContent;
1124
+ /**
1125
+ * A lightweight reference to a custom agent contributed by a customization.
1126
+ *
1127
+ * Custom agents have a single `name` (sourced from the agent file's YAML
1128
+ * frontmatter, or derived from the file name); they do not have a separate
1129
+ * display name.
1130
+ *
1131
+ * @category Customization Types
1132
+ */
1133
+ export interface CustomizationAgentRef {
1134
+ /** Stable agent URI */
1135
+ uri: URI;
1136
+ /** Agent name (from frontmatter `name`, or file-derived) */
1137
+ name: string;
1138
+ /** Optional short description for UI preview (from frontmatter `description`) */
1139
+ description?: string;
1140
+ }
1141
+ /**
1142
+ * A reference to an [Open Plugins](https://open-plugins.com/) plugin.
1143
+ *
1144
+ * This is intentionally thin — AHP specifies plugin identity and metadata
1145
+ * but not implementation details, which are defined by the Open Plugins spec.
1146
+ *
1147
+ * @category Customization Types
1148
+ */
1149
+ export interface CustomizationRef {
1150
+ /** Plugin URI (e.g. an HTTPS URL or marketplace identifier) */
1151
+ uri: URI;
1152
+ /** Human-readable name */
1153
+ displayName: string;
1154
+ /** Description of what the plugin provides */
1155
+ description?: string;
1156
+ /** Icons for the plugin */
1157
+ icons?: Icon[];
1158
+ /**
1159
+ * Opaque version token for this customization.
1160
+ *
1161
+ * Clients SHOULD include a nonce with every customization they provide.
1162
+ * Consumers can compare nonces to detect whether a customization has
1163
+ * changed since it was last seen, avoiding redundant reloads or copies.
1164
+ */
1165
+ nonce?: string;
1166
+ }
1167
+ /**
1168
+ * Loading status for a server-managed customization.
1169
+ *
1170
+ * @category Customization Types
1171
+ */
1172
+ export declare enum CustomizationStatus {
1173
+ /** Plugin is being loaded */
1174
+ Loading = "loading",
1175
+ /** Plugin is fully operational */
1176
+ Loaded = "loaded",
1177
+ /** Plugin partially loaded but has warnings */
1178
+ Degraded = "degraded",
1179
+ /** Plugin was unable to load */
1180
+ Error = "error"
1181
+ }
1182
+ /**
1183
+ * A customization active in a session.
1184
+ *
1185
+ * @category Customization Types
1186
+ */
1187
+ export interface SessionCustomization {
1188
+ /** The plugin this customization refers to */
1189
+ customization: CustomizationRef;
1190
+ /** Whether this customization is currently enabled */
1191
+ enabled: boolean;
1192
+ /**
1193
+ * The `clientId` of the client that contributed this customization.
1194
+ * Absent for server-provided customizations.
1195
+ */
1196
+ clientId?: string;
1197
+ /** Server-reported loading status */
1198
+ status?: CustomizationStatus;
1199
+ /**
1200
+ * Human-readable status detail (e.g. error message or degradation warning).
1201
+ */
1202
+ statusMessage?: string;
1203
+ /**
1204
+ * Custom agents contributed by this customization, as resolved by the
1205
+ * agent host after parsing the customization.
1206
+ *
1207
+ * Consumers MUST treat an absent field as "unknown" (e.g. the host has
1208
+ * not finished parsing the customization yet). An empty array means the
1209
+ * host parsed the customization and it contributes no agents.
1210
+ *
1211
+ * Clients are not authoritative here: only the agent host populates
1212
+ * this field.
1213
+ */
1214
+ agents?: CustomizationAgentRef[];
1215
+ }
1216
+ export {};
1217
+ //# sourceMappingURL=state.d.ts.map