@whooshbang/contracts 1.0.0-rc.13

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 (229) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/LICENSE +21 -0
  3. package/README.md +120 -0
  4. package/contract-manifest.json +390 -0
  5. package/dist/base64url.d.ts +2 -0
  6. package/dist/base64url.js +51 -0
  7. package/dist/base64url.js.map +1 -0
  8. package/dist/generated/artifact-index.d.ts +205 -0
  9. package/dist/generated/artifact-index.js +396 -0
  10. package/dist/generated/artifact-index.js.map +1 -0
  11. package/dist/generated/contract-manifest.d.ts +66 -0
  12. package/dist/generated/contract-manifest.js +6 -0
  13. package/dist/generated/contract-manifest.js.map +1 -0
  14. package/dist/generated/core-scenario.d.ts +18 -0
  15. package/dist/generated/core-scenario.js +6 -0
  16. package/dist/generated/core-scenario.js.map +1 -0
  17. package/dist/generated/fixture-index.d.ts +33 -0
  18. package/dist/generated/fixture-index.js +6 -0
  19. package/dist/generated/fixture-index.js.map +1 -0
  20. package/dist/generated/interaction-machine-scenario.d.ts +263 -0
  21. package/dist/generated/interaction-machine-scenario.js +6 -0
  22. package/dist/generated/interaction-machine-scenario.js.map +1 -0
  23. package/dist/generated/interaction-v1.d.ts +152 -0
  24. package/dist/generated/interaction-v1.js +6 -0
  25. package/dist/generated/interaction-v1.js.map +1 -0
  26. package/dist/generated/machine-v1.d.ts +169 -0
  27. package/dist/generated/machine-v1.js +6 -0
  28. package/dist/generated/machine-v1.js.map +1 -0
  29. package/dist/generated/provider-capabilities-v1.d.ts +78 -0
  30. package/dist/generated/provider-capabilities-v1.js +6 -0
  31. package/dist/generated/provider-capabilities-v1.js.map +1 -0
  32. package/dist/generated/validators-standalone.d.ts +659 -0
  33. package/dist/generated/validators-standalone.js +47800 -0
  34. package/dist/generated/validators-standalone.js.map +1 -0
  35. package/dist/generated/validators.d.ts +74 -0
  36. package/dist/generated/validators.js +493 -0
  37. package/dist/generated/validators.js.map +1 -0
  38. package/dist/generated/webhook-delivery-case-v1.d.ts +91 -0
  39. package/dist/generated/webhook-delivery-case-v1.js +6 -0
  40. package/dist/generated/webhook-delivery-case-v1.js.map +1 -0
  41. package/dist/generated/webhook-signing-vector-v1.d.ts +88 -0
  42. package/dist/generated/webhook-signing-vector-v1.js +6 -0
  43. package/dist/generated/webhook-signing-vector-v1.js.map +1 -0
  44. package/dist/generated/whooshbang-event-v1.d.ts +191 -0
  45. package/dist/generated/whooshbang-event-v1.js +6 -0
  46. package/dist/generated/whooshbang-event-v1.js.map +1 -0
  47. package/dist/generated/whooshbang-v1.d.ts +1162 -0
  48. package/dist/generated/whooshbang-v1.js +6 -0
  49. package/dist/generated/whooshbang-v1.js.map +1 -0
  50. package/dist/index.d.ts +20 -0
  51. package/dist/index.js +7 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/machine-credential.d.ts +31 -0
  54. package/dist/machine-credential.js +78 -0
  55. package/dist/machine-credential.js.map +1 -0
  56. package/dist/webhook-consumer.d.ts +50 -0
  57. package/dist/webhook-consumer.js +71 -0
  58. package/dist/webhook-consumer.js.map +1 -0
  59. package/dist/webhook-delivery.d.ts +46 -0
  60. package/dist/webhook-delivery.js +126 -0
  61. package/dist/webhook-delivery.js.map +1 -0
  62. package/dist/webhook-signature.d.ts +36 -0
  63. package/dist/webhook-signature.js +255 -0
  64. package/dist/webhook-signature.js.map +1 -0
  65. package/examples/python/verify_webhook.py +283 -0
  66. package/fixtures/.gitkeep +1 -0
  67. package/fixtures/core-v1/fixture-index.json +963 -0
  68. package/fixtures/core-v1/problems/auth-invalid.json +9 -0
  69. package/fixtures/core-v1/problems/authentication-required.json +9 -0
  70. package/fixtures/core-v1/problems/cancellation-too-late.json +9 -0
  71. package/fixtures/core-v1/problems/endpoint-rotation-conflict.json +10 -0
  72. package/fixtures/core-v1/problems/environment-mismatch.json +9 -0
  73. package/fixtures/core-v1/problems/idempotency-conflict.json +9 -0
  74. package/fixtures/core-v1/problems/idempotency-key-required.json +9 -0
  75. package/fixtures/core-v1/problems/project-slug-conflict.json +16 -0
  76. package/fixtures/core-v1/problems/provider-outcome-unknown.json +9 -0
  77. package/fixtures/core-v1/problems/provider-retryable.json +10 -0
  78. package/fixtures/core-v1/problems/provider-terminal.json +9 -0
  79. package/fixtures/core-v1/problems/rate-limited.json +10 -0
  80. package/fixtures/core-v1/problems/replay-unavailable-not-terminal.json +16 -0
  81. package/fixtures/core-v1/problems/replay-unavailable-payload.json +16 -0
  82. package/fixtures/core-v1/problems/replay-unavailable-rollout.json +16 -0
  83. package/fixtures/core-v1/problems/request-invalid.json +16 -0
  84. package/fixtures/core-v1/problems/resource-expired.json +9 -0
  85. package/fixtures/core-v1/problems/resource-not-found.json +9 -0
  86. package/fixtures/core-v1/problems/scope-forbidden.json +9 -0
  87. package/fixtures/core-v1/problems/subscriber-unbound.json +9 -0
  88. package/fixtures/core-v1/requests/create-api-credential.json +9 -0
  89. package/fixtures/core-v1/requests/create-customer-endpoint.json +5 -0
  90. package/fixtures/core-v1/requests/create-message.json +15 -0
  91. package/fixtures/core-v1/requests/create-project.json +4 -0
  92. package/fixtures/core-v1/requests/create-subscription-link.json +5 -0
  93. package/fixtures/core-v1/requests/rotate-api-credential.json +3 -0
  94. package/fixtures/core-v1/requests/rotate-customer-endpoint.json +3 -0
  95. package/fixtures/core-v1/scenarios/api-credential-invalid-indistinguishable.json +14 -0
  96. package/fixtures/core-v1/scenarios/api-credential-one-time-reveal.json +21 -0
  97. package/fixtures/core-v1/scenarios/api-credential-revocation-replay.json +17 -0
  98. package/fixtures/core-v1/scenarios/api-credential-rotation-overlap.json +18 -0
  99. package/fixtures/core-v1/scenarios/cancellation-too-late.json +15 -0
  100. package/fixtures/core-v1/scenarios/cross-account-project.json +14 -0
  101. package/fixtures/core-v1/scenarios/cross-project-resource.json +17 -0
  102. package/fixtures/core-v1/scenarios/environment-mismatch.json +17 -0
  103. package/fixtures/core-v1/scenarios/idempotency-conflict.json +35 -0
  104. package/fixtures/core-v1/scenarios/idempotency-equivalent-replay.json +27 -0
  105. package/fixtures/core-v1/scenarios/malformed-bearer.json +14 -0
  106. package/fixtures/core-v1/scenarios/metadata-overrun.json +14 -0
  107. package/fixtures/core-v1/scenarios/missing-scope.json +15 -0
  108. package/fixtures/core-v1/scenarios/project-create-equivalent-replay.json +26 -0
  109. package/fixtures/core-v1/scenarios/project-slug-conflict.json +21 -0
  110. package/fixtures/core-v1/scenarios/provider-outcome-unknown.json +15 -0
  111. package/fixtures/core-v1/scenarios/subscription-activation-replay.json +18 -0
  112. package/fixtures/core-v1/scenarios/subscription-expired-replay.json +16 -0
  113. package/fixtures/core-v1/success/account-projection.json +11 -0
  114. package/fixtures/core-v1/success/api-credential-collection.json +22 -0
  115. package/fixtures/core-v1/success/api-credential-created.json +20 -0
  116. package/fixtures/core-v1/success/api-credential-revoked.json +19 -0
  117. package/fixtures/core-v1/success/api-credential-rotated.json +41 -0
  118. package/fixtures/core-v1/success/customer-endpoint-attempts.json +15 -0
  119. package/fixtures/core-v1/success/customer-endpoint-collection.json +26 -0
  120. package/fixtures/core-v1/success/customer-endpoint-create-replayed.json +16 -0
  121. package/fixtures/core-v1/success/customer-endpoint-created.json +17 -0
  122. package/fixtures/core-v1/success/customer-endpoint-rotated.json +21 -0
  123. package/fixtures/core-v1/success/message-accepted.json +30 -0
  124. package/fixtures/core-v1/success/message-cancellation-too-late.json +27 -0
  125. package/fixtures/core-v1/success/message-cancelled.json +27 -0
  126. package/fixtures/core-v1/success/message-outcome-unknown.json +33 -0
  127. package/fixtures/core-v1/success/message-provider-accepted.json +30 -0
  128. package/fixtures/core-v1/success/project-collection.json +42 -0
  129. package/fixtures/core-v1/success/project-created.json +38 -0
  130. package/fixtures/core-v1/success/subscription-link-activated.json +22 -0
  131. package/fixtures/core-v1/success/subscription-link-cancelled.json +14 -0
  132. package/fixtures/core-v1/success/subscription-link-paused.json +22 -0
  133. package/fixtures/core-v1/success/subscription-link-pending.json +14 -0
  134. package/fixtures/core-v1/success/subscription-link-revoked.json +22 -0
  135. package/fixtures/interaction-machine-v1/capabilities/providers.json +57 -0
  136. package/fixtures/interaction-machine-v1/capabilities/telegram.json +52 -0
  137. package/fixtures/interaction-machine-v1/events/confirm-answered.json +22 -0
  138. package/fixtures/interaction-machine-v1/events/input-answered.json +22 -0
  139. package/fixtures/interaction-machine-v1/events/input-redacted.json +18 -0
  140. package/fixtures/interaction-machine-v1/events/select-answered.json +22 -0
  141. package/fixtures/interaction-machine-v1/requests/ack-processed.json +5 -0
  142. package/fixtures/interaction-machine-v1/requests/ack-quarantined.json +5 -0
  143. package/fixtures/interaction-machine-v1/requests/create-machine-client.json +6 -0
  144. package/fixtures/interaction-machine-v1/requests/create-message-confirm.json +18 -0
  145. package/fixtures/interaction-machine-v1/requests/create-message-input.json +16 -0
  146. package/fixtures/interaction-machine-v1/requests/create-message-select.json +26 -0
  147. package/fixtures/interaction-machine-v1/requests/register-machine-credential.json +4 -0
  148. package/fixtures/interaction-machine-v1/scenarios/ack-conflict.json +14 -0
  149. package/fixtures/interaction-machine-v1/scenarios/ack-cross-machine.json +15 -0
  150. package/fixtures/interaction-machine-v1/scenarios/ack-out-of-order.json +15 -0
  151. package/fixtures/interaction-machine-v1/scenarios/ack-replay.json +17 -0
  152. package/fixtures/interaction-machine-v1/scenarios/ambiguous-free-text.json +15 -0
  153. package/fixtures/interaction-machine-v1/scenarios/callback-token-opacity.json +16 -0
  154. package/fixtures/interaction-machine-v1/scenarios/credential-registration-conflict.json +16 -0
  155. package/fixtures/interaction-machine-v1/scenarios/credential-registration-replay.json +15 -0
  156. package/fixtures/interaction-machine-v1/scenarios/credential-revocation-replay.json +14 -0
  157. package/fixtures/interaction-machine-v1/scenarios/credential-rotation.json +16 -0
  158. package/fixtures/interaction-machine-v1/scenarios/first-credential-activates.json +15 -0
  159. package/fixtures/interaction-machine-v1/scenarios/interaction-duplicate.json +16 -0
  160. package/fixtures/interaction-machine-v1/scenarios/interaction-expired.json +17 -0
  161. package/fixtures/interaction-machine-v1/scenarios/interaction-mismatch.json +16 -0
  162. package/fixtures/interaction-machine-v1/scenarios/interaction-retired.json +16 -0
  163. package/fixtures/interaction-machine-v1/scenarios/interaction-stale.json +16 -0
  164. package/fixtures/interaction-machine-v1/scenarios/machine-admin-denied.json +14 -0
  165. package/fixtures/interaction-machine-v1/scenarios/machine-bound-message-create.json +22 -0
  166. package/fixtures/interaction-machine-v1/scenarios/machine-cancel-denied.json +14 -0
  167. package/fixtures/interaction-machine-v1/scenarios/machine-crash-before-ack.json +16 -0
  168. package/fixtures/interaction-machine-v1/scenarios/machine-notifier-mismatch.json +14 -0
  169. package/fixtures/interaction-machine-v1/scenarios/machine-other-message-read.json +14 -0
  170. package/fixtures/interaction-machine-v1/scenarios/machine-owned-message-read.json +22 -0
  171. package/fixtures/interaction-machine-v1/scenarios/machine-subscriber-mismatch.json +14 -0
  172. package/fixtures/interaction-machine-v1/scenarios/poll-uncommitted-cursor-rejected.json +17 -0
  173. package/fixtures/interaction-machine-v1/scenarios/project-credential-machine-endpoint-denied.json +14 -0
  174. package/fixtures/interaction-machine-v1/scenarios/quarantine-integrity-rejected.json +15 -0
  175. package/fixtures/interaction-machine-v1/scenarios/quarantine-signature-rejected.json +16 -0
  176. package/fixtures/interaction-machine-v1/scenarios/quarantine-valid.json +15 -0
  177. package/fixtures/interaction-machine-v1/scenarios/revoked-machine-credential.json +15 -0
  178. package/fixtures/interaction-machine-v1/success/ack-out-of-order.json +8 -0
  179. package/fixtures/interaction-machine-v1/success/ack-processed.json +8 -0
  180. package/fixtures/interaction-machine-v1/success/ack-quarantined.json +9 -0
  181. package/fixtures/interaction-machine-v1/success/interaction-answered-confirm.json +10 -0
  182. package/fixtures/interaction-machine-v1/success/interaction-answered-input.json +10 -0
  183. package/fixtures/interaction-machine-v1/success/interaction-answered-redacted.json +8 -0
  184. package/fixtures/interaction-machine-v1/success/interaction-answered-select.json +10 -0
  185. package/fixtures/interaction-machine-v1/success/interaction-open.json +7 -0
  186. package/fixtures/interaction-machine-v1/success/machine-client-active.json +20 -0
  187. package/fixtures/interaction-machine-v1/success/machine-client-provisioning.json +19 -0
  188. package/fixtures/interaction-machine-v1/success/machine-client-revoked.json +21 -0
  189. package/fixtures/interaction-machine-v1/success/machine-credential-active.json +13 -0
  190. package/fixtures/interaction-machine-v1/success/machine-credential-revoked.json +14 -0
  191. package/fixtures/interaction-machine-v1/success/message-interaction-open.json +33 -0
  192. package/fixtures/interaction-machine-v1/success/poll-empty.json +6 -0
  193. package/fixtures/interaction-machine-v1/success/poll-events.json +51 -0
  194. package/fixtures/interaction-machine-v1/tokens/callback-token.json +1 -0
  195. package/fixtures/whooshbang-events-v1/delivery/cases.json +418 -0
  196. package/fixtures/whooshbang-events-v1/events/agent-binding-degraded.json +17 -0
  197. package/fixtures/whooshbang-events-v1/events/interaction-expired.json +16 -0
  198. package/fixtures/whooshbang-events-v1/events/interaction-received.json +23 -0
  199. package/fixtures/whooshbang-events-v1/events/message-delivered.json +16 -0
  200. package/fixtures/whooshbang-events-v1/events/message-expired.json +15 -0
  201. package/fixtures/whooshbang-events-v1/events/message-failed.json +17 -0
  202. package/fixtures/whooshbang-events-v1/events/message-provider-accepted.json +15 -0
  203. package/fixtures/whooshbang-events-v1/events/subscription-activated.json +18 -0
  204. package/fixtures/whooshbang-events-v1/events/subscription-revoked.json +18 -0
  205. package/fixtures/whooshbang-events-v1/signing/vectors.json +852 -0
  206. package/openapi/.gitkeep +1 -0
  207. package/openapi/generated/whooshbang-v1.bundle.json +5913 -0
  208. package/openapi/whooshbang-v1.yaml +2334 -0
  209. package/package.json +63 -0
  210. package/schemas/contract-manifest.schema.json +140 -0
  211. package/schemas/core-scenario.schema.json +38 -0
  212. package/schemas/events/agent-binding-degraded-v1.schema.json +8 -0
  213. package/schemas/events/interaction-expired-v1.schema.json +8 -0
  214. package/schemas/events/interaction-received-v1.schema.json +8 -0
  215. package/schemas/events/message-delivered-v1.schema.json +8 -0
  216. package/schemas/events/message-expired-v1.schema.json +8 -0
  217. package/schemas/events/message-failed-v1.schema.json +8 -0
  218. package/schemas/events/message-provider-accepted-v1.schema.json +8 -0
  219. package/schemas/events/subscription-activated-v1.schema.json +8 -0
  220. package/schemas/events/subscription-revoked-v1.schema.json +8 -0
  221. package/schemas/events/whooshbang-event-v1.schema.json +689 -0
  222. package/schemas/fixture-index.schema.json +67 -0
  223. package/schemas/interaction-machine-scenario.schema.json +700 -0
  224. package/schemas/interaction-v1.schema.json +483 -0
  225. package/schemas/machine-v1.schema.json +430 -0
  226. package/schemas/provider-capabilities-v1.schema.json +263 -0
  227. package/schemas/webhooks/webhook-delivery-case-v1.schema.json +167 -0
  228. package/schemas/webhooks/webhook-signing-vector-v1.schema.json +197 -0
  229. package/schemas/whooshbang-v1.schema.json +2173 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,198 @@
1
+ # Changelog
2
+
3
+ All notable contract changes are recorded here.
4
+
5
+ ## 1.0.0-rc.13
6
+
7
+ - Publish the unchanged contract schemas and fixtures as the first public npm
8
+ candidate, with explicit public package metadata and a package-local MIT
9
+ license. `1.0.0-rc.12` remains immutable.
10
+ - Coordinate the public boundary with SDK `1.0.0-rc.14` and deterministic mock
11
+ `1.0.0-rc.16`; hosted WhooshBang service code remains proprietary.
12
+
13
+ ## 1.0.0-rc.12
14
+
15
+ - Reissue the unchanged schema and fixture semantics as the coordinated
16
+ contract identity for SDK `1.0.0-rc.13` and deterministic mock
17
+ `1.0.0-rc.15`.
18
+ - The mock now omits already-acknowledged events from polls and re-derives a
19
+ repeated acknowledgement from durable state, matching the existing C0-03
20
+ fixtures and semantics model. `1.0.0-rc.11` remains immutable.
21
+
22
+ ## 1.0.0-rc.11
23
+
24
+ - Add the closed `replay_unavailable` Problem code at HTTP 409. Replay
25
+ refusals retain the `not_terminal`, `payload_unavailable`, or
26
+ `rollout_disabled` field error that tells an integrator which state blocked
27
+ the operation.
28
+ - Allow `interaction.received` machine events to outlive answer content. New
29
+ retained events publish `answer_retained: true` with `response`; redacted
30
+ events publish `answer_retained: false` and omit `response`.
31
+ - Accept a retained legacy event with `response` and no retention marker during
32
+ a rolling deployment. Absence is never a redaction signal; only the published
33
+ `answer_retained: false` shape is.
34
+ - Breaking: exhaustive `ProblemCode` consumers must handle the new member, and
35
+ machine-event consumers must tolerate a redacted event without `response`.
36
+ `1.0.0-rc.10` remains immutable.
37
+
38
+ ## 1.0.0-rc.10
39
+
40
+ - Add the environment-scoped form of each operation an account-scoped caller
41
+ needs — subscription-link create and read, message create and read,
42
+ interaction read, machine-client create, and capabilities — alongside the
43
+ flat forms, which are untouched and remain credential-only.
44
+ - Add a `bearerGrant` security scheme, and attach it to those operations, to
45
+ the account and project operations, and to the customer-endpoint operations
46
+ that already carry project and environment in their paths.
47
+ - Split the scope vocabulary by level. Project-level scopes are the credential
48
+ vocabulary unchanged and stay mirrored exactly; the account-level scopes
49
+ `projects:read` and `projects:write` exist only on a grant or a human
50
+ session, because a credential lives inside a project and can never create or
51
+ enumerate its siblings.
52
+ - Additive throughout: every existing request and response is unchanged.
53
+
54
+ ## 1.0.0-rc.9
55
+
56
+ - Add authenticated per-message and per-interaction canonical response
57
+ inspection with a bounded zero-to-30-second wait that defaults to 30.
58
+ - Preserve first-terminal-writer and retained/redacted answer semantics while
59
+ making wait expiry a successful current-state response.
60
+ - Reissue the unpublished contract as a new immutable candidate;
61
+ `1.0.0-rc.8` remains unchanged.
62
+
63
+ ## 1.0.0-rc.8
64
+
65
+ - Add project/environment customer-endpoint create, signed verification,
66
+ secret rotation, lifecycle, health, and safe attempt-diagnostic operations.
67
+ - Add one-time secret result, verification challenge, endpoint resource, and
68
+ diagnostic fixtures while preserving the existing Standard Webhooks and
69
+ idempotency semantics.
70
+ - Preserve each promised rotation overlap by returning a typed conflict when
71
+ another rotation is requested before the prior overlap expires.
72
+ - Reissue the unpublished contract as a new immutable candidate;
73
+ `1.0.0-rc.7` remains unchanged.
74
+
75
+ ## 1.0.0-rc.7
76
+
77
+ - Preserve the first-terminal-writer `answered` state after normalized answer
78
+ deletion with explicit `answer_retained` status semantics: retained answers
79
+ remain typed; redacted summaries keep `answered_at` and omit `answer`.
80
+ - Add retained and redacted golden interaction summaries and regenerate the
81
+ public types, validators, OpenAPI bundle, SDK, and deterministic mock.
82
+ - Reissue the unpublished contract as a new immutable candidate;
83
+ `1.0.0-rc.6` remains unchanged.
84
+
85
+ ## 1.0.0-rc.6
86
+
87
+ - Generate the deployed production API server origin from the canonical
88
+ Cloudflare resource manifest and move it to `https://api.whooshbang.com`.
89
+ - Keep the existing V1 Problem Details and JSON Schema URI identifiers pinned
90
+ to their immutable `whooshbang.flowxo.com` identities.
91
+ - Reissue the contract, SDK, mock, generated output, and fixture identities as
92
+ a new immutable candidate; `1.0.0-rc.5` remains unchanged.
93
+ - No compatibility shim or runtime migration is required because the prior
94
+ candidate was unpublished and the product has not been deployed.
95
+
96
+ ## 1.0.0-rc.5
97
+
98
+ - Restore the documented `paused` Telegram binding state to the C0
99
+ `BindingSummary` candidate alongside `active` and `revoked`.
100
+ - Add schema-valid paused and revoked subscription-link fixtures so consumers
101
+ prove all subscriber-control states instead of inferring them.
102
+ - Reissue the contract, SDK, mock, generated output, and fixture identities as
103
+ a new immutable candidate; `1.0.0-rc.4` remains unchanged.
104
+ - No compatibility shim or runtime migration is required because the prior
105
+ candidate was unpublished and the product has not been deployed.
106
+
107
+ ## 1.0.0-rc.4
108
+
109
+ - Replace the unused pre-launch product identity with WhooshBang across the
110
+ package name, OpenAPI and schema identities, Problem Details origin,
111
+ diagnostic header, event envelope, project and machine credential markers,
112
+ generated types, validators, fixtures, and consumer examples.
113
+ - Rename the public package to `@whooshbang/contracts`; the prior candidate
114
+ was never published and has no compatibility or migration requirement.
115
+
116
+ ## 1.0.0-rc.3
117
+
118
+ - Add the approved N1-03 API credential lifecycle contract: account-owned
119
+ project/environment administration paths, exact high-entropy bearer syntax,
120
+ one-time create/rotate reveal, metadata-only listing, a zero-to-24-hour
121
+ rotation overlap, terminal repeat-safe revocation, and indistinguishable
122
+ invalid/revoked authentication.
123
+ - Keep published credential examples unmistakably synthetic with low-entropy
124
+ sentinel values so repository secret scanning remains actionable.
125
+ - Require a distinct newly active replacement, coherent lifecycle timestamps,
126
+ and an explicit old-credential revocation deadline in rotation responses;
127
+ extend deployable-artifact scanning to WhooshBang bearer formats.
128
+ - Reissue the contract, SDK, mock, fixtures, and generated artifacts under a
129
+ new immutable candidate identity; `1.0.0-rc.2` remains unchanged.
130
+
131
+ ## 1.0.0-rc.2
132
+
133
+ - Add the N1-02 human-administration contract to the reviewed release-candidate
134
+ line: current account projection, project create/list/read, atomic
135
+ `test`/`live` environment and default-notifier bootstrap, account-scoped
136
+ idempotency, slug conflict, and non-enumerating cross-account behavior.
137
+ - Reissue the manifest, schemas, fixtures, OpenAPI bundle, generated types, and
138
+ validators under a new immutable candidate identity; `1.0.0-rc.1` remains
139
+ unchanged.
140
+
141
+ ## 1.0.0-rc.1
142
+
143
+ - Promote the exact reviewed Wave 0/C0 contract from `1.0.0-draft.1` without a
144
+ public semantic change.
145
+ - Reissue every manifest, schema, fixture identity, OpenAPI document, generated
146
+ output, and package-consumer assertion at the release-candidate version after
147
+ the compatibility and adversarial security gates passed.
148
+ - Keep the candidate repository-local and unpublished so downstream consumers
149
+ can pin and verify the exact artifact before any independent product release.
150
+
151
+ ## 1.0.0-draft.1
152
+
153
+ - Establish the versioned contract workspace, ownership manifest, and package
154
+ boundary.
155
+ - Add the canonical WhooshBang OpenAPI 3.1.1 contract for subscription-link
156
+ creation, inspection, and cancellation and message creation, inspection, and
157
+ cancellation.
158
+ - Add strict JSON Schema 2020-12 request, resource, delivery-attempt, binding,
159
+ Problem Details, fixture-index, and semantic-scenario models.
160
+ - Add deterministic generated TypeScript, runtime validators, a bundled OpenAPI
161
+ document, and golden fixtures covering success, failure, idempotency, state,
162
+ cancellation, and tenant/environment isolation.
163
+ - Record seven-day idempotency, authenticated scope, safe error, and
164
+ ambiguous-provider `outcome_unknown` semantics without adding production
165
+ service, SDK, interaction, webhook, or executable mock behavior.
166
+ - Add the C0-03 tagged confirm, single-select, and input interaction request,
167
+ lifecycle summary, and authenticated answer-event contracts with bounded
168
+ prompts/options/input, opaque callback tokens, strict expiry ordering, and
169
+ deterministic duplicate/stale/expired/mismatched fixtures.
170
+ - Add project-administered machine-client and digest-only credential
171
+ registration/revocation contracts, exact locally generated
172
+ `wb_mc1.<credential-id>.<secret>` syntax, Web Crypto generation and
173
+ constant-time digest verification helpers, and safe metadata responses that
174
+ contain neither a readable secret nor digest.
175
+ - Add bounded long polling, at-least-seven-day event retention, per-event
176
+ idempotent acknowledgement, contiguous committed cursors, crash replay,
177
+ fail-closed foreign/uncommitted cursors, and schema-valid poison-event
178
+ quarantine.
179
+ - Add provider-neutral capability declarations and an additive unique-provider
180
+ collection with Telegram acceptance evidence and explicit lack of
181
+ delivered/read evidence.
182
+ - Add the strict `whooshbang.event.v1` envelope, nine initial per-event
183
+ schemas, generated types/validators, and safe synthetic event fixtures.
184
+ - Add Standard Webhooks-compatible raw-byte HMAC-SHA256 verification using
185
+ Worker- and Node-compatible Web Crypto, bounded current/previous key
186
+ rotation, strict replay/header parsing, and 28 deterministic valid and
187
+ adversarial vectors.
188
+ - Add an independently implemented Python standard-library verifier over the
189
+ same byte vectors and include it in the immutable package boundary.
190
+ - Add a caller-owned atomic deduplication consumer example with expected
191
+ project/event checks and seven-day retention, plus deterministic at-least-
192
+ once delivery classification for 2xx, redirects, retryable outcomes, safe
193
+ Retry-After, eight attempts, and a 24-hour window.
194
+ - Keep machine message create/read authorization narrowly bound to the
195
+ authenticated client destination and owned message IDs; cancellation,
196
+ administration, Relay continuation/resume, multi-select/ordered sets,
197
+ endpoint registration/delivery queues, WebSockets, SDK networking, and
198
+ executable mock behavior remain outside this change.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FlowXO LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # WhooshBang contract workspace
2
+
3
+ `@whooshbang/contracts` is the runtime-neutral artifact boundary for
4
+ public contracts owned by WhooshBang. It does not depend on sibling
5
+ repositories or Cloudflare runtime types.
6
+
7
+ Install the current release candidate from the public npm registry:
8
+
9
+ ```sh
10
+ npm install @whooshbang/contracts@next
11
+ ```
12
+
13
+ ## Source ownership
14
+
15
+ - `contract-manifest.json`, `openapi/`, `schemas/`, `fixtures/`, and
16
+ `examples/` are canonical, human-edited inputs.
17
+ - `src/generated/` is deterministic output. Never edit it by hand; run
18
+ `npm run contracts:generate` from the repository root.
19
+ - `dist/` and `artifacts/` are local build outputs and are not committed.
20
+ - Other products retain ownership of their own schemas. Consumer artifacts are
21
+ pinned and exchanged as tarballs rather than accessed through sibling paths.
22
+
23
+ The manifest indexes the C0-02 core REST contract, its approved N1-02
24
+ account/project administration and N1-03 credential-lifecycle amendments, the
25
+ C0-03 interaction, machine-client, machine-event, and provider-capability
26
+ contracts, and the C0-04 signed customer-event and delivery contracts. The
27
+ canonical API is `openapi/whooshbang-v1.yaml`; its committed distribution
28
+ bundle, generated TypeScript, validators, and fixture index are checked for
29
+ drift on every contract check.
30
+
31
+ The contract intentionally stops at serialized behavior. The JavaScript SDK and
32
+ executable Hono mock provide deterministic C0-05 consumer behavior, while no
33
+ production authentication, persistence, queue, Telegram, endpoint registration,
34
+ or provider behavior lives in this package. Its bounded runtime-neutral helpers
35
+ cover local machine credential material, raw-byte webhook verification,
36
+ caller-owned idempotent consumption, and delivery-response classification. They
37
+ perform no networking or persistence.
38
+
39
+ ## N1-03 credential boundary
40
+
41
+ - Human credential administration is scoped by the verified Clerk account and
42
+ explicit account-owned project/environment path targets.
43
+ - Project bearer syntax is
44
+ `wb_pc1.pcred_<16-byte-base64url>.<32-byte-base64url-secret>`. Creation and
45
+ rotation reveal the complete bearer exactly once and cannot be replayed.
46
+ - Safe metadata exposes a non-secret prefix, label, scopes, opaque
47
+ WhooshBang creator ID, creation/last-used time, and lifecycle state.
48
+ - Rotation preserves label and scopes, with an explicit overlap bounded at 24
49
+ hours. Revocation is terminal and repeat-safe.
50
+ - The initial onboarding scope set uses `subscriptions:read` as the minimal
51
+ resource-read scope alongside `messages:write`, `messages:read`, and
52
+ `subscriptions:write`.
53
+
54
+ ## C0-03 boundaries
55
+
56
+ - Message creation accepts an optional tagged `confirm`, single `select`, or
57
+ `input` interaction. Expiry and first-terminal-answer behavior remain
58
+ server-authoritative.
59
+ - Provider callback and cursor tokens are opaque references. They carry no
60
+ answer, identity, command, session, or business authority.
61
+ - Machine credentials have only `machine-messages:write`,
62
+ `machine-messages:read`, `machine-events:read`, and `machine-events:ack`,
63
+ each constrained to the authenticated client's bound destination or stream.
64
+ They cannot cancel messages or administer machine clients.
65
+ - Polling repeats unacknowledged events and accepts only the exact atomically
66
+ committed cursor. Per-event acknowledgement advances only a contiguous
67
+ prefix; safe quarantine cannot bypass identity, signature, or schema
68
+ failures.
69
+ - `GET /v1/capabilities` returns a provider collection whose individual
70
+ declarations validate against the standalone provider-capability schema.
71
+ - Customer applications and Agent Relay decide what an authenticated answer
72
+ means. WhooshBang never serializes or issues an executable resume
73
+ command.
74
+
75
+ ## C0-04 boundaries
76
+
77
+ - `whooshbang.event.v1` is a strict nine-member customer-event union with
78
+ stable public resource IDs and no bearer, callback token, raw provider
79
+ identity, executable command, or original message body.
80
+ - Standard Webhooks V1 verification signs
81
+ `<webhook-id>.<webhook-timestamp>.<raw-body>` with HMAC-SHA256, accepts at
82
+ most current and previous `whsec_` keys during rotation, and enforces a
83
+ five-minute-or-narrower replay window.
84
+ - Customer code checks the expected project and atomically deduplicates event
85
+ IDs before business side effects, retaining successful claims for at least
86
+ seven days.
87
+ - Delivery is at least once and unordered. Redirects are not followed; only
88
+ network failures, 408, 425, 429, and 5xx are retryable, with at most eight
89
+ attempts during 24 hours.
90
+ - The JavaScript verifier is Web Crypto-only. The packaged independent Python
91
+ example uses only the standard library and passes the same deterministic
92
+ byte vectors.
93
+
94
+ ## Public package exports
95
+
96
+ - Package root: contract manifest, version, generated model types, named
97
+ validators, machine-credential helpers, webhook verification/idempotent
98
+ consumption, and delivery classification.
99
+ - `examples/python/verify_webhook.py`: independent standard-library verifier.
100
+ - `openapi/whooshbang-v1.yaml`: canonical OpenAPI 3.1.1 source.
101
+ - `openapi/whooshbang-v1.bundle.json`: deterministic self-contained bundle.
102
+ - `schemas/*`: canonical JSON Schema 2020-12 documents.
103
+ - `fixtures/*`: versioned synthetic golden fixtures and their machine-readable
104
+ index.
105
+
106
+ ## Stable root commands
107
+
108
+ ```sh
109
+ npm run build
110
+ npm run check
111
+ npm run contracts:generate
112
+ npm run contracts:check
113
+ npm run contracts:pack
114
+ ```
115
+
116
+ `contracts:check` validates the manifest and canonical documents, fixtures,
117
+ generated-file drift, package exports, package boundaries, and runtime
118
+ neutrality. `contracts:pack` repeats those checks, proves reproducible packing,
119
+ audits the tarball, and installs it into isolated npm and pnpm consumers. It
120
+ never publishes to a registry.