@pome-sh/cli 0.12.0 → 0.13.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 (197) hide show
  1. package/dist/build-info.json +3 -3
  2. package/dist/src/cli/checks-add.js +16 -0
  3. package/dist/src/cli/checks-lint.d.ts +1 -0
  4. package/dist/src/cli/checks-lint.js +59 -0
  5. package/dist/src/cli/criterion-binding.d.ts +41 -0
  6. package/dist/src/cli/criterion-binding.js +111 -0
  7. package/dist/src/cli/main.js +12 -0
  8. package/dist/src/runner/runTask.d.ts +2 -2
  9. package/dist/src/task/insertCriterion.js +6 -1
  10. package/dist/src/task/parseTask.d.ts +21 -0
  11. package/dist/src/task/parseTask.js +48 -1
  12. package/dist/src/task/taskSchema.d.ts +4 -4
  13. package/node_modules/@pome-sh/sdk/dist/checks.d.ts +2 -0
  14. package/node_modules/@pome-sh/sdk/dist/checks.js.map +1 -1
  15. package/node_modules/@pome-sh/sdk/dist/failure-injection.js +7 -0
  16. package/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +1 -1
  17. package/node_modules/@pome-sh/sdk/dist/index.d.ts +8 -0
  18. package/node_modules/@pome-sh/sdk/dist/index.js +1 -0
  19. package/node_modules/@pome-sh/sdk/dist/index.js.map +1 -1
  20. package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +10 -0
  21. package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +1 -1
  22. package/node_modules/@pome-sh/sdk/dist/recorder.js +8 -4
  23. package/node_modules/@pome-sh/sdk/dist/recorder.js.map +1 -1
  24. package/node_modules/@pome-sh/sdk/dist/request-capture.d.ts +31 -0
  25. package/node_modules/@pome-sh/sdk/dist/request-capture.js +59 -0
  26. package/node_modules/@pome-sh/sdk/dist/request-capture.js.map +1 -0
  27. package/node_modules/@pome-sh/sdk/dist/server.d.ts +1 -0
  28. package/node_modules/@pome-sh/sdk/dist/server.js +13 -0
  29. package/node_modules/@pome-sh/sdk/dist/server.js.map +1 -1
  30. package/node_modules/@pome-sh/sdk/package.json +2 -2
  31. package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +6 -0
  32. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +2 -0
  33. package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +14 -0
  34. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +40 -0
  35. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +1 -1
  36. package/node_modules/@pome-sh/shared-types/package.json +1 -1
  37. package/node_modules/@pome-sh/shared-types/trace-contract.json +1 -1
  38. package/node_modules/@pome-sh/twin-github/dist/src/access-control.d.ts +3 -3
  39. package/node_modules/@pome-sh/twin-github/dist/src/check-params.d.ts +1 -0
  40. package/node_modules/@pome-sh/twin-github/dist/src/check-params.js +17 -0
  41. package/node_modules/@pome-sh/twin-github/dist/src/check-params.js.map +1 -1
  42. package/node_modules/@pome-sh/twin-github/dist/src/check-tape.d.ts +3 -0
  43. package/node_modules/@pome-sh/twin-github/dist/src/check-tape.js +77 -0
  44. package/node_modules/@pome-sh/twin-github/dist/src/check-tape.js.map +1 -1
  45. package/node_modules/@pome-sh/twin-github/dist/src/checks.d.ts +3 -1
  46. package/node_modules/@pome-sh/twin-github/dist/src/checks.js +4 -3
  47. package/node_modules/@pome-sh/twin-github/dist/src/checks.js.map +1 -1
  48. package/node_modules/@pome-sh/twin-github/dist/src/domain/checks.d.ts +4 -4
  49. package/node_modules/@pome-sh/twin-github/dist/src/domain/github-domain.d.ts +5 -5
  50. package/node_modules/@pome-sh/twin-github/dist/src/domain/pulls.d.ts +1 -1
  51. package/node_modules/@pome-sh/twin-github/dist/src/routes.js +16 -2
  52. package/node_modules/@pome-sh/twin-github/dist/src/routes.js.map +1 -1
  53. package/node_modules/@pome-sh/twin-github/dist/src/seed.d.ts +1 -1
  54. package/node_modules/@pome-sh/twin-github/dist/src/serializers.d.ts +3 -3
  55. package/node_modules/@pome-sh/twin-github/dist/src/tools.d.ts +22 -21
  56. package/node_modules/@pome-sh/twin-github/dist/src/tools.js +22 -0
  57. package/node_modules/@pome-sh/twin-github/dist/src/tools.js.map +1 -1
  58. package/node_modules/@pome-sh/twin-github/package.json +3 -3
  59. package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.js +6 -0
  60. package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.js.map +1 -1
  61. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js +9 -1
  62. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js.map +1 -1
  63. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.d.ts +2 -2
  64. package/node_modules/@pome-sh/twin-stripe/dist/src/session.d.ts +3 -0
  65. package/node_modules/@pome-sh/twin-stripe/dist/src/session.js +72 -0
  66. package/node_modules/@pome-sh/twin-stripe/dist/src/session.js.map +1 -1
  67. package/node_modules/@pome-sh/twin-stripe/dist/src/twin.js +5 -1
  68. package/node_modules/@pome-sh/twin-stripe/dist/src/twin.js.map +1 -1
  69. package/node_modules/@pome-sh/twin-stripe/package.json +4 -4
  70. package/package.json +5 -5
  71. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.d.ts +0 -35
  72. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.js +0 -103
  73. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/admin-gate.js.map +0 -1
  74. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.d.ts +0 -100
  75. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.js +0 -262
  76. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/auth.js.map +0 -1
  77. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.d.ts +0 -7
  78. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.js +0 -14
  79. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/build-info.js.map +0 -1
  80. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.d.ts +0 -44
  81. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.js +0 -113
  82. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/db.js.map +0 -1
  83. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.d.ts +0 -24
  84. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.js +0 -61
  85. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/errors.js.map +0 -1
  86. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.d.ts +0 -43
  87. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.js +0 -160
  88. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +0 -1
  89. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +0 -121
  90. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +0 -204
  91. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +0 -1
  92. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.d.ts +0 -8
  93. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.js +0 -39
  94. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/fidelity.js.map +0 -1
  95. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.d.ts +0 -372
  96. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.js +0 -139
  97. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/index.js.map +0 -1
  98. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.d.ts +0 -10
  99. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +0 -221
  100. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +0 -1
  101. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.d.ts +0 -61
  102. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.js +0 -123
  103. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/parity.js.map +0 -1
  104. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.d.ts +0 -120
  105. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.js +0 -368
  106. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/recorder.js.map +0 -1
  107. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.d.ts +0 -1
  108. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.js +0 -3
  109. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/redaction.js.map +0 -1
  110. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +0 -54
  111. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.js +0 -181
  112. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +0 -1
  113. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.d.ts +0 -46
  114. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.js +0 -394
  115. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/server.js.map +0 -1
  116. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.d.ts +0 -8
  117. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.js +0 -22
  118. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/dist/tool-context.js.map +0 -1
  119. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/sdk/package.json +0 -54
  120. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.d.ts +0 -39
  121. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js +0 -33
  122. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/errors.js.map +0 -1
  123. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +0 -254
  124. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +0 -122
  125. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +0 -1
  126. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +0 -175
  127. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js +0 -182
  128. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +0 -1
  129. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.d.ts +0 -90
  130. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js +0 -72
  131. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/identity.js.map +0 -1
  132. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.d.ts +0 -28
  133. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js +0 -35
  134. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/index.js.map +0 -1
  135. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.d.ts +0 -31
  136. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.js +0 -76
  137. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/manifest.js.map +0 -1
  138. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +0 -331
  139. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +0 -33
  140. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +0 -1
  141. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +0 -65
  142. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +0 -455
  143. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +0 -1
  144. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +0 -39
  145. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +0 -47
  146. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +0 -1
  147. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +0 -25
  148. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js +0 -27
  149. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +0 -1
  150. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +0 -100
  151. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +0 -193
  152. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +0 -1
  153. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +0 -64
  154. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +0 -112
  155. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +0 -1
  156. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +0 -26
  157. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js +0 -61
  158. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +0 -1
  159. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +0 -42
  160. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js +0 -104
  161. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +0 -1
  162. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +0 -57
  163. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +0 -102
  164. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +0 -1
  165. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +0 -134
  166. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +0 -152
  167. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +0 -1
  168. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +0 -480
  169. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js +0 -270
  170. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +0 -1
  171. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +0 -2
  172. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js +0 -152
  173. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/redaction.js.map +0 -1
  174. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.d.ts +0 -257
  175. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js +0 -335
  176. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/rest.js.map +0 -1
  177. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.d.ts +0 -208
  178. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js +0 -170
  179. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/run.js.map +0 -1
  180. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +0 -14
  181. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +0 -46
  182. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +0 -1
  183. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +0 -1006
  184. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js +0 -263
  185. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +0 -1
  186. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +0 -53
  187. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js +0 -51
  188. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/sessions.js.map +0 -1
  189. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +0 -80
  190. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js +0 -98
  191. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +0 -1
  192. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.d.ts +0 -859
  193. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js +0 -60
  194. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/dist/task.js.map +0 -1
  195. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/manifest-schema.json +0 -68
  196. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/package.json +0 -55
  197. package/node_modules/@pome-sh/twin-stripe/node_modules/@pome-sh/shared-types/trace-contract.json +0 -41
@@ -1,372 +0,0 @@
1
- import { z } from "zod";
2
- import type { Context, Hono } from "hono";
3
- import { recorderEventSchema, recorderFidelitySchema, type RecorderEvent, type RecorderFidelity, type TwinId } from "@pome-sh/shared-types";
4
- export { recorderEventSchema, recorderFidelitySchema };
5
- export type { RecorderEvent, RecorderFidelity, TwinId };
6
- export { openTwinDatabase } from "./db.js";
7
- export type { OpenTwinDatabaseOptions, TwinDatabase, TwinRunResult, TwinStatement, TwinTransaction } from "./db.js";
8
- export { redactEvent, redactSecrets } from "./redaction.js";
9
- export declare const fidelityTierSchema: z.ZodEnum<{
10
- semantic: "semantic";
11
- unsupported: "unsupported";
12
- shape: "shape";
13
- }>;
14
- export type FidelityTier = z.infer<typeof fidelityTierSchema>;
15
- export interface ToolFidelityMetadata {
16
- tier?: FidelityTier;
17
- backingSurface?: string;
18
- tests?: string[];
19
- deviations?: string;
20
- }
21
- /**
22
- * Per-call context handed to tool handlers by every MCP dispatch surface
23
- * (JSON-RPC `tools/call`, legacy `/mcp/tools/:name` + `/mcp/call`). Carries
24
- * the authenticated session (actor identity) and a `reportDelta` sink so
25
- * MCP-dispatched mutations surface `state_delta` on the recorded event —
26
- * the two facilities the per-twin mcp.ts modules had before F-683.
27
- */
28
- export interface ToolCallContext {
29
- /** The session set by the engine's bearerAuth for this request. */
30
- session?: import("./auth.js").SessionValue;
31
- /** Report the row-level before/after recorded as this event's `state_delta`. */
32
- reportDelta: (delta: RecorderEvent["state_delta"]) => void;
33
- }
34
- export interface ToolSpec<TDomain = unknown, TInput = unknown, TOutput = unknown> {
35
- name: string;
36
- description: string;
37
- schema: z.ZodType<TInput>;
38
- handler: (domain: TDomain, args: TInput, ctx: ToolCallContext) => TOutput | Promise<TOutput>;
39
- /**
40
- * Whether this tool's handler actually mutates local twin state when it
41
- * succeeds. Independent of upstream MCP `annotations` (e.g. Google's
42
- * `readOnlyHint`): annotations are served verbatim for wire parity;
43
- * `mutation` remains Pome's recorder truth for `state_mutation`.
44
- */
45
- mutation: boolean;
46
- fidelity?: ToolFidelityMetadata;
47
- /**
48
- * Optional MCP tool title. Emitted on tool-list surfaces only when set —
49
- * existing twins omit it and stay wire-identical.
50
- */
51
- title?: string;
52
- /**
53
- * MCP tool-list annotations (e.g. `{ readOnlyHint: true }`), emitted
54
- * verbatim on both tool-list surfaces when present. Do not derive
55
- * `mutation` from these hints — they are upstream metadata only.
56
- */
57
- annotations?: Record<string, unknown>;
58
- /**
59
- * Literal JSON-Schema override for the tool listings. Twins with a frozen
60
- * schema wire shape (e.g. slack's forced draft-7
61
- * `additionalProperties:false` form) supply it here; defaults to
62
- * `z.toJSONSchema(schema)`.
63
- */
64
- inputSchema?: Record<string, unknown>;
65
- /**
66
- * Optional MCP output JSON Schema. When set, `tools/list` advertises it
67
- * and successful `tools/call` results include `structuredContent` equal
68
- * to the handler return value. Omitted tools stay byte-identical.
69
- */
70
- outputSchema?: Record<string, unknown>;
71
- /**
72
- * Optional text-content projection for JSON-RPC `tools/call`. The
73
- * structured value remains the validated handler return value.
74
- */
75
- contentText?: (output: TOutput) => string;
76
- /** Emit the explicit MCP `isError: false` success marker when captured upstream. */
77
- includeIsError?: boolean;
78
- }
79
- /** The JSON-Schema a tool advertises: the declared override, else zod-derived. */
80
- export declare function toolInputSchema(tool: Pick<ToolSpec, "schema" | "inputSchema">): Record<string, unknown>;
81
- /**
82
- * Optional MCP tool-list fields that must stay absent when unset so existing
83
- * GitHub/Slack/Stripe listings remain byte-identical.
84
- */
85
- export declare function toolListExtras(tool: Pick<ToolSpec, "title" | "outputSchema" | "annotations">): Record<string, unknown>;
86
- export interface TwinFidelity {
87
- default: FidelityTier;
88
- }
89
- export interface RouteContext<TDomain = unknown> {
90
- domain: TDomain;
91
- recorder: RecorderHandle;
92
- runId: string;
93
- twin: TwinId;
94
- }
95
- export type RouteRegistrar<TDomain = unknown> = (app: Hono, ctx: RouteContext<TDomain>) => void;
96
- export interface RecorderHandlerResult {
97
- status: number;
98
- body: unknown;
99
- /**
100
- * Optional override for the per-event `state_mutation` field. When unset,
101
- * the recorder uses the `mutation` flag passed to `handle({mutation})`.
102
- * Used by the SDK's MCP dispatch routes to plumb the per-tool mutation
103
- * flag (different per call) into the recorder event.
104
- */
105
- mutation?: boolean;
106
- /**
107
- * Optional state delta recorded on the event (`state_delta`). Routes that
108
- * know exactly what they changed surface it here; defaults to null.
109
- */
110
- delta?: RecorderEvent["state_delta"];
111
- }
112
- export interface RecorderHandle {
113
- record(event: RecorderEvent): void;
114
- events(): RecorderEvent[];
115
- /** Event count without the O(N) copy `events()` makes. */
116
- count(): number;
117
- /** Events dropped by a bounded store (0 for the default unbounded store). */
118
- dropped(): number;
119
- /**
120
- * Durability barrier (F-720). Forwards to the backing `RecorderStore.flush`
121
- * when present. Await before upload/finalize when using a durable store.
122
- */
123
- flush(): Promise<void>;
124
- /**
125
- * Flush + release the backing store (F-720). Idempotent.
126
- */
127
- close(): Promise<void>;
128
- /**
129
- * Wrap a Hono handler with auto-recording. The wrapped function returns
130
- * `{ status, body }` (not a `Response`); the recorder fills in `ts`,
131
- * `request_id`, `latency_ms`, `state_mutation`, `error`, then writes the
132
- * `RecorderEvent` and returns `c.json(body, status)`.
133
- */
134
- handle(opts: {
135
- mutation: boolean;
136
- fidelity?: RecorderFidelity;
137
- /** Per-surface error projection override (admin routes have their own frozen envelope on some twins). */
138
- errorEnvelope?: (err: unknown) => {
139
- status: number;
140
- body: unknown;
141
- };
142
- }, fn: (c: Context) => Promise<RecorderHandlerResult> | RecorderHandlerResult): (c: Context) => Promise<Response>;
143
- }
144
- export interface AdminHandlers<TDomain = unknown, TSeed = unknown> {
145
- /**
146
- * Implements POST /admin/reset. `reportDelta` records the row-level
147
- * before/after as the admin event's `state_delta` (github's frozen tape
148
- * records the seed delta on admin mutations, F-682).
149
- */
150
- reset?: (ctx: {
151
- domain: TDomain;
152
- reportDelta: (delta: RecorderEvent["state_delta"]) => void;
153
- }) => unknown | Promise<unknown>;
154
- /**
155
- * Implements POST /admin/seed. The seed body is Zod-parsed via
156
- * `definition.seed` first; `reportDelta` stamps the event's `state_delta`.
157
- */
158
- seed?: (ctx: {
159
- domain: TDomain;
160
- seed: TSeed;
161
- reportDelta: (delta: RecorderEvent["state_delta"]) => void;
162
- }) => unknown | Promise<unknown>;
163
- /**
164
- * Whether /admin/reset|seed land on the recorder tape. Default true
165
- * (github/slack frozen tapes record admin events); stripe pins false —
166
- * its pre-port recorder never saw admin traffic.
167
- */
168
- recorded?: boolean;
169
- /**
170
- * Per-surface error projection for /admin/reset|seed. Pre-port slack's
171
- * admin handlers answered EVERY thrown error with 500
172
- * {ok:false, error:"internal_error", warning} — bypassing the session
173
- * envelope. Defaults to the twin's `errorEnvelope`.
174
- */
175
- errorEnvelope?: (err: unknown) => {
176
- status: number;
177
- body: unknown;
178
- };
179
- /**
180
- * The twin's admin-gate 403 envelope (slack pins
181
- * `{ok:false, error:"restricted_action"}`). Gate mechanism —
182
- * TWIN_ADMIN_TOKEN mode, loopback socket check — stays in the engine
183
- * (`packages/sdk/src/admin-gate.ts`); this is pure shape. Defaults to the
184
- * generic `{message: "Forbidden"}` envelope.
185
- */
186
- forbidden?: () => {
187
- status: number;
188
- body: unknown;
189
- };
190
- }
191
- export interface TwinDefinition<TDb = unknown, TSeed = unknown, TDomain = unknown> {
192
- id: string;
193
- version: string;
194
- fidelity: TwinFidelity;
195
- seed?: z.ZodType<TSeed>;
196
- domain: (ctx: {
197
- db: TDb;
198
- seed: TSeed | undefined;
199
- }) => TDomain;
200
- routes?: RouteRegistrar<TDomain>;
201
- tools: ToolSpec<TDomain>[];
202
- /**
203
- * Optional state introspection for `GET /s/:sid/_pome/state`. If absent,
204
- * the route returns a 501 envelope so consumers fail loudly instead of
205
- * silently reading an empty state. `session` is the bearer-resolved
206
- * session for the request, so account-scoped twins (stripe) can export
207
- * only the calling session's slice (F-684).
208
- */
209
- state?: (ctx: {
210
- domain: TDomain;
211
- session?: import("./auth.js").SessionValue;
212
- }) => unknown | Promise<unknown>;
213
- /**
214
- * Optional admin handlers for `/admin/reset` and `/admin/seed`. If absent,
215
- * the routes still mount (with the localhost guard) and return a 501
216
- * envelope explaining that the twin did not configure them.
217
- */
218
- admin?: AdminHandlers<TDomain, TSeed>;
219
- /**
220
- * Optional error-envelope projector. Called from the recorder middleware
221
- * catch path to convert a thrown error into the `{ status, body }` shape
222
- * the route returns. API-mirroring twins use this to preserve the
223
- * upstream API's error shape (e.g. Stripe's nested `{ error: { type,
224
- * code, message, doc_url } }`, GitHub's `{ message, documentation_url,
225
- * status, errors[] }`). Defaults to a generic `{ message, errors? }`
226
- * envelope.
227
- */
228
- errorEnvelope?: (err: unknown) => {
229
- status: number;
230
- body: unknown;
231
- };
232
- /**
233
- * `/healthz` `implementation` field (runtime contract). Defaults to
234
- * `"<id>_clone"`.
235
- */
236
- implementation?: string;
237
- /**
238
- * npm package name reported in the `/healthz` `runtime` block. Defaults
239
- * to `"@pome-sh/twin-<id>"`.
240
- */
241
- packageName?: string;
242
- /**
243
- * Extra `/healthz` fields merged over the contract core
244
- * `{ok, twin, implementation, tools, runtime}`. When absent the engine
245
- * adds `{version, fidelity}`; a twin with a frozen healthz shape supplies
246
- * its own extras (possibly `{}` to omit both).
247
- */
248
- healthz?: () => Record<string, unknown>;
249
- /**
250
- * The twin's 501 loud-unsupported envelope for unknown session routes.
251
- * Defaults to the generic `{message, fidelity, method, path}` body.
252
- */
253
- unsupported?: (ctx: {
254
- method: string;
255
- path: string;
256
- }) => {
257
- status: number;
258
- body: unknown;
259
- };
260
- /**
261
- * Per-twin request-body reader for the engine-owned JSON surfaces
262
- * (`/admin/seed`, legacy `/mcp/call`, `/mcp/tools/:name`). Defaults to
263
- * strict JSON — malformed bodies throw `SyntaxError` into the twin's
264
- * `errorEnvelope`. Twins with frozen tolerant/form parsing pass their
265
- * pre-port reader (slack `parseFormOrJson`, stripe form-or-JSON).
266
- */
267
- bodyReader?: (c: import("hono").Context) => Promise<unknown>;
268
- /**
269
- * Session-wide middleware slot mounted immediately after bearer auth and
270
- * BEFORE the engine's MCP / `/_pome/*` routes — the pre-port
271
- * `session.use("*")` position (stripe registers failure-injection and
272
- * idempotency here so they cover MCP dispatch too). Register `use()`
273
- * middleware only; routes belong in `routes`.
274
- */
275
- middleware?: RouteRegistrar<TDomain>;
276
- /**
277
- * Legacy `POST /mcp/call` dispatch pins (F-683 review): slack's frozen
278
- * surface accepts `{name}`/`{params}` as aliases of `{tool}`/`{arguments}`
279
- * and answers a body naming no tool with its own envelope instead of the
280
- * strict-parse error.
281
- */
282
- legacyMcp?: {
283
- aliases?: boolean;
284
- missingTool?: () => {
285
- status: number;
286
- body: unknown;
287
- };
288
- };
289
- /**
290
- * Extra `/s/:sid/_pome/health` fields merged over the contract core
291
- * `{ok, twin}`. When absent the engine adds `{version, fidelity}`; a twin
292
- * with a frozen per-session health shape (slack: bare {ok, twin};
293
- * github: implementation, fidelity, runtime — no version) supplies its
294
- * own extras. The hook receives the app's recorder so counters can be
295
- * surfaced (stripe).
296
- */
297
- pomeHealth?: (ctx: {
298
- recorder: RecorderHandle;
299
- }) => Record<string, unknown>;
300
- /**
301
- * Extra per-twin GET routes under the reserved `/s/:sid/_pome/*` session
302
- * namespace, keyed by subpath (github's frozen
303
- * `GET /s/:sid/_pome/access-control`). Handlers return the JSON body;
304
- * the engine mounts them behind bearer auth, after its own core routes.
305
- * The core names (`health`, `state`, `events`) stay engine-owned — a twin
306
- * declaring one refuses to boot.
307
- */
308
- pomeRoutes?: Record<string, (ctx: {
309
- domain: TDomain;
310
- }) => unknown | Promise<unknown>>;
311
- /**
312
- * FDRS-402 adapter-rich stamping pin: when true, every recorded event
313
- * persists the incoming `x-pome-correlation-id` header as `tool_call_id`
314
- * (github's frozen tape shape). Defaults to false — slack's frozen tape
315
- * stamps null. Flipping a twin is a deliberate tape-shape change.
316
- */
317
- stampToolCallId?: boolean;
318
- /**
319
- * JSON-RPC `tools/call` unknown-tool result body (frozen per-twin wire
320
- * shape). Defaults to the twin's `errorEnvelope` projection of
321
- * `UnknownToolError` (slack/stripe). github pins the pre-port
322
- * `{message: "Unknown tool: <name>"}` text — its legacy `/mcp/call`
323
- * surface keeps the 422 validation envelope from `errorEnvelope`.
324
- */
325
- mcpUnknownTool?: (name: string) => unknown;
326
- /**
327
- * Whether the engine mounts `GET /s/:sid/healthz` (200 `{ok, sid}`).
328
- * Default true. Stripe pins false — its frozen contract has NO
329
- * per-session healthz; the path falls to the 501 catch-all. Flipping a
330
- * twin is a contract change (CONTRACT.md + suite in one PR).
331
- */
332
- sessionHealthz?: boolean;
333
- /**
334
- * Also mount the session router at the root path. Stripe's frozen F3
335
- * SDK-compat surface: real `stripe-node`/`stripe-python` build URLs like
336
- * `/v1/payment_intents` with no way to inject a `/s/:sid` prefix, so the
337
- * bearer alone resolves the session (pair with `auth.requirePathSid:
338
- * false`). Root `/healthz` and `/admin/*` are registered first and stay
339
- * first-match. Default false.
340
- */
341
- mountSessionAtRoot?: boolean;
342
- /**
343
- * Per-twin auth declarations (F-712): token shape, error envelopes, extra
344
- * token locations, raw-bearer / sid-mismatch pins, credential lookup.
345
- * Mechanism lives in the engine's `bearerAuth`; this is pure shape.
346
- */
347
- auth?: import("./auth.js").BearerAuthOptions;
348
- /**
349
- * Optional pre-redaction projection applied to every recorded event
350
- * before the central secret scrubber. Use to replace large/binary
351
- * payloads (e.g. MIME/attachment bytes) with bounded digests. When
352
- * unset, recording behavior is unchanged.
353
- */
354
- recordingProjection?: (event: RecorderEvent) => RecorderEvent;
355
- }
356
- export declare class TwinManifestError extends Error {
357
- readonly issues: ReadonlyArray<z.core.$ZodIssue>;
358
- constructor(message: string, issues?: ReadonlyArray<z.core.$ZodIssue>);
359
- }
360
- /**
361
- * Define a twin manifest. Runs Zod meta-validation at the call site
362
- * (typically module-load time) and throws `TwinManifestError` on shape
363
- * violations or duplicate tool names.
364
- */
365
- export declare function defineTwin<TDb = unknown, TSeed = unknown, TDomain = unknown>(spec: TwinDefinition<TDb, TSeed, TDomain>): TwinDefinition<TDb, TSeed, TDomain>;
366
- /**
367
- * Path prefixes the SDK reserves under `/s/:sid`. User routes that match or
368
- * start with these are rejected at boot per OQ-B6 (`/_pome/*` shadow
369
- * detection). `/mcp/*` is reserved for the same reason — community twins
370
- * cannot silently override the MCP dispatch surface.
371
- */
372
- export declare const RESERVED_SESSION_PREFIXES: readonly ["/_pome", "/mcp"];
@@ -1,139 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0
2
- // `@pome-sh/sdk` — public surface for community twin authors.
3
- // `defineTwin()` returns data booted by `serve()` from `@pome-sh/sdk/server`.
4
- // The SDK enforces recording, mutation, and reserved-route invariants.
5
- import { z } from "zod";
6
- import { recorderEventSchema, recorderFidelitySchema, } from "@pome-sh/shared-types";
7
- export { recorderEventSchema, recorderFidelitySchema };
8
- export { openTwinDatabase } from "./db.js";
9
- export { redactEvent, redactSecrets } from "./redaction.js";
10
- // FIDELITY.md uses three tiers (`semantic` | `shape` | `unsupported`); the
11
- // recording-spec.md v1.0 per-event enum is closed at two (`semantic` |
12
- // `unsupported`). They serve different purposes — the FIDELITY tier is a
13
- // per-tool documentation classifier, the recorder field is per-request.
14
- export const fidelityTierSchema = z.enum(["semantic", "shape", "unsupported"]);
15
- /** The JSON-Schema a tool advertises: the declared override, else zod-derived. */
16
- export function toolInputSchema(tool) {
17
- return tool.inputSchema ?? z.toJSONSchema(tool.schema);
18
- }
19
- /**
20
- * Optional MCP tool-list fields that must stay absent when unset so existing
21
- * GitHub/Slack/Stripe listings remain byte-identical.
22
- */
23
- export function toolListExtras(tool) {
24
- return {
25
- ...(tool.title !== undefined ? { title: tool.title } : {}),
26
- ...(tool.outputSchema !== undefined ? { outputSchema: tool.outputSchema } : {}),
27
- ...(tool.annotations ? { annotations: tool.annotations } : {}),
28
- };
29
- }
30
- // ─── Meta-validation ────────────────────────────────────────────────────────
31
- export class TwinManifestError extends Error {
32
- issues;
33
- constructor(message, issues = []) {
34
- super(message);
35
- this.issues = issues;
36
- this.name = "TwinManifestError";
37
- }
38
- }
39
- // Duck-typed on purpose: a twin's schemas may come from its own zod copy
40
- // (unhoisted workspace installs, community twins bundling zod) — a bare
41
- // `instanceof z.ZodType` would reject schemas from any zod instance other
42
- // than the SDK's own.
43
- const isZodType = (value) => value instanceof z.ZodType ||
44
- (typeof value === "object" &&
45
- value !== null &&
46
- typeof value.parse === "function" &&
47
- typeof value.safeParse === "function");
48
- const isFunction = (value) => typeof value === "function";
49
- const slugLike = /^[a-z][a-z0-9_-]*$/;
50
- const toolFidelityMeta = z.object({
51
- tier: fidelityTierSchema.optional(),
52
- backingSurface: z.string().optional(),
53
- tests: z.array(z.string()).optional(),
54
- deviations: z.string().optional(),
55
- });
56
- const toolMeta = z.object({
57
- name: z.string().min(1).regex(slugLike, "tool name must be a lowercase slug"),
58
- description: z.string().min(1),
59
- schema: z.custom(isZodType, "tool.schema must be a Zod schema"),
60
- handler: z.custom(isFunction, "tool.handler must be a function"),
61
- mutation: z.boolean(),
62
- fidelity: toolFidelityMeta.optional(),
63
- title: z.string().min(1).optional(),
64
- annotations: z.record(z.string(), z.unknown()).optional(),
65
- inputSchema: z.record(z.string(), z.unknown()).optional(),
66
- outputSchema: z.record(z.string(), z.unknown()).optional(),
67
- });
68
- const adminMeta = z.object({
69
- reset: z.custom(isFunction).optional(),
70
- seed: z.custom(isFunction).optional(),
71
- recorded: z.boolean().optional(),
72
- errorEnvelope: z.custom(isFunction).optional(),
73
- forbidden: z.custom(isFunction).optional(),
74
- });
75
- const twinMeta = z.object({
76
- id: z.string().min(1).regex(slugLike, "twin id must be a lowercase slug"),
77
- version: z.string().min(1),
78
- fidelity: z.object({ default: fidelityTierSchema }),
79
- seed: z.custom(isZodType, "seed must be a Zod schema").optional(),
80
- domain: z.custom(isFunction, "domain must be a function"),
81
- routes: z.custom(isFunction, "routes must be a function").optional(),
82
- tools: z.array(toolMeta),
83
- state: z.custom(isFunction).optional(),
84
- admin: adminMeta.optional(),
85
- errorEnvelope: z.custom(isFunction).optional(),
86
- implementation: z.string().min(1).optional(),
87
- packageName: z.string().min(1).optional(),
88
- healthz: z.custom(isFunction).optional(),
89
- bodyReader: z.custom(isFunction).optional(),
90
- middleware: z.custom(isFunction).optional(),
91
- legacyMcp: z
92
- .object({
93
- aliases: z.boolean().optional(),
94
- missingTool: z.custom(isFunction).optional(),
95
- })
96
- .optional(),
97
- pomeHealth: z.custom(isFunction).optional(),
98
- unsupported: z.custom(isFunction).optional(),
99
- pomeRoutes: z.record(z.string(), z.custom(isFunction)).optional(),
100
- stampToolCallId: z.boolean().optional(),
101
- mcpUnknownTool: z.custom(isFunction).optional(),
102
- sessionHealthz: z.boolean().optional(),
103
- mountSessionAtRoot: z.boolean().optional(),
104
- auth: z
105
- .custom((value) => typeof value === "object" && value !== null, "auth must be an options object")
106
- .optional(),
107
- recordingProjection: z.custom(isFunction).optional(),
108
- });
109
- /**
110
- * Define a twin manifest. Runs Zod meta-validation at the call site
111
- * (typically module-load time) and throws `TwinManifestError` on shape
112
- * violations or duplicate tool names.
113
- */
114
- export function defineTwin(spec) {
115
- const parsed = twinMeta.safeParse(spec);
116
- if (!parsed.success) {
117
- const detail = parsed.error.issues
118
- .map((issue) => `${issue.path.join(".") || "<root>"}: ${issue.message}`)
119
- .join("; ");
120
- throw new TwinManifestError(`Invalid twin manifest: ${detail}`, parsed.error.issues);
121
- }
122
- const seen = new Set();
123
- for (const tool of spec.tools) {
124
- if (seen.has(tool.name)) {
125
- throw new TwinManifestError(`Duplicate tool name: ${tool.name}`);
126
- }
127
- seen.add(tool.name);
128
- }
129
- return spec;
130
- }
131
- // ─── Reserved paths (used by server.ts; exported for tests) ─────────────────
132
- /**
133
- * Path prefixes the SDK reserves under `/s/:sid`. User routes that match or
134
- * start with these are rejected at boot per OQ-B6 (`/_pome/*` shadow
135
- * detection). `/mcp/*` is reserved for the same reason — community twins
136
- * cannot silently override the MCP dispatch surface.
137
- */
138
- export const RESERVED_SESSION_PREFIXES = ["/_pome", "/mcp"];
139
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,8DAA8D;AAC9D,8EAA8E;AAC9E,uEAAuE;AAEvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GAIvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,CAAC;AAGvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,EAAE,WA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C;YACxB,MAAM,IAAI,iBAAiB,CAAC,wBAAwB,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QACnE,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAU,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { Context } from "hono";
2
- import { type RecorderHandle, type TwinDefinition } from "./index.js";
3
- export interface McpJsonRpcDeps<TDb, TSeed, TDomain> {
4
- definition: TwinDefinition<TDb, TSeed, TDomain>;
5
- domain: TDomain;
6
- recorder: RecorderHandle;
7
- runId: string;
8
- }
9
- export declare function mcpMethodNotAllowed(c: Context): Response;
10
- export declare function handleMcpJsonRpc<TDb, TSeed, TDomain>(c: Context, deps: McpJsonRpcDeps<TDb, TSeed, TDomain>): Promise<Response>;