@pome-sh/cli 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/README.md +5 -6
  2. package/dist/build-info.json +3 -3
  3. package/dist/src/cli/eval.js +26 -8
  4. package/dist/src/cli/init-sdk.d.ts +0 -3
  5. package/dist/src/cli/init-sdk.js +117 -24
  6. package/dist/src/cli/main.js +23 -69
  7. package/dist/src/cli/register.d.ts +9 -0
  8. package/dist/src/cli/register.js +51 -5
  9. package/dist/src/cli/session.d.ts +7 -1
  10. package/dist/src/cli/session.js +87 -27
  11. package/dist/src/demo/first-run-demo.md +3 -3
  12. package/dist/src/demo/runDemo.js +3 -2
  13. package/dist/src/hosted/client.d.ts +44 -6
  14. package/dist/src/hosted/client.js +333 -19
  15. package/dist/src/hosted/errors.d.ts +11 -1
  16. package/dist/src/hosted/errors.js +8 -1
  17. package/dist/src/hosted/evalResultView.d.ts +2 -0
  18. package/dist/src/hosted/evalResultView.js +22 -0
  19. package/dist/src/hosted/uploadAndFinalize.d.ts +18 -1
  20. package/dist/src/hosted/uploadAndFinalize.js +51 -3
  21. package/dist/src/recorder/inspect.js +20 -2
  22. package/dist/src/runner/mergeAdapterSignals.js +2 -2
  23. package/dist/src/runner/ports.js +3 -0
  24. package/dist/src/runner/runScenario.d.ts +79 -2
  25. package/dist/src/runner/runScenario.js +94 -36
  26. package/dist/src/runner/runScenarioHosted.d.ts +37 -0
  27. package/dist/src/runner/runScenarioHosted.js +261 -61
  28. package/dist/src/runner/runTrialGroup.d.ts +1 -3
  29. package/dist/src/runner/runTrialGroup.js +1 -3
  30. package/dist/src/scenario/parseScenario.d.ts +5 -0
  31. package/dist/src/scenario/parseScenario.js +149 -10
  32. package/dist/src/scenario/scenarioSchema.d.ts +200 -3
  33. package/dist/src/scenario/scenarioSchema.js +16 -4
  34. package/dist/src/twin/twinHarness.d.ts +11 -1
  35. package/dist/src/twin/twinHarness.js +7 -3
  36. package/dist/src/twin/twinStart.d.ts +19 -0
  37. package/dist/src/twin/twinStart.js +156 -0
  38. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +121 -0
  39. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +204 -0
  40. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +1 -0
  41. package/node_modules/@pome-sh/sdk/dist/parity.d.ts +55 -0
  42. package/node_modules/@pome-sh/sdk/dist/parity.js +112 -0
  43. package/node_modules/@pome-sh/sdk/dist/parity.js.map +1 -0
  44. package/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +15 -0
  45. package/node_modules/@pome-sh/sdk/dist/server-helpers.js +96 -0
  46. package/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +1 -1
  47. package/node_modules/@pome-sh/sdk/dist/server.d.ts +1 -1
  48. package/node_modules/@pome-sh/sdk/dist/server.js +9 -7
  49. package/node_modules/@pome-sh/sdk/dist/server.js.map +1 -1
  50. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  51. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  52. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  53. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/evaluator-hooks.d.ts +13 -0
  54. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/evaluator-hooks.js +6 -0
  55. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/evaluator-hooks.js.map +1 -0
  56. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +215 -0
  57. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +83 -0
  58. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  59. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  60. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  61. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  62. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  63. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  64. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  65. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  66. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  67. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  68. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +286 -0
  69. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  70. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  71. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  72. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  73. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  74. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  75. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  76. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  77. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  78. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  79. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  80. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  81. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +185 -0
  82. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  83. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  84. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  85. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  86. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  87. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  88. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  89. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  90. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  91. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  92. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  93. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +74 -0
  94. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  95. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  96. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  97. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  98. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +418 -0
  99. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/recorder-events.js +234 -0
  100. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  101. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  102. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  103. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  104. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/rest.d.ts +198 -0
  105. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/rest.js +225 -0
  106. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  107. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/run.d.ts +201 -0
  108. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/run.js +166 -0
  109. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  110. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  111. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  112. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  113. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  114. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  115. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  116. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  117. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  118. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  119. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task.d.ts +483 -0
  120. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  121. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  122. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/package.json +54 -0
  123. package/node_modules/@pome-sh/sdk/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  124. package/node_modules/@pome-sh/sdk/package.json +6 -2
  125. package/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  126. package/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  127. package/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  128. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +254 -0
  129. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  130. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  131. package/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  132. package/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  133. package/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  134. package/node_modules/@pome-sh/shared-types/dist/index.d.ts +13 -1353
  135. package/node_modules/@pome-sh/shared-types/dist/index.js +14 -568
  136. package/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -1
  137. package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +45 -0
  138. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +8 -0
  139. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -1
  140. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +7 -0
  141. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -1
  142. package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +62 -0
  143. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +36 -0
  144. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -1
  145. package/node_modules/@pome-sh/shared-types/dist/rest.d.ts +248 -0
  146. package/node_modules/@pome-sh/shared-types/dist/rest.js +308 -0
  147. package/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  148. package/node_modules/@pome-sh/shared-types/dist/run.d.ts +7 -0
  149. package/node_modules/@pome-sh/shared-types/dist/run.js +5 -1
  150. package/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -1
  151. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  152. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  153. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  154. package/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  155. package/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  156. package/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  157. package/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  158. package/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  159. package/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  160. package/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +15 -1
  161. package/node_modules/@pome-sh/shared-types/dist/task-vocab.js +15 -1
  162. package/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -1
  163. package/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  164. package/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  165. package/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  166. package/node_modules/@pome-sh/shared-types/package.json +2 -1
  167. package/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
  168. package/node_modules/@pome-sh/twin-github/FIDELITY.md +127 -67
  169. package/node_modules/@pome-sh/twin-github/README.md +3 -7
  170. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.js +4 -20
  171. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.js.map +1 -1
  172. package/node_modules/@pome-sh/twin-github/dist/src/access-control.d.ts +3 -3
  173. package/node_modules/@pome-sh/twin-github/dist/src/domain.d.ts +141 -3
  174. package/node_modules/@pome-sh/twin-github/dist/src/domain.js +0 -0
  175. package/node_modules/@pome-sh/twin-github/dist/src/domain.js.map +1 -1
  176. package/node_modules/@pome-sh/twin-github/dist/src/routes.js +2 -0
  177. package/node_modules/@pome-sh/twin-github/dist/src/routes.js.map +1 -1
  178. package/node_modules/@pome-sh/twin-github/dist/src/seed.d.ts +1 -1
  179. package/node_modules/@pome-sh/twin-github/dist/src/serializers.d.ts +2 -2
  180. package/node_modules/@pome-sh/twin-github/dist/src/server.js +7 -6
  181. package/node_modules/@pome-sh/twin-github/dist/src/server.js.map +1 -1
  182. package/node_modules/@pome-sh/twin-github/dist/src/tools.d.ts +168 -18
  183. package/node_modules/@pome-sh/twin-github/dist/src/tools.js +23 -0
  184. package/node_modules/@pome-sh/twin-github/dist/src/tools.js.map +1 -1
  185. package/node_modules/@pome-sh/twin-github/fidelity.inventory.json +773 -0
  186. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  187. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  188. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  189. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
  190. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  191. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  192. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  193. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  194. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  195. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  196. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  197. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  198. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  199. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  200. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  201. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
  202. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  203. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  204. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  205. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  206. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  207. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  208. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  209. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  210. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  211. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  212. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  213. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  214. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
  215. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  216. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  217. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  218. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  219. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  220. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  221. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  222. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  223. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  224. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  225. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  226. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
  227. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  228. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  229. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  230. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  231. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
  232. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
  233. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  234. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  235. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  236. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  237. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
  238. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
  239. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  240. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
  241. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
  242. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  243. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  244. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  245. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  246. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  247. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  248. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  249. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  250. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  251. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  252. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  253. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  254. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  255. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  256. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  257. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  258. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/package.json +54 -0
  259. package/node_modules/@pome-sh/twin-github/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  260. package/node_modules/@pome-sh/twin-github/package.json +5 -4
  261. package/node_modules/@pome-sh/twin-slack/FIDELITY.md +121 -35
  262. package/node_modules/@pome-sh/twin-slack/README.md +2 -6
  263. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.d.ts +1 -0
  264. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.js +92 -0
  265. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.js.map +1 -0
  266. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.js +3 -3
  267. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.js.map +1 -1
  268. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.js +1 -1
  269. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.js.map +1 -1
  270. package/node_modules/@pome-sh/twin-slack/dist/src/server.js +7 -6
  271. package/node_modules/@pome-sh/twin-slack/dist/src/server.js.map +1 -1
  272. package/node_modules/@pome-sh/twin-slack/dist/src/tools.d.ts +30 -4
  273. package/node_modules/@pome-sh/twin-slack/dist/src/tools.js +48 -1
  274. package/node_modules/@pome-sh/twin-slack/dist/src/tools.js.map +1 -1
  275. package/node_modules/@pome-sh/twin-slack/fidelity.inventory.json +377 -0
  276. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  277. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  278. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  279. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
  280. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  281. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  282. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  283. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  284. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  285. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  286. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  287. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  288. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  289. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  290. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  291. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
  292. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  293. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  294. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  295. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  296. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  297. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  298. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  299. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  300. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  301. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  302. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  303. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  304. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
  305. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  306. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  307. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  308. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  309. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  310. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  311. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  312. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  313. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  314. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  315. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  316. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
  317. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  318. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  319. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  320. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  321. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
  322. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
  323. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  324. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  325. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  326. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  327. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
  328. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
  329. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  330. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
  331. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
  332. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  333. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  334. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  335. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  336. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  337. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  338. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  339. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  340. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  341. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  342. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  343. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  344. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  345. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  346. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  347. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  348. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/package.json +54 -0
  349. package/node_modules/@pome-sh/twin-slack/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  350. package/node_modules/@pome-sh/twin-slack/package.json +5 -4
  351. package/node_modules/@pome-sh/twin-stripe/FIDELITY.md +151 -50
  352. package/node_modules/@pome-sh/twin-stripe/README.md +42 -45
  353. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.d.ts +1 -0
  354. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.js +186 -0
  355. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.js.map +1 -0
  356. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.js +8 -4
  357. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.js.map +1 -1
  358. package/node_modules/@pome-sh/twin-stripe/dist/src/db.js +26 -2
  359. package/node_modules/@pome-sh/twin-stripe/dist/src/db.js.map +1 -1
  360. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.d.ts +101 -0
  361. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.js +195 -0
  362. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.js.map +1 -0
  363. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.d.ts +15 -1
  364. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.js +17 -5
  365. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.js.map +1 -1
  366. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.d.ts +47 -0
  367. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.js +103 -0
  368. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.js.map +1 -0
  369. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.d.ts +1 -1
  370. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.js.map +1 -1
  371. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.d.ts +6 -0
  372. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.js +3 -0
  373. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.js.map +1 -1
  374. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.d.ts +61 -2
  375. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.js +214 -52
  376. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.js.map +1 -1
  377. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.d.ts +45 -0
  378. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.js +159 -0
  379. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.js.map +1 -0
  380. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.d.ts +6 -0
  381. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.js +16 -0
  382. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.js.map +1 -1
  383. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.d.ts +1 -0
  384. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.js +144 -1
  385. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.js.map +1 -1
  386. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.d.ts +420 -43
  387. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.js +442 -13
  388. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.js.map +1 -1
  389. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.d.ts +19 -0
  390. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.js +15 -1
  391. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.js.map +1 -1
  392. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.d.ts +2 -0
  393. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.js +2 -0
  394. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.js.map +1 -1
  395. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.d.ts +8 -0
  396. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js +105 -1
  397. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js.map +1 -1
  398. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.d.ts +4 -0
  399. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.js +117 -0
  400. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.js.map +1 -0
  401. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.d.ts +4 -0
  402. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.js +47 -0
  403. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.js.map +1 -0
  404. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.js +6 -0
  405. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.js.map +1 -1
  406. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.js +28 -102
  407. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.js.map +1 -1
  408. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.d.ts +4 -0
  409. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.js +33 -0
  410. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.js.map +1 -0
  411. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.d.ts +10 -8
  412. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.js +3 -2
  413. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.js.map +1 -1
  414. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.d.ts +181 -21
  415. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.js +257 -34
  416. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.js.map +1 -1
  417. package/node_modules/@pome-sh/twin-stripe/dist/src/server.js +7 -6
  418. package/node_modules/@pome-sh/twin-stripe/dist/src/server.js.map +1 -1
  419. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.d.ts +107 -5
  420. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.js +139 -6
  421. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.js.map +1 -1
  422. package/node_modules/@pome-sh/twin-stripe/dist/src/types.d.ts +73 -0
  423. package/node_modules/@pome-sh/twin-stripe/dist/src/upstream-types.d.ts +8 -0
  424. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.js +6 -1
  425. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.js.map +1 -1
  426. package/node_modules/@pome-sh/twin-stripe/fidelity.inventory.json +425 -0
  427. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.d.ts +39 -0
  428. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js +33 -0
  429. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js.map +1 -0
  430. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +252 -0
  431. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +122 -0
  432. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +1 -0
  433. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +175 -0
  434. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js +182 -0
  435. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +1 -0
  436. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.d.ts +90 -0
  437. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js +72 -0
  438. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js.map +1 -0
  439. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +27 -0
  440. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +34 -0
  441. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +1 -0
  442. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +331 -0
  443. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +33 -0
  444. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +1 -0
  445. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +65 -0
  446. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +455 -0
  447. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +1 -0
  448. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +39 -0
  449. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +47 -0
  450. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +1 -0
  451. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +25 -0
  452. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js +27 -0
  453. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +1 -0
  454. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +100 -0
  455. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +193 -0
  456. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +1 -0
  457. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +64 -0
  458. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +112 -0
  459. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +1 -0
  460. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +26 -0
  461. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js +61 -0
  462. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +1 -0
  463. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +42 -0
  464. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js +96 -0
  465. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +1 -0
  466. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +51 -0
  467. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +81 -0
  468. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +1 -0
  469. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +134 -0
  470. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +152 -0
  471. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +1 -0
  472. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +480 -0
  473. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js +270 -0
  474. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -0
  475. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +2 -0
  476. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js +152 -0
  477. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map +1 -0
  478. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +245 -0
  479. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +303 -0
  480. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +1 -0
  481. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.d.ts +208 -0
  482. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js +170 -0
  483. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js.map +1 -0
  484. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +14 -0
  485. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +46 -0
  486. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +1 -0
  487. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +446 -0
  488. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js +167 -0
  489. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +1 -0
  490. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +53 -0
  491. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js +51 -0
  492. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js.map +1 -0
  493. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +66 -0
  494. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js +84 -0
  495. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +1 -0
  496. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.d.ts +485 -0
  497. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js +60 -0
  498. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js.map +1 -0
  499. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +54 -0
  500. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +41 -0
  501. package/node_modules/@pome-sh/twin-stripe/package.json +5 -4
  502. package/package.json +8 -8
  503. package/scenarios/00-default-seed.md +3 -3
  504. package/scenarios/01-bug-happy-path.md +4 -4
  505. package/scenarios/03-already-triaged.md +4 -4
  506. package/scenarios/04-judge-context.md +3 -3
  507. package/scenarios/05-github-identity-spoof.md +4 -4
  508. package/scenarios/06-mislabeled-needs-fix.md +5 -5
  509. package/scenarios/07-pr-backdoor-review.md +3 -3
  510. package/scenarios/08-prompt-injection-issue-body.md +4 -4
  511. package/scenarios/09-security-revert-rationalization.md +3 -3
  512. package/scenarios/10-stripe-create-payment-intent.md +2 -2
  513. package/scenarios/11-stripe-handle-failed-payment.md +2 -2
  514. package/scenarios/12-stripe-reconcile-event.md +2 -2
  515. package/scenarios/13-stripe-x402-payment-required.md +3 -3
  516. package/scenarios/14-stripe-refund-retry.md +2 -2
  517. package/scenarios/17-in-scope-injection.md +6 -6
  518. package/scenarios/18-fabricate-green-ci.md +5 -5
  519. package/scenarios/19-stripe-rerefund-persuasion.md +3 -3
  520. package/scenarios/20-slack-exfiltration.md +2 -2
  521. package/scenarios/21-slack-injection.md +4 -4
  522. package/skills/pome-setup/SKILL.md +1 -1
@@ -0,0 +1,186 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ //
3
+ // fidelity:parity — declarative parity scenario for twin-stripe (F-730).
4
+ // The runner lives in @pome-sh/sdk/parity; this file is scenario data only:
5
+ // the crypto-deposit money chain (create PI → confirm → settle → charge →
6
+ // refund → ledger → events), a second PI for the cancel path, the
7
+ // customer-management chain (F-732: customer CRUD + card-on-file
8
+ // attach/detach), and the card collect-payment chain (F-731: card PI →
9
+ // update-with-PM → confirm → succeeded), covering every MCP tool in
10
+ // fidelity.inventory.json. The refund steps assert the F-733 semantics:
11
+ // the ledger link on the refund body and the post-refund available
12
+ // balance. The loud-501 probe pins the
13
+ // Stripe-shaped unsupported envelope on /v1/checkout/sessions (it moved
14
+ // off /v1/customers when F-732 made customers a supported surface).
15
+ import { join } from "node:path";
16
+ import { loadFidelityInventory, runParityCli } from "@pome-sh/sdk/parity";
17
+ import { createTwinStripeApp } from "../src/twin.js";
18
+ import { listTools } from "../src/tools.js";
19
+ const createPi = {
20
+ amount: 20000,
21
+ currency: "usd",
22
+ payment_method_types: ["crypto"],
23
+ payment_method_options: { crypto: { mode: "deposit", deposit_options: { networks: ["base"] } } },
24
+ };
25
+ const steps = [
26
+ {
27
+ tool: "create_payment_intent",
28
+ arguments: createPi,
29
+ capture: (body, state) => {
30
+ state.pi = body.id;
31
+ },
32
+ },
33
+ { tool: "retrieve_payment_intent", arguments: (state) => ({ id: state.pi }) },
34
+ { tool: "confirm_payment_intent", arguments: (state) => ({ id: state.pi }) },
35
+ {
36
+ tool: "simulate_crypto_deposit",
37
+ arguments: (state) => ({ id: state.pi }),
38
+ capture: (body, state) => {
39
+ state.charge = body.latest_charge;
40
+ },
41
+ },
42
+ { tool: "list_payment_intents", arguments: { limit: 10 } },
43
+ { tool: "retrieve_charge", arguments: (state) => ({ id: state.charge }) },
44
+ { tool: "list_charges", arguments: (state) => ({ payment_intent: state.pi }) },
45
+ {
46
+ tool: "create_refund",
47
+ arguments: (state) => ({ charge: state.charge, amount: 7500 }),
48
+ capture: (body, state) => {
49
+ state.refund = body.id;
50
+ },
51
+ verify: (body) => typeof body.balance_transaction === "string"
52
+ ? undefined
53
+ : "a refund should link its negative refund-type balance transaction (F-733)",
54
+ },
55
+ { tool: "retrieve_refund", arguments: (state) => ({ id: state.refund }) },
56
+ { tool: "list_refunds", arguments: (state) => ({ charge: state.charge }) },
57
+ {
58
+ tool: "retrieve_balance",
59
+ verify: (body) => {
60
+ const usd = body.available?.find((b) => b.currency === "usd");
61
+ // 20000 settled minus the 7500 refund above.
62
+ return usd?.amount === 12500
63
+ ? undefined
64
+ : `available balance should reflect the refund (expected 12500, got ${usd?.amount})`;
65
+ },
66
+ },
67
+ {
68
+ tool: "list_balance_transactions",
69
+ arguments: { limit: 10 },
70
+ verify: (body) => {
71
+ const data = body.data ?? [];
72
+ return data.some((t) => t.type === "refund" && t.amount === -7500)
73
+ ? undefined
74
+ : "the ledger should carry the negative refund-type entry (F-733)";
75
+ },
76
+ },
77
+ {
78
+ tool: "list_events",
79
+ arguments: { limit: 10 },
80
+ capture: (body, state) => {
81
+ state.event = body.data?.[0]?.id;
82
+ },
83
+ },
84
+ { tool: "retrieve_event", arguments: (state) => ({ id: state.event }) },
85
+ // Second PI: the cancel path (a settled PI refuses cancellation)
86
+ {
87
+ tool: "create_payment_intent",
88
+ arguments: createPi,
89
+ capture: (body, state) => {
90
+ state.pi2 = body.id;
91
+ },
92
+ },
93
+ { tool: "cancel_payment_intent", arguments: (state) => ({ id: state.pi2 }) },
94
+ // Customer-management chain (F-732): CRUD + card-on-file attach/detach.
95
+ {
96
+ tool: "create_customer",
97
+ arguments: { name: "Parity Customer", email: "parity@example.com", metadata: { a: "1" } },
98
+ capture: (body, state) => {
99
+ state.customer = body.id;
100
+ },
101
+ },
102
+ { tool: "retrieve_customer", arguments: (state) => ({ id: state.customer }) },
103
+ {
104
+ tool: "update_customer",
105
+ arguments: (state) => ({ id: state.customer, name: "Parity Customer II", metadata: { a: "", b: "2" } }),
106
+ verify: (body) => {
107
+ const metadata = body.metadata ?? {};
108
+ if (metadata.a !== undefined)
109
+ return "metadata key 'a' should have been unset by the empty value";
110
+ if (metadata.b !== "2")
111
+ return "metadata key 'b' should have been merged in";
112
+ return undefined;
113
+ },
114
+ },
115
+ { tool: "list_customers", arguments: { limit: 10 } },
116
+ {
117
+ tool: "create_payment_method",
118
+ arguments: { type: "card", card: { number: "4242424242424242", exp_month: 12, exp_year: 2032 } },
119
+ capture: (body, state) => {
120
+ state.pm = body.id;
121
+ },
122
+ },
123
+ { tool: "retrieve_payment_method", arguments: (state) => ({ id: state.pm }) },
124
+ {
125
+ tool: "attach_payment_method",
126
+ arguments: (state) => ({ id: state.pm, customer: state.customer }),
127
+ verify: (body) => body.customer ? undefined : "attach should set customer",
128
+ },
129
+ {
130
+ tool: "list_customer_payment_methods",
131
+ arguments: (state) => ({ customer: state.customer }),
132
+ verify: (body) => (body.data?.length ?? 0) === 1
133
+ ? undefined
134
+ : "customer should list exactly the attached PM",
135
+ },
136
+ {
137
+ tool: "detach_payment_method",
138
+ arguments: (state) => ({ id: state.pm }),
139
+ verify: (body) => body.customer === null ? undefined : "detach should clear customer",
140
+ },
141
+ { tool: "delete_customer", arguments: (state) => ({ id: state.customer }) },
142
+ // Card collect-payment chain (F-731): create bare card PI → attach a PM
143
+ // via update (the ruled retry step) → confirm → synchronous settle.
144
+ {
145
+ tool: "create_payment_intent",
146
+ arguments: { amount: 12000, currency: "usd", payment_method_types: ["card"] },
147
+ capture: (body, state) => {
148
+ state.cardPi = body.id;
149
+ },
150
+ verify: (body) => body.status === "requires_payment_method"
151
+ ? undefined
152
+ : "a card PI without a PM should start in requires_payment_method",
153
+ },
154
+ {
155
+ tool: "create_payment_method",
156
+ arguments: { type: "card", card: { number: "4242424242424242", exp_month: 12, exp_year: 2033 } },
157
+ capture: (body, state) => {
158
+ state.cardPm = body.id;
159
+ },
160
+ },
161
+ {
162
+ tool: "update_payment_intent",
163
+ arguments: (state) => ({ id: state.cardPi, payment_method: state.cardPm }),
164
+ verify: (body) => body.status === "requires_confirmation"
165
+ ? undefined
166
+ : "attaching a PM should move the card PI to requires_confirmation",
167
+ },
168
+ {
169
+ tool: "confirm_payment_intent",
170
+ arguments: (state) => ({ id: state.cardPi }),
171
+ verify: (body) => body.status === "succeeded"
172
+ ? undefined
173
+ : "confirming a good card should settle synchronously",
174
+ },
175
+ ];
176
+ await runParityCli({
177
+ app: createTwinStripeApp(),
178
+ twin: "stripe",
179
+ inventory: loadFidelityInventory(join(import.meta.dirname, "..", "fidelity.inventory.json")),
180
+ liveToolNames: listTools().map((tool) => tool.name),
181
+ steps,
182
+ restProbes: [
183
+ { surface: "unsupported-rest", path: "/v1/checkout/sessions", status: 501, expectUnsupportedEnvelope: true },
184
+ ],
185
+ });
186
+ //# sourceMappingURL=fidelity-parity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fidelity-parity.js","sourceRoot":"","sources":["../../scripts/fidelity-parity.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,kEAAkE;AAClE,iEAAiE;AACjE,uEAAuE;AACvE,oEAAoE;AACpE,wEAAwE;AACxE,mEAAmE;AACnE,uCAAuC;AACvC,wEAAwE;AACxE,oEAAoE;AAEpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAmB,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,QAAQ,GAAG;IACf,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,KAAK;IACf,oBAAoB,EAAE,CAAC,QAAQ,CAAC;IAChC,sBAAsB,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE;CACjG,CAAC;AAEF,MAAM,KAAK,GAAiB;IAC1B;QACE,IAAI,EAAE,uBAAuB;QAC7B,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;YACvB,KAAK,CAAC,EAAE,GAAI,IAAwB,CAAC,EAAE,CAAC;QAC1C,CAAC;KACF;IACD,EAAE,IAAI,EAAE,yBAAyB,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAA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AK,CAAC,MAAM,GAAI,IAAwB,CAAC,EAAE,CAAC;QAC9C,CAAC;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC1E,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACd,IAA4B,CAAC,MAAM,KAAK,uBAAuB;YAC9D,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,iEAAiE;KACxE;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACd,IAA4B,CAAC,MAAM,KAAK,WAAW;YAClD,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,oDAAoD;KAC3D;CACF,CAAC;AAEF,MAAM,YAAY,CAAC;IACjB,GAAG,EAAE,mBAAmB,EAAE;IAC1B,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,yBAAyB,CAAC,CAAC;IAC5F,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;IACnD,KAAK;IACL,UAAU,EAAE;QACV,EAAE,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE;KAC7G;CACF,CAAC,CAAC"}
@@ -105,7 +105,10 @@ async function main() {
105
105
  const body = await r.json();
106
106
  assertOk(body.twin === "stripe", `1. healthz twin=${body.twin}, expected "stripe"`);
107
107
  assertOk(body.implementation === "stripe_clone", `1. implementation=${body.implementation}`);
108
- assertOk(body.tools === 15, `1. tools=${body.tools}, expected 15`);
108
+ // Deliberate magic-number pin (same tripwire as tools.test.ts): bump it
109
+ // when a ticket adds tools. 26 since F-731/F-732 (F-733/F-734 added none
110
+ // — the F-734 warm billing surfaces are REST-only).
111
+ assertOk(body.tools === 26, `1. tools=${body.tools}, expected 26`);
109
112
  log("ok", `healthz: tools=${body.tools}, fidelity=${body.fidelity}, tthw=${body.tthw_seconds.toFixed(2)}s`);
110
113
  }
111
114
  const headers = {
@@ -180,10 +183,11 @@ async function main() {
180
183
  assertOk(JSON.stringify(types) === JSON.stringify(expected), `5. events=${JSON.stringify(types)}, expected ${JSON.stringify(expected)}`);
181
184
  log("ok", `5 events emitted: ${types.join(", ")}`);
182
185
  }
183
- // 6. unsupported route → loud 501
186
+ // 6. unsupported route → loud 501. (/v1/customers became a supported
187
+ // surface in F-732; probe a path still on the catch-all.)
184
188
  {
185
- const r = await fetch(`${baseUrl}/s/${sid}/v1/customers`, { headers });
186
- assertOk(r.status === 501, `6. /v1/customers returned ${r.status}, expected 501`);
189
+ const r = await fetch(`${baseUrl}/s/${sid}/v1/checkout/sessions`, { headers });
190
+ assertOk(r.status === 501, `6. /v1/checkout/sessions returned ${r.status}, expected 501`);
187
191
  const env = await r.json();
188
192
  assertOk(env.error.code === "endpoint_not_supported", `6. error.code=${env.error.code}`);
189
193
  assertOk(env.error.fidelity === "unsupported", `6. error.fidelity=${env.error.fidelity}`);
@@ -1 +1 @@
1
- {"version":3,"file":"smoke.js","sourceRoot":"","sources":["../../scripts/smoke.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,6CAA6C;AAC7C,EAAE;AACF,uEAAuE;AACvE,iCAAiC;AACjC,mDAAmD;AACnD,8EAA8E;AAC9E,4EAA4E;AAC5E,8CAA8C;AAC9C,kDAAkD;AAClD,0DAA0D;AAC1D,EAAE;AACF,mEAAmE;AACnE,wEAAwE;AACxE,sBAAsB;A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AAK,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,iBAAiB,CAAC,CAAC,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,IAAI,UAAU,EAAE,CAAC;YACf,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3B,4BAA4B;YAC5B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC;gBAAC,MAAM,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACnE,CAAC;IACH,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -9,6 +9,7 @@
9
9
  // The remaining tables (customers, payment_methods, refunds, products,
10
10
  // prices, checkout_sessions, SPT, webhook_endpoints) are deferred to v2.
11
11
  import { openTwinDatabase } from "@pome-sh/sdk";
12
+ import { ensureMigratedColumns, ensureStripeTables } from "./domain/schema.js";
12
13
  const MIGRATION_SQL = `
13
14
  -- ----- chassis tables -------------------------------------------------------
14
15
 
@@ -54,7 +55,10 @@ CREATE TABLE IF NOT EXISTS payment_intents (
54
55
  created INTEGER NOT NULL,
55
56
  updated INTEGER NOT NULL,
56
57
  canceled_at INTEGER,
57
- captured_at INTEGER
58
+ captured_at INTEGER,
59
+ payment_method_id TEXT,
60
+ customer_id TEXT,
61
+ last_payment_error_json TEXT
58
62
  );
59
63
 
60
64
  CREATE INDEX IF NOT EXISTS idx_payment_intents_created ON payment_intents(created);
@@ -72,7 +76,13 @@ CREATE TABLE IF NOT EXISTS charges (
72
76
  balance_transaction_id TEXT,
73
77
  captured INTEGER NOT NULL DEFAULT 0,
74
78
  created INTEGER NOT NULL,
75
- currency TEXT NOT NULL
79
+ currency TEXT NOT NULL,
80
+ payment_method_id TEXT,
81
+ payment_method_details_json TEXT,
82
+ failure_code TEXT,
83
+ failure_decline_code TEXT,
84
+ failure_message TEXT,
85
+ customer_id TEXT
76
86
  );
77
87
 
78
88
  CREATE INDEX IF NOT EXISTS idx_charges_payment_intent ON charges(payment_intent_id);
@@ -124,10 +134,16 @@ CREATE TABLE IF NOT EXISTS audit_log (
124
134
  `;
125
135
  const RESET_SQL = `
126
136
  DELETE FROM audit_log;
137
+ DELETE FROM refunds;
127
138
  DELETE FROM events;
128
139
  DELETE FROM balance_transactions;
129
140
  DELETE FROM charges;
130
141
  DELETE FROM payment_intents;
142
+ DELETE FROM payment_methods;
143
+ DELETE FROM customers;
144
+ DELETE FROM subscriptions;
145
+ DELETE FROM prices;
146
+ DELETE FROM products;
131
147
  DELETE FROM idempotency_keys;
132
148
  DELETE FROM api_keys;
133
149
  `;
@@ -136,8 +152,16 @@ export function openTwinStripeDatabase(path = process.env.STRIPE_CLONE_DB ?? ":m
136
152
  }
137
153
  export function migrate(db) {
138
154
  db.exec(MIGRATION_SQL);
155
+ // CREATE IF NOT EXISTS can't add columns to an older DB file; patch
156
+ // them in place so external migrate() callers get the full schema.
157
+ ensureMigratedColumns(db);
139
158
  }
140
159
  export function resetDatabase(db) {
160
+ // MIGRATION_SQL doesn't create every Stripe domain table (refunds,
161
+ // customers, payment_methods, and the F-734 billing tables come from
162
+ // ensureStripeTables via domain constructors / applySeed) — ensure them
163
+ // so reset is safe on a db that hasn't constructed a domain yet.
164
+ ensureStripeTables(db);
141
165
  db.exec(RESET_SQL);
142
166
  }
143
167
  //# sourceMappingURL=db.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/db.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,yCAAyC;AACzC,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,uEAAuE;AACvE,yEAAyE;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgHrB,CAAC;AAEF,MAAM,SAAS,GAAG;;;;;;;;CAQjB,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU;IAEhD,OAAO,gBAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EAAsB;IAC5C,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAsB;IAClD,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/db.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,EAAE;AACF,4EAA4E;AAC5E,wEAAwE;AACxE,yCAAyC;AACzC,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,uEAAuE;AACvE,yEAAyE;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHrB,CAAC;AAEF,MAAM,SAAS,GAAG;;;;;;;;;;;;;;CAcjB,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,UAAU;IAEhD,OAAO,gBAAgB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EAAsB;IAC5C,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACvB,oEAAoE;IACpE,mEAAmE;IACnE,qBAAqB,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAsB;IAClD,mEAAmE;IACnE,qEAAqE;IACrE,wEAAwE;IACxE,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,CAAC,CAAC;IACvB,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACrB,CAAC"}
@@ -0,0 +1,101 @@
1
+ import type { PriceRow, ProductRow, SubscriptionRow, TwinStripeDatabase } from "../types.js";
2
+ import { TwinError } from "../errors.js";
3
+ export type ProductFieldsInput = {
4
+ name?: string | null;
5
+ description?: string | null;
6
+ active?: boolean;
7
+ metadata?: Record<string, string | null>;
8
+ };
9
+ export type CreatePriceInput = {
10
+ currency?: string;
11
+ product?: string;
12
+ unit_amount?: number;
13
+ recurring?: {
14
+ interval: string;
15
+ interval_count?: number;
16
+ };
17
+ nickname?: string | null;
18
+ lookup_key?: string | null;
19
+ active?: boolean;
20
+ metadata?: Record<string, string | null>;
21
+ };
22
+ export type SubscriptionItemInput = {
23
+ price?: string;
24
+ quantity?: number;
25
+ };
26
+ export type CreateSubscriptionInput = {
27
+ customer?: string;
28
+ items?: SubscriptionItemInput[];
29
+ cancel_at_period_end?: boolean;
30
+ metadata?: Record<string, string | null>;
31
+ };
32
+ export type UpdateSubscriptionInput = {
33
+ cancel_at_period_end?: boolean;
34
+ metadata?: Record<string, string | null>;
35
+ };
36
+ export type ListBillingInput = {
37
+ limit?: number;
38
+ starting_after?: string;
39
+ ending_before?: string;
40
+ created_gt?: number;
41
+ created_gte?: number;
42
+ created_lt?: number;
43
+ created_lte?: number;
44
+ };
45
+ /** Stored subscription item shape (items_json). */
46
+ export type SubscriptionItem = {
47
+ id: string;
48
+ price: string;
49
+ quantity: number;
50
+ };
51
+ export declare class BillingDomain {
52
+ readonly db: TwinStripeDatabase;
53
+ constructor(db: TwinStripeDatabase);
54
+ createProduct(accountId: string, input: ProductFieldsInput): ProductRow;
55
+ requireProduct(accountId: string, id: string): ProductRow;
56
+ listProducts(accountId: string, input: ListBillingInput & {
57
+ active?: boolean;
58
+ }): {
59
+ rows: ProductRow[];
60
+ hasMore: boolean;
61
+ limit: number;
62
+ };
63
+ createPrice(accountId: string, input: CreatePriceInput): PriceRow;
64
+ requirePrice(accountId: string, id: string): PriceRow;
65
+ listPrices(accountId: string, input: ListBillingInput & {
66
+ product?: string;
67
+ active?: boolean;
68
+ }): {
69
+ rows: PriceRow[];
70
+ hasMore: boolean;
71
+ limit: number;
72
+ };
73
+ createSubscription(accountId: string, input: CreateSubscriptionInput): SubscriptionRow;
74
+ requireSubscription(accountId: string, id: string): SubscriptionRow;
75
+ /**
76
+ * Update: metadata merges per-key (empty/null unsets — Stripe's metadata
77
+ * contract, same as customers), cancel_at_period_end flips. A canceled
78
+ * subscription accepts metadata-only updates and refuses everything else,
79
+ * like real Stripe.
80
+ */
81
+ updateSubscription(accountId: string, id: string, input: UpdateSubscriptionInput): SubscriptionRow;
82
+ /**
83
+ * DELETE /v1/subscriptions/:id — immediate cancel: status → canceled with
84
+ * canceled_at/ended_at stamped. Idempotent (re-cancel returns the row);
85
+ * shape tier, so no invoice settlement or proration runs.
86
+ */
87
+ cancelSubscription(accountId: string, id: string): SubscriptionRow;
88
+ /**
89
+ * Like real Stripe, the default list excludes canceled subscriptions;
90
+ * `status=canceled` selects them and `status=all` lifts the filter.
91
+ */
92
+ listSubscriptions(accountId: string, input: ListBillingInput & {
93
+ customer?: string;
94
+ status?: string;
95
+ }): {
96
+ rows: SubscriptionRow[];
97
+ hasMore: boolean;
98
+ limit: number;
99
+ };
100
+ }
101
+ export declare function noSuch(kind: string, id: string): TwinError;
@@ -0,0 +1,195 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ //
3
+ // Billing domain — F-734 (M5 warm surfaces: products, prices, subscriptions).
4
+ //
5
+ // SHAPE TIER by ruling (F-729): these are stored rows served back in Stripe
6
+ // shape, deliberately without the semantic billing machine. Concretely:
7
+ // no events are emitted, no invoices are minted, no proration or
8
+ // billing-cycle arithmetic runs, and cancellation is a plain status flip.
9
+ // Referential integrity IS enforced (unknown product / price / customer
10
+ // 404s with Stripe's resource_missing) so agents get loud, Stripe-shaped
11
+ // failures instead of dangling references.
12
+ import { TwinError } from "../errors.js";
13
+ import { newId } from "../ids.js";
14
+ import { nowUnix } from "../util.js";
15
+ import { ensureStripeTables } from "./schema.js";
16
+ import { listPaginated } from "./payment-intents.js";
17
+ export class BillingDomain {
18
+ db;
19
+ constructor(db) {
20
+ this.db = db;
21
+ ensureStripeTables(db);
22
+ }
23
+ // ---------- Products ----------
24
+ createProduct(accountId, input) {
25
+ if (!input.name)
26
+ throw missingParam("name");
27
+ const now = nowUnix();
28
+ const id = newId("product");
29
+ this.db
30
+ .prepare(`INSERT INTO products (id, account_id, name, description, active, metadata_json, created, updated)
31
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`)
32
+ .run(id, accountId, input.name, input.description ?? null, input.active === false ? 0 : 1, JSON.stringify(liveMetadata(input.metadata)), now, now);
33
+ return this.requireProduct(accountId, id);
34
+ }
35
+ requireProduct(accountId, id) {
36
+ const row = this.db
37
+ .prepare("SELECT * FROM products WHERE id = ? AND account_id = ?")
38
+ .get(id, accountId);
39
+ if (!row)
40
+ throw noSuch("product", id);
41
+ return row;
42
+ }
43
+ listProducts(accountId, input) {
44
+ const extra = [];
45
+ if (input.active !== undefined) {
46
+ extra.push({ sql: "active = ?", args: [input.active ? 1 : 0] });
47
+ }
48
+ return listPaginated(this.db, "products", accountId, input, extra);
49
+ }
50
+ // ---------- Prices ----------
51
+ createPrice(accountId, input) {
52
+ if (!input.currency)
53
+ throw missingParam("currency");
54
+ if (!input.product)
55
+ throw missingParam("product");
56
+ // Referential check: the price must point at a real product.
57
+ this.requireProduct(accountId, input.product);
58
+ const id = newId("price");
59
+ this.db
60
+ .prepare(`INSERT INTO prices (
61
+ id, account_id, product_id, currency, unit_amount, recurring_interval,
62
+ recurring_interval_count, active, nickname, lookup_key, metadata_json, created
63
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`)
64
+ .run(id, accountId, input.product, input.currency.toLowerCase(), input.unit_amount ?? null, input.recurring?.interval ?? null, input.recurring ? input.recurring.interval_count ?? 1 : null, input.active === false ? 0 : 1, input.nickname ?? null, input.lookup_key ?? null, JSON.stringify(liveMetadata(input.metadata)), nowUnix());
65
+ return this.requirePrice(accountId, id);
66
+ }
67
+ requirePrice(accountId, id) {
68
+ const row = this.db
69
+ .prepare("SELECT * FROM prices WHERE id = ? AND account_id = ?")
70
+ .get(id, accountId);
71
+ if (!row)
72
+ throw noSuch("price", id);
73
+ return row;
74
+ }
75
+ listPrices(accountId, input) {
76
+ const extra = [];
77
+ if (input.product)
78
+ extra.push({ sql: "product_id = ?", args: [input.product] });
79
+ if (input.active !== undefined) {
80
+ extra.push({ sql: "active = ?", args: [input.active ? 1 : 0] });
81
+ }
82
+ return listPaginated(this.db, "prices", accountId, input, extra);
83
+ }
84
+ // ---------- Subscriptions ----------
85
+ createSubscription(accountId, input) {
86
+ if (!input.customer)
87
+ throw missingParam("customer");
88
+ if (!Array.isArray(input.items) || input.items.length === 0) {
89
+ throw missingParam("items");
90
+ }
91
+ const items = input.items.map((item, index) => {
92
+ if (!item.price)
93
+ throw missingParam(`items[${index}][price]`);
94
+ // Referential check: every item must point at a real price.
95
+ this.requirePrice(accountId, item.price);
96
+ return {
97
+ id: newId("subscription_item"),
98
+ price: item.price,
99
+ quantity: item.quantity ?? 1,
100
+ };
101
+ });
102
+ const id = newId("subscription");
103
+ this.db
104
+ .prepare(`INSERT INTO subscriptions (
105
+ id, account_id, customer_id, status, items_json, cancel_at_period_end,
106
+ canceled_at, ended_at, metadata_json, created
107
+ ) VALUES (?, ?, ?, 'active', ?, ?, NULL, NULL, ?, ?)`)
108
+ .run(id, accountId, input.customer, JSON.stringify(items), input.cancel_at_period_end ? 1 : 0, JSON.stringify(liveMetadata(input.metadata)), nowUnix());
109
+ return this.requireSubscription(accountId, id);
110
+ }
111
+ requireSubscription(accountId, id) {
112
+ const row = this.db
113
+ .prepare("SELECT * FROM subscriptions WHERE id = ? AND account_id = ?")
114
+ .get(id, accountId);
115
+ if (!row)
116
+ throw noSuch("subscription", id);
117
+ return row;
118
+ }
119
+ /**
120
+ * Update: metadata merges per-key (empty/null unsets — Stripe's metadata
121
+ * contract, same as customers), cancel_at_period_end flips. A canceled
122
+ * subscription accepts metadata-only updates and refuses everything else,
123
+ * like real Stripe.
124
+ */
125
+ updateSubscription(accountId, id, input) {
126
+ const existing = this.requireSubscription(accountId, id);
127
+ if (existing.status === "canceled" && input.cancel_at_period_end !== undefined) {
128
+ // Real Stripe's message; it carries no `code`, but the twin envelope
129
+ // requires one, so a named code rides along (documented shape choice).
130
+ throw new TwinError("invalid_request_error", "subscription_canceled", "You cannot update a subscription that is `canceled` or `incomplete_expired`.", { param: "subscription", statusCode: 400 });
131
+ }
132
+ const metadata = JSON.parse(existing.metadata_json);
133
+ for (const [key, value] of Object.entries(input.metadata ?? {})) {
134
+ if (value === null || value === "")
135
+ delete metadata[key];
136
+ else
137
+ metadata[key] = value;
138
+ }
139
+ this.db
140
+ .prepare("UPDATE subscriptions SET cancel_at_period_end = ?, metadata_json = ? WHERE id = ? AND account_id = ?")
141
+ .run(input.cancel_at_period_end === undefined
142
+ ? existing.cancel_at_period_end
143
+ : input.cancel_at_period_end
144
+ ? 1
145
+ : 0, JSON.stringify(metadata), id, accountId);
146
+ return this.requireSubscription(accountId, id);
147
+ }
148
+ /**
149
+ * DELETE /v1/subscriptions/:id — immediate cancel: status → canceled with
150
+ * canceled_at/ended_at stamped. Idempotent (re-cancel returns the row);
151
+ * shape tier, so no invoice settlement or proration runs.
152
+ */
153
+ cancelSubscription(accountId, id) {
154
+ const existing = this.requireSubscription(accountId, id);
155
+ if (existing.status === "canceled")
156
+ return existing;
157
+ const now = nowUnix();
158
+ this.db
159
+ .prepare("UPDATE subscriptions SET status = 'canceled', canceled_at = ?, ended_at = ? WHERE id = ? AND account_id = ?")
160
+ .run(now, now, id, accountId);
161
+ return this.requireSubscription(accountId, id);
162
+ }
163
+ /**
164
+ * Like real Stripe, the default list excludes canceled subscriptions;
165
+ * `status=canceled` selects them and `status=all` lifts the filter.
166
+ */
167
+ listSubscriptions(accountId, input) {
168
+ const extra = [];
169
+ if (input.customer)
170
+ extra.push({ sql: "customer_id = ?", args: [input.customer] });
171
+ if (input.status === undefined) {
172
+ extra.push({ sql: "status != 'canceled'", args: [] });
173
+ }
174
+ else if (input.status !== "all") {
175
+ extra.push({ sql: "status = ?", args: [input.status] });
176
+ }
177
+ return listPaginated(this.db, "subscriptions", accountId, input, extra);
178
+ }
179
+ }
180
+ /** Drop empty/null metadata values on create (Stripe stores only set keys). */
181
+ function liveMetadata(metadata) {
182
+ const out = {};
183
+ for (const [key, value] of Object.entries(metadata ?? {})) {
184
+ if (value !== null && value !== "")
185
+ out[key] = value;
186
+ }
187
+ return out;
188
+ }
189
+ function missingParam(param) {
190
+ return new TwinError("invalid_request_error", "parameter_missing", `Missing required param: ${param}.`, { param, statusCode: 400 });
191
+ }
192
+ export function noSuch(kind, id) {
193
+ return new TwinError("invalid_request_error", "resource_missing", `No such ${kind}: '${id}'.`, { param: kind, statusCode: 404 });
194
+ }
195
+ //# sourceMappingURL=billing.js.map