@canonmsg/agent-sdk 11.2.0 → 12.0.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 (188) hide show
  1. package/README.md +171 -536
  2. package/dist/chunks/chunk-6VK4UZHJ.js +2806 -0
  3. package/dist/chunks/chunk-FPQFTTND.js +4899 -0
  4. package/dist/chunks/chunk-OLJ7H4E2.js +14705 -0
  5. package/dist/chunks/mls-crypto-NZDNSPAO.js +10 -0
  6. package/dist/cli.js +198 -0
  7. package/dist/drivers/claude.d.ts +36 -0
  8. package/dist/drivers/code.d.ts +18 -0
  9. package/dist/drivers/codex.d.ts +37 -0
  10. package/dist/index.d.ts +12 -25
  11. package/dist/index.js +69 -13
  12. package/dist/internal/backend-contracts/agentBehaviorPolicy.d.ts +122 -0
  13. package/dist/internal/backend-contracts/agentDirectory.d.ts +32 -0
  14. package/dist/internal/backend-contracts/agentOrigin.d.ts +23 -0
  15. package/dist/internal/backend-contracts/agentSearch.d.ts +17 -0
  16. package/dist/internal/backend-contracts/api-origins.generated.d.ts +4 -0
  17. package/dist/internal/backend-contracts/apiErrors.d.ts +1 -0
  18. package/dist/internal/backend-contracts/artifactActions.d.ts +159 -0
  19. package/dist/internal/backend-contracts/artifacts.d.ts +386 -0
  20. package/dist/internal/backend-contracts/communication.d.ts +131 -0
  21. package/dist/internal/backend-contracts/conversationMembership.d.ts +28 -0
  22. package/dist/internal/backend-contracts/deliveryObservation.d.ts +23 -0
  23. package/dist/internal/backend-contracts/diffRedaction.d.ts +6 -0
  24. package/dist/internal/backend-contracts/endpoint-unread.d.ts +4 -0
  25. package/dist/internal/backend-contracts/endpoint.d.ts +103 -0
  26. package/dist/internal/backend-contracts/endpointContentPolicy.d.ts +37 -0
  27. package/dist/internal/backend-contracts/environment.d.ts +20 -0
  28. package/dist/internal/backend-contracts/externalInbound.d.ts +24 -0
  29. package/dist/internal/backend-contracts/firestoreValues.d.ts +9 -0
  30. package/dist/internal/backend-contracts/index.d.ts +48 -0
  31. package/dist/internal/backend-contracts/media-url.d.ts +6 -0
  32. package/dist/internal/backend-contracts/media.d.ts +51 -0
  33. package/dist/internal/backend-contracts/mediaDelivery.d.ts +46 -0
  34. package/dist/internal/backend-contracts/mediaTransferProtocol.d.ts +17 -0
  35. package/dist/internal/backend-contracts/membershipChange.d.ts +21 -0
  36. package/dist/internal/backend-contracts/message.d.ts +86 -0
  37. package/dist/internal/backend-contracts/messageText.d.ts +6 -0
  38. package/dist/internal/backend-contracts/mlsDevApplication.d.ts +73 -0
  39. package/dist/internal/backend-contracts/mlsDevCredential.d.ts +75 -0
  40. package/dist/internal/backend-contracts/mlsDevCredentialReconciliation.d.ts +45 -0
  41. package/dist/internal/backend-contracts/mlsDevDeviceCustody.d.ts +51 -0
  42. package/dist/internal/backend-contracts/mlsDevEnrollment.d.ts +74 -0
  43. package/dist/internal/backend-contracts/mlsDevGroup.d.ts +197 -0
  44. package/dist/internal/backend-contracts/mlsDevGroupFeed.d.ts +47 -0
  45. package/dist/internal/backend-contracts/mlsDevKeyPackage.d.ts +42 -0
  46. package/dist/internal/backend-contracts/mlsDevKeyPackages.d.ts +55 -0
  47. package/dist/internal/backend-contracts/moderation.d.ts +7 -0
  48. package/dist/internal/backend-contracts/plaintextProcessors.d.ts +63 -0
  49. package/dist/internal/backend-contracts/preparedContent.d.ts +54 -0
  50. package/dist/internal/backend-contracts/replyAuthority.d.ts +14 -0
  51. package/dist/internal/backend-contracts/runtimeCardFields.d.ts +66 -0
  52. package/dist/internal/backend-contracts/runtimeCardStorage.d.ts +3 -0
  53. package/dist/internal/backend-contracts/runtimeDescriptor.d.ts +88 -0
  54. package/dist/internal/backend-contracts/selfContext.d.ts +9 -0
  55. package/dist/internal/backend-contracts/turnProtocol.d.ts +43 -0
  56. package/dist/internal/backend-contracts/verbContract.d.ts +848 -0
  57. package/dist/internal/backend-contracts/verbSchemas.d.ts +1707 -0
  58. package/dist/internal/backend-contracts/verbWire.d.ts +493 -0
  59. package/dist/internal/backend-contracts/webAuth.d.ts +8 -0
  60. package/dist/internal/backend-contracts/workSessions.d.ts +205 -0
  61. package/dist/internal/core/agent-profiles.d.ts +69 -0
  62. package/dist/internal/core/agent-resolver.d.ts +49 -0
  63. package/dist/internal/core/agent-session.d.ts +12 -0
  64. package/dist/internal/core/approval-format.d.ts +26 -0
  65. package/dist/internal/core/approval-manager.d.ts +43 -0
  66. package/dist/internal/core/approval-types.d.ts +74 -0
  67. package/dist/internal/core/artifacts.d.ts +262 -0
  68. package/dist/internal/core/attached-native-session.d.ts +174 -0
  69. package/dist/internal/core/attached-session-file-store.d.ts +3 -0
  70. package/dist/internal/core/base-url.d.ts +1 -0
  71. package/dist/internal/core/cli-metadata.d.ts +13 -0
  72. package/dist/internal/core/client.d.ts +486 -0
  73. package/dist/internal/core/completed-output-journal.d.ts +39 -0
  74. package/dist/internal/core/constants.d.ts +4 -0
  75. package/dist/internal/core/control-poller.d.ts +221 -0
  76. package/dist/internal/core/endpoint-client.d.ts +43 -0
  77. package/dist/internal/core/exclusive-json-file-store.d.ts +7 -0
  78. package/dist/internal/core/execution-environment-mode.d.ts +8 -0
  79. package/dist/internal/core/execution-environment.d.ts +55 -0
  80. package/dist/internal/core/gifs.d.ts +35 -0
  81. package/dist/internal/core/group-context.d.ts +25 -0
  82. package/dist/internal/core/host-runtime.d.ts +257 -0
  83. package/dist/internal/core/inbound-frame.d.ts +64 -0
  84. package/dist/internal/core/index.d.ts +107 -0
  85. package/dist/internal/core/local-runtime-catalog.d.ts +131 -0
  86. package/dist/internal/core/message-format.d.ts +13 -0
  87. package/dist/internal/core/native-session-interaction.d.ts +44 -0
  88. package/dist/internal/core/node-media.d.ts +6 -0
  89. package/dist/internal/core/policy.d.ts +2 -0
  90. package/dist/internal/core/provenance.d.ts +31 -0
  91. package/dist/internal/core/registration-cli.d.ts +40 -0
  92. package/dist/internal/core/registration-profile.d.ts +10 -0
  93. package/dist/internal/core/registration-session.d.ts +55 -0
  94. package/dist/internal/core/registration.d.ts +21 -0
  95. package/dist/internal/core/retry.d.ts +122 -0
  96. package/dist/internal/core/rtdb-rest.d.ts +145 -0
  97. package/dist/internal/core/runtime-cards.d.ts +331 -0
  98. package/dist/internal/core/runtime-descriptor.d.ts +75 -0
  99. package/dist/internal/core/runtime-endpoints.d.ts +26 -0
  100. package/dist/internal/core/runtime-heartbeat.d.ts +29 -0
  101. package/dist/internal/core/runtime-presentation.d.ts +35 -0
  102. package/dist/internal/core/runtime-request-manager.d.ts +284 -0
  103. package/dist/internal/core/runtime-state-publisher.d.ts +42 -0
  104. package/dist/internal/core/self-context.d.ts +61 -0
  105. package/dist/internal/core/silent-turn.d.ts +86 -0
  106. package/dist/internal/core/stream.d.ts +77 -0
  107. package/dist/internal/core/turn-output-controller.d.ts +69 -0
  108. package/dist/internal/core/turn-protocol.d.ts +33 -0
  109. package/dist/internal/core/turn-verbosity.d.ts +97 -0
  110. package/dist/internal/core/types.d.ts +1075 -0
  111. package/dist/internal/core/typing-status-publisher.d.ts +14 -0
  112. package/dist/internal/core/unified-diff.d.ts +35 -0
  113. package/dist/internal/core/work-session-provider.d.ts +29 -0
  114. package/dist/internal/core/workspace-discovery.d.ts +17 -0
  115. package/dist/internal/endpoint/artifact-images.d.ts +60 -0
  116. package/dist/internal/endpoint/artifact-reducer.d.ts +35 -0
  117. package/dist/internal/endpoint/artifact-views.d.ts +113 -0
  118. package/dist/internal/endpoint/artifacts.d.ts +75 -0
  119. package/dist/internal/endpoint/delivery.d.ts +47 -0
  120. package/dist/internal/endpoint/engine.d.ts +219 -0
  121. package/dist/internal/endpoint/ephemeral.d.ts +8 -0
  122. package/dist/internal/endpoint/events.d.ts +32 -0
  123. package/dist/internal/endpoint/external-inbound.d.ts +36 -0
  124. package/dist/internal/endpoint/handoff.d.ts +50 -0
  125. package/dist/internal/endpoint/history.d.ts +22 -0
  126. package/dist/internal/endpoint/image-generation-errors.d.ts +2 -0
  127. package/dist/internal/endpoint/inbound.d.ts +29 -0
  128. package/dist/internal/endpoint/index.d.ts +32 -0
  129. package/dist/internal/endpoint/media.d.ts +172 -0
  130. package/dist/internal/endpoint/migration.d.ts +50 -0
  131. package/dist/internal/endpoint/mls-crypto.d.ts +25 -0
  132. package/dist/internal/endpoint/mls-dev-client.d.ts +44 -0
  133. package/dist/internal/endpoint/mls-dev-device.d.ts +67 -0
  134. package/dist/internal/endpoint/mls-dev-groups.d.ts +114 -0
  135. package/dist/internal/endpoint/mls-dev-key-package-service.d.ts +33 -0
  136. package/dist/internal/endpoint/mls-dev-key-packages.d.ts +42 -0
  137. package/dist/internal/endpoint/mls-dev-transport.d.ts +37 -0
  138. package/dist/internal/endpoint/node-mls-custody-protocol.d.ts +24 -0
  139. package/dist/internal/endpoint/node-mls-custody.d.ts +15 -0
  140. package/dist/internal/endpoint/node.d.ts +7 -0
  141. package/dist/internal/endpoint/observe-query.d.ts +17 -0
  142. package/dist/internal/endpoint/portable-node-mls-custody.d.ts +23 -0
  143. package/dist/internal/endpoint/queue.d.ts +22 -0
  144. package/dist/internal/endpoint/recovery.d.ts +27 -0
  145. package/dist/internal/endpoint/retention.d.ts +7 -0
  146. package/dist/internal/endpoint/store.d.ts +22 -0
  147. package/dist/internal/endpoint/sync.d.ts +33 -0
  148. package/dist/internal/endpoint/transient-publisher.d.ts +8 -0
  149. package/dist/internal/endpoint/transport.d.ts +58 -0
  150. package/dist/media.d.ts +1 -1
  151. package/dist/media.js +42 -541
  152. package/dist/runner/runner.d.ts +37 -0
  153. package/dist/runner/types.d.ts +168 -0
  154. package/package.json +18 -5
  155. package/dist/attached-session.d.ts +0 -58
  156. package/dist/attached-session.js +0 -638
  157. package/dist/bounded-file-read.d.ts +0 -14
  158. package/dist/bounded-file-read.js +0 -34
  159. package/dist/canon-agent.d.ts +0 -238
  160. package/dist/canon-agent.js +0 -2534
  161. package/dist/debouncer.d.ts +0 -18
  162. package/dist/debouncer.js +0 -133
  163. package/dist/inbound-handoff.d.ts +0 -6
  164. package/dist/inbound-handoff.js +0 -17
  165. package/dist/managed-session-host.d.ts +0 -27
  166. package/dist/managed-session-host.js +0 -195
  167. package/dist/managed-session-setup.d.ts +0 -99
  168. package/dist/managed-session-setup.js +0 -234
  169. package/dist/realtime.d.ts +0 -62
  170. package/dist/realtime.js +0 -193
  171. package/dist/runtime-card.d.ts +0 -48
  172. package/dist/runtime-card.js +0 -64
  173. package/dist/session-manager.d.ts +0 -77
  174. package/dist/session-manager.js +0 -285
  175. package/dist/turn-streaming-request.d.ts +0 -17
  176. package/dist/turn-streaming-request.js +0 -22
  177. package/dist/turn-verbosity-option.d.ts +0 -33
  178. package/dist/turn-verbosity-option.js +0 -23
  179. package/dist/types.d.ts +0 -387
  180. package/dist/types.js +0 -1
  181. package/dist/work-session-coordination.d.ts +0 -21
  182. package/dist/work-session-coordination.js +0 -53
  183. package/dist/work-session-host.d.ts +0 -31
  184. package/dist/work-session-host.js +0 -617
  185. package/dist/work-session-interactions.d.ts +0 -12
  186. package/dist/work-session-interactions.js +0 -173
  187. package/dist/work-session-state.d.ts +0 -36
  188. package/dist/work-session-state.js +0 -62
@@ -0,0 +1,493 @@
1
+ /**
2
+ * Canon verb WIRE contract — `canon.verb-wire.v1`.
3
+ *
4
+ * The verb INTENT contract (`canon.verbs.v1`, verbContract.ts) is the
5
+ * plaintext semantic input used locally by tools, MCP, SDK, and adapters. It
6
+ * is NOT the remote wire schema. What crosses the network is this contract:
7
+ * an authenticated public ENVELOPE (the routing/policy metadata the server
8
+ * may read, authorize, and enforce on) plus a BODY that is either plaintext
9
+ * JSON (temporary/plaintext conversations) or MLS ciphertext (encrypted
10
+ * conversations). See docs/design/e2ee-mls.md §1-2.
11
+ *
12
+ * one developer-facing API ≠ one plaintext wire schema
13
+ *
14
+ * Server endpoints (/agent/verbs/*) implement THIS contract with the `json`
15
+ * codec initially; MLS lands later as a codec swap, not an API change. In
16
+ * `json` mode the server may additionally read `body.value` to execute
17
+ * legacy behavior (validation, snapshot building); in `mls` mode the
18
+ * envelope is everything it will ever see.
19
+ *
20
+ * The intent→wire projection (and its inverse, used by the server executor
21
+ * in json mode) is defined here so every binding and the server agree on
22
+ * exactly which intent fields are envelope (server-visible) vs body
23
+ * (content). The split follows the 2026-07-12 plaintext audit: closed
24
+ * enums, ids, deadlines, and turn-protocol keys are envelope; free text,
25
+ * cards, prompts, questions, tool names/summaries, details, diffs, and
26
+ * self-contexts are body.
27
+ */
28
+ import { type CanonVerbName, type VerbNativeMetadata, type VerbSessionSelection } from './verbContract.js';
29
+ export declare const CANON_VERB_WIRE_SCHEMA_VERSION = "canon.verb-wire.v1";
30
+ export declare const CANON_VERB_WIRE_SCHEMA_ID = "https://canonmsg.com/schemas/canon.verb-wire.v1.json";
31
+ export type VerbWireBody = {
32
+ encoding: 'json';
33
+ value: Record<string, unknown>;
34
+ } | {
35
+ encoding: 'mls';
36
+ epoch: number;
37
+ ciphertext: string;
38
+ aadHash: string;
39
+ };
40
+ /** Turn-protocol keys the server enforces on (subset of TurnMetadata). */
41
+ export interface VerbWireTurn {
42
+ turnId?: string | null;
43
+ turnSemantics?: 'progress' | 'turn_complete' | 'control';
44
+ deliveryIntent?: 'queue' | 'interrupt' | 'interleave' | 'stop';
45
+ replyBehavior?: 'allow_auto_reply' | 'suppress_auto_reply';
46
+ }
47
+ /**
48
+ * The authenticated public envelope. Every field is routing/policy metadata
49
+ * the server needs to operate the network; none of it is message content.
50
+ * Which fields are permitted/required varies per verb — see
51
+ * VERB_WIRE_ENVELOPE_FIELDS and the per-verb projections.
52
+ *
53
+ * Documented leak decisions (see e2ee-mls.md §10): `mentions` stays
54
+ * plaintext for routing + mention-piercing pushes (D3); `contactUserId` on
55
+ * share_contact reveals who was shared (explicitly accepted for v1);
56
+ * `native` carries only typed correlation ids. Paths, labels, prompts, summaries, and other free
57
+ * text belong in the body or owner-local runtime state.
58
+ */
59
+ export interface CanonVerbWireEnvelope {
60
+ conversationId?: string;
61
+ targetUserId?: string;
62
+ canonContactId?: string;
63
+ sourceConversationId?: string;
64
+ contactUserId?: string;
65
+ requestId?: string;
66
+ responseUserId?: string;
67
+ /** Absolute epoch-ms deadline. Bindings convert timeoutMs before the wire. */
68
+ expiresAt?: number;
69
+ mode?: 'blocking' | 'detached';
70
+ kind?: 'clarify' | 'sudo' | 'secret';
71
+ sensitive?: boolean;
72
+ allowSessionRule?: boolean;
73
+ riskLevel?: 'normal' | 'destructive';
74
+ risk?: 'low' | 'normal' | 'high' | 'destructive';
75
+ category?: 'command' | 'file' | 'network' | 'browser' | 'mcp' | 'plugin' | 'canon' | 'tool';
76
+ sessionSelection?: VerbSessionSelection;
77
+ idempotencyKey?: string;
78
+ /** Target-message reference for react/forward — routing, not content. */
79
+ messageId?: string;
80
+ replyTo?: string;
81
+ replyToPosition?: number;
82
+ mentions?: string[];
83
+ /** Group-membership routing ids (create_group) — distinct from mentions. */
84
+ memberIds?: string[];
85
+ turn?: VerbWireTurn;
86
+ native?: VerbNativeMetadata;
87
+ runtimeId?: string;
88
+ limit?: number;
89
+ }
90
+ export interface CanonVerbWireRequest {
91
+ wire: typeof CANON_VERB_WIRE_SCHEMA_VERSION;
92
+ verb: CanonVerbName;
93
+ envelope: CanonVerbWireEnvelope;
94
+ body: VerbWireBody;
95
+ }
96
+ /**
97
+ * Server-side acceptance result for the interactive verbs (request_input,
98
+ * request_approval in blocking mode, request_card). The wire endpoint owns
99
+ * create/validate/route; the runtime library completes the intent-level
100
+ * result (submitted/allow/…) by consuming — a server cannot hold a
101
+ * 30-minute-to-72-hour HTTP response open.
102
+ */
103
+ export interface VerbWireAccepted {
104
+ status: 'accepted';
105
+ requestId: string;
106
+ expiresAt?: number;
107
+ messageId?: string;
108
+ responseUserId?: string;
109
+ interactive?: boolean;
110
+ }
111
+ export interface CanonVerbWireResponse {
112
+ wire: typeof CANON_VERB_WIRE_SCHEMA_VERSION;
113
+ verb: CanonVerbName;
114
+ /**
115
+ * json codec: `value` is the verb's canonical result (send_to/check_
116
+ * approval/share_contact/reads) or VerbWireAccepted (interactive creates).
117
+ * mls codec (future): content-bearing results become ciphertext.
118
+ */
119
+ result: VerbWireBody;
120
+ }
121
+ export declare const VERB_WIRE_ENVELOPE_FIELDS: Record<CanonVerbName, {
122
+ required: readonly string[];
123
+ optional: readonly string[];
124
+ }>;
125
+ export declare const CANON_VERB_WIRE_JSON_SCHEMA: {
126
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
127
+ readonly $id: "https://canonmsg.com/schemas/canon.verb-wire.v1.json";
128
+ readonly title: "Canon Verb Wire v1";
129
+ readonly description: string;
130
+ readonly type: "object";
131
+ readonly required: readonly ["wire", "verb", "envelope", "body"];
132
+ readonly additionalProperties: false;
133
+ readonly properties: {
134
+ readonly wire: {
135
+ readonly const: "canon.verb-wire.v1";
136
+ };
137
+ readonly verb: {
138
+ readonly enum: readonly ["send_to", "request_input", "request_approval", "check_approval", "send_card", "request_card", "share_contact", "react", "forward", "create_group", "add_member", "remove_member", "leave_conversation", "list_contacts", "list_conversations", "no_reply"];
139
+ };
140
+ readonly envelope: {
141
+ readonly $ref: "#/$defs/envelope";
142
+ };
143
+ readonly body: {
144
+ readonly $ref: "#/$defs/body";
145
+ };
146
+ };
147
+ readonly $defs: {
148
+ readonly body: {
149
+ readonly description: string;
150
+ readonly oneOf: readonly [{
151
+ readonly type: "object";
152
+ readonly required: readonly ["encoding", "value"];
153
+ readonly additionalProperties: false;
154
+ readonly properties: {
155
+ readonly encoding: {
156
+ readonly const: "json";
157
+ };
158
+ readonly value: {
159
+ readonly type: "object";
160
+ };
161
+ };
162
+ }, {
163
+ readonly type: "object";
164
+ readonly required: readonly ["encoding", "epoch", "ciphertext", "aadHash"];
165
+ readonly additionalProperties: false;
166
+ readonly properties: {
167
+ readonly encoding: {
168
+ readonly const: "mls";
169
+ };
170
+ readonly epoch: {
171
+ readonly type: "integer";
172
+ readonly minimum: 0;
173
+ };
174
+ readonly ciphertext: {
175
+ readonly type: "string";
176
+ readonly minLength: 1;
177
+ };
178
+ readonly aadHash: {
179
+ readonly type: "string";
180
+ readonly minLength: 1;
181
+ readonly description: "Hash binding the envelope (AAD) to the ciphertext.";
182
+ };
183
+ };
184
+ }];
185
+ };
186
+ readonly envelope: {
187
+ readonly type: "object";
188
+ readonly description: string;
189
+ readonly additionalProperties: false;
190
+ readonly properties: {
191
+ readonly conversationId: {
192
+ readonly type: "string";
193
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
194
+ };
195
+ readonly targetUserId: {
196
+ readonly type: "string";
197
+ readonly minLength: 1;
198
+ };
199
+ readonly canonContactId: {
200
+ readonly type: "string";
201
+ readonly minLength: 1;
202
+ };
203
+ readonly sourceConversationId: {
204
+ readonly type: "string";
205
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
206
+ };
207
+ readonly contactUserId: {
208
+ readonly type: "string";
209
+ readonly minLength: 1;
210
+ };
211
+ readonly requestId: {
212
+ readonly type: "string";
213
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
214
+ };
215
+ readonly responseUserId: {
216
+ readonly type: "string";
217
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
218
+ };
219
+ readonly expiresAt: {
220
+ readonly type: "integer";
221
+ readonly minimum: 0;
222
+ };
223
+ readonly mode: {
224
+ readonly enum: readonly ["blocking", "detached"];
225
+ };
226
+ readonly kind: {
227
+ readonly enum: readonly ["clarify", "sudo", "secret"];
228
+ };
229
+ readonly sensitive: {
230
+ readonly type: "boolean";
231
+ };
232
+ readonly allowSessionRule: {
233
+ readonly type: "boolean";
234
+ };
235
+ readonly riskLevel: {
236
+ readonly enum: readonly ["normal", "destructive"];
237
+ };
238
+ readonly risk: {
239
+ readonly enum: readonly ["low", "normal", "high", "destructive"];
240
+ };
241
+ readonly category: {
242
+ readonly enum: readonly ["command", "file", "network", "browser", "mcp", "plugin", "canon", "tool"];
243
+ };
244
+ readonly sessionSelection: {
245
+ readonly oneOf: readonly [{
246
+ readonly type: "object";
247
+ readonly required: readonly ["mode"];
248
+ readonly additionalProperties: false;
249
+ readonly properties: {
250
+ readonly mode: {
251
+ readonly enum: readonly ["new", "continue_latest", "continue_or_create"];
252
+ };
253
+ };
254
+ }, {
255
+ readonly type: "object";
256
+ readonly required: readonly ["mode", "conversationId"];
257
+ readonly additionalProperties: false;
258
+ readonly properties: {
259
+ readonly mode: {
260
+ readonly const: "specific";
261
+ };
262
+ readonly conversationId: {
263
+ readonly type: "string";
264
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
265
+ };
266
+ };
267
+ }];
268
+ };
269
+ readonly idempotencyKey: {
270
+ readonly type: "string";
271
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,160}$";
272
+ readonly not: {
273
+ readonly pattern: "^(\\.{1,2}|__.*__)$";
274
+ };
275
+ };
276
+ readonly messageId: {
277
+ readonly type: "string";
278
+ readonly minLength: 1;
279
+ };
280
+ readonly replyTo: {
281
+ readonly type: "string";
282
+ };
283
+ readonly replyToPosition: {
284
+ readonly type: "integer";
285
+ };
286
+ readonly mentions: {
287
+ readonly type: "array";
288
+ readonly items: {
289
+ readonly type: "string";
290
+ };
291
+ readonly description: "Plaintext by decision D3 (routing + mention-piercing pushes).";
292
+ };
293
+ readonly memberIds: {
294
+ readonly type: "array";
295
+ readonly items: {
296
+ readonly type: "string";
297
+ };
298
+ readonly minItems: 1;
299
+ readonly description: string;
300
+ };
301
+ readonly turn: {
302
+ readonly $ref: "#/$defs/turn";
303
+ };
304
+ readonly native: {
305
+ readonly type: "object";
306
+ readonly description: string;
307
+ readonly maxProperties: 24;
308
+ readonly additionalProperties: false;
309
+ readonly properties: {
310
+ readonly runtime: {
311
+ readonly type: "string";
312
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
313
+ readonly maxLength: 256;
314
+ };
315
+ readonly method: {
316
+ readonly type: "string";
317
+ readonly pattern: "^[A-Za-z0-9_][A-Za-z0-9_./:\\-]{0,255}$";
318
+ readonly maxLength: 256;
319
+ };
320
+ readonly requestId: {
321
+ readonly type: "string";
322
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
323
+ readonly maxLength: 256;
324
+ };
325
+ readonly provider: {
326
+ readonly type: "string";
327
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
328
+ readonly maxLength: 256;
329
+ };
330
+ readonly origin: {
331
+ readonly type: "string";
332
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
333
+ readonly maxLength: 256;
334
+ };
335
+ readonly surface: {
336
+ readonly type: "string";
337
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
338
+ readonly maxLength: 256;
339
+ };
340
+ readonly threadId: {
341
+ readonly type: "string";
342
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
343
+ readonly maxLength: 256;
344
+ };
345
+ readonly turnId: {
346
+ readonly type: "string";
347
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
348
+ readonly maxLength: 256;
349
+ };
350
+ readonly runId: {
351
+ readonly type: "string";
352
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
353
+ readonly maxLength: 256;
354
+ };
355
+ readonly itemId: {
356
+ readonly type: "string";
357
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
358
+ readonly maxLength: 256;
359
+ };
360
+ readonly toolCallId: {
361
+ readonly type: "string";
362
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
363
+ readonly maxLength: 256;
364
+ };
365
+ readonly approvalId: {
366
+ readonly type: "string";
367
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
368
+ readonly maxLength: 256;
369
+ };
370
+ readonly pluginId: {
371
+ readonly type: "string";
372
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
373
+ readonly maxLength: 256;
374
+ };
375
+ readonly sessionKey: {
376
+ readonly type: "string";
377
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
378
+ readonly maxLength: 256;
379
+ };
380
+ readonly nodeId: {
381
+ readonly type: "string";
382
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
383
+ readonly maxLength: 256;
384
+ };
385
+ readonly handles: {
386
+ readonly type: "object";
387
+ readonly maxProperties: 16;
388
+ readonly propertyNames: {
389
+ readonly pattern: "^[A-Za-z0-9_.:-]{1,80}$";
390
+ };
391
+ readonly additionalProperties: {
392
+ readonly type: "string";
393
+ readonly pattern: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
394
+ readonly maxLength: 256;
395
+ };
396
+ };
397
+ };
398
+ };
399
+ readonly runtimeId: {
400
+ readonly type: "string";
401
+ readonly maxLength: 128;
402
+ };
403
+ readonly limit: {
404
+ readonly type: "integer";
405
+ readonly minimum: 1;
406
+ };
407
+ };
408
+ };
409
+ readonly turn: {
410
+ readonly type: "object";
411
+ readonly additionalProperties: false;
412
+ readonly properties: {
413
+ readonly turnId: {
414
+ readonly type: readonly ["string", "null"];
415
+ };
416
+ readonly turnSemantics: {
417
+ readonly enum: readonly ["progress", "turn_complete", "control"];
418
+ };
419
+ readonly deliveryIntent: {
420
+ readonly enum: readonly ["queue", "interrupt", "interleave", "stop"];
421
+ };
422
+ readonly replyBehavior: {
423
+ readonly enum: readonly ["allow_auto_reply", "suppress_auto_reply"];
424
+ };
425
+ };
426
+ };
427
+ readonly accepted: {
428
+ readonly type: "object";
429
+ readonly required: readonly ["status", "requestId"];
430
+ readonly additionalProperties: true;
431
+ readonly properties: {
432
+ readonly status: {
433
+ readonly const: "accepted";
434
+ };
435
+ readonly requestId: {
436
+ readonly type: "string";
437
+ };
438
+ readonly expiresAt: {
439
+ readonly type: "integer";
440
+ };
441
+ readonly messageId: {
442
+ readonly type: "string";
443
+ };
444
+ readonly responseUserId: {
445
+ readonly type: "string";
446
+ };
447
+ readonly interactive: {
448
+ readonly type: "boolean";
449
+ };
450
+ };
451
+ };
452
+ readonly response: {
453
+ readonly type: "object";
454
+ readonly required: readonly ["wire", "verb", "result"];
455
+ readonly additionalProperties: true;
456
+ readonly properties: {
457
+ readonly wire: {
458
+ readonly const: "canon.verb-wire.v1";
459
+ };
460
+ readonly verb: {
461
+ readonly enum: readonly ["send_to", "request_input", "request_approval", "check_approval", "send_card", "request_card", "share_contact", "react", "forward", "create_group", "add_member", "remove_member", "leave_conversation", "list_contacts", "list_conversations", "no_reply"];
462
+ };
463
+ readonly result: {
464
+ readonly $ref: "#/$defs/body";
465
+ };
466
+ };
467
+ };
468
+ };
469
+ };
470
+ export interface ProjectVerbIntentOptions {
471
+ /** Clock for timeoutMs→expiresAt normalization. */
472
+ now: number;
473
+ }
474
+ /**
475
+ * Project a plaintext verb intent (canon.verbs.v1 input) into its wire form
476
+ * with the `json` codec: envelope = the routing/policy fields the server may
477
+ * see; body.value = the content fields (what MLS later encrypts).
478
+ *
479
+ * The inverse is mergeVerbWireToIntent; round-tripping normalizes deadlines
480
+ * to absolute expiresAt but is otherwise lossless.
481
+ */
482
+ export declare function projectVerbIntentToWire(verb: CanonVerbName, intent: Record<string, unknown>, options: ProjectVerbIntentOptions): CanonVerbWireRequest;
483
+ /**
484
+ * Reconstruct the plaintext verb intent from a json-codec wire request — the
485
+ * server executor's half of the seam. Throws if the body is not json.
486
+ */
487
+ export declare function mergeVerbWireToIntent(request: CanonVerbWireRequest): Record<string, unknown>;
488
+ /**
489
+ * Envelope discipline check: no field outside the verb's allowed set, all
490
+ * required fields present. Schema validation catches shape; this catches
491
+ * per-verb field misuse (a strict-envelope server rejects on it).
492
+ */
493
+ export declare function findVerbWireEnvelopeViolations(verb: CanonVerbName, envelope: CanonVerbWireEnvelope): string[];
@@ -0,0 +1,8 @@
1
+ /** POST /auth/web-phone-account: 204 if an existing account can sign in. */
2
+ export interface WebPhoneAccountRequest {
3
+ phoneNumber: string;
4
+ }
5
+ /** POST /auth/web-phone-token: a recent Firebase phone ID token is required. */
6
+ export interface WebPhoneTokenResponse {
7
+ token: string;
8
+ }