@sequenceholdings/agent-spec 0.1.2 → 0.1.4

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 (76) hide show
  1. package/README.md +152 -0
  2. package/dist/agent-definition.d.ts +626 -0
  3. package/dist/agent-definition.js +250 -0
  4. package/dist/canonical-json.d.ts +2 -0
  5. package/dist/canonical-json.js +13 -0
  6. package/dist/client-proposals.d.ts +20 -0
  7. package/dist/client-proposals.js +172 -0
  8. package/dist/index.d.ts +4 -116
  9. package/dist/index.js +4 -247
  10. package/dist/input-schema.d.ts +19 -0
  11. package/dist/input-schema.js +57 -0
  12. package/dist/job-request-hash.d.ts +27 -0
  13. package/dist/job-request-hash.js +54 -0
  14. package/dist/voice-access.d.ts +40 -0
  15. package/dist/voice-access.js +34 -0
  16. package/dist/voice-actions-contracts.d.ts +423 -0
  17. package/dist/voice-actions-contracts.js +95 -0
  18. package/dist/voice-actions-transitions.d.ts +52 -0
  19. package/dist/voice-actions-transitions.js +170 -0
  20. package/dist/voice-actions.d.ts +2 -0
  21. package/dist/voice-actions.js +2 -0
  22. package/dist/voice-api.d.ts +1102 -0
  23. package/dist/voice-api.js +164 -0
  24. package/dist/voice-authoring.d.ts +463 -0
  25. package/dist/voice-authoring.js +132 -0
  26. package/dist/voice-authority-contracts.d.ts +247 -0
  27. package/dist/voice-authority-contracts.js +177 -0
  28. package/dist/voice-authority-evaluation.d.ts +29 -0
  29. package/dist/voice-authority-evaluation.js +80 -0
  30. package/dist/voice-authority-verification.d.ts +47 -0
  31. package/dist/voice-authority-verification.js +184 -0
  32. package/dist/voice-authority.d.ts +3 -0
  33. package/dist/voice-authority.js +3 -0
  34. package/dist/voice-common.d.ts +21 -0
  35. package/dist/voice-common.js +23 -0
  36. package/dist/voice-drafts.d.ts +441 -0
  37. package/dist/voice-drafts.js +75 -0
  38. package/dist/voice-grant.d.ts +19 -0
  39. package/dist/voice-grant.js +21 -0
  40. package/dist/voice-lifecycle-control.d.ts +130 -0
  41. package/dist/voice-lifecycle-control.js +138 -0
  42. package/dist/voice-lifecycle-session.d.ts +168 -0
  43. package/dist/voice-lifecycle-session.js +114 -0
  44. package/dist/voice-lifecycle-states.d.ts +96 -0
  45. package/dist/voice-lifecycle-states.js +139 -0
  46. package/dist/voice-lifecycle.d.ts +3 -0
  47. package/dist/voice-lifecycle.js +3 -0
  48. package/dist/voice-policy-duration.d.ts +46 -0
  49. package/dist/voice-policy-duration.js +166 -0
  50. package/dist/voice-policy-limits.d.ts +174 -0
  51. package/dist/voice-policy-limits.js +188 -0
  52. package/dist/voice-policy.d.ts +2 -0
  53. package/dist/voice-policy.js +2 -0
  54. package/dist/voice-provider-evidence.d.ts +80 -0
  55. package/dist/voice-provider-evidence.js +115 -0
  56. package/dist/voice-provider-publication.d.ts +319 -0
  57. package/dist/voice-provider-publication.js +117 -0
  58. package/dist/voice-provider-release.d.ts +386 -0
  59. package/dist/voice-provider-release.js +154 -0
  60. package/dist/voice-provider.d.ts +3 -0
  61. package/dist/voice-provider.js +3 -0
  62. package/dist/voice-release.d.ts +808 -0
  63. package/dist/voice-release.js +110 -0
  64. package/dist/voice-runs-audio.d.ts +157 -0
  65. package/dist/voice-runs-audio.js +85 -0
  66. package/dist/voice-runs-evidence.d.ts +183 -0
  67. package/dist/voice-runs-evidence.js +154 -0
  68. package/dist/voice-runs-model.d.ts +967 -0
  69. package/dist/voice-runs-model.js +199 -0
  70. package/dist/voice-runs-tooling.d.ts +88 -0
  71. package/dist/voice-runs-tooling.js +100 -0
  72. package/dist/voice-runs.d.ts +4 -0
  73. package/dist/voice-runs.js +4 -0
  74. package/dist/voice.d.ts +13 -0
  75. package/dist/voice.js +13 -0
  76. package/package.json +8 -3
@@ -0,0 +1,423 @@
1
+ import { z } from 'zod';
2
+ export declare const voiceActionAuthoritySubjectSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
+ kind: z.ZodLiteral<"verified_resource">;
4
+ resource: z.ZodObject<{
5
+ kind: z.ZodString;
6
+ id: z.ZodString;
7
+ }, z.core.$strict>;
8
+ verificationId: z.ZodString;
9
+ }, z.core.$strict>, z.ZodObject<{
10
+ kind: z.ZodLiteral<"unverified">;
11
+ }, z.core.$strict>], "kind">;
12
+ export type VoiceActionAuthoritySubject = z.infer<typeof voiceActionAuthoritySubjectSchema>;
13
+ export declare const voiceActionIntentBindingSchema: z.ZodObject<{
14
+ intentId: z.ZodString;
15
+ subject: z.ZodObject<{
16
+ tenantId: z.ZodString;
17
+ environmentId: z.ZodString;
18
+ agentId: z.ZodString;
19
+ sessionId: z.ZodString;
20
+ releaseId: z.ZodString;
21
+ }, z.core.$strict>;
22
+ actionAlias: z.ZodString;
23
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
24
+ kind: z.ZodLiteral<"verified_resource">;
25
+ resource: z.ZodObject<{
26
+ kind: z.ZodString;
27
+ id: z.ZodString;
28
+ }, z.core.$strict>;
29
+ verificationId: z.ZodString;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"unverified">;
32
+ }, z.core.$strict>], "kind">;
33
+ argumentDigest: z.ZodString;
34
+ }, z.core.$strict>;
35
+ export type VoiceActionIntentBinding = z.infer<typeof voiceActionIntentBindingSchema>;
36
+ export declare const voicePrepareActionRequestSchema: z.ZodObject<{
37
+ binding: z.ZodObject<{
38
+ intentId: z.ZodString;
39
+ subject: z.ZodObject<{
40
+ tenantId: z.ZodString;
41
+ environmentId: z.ZodString;
42
+ agentId: z.ZodString;
43
+ sessionId: z.ZodString;
44
+ releaseId: z.ZodString;
45
+ }, z.core.$strict>;
46
+ actionAlias: z.ZodString;
47
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
48
+ kind: z.ZodLiteral<"verified_resource">;
49
+ resource: z.ZodObject<{
50
+ kind: z.ZodString;
51
+ id: z.ZodString;
52
+ }, z.core.$strict>;
53
+ verificationId: z.ZodString;
54
+ }, z.core.$strict>, z.ZodObject<{
55
+ kind: z.ZodLiteral<"unverified">;
56
+ }, z.core.$strict>], "kind">;
57
+ argumentDigest: z.ZodString;
58
+ }, z.core.$strict>;
59
+ confirmationSummary: z.ZodString;
60
+ preparedAt: z.ZodISODateTime;
61
+ expiresAt: z.ZodISODateTime;
62
+ }, z.core.$strict>;
63
+ export type VoicePrepareActionRequest = z.infer<typeof voicePrepareActionRequestSchema>;
64
+ export declare const voiceConfirmActionRequestSchema: z.ZodObject<{
65
+ binding: z.ZodObject<{
66
+ intentId: z.ZodString;
67
+ subject: z.ZodObject<{
68
+ tenantId: z.ZodString;
69
+ environmentId: z.ZodString;
70
+ agentId: z.ZodString;
71
+ sessionId: z.ZodString;
72
+ releaseId: z.ZodString;
73
+ }, z.core.$strict>;
74
+ actionAlias: z.ZodString;
75
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
76
+ kind: z.ZodLiteral<"verified_resource">;
77
+ resource: z.ZodObject<{
78
+ kind: z.ZodString;
79
+ id: z.ZodString;
80
+ }, z.core.$strict>;
81
+ verificationId: z.ZodString;
82
+ }, z.core.$strict>, z.ZodObject<{
83
+ kind: z.ZodLiteral<"unverified">;
84
+ }, z.core.$strict>], "kind">;
85
+ argumentDigest: z.ZodString;
86
+ }, z.core.$strict>;
87
+ requestedAt: z.ZodISODateTime;
88
+ }, z.core.$strict>;
89
+ export type VoiceConfirmActionRequest = z.infer<typeof voiceConfirmActionRequestSchema>;
90
+ export declare const voiceCancelActionRequestSchema: z.ZodObject<{
91
+ binding: z.ZodObject<{
92
+ intentId: z.ZodString;
93
+ subject: z.ZodObject<{
94
+ tenantId: z.ZodString;
95
+ environmentId: z.ZodString;
96
+ agentId: z.ZodString;
97
+ sessionId: z.ZodString;
98
+ releaseId: z.ZodString;
99
+ }, z.core.$strict>;
100
+ actionAlias: z.ZodString;
101
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
102
+ kind: z.ZodLiteral<"verified_resource">;
103
+ resource: z.ZodObject<{
104
+ kind: z.ZodString;
105
+ id: z.ZodString;
106
+ }, z.core.$strict>;
107
+ verificationId: z.ZodString;
108
+ }, z.core.$strict>, z.ZodObject<{
109
+ kind: z.ZodLiteral<"unverified">;
110
+ }, z.core.$strict>], "kind">;
111
+ argumentDigest: z.ZodString;
112
+ }, z.core.$strict>;
113
+ requestedAt: z.ZodISODateTime;
114
+ }, z.core.$strict>;
115
+ export type VoiceCancelActionRequest = z.infer<typeof voiceCancelActionRequestSchema>;
116
+ export declare const voicePreparedActionIntentSchema: z.ZodObject<{
117
+ intentId: z.ZodString;
118
+ subject: z.ZodObject<{
119
+ tenantId: z.ZodString;
120
+ environmentId: z.ZodString;
121
+ agentId: z.ZodString;
122
+ sessionId: z.ZodString;
123
+ releaseId: z.ZodString;
124
+ }, z.core.$strict>;
125
+ actionAlias: z.ZodString;
126
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
127
+ kind: z.ZodLiteral<"verified_resource">;
128
+ resource: z.ZodObject<{
129
+ kind: z.ZodString;
130
+ id: z.ZodString;
131
+ }, z.core.$strict>;
132
+ verificationId: z.ZodString;
133
+ }, z.core.$strict>, z.ZodObject<{
134
+ kind: z.ZodLiteral<"unverified">;
135
+ }, z.core.$strict>], "kind">;
136
+ argumentDigest: z.ZodString;
137
+ state: z.ZodLiteral<"prepared">;
138
+ confirmationSummary: z.ZodString;
139
+ preparedAt: z.ZodISODateTime;
140
+ expiresAt: z.ZodISODateTime;
141
+ }, z.core.$strict>;
142
+ export type VoicePreparedActionIntent = z.infer<typeof voicePreparedActionIntentSchema>;
143
+ export declare const voiceUncertainActionIntentSchema: z.ZodObject<{
144
+ intentId: z.ZodString;
145
+ subject: z.ZodObject<{
146
+ tenantId: z.ZodString;
147
+ environmentId: z.ZodString;
148
+ agentId: z.ZodString;
149
+ sessionId: z.ZodString;
150
+ releaseId: z.ZodString;
151
+ }, z.core.$strict>;
152
+ actionAlias: z.ZodString;
153
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
154
+ kind: z.ZodLiteral<"verified_resource">;
155
+ resource: z.ZodObject<{
156
+ kind: z.ZodString;
157
+ id: z.ZodString;
158
+ }, z.core.$strict>;
159
+ verificationId: z.ZodString;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ kind: z.ZodLiteral<"unverified">;
162
+ }, z.core.$strict>], "kind">;
163
+ argumentDigest: z.ZodString;
164
+ state: z.ZodLiteral<"uncertain">;
165
+ confirmationSummary: z.ZodString;
166
+ preparedAt: z.ZodISODateTime;
167
+ expiresAt: z.ZodISODateTime;
168
+ dispatchAttemptId: z.ZodString;
169
+ uncertainAt: z.ZodISODateTime;
170
+ }, z.core.$strict>;
171
+ export type VoiceUncertainActionIntent = z.infer<typeof voiceUncertainActionIntentSchema>;
172
+ export declare const voiceCommittedActionReceiptSchema: z.ZodObject<{
173
+ intentId: z.ZodString;
174
+ subject: z.ZodObject<{
175
+ tenantId: z.ZodString;
176
+ environmentId: z.ZodString;
177
+ agentId: z.ZodString;
178
+ sessionId: z.ZodString;
179
+ releaseId: z.ZodString;
180
+ }, z.core.$strict>;
181
+ actionAlias: z.ZodString;
182
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
183
+ kind: z.ZodLiteral<"verified_resource">;
184
+ resource: z.ZodObject<{
185
+ kind: z.ZodString;
186
+ id: z.ZodString;
187
+ }, z.core.$strict>;
188
+ verificationId: z.ZodString;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"unverified">;
191
+ }, z.core.$strict>], "kind">;
192
+ argumentDigest: z.ZodString;
193
+ state: z.ZodLiteral<"committed">;
194
+ receiptId: z.ZodString;
195
+ resultDigest: z.ZodString;
196
+ resultStatus: z.ZodString;
197
+ committedAt: z.ZodISODateTime;
198
+ }, z.core.$strict>;
199
+ export type VoiceCommittedActionReceipt = z.infer<typeof voiceCommittedActionReceiptSchema>;
200
+ export declare const voiceCancelledActionReceiptSchema: z.ZodObject<{
201
+ intentId: z.ZodString;
202
+ subject: z.ZodObject<{
203
+ tenantId: z.ZodString;
204
+ environmentId: z.ZodString;
205
+ agentId: z.ZodString;
206
+ sessionId: z.ZodString;
207
+ releaseId: z.ZodString;
208
+ }, z.core.$strict>;
209
+ actionAlias: z.ZodString;
210
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
211
+ kind: z.ZodLiteral<"verified_resource">;
212
+ resource: z.ZodObject<{
213
+ kind: z.ZodString;
214
+ id: z.ZodString;
215
+ }, z.core.$strict>;
216
+ verificationId: z.ZodString;
217
+ }, z.core.$strict>, z.ZodObject<{
218
+ kind: z.ZodLiteral<"unverified">;
219
+ }, z.core.$strict>], "kind">;
220
+ argumentDigest: z.ZodString;
221
+ state: z.ZodLiteral<"cancelled">;
222
+ cancellationReceiptId: z.ZodString;
223
+ cancellationResolution: z.ZodEnum<{
224
+ local_before_dispatch: "local_before_dispatch";
225
+ confirmed_not_committed: "confirmed_not_committed";
226
+ }>;
227
+ cancelledAt: z.ZodISODateTime;
228
+ }, z.core.$strict>;
229
+ export type VoiceCancelledActionReceipt = z.infer<typeof voiceCancelledActionReceiptSchema>;
230
+ export declare const voiceActionIntentStateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
231
+ intentId: z.ZodString;
232
+ subject: z.ZodObject<{
233
+ tenantId: z.ZodString;
234
+ environmentId: z.ZodString;
235
+ agentId: z.ZodString;
236
+ sessionId: z.ZodString;
237
+ releaseId: z.ZodString;
238
+ }, z.core.$strict>;
239
+ actionAlias: z.ZodString;
240
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
241
+ kind: z.ZodLiteral<"verified_resource">;
242
+ resource: z.ZodObject<{
243
+ kind: z.ZodString;
244
+ id: z.ZodString;
245
+ }, z.core.$strict>;
246
+ verificationId: z.ZodString;
247
+ }, z.core.$strict>, z.ZodObject<{
248
+ kind: z.ZodLiteral<"unverified">;
249
+ }, z.core.$strict>], "kind">;
250
+ argumentDigest: z.ZodString;
251
+ state: z.ZodLiteral<"prepared">;
252
+ confirmationSummary: z.ZodString;
253
+ preparedAt: z.ZodISODateTime;
254
+ expiresAt: z.ZodISODateTime;
255
+ }, z.core.$strict>, z.ZodObject<{
256
+ intentId: z.ZodString;
257
+ subject: z.ZodObject<{
258
+ tenantId: z.ZodString;
259
+ environmentId: z.ZodString;
260
+ agentId: z.ZodString;
261
+ sessionId: z.ZodString;
262
+ releaseId: z.ZodString;
263
+ }, z.core.$strict>;
264
+ actionAlias: z.ZodString;
265
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
266
+ kind: z.ZodLiteral<"verified_resource">;
267
+ resource: z.ZodObject<{
268
+ kind: z.ZodString;
269
+ id: z.ZodString;
270
+ }, z.core.$strict>;
271
+ verificationId: z.ZodString;
272
+ }, z.core.$strict>, z.ZodObject<{
273
+ kind: z.ZodLiteral<"unverified">;
274
+ }, z.core.$strict>], "kind">;
275
+ argumentDigest: z.ZodString;
276
+ state: z.ZodLiteral<"uncertain">;
277
+ confirmationSummary: z.ZodString;
278
+ preparedAt: z.ZodISODateTime;
279
+ expiresAt: z.ZodISODateTime;
280
+ dispatchAttemptId: z.ZodString;
281
+ uncertainAt: z.ZodISODateTime;
282
+ }, z.core.$strict>, z.ZodObject<{
283
+ intentId: z.ZodString;
284
+ subject: z.ZodObject<{
285
+ tenantId: z.ZodString;
286
+ environmentId: z.ZodString;
287
+ agentId: z.ZodString;
288
+ sessionId: z.ZodString;
289
+ releaseId: z.ZodString;
290
+ }, z.core.$strict>;
291
+ actionAlias: z.ZodString;
292
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
293
+ kind: z.ZodLiteral<"verified_resource">;
294
+ resource: z.ZodObject<{
295
+ kind: z.ZodString;
296
+ id: z.ZodString;
297
+ }, z.core.$strict>;
298
+ verificationId: z.ZodString;
299
+ }, z.core.$strict>, z.ZodObject<{
300
+ kind: z.ZodLiteral<"unverified">;
301
+ }, z.core.$strict>], "kind">;
302
+ argumentDigest: z.ZodString;
303
+ state: z.ZodLiteral<"committed">;
304
+ receiptId: z.ZodString;
305
+ resultDigest: z.ZodString;
306
+ resultStatus: z.ZodString;
307
+ committedAt: z.ZodISODateTime;
308
+ }, z.core.$strict>, z.ZodObject<{
309
+ intentId: z.ZodString;
310
+ subject: z.ZodObject<{
311
+ tenantId: z.ZodString;
312
+ environmentId: z.ZodString;
313
+ agentId: z.ZodString;
314
+ sessionId: z.ZodString;
315
+ releaseId: z.ZodString;
316
+ }, z.core.$strict>;
317
+ actionAlias: z.ZodString;
318
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
319
+ kind: z.ZodLiteral<"verified_resource">;
320
+ resource: z.ZodObject<{
321
+ kind: z.ZodString;
322
+ id: z.ZodString;
323
+ }, z.core.$strict>;
324
+ verificationId: z.ZodString;
325
+ }, z.core.$strict>, z.ZodObject<{
326
+ kind: z.ZodLiteral<"unverified">;
327
+ }, z.core.$strict>], "kind">;
328
+ argumentDigest: z.ZodString;
329
+ state: z.ZodLiteral<"cancelled">;
330
+ cancellationReceiptId: z.ZodString;
331
+ cancellationResolution: z.ZodEnum<{
332
+ local_before_dispatch: "local_before_dispatch";
333
+ confirmed_not_committed: "confirmed_not_committed";
334
+ }>;
335
+ cancelledAt: z.ZodISODateTime;
336
+ }, z.core.$strict>], "state">;
337
+ export type VoiceActionIntentState = z.infer<typeof voiceActionIntentStateSchema>;
338
+ export declare const voiceActionIntentTransitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
339
+ dispatchAttemptId: z.ZodString;
340
+ binding: z.ZodObject<{
341
+ intentId: z.ZodString;
342
+ subject: z.ZodObject<{
343
+ tenantId: z.ZodString;
344
+ environmentId: z.ZodString;
345
+ agentId: z.ZodString;
346
+ sessionId: z.ZodString;
347
+ releaseId: z.ZodString;
348
+ }, z.core.$strict>;
349
+ actionAlias: z.ZodString;
350
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
351
+ kind: z.ZodLiteral<"verified_resource">;
352
+ resource: z.ZodObject<{
353
+ kind: z.ZodString;
354
+ id: z.ZodString;
355
+ }, z.core.$strict>;
356
+ verificationId: z.ZodString;
357
+ }, z.core.$strict>, z.ZodObject<{
358
+ kind: z.ZodLiteral<"unverified">;
359
+ }, z.core.$strict>], "kind">;
360
+ argumentDigest: z.ZodString;
361
+ }, z.core.$strict>;
362
+ occurredAt: z.ZodISODateTime;
363
+ kind: z.ZodLiteral<"mark_uncertain">;
364
+ }, z.core.$strict>, z.ZodObject<{
365
+ receiptId: z.ZodString;
366
+ resultDigest: z.ZodString;
367
+ resultStatus: z.ZodString;
368
+ binding: z.ZodObject<{
369
+ intentId: z.ZodString;
370
+ subject: z.ZodObject<{
371
+ tenantId: z.ZodString;
372
+ environmentId: z.ZodString;
373
+ agentId: z.ZodString;
374
+ sessionId: z.ZodString;
375
+ releaseId: z.ZodString;
376
+ }, z.core.$strict>;
377
+ actionAlias: z.ZodString;
378
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
379
+ kind: z.ZodLiteral<"verified_resource">;
380
+ resource: z.ZodObject<{
381
+ kind: z.ZodString;
382
+ id: z.ZodString;
383
+ }, z.core.$strict>;
384
+ verificationId: z.ZodString;
385
+ }, z.core.$strict>, z.ZodObject<{
386
+ kind: z.ZodLiteral<"unverified">;
387
+ }, z.core.$strict>], "kind">;
388
+ argumentDigest: z.ZodString;
389
+ }, z.core.$strict>;
390
+ occurredAt: z.ZodISODateTime;
391
+ kind: z.ZodLiteral<"commit">;
392
+ }, z.core.$strict>, z.ZodObject<{
393
+ cancellationReceiptId: z.ZodString;
394
+ resolution: z.ZodEnum<{
395
+ local_before_dispatch: "local_before_dispatch";
396
+ confirmed_not_committed: "confirmed_not_committed";
397
+ }>;
398
+ binding: z.ZodObject<{
399
+ intentId: z.ZodString;
400
+ subject: z.ZodObject<{
401
+ tenantId: z.ZodString;
402
+ environmentId: z.ZodString;
403
+ agentId: z.ZodString;
404
+ sessionId: z.ZodString;
405
+ releaseId: z.ZodString;
406
+ }, z.core.$strict>;
407
+ actionAlias: z.ZodString;
408
+ authoritySubject: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
+ kind: z.ZodLiteral<"verified_resource">;
410
+ resource: z.ZodObject<{
411
+ kind: z.ZodString;
412
+ id: z.ZodString;
413
+ }, z.core.$strict>;
414
+ verificationId: z.ZodString;
415
+ }, z.core.$strict>, z.ZodObject<{
416
+ kind: z.ZodLiteral<"unverified">;
417
+ }, z.core.$strict>], "kind">;
418
+ argumentDigest: z.ZodString;
419
+ }, z.core.$strict>;
420
+ occurredAt: z.ZodISODateTime;
421
+ kind: z.ZodLiteral<"cancel">;
422
+ }, z.core.$strict>], "kind">;
423
+ export type VoiceActionIntentTransition = z.infer<typeof voiceActionIntentTransitionSchema>;
@@ -0,0 +1,95 @@
1
+ import { z } from 'zod';
2
+ import { voiceHashSchema, voiceIdSchema, voiceLocalKeySchema, voiceTimestampSchema, } from './voice-common.js';
3
+ import { voiceCallSubjectSchema, voiceResourceReferenceSchema } from './voice-authority-contracts.js';
4
+ export const voiceActionAuthoritySubjectSchema = z.discriminatedUnion('kind', [
5
+ z.strictObject({
6
+ kind: z.literal('verified_resource'),
7
+ resource: voiceResourceReferenceSchema,
8
+ verificationId: voiceIdSchema,
9
+ }),
10
+ z.strictObject({ kind: z.literal('unverified') }),
11
+ ]);
12
+ export const voiceActionIntentBindingSchema = z.strictObject({
13
+ intentId: voiceIdSchema,
14
+ subject: voiceCallSubjectSchema,
15
+ actionAlias: voiceLocalKeySchema,
16
+ authoritySubject: voiceActionAuthoritySubjectSchema,
17
+ argumentDigest: voiceHashSchema,
18
+ });
19
+ export const voicePrepareActionRequestSchema = z
20
+ .strictObject({
21
+ binding: voiceActionIntentBindingSchema,
22
+ confirmationSummary: z.string().trim().min(1).max(2_000),
23
+ preparedAt: voiceTimestampSchema,
24
+ expiresAt: voiceTimestampSchema,
25
+ })
26
+ .superRefine((request, context) => {
27
+ if (Date.parse(request.expiresAt) <= Date.parse(request.preparedAt)) {
28
+ context.addIssue({
29
+ code: 'custom', path: ['expiresAt'],
30
+ message: 'action intent expiry must be after preparation',
31
+ });
32
+ }
33
+ });
34
+ export const voiceConfirmActionRequestSchema = z.strictObject({
35
+ binding: voiceActionIntentBindingSchema,
36
+ requestedAt: voiceTimestampSchema,
37
+ });
38
+ export const voiceCancelActionRequestSchema = z.strictObject({
39
+ binding: voiceActionIntentBindingSchema,
40
+ requestedAt: voiceTimestampSchema,
41
+ });
42
+ export const voicePreparedActionIntentSchema = voiceActionIntentBindingSchema.extend({
43
+ state: z.literal('prepared'),
44
+ confirmationSummary: z.string().trim().min(1).max(2_000),
45
+ preparedAt: voiceTimestampSchema,
46
+ expiresAt: voiceTimestampSchema,
47
+ });
48
+ export const voiceUncertainActionIntentSchema = voiceActionIntentBindingSchema.extend({
49
+ state: z.literal('uncertain'),
50
+ confirmationSummary: z.string().trim().min(1).max(2_000),
51
+ preparedAt: voiceTimestampSchema,
52
+ expiresAt: voiceTimestampSchema,
53
+ dispatchAttemptId: voiceIdSchema,
54
+ uncertainAt: voiceTimestampSchema,
55
+ });
56
+ export const voiceCommittedActionReceiptSchema = voiceActionIntentBindingSchema.extend({
57
+ state: z.literal('committed'),
58
+ receiptId: voiceIdSchema,
59
+ resultDigest: voiceHashSchema,
60
+ resultStatus: voiceIdSchema,
61
+ committedAt: voiceTimestampSchema,
62
+ });
63
+ export const voiceCancelledActionReceiptSchema = voiceActionIntentBindingSchema.extend({
64
+ state: z.literal('cancelled'),
65
+ cancellationReceiptId: voiceIdSchema,
66
+ cancellationResolution: z.enum(['local_before_dispatch', 'confirmed_not_committed']),
67
+ cancelledAt: voiceTimestampSchema,
68
+ });
69
+ export const voiceActionIntentStateSchema = z.discriminatedUnion('state', [
70
+ voicePreparedActionIntentSchema,
71
+ voiceUncertainActionIntentSchema,
72
+ voiceCommittedActionReceiptSchema,
73
+ voiceCancelledActionReceiptSchema,
74
+ ]);
75
+ const transitionBase = {
76
+ binding: voiceActionIntentBindingSchema,
77
+ occurredAt: voiceTimestampSchema,
78
+ };
79
+ export const voiceActionIntentTransitionSchema = z.discriminatedUnion('kind', [
80
+ z.strictObject({
81
+ kind: z.literal('mark_uncertain'), ...transitionBase,
82
+ dispatchAttemptId: voiceIdSchema,
83
+ }),
84
+ z.strictObject({
85
+ kind: z.literal('commit'), ...transitionBase,
86
+ receiptId: voiceIdSchema,
87
+ resultDigest: voiceHashSchema,
88
+ resultStatus: voiceIdSchema,
89
+ }),
90
+ z.strictObject({
91
+ kind: z.literal('cancel'), ...transitionBase,
92
+ cancellationReceiptId: voiceIdSchema,
93
+ resolution: z.enum(['local_before_dispatch', 'confirmed_not_committed']),
94
+ }),
95
+ ]);
@@ -0,0 +1,52 @@
1
+ import { type VoiceActionIntentBinding, type VoiceActionIntentState, type VoiceActionIntentTransition, type VoiceCommittedActionReceipt, type VoicePrepareActionRequest, type VoicePreparedActionIntent } from './voice-actions-contracts.js';
2
+ export type PrepareVoiceActionIntentResult = {
3
+ outcome: 'prepared';
4
+ state: VoicePreparedActionIntent;
5
+ } | {
6
+ outcome: 'retry';
7
+ state: VoiceActionIntentState;
8
+ } | {
9
+ outcome: 'conflict';
10
+ reason: 'intent_binding_conflict';
11
+ };
12
+ export declare function prepareVoiceActionIntent({ request, existing }: {
13
+ request: VoicePrepareActionRequest;
14
+ existing: VoiceActionIntentState | null;
15
+ }): PrepareVoiceActionIntentResult;
16
+ export type VoiceActionConfirmationDecision = {
17
+ decision: 'dispatch';
18
+ } | {
19
+ decision: 'reconcile';
20
+ reason: 'uncertain_outcome';
21
+ } | {
22
+ decision: 'return_receipt';
23
+ receipt: VoiceCommittedActionReceipt;
24
+ } | {
25
+ decision: 'conflict';
26
+ reason: 'intent_binding_conflict';
27
+ } | {
28
+ decision: 'denied';
29
+ reason: 'intent_cancelled' | 'intent_expired';
30
+ };
31
+ export declare function decideVoiceActionConfirmation({ state, binding, now }: {
32
+ state: VoiceActionIntentState;
33
+ binding: VoiceActionIntentBinding;
34
+ now: string;
35
+ }): VoiceActionConfirmationDecision;
36
+ export type TransitionVoiceActionIntentResult = {
37
+ outcome: 'transitioned';
38
+ state: VoiceActionIntentState;
39
+ } | {
40
+ outcome: 'retry';
41
+ state: VoiceActionIntentState;
42
+ } | {
43
+ outcome: 'conflict';
44
+ reason: 'intent_binding_conflict' | 'terminal_receipt_conflict';
45
+ } | {
46
+ outcome: 'denied';
47
+ reason: 'intent_expired' | 'terminal_intent' | 'uncertain_requires_reconciliation';
48
+ };
49
+ export declare function transitionVoiceActionIntent({ state, transition }: {
50
+ state: VoiceActionIntentState;
51
+ transition: VoiceActionIntentTransition;
52
+ }): TransitionVoiceActionIntentResult;