@greatwait/contracts 0.1.0-alpha.1

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 (241) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +77 -0
  3. package/dist/authority.d.ts +217 -0
  4. package/dist/authority.js +261 -0
  5. package/dist/callback-ownership.d.ts +58 -0
  6. package/dist/callback-ownership.js +71 -0
  7. package/dist/callback-safety.d.ts +38 -0
  8. package/dist/callback-safety.js +403 -0
  9. package/dist/compatibility.d.ts +82 -0
  10. package/dist/compatibility.js +115 -0
  11. package/dist/delivery.d.ts +401 -0
  12. package/dist/delivery.js +311 -0
  13. package/dist/endpoints.d.ts +305 -0
  14. package/dist/endpoints.js +179 -0
  15. package/dist/events.d.ts +62 -0
  16. package/dist/events.js +38 -0
  17. package/dist/first-value-journey.d.ts +305 -0
  18. package/dist/first-value-journey.js +466 -0
  19. package/dist/forecast.d.ts +443 -0
  20. package/dist/forecast.js +729 -0
  21. package/dist/identifiers.d.ts +109 -0
  22. package/dist/identifiers.js +131 -0
  23. package/dist/identity.d.ts +196 -0
  24. package/dist/identity.js +182 -0
  25. package/dist/index.d.ts +27 -0
  26. package/dist/index.js +27 -0
  27. package/dist/mcp.d.ts +51 -0
  28. package/dist/mcp.js +56 -0
  29. package/dist/oauth.d.ts +796 -0
  30. package/dist/oauth.js +708 -0
  31. package/dist/operations.d.ts +3985 -0
  32. package/dist/operations.js +1837 -0
  33. package/dist/partition.d.ts +771 -0
  34. package/dist/partition.js +206 -0
  35. package/dist/policy.d.ts +93 -0
  36. package/dist/policy.js +180 -0
  37. package/dist/problems.d.ts +158 -0
  38. package/dist/problems.js +104 -0
  39. package/dist/protocol.d.ts +308 -0
  40. package/dist/protocol.js +515 -0
  41. package/dist/scheduling-records.d.ts +395 -0
  42. package/dist/scheduling-records.js +284 -0
  43. package/dist/scheduling.d.ts +1098 -0
  44. package/dist/scheduling.js +1116 -0
  45. package/dist/secrets.d.ts +383 -0
  46. package/dist/secrets.js +272 -0
  47. package/dist/signatures.d.ts +704 -0
  48. package/dist/signatures.js +867 -0
  49. package/dist/tenancy.d.ts +178 -0
  50. package/dist/tenancy.js +145 -0
  51. package/dist/test-sink.d.ts +986 -0
  52. package/dist/test-sink.js +755 -0
  53. package/dist/time.d.ts +45 -0
  54. package/dist/time.js +128 -0
  55. package/dist/usage.d.ts +121 -0
  56. package/dist/usage.js +200 -0
  57. package/dist/webhooks.d.ts +116 -0
  58. package/dist/webhooks.js +161 -0
  59. package/dist/workspace.d.ts +92 -0
  60. package/dist/workspace.js +59 -0
  61. package/generated/v1/callback-delivery-signature.json +467 -0
  62. package/generated/v1/callback-endpoint-verification.json +59 -0
  63. package/generated/v1/callback-receiver.json +241 -0
  64. package/generated/v1/examples/attempts.list.response.json +24 -0
  65. package/generated/v1/examples/attempts.read.response.json +20 -0
  66. package/generated/v1/examples/credentials.create.request.json +5 -0
  67. package/generated/v1/examples/credentials.create.response.json +10 -0
  68. package/generated/v1/examples/credentials.list.response.json +17 -0
  69. package/generated/v1/examples/credentials.revoke.response.json +11 -0
  70. package/generated/v1/examples/credentials.rotate.request.json +3 -0
  71. package/generated/v1/examples/credentials.rotate.response.json +22 -0
  72. package/generated/v1/examples/endpoints.create.request.json +3 -0
  73. package/generated/v1/examples/endpoints.create.response.json +16 -0
  74. package/generated/v1/examples/endpoints.disable.response.json +15 -0
  75. package/generated/v1/examples/endpoints.list.response.json +21 -0
  76. package/generated/v1/examples/endpoints.read.response.json +14 -0
  77. package/generated/v1/examples/endpoints.rotateSigningKey.request.json +3 -0
  78. package/generated/v1/examples/endpoints.rotateSigningKey.response.json +23 -0
  79. package/generated/v1/examples/endpoints.update.request.json +3 -0
  80. package/generated/v1/examples/endpoints.update.response.json +13 -0
  81. package/generated/v1/examples/endpoints.verify.response.json +15 -0
  82. package/generated/v1/examples/forecast.read.response.json +28 -0
  83. package/generated/v1/examples/forecast.windows.response.json +21 -0
  84. package/generated/v1/examples/grants.list.response.json +17 -0
  85. package/generated/v1/examples/grants.revoke.response.json +16 -0
  86. package/generated/v1/examples/meta.scaffold.response.json +5 -0
  87. package/generated/v1/examples/meta.version.response.json +5 -0
  88. package/generated/v1/examples/occurrences.list.response.json +17 -0
  89. package/generated/v1/examples/occurrences.read.response.json +15 -0
  90. package/generated/v1/examples/occurrences.redeliver.response.json +16 -0
  91. package/generated/v1/examples/projects.create.request.json +3 -0
  92. package/generated/v1/examples/projects.create.response.json +5 -0
  93. package/generated/v1/examples/projects.list.response.json +9 -0
  94. package/generated/v1/examples/schedules.archive.response.json +25 -0
  95. package/generated/v1/examples/schedules.cancel.response.json +24 -0
  96. package/generated/v1/examples/schedules.create.request.json +9 -0
  97. package/generated/v1/examples/schedules.create.response.json +25 -0
  98. package/generated/v1/examples/schedules.list.response.json +23 -0
  99. package/generated/v1/examples/schedules.pause.response.json +23 -0
  100. package/generated/v1/examples/schedules.read.response.json +25 -0
  101. package/generated/v1/examples/schedules.replace.request.json +8 -0
  102. package/generated/v1/examples/schedules.replace.response.json +25 -0
  103. package/generated/v1/examples/schedules.resume.response.json +23 -0
  104. package/generated/v1/examples/sinkdeliveries.list.response.json +19 -0
  105. package/generated/v1/examples/sinkdeliveries.read.response.json +16 -0
  106. package/generated/v1/examples/testsinks.configure.request.json +3 -0
  107. package/generated/v1/examples/testsinks.configure.response.json +13 -0
  108. package/generated/v1/examples/testsinks.create.request.json +8 -0
  109. package/generated/v1/examples/testsinks.create.response.json +13 -0
  110. package/generated/v1/examples/testsinks.delete.response.json +13 -0
  111. package/generated/v1/examples/testsinks.list.response.json +20 -0
  112. package/generated/v1/examples/testsinks.read.response.json +14 -0
  113. package/generated/v1/examples/usage.read.response.json +20 -0
  114. package/generated/v1/first-value-journey.json +436 -0
  115. package/generated/v1/manifest.json +1037 -0
  116. package/generated/v1/openapi.json +23665 -0
  117. package/generated/v1/policy-matrix.json +305 -0
  118. package/generated/v1/schemas/attempts.list.query.json +16 -0
  119. package/generated/v1/schemas/attempts.list.response.json +175 -0
  120. package/generated/v1/schemas/attempts.read.response.json +168 -0
  121. package/generated/v1/schemas/credentials.create.request.json +39 -0
  122. package/generated/v1/schemas/credentials.create.response.json +88 -0
  123. package/generated/v1/schemas/credentials.list.query.json +16 -0
  124. package/generated/v1/schemas/credentials.list.response.json +124 -0
  125. package/generated/v1/schemas/credentials.revoke.response.json +84 -0
  126. package/generated/v1/schemas/credentials.rotate.request.json +11 -0
  127. package/generated/v1/schemas/credentials.rotate.response.json +171 -0
  128. package/generated/v1/schemas/endpoints.create.request.json +12 -0
  129. package/generated/v1/schemas/endpoints.create.response.json +115 -0
  130. package/generated/v1/schemas/endpoints.disable.response-headers.json +11 -0
  131. package/generated/v1/schemas/endpoints.disable.response.json +100 -0
  132. package/generated/v1/schemas/endpoints.list.query.json +16 -0
  133. package/generated/v1/schemas/endpoints.list.response.json +146 -0
  134. package/generated/v1/schemas/endpoints.read.response-headers.json +11 -0
  135. package/generated/v1/schemas/endpoints.read.response.json +100 -0
  136. package/generated/v1/schemas/endpoints.rotateSigningKey.request-headers.json +10 -0
  137. package/generated/v1/schemas/endpoints.rotateSigningKey.request.json +11 -0
  138. package/generated/v1/schemas/endpoints.rotateSigningKey.response-headers.json +11 -0
  139. package/generated/v1/schemas/endpoints.rotateSigningKey.response.json +118 -0
  140. package/generated/v1/schemas/endpoints.update.request-headers.json +10 -0
  141. package/generated/v1/schemas/endpoints.update.request.json +12 -0
  142. package/generated/v1/schemas/endpoints.update.response-headers.json +11 -0
  143. package/generated/v1/schemas/endpoints.update.response.json +100 -0
  144. package/generated/v1/schemas/endpoints.verify.request-headers.json +10 -0
  145. package/generated/v1/schemas/endpoints.verify.response-headers.json +11 -0
  146. package/generated/v1/schemas/endpoints.verify.response.json +100 -0
  147. package/generated/v1/schemas/forecast.read.query.json +26 -0
  148. package/generated/v1/schemas/forecast.read.response.json +100 -0
  149. package/generated/v1/schemas/forecast.windows.query.json +26 -0
  150. package/generated/v1/schemas/forecast.windows.response.json +94 -0
  151. package/generated/v1/schemas/grants.list.response.json +98 -0
  152. package/generated/v1/schemas/grants.revoke.response.json +95 -0
  153. package/generated/v1/schemas/meta.scaffold.response.json +36 -0
  154. package/generated/v1/schemas/meta.version.response.json +19 -0
  155. package/generated/v1/schemas/occurrences.list.query.json +16 -0
  156. package/generated/v1/schemas/occurrences.list.response.json +83 -0
  157. package/generated/v1/schemas/occurrences.read.response.json +76 -0
  158. package/generated/v1/schemas/occurrences.redeliver.request-headers.json +13 -0
  159. package/generated/v1/schemas/occurrences.redeliver.response-headers.json +10 -0
  160. package/generated/v1/schemas/occurrences.redeliver.response.json +168 -0
  161. package/generated/v1/schemas/projects.create.request.json +12 -0
  162. package/generated/v1/schemas/projects.create.response.json +25 -0
  163. package/generated/v1/schemas/projects.list.response.json +35 -0
  164. package/generated/v1/schemas/schedules.archive.request-headers.json +10 -0
  165. package/generated/v1/schemas/schedules.archive.response-headers.json +11 -0
  166. package/generated/v1/schemas/schedules.archive.response.json +189 -0
  167. package/generated/v1/schemas/schedules.cancel.request-headers.json +10 -0
  168. package/generated/v1/schemas/schedules.cancel.response-headers.json +11 -0
  169. package/generated/v1/schemas/schedules.cancel.response.json +189 -0
  170. package/generated/v1/schemas/schedules.create.request-headers.json +12 -0
  171. package/generated/v1/schemas/schedules.create.request.json +99 -0
  172. package/generated/v1/schemas/schedules.create.response-headers.json +15 -0
  173. package/generated/v1/schemas/schedules.create.response.json +189 -0
  174. package/generated/v1/schemas/schedules.list.query.json +16 -0
  175. package/generated/v1/schemas/schedules.list.response.json +170 -0
  176. package/generated/v1/schemas/schedules.pause.request-headers.json +10 -0
  177. package/generated/v1/schemas/schedules.pause.response-headers.json +11 -0
  178. package/generated/v1/schemas/schedules.pause.response.json +189 -0
  179. package/generated/v1/schemas/schedules.read.response-headers.json +11 -0
  180. package/generated/v1/schemas/schedules.read.response.json +189 -0
  181. package/generated/v1/schemas/schedules.replace.request-headers.json +10 -0
  182. package/generated/v1/schemas/schedules.replace.request.json +99 -0
  183. package/generated/v1/schemas/schedules.replace.response-headers.json +11 -0
  184. package/generated/v1/schemas/schedules.replace.response.json +189 -0
  185. package/generated/v1/schemas/schedules.resume.request-headers.json +10 -0
  186. package/generated/v1/schemas/schedules.resume.response-headers.json +11 -0
  187. package/generated/v1/schemas/schedules.resume.response.json +189 -0
  188. package/generated/v1/schemas/sinkdeliveries.list.query.json +16 -0
  189. package/generated/v1/schemas/sinkdeliveries.list.response.json +126 -0
  190. package/generated/v1/schemas/sinkdeliveries.read.response.json +98 -0
  191. package/generated/v1/schemas/testsinks.configure.request.json +66 -0
  192. package/generated/v1/schemas/testsinks.configure.response.json +115 -0
  193. package/generated/v1/schemas/testsinks.create.request.json +76 -0
  194. package/generated/v1/schemas/testsinks.create.response.json +115 -0
  195. package/generated/v1/schemas/testsinks.delete.response.json +115 -0
  196. package/generated/v1/schemas/testsinks.list.query.json +16 -0
  197. package/generated/v1/schemas/testsinks.list.response.json +161 -0
  198. package/generated/v1/schemas/testsinks.read.response.json +115 -0
  199. package/generated/v1/schemas/usage.read.query.json +15 -0
  200. package/generated/v1/schemas/usage.read.response.json +71 -0
  201. package/generated/v1/snippets/attempts.list.json +5 -0
  202. package/generated/v1/snippets/attempts.read.json +5 -0
  203. package/generated/v1/snippets/credentials.create.json +5 -0
  204. package/generated/v1/snippets/credentials.list.json +5 -0
  205. package/generated/v1/snippets/credentials.revoke.json +5 -0
  206. package/generated/v1/snippets/credentials.rotate.json +5 -0
  207. package/generated/v1/snippets/endpoints.create.json +5 -0
  208. package/generated/v1/snippets/endpoints.disable.json +5 -0
  209. package/generated/v1/snippets/endpoints.list.json +5 -0
  210. package/generated/v1/snippets/endpoints.read.json +5 -0
  211. package/generated/v1/snippets/endpoints.rotateSigningKey.json +5 -0
  212. package/generated/v1/snippets/endpoints.update.json +5 -0
  213. package/generated/v1/snippets/endpoints.verify.json +5 -0
  214. package/generated/v1/snippets/forecast.read.json +5 -0
  215. package/generated/v1/snippets/forecast.windows.json +5 -0
  216. package/generated/v1/snippets/grants.list.json +5 -0
  217. package/generated/v1/snippets/grants.revoke.json +5 -0
  218. package/generated/v1/snippets/meta.scaffold.json +5 -0
  219. package/generated/v1/snippets/meta.version.json +5 -0
  220. package/generated/v1/snippets/occurrences.list.json +5 -0
  221. package/generated/v1/snippets/occurrences.read.json +5 -0
  222. package/generated/v1/snippets/occurrences.redeliver.json +5 -0
  223. package/generated/v1/snippets/projects.create.json +5 -0
  224. package/generated/v1/snippets/projects.list.json +5 -0
  225. package/generated/v1/snippets/schedules.archive.json +5 -0
  226. package/generated/v1/snippets/schedules.cancel.json +5 -0
  227. package/generated/v1/snippets/schedules.create.json +5 -0
  228. package/generated/v1/snippets/schedules.list.json +5 -0
  229. package/generated/v1/snippets/schedules.pause.json +5 -0
  230. package/generated/v1/snippets/schedules.read.json +5 -0
  231. package/generated/v1/snippets/schedules.replace.json +5 -0
  232. package/generated/v1/snippets/schedules.resume.json +5 -0
  233. package/generated/v1/snippets/sinkdeliveries.list.json +5 -0
  234. package/generated/v1/snippets/sinkdeliveries.read.json +5 -0
  235. package/generated/v1/snippets/testsinks.configure.json +5 -0
  236. package/generated/v1/snippets/testsinks.create.json +5 -0
  237. package/generated/v1/snippets/testsinks.delete.json +5 -0
  238. package/generated/v1/snippets/testsinks.list.json +5 -0
  239. package/generated/v1/snippets/testsinks.read.json +5 -0
  240. package/generated/v1/snippets/usage.read.json +5 -0
  241. package/package.json +153 -0
@@ -0,0 +1,3985 @@
1
+ import { z } from "zod";
2
+ import type { PrincipalKind, Scope } from "./authority.js";
3
+ import type { ProblemCode } from "./problems.js";
4
+ /**
5
+ * The operation registry: one declaration per public operation, and the single
6
+ * source every artifact is generated from.
7
+ *
8
+ * OpenAPI, the typed client, the MCP tool registry, and the contract mock are
9
+ * all projections of this list. Nothing downstream may hand-write a wire
10
+ * shape, because a hand-written shape is a shape that drifts — which is
11
+ * exactly what the legacy scheduler's separately-maintained client and docs
12
+ * did.
13
+ *
14
+ * The list grows one story at a time and each new operation gets every
15
+ * artifact for free. W0-02 settled conventions rather than resources and W0-03
16
+ * settled the generation pipeline; W1-08 added the first `/v1` operations,
17
+ * W1-04 the credential lifecycle, and W1-06 the first paged collection —
18
+ * which is what put `query` on this interface, since a page is asked for on
19
+ * the URL rather than in a body.
20
+ */
21
+ /** Where an operation is served. The mock implements all of them. */
22
+ export type OperationSurface = "api" | "mock";
23
+ /**
24
+ * What an operation is on the MCP surface.
25
+ *
26
+ * Architecture section 9 defines "complete MCP" as *every supported REST
27
+ * capability is either an MCP tool or an intentionally read-only MCP resource*.
28
+ * This is that sentence made declarable, and it is **required** on every
29
+ * operation so the compiler refuses one that has not decided — which is W1-07's
30
+ * criterion 4 at the earliest point it can be enforced. The parity gate then
31
+ * publishes the decisions as a table and refuses the ones that contradict the
32
+ * operation's own declarations.
33
+ *
34
+ * Deriving it instead was considered and rejected for the reason `creates` is
35
+ * declared: "should an agent be able to call this" is not a function of a
36
+ * method, a path or a schema. `credentials.create` is the case that proves it —
37
+ * a `POST` like any other, and structurally uncallable by any principal MCP can
38
+ * carry.
39
+ */
40
+ export type McpDisposition = {
41
+ /**
42
+ * Published as a read-only MCP resource rather than a tool.
43
+ *
44
+ * For an operation that takes no arguments and reports a fact about the
45
+ * service. A resource is fetched by URI and cannot be given parameters, so
46
+ * the parity gate refuses this disposition on anything that mutates,
47
+ * declares scopes, takes a body, or has a path parameter.
48
+ */
49
+ readonly kind: "resource";
50
+ /** The URI a client reads it by. Opaque, stable, and ours to choose. */
51
+ readonly uri: string;
52
+ } | {
53
+ /**
54
+ * MCP's `destructiveHint`: whether a successful call can undo or discard
55
+ * something that already existed.
56
+ *
57
+ * Declared rather than inferred from `mutates`, because an agent host
58
+ * gates confirmation on it and the two are genuinely different questions.
59
+ * Creating a schedule and cancelling one both mutate; only the second
60
+ * takes something away. MCP defines the hint as meaningful only when the
61
+ * tool is not read-only, so the parity gate refuses `true` on a read.
62
+ */
63
+ readonly destructive: boolean;
64
+ /** Callable by an agent. */
65
+ readonly kind: "tool";
66
+ /**
67
+ * MCP's `openWorldHint`: whether the call can interact with an entity
68
+ * outside Greatwait. This cannot be inferred from the HTTP path —
69
+ * endpoint verification is a Greatwait API operation whose effect is an
70
+ * outbound request to a customer-controlled receiver.
71
+ */
72
+ readonly openWorld: boolean;
73
+ } | {
74
+ /** Why an agent cannot reach it. Required, and the gate refuses an empty
75
+ * one: an exclusion nobody can explain is an exclusion nobody can review. */
76
+ readonly reason: string;
77
+ /** Deliberately absent from the MCP surface. */
78
+ readonly kind: "unavailable";
79
+ };
80
+ export interface OperationDefinition {
81
+ /**
82
+ * Whether a success brings into existence a resource that did not exist
83
+ * before the call. This is what 201 means, and until W2-02 it was inferred
84
+ * from `POST` + `mutates`, which happened to agree because every mutating
85
+ * POST on the surface did create something.
86
+ *
87
+ * `schedules.pause` is the first that does not. Inferring 201 for it would
88
+ * publish "Created" for a call that creates nothing — and the inference could
89
+ * not be fixed by looking harder at the other fields, because "did this bring
90
+ * something into being" is not derivable from a method, a path or a schema.
91
+ * So it is declared, in the same category as `mutates` and `idempotent`, and
92
+ * `successStatusFor` reads it instead of guessing.
93
+ */
94
+ readonly creates: boolean;
95
+ readonly description: string;
96
+ /**
97
+ * A response example, validated against `response` when artifacts are
98
+ * generated. Required, because an example is the part of a specification
99
+ * people actually read — and an unvalidated one is worse than none, since it
100
+ * teaches a shape the service will reject.
101
+ */
102
+ readonly example: unknown;
103
+ /** Stable machine name, also the MCP tool name and the SDK method name. */
104
+ readonly id: string;
105
+ /**
106
+ * Whether repeating the identical request is safe. Read operations are
107
+ * trivially so; writes must carry an idempotency key to qualify.
108
+ */
109
+ readonly idempotent: boolean;
110
+ /**
111
+ * What this operation is on the MCP surface. Required, so an operation added
112
+ * to this registry cannot reach REST without the question being answered.
113
+ */
114
+ readonly mcp: McpDisposition;
115
+ readonly method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
116
+ /** Whether the operation changes state, for MCP annotations and approvals. */
117
+ readonly mutates: boolean;
118
+ /** Path template with `{name}` parameters. */
119
+ readonly path: string;
120
+ /**
121
+ * Which kinds of principal this operation accepts. Empty means it needs none.
122
+ *
123
+ * **Required, for the reason `mcp` is: an operation cannot reach REST without
124
+ * the question being answered.** Until this field existed the published
125
+ * document derived its security requirement from `scopes` alone, which says
126
+ * what a caller must hold and not what kind of caller may hold it. That is how
127
+ * `credentials.create` came to advertise API-credential authentication for a
128
+ * route that refuses an API credential on sight — a published claim that was
129
+ * simply false, and that no gate could see because the fact it contradicted
130
+ * was written nowhere.
131
+ *
132
+ * The rule the current list follows, so a reader does not have to infer it:
133
+ *
134
+ * - **Every `/v1` GET accepts a signed-in member**, alongside keys and tokens.
135
+ * The dashboard is a normal client of the public API, not a privileged one.
136
+ * - **The schedule lifecycle writes accept one too**, since W4-03: create,
137
+ * replace, pause, resume, cancel, archive, and redeliver. Until then no
138
+ * `/v1` write did, on the grounds that writing from a browser needs
139
+ * conditional-request and idempotency handling no browser surface existed
140
+ * for — and that shipping an authorization path nothing exercises is worse
141
+ * than shipping none. W4-03 is that surface, and
142
+ * `apps/dashboard/src/workspace-mutations.test.ts` holds the two sets equal:
143
+ * a write declared here and reachable by no dashboard control fails, and so
144
+ * does a dashboard control for a write that does not declare it.
145
+ * - **The endpoint writes accept one too, since W4-02's first cut**: create,
146
+ * update, verify, rotateSigningKey and disable. The reason is the same one
147
+ * W4-03 gave — a browser surface now exercises them, and three of the five
148
+ * publish the `If-Match` that makes a write from a page somebody has been
149
+ * looking at refusable rather than silently last-writer-wins.
150
+ * - **The credential writes accept one too, since W4-02's second cut**:
151
+ * rotate and revoke, joining `credentials.create`, which was session-only
152
+ * from the start. Acting on a credential *somebody else issued* additionally
153
+ * needs `credentials:administer`, which is the one scope the `member` role
154
+ * does not hold — see `policy.ts`.
155
+ * - **Every other `/v1` write still refuses a session**, which is the half of
156
+ * the old rule that survives. Test sinks are the remaining surface nobody
157
+ * has built, and the case that pins each refused write lives in
158
+ * `apps/api/src/v1-session-authority.worker.test.ts`.
159
+ * - **`credentials.create` is the exception in the other direction**: a write
160
+ * that accepts *only* a session, and predates all of this.
161
+ * - **`projects.list` is session-only**, because a key's authority already
162
+ * *is* one project: for a key the answer is either a one-row list of no
163
+ * value or an invitation to widen.
164
+ */
165
+ readonly principals: readonly PrincipalKind[];
166
+ /**
167
+ * How a session request states the project and environment it acts in.
168
+ *
169
+ * A key and a token carry their authority tuple intrinsically. A session
170
+ * carries only the member's organization, so something else has to say which
171
+ * project — and it is not the same something for every operation:
172
+ *
173
+ * - `"headers"` — the two `SESSION_AUTHORITY_HEADERS`. Every operation that
174
+ * acts on resources inside one project.
175
+ * - `"request-body"` — the request already names them as fields.
176
+ * `credentials.create` is the only one, and it predates this field.
177
+ * - `"organization"` — the operation is answered from the member's
178
+ * organization and names no project at all. `projects.list` is this, and it
179
+ * has to be: it is the call a browser makes *because* it does not know a
180
+ * project yet. Publishing a required project header on it would describe a
181
+ * call nobody can make.
182
+ * - `"member"` — the operation is answered from the signed-in **person**, and
183
+ * the resource is theirs rather than a project's. The grant operations are
184
+ * this: a member's connected applications span every project in their
185
+ * organization, because a person connects an application and not a project.
186
+ * A project header would narrow an answer that is not project-shaped, and
187
+ * there is nothing for it to narrow.
188
+ *
189
+ * **It is a distinct value rather than a second use of `"organization"`,
190
+ * and the difference is load-bearing.** The rule
191
+ * `operations.test.ts` holds — a session *write* answered from the
192
+ * organization is a write to an unspecified place — is about writes that
193
+ * have to choose a project and did not. A write against the member's own
194
+ * resource chooses nothing: the resource is identified by who is asking and
195
+ * by the path. Collapsing the two would have meant either weakening that
196
+ * rule or granting `grants.revoke` an exemption, and an exemption is what
197
+ * the rule replaced.
198
+ *
199
+ * Present exactly when `principals` includes `session`; `operations.test.ts`
200
+ * holds that biconditional, because either half alone is a silent defect —
201
+ * an absent value makes the generator publish a call that cannot be made, and
202
+ * a stray one describes authentication for a credential kind the operation
203
+ * refuses.
204
+ */
205
+ readonly sessionAuthority?: "headers" | "member" | "organization" | "request-body";
206
+ /**
207
+ * Scopes this operation needs only for *some* calls.
208
+ *
209
+ * **Published because an operation that can refuse for a scope it never
210
+ * mentions is a document that lies.** `scopes` is what every call needs and
211
+ * `authorizeOperation` requires all of it; a scope required by the shape of
212
+ * the *target* rather than of the request cannot go there, because declaring
213
+ * it would refuse the ordinary call too. `credentials.rotate` is the case:
214
+ * anybody holding `credentials:write` may rotate their own credential, and
215
+ * rotating one somebody else issued additionally needs
216
+ * `credentials:administer`.
217
+ *
218
+ * Leaving it undeclared had two costs, and the second is the one that bites.
219
+ * An integrator reading the document could not learn why a 403 arrived. And
220
+ * `grantableScopes` derives what an OAuth client may ask for from the scopes
221
+ * operations declare, so a scope named nowhere is a scope no grant can carry
222
+ * — which would have made the whole restriction unreachable through OAuth and
223
+ * the role-narrowing rules unobservable, since nothing else a member is
224
+ * refused would be grantable.
225
+ */
226
+ readonly conditionalScopes?: readonly Scope[];
227
+ /** Problem codes this operation may return, beyond the universal ones. */
228
+ readonly problems: readonly ProblemCode[];
229
+ /**
230
+ * Query parameters, as one object schema whose properties are the parameters.
231
+ *
232
+ * An object rather than a list of declarations because the shapes that matter
233
+ * already exist as schemas — `pageRequestSchema` is the paging contract, and
234
+ * an operation that pages references it instead of restating a cursor and a
235
+ * bound. Every projection derives the parameter list from the schema's own
236
+ * JSON Schema, so which parameters are required, what they accept and what
237
+ * they default to are stated once and published everywhere.
238
+ *
239
+ * Values arrive as strings on a URL. `parsePageRequest` is where that
240
+ * coercion lives for paging, so REST and MCP cannot disagree about what
241
+ * `limit=abc` means.
242
+ */
243
+ readonly query?: z.ZodTypeAny;
244
+ readonly request?: z.ZodTypeAny;
245
+ /**
246
+ * Request headers this operation reads, as one object schema whose properties
247
+ * are the header names — `query`'s shape, for `query`'s reason.
248
+ *
249
+ * A header is as much part of a request as a field is, and the two failures
250
+ * are the same one: a route that reads `If-Match` while the document does not
251
+ * publish it teaches integrators that conditional writes are unavailable, and
252
+ * a document that publishes one no route reads teaches them their preconditions
253
+ * are being honoured when they are not. Both are invisible until a lost update
254
+ * makes them visible.
255
+ *
256
+ * Header names are HTTP's, not ours. `If-Match` and `ETag` are RFC 9110's;
257
+ * `Idempotency-Key` is the spelling the ecosystem settled on. They are
258
+ * case-insensitive on the wire, and the canonical casing here is what the
259
+ * document publishes and what the generated client sends.
260
+ */
261
+ readonly requestHeaders?: z.ZodTypeAny;
262
+ /**
263
+ * Response headers this operation sets on success, same shape.
264
+ *
265
+ * Published because an `ETag` a client is expected to send back in `If-Match`
266
+ * is a value that operation *promises*, and a promise no artifact carries is
267
+ * one the next reader has to discover by experiment.
268
+ */
269
+ readonly responseHeaders?: z.ZodTypeAny;
270
+ /** A request example, validated against `request`. Required whenever the
271
+ * operation takes a body. */
272
+ readonly requestExample?: unknown;
273
+ readonly response: z.ZodTypeAny;
274
+ /** Empty means the operation needs no principal. */
275
+ readonly scopes: readonly Scope[];
276
+ readonly summary: string;
277
+ readonly surfaces: readonly OperationSurface[];
278
+ }
279
+ /**
280
+ * Deterministic behaviors the contract mock can be asked to produce.
281
+ *
282
+ * These are the failure modes an integrator must be able to rehearse before
283
+ * going live, and they are part of the contract rather than mock trivia: a
284
+ * customer tunes their receiver against exactly these categories.
285
+ */
286
+ export declare const MOCK_BEHAVIORS: readonly ["ambiguous", "redelivery", "refusal", "retry", "success", "timeout"];
287
+ export declare const mockBehaviorSchema: z.ZodEnum<{
288
+ success: "success";
289
+ redelivery: "redelivery";
290
+ ambiguous: "ambiguous";
291
+ refusal: "refusal";
292
+ timeout: "timeout";
293
+ retry: "retry";
294
+ }>;
295
+ export type MockBehavior = z.infer<typeof mockBehaviorSchema>;
296
+ /**
297
+ * A mock scenario. `now` pins the clock so a test that depends on time is
298
+ * reproducible: without it, "what does a stale signature look like" is a test
299
+ * that passes until it doesn't.
300
+ */
301
+ export declare const mockScenarioRequestSchema: z.ZodObject<{
302
+ behavior: z.ZodEnum<{
303
+ success: "success";
304
+ redelivery: "redelivery";
305
+ ambiguous: "ambiguous";
306
+ refusal: "refusal";
307
+ timeout: "timeout";
308
+ retry: "retry";
309
+ }>;
310
+ now: z.ZodOptional<z.ZodString>;
311
+ failuresBeforeSuccess: z.ZodOptional<z.ZodNumber>;
312
+ }, z.core.$strip>;
313
+ export type MockScenarioRequest = z.infer<typeof mockScenarioRequestSchema>;
314
+ export declare const mockScenarioResponseSchema: z.ZodObject<{
315
+ behavior: z.ZodEnum<{
316
+ success: "success";
317
+ redelivery: "redelivery";
318
+ ambiguous: "ambiguous";
319
+ refusal: "refusal";
320
+ timeout: "timeout";
321
+ retry: "retry";
322
+ }>;
323
+ now: z.ZodString;
324
+ scenarioId: z.ZodString;
325
+ }, z.core.$strip>;
326
+ export type MockScenarioResponse = z.infer<typeof mockScenarioResponseSchema>;
327
+ export declare const fixtureListSchema: z.ZodObject<{
328
+ fixtures: z.ZodArray<z.ZodObject<{
329
+ id: z.ZodString;
330
+ description: z.ZodString;
331
+ }, z.core.$strip>>;
332
+ }, z.core.$strip>;
333
+ export type FixtureList = z.infer<typeof fixtureListSchema>;
334
+ export declare const OPERATIONS: readonly [{
335
+ readonly creates: false;
336
+ readonly description: "Reports the service, environment, and build the request reached. Unauthenticated: it carries no customer data and is used by canaries and deployment smoke checks.";
337
+ readonly example: {
338
+ readonly buildSha: "9f2c1ab";
339
+ readonly environment: "development";
340
+ readonly service: "@greatwait/api";
341
+ };
342
+ readonly id: "meta.version";
343
+ readonly idempotent: true;
344
+ readonly mcp: {
345
+ readonly kind: "resource";
346
+ readonly uri: "greatwait://meta/version";
347
+ };
348
+ readonly method: "GET";
349
+ readonly mutates: false;
350
+ readonly path: "/__greatwait/version";
351
+ readonly principals: readonly [];
352
+ readonly problems: readonly [];
353
+ readonly response: z.ZodObject<{
354
+ buildSha: z.ZodString;
355
+ environment: z.ZodString;
356
+ service: z.ZodString;
357
+ }, z.core.$strip>;
358
+ readonly scopes: readonly [];
359
+ readonly summary: "Read the deployed version";
360
+ readonly surfaces: readonly ["api", "mock"];
361
+ }, {
362
+ readonly creates: false;
363
+ readonly description: "Reports the workspace layer this service occupies and the layers it may depend on. Exists so the architecture boundary is observable at runtime, not only at build time.";
364
+ readonly example: {
365
+ readonly dependsOn: readonly ["application", "contract", "platform"];
366
+ readonly layer: "adapter";
367
+ readonly service: "@greatwait/api";
368
+ };
369
+ readonly id: "meta.scaffold";
370
+ readonly idempotent: true;
371
+ readonly mcp: {
372
+ readonly kind: "resource";
373
+ readonly uri: "greatwait://meta/scaffold";
374
+ };
375
+ readonly method: "GET";
376
+ readonly mutates: false;
377
+ readonly path: "/_scaffold";
378
+ readonly principals: readonly [];
379
+ readonly problems: readonly [];
380
+ readonly response: z.ZodObject<{
381
+ dependsOn: z.ZodArray<z.ZodEnum<{
382
+ contract: "contract";
383
+ platform: "platform";
384
+ domain: "domain";
385
+ application: "application";
386
+ adapter: "adapter";
387
+ "test-support": "test-support";
388
+ }>>;
389
+ layer: z.ZodEnum<{
390
+ contract: "contract";
391
+ platform: "platform";
392
+ domain: "domain";
393
+ application: "application";
394
+ adapter: "adapter";
395
+ "test-support": "test-support";
396
+ }>;
397
+ service: z.ZodString;
398
+ }, z.core.$strip>;
399
+ readonly scopes: readonly [];
400
+ readonly summary: "Read the workspace scaffold";
401
+ readonly surfaces: readonly ["api", "mock"];
402
+ }, {
403
+ readonly creates: false;
404
+ readonly description: "Lists the committed contract fixtures the mock can serve. Mock-only: the API has no fixtures.";
405
+ readonly example: {
406
+ readonly fixtures: readonly [{
407
+ readonly description: "The workspace scaffold every service reports.";
408
+ readonly id: "workspace-scaffold";
409
+ }];
410
+ };
411
+ readonly id: "mock.listFixtures";
412
+ readonly idempotent: true;
413
+ readonly mcp: {
414
+ readonly kind: "unavailable";
415
+ readonly reason: "The contract mock's control plane. An agent handed this would call it against the real service.";
416
+ };
417
+ readonly method: "GET";
418
+ readonly mutates: false;
419
+ readonly path: "/_contract/fixtures";
420
+ readonly principals: readonly [];
421
+ readonly problems: readonly [];
422
+ readonly response: z.ZodObject<{
423
+ fixtures: z.ZodArray<z.ZodObject<{
424
+ id: z.ZodString;
425
+ description: z.ZodString;
426
+ }, z.core.$strip>>;
427
+ }, z.core.$strip>;
428
+ readonly scopes: readonly [];
429
+ readonly summary: "List contract fixtures";
430
+ readonly surfaces: readonly ["mock"];
431
+ }, {
432
+ readonly creates: false;
433
+ readonly description: "Serves one committed fixture, byte-identical on every call. Returns a not_found problem for an unknown identifier.";
434
+ readonly example: {
435
+ readonly dependsOn: readonly ["application", "contract", "platform"];
436
+ readonly layer: "adapter";
437
+ readonly service: "@greatwait/contract-mock";
438
+ };
439
+ readonly id: "mock.getFixture";
440
+ readonly idempotent: true;
441
+ readonly mcp: {
442
+ readonly kind: "unavailable";
443
+ readonly reason: "The contract mock's control plane. An agent handed this would call it against the real service.";
444
+ };
445
+ readonly method: "GET";
446
+ readonly mutates: false;
447
+ readonly path: "/_contract/fixtures/{fixtureId}";
448
+ readonly principals: readonly [];
449
+ readonly problems: readonly ["not_found"];
450
+ readonly response: z.ZodObject<{
451
+ dependsOn: z.ZodArray<z.ZodEnum<{
452
+ contract: "contract";
453
+ platform: "platform";
454
+ domain: "domain";
455
+ application: "application";
456
+ adapter: "adapter";
457
+ "test-support": "test-support";
458
+ }>>;
459
+ layer: z.ZodEnum<{
460
+ contract: "contract";
461
+ platform: "platform";
462
+ domain: "domain";
463
+ application: "application";
464
+ adapter: "adapter";
465
+ "test-support": "test-support";
466
+ }>;
467
+ service: z.ZodString;
468
+ }, z.core.$strip>;
469
+ readonly scopes: readonly [];
470
+ readonly summary: "Read a contract fixture";
471
+ readonly surfaces: readonly ["mock"];
472
+ }, {
473
+ readonly creates: true;
474
+ readonly description: "Creates a reusable callback endpoint in the caller's project and environment. The destination must be HTTPS on effective port 443, contain no URL credentials or fragment, and resolve only to public unicast addresses. The endpoint begins pending. Whether delivery waits for its secret-bound ownership challenge is a deployment policy: where the challenge is not required, which is the default, a pending endpoint is delivered to and answering the challenge only records the instant it proved possession; where it is required, attaching a pending endpoint to a schedule is refused endpoint_unverified until the challenge succeeds. A disabled endpoint is never delivered to under either policy, and a schedule write naming one answers not_found, because disabling is terminal rather than a state to recover from. The per-endpoint secret is returned in this response and nowhere else. The 50-record safety ceiling includes disabled endpoints because they remain readable for audit.";
475
+ readonly example: {
476
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
477
+ readonly environmentKind: "test";
478
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
479
+ readonly keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
480
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
481
+ readonly secret: "ptsk_test_<the-one-time-endpoint-secret-here>";
482
+ readonly shownOnce: true;
483
+ readonly signingKeys: {
484
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
485
+ };
486
+ readonly status: "pending";
487
+ readonly updatedAt: "2026-08-05T15:00:00.000Z";
488
+ readonly url: "https://hooks.example.com/greatwait";
489
+ readonly version: 1;
490
+ };
491
+ readonly id: "endpoints.create";
492
+ readonly idempotent: false;
493
+ readonly mcp: {
494
+ readonly kind: "unavailable";
495
+ readonly reason: "Creation returns a one-time endpoint signing secret, and MCP has no negotiated secure-result channel that can keep it out of ordinary tool history.";
496
+ };
497
+ readonly method: "POST";
498
+ readonly mutates: true;
499
+ readonly path: "/v1/endpoints";
500
+ readonly principals: readonly ["api-credential", "oauth", "session"];
501
+ readonly problems: readonly ["invalid_request", "plan_limit_reached", "rate_limited"];
502
+ readonly request: z.ZodObject<{
503
+ url: z.ZodString;
504
+ }, z.core.$strip>;
505
+ readonly requestExample: {
506
+ readonly url: "https://hooks.example.com/greatwait";
507
+ };
508
+ readonly response: z.ZodObject<{
509
+ createdAt: z.ZodString;
510
+ disabledAt: z.ZodOptional<z.ZodString>;
511
+ environmentKind: z.ZodEnum<{
512
+ test: "test";
513
+ live: "live";
514
+ }>;
515
+ id: z.ZodString;
516
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
517
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
518
+ rate_limited: "rate_limited";
519
+ address_forbidden: "address_forbidden";
520
+ challenge_failed: "challenge_failed";
521
+ connection_failed: "connection_failed";
522
+ dns_unresolved: "dns_unresolved";
523
+ redirect_refused: "redirect_refused";
524
+ response_too_large: "response_too_large";
525
+ timed_out: "timed_out";
526
+ unexpected_status: "unexpected_status";
527
+ }>>;
528
+ project: z.ZodString;
529
+ signingKeys: z.ZodObject<{
530
+ current: z.ZodString;
531
+ next: z.ZodOptional<z.ZodObject<{
532
+ id: z.ZodString;
533
+ overlapEndsAt: z.ZodString;
534
+ }, z.core.$strip>>;
535
+ }, z.core.$strip>;
536
+ status: z.ZodEnum<{
537
+ verified: "verified";
538
+ pending: "pending";
539
+ disabled: "disabled";
540
+ }>;
541
+ updatedAt: z.ZodString;
542
+ url: z.ZodString;
543
+ verifiedAt: z.ZodOptional<z.ZodString>;
544
+ version: z.ZodNumber;
545
+ keyId: z.ZodString;
546
+ secret: z.ZodString;
547
+ shownOnce: z.ZodLiteral<true>;
548
+ }, z.core.$strip>;
549
+ readonly scopes: readonly ["endpoints:write"];
550
+ readonly sessionAuthority: "headers";
551
+ readonly summary: "Create a callback endpoint";
552
+ readonly surfaces: readonly ["api", "mock"];
553
+ }, {
554
+ readonly creates: false;
555
+ readonly description: "Lists the caller's callback endpoints for exactly its own project and environment. The result is authoritative and metadata-only: no signing secret or sealed key material has a field in this shape.";
556
+ readonly example: {
557
+ readonly data: readonly [{
558
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
559
+ readonly environmentKind: "test";
560
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
561
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
562
+ readonly signingKeys: {
563
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
564
+ };
565
+ readonly status: "verified";
566
+ readonly updatedAt: "2026-08-05T15:01:00.000Z";
567
+ readonly url: "https://hooks.example.com/greatwait";
568
+ readonly verifiedAt: "2026-08-05T15:01:00.000Z";
569
+ readonly version: 2;
570
+ }];
571
+ readonly freshness: {
572
+ readonly kind: "authoritative";
573
+ };
574
+ };
575
+ readonly id: "endpoints.list";
576
+ readonly idempotent: true;
577
+ readonly mcp: {
578
+ readonly destructive: false;
579
+ readonly kind: "tool";
580
+ readonly openWorld: false;
581
+ };
582
+ readonly method: "GET";
583
+ readonly mutates: false;
584
+ readonly path: "/v1/endpoints";
585
+ readonly principals: readonly ["api-credential", "oauth", "session"];
586
+ readonly problems: readonly ["invalid_request"];
587
+ readonly query: z.ZodObject<{
588
+ cursor: z.ZodOptional<z.ZodString>;
589
+ limit: z.ZodDefault<z.ZodNumber>;
590
+ }, z.core.$strip>;
591
+ readonly response: z.ZodObject<{
592
+ data: z.ZodArray<z.ZodObject<{
593
+ createdAt: z.ZodString;
594
+ disabledAt: z.ZodOptional<z.ZodString>;
595
+ environmentKind: z.ZodEnum<{
596
+ test: "test";
597
+ live: "live";
598
+ }>;
599
+ id: z.ZodString;
600
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
601
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
602
+ rate_limited: "rate_limited";
603
+ address_forbidden: "address_forbidden";
604
+ challenge_failed: "challenge_failed";
605
+ connection_failed: "connection_failed";
606
+ dns_unresolved: "dns_unresolved";
607
+ redirect_refused: "redirect_refused";
608
+ response_too_large: "response_too_large";
609
+ timed_out: "timed_out";
610
+ unexpected_status: "unexpected_status";
611
+ }>>;
612
+ project: z.ZodString;
613
+ signingKeys: z.ZodObject<{
614
+ current: z.ZodString;
615
+ next: z.ZodOptional<z.ZodObject<{
616
+ id: z.ZodString;
617
+ overlapEndsAt: z.ZodString;
618
+ }, z.core.$strip>>;
619
+ }, z.core.$strip>;
620
+ status: z.ZodEnum<{
621
+ verified: "verified";
622
+ pending: "pending";
623
+ disabled: "disabled";
624
+ }>;
625
+ updatedAt: z.ZodString;
626
+ url: z.ZodString;
627
+ verifiedAt: z.ZodOptional<z.ZodString>;
628
+ version: z.ZodNumber;
629
+ }, z.core.$strip>>;
630
+ freshness: z.ZodDiscriminatedUnion<[z.ZodObject<{
631
+ kind: z.ZodLiteral<"authoritative">;
632
+ }, z.core.$strip>, z.ZodObject<{
633
+ asOf: z.ZodString;
634
+ kind: z.ZodLiteral<"projected">;
635
+ lagSeconds: z.ZodNumber;
636
+ }, z.core.$strip>], "kind">;
637
+ nextCursor: z.ZodOptional<z.ZodString>;
638
+ }, z.core.$strip>;
639
+ readonly scopes: readonly ["endpoints:read"];
640
+ readonly sessionAuthority: "headers";
641
+ readonly summary: "List callback endpoints";
642
+ readonly surfaces: readonly ["api", "mock"];
643
+ }, {
644
+ readonly creates: false;
645
+ readonly description: "Reads one callback endpoint from the caller's own project and environment. A well-formed identifier belonging to another authority is indistinguishable from an absent endpoint, and the response never contains secret material.";
646
+ readonly example: {
647
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
648
+ readonly environmentKind: "test";
649
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
650
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
651
+ readonly signingKeys: {
652
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
653
+ };
654
+ readonly status: "verified";
655
+ readonly updatedAt: "2026-08-05T15:01:00.000Z";
656
+ readonly url: "https://hooks.example.com/greatwait";
657
+ readonly verifiedAt: "2026-08-05T15:01:00.000Z";
658
+ readonly version: 2;
659
+ };
660
+ readonly id: "endpoints.read";
661
+ readonly idempotent: true;
662
+ readonly mcp: {
663
+ readonly destructive: false;
664
+ readonly kind: "tool";
665
+ readonly openWorld: false;
666
+ };
667
+ readonly method: "GET";
668
+ readonly mutates: false;
669
+ readonly path: "/v1/endpoints/{endpointId}";
670
+ readonly principals: readonly ["api-credential", "oauth", "session"];
671
+ readonly problems: readonly ["invalid_request", "not_found"];
672
+ readonly response: z.ZodObject<{
673
+ createdAt: z.ZodString;
674
+ disabledAt: z.ZodOptional<z.ZodString>;
675
+ environmentKind: z.ZodEnum<{
676
+ test: "test";
677
+ live: "live";
678
+ }>;
679
+ id: z.ZodString;
680
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
681
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
682
+ rate_limited: "rate_limited";
683
+ address_forbidden: "address_forbidden";
684
+ challenge_failed: "challenge_failed";
685
+ connection_failed: "connection_failed";
686
+ dns_unresolved: "dns_unresolved";
687
+ redirect_refused: "redirect_refused";
688
+ response_too_large: "response_too_large";
689
+ timed_out: "timed_out";
690
+ unexpected_status: "unexpected_status";
691
+ }>>;
692
+ project: z.ZodString;
693
+ signingKeys: z.ZodObject<{
694
+ current: z.ZodString;
695
+ next: z.ZodOptional<z.ZodObject<{
696
+ id: z.ZodString;
697
+ overlapEndsAt: z.ZodString;
698
+ }, z.core.$strip>>;
699
+ }, z.core.$strip>;
700
+ status: z.ZodEnum<{
701
+ verified: "verified";
702
+ pending: "pending";
703
+ disabled: "disabled";
704
+ }>;
705
+ updatedAt: z.ZodString;
706
+ url: z.ZodString;
707
+ verifiedAt: z.ZodOptional<z.ZodString>;
708
+ version: z.ZodNumber;
709
+ }, z.core.$strip>;
710
+ readonly responseHeaders: z.ZodObject<{
711
+ ETag: z.ZodString;
712
+ }, z.core.$strip>;
713
+ readonly scopes: readonly ["endpoints:read"];
714
+ readonly sessionAuthority: "headers";
715
+ readonly summary: "Read a callback endpoint";
716
+ readonly surfaces: readonly ["api", "mock"];
717
+ }, {
718
+ readonly creates: false;
719
+ readonly description: "Replaces an endpoint's destination after applying the complete URL and DNS policy. A changed destination resets verification to pending; the endpoint cannot be used again until ownership of the new URL is proved. Disabled endpoints cannot be updated. Send If-Match with the version the endpoint was read at to be refused rather than overwrite a destination somebody else changed in the meantime.";
720
+ readonly example: {
721
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
722
+ readonly environmentKind: "test";
723
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
724
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
725
+ readonly signingKeys: {
726
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
727
+ };
728
+ readonly status: "pending";
729
+ readonly updatedAt: "2026-08-05T16:00:00.000Z";
730
+ readonly url: "https://hooks.example.com/replacement";
731
+ readonly version: 3;
732
+ };
733
+ readonly id: "endpoints.update";
734
+ readonly idempotent: true;
735
+ readonly mcp: {
736
+ readonly destructive: true;
737
+ readonly kind: "tool";
738
+ readonly openWorld: true;
739
+ };
740
+ readonly method: "PUT";
741
+ readonly mutates: true;
742
+ readonly path: "/v1/endpoints/{endpointId}";
743
+ readonly principals: readonly ["api-credential", "oauth", "session"];
744
+ readonly problems: readonly ["invalid_request", "not_found", "rate_limited", "state_conflict", "version_conflict"];
745
+ readonly request: z.ZodObject<{
746
+ url: z.ZodString;
747
+ }, z.core.$strip>;
748
+ readonly requestExample: {
749
+ readonly url: "https://hooks.example.com/replacement";
750
+ };
751
+ readonly requestHeaders: z.ZodObject<{
752
+ "If-Match": z.ZodOptional<z.ZodString>;
753
+ }, z.core.$strip>;
754
+ readonly response: z.ZodObject<{
755
+ createdAt: z.ZodString;
756
+ disabledAt: z.ZodOptional<z.ZodString>;
757
+ environmentKind: z.ZodEnum<{
758
+ test: "test";
759
+ live: "live";
760
+ }>;
761
+ id: z.ZodString;
762
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
763
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
764
+ rate_limited: "rate_limited";
765
+ address_forbidden: "address_forbidden";
766
+ challenge_failed: "challenge_failed";
767
+ connection_failed: "connection_failed";
768
+ dns_unresolved: "dns_unresolved";
769
+ redirect_refused: "redirect_refused";
770
+ response_too_large: "response_too_large";
771
+ timed_out: "timed_out";
772
+ unexpected_status: "unexpected_status";
773
+ }>>;
774
+ project: z.ZodString;
775
+ signingKeys: z.ZodObject<{
776
+ current: z.ZodString;
777
+ next: z.ZodOptional<z.ZodObject<{
778
+ id: z.ZodString;
779
+ overlapEndsAt: z.ZodString;
780
+ }, z.core.$strip>>;
781
+ }, z.core.$strip>;
782
+ status: z.ZodEnum<{
783
+ verified: "verified";
784
+ pending: "pending";
785
+ disabled: "disabled";
786
+ }>;
787
+ updatedAt: z.ZodString;
788
+ url: z.ZodString;
789
+ verifiedAt: z.ZodOptional<z.ZodString>;
790
+ version: z.ZodNumber;
791
+ }, z.core.$strip>;
792
+ readonly responseHeaders: z.ZodObject<{
793
+ ETag: z.ZodString;
794
+ }, z.core.$strip>;
795
+ readonly scopes: readonly ["endpoints:write"];
796
+ readonly sessionAuthority: "headers";
797
+ readonly summary: "Update a callback endpoint";
798
+ readonly surfaces: readonly ["api", "mock"];
799
+ }, {
800
+ readonly creates: false;
801
+ readonly description: "Re-resolves the endpoint immediately before sending one bounded ownership challenge with redirects disabled. The receiver proves possession of the one-time endpoint secret in its response. A successful challenge marks the endpoint verified; a failed challenge records only a safe failure category. Send If-Match with the version the endpoint was read at to be refused rather than challenge a destination somebody else has since changed.";
802
+ readonly example: {
803
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
804
+ readonly environmentKind: "test";
805
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
806
+ readonly lastVerificationAttemptAt: "2026-08-05T15:01:00.000Z";
807
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
808
+ readonly signingKeys: {
809
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
810
+ };
811
+ readonly status: "verified";
812
+ readonly updatedAt: "2026-08-05T15:01:00.000Z";
813
+ readonly url: "https://hooks.example.com/greatwait";
814
+ readonly verifiedAt: "2026-08-05T15:01:00.000Z";
815
+ readonly version: 2;
816
+ };
817
+ readonly id: "endpoints.verify";
818
+ readonly idempotent: false;
819
+ readonly mcp: {
820
+ readonly destructive: false;
821
+ readonly kind: "tool";
822
+ readonly openWorld: true;
823
+ };
824
+ readonly method: "POST";
825
+ readonly mutates: true;
826
+ readonly path: "/v1/endpoints/{endpointId}/verify";
827
+ readonly principals: readonly ["api-credential", "oauth", "session"];
828
+ readonly problems: readonly ["invalid_request", "not_found", "rate_limited", "state_conflict", "version_conflict"];
829
+ readonly requestHeaders: z.ZodObject<{
830
+ "If-Match": z.ZodOptional<z.ZodString>;
831
+ }, z.core.$strip>;
832
+ readonly response: z.ZodObject<{
833
+ createdAt: z.ZodString;
834
+ disabledAt: z.ZodOptional<z.ZodString>;
835
+ environmentKind: z.ZodEnum<{
836
+ test: "test";
837
+ live: "live";
838
+ }>;
839
+ id: z.ZodString;
840
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
841
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
842
+ rate_limited: "rate_limited";
843
+ address_forbidden: "address_forbidden";
844
+ challenge_failed: "challenge_failed";
845
+ connection_failed: "connection_failed";
846
+ dns_unresolved: "dns_unresolved";
847
+ redirect_refused: "redirect_refused";
848
+ response_too_large: "response_too_large";
849
+ timed_out: "timed_out";
850
+ unexpected_status: "unexpected_status";
851
+ }>>;
852
+ project: z.ZodString;
853
+ signingKeys: z.ZodObject<{
854
+ current: z.ZodString;
855
+ next: z.ZodOptional<z.ZodObject<{
856
+ id: z.ZodString;
857
+ overlapEndsAt: z.ZodString;
858
+ }, z.core.$strip>>;
859
+ }, z.core.$strip>;
860
+ status: z.ZodEnum<{
861
+ verified: "verified";
862
+ pending: "pending";
863
+ disabled: "disabled";
864
+ }>;
865
+ updatedAt: z.ZodString;
866
+ url: z.ZodString;
867
+ verifiedAt: z.ZodOptional<z.ZodString>;
868
+ version: z.ZodNumber;
869
+ }, z.core.$strip>;
870
+ readonly responseHeaders: z.ZodObject<{
871
+ ETag: z.ZodString;
872
+ }, z.core.$strip>;
873
+ readonly scopes: readonly ["endpoints:write"];
874
+ readonly sessionAuthority: "headers";
875
+ readonly summary: "Verify callback endpoint ownership";
876
+ readonly surfaces: readonly ["api", "mock"];
877
+ }, {
878
+ readonly creates: true;
879
+ readonly description: "Creates the next endpoint signing key and selects it immediately for new deliveries while retaining the current key in the receiver acceptance set for a bounded overlap. The overlap defaults to and cannot exceed 24 hours. A second rotation is refused until the current overlap ends. The new secret is returned once and has no recovery operation, so a call whose answer was never read may have rotated a key nobody holds: read the endpoint and compare its signing keys before repeating one. Send If-Match with the version the endpoint was read at to be refused rather than rotate an endpoint that has changed since.";
880
+ readonly example: {
881
+ readonly endpoint: {
882
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
883
+ readonly environmentKind: "test";
884
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
885
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
886
+ readonly signingKeys: {
887
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
888
+ readonly next: {
889
+ readonly id: "csk_11h8xyz9k2m4n6p8r0t2v4w6y8";
890
+ readonly overlapEndsAt: "2026-08-06T15:05:00.000Z";
891
+ };
892
+ };
893
+ readonly status: "verified";
894
+ readonly updatedAt: "2026-08-05T15:05:00.000Z";
895
+ readonly url: "https://hooks.example.com/greatwait";
896
+ readonly verifiedAt: "2026-08-05T15:01:00.000Z";
897
+ readonly version: 3;
898
+ };
899
+ readonly keyId: "csk_11h8xyz9k2m4n6p8r0t2v4w6y8";
900
+ readonly secret: "ptsk_test_<the-next-one-time-endpoint-secret-here>";
901
+ readonly shownOnce: true;
902
+ };
903
+ readonly id: "endpoints.rotateSigningKey";
904
+ readonly idempotent: false;
905
+ readonly mcp: {
906
+ readonly kind: "unavailable";
907
+ readonly reason: "Rotation returns a one-time endpoint signing secret, and MCP has no negotiated secure-result channel that can keep it out of ordinary tool history.";
908
+ };
909
+ readonly method: "POST";
910
+ readonly mutates: true;
911
+ readonly path: "/v1/endpoints/{endpointId}/signing-keys/rotate";
912
+ readonly principals: readonly ["api-credential", "oauth", "session"];
913
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict", "version_conflict"];
914
+ readonly request: z.ZodObject<{
915
+ overlapSeconds: z.ZodOptional<z.ZodNumber>;
916
+ }, z.core.$strip>;
917
+ readonly requestExample: {
918
+ readonly overlapSeconds: 3600;
919
+ };
920
+ readonly requestHeaders: z.ZodObject<{
921
+ "If-Match": z.ZodOptional<z.ZodString>;
922
+ }, z.core.$strip>;
923
+ readonly response: z.ZodObject<{
924
+ endpoint: z.ZodObject<{
925
+ createdAt: z.ZodString;
926
+ disabledAt: z.ZodOptional<z.ZodString>;
927
+ environmentKind: z.ZodEnum<{
928
+ test: "test";
929
+ live: "live";
930
+ }>;
931
+ id: z.ZodString;
932
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
933
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
934
+ rate_limited: "rate_limited";
935
+ address_forbidden: "address_forbidden";
936
+ challenge_failed: "challenge_failed";
937
+ connection_failed: "connection_failed";
938
+ dns_unresolved: "dns_unresolved";
939
+ redirect_refused: "redirect_refused";
940
+ response_too_large: "response_too_large";
941
+ timed_out: "timed_out";
942
+ unexpected_status: "unexpected_status";
943
+ }>>;
944
+ project: z.ZodString;
945
+ signingKeys: z.ZodObject<{
946
+ current: z.ZodString;
947
+ next: z.ZodOptional<z.ZodObject<{
948
+ id: z.ZodString;
949
+ overlapEndsAt: z.ZodString;
950
+ }, z.core.$strip>>;
951
+ }, z.core.$strip>;
952
+ status: z.ZodEnum<{
953
+ verified: "verified";
954
+ pending: "pending";
955
+ disabled: "disabled";
956
+ }>;
957
+ updatedAt: z.ZodString;
958
+ url: z.ZodString;
959
+ verifiedAt: z.ZodOptional<z.ZodString>;
960
+ version: z.ZodNumber;
961
+ }, z.core.$strip>;
962
+ keyId: z.ZodString;
963
+ secret: z.ZodString;
964
+ shownOnce: z.ZodLiteral<true>;
965
+ }, z.core.$strip>;
966
+ readonly responseHeaders: z.ZodObject<{
967
+ ETag: z.ZodString;
968
+ }, z.core.$strip>;
969
+ readonly scopes: readonly ["endpoints:write"];
970
+ readonly sessionAuthority: "headers";
971
+ readonly summary: "Rotate a callback endpoint signing key";
972
+ readonly surfaces: readonly ["api", "mock"];
973
+ }, {
974
+ readonly creates: false;
975
+ readonly description: "Disables an endpoint immediately and permanently: there is no operation that re-enables one. It stays readable for audit but is no longer eligible for update, verification or callback send admission, and schedules pointed at it deliver nothing. Repeating the disable is idempotent and does not write a second audit event, which is why it takes no precondition — the outcome does not depend on what else has changed.";
976
+ readonly example: {
977
+ readonly createdAt: "2026-08-05T15:00:00.000Z";
978
+ readonly disabledAt: "2026-08-05T17:00:00.000Z";
979
+ readonly environmentKind: "test";
980
+ readonly id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
981
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
982
+ readonly signingKeys: {
983
+ readonly current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
984
+ };
985
+ readonly status: "disabled";
986
+ readonly updatedAt: "2026-08-05T17:00:00.000Z";
987
+ readonly url: "https://hooks.example.com/greatwait";
988
+ readonly verifiedAt: "2026-08-05T15:01:00.000Z";
989
+ readonly version: 3;
990
+ };
991
+ readonly id: "endpoints.disable";
992
+ readonly idempotent: true;
993
+ readonly mcp: {
994
+ readonly destructive: true;
995
+ readonly kind: "tool";
996
+ readonly openWorld: false;
997
+ };
998
+ readonly method: "DELETE";
999
+ readonly mutates: true;
1000
+ readonly path: "/v1/endpoints/{endpointId}";
1001
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1002
+ readonly problems: readonly ["invalid_request", "not_found"];
1003
+ readonly response: z.ZodObject<{
1004
+ createdAt: z.ZodString;
1005
+ disabledAt: z.ZodOptional<z.ZodString>;
1006
+ environmentKind: z.ZodEnum<{
1007
+ test: "test";
1008
+ live: "live";
1009
+ }>;
1010
+ id: z.ZodString;
1011
+ lastVerificationAttemptAt: z.ZodOptional<z.ZodString>;
1012
+ lastVerificationFailure: z.ZodOptional<z.ZodEnum<{
1013
+ rate_limited: "rate_limited";
1014
+ address_forbidden: "address_forbidden";
1015
+ challenge_failed: "challenge_failed";
1016
+ connection_failed: "connection_failed";
1017
+ dns_unresolved: "dns_unresolved";
1018
+ redirect_refused: "redirect_refused";
1019
+ response_too_large: "response_too_large";
1020
+ timed_out: "timed_out";
1021
+ unexpected_status: "unexpected_status";
1022
+ }>>;
1023
+ project: z.ZodString;
1024
+ signingKeys: z.ZodObject<{
1025
+ current: z.ZodString;
1026
+ next: z.ZodOptional<z.ZodObject<{
1027
+ id: z.ZodString;
1028
+ overlapEndsAt: z.ZodString;
1029
+ }, z.core.$strip>>;
1030
+ }, z.core.$strip>;
1031
+ status: z.ZodEnum<{
1032
+ verified: "verified";
1033
+ pending: "pending";
1034
+ disabled: "disabled";
1035
+ }>;
1036
+ updatedAt: z.ZodString;
1037
+ url: z.ZodString;
1038
+ verifiedAt: z.ZodOptional<z.ZodString>;
1039
+ version: z.ZodNumber;
1040
+ }, z.core.$strip>;
1041
+ readonly responseHeaders: z.ZodObject<{
1042
+ ETag: z.ZodString;
1043
+ }, z.core.$strip>;
1044
+ readonly scopes: readonly ["endpoints:write"];
1045
+ readonly sessionAuthority: "headers";
1046
+ readonly summary: "Disable a callback endpoint";
1047
+ readonly surfaces: readonly ["api", "mock"];
1048
+ }, {
1049
+ readonly creates: true;
1050
+ readonly description: "Creates a deterministic receiver for one callback endpoint so failures can be rehearsed before they happen in production. Test environments only: a live principal has no such operation, and there is no request field that could widen the organization, project, or environment the sink belongs to. The sink verifies deliveries with the bound endpoint's own signing keys, so key rotation and a wrong key behave here exactly as they would at the customer's receiver. It receives and never sends: no field names a destination and no configuration makes it forward a delivery. Point the endpoint at the returned url and verify it, and every attempt lands here.";
1051
+ readonly example: {
1052
+ readonly createdAt: "2026-08-07T15:00:00.000Z";
1053
+ readonly deliveryCount: 0;
1054
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
1055
+ readonly environmentKind: "test";
1056
+ readonly id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1057
+ readonly program: {
1058
+ readonly behavior: "success";
1059
+ };
1060
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1061
+ readonly updatedAt: "2026-08-07T15:00:00.000Z";
1062
+ readonly url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1063
+ };
1064
+ readonly id: "testsinks.create";
1065
+ readonly idempotent: false;
1066
+ readonly mcp: {
1067
+ readonly destructive: false;
1068
+ readonly kind: "tool";
1069
+ readonly openWorld: false;
1070
+ };
1071
+ readonly method: "POST";
1072
+ readonly mutates: true;
1073
+ readonly path: "/v1/test-sinks";
1074
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1075
+ readonly problems: readonly ["invalid_request", "not_found", "plan_limit_reached", "state_conflict"];
1076
+ readonly request: z.ZodObject<{
1077
+ endpoint: z.ZodString;
1078
+ program: z.ZodOptional<z.ZodObject<{
1079
+ behavior: z.ZodEnum<{
1080
+ rate_limited: "rate_limited";
1081
+ success: "success";
1082
+ server_error: "server_error";
1083
+ client_error: "client_error";
1084
+ defer_abandon: "defer_abandon";
1085
+ defer_fail: "defer_fail";
1086
+ defer_succeed: "defer_succeed";
1087
+ delay: "delay";
1088
+ disconnect: "disconnect";
1089
+ duplicate: "duplicate";
1090
+ invalid_signature: "invalid_signature";
1091
+ timeout: "timeout";
1092
+ }>;
1093
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1094
+ delayMs: z.ZodOptional<z.ZodNumber>;
1095
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1096
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1097
+ status: z.ZodOptional<z.ZodNumber>;
1098
+ then: z.ZodOptional<z.ZodEnum<{
1099
+ rate_limited: "rate_limited";
1100
+ success: "success";
1101
+ server_error: "server_error";
1102
+ client_error: "client_error";
1103
+ defer_abandon: "defer_abandon";
1104
+ defer_fail: "defer_fail";
1105
+ defer_succeed: "defer_succeed";
1106
+ delay: "delay";
1107
+ disconnect: "disconnect";
1108
+ duplicate: "duplicate";
1109
+ invalid_signature: "invalid_signature";
1110
+ timeout: "timeout";
1111
+ }>>;
1112
+ }, z.core.$strip>>;
1113
+ }, z.core.$strip>;
1114
+ readonly requestExample: {
1115
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
1116
+ readonly program: {
1117
+ readonly behavior: "server_error";
1118
+ readonly forDeliveries: 2;
1119
+ readonly then: "success";
1120
+ };
1121
+ };
1122
+ readonly response: z.ZodObject<{
1123
+ createdAt: z.ZodString;
1124
+ deliveryCount: z.ZodNumber;
1125
+ endpoint: z.ZodString;
1126
+ environmentKind: z.ZodLiteral<"test">;
1127
+ id: z.ZodString;
1128
+ program: z.ZodObject<{
1129
+ behavior: z.ZodEnum<{
1130
+ rate_limited: "rate_limited";
1131
+ success: "success";
1132
+ server_error: "server_error";
1133
+ client_error: "client_error";
1134
+ defer_abandon: "defer_abandon";
1135
+ defer_fail: "defer_fail";
1136
+ defer_succeed: "defer_succeed";
1137
+ delay: "delay";
1138
+ disconnect: "disconnect";
1139
+ duplicate: "duplicate";
1140
+ invalid_signature: "invalid_signature";
1141
+ timeout: "timeout";
1142
+ }>;
1143
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1144
+ delayMs: z.ZodOptional<z.ZodNumber>;
1145
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1146
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1147
+ status: z.ZodOptional<z.ZodNumber>;
1148
+ then: z.ZodOptional<z.ZodEnum<{
1149
+ rate_limited: "rate_limited";
1150
+ success: "success";
1151
+ server_error: "server_error";
1152
+ client_error: "client_error";
1153
+ defer_abandon: "defer_abandon";
1154
+ defer_fail: "defer_fail";
1155
+ defer_succeed: "defer_succeed";
1156
+ delay: "delay";
1157
+ disconnect: "disconnect";
1158
+ duplicate: "duplicate";
1159
+ invalid_signature: "invalid_signature";
1160
+ timeout: "timeout";
1161
+ }>>;
1162
+ }, z.core.$strip>;
1163
+ project: z.ZodString;
1164
+ updatedAt: z.ZodString;
1165
+ url: z.ZodURL;
1166
+ }, z.core.$strip>;
1167
+ readonly scopes: readonly ["endpoints:write"];
1168
+ readonly sessionAuthority: "headers";
1169
+ readonly summary: "Create a test sink";
1170
+ readonly surfaces: readonly ["api", "mock"];
1171
+ }, {
1172
+ readonly creates: false;
1173
+ readonly description: "Lists the caller's test sinks for exactly its own project and test environment. A live principal receives an empty-handed refusal rather than another environment's sinks.";
1174
+ readonly example: {
1175
+ readonly data: readonly [{
1176
+ readonly createdAt: "2026-08-07T15:00:00.000Z";
1177
+ readonly deliveryCount: 3;
1178
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
1179
+ readonly environmentKind: "test";
1180
+ readonly id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1181
+ readonly program: {
1182
+ readonly behavior: "success";
1183
+ };
1184
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1185
+ readonly updatedAt: "2026-08-07T15:02:00.000Z";
1186
+ readonly url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1187
+ }];
1188
+ readonly freshness: {
1189
+ readonly kind: "authoritative";
1190
+ };
1191
+ };
1192
+ readonly id: "testsinks.list";
1193
+ readonly idempotent: true;
1194
+ readonly mcp: {
1195
+ readonly destructive: false;
1196
+ readonly kind: "tool";
1197
+ readonly openWorld: false;
1198
+ };
1199
+ readonly method: "GET";
1200
+ readonly mutates: false;
1201
+ readonly path: "/v1/test-sinks";
1202
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1203
+ readonly problems: readonly ["invalid_request", "state_conflict"];
1204
+ readonly query: z.ZodObject<{
1205
+ cursor: z.ZodOptional<z.ZodString>;
1206
+ limit: z.ZodDefault<z.ZodNumber>;
1207
+ }, z.core.$strip>;
1208
+ readonly response: z.ZodObject<{
1209
+ data: z.ZodArray<z.ZodObject<{
1210
+ createdAt: z.ZodString;
1211
+ deliveryCount: z.ZodNumber;
1212
+ endpoint: z.ZodString;
1213
+ environmentKind: z.ZodLiteral<"test">;
1214
+ id: z.ZodString;
1215
+ program: z.ZodObject<{
1216
+ behavior: z.ZodEnum<{
1217
+ rate_limited: "rate_limited";
1218
+ success: "success";
1219
+ server_error: "server_error";
1220
+ client_error: "client_error";
1221
+ defer_abandon: "defer_abandon";
1222
+ defer_fail: "defer_fail";
1223
+ defer_succeed: "defer_succeed";
1224
+ delay: "delay";
1225
+ disconnect: "disconnect";
1226
+ duplicate: "duplicate";
1227
+ invalid_signature: "invalid_signature";
1228
+ timeout: "timeout";
1229
+ }>;
1230
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1231
+ delayMs: z.ZodOptional<z.ZodNumber>;
1232
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1233
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1234
+ status: z.ZodOptional<z.ZodNumber>;
1235
+ then: z.ZodOptional<z.ZodEnum<{
1236
+ rate_limited: "rate_limited";
1237
+ success: "success";
1238
+ server_error: "server_error";
1239
+ client_error: "client_error";
1240
+ defer_abandon: "defer_abandon";
1241
+ defer_fail: "defer_fail";
1242
+ defer_succeed: "defer_succeed";
1243
+ delay: "delay";
1244
+ disconnect: "disconnect";
1245
+ duplicate: "duplicate";
1246
+ invalid_signature: "invalid_signature";
1247
+ timeout: "timeout";
1248
+ }>>;
1249
+ }, z.core.$strip>;
1250
+ project: z.ZodString;
1251
+ updatedAt: z.ZodString;
1252
+ url: z.ZodURL;
1253
+ }, z.core.$strip>>;
1254
+ freshness: z.ZodDiscriminatedUnion<[z.ZodObject<{
1255
+ kind: z.ZodLiteral<"authoritative">;
1256
+ }, z.core.$strip>, z.ZodObject<{
1257
+ asOf: z.ZodString;
1258
+ kind: z.ZodLiteral<"projected">;
1259
+ lagSeconds: z.ZodNumber;
1260
+ }, z.core.$strip>], "kind">;
1261
+ nextCursor: z.ZodOptional<z.ZodString>;
1262
+ }, z.core.$strip>;
1263
+ readonly scopes: readonly ["endpoints:read"];
1264
+ readonly sessionAuthority: "headers";
1265
+ readonly summary: "List test sinks";
1266
+ readonly surfaces: readonly ["api", "mock"];
1267
+ }, {
1268
+ readonly creates: false;
1269
+ readonly description: "Reads one test sink from the caller's own project and test environment, including how many deliveries it has taken. A well-formed identifier belonging to another authority is indistinguishable from an absent sink.";
1270
+ readonly example: {
1271
+ readonly createdAt: "2026-08-07T15:00:00.000Z";
1272
+ readonly deliveryCount: 3;
1273
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
1274
+ readonly environmentKind: "test";
1275
+ readonly id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1276
+ readonly program: {
1277
+ readonly behavior: "rate_limited";
1278
+ readonly retryAfterSeconds: 5;
1279
+ };
1280
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1281
+ readonly updatedAt: "2026-08-07T15:02:00.000Z";
1282
+ readonly url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1283
+ };
1284
+ readonly id: "testsinks.read";
1285
+ readonly idempotent: true;
1286
+ readonly mcp: {
1287
+ readonly destructive: false;
1288
+ readonly kind: "tool";
1289
+ readonly openWorld: false;
1290
+ };
1291
+ readonly method: "GET";
1292
+ readonly mutates: false;
1293
+ readonly path: "/v1/test-sinks/{sinkId}";
1294
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1295
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict"];
1296
+ readonly response: z.ZodObject<{
1297
+ createdAt: z.ZodString;
1298
+ deliveryCount: z.ZodNumber;
1299
+ endpoint: z.ZodString;
1300
+ environmentKind: z.ZodLiteral<"test">;
1301
+ id: z.ZodString;
1302
+ program: z.ZodObject<{
1303
+ behavior: z.ZodEnum<{
1304
+ rate_limited: "rate_limited";
1305
+ success: "success";
1306
+ server_error: "server_error";
1307
+ client_error: "client_error";
1308
+ defer_abandon: "defer_abandon";
1309
+ defer_fail: "defer_fail";
1310
+ defer_succeed: "defer_succeed";
1311
+ delay: "delay";
1312
+ disconnect: "disconnect";
1313
+ duplicate: "duplicate";
1314
+ invalid_signature: "invalid_signature";
1315
+ timeout: "timeout";
1316
+ }>;
1317
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1318
+ delayMs: z.ZodOptional<z.ZodNumber>;
1319
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1320
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1321
+ status: z.ZodOptional<z.ZodNumber>;
1322
+ then: z.ZodOptional<z.ZodEnum<{
1323
+ rate_limited: "rate_limited";
1324
+ success: "success";
1325
+ server_error: "server_error";
1326
+ client_error: "client_error";
1327
+ defer_abandon: "defer_abandon";
1328
+ defer_fail: "defer_fail";
1329
+ defer_succeed: "defer_succeed";
1330
+ delay: "delay";
1331
+ disconnect: "disconnect";
1332
+ duplicate: "duplicate";
1333
+ invalid_signature: "invalid_signature";
1334
+ timeout: "timeout";
1335
+ }>>;
1336
+ }, z.core.$strip>;
1337
+ project: z.ZodString;
1338
+ updatedAt: z.ZodString;
1339
+ url: z.ZodURL;
1340
+ }, z.core.$strip>;
1341
+ readonly scopes: readonly ["endpoints:read"];
1342
+ readonly sessionAuthority: "headers";
1343
+ readonly summary: "Read a test sink";
1344
+ readonly surfaces: readonly ["api", "mock"];
1345
+ }, {
1346
+ readonly creates: false;
1347
+ readonly description: "Replaces a sink's behavior program. The program is resolved against the number of deliveries the sink has already taken, so `forDeliveries` counts from the next delivery rather than from the sink's creation. Repeating the identical program is idempotent and changes nothing an integrator can observe.";
1348
+ readonly example: {
1349
+ readonly createdAt: "2026-08-07T15:00:00.000Z";
1350
+ readonly deliveryCount: 3;
1351
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
1352
+ readonly environmentKind: "test";
1353
+ readonly id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1354
+ readonly program: {
1355
+ readonly behavior: "timeout";
1356
+ };
1357
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1358
+ readonly updatedAt: "2026-08-07T15:03:00.000Z";
1359
+ readonly url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1360
+ };
1361
+ readonly id: "testsinks.configure";
1362
+ readonly idempotent: true;
1363
+ readonly mcp: {
1364
+ readonly destructive: false;
1365
+ readonly kind: "tool";
1366
+ readonly openWorld: false;
1367
+ };
1368
+ readonly method: "PUT";
1369
+ readonly mutates: true;
1370
+ readonly path: "/v1/test-sinks/{sinkId}/program";
1371
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1372
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict"];
1373
+ readonly request: z.ZodObject<{
1374
+ behavior: z.ZodEnum<{
1375
+ rate_limited: "rate_limited";
1376
+ success: "success";
1377
+ server_error: "server_error";
1378
+ client_error: "client_error";
1379
+ defer_abandon: "defer_abandon";
1380
+ defer_fail: "defer_fail";
1381
+ defer_succeed: "defer_succeed";
1382
+ delay: "delay";
1383
+ disconnect: "disconnect";
1384
+ duplicate: "duplicate";
1385
+ invalid_signature: "invalid_signature";
1386
+ timeout: "timeout";
1387
+ }>;
1388
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1389
+ delayMs: z.ZodOptional<z.ZodNumber>;
1390
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1391
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1392
+ status: z.ZodOptional<z.ZodNumber>;
1393
+ then: z.ZodOptional<z.ZodEnum<{
1394
+ rate_limited: "rate_limited";
1395
+ success: "success";
1396
+ server_error: "server_error";
1397
+ client_error: "client_error";
1398
+ defer_abandon: "defer_abandon";
1399
+ defer_fail: "defer_fail";
1400
+ defer_succeed: "defer_succeed";
1401
+ delay: "delay";
1402
+ disconnect: "disconnect";
1403
+ duplicate: "duplicate";
1404
+ invalid_signature: "invalid_signature";
1405
+ timeout: "timeout";
1406
+ }>>;
1407
+ }, z.core.$strip>;
1408
+ readonly requestExample: {
1409
+ readonly behavior: "timeout";
1410
+ };
1411
+ readonly response: z.ZodObject<{
1412
+ createdAt: z.ZodString;
1413
+ deliveryCount: z.ZodNumber;
1414
+ endpoint: z.ZodString;
1415
+ environmentKind: z.ZodLiteral<"test">;
1416
+ id: z.ZodString;
1417
+ program: z.ZodObject<{
1418
+ behavior: z.ZodEnum<{
1419
+ rate_limited: "rate_limited";
1420
+ success: "success";
1421
+ server_error: "server_error";
1422
+ client_error: "client_error";
1423
+ defer_abandon: "defer_abandon";
1424
+ defer_fail: "defer_fail";
1425
+ defer_succeed: "defer_succeed";
1426
+ delay: "delay";
1427
+ disconnect: "disconnect";
1428
+ duplicate: "duplicate";
1429
+ invalid_signature: "invalid_signature";
1430
+ timeout: "timeout";
1431
+ }>;
1432
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1433
+ delayMs: z.ZodOptional<z.ZodNumber>;
1434
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1435
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1436
+ status: z.ZodOptional<z.ZodNumber>;
1437
+ then: z.ZodOptional<z.ZodEnum<{
1438
+ rate_limited: "rate_limited";
1439
+ success: "success";
1440
+ server_error: "server_error";
1441
+ client_error: "client_error";
1442
+ defer_abandon: "defer_abandon";
1443
+ defer_fail: "defer_fail";
1444
+ defer_succeed: "defer_succeed";
1445
+ delay: "delay";
1446
+ disconnect: "disconnect";
1447
+ duplicate: "duplicate";
1448
+ invalid_signature: "invalid_signature";
1449
+ timeout: "timeout";
1450
+ }>>;
1451
+ }, z.core.$strip>;
1452
+ project: z.ZodString;
1453
+ updatedAt: z.ZodString;
1454
+ url: z.ZodURL;
1455
+ }, z.core.$strip>;
1456
+ readonly scopes: readonly ["endpoints:write"];
1457
+ readonly sessionAuthority: "headers";
1458
+ readonly summary: "Set a test sink behavior program";
1459
+ readonly surfaces: readonly ["api", "mock"];
1460
+ }, {
1461
+ readonly creates: false;
1462
+ readonly description: "Lists what the sink received, most recent first with the record identifier breaking a tie, bounded by the retained-delivery ceiling. Metadata only: the identifiers, the signing key that authenticated the delivery, how the receiver disposed of it, and what it answered. The delivered body is not in this shape.";
1463
+ readonly example: {
1464
+ readonly data: readonly [{
1465
+ readonly behavior: "success";
1466
+ readonly delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8";
1467
+ readonly disposition: "processed";
1468
+ readonly id: "tsd_01h8xyz9k2m4n6p8r0t2v4w6y8";
1469
+ readonly keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1470
+ readonly occurrenceId: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
1471
+ readonly receivedAt: "2026-08-07T15:02:00.000Z";
1472
+ readonly respondedWith: 200;
1473
+ readonly scheduleId: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
1474
+ readonly sink: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1475
+ }];
1476
+ readonly freshness: {
1477
+ readonly kind: "authoritative";
1478
+ };
1479
+ };
1480
+ readonly id: "sinkdeliveries.list";
1481
+ readonly idempotent: true;
1482
+ readonly mcp: {
1483
+ readonly destructive: false;
1484
+ readonly kind: "tool";
1485
+ readonly openWorld: false;
1486
+ };
1487
+ readonly method: "GET";
1488
+ readonly mutates: false;
1489
+ readonly path: "/v1/test-sinks/{sinkId}/deliveries";
1490
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1491
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict"];
1492
+ readonly query: z.ZodObject<{
1493
+ cursor: z.ZodOptional<z.ZodString>;
1494
+ limit: z.ZodDefault<z.ZodNumber>;
1495
+ }, z.core.$strip>;
1496
+ readonly response: z.ZodObject<{
1497
+ data: z.ZodArray<z.ZodObject<{
1498
+ behavior: z.ZodEnum<{
1499
+ rate_limited: "rate_limited";
1500
+ success: "success";
1501
+ server_error: "server_error";
1502
+ client_error: "client_error";
1503
+ defer_abandon: "defer_abandon";
1504
+ defer_fail: "defer_fail";
1505
+ defer_succeed: "defer_succeed";
1506
+ delay: "delay";
1507
+ disconnect: "disconnect";
1508
+ duplicate: "duplicate";
1509
+ invalid_signature: "invalid_signature";
1510
+ timeout: "timeout";
1511
+ }>;
1512
+ disposition: z.ZodEnum<{
1513
+ duplicate: "duplicate";
1514
+ invalid_signature: "invalid_signature";
1515
+ body_too_large: "body_too_large";
1516
+ handler_failed: "handler_failed";
1517
+ in_flight: "in_flight";
1518
+ invalid_envelope: "invalid_envelope";
1519
+ invalid_headers: "invalid_headers";
1520
+ processed: "processed";
1521
+ replay: "replay";
1522
+ stale_timestamp: "stale_timestamp";
1523
+ connection_dropped: "connection_dropped";
1524
+ }>;
1525
+ delivery: z.ZodString;
1526
+ id: z.ZodString;
1527
+ keyId: z.ZodOptional<z.ZodString>;
1528
+ occurrenceId: z.ZodOptional<z.ZodString>;
1529
+ receivedAt: z.ZodString;
1530
+ respondedWith: z.ZodOptional<z.ZodNumber>;
1531
+ scheduleId: z.ZodOptional<z.ZodString>;
1532
+ sink: z.ZodString;
1533
+ }, z.core.$strip>>;
1534
+ freshness: z.ZodDiscriminatedUnion<[z.ZodObject<{
1535
+ kind: z.ZodLiteral<"authoritative">;
1536
+ }, z.core.$strip>, z.ZodObject<{
1537
+ asOf: z.ZodString;
1538
+ kind: z.ZodLiteral<"projected">;
1539
+ lagSeconds: z.ZodNumber;
1540
+ }, z.core.$strip>], "kind">;
1541
+ nextCursor: z.ZodOptional<z.ZodString>;
1542
+ }, z.core.$strip>;
1543
+ readonly scopes: readonly ["endpoints:read"];
1544
+ readonly sessionAuthority: "headers";
1545
+ readonly summary: "List test sink deliveries";
1546
+ readonly surfaces: readonly ["api", "mock"];
1547
+ }, {
1548
+ readonly creates: false;
1549
+ readonly description: "Reads one recorded delivery including the exact bytes that arrived, truncated at the published cap with the original length stated. This is the one place a callback body is readable, and it is narrow on purpose: a test environment only, the creating authority only, a single record rather than a listing, and never a log. The signature is included because a MAC is not secret and comparing it against a locally computed one is how a body-mutation bug is found; no signing key appears in this shape.";
1550
+ readonly example: {
1551
+ readonly behavior: "success";
1552
+ readonly body: "{\"version\":\"2026-08-08\",\"type\":\"schedule.occurrence\",\"scheduleId\":\"sch_01h8xyz9k2m4n6p8r0t2v4w6y8\",\"occurrenceId\":\"occ_01h8xyz9k2m4n6p8r0t2v4w6y8\",\"plannedFor\":\"2026-08-07T15:00:00.000Z\",\"attempt\":1,\"trigger\":{\"kind\":\"automatic\"},\"data\":{}}";
1553
+ readonly bodyTruncated: false;
1554
+ readonly delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8";
1555
+ readonly disposition: "processed";
1556
+ readonly id: "tsd_01h8xyz9k2m4n6p8r0t2v4w6y8";
1557
+ readonly keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1558
+ readonly occurrenceId: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
1559
+ readonly receivedAt: "2026-08-07T15:02:00.000Z";
1560
+ readonly receivedBytes: 240;
1561
+ readonly respondedWith: 200;
1562
+ readonly scheduleId: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
1563
+ readonly signature: "v1=11135fdfc0bc5d49ebcc9d3a0d8df1116179097cefe961c6eca281339e5cfab3";
1564
+ readonly sink: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1565
+ };
1566
+ readonly id: "sinkdeliveries.read";
1567
+ readonly idempotent: true;
1568
+ readonly mcp: {
1569
+ readonly kind: "unavailable";
1570
+ readonly reason: "The only operation that returns a delivered callback body. An agent handed it would put customer payload into ordinary tool history, which is the disclosure the narrow exception was written to avoid.";
1571
+ };
1572
+ readonly method: "GET";
1573
+ readonly mutates: false;
1574
+ readonly path: "/v1/test-sinks/{sinkId}/deliveries/{deliveryRecordId}";
1575
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1576
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict"];
1577
+ readonly response: z.ZodObject<{
1578
+ behavior: z.ZodEnum<{
1579
+ rate_limited: "rate_limited";
1580
+ success: "success";
1581
+ server_error: "server_error";
1582
+ client_error: "client_error";
1583
+ defer_abandon: "defer_abandon";
1584
+ defer_fail: "defer_fail";
1585
+ defer_succeed: "defer_succeed";
1586
+ delay: "delay";
1587
+ disconnect: "disconnect";
1588
+ duplicate: "duplicate";
1589
+ invalid_signature: "invalid_signature";
1590
+ timeout: "timeout";
1591
+ }>;
1592
+ disposition: z.ZodEnum<{
1593
+ duplicate: "duplicate";
1594
+ invalid_signature: "invalid_signature";
1595
+ body_too_large: "body_too_large";
1596
+ handler_failed: "handler_failed";
1597
+ in_flight: "in_flight";
1598
+ invalid_envelope: "invalid_envelope";
1599
+ invalid_headers: "invalid_headers";
1600
+ processed: "processed";
1601
+ replay: "replay";
1602
+ stale_timestamp: "stale_timestamp";
1603
+ connection_dropped: "connection_dropped";
1604
+ }>;
1605
+ delivery: z.ZodString;
1606
+ id: z.ZodString;
1607
+ keyId: z.ZodOptional<z.ZodString>;
1608
+ occurrenceId: z.ZodOptional<z.ZodString>;
1609
+ receivedAt: z.ZodString;
1610
+ respondedWith: z.ZodOptional<z.ZodNumber>;
1611
+ scheduleId: z.ZodOptional<z.ZodString>;
1612
+ sink: z.ZodString;
1613
+ body: z.ZodString;
1614
+ bodyTruncated: z.ZodBoolean;
1615
+ receivedBytes: z.ZodNumber;
1616
+ signature: z.ZodOptional<z.ZodString>;
1617
+ }, z.core.$strip>;
1618
+ readonly scopes: readonly ["endpoints:read"];
1619
+ readonly sessionAuthority: "headers";
1620
+ readonly summary: "Read a test sink delivery";
1621
+ readonly surfaces: readonly ["api", "mock"];
1622
+ }, {
1623
+ readonly creates: false;
1624
+ readonly description: "Deletes a sink and every delivery it recorded. The bound callback endpoint is untouched and keeps its signing keys; deliveries sent afterwards find nothing at the url and fail the way an unreachable receiver does.";
1625
+ readonly example: {
1626
+ readonly createdAt: "2026-08-07T15:00:00.000Z";
1627
+ readonly deliveryCount: 3;
1628
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
1629
+ readonly environmentKind: "test";
1630
+ readonly id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1631
+ readonly program: {
1632
+ readonly behavior: "success";
1633
+ };
1634
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1635
+ readonly updatedAt: "2026-08-07T15:04:00.000Z";
1636
+ readonly url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8";
1637
+ };
1638
+ readonly id: "testsinks.delete";
1639
+ readonly idempotent: true;
1640
+ readonly mcp: {
1641
+ readonly destructive: true;
1642
+ readonly kind: "tool";
1643
+ readonly openWorld: false;
1644
+ };
1645
+ readonly method: "DELETE";
1646
+ readonly mutates: true;
1647
+ readonly path: "/v1/test-sinks/{sinkId}";
1648
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1649
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict"];
1650
+ readonly response: z.ZodObject<{
1651
+ createdAt: z.ZodString;
1652
+ deliveryCount: z.ZodNumber;
1653
+ endpoint: z.ZodString;
1654
+ environmentKind: z.ZodLiteral<"test">;
1655
+ id: z.ZodString;
1656
+ program: z.ZodObject<{
1657
+ behavior: z.ZodEnum<{
1658
+ rate_limited: "rate_limited";
1659
+ success: "success";
1660
+ server_error: "server_error";
1661
+ client_error: "client_error";
1662
+ defer_abandon: "defer_abandon";
1663
+ defer_fail: "defer_fail";
1664
+ defer_succeed: "defer_succeed";
1665
+ delay: "delay";
1666
+ disconnect: "disconnect";
1667
+ duplicate: "duplicate";
1668
+ invalid_signature: "invalid_signature";
1669
+ timeout: "timeout";
1670
+ }>;
1671
+ completionDelayMs: z.ZodOptional<z.ZodNumber>;
1672
+ delayMs: z.ZodOptional<z.ZodNumber>;
1673
+ forDeliveries: z.ZodOptional<z.ZodNumber>;
1674
+ retryAfterSeconds: z.ZodOptional<z.ZodNumber>;
1675
+ status: z.ZodOptional<z.ZodNumber>;
1676
+ then: z.ZodOptional<z.ZodEnum<{
1677
+ rate_limited: "rate_limited";
1678
+ success: "success";
1679
+ server_error: "server_error";
1680
+ client_error: "client_error";
1681
+ defer_abandon: "defer_abandon";
1682
+ defer_fail: "defer_fail";
1683
+ defer_succeed: "defer_succeed";
1684
+ delay: "delay";
1685
+ disconnect: "disconnect";
1686
+ duplicate: "duplicate";
1687
+ invalid_signature: "invalid_signature";
1688
+ timeout: "timeout";
1689
+ }>>;
1690
+ }, z.core.$strip>;
1691
+ project: z.ZodString;
1692
+ updatedAt: z.ZodString;
1693
+ url: z.ZodURL;
1694
+ }, z.core.$strip>;
1695
+ readonly scopes: readonly ["endpoints:write"];
1696
+ readonly sessionAuthority: "headers";
1697
+ readonly summary: "Delete a test sink";
1698
+ readonly surfaces: readonly ["api", "mock"];
1699
+ }, {
1700
+ readonly creates: true;
1701
+ readonly description: "Pins the mock's behavior and clock so an integrator can rehearse success, refusal, retry, timeout, ambiguity, and redelivery deterministically. Mock-only, and never evidence that the real runtime behaves this way.";
1702
+ readonly example: {
1703
+ readonly behavior: "retry";
1704
+ readonly now: "2026-01-01T00:00:00.000Z";
1705
+ readonly scenarioId: "scenario-1";
1706
+ };
1707
+ readonly id: "mock.setScenario";
1708
+ readonly idempotent: false;
1709
+ readonly mcp: {
1710
+ readonly kind: "unavailable";
1711
+ readonly reason: "The contract mock's control plane. An agent handed this would call it against the real service.";
1712
+ };
1713
+ readonly method: "POST";
1714
+ readonly mutates: true;
1715
+ readonly path: "/_contract/scenarios";
1716
+ readonly principals: readonly [];
1717
+ readonly problems: readonly ["invalid_request"];
1718
+ readonly request: z.ZodObject<{
1719
+ behavior: z.ZodEnum<{
1720
+ success: "success";
1721
+ redelivery: "redelivery";
1722
+ ambiguous: "ambiguous";
1723
+ refusal: "refusal";
1724
+ timeout: "timeout";
1725
+ retry: "retry";
1726
+ }>;
1727
+ now: z.ZodOptional<z.ZodString>;
1728
+ failuresBeforeSuccess: z.ZodOptional<z.ZodNumber>;
1729
+ }, z.core.$strip>;
1730
+ readonly requestExample: {
1731
+ readonly behavior: "retry";
1732
+ readonly failuresBeforeSuccess: 2;
1733
+ };
1734
+ readonly response: z.ZodObject<{
1735
+ behavior: z.ZodEnum<{
1736
+ success: "success";
1737
+ redelivery: "redelivery";
1738
+ ambiguous: "ambiguous";
1739
+ refusal: "refusal";
1740
+ timeout: "timeout";
1741
+ retry: "retry";
1742
+ }>;
1743
+ now: z.ZodString;
1744
+ scenarioId: z.ZodString;
1745
+ }, z.core.$strip>;
1746
+ readonly scopes: readonly [];
1747
+ readonly summary: "Set the mock scenario";
1748
+ readonly surfaces: readonly ["mock"];
1749
+ }, {
1750
+ readonly creates: true;
1751
+ readonly description: "Issues an API credential bound to one project and environment, with scopes capped by the issuing member's current role. The full secret is in this response and in no other, is not recoverable afterwards, and there is deliberately no reveal endpoint. The value is the sixteen-character display prefix followed immediately by thirty-two more characters; the example below is a visible placeholder rather than that shape, because a realistic credential in a committed file is one the repository's own secret scanner refuses.";
1752
+ readonly example: {
1753
+ readonly createdAt: "2026-07-28T15:00:00.000Z";
1754
+ readonly displayPrefix: "pt_test_a1b2c3d4";
1755
+ readonly environmentKind: "test";
1756
+ readonly id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8";
1757
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1758
+ readonly scopes: readonly ["schedules:write"];
1759
+ readonly secret: "pt_test_a1b2c3d4<the-32-character-secret-half-here>";
1760
+ readonly shownOnce: true;
1761
+ };
1762
+ readonly id: "credentials.create";
1763
+ readonly idempotent: false;
1764
+ readonly mcp: {
1765
+ readonly kind: "unavailable";
1766
+ readonly reason: "Issuance is authenticated by a signed-in member. MCP carries API credentials and OAuth tokens, and `POST /v1/credentials` refuses both.";
1767
+ };
1768
+ readonly method: "POST";
1769
+ readonly mutates: true;
1770
+ readonly path: "/v1/credentials";
1771
+ readonly principals: readonly ["session"];
1772
+ readonly problems: readonly ["invalid_request", "not_found"];
1773
+ readonly request: z.ZodObject<{
1774
+ environmentKind: z.ZodEnum<{
1775
+ test: "test";
1776
+ live: "live";
1777
+ }>;
1778
+ project: z.ZodString;
1779
+ scopes: z.ZodArray<z.ZodEnum<{
1780
+ "credentials:administer": "credentials:administer";
1781
+ "credentials:read": "credentials:read";
1782
+ "credentials:write": "credentials:write";
1783
+ "endpoints:read": "endpoints:read";
1784
+ "endpoints:write": "endpoints:write";
1785
+ "forecast:read": "forecast:read";
1786
+ "grants:read": "grants:read";
1787
+ "grants:write": "grants:write";
1788
+ "occurrences:read": "occurrences:read";
1789
+ "occurrences:redeliver": "occurrences:redeliver";
1790
+ "projects:read": "projects:read";
1791
+ "projects:write": "projects:write";
1792
+ "schedules:read": "schedules:read";
1793
+ "schedules:write": "schedules:write";
1794
+ "usage:read": "usage:read";
1795
+ }>>;
1796
+ }, z.core.$strip>;
1797
+ readonly requestExample: {
1798
+ readonly environmentKind: "test";
1799
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1800
+ readonly scopes: readonly ["schedules:write"];
1801
+ };
1802
+ readonly response: z.ZodObject<{
1803
+ createdAt: z.ZodString;
1804
+ displayPrefix: z.ZodString;
1805
+ environmentKind: z.ZodEnum<{
1806
+ test: "test";
1807
+ live: "live";
1808
+ }>;
1809
+ expiresAt: z.ZodOptional<z.ZodString>;
1810
+ id: z.ZodString;
1811
+ issuedBy: z.ZodOptional<z.ZodString>;
1812
+ lastUsedAt: z.ZodOptional<z.ZodString>;
1813
+ project: z.ZodString;
1814
+ revokedAt: z.ZodOptional<z.ZodString>;
1815
+ supersededBy: z.ZodOptional<z.ZodString>;
1816
+ scopes: z.ZodArray<z.ZodEnum<{
1817
+ "credentials:administer": "credentials:administer";
1818
+ "credentials:read": "credentials:read";
1819
+ "credentials:write": "credentials:write";
1820
+ "endpoints:read": "endpoints:read";
1821
+ "endpoints:write": "endpoints:write";
1822
+ "forecast:read": "forecast:read";
1823
+ "grants:read": "grants:read";
1824
+ "grants:write": "grants:write";
1825
+ "occurrences:read": "occurrences:read";
1826
+ "occurrences:redeliver": "occurrences:redeliver";
1827
+ "projects:read": "projects:read";
1828
+ "projects:write": "projects:write";
1829
+ "schedules:read": "schedules:read";
1830
+ "schedules:write": "schedules:write";
1831
+ "usage:read": "usage:read";
1832
+ }>>;
1833
+ secret: z.ZodString;
1834
+ shownOnce: z.ZodLiteral<true>;
1835
+ }, z.core.$strip>;
1836
+ readonly scopes: readonly ["credentials:write"];
1837
+ readonly sessionAuthority: "request-body";
1838
+ readonly summary: "Issue an API credential";
1839
+ readonly surfaces: readonly ["api", "mock"];
1840
+ }, {
1841
+ readonly creates: false;
1842
+ readonly description: "Lists the credentials issued for the caller's own project and environment, oldest first, one page at a time. The authority tuple comes from the verified principal, so there is no parameter that could name another project — a listing is the caller's own book or nothing. Revoked and rotated credentials stay in the listing and carry the fields that say so; a credential nobody can see is a credential nobody can audit. `limit` is bounded by the contract and `cursor` is the opaque value the previous page returned. No page carries a secret: the item is the read shape, which has no field one could be put in.";
1843
+ readonly example: {
1844
+ readonly data: readonly [{
1845
+ readonly createdAt: "2026-07-28T15:00:00.000Z";
1846
+ readonly displayPrefix: "pt_test_a1b2c3d4";
1847
+ readonly environmentKind: "test";
1848
+ readonly id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8";
1849
+ readonly lastUsedAt: "2026-07-28T15:04:00.000Z";
1850
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1851
+ readonly scopes: readonly ["schedules:write"];
1852
+ }];
1853
+ readonly freshness: {
1854
+ readonly kind: "authoritative";
1855
+ };
1856
+ readonly nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoiYWtfMDFoOHh5ejlrMm00bjZwOHIwdDJ2NHc2eTgiLCJrIjoiOTUxMzU0NmYifQ";
1857
+ };
1858
+ readonly id: "credentials.list";
1859
+ readonly idempotent: true;
1860
+ readonly mcp: {
1861
+ readonly destructive: false;
1862
+ readonly kind: "tool";
1863
+ readonly openWorld: false;
1864
+ };
1865
+ readonly method: "GET";
1866
+ readonly mutates: false;
1867
+ readonly path: "/v1/credentials";
1868
+ readonly principals: readonly ["api-credential", "oauth", "session"];
1869
+ readonly problems: readonly ["invalid_request"];
1870
+ readonly query: z.ZodObject<{
1871
+ cursor: z.ZodOptional<z.ZodString>;
1872
+ limit: z.ZodDefault<z.ZodNumber>;
1873
+ }, z.core.$strip>;
1874
+ readonly response: z.ZodObject<{
1875
+ data: z.ZodArray<z.ZodObject<{
1876
+ createdAt: z.ZodString;
1877
+ displayPrefix: z.ZodString;
1878
+ environmentKind: z.ZodEnum<{
1879
+ test: "test";
1880
+ live: "live";
1881
+ }>;
1882
+ expiresAt: z.ZodOptional<z.ZodString>;
1883
+ id: z.ZodString;
1884
+ issuedBy: z.ZodOptional<z.ZodString>;
1885
+ lastUsedAt: z.ZodOptional<z.ZodString>;
1886
+ project: z.ZodString;
1887
+ revokedAt: z.ZodOptional<z.ZodString>;
1888
+ supersededBy: z.ZodOptional<z.ZodString>;
1889
+ scopes: z.ZodArray<z.ZodEnum<{
1890
+ "credentials:administer": "credentials:administer";
1891
+ "credentials:read": "credentials:read";
1892
+ "credentials:write": "credentials:write";
1893
+ "endpoints:read": "endpoints:read";
1894
+ "endpoints:write": "endpoints:write";
1895
+ "forecast:read": "forecast:read";
1896
+ "grants:read": "grants:read";
1897
+ "grants:write": "grants:write";
1898
+ "occurrences:read": "occurrences:read";
1899
+ "occurrences:redeliver": "occurrences:redeliver";
1900
+ "projects:read": "projects:read";
1901
+ "projects:write": "projects:write";
1902
+ "schedules:read": "schedules:read";
1903
+ "schedules:write": "schedules:write";
1904
+ "usage:read": "usage:read";
1905
+ }>>;
1906
+ }, z.core.$strip>>;
1907
+ freshness: z.ZodDiscriminatedUnion<[z.ZodObject<{
1908
+ kind: z.ZodLiteral<"authoritative">;
1909
+ }, z.core.$strip>, z.ZodObject<{
1910
+ asOf: z.ZodString;
1911
+ kind: z.ZodLiteral<"projected">;
1912
+ lagSeconds: z.ZodNumber;
1913
+ }, z.core.$strip>], "kind">;
1914
+ nextCursor: z.ZodOptional<z.ZodString>;
1915
+ }, z.core.$strip>;
1916
+ readonly scopes: readonly ["credentials:read"];
1917
+ readonly sessionAuthority: "headers";
1918
+ readonly summary: "List API credentials";
1919
+ readonly surfaces: readonly ["api", "mock"];
1920
+ }, {
1921
+ readonly creates: false;
1922
+ readonly description: "Lists the projects in the signed-in member's organization that they may act in, with the environment kinds each one has. This is what a browser asks before it can address anything else: an API credential and an OAuth token each carry one project intrinsically, but a member belongs to an organization and chooses. Archived and deleted projects are omitted, because a member cannot act in one. The result is a display aid rather than an authorization control — naming a project on a later request re-resolves it against the member's own organization, and a project that is not theirs answers exactly as one that does not exist.";
1923
+ readonly example: {
1924
+ readonly data: readonly [{
1925
+ readonly environmentKinds: readonly ["test", "live"];
1926
+ readonly id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1927
+ readonly name: "Billing reminders";
1928
+ }];
1929
+ };
1930
+ readonly id: "projects.list";
1931
+ readonly idempotent: true;
1932
+ readonly mcp: {
1933
+ readonly kind: "unavailable";
1934
+ readonly reason: "Enumerating an organization's projects is a signed-in member's question. MCP carries API credentials and OAuth tokens, whose authority already is one project, and this operation accepts neither.";
1935
+ };
1936
+ readonly method: "GET";
1937
+ readonly mutates: false;
1938
+ readonly path: "/v1/projects";
1939
+ readonly principals: readonly ["session"];
1940
+ readonly problems: readonly [];
1941
+ readonly response: z.ZodObject<{
1942
+ data: z.ZodArray<z.ZodObject<{
1943
+ environmentKinds: z.ZodArray<z.ZodEnum<{
1944
+ test: "test";
1945
+ live: "live";
1946
+ }>>;
1947
+ id: z.ZodString;
1948
+ name: z.ZodString;
1949
+ }, z.core.$strip>>;
1950
+ }, z.core.$strip>;
1951
+ readonly scopes: readonly ["projects:read"];
1952
+ readonly sessionAuthority: "organization";
1953
+ readonly summary: "List the member's projects";
1954
+ readonly surfaces: readonly ["api", "mock"];
1955
+ }, {
1956
+ readonly creates: true;
1957
+ readonly description: "Creates a project in the signed-in member's organization, with both of its environments. This is the first call a new customer makes: an organization has no project until somebody makes one, and every other operation on this surface acts inside one. The `test` and `live` environments are provisioned with it in a single transaction rather than asked for, so a project is never observable in a half-provisioned state. The organization comes from the verified session and is never read from the request — a member who belongs to one organization cannot create a project in another. `PROJECT_LIST_LIMIT` bounds how many an organization may hold, and it is the same ceiling the listing publishes: a create that would take an organization past a list it can no longer return is refused rather than silently truncating a later read.";
1958
+ readonly example: {
1959
+ readonly environmentKinds: readonly ["test", "live"];
1960
+ readonly id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
1961
+ readonly name: "Billing reminders";
1962
+ };
1963
+ readonly id: "projects.create";
1964
+ readonly idempotent: false;
1965
+ readonly mcp: {
1966
+ readonly kind: "unavailable";
1967
+ readonly reason: "Creating a project is a signed-in member's act. MCP carries API credentials and OAuth tokens, whose authority already is one project — so this operation accepts neither, and an agent that somehow created one could not act in it.";
1968
+ };
1969
+ readonly method: "POST";
1970
+ readonly mutates: true;
1971
+ readonly path: "/v1/projects";
1972
+ readonly principals: readonly ["session"];
1973
+ readonly problems: readonly ["invalid_request", "plan_limit_reached"];
1974
+ readonly request: z.ZodObject<{
1975
+ name: z.ZodString;
1976
+ }, z.core.$strip>;
1977
+ readonly requestExample: {
1978
+ readonly name: "Billing reminders";
1979
+ };
1980
+ readonly response: z.ZodObject<{
1981
+ environmentKinds: z.ZodArray<z.ZodEnum<{
1982
+ test: "test";
1983
+ live: "live";
1984
+ }>>;
1985
+ id: z.ZodString;
1986
+ name: z.ZodString;
1987
+ }, z.core.$strip>;
1988
+ readonly scopes: readonly ["projects:write"];
1989
+ readonly sessionAuthority: "organization";
1990
+ readonly summary: "Create a project";
1991
+ readonly surfaces: readonly ["api", "mock"];
1992
+ }, {
1993
+ readonly creates: false;
1994
+ readonly description: "Lists the applications this member has connected to their own account, newest first, across every project in their organization — because a person connects an application, not a project. Revoked connections stay in the listing with the instant and the reason they ended: a connection nobody can see is one nobody can audit. This is a signed-in member's view of their own delegations. An application holding a grant cannot read it, which is why the operation accepts no API credential and no access token, and why it is on no agent's tool list.";
1995
+ readonly example: {
1996
+ readonly data: readonly [{
1997
+ readonly client: {
1998
+ readonly id: "oc_01h8xyz9k2m4n6p8r0t2v4w6y8";
1999
+ readonly name: "Flow XO";
2000
+ };
2001
+ readonly createdAt: "2026-08-14T11:00:00.000Z";
2002
+ readonly environmentKind: "test";
2003
+ readonly id: "og_01h8xyz9k2m4n6p8r0t2v4w6y8";
2004
+ readonly lastUsedAt: "2026-08-15T09:12:00.000Z";
2005
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
2006
+ readonly scopes: readonly ["schedules:read", "schedules:write"];
2007
+ readonly status: "active";
2008
+ }];
2009
+ };
2010
+ readonly id: "grants.list";
2011
+ readonly idempotent: true;
2012
+ readonly mcp: {
2013
+ readonly kind: "unavailable";
2014
+ readonly reason: "A member's own connected applications. MCP carries API credentials and OAuth tokens, and an application holding a grant must not be able to enumerate its rivals — still less disconnect them — so this operation accepts neither.";
2015
+ };
2016
+ readonly method: "GET";
2017
+ readonly mutates: false;
2018
+ readonly path: "/v1/grants";
2019
+ readonly principals: readonly ["session"];
2020
+ readonly problems: readonly [];
2021
+ readonly response: z.ZodObject<{
2022
+ data: z.ZodArray<z.ZodObject<{
2023
+ client: z.ZodObject<{
2024
+ id: z.ZodString;
2025
+ name: z.ZodString;
2026
+ }, z.core.$strip>;
2027
+ createdAt: z.ZodString;
2028
+ environmentKind: z.ZodEnum<{
2029
+ test: "test";
2030
+ live: "live";
2031
+ }>;
2032
+ id: z.ZodString;
2033
+ lastUsedAt: z.ZodOptional<z.ZodString>;
2034
+ project: z.ZodString;
2035
+ revocationReason: z.ZodOptional<z.ZodEnum<{
2036
+ "authorization-code-replayed": "authorization-code-replayed";
2037
+ "client-revoked": "client-revoked";
2038
+ "member-revoked": "member-revoked";
2039
+ "refresh-token-replayed": "refresh-token-replayed";
2040
+ }>>;
2041
+ revokedAt: z.ZodOptional<z.ZodString>;
2042
+ scopes: z.ZodArray<z.ZodEnum<{
2043
+ "credentials:administer": "credentials:administer";
2044
+ "credentials:read": "credentials:read";
2045
+ "credentials:write": "credentials:write";
2046
+ "endpoints:read": "endpoints:read";
2047
+ "endpoints:write": "endpoints:write";
2048
+ "forecast:read": "forecast:read";
2049
+ "grants:read": "grants:read";
2050
+ "grants:write": "grants:write";
2051
+ "occurrences:read": "occurrences:read";
2052
+ "occurrences:redeliver": "occurrences:redeliver";
2053
+ "projects:read": "projects:read";
2054
+ "projects:write": "projects:write";
2055
+ "schedules:read": "schedules:read";
2056
+ "schedules:write": "schedules:write";
2057
+ "usage:read": "usage:read";
2058
+ }>>;
2059
+ status: z.ZodEnum<{
2060
+ active: "active";
2061
+ revoked: "revoked";
2062
+ }>;
2063
+ }, z.core.$strip>>;
2064
+ }, z.core.$strip>;
2065
+ readonly scopes: readonly ["grants:read"];
2066
+ readonly sessionAuthority: "member";
2067
+ readonly summary: "List the member's connected applications";
2068
+ readonly surfaces: readonly ["api", "mock"];
2069
+ }, {
2070
+ readonly creates: false;
2071
+ readonly description: "Disconnects one application, ending every token that grant ever issued — the access tokens and the refresh token together. The grant stays readable afterwards with the instant and the reason it ended. Only the member who granted it can disconnect it, and a grant belonging to somebody else answers exactly as one that does not exist.";
2072
+ readonly example: {
2073
+ readonly grant: {
2074
+ readonly client: {
2075
+ readonly id: "oc_01h8xyz9k2m4n6p8r0t2v4w6y8";
2076
+ readonly name: "Flow XO";
2077
+ };
2078
+ readonly createdAt: "2026-08-14T11:00:00.000Z";
2079
+ readonly environmentKind: "test";
2080
+ readonly id: "og_01h8xyz9k2m4n6p8r0t2v4w6y8";
2081
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
2082
+ readonly revocationReason: "member-revoked";
2083
+ readonly revokedAt: "2026-08-15T10:00:00.000Z";
2084
+ readonly scopes: readonly ["schedules:read", "schedules:write"];
2085
+ readonly status: "revoked";
2086
+ };
2087
+ };
2088
+ readonly id: "grants.revoke";
2089
+ readonly idempotent: true;
2090
+ readonly mcp: {
2091
+ readonly kind: "unavailable";
2092
+ readonly reason: "Disconnecting an application is the member's own act. MCP carries API credentials and OAuth tokens, and an application able to disconnect a grant could disconnect the ones belonging to every other application the member has connected.";
2093
+ };
2094
+ readonly method: "DELETE";
2095
+ readonly mutates: true;
2096
+ readonly path: "/v1/grants/{grantId}";
2097
+ readonly principals: readonly ["session"];
2098
+ readonly problems: readonly ["not_found"];
2099
+ readonly response: z.ZodObject<{
2100
+ grant: z.ZodObject<{
2101
+ client: z.ZodObject<{
2102
+ id: z.ZodString;
2103
+ name: z.ZodString;
2104
+ }, z.core.$strip>;
2105
+ createdAt: z.ZodString;
2106
+ environmentKind: z.ZodEnum<{
2107
+ test: "test";
2108
+ live: "live";
2109
+ }>;
2110
+ id: z.ZodString;
2111
+ lastUsedAt: z.ZodOptional<z.ZodString>;
2112
+ project: z.ZodString;
2113
+ revocationReason: z.ZodOptional<z.ZodEnum<{
2114
+ "authorization-code-replayed": "authorization-code-replayed";
2115
+ "client-revoked": "client-revoked";
2116
+ "member-revoked": "member-revoked";
2117
+ "refresh-token-replayed": "refresh-token-replayed";
2118
+ }>>;
2119
+ revokedAt: z.ZodOptional<z.ZodString>;
2120
+ scopes: z.ZodArray<z.ZodEnum<{
2121
+ "credentials:administer": "credentials:administer";
2122
+ "credentials:read": "credentials:read";
2123
+ "credentials:write": "credentials:write";
2124
+ "endpoints:read": "endpoints:read";
2125
+ "endpoints:write": "endpoints:write";
2126
+ "forecast:read": "forecast:read";
2127
+ "grants:read": "grants:read";
2128
+ "grants:write": "grants:write";
2129
+ "occurrences:read": "occurrences:read";
2130
+ "occurrences:redeliver": "occurrences:redeliver";
2131
+ "projects:read": "projects:read";
2132
+ "projects:write": "projects:write";
2133
+ "schedules:read": "schedules:read";
2134
+ "schedules:write": "schedules:write";
2135
+ "usage:read": "usage:read";
2136
+ }>>;
2137
+ status: z.ZodEnum<{
2138
+ active: "active";
2139
+ revoked: "revoked";
2140
+ }>;
2141
+ }, z.core.$strip>;
2142
+ }, z.core.$strip>;
2143
+ readonly scopes: readonly ["grants:write"];
2144
+ readonly sessionAuthority: "member";
2145
+ readonly summary: "Disconnect an application";
2146
+ readonly surfaces: readonly ["api", "mock"];
2147
+ }, {
2148
+ readonly creates: true;
2149
+ readonly description: "Replaces a credential with a new one and gives the original a deadline, so consumers can pick up the new secret before the old stops working. The replacement is a new credential with its own identifier and the same authority and scopes; the original keeps working until it expires, then refuses with `credential_expired` rather than `credential_revoked`. `overlapSeconds` may only shorten the window — the default is also the maximum — and zero retires the original immediately. The new secret is in this response and in no other.";
2150
+ readonly example: {
2151
+ readonly credential: {
2152
+ readonly createdAt: "2026-07-28T15:00:00.000Z";
2153
+ readonly displayPrefix: "pt_test_e5f6g7h8";
2154
+ readonly environmentKind: "test";
2155
+ readonly id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y9";
2156
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
2157
+ readonly scopes: readonly ["schedules:write"];
2158
+ readonly secret: "pt_test_e5f6g7h8<the-32-character-secret-half-here>";
2159
+ readonly shownOnce: true;
2160
+ };
2161
+ readonly retired: {
2162
+ readonly createdAt: "2026-07-28T15:00:00.000Z";
2163
+ readonly displayPrefix: "pt_test_a1b2c3d4";
2164
+ readonly environmentKind: "test";
2165
+ readonly expiresAt: "2026-07-29T15:00:00.000Z";
2166
+ readonly id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8";
2167
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
2168
+ readonly scopes: readonly ["schedules:write"];
2169
+ readonly supersededBy: "ak_01h8xyz9k2m4n6p8r0t2v4w6y9";
2170
+ };
2171
+ };
2172
+ readonly id: "credentials.rotate";
2173
+ readonly mcp: {
2174
+ readonly destructive: true;
2175
+ readonly kind: "tool";
2176
+ readonly openWorld: false;
2177
+ };
2178
+ readonly idempotent: false;
2179
+ readonly method: "POST";
2180
+ readonly mutates: true;
2181
+ readonly path: "/v1/credentials/{credentialId}/rotate";
2182
+ readonly conditionalScopes: readonly ["credentials:administer"];
2183
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2184
+ readonly problems: readonly ["invalid_request", "not_found", "scope_missing"];
2185
+ readonly request: z.ZodObject<{
2186
+ overlapSeconds: z.ZodOptional<z.ZodNumber>;
2187
+ }, z.core.$strip>;
2188
+ readonly requestExample: {
2189
+ readonly overlapSeconds: 3600;
2190
+ };
2191
+ readonly response: z.ZodObject<{
2192
+ credential: z.ZodObject<{
2193
+ createdAt: z.ZodString;
2194
+ displayPrefix: z.ZodString;
2195
+ environmentKind: z.ZodEnum<{
2196
+ test: "test";
2197
+ live: "live";
2198
+ }>;
2199
+ expiresAt: z.ZodOptional<z.ZodString>;
2200
+ id: z.ZodString;
2201
+ issuedBy: z.ZodOptional<z.ZodString>;
2202
+ lastUsedAt: z.ZodOptional<z.ZodString>;
2203
+ project: z.ZodString;
2204
+ revokedAt: z.ZodOptional<z.ZodString>;
2205
+ supersededBy: z.ZodOptional<z.ZodString>;
2206
+ scopes: z.ZodArray<z.ZodEnum<{
2207
+ "credentials:administer": "credentials:administer";
2208
+ "credentials:read": "credentials:read";
2209
+ "credentials:write": "credentials:write";
2210
+ "endpoints:read": "endpoints:read";
2211
+ "endpoints:write": "endpoints:write";
2212
+ "forecast:read": "forecast:read";
2213
+ "grants:read": "grants:read";
2214
+ "grants:write": "grants:write";
2215
+ "occurrences:read": "occurrences:read";
2216
+ "occurrences:redeliver": "occurrences:redeliver";
2217
+ "projects:read": "projects:read";
2218
+ "projects:write": "projects:write";
2219
+ "schedules:read": "schedules:read";
2220
+ "schedules:write": "schedules:write";
2221
+ "usage:read": "usage:read";
2222
+ }>>;
2223
+ secret: z.ZodString;
2224
+ shownOnce: z.ZodLiteral<true>;
2225
+ }, z.core.$strip>;
2226
+ retired: z.ZodObject<{
2227
+ createdAt: z.ZodString;
2228
+ displayPrefix: z.ZodString;
2229
+ environmentKind: z.ZodEnum<{
2230
+ test: "test";
2231
+ live: "live";
2232
+ }>;
2233
+ expiresAt: z.ZodOptional<z.ZodString>;
2234
+ id: z.ZodString;
2235
+ issuedBy: z.ZodOptional<z.ZodString>;
2236
+ lastUsedAt: z.ZodOptional<z.ZodString>;
2237
+ project: z.ZodString;
2238
+ revokedAt: z.ZodOptional<z.ZodString>;
2239
+ supersededBy: z.ZodOptional<z.ZodString>;
2240
+ scopes: z.ZodArray<z.ZodEnum<{
2241
+ "credentials:administer": "credentials:administer";
2242
+ "credentials:read": "credentials:read";
2243
+ "credentials:write": "credentials:write";
2244
+ "endpoints:read": "endpoints:read";
2245
+ "endpoints:write": "endpoints:write";
2246
+ "forecast:read": "forecast:read";
2247
+ "grants:read": "grants:read";
2248
+ "grants:write": "grants:write";
2249
+ "occurrences:read": "occurrences:read";
2250
+ "occurrences:redeliver": "occurrences:redeliver";
2251
+ "projects:read": "projects:read";
2252
+ "projects:write": "projects:write";
2253
+ "schedules:read": "schedules:read";
2254
+ "schedules:write": "schedules:write";
2255
+ "usage:read": "usage:read";
2256
+ }>>;
2257
+ }, z.core.$strip>;
2258
+ }, z.core.$strip>;
2259
+ readonly scopes: readonly ["credentials:write"];
2260
+ readonly sessionAuthority: "headers";
2261
+ readonly summary: "Rotate an API credential";
2262
+ readonly surfaces: readonly ["api", "mock"];
2263
+ }, {
2264
+ readonly creates: false;
2265
+ readonly description: "Revokes a credential immediately, with no overlap. The credential stops verifying on the next request and refuses with `credential_revoked`. The row survives its revocation so the credential's history remains answerable, and revoking a credential that is already revoked reports the original revocation rather than moving it. A credential belonging to another project is indistinguishable from one that does not exist.";
2266
+ readonly example: {
2267
+ readonly credential: {
2268
+ readonly createdAt: "2026-07-28T15:00:00.000Z";
2269
+ readonly displayPrefix: "pt_test_a1b2c3d4";
2270
+ readonly environmentKind: "test";
2271
+ readonly id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8";
2272
+ readonly project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8";
2273
+ readonly revokedAt: "2026-07-28T16:00:00.000Z";
2274
+ readonly scopes: readonly ["schedules:write"];
2275
+ };
2276
+ };
2277
+ readonly id: "credentials.revoke";
2278
+ readonly mcp: {
2279
+ readonly destructive: true;
2280
+ readonly kind: "tool";
2281
+ readonly openWorld: false;
2282
+ };
2283
+ readonly idempotent: true;
2284
+ readonly method: "DELETE";
2285
+ readonly mutates: true;
2286
+ readonly path: "/v1/credentials/{credentialId}";
2287
+ readonly conditionalScopes: readonly ["credentials:administer"];
2288
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2289
+ readonly problems: readonly ["invalid_request", "not_found", "scope_missing"];
2290
+ readonly response: z.ZodObject<{
2291
+ credential: z.ZodObject<{
2292
+ createdAt: z.ZodString;
2293
+ displayPrefix: z.ZodString;
2294
+ environmentKind: z.ZodEnum<{
2295
+ test: "test";
2296
+ live: "live";
2297
+ }>;
2298
+ expiresAt: z.ZodOptional<z.ZodString>;
2299
+ id: z.ZodString;
2300
+ issuedBy: z.ZodOptional<z.ZodString>;
2301
+ lastUsedAt: z.ZodOptional<z.ZodString>;
2302
+ project: z.ZodString;
2303
+ revokedAt: z.ZodOptional<z.ZodString>;
2304
+ supersededBy: z.ZodOptional<z.ZodString>;
2305
+ scopes: z.ZodArray<z.ZodEnum<{
2306
+ "credentials:administer": "credentials:administer";
2307
+ "credentials:read": "credentials:read";
2308
+ "credentials:write": "credentials:write";
2309
+ "endpoints:read": "endpoints:read";
2310
+ "endpoints:write": "endpoints:write";
2311
+ "forecast:read": "forecast:read";
2312
+ "grants:read": "grants:read";
2313
+ "grants:write": "grants:write";
2314
+ "occurrences:read": "occurrences:read";
2315
+ "occurrences:redeliver": "occurrences:redeliver";
2316
+ "projects:read": "projects:read";
2317
+ "projects:write": "projects:write";
2318
+ "schedules:read": "schedules:read";
2319
+ "schedules:write": "schedules:write";
2320
+ "usage:read": "usage:read";
2321
+ }>>;
2322
+ }, z.core.$strip>;
2323
+ }, z.core.$strip>;
2324
+ readonly scopes: readonly ["credentials:write"];
2325
+ readonly sessionAuthority: "headers";
2326
+ readonly summary: "Revoke an API credential";
2327
+ readonly surfaces: readonly ["api", "mock"];
2328
+ }, {
2329
+ readonly creates: true;
2330
+ readonly description: "Creates a schedule and returns it together with its first planned occurrence. Give exactly one of `at`, `delaySeconds`, `everySeconds` and `cron`. An optional `partitionKey` selects a fairness lane inside this project and environment; it is fixed after create. Add a verified `endpoint` to deliver each occurrence there; optional JSON `data` is encrypted before PostgreSQL persistence and is placed in the signed callback, never returned by schedule reads. `at` and `delaySeconds` fire once; a delay is converted to an absolute instant when the request is accepted, so a schedule created either way reads back the same afterwards. `everySeconds` is a fixed duration and its first occurrence falls one interval after acceptance — it stays the same length across a daylight-saving change, and takes no timezone for that reason. `cron` is a wall clock: it is read against the IANA `timeZone` sent with it, `UTC` when none is, and the first occurrence is the first instant the expression names after acceptance. Where the clocks go forward and the wall time named does not exist that day, the occurrence falls at the first instant after the gap; where they go back and it happens twice, it falls once, at the earlier of the two. A recurring schedule is materialized one occurrence at a time: the next one is planned once the current one is due, so a read always shows one occurrence still to come. The organization, project and environment come from the verified principal; a body cannot name them, and the endpoint must belong to the same tuple, so a credential issued for one project can only ever create schedules in that project. Send an `Idempotency-Key` to make a retry safe: the identical request returns the schedule that key already created, marked `Idempotency-Replayed: true`, and creates nothing further; the same key with a different request is refused `idempotency_key_reused`. A replay reports the schedule **as it stands now**, not a frozen copy of the first response — if it was paused in between, the replay says so.";
2331
+ readonly example: {
2332
+ readonly occurrence: {
2333
+ readonly attemptCount: 0;
2334
+ readonly generation: 1;
2335
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
2336
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
2337
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2338
+ readonly sequence: 1;
2339
+ readonly state: "planned";
2340
+ };
2341
+ readonly schedule: {
2342
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
2343
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
2344
+ readonly generation: 1;
2345
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2346
+ readonly latencyClass: "realtime";
2347
+ readonly partitionKey: "campaign.spring";
2348
+ readonly recurrence: {
2349
+ readonly kind: "at";
2350
+ };
2351
+ readonly status: "active";
2352
+ readonly updatedAt: "2026-07-28T14:59:00.000Z";
2353
+ readonly version: 1;
2354
+ };
2355
+ };
2356
+ readonly id: "schedules.create";
2357
+ readonly mcp: {
2358
+ readonly destructive: false;
2359
+ readonly kind: "tool";
2360
+ readonly openWorld: true;
2361
+ };
2362
+ readonly idempotent: false;
2363
+ readonly method: "POST";
2364
+ readonly mutates: true;
2365
+ readonly path: "/v1/schedules";
2366
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2367
+ readonly problems: readonly ["endpoint_unverified", "idempotency_key_reused", "invalid_request", "not_found", "plan_limit_reached", "service_unavailable"];
2368
+ readonly request: z.ZodObject<{
2369
+ at: z.ZodOptional<z.ZodString>;
2370
+ cron: z.ZodOptional<z.ZodString>;
2371
+ data: z.ZodOptional<z.ZodJSONSchema>;
2372
+ delaySeconds: z.ZodOptional<z.ZodNumber>;
2373
+ delivery: z.ZodOptional<z.ZodObject<{
2374
+ onOverlap: z.ZodOptional<z.ZodEnum<{
2375
+ skip: "skip";
2376
+ queue: "queue";
2377
+ }>>;
2378
+ completion: z.ZodOptional<z.ZodEnum<{
2379
+ response: "response";
2380
+ callback: "callback";
2381
+ }>>;
2382
+ maxDurationSeconds: z.ZodOptional<z.ZodLiteral<5 | 300 | 86400 | 30 | 900 | 1800 | 3600 | 43200>>;
2383
+ }, z.core.$strict>>;
2384
+ everySeconds: z.ZodOptional<z.ZodNumber>;
2385
+ endpoint: z.ZodOptional<z.ZodString>;
2386
+ latencyClass: z.ZodOptional<z.ZodEnum<{
2387
+ realtime: "realtime";
2388
+ bulk: "bulk";
2389
+ }>>;
2390
+ partitionKey: z.ZodOptional<z.ZodString>;
2391
+ timeZone: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
2392
+ }, z.core.$strict>;
2393
+ readonly requestExample: {
2394
+ readonly cron: "0 9 * * 1-5";
2395
+ readonly data: {
2396
+ readonly report: "daily";
2397
+ };
2398
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
2399
+ readonly partitionKey: "campaign.spring";
2400
+ readonly timeZone: "Europe/London";
2401
+ };
2402
+ readonly requestHeaders: z.ZodObject<{
2403
+ "Idempotency-Key": z.ZodOptional<z.ZodString>;
2404
+ }, z.core.$strip>;
2405
+ readonly response: z.ZodObject<{
2406
+ occurrence: z.ZodObject<{
2407
+ attemptCount: z.ZodNumber;
2408
+ generation: z.ZodNumber;
2409
+ id: z.ZodString;
2410
+ plannedFor: z.ZodString;
2411
+ schedule: z.ZodString;
2412
+ sequence: z.ZodNumber;
2413
+ settledAt: z.ZodOptional<z.ZodString>;
2414
+ state: z.ZodEnum<{
2415
+ succeeded: "succeeded";
2416
+ ambiguous: "ambiguous";
2417
+ cancelled: "cancelled";
2418
+ planned: "planned";
2419
+ due: "due";
2420
+ dispatching: "dispatching";
2421
+ retry_wait: "retry_wait";
2422
+ terminal_failed: "terminal_failed";
2423
+ skipped_stale: "skipped_stale";
2424
+ }>;
2425
+ }, z.core.$strip>;
2426
+ schedule: z.ZodObject<{
2427
+ archivedAt: z.ZodOptional<z.ZodString>;
2428
+ createdAt: z.ZodString;
2429
+ delivery: z.ZodOptional<z.ZodObject<{
2430
+ completion: z.ZodEnum<{
2431
+ response: "response";
2432
+ callback: "callback";
2433
+ }>;
2434
+ maxDurationSeconds: z.ZodNumber;
2435
+ onOverlap: z.ZodEnum<{
2436
+ skip: "skip";
2437
+ queue: "queue";
2438
+ }>;
2439
+ }, z.core.$strip>>;
2440
+ endpoint: z.ZodOptional<z.ZodString>;
2441
+ generation: z.ZodNumber;
2442
+ id: z.ZodString;
2443
+ latencyClass: z.ZodEnum<{
2444
+ realtime: "realtime";
2445
+ bulk: "bulk";
2446
+ }>;
2447
+ partitionKey: z.ZodOptional<z.ZodString>;
2448
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
2449
+ kind: z.ZodLiteral<"at">;
2450
+ }, z.core.$strip>, z.ZodObject<{
2451
+ everySeconds: z.ZodNumber;
2452
+ kind: z.ZodLiteral<"every">;
2453
+ }, z.core.$strip>, z.ZodObject<{
2454
+ cron: z.ZodString;
2455
+ kind: z.ZodLiteral<"cron">;
2456
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
2457
+ }, z.core.$strip>], "kind">;
2458
+ status: z.ZodEnum<{
2459
+ paused: "paused";
2460
+ active: "active";
2461
+ cancelled: "cancelled";
2462
+ completed: "completed";
2463
+ }>;
2464
+ updatedAt: z.ZodString;
2465
+ version: z.ZodNumber;
2466
+ }, z.core.$strip>;
2467
+ }, z.core.$strip>;
2468
+ readonly responseHeaders: z.ZodObject<{
2469
+ ETag: z.ZodString;
2470
+ "Idempotency-Replayed": z.ZodOptional<z.ZodLiteral<"true">>;
2471
+ }, z.core.$strip>;
2472
+ readonly scopes: readonly ["schedules:write"];
2473
+ readonly sessionAuthority: "headers";
2474
+ readonly summary: "Create a schedule";
2475
+ readonly surfaces: readonly ["api", "mock"];
2476
+ }, {
2477
+ readonly creates: false;
2478
+ readonly description: "Reads one schedule and its next occurrence from the partition that owns it. A schedule belonging to another organization, project or environment answers not_found rather than a refusal that would confirm it exists. The response carries the schedule's version as a strong ETag; send it back in `If-Match` to make a later write conditional on nothing having changed in between.";
2479
+ readonly example: {
2480
+ readonly occurrence: {
2481
+ readonly attemptCount: 0;
2482
+ readonly generation: 1;
2483
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
2484
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
2485
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2486
+ readonly sequence: 1;
2487
+ readonly state: "planned";
2488
+ };
2489
+ readonly schedule: {
2490
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
2491
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
2492
+ readonly generation: 1;
2493
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2494
+ readonly latencyClass: "realtime";
2495
+ readonly partitionKey: "campaign.spring";
2496
+ readonly recurrence: {
2497
+ readonly kind: "at";
2498
+ };
2499
+ readonly status: "active";
2500
+ readonly updatedAt: "2026-07-28T14:59:00.000Z";
2501
+ readonly version: 1;
2502
+ };
2503
+ };
2504
+ readonly id: "schedules.read";
2505
+ readonly idempotent: true;
2506
+ readonly mcp: {
2507
+ readonly destructive: false;
2508
+ readonly kind: "tool";
2509
+ readonly openWorld: false;
2510
+ };
2511
+ readonly method: "GET";
2512
+ readonly mutates: false;
2513
+ readonly path: "/v1/schedules/{scheduleId}";
2514
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2515
+ readonly problems: readonly ["invalid_request", "not_found"];
2516
+ readonly response: z.ZodObject<{
2517
+ occurrence: z.ZodObject<{
2518
+ attemptCount: z.ZodNumber;
2519
+ generation: z.ZodNumber;
2520
+ id: z.ZodString;
2521
+ plannedFor: z.ZodString;
2522
+ schedule: z.ZodString;
2523
+ sequence: z.ZodNumber;
2524
+ settledAt: z.ZodOptional<z.ZodString>;
2525
+ state: z.ZodEnum<{
2526
+ succeeded: "succeeded";
2527
+ ambiguous: "ambiguous";
2528
+ cancelled: "cancelled";
2529
+ planned: "planned";
2530
+ due: "due";
2531
+ dispatching: "dispatching";
2532
+ retry_wait: "retry_wait";
2533
+ terminal_failed: "terminal_failed";
2534
+ skipped_stale: "skipped_stale";
2535
+ }>;
2536
+ }, z.core.$strip>;
2537
+ schedule: z.ZodObject<{
2538
+ archivedAt: z.ZodOptional<z.ZodString>;
2539
+ createdAt: z.ZodString;
2540
+ delivery: z.ZodOptional<z.ZodObject<{
2541
+ completion: z.ZodEnum<{
2542
+ response: "response";
2543
+ callback: "callback";
2544
+ }>;
2545
+ maxDurationSeconds: z.ZodNumber;
2546
+ onOverlap: z.ZodEnum<{
2547
+ skip: "skip";
2548
+ queue: "queue";
2549
+ }>;
2550
+ }, z.core.$strip>>;
2551
+ endpoint: z.ZodOptional<z.ZodString>;
2552
+ generation: z.ZodNumber;
2553
+ id: z.ZodString;
2554
+ latencyClass: z.ZodEnum<{
2555
+ realtime: "realtime";
2556
+ bulk: "bulk";
2557
+ }>;
2558
+ partitionKey: z.ZodOptional<z.ZodString>;
2559
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
2560
+ kind: z.ZodLiteral<"at">;
2561
+ }, z.core.$strip>, z.ZodObject<{
2562
+ everySeconds: z.ZodNumber;
2563
+ kind: z.ZodLiteral<"every">;
2564
+ }, z.core.$strip>, z.ZodObject<{
2565
+ cron: z.ZodString;
2566
+ kind: z.ZodLiteral<"cron">;
2567
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
2568
+ }, z.core.$strip>], "kind">;
2569
+ status: z.ZodEnum<{
2570
+ paused: "paused";
2571
+ active: "active";
2572
+ cancelled: "cancelled";
2573
+ completed: "completed";
2574
+ }>;
2575
+ updatedAt: z.ZodString;
2576
+ version: z.ZodNumber;
2577
+ }, z.core.$strip>;
2578
+ }, z.core.$strip>;
2579
+ readonly responseHeaders: z.ZodObject<{
2580
+ ETag: z.ZodString;
2581
+ }, z.core.$strip>;
2582
+ readonly scopes: readonly ["schedules:read"];
2583
+ readonly sessionAuthority: "headers";
2584
+ readonly summary: "Read a schedule";
2585
+ readonly surfaces: readonly ["api", "mock"];
2586
+ }, {
2587
+ readonly creates: false;
2588
+ readonly description: "Lists the caller's own schedules, oldest first, one page at a time. Archived schedules are left out: archiving is how a schedule leaves the working set, and a listing that still carried them would make the operation pointless. Items are schedules rather than schedules-with-occurrences, because a cross-partition listing is served from a projection that holds a summary; read a schedule to get its authoritative next occurrence. Every page states whether it is authoritative or projected.";
2589
+ readonly example: {
2590
+ readonly data: readonly [{
2591
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
2592
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
2593
+ readonly generation: 1;
2594
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2595
+ readonly latencyClass: "realtime";
2596
+ readonly recurrence: {
2597
+ readonly kind: "at";
2598
+ };
2599
+ readonly status: "active";
2600
+ readonly updatedAt: "2026-07-28T14:59:00.000Z";
2601
+ readonly version: 1;
2602
+ }];
2603
+ readonly freshness: {
2604
+ readonly asOf: "2026-07-28T15:00:00.000Z";
2605
+ readonly kind: "projected";
2606
+ readonly lagSeconds: 0;
2607
+ };
2608
+ readonly nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoic2NoXzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0";
2609
+ };
2610
+ readonly id: "schedules.list";
2611
+ readonly idempotent: true;
2612
+ readonly mcp: {
2613
+ readonly destructive: false;
2614
+ readonly kind: "tool";
2615
+ readonly openWorld: false;
2616
+ };
2617
+ readonly method: "GET";
2618
+ readonly mutates: false;
2619
+ readonly path: "/v1/schedules";
2620
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2621
+ readonly problems: readonly ["invalid_request"];
2622
+ readonly query: z.ZodObject<{
2623
+ cursor: z.ZodOptional<z.ZodString>;
2624
+ limit: z.ZodDefault<z.ZodNumber>;
2625
+ }, z.core.$strip>;
2626
+ readonly response: z.ZodObject<{
2627
+ data: z.ZodArray<z.ZodObject<{
2628
+ archivedAt: z.ZodOptional<z.ZodString>;
2629
+ createdAt: z.ZodString;
2630
+ delivery: z.ZodOptional<z.ZodObject<{
2631
+ completion: z.ZodEnum<{
2632
+ response: "response";
2633
+ callback: "callback";
2634
+ }>;
2635
+ maxDurationSeconds: z.ZodNumber;
2636
+ onOverlap: z.ZodEnum<{
2637
+ skip: "skip";
2638
+ queue: "queue";
2639
+ }>;
2640
+ }, z.core.$strip>>;
2641
+ endpoint: z.ZodOptional<z.ZodString>;
2642
+ generation: z.ZodNumber;
2643
+ id: z.ZodString;
2644
+ latencyClass: z.ZodEnum<{
2645
+ realtime: "realtime";
2646
+ bulk: "bulk";
2647
+ }>;
2648
+ partitionKey: z.ZodOptional<z.ZodString>;
2649
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
2650
+ kind: z.ZodLiteral<"at">;
2651
+ }, z.core.$strip>, z.ZodObject<{
2652
+ everySeconds: z.ZodNumber;
2653
+ kind: z.ZodLiteral<"every">;
2654
+ }, z.core.$strip>, z.ZodObject<{
2655
+ cron: z.ZodString;
2656
+ kind: z.ZodLiteral<"cron">;
2657
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
2658
+ }, z.core.$strip>], "kind">;
2659
+ status: z.ZodEnum<{
2660
+ paused: "paused";
2661
+ active: "active";
2662
+ cancelled: "cancelled";
2663
+ completed: "completed";
2664
+ }>;
2665
+ updatedAt: z.ZodString;
2666
+ version: z.ZodNumber;
2667
+ }, z.core.$strip>>;
2668
+ freshness: z.ZodDiscriminatedUnion<[z.ZodObject<{
2669
+ kind: z.ZodLiteral<"authoritative">;
2670
+ }, z.core.$strip>, z.ZodObject<{
2671
+ asOf: z.ZodString;
2672
+ kind: z.ZodLiteral<"projected">;
2673
+ lagSeconds: z.ZodNumber;
2674
+ }, z.core.$strip>], "kind">;
2675
+ nextCursor: z.ZodOptional<z.ZodString>;
2676
+ }, z.core.$strip>;
2677
+ readonly scopes: readonly ["schedules:read"];
2678
+ readonly sessionAuthority: "headers";
2679
+ readonly summary: "List schedules";
2680
+ readonly surfaces: readonly ["api", "mock"];
2681
+ }, {
2682
+ readonly creates: false;
2683
+ readonly description: "Counts the occurrences this project and environment expect to fire, in epoch-aligned time buckets, with a latency-class split on every bucket and an optional customer partition-key breakdown. A recurring series contributes every instant it fires inside the window rather than only its next one, and `nextFireCount` reports how many of a bucket's occurrences are a schedule's next firing. The answer states its own freshness and is refused rather than shortened when a partition cannot complete it. It carries counts only: no schedule identifier, callback destination, payload or endpoint detail has a field in the response.";
2684
+ readonly example: {
2685
+ readonly buckets: readonly [{
2686
+ readonly byLatencyClass: {
2687
+ readonly bulk: 12;
2688
+ readonly realtime: 3;
2689
+ };
2690
+ readonly byPartitionKey: {
2691
+ readonly "campaign.spring": 9;
2692
+ readonly "campaign.winter": 4;
2693
+ };
2694
+ readonly count: 15;
2695
+ readonly nextFireCount: 4;
2696
+ readonly otherPartitionKeyCount: 2;
2697
+ readonly start: "2026-07-28T15:00:00.000Z";
2698
+ }];
2699
+ readonly freshness: {
2700
+ readonly asOf: "2026-07-28T14:58:30.000Z";
2701
+ readonly kind: "projected";
2702
+ readonly lagSeconds: 90;
2703
+ };
2704
+ readonly window: {
2705
+ readonly bucketSeconds: 1800;
2706
+ readonly from: "2026-07-28T15:00:00.000Z";
2707
+ readonly to: "2026-07-29T15:00:00.000Z";
2708
+ };
2709
+ };
2710
+ readonly id: "forecast.read";
2711
+ readonly idempotent: true;
2712
+ readonly mcp: {
2713
+ readonly destructive: false;
2714
+ readonly kind: "tool";
2715
+ readonly openWorld: false;
2716
+ };
2717
+ readonly method: "GET";
2718
+ readonly mutates: false;
2719
+ readonly path: "/v1/forecast";
2720
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2721
+ readonly problems: readonly ["invalid_request"];
2722
+ readonly query: z.ZodObject<{
2723
+ breakdown: z.ZodDefault<z.ZodEnum<{
2724
+ none: "none";
2725
+ partitionKey: "partitionKey";
2726
+ }>>;
2727
+ bucketSeconds: z.ZodDefault<z.ZodNumber>;
2728
+ from: z.ZodOptional<z.ZodString>;
2729
+ to: z.ZodOptional<z.ZodString>;
2730
+ }, z.core.$strip>;
2731
+ readonly response: z.ZodObject<{
2732
+ buckets: z.ZodArray<z.ZodObject<{
2733
+ byLatencyClass: z.ZodObject<{
2734
+ bulk: z.ZodNumber;
2735
+ realtime: z.ZodNumber;
2736
+ }, z.core.$strip>;
2737
+ byPartitionKey: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2738
+ count: z.ZodNumber;
2739
+ nextFireCount: z.ZodNumber;
2740
+ otherPartitionKeyCount: z.ZodOptional<z.ZodNumber>;
2741
+ start: z.ZodString;
2742
+ }, z.core.$strip>>;
2743
+ freshness: z.ZodObject<{
2744
+ asOf: z.ZodString;
2745
+ kind: z.ZodLiteral<"projected">;
2746
+ lagSeconds: z.ZodNumber;
2747
+ }, z.core.$strip>;
2748
+ window: z.ZodObject<{
2749
+ bucketSeconds: z.ZodNumber;
2750
+ from: z.ZodString;
2751
+ to: z.ZodString;
2752
+ }, z.core.$strip>;
2753
+ }, z.core.$strip>;
2754
+ readonly scopes: readonly ["forecast:read"];
2755
+ readonly sessionAuthority: "headers";
2756
+ readonly summary: "Forecast upcoming occurrences";
2757
+ readonly surfaces: readonly ["api", "mock"];
2758
+ }, {
2759
+ readonly creates: false;
2760
+ readonly description: "What this project was charged for, by UTC day, from the authoritative scheduling model. One terminal occurrence is one billable unit however many attempts it took, so a schedule that failed four times and succeeded on the fifth appears here once; the attempts it cost are on that occurrence's own attempt history. Days with no billable occurrence are absent rather than zero, and the window states which days the answer covers. `from` and `to` are snapped outward to UTC midnight, so an answer always covers whole days.";
2761
+ readonly example: {
2762
+ readonly days: readonly [{
2763
+ readonly billableOccurrences: 42;
2764
+ readonly byTerminalState: {
2765
+ readonly succeeded: 40;
2766
+ readonly terminal_failed: 2;
2767
+ };
2768
+ readonly start: "2026-07-28T00:00:00.000Z";
2769
+ }];
2770
+ readonly freshness: {
2771
+ readonly kind: "authoritative";
2772
+ };
2773
+ readonly totalBillableOccurrences: 42;
2774
+ readonly window: {
2775
+ readonly from: "2026-07-28T00:00:00.000Z";
2776
+ readonly to: "2026-07-29T00:00:00.000Z";
2777
+ };
2778
+ };
2779
+ readonly id: "usage.read";
2780
+ readonly idempotent: true;
2781
+ readonly mcp: {
2782
+ readonly destructive: false;
2783
+ readonly kind: "tool";
2784
+ readonly openWorld: false;
2785
+ };
2786
+ readonly method: "GET";
2787
+ readonly mutates: false;
2788
+ readonly path: "/v1/usage";
2789
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2790
+ readonly problems: readonly ["invalid_request"];
2791
+ readonly query: z.ZodObject<{
2792
+ from: z.ZodOptional<z.ZodString>;
2793
+ to: z.ZodOptional<z.ZodString>;
2794
+ }, z.core.$strict>;
2795
+ readonly response: z.ZodObject<{
2796
+ days: z.ZodArray<z.ZodObject<{
2797
+ billableOccurrences: z.ZodNumber;
2798
+ byTerminalState: z.ZodRecord<z.ZodEnum<{
2799
+ succeeded: "succeeded";
2800
+ cancelled: "cancelled";
2801
+ terminal_failed: "terminal_failed";
2802
+ skipped_stale: "skipped_stale";
2803
+ }> & z.core.$partial, z.ZodNumber>;
2804
+ start: z.ZodString;
2805
+ }, z.core.$strip>>;
2806
+ freshness: z.ZodObject<{
2807
+ kind: z.ZodLiteral<"authoritative">;
2808
+ }, z.core.$strip>;
2809
+ totalBillableOccurrences: z.ZodNumber;
2810
+ window: z.ZodObject<{
2811
+ from: z.ZodString;
2812
+ to: z.ZodString;
2813
+ }, z.core.$strip>;
2814
+ }, z.core.$strip>;
2815
+ readonly scopes: readonly ["usage:read"];
2816
+ readonly sessionAuthority: "headers";
2817
+ readonly summary: "Read billable usage by day";
2818
+ readonly surfaces: readonly ["api", "mock"];
2819
+ }, {
2820
+ readonly creates: false;
2821
+ readonly description: "The same forecast in the window shape the legacy scheduler's autoscaler already parses, published under a dated version so a consumer can pin it. It exists for one migration and is expected to be withdrawn once that migration completes; `forecast.read` is the shape this product publishes. `byTenant` is the customer partition-key breakdown under its legacy name, and `count` is always the bucket total rather than the named subtotal.";
2822
+ readonly example: {
2823
+ readonly bucketSeconds: 600;
2824
+ readonly buckets: readonly [{
2825
+ readonly byTenant: {
2826
+ readonly "campaign.spring": 9;
2827
+ readonly "campaign.winter": 4;
2828
+ };
2829
+ readonly count: 15;
2830
+ readonly nextFireCount: 4;
2831
+ readonly otherCount: 2;
2832
+ readonly start: "2026-07-28T15:00:00.000Z";
2833
+ }];
2834
+ readonly freshness: {
2835
+ readonly asOf: "2026-07-28T14:58:30.000Z";
2836
+ readonly kind: "projected";
2837
+ readonly lagSeconds: 90;
2838
+ };
2839
+ readonly version: "2026-08-09";
2840
+ };
2841
+ readonly id: "forecast.windows";
2842
+ readonly idempotent: true;
2843
+ readonly mcp: {
2844
+ readonly kind: "unavailable";
2845
+ readonly reason: "A transitional shape for the autoscaler migration, scheduled for withdrawal once W6-02 has cut over. forecast.read is the same data in the shape this product publishes, and it is the tool an agent should reach for.";
2846
+ };
2847
+ readonly method: "GET";
2848
+ readonly mutates: false;
2849
+ readonly path: "/v1/forecast/windows";
2850
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2851
+ readonly problems: readonly ["invalid_request"];
2852
+ readonly query: z.ZodObject<{
2853
+ breakdown: z.ZodDefault<z.ZodEnum<{
2854
+ none: "none";
2855
+ partitionKey: "partitionKey";
2856
+ }>>;
2857
+ bucketSeconds: z.ZodDefault<z.ZodNumber>;
2858
+ from: z.ZodOptional<z.ZodString>;
2859
+ to: z.ZodOptional<z.ZodString>;
2860
+ }, z.core.$strip>;
2861
+ readonly response: z.ZodObject<{
2862
+ bucketSeconds: z.ZodNumber;
2863
+ buckets: z.ZodArray<z.ZodObject<{
2864
+ byTenant: z.ZodRecord<z.ZodString, z.ZodNumber>;
2865
+ count: z.ZodNumber;
2866
+ nextFireCount: z.ZodNumber;
2867
+ otherCount: z.ZodNumber;
2868
+ start: z.ZodString;
2869
+ }, z.core.$strip>>;
2870
+ freshness: z.ZodDiscriminatedUnion<[z.ZodObject<{
2871
+ kind: z.ZodLiteral<"authoritative">;
2872
+ }, z.core.$strip>, z.ZodObject<{
2873
+ asOf: z.ZodString;
2874
+ kind: z.ZodLiteral<"projected">;
2875
+ lagSeconds: z.ZodNumber;
2876
+ }, z.core.$strip>], "kind">;
2877
+ version: z.ZodLiteral<"2026-08-09">;
2878
+ }, z.core.$strip>;
2879
+ readonly scopes: readonly ["forecast:read"];
2880
+ readonly sessionAuthority: "headers";
2881
+ readonly summary: "Forecast in the transitional window shape";
2882
+ readonly surfaces: readonly ["api", "mock"];
2883
+ }, {
2884
+ readonly creates: false;
2885
+ readonly description: "Lists the retained occurrences of one schedule from its authoritative Scheduler Partition, ordered by durable creation instant and occurrence identifier so tied timestamps never duplicate or omit a row. The cursor is opaque and scoped to the verified principal's organization, project and environment. Each item is metadata only: callback payloads, destinations, response bodies and signing material have no field in the response.";
2886
+ readonly example: {
2887
+ readonly data: readonly [{
2888
+ readonly attemptCount: 1;
2889
+ readonly generation: 1;
2890
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
2891
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
2892
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2893
+ readonly sequence: 1;
2894
+ readonly state: "retry_wait";
2895
+ }];
2896
+ readonly freshness: {
2897
+ readonly kind: "authoritative";
2898
+ };
2899
+ readonly nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoib2NjXzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0";
2900
+ };
2901
+ readonly id: "occurrences.list";
2902
+ readonly idempotent: true;
2903
+ readonly mcp: {
2904
+ readonly destructive: false;
2905
+ readonly kind: "tool";
2906
+ readonly openWorld: false;
2907
+ };
2908
+ readonly method: "GET";
2909
+ readonly mutates: false;
2910
+ readonly path: "/v1/schedules/{scheduleId}/occurrences";
2911
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2912
+ readonly problems: readonly ["invalid_request", "not_found"];
2913
+ readonly query: z.ZodObject<{
2914
+ cursor: z.ZodOptional<z.ZodString>;
2915
+ limit: z.ZodDefault<z.ZodNumber>;
2916
+ }, z.core.$strip>;
2917
+ readonly response: z.ZodObject<{
2918
+ data: z.ZodArray<z.ZodObject<{
2919
+ attemptCount: z.ZodNumber;
2920
+ generation: z.ZodNumber;
2921
+ id: z.ZodString;
2922
+ plannedFor: z.ZodString;
2923
+ schedule: z.ZodString;
2924
+ sequence: z.ZodNumber;
2925
+ settledAt: z.ZodOptional<z.ZodString>;
2926
+ state: z.ZodEnum<{
2927
+ succeeded: "succeeded";
2928
+ ambiguous: "ambiguous";
2929
+ cancelled: "cancelled";
2930
+ planned: "planned";
2931
+ due: "due";
2932
+ dispatching: "dispatching";
2933
+ retry_wait: "retry_wait";
2934
+ terminal_failed: "terminal_failed";
2935
+ skipped_stale: "skipped_stale";
2936
+ }>;
2937
+ }, z.core.$strip>>;
2938
+ nextCursor: z.ZodOptional<z.ZodString>;
2939
+ freshness: z.ZodObject<{
2940
+ kind: z.ZodLiteral<"authoritative">;
2941
+ }, z.core.$strip>;
2942
+ }, z.core.$strip>;
2943
+ readonly scopes: readonly ["occurrences:read"];
2944
+ readonly sessionAuthority: "headers";
2945
+ readonly summary: "List retained occurrences";
2946
+ readonly surfaces: readonly ["api", "mock"];
2947
+ }, {
2948
+ readonly creates: false;
2949
+ readonly description: "Reads one retained occurrence from the Scheduler Partition that owns its schedule. The response explicitly states that it is authoritative; a stale D1 directory or schedule projection is used only to find the partition and never as occurrence truth. An identifier outside the verified principal's organization, project or environment is indistinguishable from an absent occurrence.";
2950
+ readonly example: {
2951
+ readonly freshness: {
2952
+ readonly kind: "authoritative";
2953
+ };
2954
+ readonly occurrence: {
2955
+ readonly attemptCount: 2;
2956
+ readonly generation: 1;
2957
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
2958
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
2959
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
2960
+ readonly sequence: 1;
2961
+ readonly settledAt: "2026-07-28T15:02:00.000Z";
2962
+ readonly state: "terminal_failed";
2963
+ };
2964
+ };
2965
+ readonly id: "occurrences.read";
2966
+ readonly idempotent: true;
2967
+ readonly mcp: {
2968
+ readonly destructive: false;
2969
+ readonly kind: "tool";
2970
+ readonly openWorld: false;
2971
+ };
2972
+ readonly method: "GET";
2973
+ readonly mutates: false;
2974
+ readonly path: "/v1/schedules/{scheduleId}/occurrences/{occurrenceId}";
2975
+ readonly principals: readonly ["api-credential", "oauth", "session"];
2976
+ readonly problems: readonly ["invalid_request", "not_found"];
2977
+ readonly response: z.ZodObject<{
2978
+ freshness: z.ZodObject<{
2979
+ kind: z.ZodLiteral<"authoritative">;
2980
+ }, z.core.$strip>;
2981
+ occurrence: z.ZodObject<{
2982
+ attemptCount: z.ZodNumber;
2983
+ generation: z.ZodNumber;
2984
+ id: z.ZodString;
2985
+ plannedFor: z.ZodString;
2986
+ schedule: z.ZodString;
2987
+ sequence: z.ZodNumber;
2988
+ settledAt: z.ZodOptional<z.ZodString>;
2989
+ state: z.ZodEnum<{
2990
+ succeeded: "succeeded";
2991
+ ambiguous: "ambiguous";
2992
+ cancelled: "cancelled";
2993
+ planned: "planned";
2994
+ due: "due";
2995
+ dispatching: "dispatching";
2996
+ retry_wait: "retry_wait";
2997
+ terminal_failed: "terminal_failed";
2998
+ skipped_stale: "skipped_stale";
2999
+ }>;
3000
+ }, z.core.$strip>;
3001
+ }, z.core.$strip>;
3002
+ readonly scopes: readonly ["occurrences:read"];
3003
+ readonly sessionAuthority: "headers";
3004
+ readonly summary: "Read an occurrence";
3005
+ readonly surfaces: readonly ["api", "mock"];
3006
+ }, {
3007
+ readonly creates: false;
3008
+ readonly description: "Lists the immutable attempts retained under one occurrence, ordered by start instant and attempt identifier so equal timestamps have a stable position. The owning Scheduler Partition is authoritative and every page says so. Results expose only bounded outcome, response-status, duration, diagnostic, remediation and redelivery-cause metadata; callback payloads, response bodies, destinations, signing material, secrets and transport traces are structurally absent.";
3009
+ readonly example: {
3010
+ readonly data: readonly [{
3011
+ readonly attemptNumber: 1;
3012
+ readonly classifiedAt: "2026-07-28T15:00:00.071Z";
3013
+ readonly delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8";
3014
+ readonly diagnostic: "http_retryable";
3015
+ readonly durationMs: 71;
3016
+ readonly id: "att_01h8xyz9k2m4n6p8r0t2v4w6y8";
3017
+ readonly occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3018
+ readonly remediation: "review_retry_policy";
3019
+ readonly responseStatus: 503;
3020
+ readonly startedAt: "2026-07-28T15:00:00.000Z";
3021
+ readonly state: "retryable_failure";
3022
+ readonly trigger: {
3023
+ readonly kind: "automatic";
3024
+ };
3025
+ }];
3026
+ readonly freshness: {
3027
+ readonly kind: "authoritative";
3028
+ };
3029
+ readonly nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoiYXR0XzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0";
3030
+ };
3031
+ readonly id: "attempts.list";
3032
+ readonly idempotent: true;
3033
+ readonly mcp: {
3034
+ readonly destructive: false;
3035
+ readonly kind: "tool";
3036
+ readonly openWorld: false;
3037
+ };
3038
+ readonly method: "GET";
3039
+ readonly mutates: false;
3040
+ readonly path: "/v1/schedules/{scheduleId}/occurrences/{occurrenceId}/attempts";
3041
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3042
+ readonly problems: readonly ["invalid_request", "not_found"];
3043
+ readonly query: z.ZodObject<{
3044
+ cursor: z.ZodOptional<z.ZodString>;
3045
+ limit: z.ZodDefault<z.ZodNumber>;
3046
+ }, z.core.$strip>;
3047
+ readonly response: z.ZodObject<{
3048
+ data: z.ZodArray<z.ZodObject<{
3049
+ attemptNumber: z.ZodNumber;
3050
+ classifiedAt: z.ZodOptional<z.ZodString>;
3051
+ delivery: z.ZodString;
3052
+ diagnostic: z.ZodOptional<z.ZodEnum<{
3053
+ rate_limited: "rate_limited";
3054
+ completion_timed_out: "completion_timed_out";
3055
+ delivered: "delivered";
3056
+ duplicate_inflight: "duplicate_inflight";
3057
+ endpoint_unavailable: "endpoint_unavailable";
3058
+ endpoint_unsafe: "endpoint_unsafe";
3059
+ http_refused: "http_refused";
3060
+ http_retryable: "http_retryable";
3061
+ http_terminal: "http_terminal";
3062
+ identity_conflict: "identity_conflict";
3063
+ network_ambiguous: "network_ambiguous";
3064
+ payload_unavailable: "payload_unavailable";
3065
+ }>>;
3066
+ durationMs: z.ZodOptional<z.ZodNumber>;
3067
+ id: z.ZodString;
3068
+ occurrence: z.ZodString;
3069
+ remediation: z.ZodOptional<z.ZodEnum<{
3070
+ none: "none";
3071
+ review_retry_policy: "review_retry_policy";
3072
+ inspect_receiver: "inspect_receiver";
3073
+ verify_endpoint: "verify_endpoint";
3074
+ replace_payload: "replace_payload";
3075
+ contact_support: "contact_support";
3076
+ review_before_redelivery: "review_before_redelivery";
3077
+ }>>;
3078
+ failureSnippet: z.ZodOptional<z.ZodObject<{
3079
+ contentType: z.ZodString;
3080
+ text: z.ZodString;
3081
+ truncated: z.ZodBoolean;
3082
+ }, z.core.$strip>>;
3083
+ responseHeaders: z.ZodOptional<z.ZodArray<z.ZodObject<{
3084
+ name: z.ZodString;
3085
+ value: z.ZodString;
3086
+ }, z.core.$strip>>>;
3087
+ responseStatus: z.ZodOptional<z.ZodNumber>;
3088
+ startedAt: z.ZodString;
3089
+ state: z.ZodOptional<z.ZodEnum<{
3090
+ succeeded: "succeeded";
3091
+ ambiguous: "ambiguous";
3092
+ retryable_failure: "retryable_failure";
3093
+ terminal_failure: "terminal_failure";
3094
+ }>>;
3095
+ trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
3096
+ kind: z.ZodLiteral<"automatic">;
3097
+ }, z.core.$strip>, z.ZodObject<{
3098
+ kind: z.ZodLiteral<"redelivery">;
3099
+ sourceAttemptId: z.ZodString;
3100
+ }, z.core.$strip>], "kind">;
3101
+ }, z.core.$strip>>;
3102
+ nextCursor: z.ZodOptional<z.ZodString>;
3103
+ freshness: z.ZodObject<{
3104
+ kind: z.ZodLiteral<"authoritative">;
3105
+ }, z.core.$strip>;
3106
+ }, z.core.$strip>;
3107
+ readonly scopes: readonly ["occurrences:read"];
3108
+ readonly sessionAuthority: "headers";
3109
+ readonly summary: "List delivery attempts";
3110
+ readonly surfaces: readonly ["api", "mock"];
3111
+ }, {
3112
+ readonly creates: false;
3113
+ readonly description: "Reads one immutable delivery attempt from its occurrence's authoritative Scheduler Partition. Ambiguous means the receiver may have acted and is never rewritten into certainty without durable result evidence. The bounded response omits callback payloads, response bodies, destinations, signing material, secrets and raw transport failures by construction.";
3114
+ readonly example: {
3115
+ readonly attempt: {
3116
+ readonly attemptNumber: 2;
3117
+ readonly classifiedAt: "2026-07-28T15:02:00.000Z";
3118
+ readonly delivery: "dlv_11h8xyz9k2m4n6p8r0t2v4w6y8";
3119
+ readonly diagnostic: "network_ambiguous";
3120
+ readonly durationMs: 10000;
3121
+ readonly id: "att_11h8xyz9k2m4n6p8r0t2v4w6y8";
3122
+ readonly occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3123
+ readonly remediation: "review_before_redelivery";
3124
+ readonly startedAt: "2026-07-28T15:01:50.000Z";
3125
+ readonly state: "ambiguous";
3126
+ readonly trigger: {
3127
+ readonly kind: "automatic";
3128
+ };
3129
+ };
3130
+ readonly freshness: {
3131
+ readonly kind: "authoritative";
3132
+ };
3133
+ };
3134
+ readonly id: "attempts.read";
3135
+ readonly idempotent: true;
3136
+ readonly mcp: {
3137
+ readonly destructive: false;
3138
+ readonly kind: "tool";
3139
+ readonly openWorld: false;
3140
+ };
3141
+ readonly method: "GET";
3142
+ readonly mutates: false;
3143
+ readonly path: "/v1/schedules/{scheduleId}/occurrences/{occurrenceId}/attempts/{attemptId}";
3144
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3145
+ readonly problems: readonly ["invalid_request", "not_found"];
3146
+ readonly response: z.ZodObject<{
3147
+ attempt: z.ZodObject<{
3148
+ attemptNumber: z.ZodNumber;
3149
+ classifiedAt: z.ZodOptional<z.ZodString>;
3150
+ delivery: z.ZodString;
3151
+ diagnostic: z.ZodOptional<z.ZodEnum<{
3152
+ rate_limited: "rate_limited";
3153
+ completion_timed_out: "completion_timed_out";
3154
+ delivered: "delivered";
3155
+ duplicate_inflight: "duplicate_inflight";
3156
+ endpoint_unavailable: "endpoint_unavailable";
3157
+ endpoint_unsafe: "endpoint_unsafe";
3158
+ http_refused: "http_refused";
3159
+ http_retryable: "http_retryable";
3160
+ http_terminal: "http_terminal";
3161
+ identity_conflict: "identity_conflict";
3162
+ network_ambiguous: "network_ambiguous";
3163
+ payload_unavailable: "payload_unavailable";
3164
+ }>>;
3165
+ durationMs: z.ZodOptional<z.ZodNumber>;
3166
+ id: z.ZodString;
3167
+ occurrence: z.ZodString;
3168
+ remediation: z.ZodOptional<z.ZodEnum<{
3169
+ none: "none";
3170
+ review_retry_policy: "review_retry_policy";
3171
+ inspect_receiver: "inspect_receiver";
3172
+ verify_endpoint: "verify_endpoint";
3173
+ replace_payload: "replace_payload";
3174
+ contact_support: "contact_support";
3175
+ review_before_redelivery: "review_before_redelivery";
3176
+ }>>;
3177
+ failureSnippet: z.ZodOptional<z.ZodObject<{
3178
+ contentType: z.ZodString;
3179
+ text: z.ZodString;
3180
+ truncated: z.ZodBoolean;
3181
+ }, z.core.$strip>>;
3182
+ responseHeaders: z.ZodOptional<z.ZodArray<z.ZodObject<{
3183
+ name: z.ZodString;
3184
+ value: z.ZodString;
3185
+ }, z.core.$strip>>>;
3186
+ responseStatus: z.ZodOptional<z.ZodNumber>;
3187
+ startedAt: z.ZodString;
3188
+ state: z.ZodOptional<z.ZodEnum<{
3189
+ succeeded: "succeeded";
3190
+ ambiguous: "ambiguous";
3191
+ retryable_failure: "retryable_failure";
3192
+ terminal_failure: "terminal_failure";
3193
+ }>>;
3194
+ trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
3195
+ kind: z.ZodLiteral<"automatic">;
3196
+ }, z.core.$strip>, z.ZodObject<{
3197
+ kind: z.ZodLiteral<"redelivery">;
3198
+ sourceAttemptId: z.ZodString;
3199
+ }, z.core.$strip>], "kind">;
3200
+ }, z.core.$strip>;
3201
+ freshness: z.ZodObject<{
3202
+ kind: z.ZodLiteral<"authoritative">;
3203
+ }, z.core.$strip>;
3204
+ }, z.core.$strip>;
3205
+ readonly scopes: readonly ["occurrences:read"];
3206
+ readonly sessionAuthority: "headers";
3207
+ readonly summary: "Read a delivery attempt";
3208
+ readonly surfaces: readonly ["api", "mock"];
3209
+ }, {
3210
+ readonly creates: true;
3211
+ readonly description: "Creates one new immutable attempt under the same retained terminal occurrence and dispatches it through the ordinary delivery boundary. The required Idempotency-Key makes an identical replay converge on the same attempt and conflicting reuse is refused. The new attempt names the retained attempt that caused the redelivery; no earlier identity or outcome is changed. MCP marks this outbound mutation for explicit approval even though it is non-destructive.";
3212
+ readonly example: {
3213
+ readonly attempt: {
3214
+ readonly attemptNumber: 3;
3215
+ readonly delivery: "dlv_21h8xyz9k2m4n6p8r0t2v4w6y8";
3216
+ readonly id: "att_21h8xyz9k2m4n6p8r0t2v4w6y8";
3217
+ readonly occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3218
+ readonly startedAt: "2026-07-28T15:05:00.000Z";
3219
+ readonly trigger: {
3220
+ readonly kind: "redelivery";
3221
+ readonly sourceAttemptId: "att_11h8xyz9k2m4n6p8r0t2v4w6y8";
3222
+ };
3223
+ };
3224
+ readonly freshness: {
3225
+ readonly kind: "authoritative";
3226
+ };
3227
+ };
3228
+ readonly id: "occurrences.redeliver";
3229
+ readonly idempotent: true;
3230
+ readonly mcp: {
3231
+ readonly destructive: false;
3232
+ readonly kind: "tool";
3233
+ readonly openWorld: true;
3234
+ };
3235
+ readonly method: "POST";
3236
+ readonly mutates: true;
3237
+ readonly path: "/v1/schedules/{scheduleId}/occurrences/{occurrenceId}/redeliver";
3238
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3239
+ readonly problems: readonly ["idempotency_key_reused", "invalid_request", "not_found", "service_unavailable", "state_conflict"];
3240
+ readonly requestHeaders: z.ZodObject<{
3241
+ "Idempotency-Key": z.ZodString;
3242
+ }, z.core.$strip>;
3243
+ readonly response: z.ZodObject<{
3244
+ attempt: z.ZodObject<{
3245
+ attemptNumber: z.ZodNumber;
3246
+ classifiedAt: z.ZodOptional<z.ZodString>;
3247
+ delivery: z.ZodString;
3248
+ diagnostic: z.ZodOptional<z.ZodEnum<{
3249
+ rate_limited: "rate_limited";
3250
+ completion_timed_out: "completion_timed_out";
3251
+ delivered: "delivered";
3252
+ duplicate_inflight: "duplicate_inflight";
3253
+ endpoint_unavailable: "endpoint_unavailable";
3254
+ endpoint_unsafe: "endpoint_unsafe";
3255
+ http_refused: "http_refused";
3256
+ http_retryable: "http_retryable";
3257
+ http_terminal: "http_terminal";
3258
+ identity_conflict: "identity_conflict";
3259
+ network_ambiguous: "network_ambiguous";
3260
+ payload_unavailable: "payload_unavailable";
3261
+ }>>;
3262
+ durationMs: z.ZodOptional<z.ZodNumber>;
3263
+ id: z.ZodString;
3264
+ occurrence: z.ZodString;
3265
+ remediation: z.ZodOptional<z.ZodEnum<{
3266
+ none: "none";
3267
+ review_retry_policy: "review_retry_policy";
3268
+ inspect_receiver: "inspect_receiver";
3269
+ verify_endpoint: "verify_endpoint";
3270
+ replace_payload: "replace_payload";
3271
+ contact_support: "contact_support";
3272
+ review_before_redelivery: "review_before_redelivery";
3273
+ }>>;
3274
+ failureSnippet: z.ZodOptional<z.ZodObject<{
3275
+ contentType: z.ZodString;
3276
+ text: z.ZodString;
3277
+ truncated: z.ZodBoolean;
3278
+ }, z.core.$strip>>;
3279
+ responseHeaders: z.ZodOptional<z.ZodArray<z.ZodObject<{
3280
+ name: z.ZodString;
3281
+ value: z.ZodString;
3282
+ }, z.core.$strip>>>;
3283
+ responseStatus: z.ZodOptional<z.ZodNumber>;
3284
+ startedAt: z.ZodString;
3285
+ state: z.ZodOptional<z.ZodEnum<{
3286
+ succeeded: "succeeded";
3287
+ ambiguous: "ambiguous";
3288
+ retryable_failure: "retryable_failure";
3289
+ terminal_failure: "terminal_failure";
3290
+ }>>;
3291
+ trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
3292
+ kind: z.ZodLiteral<"automatic">;
3293
+ }, z.core.$strip>, z.ZodObject<{
3294
+ kind: z.ZodLiteral<"redelivery">;
3295
+ sourceAttemptId: z.ZodString;
3296
+ }, z.core.$strip>], "kind">;
3297
+ }, z.core.$strip>;
3298
+ freshness: z.ZodObject<{
3299
+ kind: z.ZodLiteral<"authoritative">;
3300
+ }, z.core.$strip>;
3301
+ }, z.core.$strip>;
3302
+ readonly responseHeaders: z.ZodObject<{
3303
+ "Idempotency-Replayed": z.ZodOptional<z.ZodLiteral<"true">>;
3304
+ }, z.core.$strip>;
3305
+ readonly scopes: readonly ["occurrences:redeliver"];
3306
+ readonly sessionAuthority: "headers";
3307
+ readonly summary: "Redeliver an occurrence";
3308
+ readonly surfaces: readonly ["api", "mock"];
3309
+ }, {
3310
+ readonly creates: false;
3311
+ readonly description: "Replaces a schedule's definition, starting a new generation. Takes the same four ways of saying when as a create, so a one-shot can be replaced by a recurring definition and the other way round. An omitted callback endpoint/data pair preserves the stored callback; sending `data` alone replaces the encrypted data for the current endpoint, and sending `endpoint` selects a verified endpoint in the same authority tuple. The occurrence planned under the old definition is settled `skipped_stale` and can never fire unless it was already in flight, in which case its immutable attempt is allowed to settle honestly; a fresh occurrence is planned under the new definition, and the old definition's series stops advancing. Send `If-Match` with the version you read to make this conditional; without it the replace is unconditional and the last writer wins. A cancelled or completed schedule cannot be replaced. `partitionKey` is fixed when the schedule is created: omit it to preserve the stored value or echo that exact value in a GET → modify → PUT flow. Adding, changing, or clearing it is refused as `invalid_request` with `/partitionKey` identified. `latencyClass` remains derived from the replacement recurrence when the caller omits it.";
3312
+ readonly example: {
3313
+ readonly occurrence: {
3314
+ readonly attemptCount: 0;
3315
+ readonly generation: 2;
3316
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y9";
3317
+ readonly plannedFor: "2026-07-28T16:00:00.000Z";
3318
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3319
+ readonly sequence: 1;
3320
+ readonly state: "planned";
3321
+ };
3322
+ readonly schedule: {
3323
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
3324
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
3325
+ readonly generation: 2;
3326
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3327
+ readonly latencyClass: "realtime";
3328
+ readonly partitionKey: "campaign.spring";
3329
+ readonly recurrence: {
3330
+ readonly kind: "at";
3331
+ };
3332
+ readonly status: "active";
3333
+ readonly updatedAt: "2026-07-28T15:10:00.000Z";
3334
+ readonly version: 2;
3335
+ };
3336
+ };
3337
+ readonly id: "schedules.replace";
3338
+ readonly idempotent: true;
3339
+ readonly mcp: {
3340
+ readonly destructive: true;
3341
+ readonly kind: "tool";
3342
+ readonly openWorld: true;
3343
+ };
3344
+ readonly method: "PUT";
3345
+ readonly mutates: true;
3346
+ readonly path: "/v1/schedules/{scheduleId}";
3347
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3348
+ readonly problems: readonly ["endpoint_unverified", "invalid_request", "not_found", "plan_limit_reached", "service_unavailable", "state_conflict", "version_conflict"];
3349
+ readonly request: z.ZodObject<{
3350
+ at: z.ZodOptional<z.ZodString>;
3351
+ cron: z.ZodOptional<z.ZodString>;
3352
+ data: z.ZodOptional<z.ZodJSONSchema>;
3353
+ delaySeconds: z.ZodOptional<z.ZodNumber>;
3354
+ delivery: z.ZodOptional<z.ZodObject<{
3355
+ onOverlap: z.ZodOptional<z.ZodEnum<{
3356
+ skip: "skip";
3357
+ queue: "queue";
3358
+ }>>;
3359
+ completion: z.ZodOptional<z.ZodEnum<{
3360
+ response: "response";
3361
+ callback: "callback";
3362
+ }>>;
3363
+ maxDurationSeconds: z.ZodOptional<z.ZodLiteral<5 | 300 | 86400 | 30 | 900 | 1800 | 3600 | 43200>>;
3364
+ }, z.core.$strict>>;
3365
+ everySeconds: z.ZodOptional<z.ZodNumber>;
3366
+ endpoint: z.ZodOptional<z.ZodString>;
3367
+ latencyClass: z.ZodOptional<z.ZodEnum<{
3368
+ realtime: "realtime";
3369
+ bulk: "bulk";
3370
+ }>>;
3371
+ partitionKey: z.ZodOptional<z.ZodString>;
3372
+ timeZone: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
3373
+ }, z.core.$strict>;
3374
+ readonly requestExample: {
3375
+ readonly data: {
3376
+ readonly report: "weekly";
3377
+ };
3378
+ readonly everySeconds: 86400;
3379
+ readonly endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8";
3380
+ readonly partitionKey: "campaign.spring";
3381
+ };
3382
+ readonly requestHeaders: z.ZodObject<{
3383
+ "If-Match": z.ZodOptional<z.ZodString>;
3384
+ }, z.core.$strip>;
3385
+ readonly response: z.ZodObject<{
3386
+ occurrence: z.ZodObject<{
3387
+ attemptCount: z.ZodNumber;
3388
+ generation: z.ZodNumber;
3389
+ id: z.ZodString;
3390
+ plannedFor: z.ZodString;
3391
+ schedule: z.ZodString;
3392
+ sequence: z.ZodNumber;
3393
+ settledAt: z.ZodOptional<z.ZodString>;
3394
+ state: z.ZodEnum<{
3395
+ succeeded: "succeeded";
3396
+ ambiguous: "ambiguous";
3397
+ cancelled: "cancelled";
3398
+ planned: "planned";
3399
+ due: "due";
3400
+ dispatching: "dispatching";
3401
+ retry_wait: "retry_wait";
3402
+ terminal_failed: "terminal_failed";
3403
+ skipped_stale: "skipped_stale";
3404
+ }>;
3405
+ }, z.core.$strip>;
3406
+ schedule: z.ZodObject<{
3407
+ archivedAt: z.ZodOptional<z.ZodString>;
3408
+ createdAt: z.ZodString;
3409
+ delivery: z.ZodOptional<z.ZodObject<{
3410
+ completion: z.ZodEnum<{
3411
+ response: "response";
3412
+ callback: "callback";
3413
+ }>;
3414
+ maxDurationSeconds: z.ZodNumber;
3415
+ onOverlap: z.ZodEnum<{
3416
+ skip: "skip";
3417
+ queue: "queue";
3418
+ }>;
3419
+ }, z.core.$strip>>;
3420
+ endpoint: z.ZodOptional<z.ZodString>;
3421
+ generation: z.ZodNumber;
3422
+ id: z.ZodString;
3423
+ latencyClass: z.ZodEnum<{
3424
+ realtime: "realtime";
3425
+ bulk: "bulk";
3426
+ }>;
3427
+ partitionKey: z.ZodOptional<z.ZodString>;
3428
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
3429
+ kind: z.ZodLiteral<"at">;
3430
+ }, z.core.$strip>, z.ZodObject<{
3431
+ everySeconds: z.ZodNumber;
3432
+ kind: z.ZodLiteral<"every">;
3433
+ }, z.core.$strip>, z.ZodObject<{
3434
+ cron: z.ZodString;
3435
+ kind: z.ZodLiteral<"cron">;
3436
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
3437
+ }, z.core.$strip>], "kind">;
3438
+ status: z.ZodEnum<{
3439
+ paused: "paused";
3440
+ active: "active";
3441
+ cancelled: "cancelled";
3442
+ completed: "completed";
3443
+ }>;
3444
+ updatedAt: z.ZodString;
3445
+ version: z.ZodNumber;
3446
+ }, z.core.$strip>;
3447
+ }, z.core.$strip>;
3448
+ readonly responseHeaders: z.ZodObject<{
3449
+ ETag: z.ZodString;
3450
+ }, z.core.$strip>;
3451
+ readonly scopes: readonly ["schedules:write"];
3452
+ readonly sessionAuthority: "headers";
3453
+ readonly summary: "Replace a schedule";
3454
+ readonly surfaces: readonly ["api", "mock"];
3455
+ }, {
3456
+ readonly creates: false;
3457
+ readonly description: "Suspends a schedule without discarding it: its occurrence stays planned, its timer is released, and resume re-arms the original planned instant so elapsed work becomes due rather than being silently moved. A schedule with a dispatching or ambiguous callback is refused until that attempt settles, because pausing cannot strand its watchdog or turn a proven success into an unreachable completed state. Pausing an already paused schedule changes nothing and returns the same version, so a retry is free. A cancelled or completed schedule cannot be paused.";
3458
+ readonly example: {
3459
+ readonly occurrence: {
3460
+ readonly attemptCount: 0;
3461
+ readonly generation: 1;
3462
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3463
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
3464
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3465
+ readonly sequence: 1;
3466
+ readonly state: "planned";
3467
+ };
3468
+ readonly schedule: {
3469
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
3470
+ readonly generation: 1;
3471
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3472
+ readonly latencyClass: "realtime";
3473
+ readonly recurrence: {
3474
+ readonly kind: "at";
3475
+ };
3476
+ readonly status: "paused";
3477
+ readonly updatedAt: "2026-07-28T15:10:00.000Z";
3478
+ readonly version: 2;
3479
+ };
3480
+ };
3481
+ readonly id: "schedules.pause";
3482
+ readonly idempotent: true;
3483
+ readonly mcp: {
3484
+ readonly destructive: false;
3485
+ readonly kind: "tool";
3486
+ readonly openWorld: false;
3487
+ };
3488
+ readonly method: "POST";
3489
+ readonly mutates: true;
3490
+ readonly path: "/v1/schedules/{scheduleId}/pause";
3491
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3492
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict", "version_conflict"];
3493
+ readonly requestHeaders: z.ZodObject<{
3494
+ "If-Match": z.ZodOptional<z.ZodString>;
3495
+ }, z.core.$strip>;
3496
+ readonly response: z.ZodObject<{
3497
+ occurrence: z.ZodObject<{
3498
+ attemptCount: z.ZodNumber;
3499
+ generation: z.ZodNumber;
3500
+ id: z.ZodString;
3501
+ plannedFor: z.ZodString;
3502
+ schedule: z.ZodString;
3503
+ sequence: z.ZodNumber;
3504
+ settledAt: z.ZodOptional<z.ZodString>;
3505
+ state: z.ZodEnum<{
3506
+ succeeded: "succeeded";
3507
+ ambiguous: "ambiguous";
3508
+ cancelled: "cancelled";
3509
+ planned: "planned";
3510
+ due: "due";
3511
+ dispatching: "dispatching";
3512
+ retry_wait: "retry_wait";
3513
+ terminal_failed: "terminal_failed";
3514
+ skipped_stale: "skipped_stale";
3515
+ }>;
3516
+ }, z.core.$strip>;
3517
+ schedule: z.ZodObject<{
3518
+ archivedAt: z.ZodOptional<z.ZodString>;
3519
+ createdAt: z.ZodString;
3520
+ delivery: z.ZodOptional<z.ZodObject<{
3521
+ completion: z.ZodEnum<{
3522
+ response: "response";
3523
+ callback: "callback";
3524
+ }>;
3525
+ maxDurationSeconds: z.ZodNumber;
3526
+ onOverlap: z.ZodEnum<{
3527
+ skip: "skip";
3528
+ queue: "queue";
3529
+ }>;
3530
+ }, z.core.$strip>>;
3531
+ endpoint: z.ZodOptional<z.ZodString>;
3532
+ generation: z.ZodNumber;
3533
+ id: z.ZodString;
3534
+ latencyClass: z.ZodEnum<{
3535
+ realtime: "realtime";
3536
+ bulk: "bulk";
3537
+ }>;
3538
+ partitionKey: z.ZodOptional<z.ZodString>;
3539
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
3540
+ kind: z.ZodLiteral<"at">;
3541
+ }, z.core.$strip>, z.ZodObject<{
3542
+ everySeconds: z.ZodNumber;
3543
+ kind: z.ZodLiteral<"every">;
3544
+ }, z.core.$strip>, z.ZodObject<{
3545
+ cron: z.ZodString;
3546
+ kind: z.ZodLiteral<"cron">;
3547
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
3548
+ }, z.core.$strip>], "kind">;
3549
+ status: z.ZodEnum<{
3550
+ paused: "paused";
3551
+ active: "active";
3552
+ cancelled: "cancelled";
3553
+ completed: "completed";
3554
+ }>;
3555
+ updatedAt: z.ZodString;
3556
+ version: z.ZodNumber;
3557
+ }, z.core.$strip>;
3558
+ }, z.core.$strip>;
3559
+ readonly responseHeaders: z.ZodObject<{
3560
+ ETag: z.ZodString;
3561
+ }, z.core.$strip>;
3562
+ readonly scopes: readonly ["schedules:write"];
3563
+ readonly sessionAuthority: "headers";
3564
+ readonly summary: "Pause a schedule";
3565
+ readonly surfaces: readonly ["api", "mock"];
3566
+ }, {
3567
+ readonly creates: false;
3568
+ readonly description: "Returns a paused schedule to active. An occurrence whose instant passed while the schedule was paused becomes due at once rather than being skipped — a pause defers work, it does not discard it. Resuming an already active schedule changes nothing and returns the same version.";
3569
+ readonly example: {
3570
+ readonly occurrence: {
3571
+ readonly attemptCount: 0;
3572
+ readonly generation: 1;
3573
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3574
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
3575
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3576
+ readonly sequence: 1;
3577
+ readonly state: "planned";
3578
+ };
3579
+ readonly schedule: {
3580
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
3581
+ readonly generation: 1;
3582
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3583
+ readonly latencyClass: "realtime";
3584
+ readonly recurrence: {
3585
+ readonly kind: "at";
3586
+ };
3587
+ readonly status: "active";
3588
+ readonly updatedAt: "2026-07-28T15:20:00.000Z";
3589
+ readonly version: 3;
3590
+ };
3591
+ };
3592
+ readonly id: "schedules.resume";
3593
+ readonly idempotent: true;
3594
+ readonly mcp: {
3595
+ readonly destructive: false;
3596
+ readonly kind: "tool";
3597
+ readonly openWorld: false;
3598
+ };
3599
+ readonly method: "POST";
3600
+ readonly mutates: true;
3601
+ readonly path: "/v1/schedules/{scheduleId}/resume";
3602
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3603
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict", "version_conflict"];
3604
+ readonly requestHeaders: z.ZodObject<{
3605
+ "If-Match": z.ZodOptional<z.ZodString>;
3606
+ }, z.core.$strip>;
3607
+ readonly response: z.ZodObject<{
3608
+ occurrence: z.ZodObject<{
3609
+ attemptCount: z.ZodNumber;
3610
+ generation: z.ZodNumber;
3611
+ id: z.ZodString;
3612
+ plannedFor: z.ZodString;
3613
+ schedule: z.ZodString;
3614
+ sequence: z.ZodNumber;
3615
+ settledAt: z.ZodOptional<z.ZodString>;
3616
+ state: z.ZodEnum<{
3617
+ succeeded: "succeeded";
3618
+ ambiguous: "ambiguous";
3619
+ cancelled: "cancelled";
3620
+ planned: "planned";
3621
+ due: "due";
3622
+ dispatching: "dispatching";
3623
+ retry_wait: "retry_wait";
3624
+ terminal_failed: "terminal_failed";
3625
+ skipped_stale: "skipped_stale";
3626
+ }>;
3627
+ }, z.core.$strip>;
3628
+ schedule: z.ZodObject<{
3629
+ archivedAt: z.ZodOptional<z.ZodString>;
3630
+ createdAt: z.ZodString;
3631
+ delivery: z.ZodOptional<z.ZodObject<{
3632
+ completion: z.ZodEnum<{
3633
+ response: "response";
3634
+ callback: "callback";
3635
+ }>;
3636
+ maxDurationSeconds: z.ZodNumber;
3637
+ onOverlap: z.ZodEnum<{
3638
+ skip: "skip";
3639
+ queue: "queue";
3640
+ }>;
3641
+ }, z.core.$strip>>;
3642
+ endpoint: z.ZodOptional<z.ZodString>;
3643
+ generation: z.ZodNumber;
3644
+ id: z.ZodString;
3645
+ latencyClass: z.ZodEnum<{
3646
+ realtime: "realtime";
3647
+ bulk: "bulk";
3648
+ }>;
3649
+ partitionKey: z.ZodOptional<z.ZodString>;
3650
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
3651
+ kind: z.ZodLiteral<"at">;
3652
+ }, z.core.$strip>, z.ZodObject<{
3653
+ everySeconds: z.ZodNumber;
3654
+ kind: z.ZodLiteral<"every">;
3655
+ }, z.core.$strip>, z.ZodObject<{
3656
+ cron: z.ZodString;
3657
+ kind: z.ZodLiteral<"cron">;
3658
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
3659
+ }, z.core.$strip>], "kind">;
3660
+ status: z.ZodEnum<{
3661
+ paused: "paused";
3662
+ active: "active";
3663
+ cancelled: "cancelled";
3664
+ completed: "completed";
3665
+ }>;
3666
+ updatedAt: z.ZodString;
3667
+ version: z.ZodNumber;
3668
+ }, z.core.$strip>;
3669
+ }, z.core.$strip>;
3670
+ readonly responseHeaders: z.ZodObject<{
3671
+ ETag: z.ZodString;
3672
+ }, z.core.$strip>;
3673
+ readonly scopes: readonly ["schedules:write"];
3674
+ readonly sessionAuthority: "headers";
3675
+ readonly summary: "Resume a schedule";
3676
+ readonly surfaces: readonly ["api", "mock"];
3677
+ }, {
3678
+ readonly creates: false;
3679
+ readonly description: "Cancels a schedule and settles its occurrence `cancelled`, releasing the timer. Terminal: a cancelled schedule cannot be resumed or replaced, and cancelling one that is already cancelled changes nothing and returns the same version. A cancel that races its own occurrence becoming due still wins — the occurrence settles cancelled and no work is delivered — which is why this is a refusal-free retry rather than a race a client has to reason about. The schedule stays readable; archive it to take it out of the listing.";
3680
+ readonly example: {
3681
+ readonly occurrence: {
3682
+ readonly attemptCount: 0;
3683
+ readonly generation: 1;
3684
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3685
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
3686
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3687
+ readonly sequence: 1;
3688
+ readonly settledAt: "2026-07-28T15:10:00.000Z";
3689
+ readonly state: "cancelled";
3690
+ };
3691
+ readonly schedule: {
3692
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
3693
+ readonly generation: 1;
3694
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3695
+ readonly latencyClass: "realtime";
3696
+ readonly recurrence: {
3697
+ readonly kind: "at";
3698
+ };
3699
+ readonly status: "cancelled";
3700
+ readonly updatedAt: "2026-07-28T15:10:00.000Z";
3701
+ readonly version: 2;
3702
+ };
3703
+ };
3704
+ readonly id: "schedules.cancel";
3705
+ readonly idempotent: true;
3706
+ readonly mcp: {
3707
+ readonly destructive: true;
3708
+ readonly kind: "tool";
3709
+ readonly openWorld: false;
3710
+ };
3711
+ readonly method: "DELETE";
3712
+ readonly mutates: true;
3713
+ readonly path: "/v1/schedules/{scheduleId}";
3714
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3715
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict", "version_conflict"];
3716
+ readonly requestHeaders: z.ZodObject<{
3717
+ "If-Match": z.ZodOptional<z.ZodString>;
3718
+ }, z.core.$strip>;
3719
+ readonly response: z.ZodObject<{
3720
+ occurrence: z.ZodObject<{
3721
+ attemptCount: z.ZodNumber;
3722
+ generation: z.ZodNumber;
3723
+ id: z.ZodString;
3724
+ plannedFor: z.ZodString;
3725
+ schedule: z.ZodString;
3726
+ sequence: z.ZodNumber;
3727
+ settledAt: z.ZodOptional<z.ZodString>;
3728
+ state: z.ZodEnum<{
3729
+ succeeded: "succeeded";
3730
+ ambiguous: "ambiguous";
3731
+ cancelled: "cancelled";
3732
+ planned: "planned";
3733
+ due: "due";
3734
+ dispatching: "dispatching";
3735
+ retry_wait: "retry_wait";
3736
+ terminal_failed: "terminal_failed";
3737
+ skipped_stale: "skipped_stale";
3738
+ }>;
3739
+ }, z.core.$strip>;
3740
+ schedule: z.ZodObject<{
3741
+ archivedAt: z.ZodOptional<z.ZodString>;
3742
+ createdAt: z.ZodString;
3743
+ delivery: z.ZodOptional<z.ZodObject<{
3744
+ completion: z.ZodEnum<{
3745
+ response: "response";
3746
+ callback: "callback";
3747
+ }>;
3748
+ maxDurationSeconds: z.ZodNumber;
3749
+ onOverlap: z.ZodEnum<{
3750
+ skip: "skip";
3751
+ queue: "queue";
3752
+ }>;
3753
+ }, z.core.$strip>>;
3754
+ endpoint: z.ZodOptional<z.ZodString>;
3755
+ generation: z.ZodNumber;
3756
+ id: z.ZodString;
3757
+ latencyClass: z.ZodEnum<{
3758
+ realtime: "realtime";
3759
+ bulk: "bulk";
3760
+ }>;
3761
+ partitionKey: z.ZodOptional<z.ZodString>;
3762
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
3763
+ kind: z.ZodLiteral<"at">;
3764
+ }, z.core.$strip>, z.ZodObject<{
3765
+ everySeconds: z.ZodNumber;
3766
+ kind: z.ZodLiteral<"every">;
3767
+ }, z.core.$strip>, z.ZodObject<{
3768
+ cron: z.ZodString;
3769
+ kind: z.ZodLiteral<"cron">;
3770
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
3771
+ }, z.core.$strip>], "kind">;
3772
+ status: z.ZodEnum<{
3773
+ paused: "paused";
3774
+ active: "active";
3775
+ cancelled: "cancelled";
3776
+ completed: "completed";
3777
+ }>;
3778
+ updatedAt: z.ZodString;
3779
+ version: z.ZodNumber;
3780
+ }, z.core.$strip>;
3781
+ }, z.core.$strip>;
3782
+ readonly responseHeaders: z.ZodObject<{
3783
+ ETag: z.ZodString;
3784
+ }, z.core.$strip>;
3785
+ readonly scopes: readonly ["schedules:write"];
3786
+ readonly sessionAuthority: "headers";
3787
+ readonly summary: "Cancel a schedule";
3788
+ readonly surfaces: readonly ["api", "mock"];
3789
+ }, {
3790
+ readonly creates: false;
3791
+ readonly description: "Files a finished schedule away: it leaves the default listing and stays readable by identifier, carrying the instant it was archived. Only a cancelled or completed schedule can be archived — archiving is filing, not stopping, so cancel it first. Archiving an already archived schedule changes nothing and returns the same version.";
3792
+ readonly example: {
3793
+ readonly occurrence: {
3794
+ readonly attemptCount: 0;
3795
+ readonly generation: 1;
3796
+ readonly id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8";
3797
+ readonly plannedFor: "2026-07-28T15:00:00.000Z";
3798
+ readonly schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3799
+ readonly sequence: 1;
3800
+ readonly settledAt: "2026-07-28T15:10:00.000Z";
3801
+ readonly state: "cancelled";
3802
+ };
3803
+ readonly schedule: {
3804
+ readonly archivedAt: "2026-07-28T15:30:00.000Z";
3805
+ readonly createdAt: "2026-07-28T14:59:00.000Z";
3806
+ readonly generation: 1;
3807
+ readonly id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8";
3808
+ readonly latencyClass: "realtime";
3809
+ readonly recurrence: {
3810
+ readonly kind: "at";
3811
+ };
3812
+ readonly status: "cancelled";
3813
+ readonly updatedAt: "2026-07-28T15:30:00.000Z";
3814
+ readonly version: 3;
3815
+ };
3816
+ };
3817
+ readonly id: "schedules.archive";
3818
+ readonly idempotent: true;
3819
+ readonly mcp: {
3820
+ readonly destructive: false;
3821
+ readonly kind: "tool";
3822
+ readonly openWorld: false;
3823
+ };
3824
+ readonly method: "POST";
3825
+ readonly mutates: true;
3826
+ readonly path: "/v1/schedules/{scheduleId}/archive";
3827
+ readonly principals: readonly ["api-credential", "oauth", "session"];
3828
+ readonly problems: readonly ["invalid_request", "not_found", "state_conflict", "version_conflict"];
3829
+ readonly requestHeaders: z.ZodObject<{
3830
+ "If-Match": z.ZodOptional<z.ZodString>;
3831
+ }, z.core.$strip>;
3832
+ readonly response: z.ZodObject<{
3833
+ occurrence: z.ZodObject<{
3834
+ attemptCount: z.ZodNumber;
3835
+ generation: z.ZodNumber;
3836
+ id: z.ZodString;
3837
+ plannedFor: z.ZodString;
3838
+ schedule: z.ZodString;
3839
+ sequence: z.ZodNumber;
3840
+ settledAt: z.ZodOptional<z.ZodString>;
3841
+ state: z.ZodEnum<{
3842
+ succeeded: "succeeded";
3843
+ ambiguous: "ambiguous";
3844
+ cancelled: "cancelled";
3845
+ planned: "planned";
3846
+ due: "due";
3847
+ dispatching: "dispatching";
3848
+ retry_wait: "retry_wait";
3849
+ terminal_failed: "terminal_failed";
3850
+ skipped_stale: "skipped_stale";
3851
+ }>;
3852
+ }, z.core.$strip>;
3853
+ schedule: z.ZodObject<{
3854
+ archivedAt: z.ZodOptional<z.ZodString>;
3855
+ createdAt: z.ZodString;
3856
+ delivery: z.ZodOptional<z.ZodObject<{
3857
+ completion: z.ZodEnum<{
3858
+ response: "response";
3859
+ callback: "callback";
3860
+ }>;
3861
+ maxDurationSeconds: z.ZodNumber;
3862
+ onOverlap: z.ZodEnum<{
3863
+ skip: "skip";
3864
+ queue: "queue";
3865
+ }>;
3866
+ }, z.core.$strip>>;
3867
+ endpoint: z.ZodOptional<z.ZodString>;
3868
+ generation: z.ZodNumber;
3869
+ id: z.ZodString;
3870
+ latencyClass: z.ZodEnum<{
3871
+ realtime: "realtime";
3872
+ bulk: "bulk";
3873
+ }>;
3874
+ partitionKey: z.ZodOptional<z.ZodString>;
3875
+ recurrence: z.ZodDiscriminatedUnion<[z.ZodObject<{
3876
+ kind: z.ZodLiteral<"at">;
3877
+ }, z.core.$strip>, z.ZodObject<{
3878
+ everySeconds: z.ZodNumber;
3879
+ kind: z.ZodLiteral<"every">;
3880
+ }, z.core.$strip>, z.ZodObject<{
3881
+ cron: z.ZodString;
3882
+ kind: z.ZodLiteral<"cron">;
3883
+ timeZone: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
3884
+ }, z.core.$strip>], "kind">;
3885
+ status: z.ZodEnum<{
3886
+ paused: "paused";
3887
+ active: "active";
3888
+ cancelled: "cancelled";
3889
+ completed: "completed";
3890
+ }>;
3891
+ updatedAt: z.ZodString;
3892
+ version: z.ZodNumber;
3893
+ }, z.core.$strip>;
3894
+ }, z.core.$strip>;
3895
+ readonly responseHeaders: z.ZodObject<{
3896
+ ETag: z.ZodString;
3897
+ }, z.core.$strip>;
3898
+ readonly scopes: readonly ["schedules:write"];
3899
+ readonly sessionAuthority: "headers";
3900
+ readonly summary: "Archive a schedule";
3901
+ readonly surfaces: readonly ["api", "mock"];
3902
+ }];
3903
+ /**
3904
+ * Every declared operation id, as a literal union.
3905
+ *
3906
+ * This is what lets an adapter key its handlers off a `Record<OperationId, …>`
3907
+ * and get a *compile error* when the registry gains an operation it does not
3908
+ * serve. A hand-maintained list compared in a test is a weaker guarantee: the
3909
+ * list and the implementation can drift together while the test still passes.
3910
+ */
3911
+ export type OperationId = (typeof OPERATIONS)[number]["id"];
3912
+ /**
3913
+ * Headers the contract mock uses to expose state a body cannot carry.
3914
+ *
3915
+ * Declared here rather than written into the adapter for the same reason every
3916
+ * other wire detail is: a header invented at the edge is a wire shape that
3917
+ * drifts.
3918
+ */
3919
+ export declare const MOCK_HEADERS: {
3920
+ /** The instant the mock's pinned clock reports. */
3921
+ readonly now: "X-Greatwait-Now";
3922
+ /** Present when this response is an at-least-once duplicate. */
3923
+ readonly replayed: "X-Greatwait-Replayed";
3924
+ };
3925
+ export declare function operationsFor(surface: OperationSurface): readonly OperationDefinition[];
3926
+ export declare function findOperation(id: string): OperationDefinition | undefined;
3927
+ /**
3928
+ * The schema an operation's success body is parsed with, by operation id.
3929
+ *
3930
+ * **Exists so a consumer can parse without naming a schema export.** The typed
3931
+ * client returns `unknown` and tells callers to parse with "that operation's
3932
+ * contract schema", which until W9-03 meant every caller had to map an
3933
+ * operation id onto a symbol by hand — a mapping that is a second statement of
3934
+ * the registry, and one a renamed export breaks silently. The published
3935
+ * quickstarts and anything W10 generates resolve it here instead, so the
3936
+ * operation id is the only name a consumer has to know.
3937
+ *
3938
+ * `undefined` for an id the registry does not carry, rather than a throw: the
3939
+ * caller usually has a better message than this function could write.
3940
+ */
3941
+ export declare function responseSchemaFor(id: string): z.ZodTypeAny | undefined;
3942
+ /** The schema an operation's request body is validated with, by id. */
3943
+ export declare function requestSchemaFor(id: string): z.ZodTypeAny | undefined;
3944
+ /**
3945
+ * The status a successful call returns.
3946
+ *
3947
+ * Computed in one place, so the OpenAPI document, the contract mock and the API
3948
+ * adapter cannot disagree about it — which they did for exactly one commit,
3949
+ * when a route returned 201 and the published document said 200. An operation
3950
+ * that **creates** something, **on the product surface**, answers 201;
3951
+ * everything else answers 200.
3952
+ *
3953
+ * The first clause read `method === "POST" && mutates` until W2-02, which added
3954
+ * the first mutating POST that creates nothing — pausing a schedule — and would
3955
+ * have had "201 Created" published for it. `creates` is declared rather than
3956
+ * inferred because no combination of method, path and schema distinguishes
3957
+ * "changed something" from "brought something into being".
3958
+ *
3959
+ * The surface clause is not a per-operation exception, and it is not
3960
+ * cosmetic. Without it the rule reaches `mock.setScenario`, whose 200 is
3961
+ * already published in `openapi.mock.json` and already served from a deployed
3962
+ * host — and `classifyChange` in `compatibility.ts` classifies a changed status
3963
+ * as **breaking**, requiring a new contract version. Tidying the mock's control
3964
+ * plane is not worth a contract version, and shipping the change without one
3965
+ * would make the compatibility module a thing this repository consults and then
3966
+ * ignores. The mock's control plane is not a product operation; that is the
3967
+ * distinction, and it is structural rather than a judgement about any one
3968
+ * operation.
3969
+ */
3970
+ export declare function successStatusFor(operation: OperationDefinition): 200 | 201;
3971
+ /**
3972
+ * Problems any operation may return regardless of what it does. Kept separate
3973
+ * so an operation's own `problems` list stays about that operation.
3974
+ */
3975
+ export declare const UNIVERSAL_PROBLEMS: readonly ProblemCode[];
3976
+ /**
3977
+ * Problems an operation returns once authentication applies to it.
3978
+ *
3979
+ * `credential_expired` is here rather than on the operations that rotate,
3980
+ * because expiry is a property of the credential being *presented*, not of what
3981
+ * the caller asked to do. Any authenticated operation can meet a credential
3982
+ * whose rotation window has closed.
3983
+ */
3984
+ export declare const AUTHENTICATED_PROBLEMS: readonly ProblemCode[];
3985
+ export declare function problemsFor(operation: OperationDefinition): readonly ProblemCode[];