@canonmsg/backend-contracts 1.8.1 → 2.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 (193) hide show
  1. package/dist/agentBehaviorPolicy.d.ts +45 -86
  2. package/dist/agentBehaviorPolicy.js +0 -53
  3. package/dist/cjs/agentBehaviorPolicy.js +1 -54
  4. package/dist/cjs/contactRequest.js +0 -30
  5. package/dist/cjs/index.js +0 -8
  6. package/dist/cjs/media.js +0 -13
  7. package/dist/cjs/message.js +0 -64
  8. package/dist/cjs/runtimeCardFields.js +1 -58
  9. package/dist/cjs/turnProtocol.js +1 -41
  10. package/dist/contactRequest.d.ts +23 -42
  11. package/dist/contactRequest.js +0 -29
  12. package/dist/index.d.ts +0 -8
  13. package/dist/index.js +0 -8
  14. package/dist/media.d.ts +11 -24
  15. package/dist/media.js +0 -12
  16. package/dist/message.d.ts +50 -133
  17. package/dist/message.js +1 -64
  18. package/dist/runtimeCardFields.d.ts +39 -112
  19. package/dist/runtimeCardFields.js +0 -57
  20. package/dist/turnProtocol.d.ts +24 -91
  21. package/dist/turnProtocol.js +0 -40
  22. package/package.json +5 -8
  23. package/dist/bridgeLocal.d.ts +0 -1729
  24. package/dist/bridgeLocal.js +0 -673
  25. package/dist/cjs/bridgeLocal.js +0 -676
  26. package/dist/cjs/controlSignals.js +0 -44
  27. package/dist/cjs/endpointRegistry.js +0 -264
  28. package/dist/cjs/hitl.js +0 -0
  29. package/dist/cjs/inboundFrame.js +0 -92
  30. package/dist/cjs/restEndpoints.js +0 -237
  31. package/dist/cjs/sendContextual.js +0 -92
  32. package/dist/cjs/sseEvents.js +0 -298
  33. package/dist/controlSignals.d.ts +0 -55
  34. package/dist/controlSignals.js +0 -41
  35. package/dist/endpointRegistry.d.ts +0 -13
  36. package/dist/endpointRegistry.js +0 -261
  37. package/dist/hitl.d.ts +0 -303
  38. package/dist/hitl.js +0 -168
  39. package/dist/inboundFrame.d.ts +0 -229
  40. package/dist/inboundFrame.js +0 -89
  41. package/dist/restEndpoints.d.ts +0 -531
  42. package/dist/restEndpoints.js +0 -234
  43. package/dist/schemas/agent-behavior-settings-record.schema.json +0 -48
  44. package/dist/schemas/bridge-connection-state-notification.schema.json +0 -19
  45. package/dist/schemas/bridge-get-attachment-params.schema.json +0 -24
  46. package/dist/schemas/bridge-get-attachment-result.schema.json +0 -20
  47. package/dist/schemas/bridge-hello-params.schema.json +0 -42
  48. package/dist/schemas/bridge-hello-result.schema.json +0 -105
  49. package/dist/schemas/bridge-hitl-state.schema.json +0 -38
  50. package/dist/schemas/bridge-ok-result.schema.json +0 -15
  51. package/dist/schemas/bridge-ready-notification.schema.json +0 -79
  52. package/dist/schemas/bridge-resync-reason.schema.json +0 -9
  53. package/dist/schemas/bridge-resync.schema.json +0 -18
  54. package/dist/schemas/bridge-rpc-error.schema.json +0 -19
  55. package/dist/schemas/bridge-rpc-id.schema.json +0 -12
  56. package/dist/schemas/bridge-rpc-notification.schema.json +0 -20
  57. package/dist/schemas/bridge-rpc-request.schema.json +0 -31
  58. package/dist/schemas/bridge-rpc-response.schema.json +0 -81
  59. package/dist/schemas/bridge-status-result.schema.json +0 -76
  60. package/dist/schemas/bridge-upload-media-params.schema.json +0 -28
  61. package/dist/schemas/bridge-upstream-state.schema.json +0 -10
  62. package/dist/schemas/contacts-response.schema.json +0 -52
  63. package/dist/schemas/control-channel-key.schema.json +0 -10
  64. package/dist/schemas/control-primitive-event.schema.json +0 -30
  65. package/dist/schemas/control-primitive-map.schema.json +0 -15
  66. package/dist/schemas/control-session-event.schema.json +0 -26
  67. package/dist/schemas/control-session-node.schema.json +0 -11
  68. package/dist/schemas/control-signal-event.schema.json +0 -35
  69. package/dist/schemas/control-signal-node.schema.json +0 -22
  70. package/dist/schemas/control-signal-type.schema.json +0 -10
  71. package/dist/schemas/conversations-response.schema.json +0 -167
  72. package/dist/schemas/create-contact-request-request.schema.json +0 -17
  73. package/dist/schemas/create-contact-request-response.schema.json +0 -51
  74. package/dist/schemas/create-conversation-request.schema.json +0 -82
  75. package/dist/schemas/create-conversation-response.schema.json +0 -29
  76. package/dist/schemas/delete-message-response.schema.json +0 -11
  77. package/dist/schemas/delivery-intent.schema.json +0 -11
  78. package/dist/schemas/forward-message-request.schema.json +0 -25
  79. package/dist/schemas/forward-message-response.schema.json +0 -35
  80. package/dist/schemas/forwarded-from.schema.json +0 -18
  81. package/dist/schemas/get-messages-query.schema.json +0 -17
  82. package/dist/schemas/hitl-approval-category.schema.json +0 -15
  83. package/dist/schemas/hitl-approval-detail.schema.json +0 -21
  84. package/dist/schemas/hitl-approval-outcome-record.schema.json +0 -33
  85. package/dist/schemas/hitl-approval-reply-record.schema.json +0 -57
  86. package/dist/schemas/hitl-approval-request-record.schema.json +0 -105
  87. package/dist/schemas/hitl-approval-risk.schema.json +0 -11
  88. package/dist/schemas/hitl-card-outcome-record.schema.json +0 -48
  89. package/dist/schemas/hitl-card-reply-record.schema.json +0 -46
  90. package/dist/schemas/hitl-card-request-record.schema.json +0 -73
  91. package/dist/schemas/hitl-input-answers.schema.json +0 -23
  92. package/dist/schemas/hitl-input-kind.schema.json +0 -10
  93. package/dist/schemas/hitl-input-outcome-record.schema.json +0 -46
  94. package/dist/schemas/hitl-input-question.schema.json +0 -54
  95. package/dist/schemas/hitl-input-reply-record.schema.json +0 -44
  96. package/dist/schemas/hitl-input-request-record.schema.json +0 -134
  97. package/dist/schemas/hitl-pending.schema.json +0 -31
  98. package/dist/schemas/hitl-request-accepted.schema.json +0 -18
  99. package/dist/schemas/hitl-request-kind.schema.json +0 -10
  100. package/dist/schemas/hitl-resolution-status.schema.json +0 -10
  101. package/dist/schemas/hitl-resolution.schema.json +0 -38
  102. package/dist/schemas/hitl-session-rule.schema.json +0 -32
  103. package/dist/schemas/inbound-disposition.schema.json +0 -13
  104. package/dist/schemas/inbound-frame-attachment-v1.schema.json +0 -94
  105. package/dist/schemas/inbound-frame-contact-card-v1.schema.json +0 -59
  106. package/dist/schemas/inbound-frame-group-context-v1.schema.json +0 -96
  107. package/dist/schemas/inbound-frame-reply-context-v1.schema.json +0 -261
  108. package/dist/schemas/inbound-frame-shape-v1.schema.json +0 -12
  109. package/dist/schemas/inbound-frame-v1.schema.json +0 -506
  110. package/dist/schemas/mark-read-response.schema.json +0 -11
  111. package/dist/schemas/media-attachment-kind.schema.json +0 -11
  112. package/dist/schemas/media-attachment.schema.json +0 -42
  113. package/dist/schemas/messages-page-response.schema.json +0 -290
  114. package/dist/schemas/participation-decision-input.schema.json +0 -44
  115. package/dist/schemas/participation-history-message.schema.json +0 -23
  116. package/dist/schemas/participation-history-snapshot.schema.json +0 -37
  117. package/dist/schemas/participation-style.schema.json +0 -13
  118. package/dist/schemas/react-request.schema.json +0 -22
  119. package/dist/schemas/react-response.schema.json +0 -35
  120. package/dist/schemas/resolve-admission-request.schema.json +0 -30
  121. package/dist/schemas/resolve-admission-response.schema.json +0 -129
  122. package/dist/schemas/resolved-agent-behavior-policy-record.schema.json +0 -81
  123. package/dist/schemas/rest-contact.schema.json +0 -40
  124. package/dist/schemas/rest-conversation-last-message.schema.json +0 -77
  125. package/dist/schemas/rest-conversation.schema.json +0 -155
  126. package/dist/schemas/rest-message.schema.json +0 -252
  127. package/dist/schemas/rest-ok-response.schema.json +0 -11
  128. package/dist/schemas/rest-session-selection.schema.json +0 -40
  129. package/dist/schemas/runtime-card-field-choice.schema.json +0 -23
  130. package/dist/schemas/runtime-card-field-type.schema.json +0 -17
  131. package/dist/schemas/runtime-card-field.schema.json +0 -180
  132. package/dist/schemas/runtime-card-line-item-column-type.schema.json +0 -12
  133. package/dist/schemas/runtime-card-line-item-column.schema.json +0 -74
  134. package/dist/schemas/send-contextual-deferred-response.schema.json +0 -39
  135. package/dist/schemas/send-contextual-messaged-response.schema.json +0 -42
  136. package/dist/schemas/send-contextual-request.schema.json +0 -103
  137. package/dist/schemas/send-contextual-response.schema.json +0 -105
  138. package/dist/schemas/send-contextual-self-context.schema.json +0 -19
  139. package/dist/schemas/send-contextual-state-response.schema.json +0 -24
  140. package/dist/schemas/send-message-request.schema.json +0 -106
  141. package/dist/schemas/send-message-response.schema.json +0 -14
  142. package/dist/schemas/sender-type.schema.json +0 -9
  143. package/dist/schemas/serialize-message-input.schema.json +0 -29
  144. package/dist/schemas/serialized-agent-client-type.schema.json +0 -12
  145. package/dist/schemas/serialized-contact-card.schema.json +0 -65
  146. package/dist/schemas/serialized-contact-request-status.schema.json +0 -11
  147. package/dist/schemas/serialized-contact-request.schema.json +0 -157
  148. package/dist/schemas/serialized-content-type.schema.json +0 -13
  149. package/dist/schemas/serialized-message.schema.json +0 -249
  150. package/dist/schemas/serialized-reactions.schema.json +0 -14
  151. package/dist/schemas/serialized-sender-type.schema.json +0 -9
  152. package/dist/schemas/set-streaming-request.schema.json +0 -67
  153. package/dist/schemas/set-typing-request.schema.json +0 -25
  154. package/dist/schemas/sse-access-policy.schema.json +0 -10
  155. package/dist/schemas/sse-agent-context-payload.schema.json +0 -57
  156. package/dist/schemas/sse-connected-payload.schema.json +0 -18
  157. package/dist/schemas/sse-contact-payload.schema.json +0 -40
  158. package/dist/schemas/sse-contact-removed-payload.schema.json +0 -14
  159. package/dist/schemas/sse-contact-request-payload.schema.json +0 -157
  160. package/dist/schemas/sse-conversation-updated-payload.schema.json +0 -48
  161. package/dist/schemas/sse-error-payload.schema.json +0 -23
  162. package/dist/schemas/sse-event-envelope.schema.json +0 -42
  163. package/dist/schemas/sse-event-family.schema.json +0 -12
  164. package/dist/schemas/sse-event-type.schema.json +0 -28
  165. package/dist/schemas/sse-heartbeat-payload.schema.json +0 -14
  166. package/dist/schemas/sse-membership-change.schema.json +0 -28
  167. package/dist/schemas/sse-message-created-payload.schema.json +0 -414
  168. package/dist/schemas/sse-message-deleted-payload.schema.json +0 -18
  169. package/dist/schemas/sse-message-updated-payload.schema.json +0 -46
  170. package/dist/schemas/sse-presence-payload.schema.json +0 -21
  171. package/dist/schemas/sse-provenance.schema.json +0 -64
  172. package/dist/schemas/sse-replay-expired-payload.schema.json +0 -21
  173. package/dist/schemas/sse-runtime-control-kind.schema.json +0 -13
  174. package/dist/schemas/sse-runtime-control-payload.schema.json +0 -44
  175. package/dist/schemas/sse-runtime-updated-payload.schema.json +0 -78
  176. package/dist/schemas/sse-self-context.schema.json +0 -45
  177. package/dist/schemas/sse-turn-dispatch.schema.json +0 -29
  178. package/dist/schemas/sse-turn-updated-payload.schema.json +0 -33
  179. package/dist/schemas/sse-typing-payload.schema.json +0 -32
  180. package/dist/schemas/sse-voice-session-event-payload.schema.json +0 -170
  181. package/dist/schemas/sse-voice-session.schema.json +0 -157
  182. package/dist/schemas/trigger-decision.schema.json +0 -27
  183. package/dist/schemas/turn-lifecycle-state.schema.json +0 -14
  184. package/dist/schemas/turn-message-semantics.schema.json +0 -10
  185. package/dist/schemas/turn-metadata.schema.json +0 -56
  186. package/dist/schemas/turn-state-like.schema.json +0 -39
  187. package/dist/schemas/update-disposition-request.schema.json +0 -22
  188. package/dist/schemas/upload-media-request.schema.json +0 -25
  189. package/dist/schemas/upload-media-response.schema.json +0 -55
  190. package/dist/sendContextual.d.ts +0 -114
  191. package/dist/sendContextual.js +0 -89
  192. package/dist/sseEvents.d.ts +0 -494
  193. package/dist/sseEvents.js +0 -295
@@ -1,261 +0,0 @@
1
- import { ContactsResponseSchema, ConversationsResponseSchema, CreateContactRequestRequestSchema, CreateContactRequestResponseSchema, CreateConversationRequestSchema, CreateConversationResponseSchema, ForwardMessageRequestSchema, ForwardMessageResponseSchema, GetMessagesQuerySchema, MessagesPageResponseSchema, ReactRequestSchema, ReactResponseSchema, ResolveAdmissionRequestSchema, ResolveAdmissionResponseSchema, RestContactSchema, SendMessageRequestSchema, SendMessageResponseSchema, SetStreamingRequestSchema, SetTypingRequestSchema, UpdateDispositionRequestSchema, UploadMediaRequestSchema, UploadMediaResponseSchema, } from './restEndpoints.js';
2
- import { SendContextualRequestSchema, SendContextualResponseSchema, } from './sendContextual.js';
3
- export const CANON_REST_ENDPOINTS = [
4
- // ── Identity ─────────────────────────────────────────────────────────
5
- {
6
- method: 'POST',
7
- path: '/agents/register',
8
- section: 'identity',
9
- note: 'Public registration request. No API key required.',
10
- },
11
- {
12
- method: 'GET',
13
- path: '/agents/status/:requestId',
14
- section: 'identity',
15
- note: 'Poll approval status. Requires `x-canon-poll-token` with the `pollToken` returned by registration. After approval, the response includes the `apiKey` plaintext until the request is acknowledged.',
16
- },
17
- {
18
- method: 'POST',
19
- path: '/agents/status/:requestId/ack',
20
- section: 'identity',
21
- note: 'Acknowledge delivery. Requires `x-canon-poll-token`; clears the plaintext key from the registration request record so subsequent GET reads return `apiKeyDelivered: true`. Unacked plaintext keys are also auto-scrubbed 48 hours after approval; subsequent GET reads then return `apiKeyExpired: true` and the registrant must re-register (or the owner re-issues via key rotation).',
22
- },
23
- {
24
- method: 'GET',
25
- path: '/agents/me',
26
- section: 'identity',
27
- note: 'Authenticated agent identity and context.',
28
- },
29
- {
30
- method: 'PATCH',
31
- path: '/agents/profile',
32
- section: 'identity',
33
- note: 'Update agent profile fields.',
34
- },
35
- {
36
- method: 'POST',
37
- path: '/agents/auth-token',
38
- section: 'identity',
39
- note: 'Exchange API key for live agent-channel access when needed.',
40
- },
41
- {
42
- method: 'POST',
43
- path: '/agents/keys/rotate',
44
- section: 'identity',
45
- note: 'Agent-initiated key rotation. Returns the new plaintext key once.',
46
- },
47
- // ── Messaging ────────────────────────────────────────────────────────
48
- {
49
- method: 'POST',
50
- path: '/messages/send',
51
- section: 'messaging',
52
- note: 'Send a durable message into a conversation.',
53
- request: SendMessageRequestSchema,
54
- response: SendMessageResponseSchema,
55
- },
56
- {
57
- method: 'POST',
58
- path: '/messages/send-contextual',
59
- section: 'messaging',
60
- note: 'Cross-conversation message with private agent self-context.',
61
- request: SendContextualRequestSchema,
62
- response: SendContextualResponseSchema,
63
- },
64
- {
65
- method: 'POST',
66
- path: '/messages/react',
67
- section: 'messaging',
68
- note: 'Toggle an emoji reaction.',
69
- request: ReactRequestSchema,
70
- response: ReactResponseSchema,
71
- },
72
- {
73
- method: 'POST',
74
- path: '/messages/forward',
75
- section: 'messaging',
76
- note: 'Forward an existing message.',
77
- request: ForwardMessageRequestSchema,
78
- response: ForwardMessageResponseSchema,
79
- },
80
- {
81
- method: 'DELETE',
82
- path: '/conversations/:conversationId/messages/:messageId',
83
- section: 'messaging',
84
- note: "Soft-delete the agent's own message.",
85
- },
86
- {
87
- method: 'PATCH',
88
- path: '/conversations/:conversationId/messages/:messageId/disposition',
89
- section: 'messaging',
90
- note: 'Update message disposition metadata.',
91
- request: UpdateDispositionRequestSchema,
92
- },
93
- {
94
- method: 'POST',
95
- path: '/typing',
96
- section: 'messaging',
97
- note: 'Publish typing state.',
98
- request: SetTypingRequestSchema,
99
- },
100
- {
101
- method: 'POST',
102
- path: '/streaming',
103
- section: 'messaging',
104
- note: 'Publish live streaming/progress state through REST. Most current runtimes prefer shared live-state helpers.',
105
- request: SetStreamingRequestSchema,
106
- },
107
- // ── Conversations ────────────────────────────────────────────────────
108
- {
109
- method: 'GET',
110
- path: '/conversations',
111
- section: 'conversations',
112
- note: 'List conversations the agent participates in.',
113
- response: ConversationsResponseSchema,
114
- },
115
- {
116
- method: 'GET',
117
- path: '/conversations/:conversationId/messages',
118
- section: 'conversations',
119
- note: 'Fetch recent messages.',
120
- request: GetMessagesQuerySchema,
121
- response: MessagesPageResponseSchema,
122
- },
123
- {
124
- method: 'POST',
125
- path: '/conversations/create',
126
- section: 'conversations',
127
- note: 'Create or find a direct/group conversation when allowed.',
128
- request: CreateConversationRequestSchema,
129
- response: CreateConversationResponseSchema,
130
- },
131
- {
132
- method: 'PATCH',
133
- path: '/conversations/:conversationId/topic',
134
- section: 'conversations',
135
- note: 'Update the topic.',
136
- },
137
- {
138
- method: 'PATCH',
139
- path: '/conversations/:conversationId/name',
140
- section: 'conversations',
141
- note: 'Update group name when allowed.',
142
- },
143
- {
144
- method: 'PATCH',
145
- path: '/conversations/:conversationId/avatar',
146
- section: 'conversations',
147
- note: 'Update group avatar when allowed.',
148
- },
149
- {
150
- method: 'POST',
151
- path: '/conversations/:conversationId/read',
152
- section: 'conversations',
153
- note: 'Mark read.',
154
- },
155
- {
156
- method: 'POST',
157
- path: '/conversations/:conversationId/mute',
158
- section: 'conversations',
159
- note: 'Mute for the agent.',
160
- },
161
- {
162
- method: 'POST',
163
- path: '/conversations/:conversationId/unmute',
164
- section: 'conversations',
165
- note: 'Unmute for the agent.',
166
- },
167
- {
168
- method: 'POST',
169
- path: '/conversations/:conversationId/hide',
170
- section: 'conversations',
171
- note: 'Hide until new inbound activity.',
172
- },
173
- {
174
- method: 'POST',
175
- path: '/conversations/:conversationId/leave',
176
- section: 'conversations',
177
- note: 'Leave a group.',
178
- },
179
- {
180
- method: 'POST',
181
- path: '/conversations/:conversationId/members',
182
- section: 'conversations',
183
- note: 'Add a member when allowed.',
184
- },
185
- {
186
- method: 'DELETE',
187
- path: '/conversations/:conversationId/members/:userId',
188
- section: 'conversations',
189
- note: 'Remove a member when allowed.',
190
- },
191
- // ── Contacts and access ──────────────────────────────────────────────
192
- {
193
- method: 'POST',
194
- path: '/contacts/request',
195
- section: 'contacts',
196
- note: 'Agent-side request for access.',
197
- request: CreateContactRequestRequestSchema,
198
- response: CreateContactRequestResponseSchema,
199
- },
200
- {
201
- method: 'GET',
202
- path: '/contacts/requests',
203
- section: 'contacts',
204
- note: 'Read-only awareness surface for requests involving the agent.',
205
- },
206
- {
207
- method: 'GET',
208
- path: '/contacts',
209
- section: 'contacts',
210
- note: "List the authenticated agent's contacts.",
211
- response: ContactsResponseSchema,
212
- },
213
- {
214
- method: 'GET',
215
- path: '/contacts/:contactId',
216
- section: 'contacts',
217
- note: 'Fetch a single contact entry; 404 if missing.',
218
- response: RestContactSchema,
219
- },
220
- {
221
- method: 'DELETE',
222
- path: '/contacts/:contactId',
223
- section: 'contacts',
224
- note: 'Remove a contact.',
225
- },
226
- {
227
- method: 'POST',
228
- path: '/users/block',
229
- section: 'contacts',
230
- note: 'Block a user.',
231
- },
232
- {
233
- method: 'POST',
234
- path: '/users/unblock',
235
- section: 'contacts',
236
- note: 'Unblock a user.',
237
- },
238
- {
239
- method: 'POST',
240
- path: '/admission/resolve',
241
- section: 'contacts',
242
- note: 'Resolve live admission state for a target user (used by `agent.reachOut` and contact-card CTAs to avoid acting on stale snapshots).',
243
- request: ResolveAdmissionRequestSchema,
244
- response: ResolveAdmissionResponseSchema,
245
- },
246
- {
247
- method: 'POST',
248
- path: '/admission/resolve-group',
249
- section: 'contacts',
250
- note: 'Resolve live group-join admission state (reads `groupJoinPolicy`).',
251
- },
252
- ];
253
- // Referenced for completeness of the registry import surface.
254
- export const CANON_MEDIA_UPLOAD_ENDPOINT = {
255
- method: 'POST',
256
- path: '/media/upload',
257
- section: 'messaging',
258
- note: 'Upload media; returns a Storage URL plus a normalized attachment.',
259
- request: UploadMediaRequestSchema,
260
- response: UploadMediaResponseSchema,
261
- };
package/dist/hitl.d.ts DELETED
@@ -1,303 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const HitlRequestKindSchema: z.ZodEnum<{
3
- input: "input";
4
- approval: "approval";
5
- card: "card";
6
- }>;
7
- export type HitlRequestKind = z.infer<typeof HitlRequestKindSchema>;
8
- export declare const HitlResolutionStatusSchema: z.ZodEnum<{
9
- cancelled: "cancelled";
10
- submitted: "submitted";
11
- timeout: "timeout";
12
- }>;
13
- export type HitlResolutionStatus = z.infer<typeof HitlResolutionStatusSchema>;
14
- export declare const HitlApprovalRiskSchema: z.ZodEnum<{
15
- low: "low";
16
- normal: "normal";
17
- high: "high";
18
- destructive: "destructive";
19
- }>;
20
- export type HitlApprovalRisk = z.infer<typeof HitlApprovalRiskSchema>;
21
- export declare const HitlApprovalCategorySchema: z.ZodEnum<{
22
- tool: "tool";
23
- file: "file";
24
- command: "command";
25
- network: "network";
26
- browser: "browser";
27
- mcp: "mcp";
28
- plugin: "plugin";
29
- canon: "canon";
30
- }>;
31
- export type HitlApprovalCategory = z.infer<typeof HitlApprovalCategorySchema>;
32
- export declare const HitlApprovalDetailSchema: z.ZodObject<{
33
- label: z.ZodString;
34
- value: z.ZodString;
35
- monospace: z.ZodOptional<z.ZodBoolean>;
36
- }, z.core.$strip>;
37
- export type HitlApprovalDetail = z.infer<typeof HitlApprovalDetailSchema>;
38
- export declare const HitlSessionRuleSchema: z.ZodObject<{
39
- type: z.ZodEnum<{
40
- "approve-all": "approve-all";
41
- "approve-tool": "approve-tool";
42
- "deny-tool": "deny-tool";
43
- }>;
44
- toolPattern: z.ZodOptional<z.ZodString>;
45
- expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
- }, z.core.$strip>;
47
- export type HitlSessionRule = z.infer<typeof HitlSessionRuleSchema>;
48
- export declare const HitlApprovalRequestRecordSchema: z.ZodObject<{
49
- type: z.ZodLiteral<"approval_request">;
50
- approvalId: z.ZodString;
51
- responseUserId: z.ZodOptional<z.ZodString>;
52
- toolName: z.ZodString;
53
- toolSummary: z.ZodString;
54
- category: z.ZodOptional<z.ZodEnum<{
55
- tool: "tool";
56
- file: "file";
57
- command: "command";
58
- network: "network";
59
- browser: "browser";
60
- mcp: "mcp";
61
- plugin: "plugin";
62
- canon: "canon";
63
- }>>;
64
- risk: z.ZodOptional<z.ZodEnum<{
65
- low: "low";
66
- normal: "normal";
67
- high: "high";
68
- destructive: "destructive";
69
- }>>;
70
- riskLevel: z.ZodOptional<z.ZodEnum<{
71
- normal: "normal";
72
- destructive: "destructive";
73
- }>>;
74
- runtimeId: z.ZodOptional<z.ZodString>;
75
- turnId: z.ZodOptional<z.ZodString>;
76
- native: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
77
- details: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
- label: z.ZodString;
79
- value: z.ZodString;
80
- monospace: z.ZodOptional<z.ZodBoolean>;
81
- }, z.core.$strip>>>;
82
- diff: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
83
- expiresAt: z.ZodString;
84
- }, z.core.$loose>;
85
- export type HitlApprovalRequestRecord = z.infer<typeof HitlApprovalRequestRecordSchema>;
86
- export declare const HitlApprovalReplyRecordSchema: z.ZodObject<{
87
- type: z.ZodLiteral<"approval_reply">;
88
- approvalId: z.ZodString;
89
- decision: z.ZodEnum<{
90
- allow: "allow";
91
- deny: "deny";
92
- }>;
93
- sessionRule: z.ZodOptional<z.ZodObject<{
94
- type: z.ZodEnum<{
95
- "approve-all": "approve-all";
96
- "approve-tool": "approve-tool";
97
- "deny-tool": "deny-tool";
98
- }>;
99
- toolPattern: z.ZodOptional<z.ZodString>;
100
- expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
101
- }, z.core.$strip>>;
102
- }, z.core.$loose>;
103
- export type HitlApprovalReplyRecord = z.infer<typeof HitlApprovalReplyRecordSchema>;
104
- export declare const HitlApprovalOutcomeRecordSchema: z.ZodObject<{
105
- type: z.ZodLiteral<"approval_outcome">;
106
- approvalId: z.ZodOptional<z.ZodString>;
107
- decision: z.ZodOptional<z.ZodEnum<{
108
- allow: "allow";
109
- deny: "deny";
110
- }>>;
111
- reason: z.ZodOptional<z.ZodEnum<{
112
- timeout: "timeout";
113
- replied: "replied";
114
- "session-rule": "session-rule";
115
- }>>;
116
- }, z.core.$loose>;
117
- export type HitlApprovalOutcomeRecord = z.infer<typeof HitlApprovalOutcomeRecordSchema>;
118
- export declare const HitlInputKindSchema: z.ZodEnum<{
119
- clarify: "clarify";
120
- sudo: "sudo";
121
- secret: "secret";
122
- }>;
123
- export type HitlInputKind = z.infer<typeof HitlInputKindSchema>;
124
- export declare const HitlInputQuestionSchema: z.ZodObject<{
125
- id: z.ZodString;
126
- question: z.ZodString;
127
- header: z.ZodOptional<z.ZodString>;
128
- choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
129
- label: z.ZodString;
130
- value: z.ZodOptional<z.ZodString>;
131
- description: z.ZodOptional<z.ZodString>;
132
- preview: z.ZodOptional<z.ZodString>;
133
- }, z.core.$strip>>>;
134
- allowOther: z.ZodOptional<z.ZodBoolean>;
135
- isSecret: z.ZodOptional<z.ZodBoolean>;
136
- multiSelect: z.ZodOptional<z.ZodBoolean>;
137
- }, z.core.$strip>;
138
- export type HitlInputQuestion = z.infer<typeof HitlInputQuestionSchema>;
139
- /** questionId → selected/typed answers. */
140
- export declare const HitlInputAnswersSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
141
- answers: z.ZodArray<z.ZodString>;
142
- }, z.core.$strip>>;
143
- export type HitlInputAnswers = z.infer<typeof HitlInputAnswersSchema>;
144
- export declare const HitlInputRequestRecordSchema: z.ZodObject<{
145
- type: z.ZodLiteral<"runtime_input_request">;
146
- inputId: z.ZodString;
147
- responseUserId: z.ZodOptional<z.ZodString>;
148
- kind: z.ZodEnum<{
149
- clarify: "clarify";
150
- sudo: "sudo";
151
- secret: "secret";
152
- }>;
153
- prompt: z.ZodString;
154
- title: z.ZodOptional<z.ZodString>;
155
- choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
156
- label: z.ZodString;
157
- value: z.ZodOptional<z.ZodString>;
158
- description: z.ZodOptional<z.ZodString>;
159
- preview: z.ZodOptional<z.ZodString>;
160
- }, z.core.$strip>>>;
161
- questions: z.ZodOptional<z.ZodArray<z.ZodObject<{
162
- id: z.ZodString;
163
- question: z.ZodString;
164
- header: z.ZodOptional<z.ZodString>;
165
- choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
166
- label: z.ZodString;
167
- value: z.ZodOptional<z.ZodString>;
168
- description: z.ZodOptional<z.ZodString>;
169
- preview: z.ZodOptional<z.ZodString>;
170
- }, z.core.$strip>>>;
171
- allowOther: z.ZodOptional<z.ZodBoolean>;
172
- isSecret: z.ZodOptional<z.ZodBoolean>;
173
- multiSelect: z.ZodOptional<z.ZodBoolean>;
174
- }, z.core.$strip>>>;
175
- secretName: z.ZodOptional<z.ZodString>;
176
- native: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
- expiresAt: z.ZodString;
178
- sensitive: z.ZodOptional<z.ZodBoolean>;
179
- }, z.core.$loose>;
180
- export type HitlInputRequestRecord = z.infer<typeof HitlInputRequestRecordSchema>;
181
- export declare const HitlInputReplyRecordSchema: z.ZodObject<{
182
- type: z.ZodLiteral<"runtime_input_reply">;
183
- inputId: z.ZodString;
184
- kind: z.ZodOptional<z.ZodEnum<{
185
- clarify: "clarify";
186
- sudo: "sudo";
187
- secret: "secret";
188
- }>>;
189
- status: z.ZodEnum<{
190
- cancelled: "cancelled";
191
- submitted: "submitted";
192
- }>;
193
- answerSummary: z.ZodOptional<z.ZodString>;
194
- answersSummary: z.ZodOptional<z.ZodString>;
195
- sensitive: z.ZodOptional<z.ZodBoolean>;
196
- }, z.core.$loose>;
197
- export type HitlInputReplyRecord = z.infer<typeof HitlInputReplyRecordSchema>;
198
- export declare const HitlInputOutcomeRecordSchema: z.ZodObject<{
199
- type: z.ZodLiteral<"runtime_input_outcome">;
200
- inputId: z.ZodString;
201
- kind: z.ZodOptional<z.ZodEnum<{
202
- clarify: "clarify";
203
- sudo: "sudo";
204
- secret: "secret";
205
- }>>;
206
- status: z.ZodEnum<{
207
- cancelled: "cancelled";
208
- submitted: "submitted";
209
- timeout: "timeout";
210
- }>;
211
- reason: z.ZodOptional<z.ZodEnum<{
212
- interrupted: "interrupted";
213
- cancelled: "cancelled";
214
- expired: "expired";
215
- submitted: "submitted";
216
- timeout: "timeout";
217
- }>>;
218
- }, z.core.$loose>;
219
- export type HitlInputOutcomeRecord = z.infer<typeof HitlInputOutcomeRecordSchema>;
220
- export declare const HitlCardRequestRecordSchema: z.ZodObject<{
221
- type: z.ZodLiteral<"runtime_card_request">;
222
- cardId: z.ZodString;
223
- cardKind: z.ZodString;
224
- schemaVersion: z.ZodLiteral<"canon.card.v1">;
225
- fallbackText: z.ZodString;
226
- responseUserId: z.ZodOptional<z.ZodString>;
227
- expiresAt: z.ZodString;
228
- runtimeId: z.ZodOptional<z.ZodString>;
229
- turnId: z.ZodOptional<z.ZodString>;
230
- native: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
231
- interactive: z.ZodOptional<z.ZodBoolean>;
232
- cardPreview: z.ZodRecord<z.ZodString, z.ZodUnknown>;
233
- turnSemantics: z.ZodLiteral<"control">;
234
- replyBehavior: z.ZodLiteral<"suppress_auto_reply">;
235
- }, z.core.$loose>;
236
- export type HitlCardRequestRecord = z.infer<typeof HitlCardRequestRecordSchema>;
237
- export declare const HitlCardReplyRecordSchema: z.ZodObject<{
238
- type: z.ZodLiteral<"runtime_card_reply">;
239
- cardId: z.ZodString;
240
- status: z.ZodEnum<{
241
- cancelled: "cancelled";
242
- submitted: "submitted";
243
- }>;
244
- actionId: z.ZodOptional<z.ZodString>;
245
- answerSummary: z.ZodOptional<z.ZodString>;
246
- sensitive: z.ZodOptional<z.ZodBoolean>;
247
- turnSemantics: z.ZodLiteral<"control">;
248
- replyBehavior: z.ZodLiteral<"suppress_auto_reply">;
249
- }, z.core.$loose>;
250
- export type HitlCardReplyRecord = z.infer<typeof HitlCardReplyRecordSchema>;
251
- export declare const HitlCardOutcomeRecordSchema: z.ZodObject<{
252
- type: z.ZodLiteral<"runtime_card_outcome">;
253
- cardId: z.ZodString;
254
- status: z.ZodEnum<{
255
- cancelled: "cancelled";
256
- submitted: "submitted";
257
- timeout: "timeout";
258
- }>;
259
- reason: z.ZodOptional<z.ZodEnum<{
260
- interrupted: "interrupted";
261
- cancelled: "cancelled";
262
- expired: "expired";
263
- submitted: "submitted";
264
- timeout: "timeout";
265
- }>>;
266
- turnSemantics: z.ZodLiteral<"control">;
267
- replyBehavior: z.ZodLiteral<"suppress_auto_reply">;
268
- }, z.core.$loose>;
269
- export type HitlCardOutcomeRecord = z.infer<typeof HitlCardOutcomeRecordSchema>;
270
- /** Immediate result of requestApproval/requestInput/requestCard. */
271
- export declare const HitlRequestAcceptedSchema: z.ZodObject<{
272
- requestId: z.ZodString;
273
- expiresAt: z.ZodString;
274
- }, z.core.$strip>;
275
- export type HitlRequestAccepted = z.infer<typeof HitlRequestAcceptedSchema>;
276
- /** `onHitlResolved` — matches an earlier requestId. */
277
- export declare const HitlResolutionSchema: z.ZodObject<{
278
- requestId: z.ZodString;
279
- kind: z.ZodOptional<z.ZodEnum<{
280
- input: "input";
281
- approval: "approval";
282
- card: "card";
283
- }>>;
284
- status: z.ZodEnum<{
285
- cancelled: "cancelled";
286
- submitted: "submitted";
287
- timeout: "timeout";
288
- }>;
289
- answer: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
290
- }, z.core.$strip>;
291
- export type HitlResolution = z.infer<typeof HitlResolutionSchema>;
292
- /** `onHitlPending` — replayed on reconnect for still-open requests. */
293
- export declare const HitlPendingSchema: z.ZodObject<{
294
- requestId: z.ZodString;
295
- kind: z.ZodEnum<{
296
- input: "input";
297
- approval: "approval";
298
- card: "card";
299
- }>;
300
- conversationId: z.ZodString;
301
- expiresAt: z.ZodString;
302
- }, z.core.$strip>;
303
- export type HitlPending = z.infer<typeof HitlPendingSchema>;