@greatwait/contracts 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (345) hide show
  1. package/README.md +12 -10
  2. package/dist/authority.d.ts +33 -27
  3. package/dist/authority.js +12 -2
  4. package/dist/billing.d.ts +1231 -0
  5. package/dist/billing.js +833 -0
  6. package/dist/callback-safety.d.ts +2 -2
  7. package/dist/callback-safety.js +15 -5
  8. package/dist/compatibility.d.ts +3 -3
  9. package/dist/compatibility.js +1 -1
  10. package/dist/configuration-bounds.d.ts +13 -0
  11. package/dist/configuration-bounds.js +13 -0
  12. package/dist/data-export.d.ts +67 -0
  13. package/dist/data-export.js +182 -0
  14. package/dist/effective-limits.d.ts +40 -0
  15. package/dist/effective-limits.js +42 -0
  16. package/dist/endpoints.d.ts +186 -245
  17. package/dist/endpoints.js +82 -86
  18. package/dist/events.d.ts +17 -17
  19. package/dist/events.js +1 -1
  20. package/dist/first-value-journey.d.ts +50 -56
  21. package/dist/first-value-journey.js +17 -20
  22. package/dist/forecast.d.ts +182 -92
  23. package/dist/forecast.js +88 -25
  24. package/dist/identifiers.d.ts +20 -20
  25. package/dist/identifiers.js +1 -1
  26. package/dist/identity.d.ts +41 -37
  27. package/dist/identity.js +5 -4
  28. package/dist/index.d.ts +12 -6
  29. package/dist/index.js +12 -6
  30. package/dist/mcp.d.ts +21 -19
  31. package/dist/mcp.js +2 -2
  32. package/dist/naming.d.ts +45 -0
  33. package/dist/naming.js +159 -0
  34. package/dist/oauth.d.ts +186 -172
  35. package/dist/oauth.js +1 -1
  36. package/dist/operation-definitions.d.ts +9 -0
  37. package/dist/operation-definitions.js +7 -0
  38. package/dist/operational-config.d.ts +101 -0
  39. package/dist/operational-config.js +341 -0
  40. package/dist/operations.d.ts +4742 -2170
  41. package/dist/operations.js +3064 -932
  42. package/dist/organization-lifecycle.d.ts +34 -0
  43. package/dist/organization-lifecycle.js +122 -0
  44. package/dist/partition.d.ts +43 -9
  45. package/dist/partition.js +3 -3
  46. package/dist/policy.d.ts +4 -4
  47. package/dist/policy.js +9 -5
  48. package/dist/problems.d.ts +57 -28
  49. package/dist/problems.js +55 -3
  50. package/dist/protocol.d.ts +209 -80
  51. package/dist/protocol.js +110 -37
  52. package/dist/scheduling-records.d.ts +349 -285
  53. package/dist/scheduling-records.js +1 -1
  54. package/dist/scheduling.d.ts +707 -361
  55. package/dist/scheduling.js +443 -61
  56. package/dist/secrets.d.ts +119 -105
  57. package/dist/secrets.js +1 -1
  58. package/dist/signatures.d.ts +74 -74
  59. package/dist/signatures.js +1 -1
  60. package/dist/tenancy.d.ts +142 -68
  61. package/dist/tenancy.js +70 -17
  62. package/dist/test-sink.d.ts +127 -127
  63. package/dist/test-sink.js +1 -1
  64. package/dist/time.d.ts +4 -4
  65. package/dist/time.js +1 -1
  66. package/dist/timing.d.ts +65 -0
  67. package/dist/timing.js +82 -0
  68. package/dist/usage.d.ts +103 -47
  69. package/dist/usage.js +183 -32
  70. package/dist/workspace.d.ts +34 -34
  71. package/dist/workspace.js +1 -1
  72. package/dist/zod-values.d.ts +3 -0
  73. package/dist/zod-values.js +2 -0
  74. package/dist/zod.d.ts +2 -0
  75. package/dist/zod.js +2 -0
  76. package/generated/v1/examples/attempts.list.response.json +6 -0
  77. package/generated/v1/examples/attempts.read.response.json +6 -0
  78. package/generated/v1/examples/billing.autotopup.request.json +5 -0
  79. package/generated/v1/examples/billing.autotopup.response.json +120 -0
  80. package/generated/v1/examples/billing.autotopuppreview.request.json +19 -0
  81. package/generated/v1/examples/billing.autotopuppreview.response.json +45 -0
  82. package/generated/v1/examples/billing.budgets.request.json +13 -0
  83. package/generated/v1/examples/billing.budgets.response.json +22 -0
  84. package/generated/v1/examples/billing.ceiling.request.json +8 -0
  85. package/generated/v1/examples/billing.ceiling.response.json +120 -0
  86. package/generated/v1/examples/billing.change.request.json +5 -0
  87. package/generated/v1/examples/billing.change.response.json +12 -0
  88. package/generated/v1/examples/billing.funding.response.json +120 -0
  89. package/generated/v1/examples/billing.fundingconfirm.response.json +120 -0
  90. package/generated/v1/examples/billing.fundingquote.request.json +7 -0
  91. package/generated/v1/examples/billing.fundingquote.response.json +13 -0
  92. package/generated/v1/examples/billing.invoicehistory.response.json +6 -0
  93. package/generated/v1/examples/billing.invoices.response.json +15 -0
  94. package/generated/v1/examples/billing.ledger.response.json +23 -0
  95. package/generated/v1/examples/billing.notices.response.json +41 -0
  96. package/generated/v1/examples/billing.notificationsettings.response.json +17 -0
  97. package/generated/v1/examples/billing.notificationsettingsupdate.request.json +9 -0
  98. package/generated/v1/examples/billing.notificationsettingsupdate.response.json +17 -0
  99. package/generated/v1/examples/billing.paymenthistory.response.json +6 -0
  100. package/generated/v1/examples/billing.paymentmethod.response.json +16 -0
  101. package/generated/v1/examples/billing.paymentmethodconfirm.request.json +3 -0
  102. package/generated/v1/examples/billing.paymentmethodconfirm.response.json +16 -0
  103. package/generated/v1/examples/billing.paymentmethodremove.request.json +3 -0
  104. package/generated/v1/examples/billing.paymentmethodremove.response.json +4 -0
  105. package/generated/v1/examples/billing.paymentmethodsetup.request.json +1 -0
  106. package/generated/v1/examples/billing.paymentmethodsetup.response.json +3 -0
  107. package/generated/v1/examples/billing.portal.response.json +3 -0
  108. package/generated/v1/examples/billing.projects.response.json +12 -0
  109. package/generated/v1/examples/billing.purchase.request.json +5 -0
  110. package/generated/v1/examples/billing.purchase.response.json +120 -0
  111. package/generated/v1/examples/billing.quote.request.json +4 -0
  112. package/generated/v1/examples/billing.quote.response.json +19 -0
  113. package/generated/v1/examples/billing.reconcile.response.json +73 -0
  114. package/generated/v1/examples/billing.refundrequest.request.json +10 -0
  115. package/generated/v1/examples/billing.refundrequest.response.json +11 -0
  116. package/generated/v1/examples/billing.refundresolution.request.json +4 -0
  117. package/generated/v1/examples/billing.refundresolution.response.json +120 -0
  118. package/generated/v1/examples/billing.summary.response.json +73 -0
  119. package/generated/v1/examples/endpoints.acknowledgeSigningKeyRotation.response.json +18 -0
  120. package/generated/v1/examples/endpoints.create.response.json +1 -1
  121. package/generated/v1/examples/endpoints.disable.response.json +0 -1
  122. package/generated/v1/examples/{endpoints.verify.response.json → endpoints.enable.response.json} +4 -5
  123. package/generated/v1/examples/endpoints.list.response.json +1 -2
  124. package/generated/v1/examples/endpoints.read.response.json +2 -2
  125. package/generated/v1/examples/endpoints.revealSigningSecret.response.json +7 -0
  126. package/generated/v1/examples/endpoints.rotateSigningKey.response.json +1 -2
  127. package/generated/v1/examples/endpoints.update.response.json +1 -1
  128. package/generated/v1/examples/executions.list.response.json +20 -0
  129. package/generated/v1/examples/exports.cancel.response.json +11 -0
  130. package/generated/v1/examples/exports.create.request.json +1 -0
  131. package/generated/v1/examples/exports.create.response.json +8 -0
  132. package/generated/v1/examples/exports.part.response.json +5 -0
  133. package/generated/v1/examples/exports.read.response.json +8 -0
  134. package/generated/v1/examples/limits.read.response.json +16 -0
  135. package/generated/v1/examples/occurrences.read.response.json +4 -0
  136. package/generated/v1/examples/occurrences.redeliver.response.json +2 -0
  137. package/generated/v1/examples/organizations.close.request.json +5 -0
  138. package/generated/v1/examples/organizations.close.response.json +10 -0
  139. package/generated/v1/examples/organizations.lifecycle.response.json +10 -0
  140. package/generated/v1/examples/organizations.restore.request.json +3 -0
  141. package/generated/v1/examples/organizations.restore.response.json +10 -0
  142. package/generated/v1/examples/projects.archive.request.json +3 -0
  143. package/generated/v1/examples/projects.archive.response.json +14 -0
  144. package/generated/v1/examples/projects.create.response.json +10 -1
  145. package/generated/v1/examples/projects.delete.response.json +9 -0
  146. package/generated/v1/examples/projects.list.response.json +12 -2
  147. package/generated/v1/examples/projects.rename.request.json +3 -0
  148. package/generated/v1/examples/projects.rename.response.json +14 -0
  149. package/generated/v1/examples/schedules.archive.response.json +3 -0
  150. package/generated/v1/examples/schedules.cancel.response.json +3 -0
  151. package/generated/v1/examples/schedules.create.request.json +4 -0
  152. package/generated/v1/examples/schedules.create.response.json +3 -0
  153. package/generated/v1/examples/schedules.list.response.json +3 -0
  154. package/generated/v1/examples/schedules.pause.response.json +3 -0
  155. package/generated/v1/examples/schedules.read.response.json +6 -0
  156. package/generated/v1/examples/schedules.replace.request.json +4 -0
  157. package/generated/v1/examples/schedules.replace.response.json +3 -0
  158. package/generated/v1/examples/schedules.resume.response.json +3 -0
  159. package/generated/v1/examples/timing.summary.response.json +35 -0
  160. package/generated/v1/examples/usage.read.response.json +1 -0
  161. package/generated/v1/first-value-journey.json +43 -18
  162. package/generated/v1/manifest.json +1287 -42
  163. package/generated/v1/openapi.json +36033 -5982
  164. package/generated/v1/policy-matrix.json +341 -47
  165. package/generated/v1/schemas/attempts.list.response.json +39 -1
  166. package/generated/v1/schemas/attempts.read.response.json +39 -1
  167. package/generated/v1/schemas/billing.autotopup.request-headers.json +13 -0
  168. package/generated/v1/schemas/billing.autotopup.request.json +22 -0
  169. package/generated/v1/schemas/billing.autotopup.response-headers.json +10 -0
  170. package/generated/v1/schemas/billing.autotopup.response.json +552 -0
  171. package/generated/v1/schemas/billing.autotopuppreview.request.json +77 -0
  172. package/generated/v1/schemas/billing.autotopuppreview.response.json +277 -0
  173. package/generated/v1/schemas/billing.budgets.request-headers.json +13 -0
  174. package/generated/v1/schemas/billing.budgets.request.json +66 -0
  175. package/generated/v1/schemas/billing.budgets.response-headers.json +10 -0
  176. package/generated/v1/schemas/billing.budgets.response.json +92 -0
  177. package/generated/v1/schemas/billing.ceiling.request-headers.json +13 -0
  178. package/generated/v1/schemas/billing.ceiling.request.json +40 -0
  179. package/generated/v1/schemas/billing.ceiling.response-headers.json +10 -0
  180. package/generated/v1/schemas/billing.ceiling.response.json +552 -0
  181. package/generated/v1/schemas/billing.change.request-headers.json +13 -0
  182. package/generated/v1/schemas/billing.change.request.json +22 -0
  183. package/generated/v1/schemas/billing.change.response.json +119 -0
  184. package/generated/v1/schemas/billing.funding.response.json +552 -0
  185. package/generated/v1/schemas/billing.fundingconfirm.response.json +552 -0
  186. package/generated/v1/schemas/billing.fundingquote.request.json +28 -0
  187. package/generated/v1/schemas/billing.fundingquote.response.json +61 -0
  188. package/generated/v1/schemas/billing.invoicehistory.query.json +16 -0
  189. package/generated/v1/schemas/billing.invoicehistory.response.json +88 -0
  190. package/generated/v1/schemas/billing.invoices.response.json +51 -0
  191. package/generated/v1/schemas/billing.ledger.query.json +16 -0
  192. package/generated/v1/schemas/billing.ledger.response.json +130 -0
  193. package/generated/v1/schemas/billing.notices.query.json +16 -0
  194. package/generated/v1/schemas/billing.notices.response.json +278 -0
  195. package/generated/v1/schemas/billing.notificationsettings.response.json +70 -0
  196. package/generated/v1/schemas/billing.notificationsettingsupdate.request-headers.json +13 -0
  197. package/generated/v1/schemas/billing.notificationsettingsupdate.request.json +43 -0
  198. package/generated/v1/schemas/billing.notificationsettingsupdate.response-headers.json +10 -0
  199. package/generated/v1/schemas/billing.notificationsettingsupdate.response.json +70 -0
  200. package/generated/v1/schemas/billing.paymenthistory.query.json +16 -0
  201. package/generated/v1/schemas/billing.paymenthistory.response.json +182 -0
  202. package/generated/v1/schemas/billing.paymentmethod.response.json +137 -0
  203. package/generated/v1/schemas/billing.paymentmethodconfirm.request.json +14 -0
  204. package/generated/v1/schemas/billing.paymentmethodconfirm.response.json +137 -0
  205. package/generated/v1/schemas/billing.paymentmethodremove.request.json +12 -0
  206. package/generated/v1/schemas/billing.paymentmethodremove.response.json +137 -0
  207. package/generated/v1/schemas/billing.paymentmethodsetup.request.json +12 -0
  208. package/generated/v1/schemas/billing.paymentmethodsetup.response.json +11 -0
  209. package/generated/v1/schemas/billing.portal.response.json +11 -0
  210. package/generated/v1/schemas/billing.projects.response.json +119 -0
  211. package/generated/v1/schemas/billing.purchase.request-headers.json +13 -0
  212. package/generated/v1/schemas/billing.purchase.request.json +26 -0
  213. package/generated/v1/schemas/billing.purchase.response-headers.json +10 -0
  214. package/generated/v1/schemas/billing.purchase.response.json +552 -0
  215. package/generated/v1/schemas/billing.quote.request.json +20 -0
  216. package/generated/v1/schemas/billing.quote.response.json +86 -0
  217. package/generated/v1/schemas/billing.reconcile.response.json +468 -0
  218. package/generated/v1/schemas/billing.refundrequest.request-headers.json +13 -0
  219. package/generated/v1/schemas/billing.refundrequest.request.json +42 -0
  220. package/generated/v1/schemas/billing.refundrequest.response-headers.json +10 -0
  221. package/generated/v1/schemas/billing.refundrequest.response.json +45 -0
  222. package/generated/v1/schemas/billing.refundresolution.request-headers.json +13 -0
  223. package/generated/v1/schemas/billing.refundresolution.request.json +61 -0
  224. package/generated/v1/schemas/billing.refundresolution.response-headers.json +10 -0
  225. package/generated/v1/schemas/billing.refundresolution.response.json +552 -0
  226. package/generated/v1/schemas/billing.summary.response.json +468 -0
  227. package/generated/v1/schemas/context.read.response.json +2 -0
  228. package/generated/v1/schemas/credentials.connection.response.json +2 -0
  229. package/generated/v1/schemas/credentials.create.request.json +2 -0
  230. package/generated/v1/schemas/credentials.create.response.json +2 -0
  231. package/generated/v1/schemas/credentials.list.response.json +2 -0
  232. package/generated/v1/schemas/credentials.revoke.response.json +2 -0
  233. package/generated/v1/schemas/credentials.rotate.response.json +4 -0
  234. package/generated/v1/schemas/{endpoints.verify.request-headers.json → endpoints.acknowledgeSigningKeyRotation.request-headers.json} +2 -1
  235. package/generated/v1/schemas/{endpoints.verify.response.json → endpoints.acknowledgeSigningKeyRotation.response.json} +8 -21
  236. package/generated/v1/schemas/endpoints.create.request.json +5 -0
  237. package/generated/v1/schemas/endpoints.create.response.json +8 -21
  238. package/generated/v1/schemas/endpoints.disable.response.json +8 -21
  239. package/generated/v1/schemas/endpoints.enable.response-headers.json +11 -0
  240. package/generated/v1/schemas/endpoints.enable.response.json +87 -0
  241. package/generated/v1/schemas/endpoints.list.response.json +8 -21
  242. package/generated/v1/schemas/endpoints.read.response.json +8 -21
  243. package/generated/v1/schemas/endpoints.revealSigningSecret.response.json +43 -0
  244. package/generated/v1/schemas/endpoints.rotateSigningKey.response.json +8 -21
  245. package/generated/v1/schemas/endpoints.update.request.json +5 -0
  246. package/generated/v1/schemas/endpoints.update.response.json +8 -21
  247. package/generated/v1/schemas/executions.list.query.json +46 -0
  248. package/generated/v1/schemas/executions.list.response.json +116 -0
  249. package/generated/v1/schemas/exports.cancel.response.json +48 -0
  250. package/generated/v1/schemas/exports.create.request.json +6 -0
  251. package/generated/v1/schemas/exports.create.response.json +38 -0
  252. package/generated/v1/schemas/exports.part.query.json +11 -0
  253. package/generated/v1/schemas/exports.part.response.json +22 -0
  254. package/generated/v1/schemas/exports.read.response.json +38 -0
  255. package/generated/v1/schemas/forecast.read.request-headers.json +10 -0
  256. package/generated/v1/schemas/forecast.read.response.json +148 -0
  257. package/generated/v1/schemas/grants.list.response.json +2 -0
  258. package/generated/v1/schemas/grants.revoke.response.json +2 -0
  259. package/generated/v1/schemas/limits.read.response.json +79 -0
  260. package/generated/v1/schemas/occurrences.list.query.json +5 -0
  261. package/generated/v1/schemas/occurrences.list.response.json +23 -0
  262. package/generated/v1/schemas/occurrences.read.response.json +23 -0
  263. package/generated/v1/schemas/occurrences.redeliver.response.json +39 -1
  264. package/generated/v1/schemas/organizations.close.request.json +20 -0
  265. package/generated/v1/schemas/organizations.close.response.json +68 -0
  266. package/generated/v1/schemas/organizations.lifecycle.response.json +68 -0
  267. package/generated/v1/schemas/organizations.restore.request.json +13 -0
  268. package/generated/v1/schemas/organizations.restore.response.json +68 -0
  269. package/generated/v1/schemas/projects.archive.request-headers.json +11 -0
  270. package/generated/v1/schemas/projects.archive.request.json +10 -0
  271. package/generated/v1/schemas/projects.archive.response-headers.json +11 -0
  272. package/generated/v1/schemas/projects.archive.response.json +79 -0
  273. package/generated/v1/schemas/projects.create.response.json +55 -1
  274. package/generated/v1/schemas/projects.delete.request-headers.json +11 -0
  275. package/generated/v1/schemas/projects.delete.response.json +37 -0
  276. package/generated/v1/schemas/projects.list.response.json +61 -2
  277. package/generated/v1/schemas/projects.rename.request-headers.json +11 -0
  278. package/generated/v1/schemas/projects.rename.request.json +12 -0
  279. package/generated/v1/schemas/projects.rename.response-headers.json +11 -0
  280. package/generated/v1/schemas/projects.rename.response.json +79 -0
  281. package/generated/v1/schemas/schedules.archive.response.json +90 -2
  282. package/generated/v1/schemas/schedules.cancel.response.json +90 -2
  283. package/generated/v1/schemas/schedules.create.request.json +24 -3
  284. package/generated/v1/schemas/schedules.create.response.json +90 -2
  285. package/generated/v1/schemas/schedules.list.query.json +13 -0
  286. package/generated/v1/schemas/schedules.list.response.json +67 -2
  287. package/generated/v1/schemas/schedules.pause.response.json +90 -2
  288. package/generated/v1/schemas/schedules.read.response.json +90 -2
  289. package/generated/v1/schemas/schedules.replace.request.json +24 -3
  290. package/generated/v1/schemas/schedules.replace.response.json +90 -2
  291. package/generated/v1/schemas/schedules.resume.response.json +90 -2
  292. package/generated/v1/schemas/timing.summary.response.json +191 -0
  293. package/generated/v1/schemas/usage.read.query.json +7 -0
  294. package/generated/v1/schemas/usage.read.response.json +36 -1
  295. package/generated/v1/snippets/billing.autotopup.json +6 -0
  296. package/generated/v1/snippets/billing.autotopuppreview.json +6 -0
  297. package/generated/v1/snippets/billing.budgets.json +6 -0
  298. package/generated/v1/snippets/billing.ceiling.json +6 -0
  299. package/generated/v1/snippets/billing.change.json +6 -0
  300. package/generated/v1/snippets/billing.funding.json +6 -0
  301. package/generated/v1/snippets/billing.fundingconfirm.json +6 -0
  302. package/generated/v1/snippets/billing.fundingquote.json +6 -0
  303. package/generated/v1/snippets/billing.invoicehistory.json +6 -0
  304. package/generated/v1/snippets/billing.invoices.json +6 -0
  305. package/generated/v1/snippets/billing.ledger.json +6 -0
  306. package/generated/v1/snippets/billing.notices.json +6 -0
  307. package/generated/v1/snippets/billing.notificationsettings.json +6 -0
  308. package/generated/v1/snippets/billing.notificationsettingsupdate.json +6 -0
  309. package/generated/v1/snippets/billing.paymenthistory.json +6 -0
  310. package/generated/v1/snippets/billing.paymentmethod.json +6 -0
  311. package/generated/v1/snippets/billing.paymentmethodconfirm.json +6 -0
  312. package/generated/v1/snippets/billing.paymentmethodremove.json +6 -0
  313. package/generated/v1/snippets/billing.paymentmethodsetup.json +6 -0
  314. package/generated/v1/snippets/billing.portal.json +6 -0
  315. package/generated/v1/snippets/billing.projects.json +6 -0
  316. package/generated/v1/snippets/billing.purchase.json +6 -0
  317. package/generated/v1/snippets/billing.quote.json +6 -0
  318. package/generated/v1/snippets/billing.reconcile.json +6 -0
  319. package/generated/v1/snippets/billing.refundrequest.json +6 -0
  320. package/generated/v1/snippets/billing.refundresolution.json +6 -0
  321. package/generated/v1/snippets/billing.summary.json +6 -0
  322. package/generated/v1/snippets/endpoints.acknowledgeSigningKeyRotation.json +6 -0
  323. package/generated/v1/snippets/{endpoints.verify.json → endpoints.enable.json} +3 -3
  324. package/generated/v1/snippets/endpoints.revealSigningSecret.json +6 -0
  325. package/generated/v1/snippets/executions.list.json +6 -0
  326. package/generated/v1/snippets/exports.cancel.json +6 -0
  327. package/generated/v1/snippets/exports.create.json +6 -0
  328. package/generated/v1/snippets/exports.part.json +6 -0
  329. package/generated/v1/snippets/exports.read.json +6 -0
  330. package/generated/v1/snippets/forecast.windows.json +1 -1
  331. package/generated/v1/snippets/limits.read.json +6 -0
  332. package/generated/v1/snippets/organizations.close.json +6 -0
  333. package/generated/v1/snippets/organizations.lifecycle.json +6 -0
  334. package/generated/v1/snippets/organizations.restore.json +6 -0
  335. package/generated/v1/snippets/projects.archive.json +6 -0
  336. package/generated/v1/snippets/projects.delete.json +6 -0
  337. package/generated/v1/snippets/projects.rename.json +6 -0
  338. package/generated/v1/snippets/schedules.create.json +3 -3
  339. package/generated/v1/snippets/schedules.replace.json +3 -3
  340. package/generated/v1/snippets/timing.summary.json +6 -0
  341. package/package.json +7 -7
  342. package/dist/callback-ownership.d.ts +0 -58
  343. package/dist/callback-ownership.js +0 -71
  344. package/generated/v1/callback-endpoint-verification.json +0 -59
  345. /package/generated/v1/schemas/{endpoints.verify.response-headers.json → endpoints.acknowledgeSigningKeyRotation.response-headers.json} +0 -0
@@ -1,14 +1,20 @@
1
- import { z } from "zod";
1
+ import { effectiveCustomerLimitsSchema } from "./effective-limits.js";
2
+ import { z } from "./zod.js";
3
+ import { DATA_EXPORT_OPERATIONS } from "./data-export.js";
4
+ import { ORGANIZATION_LIFECYCLE_OPERATIONS } from "./organization-lifecycle.js";
5
+ import { API_UNUSED_RESPONSE_SCHEMA } from "./operation-definitions.js";
2
6
  import { credentialContextSchema } from "./authority.js";
3
- import { callbackEndpointCreatedSchema, callbackEndpointPageSchema, callbackEndpointRequestSchema, callbackEndpointRotatedSchema, callbackEndpointSchema, callbackSigningKeyRotationRequestSchema, } from "./endpoints.js";
4
- import { FORECAST_WINDOW_VERSION, forecastRequestSchema, forecastSchema, forecastWindowsSchema, } from "./forecast.js";
7
+ import { callbackEndpointCreatedSchema, callbackEndpointPageSchema, callbackEndpointRequestSchema, callbackEndpointRotatedSchema, callbackEndpointSchema, callbackEndpointSigningSecretsSchema, callbackSigningKeyRotationRequestSchema, } from "./endpoints.js";
8
+ import { FORECAST_WINDOW_VERSION, forecastRequestSchema, forecastSchema, forecastRequestHeadersSchema, forecastWindowsSchema, } from "./forecast.js";
5
9
  import { usageRequestSchema, usageSchema } from "./usage.js";
6
- import { conditionalRequestHeaderSchema, idempotencyReplayResponseHeaderSchema, idempotencyRequestHeaderSchema, pageRequestSchema, replayedResponseHeaderSchema, requiredIdempotencyRequestHeaderSchema, versionResponseHeaderSchema, } from "./protocol.js";
10
+ import { deliveryTimingSummarySchema } from "./timing.js";
11
+ import { billingAutoTopUpApplyRequestSchema, billingAutoTopUpPreviewRequestSchema, billingAutoTopUpPreviewSchema, billingCeilingUpdateRequestSchema, billingFundingQuoteRequestSchema, billingFundingQuoteSchema, billingFundingViewSchema, billingNoticePageSchema, billingNotificationSettingsSchema, billingNotificationSettingsUpdateRequestSchema, billingLedgerPageSchema, billingLedgerRequestSchema, billingBudgetUpdateRequestHeadersSchema, billingBudgetUpdateRequestSchema, billingBudgetUpdateResponseSchema, billingPurchaseRequestSchema, billingRefundRequestCreateSchema, billingRefundResolutionRequestSchema, billingRefundRequestViewSchema, billingSummarySchema, projectBillingStateSchema, projectBillingQuoteSchema, projectBillingQuoteRequestSchema, projectBillingChangeRequestSchema, billingPortalSchema, billingInvoiceListSchema, billingPaymentHistoryPageSchema, billingInvoiceHistoryPageSchema, billingPaymentMethodSchema, billingPaymentMethodSetupRequestSchema, billingPaymentMethodConfirmRequestSchema, billingPaymentMethodRemoveRequestSchema, } from "./billing.js";
12
+ import { conditionalRequestHeaderSchema, idempotencyReplayResponseHeaderSchema, idempotencyRequestHeaderSchema, historyPageRequestSchema, pageRequestSchema, scheduleListRequestSchema, replayedResponseHeaderSchema, requiredConditionalRequestHeaderSchema, requiredIdempotencyRequestHeaderSchema, versionResponseHeaderSchema, } from "./protocol.js";
7
13
  import { oauthGrantListSchema, oauthGrantRevokedSchema } from "./oauth.js";
8
14
  import { credentialCreatedSchema, credentialPageSchema, credentialRequestSchema, credentialRevokedSchema, credentialRotatedSchema, credentialRotationRequestSchema, } from "./secrets.js";
9
- import { attemptPageSchema, attemptViewSchema, occurrencePageSchema, occurrenceViewSchema, schedulePageSchema, scheduleRequestSchema, scheduleViewSchema, } from "./scheduling.js";
15
+ import { attemptPageSchema, attemptViewSchema, occurrencePageSchema, projectOccurrenceListRequestSchema, projectOccurrencePageSchema, occurrenceViewSchema, schedulePageSchema, scheduleRequestSchema, scheduleViewSchema, } from "./scheduling.js";
10
16
  import { testSinkCreateRequestSchema, testSinkDeliveryBodySchema, testSinkDeliveryPageSchema, testSinkPageSchema, testSinkProgramSchema, testSinkSchema, } from "./test-sink.js";
11
- import { projectCreateRequestSchema, projectListSchema, projectSummarySchema, } from "./tenancy.js";
17
+ import { projectArchiveRequestSchema, projectCreateRequestSchema, projectDeletedSchema, projectListSchema, projectSummarySchema, projectUpdateRequestSchema, } from "./tenancy.js";
12
18
  import { mcpConnectionSchema } from "./mcp.js";
13
19
  import { scaffoldVersionSchema, workspaceScaffoldSchema } from "./workspace.js";
14
20
  import { timestampSchema } from "./time.js";
@@ -49,15 +55,489 @@ export const mockScenarioResponseSchema = z.object({
49
55
  export const fixtureListSchema = z.object({
50
56
  fixtures: z.array(z.object({ id: z.string().min(1), description: z.string().min(1) })),
51
57
  });
58
+ const PROJECT_BILLING_EXAMPLE = {
59
+ desiredRevision: 2,
60
+ effectiveRevision: 2,
61
+ pending: false,
62
+ recurringProjectFees: { currency: "USD", microdollars: "0", scale: 6 },
63
+ projects: [],
64
+ pendingOperations: [],
65
+ };
66
+ const PROJECT_BILLING_QUOTE_EXAMPLE = {
67
+ action: "add",
68
+ project: "proj_00000000000000000000000000",
69
+ quote: "quote-example",
70
+ expectedRevision: 2,
71
+ expiresAt: "2026-09-10T12:05:00.000Z",
72
+ charge: { currency: "USD", microdollars: "5000000", scale: 6 },
73
+ monthlyProjectFees: { currency: "USD", microdollars: "5000000", scale: 6 },
74
+ effectiveAt: "2026-09-10T12:00:00.000Z",
75
+ formerIncludedWillBlock: false,
76
+ };
77
+ const BILLING_SUMMARY_EXAMPLE = {
78
+ activation: {
79
+ boundary: "2026-09-01T00:00:00.000Z",
80
+ mode: "shadow",
81
+ },
82
+ blockingReasons: [],
83
+ budgetPolicy: {
84
+ desired: { advisoryBudget: null, hardCap: null },
85
+ desiredRevision: 0,
86
+ effectiveRevision: 0,
87
+ pending: false,
88
+ },
89
+ credit: {
90
+ available: { currency: "USD", microdollars: "999980", scale: 6 },
91
+ consumed: { currency: "USD", microdollars: "10", scale: 6 },
92
+ reserved: { currency: "USD", microdollars: "10", scale: 6 },
93
+ },
94
+ desiredRevision: 2,
95
+ effectiveRevision: 1,
96
+ freshness: { kind: "authoritative" },
97
+ includedProject: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
98
+ period: {
99
+ automaticExecutionTopUp: {
100
+ pending: { currency: "USD", microdollars: "0", scale: 6 },
101
+ settled: { currency: "USD", microdollars: "0", scale: 6 },
102
+ },
103
+ subscribedProjectFees: {
104
+ currency: "USD",
105
+ microdollars: "0",
106
+ scale: 6,
107
+ },
108
+ reservedUsage: { currency: "USD", microdollars: "10", scale: 6 },
109
+ settledUsage: { currency: "USD", microdollars: "10", scale: 6 },
110
+ start: "2026-09-01T00:00:00.000Z",
111
+ end: "2026-10-01T00:00:00.000Z",
112
+ },
113
+ pending: true,
114
+ priceVersion: "payg-v1",
115
+ trialExpiresAt: "2026-09-15T00:00:00.000Z",
116
+ };
117
+ const BILLING_FUNDING_QUOTE_EXAMPLE = {
118
+ credit: { currency: "USD", microdollars: "10000000", scale: 6 },
119
+ expectedRevision: 3,
120
+ expiresAt: "2026-09-10T12:05:00.000Z",
121
+ gross: null,
122
+ quote: "funding-quote-example",
123
+ tax: null,
124
+ taxStatus: "calculated-at-checkout",
125
+ };
126
+ const BILLING_FUNDING_EXAMPLE = {
127
+ automaticExecutionTopUp: {
128
+ ceiling: { currency: "USD", microdollars: "50000000", scale: 6 },
129
+ currentPeriod: {
130
+ end: "2026-10-01T00:00:00.000Z",
131
+ pending: { currency: "USD", microdollars: "10830000", scale: 6 },
132
+ remaining: { currency: "USD", microdollars: "29170000", scale: 6 },
133
+ settled: { currency: "USD", microdollars: "10000000", scale: 6 },
134
+ start: "2026-09-01T00:00:00.000Z",
135
+ },
136
+ rule: {
137
+ cooldownUntil: null,
138
+ desired: {
139
+ ceiling: { currency: "USD", microdollars: "50000000", scale: 6 },
140
+ credit: { currency: "USD", microdollars: "10000000", scale: 6 },
141
+ triggerBelow: {
142
+ currency: "USD",
143
+ microdollars: "2000000",
144
+ scale: 6,
145
+ },
146
+ },
147
+ effective: {
148
+ ceiling: { currency: "USD", microdollars: "50000000", scale: 6 },
149
+ credit: { currency: "USD", microdollars: "10000000", scale: 6 },
150
+ triggerBelow: {
151
+ currency: "USD",
152
+ microdollars: "2000000",
153
+ scale: 6,
154
+ },
155
+ },
156
+ state: "ready",
157
+ suspension: null,
158
+ },
159
+ revision: 3,
160
+ },
161
+ credit: {
162
+ amountOwed: { currency: "USD", microdollars: "0", scale: 6 },
163
+ available: { currency: "USD", microdollars: "9000000", scale: 6 },
164
+ reserved: { currency: "USD", microdollars: "10", scale: 6 },
165
+ },
166
+ freshness: { kind: "authoritative" },
167
+ paymentOperations: [
168
+ {
169
+ createdAt: "2026-09-10T12:00:00.000Z",
170
+ credit: { currency: "USD", microdollars: "10000000", scale: 6 },
171
+ gross: { currency: "USD", microdollars: "10830000", scale: 6 },
172
+ id: "funding-operation-example",
173
+ kind: "automatic",
174
+ paymentUrl: "https://pay.stripe.com/receipts/acct_example/example",
175
+ reason: "payment-required",
176
+ state: "pending",
177
+ tax: { currency: "USD", microdollars: "830000", scale: 6 },
178
+ taxStatus: "confirmed",
179
+ updatedAt: "2026-09-10T12:00:01.000Z",
180
+ },
181
+ ],
182
+ subscribedProjectFees: {
183
+ currency: "USD",
184
+ microdollars: "5000000",
185
+ scale: 6,
186
+ },
187
+ };
188
+ const BILLING_NOTICE_PAGE_EXAMPLE = {
189
+ data: [
190
+ {
191
+ amounts: {
192
+ available: { currency: "USD", microdollars: "1750000", scale: 6 },
193
+ threshold: { currency: "USD", microdollars: "2000000", scale: 6 },
194
+ },
195
+ detail: "Available execution credit is below the configured USD 2.00 threshold.",
196
+ email: {
197
+ attempts: 3,
198
+ failureCode: "provider-unavailable",
199
+ lastAttemptAt: "2026-09-10T12:03:00.000Z",
200
+ state: "failed",
201
+ },
202
+ id: "billing-notice-example",
203
+ kind: "low-credit",
204
+ occurredAt: "2026-09-10T12:00:00.000Z",
205
+ payment: null,
206
+ recoveryPath: "#billing-funding",
207
+ resolvedAt: null,
208
+ scope: { kind: "organization" },
209
+ severity: "warning",
210
+ state: "active",
211
+ title: "Execution credit is low",
212
+ updatedAt: "2026-09-10T12:03:00.000Z",
213
+ },
214
+ ],
215
+ freshness: { kind: "authoritative" },
216
+ };
217
+ const BILLING_NOTIFICATION_SETTINGS_EXAMPLE = {
218
+ criticalEmail: true,
219
+ freshness: { kind: "authoritative" },
220
+ lowCreditThreshold: {
221
+ currency: "USD",
222
+ microdollars: "2000000",
223
+ scale: 6,
224
+ },
225
+ noncriticalEmail: true,
226
+ recipients: {
227
+ billingContacts: "active-billing-role-members",
228
+ owners: true,
229
+ },
230
+ revision: 1,
231
+ };
232
+ function withBillingFundingContract(operation) {
233
+ return {
234
+ ...operation,
235
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
236
+ ? {}
237
+ : BILLING_FUNDING_EXAMPLE,
238
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
239
+ ? API_UNUSED_RESPONSE_SCHEMA
240
+ : billingFundingViewSchema,
241
+ };
242
+ }
243
+ const BILLING_AUTO_TOP_UP_PREVIEW_EXAMPLE = {
244
+ action: "enable",
245
+ after: {
246
+ ceiling: { currency: "USD", microdollars: "50000000", scale: 6 },
247
+ credit: { currency: "USD", microdollars: "10000000", scale: 6 },
248
+ triggerBelow: {
249
+ currency: "USD",
250
+ microdollars: "2000000",
251
+ scale: 6,
252
+ },
253
+ },
254
+ before: null,
255
+ currentPeriod: {
256
+ end: "2026-10-01T00:00:00.000Z",
257
+ pending: { currency: "USD", microdollars: "0", scale: 6 },
258
+ remaining: null,
259
+ settled: { currency: "USD", microdollars: "0", scale: 6 },
260
+ start: "2026-09-01T00:00:00.000Z",
261
+ },
262
+ expectedRevision: 3,
263
+ expandsAuthority: true,
264
+ expiresAt: "2026-09-10T12:05:00.000Z",
265
+ preview: "automatic-top-up-preview-example",
266
+ subscribedProjectFees: {
267
+ currency: "USD",
268
+ microdollars: "5000000",
269
+ scale: 6,
270
+ },
271
+ };
272
+ const BILLING_NOTICE_LIST_OPERATION = {
273
+ creates: false,
274
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
275
+ ? ""
276
+ : "Lists the verified organization's durable billing notices with exact USD amounts, affected scope, payment state, a fixed same-page recovery path, and visible email delivery failure. Raw provider details, payment credentials, callback data and arbitrary URLs have no field.",
277
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
278
+ ? {}
279
+ : BILLING_NOTICE_PAGE_EXAMPLE,
280
+ id: "billing.notices",
281
+ idempotent: true,
282
+ mcp: { destructive: false, kind: "tool", openWorld: false },
283
+ method: "GET",
284
+ mutates: false,
285
+ path: "/v1/billing/notices",
286
+ principals: ["api-credential", "oauth", "session"],
287
+ problems: ["invalid_request", "service_unavailable"],
288
+ query: pageRequestSchema,
289
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
290
+ ? API_UNUSED_RESPONSE_SCHEMA
291
+ : billingNoticePageSchema,
292
+ scopes: ["usage:read"],
293
+ sessionAuthority: "headers",
294
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
295
+ ? ""
296
+ : "List persistent billing notices",
297
+ surfaces: ["api", "mock"],
298
+ };
299
+ const BILLING_NOTIFICATION_SETTINGS_OPERATION = {
300
+ creates: false,
301
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
302
+ ? ""
303
+ : "Reads the low-credit threshold in effect and the optional-email choice. Unless a threshold was chosen, it is one fifth of the organization's most recent credit purchase or grant, rounded down to a whole cent, and zero before any credit was granted. Critical email remains mandatory for owners and active billing-role members; addresses and contact management are absent.",
304
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
305
+ ? {}
306
+ : BILLING_NOTIFICATION_SETTINGS_EXAMPLE,
307
+ id: "billing.notificationsettings",
308
+ idempotent: true,
309
+ mcp: { destructive: false, kind: "tool", openWorld: false },
310
+ method: "GET",
311
+ mutates: false,
312
+ path: "/v1/billing/notification-settings",
313
+ principals: ["api-credential", "oauth", "session"],
314
+ problems: ["service_unavailable"],
315
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
316
+ ? API_UNUSED_RESPONSE_SCHEMA
317
+ : billingNotificationSettingsSchema,
318
+ scopes: ["usage:read"],
319
+ sessionAuthority: "headers",
320
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
321
+ ? ""
322
+ : "Read billing notification settings",
323
+ surfaces: ["api", "mock"],
324
+ };
325
+ const BILLING_NOTIFICATION_SETTINGS_UPDATE_OPERATION = {
326
+ creates: false,
327
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
328
+ ? ""
329
+ : "Replaces the low-credit threshold and noncritical email choice at an expected revision. A null threshold returns to the default of one fifth of the most recent credit purchase or grant; an omitted threshold is left exactly as it is. Critical email stays mandatory; idempotent retries converge and agents require explicit approval.",
330
+ environments: ["live"],
331
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
332
+ ? {}
333
+ : BILLING_NOTIFICATION_SETTINGS_EXAMPLE,
334
+ id: "billing.notificationsettingsupdate",
335
+ idempotent: true,
336
+ mcp: { destructive: false, kind: "tool", openWorld: false },
337
+ method: "PATCH",
338
+ mutates: true,
339
+ path: "/v1/billing/notification-settings",
340
+ principals: ["api-credential", "oauth", "session"],
341
+ problems: [
342
+ "idempotency_key_reused",
343
+ "invalid_request",
344
+ "revision_conflict",
345
+ "service_unavailable",
346
+ "test_to_live_escalation",
347
+ ],
348
+ request: billingNotificationSettingsUpdateRequestSchema,
349
+ requestExample: globalThis
350
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
351
+ ? {}
352
+ : {
353
+ expectedRevision: 1,
354
+ lowCreditThreshold: {
355
+ currency: "USD",
356
+ microdollars: "2000000",
357
+ scale: 6,
358
+ },
359
+ noncriticalEmail: false,
360
+ },
361
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
362
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
363
+ ? API_UNUSED_RESPONSE_SCHEMA
364
+ : billingNotificationSettingsSchema,
365
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
366
+ ? {}
367
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
368
+ scopes: ["billing:write"],
369
+ sessionAuthority: "headers",
370
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
371
+ ? ""
372
+ : "Update billing notification settings",
373
+ surfaces: ["api", "mock"],
374
+ };
375
+ const BILLING_AUTO_TOP_UP_PREVIEW_OPERATION = {
376
+ creates: false,
377
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
378
+ ? ""
379
+ : "Previews one complete automatic execution-credit top-up rule without changing payment authority or contacting the payment provider. Enable and edit replace the fixed credit amount, usable-balance trigger and UTC-month gross ceiling together; disable and resume name those exact intents. The preview reports the current and proposed rule, whether authority expands, existing monthly commitments and separate recurring project fees. USD 10 below USD 2 within USD 50 is a suggested editable rule, not a platform maximum or target-balance refill.",
380
+ environments: ["live"],
381
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
382
+ ? {}
383
+ : BILLING_AUTO_TOP_UP_PREVIEW_EXAMPLE,
384
+ id: "billing.autotopuppreview",
385
+ idempotent: false,
386
+ mcp: { destructive: false, kind: "tool", openWorld: false },
387
+ method: "POST",
388
+ mutates: false,
389
+ path: "/v1/billing/funding/auto-top-up/preview",
390
+ principals: ["api-credential", "oauth", "session"],
391
+ problems: [
392
+ "invalid_request",
393
+ "revision_conflict",
394
+ "service_unavailable",
395
+ "state_conflict",
396
+ "test_to_live_escalation",
397
+ ],
398
+ request: billingAutoTopUpPreviewRequestSchema,
399
+ requestExample: globalThis
400
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
401
+ ? {}
402
+ : {
403
+ action: "enable",
404
+ ceiling: {
405
+ currency: "USD",
406
+ microdollars: "50000000",
407
+ scale: 6,
408
+ },
409
+ credit: {
410
+ currency: "USD",
411
+ microdollars: "10000000",
412
+ scale: 6,
413
+ },
414
+ expectedRevision: 3,
415
+ triggerBelow: {
416
+ currency: "USD",
417
+ microdollars: "2000000",
418
+ scale: 6,
419
+ },
420
+ },
421
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
422
+ ? API_UNUSED_RESPONSE_SCHEMA
423
+ : billingAutoTopUpPreviewSchema,
424
+ scopes: ["billing:write"],
425
+ sessionAuthority: "headers",
426
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
427
+ ? ""
428
+ : "Preview an automatic top-up rule",
429
+ surfaces: ["api", "mock"],
430
+ };
431
+ const BILLING_AUTO_TOP_UP_APPLY_OPERATION = withBillingFundingContract({
432
+ creates: false,
433
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
434
+ ? ""
435
+ : "Applies the exact unexpired automatic top-up preview a billing owner confirmed. Enable or expanded limits require this explicit approval; edit and disable fence queued unsubmitted work, while submitted or uncertain payments retain their original identity and UTC authorization month. Resume may clear only an authenticated payment-method failure and never an unresolved provider outcome. Applying a rule creates no charge; later low-balance work remains bounded by the approved fixed amount, one outstanding operation, cooldown, usage cap and gross monthly ceiling.",
436
+ environments: ["live"],
437
+ id: "billing.autotopup",
438
+ idempotent: true,
439
+ mcp: { destructive: false, kind: "tool", openWorld: false },
440
+ method: "PATCH",
441
+ mutates: true,
442
+ path: "/v1/billing/funding/auto-top-up",
443
+ principals: ["api-credential", "oauth", "session"],
444
+ problems: [
445
+ "idempotency_key_reused",
446
+ "invalid_request",
447
+ "revision_conflict",
448
+ "service_unavailable",
449
+ "state_conflict",
450
+ "test_to_live_escalation",
451
+ ],
452
+ request: billingAutoTopUpApplyRequestSchema,
453
+ requestExample: globalThis
454
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
455
+ ? {}
456
+ : {
457
+ confirmed: true,
458
+ expectedRevision: 3,
459
+ preview: "automatic-top-up-preview-example",
460
+ },
461
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
462
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
463
+ ? {}
464
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
465
+ scopes: ["billing:write"],
466
+ sessionAuthority: "headers",
467
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
468
+ ? ""
469
+ : "Apply an automatic top-up rule",
470
+ surfaces: ["api", "mock"],
471
+ });
52
472
  export const OPERATIONS = [
53
473
  {
54
474
  creates: false,
55
- 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.",
56
- example: {
57
- buildSha: "9f2c1ab",
58
- environment: "development",
59
- service: "@greatwait/api",
60
- },
475
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
476
+ ? ""
477
+ : "Read the verified organization's execution-credit payments with bounded cursor continuation. Existing recent-history responses remain compatible.",
478
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
479
+ ? {}
480
+ : { data: [], freshness: { kind: "authoritative" } },
481
+ id: "billing.paymenthistory",
482
+ idempotent: true,
483
+ mcp: { destructive: false, kind: "tool", openWorld: false },
484
+ method: "GET",
485
+ mutates: false,
486
+ path: "/v1/billing/payment-history",
487
+ principals: ["api-credential", "oauth", "session"],
488
+ problems: ["invalid_request", "service_unavailable"],
489
+ query: pageRequestSchema,
490
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
491
+ ? API_UNUSED_RESPONSE_SCHEMA
492
+ : billingPaymentHistoryPageSchema,
493
+ scopes: ["usage:read"],
494
+ sessionAuthority: "headers",
495
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
496
+ ? ""
497
+ : "Page execution-credit payments",
498
+ surfaces: ["api", "mock"],
499
+ },
500
+ {
501
+ creates: false,
502
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
503
+ ? ""
504
+ : "Read the verified organization's project subscription invoices with bounded cursor continuation. Existing recent-history responses remain compatible.",
505
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
506
+ ? {}
507
+ : { data: [], freshness: { kind: "authoritative" } },
508
+ id: "billing.invoicehistory",
509
+ idempotent: true,
510
+ mcp: { destructive: false, kind: "tool", openWorld: false },
511
+ method: "GET",
512
+ mutates: false,
513
+ path: "/v1/billing/invoice-history",
514
+ principals: ["api-credential", "oauth", "session"],
515
+ problems: ["invalid_request", "service_unavailable"],
516
+ query: pageRequestSchema,
517
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
518
+ ? API_UNUSED_RESPONSE_SCHEMA
519
+ : billingInvoiceHistoryPageSchema,
520
+ scopes: ["usage:read"],
521
+ sessionAuthority: "headers",
522
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
523
+ ? ""
524
+ : "Page project subscription invoices",
525
+ surfaces: ["api", "mock"],
526
+ },
527
+ ...DATA_EXPORT_OPERATIONS,
528
+ ...ORGANIZATION_LIFECYCLE_OPERATIONS,
529
+ {
530
+ creates: false,
531
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
532
+ ? ""
533
+ : "Reports the service, environment, and build the request reached. Unauthenticated: it carries no customer data and is used by canaries and deployment smoke checks.",
534
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
535
+ ? {}
536
+ : {
537
+ buildSha: "9f2c1ab",
538
+ environment: "development",
539
+ service: "@greatwait/api",
540
+ },
61
541
  id: "meta.version",
62
542
  idempotent: true,
63
543
  // A resource, not a tool. It takes no arguments and reports a fact about
@@ -70,19 +550,27 @@ export const OPERATIONS = [
70
550
  path: "/__greatwait/version",
71
551
  principals: [],
72
552
  problems: [],
73
- response: scaffoldVersionSchema,
553
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
554
+ ? API_UNUSED_RESPONSE_SCHEMA
555
+ : scaffoldVersionSchema,
74
556
  scopes: [],
75
- summary: "Read the deployed version",
557
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
558
+ ? ""
559
+ : "Read the deployed version",
76
560
  surfaces: ["api", "mock"],
77
561
  },
78
562
  {
79
563
  creates: false,
80
- 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.",
81
- example: {
82
- dependsOn: ["application", "contract", "platform"],
83
- layer: "adapter",
84
- service: "@greatwait/api",
85
- },
564
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
565
+ ? ""
566
+ : "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.",
567
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
568
+ ? {}
569
+ : {
570
+ dependsOn: ["application", "contract", "platform"],
571
+ layer: "adapter",
572
+ service: "@greatwait/api",
573
+ },
86
574
  id: "meta.scaffold",
87
575
  idempotent: true,
88
576
  mcp: { kind: "resource", uri: "greatwait://meta/scaffold" },
@@ -91,22 +579,30 @@ export const OPERATIONS = [
91
579
  path: "/_scaffold",
92
580
  principals: [],
93
581
  problems: [],
94
- response: workspaceScaffoldSchema,
582
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
583
+ ? API_UNUSED_RESPONSE_SCHEMA
584
+ : workspaceScaffoldSchema,
95
585
  scopes: [],
96
- summary: "Read the workspace scaffold",
586
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
587
+ ? ""
588
+ : "Read the workspace scaffold",
97
589
  surfaces: ["api", "mock"],
98
590
  },
99
591
  {
100
592
  creates: false,
101
- description: "Lists the committed contract fixtures the mock can serve. Mock-only: the API has no fixtures.",
102
- example: {
103
- fixtures: [
104
- {
105
- description: "The workspace scaffold every service reports.",
106
- id: "workspace-scaffold",
107
- },
108
- ],
109
- },
593
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
594
+ ? ""
595
+ : "Lists the committed contract fixtures the mock can serve. Mock-only: the API has no fixtures.",
596
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
597
+ ? {}
598
+ : {
599
+ fixtures: [
600
+ {
601
+ description: "The workspace scaffold every service reports.",
602
+ id: "workspace-scaffold",
603
+ },
604
+ ],
605
+ },
110
606
  id: "mock.listFixtures",
111
607
  idempotent: true,
112
608
  mcp: {
@@ -118,19 +614,27 @@ export const OPERATIONS = [
118
614
  path: "/_contract/fixtures",
119
615
  principals: [],
120
616
  problems: [],
121
- response: fixtureListSchema,
617
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
618
+ ? API_UNUSED_RESPONSE_SCHEMA
619
+ : fixtureListSchema,
122
620
  scopes: [],
123
- summary: "List contract fixtures",
621
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
622
+ ? ""
623
+ : "List contract fixtures",
124
624
  surfaces: ["mock"],
125
625
  },
126
626
  {
127
627
  creates: false,
128
- description: "Serves one committed fixture, byte-identical on every call. Returns a not_found problem for an unknown identifier.",
129
- example: {
130
- dependsOn: ["application", "contract", "platform"],
131
- layer: "adapter",
132
- service: "@greatwait/contract-mock",
133
- },
628
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
629
+ ? ""
630
+ : "Serves one committed fixture, byte-identical on every call. Returns a not_found problem for an unknown identifier.",
631
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
632
+ ? {}
633
+ : {
634
+ dependsOn: ["application", "contract", "platform"],
635
+ layer: "adapter",
636
+ service: "@greatwait/contract-mock",
637
+ },
134
638
  id: "mock.getFixture",
135
639
  idempotent: true,
136
640
  mcp: {
@@ -142,28 +646,36 @@ export const OPERATIONS = [
142
646
  path: "/_contract/fixtures/{fixtureId}",
143
647
  principals: [],
144
648
  problems: ["not_found"],
145
- response: workspaceScaffoldSchema,
649
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
650
+ ? API_UNUSED_RESPONSE_SCHEMA
651
+ : workspaceScaffoldSchema,
146
652
  scopes: [],
147
- summary: "Read a contract fixture",
653
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
654
+ ? ""
655
+ : "Read a contract fixture",
148
656
  surfaces: ["mock"],
149
657
  },
150
658
  {
151
659
  creates: true,
152
- 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.",
153
- example: {
154
- createdAt: "2026-08-05T15:00:00.000Z",
155
- environmentKind: "test",
156
- id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
157
- keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
158
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
159
- secret: "ptsk_test_<the-one-time-endpoint-secret-here>",
160
- shownOnce: true,
161
- signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
162
- status: "pending",
163
- updatedAt: "2026-08-05T15:00:00.000Z",
164
- url: "https://hooks.example.com/greatwait",
165
- version: 1,
166
- },
660
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
661
+ ? ""
662
+ : "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 is active and usable the moment it exists; there is nothing to verify. A disabled endpoint is never delivered to, 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 to this call and to no other call an API credential or an OAuth token can make; a signed-in member can read it again through endpoints.revealSigningSecret. There is no endpoint-count ceiling. Disabled endpoints remain readable for audit; request and DNS inspection admission bound creation work and reads are paged.",
663
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
664
+ ? {}
665
+ : {
666
+ createdAt: "2026-08-05T15:00:00.000Z",
667
+ environmentKind: "test",
668
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
669
+ keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
670
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
671
+ secret: "ptsk_test_<the-one-time-endpoint-secret-here>",
672
+ shownOnce: true,
673
+ signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
674
+ status: "active",
675
+ updatedAt: "2026-08-05T15:00:00.000Z",
676
+ url: "https://hooks.example.com/greatwait",
677
+ version: 1,
678
+ },
167
679
  id: "endpoints.create",
168
680
  idempotent: false,
169
681
  mcp: {
@@ -174,35 +686,50 @@ export const OPERATIONS = [
174
686
  mutates: true,
175
687
  path: "/v1/endpoints",
176
688
  principals: ["api-credential", "oauth", "session"],
177
- problems: ["invalid_request", "plan_limit_reached", "rate_limited"],
689
+ problems: [
690
+ "state_conflict",
691
+ "invalid_request",
692
+ "plan_limit_reached",
693
+ "rate_limited",
694
+ ],
178
695
  request: callbackEndpointRequestSchema,
179
- requestExample: { url: "https://hooks.example.com/greatwait" },
180
- response: callbackEndpointCreatedSchema,
696
+ requestExample: globalThis
697
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
698
+ ? {}
699
+ : { url: "https://hooks.example.com/greatwait" },
700
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
701
+ ? API_UNUSED_RESPONSE_SCHEMA
702
+ : callbackEndpointCreatedSchema,
181
703
  scopes: ["endpoints:write"],
182
704
  sessionAuthority: "headers",
183
- summary: "Create a callback endpoint",
705
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
706
+ ? ""
707
+ : "Create a callback endpoint",
184
708
  surfaces: ["api", "mock"],
185
709
  },
186
710
  {
187
711
  creates: false,
188
- 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.",
189
- example: {
190
- data: [
191
- {
192
- createdAt: "2026-08-05T15:00:00.000Z",
193
- environmentKind: "test",
194
- id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
195
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
196
- signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
197
- status: "verified",
198
- updatedAt: "2026-08-05T15:01:00.000Z",
199
- url: "https://hooks.example.com/greatwait",
200
- verifiedAt: "2026-08-05T15:01:00.000Z",
201
- version: 2,
202
- },
203
- ],
204
- freshness: { kind: "authoritative" },
205
- },
712
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
713
+ ? ""
714
+ : "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.",
715
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
716
+ ? {}
717
+ : {
718
+ data: [
719
+ {
720
+ createdAt: "2026-08-05T15:00:00.000Z",
721
+ environmentKind: "test",
722
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
723
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
724
+ signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
725
+ status: "active",
726
+ updatedAt: "2026-08-05T15:01:00.000Z",
727
+ url: "https://hooks.example.com/greatwait",
728
+ version: 2,
729
+ },
730
+ ],
731
+ freshness: { kind: "authoritative" },
732
+ },
206
733
  id: "endpoints.list",
207
734
  idempotent: true,
208
735
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -212,27 +739,35 @@ export const OPERATIONS = [
212
739
  principals: ["api-credential", "oauth", "session"],
213
740
  problems: ["invalid_request"],
214
741
  query: pageRequestSchema,
215
- response: callbackEndpointPageSchema,
742
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
743
+ ? API_UNUSED_RESPONSE_SCHEMA
744
+ : callbackEndpointPageSchema,
216
745
  scopes: ["endpoints:read"],
217
746
  sessionAuthority: "headers",
218
- summary: "List callback endpoints",
747
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
748
+ ? ""
749
+ : "List callback endpoints",
219
750
  surfaces: ["api", "mock"],
220
751
  },
221
752
  {
222
753
  creates: false,
223
- 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.",
224
- example: {
225
- createdAt: "2026-08-05T15:00:00.000Z",
226
- environmentKind: "test",
227
- id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
228
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
229
- signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
230
- status: "verified",
231
- updatedAt: "2026-08-05T15:01:00.000Z",
232
- url: "https://hooks.example.com/greatwait",
233
- verifiedAt: "2026-08-05T15:01:00.000Z",
234
- version: 2,
235
- },
754
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
755
+ ? ""
756
+ : "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.",
757
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
758
+ ? {}
759
+ : {
760
+ createdAt: "2026-08-05T15:00:00.000Z",
761
+ environmentKind: "test",
762
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
763
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
764
+ name: "https://hooks.example.com/greatwait",
765
+ signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
766
+ status: "active",
767
+ updatedAt: "2026-08-05T15:01:00.000Z",
768
+ url: "https://hooks.example.com/greatwait",
769
+ version: 2,
770
+ },
236
771
  id: "endpoints.read",
237
772
  idempotent: true,
238
773
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -241,30 +776,40 @@ export const OPERATIONS = [
241
776
  path: "/v1/endpoints/{endpointId}",
242
777
  principals: ["api-credential", "oauth", "session"],
243
778
  problems: ["invalid_request", "not_found"],
244
- response: callbackEndpointSchema,
245
- // The version a conditional update or verification must send back. Published
779
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
780
+ ? API_UNUSED_RESPONSE_SCHEMA
781
+ : callbackEndpointSchema,
782
+ // The version a conditional update must send back. Published
246
783
  // because a caller expected to put a value in `If-Match` needs the operation
247
784
  // that hands it out to say so — the same reason `schedules.read` carries it.
248
- responseHeaders: versionResponseHeaderSchema,
785
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
786
+ ? {}
787
+ : { responseHeaders: versionResponseHeaderSchema }),
249
788
  scopes: ["endpoints:read"],
250
789
  sessionAuthority: "headers",
251
- summary: "Read a callback endpoint",
790
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
791
+ ? ""
792
+ : "Read a callback endpoint",
252
793
  surfaces: ["api", "mock"],
253
794
  },
254
795
  {
255
796
  creates: false,
256
- 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.",
257
- example: {
258
- createdAt: "2026-08-05T15:00:00.000Z",
259
- environmentKind: "test",
260
- id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
261
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
262
- signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
263
- status: "pending",
264
- updatedAt: "2026-08-05T16:00:00.000Z",
265
- url: "https://hooks.example.com/replacement",
266
- version: 3,
267
- },
797
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
798
+ ? ""
799
+ : "Replaces an endpoint's destination after applying the complete URL and DNS policy, and renames it when a name is given. Deliveries go to the new destination from the next one on. 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.",
800
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
801
+ ? {}
802
+ : {
803
+ createdAt: "2026-08-05T15:00:00.000Z",
804
+ environmentKind: "test",
805
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
806
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
807
+ signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
808
+ status: "active",
809
+ updatedAt: "2026-08-05T16:00:00.000Z",
810
+ url: "https://hooks.example.com/replacement",
811
+ version: 3,
812
+ },
268
813
  id: "endpoints.update",
269
814
  idempotent: true,
270
815
  mcp: { destructive: true, kind: "tool", openWorld: true },
@@ -280,58 +825,98 @@ export const OPERATIONS = [
280
825
  "version_conflict",
281
826
  ],
282
827
  request: callbackEndpointRequestSchema,
283
- requestExample: { url: "https://hooks.example.com/replacement" },
828
+ requestExample: globalThis
829
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
830
+ ? {}
831
+ : { url: "https://hooks.example.com/replacement" },
284
832
  requestHeaders: conditionalRequestHeaderSchema,
285
- response: callbackEndpointSchema,
286
- responseHeaders: versionResponseHeaderSchema,
833
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
834
+ ? API_UNUSED_RESPONSE_SCHEMA
835
+ : callbackEndpointSchema,
836
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
837
+ ? {}
838
+ : { responseHeaders: versionResponseHeaderSchema }),
287
839
  scopes: ["endpoints:write"],
288
840
  sessionAuthority: "headers",
289
- summary: "Update a callback endpoint",
841
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
842
+ ? ""
843
+ : "Update a callback endpoint",
290
844
  surfaces: ["api", "mock"],
291
845
  },
292
846
  {
293
- creates: false,
294
- 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.",
295
- example: {
296
- createdAt: "2026-08-05T15:00:00.000Z",
297
- environmentKind: "test",
298
- id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
299
- lastVerificationAttemptAt: "2026-08-05T15:01:00.000Z",
300
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
301
- signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
302
- status: "verified",
303
- updatedAt: "2026-08-05T15:01:00.000Z",
304
- url: "https://hooks.example.com/greatwait",
305
- verifiedAt: "2026-08-05T15:01:00.000Z",
306
- version: 2,
307
- },
308
- id: "endpoints.verify",
847
+ creates: true,
848
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
849
+ ? ""
850
+ : "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 to this call, so a call whose answer was never read has rotated a key the caller does not hold. It is recoverable: a signed-in member can read both keys, and the instant the overlap ends, through endpoints.revealSigningSecret. An API credential or an OAuth token cannot, so an integration that loses the answer needs a member to read it back rather than a second rotation, which is refused until the overlap ends. Send If-Match with the version the endpoint was read at to be refused rather than rotate an endpoint that has changed since.",
851
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
852
+ ? {}
853
+ : {
854
+ endpoint: {
855
+ createdAt: "2026-08-05T15:00:00.000Z",
856
+ environmentKind: "test",
857
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
858
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
859
+ signingKeys: {
860
+ current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
861
+ next: {
862
+ id: "csk_11h8xyz9k2m4n6p8r0t2v4w6y8",
863
+ overlapEndsAt: "2026-08-06T15:05:00.000Z",
864
+ },
865
+ },
866
+ status: "active",
867
+ updatedAt: "2026-08-05T15:05:00.000Z",
868
+ url: "https://hooks.example.com/greatwait",
869
+ version: 3,
870
+ },
871
+ keyId: "csk_11h8xyz9k2m4n6p8r0t2v4w6y8",
872
+ secret: "ptsk_test_<the-next-one-time-endpoint-secret-here>",
873
+ shownOnce: true,
874
+ },
875
+ id: "endpoints.rotateSigningKey",
309
876
  idempotent: false,
310
- mcp: { destructive: false, kind: "tool", openWorld: true },
877
+ mcp: {
878
+ kind: "unavailable",
879
+ 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.",
880
+ },
311
881
  method: "POST",
312
882
  mutates: true,
313
- path: "/v1/endpoints/{endpointId}/verify",
883
+ path: "/v1/endpoints/{endpointId}/signing-keys/rotate",
314
884
  principals: ["api-credential", "oauth", "session"],
315
885
  problems: [
316
886
  "invalid_request",
317
887
  "not_found",
318
- "rate_limited",
319
888
  "state_conflict",
320
889
  "version_conflict",
321
890
  ],
891
+ request: callbackSigningKeyRotationRequestSchema,
892
+ requestExample: globalThis
893
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
894
+ ? {}
895
+ : { overlapSeconds: 3600 },
322
896
  requestHeaders: conditionalRequestHeaderSchema,
323
- response: callbackEndpointSchema,
324
- responseHeaders: versionResponseHeaderSchema,
897
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
898
+ ? API_UNUSED_RESPONSE_SCHEMA
899
+ : callbackEndpointRotatedSchema,
900
+ // The endpoint's version after the rotation, so the next conditional write
901
+ // from the same page has something to send.
902
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
903
+ ? {}
904
+ : { responseHeaders: versionResponseHeaderSchema }),
325
905
  scopes: ["endpoints:write"],
326
906
  sessionAuthority: "headers",
327
- summary: "Verify callback endpoint ownership",
907
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
908
+ ? ""
909
+ : "Rotate a callback endpoint signing key",
328
910
  surfaces: ["api", "mock"],
329
911
  },
330
912
  {
331
- creates: true,
332
- 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.",
333
- example: {
334
- endpoint: {
913
+ creates: false,
914
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
915
+ ? ""
916
+ : "Records that a person has updated their server to accept the next signing key during the active overlap. This only marks the reminder done: it does not retire either key, shorten the overlap, or change which key signs new deliveries. Send If-Match with the version the endpoint was read at so an acknowledgement cannot be applied to a different rotation.",
917
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
918
+ ? {}
919
+ : {
335
920
  createdAt: "2026-08-05T15:00:00.000Z",
336
921
  environmentKind: "test",
337
922
  id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
@@ -339,29 +924,25 @@ export const OPERATIONS = [
339
924
  signingKeys: {
340
925
  current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
341
926
  next: {
927
+ acknowledgedAt: "2026-08-05T15:10:00.000Z",
342
928
  id: "csk_11h8xyz9k2m4n6p8r0t2v4w6y8",
343
929
  overlapEndsAt: "2026-08-06T15:05:00.000Z",
344
930
  },
345
931
  },
346
- status: "verified",
347
- updatedAt: "2026-08-05T15:05:00.000Z",
932
+ status: "active",
933
+ updatedAt: "2026-08-05T15:10:00.000Z",
348
934
  url: "https://hooks.example.com/greatwait",
349
- verifiedAt: "2026-08-05T15:01:00.000Z",
350
- version: 3,
935
+ version: 4,
351
936
  },
352
- keyId: "csk_11h8xyz9k2m4n6p8r0t2v4w6y8",
353
- secret: "ptsk_test_<the-next-one-time-endpoint-secret-here>",
354
- shownOnce: true,
355
- },
356
- id: "endpoints.rotateSigningKey",
357
- idempotent: false,
937
+ id: "endpoints.acknowledgeSigningKeyRotation",
938
+ idempotent: true,
358
939
  mcp: {
359
940
  kind: "unavailable",
360
- 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.",
941
+ reason: "This is a human assertion about a server outside GreatWait; an agent cannot observe that the server has accepted the new secret.",
361
942
  },
362
943
  method: "POST",
363
944
  mutates: true,
364
- path: "/v1/endpoints/{endpointId}/signing-keys/rotate",
945
+ path: "/v1/endpoints/{endpointId}/signing-keys/acknowledge",
365
946
  principals: ["api-credential", "oauth", "session"],
366
947
  problems: [
367
948
  "invalid_request",
@@ -369,34 +950,83 @@ export const OPERATIONS = [
369
950
  "state_conflict",
370
951
  "version_conflict",
371
952
  ],
372
- request: callbackSigningKeyRotationRequestSchema,
373
- requestExample: { overlapSeconds: 3600 },
374
- requestHeaders: conditionalRequestHeaderSchema,
375
- response: callbackEndpointRotatedSchema,
376
- // The endpoint's version after the rotation, so the next conditional write
377
- // from the same page has something to send.
378
- responseHeaders: versionResponseHeaderSchema,
953
+ requestHeaders: requiredConditionalRequestHeaderSchema,
954
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
955
+ ? API_UNUSED_RESPONSE_SCHEMA
956
+ : callbackEndpointSchema,
957
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
958
+ ? {}
959
+ : { responseHeaders: versionResponseHeaderSchema }),
379
960
  scopes: ["endpoints:write"],
380
961
  sessionAuthority: "headers",
381
- summary: "Rotate a callback endpoint signing key",
962
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
963
+ ? ""
964
+ : "Mark a signing-key server update done",
382
965
  surfaces: ["api", "mock"],
383
966
  },
384
967
  {
385
968
  creates: false,
386
- 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.",
387
- example: {
388
- createdAt: "2026-08-05T15:00:00.000Z",
389
- disabledAt: "2026-08-05T17:00:00.000Z",
390
- environmentKind: "test",
391
- id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
392
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
393
- signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
394
- status: "disabled",
395
- updatedAt: "2026-08-05T17:00:00.000Z",
396
- url: "https://hooks.example.com/greatwait",
397
- verifiedAt: "2026-08-05T15:01:00.000Z",
398
- version: 3,
969
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
970
+ ? ""
971
+ : "Reveals an endpoint's signing secret to a signed-in member: the value `endpoints.create` and `endpoints.rotateSigningKey` hand out once, readable again from the endpoint's own page. During a rotation both keys are returned, with the instant the overlap ends. Only a member session is accepted; an API credential or an OAuth token is refused, so an integration that needs the secret keeps the one the create or rotation that minted it returned. A disabled endpoint has nothing to reveal.",
972
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
973
+ ? {}
974
+ : {
975
+ current: {
976
+ keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
977
+ secret: "ptsk_test_<the-current-endpoint-secret-here>",
978
+ },
979
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
980
+ },
981
+ id: "endpoints.revealSigningSecret",
982
+ idempotent: true,
983
+ // The same reason `endpoints.rotateSigningKey` gives, and one more: the
984
+ // route accepts only a signed-in member, and MCP never carries a session.
985
+ // The operator chose reveal-later for people (FXO-2244) and no new
986
+ // machine-callable read; an agent that needs the secret scripts the
987
+ // create or rotation, which keeps it out of tool history by construction.
988
+ mcp: {
989
+ kind: "unavailable",
990
+ reason: "The response is an endpoint signing secret, which MCP has no secure-result channel for — and the route accepts only a signed-in member, which MCP never carries.",
399
991
  },
992
+ method: "GET",
993
+ mutates: false,
994
+ path: "/v1/endpoints/{endpointId}/signing-secret",
995
+ principals: ["session"],
996
+ problems: ["invalid_request", "not_found", "state_conflict"],
997
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
998
+ ? API_UNUSED_RESPONSE_SCHEMA
999
+ : callbackEndpointSigningSecretsSchema,
1000
+ // `endpoints:write`, not `endpoints:read`, though nothing is written: it is
1001
+ // the standing the two operations that already hand this value out
1002
+ // require, and a session that may not rotate the key should not be able
1003
+ // to read it either.
1004
+ scopes: ["endpoints:write"],
1005
+ sessionAuthority: "headers",
1006
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1007
+ ? ""
1008
+ : "Reveal a callback endpoint signing secret",
1009
+ surfaces: ["api", "mock"],
1010
+ },
1011
+ {
1012
+ creates: false,
1013
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1014
+ ? ""
1015
+ : "Disables an endpoint immediately. It stays readable for audit but can no longer be updated or delivered to, and schedules pointed at it deliver nothing until `endpoints.enable` turns it back on. 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.",
1016
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1017
+ ? {}
1018
+ : {
1019
+ createdAt: "2026-08-05T15:00:00.000Z",
1020
+ disabledAt: "2026-08-05T17:00:00.000Z",
1021
+ environmentKind: "test",
1022
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1023
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1024
+ signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
1025
+ status: "disabled",
1026
+ updatedAt: "2026-08-05T17:00:00.000Z",
1027
+ url: "https://hooks.example.com/greatwait",
1028
+ version: 3,
1029
+ },
400
1030
  id: "endpoints.disable",
401
1031
  idempotent: true,
402
1032
  mcp: { destructive: true, kind: "tool", openWorld: false },
@@ -405,27 +1035,80 @@ export const OPERATIONS = [
405
1035
  path: "/v1/endpoints/{endpointId}",
406
1036
  principals: ["api-credential", "oauth", "session"],
407
1037
  problems: ["invalid_request", "not_found"],
408
- response: callbackEndpointSchema,
409
- responseHeaders: versionResponseHeaderSchema,
1038
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1039
+ ? API_UNUSED_RESPONSE_SCHEMA
1040
+ : callbackEndpointSchema,
1041
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
1042
+ ? {}
1043
+ : { responseHeaders: versionResponseHeaderSchema }),
1044
+ scopes: ["endpoints:write"],
1045
+ sessionAuthority: "headers",
1046
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1047
+ ? ""
1048
+ : "Disable a callback endpoint",
1049
+ surfaces: ["api", "mock"],
1050
+ },
1051
+ {
1052
+ creates: false,
1053
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1054
+ ? ""
1055
+ : "Enables an endpoint that was disabled, so schedules pointed at it deliver again from the next occurrence on. Its address, name, signing keys and history are exactly as they were; nothing has to be created or re-pointed. Repeating the enable is idempotent and does not write a second audit event, so like `endpoints.disable` it takes no precondition. Somebody who disabled an endpoint by mistake, with many schedules pointed at it, gets it back with one call.",
1056
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1057
+ ? {}
1058
+ : {
1059
+ createdAt: "2026-08-05T15:00:00.000Z",
1060
+ environmentKind: "test",
1061
+ id: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1062
+ name: "https://hooks.example.com/greatwait",
1063
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1064
+ signingKeys: { current: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8" },
1065
+ status: "active",
1066
+ updatedAt: "2026-08-05T18:00:00.000Z",
1067
+ url: "https://hooks.example.com/greatwait",
1068
+ version: 4,
1069
+ },
1070
+ id: "endpoints.enable",
1071
+ idempotent: true,
1072
+ mcp: { destructive: false, kind: "tool", openWorld: false },
1073
+ method: "POST",
1074
+ mutates: true,
1075
+ path: "/v1/endpoints/{endpointId}/enable",
1076
+ principals: ["api-credential", "oauth", "session"],
1077
+ // `state_conflict` when another endpoint took this one's name while it
1078
+ // was off: names are unique among live endpoints, and enabling would make
1079
+ // two.
1080
+ problems: ["invalid_request", "not_found", "state_conflict"],
1081
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1082
+ ? API_UNUSED_RESPONSE_SCHEMA
1083
+ : callbackEndpointSchema,
1084
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
1085
+ ? {}
1086
+ : { responseHeaders: versionResponseHeaderSchema }),
410
1087
  scopes: ["endpoints:write"],
411
1088
  sessionAuthority: "headers",
412
- summary: "Disable a callback endpoint",
1089
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1090
+ ? ""
1091
+ : "Enable a disabled callback endpoint",
413
1092
  surfaces: ["api", "mock"],
414
1093
  },
415
1094
  {
416
1095
  creates: true,
417
- 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.",
418
- example: {
419
- createdAt: "2026-08-07T15:00:00.000Z",
420
- deliveryCount: 0,
421
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
422
- environmentKind: "test",
423
- id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
424
- program: { behavior: "success" },
425
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
426
- updatedAt: "2026-08-07T15:00:00.000Z",
427
- url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
428
- },
1096
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1097
+ ? ""
1098
+ : "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 every attempt lands here.",
1099
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1100
+ ? {}
1101
+ : {
1102
+ createdAt: "2026-08-07T15:00:00.000Z",
1103
+ deliveryCount: 0,
1104
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1105
+ environmentKind: "test",
1106
+ id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1107
+ program: { behavior: "success" },
1108
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1109
+ updatedAt: "2026-08-07T15:00:00.000Z",
1110
+ url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1111
+ },
429
1112
  environments: ["test"],
430
1113
  id: "testsinks.create",
431
1114
  idempotent: false,
@@ -449,35 +1132,50 @@ export const OPERATIONS = [
449
1132
  "state_conflict",
450
1133
  ],
451
1134
  request: testSinkCreateRequestSchema,
452
- requestExample: {
453
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
454
- program: { behavior: "server_error", forDeliveries: 2, then: "success" },
455
- },
456
- response: testSinkSchema,
1135
+ requestExample: globalThis
1136
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1137
+ ? {}
1138
+ : {
1139
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1140
+ program: {
1141
+ behavior: "server_error",
1142
+ forDeliveries: 2,
1143
+ then: "success",
1144
+ },
1145
+ },
1146
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1147
+ ? API_UNUSED_RESPONSE_SCHEMA
1148
+ : testSinkSchema,
457
1149
  scopes: ["endpoints:write"],
458
1150
  sessionAuthority: "headers",
459
- summary: "Create a test sink",
1151
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1152
+ ? ""
1153
+ : "Create a test sink",
460
1154
  surfaces: ["api", "mock"],
461
1155
  },
462
1156
  {
463
1157
  creates: false,
464
- 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.",
465
- example: {
466
- data: [
467
- {
468
- createdAt: "2026-08-07T15:00:00.000Z",
469
- deliveryCount: 3,
470
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
471
- environmentKind: "test",
472
- id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
473
- program: { behavior: "success" },
474
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
475
- updatedAt: "2026-08-07T15:02:00.000Z",
476
- url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
477
- },
478
- ],
479
- freshness: { kind: "authoritative" },
480
- },
1158
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1159
+ ? ""
1160
+ : "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.",
1161
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1162
+ ? {}
1163
+ : {
1164
+ data: [
1165
+ {
1166
+ createdAt: "2026-08-07T15:00:00.000Z",
1167
+ deliveryCount: 3,
1168
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1169
+ environmentKind: "test",
1170
+ id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1171
+ program: { behavior: "success" },
1172
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1173
+ updatedAt: "2026-08-07T15:02:00.000Z",
1174
+ url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1175
+ },
1176
+ ],
1177
+ freshness: { kind: "authoritative" },
1178
+ },
481
1179
  environments: ["test"],
482
1180
  id: "testsinks.list",
483
1181
  idempotent: true,
@@ -488,26 +1186,34 @@ export const OPERATIONS = [
488
1186
  principals: ["api-credential", "oauth", "session"],
489
1187
  problems: ["invalid_request", "state_conflict"],
490
1188
  query: pageRequestSchema,
491
- response: testSinkPageSchema,
1189
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1190
+ ? API_UNUSED_RESPONSE_SCHEMA
1191
+ : testSinkPageSchema,
492
1192
  scopes: ["endpoints:read"],
493
1193
  sessionAuthority: "headers",
494
- summary: "List test sinks",
1194
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1195
+ ? ""
1196
+ : "List test sinks",
495
1197
  surfaces: ["api", "mock"],
496
1198
  },
497
1199
  {
498
1200
  creates: false,
499
- 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.",
500
- example: {
501
- createdAt: "2026-08-07T15:00:00.000Z",
502
- deliveryCount: 3,
503
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
504
- environmentKind: "test",
505
- id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
506
- program: { behavior: "rate_limited", retryAfterSeconds: 5 },
507
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
508
- updatedAt: "2026-08-07T15:02:00.000Z",
509
- url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
510
- },
1201
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1202
+ ? ""
1203
+ : "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.",
1204
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1205
+ ? {}
1206
+ : {
1207
+ createdAt: "2026-08-07T15:00:00.000Z",
1208
+ deliveryCount: 3,
1209
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1210
+ environmentKind: "test",
1211
+ id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1212
+ program: { behavior: "rate_limited", retryAfterSeconds: 5 },
1213
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1214
+ updatedAt: "2026-08-07T15:02:00.000Z",
1215
+ url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1216
+ },
511
1217
  environments: ["test"],
512
1218
  id: "testsinks.read",
513
1219
  idempotent: true,
@@ -517,26 +1223,34 @@ export const OPERATIONS = [
517
1223
  path: "/v1/test-sinks/{sinkId}",
518
1224
  principals: ["api-credential", "oauth", "session"],
519
1225
  problems: ["invalid_request", "not_found", "state_conflict"],
520
- response: testSinkSchema,
1226
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1227
+ ? API_UNUSED_RESPONSE_SCHEMA
1228
+ : testSinkSchema,
521
1229
  scopes: ["endpoints:read"],
522
1230
  sessionAuthority: "headers",
523
- summary: "Read a test sink",
1231
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1232
+ ? ""
1233
+ : "Read a test sink",
524
1234
  surfaces: ["api", "mock"],
525
1235
  },
526
1236
  {
527
1237
  creates: false,
528
- 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.",
529
- example: {
530
- createdAt: "2026-08-07T15:00:00.000Z",
531
- deliveryCount: 3,
532
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
533
- environmentKind: "test",
534
- id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
535
- program: { behavior: "timeout" },
536
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
537
- updatedAt: "2026-08-07T15:03:00.000Z",
538
- url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
539
- },
1238
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1239
+ ? ""
1240
+ : "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.",
1241
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1242
+ ? {}
1243
+ : {
1244
+ createdAt: "2026-08-07T15:00:00.000Z",
1245
+ deliveryCount: 3,
1246
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1247
+ environmentKind: "test",
1248
+ id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1249
+ program: { behavior: "timeout" },
1250
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1251
+ updatedAt: "2026-08-07T15:03:00.000Z",
1252
+ url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1253
+ },
540
1254
  environments: ["test"],
541
1255
  id: "testsinks.configure",
542
1256
  idempotent: true,
@@ -547,33 +1261,44 @@ export const OPERATIONS = [
547
1261
  principals: ["api-credential", "oauth", "session"],
548
1262
  problems: ["invalid_request", "not_found", "state_conflict"],
549
1263
  request: testSinkProgramSchema,
550
- requestExample: { behavior: "timeout" },
551
- response: testSinkSchema,
1264
+ requestExample: globalThis
1265
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1266
+ ? {}
1267
+ : { behavior: "timeout" },
1268
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1269
+ ? API_UNUSED_RESPONSE_SCHEMA
1270
+ : testSinkSchema,
552
1271
  scopes: ["endpoints:write"],
553
1272
  sessionAuthority: "headers",
554
- summary: "Set a test sink behavior program",
1273
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1274
+ ? ""
1275
+ : "Set a test sink behavior program",
555
1276
  surfaces: ["api", "mock"],
556
1277
  },
557
1278
  {
558
1279
  creates: false,
559
- 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.",
560
- example: {
561
- data: [
562
- {
563
- behavior: "success",
564
- delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8",
565
- disposition: "processed",
566
- id: "tsd_01h8xyz9k2m4n6p8r0t2v4w6y8",
567
- keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
568
- occurrenceId: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
569
- receivedAt: "2026-08-07T15:02:00.000Z",
570
- respondedWith: 200,
571
- scheduleId: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
572
- sink: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
573
- },
574
- ],
575
- freshness: { kind: "authoritative" },
576
- },
1280
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1281
+ ? ""
1282
+ : "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.",
1283
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1284
+ ? {}
1285
+ : {
1286
+ data: [
1287
+ {
1288
+ behavior: "success",
1289
+ delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8",
1290
+ disposition: "processed",
1291
+ id: "tsd_01h8xyz9k2m4n6p8r0t2v4w6y8",
1292
+ keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1293
+ occurrenceId: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1294
+ receivedAt: "2026-08-07T15:02:00.000Z",
1295
+ respondedWith: 200,
1296
+ scheduleId: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1297
+ sink: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1298
+ },
1299
+ ],
1300
+ freshness: { kind: "authoritative" },
1301
+ },
577
1302
  environments: ["test"],
578
1303
  id: "sinkdeliveries.list",
579
1304
  idempotent: true,
@@ -584,31 +1309,39 @@ export const OPERATIONS = [
584
1309
  principals: ["api-credential", "oauth", "session"],
585
1310
  problems: ["invalid_request", "not_found", "state_conflict"],
586
1311
  query: pageRequestSchema,
587
- response: testSinkDeliveryPageSchema,
1312
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1313
+ ? API_UNUSED_RESPONSE_SCHEMA
1314
+ : testSinkDeliveryPageSchema,
588
1315
  scopes: ["endpoints:read"],
589
1316
  sessionAuthority: "headers",
590
- summary: "List test sink deliveries",
591
- surfaces: ["api", "mock"],
592
- },
593
- {
594
- creates: false,
595
- 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.",
596
- example: {
597
- behavior: "success",
598
- 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":{}}',
599
- bodyTruncated: false,
600
- delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8",
601
- disposition: "processed",
602
- id: "tsd_01h8xyz9k2m4n6p8r0t2v4w6y8",
603
- keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
604
- occurrenceId: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
605
- receivedAt: "2026-08-07T15:02:00.000Z",
606
- receivedBytes: 240,
607
- respondedWith: 200,
608
- scheduleId: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
609
- signature: "v1=11135fdfc0bc5d49ebcc9d3a0d8df1116179097cefe961c6eca281339e5cfab3",
610
- sink: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
611
- },
1317
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1318
+ ? ""
1319
+ : "List test sink deliveries",
1320
+ surfaces: ["api", "mock"],
1321
+ },
1322
+ {
1323
+ creates: false,
1324
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1325
+ ? ""
1326
+ : "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.",
1327
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1328
+ ? {}
1329
+ : {
1330
+ behavior: "success",
1331
+ 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":{}}',
1332
+ bodyTruncated: false,
1333
+ delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8",
1334
+ disposition: "processed",
1335
+ id: "tsd_01h8xyz9k2m4n6p8r0t2v4w6y8",
1336
+ keyId: "csk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1337
+ occurrenceId: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1338
+ receivedAt: "2026-08-07T15:02:00.000Z",
1339
+ receivedBytes: 240,
1340
+ respondedWith: 200,
1341
+ scheduleId: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1342
+ signature: "v1=11135fdfc0bc5d49ebcc9d3a0d8df1116179097cefe961c6eca281339e5cfab3",
1343
+ sink: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1344
+ },
612
1345
  environments: ["test"],
613
1346
  id: "sinkdeliveries.read",
614
1347
  idempotent: true,
@@ -621,26 +1354,34 @@ export const OPERATIONS = [
621
1354
  path: "/v1/test-sinks/{sinkId}/deliveries/{deliveryRecordId}",
622
1355
  principals: ["api-credential", "oauth", "session"],
623
1356
  problems: ["invalid_request", "not_found", "state_conflict"],
624
- response: testSinkDeliveryBodySchema,
1357
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1358
+ ? API_UNUSED_RESPONSE_SCHEMA
1359
+ : testSinkDeliveryBodySchema,
625
1360
  scopes: ["endpoints:read"],
626
1361
  sessionAuthority: "headers",
627
- summary: "Read a test sink delivery",
1362
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1363
+ ? ""
1364
+ : "Read a test sink delivery",
628
1365
  surfaces: ["api", "mock"],
629
1366
  },
630
1367
  {
631
1368
  creates: false,
632
- 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.",
633
- example: {
634
- createdAt: "2026-08-07T15:00:00.000Z",
635
- deliveryCount: 3,
636
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
637
- environmentKind: "test",
638
- id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
639
- program: { behavior: "success" },
640
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
641
- updatedAt: "2026-08-07T15:04:00.000Z",
642
- url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
643
- },
1369
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1370
+ ? ""
1371
+ : "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.",
1372
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1373
+ ? {}
1374
+ : {
1375
+ createdAt: "2026-08-07T15:00:00.000Z",
1376
+ deliveryCount: 3,
1377
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1378
+ environmentKind: "test",
1379
+ id: "tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1380
+ program: { behavior: "success" },
1381
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1382
+ updatedAt: "2026-08-07T15:04:00.000Z",
1383
+ url: "https://sink.greatwait.dev/__greatwait/test-sinks/tsk_01h8xyz9k2m4n6p8r0t2v4w6y8",
1384
+ },
644
1385
  environments: ["test"],
645
1386
  id: "testsinks.delete",
646
1387
  idempotent: true,
@@ -650,20 +1391,28 @@ export const OPERATIONS = [
650
1391
  path: "/v1/test-sinks/{sinkId}",
651
1392
  principals: ["api-credential", "oauth", "session"],
652
1393
  problems: ["invalid_request", "not_found", "state_conflict"],
653
- response: testSinkSchema,
1394
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1395
+ ? API_UNUSED_RESPONSE_SCHEMA
1396
+ : testSinkSchema,
654
1397
  scopes: ["endpoints:write"],
655
1398
  sessionAuthority: "headers",
656
- summary: "Delete a test sink",
1399
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1400
+ ? ""
1401
+ : "Delete a test sink",
657
1402
  surfaces: ["api", "mock"],
658
1403
  },
659
1404
  {
660
1405
  creates: true,
661
- 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.",
662
- example: {
663
- behavior: "retry",
664
- now: "2026-01-01T00:00:00.000Z",
665
- scenarioId: "scenario-1",
666
- },
1406
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1407
+ ? ""
1408
+ : "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.",
1409
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1410
+ ? {}
1411
+ : {
1412
+ behavior: "retry",
1413
+ now: "2026-01-01T00:00:00.000Z",
1414
+ scenarioId: "scenario-1",
1415
+ },
667
1416
  id: "mock.setScenario",
668
1417
  idempotent: false,
669
1418
  mcp: {
@@ -676,21 +1425,32 @@ export const OPERATIONS = [
676
1425
  principals: [],
677
1426
  problems: ["invalid_request"],
678
1427
  request: mockScenarioRequestSchema,
679
- requestExample: { behavior: "retry", failuresBeforeSuccess: 2 },
680
- response: mockScenarioResponseSchema,
1428
+ requestExample: globalThis
1429
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1430
+ ? {}
1431
+ : { behavior: "retry", failuresBeforeSuccess: 2 },
1432
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1433
+ ? API_UNUSED_RESPONSE_SCHEMA
1434
+ : mockScenarioResponseSchema,
681
1435
  scopes: [],
682
- summary: "Set the mock scenario",
1436
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1437
+ ? ""
1438
+ : "Set the mock scenario",
683
1439
  surfaces: ["mock"],
684
1440
  },
685
1441
  {
686
1442
  creates: false,
687
- description: "Reports the authority the presented credential carries: the project it acts in, which of that project's two environments, and the scopes the service will enforce for it. The answer comes entirely from the verified principal, so there is no parameter that could name another project and no way for the reply to describe anything but the caller itself. It requires a principal and no scope, because every value in it is a property of the credential being presented rather than of anything the credential may reach: a caller that could not read this could still act, and would simply be acting without being able to say where. A signed-in member is not accepted — a session's authority is an organization and it names its project per request, so there is no single answer to give one.",
688
- example: {
689
- environmentKind: "test",
690
- principal: "api-credential",
691
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
692
- scopes: ["schedules:read", "schedules:write"],
693
- },
1443
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1444
+ ? ""
1445
+ : "Reports the authority the presented credential carries: the project it acts in, which of that project's two environments, and the scopes the service will enforce for it. The answer comes entirely from the verified principal, so there is no parameter that could name another project and no way for the reply to describe anything but the caller itself. It requires a principal and no scope, because every value in it is a property of the credential being presented rather than of anything the credential may reach: a caller that could not read this could still act, and would simply be acting without being able to say where. A signed-in member is not accepted — a session's authority is an organization and it names its project per request, so there is no single answer to give one.",
1446
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1447
+ ? {}
1448
+ : {
1449
+ environmentKind: "test",
1450
+ principal: "api-credential",
1451
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1452
+ scopes: ["schedules:read", "schedules:write"],
1453
+ },
694
1454
  id: "context.read",
695
1455
  idempotent: true,
696
1456
  // A resource rather than a tool: it takes no arguments, it reports a fact
@@ -707,30 +1467,38 @@ export const OPERATIONS = [
707
1467
  // No `not_found`: the authority tuple exists by the time a principal is
708
1468
  // verified, so there is nothing here that can be absent.
709
1469
  problems: [],
710
- response: credentialContextSchema,
1470
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1471
+ ? API_UNUSED_RESPONSE_SCHEMA
1472
+ : credentialContextSchema,
711
1473
  // **Empty, and that is the point of the operation.** Every other
712
1474
  // authenticated operation names the scope it consumes; this one consumes
713
1475
  // none, so `scope_missing` is a refusal it can never produce and
714
1476
  // `problemsFor` does not publish one for it.
715
1477
  scopes: [],
716
- summary: "Read this credential's authority",
1478
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1479
+ ? ""
1480
+ : "Read this credential's authority",
717
1481
  surfaces: ["api", "mock"],
718
1482
  },
719
1483
  {
720
1484
  creates: true,
721
- 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.",
722
- example: {
723
- createdAt: "2026-07-28T15:00:00.000Z",
724
- displayPrefix: "pt_test_a1b2c3d4",
725
- environmentKind: "test",
726
- id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
727
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
728
- scopes: ["schedules:write"],
729
- secret: "pt_test_a1b2c3d4<the-32-character-secret-half-here>",
730
- shownOnce: true,
731
- },
732
- id: "credentials.create",
733
- idempotent: false,
1485
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1486
+ ? ""
1487
+ : "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.",
1488
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1489
+ ? {}
1490
+ : {
1491
+ createdAt: "2026-07-28T15:00:00.000Z",
1492
+ displayPrefix: "pt_test_a1b2c3d4",
1493
+ environmentKind: "test",
1494
+ id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
1495
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1496
+ scopes: ["schedules:write"],
1497
+ secret: "pt_test_a1b2c3d4<the-32-character-secret-half-here>",
1498
+ shownOnce: true,
1499
+ },
1500
+ id: "credentials.create",
1501
+ idempotent: false,
734
1502
  // The one API-surface operation an agent cannot reach, and the reason is
735
1503
  // the route's own: issuance is authenticated by a Clerk session and refuses
736
1504
  // an API credential outright, because a key that can mint keys turns one
@@ -764,42 +1532,53 @@ export const OPERATIONS = [
764
1532
  // where the refusal becomes reachable and declarable.
765
1533
  problems: ["invalid_request", "not_found"],
766
1534
  request: credentialRequestSchema,
767
- requestExample: {
768
- environmentKind: "test",
769
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
770
- scopes: ["schedules:write"],
771
- },
772
- response: credentialCreatedSchema,
1535
+ requestExample: globalThis
1536
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1537
+ ? {}
1538
+ : {
1539
+ environmentKind: "test",
1540
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1541
+ scopes: ["schedules:write"],
1542
+ },
1543
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1544
+ ? API_UNUSED_RESPONSE_SCHEMA
1545
+ : credentialCreatedSchema,
773
1546
  scopes: ["credentials:write"],
774
1547
  sessionAuthority: "request-body",
775
- summary: "Issue an API credential",
1548
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1549
+ ? ""
1550
+ : "Issue an API credential",
776
1551
  surfaces: ["api", "mock"],
777
1552
  },
778
1553
  {
779
1554
  creates: false,
780
- 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.",
781
- example: {
782
- data: [
783
- {
784
- createdAt: "2026-07-28T15:00:00.000Z",
785
- displayPrefix: "pt_test_a1b2c3d4",
786
- environmentKind: "test",
787
- id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
788
- lastUsedAt: "2026-07-28T15:04:00.000Z",
789
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
790
- scopes: ["schedules:write"],
791
- },
792
- ],
793
- // Authoritative rather than projected: credentials are read from the row
794
- // that owns them, not from a cross-partition projection. The
795
- // discriminator is on every page so a client never has to know which
796
- // collections lag.
797
- freshness: { kind: "authoritative" },
798
- // Opaque. Clients pass back exactly what they were given, which is why
799
- // this is the whole value rather than an elided one — a truncated example
800
- // teaches a reader that a cursor has readable parts.
801
- nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoiYWtfMDFoOHh5ejlrMm00bjZwOHIwdDJ2NHc2eTgiLCJrIjoiOTUxMzU0NmYifQ",
802
- },
1555
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1556
+ ? ""
1557
+ : "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.",
1558
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1559
+ ? {}
1560
+ : {
1561
+ data: [
1562
+ {
1563
+ createdAt: "2026-07-28T15:00:00.000Z",
1564
+ displayPrefix: "pt_test_a1b2c3d4",
1565
+ environmentKind: "test",
1566
+ id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
1567
+ lastUsedAt: "2026-07-28T15:04:00.000Z",
1568
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1569
+ scopes: ["schedules:write"],
1570
+ },
1571
+ ],
1572
+ // Authoritative rather than projected: credentials are read from the row
1573
+ // that owns them, not from a cross-partition projection. The
1574
+ // discriminator is on every page so a client never has to know which
1575
+ // collections lag.
1576
+ freshness: { kind: "authoritative" },
1577
+ // Opaque. Clients pass back exactly what they were given, which is why
1578
+ // this is the whole value rather than an elided one — a truncated example
1579
+ // teaches a reader that a cursor has readable parts.
1580
+ nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoiYWtfMDFoOHh5ejlrMm00bjZwOHIwdDJ2NHc2eTgiLCJrIjoiOTUxMzU0NmYifQ",
1581
+ },
803
1582
  id: "credentials.list",
804
1583
  idempotent: true,
805
1584
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -813,31 +1592,39 @@ export const OPERATIONS = [
813
1592
  // sometimes empty.
814
1593
  problems: ["invalid_request"],
815
1594
  query: pageRequestSchema,
816
- response: credentialPageSchema,
1595
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1596
+ ? API_UNUSED_RESPONSE_SCHEMA
1597
+ : credentialPageSchema,
817
1598
  scopes: ["credentials:read"],
818
1599
  sessionAuthority: "headers",
819
- summary: "List API credentials",
820
- surfaces: ["api", "mock"],
821
- },
822
- {
823
- creates: false,
824
- description: "Reads what a key this project issued should be able to do over MCP: the endpoint to point a client at, the discovery document beside it, the scopes fixed into the key when it was made, and the MCP tool names those scopes authorize. It returns no secret and cannot: the transient value is shown once at creation and is never sent here. The credential is addressed by identifier and re-resolved against the signed-in member's own project and environment, so a key belonging to another project answers exactly as one that does not exist. `state` distinguishes a key that still verifies from one that was revoked and one whose rotation overlap has run out, because a client configured with either fails identically and the remedies differ.",
825
- example: {
826
- discovery: "https://api.greatwait.dev/.well-known/oauth-protected-resource/mcp",
827
- displayPrefix: "pt_test_a1b2c3d4",
828
- endpoint: "https://api.greatwait.dev/mcp",
829
- id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
830
- scopes: ["occurrences:read", "schedules:read", "schedules:write"],
831
- state: "usable",
832
- tools: [
833
- "occurrences_list",
834
- "occurrences_read",
835
- "schedules_cancel",
836
- "schedules_create",
837
- "schedules_list",
838
- "schedules_read",
839
- ],
840
- },
1600
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1601
+ ? ""
1602
+ : "List API credentials",
1603
+ surfaces: ["api", "mock"],
1604
+ },
1605
+ {
1606
+ creates: false,
1607
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1608
+ ? ""
1609
+ : "Reads what a key this project issued should be able to do over MCP: the endpoint to point a client at, the discovery document beside it, the scopes fixed into the key when it was made, and the MCP tool names those scopes authorize. It returns no secret and cannot: the transient value is shown once at creation and is never sent here. The credential is addressed by identifier and re-resolved against the signed-in member's own project and environment, so a key belonging to another project answers exactly as one that does not exist. `state` distinguishes a key that still verifies from one that was revoked and one whose rotation overlap has run out, because a client configured with either fails identically and the remedies differ.",
1610
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1611
+ ? {}
1612
+ : {
1613
+ discovery: "https://api.greatwait.dev/.well-known/oauth-protected-resource/mcp",
1614
+ displayPrefix: "pt_test_a1b2c3d4",
1615
+ endpoint: "https://api.greatwait.dev/mcp",
1616
+ id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
1617
+ scopes: ["occurrences:read", "schedules:read", "schedules:write"],
1618
+ state: "usable",
1619
+ tools: [
1620
+ "occurrences_list",
1621
+ "occurrences_read",
1622
+ "schedules_cancel",
1623
+ "schedules_create",
1624
+ "schedules_list",
1625
+ "schedules_read",
1626
+ ],
1627
+ },
841
1628
  id: "credentials.connection",
842
1629
  idempotent: true,
843
1630
  // **Withheld, and the reason is the same one that withholds issuance.** A
@@ -855,24 +1642,42 @@ export const OPERATIONS = [
855
1642
  path: "/v1/credentials/{credentialId}/connection",
856
1643
  principals: ["session"],
857
1644
  problems: ["not_found"],
858
- response: mcpConnectionSchema,
1645
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1646
+ ? API_UNUSED_RESPONSE_SCHEMA
1647
+ : mcpConnectionSchema,
859
1648
  scopes: ["credentials:read"],
860
1649
  sessionAuthority: "headers",
861
- summary: "Read a credential's MCP connection",
1650
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1651
+ ? ""
1652
+ : "Read a credential's MCP connection",
862
1653
  surfaces: ["api", "mock"],
863
1654
  },
864
1655
  {
865
1656
  creates: false,
866
- 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.",
867
- example: {
868
- data: [
869
- {
870
- environmentKinds: ["test", "live"],
871
- id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
872
- name: "Billing reminders",
873
- },
874
- ],
875
- },
1657
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1658
+ ? ""
1659
+ : "Lists the active and archived projects in the signed-in member's organization, with the environment kinds, lifecycle state, version and deletion-preview counts each one has. Active and archived rows both occupy a plan slot; deleted projects are absent. Archived rows are management targets rather than projects work may run inside, so a picker must not offer them as switch targets. 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.",
1660
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1661
+ ? {}
1662
+ : {
1663
+ data: [
1664
+ {
1665
+ createdAt: "2026-08-14T11:00:00.000Z",
1666
+ deletionCounts: {
1667
+ endpoints: 2,
1668
+ keys: 4,
1669
+ runs: 37,
1670
+ schedules: 5,
1671
+ },
1672
+ environmentKinds: ["test", "live"],
1673
+ id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1674
+ name: "Billing reminders",
1675
+ status: "active",
1676
+ version: 1,
1677
+ },
1678
+ ],
1679
+ total: 1,
1680
+ },
876
1681
  id: "projects.list",
877
1682
  idempotent: true,
878
1683
  mcp: {
@@ -886,27 +1691,38 @@ export const OPERATIONS = [
886
1691
  // No `not_found`: the collection is the member's own organization, so it
887
1692
  // always exists and is sometimes empty. No paging, so no `invalid_request`.
888
1693
  problems: [],
889
- response: projectListSchema,
1694
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1695
+ ? API_UNUSED_RESPONSE_SCHEMA
1696
+ : projectListSchema,
890
1697
  scopes: ["projects:read"],
891
1698
  sessionAuthority: "organization",
892
- summary: "List the member's projects",
1699
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1700
+ ? ""
1701
+ : "List the member's projects",
893
1702
  surfaces: ["api", "mock"],
894
1703
  },
895
1704
  {
896
1705
  creates: true,
897
- 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.",
898
- example: {
899
- environmentKinds: ["test", "live"],
900
- id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
901
- name: "Billing reminders",
902
- },
1706
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1707
+ ? ""
1708
+ : "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. A name is unique within the organization, compared ignoring case and surrounding or repeated spaces; a second project with a name already taken is refused with `state_conflict`, and the refusal says nothing about any other organization's names.",
1709
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1710
+ ? {}
1711
+ : {
1712
+ createdAt: null,
1713
+ deletionCounts: { endpoints: 0, keys: 0, runs: 0, schedules: 0 },
1714
+ environmentKinds: ["test", "live"],
1715
+ id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1716
+ name: "Billing reminders",
1717
+ status: "active",
1718
+ version: 1,
1719
+ },
903
1720
  id: "projects.create",
904
- // Not idempotent, and it cannot be made so here: repeating this makes a
905
- // second project with the same name, because a name is a label rather than
906
- // an identifier — `projectNameSchema` says so, and non-uniqueness is what
907
- // lets somebody rename one without breaking a caller's URLs. No route on
908
- // this Worker reads an idempotency key for it, so declaring `true` would
909
- // publish a promise nothing keeps.
1721
+ // Not idempotent, and it cannot be made so here. Since FXO-2256 a repeat
1722
+ // with the same name is *refused* rather than doubled — the name is unique
1723
+ // in its organization — but a refusal is not the same answer as the first
1724
+ // call's, and no route on this Worker reads an idempotency key for it, so
1725
+ // declaring `true` would publish a promise nothing keeps.
910
1726
  idempotent: false,
911
1727
  // Withheld from MCP for `projects.list`'s reason and one of its own. The
912
1728
  // shared half: this operation accepts only a signed-in member, and MCP
@@ -928,32 +1744,169 @@ export const OPERATIONS = [
928
1744
  // the same shape of refusal. There is no `not_found`: the organization is
929
1745
  // the member's own and is created on first use, so it always exists by the
930
1746
  // time the project is written.
931
- problems: ["invalid_request", "plan_limit_reached"],
1747
+ problems: ["invalid_request", "plan_limit_reached", "state_conflict"],
932
1748
  request: projectCreateRequestSchema,
933
- requestExample: { name: "Billing reminders" },
934
- response: projectSummarySchema,
1749
+ requestExample: globalThis
1750
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1751
+ ? {}
1752
+ : { name: "Billing reminders" },
1753
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1754
+ ? API_UNUSED_RESPONSE_SCHEMA
1755
+ : projectSummarySchema,
935
1756
  scopes: ["projects:write"],
936
1757
  sessionAuthority: "organization",
937
- summary: "Create a project",
1758
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1759
+ ? ""
1760
+ : "Create a project",
938
1761
  surfaces: ["api", "mock"],
939
1762
  },
940
1763
  {
941
1764
  creates: false,
942
- 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.",
943
- example: {
944
- data: [
945
- {
946
- client: { id: "oc_01h8xyz9k2m4n6p8r0t2v4w6y8", name: "Flow XO" },
947
- createdAt: "2026-08-14T11:00:00.000Z",
948
- environmentKind: "test",
949
- id: "og_01h8xyz9k2m4n6p8r0t2v4w6y8",
950
- lastUsedAt: "2026-08-15T09:12:00.000Z",
951
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
952
- scopes: ["schedules:read", "schedules:write"],
953
- status: "active",
954
- },
955
- ],
956
- },
1765
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1766
+ ? ""
1767
+ : "Renames one project in the caller's own organization without changing its opaque identifier. Names remain unique within the organization ignoring ASCII case and surrounding or repeated whitespace. Send If-Match with the project's current version; a stale version is refused rather than silently overwriting somebody else's change. Members and administrators may rename because the change is cosmetic and reversible.",
1768
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1769
+ ? {}
1770
+ : {
1771
+ createdAt: "2026-08-14T11:00:00.000Z",
1772
+ deletionCounts: { endpoints: 2, keys: 4, runs: 37, schedules: 5 },
1773
+ environmentKinds: ["test", "live"],
1774
+ id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1775
+ name: "Customer reminders",
1776
+ status: "active",
1777
+ version: 2,
1778
+ },
1779
+ id: "projects.rename",
1780
+ idempotent: false,
1781
+ mcp: { destructive: false, kind: "tool", openWorld: false },
1782
+ method: "PATCH",
1783
+ mutates: true,
1784
+ path: "/v1/projects/{projectId}",
1785
+ principals: ["api-credential", "oauth", "session"],
1786
+ problems: [
1787
+ "invalid_request",
1788
+ "not_found",
1789
+ "state_conflict",
1790
+ "version_conflict",
1791
+ ],
1792
+ request: projectUpdateRequestSchema,
1793
+ requestExample: globalThis
1794
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1795
+ ? {}
1796
+ : { name: "Customer reminders" },
1797
+ requestHeaders: requiredConditionalRequestHeaderSchema,
1798
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1799
+ ? API_UNUSED_RESPONSE_SCHEMA
1800
+ : projectSummarySchema,
1801
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
1802
+ ? {}
1803
+ : { responseHeaders: versionResponseHeaderSchema }),
1804
+ scopes: ["projects:write"],
1805
+ sessionAuthority: "headers",
1806
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1807
+ ? ""
1808
+ : "Rename a project",
1809
+ surfaces: ["api", "mock"],
1810
+ },
1811
+ {
1812
+ creates: false,
1813
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1814
+ ? ""
1815
+ : "Archives or restores the caller's project. Archiving parks the complete project: no new occurrence is dispatched, while schedules, endpoints, keys, grants and retained history remain intact. Restoring clears that project-wide hold without rewriting any schedule; an occurrence whose instant passed while archived becomes due, matching schedule pause and resume. Only organization administrators may make this project-wide change.",
1816
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1817
+ ? {}
1818
+ : {
1819
+ createdAt: "2026-08-14T11:00:00.000Z",
1820
+ deletionCounts: { endpoints: 2, keys: 4, runs: 37, schedules: 5 },
1821
+ environmentKinds: ["test", "live"],
1822
+ id: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1823
+ name: "Customer reminders",
1824
+ status: "archived",
1825
+ version: 2,
1826
+ },
1827
+ id: "projects.archive",
1828
+ idempotent: false,
1829
+ mcp: { destructive: false, kind: "tool", openWorld: false },
1830
+ method: "POST",
1831
+ mutates: true,
1832
+ path: "/v1/projects/{projectId}/archive",
1833
+ principals: ["api-credential", "oauth", "session"],
1834
+ problems: [
1835
+ "invalid_request",
1836
+ "not_found",
1837
+ "state_conflict",
1838
+ "version_conflict",
1839
+ ],
1840
+ request: projectArchiveRequestSchema,
1841
+ requestExample: globalThis
1842
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1843
+ ? {}
1844
+ : { archived: true },
1845
+ requestHeaders: requiredConditionalRequestHeaderSchema,
1846
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1847
+ ? API_UNUSED_RESPONSE_SCHEMA
1848
+ : projectSummarySchema,
1849
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
1850
+ ? {}
1851
+ : { responseHeaders: versionResponseHeaderSchema }),
1852
+ scopes: ["projects:administer"],
1853
+ sessionAuthority: "headers",
1854
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1855
+ ? ""
1856
+ : "Archive or restore a project",
1857
+ surfaces: ["api", "mock"],
1858
+ },
1859
+ {
1860
+ creates: false,
1861
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1862
+ ? ""
1863
+ : "Permanently deletes an archived project and everything it owns immediately: schedules and encrypted payloads, occurrences and delivery attempts, endpoints and their signing keys, API credentials and their audit events, OAuth grants and tokens, test sinks, and control-plane projections. The operation is refused while the project is active and names archiving as the required first move. Its response reports the schedules, endpoints, keys and runs destroyed. Only organization administrators may perform it, and there is no restore operation.",
1864
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1865
+ ? {}
1866
+ : {
1867
+ deleted: true,
1868
+ destroyed: { endpoints: 2, keys: 4, runs: 37, schedules: 5 },
1869
+ },
1870
+ id: "projects.delete",
1871
+ idempotent: false,
1872
+ mcp: { destructive: true, kind: "tool", openWorld: false },
1873
+ method: "DELETE",
1874
+ mutates: true,
1875
+ path: "/v1/projects/{projectId}",
1876
+ principals: ["api-credential", "oauth", "session"],
1877
+ problems: ["not_found", "state_conflict", "version_conflict"],
1878
+ requestHeaders: requiredConditionalRequestHeaderSchema,
1879
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1880
+ ? API_UNUSED_RESPONSE_SCHEMA
1881
+ : projectDeletedSchema,
1882
+ scopes: ["projects:administer"],
1883
+ sessionAuthority: "headers",
1884
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1885
+ ? ""
1886
+ : "Delete an archived project",
1887
+ surfaces: ["api", "mock"],
1888
+ },
1889
+ {
1890
+ creates: false,
1891
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1892
+ ? ""
1893
+ : "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.",
1894
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1895
+ ? {}
1896
+ : {
1897
+ data: [
1898
+ {
1899
+ client: { id: "oc_01h8xyz9k2m4n6p8r0t2v4w6y8", name: "Flow XO" },
1900
+ createdAt: "2026-08-14T11:00:00.000Z",
1901
+ environmentKind: "test",
1902
+ id: "og_01h8xyz9k2m4n6p8r0t2v4w6y8",
1903
+ lastUsedAt: "2026-08-15T09:12:00.000Z",
1904
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1905
+ scopes: ["schedules:read", "schedules:write"],
1906
+ status: "active",
1907
+ },
1908
+ ],
1909
+ },
957
1910
  id: "grants.list",
958
1911
  idempotent: true,
959
1912
  // **Withheld, and the reason is what the surface is for.** An application
@@ -974,28 +1927,36 @@ export const OPERATIONS = [
974
1927
  // sometimes empty. Its size is how many applications one person has
975
1928
  // connected, which is not a number a cursor helps with.
976
1929
  problems: [],
977
- response: oauthGrantListSchema,
1930
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1931
+ ? API_UNUSED_RESPONSE_SCHEMA
1932
+ : oauthGrantListSchema,
978
1933
  scopes: ["grants:read"],
979
1934
  sessionAuthority: "member",
980
- summary: "List the member's connected applications",
1935
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1936
+ ? ""
1937
+ : "List the member's connected applications",
981
1938
  surfaces: ["api", "mock"],
982
1939
  },
983
1940
  {
984
1941
  creates: false,
985
- 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.",
986
- example: {
987
- grant: {
988
- client: { id: "oc_01h8xyz9k2m4n6p8r0t2v4w6y8", name: "Flow XO" },
989
- createdAt: "2026-08-14T11:00:00.000Z",
990
- environmentKind: "test",
991
- id: "og_01h8xyz9k2m4n6p8r0t2v4w6y8",
992
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
993
- revocationReason: "member-revoked",
994
- revokedAt: "2026-08-15T10:00:00.000Z",
995
- scopes: ["schedules:read", "schedules:write"],
996
- status: "revoked",
1942
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1943
+ ? ""
1944
+ : "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.",
1945
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1946
+ ? {}
1947
+ : {
1948
+ grant: {
1949
+ client: { id: "oc_01h8xyz9k2m4n6p8r0t2v4w6y8", name: "Flow XO" },
1950
+ createdAt: "2026-08-14T11:00:00.000Z",
1951
+ environmentKind: "test",
1952
+ id: "og_01h8xyz9k2m4n6p8r0t2v4w6y8",
1953
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1954
+ revocationReason: "member-revoked",
1955
+ revokedAt: "2026-08-15T10:00:00.000Z",
1956
+ scopes: ["schedules:read", "schedules:write"],
1957
+ status: "revoked",
1958
+ },
997
1959
  },
998
- },
999
1960
  id: "grants.revoke",
1000
1961
  // Repeating it is safe: the grant is already revoked, and the second call
1001
1962
  // reports the first one's instant rather than moving it. That is
@@ -1010,37 +1971,45 @@ export const OPERATIONS = [
1010
1971
  path: "/v1/grants/{grantId}",
1011
1972
  principals: ["session"],
1012
1973
  problems: ["not_found"],
1013
- response: oauthGrantRevokedSchema,
1974
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1975
+ ? API_UNUSED_RESPONSE_SCHEMA
1976
+ : oauthGrantRevokedSchema,
1014
1977
  scopes: ["grants:write"],
1015
1978
  sessionAuthority: "member",
1016
- summary: "Disconnect an application",
1979
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
1980
+ ? ""
1981
+ : "Disconnect an application",
1017
1982
  surfaces: ["api", "mock"],
1018
1983
  },
1019
1984
  {
1020
1985
  creates: true,
1021
- 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.",
1022
- example: {
1023
- credential: {
1024
- createdAt: "2026-07-28T15:00:00.000Z",
1025
- displayPrefix: "pt_test_e5f6g7h8",
1026
- environmentKind: "test",
1027
- id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y9",
1028
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1029
- scopes: ["schedules:write"],
1030
- secret: "pt_test_e5f6g7h8<the-32-character-secret-half-here>",
1031
- shownOnce: true,
1032
- },
1033
- retired: {
1034
- createdAt: "2026-07-28T15:00:00.000Z",
1035
- displayPrefix: "pt_test_a1b2c3d4",
1036
- environmentKind: "test",
1037
- expiresAt: "2026-07-29T15:00:00.000Z",
1038
- id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
1039
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1040
- scopes: ["schedules:write"],
1041
- supersededBy: "ak_01h8xyz9k2m4n6p8r0t2v4w6y9",
1986
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
1987
+ ? ""
1988
+ : "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.",
1989
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
1990
+ ? {}
1991
+ : {
1992
+ credential: {
1993
+ createdAt: "2026-07-28T15:00:00.000Z",
1994
+ displayPrefix: "pt_test_e5f6g7h8",
1995
+ environmentKind: "test",
1996
+ id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y9",
1997
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1998
+ scopes: ["schedules:write"],
1999
+ secret: "pt_test_e5f6g7h8<the-32-character-secret-half-here>",
2000
+ shownOnce: true,
2001
+ },
2002
+ retired: {
2003
+ createdAt: "2026-07-28T15:00:00.000Z",
2004
+ displayPrefix: "pt_test_a1b2c3d4",
2005
+ environmentKind: "test",
2006
+ expiresAt: "2026-07-29T15:00:00.000Z",
2007
+ id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
2008
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
2009
+ scopes: ["schedules:write"],
2010
+ supersededBy: "ak_01h8xyz9k2m4n6p8r0t2v4w6y9",
2011
+ },
1042
2012
  },
1043
- },
1044
2013
  id: "credentials.rotate",
1045
2014
  // Destructive: the original credential is given a deadline it did not have,
1046
2015
  // and whatever is still using it stops working when that deadline passes.
@@ -1061,305 +2030,1284 @@ export const OPERATIONS = [
1061
2030
  principals: ["api-credential", "oauth", "session"],
1062
2031
  problems: ["invalid_request", "not_found", "scope_missing"],
1063
2032
  request: credentialRotationRequestSchema,
1064
- requestExample: { overlapSeconds: 3600 },
1065
- response: credentialRotatedSchema,
2033
+ requestExample: globalThis
2034
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2035
+ ? {}
2036
+ : { overlapSeconds: 3600 },
2037
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2038
+ ? API_UNUSED_RESPONSE_SCHEMA
2039
+ : credentialRotatedSchema,
2040
+ scopes: ["credentials:write"],
2041
+ sessionAuthority: "headers",
2042
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2043
+ ? ""
2044
+ : "Rotate an API credential",
2045
+ surfaces: ["api", "mock"],
2046
+ },
2047
+ {
2048
+ creates: false,
2049
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2050
+ ? ""
2051
+ : "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.",
2052
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2053
+ ? {}
2054
+ : {
2055
+ credential: {
2056
+ createdAt: "2026-07-28T15:00:00.000Z",
2057
+ displayPrefix: "pt_test_a1b2c3d4",
2058
+ environmentKind: "test",
2059
+ id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
2060
+ project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
2061
+ revokedAt: "2026-07-28T16:00:00.000Z",
2062
+ scopes: ["schedules:write"],
2063
+ },
2064
+ },
2065
+ id: "credentials.revoke",
2066
+ mcp: { destructive: true, kind: "tool", openWorld: false },
2067
+ // Repeating this leaves the same credential revoked at the same instant, so
2068
+ // it is idempotent in the sense the field means — no key required, because
2069
+ // there is no second effect to suppress.
2070
+ idempotent: true,
2071
+ method: "DELETE",
2072
+ mutates: true,
2073
+ path: "/v1/credentials/{credentialId}",
2074
+ conditionalScopes: ["credentials:administer"],
2075
+ principals: ["api-credential", "oauth", "session"],
2076
+ problems: ["invalid_request", "not_found", "scope_missing"],
2077
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2078
+ ? API_UNUSED_RESPONSE_SCHEMA
2079
+ : credentialRevokedSchema,
1066
2080
  scopes: ["credentials:write"],
1067
2081
  sessionAuthority: "headers",
1068
- summary: "Rotate an API credential",
2082
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2083
+ ? ""
2084
+ : "Revoke an API credential",
2085
+ surfaces: ["api", "mock"],
2086
+ },
2087
+ {
2088
+ creates: true,
2089
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2090
+ ? ""
2091
+ : "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, placed in the signed callback, and returned as given by a schedule read. `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. `lateness.policy` decides what happens when an occurrence reaches its first attempt after its planned instant: `skipAhead` never carries a recurring arrival across its next scheduled instant (and a shorter custom window may retire it earlier), while `catchUp` admits one arrival within `maxStalenessSeconds` even after later recurrence instants passed. A one-shot has no next recurrence, so either explicit policy uses its window and the default is `catchUp` with 24 hours; recurring schedules default to `skipAhead`, and a `catchUp` without an override has a one-interval window. A retry already in progress is exempt because it arrived and failed; its retry and give-up policy still decide the outcome. 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.",
2092
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2093
+ ? {}
2094
+ : {
2095
+ occurrence: {
2096
+ attemptCount: 0,
2097
+ generation: 1,
2098
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
2099
+ plannedFor: "2026-07-28T15:00:00.000Z",
2100
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
2101
+ sequence: 1,
2102
+ state: "planned",
2103
+ },
2104
+ schedule: {
2105
+ createdAt: "2026-07-28T14:59:00.000Z",
2106
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
2107
+ generation: 1,
2108
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
2109
+ latencyClass: "realtime",
2110
+ lateness: { policy: "catchUp" },
2111
+ partitionKey: "campaign.spring",
2112
+ recurrence: { kind: "at" },
2113
+ status: "active",
2114
+ updatedAt: "2026-07-28T14:59:00.000Z",
2115
+ version: 1,
2116
+ },
2117
+ },
2118
+ id: "schedules.create",
2119
+ // Additive: it brings a schedule into existence and takes nothing away.
2120
+ // A callback schedule causes a future request to the verified external
2121
+ // endpoint. It does not destructively modify that system, but it does act
2122
+ // beyond Greatwait, so MCP clients must receive the open-world hint.
2123
+ mcp: { destructive: false, kind: "tool", openWorld: true },
2124
+ // False even though this operation reads `Idempotency-Key`, because the
2125
+ // header is optional and this flag is what a client reads before deciding
2126
+ // whether a blind retry is safe. It is not: a retry without the key creates
2127
+ // a second schedule. What says the protection is available is
2128
+ // `requestHeaders`, which publishes the key rather than promising it was
2129
+ // used.
2130
+ idempotent: false,
2131
+ method: "POST",
2132
+ mutates: true,
2133
+ path: "/v1/schedules",
2134
+ principals: ["api-credential", "oauth", "session"],
2135
+ problems: [
2136
+ "idempotency_key_reused",
2137
+ "invalid_request",
2138
+ "not_found",
2139
+ // The organization ceiling, the same code and the same shape
2140
+ // `projects.create` and `endpoints.create` use. A plan may bound the
2141
+ // distinct partition keys an organization has live and how large a
2142
+ // `data` body it may carry; both refuse here rather than truncating,
2143
+ // because a schedule created without the body the caller sent is not
2144
+ // the schedule they asked for. How many schedules an organization holds
2145
+ // is not bounded (FXO-2556).
2146
+ "plan_limit_reached",
2147
+ "service_unavailable",
2148
+ // A schedule against a disabled endpoint. Refused rather than accepted
2149
+ // and never fired, and refused by its state rather than as `not_found`,
2150
+ // because the endpoint exists and one call turns it back on.
2151
+ "state_conflict",
2152
+ ],
2153
+ request: scheduleRequestSchema,
2154
+ requestExample: globalThis
2155
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2156
+ ? {}
2157
+ : {
2158
+ cron: "0 9 * * 1-5",
2159
+ data: { report: "daily" },
2160
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
2161
+ lateness: { maxStalenessSeconds: 3_600, policy: "catchUp" },
2162
+ partitionKey: "campaign.spring",
2163
+ timeZone: "Europe/London",
2164
+ },
2165
+ requestHeaders: idempotencyRequestHeaderSchema,
2166
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2167
+ ? API_UNUSED_RESPONSE_SCHEMA
2168
+ : scheduleViewSchema,
2169
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2170
+ ? {}
2171
+ : { responseHeaders: replayedResponseHeaderSchema }),
2172
+ scopes: ["schedules:write"],
2173
+ sessionAuthority: "headers",
2174
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2175
+ ? ""
2176
+ : "Create a schedule",
2177
+ surfaces: ["api", "mock"],
2178
+ },
2179
+ {
2180
+ creates: false,
2181
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2182
+ ? ""
2183
+ : "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. The response carries the schedule's `data` when it has one, exactly as it was given; the listing leaves it off.",
2184
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2185
+ ? {}
2186
+ : {
2187
+ occurrence: {
2188
+ attemptCount: 0,
2189
+ generation: 1,
2190
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
2191
+ plannedFor: "2026-07-28T15:00:00.000Z",
2192
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
2193
+ sequence: 1,
2194
+ state: "planned",
2195
+ },
2196
+ schedule: {
2197
+ createdAt: "2026-07-28T14:59:00.000Z",
2198
+ data: { report: "daily" },
2199
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
2200
+ generation: 1,
2201
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
2202
+ latencyClass: "realtime",
2203
+ lateness: { policy: "catchUp" },
2204
+ partitionKey: "campaign.spring",
2205
+ recurrence: { kind: "at" },
2206
+ status: "active",
2207
+ updatedAt: "2026-07-28T14:59:00.000Z",
2208
+ version: 1,
2209
+ },
2210
+ },
2211
+ id: "schedules.read",
2212
+ idempotent: true,
2213
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2214
+ method: "GET",
2215
+ mutates: false,
2216
+ path: "/v1/schedules/{scheduleId}",
2217
+ principals: ["api-credential", "oauth", "session"],
2218
+ problems: ["invalid_request", "not_found"],
2219
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2220
+ ? API_UNUSED_RESPONSE_SCHEMA
2221
+ : scheduleViewSchema,
2222
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2223
+ ? {}
2224
+ : { responseHeaders: versionResponseHeaderSchema }),
2225
+ scopes: ["schedules:read"],
2226
+ sessionAuthority: "headers",
2227
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2228
+ ? ""
2229
+ : "Read a schedule",
2230
+ surfaces: ["api", "mock"],
2231
+ },
2232
+ {
2233
+ creates: false,
2234
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2235
+ ? ""
2236
+ : "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. Give `endpoint` to keep the page to the schedules that deliver to that endpoint — the way back from a destination to everything pointed at it, which is what somebody who disabled or is about to move an endpoint needs to see. 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.",
2237
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2238
+ ? {}
2239
+ : {
2240
+ data: [
2241
+ {
2242
+ createdAt: "2026-07-28T14:59:00.000Z",
2243
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
2244
+ generation: 1,
2245
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
2246
+ latencyClass: "realtime",
2247
+ lateness: { policy: "catchUp" },
2248
+ recurrence: { kind: "at" },
2249
+ status: "active",
2250
+ updatedAt: "2026-07-28T14:59:00.000Z",
2251
+ version: 1,
2252
+ },
2253
+ ],
2254
+ // `projected` since W2-06 served this listing from the control-plane
2255
+ // directory. `asOf` is the instant the projection was last known to hold
2256
+ // everything every partition had handed over, and `lagSeconds` is how long
2257
+ // ago that was — so a page states how far behind it may be rather than
2258
+ // implying it is current.
2259
+ freshness: {
2260
+ asOf: "2026-07-28T15:00:00.000Z",
2261
+ kind: "projected",
2262
+ lagSeconds: 0,
2263
+ },
2264
+ nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoic2NoXzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0",
2265
+ },
2266
+ id: "schedules.list",
2267
+ idempotent: true,
2268
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2269
+ method: "GET",
2270
+ mutates: false,
2271
+ path: "/v1/schedules",
2272
+ principals: ["api-credential", "oauth", "session"],
2273
+ problems: ["invalid_request"],
2274
+ query: scheduleListRequestSchema,
2275
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2276
+ ? API_UNUSED_RESPONSE_SCHEMA
2277
+ : schedulePageSchema,
2278
+ scopes: ["schedules:read"],
2279
+ sessionAuthority: "headers",
2280
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2281
+ ? ""
2282
+ : "List schedules",
2283
+ surfaces: ["api", "mock"],
2284
+ },
2285
+ {
2286
+ creates: false,
2287
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2288
+ ? ""
2289
+ : "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 freshness and explicit coverage. Clients sending X-Greatwait-Accept-Partial-Forecast: true receive bounded lower-bound counts when a book reaches a row, cell or recurrence-work bound, with coverage.complete false and the exact bounds reached. Without this capability header the previous refusal behavior remains safe for clients that only read totals. Unavailable or stale sources still refuse. Coverage identifies the selected recurring schedule range but never includes destinations, payload or endpoint detail.",
2290
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2291
+ ? {}
2292
+ : {
2293
+ buckets: [
2294
+ {
2295
+ byLatencyClass: { bulk: 12, realtime: 3 },
2296
+ byPartitionKey: { "campaign.spring": 9, "campaign.winter": 4 },
2297
+ count: 15,
2298
+ nextFireCount: 4,
2299
+ otherPartitionKeyCount: 2,
2300
+ start: "2026-07-28T15:00:00.000Z",
2301
+ },
2302
+ ],
2303
+ freshness: {
2304
+ asOf: "2026-07-28T14:58:30.000Z",
2305
+ kind: "projected",
2306
+ lagSeconds: 90,
2307
+ },
2308
+ window: {
2309
+ bucketSeconds: 1800,
2310
+ from: "2026-07-28T15:00:00.000Z",
2311
+ to: "2026-07-29T15:00:00.000Z",
2312
+ },
2313
+ },
2314
+ requestHeaders: forecastRequestHeadersSchema,
2315
+ id: "forecast.read",
2316
+ idempotent: true,
2317
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2318
+ method: "GET",
2319
+ mutates: false,
2320
+ path: "/v1/forecast",
2321
+ principals: ["api-credential", "oauth", "session"],
2322
+ problems: ["invalid_request"],
2323
+ query: forecastRequestSchema,
2324
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2325
+ ? API_UNUSED_RESPONSE_SCHEMA
2326
+ : forecastSchema,
2327
+ scopes: ["forecast:read"],
2328
+ sessionAuthority: "headers",
2329
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2330
+ ? ""
2331
+ : "Forecast upcoming occurrences",
2332
+ surfaces: ["api", "mock"],
2333
+ },
2334
+ {
2335
+ creates: false,
2336
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2337
+ ? ""
2338
+ : "Reads the verified principal's organization-wide prepaid execution position from the authoritative PostgreSQL ledger. Desired and effective revisions remain distinct, and pending stays true until the control plane records PostgreSQL confirmation. Amounts are exact integer microdollars encoded as decimal strings; currency is USD and scale is six. Reserved credit has already been committed to a logical attempt but is not yet a settled debit. A missing hard cap means the customer elected no execution spending cap, never zero room. Shadow mode records what enforcement would have done without charging or blocking, and the activation boundary prevents retroactive charges.",
2339
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2340
+ ? {}
2341
+ : BILLING_SUMMARY_EXAMPLE,
2342
+ id: "billing.summary",
2343
+ idempotent: true,
2344
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2345
+ method: "GET",
2346
+ mutates: false,
2347
+ path: "/v1/billing/summary",
2348
+ principals: ["api-credential", "oauth", "session"],
2349
+ problems: ["billing_not_ready", "service_unavailable"],
2350
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2351
+ ? API_UNUSED_RESPONSE_SCHEMA
2352
+ : billingSummarySchema,
2353
+ scopes: ["usage:read"],
2354
+ sessionAuthority: "headers",
2355
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2356
+ ? ""
2357
+ : "Read exact execution-credit state",
2358
+ surfaces: ["api", "mock"],
2359
+ },
2360
+ BILLING_NOTICE_LIST_OPERATION,
2361
+ BILLING_NOTIFICATION_SETTINGS_OPERATION,
2362
+ BILLING_NOTIFICATION_SETTINGS_UPDATE_OPERATION,
2363
+ withBillingFundingContract({
2364
+ creates: false,
2365
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2366
+ ? ""
2367
+ : "Reads the verified principal's authoritative execution-funding position, including available and reserved credit, amount owed, recurring project fees, the current UTC month's automatic-charge ceiling and its settled, pending and remaining gross authority, and bounded payment history. Manual purchases and project subscriptions are separately authorized and never consume the automatic ceiling. Pending gross charges include applicable tax; refunds never restore monthly automatic purchasing authority. Receipt and payment links are limited to supported provider-hosted HTTPS URLs.",
2368
+ id: "billing.funding",
2369
+ idempotent: true,
2370
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2371
+ method: "GET",
2372
+ mutates: false,
2373
+ path: "/v1/billing/funding",
2374
+ principals: ["api-credential", "oauth", "session"],
2375
+ problems: ["service_unavailable"],
2376
+ scopes: ["usage:read"],
2377
+ sessionAuthority: "headers",
2378
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2379
+ ? ""
2380
+ : "Read execution funding and payments",
2381
+ surfaces: ["api", "mock"],
2382
+ }),
2383
+ {
2384
+ creates: false,
2385
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2386
+ ? ""
2387
+ : "Previews an execution-credit purchase of at least USD 10 without creating a provider payment or granting credit. The quote binds its exact credit and current funding revision; tax and gross remain null with calculated-at-checkout status until an idempotent confirmed purchase creates authenticated hosted Checkout. This manual purchase has separate authority and never consumes the automatic execution top-up ceiling.",
2388
+ environments: ["live"],
2389
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2390
+ ? {}
2391
+ : BILLING_FUNDING_QUOTE_EXAMPLE,
2392
+ id: "billing.fundingquote",
2393
+ idempotent: false,
2394
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2395
+ method: "POST",
2396
+ mutates: false,
2397
+ path: "/v1/billing/funding/quote",
2398
+ principals: ["api-credential", "oauth", "session"],
2399
+ problems: [
2400
+ "invalid_request",
2401
+ "revision_conflict",
2402
+ "service_unavailable",
2403
+ "state_conflict",
2404
+ "test_to_live_escalation",
2405
+ ],
2406
+ request: billingFundingQuoteRequestSchema,
2407
+ requestExample: globalThis
2408
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2409
+ ? {}
2410
+ : {
2411
+ credit: { currency: "USD", microdollars: "10000000", scale: 6 },
2412
+ },
2413
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2414
+ ? API_UNUSED_RESPONSE_SCHEMA
2415
+ : billingFundingQuoteSchema,
2416
+ scopes: ["billing:write"],
2417
+ sessionAuthority: "headers",
2418
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2419
+ ? ""
2420
+ : "Preview manual execution funding",
2421
+ surfaces: ["api", "mock"],
2422
+ },
2423
+ withBillingFundingContract({
2424
+ creates: true,
2425
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2426
+ ? ""
2427
+ : "Confirms one exact manual execution-credit quote and creates or replays its durable payment operation. Billing-owner authority and explicit agent approval apply; the Idempotency-Key preserves one payment identity across retries. Manual funding stays outside the automatic-charge ceiling. A browser redirect never grants credit: only authenticated provider reconciliation can move the operation to paid and grant its exact execution credit once, while the operation reports provider-confirmed tax and gross when known.",
2428
+ environments: ["live"],
2429
+ id: "billing.purchase",
2430
+ idempotent: true,
2431
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2432
+ method: "POST",
2433
+ mutates: true,
2434
+ path: "/v1/billing/funding/purchase",
2435
+ principals: ["api-credential", "oauth", "session"],
2436
+ problems: [
2437
+ "idempotency_key_reused",
2438
+ "invalid_request",
2439
+ "not_found",
2440
+ "revision_conflict",
2441
+ "service_unavailable",
2442
+ "state_conflict",
2443
+ "test_to_live_escalation",
2444
+ ],
2445
+ request: billingPurchaseRequestSchema,
2446
+ requestExample: globalThis
2447
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2448
+ ? {}
2449
+ : {
2450
+ confirmed: true,
2451
+ expectedRevision: 3,
2452
+ quote: "funding-quote-example",
2453
+ },
2454
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
2455
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2456
+ ? {}
2457
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
2458
+ scopes: ["billing:write"],
2459
+ sessionAuthority: "headers",
2460
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2461
+ ? ""
2462
+ : "Confirm manual execution funding",
2463
+ surfaces: ["api", "mock"],
2464
+ }),
2465
+ withBillingFundingContract({
2466
+ creates: false,
2467
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2468
+ ? ""
2469
+ : "Confirms one execution-credit payment or saved-payment-method setup now, typically when the customer returns from hosted Checkout, instead of waiting for the provider's notification or the scheduled repair. It reads that one operation from the payment provider under the caller organization's authenticated account and applies what the provider reports: a paid Checkout grants its exact credit once, an open or unpaid one stays pending, and an operation already settled is answered without reading the provider. Nothing in the request can claim a payment succeeded — it names only which operation to read. Repeating the call is safe and converges on the same state. Returns the same execution-funding position as billing.funding.",
2470
+ environments: ["live"],
2471
+ id: "billing.fundingconfirm",
2472
+ idempotent: true,
2473
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2474
+ method: "POST",
2475
+ mutates: true,
2476
+ path: "/v1/billing/funding/{paymentOperation}/confirm",
2477
+ principals: ["api-credential", "oauth", "session"],
2478
+ problems: [
2479
+ "not_found",
2480
+ "service_unavailable",
2481
+ "state_conflict",
2482
+ "test_to_live_escalation",
2483
+ ],
2484
+ scopes: ["billing:write"],
2485
+ sessionAuthority: "headers",
2486
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2487
+ ? ""
2488
+ : "Confirm one payment with the provider now",
2489
+ surfaces: ["api", "mock"],
2490
+ }),
2491
+ withBillingFundingContract({
2492
+ creates: false,
2493
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2494
+ ? ""
2495
+ : "Replaces the billing owner's exact calendar-month ceiling for automatic execution-credit charges, or turns automatic payment authority off with null. The expected revision prevents stale authority changes, and the Idempotency-Key makes retries converge. This command requires explicit agent approval because it changes payment authority. Tax and pending gross commitments consume the ceiling; manual purchases and project subscriptions do not. Refunds do not restore authority already used in that UTC month. USD 50 is the suggested editable default, not a platform maximum.",
2496
+ environments: ["live"],
2497
+ id: "billing.ceiling",
2498
+ idempotent: true,
2499
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2500
+ method: "PATCH",
2501
+ mutates: true,
2502
+ path: "/v1/billing/funding/ceiling",
2503
+ principals: ["api-credential", "oauth", "session"],
2504
+ problems: [
2505
+ "idempotency_key_reused",
2506
+ "invalid_request",
2507
+ "revision_conflict",
2508
+ "service_unavailable",
2509
+ "state_conflict",
2510
+ "test_to_live_escalation",
2511
+ ],
2512
+ request: billingCeilingUpdateRequestSchema,
2513
+ requestExample: globalThis
2514
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2515
+ ? {}
2516
+ : {
2517
+ automaticExecutionTopUpCeiling: {
2518
+ currency: "USD",
2519
+ microdollars: "50000000",
2520
+ scale: 6,
2521
+ },
2522
+ expectedRevision: 3,
2523
+ },
2524
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
2525
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2526
+ ? {}
2527
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
2528
+ scopes: ["billing:write"],
2529
+ sessionAuthority: "headers",
2530
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2531
+ ? ""
2532
+ : "Set the automatic payment ceiling",
2533
+ surfaces: ["api", "mock"],
2534
+ }),
2535
+ BILLING_AUTO_TOP_UP_PREVIEW_OPERATION,
2536
+ BILLING_AUTO_TOP_UP_APPLY_OPERATION,
2537
+ {
2538
+ creates: true,
2539
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2540
+ ? ""
2541
+ : "Reserves unused purchased execution credit against one original payment, with the billing owner's explicit confirmation. Purchased credit is not refundable except where a charge is refunded because the service did not work as described, so this records no promise of a refund: it never calls Stripe, cashes out credit or grants an MCP cash-out path. A Stripe refund of that payment settles the reservation when it carries the same credit and supersedes it otherwise; the Idempotency-Key preserves one reservation across retries. Trial credit has no cash value, and a refund does not restore automatic purchasing authority used in the month.",
2542
+ environments: ["live"],
2543
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2544
+ ? {}
2545
+ : {
2546
+ amount: { currency: "USD", microdollars: "5000000", scale: 6 },
2547
+ id: "refund-request-example",
2548
+ paymentOperation: "funding-operation-example",
2549
+ requestedAt: "2026-09-10T12:10:00.000Z",
2550
+ state: "operator-review-pending",
2551
+ },
2552
+ id: "billing.refundrequest",
2553
+ idempotent: true,
2554
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2555
+ method: "POST",
2556
+ mutates: true,
2557
+ path: "/v1/billing/funding/refunds",
2558
+ // **No browser session** (W9-09). The dashboard's refund request and
2559
+ // refund review forms were an operator's procedure rendered on a customer's
2560
+ // home screen, and they are gone; refunds are a conversation with support.
2561
+ // The operation is unchanged for an API credential and OAuth — the CLI's
2562
+ // `billing refund-request` — and a session write nothing calls is an
2563
+ // authorization path nobody exercises, which `workspace-mutations.test.ts`
2564
+ // exists to refuse.
2565
+ principals: ["api-credential", "oauth"],
2566
+ problems: [
2567
+ "idempotency_key_reused",
2568
+ "invalid_request",
2569
+ "not_found",
2570
+ "service_unavailable",
2571
+ "state_conflict",
2572
+ "test_to_live_escalation",
2573
+ ],
2574
+ request: billingRefundRequestCreateSchema,
2575
+ requestExample: globalThis
2576
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2577
+ ? {}
2578
+ : {
2579
+ amount: { currency: "USD", microdollars: "5000000", scale: 6 },
2580
+ confirmed: true,
2581
+ paymentOperation: "funding-operation-example",
2582
+ reason: "Duplicate manual purchase",
2583
+ },
2584
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
2585
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2586
+ ? API_UNUSED_RESPONSE_SCHEMA
2587
+ : billingRefundRequestViewSchema,
2588
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2589
+ ? {}
2590
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
2591
+ scopes: ["billing:write"],
2592
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2593
+ ? ""
2594
+ : "Reserve credit against a payment for refund",
2595
+ surfaces: ["api", "mock"],
2596
+ },
2597
+ withBillingFundingContract({
2598
+ creates: false,
2599
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2600
+ ? ""
2601
+ : "Completes or declines a pending refund reservation. Completion verifies an existing Stripe refund by authenticated provider read before applying the exact credit, tax and gross adjustment, and converges on the recorded adjustment when that refund already settled the reservation; it never creates a provider refund. Decline releases the reserved credit without contacting the provider, and a reservation a Stripe refund superseded is refused as a state conflict. The Idempotency-Key makes either outcome converge across retries.",
2602
+ environments: ["live"],
2603
+ id: "billing.refundresolution",
2604
+ idempotent: true,
2605
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2606
+ method: "PATCH",
2607
+ mutates: true,
2608
+ path: "/v1/billing/funding/refunds/{refundRequest}",
2609
+ // **No browser session** (W9-09). The dashboard's refund request and
2610
+ // refund review forms were an operator's procedure rendered on a customer's
2611
+ // home screen, and they are gone; refunds are a conversation with support.
2612
+ // The operation is unchanged for an API credential and OAuth — the CLI's
2613
+ // `billing refund-request` — and a session write nothing calls is an
2614
+ // authorization path nobody exercises, which `workspace-mutations.test.ts`
2615
+ // exists to refuse.
2616
+ principals: ["api-credential", "oauth"],
2617
+ problems: [
2618
+ "idempotency_key_reused",
2619
+ "invalid_request",
2620
+ "not_found",
2621
+ "service_unavailable",
2622
+ "state_conflict",
2623
+ "test_to_live_escalation",
2624
+ ],
2625
+ request: billingRefundResolutionRequestSchema,
2626
+ requestExample: globalThis
2627
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2628
+ ? {}
2629
+ : {
2630
+ confirmed: true,
2631
+ decision: "declined",
2632
+ },
2633
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
2634
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
2635
+ ? {}
2636
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
2637
+ scopes: ["billing:write"],
2638
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2639
+ ? ""
2640
+ : "Complete or decline a refund reservation",
2641
+ surfaces: ["api", "mock"],
2642
+ }),
2643
+ {
2644
+ creates: false,
2645
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2646
+ ? ""
2647
+ : "Reads named included and subscribed project access, paid-through and grace deadlines, separate monthly fees, pending provider actions and desired/effective revisions.",
2648
+ id: "billing.projects",
2649
+ method: "GET",
2650
+ path: "/v1/billing/projects",
2651
+ idempotent: true,
2652
+ mutates: false,
2653
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2654
+ principals: ["api-credential", "oauth", "session"],
2655
+ scopes: ["usage:read"],
2656
+ sessionAuthority: "headers",
2657
+ surfaces: ["api", "mock"],
2658
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2659
+ ? API_UNUSED_RESPONSE_SCHEMA
2660
+ : projectBillingStateSchema,
2661
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2662
+ ? {}
2663
+ : PROJECT_BILLING_EXAMPLE,
2664
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2665
+ ? ""
2666
+ : "Read named project billing access",
2667
+ problems: [
2668
+ "service_unavailable",
2669
+ "state_conflict",
2670
+ "not_found",
2671
+ "revision_conflict",
2672
+ "test_to_live_escalation",
2673
+ ],
2674
+ },
2675
+ {
2676
+ creates: false,
2677
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2678
+ ? ""
2679
+ : "Previews one named project addition, paid-through cancellation or included-slot transfer without authorizing a charge. Quotes expire after five minutes and bind the current commercial revision. Amounts describe project fees; Stripe Checkout shows any applicable tax before confirmation.",
2680
+ id: "billing.quote",
2681
+ method: "POST",
2682
+ path: "/v1/billing/projects/quote",
2683
+ idempotent: false,
2684
+ mutates: false,
2685
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2686
+ principals: ["api-credential", "oauth", "session"],
2687
+ scopes: ["billing:write"],
2688
+ sessionAuthority: "headers",
2689
+ surfaces: ["api", "mock"],
2690
+ environments: ["live"],
2691
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2692
+ ? API_UNUSED_RESPONSE_SCHEMA
2693
+ : projectBillingQuoteSchema,
2694
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2695
+ ? {}
2696
+ : PROJECT_BILLING_QUOTE_EXAMPLE,
2697
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2698
+ ? ""
2699
+ : "Preview a named project billing change",
2700
+ problems: [
2701
+ "service_unavailable",
2702
+ "state_conflict",
2703
+ "not_found",
2704
+ "revision_conflict",
2705
+ "test_to_live_escalation",
2706
+ ],
2707
+ request: projectBillingQuoteRequestSchema,
2708
+ requestExample: globalThis
2709
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2710
+ ? {}
2711
+ : {
2712
+ action: "add",
2713
+ project: "proj_00000000000000000000000000",
2714
+ },
2715
+ },
2716
+ {
2717
+ creates: false,
2718
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2719
+ ? ""
2720
+ : "Confirms the exact named-project quote and recurring commitment. Additional access activates only after authenticated successful provider payment; cancellation preserves paid-through access without a refund or renewal grace. Included transfer never subscribes the formerly included project. Retries retain the same operation and payment identity.",
2721
+ id: "billing.change",
2722
+ method: "POST",
2723
+ path: "/v1/billing/projects/change",
2724
+ idempotent: true,
2725
+ mutates: true,
2726
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2727
+ principals: ["api-credential", "oauth", "session"],
2728
+ scopes: ["billing:write"],
2729
+ sessionAuthority: "headers",
2730
+ surfaces: ["api", "mock"],
2731
+ environments: ["live"],
2732
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2733
+ ? API_UNUSED_RESPONSE_SCHEMA
2734
+ : projectBillingStateSchema,
2735
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2736
+ ? {}
2737
+ : PROJECT_BILLING_EXAMPLE,
2738
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2739
+ ? ""
2740
+ : "Confirm a quoted project billing change",
2741
+ problems: [
2742
+ "service_unavailable",
2743
+ "idempotency_key_reused",
2744
+ "state_conflict",
2745
+ "not_found",
2746
+ "revision_conflict",
2747
+ "test_to_live_escalation",
2748
+ ],
2749
+ request: projectBillingChangeRequestSchema,
2750
+ requestExample: globalThis
2751
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2752
+ ? {}
2753
+ : {
2754
+ quote: "quote-example",
2755
+ expectedRevision: 2,
2756
+ confirmed: true,
2757
+ },
2758
+ requestHeaders: requiredIdempotencyRequestHeaderSchema,
2759
+ },
2760
+ {
2761
+ creates: false,
2762
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2763
+ ? ""
2764
+ : "Creates a short-lived Stripe-hosted payment-method and invoice recovery session for the verified organization. It does not grant execution credit or additional project access.",
2765
+ id: "billing.portal",
2766
+ method: "POST",
2767
+ path: "/v1/billing/portal",
2768
+ idempotent: false,
2769
+ mutates: true,
2770
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2771
+ principals: ["api-credential", "oauth", "session"],
2772
+ scopes: ["billing:write"],
2773
+ sessionAuthority: "headers",
2774
+ surfaces: ["api", "mock"],
2775
+ environments: ["live"],
2776
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2777
+ ? API_UNUSED_RESPONSE_SCHEMA
2778
+ : billingPortalSchema,
2779
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2780
+ ? {}
2781
+ : { url: "https://billing.stripe.com/p/session/example" },
2782
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2783
+ ? ""
2784
+ : "Open hosted payment recovery",
2785
+ problems: [
2786
+ "service_unavailable",
2787
+ "state_conflict",
2788
+ "not_found",
2789
+ "revision_conflict",
2790
+ "test_to_live_escalation",
2791
+ ],
2792
+ },
2793
+ {
2794
+ creates: false,
2795
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2796
+ ? ""
2797
+ : "Reads the verified organization's saved payment method: the one method automatic execution top-ups and project subscriptions charge. It is the payment provider's default payment method for the organization, read by authenticated provider call. method says what it is — type card with brand, last four digits and expiry; type link with the email Link reports, when it reports one; or type other with the provider's type name (cashapp, amazon_pay, klarna and the like) — and every variant carries label, the name to show a person. card repeats the card details when the method is a card and is null otherwise; it is kept for clients written before other payment methods were accepted. A method the organization already authorized for automatic top-up or a project subscription is adopted as the saved method, so an existing customer is not told they have none. method and card are null when the organization has none.",
2798
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2799
+ ? {}
2800
+ : {
2801
+ card: { brand: "visa", expMonth: 12, expYear: 2030, last4: "4242" },
2802
+ method: {
2803
+ brand: "visa",
2804
+ expMonth: 12,
2805
+ expYear: 2030,
2806
+ label: "Visa ending in 4242",
2807
+ last4: "4242",
2808
+ type: "card",
2809
+ },
2810
+ },
2811
+ id: "billing.paymentmethod",
2812
+ idempotent: true,
2813
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2814
+ method: "GET",
2815
+ mutates: false,
2816
+ path: "/v1/billing/payment-method",
2817
+ principals: ["api-credential", "oauth", "session"],
2818
+ problems: ["service_unavailable"],
2819
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2820
+ ? API_UNUSED_RESPONSE_SCHEMA
2821
+ : billingPaymentMethodSchema,
2822
+ scopes: ["usage:read"],
2823
+ sessionAuthority: "headers",
2824
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2825
+ ? ""
2826
+ : "Read the saved payment method",
2827
+ surfaces: ["api", "mock"],
2828
+ },
2829
+ {
2830
+ creates: false,
2831
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2832
+ ? ""
2833
+ : "Lists the verified organization's project subscription charges: the payment provider's invoices for its project subscription, read by authenticated provider call, most recent first and at most 24. Execution-credit purchases are not listed here; billing.funding reports them. Draft and zero-amount invoices are omitted. Each amount is the invoice total including tax, and the receipt link, when present, is the provider-hosted invoice page. An organization that has never been billed has an empty list; reading it creates nothing and changes nothing.",
2834
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2835
+ ? {}
2836
+ : {
2837
+ data: [
2838
+ {
2839
+ amount: {
2840
+ currency: "USD",
2841
+ microdollars: "5000000",
2842
+ scale: 6,
2843
+ },
2844
+ createdAt: "2026-09-01T12:00:00.000Z",
2845
+ id: "in_example_project_charge",
2846
+ receiptUrl: "https://invoice.stripe.com/i/acct_example/example",
2847
+ state: "paid",
2848
+ },
2849
+ ],
2850
+ },
2851
+ id: "billing.invoices",
2852
+ idempotent: true,
2853
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2854
+ method: "GET",
2855
+ mutates: false,
2856
+ path: "/v1/billing/invoices",
2857
+ principals: ["api-credential", "oauth", "session"],
2858
+ problems: ["service_unavailable"],
2859
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2860
+ ? API_UNUSED_RESPONSE_SCHEMA
2861
+ : billingInvoiceListSchema,
2862
+ scopes: ["usage:read"],
2863
+ sessionAuthority: "headers",
2864
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2865
+ ? ""
2866
+ : "List project subscription charges",
2867
+ surfaces: ["api", "mock"],
2868
+ },
2869
+ {
2870
+ creates: false,
2871
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2872
+ ? ""
2873
+ : "Creates a short-lived provider-hosted payment-method setup session for the verified organization and returns its address. It offers every payment method the provider account enables that can be charged later without the customer present — cards, Link and others. Saving one there charges nothing; it becomes the saved payment method only once billing.paymentmethodconfirm (when the browser returns) or the provider's notification reads the completed setup by authenticated provider call. An optional return address must share the origin of the configured billing page.",
2874
+ environments: ["live"],
2875
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2876
+ ? {}
2877
+ : { url: "https://checkout.stripe.com/c/pay/example-card-setup" },
2878
+ id: "billing.paymentmethodsetup",
2879
+ idempotent: false,
2880
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2881
+ method: "POST",
2882
+ mutates: true,
2883
+ path: "/v1/billing/payment-method/setup",
2884
+ principals: ["api-credential", "oauth", "session"],
2885
+ problems: [
2886
+ "invalid_request",
2887
+ "service_unavailable",
2888
+ "state_conflict",
2889
+ "not_found",
2890
+ "revision_conflict",
2891
+ "test_to_live_escalation",
2892
+ ],
2893
+ request: billingPaymentMethodSetupRequestSchema,
2894
+ requestExample: globalThis
2895
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2896
+ ? {}
2897
+ : {},
2898
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2899
+ ? API_UNUSED_RESPONSE_SCHEMA
2900
+ : billingPortalSchema,
2901
+ scopes: ["billing:write"],
2902
+ sessionAuthority: "headers",
2903
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2904
+ ? ""
2905
+ : "Start saving a payment method",
2906
+ surfaces: ["api", "mock"],
2907
+ },
2908
+ {
2909
+ creates: false,
2910
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2911
+ ? ""
2912
+ : "Makes the payment method saved in one completed hosted setup the organization's saved payment method, typically when the browser returns from it. The session is read by authenticated provider call and must belong to the verified organization's own customer; a session of another organization is answered not found. It becomes the provider default for invoices, the default of the organization's project subscription, and the automatic top-up payment method — readying a top-up rule that was waiting for one. The response has the shape billing.paymentmethod returns. When the previous method was removed (billing.paymentmethodremove) and the paid period it let run out has not ended, renewal resumes for the projects that removal stopped; a project the customer cancelled themselves stays cancelled. Nothing in the request can claim a setup succeeded, and repeating the call is safe.",
2913
+ environments: ["live"],
2914
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2915
+ ? {}
2916
+ : {
2917
+ card: { brand: "visa", expMonth: 12, expYear: 2030, last4: "4242" },
2918
+ method: {
2919
+ brand: "visa",
2920
+ expMonth: 12,
2921
+ expYear: 2030,
2922
+ label: "Visa ending in 4242",
2923
+ last4: "4242",
2924
+ type: "card",
2925
+ },
2926
+ },
2927
+ id: "billing.paymentmethodconfirm",
2928
+ idempotent: true,
2929
+ mcp: { destructive: false, kind: "tool", openWorld: false },
2930
+ method: "POST",
2931
+ mutates: true,
2932
+ path: "/v1/billing/payment-method/confirm",
2933
+ principals: ["api-credential", "oauth", "session"],
2934
+ problems: [
2935
+ "invalid_request",
2936
+ "not_found",
2937
+ "service_unavailable",
2938
+ "state_conflict",
2939
+ "revision_conflict",
2940
+ "test_to_live_escalation",
2941
+ ],
2942
+ request: billingPaymentMethodConfirmRequestSchema,
2943
+ requestExample: globalThis
2944
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2945
+ ? {}
2946
+ : { checkoutSession: "cs_example_card_setup" },
2947
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2948
+ ? API_UNUSED_RESPONSE_SCHEMA
2949
+ : billingPaymentMethodSchema,
2950
+ scopes: ["billing:write"],
2951
+ sessionAuthority: "headers",
2952
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2953
+ ? ""
2954
+ : "Confirm a saved payment method",
2955
+ surfaces: ["api", "mock"],
2956
+ },
2957
+ {
2958
+ creates: false,
2959
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2960
+ ? ""
2961
+ : "Removes the verified organization's saved payment method, and with it everything that charges it. Removing it stops renewal: every project subscription is set to end at the end of the period already paid for, so paid projects keep running until then and then stop, with nothing refunded and nothing more charged; billing.projects shows each one's cancellationAt. The included free project is unaffected. Automatic top-up turns off immediately and forgets its payment method. A pending or declined project addition is ended, so nothing later starts a checkout or a charge, and no project can be added until a payment method is saved again. The method stops being the provider default and is detached from the organization's customer. The request must carry confirmed: true. Repeating the call is safe: with nothing on file it answers a null method and card and still makes sure nothing is left that could charge one. Saving a payment method through billing.paymentmethodsetup before the period ends keeps those projects: renewal resumes on the new method, except for any project the customer cancelled themselves. After the period ends, a paid project must be added again.",
2962
+ environments: ["live"],
2963
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2964
+ ? {}
2965
+ : { card: null, method: null },
2966
+ id: "billing.paymentmethodremove",
2967
+ idempotent: true,
2968
+ mcp: { destructive: true, kind: "tool", openWorld: false },
2969
+ method: "POST",
2970
+ mutates: true,
2971
+ path: "/v1/billing/payment-method/remove",
2972
+ principals: ["api-credential", "oauth", "session"],
2973
+ problems: [
2974
+ "invalid_request",
2975
+ "not_found",
2976
+ "service_unavailable",
2977
+ "state_conflict",
2978
+ "revision_conflict",
2979
+ "test_to_live_escalation",
2980
+ ],
2981
+ request: billingPaymentMethodRemoveRequestSchema,
2982
+ requestExample: globalThis
2983
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
2984
+ ? {}
2985
+ : { confirmed: true },
2986
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2987
+ ? API_UNUSED_RESPONSE_SCHEMA
2988
+ : billingPaymentMethodSchema,
2989
+ scopes: ["billing:write"],
2990
+ sessionAuthority: "headers",
2991
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
2992
+ ? ""
2993
+ : "Remove the saved payment method",
1069
2994
  surfaces: ["api", "mock"],
1070
2995
  },
1071
2996
  {
1072
2997
  creates: false,
1073
- 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.",
1074
- example: {
1075
- credential: {
1076
- createdAt: "2026-07-28T15:00:00.000Z",
1077
- displayPrefix: "pt_test_a1b2c3d4",
1078
- environmentKind: "test",
1079
- id: "ak_01h8xyz9k2m4n6p8r0t2v4w6y8",
1080
- project: "proj_01h8xyz9k2m4n6p8r0t2v4w6y8",
1081
- revokedAt: "2026-07-28T16:00:00.000Z",
1082
- scopes: ["schedules:write"],
1083
- },
1084
- },
1085
- id: "credentials.revoke",
1086
- mcp: { destructive: true, kind: "tool", openWorld: false },
1087
- // Repeating this leaves the same credential revoked at the same instant, so
1088
- // it is idempotent in the sense the field means — no key required, because
1089
- // there is no second effect to suppress.
1090
- idempotent: true,
1091
- method: "DELETE",
2998
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
2999
+ ? ""
3000
+ : "Advances at most one due, already-authorized desired billing-policy revision for the caller's organization into PostgreSQL, then returns the same exact desired/effective summary as billing.summary. The command never changes the desired document. A transport failure is recorded for bounded retry and remains pending. Repeating the command may advance the next queued revision, so each call requires approval.",
3001
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3002
+ ? {}
3003
+ : BILLING_SUMMARY_EXAMPLE,
3004
+ environments: ["live"],
3005
+ id: "billing.reconcile",
3006
+ idempotent: false,
3007
+ mcp: { destructive: false, kind: "tool", openWorld: false },
3008
+ method: "POST",
1092
3009
  mutates: true,
1093
- path: "/v1/credentials/{credentialId}",
1094
- conditionalScopes: ["credentials:administer"],
3010
+ path: "/v1/billing/reconcile",
1095
3011
  principals: ["api-credential", "oauth", "session"],
1096
- problems: ["invalid_request", "not_found", "scope_missing"],
1097
- response: credentialRevokedSchema,
1098
- scopes: ["credentials:write"],
3012
+ // `billing.reconcile` answers from the same summary read as
3013
+ // `billing.summary`, so it reaches the same not-provisioned refusal. It is
3014
+ // declared here because an integrator reading the published OpenAPI would
3015
+ // otherwise be told a 503 on this operation can only ever be
3016
+ // `service_unavailable`.
3017
+ problems: [
3018
+ "billing_not_ready",
3019
+ "service_unavailable",
3020
+ "test_to_live_escalation",
3021
+ ],
3022
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3023
+ ? API_UNUSED_RESPONSE_SCHEMA
3024
+ : billingSummarySchema,
3025
+ scopes: ["billing:write"],
1099
3026
  sessionAuthority: "headers",
1100
- summary: "Revoke an API credential",
3027
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3028
+ ? ""
3029
+ : "Advance one pending billing policy",
1101
3030
  surfaces: ["api", "mock"],
1102
3031
  },
1103
3032
  {
1104
- creates: true,
1105
- 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.",
1106
- example: {
1107
- occurrence: {
1108
- attemptCount: 0,
1109
- generation: 1,
1110
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1111
- plannedFor: "2026-07-28T15:00:00.000Z",
1112
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1113
- sequence: 1,
1114
- state: "planned",
1115
- },
1116
- schedule: {
1117
- createdAt: "2026-07-28T14:59:00.000Z",
1118
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1119
- generation: 1,
1120
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1121
- latencyClass: "realtime",
1122
- partitionKey: "campaign.spring",
1123
- recurrence: { kind: "at" },
1124
- status: "active",
1125
- updatedAt: "2026-07-28T14:59:00.000Z",
1126
- version: 1,
3033
+ creates: false,
3034
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3035
+ ? ""
3036
+ : "Replaces the caller organization's advisory execution budget and optional hard execution-spend cap for the current UTC month. Values are exact whole cents encoded as integer microdollars. The expected budget-policy revision prevents a stale editor overwriting a newer choice, and Idempotency-Key makes retrying one intent safe. Null turns that setting off. This command records desired state durably; billing.reconcile advances it to PostgreSQL, and reads remain pending until PostgreSQL confirms it. It never changes automatic top-up authority, purchases credit, or counts subscription payments as execution usage.",
3037
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3038
+ ? {}
3039
+ : {
3040
+ budgetPolicy: {
3041
+ desired: {
3042
+ advisoryBudget: {
3043
+ currency: "USD",
3044
+ microdollars: "25000000",
3045
+ scale: 6,
3046
+ },
3047
+ hardCap: {
3048
+ currency: "USD",
3049
+ microdollars: "50000000",
3050
+ scale: 6,
3051
+ },
3052
+ },
3053
+ desiredRevision: 2,
3054
+ effectiveRevision: 1,
3055
+ pending: true,
3056
+ },
3057
+ freshness: { kind: "authoritative" },
1127
3058
  },
1128
- },
1129
- id: "schedules.create",
1130
- // Additive: it brings a schedule into existence and takes nothing away.
1131
- // A callback schedule causes a future request to the verified external
1132
- // endpoint. It does not destructively modify that system, but it does act
1133
- // beyond Greatwait, so MCP clients must receive the open-world hint.
1134
- mcp: { destructive: false, kind: "tool", openWorld: true },
1135
- // False even though this operation reads `Idempotency-Key`, because the
1136
- // header is optional and this flag is what a client reads before deciding
1137
- // whether a blind retry is safe. It is not: a retry without the key creates
1138
- // a second schedule. What says the protection is available is
1139
- // `requestHeaders`, which publishes the key rather than promising it was
1140
- // used.
1141
- idempotent: false,
1142
- method: "POST",
3059
+ environments: ["live"],
3060
+ id: "billing.budgets",
3061
+ idempotent: true,
3062
+ mcp: { destructive: false, kind: "tool", openWorld: false },
3063
+ method: "PATCH",
1143
3064
  mutates: true,
1144
- path: "/v1/schedules",
3065
+ path: "/v1/billing/budgets",
1145
3066
  principals: ["api-credential", "oauth", "session"],
1146
3067
  problems: [
1147
- // **Reachable in every deployment, and undeclared until W9-03.** The
1148
- // route refuses here when the endpoint's status is not one this
1149
- // deployment will send to — under the default `not-required` ownership
1150
- // policy that still covers a `disabled` destination, and under
1151
- // `required` it covers a `pending` one as well. An operation that can
1152
- // refuse for a code it never mentions is a document that lies, and a
1153
- // published quickstart could not tell a reader what to do about a
1154
- // refusal the contract said was impossible.
1155
- "endpoint_unverified",
1156
3068
  "idempotency_key_reused",
1157
3069
  "invalid_request",
1158
- "not_found",
1159
- // The organization ceiling, the same code and the same shape
1160
- // `projects.create` and `endpoints.create` use. A plan may bound the
1161
- // live schedules an organization holds, the distinct partition keys it
1162
- // has live, and how large a `data` body it may carry; all three refuse
1163
- // here rather than truncating, because a schedule created without the
1164
- // body the caller sent is not the schedule they asked for.
1165
- "plan_limit_reached",
3070
+ "revision_conflict",
1166
3071
  "service_unavailable",
3072
+ "test_to_live_escalation",
1167
3073
  ],
1168
- request: scheduleRequestSchema,
1169
- requestExample: {
1170
- cron: "0 9 * * 1-5",
1171
- data: { report: "daily" },
1172
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1173
- partitionKey: "campaign.spring",
1174
- timeZone: "Europe/London",
1175
- },
1176
- requestHeaders: idempotencyRequestHeaderSchema,
1177
- response: scheduleViewSchema,
1178
- responseHeaders: replayedResponseHeaderSchema,
1179
- scopes: ["schedules:write"],
3074
+ request: billingBudgetUpdateRequestSchema,
3075
+ requestExample: globalThis
3076
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3077
+ ? {}
3078
+ : {
3079
+ advisoryBudget: {
3080
+ currency: "USD",
3081
+ microdollars: "25000000",
3082
+ scale: 6,
3083
+ },
3084
+ expectedRevision: 1,
3085
+ hardCap: {
3086
+ currency: "USD",
3087
+ microdollars: "50000000",
3088
+ scale: 6,
3089
+ },
3090
+ },
3091
+ requestHeaders: billingBudgetUpdateRequestHeadersSchema,
3092
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3093
+ ? API_UNUSED_RESPONSE_SCHEMA
3094
+ : billingBudgetUpdateResponseSchema,
3095
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3096
+ ? {}
3097
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
3098
+ scopes: ["billing:write"],
1180
3099
  sessionAuthority: "headers",
1181
- summary: "Create a schedule",
3100
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3101
+ ? ""
3102
+ : "Set execution budgets",
1182
3103
  surfaces: ["api", "mock"],
1183
3104
  },
1184
3105
  {
1185
3106
  creates: false,
1186
- 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.",
1187
- example: {
1188
- occurrence: {
1189
- attemptCount: 0,
1190
- generation: 1,
1191
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1192
- plannedFor: "2026-07-28T15:00:00.000Z",
1193
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1194
- sequence: 1,
1195
- state: "planned",
1196
- },
1197
- schedule: {
1198
- createdAt: "2026-07-28T14:59:00.000Z",
1199
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1200
- generation: 1,
1201
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1202
- latencyClass: "realtime",
1203
- partitionKey: "campaign.spring",
1204
- recurrence: { kind: "at" },
1205
- status: "active",
1206
- updatedAt: "2026-07-28T14:59:00.000Z",
1207
- version: 1,
3107
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3108
+ ? ""
3109
+ : "Lists the verified principal's organization ledger in immutable sequence order. Each entry is one exact signed microdollar fact with safe attempt, lot, payment-operation and event references. Raw callback data, card data, internal causal keys and ledger detail have no field in the response. The opaque cursor is bound to the principal's organization, project and environment and cannot widen authority.",
3110
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3111
+ ? {}
3112
+ : {
3113
+ data: [
3114
+ {
3115
+ amount: { currency: "USD", microdollars: "-10", scale: 6 },
3116
+ kind: "attempt_debited",
3117
+ period: "2026-09-01T00:00:00.000Z",
3118
+ recordedAt: "2026-09-09T14:00:00.000Z",
3119
+ reference: {
3120
+ attempt: "att_01h8xyz9k2m4n6p8r0t2v4w6y8",
3121
+ event: "billing-attempt-debited-1",
3122
+ },
3123
+ sequence: "42",
3124
+ },
3125
+ ],
3126
+ freshness: { kind: "authoritative" },
3127
+ nextCursor: "eyJhIjowLCJpIjoiNDIiLCJrIjoiOTUxMzU0NmYifQ",
1208
3128
  },
1209
- },
1210
- id: "schedules.read",
3129
+ id: "billing.ledger",
1211
3130
  idempotent: true,
1212
3131
  mcp: { destructive: false, kind: "tool", openWorld: false },
1213
3132
  method: "GET",
1214
3133
  mutates: false,
1215
- path: "/v1/schedules/{scheduleId}",
3134
+ path: "/v1/billing/ledger",
1216
3135
  principals: ["api-credential", "oauth", "session"],
1217
- problems: ["invalid_request", "not_found"],
1218
- response: scheduleViewSchema,
1219
- responseHeaders: versionResponseHeaderSchema,
1220
- scopes: ["schedules:read"],
3136
+ problems: ["invalid_request"],
3137
+ query: billingLedgerRequestSchema,
3138
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3139
+ ? API_UNUSED_RESPONSE_SCHEMA
3140
+ : billingLedgerPageSchema,
3141
+ scopes: ["usage:read"],
1221
3142
  sessionAuthority: "headers",
1222
- summary: "Read a schedule",
3143
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3144
+ ? ""
3145
+ : "List immutable billing entries",
1223
3146
  surfaces: ["api", "mock"],
1224
3147
  },
1225
3148
  {
1226
3149
  creates: false,
1227
- 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.",
1228
- example: {
1229
- data: [
1230
- {
1231
- createdAt: "2026-07-28T14:59:00.000Z",
1232
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1233
- generation: 1,
1234
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1235
- latencyClass: "realtime",
1236
- recurrence: { kind: "at" },
1237
- status: "active",
1238
- updatedAt: "2026-07-28T14:59:00.000Z",
1239
- version: 1,
3150
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3151
+ ? ""
3152
+ : "Read effective customer allowances for the verified organization. Deployment and organization revisions identify the policy used; infrastructure and other organizations' settings are excluded.",
3153
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3154
+ ? {}
3155
+ : {
3156
+ limits: {
3157
+ inlinePayloadBytes: 65536,
3158
+ forecastHorizonSeconds: 90000,
3159
+ usageWindowDays: 366,
1240
3160
  },
1241
- ],
1242
- // `projected` since W2-06 served this listing from the control-plane
1243
- // directory. `asOf` is the instant the projection was last known to hold
1244
- // everything every partition had handed over, and `lagSeconds` is how long
1245
- // ago that was — so a page states how far behind it may be rather than
1246
- // implying it is current.
1247
- freshness: {
1248
- asOf: "2026-07-28T15:00:00.000Z",
1249
- kind: "projected",
1250
- lagSeconds: 0,
1251
- },
1252
- nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoic2NoXzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0",
1253
- },
1254
- id: "schedules.list",
3161
+ provenance: {
3162
+ inlinePayloadBytes: "default",
3163
+ forecastHorizonSeconds: "default",
3164
+ usageWindowDays: "default",
3165
+ },
3166
+ revision: { global: 0, organization: 0 },
3167
+ },
3168
+ id: "limits.read",
1255
3169
  idempotent: true,
1256
3170
  mcp: { destructive: false, kind: "tool", openWorld: false },
1257
3171
  method: "GET",
1258
3172
  mutates: false,
1259
- path: "/v1/schedules",
3173
+ path: "/v1/limits",
1260
3174
  principals: ["api-credential", "oauth", "session"],
1261
- problems: ["invalid_request"],
1262
- query: pageRequestSchema,
1263
- response: schedulePageSchema,
3175
+ problems: ["service_unavailable"],
3176
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3177
+ ? API_UNUSED_RESPONSE_SCHEMA
3178
+ : effectiveCustomerLimitsSchema,
1264
3179
  scopes: ["schedules:read"],
1265
3180
  sessionAuthority: "headers",
1266
- summary: "List schedules",
3181
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3182
+ ? ""
3183
+ : "Read effective customer limits",
1267
3184
  surfaces: ["api", "mock"],
1268
3185
  },
1269
3186
  {
1270
3187
  creates: false,
1271
- 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.",
1272
- example: {
1273
- buckets: [
1274
- {
1275
- byLatencyClass: { bulk: 12, realtime: 3 },
1276
- byPartitionKey: { "campaign.spring": 9, "campaign.winter": 4 },
1277
- count: 15,
1278
- nextFireCount: 4,
1279
- otherPartitionKeyCount: 2,
1280
- start: "2026-07-28T15:00:00.000Z",
3188
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3189
+ ? ""
3190
+ : "Legacy terminal-occurrence volume by UTC day from the authoritative scheduling model. This is an operational outcome aggregate retained for compatibility; it is not the PAYG invoice meter. Billing is per logical delivery attempt, including retries and redeliveries, and is exposed exactly by billing.summary and billing.ledger. Days with no terminal 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.",
3191
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3192
+ ? {}
3193
+ : {
3194
+ bucketSeconds: 86_400,
3195
+ days: [
3196
+ {
3197
+ billableOccurrences: 42,
3198
+ byTerminalState: { succeeded: 40, terminal_failed: 2 },
3199
+ start: "2026-07-28T00:00:00.000Z",
3200
+ },
3201
+ ],
3202
+ freshness: { kind: "authoritative" },
3203
+ totalBillableOccurrences: 42,
3204
+ window: {
3205
+ from: "2026-07-28T00:00:00.000Z",
3206
+ to: "2026-07-29T00:00:00.000Z",
1281
3207
  },
1282
- ],
1283
- freshness: {
1284
- asOf: "2026-07-28T14:58:30.000Z",
1285
- kind: "projected",
1286
- lagSeconds: 90,
1287
3208
  },
1288
- window: {
1289
- bucketSeconds: 1800,
1290
- from: "2026-07-28T15:00:00.000Z",
1291
- to: "2026-07-29T15:00:00.000Z",
1292
- },
1293
- },
1294
- id: "forecast.read",
3209
+ id: "usage.read",
1295
3210
  idempotent: true,
1296
3211
  mcp: { destructive: false, kind: "tool", openWorld: false },
1297
3212
  method: "GET",
1298
3213
  mutates: false,
1299
- path: "/v1/forecast",
3214
+ path: "/v1/usage",
1300
3215
  principals: ["api-credential", "oauth", "session"],
1301
3216
  problems: ["invalid_request"],
1302
- query: forecastRequestSchema,
1303
- response: forecastSchema,
1304
- scopes: ["forecast:read"],
3217
+ query: usageRequestSchema,
3218
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3219
+ ? API_UNUSED_RESPONSE_SCHEMA
3220
+ : usageSchema,
3221
+ scopes: ["usage:read"],
1305
3222
  sessionAuthority: "headers",
1306
- summary: "Forecast upcoming occurrences",
3223
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3224
+ ? ""
3225
+ : "Read terminal occurrence volume by day",
1307
3226
  surfaces: ["api", "mock"],
1308
3227
  },
1309
3228
  {
1310
3229
  creates: false,
1311
- 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.",
1312
- example: {
1313
- days: [
1314
- {
1315
- billableOccurrences: 42,
1316
- byTerminalState: { succeeded: 40, terminal_failed: 2 },
1317
- start: "2026-07-28T00:00:00.000Z",
1318
- },
1319
- ],
1320
- freshness: { kind: "authoritative" },
1321
- totalBillableOccurrences: 42,
1322
- window: {
1323
- from: "2026-07-28T00:00:00.000Z",
1324
- to: "2026-07-29T00:00:00.000Z",
3230
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3231
+ ? ""
3232
+ : "Reads the verified principal's project timing cohort over the authoritative rolling 24-hour due-time window. Exact 5,000ms and 15,000ms counters include eligible work that has not fired; customer blocks, platform blocks, skipped work and missing evidence stay visible beside the verdict. Values equal to a target meet it, and a threshold with no matured population is unknown. Delivered-sample p95 and p99 lateness are separate observations, including negative early-delivery defects. These are internal operating objectives, not a contractual SLA or service-credit promise.",
3233
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3234
+ ? {}
3235
+ : {
3236
+ customerBlockedCount: 2,
3237
+ deliveredSampleCount: 98,
3238
+ freshness: { kind: "authoritative" },
3239
+ missingEvidenceCount: 1,
3240
+ p95LatenessMs: 4_200,
3241
+ p99LatenessMs: 12_000,
3242
+ platformBlockedCount: 1,
3243
+ policyVersion: "timing-v1",
3244
+ skippedCount: 3,
3245
+ targets: [
3246
+ {
3247
+ breachCount: 5,
3248
+ customerBlockedCount: 2,
3249
+ eligibleOutstandingBreachCount: 1,
3250
+ maturedCount: 100,
3251
+ targetMs: 5_000,
3252
+ verdict: "met",
3253
+ withinTargetCount: 95,
3254
+ },
3255
+ {
3256
+ breachCount: 1,
3257
+ customerBlockedCount: 2,
3258
+ eligibleOutstandingBreachCount: 1,
3259
+ maturedCount: 100,
3260
+ targetMs: 15_000,
3261
+ verdict: "met",
3262
+ withinTargetCount: 99,
3263
+ },
3264
+ ],
3265
+ windowEnd: "2026-09-09T12:00:00.000Z",
3266
+ windowStart: "2026-09-08T12:00:00.000Z",
1325
3267
  },
1326
- },
1327
- id: "usage.read",
3268
+ id: "timing.summary",
1328
3269
  idempotent: true,
1329
3270
  mcp: { destructive: false, kind: "tool", openWorld: false },
1330
3271
  method: "GET",
1331
3272
  mutates: false,
1332
- path: "/v1/usage",
3273
+ path: "/v1/timing/summary",
1333
3274
  principals: ["api-credential", "oauth", "session"],
1334
- problems: ["invalid_request"],
1335
- query: usageRequestSchema,
1336
- response: usageSchema,
3275
+ problems: [],
3276
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3277
+ ? API_UNUSED_RESPONSE_SCHEMA
3278
+ : deliveryTimingSummarySchema,
1337
3279
  scopes: ["usage:read"],
1338
3280
  sessionAuthority: "headers",
1339
- summary: "Read billable usage by day",
3281
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3282
+ ? ""
3283
+ : "Read rolling delivery timing",
1340
3284
  surfaces: ["api", "mock"],
1341
3285
  },
1342
3286
  {
1343
3287
  creates: false,
1344
- 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.",
1345
- example: {
1346
- bucketSeconds: 600,
1347
- buckets: [
1348
- {
1349
- byTenant: { "campaign.spring": 9, "campaign.winter": 4 },
1350
- count: 15,
1351
- nextFireCount: 4,
1352
- otherCount: 2,
1353
- start: "2026-07-28T15:00:00.000Z",
3288
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3289
+ ? ""
3290
+ : "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.",
3291
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3292
+ ? {}
3293
+ : {
3294
+ bucketSeconds: 600,
3295
+ buckets: [
3296
+ {
3297
+ byTenant: { "campaign.spring": 9, "campaign.winter": 4 },
3298
+ count: 15,
3299
+ nextFireCount: 4,
3300
+ otherCount: 2,
3301
+ start: "2026-07-28T15:00:00.000Z",
3302
+ },
3303
+ ],
3304
+ freshness: {
3305
+ asOf: "2026-07-28T14:58:30.000Z",
3306
+ kind: "projected",
3307
+ lagSeconds: 90,
1354
3308
  },
1355
- ],
1356
- freshness: {
1357
- asOf: "2026-07-28T14:58:30.000Z",
1358
- kind: "projected",
1359
- lagSeconds: 90,
3309
+ version: FORECAST_WINDOW_VERSION,
1360
3310
  },
1361
- version: FORECAST_WINDOW_VERSION,
1362
- },
1363
3311
  id: "forecast.windows",
1364
3312
  idempotent: true,
1365
3313
  // Withheld from MCP rather than published as a tool. It is a compatibility
@@ -1369,7 +3317,7 @@ export const OPERATIONS = [
1369
3317
  // scheduled for removal, which is the opposite of what a tool list is for.
1370
3318
  mcp: {
1371
3319
  kind: "unavailable",
1372
- 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.",
3320
+ reason: "A transitional shape for the autoscaler migration, withdrawn after its cutover. forecast.read is the same data in the shape this product publishes, and it is the tool an agent should reach for.",
1373
3321
  },
1374
3322
  method: "GET",
1375
3323
  mutates: false,
@@ -1377,30 +3325,38 @@ export const OPERATIONS = [
1377
3325
  principals: ["api-credential", "oauth", "session"],
1378
3326
  problems: ["invalid_request"],
1379
3327
  query: forecastRequestSchema,
1380
- response: forecastWindowsSchema,
3328
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3329
+ ? API_UNUSED_RESPONSE_SCHEMA
3330
+ : forecastWindowsSchema,
1381
3331
  scopes: ["forecast:read"],
1382
3332
  sessionAuthority: "headers",
1383
- summary: "Forecast in the transitional window shape",
3333
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3334
+ ? ""
3335
+ : "Forecast in the transitional window shape",
1384
3336
  surfaces: ["api", "mock"],
1385
3337
  },
1386
3338
  {
1387
3339
  creates: false,
1388
- 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.",
1389
- example: {
1390
- data: [
1391
- {
1392
- attemptCount: 1,
1393
- generation: 1,
1394
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1395
- plannedFor: "2026-07-28T15:00:00.000Z",
1396
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1397
- sequence: 1,
1398
- state: "retry_wait",
1399
- },
1400
- ],
1401
- freshness: { kind: "authoritative" },
1402
- nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoib2NjXzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0",
1403
- },
3340
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3341
+ ? ""
3342
+ : "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 — oldest first unless `order=newest`, which walks from the most recent. A run that an edit replaced before it ran is left out; a run skipped because the previous one was still going is listed. The cursor is opaque, scoped to the verified principal's organization, project and environment, and to the order it was issued under. Each item is metadata only: callback payloads, destinations, response bodies and signing material have no field in the response.",
3343
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3344
+ ? {}
3345
+ : {
3346
+ data: [
3347
+ {
3348
+ attemptCount: 1,
3349
+ generation: 1,
3350
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3351
+ plannedFor: "2026-07-28T15:00:00.000Z",
3352
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3353
+ sequence: 1,
3354
+ state: "retry_wait",
3355
+ },
3356
+ ],
3357
+ freshness: { kind: "authoritative" },
3358
+ nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoib2NjXzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0",
3359
+ },
1404
3360
  id: "occurrences.list",
1405
3361
  idempotent: true,
1406
3362
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -1409,29 +3365,83 @@ export const OPERATIONS = [
1409
3365
  path: "/v1/schedules/{scheduleId}/occurrences",
1410
3366
  principals: ["api-credential", "oauth", "session"],
1411
3367
  problems: ["invalid_request", "not_found"],
1412
- query: pageRequestSchema,
1413
- response: occurrencePageSchema,
3368
+ query: historyPageRequestSchema,
3369
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3370
+ ? API_UNUSED_RESPONSE_SCHEMA
3371
+ : occurrencePageSchema,
3372
+ scopes: ["occurrences:read"],
3373
+ sessionAuthority: "headers",
3374
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3375
+ ? ""
3376
+ : "List retained occurrences",
3377
+ surfaces: ["api", "mock"],
3378
+ },
3379
+ {
3380
+ creates: false,
3381
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3382
+ ? ""
3383
+ : "Lists every retained occurrence in the verified principal's project and environment, newest first by planned instant with the occurrence identifier breaking millisecond ties. Optional endpoint, schedule, half-open date-range and outcome filters may be combined; the endpoint is resolved through the schedules that belong to the same authority. The opaque cursor belongs to this operation and the exact normalized filters that issued it, so it cannot be replayed under another view. Every page publishes the authoritative earliest retained instant for the caller's effective plan. Each item is metadata only: callback payloads, destinations, response bodies and signing material have no field in the response.",
3384
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3385
+ ? {}
3386
+ : {
3387
+ data: [
3388
+ {
3389
+ attemptCount: 1,
3390
+ generation: 1,
3391
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3392
+ plannedFor: "2026-07-28T15:00:00.000Z",
3393
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3394
+ sequence: 1,
3395
+ settledAt: "2026-07-28T15:00:01.000Z",
3396
+ state: "succeeded",
3397
+ },
3398
+ ],
3399
+ freshness: { kind: "authoritative" },
3400
+ retention: { from: "2026-07-21T15:00:00.000Z" },
3401
+ },
3402
+ id: "executions.list",
3403
+ idempotent: true,
3404
+ mcp: { destructive: false, kind: "tool", openWorld: false },
3405
+ method: "GET",
3406
+ mutates: false,
3407
+ path: "/v1/occurrences",
3408
+ principals: ["api-credential", "oauth", "session"],
3409
+ problems: ["invalid_request"],
3410
+ query: projectOccurrenceListRequestSchema,
3411
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3412
+ ? API_UNUSED_RESPONSE_SCHEMA
3413
+ : projectOccurrencePageSchema,
1414
3414
  scopes: ["occurrences:read"],
1415
3415
  sessionAuthority: "headers",
1416
- summary: "List retained occurrences",
3416
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3417
+ ? ""
3418
+ : "List project executions",
1417
3419
  surfaces: ["api", "mock"],
1418
3420
  },
1419
3421
  {
1420
3422
  creates: false,
1421
- 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.",
1422
- example: {
1423
- freshness: { kind: "authoritative" },
1424
- occurrence: {
1425
- attemptCount: 2,
1426
- generation: 1,
1427
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1428
- plannedFor: "2026-07-28T15:00:00.000Z",
1429
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1430
- sequence: 1,
1431
- settledAt: "2026-07-28T15:02:00.000Z",
1432
- state: "terminal_failed",
3423
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3424
+ ? ""
3425
+ : "Reads one retained occurrence from the PostgreSQL authority that owns its schedule. Trusted first-outbound timing is optional for records that predate substantiation; when present, firstAttemptLatenessMs is signed and a negative value exposes an early-delivery defect rather than being clamped to zero. Timing eligibility states whether a customer restriction excluded the occurrence from the internal target cohort. An identifier outside the verified principal's organization, project or environment is indistinguishable from an absent occurrence.",
3426
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3427
+ ? {}
3428
+ : {
3429
+ freshness: { kind: "authoritative" },
3430
+ occurrence: {
3431
+ attemptCount: 2,
3432
+ firstAttemptLatenessMs: 0,
3433
+ firstAttemptStartedAt: "2026-07-28T15:00:00.000Z",
3434
+ generation: 1,
3435
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3436
+ plannedFor: "2026-07-28T15:00:00.000Z",
3437
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3438
+ sequence: 1,
3439
+ settledAt: "2026-07-28T15:02:00.000Z",
3440
+ state: "terminal_failed",
3441
+ timingEligibility: "eligible",
3442
+ timingPolicyVersion: "payg-v1",
3443
+ },
1433
3444
  },
1434
- },
1435
3445
  id: "occurrences.read",
1436
3446
  idempotent: true,
1437
3447
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -1440,35 +3450,49 @@ export const OPERATIONS = [
1440
3450
  path: "/v1/schedules/{scheduleId}/occurrences/{occurrenceId}",
1441
3451
  principals: ["api-credential", "oauth", "session"],
1442
3452
  problems: ["invalid_request", "not_found"],
1443
- response: occurrenceViewSchema,
3453
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3454
+ ? API_UNUSED_RESPONSE_SCHEMA
3455
+ : occurrenceViewSchema,
1444
3456
  scopes: ["occurrences:read"],
1445
3457
  sessionAuthority: "headers",
1446
- summary: "Read an occurrence",
3458
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3459
+ ? ""
3460
+ : "Read an occurrence",
1447
3461
  surfaces: ["api", "mock"],
1448
3462
  },
1449
3463
  {
1450
3464
  creates: false,
1451
- 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.",
1452
- example: {
1453
- data: [
1454
- {
1455
- attemptNumber: 1,
1456
- classifiedAt: "2026-07-28T15:00:00.071Z",
1457
- delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8",
1458
- diagnostic: "http_retryable",
1459
- durationMs: 71,
1460
- id: "att_01h8xyz9k2m4n6p8r0t2v4w6y8",
1461
- occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1462
- remediation: "review_retry_policy",
1463
- responseStatus: 503,
1464
- startedAt: "2026-07-28T15:00:00.000Z",
1465
- state: "retryable_failure",
1466
- trigger: { kind: "automatic" },
1467
- },
1468
- ],
1469
- freshness: { kind: "authoritative" },
1470
- nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoiYXR0XzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0",
1471
- },
3465
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3466
+ ? ""
3467
+ : "Lists the immutable attempts retained under one occurrence, ordered by start instant and attempt identifier so equal timestamps have a stable position. The PostgreSQL authority answers every page. Optional first-outbound fields carry trusted occurrence timing and its pinned policy; absence means unknown, never zero. Results expose only bounded outcome, response-status, duration, timing, diagnostic, remediation and redelivery-cause metadata; callback payloads, response bodies, destinations, signing material, secrets and transport traces are structurally absent.",
3468
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3469
+ ? {}
3470
+ : {
3471
+ data: [
3472
+ {
3473
+ attemptNumber: 1,
3474
+ classifiedAt: "2026-07-28T15:00:00.071Z",
3475
+ dispatchRecoveries: 0,
3476
+ localReceiptRecoveries: 0,
3477
+ delivery: "dlv_01h8xyz9k2m4n6p8r0t2v4w6y8",
3478
+ diagnostic: "http_retryable",
3479
+ durationMs: 71,
3480
+ firstAttemptLatenessMs: 0,
3481
+ firstAttemptStartedAt: "2026-07-28T15:00:00.000Z",
3482
+ id: "att_01h8xyz9k2m4n6p8r0t2v4w6y8",
3483
+ occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3484
+ remediation: "review_retry_policy",
3485
+ responseStatus: 503,
3486
+ startedAt: "2026-07-28T15:00:00.000Z",
3487
+ state: "retryable_failure",
3488
+ timingEligibility: "eligible",
3489
+ timingPolicyVersion: "payg-v1",
3490
+ trigger: { kind: "automatic" },
3491
+ },
3492
+ ],
3493
+ freshness: { kind: "authoritative" },
3494
+ nextCursor: "eyJhIjoxNzg1MjUwODAwMDAwLCJpIjoiYXR0XzAxaDh4eXo5azJtNG42cDhyMHQydjR3Nnk4IiwiayI6Ijk1MTM1NDZmIn0",
3495
+ },
1472
3496
  id: "attempts.list",
1473
3497
  idempotent: true,
1474
3498
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -1478,31 +3502,45 @@ export const OPERATIONS = [
1478
3502
  principals: ["api-credential", "oauth", "session"],
1479
3503
  problems: ["invalid_request", "not_found"],
1480
3504
  query: pageRequestSchema,
1481
- response: attemptPageSchema,
3505
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3506
+ ? API_UNUSED_RESPONSE_SCHEMA
3507
+ : attemptPageSchema,
1482
3508
  scopes: ["occurrences:read"],
1483
3509
  sessionAuthority: "headers",
1484
- summary: "List delivery attempts",
3510
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3511
+ ? ""
3512
+ : "List delivery attempts",
1485
3513
  surfaces: ["api", "mock"],
1486
3514
  },
1487
3515
  {
1488
3516
  creates: false,
1489
- 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.",
1490
- example: {
1491
- attempt: {
1492
- attemptNumber: 2,
1493
- classifiedAt: "2026-07-28T15:02:00.000Z",
1494
- delivery: "dlv_11h8xyz9k2m4n6p8r0t2v4w6y8",
1495
- diagnostic: "network_ambiguous",
1496
- durationMs: 10_000,
1497
- id: "att_11h8xyz9k2m4n6p8r0t2v4w6y8",
1498
- occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1499
- remediation: "review_before_redelivery",
1500
- startedAt: "2026-07-28T15:01:50.000Z",
1501
- state: "ambiguous",
1502
- trigger: { kind: "automatic" },
3517
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3518
+ ? ""
3519
+ : "Reads one immutable delivery attempt from its occurrence's PostgreSQL authority. Ambiguous means the receiver may have acted and is never rewritten into certainty without durable result evidence. Optional first-outbound fields come only from trusted transport evidence and absence means unknown, never zero. The bounded response omits callback payloads, response bodies, destinations, signing material, secrets and raw transport failures by construction.",
3520
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3521
+ ? {}
3522
+ : {
3523
+ attempt: {
3524
+ attemptNumber: 2,
3525
+ classifiedAt: "2026-07-28T15:02:00.000Z",
3526
+ dispatchRecoveries: 2,
3527
+ localReceiptRecoveries: 1,
3528
+ delivery: "dlv_11h8xyz9k2m4n6p8r0t2v4w6y8",
3529
+ diagnostic: "network_ambiguous",
3530
+ durationMs: 10_000,
3531
+ firstAttemptLatenessMs: 0,
3532
+ firstAttemptStartedAt: "2026-07-28T15:00:00.000Z",
3533
+ id: "att_11h8xyz9k2m4n6p8r0t2v4w6y8",
3534
+ occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3535
+ remediation: "review_before_redelivery",
3536
+ startedAt: "2026-07-28T15:01:50.000Z",
3537
+ state: "ambiguous",
3538
+ timingEligibility: "eligible",
3539
+ timingPolicyVersion: "payg-v1",
3540
+ trigger: { kind: "automatic" },
3541
+ },
3542
+ freshness: { kind: "authoritative" },
1503
3543
  },
1504
- freshness: { kind: "authoritative" },
1505
- },
1506
3544
  id: "attempts.read",
1507
3545
  idempotent: true,
1508
3546
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -1511,29 +3549,39 @@ export const OPERATIONS = [
1511
3549
  path: "/v1/schedules/{scheduleId}/occurrences/{occurrenceId}/attempts/{attemptId}",
1512
3550
  principals: ["api-credential", "oauth", "session"],
1513
3551
  problems: ["invalid_request", "not_found"],
1514
- response: attemptViewSchema,
3552
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3553
+ ? API_UNUSED_RESPONSE_SCHEMA
3554
+ : attemptViewSchema,
1515
3555
  scopes: ["occurrences:read"],
1516
3556
  sessionAuthority: "headers",
1517
- summary: "Read a delivery attempt",
3557
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3558
+ ? ""
3559
+ : "Read a delivery attempt",
1518
3560
  surfaces: ["api", "mock"],
1519
3561
  },
1520
3562
  {
1521
3563
  creates: true,
1522
- 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.",
1523
- example: {
1524
- attempt: {
1525
- attemptNumber: 3,
1526
- delivery: "dlv_21h8xyz9k2m4n6p8r0t2v4w6y8",
1527
- id: "att_21h8xyz9k2m4n6p8r0t2v4w6y8",
1528
- occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1529
- startedAt: "2026-07-28T15:05:00.000Z",
1530
- trigger: {
1531
- kind: "redelivery",
1532
- sourceAttemptId: "att_11h8xyz9k2m4n6p8r0t2v4w6y8",
3564
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3565
+ ? ""
3566
+ : "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.",
3567
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3568
+ ? {}
3569
+ : {
3570
+ attempt: {
3571
+ attemptNumber: 3,
3572
+ dispatchRecoveries: 0,
3573
+ localReceiptRecoveries: 0,
3574
+ delivery: "dlv_21h8xyz9k2m4n6p8r0t2v4w6y8",
3575
+ id: "att_21h8xyz9k2m4n6p8r0t2v4w6y8",
3576
+ occurrence: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3577
+ startedAt: "2026-07-28T15:05:00.000Z",
3578
+ trigger: {
3579
+ kind: "redelivery",
3580
+ sourceAttemptId: "att_11h8xyz9k2m4n6p8r0t2v4w6y8",
3581
+ },
1533
3582
  },
3583
+ freshness: { kind: "authoritative" },
1534
3584
  },
1535
- freshness: { kind: "authoritative" },
1536
- },
1537
3585
  id: "occurrences.redeliver",
1538
3586
  idempotent: true,
1539
3587
  mcp: { destructive: false, kind: "tool", openWorld: true },
@@ -1549,39 +3597,50 @@ export const OPERATIONS = [
1549
3597
  "state_conflict",
1550
3598
  ],
1551
3599
  requestHeaders: requiredIdempotencyRequestHeaderSchema,
1552
- response: attemptViewSchema,
1553
- responseHeaders: idempotencyReplayResponseHeaderSchema,
3600
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3601
+ ? API_UNUSED_RESPONSE_SCHEMA
3602
+ : attemptViewSchema,
3603
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3604
+ ? {}
3605
+ : { responseHeaders: idempotencyReplayResponseHeaderSchema }),
1554
3606
  scopes: ["occurrences:redeliver"],
1555
3607
  sessionAuthority: "headers",
1556
- summary: "Redeliver an occurrence",
3608
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3609
+ ? ""
3610
+ : "Redeliver an occurrence",
1557
3611
  surfaces: ["api", "mock"],
1558
3612
  },
1559
3613
  {
1560
3614
  creates: false,
1561
- 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.",
1562
- example: {
1563
- occurrence: {
1564
- attemptCount: 0,
1565
- generation: 2,
1566
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y9",
1567
- plannedFor: "2026-07-28T16:00:00.000Z",
1568
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1569
- sequence: 1,
1570
- state: "planned",
1571
- },
1572
- schedule: {
1573
- createdAt: "2026-07-28T14:59:00.000Z",
1574
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1575
- generation: 2,
1576
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1577
- latencyClass: "realtime",
1578
- partitionKey: "campaign.spring",
1579
- recurrence: { kind: "at" },
1580
- status: "active",
1581
- updatedAt: "2026-07-28T15:10:00.000Z",
1582
- version: 2,
3615
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3616
+ ? ""
3617
+ : "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. `lateness` is resolved afresh against the replacement recurrence: omit it for that kind's default, or state `skipAhead`, `catchUp`, and an optional `maxStalenessSeconds` override. The policy applies only before an occurrence's first attempt; a retry already in progress remains on its retry and give-up ladder. 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.",
3618
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3619
+ ? {}
3620
+ : {
3621
+ occurrence: {
3622
+ attemptCount: 0,
3623
+ generation: 2,
3624
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y9",
3625
+ plannedFor: "2026-07-28T16:00:00.000Z",
3626
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3627
+ sequence: 1,
3628
+ state: "planned",
3629
+ },
3630
+ schedule: {
3631
+ createdAt: "2026-07-28T14:59:00.000Z",
3632
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
3633
+ generation: 2,
3634
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3635
+ latencyClass: "realtime",
3636
+ lateness: { policy: "catchUp" },
3637
+ partitionKey: "campaign.spring",
3638
+ recurrence: { kind: "at" },
3639
+ status: "active",
3640
+ updatedAt: "2026-07-28T15:10:00.000Z",
3641
+ version: 2,
3642
+ },
1583
3643
  },
1584
- },
1585
3644
  id: "schedules.replace",
1586
3645
  idempotent: true,
1587
3646
  // Destructive: the occurrence planned under the old definition is settled
@@ -1593,10 +3652,6 @@ export const OPERATIONS = [
1593
3652
  path: "/v1/schedules/{scheduleId}",
1594
3653
  principals: ["api-credential", "oauth", "session"],
1595
3654
  problems: [
1596
- // The same undeclared refusal `schedules.create` carried, for the same
1597
- // reason: a replacement may attach a different endpoint and resolves it
1598
- // through the same status rule.
1599
- "endpoint_unverified",
1600
3655
  "invalid_request",
1601
3656
  "not_found",
1602
3657
  // Only the payload ceiling can produce this here. A replacement adds no
@@ -1611,48 +3666,63 @@ export const OPERATIONS = [
1611
3666
  // The other arm of the same schema, deliberately: the create example shows
1612
3667
  // `at` and this one shows `delaySeconds`, so a reader of the published
1613
3668
  // document meets both ways of naming an instant.
1614
- requestExample: {
1615
- data: { report: "weekly" },
1616
- everySeconds: 86_400,
1617
- endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
1618
- partitionKey: "campaign.spring",
1619
- },
3669
+ requestExample: globalThis
3670
+ .GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3671
+ ? {}
3672
+ : {
3673
+ data: { report: "weekly" },
3674
+ everySeconds: 86_400,
3675
+ endpoint: "ep_01h8xyz9k2m4n6p8r0t2v4w6y8",
3676
+ lateness: { maxStalenessSeconds: 7_200, policy: "catchUp" },
3677
+ partitionKey: "campaign.spring",
3678
+ },
1620
3679
  requestHeaders: conditionalRequestHeaderSchema,
1621
- response: scheduleViewSchema,
1622
- responseHeaders: versionResponseHeaderSchema,
3680
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3681
+ ? API_UNUSED_RESPONSE_SCHEMA
3682
+ : scheduleViewSchema,
3683
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3684
+ ? {}
3685
+ : { responseHeaders: versionResponseHeaderSchema }),
1623
3686
  scopes: ["schedules:write"],
1624
3687
  sessionAuthority: "headers",
1625
- summary: "Replace a schedule",
1626
- surfaces: ["api", "mock"],
1627
- },
1628
- {
1629
- creates: false,
1630
- 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.",
1631
- example: {
1632
- occurrence: {
1633
- attemptCount: 0,
1634
- generation: 1,
1635
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1636
- plannedFor: "2026-07-28T15:00:00.000Z",
1637
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1638
- sequence: 1,
1639
- state: "planned",
1640
- },
1641
- schedule: {
1642
- createdAt: "2026-07-28T14:59:00.000Z",
1643
- generation: 1,
1644
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1645
- latencyClass: "realtime",
1646
- recurrence: { kind: "at" },
1647
- status: "paused",
1648
- updatedAt: "2026-07-28T15:10:00.000Z",
1649
- version: 2,
3688
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3689
+ ? ""
3690
+ : "Replace a schedule",
3691
+ surfaces: ["api", "mock"],
3692
+ },
3693
+ {
3694
+ creates: false,
3695
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3696
+ ? ""
3697
+ : "Suspends a schedule without discarding it: its occurrence stays planned, its timer is released, and resume re-arms the original planned instant rather than silently moving it. If that instant has passed, the schedule's lateness policy decides whether the first arrival becomes due or settles `skipped_stale`; a pause defers the decision, it does not promise delivery. 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.",
3698
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3699
+ ? {}
3700
+ : {
3701
+ occurrence: {
3702
+ attemptCount: 0,
3703
+ generation: 1,
3704
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3705
+ plannedFor: "2026-07-28T15:00:00.000Z",
3706
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3707
+ sequence: 1,
3708
+ state: "planned",
3709
+ },
3710
+ schedule: {
3711
+ createdAt: "2026-07-28T14:59:00.000Z",
3712
+ generation: 1,
3713
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3714
+ latencyClass: "realtime",
3715
+ lateness: { policy: "catchUp" },
3716
+ recurrence: { kind: "at" },
3717
+ status: "paused",
3718
+ updatedAt: "2026-07-28T15:10:00.000Z",
3719
+ version: 2,
3720
+ },
1650
3721
  },
1651
- },
1652
3722
  id: "schedules.pause",
1653
3723
  idempotent: true,
1654
3724
  // Not destructive: the occurrence stays planned and the timer stays armed.
1655
- // A pause defers work; resuming delivers it.
3725
+ // A pause defers the first-arrival decision; the lateness policy resolves it.
1656
3726
  mcp: { destructive: false, kind: "tool", openWorld: false },
1657
3727
  method: "POST",
1658
3728
  mutates: true,
@@ -1665,37 +3735,48 @@ export const OPERATIONS = [
1665
3735
  "version_conflict",
1666
3736
  ],
1667
3737
  requestHeaders: conditionalRequestHeaderSchema,
1668
- response: scheduleViewSchema,
1669
- responseHeaders: versionResponseHeaderSchema,
3738
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3739
+ ? API_UNUSED_RESPONSE_SCHEMA
3740
+ : scheduleViewSchema,
3741
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3742
+ ? {}
3743
+ : { responseHeaders: versionResponseHeaderSchema }),
1670
3744
  scopes: ["schedules:write"],
1671
3745
  sessionAuthority: "headers",
1672
- summary: "Pause a schedule",
3746
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3747
+ ? ""
3748
+ : "Pause a schedule",
1673
3749
  surfaces: ["api", "mock"],
1674
3750
  },
1675
3751
  {
1676
3752
  creates: false,
1677
- 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.",
1678
- example: {
1679
- occurrence: {
1680
- attemptCount: 0,
1681
- generation: 1,
1682
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1683
- plannedFor: "2026-07-28T15:00:00.000Z",
1684
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1685
- sequence: 1,
1686
- state: "planned",
1687
- },
1688
- schedule: {
1689
- createdAt: "2026-07-28T14:59:00.000Z",
1690
- generation: 1,
1691
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1692
- latencyClass: "realtime",
1693
- recurrence: { kind: "at" },
1694
- status: "active",
1695
- updatedAt: "2026-07-28T15:20:00.000Z",
1696
- version: 3,
3753
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3754
+ ? ""
3755
+ : "Returns a paused schedule to active and re-arms its original planned instant. When that instant passed during the pause, the schedule's lateness policy applies exactly as it does after an outage: `catchUp` makes an occurrence inside its window due, while `skipAhead` or an expired window settles it `skipped_stale`. An occurrence already on its retry ladder is exempt from this first-arrival decision. Resuming an already active schedule changes nothing and returns the same version.",
3756
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3757
+ ? {}
3758
+ : {
3759
+ occurrence: {
3760
+ attemptCount: 0,
3761
+ generation: 1,
3762
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3763
+ plannedFor: "2026-07-28T15:00:00.000Z",
3764
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3765
+ sequence: 1,
3766
+ state: "planned",
3767
+ },
3768
+ schedule: {
3769
+ createdAt: "2026-07-28T14:59:00.000Z",
3770
+ generation: 1,
3771
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3772
+ latencyClass: "realtime",
3773
+ lateness: { policy: "catchUp" },
3774
+ recurrence: { kind: "at" },
3775
+ status: "active",
3776
+ updatedAt: "2026-07-28T15:20:00.000Z",
3777
+ version: 3,
3778
+ },
1697
3779
  },
1698
- },
1699
3780
  id: "schedules.resume",
1700
3781
  idempotent: true,
1701
3782
  mcp: { destructive: false, kind: "tool", openWorld: false },
@@ -1710,38 +3791,49 @@ export const OPERATIONS = [
1710
3791
  "version_conflict",
1711
3792
  ],
1712
3793
  requestHeaders: conditionalRequestHeaderSchema,
1713
- response: scheduleViewSchema,
1714
- responseHeaders: versionResponseHeaderSchema,
3794
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3795
+ ? API_UNUSED_RESPONSE_SCHEMA
3796
+ : scheduleViewSchema,
3797
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3798
+ ? {}
3799
+ : { responseHeaders: versionResponseHeaderSchema }),
1715
3800
  scopes: ["schedules:write"],
1716
3801
  sessionAuthority: "headers",
1717
- summary: "Resume a schedule",
1718
- surfaces: ["api", "mock"],
1719
- },
1720
- {
1721
- creates: false,
1722
- 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.",
1723
- example: {
1724
- occurrence: {
1725
- attemptCount: 0,
1726
- generation: 1,
1727
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1728
- plannedFor: "2026-07-28T15:00:00.000Z",
1729
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1730
- sequence: 1,
1731
- settledAt: "2026-07-28T15:10:00.000Z",
1732
- state: "cancelled",
1733
- },
1734
- schedule: {
1735
- createdAt: "2026-07-28T14:59:00.000Z",
1736
- generation: 1,
1737
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1738
- latencyClass: "realtime",
1739
- recurrence: { kind: "at" },
1740
- status: "cancelled",
1741
- updatedAt: "2026-07-28T15:10:00.000Z",
1742
- version: 2,
3802
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3803
+ ? ""
3804
+ : "Resume a schedule",
3805
+ surfaces: ["api", "mock"],
3806
+ },
3807
+ {
3808
+ creates: false,
3809
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3810
+ ? ""
3811
+ : "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.",
3812
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3813
+ ? {}
3814
+ : {
3815
+ occurrence: {
3816
+ attemptCount: 0,
3817
+ generation: 1,
3818
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3819
+ plannedFor: "2026-07-28T15:00:00.000Z",
3820
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3821
+ sequence: 1,
3822
+ settledAt: "2026-07-28T15:10:00.000Z",
3823
+ state: "cancelled",
3824
+ },
3825
+ schedule: {
3826
+ createdAt: "2026-07-28T14:59:00.000Z",
3827
+ generation: 1,
3828
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3829
+ latencyClass: "realtime",
3830
+ lateness: { policy: "catchUp" },
3831
+ recurrence: { kind: "at" },
3832
+ status: "cancelled",
3833
+ updatedAt: "2026-07-28T15:10:00.000Z",
3834
+ version: 2,
3835
+ },
1743
3836
  },
1744
- },
1745
3837
  id: "schedules.cancel",
1746
3838
  idempotent: true,
1747
3839
  // Destructive and terminal: the occurrence settles `cancelled`, no work is
@@ -1758,39 +3850,50 @@ export const OPERATIONS = [
1758
3850
  "version_conflict",
1759
3851
  ],
1760
3852
  requestHeaders: conditionalRequestHeaderSchema,
1761
- response: scheduleViewSchema,
1762
- responseHeaders: versionResponseHeaderSchema,
3853
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3854
+ ? API_UNUSED_RESPONSE_SCHEMA
3855
+ : scheduleViewSchema,
3856
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3857
+ ? {}
3858
+ : { responseHeaders: versionResponseHeaderSchema }),
1763
3859
  scopes: ["schedules:write"],
1764
3860
  sessionAuthority: "headers",
1765
- summary: "Cancel a schedule",
1766
- surfaces: ["api", "mock"],
1767
- },
1768
- {
1769
- creates: false,
1770
- 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.",
1771
- example: {
1772
- occurrence: {
1773
- attemptCount: 0,
1774
- generation: 1,
1775
- id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
1776
- plannedFor: "2026-07-28T15:00:00.000Z",
1777
- schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1778
- sequence: 1,
1779
- settledAt: "2026-07-28T15:10:00.000Z",
1780
- state: "cancelled",
1781
- },
1782
- schedule: {
1783
- archivedAt: "2026-07-28T15:30:00.000Z",
1784
- createdAt: "2026-07-28T14:59:00.000Z",
1785
- generation: 1,
1786
- id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
1787
- latencyClass: "realtime",
1788
- recurrence: { kind: "at" },
1789
- status: "cancelled",
1790
- updatedAt: "2026-07-28T15:30:00.000Z",
1791
- version: 3,
3861
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3862
+ ? ""
3863
+ : "Cancel a schedule",
3864
+ surfaces: ["api", "mock"],
3865
+ },
3866
+ {
3867
+ creates: false,
3868
+ description: globalThis.GREATWAIT_RUNTIME_CONTRACTS_ONLY
3869
+ ? ""
3870
+ : "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.",
3871
+ example: globalThis.GREATWAIT_RUNTIME_WITHOUT_EXAMPLES
3872
+ ? {}
3873
+ : {
3874
+ occurrence: {
3875
+ attemptCount: 0,
3876
+ generation: 1,
3877
+ id: "occ_01h8xyz9k2m4n6p8r0t2v4w6y8",
3878
+ plannedFor: "2026-07-28T15:00:00.000Z",
3879
+ schedule: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3880
+ sequence: 1,
3881
+ settledAt: "2026-07-28T15:10:00.000Z",
3882
+ state: "cancelled",
3883
+ },
3884
+ schedule: {
3885
+ archivedAt: "2026-07-28T15:30:00.000Z",
3886
+ createdAt: "2026-07-28T14:59:00.000Z",
3887
+ generation: 1,
3888
+ id: "sch_01h8xyz9k2m4n6p8r0t2v4w6y8",
3889
+ latencyClass: "realtime",
3890
+ lateness: { policy: "catchUp" },
3891
+ recurrence: { kind: "at" },
3892
+ status: "cancelled",
3893
+ updatedAt: "2026-07-28T15:30:00.000Z",
3894
+ version: 3,
3895
+ },
1792
3896
  },
1793
- },
1794
3897
  id: "schedules.archive",
1795
3898
  idempotent: true,
1796
3899
  // Not destructive: archiving is filing. The schedule stays readable by
@@ -1808,11 +3911,17 @@ export const OPERATIONS = [
1808
3911
  "version_conflict",
1809
3912
  ],
1810
3913
  requestHeaders: conditionalRequestHeaderSchema,
1811
- response: scheduleViewSchema,
1812
- responseHeaders: versionResponseHeaderSchema,
3914
+ response: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3915
+ ? API_UNUSED_RESPONSE_SCHEMA
3916
+ : scheduleViewSchema,
3917
+ ...(globalThis.GREATWAIT_API_REQUEST_REGISTRY
3918
+ ? {}
3919
+ : { responseHeaders: versionResponseHeaderSchema }),
1813
3920
  scopes: ["schedules:write"],
1814
3921
  sessionAuthority: "headers",
1815
- summary: "Archive a schedule",
3922
+ summary: globalThis.GREATWAIT_API_REQUEST_REGISTRY
3923
+ ? ""
3924
+ : "Archive a schedule",
1816
3925
  surfaces: ["api", "mock"],
1817
3926
  },
1818
3927
  ];
@@ -1894,6 +4003,16 @@ export function successStatusFor(operation) {
1894
4003
  * so an operation's own `problems` list stays about that operation.
1895
4004
  */
1896
4005
  export const UNIVERSAL_PROBLEMS = [
4006
+ // **Universal rather than per-operation, because its earliest raise sites
4007
+ // are before any operation exists.** Request admission runs as pre-route
4008
+ // middleware on every `/v1/*`, `/oauth/*` and `/mcp` path, and the Worker
4009
+ // refuses an unconfigured PostgreSQL authority before it builds an app at
4010
+ // all. Declaring it operation by operation would leave the published
4011
+ // contract, the mock and the SDK telling an integrator that a 503 on those
4012
+ // paths can only be `service_unavailable` — which is the mistake a review
4013
+ // round caught when `billing_not_ready` was declared on one of its two
4014
+ // operations and not the other.
4015
+ "capability_not_configured",
1897
4016
  "rate_limited",
1898
4017
  "service_unavailable",
1899
4018
  ];
@@ -1927,6 +4046,16 @@ export const AUTHENTICATED_PROBLEMS = [
1927
4046
  * operation could ever produce.
1928
4047
  */
1929
4048
  export const SCOPED_PROBLEMS = ["scope_missing"];
4049
+ /** Whether an authenticated operation needs a project that accepts work. */
4050
+ function canMeetArchivedProject(operation) {
4051
+ if (operation.principals.length === 0)
4052
+ return false;
4053
+ if (operation.sessionAuthority === "organization" ||
4054
+ operation.sessionAuthority === "member") {
4055
+ return false;
4056
+ }
4057
+ return !["projects.archive", "projects.delete", "projects.rename"].includes(operation.id);
4058
+ }
1930
4059
  export function problemsFor(operation) {
1931
4060
  return [
1932
4061
  ...new Set([
@@ -1934,6 +4063,9 @@ export function problemsFor(operation) {
1934
4063
  ...UNIVERSAL_PROBLEMS,
1935
4064
  ...(operation.principals.length > 0 ? AUTHENTICATED_PROBLEMS : []),
1936
4065
  ...(operation.scopes.length > 0 ? SCOPED_PROBLEMS : []),
4066
+ ...(canMeetArchivedProject(operation)
4067
+ ? ["project_archived"]
4068
+ : []),
1937
4069
  ]),
1938
4070
  ].sort();
1939
4071
  }