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