@canonmsg/agent-sdk 11.2.1 → 12.1.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 (181) hide show
  1. package/README.md +248 -523
  2. package/dist/chunks/chunk-7N6OPPW4.js +5430 -0
  3. package/dist/chunks/chunk-N722GWCP.js +4897 -0
  4. package/dist/chunks/chunk-QZ4PPRQW.js +14247 -0
  5. package/dist/chunks/mls-crypto-LMNQZOS6.js +10 -0
  6. package/dist/cli.js +572 -0
  7. package/dist/drivers/claude.d.ts +42 -0
  8. package/dist/drivers/code.d.ts +18 -0
  9. package/dist/drivers/codex.d.ts +46 -0
  10. package/dist/drivers/connector.d.ts +34 -0
  11. package/dist/index.d.ts +20 -25
  12. package/dist/index.js +91 -13
  13. package/dist/internal/backend-contracts/agentBehaviorPolicy.d.ts +122 -0
  14. package/dist/internal/backend-contracts/agentDirectory.d.ts +32 -0
  15. package/dist/internal/backend-contracts/agentOrigin.d.ts +23 -0
  16. package/dist/internal/backend-contracts/agentSearch.d.ts +17 -0
  17. package/dist/internal/backend-contracts/api-origins.generated.d.ts +4 -0
  18. package/dist/internal/backend-contracts/apiErrors.d.ts +1 -0
  19. package/dist/internal/backend-contracts/artifactActions.d.ts +8 -0
  20. package/dist/internal/backend-contracts/artifacts.d.ts +386 -0
  21. package/dist/internal/backend-contracts/clientFloor.d.ts +41 -0
  22. package/dist/internal/backend-contracts/communication.d.ts +146 -0
  23. package/dist/internal/backend-contracts/connectorRelay.d.ts +179 -0
  24. package/dist/internal/backend-contracts/conversationMembership.d.ts +28 -0
  25. package/dist/internal/backend-contracts/deliveryObservation.d.ts +23 -0
  26. package/dist/internal/backend-contracts/diffRedaction.d.ts +6 -0
  27. package/dist/internal/backend-contracts/endpoint-unread.d.ts +4 -0
  28. package/dist/internal/backend-contracts/endpoint.d.ts +120 -0
  29. package/dist/internal/backend-contracts/endpointContentPolicy.d.ts +48 -0
  30. package/dist/internal/backend-contracts/environment.d.ts +20 -0
  31. package/dist/internal/backend-contracts/externalInbound.d.ts +24 -0
  32. package/dist/internal/backend-contracts/firestoreValues.d.ts +9 -0
  33. package/dist/internal/backend-contracts/index.d.ts +54 -0
  34. package/dist/internal/backend-contracts/media-url.d.ts +20 -0
  35. package/dist/internal/backend-contracts/media.d.ts +51 -0
  36. package/dist/internal/backend-contracts/mediaDelivery.d.ts +46 -0
  37. package/dist/internal/backend-contracts/mediaTransferProtocol.d.ts +17 -0
  38. package/dist/internal/backend-contracts/membershipChange.d.ts +21 -0
  39. package/dist/internal/backend-contracts/message.d.ts +86 -0
  40. package/dist/internal/backend-contracts/messageText.d.ts +6 -0
  41. package/dist/internal/backend-contracts/mlsDevApplication.d.ts +161 -0
  42. package/dist/internal/backend-contracts/mlsDevCredential.d.ts +78 -0
  43. package/dist/internal/backend-contracts/mlsDevCredentialReconciliation.d.ts +45 -0
  44. package/dist/internal/backend-contracts/mlsDevDeviceCustody.d.ts +52 -0
  45. package/dist/internal/backend-contracts/mlsDevEnrollment.d.ts +75 -0
  46. package/dist/internal/backend-contracts/mlsDevFeedReceipt.d.ts +43 -0
  47. package/dist/internal/backend-contracts/mlsDevGroup.d.ts +321 -0
  48. package/dist/internal/backend-contracts/mlsDevGroupFeed.d.ts +51 -0
  49. package/dist/internal/backend-contracts/mlsDevInteraction.d.ts +159 -0
  50. package/dist/internal/backend-contracts/mlsDevKeyPackage.d.ts +42 -0
  51. package/dist/internal/backend-contracts/mlsDevKeyPackages.d.ts +55 -0
  52. package/dist/internal/backend-contracts/mlsEnvironment.d.ts +35 -0
  53. package/dist/internal/backend-contracts/mlsPrincipalAlias.d.ts +23 -0
  54. package/dist/internal/backend-contracts/moderation.d.ts +7 -0
  55. package/dist/internal/backend-contracts/plaintextProcessors.d.ts +63 -0
  56. package/dist/internal/backend-contracts/preparedContent.d.ts +54 -0
  57. package/dist/internal/backend-contracts/replyAuthority.d.ts +14 -0
  58. package/dist/internal/backend-contracts/runtimeCardFields.d.ts +66 -0
  59. package/dist/internal/backend-contracts/runtimeCardStorage.d.ts +3 -0
  60. package/dist/internal/backend-contracts/runtimeDescriptor.d.ts +88 -0
  61. package/dist/internal/backend-contracts/selfContext.d.ts +9 -0
  62. package/dist/internal/backend-contracts/turnProtocol.d.ts +43 -0
  63. package/dist/internal/backend-contracts/upload-mime-types.d.ts +17 -0
  64. package/dist/internal/backend-contracts/verbContract.d.ts +856 -0
  65. package/dist/internal/backend-contracts/verbSchemas.d.ts +1717 -0
  66. package/dist/internal/backend-contracts/verbWire.d.ts +493 -0
  67. package/dist/internal/backend-contracts/webAuth.d.ts +8 -0
  68. package/dist/internal/core/agent-profiles.d.ts +65 -0
  69. package/dist/internal/core/approval-format.d.ts +22 -0
  70. package/dist/internal/core/approval-manager.d.ts +43 -0
  71. package/dist/internal/core/approval-types.d.ts +73 -0
  72. package/dist/internal/core/base-url.d.ts +1 -0
  73. package/dist/internal/core/cli-metadata.d.ts +13 -0
  74. package/dist/internal/core/client.d.ts +432 -0
  75. package/dist/internal/core/completed-output-journal.d.ts +39 -0
  76. package/dist/internal/core/constants.d.ts +1 -0
  77. package/dist/internal/core/endpoint-client.d.ts +56 -0
  78. package/dist/internal/core/execution-environment-mode.d.ts +6 -0
  79. package/dist/internal/core/gifs.d.ts +29 -0
  80. package/dist/internal/core/host-runtime.d.ts +53 -0
  81. package/dist/internal/core/index.d.ts +68 -0
  82. package/dist/internal/core/node-media.d.ts +6 -0
  83. package/dist/internal/core/policy.d.ts +2 -0
  84. package/dist/internal/core/registration-profile.d.ts +10 -0
  85. package/dist/internal/core/registration-session.d.ts +55 -0
  86. package/dist/internal/core/registration.d.ts +5 -0
  87. package/dist/internal/core/retry.d.ts +113 -0
  88. package/dist/internal/core/rtdb-rest.d.ts +141 -0
  89. package/dist/internal/core/runtime-cards.d.ts +286 -0
  90. package/dist/internal/core/runtime-descriptor.d.ts +16 -0
  91. package/dist/internal/core/runtime-endpoints.d.ts +26 -0
  92. package/dist/internal/core/runtime-heartbeat.d.ts +29 -0
  93. package/dist/internal/core/runtime-presentation.d.ts +9 -0
  94. package/dist/internal/core/runtime-request-manager.d.ts +283 -0
  95. package/dist/internal/core/runtime-state-publisher.d.ts +42 -0
  96. package/dist/internal/core/self-context.d.ts +22 -0
  97. package/dist/internal/core/silent-turn.d.ts +49 -0
  98. package/dist/internal/core/stream.d.ts +78 -0
  99. package/dist/internal/core/turn-protocol.d.ts +28 -0
  100. package/dist/internal/core/turn-verbosity.d.ts +85 -0
  101. package/dist/internal/core/types.d.ts +964 -0
  102. package/dist/internal/core/unified-diff.d.ts +35 -0
  103. package/dist/internal/endpoint/artifact-images.d.ts +60 -0
  104. package/dist/internal/endpoint/artifact-reducer.d.ts +35 -0
  105. package/dist/internal/endpoint/artifact-views.d.ts +113 -0
  106. package/dist/internal/endpoint/artifacts.d.ts +75 -0
  107. package/dist/internal/endpoint/delivery.d.ts +47 -0
  108. package/dist/internal/endpoint/engine.d.ts +249 -0
  109. package/dist/internal/endpoint/ephemeral.d.ts +8 -0
  110. package/dist/internal/endpoint/events.d.ts +32 -0
  111. package/dist/internal/endpoint/external-inbound.d.ts +36 -0
  112. package/dist/internal/endpoint/handoff.d.ts +50 -0
  113. package/dist/internal/endpoint/history.d.ts +22 -0
  114. package/dist/internal/endpoint/image-generation-errors.d.ts +2 -0
  115. package/dist/internal/endpoint/inbound.d.ts +29 -0
  116. package/dist/internal/endpoint/index.d.ts +32 -0
  117. package/dist/internal/endpoint/media.d.ts +177 -0
  118. package/dist/internal/endpoint/migration.d.ts +50 -0
  119. package/dist/internal/endpoint/mls-crypto.d.ts +32 -0
  120. package/dist/internal/endpoint/mls-dev-client.d.ts +52 -0
  121. package/dist/internal/endpoint/mls-dev-device.d.ts +69 -0
  122. package/dist/internal/endpoint/mls-dev-groups.d.ts +174 -0
  123. package/dist/internal/endpoint/mls-dev-interactions.d.ts +99 -0
  124. package/dist/internal/endpoint/mls-dev-key-package-service.d.ts +46 -0
  125. package/dist/internal/endpoint/mls-dev-key-packages.d.ts +62 -0
  126. package/dist/internal/endpoint/mls-dev-text.d.ts +67 -0
  127. package/dist/internal/endpoint/mls-dev-transport.d.ts +38 -0
  128. package/dist/internal/endpoint/node-mls-custody-protocol.d.ts +29 -0
  129. package/dist/internal/endpoint/node-mls-custody.d.ts +15 -0
  130. package/dist/internal/endpoint/node.d.ts +7 -0
  131. package/dist/internal/endpoint/observe-query.d.ts +17 -0
  132. package/dist/internal/endpoint/portable-node-mls-custody.d.ts +23 -0
  133. package/dist/internal/endpoint/queue.d.ts +22 -0
  134. package/dist/internal/endpoint/recovery.d.ts +27 -0
  135. package/dist/internal/endpoint/retention.d.ts +7 -0
  136. package/dist/internal/endpoint/store.d.ts +22 -0
  137. package/dist/internal/endpoint/sync.d.ts +33 -0
  138. package/dist/internal/endpoint/transient-publisher.d.ts +8 -0
  139. package/dist/internal/endpoint/transport.d.ts +63 -0
  140. package/dist/media.d.ts +1 -1
  141. package/dist/media.js +42 -541
  142. package/dist/runner/errands.d.ts +118 -0
  143. package/dist/runner/mls.d.ts +97 -0
  144. package/dist/runner/relay.d.ts +87 -0
  145. package/dist/runner/runner.d.ts +98 -0
  146. package/dist/runner/types.d.ts +215 -0
  147. package/package.json +18 -5
  148. package/dist/attached-session.d.ts +0 -58
  149. package/dist/attached-session.js +0 -638
  150. package/dist/bounded-file-read.d.ts +0 -14
  151. package/dist/bounded-file-read.js +0 -34
  152. package/dist/canon-agent.d.ts +0 -236
  153. package/dist/canon-agent.js +0 -2531
  154. package/dist/debouncer.d.ts +0 -18
  155. package/dist/debouncer.js +0 -133
  156. package/dist/inbound-handoff.d.ts +0 -6
  157. package/dist/inbound-handoff.js +0 -17
  158. package/dist/managed-session-host.d.ts +0 -27
  159. package/dist/managed-session-host.js +0 -195
  160. package/dist/managed-session-setup.d.ts +0 -99
  161. package/dist/managed-session-setup.js +0 -234
  162. package/dist/realtime.d.ts +0 -62
  163. package/dist/realtime.js +0 -193
  164. package/dist/runtime-card.d.ts +0 -48
  165. package/dist/runtime-card.js +0 -64
  166. package/dist/session-manager.d.ts +0 -77
  167. package/dist/session-manager.js +0 -285
  168. package/dist/turn-streaming-request.d.ts +0 -17
  169. package/dist/turn-streaming-request.js +0 -22
  170. package/dist/turn-verbosity-option.d.ts +0 -33
  171. package/dist/turn-verbosity-option.js +0 -23
  172. package/dist/types.d.ts +0 -387
  173. package/dist/types.js +0 -1
  174. package/dist/work-session-coordination.d.ts +0 -21
  175. package/dist/work-session-coordination.js +0 -53
  176. package/dist/work-session-host.d.ts +0 -31
  177. package/dist/work-session-host.js +0 -617
  178. package/dist/work-session-interactions.d.ts +0 -12
  179. package/dist/work-session-interactions.js +0 -173
  180. package/dist/work-session-state.d.ts +0 -36
  181. package/dist/work-session-state.js +0 -62
@@ -0,0 +1,856 @@
1
+ /**
2
+ * Canon agent verb contract — the canonical, runtime-agnostic vocabulary for
3
+ * the conversational/HITL actions an agent deliberately takes against Canon
4
+ * (v1 scope: messaging, HITL interactions, contact sharing, and the read
5
+ * verbs bindings need alongside them).
6
+ *
7
+ * One verb = one intent-level action. Each runtime binding (Hermes native
8
+ * tool, MCP server, codex dynamicTools, agent-sdk method, CLI) projects these
9
+ * verbs into its native tool surface; the names, argument shapes, limits, and
10
+ * result vocabularies defined here are the single source of truth. JSON
11
+ * Schemas for each verb live in `verbSchemas.ts` and are also emitted as a
12
+ * plain JSON artifact at build time (`dist/canon-verbs.schema.json`) so
13
+ * non-TypeScript consumers (the Python hermes plugin, external integrators)
14
+ * can consume the identical contract.
15
+ *
16
+ * Deliberately NOT verbs: replying in the active conversation, streaming
17
+ * partials, typing, and read receipts stay host-mediated — the model talks
18
+ * and the platform delivers. `no_reply` is the deliberate exception: it is the
19
+ * ABSENCE of a reply, and only an intent can express that — silence has no
20
+ * host-mediated channel of its own. Still out of scope pending their own design
21
+ * pass: plan approval (the fourth runtime-interaction kind — coding-host
22
+ * concern today) and block/mute. Their REST surfaces remain directly
23
+ * callable.
24
+ *
25
+ * Scope note: this module DESCRIBES the contract (canonical shapes + the
26
+ * server-enforced limits, with enforcement sites cited). Enforcement itself
27
+ * stays where it runs today — functions/src. The server-side verb endpoint that
28
+ * validates against these schemas is live: POST /agent/verbs/:verb
29
+ * (functions/src/index.ts, functions/src/api/agentVerbs.ts).
30
+ *
31
+ * Normativity: the JSON Schemas in `verbSchemas.ts` (and the emitted
32
+ * canon-verbs.schema.json) are the normative contract. The TypeScript types
33
+ * here are a convenience projection — corrections flow schema -> type, and
34
+ * the dual-witness fixtures in verbContract.test.ts (each fixture is both
35
+ * compile-checked against the type and validated against the schema) guard
36
+ * the two from drifting. Single-sourcing the types from the schemas is a
37
+ * planned follow-up.
38
+ *
39
+ * Byte-sensitive limits: JSON Schema `maxLength` counts UTF-16 code units,
40
+ * but several server limits count UTF-8 bytes or serialized-JSON length,
41
+ * which no standard keyword expresses. Bindings MUST run
42
+ * `findVerbByteLimitViolations()` (or equivalent checks from the emitted
43
+ * canon-verbs.limits.json) after schema validation.
44
+ */
45
+ /** Identifier for this contract document. */
46
+ export declare const CANON_VERBS_SCHEMA_VERSION = "canon.verbs.v1";
47
+ /** $id of the emitted JSON Schema bundle. */
48
+ export declare const CANON_VERBS_SCHEMA_ID = "https://canonmsg.com/schemas/canon.verbs.v1.json";
49
+ /** Namespace prefix bindings should use for flat tool names (e.g. `canon_send_to`). */
50
+ export declare const CANON_VERB_NAMESPACE = "canon";
51
+ /**
52
+ * $id of the canonical canon.card.v1 document schema
53
+ * (@canonmsg/rich-cards RUNTIME_CARD_JSON_SCHEMA_V1). The verbs bundle only
54
+ * validates the card ENVELOPE.
55
+ */
56
+ export declare const CANON_CARD_SCHEMA_ID = "https://canonmsg.com/schemas/canon.card.v1.json";
57
+ /**
58
+ * Identifier patterns, mirrored from the enforcing sites:
59
+ * - RUNTIME_ID_PATTERN: conversation/input/approval ids —
60
+ * functions/src/utils/runtimeRequestHelpers.ts (`/^[A-Za-z0-9_.:-]{1,160}$/`)
61
+ * - CARD_ID_PATTERN / ACTION_ID_PATTERN: functions/src/api/interactionCard.ts
62
+ * and @canonmsg/rich-cards RUNTIME_CARD_ACTION_ID_PATTERN (80 chars)
63
+ * - QUESTION_ID_PATTERN: functions/src/api/interactionInput.ts (120 chars)
64
+ * - SESSION_RULE_TOOL_PATTERN: functions/src/callable/respondToInteraction.ts
65
+ */
66
+ export declare const VERB_ID_PATTERNS: {
67
+ readonly runtimeId: "^[A-Za-z0-9_.:-]{1,160}$";
68
+ readonly cardId: "^[A-Za-z0-9_.:-]{1,80}$";
69
+ readonly actionId: "^[A-Za-z0-9_.:-]{1,80}$";
70
+ readonly questionId: "^[A-Za-z0-9_.:-]{1,120}$";
71
+ readonly sessionRuleToolPattern: "^[\\w.*:-]{1,128}$";
72
+ readonly runtimeCorrelationValue: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
73
+ readonly runtimeMethod: "^[A-Za-z0-9_][A-Za-z0-9_./:\\-]{0,255}$";
74
+ readonly runtimeHandleKey: "^[A-Za-z0-9_.:-]{1,80}$";
75
+ /** UUID issued by Canon's resumable-media session endpoint. */
76
+ readonly resumableUploadId: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$";
77
+ };
78
+ /**
79
+ * Server-enforced limits, single-sourced. Each value cites its enforcement
80
+ * site; keep the citation current when a limit moves.
81
+ */
82
+ export declare const VERB_LIMITS: {
83
+ /** Message text — UTF-8 bytes (functions/src/api/sendMessage.ts MAX_MESSAGE_TEXT_BYTES). */
84
+ readonly messageTextBytes: 4096;
85
+ /**
86
+ * Serialized metadata JSON length in UTF-16 code units — the server checks
87
+ * JSON.stringify(metadata).length, not bytes (sendMessage.ts:716-724 inline;
88
+ * parseBody.ts maxJsonBytes despite the name).
89
+ */
90
+ readonly messageMetadataJsonChars: 4096;
91
+ /** Attachments per message (sendMessage.ts MAX_MESSAGE_ATTACHMENTS). */
92
+ readonly messageAttachments: 10;
93
+ /** Client-supplied messageId — chars and UTF-8 bytes (sendMessage.ts). */
94
+ readonly messageIdChars: 160;
95
+ readonly messageIdBytes: 256;
96
+ /** Self-context note (functions/src/utils/selfContexts.ts SELF_CONTEXT_CONTEXT_LIMIT). */
97
+ readonly selfContextChars: 1000;
98
+ /** Short private description of an external working context. */
99
+ readonly externalSourceLabelChars: 80;
100
+ /**
101
+ * Contact-request note. Values longer than this are truncated by senders
102
+ * (slice(0,497)+'...') — the truncation is currently triplicated in
103
+ * functions/src/api/sendContextualMessage.ts, packages/core/src/reach-out.ts
104
+ * and the hermes plugin; this constant is the canonical figure.
105
+ */
106
+ readonly contactRequestNoteChars: 500;
107
+ /** Group membership cap incl. creator (functions/src/utils/conversations.ts MAX_GROUP_MEMBERS). */
108
+ readonly groupMembers: 50;
109
+ /** Runtime input (functions/src/api/interactionInput.ts). */
110
+ readonly inputTitleChars: 160;
111
+ readonly inputPromptChars: 4000;
112
+ readonly inputChoices: 12;
113
+ readonly inputChoiceLabelChars: 120;
114
+ readonly inputChoiceValueChars: 200;
115
+ readonly inputChoiceDescriptionChars: 300;
116
+ readonly inputQuestions: 12;
117
+ readonly inputQuestionChars: 1000;
118
+ readonly inputQuestionHeaderChars: 120;
119
+ readonly inputSecretNameChars: 160;
120
+ readonly inputAnswerChars: 8192;
121
+ /** Approval (functions/src/api/interactionApproval.ts). */
122
+ readonly toolNameChars: 128;
123
+ readonly toolSummaryChars: 1000;
124
+ readonly approvalDetails: 8;
125
+ readonly approvalDetailLabelChars: 80;
126
+ readonly approvalDetailValueChars: 500;
127
+ readonly diffFiles: 100;
128
+ readonly diffPathChars: 1024;
129
+ readonly diffFileBytes: number;
130
+ readonly diffTotalBytes: number;
131
+ /** Card envelope acceptance (functions/src/api/interactionCard.ts — server caps;
132
+ * authoring caps in @canonmsg/rich-cards are stricter: title 120, fallback 500, blocks 24). */
133
+ readonly cardEnvelopeBytes: number;
134
+ readonly cardServerTitleChars: 200;
135
+ readonly cardServerFallbackTextChars: 2000;
136
+ readonly cardServerBlocks: 64;
137
+ /** Response-values caps enforced on submit (callable respondToInteraction.ts
138
+ * MAX_VALUES_BYTES/MAX_VALUES_DEPTH; interactionCard.ts re-checks bytes on
139
+ * consume via MAX_REPLY_BYTES). */
140
+ readonly cardValuesBytes: number;
141
+ readonly cardValuesDepth: 8;
142
+ /** Native correlation metadata (functions/src/api/interactionKinds.ts normalizeNative). */
143
+ readonly nativeKeys: 24;
144
+ readonly nativeValueChars: 256;
145
+ readonly nativeHandles: 16;
146
+ /** Deadlines (functions/src/utils/runtimeRequestHelpers.ts). */
147
+ readonly minTimeoutMs: 1000;
148
+ /** input/card/plan ceiling (30 minutes). */
149
+ readonly maxTimeoutMs: number;
150
+ /** approval-only ceiling (72 hours — owner ruling 2026-07-10). */
151
+ readonly maxApprovalTimeoutMs: number;
152
+ /** turnId / runtimeId fields on interaction creators. */
153
+ readonly turnIdChars: 128;
154
+ /** Reaction key (functions/src/api/reactToMessage.ts normalizeReactionKey). */
155
+ readonly reactionEmojiChars: 64;
156
+ /**
157
+ * Group name authoring cap (enforced on rename via updateNameServer; group
158
+ * CREATE does not length-check today — treat as the authoring contract).
159
+ */
160
+ readonly groupNameChars: 100;
161
+ /**
162
+ * `no_reply.reason` authoring cap. There is no server enforcement beyond the
163
+ * intent schema — the handler logs the reason's presence and nothing else —
164
+ * so this constant is the canonical figure.
165
+ */
166
+ readonly noReplyReasonChars: 500;
167
+ };
168
+ /**
169
+ * Sender-side rate limits enforced by POST /messages/send
170
+ * (functions/src/api/sendMessage.ts). Bindings should surface 429s with the
171
+ * retryAfter the server returns rather than re-deriving these.
172
+ */
173
+ export declare const VERB_RATE_LIMITS: {
174
+ readonly senderMessagesPer5Min: 300;
175
+ readonly conversationMessagesPer5Min: 120;
176
+ readonly agentPeerMessagesPerHour: 30;
177
+ };
178
+ /** The one self-context type the platform accepts today. */
179
+ export declare const SELF_CONTEXT_TYPE = "cross_session";
180
+ /** Canonical verb names. */
181
+ export declare const CANON_VERB_NAMES: 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"];
182
+ export type CanonVerbName = (typeof CANON_VERB_NAMES)[number];
183
+ /** Private note-to-self attached to a cross-conversation send. */
184
+ export interface VerbSelfContext {
185
+ type: typeof SELF_CONTEXT_TYPE;
186
+ /** <= VERB_LIMITS.selfContextChars. Visible only to the sending agent. */
187
+ context: string;
188
+ }
189
+ export type VerbSessionSelection = {
190
+ mode: 'new';
191
+ } | {
192
+ mode: 'continue_latest';
193
+ } | {
194
+ mode: 'continue_or_create';
195
+ } | {
196
+ mode: 'specific';
197
+ conversationId: string;
198
+ };
199
+ /**
200
+ * Bounded runtime correlation carried in the public wire envelope. These are
201
+ * opaque identifiers only; workspace paths, commands, prompts, summaries,
202
+ * and model labels belong in encrypted content or owner-local runtime state.
203
+ */
204
+ export interface VerbNativeMetadata {
205
+ runtime?: string;
206
+ method?: string;
207
+ requestId?: string;
208
+ provider?: string;
209
+ origin?: string;
210
+ surface?: string;
211
+ threadId?: string;
212
+ turnId?: string;
213
+ runId?: string;
214
+ itemId?: string;
215
+ toolCallId?: string;
216
+ approvalId?: string;
217
+ pluginId?: string;
218
+ sessionKey?: string;
219
+ nodeId?: string;
220
+ handles?: Record<string, string>;
221
+ }
222
+ export declare const VERB_NATIVE_METADATA_KEYS: readonly ["runtime", "method", "requestId", "provider", "origin", "surface", "threadId", "turnId", "runId", "itemId", "toolCallId", "approvalId", "pluginId", "sessionKey", "nodeId", "handles"];
223
+ /**
224
+ * Keep only the typed, content-free runtime correlation contract. Invalid or
225
+ * unknown fields are omitted on compatibility REST paths; canon.verb-wire.v1
226
+ * rejects the same fields through its strict JSON Schema.
227
+ */
228
+ export declare function normalizeVerbNativeMetadata(value: unknown): VerbNativeMetadata | undefined;
229
+ export interface VerbMediaAttachment {
230
+ kind: 'image' | 'audio' | 'video' | 'file';
231
+ /** Must come from a canonical Canon upload/finalization response or the GIF picker. */
232
+ url: string;
233
+ /** Server-issued resumable identity; preserve it so durable sends retain temporary media. */
234
+ uploadId?: string;
235
+ mimeType?: string;
236
+ fileName?: string;
237
+ sizeBytes?: number;
238
+ width?: number;
239
+ height?: number;
240
+ durationMs?: number;
241
+ thumbnailUrl?: string;
242
+ processingStatus?: 'processing' | 'ready' | 'failed';
243
+ processingErrorCode?: 'invalid_video' | 'video_limits_exceeded' | 'video_processing_failed';
244
+ }
245
+ /**
246
+ * Well-known turn-protocol keys inside the free-form metadata envelope
247
+ * (see turnProtocol.ts TurnMetadata — the authoritative type).
248
+ */
249
+ export interface VerbTurnMetadata {
250
+ turnId?: string | null;
251
+ turnSemantics?: 'progress' | 'turn_complete' | 'control';
252
+ deliveryIntent?: 'queue' | 'interrupt' | 'interleave' | 'stop';
253
+ replyBehavior?: 'allow_auto_reply' | 'suppress_auto_reply';
254
+ [key: string]: unknown;
255
+ }
256
+ /** Message composition options shared by send_to (mirrors POST /messages/send). */
257
+ export interface VerbMessageOptions {
258
+ messageId?: string;
259
+ contentType?: 'text' | 'image' | 'audio' | 'video' | 'file';
260
+ attachments?: VerbMediaAttachment[];
261
+ mentions?: string[];
262
+ replyTo?: string;
263
+ replyToPosition?: number;
264
+ metadata?: VerbTurnMetadata;
265
+ }
266
+ /**
267
+ * Message another conversation or user (admission-aware reach-out), optionally
268
+ * carrying a private self-context so the agent recognizes its own transfer in
269
+ * both sessions. Merges today's reach_out / send_contextual_message /
270
+ * cross-conversation send into one verb.
271
+ */
272
+ export interface SendToInput {
273
+ /** Exactly one of targetConversationId / targetUserId / canonContactId. */
274
+ targetConversationId?: string;
275
+ targetUserId?: string;
276
+ /**
277
+ * Contact-card identity. NOT a wire field on any send endpoint: bindings
278
+ * resolve it to a targetUserId via POST /admission/resolve first (the
279
+ * two-step core reachOutToCanonContact runs).
280
+ */
281
+ canonContactId?: string;
282
+ /** Required unless messageOptions.attachments carries the content. */
283
+ text?: string;
284
+ /**
285
+ * The Canon conversation this send originates from. A self-context send
286
+ * requires exactly one of this or externalSource.
287
+ */
288
+ sourceConversationId?: string;
289
+ /** An owner-local working context outside Canon, such as a Codex task. */
290
+ externalSource?: {
291
+ kind: 'external';
292
+ integration: 'codex';
293
+ label?: string;
294
+ };
295
+ selfContext?: VerbSelfContext;
296
+ /** Contact-request note when admission requires approval; defaults to text. */
297
+ requestMessage?: string;
298
+ /** Only meaningful for user targets that are agents. Default: continue_or_create. */
299
+ sessionSelection?: VerbSessionSelection;
300
+ messageOptions?: VerbMessageOptions;
301
+ }
302
+ export type SendToResult = {
303
+ status: 'messaged';
304
+ conversationId: string;
305
+ messageId?: string;
306
+ selfContextId?: string;
307
+ created?: boolean;
308
+ reused?: boolean;
309
+ sessionSelection?: string;
310
+ }
311
+ /** The room is encrypted, so Canon stored no opening text: the sender sends it encrypted under `messageId`. */
312
+ | {
313
+ status: 'opened';
314
+ conversationId: string;
315
+ messageId: string;
316
+ openingText: 'deferred';
317
+ created?: boolean;
318
+ reused?: boolean;
319
+ } | {
320
+ status: 'requested' | 'pending';
321
+ requestId: string | null;
322
+ deferredIntentId?: string | null;
323
+ /** An encrypted room stores no opener: the sender sends it into `conversationId` under `messageId`. */
324
+ conversationId?: string;
325
+ messageId?: string;
326
+ openingText?: 'deferred';
327
+ } | {
328
+ status: 'setup_required';
329
+ reason: string;
330
+ } | {
331
+ status: 'no_session';
332
+ reason: string;
333
+ } | {
334
+ status: 'blocked';
335
+ reason: string;
336
+ } | {
337
+ status: 'unavailable';
338
+ reason: string;
339
+ };
340
+ export type VerbInputKind = 'clarify' | 'sudo' | 'secret';
341
+ export interface VerbInputChoice {
342
+ label: string;
343
+ value?: string;
344
+ description?: string;
345
+ }
346
+ export interface VerbInputQuestion {
347
+ id: string;
348
+ question: string;
349
+ header?: string;
350
+ choices?: VerbInputChoice[];
351
+ allowOther?: boolean;
352
+ isSecret?: boolean;
353
+ multiSelect?: boolean;
354
+ }
355
+ /**
356
+ * Ask a human a structured question mid-turn (HITL input card). `sudo`,
357
+ * `secret`, `sensitive:true`, and any `isSecret` question force owner-only
358
+ * routing server-side; bindings must not let the model redirect the responder
359
+ * for those.
360
+ */
361
+ export interface RequestInputInput {
362
+ /** Bindings default this to the active conversation. */
363
+ conversationId?: string;
364
+ /** Durable single-use id; generated by the binding when omitted. */
365
+ inputId?: string;
366
+ kind?: VerbInputKind;
367
+ title?: string;
368
+ prompt?: string;
369
+ choices?: VerbInputChoice[];
370
+ questions?: VerbInputQuestion[];
371
+ secretName?: string;
372
+ sensitive?: boolean;
373
+ responseUserId?: string;
374
+ native?: VerbNativeMetadata;
375
+ turnId?: string;
376
+ /** Relative deadline; server ceiling is VERB_LIMITS.maxTimeoutMs (30 min). */
377
+ timeoutMs?: number;
378
+ /** Absolute epoch-ms deadline; wins over timeoutMs when both given. */
379
+ expiresAt?: number;
380
+ }
381
+ export type RequestInputResult = {
382
+ status: 'submitted';
383
+ inputId: string;
384
+ value: string;
385
+ answers?: Record<string, {
386
+ answers: string[];
387
+ }>;
388
+ } | {
389
+ status: 'cancelled';
390
+ inputId: string;
391
+ } | {
392
+ status: 'timeout';
393
+ inputId: string;
394
+ };
395
+ export type VerbApprovalRisk = 'low' | 'normal' | 'high' | 'destructive';
396
+ export type VerbApprovalCategory = 'command' | 'file' | 'network' | 'browser' | 'mcp' | 'plugin' | 'canon' | 'tool';
397
+ export interface VerbApprovalDetail {
398
+ label: string;
399
+ value: string;
400
+ monospace?: boolean;
401
+ }
402
+ export interface VerbUnifiedDiffFile {
403
+ path: string;
404
+ status: 'modified' | 'created' | 'deleted' | 'renamed';
405
+ oldPath?: string;
406
+ additions?: number;
407
+ deletions?: number;
408
+ diff?: string;
409
+ suppressed?: boolean;
410
+ }
411
+ export interface VerbUnifiedDiff {
412
+ files: VerbUnifiedDiffFile[];
413
+ truncated?: boolean;
414
+ }
415
+ export interface VerbSessionRule {
416
+ type: 'approve-all' | 'approve-tool' | 'deny-tool';
417
+ toolPattern?: string;
418
+ expiresAt?: string | null;
419
+ }
420
+ /**
421
+ * Ask a human to allow or deny an action. `mode: 'blocking'` waits for the
422
+ * decision inside the verb call (default timeout 5 min); `mode: 'detached'`
423
+ * returns `pending` immediately and the decision is fetched later with
424
+ * check_approval (ceiling 72h). Timeouts fail closed to deny.
425
+ *
426
+ * Binding-local options are deliberately not wire fields: session-rule caches
427
+ * and their bypass (agent-sdk/core `ignoreSessionRules`) live in the binding,
428
+ * never on the wire — the server has no such field.
429
+ */
430
+ export interface RequestApprovalInput {
431
+ conversationId?: string;
432
+ /** Server-generated when omitted. Durable single-use id. */
433
+ approvalId?: string;
434
+ toolName: string;
435
+ toolSummary: string;
436
+ mode?: 'blocking' | 'detached';
437
+ riskLevel?: 'normal' | 'destructive';
438
+ risk?: VerbApprovalRisk;
439
+ category?: VerbApprovalCategory;
440
+ details?: VerbApprovalDetail[];
441
+ diff?: VerbUnifiedDiff;
442
+ native?: VerbNativeMetadata;
443
+ runtimeId?: string;
444
+ turnId?: string;
445
+ responseUserId?: string;
446
+ /** Server forces false when the responder is not the agent owner. */
447
+ allowSessionRule?: boolean;
448
+ timeoutMs?: number;
449
+ expiresAt?: number;
450
+ }
451
+ export type RequestApprovalResult = {
452
+ status: 'allow';
453
+ approvalId: string;
454
+ sessionRule?: VerbSessionRule;
455
+ respondedBy?: string;
456
+ } | {
457
+ status: 'deny';
458
+ approvalId: string;
459
+ sessionRule?: VerbSessionRule;
460
+ respondedBy?: string;
461
+ } | {
462
+ status: 'timeout';
463
+ approvalId: string;
464
+ } | {
465
+ status: 'pending';
466
+ approvalId: string;
467
+ conversationId?: string;
468
+ expiresAt: number;
469
+ responseUserId?: string;
470
+ };
471
+ export interface CheckApprovalInput {
472
+ approvalId: string;
473
+ /** Bindings must bind checks to the conversation that created the approval. */
474
+ conversationId?: string;
475
+ }
476
+ /**
477
+ * `unknown` is NOT a denial — it means the id is unrecognized (consumed
478
+ * tombstone expired, or foreign id). Callers must treat only `resolved` with
479
+ * `decision` as an answer.
480
+ */
481
+ export type CheckApprovalResult = {
482
+ status: 'resolved';
483
+ approvalId: string;
484
+ decision: 'allow' | 'deny';
485
+ respondedBy?: string;
486
+ conversationId?: string;
487
+ } | {
488
+ status: 'pending';
489
+ approvalId: string;
490
+ expiresAt?: number;
491
+ conversationId?: string;
492
+ } | {
493
+ status: 'expired';
494
+ approvalId: string;
495
+ conversationId?: string;
496
+ } | {
497
+ status: 'unknown';
498
+ approvalId: string;
499
+ };
500
+ /**
501
+ * A canon.card.v1 document. The full document contract is
502
+ * @canonmsg/rich-cards RUNTIME_CARD_JSON_SCHEMA_V1
503
+ * ($id https://canonmsg.com/schemas/canon.card.v1.json) — authoring caps
504
+ * title 120 / fallbackText 500 / blocks 24; the server envelope accepts up to
505
+ * 200 / 2000 / 64 and 32 KiB total (interactionCard.ts validateCardEnvelope).
506
+ */
507
+ export interface VerbRuntimeCard {
508
+ schema: 'canon.card.v1';
509
+ cardId?: string;
510
+ title: string;
511
+ fallbackText: string;
512
+ /** At least one block (schema enforces minItems: 1). */
513
+ blocks: unknown[];
514
+ [key: string]: unknown;
515
+ }
516
+ /** Display a card with no actions — fire-and-forget, no pending state. */
517
+ export interface SendCardInput {
518
+ conversationId?: string;
519
+ card: VerbRuntimeCard;
520
+ cardId?: string;
521
+ native?: VerbNativeMetadata;
522
+ runtimeId?: string;
523
+ turnId?: string;
524
+ }
525
+ export interface SendCardResult {
526
+ status: 'displayed';
527
+ cardId: string;
528
+ conversationId?: string;
529
+ responseUserId?: string;
530
+ }
531
+ /** Show an interactive card (>=1 actions block) and wait for the response. */
532
+ export interface RequestCardInput extends SendCardInput {
533
+ responseUserId?: string;
534
+ timeoutMs?: number;
535
+ expiresAt?: number;
536
+ }
537
+ export type RequestCardResult = {
538
+ status: 'submitted';
539
+ cardId: string;
540
+ actionId?: string;
541
+ values?: Record<string, unknown>;
542
+ /** Canon-authenticated responder (server-verified against responseUserId). */
543
+ respondedBy?: string;
544
+ } | {
545
+ status: 'cancelled';
546
+ cardId: string;
547
+ respondedBy?: string;
548
+ } | {
549
+ status: 'timeout';
550
+ cardId: string;
551
+ };
552
+ /**
553
+ * Share a contact card into a conversation (POST /messages/send with
554
+ * contentType 'contact_card'). The shared user must be in the sending
555
+ * agent's contacts (403 otherwise); the owner shortcut in sendMessage.ts
556
+ * applies only to human senders sharing their own agents. The server
557
+ * snapshots the card.
558
+ */
559
+ export interface ShareContactInput {
560
+ conversationId: string;
561
+ contactUserId: string;
562
+ text?: string;
563
+ messageId?: string;
564
+ }
565
+ export interface ShareContactResult {
566
+ status: 'shared';
567
+ messageId: string;
568
+ }
569
+ /** Toggle an emoji reaction on a message (idempotent toggle server-side). */
570
+ export interface ReactInput {
571
+ conversationId: string;
572
+ messageId: string;
573
+ /** <= VERB_LIMITS.reactionEmojiChars after normalization. Content-adjacent
574
+ * (open decision D5: MLS messengers encrypt reactions) — rides the body. */
575
+ emoji: string;
576
+ }
577
+ export interface ReactResult {
578
+ status: 'reacted';
579
+ action: 'added' | 'removed';
580
+ reactions?: Record<string, unknown>;
581
+ }
582
+ /** Forward an existing message into another conversation. Under E2EE this
583
+ * becomes a client-side re-encrypt; the wire verb carries only routing ids
584
+ * plus an optional caption. */
585
+ export interface ForwardInput {
586
+ sourceConversationId: string;
587
+ targetConversationId: string;
588
+ messageId: string;
589
+ /** Optional caption; <= VERB_LIMITS.messageTextBytes UTF-8 bytes. */
590
+ text?: string;
591
+ }
592
+ export interface ForwardResult {
593
+ status: 'forwarded';
594
+ messageId: string;
595
+ targetConversationId: string;
596
+ forwardedFrom?: unknown;
597
+ }
598
+ export interface CreateGroupInput {
599
+ /** Optional conversation title (authoring cap VERB_LIMITS.groupNameChars). */
600
+ name?: string;
601
+ /** Other members; the caller is added automatically. Cap
602
+ * VERB_LIMITS.groupMembers including the creator. Each target's
603
+ * groupJoinPolicy is enforced server-side. */
604
+ memberIds: string[];
605
+ }
606
+ export interface PendingGroupInviteResult {
607
+ userId: string;
608
+ requestId: string;
609
+ }
610
+ export interface CreateGroupResult {
611
+ status: 'created';
612
+ conversationId: string;
613
+ /** Members admitted synchronously during creation. */
614
+ added: string[];
615
+ /** group_invite requests awaiting exact policy approval. */
616
+ pending: PendingGroupInviteResult[];
617
+ /** Members the staged create could not admit: hard policy denials
618
+ * (closed, blocked, inactive, not-found, …). */
619
+ skipped: Array<{
620
+ userId: string;
621
+ reason: string;
622
+ }>;
623
+ }
624
+ /**
625
+ * Error code on the 400 a create_group receives when no requested member can
626
+ * be added or invited. A creator-only group with at least one valid pending
627
+ * invite is allowed; the error detail carries the attempted partition.
628
+ */
629
+ export declare const CREATE_GROUP_NO_ADDABLE_MEMBERS_CODE = "CREATE_GROUP_NO_ADDABLE_MEMBERS";
630
+ export interface AddMemberInput {
631
+ conversationId: string;
632
+ userId: string;
633
+ }
634
+ /** Policy approval yields one exact pending group invite. */
635
+ export type AddMemberResult = {
636
+ status: 'added';
637
+ } | {
638
+ status: 'pending';
639
+ requestId: string;
640
+ };
641
+ export interface RemoveMemberInput {
642
+ conversationId: string;
643
+ userId: string;
644
+ }
645
+ export interface RemoveMemberResult {
646
+ status: 'removed';
647
+ }
648
+ export interface LeaveConversationInput {
649
+ conversationId: string;
650
+ }
651
+ export interface LeaveConversationResult {
652
+ status: 'left';
653
+ }
654
+ export type ListContactsInput = Record<string, never>;
655
+ export interface VerbContact {
656
+ /** The contact's userId. */
657
+ id: string;
658
+ /** Vocabulary: direct_add | phone_book | contact_request | link | qr | group | open_inbound_message | unknown (server passes strings through). */
659
+ source: string;
660
+ addedAt: string | null;
661
+ displayNameOverride: string | null;
662
+ }
663
+ export interface ListContactsResult {
664
+ contacts: VerbContact[];
665
+ }
666
+ export interface ListConversationsInput {
667
+ /** Optional client-side cap; the REST endpoint returns all memberships. */
668
+ limit?: number;
669
+ }
670
+ export interface VerbConversationSummary {
671
+ id: string;
672
+ type: 'direct' | 'group';
673
+ /** Raw passthrough — may be absent entirely on direct chats. */
674
+ name?: string | null;
675
+ topic: string | null;
676
+ memberIds: string[];
677
+ /** Original pair provenance for presentation; never grants membership or authority. */
678
+ originalParticipantIds?: string[];
679
+ membershipModel?: 'unified';
680
+ membershipRevision?: number;
681
+ participantTypes?: Record<string, 'human' | 'ai_agent'>;
682
+ participantSummary?: {
683
+ humanCount: number;
684
+ agentCount: number;
685
+ totalCount: number;
686
+ };
687
+ runtimeSessionKind?: 'direct' | 'group';
688
+ admissionId?: string | null;
689
+ historyStartAt?: string | null;
690
+ isAgentChat: boolean;
691
+ hasUnread?: boolean;
692
+ lastMessage: {
693
+ text: string | null;
694
+ messageId?: string;
695
+ senderId: string;
696
+ senderType: string;
697
+ contentType?: string;
698
+ timestamp: string | null;
699
+ } | null;
700
+ createdAt: string | null;
701
+ }
702
+ export interface ListConversationsResult {
703
+ conversations: VerbConversationSummary[];
704
+ }
705
+ /** Deliberate silence: end the turn without posting anything. */
706
+ export interface NoReplyInput {
707
+ /** Bindings default this to the active conversation when they have one. */
708
+ conversationId?: string;
709
+ /** Private rationale — logged only, never rendered. <= noReplyReasonChars. */
710
+ reason?: string;
711
+ }
712
+ export interface NoReplyResult {
713
+ status: 'acknowledged';
714
+ conversationId?: string;
715
+ note?: string;
716
+ }
717
+ /**
718
+ * The `note` the server returns on a `no_reply` ack — the model's closure
719
+ * sentence. It lives here, not in a host, because every binding surfaces the
720
+ * server's result verbatim and a runtime that answers `no_reply` locally must
721
+ * say the same thing.
722
+ */
723
+ export declare const NO_REPLY_ACK_NOTE = "Acknowledged \u2014 nothing was posted to the conversation.";
724
+ /** Flat tool name for a verb on namespaced tool surfaces (e.g. `canon_send_to`). */
725
+ export declare function canonVerbToolName(verb: CanonVerbName): string;
726
+ export interface VerbLimitViolation {
727
+ path: string;
728
+ message: string;
729
+ }
730
+ /**
731
+ * The server limits JSON Schema cannot express: UTF-8 byte caps and
732
+ * serialized-JSON length caps. Bindings MUST run this after schema
733
+ * validation; the server enforces the same checks with 400s.
734
+ */
735
+ export declare function findVerbByteLimitViolations(verb: CanonVerbName, input: Record<string, unknown>): VerbLimitViolation[];
736
+ /**
737
+ * Machine-readable limits companion to the schema bundle, emitted as
738
+ * dist/canon-verbs.limits.json so non-TypeScript bindings can apply the
739
+ * byte-sensitive checks JSON Schema cannot express.
740
+ */
741
+ export declare const CANON_VERB_LIMITS_ARTIFACT: {
742
+ readonly schemaVersion: "canon.verbs.v1";
743
+ readonly limits: {
744
+ /** Message text — UTF-8 bytes (functions/src/api/sendMessage.ts MAX_MESSAGE_TEXT_BYTES). */
745
+ readonly messageTextBytes: 4096;
746
+ /**
747
+ * Serialized metadata JSON length in UTF-16 code units — the server checks
748
+ * JSON.stringify(metadata).length, not bytes (sendMessage.ts:716-724 inline;
749
+ * parseBody.ts maxJsonBytes despite the name).
750
+ */
751
+ readonly messageMetadataJsonChars: 4096;
752
+ /** Attachments per message (sendMessage.ts MAX_MESSAGE_ATTACHMENTS). */
753
+ readonly messageAttachments: 10;
754
+ /** Client-supplied messageId — chars and UTF-8 bytes (sendMessage.ts). */
755
+ readonly messageIdChars: 160;
756
+ readonly messageIdBytes: 256;
757
+ /** Self-context note (functions/src/utils/selfContexts.ts SELF_CONTEXT_CONTEXT_LIMIT). */
758
+ readonly selfContextChars: 1000;
759
+ /** Short private description of an external working context. */
760
+ readonly externalSourceLabelChars: 80;
761
+ /**
762
+ * Contact-request note. Values longer than this are truncated by senders
763
+ * (slice(0,497)+'...') — the truncation is currently triplicated in
764
+ * functions/src/api/sendContextualMessage.ts, packages/core/src/reach-out.ts
765
+ * and the hermes plugin; this constant is the canonical figure.
766
+ */
767
+ readonly contactRequestNoteChars: 500;
768
+ /** Group membership cap incl. creator (functions/src/utils/conversations.ts MAX_GROUP_MEMBERS). */
769
+ readonly groupMembers: 50;
770
+ /** Runtime input (functions/src/api/interactionInput.ts). */
771
+ readonly inputTitleChars: 160;
772
+ readonly inputPromptChars: 4000;
773
+ readonly inputChoices: 12;
774
+ readonly inputChoiceLabelChars: 120;
775
+ readonly inputChoiceValueChars: 200;
776
+ readonly inputChoiceDescriptionChars: 300;
777
+ readonly inputQuestions: 12;
778
+ readonly inputQuestionChars: 1000;
779
+ readonly inputQuestionHeaderChars: 120;
780
+ readonly inputSecretNameChars: 160;
781
+ readonly inputAnswerChars: 8192;
782
+ /** Approval (functions/src/api/interactionApproval.ts). */
783
+ readonly toolNameChars: 128;
784
+ readonly toolSummaryChars: 1000;
785
+ readonly approvalDetails: 8;
786
+ readonly approvalDetailLabelChars: 80;
787
+ readonly approvalDetailValueChars: 500;
788
+ readonly diffFiles: 100;
789
+ readonly diffPathChars: 1024;
790
+ readonly diffFileBytes: number;
791
+ readonly diffTotalBytes: number;
792
+ /** Card envelope acceptance (functions/src/api/interactionCard.ts — server caps;
793
+ * authoring caps in @canonmsg/rich-cards are stricter: title 120, fallback 500, blocks 24). */
794
+ readonly cardEnvelopeBytes: number;
795
+ readonly cardServerTitleChars: 200;
796
+ readonly cardServerFallbackTextChars: 2000;
797
+ readonly cardServerBlocks: 64;
798
+ /** Response-values caps enforced on submit (callable respondToInteraction.ts
799
+ * MAX_VALUES_BYTES/MAX_VALUES_DEPTH; interactionCard.ts re-checks bytes on
800
+ * consume via MAX_REPLY_BYTES). */
801
+ readonly cardValuesBytes: number;
802
+ readonly cardValuesDepth: 8;
803
+ /** Native correlation metadata (functions/src/api/interactionKinds.ts normalizeNative). */
804
+ readonly nativeKeys: 24;
805
+ readonly nativeValueChars: 256;
806
+ readonly nativeHandles: 16;
807
+ /** Deadlines (functions/src/utils/runtimeRequestHelpers.ts). */
808
+ readonly minTimeoutMs: 1000;
809
+ /** input/card/plan ceiling (30 minutes). */
810
+ readonly maxTimeoutMs: number;
811
+ /** approval-only ceiling (72 hours — owner ruling 2026-07-10). */
812
+ readonly maxApprovalTimeoutMs: number;
813
+ /** turnId / runtimeId fields on interaction creators. */
814
+ readonly turnIdChars: 128;
815
+ /** Reaction key (functions/src/api/reactToMessage.ts normalizeReactionKey). */
816
+ readonly reactionEmojiChars: 64;
817
+ /**
818
+ * Group name authoring cap (enforced on rename via updateNameServer; group
819
+ * CREATE does not length-check today — treat as the authoring contract).
820
+ */
821
+ readonly groupNameChars: 100;
822
+ /**
823
+ * `no_reply.reason` authoring cap. There is no server enforcement beyond the
824
+ * intent schema — the handler logs the reason's presence and nothing else —
825
+ * so this constant is the canonical figure.
826
+ */
827
+ readonly noReplyReasonChars: 500;
828
+ };
829
+ readonly rateLimits: {
830
+ readonly senderMessagesPer5Min: 300;
831
+ readonly conversationMessagesPer5Min: 120;
832
+ readonly agentPeerMessagesPerHour: 30;
833
+ };
834
+ readonly idPatterns: {
835
+ readonly runtimeId: "^[A-Za-z0-9_.:-]{1,160}$";
836
+ readonly cardId: "^[A-Za-z0-9_.:-]{1,80}$";
837
+ readonly actionId: "^[A-Za-z0-9_.:-]{1,80}$";
838
+ readonly questionId: "^[A-Za-z0-9_.:-]{1,120}$";
839
+ readonly sessionRuleToolPattern: "^[\\w.*:-]{1,128}$";
840
+ readonly runtimeCorrelationValue: "^[A-Za-z0-9@_][A-Za-z0-9_.:@+\\-]{0,255}$";
841
+ readonly runtimeMethod: "^[A-Za-z0-9_][A-Za-z0-9_./:\\-]{0,255}$";
842
+ readonly runtimeHandleKey: "^[A-Za-z0-9_.:-]{1,80}$";
843
+ /** UUID issued by Canon's resumable-media session endpoint. */
844
+ readonly resumableUploadId: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$";
845
+ };
846
+ readonly byteSemantics: {
847
+ readonly 'send_to.text': "utf8_bytes<=messageTextBytes";
848
+ readonly 'share_contact.text': "utf8_bytes<=messageTextBytes";
849
+ readonly 'forward.text': "utf8_bytes<=messageTextBytes";
850
+ readonly 'send_to.messageOptions.messageId': "utf8_bytes<=messageIdBytes";
851
+ readonly 'share_contact.messageId': "utf8_bytes<=messageIdBytes";
852
+ readonly 'send_to.messageOptions.metadata': "json_stringify_chars<=messageMetadataJsonChars";
853
+ readonly 'send_card.card': "json_utf8_bytes<=cardEnvelopeBytes";
854
+ readonly 'request_card.card': "json_utf8_bytes<=cardEnvelopeBytes";
855
+ };
856
+ };