@whooshbang/contracts 2.5.0 → 2.6.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 (98) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +21 -21
  3. package/contract-manifest.json +32 -32
  4. package/dist/generated/artifact-index.d.ts +33 -33
  5. package/dist/generated/artifact-index.js +32 -32
  6. package/dist/generated/interaction-v1.d.ts +77 -4
  7. package/dist/generated/validators-standalone.d.ts +492 -492
  8. package/dist/generated/validators-standalone.js +6110 -4475
  9. package/dist/generated/validators-standalone.js.map +1 -1
  10. package/dist/generated/validators.d.ts +2 -2
  11. package/dist/generated/whooshbang-v1.d.ts +523 -116
  12. package/dist/index.d.ts +3 -0
  13. package/dist/index.js +1 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/input-defaults.d.ts +7 -0
  16. package/dist/input-defaults.js +59 -0
  17. package/dist/input-defaults.js.map +1 -0
  18. package/dist/interaction-expiry.js +2 -1
  19. package/dist/interaction-expiry.js.map +1 -1
  20. package/fixtures/core-v1/fixture-index.json +1 -1
  21. package/fixtures/core-v1/problems/idempotency-key-required.json +2 -2
  22. package/fixtures/core-v1/scenarios/api-credential-invalid-indistinguishable.json +1 -1
  23. package/fixtures/core-v1/scenarios/api-credential-one-time-reveal.json +1 -1
  24. package/fixtures/core-v1/scenarios/api-credential-revocation-replay.json +1 -1
  25. package/fixtures/core-v1/scenarios/api-credential-rotation-overlap.json +1 -1
  26. package/fixtures/core-v1/scenarios/cancellation-too-late.json +1 -1
  27. package/fixtures/core-v1/scenarios/cross-organization-project.json +1 -1
  28. package/fixtures/core-v1/scenarios/cross-project-resource.json +1 -1
  29. package/fixtures/core-v1/scenarios/environment-mismatch.json +1 -1
  30. package/fixtures/core-v1/scenarios/idempotency-conflict.json +1 -1
  31. package/fixtures/core-v1/scenarios/idempotency-equivalent-replay.json +1 -1
  32. package/fixtures/core-v1/scenarios/malformed-bearer.json +1 -1
  33. package/fixtures/core-v1/scenarios/metadata-overrun.json +1 -1
  34. package/fixtures/core-v1/scenarios/missing-scope.json +1 -1
  35. package/fixtures/core-v1/scenarios/project-create-equivalent-replay.json +1 -1
  36. package/fixtures/core-v1/scenarios/project-slug-conflict.json +1 -1
  37. package/fixtures/core-v1/scenarios/provider-outcome-unknown.json +1 -1
  38. package/fixtures/core-v1/scenarios/subscription-activation-replay.json +1 -1
  39. package/fixtures/core-v1/scenarios/subscription-authorization-capability-opacity.json +1 -1
  40. package/fixtures/core-v1/scenarios/subscription-cross-connection-callback-rejected.json +1 -1
  41. package/fixtures/core-v1/scenarios/subscription-expired-replay.json +1 -1
  42. package/fixtures/core-v1/scenarios/subscription-selected-connection-replay.json +1 -1
  43. package/fixtures/interaction-machine-v1/scenarios/ack-conflict.json +1 -1
  44. package/fixtures/interaction-machine-v1/scenarios/ack-cross-machine.json +1 -1
  45. package/fixtures/interaction-machine-v1/scenarios/ack-out-of-order.json +1 -1
  46. package/fixtures/interaction-machine-v1/scenarios/ack-replay.json +1 -1
  47. package/fixtures/interaction-machine-v1/scenarios/ambiguous-free-text.json +1 -1
  48. package/fixtures/interaction-machine-v1/scenarios/callback-token-opacity.json +1 -1
  49. package/fixtures/interaction-machine-v1/scenarios/credential-registration-conflict.json +1 -1
  50. package/fixtures/interaction-machine-v1/scenarios/credential-registration-replay.json +1 -1
  51. package/fixtures/interaction-machine-v1/scenarios/credential-revocation-replay.json +1 -1
  52. package/fixtures/interaction-machine-v1/scenarios/credential-rotation.json +1 -1
  53. package/fixtures/interaction-machine-v1/scenarios/first-credential-activates.json +1 -1
  54. package/fixtures/interaction-machine-v1/scenarios/interaction-duplicate.json +1 -1
  55. package/fixtures/interaction-machine-v1/scenarios/interaction-expired.json +1 -1
  56. package/fixtures/interaction-machine-v1/scenarios/interaction-mismatch.json +1 -1
  57. package/fixtures/interaction-machine-v1/scenarios/interaction-retired.json +1 -1
  58. package/fixtures/interaction-machine-v1/scenarios/interaction-stale.json +1 -1
  59. package/fixtures/interaction-machine-v1/scenarios/machine-admin-denied.json +1 -1
  60. package/fixtures/interaction-machine-v1/scenarios/machine-bound-message-create.json +1 -1
  61. package/fixtures/interaction-machine-v1/scenarios/machine-cancel-denied.json +1 -1
  62. package/fixtures/interaction-machine-v1/scenarios/machine-crash-before-ack.json +1 -1
  63. package/fixtures/interaction-machine-v1/scenarios/machine-notifier-mismatch.json +1 -1
  64. package/fixtures/interaction-machine-v1/scenarios/machine-other-message-read.json +1 -1
  65. package/fixtures/interaction-machine-v1/scenarios/machine-owned-message-read.json +1 -1
  66. package/fixtures/interaction-machine-v1/scenarios/machine-subscriber-mismatch.json +1 -1
  67. package/fixtures/interaction-machine-v1/scenarios/poll-uncommitted-cursor-rejected.json +1 -1
  68. package/fixtures/interaction-machine-v1/scenarios/project-credential-machine-endpoint-denied.json +1 -1
  69. package/fixtures/interaction-machine-v1/scenarios/quarantine-integrity-rejected.json +1 -1
  70. package/fixtures/interaction-machine-v1/scenarios/quarantine-signature-rejected.json +1 -1
  71. package/fixtures/interaction-machine-v1/scenarios/quarantine-valid.json +1 -1
  72. package/fixtures/interaction-machine-v1/scenarios/revoked-machine-credential.json +1 -1
  73. package/fixtures/recipient-experience-v1/scenarios/membership-broadcast-snapshot.json +1 -1
  74. package/fixtures/recipient-experience-v1/scenarios/preferred-binding-resolution.json +1 -1
  75. package/fixtures/recipient-experience-v1/scenarios/recipient-session-security.json +1 -1
  76. package/fixtures/recipient-experience-v1/scenarios/subscriber-initial-groups-transaction.json +1 -1
  77. package/openapi/generated/whooshbang-v1.bundle.json +998 -297
  78. package/openapi/whooshbang-v1.yaml +454 -73
  79. package/package.json +1 -1
  80. package/schemas/core-scenario.schema.json +1 -1
  81. package/schemas/events/agent-binding-degraded-v1.schema.json +1 -1
  82. package/schemas/events/interaction-expired-v1.schema.json +1 -1
  83. package/schemas/events/interaction-received-v1.schema.json +1 -1
  84. package/schemas/events/message-delivered-v1.schema.json +1 -1
  85. package/schemas/events/message-expired-v1.schema.json +1 -1
  86. package/schemas/events/message-failed-v1.schema.json +1 -1
  87. package/schemas/events/message-provider-accepted-v1.schema.json +1 -1
  88. package/schemas/events/subscription-activated-v1.schema.json +1 -1
  89. package/schemas/events/subscription-revoked-v1.schema.json +1 -1
  90. package/schemas/events/whooshbang-event-v1.schema.json +1 -1
  91. package/schemas/fixture-index.schema.json +1 -1
  92. package/schemas/interaction-machine-scenario.schema.json +1 -1
  93. package/schemas/interaction-v1.schema.json +192 -5
  94. package/schemas/machine-v1.schema.json +1 -1
  95. package/schemas/provider-capabilities-v1.schema.json +1 -1
  96. package/schemas/webhooks/webhook-delivery-case-v1.schema.json +1 -1
  97. package/schemas/webhooks/webhook-signing-vector-v1.schema.json +1 -1
  98. package/schemas/whooshbang-v1.schema.json +400 -63
@@ -5,115 +5,115 @@
5
5
  export const contractManifest = {
6
6
  schema: "flowxo.contract-manifest.v1",
7
7
  artifact: "@whooshbang/contracts",
8
- version: "2.5.0",
8
+ version: "2.6.0",
9
9
  openapi: [
10
10
  {
11
11
  id: "whooshbang-rest-v1",
12
- version: "2.5.0",
12
+ version: "2.6.0",
13
13
  path: "openapi/whooshbang-v1.yaml",
14
14
  },
15
15
  ],
16
16
  schemas: [
17
17
  {
18
18
  id: "whooshbang-v1",
19
- version: "2.5.0",
19
+ version: "2.6.0",
20
20
  path: "schemas/whooshbang-v1.schema.json",
21
21
  },
22
22
  {
23
23
  id: "interaction-v1",
24
- version: "2.5.0",
24
+ version: "2.6.0",
25
25
  path: "schemas/interaction-v1.schema.json",
26
26
  },
27
27
  {
28
28
  id: "machine-v1",
29
- version: "2.5.0",
29
+ version: "2.6.0",
30
30
  path: "schemas/machine-v1.schema.json",
31
31
  },
32
32
  {
33
33
  id: "provider-capabilities-v1",
34
- version: "2.5.0",
34
+ version: "2.6.0",
35
35
  path: "schemas/provider-capabilities-v1.schema.json",
36
36
  },
37
37
  {
38
38
  id: "whooshbang-event-v1",
39
- version: "2.5.0",
39
+ version: "2.6.0",
40
40
  path: "schemas/events/whooshbang-event-v1.schema.json",
41
41
  },
42
42
  {
43
43
  id: "subscription-activated-event-v1",
44
- version: "2.5.0",
44
+ version: "2.6.0",
45
45
  path: "schemas/events/subscription-activated-v1.schema.json",
46
46
  },
47
47
  {
48
48
  id: "subscription-revoked-event-v1",
49
- version: "2.5.0",
49
+ version: "2.6.0",
50
50
  path: "schemas/events/subscription-revoked-v1.schema.json",
51
51
  },
52
52
  {
53
53
  id: "message-provider-accepted-event-v1",
54
- version: "2.5.0",
54
+ version: "2.6.0",
55
55
  path: "schemas/events/message-provider-accepted-v1.schema.json",
56
56
  },
57
57
  {
58
58
  id: "message-delivered-event-v1",
59
- version: "2.5.0",
59
+ version: "2.6.0",
60
60
  path: "schemas/events/message-delivered-v1.schema.json",
61
61
  },
62
62
  {
63
63
  id: "message-failed-event-v1",
64
- version: "2.5.0",
64
+ version: "2.6.0",
65
65
  path: "schemas/events/message-failed-v1.schema.json",
66
66
  },
67
67
  {
68
68
  id: "message-expired-event-v1",
69
- version: "2.5.0",
69
+ version: "2.6.0",
70
70
  path: "schemas/events/message-expired-v1.schema.json",
71
71
  },
72
72
  {
73
73
  id: "interaction-received-event-v1",
74
- version: "2.5.0",
74
+ version: "2.6.0",
75
75
  path: "schemas/events/interaction-received-v1.schema.json",
76
76
  },
77
77
  {
78
78
  id: "interaction-expired-event-v1",
79
- version: "2.5.0",
79
+ version: "2.6.0",
80
80
  path: "schemas/events/interaction-expired-v1.schema.json",
81
81
  },
82
82
  {
83
83
  id: "agent-binding-degraded-event-v1",
84
- version: "2.5.0",
84
+ version: "2.6.0",
85
85
  path: "schemas/events/agent-binding-degraded-v1.schema.json",
86
86
  },
87
87
  {
88
88
  id: "webhook-signing-vector-v1",
89
- version: "2.5.0",
89
+ version: "2.6.0",
90
90
  path: "schemas/webhooks/webhook-signing-vector-v1.schema.json",
91
91
  },
92
92
  {
93
93
  id: "webhook-delivery-case-v1",
94
- version: "2.5.0",
94
+ version: "2.6.0",
95
95
  path: "schemas/webhooks/webhook-delivery-case-v1.schema.json",
96
96
  },
97
97
  {
98
98
  id: "interaction-machine-scenario",
99
- version: "2.5.0",
99
+ version: "2.6.0",
100
100
  path: "schemas/interaction-machine-scenario.schema.json",
101
101
  },
102
102
  {
103
103
  id: "core-contract-scenario",
104
- version: "2.5.0",
104
+ version: "2.6.0",
105
105
  path: "schemas/core-scenario.schema.json",
106
106
  },
107
107
  {
108
108
  id: "core-fixture-index",
109
- version: "2.5.0",
109
+ version: "2.6.0",
110
110
  path: "schemas/fixture-index.schema.json",
111
111
  },
112
112
  ],
113
113
  fixture_sets: [
114
114
  {
115
115
  id: "core-api-bodies",
116
- version: "2.5.0",
116
+ version: "2.6.0",
117
117
  schema: "schemas/whooshbang-v1.schema.json",
118
118
  fixtures: [
119
119
  "fixtures/core-v1/requests/create-project.json",
@@ -309,7 +309,7 @@ export const contractManifest = {
309
309
  },
310
310
  {
311
311
  id: "core-semantic-scenarios",
312
- version: "2.5.0",
312
+ version: "2.6.0",
313
313
  schema: "schemas/core-scenario.schema.json",
314
314
  fixtures: [
315
315
  "fixtures/core-v1/scenarios/project-create-equivalent-replay.json",
@@ -341,7 +341,7 @@ export const contractManifest = {
341
341
  },
342
342
  {
343
343
  id: "interaction-message-api-bodies",
344
- version: "2.5.0",
344
+ version: "2.6.0",
345
345
  schema: "schemas/whooshbang-v1.schema.json",
346
346
  fixtures: [
347
347
  "fixtures/interaction-machine-v1/requests/create-message-confirm.json",
@@ -353,7 +353,7 @@ export const contractManifest = {
353
353
  },
354
354
  {
355
355
  id: "interaction-contract-bodies",
356
- version: "2.5.0",
356
+ version: "2.6.0",
357
357
  schema: "schemas/interaction-v1.schema.json",
358
358
  fixtures: [
359
359
  "fixtures/interaction-machine-v1/success/interaction-open.json",
@@ -370,7 +370,7 @@ export const contractManifest = {
370
370
  },
371
371
  {
372
372
  id: "machine-api-bodies",
373
- version: "2.5.0",
373
+ version: "2.6.0",
374
374
  schema: "schemas/machine-v1.schema.json",
375
375
  fixtures: [
376
376
  "fixtures/interaction-machine-v1/requests/create-machine-client.json",
@@ -391,13 +391,13 @@ export const contractManifest = {
391
391
  },
392
392
  {
393
393
  id: "provider-capability-bodies",
394
- version: "2.5.0",
394
+ version: "2.6.0",
395
395
  schema: "schemas/provider-capabilities-v1.schema.json",
396
396
  fixtures: ["fixtures/interaction-machine-v1/capabilities/telegram.json"],
397
397
  },
398
398
  {
399
399
  id: "interaction-machine-semantic-scenarios",
400
- version: "2.5.0",
400
+ version: "2.6.0",
401
401
  schema: "schemas/interaction-machine-scenario.schema.json",
402
402
  fixtures: [
403
403
  "fixtures/interaction-machine-v1/scenarios/interaction-duplicate.json",
@@ -434,7 +434,7 @@ export const contractManifest = {
434
434
  },
435
435
  {
436
436
  id: "customer-event-bodies",
437
- version: "2.5.0",
437
+ version: "2.6.0",
438
438
  schema: "schemas/events/whooshbang-event-v1.schema.json",
439
439
  fixtures: [
440
440
  "fixtures/whooshbang-events-v1/events/subscription-activated.json",
@@ -452,19 +452,19 @@ export const contractManifest = {
452
452
  },
453
453
  {
454
454
  id: "webhook-signing-vectors",
455
- version: "2.5.0",
455
+ version: "2.6.0",
456
456
  schema: "schemas/webhooks/webhook-signing-vector-v1.schema.json",
457
457
  fixtures: ["fixtures/whooshbang-events-v1/signing/vectors.json"],
458
458
  },
459
459
  {
460
460
  id: "webhook-delivery-cases",
461
- version: "2.5.0",
461
+ version: "2.6.0",
462
462
  schema: "schemas/webhooks/webhook-delivery-case-v1.schema.json",
463
463
  fixtures: ["fixtures/whooshbang-events-v1/delivery/cases.json"],
464
464
  },
465
465
  {
466
466
  id: "core-fixture-index",
467
- version: "2.5.0",
467
+ version: "2.6.0",
468
468
  schema: "schemas/fixture-index.schema.json",
469
469
  fixtures: ["fixtures/core-v1/fixture-index.json"],
470
470
  },
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Provider-neutral confirm, single-select, input, lifecycle, callback-token, and authenticated answer-event contracts.
7
7
  */
8
- export type InteractionV1ContractDocument = InteractionRequest | InteractionSummary | InteractionEvent | ProviderCallbackToken | InteractionSendRequest;
8
+ export type InteractionV1ContractDocument = InteractionRequest | InteractionSummary | InteractionEvent | ProviderCallbackToken | InteractionSendRequest | CanonicalInteractionSendRequest;
9
9
  /**
10
10
  * A required-type tagged union. C0 supports confirm, single-select, and input only.
11
11
  */
@@ -74,9 +74,18 @@ export type TrimmedInputAnswer = string;
74
74
  */
75
75
  export type ProviderCallbackToken = string;
76
76
  /**
77
- * Send-time interaction. Choose expires_in_seconds or expires_at; omit both for 24 hours from server acceptance. Idempotent replays retain the original resolved deadline.
77
+ * Options infer select; otherwise confirm. Typed replies require type: input. Omit expiry for 24 hours.
78
78
  */
79
79
  export type InteractionSendRequest = ConfirmInteractionSendRequest | SelectInteractionSendRequest | InputInteractionSendRequest;
80
+ export type InteractionOptionInput = string | {
81
+ label: string;
82
+ value?: string;
83
+ intent?: "accept" | "destructive" | "informational" | "neutral";
84
+ };
85
+ /**
86
+ * Send-time interaction. Choose expires_in_seconds or expires_at; omit both for 24 hours from server acceptance. Idempotent replays retain the original resolved deadline.
87
+ */
88
+ export type CanonicalInteractionSendRequest = CanonicalConfirmInteractionSendRequest | CanonicalSelectInteractionSendRequest | CanonicalInputInteractionSendRequest;
80
89
  export interface ConfirmInteractionRequest {
81
90
  type: "confirm";
82
91
  prompt: InteractionPrompt;
@@ -162,7 +171,7 @@ export interface SafeChannelContext {
162
171
  display_name?: string;
163
172
  }
164
173
  export interface ConfirmInteractionSendRequest {
165
- type: "confirm";
174
+ type?: "confirm";
166
175
  prompt: InteractionPrompt;
167
176
  confirm_label?: string;
168
177
  deny_label?: string;
@@ -177,6 +186,70 @@ export interface ConfirmInteractionSendRequest {
177
186
  expires_in_seconds?: number;
178
187
  }
179
188
  export interface SelectInteractionSendRequest {
189
+ type?: "select";
190
+ prompt: InteractionPrompt;
191
+ /**
192
+ * @minItems 2
193
+ * @maxItems 6
194
+ */
195
+ options: [InteractionOptionInput, InteractionOptionInput] | [InteractionOptionInput, InteractionOptionInput, InteractionOptionInput] | [
196
+ InteractionOptionInput,
197
+ InteractionOptionInput,
198
+ InteractionOptionInput,
199
+ InteractionOptionInput
200
+ ] | [
201
+ InteractionOptionInput,
202
+ InteractionOptionInput,
203
+ InteractionOptionInput,
204
+ InteractionOptionInput,
205
+ InteractionOptionInput
206
+ ] | [
207
+ InteractionOptionInput,
208
+ InteractionOptionInput,
209
+ InteractionOptionInput,
210
+ InteractionOptionInput,
211
+ InteractionOptionInput,
212
+ InteractionOptionInput
213
+ ];
214
+ /**
215
+ * Absolute RFC3339 deadline with an explicit timezone and at most millisecond precision. At least 30 seconds after server acceptance. Mutually exclusive with expires_in_seconds.
216
+ */
217
+ expires_at?: string;
218
+ correlation_id?: InteractionCorrelationId;
219
+ /**
220
+ * Whole seconds from server acceptance. No fixed maximum; the resolved timestamp must be representable through year 9999. Mutually exclusive with expires_at. Omit both for 86400 seconds (24 hours).
221
+ */
222
+ expires_in_seconds?: number;
223
+ }
224
+ export interface InputInteractionSendRequest {
225
+ type: "input";
226
+ prompt: InteractionPrompt;
227
+ /**
228
+ * Absolute RFC3339 deadline with an explicit timezone and at most millisecond precision. At least 30 seconds after server acceptance. Mutually exclusive with expires_in_seconds.
229
+ */
230
+ expires_at?: string;
231
+ correlation_id?: InteractionCorrelationId;
232
+ /**
233
+ * Whole seconds from server acceptance. No fixed maximum; the resolved timestamp must be representable through year 9999. Mutually exclusive with expires_at. Omit both for 86400 seconds (24 hours).
234
+ */
235
+ expires_in_seconds?: number;
236
+ }
237
+ export interface CanonicalConfirmInteractionSendRequest {
238
+ type: "confirm";
239
+ prompt: InteractionPrompt;
240
+ confirm_label?: string;
241
+ deny_label?: string;
242
+ /**
243
+ * Absolute RFC3339 deadline with an explicit timezone and at most millisecond precision. At least 30 seconds after server acceptance. Mutually exclusive with expires_in_seconds.
244
+ */
245
+ expires_at?: string;
246
+ correlation_id?: InteractionCorrelationId;
247
+ /**
248
+ * Whole seconds from server acceptance. No fixed maximum; the resolved timestamp must be representable through year 9999. Mutually exclusive with expires_at. Omit both for 86400 seconds (24 hours).
249
+ */
250
+ expires_in_seconds?: number;
251
+ }
252
+ export interface CanonicalSelectInteractionSendRequest {
180
253
  type: "select";
181
254
  prompt: InteractionPrompt;
182
255
  /**
@@ -212,7 +285,7 @@ export interface SelectInteractionSendRequest {
212
285
  */
213
286
  expires_in_seconds?: number;
214
287
  }
215
- export interface InputInteractionSendRequest {
288
+ export interface CanonicalInputInteractionSendRequest {
216
289
  type: "input";
217
290
  prompt: InteractionPrompt;
218
291
  /**