@pome-sh/cli 0.20.0 → 0.21.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 (2782) hide show
  1. package/README.md +6 -4
  2. package/dist/agent-Q2UTRJYL.js +408 -0
  3. package/dist/build-info.json +3 -3
  4. package/dist/checks-C63QWUOI.js +290 -0
  5. package/dist/chunk-2Q7AYEUA.js +1207 -0
  6. package/dist/chunk-APAS34RJ.js +6614 -0
  7. package/dist/chunk-BSKITCXD.js +116 -0
  8. package/dist/chunk-CBFKZZBR.js +96 -0
  9. package/dist/chunk-D3GRORLQ.js +1614 -0
  10. package/dist/chunk-GEAGPLZZ.js +57 -0
  11. package/dist/chunk-IY6G5NWT.js +330 -0
  12. package/dist/chunk-LZIPGCQJ.js +1512 -0
  13. package/dist/chunk-NW7HGA2K.js +1 -0
  14. package/dist/chunk-NY55QTVQ.js +120 -0
  15. package/dist/chunk-OHKJGCWS.js +186 -0
  16. package/dist/chunk-OKDJRKJV.js +4390 -0
  17. package/dist/chunk-PPJUFV6S.js +1179 -0
  18. package/dist/chunk-RGZBC7NF.js +90 -0
  19. package/dist/chunk-SG6ZTIMT.js +145 -0
  20. package/dist/chunk-VBATFCWR.js +442 -0
  21. package/dist/chunk-W5EJAOWD.js +462 -0
  22. package/dist/chunk-WVWV7DLA.js +6061 -0
  23. package/dist/chunk-XDU6TD4O.js +20 -0
  24. package/dist/chunk-ZX4WNSZ5.js +71 -0
  25. package/dist/egress-4V6DVJZ7.js +1 -0
  26. package/dist/install-A2PSSNW6.js +19 -0
  27. package/dist/render-ZQQ4UMNO.js +40 -0
  28. package/dist/run-CFA4LZWQ.js +203 -0
  29. package/dist/runDemo-VWKBJRSL.js +327 -0
  30. package/dist/runTrialGroup-NCD4Q2QU.js +277 -0
  31. package/dist/server-Y52EIWDP.js +3 -0
  32. package/dist/src/cli/main.js +5381 -1079
  33. package/dist/src-4SVLX7UK.js +4398 -0
  34. package/dist/src-GGRWNJTK.js +2869 -0
  35. package/dist/src-JGOW5WYI.js +5 -0
  36. package/dist/src-KIHABGI5.js +5 -0
  37. package/dist/src-TUX5L2RC.js +4 -0
  38. package/dist/twinHarness-IZC72UQN.js +5 -0
  39. package/dist/twinStart-S2CCEZWQ.js +111 -0
  40. package/package.json +17 -27
  41. package/dist/examples/agents/llm-refund-agent.d.ts +0 -1
  42. package/dist/examples/agents/llm-refund-agent.js +0 -140
  43. package/dist/examples/agents/llm-triage-agent.d.ts +0 -1
  44. package/dist/examples/agents/llm-triage-agent.js +0 -136
  45. package/dist/examples/agents/mcp-loop-agent.d.ts +0 -1
  46. package/dist/examples/agents/mcp-loop-agent.js +0 -61
  47. package/dist/examples/agents/scripted-pr-reviewer-agent.d.ts +0 -1
  48. package/dist/examples/agents/scripted-pr-reviewer-agent.js +0 -77
  49. package/dist/examples/agents/scripted-triage-agent.d.ts +0 -1
  50. package/dist/examples/agents/scripted-triage-agent.js +0 -92
  51. package/dist/src/capture-server/egress.d.ts +0 -19
  52. package/dist/src/capture-server/egress.js +0 -152
  53. package/dist/src/capture-server/index.d.ts +0 -12
  54. package/dist/src/capture-server/index.js +0 -198
  55. package/dist/src/capture-server/run.d.ts +0 -7
  56. package/dist/src/capture-server/run.js +0 -26
  57. package/dist/src/cli/agent-identity.d.ts +0 -20
  58. package/dist/src/cli/agent-identity.js +0 -64
  59. package/dist/src/cli/agent-resolver.d.ts +0 -29
  60. package/dist/src/cli/agent-resolver.js +0 -131
  61. package/dist/src/cli/checks-add.d.ts +0 -27
  62. package/dist/src/cli/checks-add.js +0 -238
  63. package/dist/src/cli/checks-lint.d.ts +0 -1
  64. package/dist/src/cli/checks-lint.js +0 -59
  65. package/dist/src/cli/checks.d.ts +0 -36
  66. package/dist/src/cli/checks.js +0 -197
  67. package/dist/src/cli/compile-seeds.d.ts +0 -7
  68. package/dist/src/cli/compile-seeds.js +0 -260
  69. package/dist/src/cli/credentials.d.ts +0 -32
  70. package/dist/src/cli/credentials.js +0 -121
  71. package/dist/src/cli/criterion-binding.d.ts +0 -41
  72. package/dist/src/cli/criterion-binding.js +0 -111
  73. package/dist/src/cli/default-task.d.ts +0 -38
  74. package/dist/src/cli/default-task.js +0 -141
  75. package/dist/src/cli/defaults.d.ts +0 -4
  76. package/dist/src/cli/defaults.js +0 -5
  77. package/dist/src/cli/docs-topics.d.ts +0 -13
  78. package/dist/src/cli/docs-topics.js +0 -157
  79. package/dist/src/cli/docs.d.ts +0 -7
  80. package/dist/src/cli/docs.js +0 -178
  81. package/dist/src/cli/eval.d.ts +0 -83
  82. package/dist/src/cli/eval.js +0 -443
  83. package/dist/src/cli/frameworks.d.ts +0 -12
  84. package/dist/src/cli/frameworks.js +0 -62
  85. package/dist/src/cli/init-sdk.d.ts +0 -12
  86. package/dist/src/cli/init-sdk.js +0 -140
  87. package/dist/src/cli/install.d.ts +0 -4
  88. package/dist/src/cli/install.js +0 -36
  89. package/dist/src/cli/keychain.d.ts +0 -5
  90. package/dist/src/cli/keychain.js +0 -80
  91. package/dist/src/cli/link-cache.d.ts +0 -23
  92. package/dist/src/cli/link-cache.js +0 -91
  93. package/dist/src/cli/login.d.ts +0 -6
  94. package/dist/src/cli/login.js +0 -195
  95. package/dist/src/cli/main.d.ts +0 -3
  96. package/dist/src/cli/project-config.d.ts +0 -37
  97. package/dist/src/cli/project-config.js +0 -145
  98. package/dist/src/cli/register.d.ts +0 -33
  99. package/dist/src/cli/register.js +0 -194
  100. package/dist/src/cli/resolve-package-root.d.ts +0 -2
  101. package/dist/src/cli/resolve-package-root.js +0 -20
  102. package/dist/src/cli/session.d.ts +0 -35
  103. package/dist/src/cli/session.js +0 -294
  104. package/dist/src/cli/tasks-catalog.d.ts +0 -25
  105. package/dist/src/cli/tasks-catalog.js +0 -196
  106. package/dist/src/cli/tasks.d.ts +0 -13
  107. package/dist/src/cli/tasks.js +0 -144
  108. package/dist/src/cli/vocabulary-skew.d.ts +0 -64
  109. package/dist/src/cli/vocabulary-skew.js +0 -187
  110. package/dist/src/demo/agent.d.ts +0 -30
  111. package/dist/src/demo/agent.js +0 -231
  112. package/dist/src/demo/capacity.d.ts +0 -18
  113. package/dist/src/demo/capacity.js +0 -94
  114. package/dist/src/demo/gateway.d.ts +0 -66
  115. package/dist/src/demo/gateway.js +0 -76
  116. package/dist/src/demo/ids.d.ts +0 -4
  117. package/dist/src/demo/ids.js +0 -28
  118. package/dist/src/demo/mint.d.ts +0 -17
  119. package/dist/src/demo/mint.js +0 -78
  120. package/dist/src/demo/proxyRequest.d.ts +0 -21
  121. package/dist/src/demo/proxyRequest.js +0 -156
  122. package/dist/src/demo/render.d.ts +0 -32
  123. package/dist/src/demo/render.js +0 -96
  124. package/dist/src/demo/runDemo.d.ts +0 -33
  125. package/dist/src/demo/runDemo.js +0 -314
  126. package/dist/src/demo/task.d.ts +0 -10
  127. package/dist/src/demo/task.js +0 -32
  128. package/dist/src/doctor/checks.d.ts +0 -19
  129. package/dist/src/doctor/checks.js +0 -208
  130. package/dist/src/doctor/render.d.ts +0 -17
  131. package/dist/src/doctor/render.js +0 -39
  132. package/dist/src/doctor/scan.d.ts +0 -16
  133. package/dist/src/doctor/scan.js +0 -127
  134. package/dist/src/fix-prompt/index.d.ts +0 -20
  135. package/dist/src/fix-prompt/index.js +0 -31
  136. package/dist/src/fix-prompt/prompt.d.ts +0 -32
  137. package/dist/src/fix-prompt/prompt.js +0 -240
  138. package/dist/src/hosted/client.d.ts +0 -209
  139. package/dist/src/hosted/client.js +0 -722
  140. package/dist/src/hosted/errors.d.ts +0 -60
  141. package/dist/src/hosted/errors.js +0 -120
  142. package/dist/src/hosted/evalResultCache.d.ts +0 -71
  143. package/dist/src/hosted/evalResultCache.js +0 -219
  144. package/dist/src/hosted/evalResultView.d.ts +0 -40
  145. package/dist/src/hosted/evalResultView.js +0 -103
  146. package/dist/src/hosted/uploadAndFinalize.d.ts +0 -85
  147. package/dist/src/hosted/uploadAndFinalize.js +0 -238
  148. package/dist/src/recorder/artifacts.d.ts +0 -34
  149. package/dist/src/recorder/artifacts.js +0 -153
  150. package/dist/src/recorder/inspect.d.ts +0 -37
  151. package/dist/src/recorder/inspect.js +0 -195
  152. package/dist/src/recorder/recorder.d.ts +0 -14
  153. package/dist/src/recorder/recorder.js +0 -16
  154. package/dist/src/recorder/redaction.d.ts +0 -1
  155. package/dist/src/recorder/redaction.js +0 -2
  156. package/dist/src/recorder/specMeta.d.ts +0 -8
  157. package/dist/src/recorder/specMeta.js +0 -79
  158. package/dist/src/runner/agentRunner.d.ts +0 -12
  159. package/dist/src/runner/agentRunner.js +0 -163
  160. package/dist/src/runner/captureServerChild.d.ts +0 -16
  161. package/dist/src/runner/captureServerChild.js +0 -148
  162. package/dist/src/runner/groupRender.d.ts +0 -65
  163. package/dist/src/runner/groupRender.js +0 -144
  164. package/dist/src/runner/mergeAdapterSignals.d.ts +0 -27
  165. package/dist/src/runner/mergeAdapterSignals.js +0 -137
  166. package/dist/src/runner/ports.d.ts +0 -1
  167. package/dist/src/runner/ports.js +0 -21
  168. package/dist/src/runner/runTask.d.ts +0 -831
  169. package/dist/src/runner/runTask.js +0 -275
  170. package/dist/src/runner/runTaskCore.d.ts +0 -21
  171. package/dist/src/runner/runTaskCore.js +0 -26
  172. package/dist/src/runner/runTaskHosted.d.ts +0 -97
  173. package/dist/src/runner/runTaskHosted.js +0 -660
  174. package/dist/src/runner/runTrialGroup.d.ts +0 -49
  175. package/dist/src/runner/runTrialGroup.js +0 -264
  176. package/dist/src/runner/trialCount.d.ts +0 -8
  177. package/dist/src/runner/trialCount.js +0 -32
  178. package/dist/src/scaffolds/mcp-loop/loop.d.ts +0 -47
  179. package/dist/src/scaffolds/mcp-loop/loop.js +0 -331
  180. package/dist/src/scaffolds/mcp-loop/providers.d.ts +0 -29
  181. package/dist/src/scaffolds/mcp-loop/providers.js +0 -142
  182. package/dist/src/task/githubSeedCompat.d.ts +0 -3
  183. package/dist/src/task/githubSeedCompat.js +0 -48
  184. package/dist/src/task/insertCriterion.d.ts +0 -15
  185. package/dist/src/task/insertCriterion.js +0 -67
  186. package/dist/src/task/parseTask.d.ts +0 -35
  187. package/dist/src/task/parseTask.js +0 -398
  188. package/dist/src/task/seed-compiler-hosted.d.ts +0 -8
  189. package/dist/src/task/seed-compiler-hosted.js +0 -122
  190. package/dist/src/task/seed-compiler.d.ts +0 -11
  191. package/dist/src/task/seed-compiler.js +0 -61
  192. package/dist/src/task/seed-verifier.d.ts +0 -1
  193. package/dist/src/task/seed-verifier.js +0 -23
  194. package/dist/src/task/taskSchema.d.ts +0 -1978
  195. package/dist/src/task/taskSchema.js +0 -106
  196. package/dist/src/twin/githubCloneAdapter.d.ts +0 -70
  197. package/dist/src/twin/githubCloneAdapter.js +0 -19
  198. package/dist/src/twin/twinHarness.d.ts +0 -52
  199. package/dist/src/twin/twinHarness.js +0 -186
  200. package/dist/src/twin/twinStart.d.ts +0 -21
  201. package/dist/src/twin/twinStart.js +0 -174
  202. package/dist/src/types/shared.d.ts +0 -1
  203. package/dist/src/types/shared.js +0 -2
  204. package/node_modules/@hono/node-server/LICENSE +0 -21
  205. package/node_modules/@hono/node-server/README.md +0 -437
  206. package/node_modules/@hono/node-server/dist/conninfo.cjs +0 -22
  207. package/node_modules/@hono/node-server/dist/conninfo.d.cts +0 -11
  208. package/node_modules/@hono/node-server/dist/conninfo.d.mts +0 -11
  209. package/node_modules/@hono/node-server/dist/conninfo.mjs +0 -20
  210. package/node_modules/@hono/node-server/dist/constants-BLSFu_RU.mjs +0 -5
  211. package/node_modules/@hono/node-server/dist/constants-BXAKTxRC.cjs +0 -11
  212. package/node_modules/@hono/node-server/dist/early-hints.cjs +0 -35
  213. package/node_modules/@hono/node-server/dist/early-hints.d.cts +0 -16
  214. package/node_modules/@hono/node-server/dist/early-hints.d.mts +0 -16
  215. package/node_modules/@hono/node-server/dist/early-hints.mjs +0 -33
  216. package/node_modules/@hono/node-server/dist/index.cjs +0 -1176
  217. package/node_modules/@hono/node-server/dist/index.d.cts +0 -101
  218. package/node_modules/@hono/node-server/dist/index.d.mts +0 -101
  219. package/node_modules/@hono/node-server/dist/index.mjs +0 -1171
  220. package/node_modules/@hono/node-server/dist/serve-static.cjs +0 -151
  221. package/node_modules/@hono/node-server/dist/serve-static.d.cts +0 -18
  222. package/node_modules/@hono/node-server/dist/serve-static.d.mts +0 -18
  223. package/node_modules/@hono/node-server/dist/serve-static.mjs +0 -150
  224. package/node_modules/@hono/node-server/dist/utils/response.cjs +0 -8
  225. package/node_modules/@hono/node-server/dist/utils/response.d.cts +0 -4
  226. package/node_modules/@hono/node-server/dist/utils/response.d.mts +0 -4
  227. package/node_modules/@hono/node-server/dist/utils/response.mjs +0 -7
  228. package/node_modules/@hono/node-server/dist/utils/stream.cjs +0 -65
  229. package/node_modules/@hono/node-server/dist/utils/stream.d.cts +0 -6
  230. package/node_modules/@hono/node-server/dist/utils/stream.d.mts +0 -6
  231. package/node_modules/@hono/node-server/dist/utils/stream.mjs +0 -64
  232. package/node_modules/@hono/node-server/package.json +0 -127
  233. package/node_modules/@pome-sh/sdk/dist/admin-gate.d.ts +0 -35
  234. package/node_modules/@pome-sh/sdk/dist/admin-gate.js +0 -103
  235. package/node_modules/@pome-sh/sdk/dist/admin-gate.js.map +0 -1
  236. package/node_modules/@pome-sh/sdk/dist/auth.d.ts +0 -100
  237. package/node_modules/@pome-sh/sdk/dist/auth.js +0 -262
  238. package/node_modules/@pome-sh/sdk/dist/auth.js.map +0 -1
  239. package/node_modules/@pome-sh/sdk/dist/build-info.d.ts +0 -7
  240. package/node_modules/@pome-sh/sdk/dist/build-info.js +0 -14
  241. package/node_modules/@pome-sh/sdk/dist/build-info.js.map +0 -1
  242. package/node_modules/@pome-sh/sdk/dist/check-discrimination.d.ts +0 -7
  243. package/node_modules/@pome-sh/sdk/dist/check-discrimination.js +0 -81
  244. package/node_modules/@pome-sh/sdk/dist/check-discrimination.js.map +0 -1
  245. package/node_modules/@pome-sh/sdk/dist/check-state-path.d.ts +0 -71
  246. package/node_modules/@pome-sh/sdk/dist/check-state-path.js +0 -200
  247. package/node_modules/@pome-sh/sdk/dist/check-state-path.js.map +0 -1
  248. package/node_modules/@pome-sh/sdk/dist/checks.d.ts +0 -93
  249. package/node_modules/@pome-sh/sdk/dist/checks.js +0 -218
  250. package/node_modules/@pome-sh/sdk/dist/checks.js.map +0 -1
  251. package/node_modules/@pome-sh/sdk/dist/db.d.ts +0 -44
  252. package/node_modules/@pome-sh/sdk/dist/db.js +0 -113
  253. package/node_modules/@pome-sh/sdk/dist/db.js.map +0 -1
  254. package/node_modules/@pome-sh/sdk/dist/errors.d.ts +0 -24
  255. package/node_modules/@pome-sh/sdk/dist/errors.js +0 -61
  256. package/node_modules/@pome-sh/sdk/dist/errors.js.map +0 -1
  257. package/node_modules/@pome-sh/sdk/dist/failure-injection.d.ts +0 -43
  258. package/node_modules/@pome-sh/sdk/dist/failure-injection.js +0 -167
  259. package/node_modules/@pome-sh/sdk/dist/failure-injection.js.map +0 -1
  260. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.d.ts +0 -121
  261. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js +0 -204
  262. package/node_modules/@pome-sh/sdk/dist/fidelity-inventory.js.map +0 -1
  263. package/node_modules/@pome-sh/sdk/dist/fidelity.d.ts +0 -8
  264. package/node_modules/@pome-sh/sdk/dist/fidelity.js +0 -39
  265. package/node_modules/@pome-sh/sdk/dist/fidelity.js.map +0 -1
  266. package/node_modules/@pome-sh/sdk/dist/index.d.ts +0 -380
  267. package/node_modules/@pome-sh/sdk/dist/index.js +0 -140
  268. package/node_modules/@pome-sh/sdk/dist/index.js.map +0 -1
  269. package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.d.ts +0 -10
  270. package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js +0 -231
  271. package/node_modules/@pome-sh/sdk/dist/mcp-jsonrpc.js.map +0 -1
  272. package/node_modules/@pome-sh/sdk/dist/parity.d.ts +0 -61
  273. package/node_modules/@pome-sh/sdk/dist/parity.js +0 -123
  274. package/node_modules/@pome-sh/sdk/dist/parity.js.map +0 -1
  275. package/node_modules/@pome-sh/sdk/dist/recorder.d.ts +0 -129
  276. package/node_modules/@pome-sh/sdk/dist/recorder.js +0 -381
  277. package/node_modules/@pome-sh/sdk/dist/recorder.js.map +0 -1
  278. package/node_modules/@pome-sh/sdk/dist/redaction.d.ts +0 -1
  279. package/node_modules/@pome-sh/sdk/dist/redaction.js +0 -3
  280. package/node_modules/@pome-sh/sdk/dist/redaction.js.map +0 -1
  281. package/node_modules/@pome-sh/sdk/dist/request-capture.d.ts +0 -31
  282. package/node_modules/@pome-sh/sdk/dist/request-capture.js +0 -59
  283. package/node_modules/@pome-sh/sdk/dist/request-capture.js.map +0 -1
  284. package/node_modules/@pome-sh/sdk/dist/server-helpers.d.ts +0 -54
  285. package/node_modules/@pome-sh/sdk/dist/server-helpers.js +0 -181
  286. package/node_modules/@pome-sh/sdk/dist/server-helpers.js.map +0 -1
  287. package/node_modules/@pome-sh/sdk/dist/server.d.ts +0 -47
  288. package/node_modules/@pome-sh/sdk/dist/server.js +0 -407
  289. package/node_modules/@pome-sh/sdk/dist/server.js.map +0 -1
  290. package/node_modules/@pome-sh/sdk/dist/tool-context.d.ts +0 -8
  291. package/node_modules/@pome-sh/sdk/dist/tool-context.js +0 -22
  292. package/node_modules/@pome-sh/sdk/dist/tool-context.js.map +0 -1
  293. package/node_modules/@pome-sh/sdk/package.json +0 -58
  294. package/node_modules/@pome-sh/shared-types/dist/errors.d.ts +0 -39
  295. package/node_modules/@pome-sh/shared-types/dist/errors.js +0 -33
  296. package/node_modules/@pome-sh/shared-types/dist/errors.js.map +0 -1
  297. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.d.ts +0 -254
  298. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js +0 -122
  299. package/node_modules/@pome-sh/shared-types/dist/finalize-shapes.js.map +0 -1
  300. package/node_modules/@pome-sh/shared-types/dist/github-access-control.d.ts +0 -175
  301. package/node_modules/@pome-sh/shared-types/dist/github-access-control.js +0 -182
  302. package/node_modules/@pome-sh/shared-types/dist/github-access-control.js.map +0 -1
  303. package/node_modules/@pome-sh/shared-types/dist/identity.d.ts +0 -90
  304. package/node_modules/@pome-sh/shared-types/dist/identity.js +0 -72
  305. package/node_modules/@pome-sh/shared-types/dist/identity.js.map +0 -1
  306. package/node_modules/@pome-sh/shared-types/dist/index.d.ts +0 -28
  307. package/node_modules/@pome-sh/shared-types/dist/index.js +0 -35
  308. package/node_modules/@pome-sh/shared-types/dist/index.js.map +0 -1
  309. package/node_modules/@pome-sh/shared-types/dist/manifest.d.ts +0 -31
  310. package/node_modules/@pome-sh/shared-types/dist/manifest.js +0 -76
  311. package/node_modules/@pome-sh/shared-types/dist/manifest.js.map +0 -1
  312. package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.d.ts +0 -424
  313. package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js +0 -33
  314. package/node_modules/@pome-sh/shared-types/dist/otel/event-schema.js.map +0 -1
  315. package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.d.ts +0 -65
  316. package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js +0 -455
  317. package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/data.js.map +0 -1
  318. package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.d.ts +0 -39
  319. package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js +0 -47
  320. package/node_modules/@pome-sh/shared-types/dist/otel/fixtures/index.js.map +0 -1
  321. package/node_modules/@pome-sh/shared-types/dist/otel/index.d.ts +0 -25
  322. package/node_modules/@pome-sh/shared-types/dist/otel/index.js +0 -27
  323. package/node_modules/@pome-sh/shared-types/dist/otel/index.js.map +0 -1
  324. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.d.ts +0 -105
  325. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js +0 -198
  326. package/node_modules/@pome-sh/shared-types/dist/otel/legacy-shim.js.map +0 -1
  327. package/node_modules/@pome-sh/shared-types/dist/otel/map-span.d.ts +0 -64
  328. package/node_modules/@pome-sh/shared-types/dist/otel/map-span.js +0 -112
  329. package/node_modules/@pome-sh/shared-types/dist/otel/map-span.js.map +0 -1
  330. package/node_modules/@pome-sh/shared-types/dist/otel/nano.d.ts +0 -26
  331. package/node_modules/@pome-sh/shared-types/dist/otel/nano.js +0 -61
  332. package/node_modules/@pome-sh/shared-types/dist/otel/nano.js.map +0 -1
  333. package/node_modules/@pome-sh/shared-types/dist/otel/project.d.ts +0 -42
  334. package/node_modules/@pome-sh/shared-types/dist/otel/project.js +0 -104
  335. package/node_modules/@pome-sh/shared-types/dist/otel/project.js.map +0 -1
  336. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.d.ts +0 -57
  337. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.js +0 -102
  338. package/node_modules/@pome-sh/shared-types/dist/otel/semconv.js.map +0 -1
  339. package/node_modules/@pome-sh/shared-types/dist/otel/span-event.d.ts +0 -198
  340. package/node_modules/@pome-sh/shared-types/dist/otel/span-event.js +0 -166
  341. package/node_modules/@pome-sh/shared-types/dist/otel/span-event.js.map +0 -1
  342. package/node_modules/@pome-sh/shared-types/dist/recorder-events.d.ts +0 -526
  343. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js +0 -381
  344. package/node_modules/@pome-sh/shared-types/dist/recorder-events.js.map +0 -1
  345. package/node_modules/@pome-sh/shared-types/dist/redaction.d.ts +0 -2
  346. package/node_modules/@pome-sh/shared-types/dist/redaction.js +0 -152
  347. package/node_modules/@pome-sh/shared-types/dist/redaction.js.map +0 -1
  348. package/node_modules/@pome-sh/shared-types/dist/rest.d.ts +0 -259
  349. package/node_modules/@pome-sh/shared-types/dist/rest.js +0 -346
  350. package/node_modules/@pome-sh/shared-types/dist/rest.js.map +0 -1
  351. package/node_modules/@pome-sh/shared-types/dist/run.d.ts +0 -208
  352. package/node_modules/@pome-sh/shared-types/dist/run.js +0 -170
  353. package/node_modules/@pome-sh/shared-types/dist/run.js.map +0 -1
  354. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.d.ts +0 -14
  355. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.js +0 -46
  356. package/node_modules/@pome-sh/shared-types/dist/seed-envelope.js.map +0 -1
  357. package/node_modules/@pome-sh/shared-types/dist/seed-state.d.ts +0 -1506
  358. package/node_modules/@pome-sh/shared-types/dist/seed-state.js +0 -462
  359. package/node_modules/@pome-sh/shared-types/dist/seed-state.js.map +0 -1
  360. package/node_modules/@pome-sh/shared-types/dist/sessions.d.ts +0 -53
  361. package/node_modules/@pome-sh/shared-types/dist/sessions.js +0 -51
  362. package/node_modules/@pome-sh/shared-types/dist/sessions.js.map +0 -1
  363. package/node_modules/@pome-sh/shared-types/dist/task-vocab.d.ts +0 -80
  364. package/node_modules/@pome-sh/shared-types/dist/task-vocab.js +0 -98
  365. package/node_modules/@pome-sh/shared-types/dist/task-vocab.js.map +0 -1
  366. package/node_modules/@pome-sh/shared-types/dist/task.d.ts +0 -1193
  367. package/node_modules/@pome-sh/shared-types/dist/task.js +0 -60
  368. package/node_modules/@pome-sh/shared-types/dist/task.js.map +0 -1
  369. package/node_modules/@pome-sh/shared-types/manifest-schema.json +0 -68
  370. package/node_modules/@pome-sh/shared-types/package.json +0 -55
  371. package/node_modules/@pome-sh/shared-types/trace-contract.json +0 -89
  372. package/node_modules/@pome-sh/twin-github/FIDELITY.md +0 -395
  373. package/node_modules/@pome-sh/twin-github/README.md +0 -254
  374. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.d.ts +0 -1
  375. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.js +0 -222
  376. package/node_modules/@pome-sh/twin-github/dist/examples/claude-github-agent.js.map +0 -1
  377. package/node_modules/@pome-sh/twin-github/dist/examples/mcp-node.d.ts +0 -1
  378. package/node_modules/@pome-sh/twin-github/dist/examples/mcp-node.js +0 -15
  379. package/node_modules/@pome-sh/twin-github/dist/examples/mcp-node.js.map +0 -1
  380. package/node_modules/@pome-sh/twin-github/dist/examples/mini-bot-flow.d.ts +0 -1
  381. package/node_modules/@pome-sh/twin-github/dist/examples/mini-bot-flow.js +0 -39
  382. package/node_modules/@pome-sh/twin-github/dist/examples/mini-bot-flow.js.map +0 -1
  383. package/node_modules/@pome-sh/twin-github/dist/src/access-control.d.ts +0 -32
  384. package/node_modules/@pome-sh/twin-github/dist/src/access-control.js +0 -20
  385. package/node_modules/@pome-sh/twin-github/dist/src/access-control.js.map +0 -1
  386. package/node_modules/@pome-sh/twin-github/dist/src/check-issues.d.ts +0 -30
  387. package/node_modules/@pome-sh/twin-github/dist/src/check-issues.js +0 -268
  388. package/node_modules/@pome-sh/twin-github/dist/src/check-issues.js.map +0 -1
  389. package/node_modules/@pome-sh/twin-github/dist/src/check-kind.d.ts +0 -3
  390. package/node_modules/@pome-sh/twin-github/dist/src/check-kind.js +0 -10
  391. package/node_modules/@pome-sh/twin-github/dist/src/check-kind.js.map +0 -1
  392. package/node_modules/@pome-sh/twin-github/dist/src/check-params.d.ts +0 -13
  393. package/node_modules/@pome-sh/twin-github/dist/src/check-params.js +0 -116
  394. package/node_modules/@pome-sh/twin-github/dist/src/check-params.js.map +0 -1
  395. package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.d.ts +0 -15
  396. package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.js +0 -237
  397. package/node_modules/@pome-sh/twin-github/dist/src/check-pulls.js.map +0 -1
  398. package/node_modules/@pome-sh/twin-github/dist/src/check-repos.d.ts +0 -16
  399. package/node_modules/@pome-sh/twin-github/dist/src/check-repos.js +0 -256
  400. package/node_modules/@pome-sh/twin-github/dist/src/check-repos.js.map +0 -1
  401. package/node_modules/@pome-sh/twin-github/dist/src/check-state.d.ts +0 -77
  402. package/node_modules/@pome-sh/twin-github/dist/src/check-state.js +0 -147
  403. package/node_modules/@pome-sh/twin-github/dist/src/check-state.js.map +0 -1
  404. package/node_modules/@pome-sh/twin-github/dist/src/check-tape.d.ts +0 -5
  405. package/node_modules/@pome-sh/twin-github/dist/src/check-tape.js +0 -182
  406. package/node_modules/@pome-sh/twin-github/dist/src/check-tape.js.map +0 -1
  407. package/node_modules/@pome-sh/twin-github/dist/src/check-worlds.d.ts +0 -13
  408. package/node_modules/@pome-sh/twin-github/dist/src/check-worlds.js +0 -33
  409. package/node_modules/@pome-sh/twin-github/dist/src/check-worlds.js.map +0 -1
  410. package/node_modules/@pome-sh/twin-github/dist/src/checks.d.ts +0 -50
  411. package/node_modules/@pome-sh/twin-github/dist/src/checks.js +0 -79
  412. package/node_modules/@pome-sh/twin-github/dist/src/checks.js.map +0 -1
  413. package/node_modules/@pome-sh/twin-github/dist/src/db.d.ts +0 -4
  414. package/node_modules/@pome-sh/twin-github/dist/src/db.js +0 -443
  415. package/node_modules/@pome-sh/twin-github/dist/src/db.js.map +0 -1
  416. package/node_modules/@pome-sh/twin-github/dist/src/domain/checks.d.ts +0 -153
  417. package/node_modules/@pome-sh/twin-github/dist/src/domain/checks.js +0 -66
  418. package/node_modules/@pome-sh/twin-github/dist/src/domain/checks.js.map +0 -1
  419. package/node_modules/@pome-sh/twin-github/dist/src/domain/git.d.ts +0 -567
  420. package/node_modules/@pome-sh/twin-github/dist/src/domain/git.js +0 -198
  421. package/node_modules/@pome-sh/twin-github/dist/src/domain/git.js.map +0 -1
  422. package/node_modules/@pome-sh/twin-github/dist/src/domain/github-domain.d.ts +0 -3106
  423. package/node_modules/@pome-sh/twin-github/dist/src/domain/github-domain.js +0 -842
  424. package/node_modules/@pome-sh/twin-github/dist/src/domain/github-domain.js.map +0 -1
  425. package/node_modules/@pome-sh/twin-github/dist/src/domain/helpers.d.ts +0 -5
  426. package/node_modules/@pome-sh/twin-github/dist/src/domain/helpers.js +0 -15
  427. package/node_modules/@pome-sh/twin-github/dist/src/domain/helpers.js.map +0 -1
  428. package/node_modules/@pome-sh/twin-github/dist/src/domain/index.d.ts +0 -2
  429. package/node_modules/@pome-sh/twin-github/dist/src/domain/index.js +0 -5
  430. package/node_modules/@pome-sh/twin-github/dist/src/domain/index.js.map +0 -1
  431. package/node_modules/@pome-sh/twin-github/dist/src/domain/issues.d.ts +0 -545
  432. package/node_modules/@pome-sh/twin-github/dist/src/domain/issues.js +0 -282
  433. package/node_modules/@pome-sh/twin-github/dist/src/domain/issues.js.map +0 -1
  434. package/node_modules/@pome-sh/twin-github/dist/src/domain/pulls.d.ts +0 -816
  435. package/node_modules/@pome-sh/twin-github/dist/src/domain/pulls.js +0 -256
  436. package/node_modules/@pome-sh/twin-github/dist/src/domain/pulls.js.map +0 -1
  437. package/node_modules/@pome-sh/twin-github/dist/src/domain/releases.d.ts +0 -160
  438. package/node_modules/@pome-sh/twin-github/dist/src/domain/releases.js +0 -63
  439. package/node_modules/@pome-sh/twin-github/dist/src/domain/releases.js.map +0 -1
  440. package/node_modules/@pome-sh/twin-github/dist/src/domain/repos.d.ts +0 -219
  441. package/node_modules/@pome-sh/twin-github/dist/src/domain/repos.js +0 -131
  442. package/node_modules/@pome-sh/twin-github/dist/src/domain/repos.js.map +0 -1
  443. package/node_modules/@pome-sh/twin-github/dist/src/domain/search.d.ts +0 -252
  444. package/node_modules/@pome-sh/twin-github/dist/src/domain/search.js +0 -83
  445. package/node_modules/@pome-sh/twin-github/dist/src/domain/search.js.map +0 -1
  446. package/node_modules/@pome-sh/twin-github/dist/src/domain/types.d.ts +0 -15
  447. package/node_modules/@pome-sh/twin-github/dist/src/domain/types.js +0 -2
  448. package/node_modules/@pome-sh/twin-github/dist/src/domain/types.js.map +0 -1
  449. package/node_modules/@pome-sh/twin-github/dist/src/errors.d.ts +0 -14
  450. package/node_modules/@pome-sh/twin-github/dist/src/errors.js +0 -35
  451. package/node_modules/@pome-sh/twin-github/dist/src/errors.js.map +0 -1
  452. package/node_modules/@pome-sh/twin-github/dist/src/index.d.ts +0 -9
  453. package/node_modules/@pome-sh/twin-github/dist/src/index.js +0 -7
  454. package/node_modules/@pome-sh/twin-github/dist/src/index.js.map +0 -1
  455. package/node_modules/@pome-sh/twin-github/dist/src/routes.d.ts +0 -4
  456. package/node_modules/@pome-sh/twin-github/dist/src/routes.js +0 -372
  457. package/node_modules/@pome-sh/twin-github/dist/src/routes.js.map +0 -1
  458. package/node_modules/@pome-sh/twin-github/dist/src/seed.d.ts +0 -84
  459. package/node_modules/@pome-sh/twin-github/dist/src/seed.js +0 -170
  460. package/node_modules/@pome-sh/twin-github/dist/src/seed.js.map +0 -1
  461. package/node_modules/@pome-sh/twin-github/dist/src/serializers.d.ts +0 -926
  462. package/node_modules/@pome-sh/twin-github/dist/src/serializers.js +0 -685
  463. package/node_modules/@pome-sh/twin-github/dist/src/serializers.js.map +0 -1
  464. package/node_modules/@pome-sh/twin-github/dist/src/server.d.ts +0 -2
  465. package/node_modules/@pome-sh/twin-github/dist/src/server.js +0 -43
  466. package/node_modules/@pome-sh/twin-github/dist/src/server.js.map +0 -1
  467. package/node_modules/@pome-sh/twin-github/dist/src/tools.d.ts +0 -2815
  468. package/node_modules/@pome-sh/twin-github/dist/src/tools.js +0 -621
  469. package/node_modules/@pome-sh/twin-github/dist/src/tools.js.map +0 -1
  470. package/node_modules/@pome-sh/twin-github/dist/src/twin.d.ts +0 -15
  471. package/node_modules/@pome-sh/twin-github/dist/src/twin.js +0 -193
  472. package/node_modules/@pome-sh/twin-github/dist/src/twin.js.map +0 -1
  473. package/node_modules/@pome-sh/twin-github/dist/src/types.d.ts +0 -244
  474. package/node_modules/@pome-sh/twin-github/dist/src/types.js +0 -2
  475. package/node_modules/@pome-sh/twin-github/dist/src/types.js.map +0 -1
  476. package/node_modules/@pome-sh/twin-github/dist/src/unsupported-envelope.d.ts +0 -10
  477. package/node_modules/@pome-sh/twin-github/dist/src/unsupported-envelope.js +0 -27
  478. package/node_modules/@pome-sh/twin-github/dist/src/unsupported-envelope.js.map +0 -1
  479. package/node_modules/@pome-sh/twin-github/dist/src/upstream-types.d.ts +0 -30
  480. package/node_modules/@pome-sh/twin-github/dist/src/upstream-types.js +0 -2
  481. package/node_modules/@pome-sh/twin-github/dist/src/upstream-types.js.map +0 -1
  482. package/node_modules/@pome-sh/twin-github/dist/src/util.d.ts +0 -12
  483. package/node_modules/@pome-sh/twin-github/dist/src/util.js +0 -63
  484. package/node_modules/@pome-sh/twin-github/dist/src/util.js.map +0 -1
  485. package/node_modules/@pome-sh/twin-github/fidelity.inventory.json +0 -773
  486. package/node_modules/@pome-sh/twin-github/package.json +0 -63
  487. package/node_modules/@pome-sh/twin-gmail/CHANGELOG.md +0 -126
  488. package/node_modules/@pome-sh/twin-gmail/HOSTED.md +0 -45
  489. package/node_modules/@pome-sh/twin-gmail/LIMITS.md +0 -51
  490. package/node_modules/@pome-sh/twin-gmail/README.md +0 -150
  491. package/node_modules/@pome-sh/twin-gmail/REFERENCE-DIVERGENCES.md +0 -42
  492. package/node_modules/@pome-sh/twin-gmail/dist/fixtures/mcp-tools-list.canonical.json +0 -1209
  493. package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.d.ts +0 -7
  494. package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.js +0 -153
  495. package/node_modules/@pome-sh/twin-gmail/dist/src/check-drafts.js.map +0 -1
  496. package/node_modules/@pome-sh/twin-gmail/dist/src/check-kind.d.ts +0 -3
  497. package/node_modules/@pome-sh/twin-gmail/dist/src/check-kind.js +0 -9
  498. package/node_modules/@pome-sh/twin-gmail/dist/src/check-kind.js.map +0 -1
  499. package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.d.ts +0 -4
  500. package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.js +0 -67
  501. package/node_modules/@pome-sh/twin-gmail/dist/src/check-labels.js.map +0 -1
  502. package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.d.ts +0 -14
  503. package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.js +0 -223
  504. package/node_modules/@pome-sh/twin-gmail/dist/src/check-messages.js.map +0 -1
  505. package/node_modules/@pome-sh/twin-gmail/dist/src/check-params.d.ts +0 -10
  506. package/node_modules/@pome-sh/twin-gmail/dist/src/check-params.js +0 -96
  507. package/node_modules/@pome-sh/twin-gmail/dist/src/check-params.js.map +0 -1
  508. package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.d.ts +0 -138
  509. package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.js +0 -181
  510. package/node_modules/@pome-sh/twin-gmail/dist/src/check-state.js.map +0 -1
  511. package/node_modules/@pome-sh/twin-gmail/dist/src/check-tape.d.ts +0 -2
  512. package/node_modules/@pome-sh/twin-gmail/dist/src/check-tape.js +0 -103
  513. package/node_modules/@pome-sh/twin-gmail/dist/src/check-tape.js.map +0 -1
  514. package/node_modules/@pome-sh/twin-gmail/dist/src/check-worlds.d.ts +0 -17
  515. package/node_modules/@pome-sh/twin-gmail/dist/src/check-worlds.js +0 -62
  516. package/node_modules/@pome-sh/twin-gmail/dist/src/check-worlds.js.map +0 -1
  517. package/node_modules/@pome-sh/twin-gmail/dist/src/checks.d.ts +0 -19
  518. package/node_modules/@pome-sh/twin-gmail/dist/src/checks.js +0 -42
  519. package/node_modules/@pome-sh/twin-gmail/dist/src/checks.js.map +0 -1
  520. package/node_modules/@pome-sh/twin-gmail/dist/src/db.d.ts +0 -4
  521. package/node_modules/@pome-sh/twin-gmail/dist/src/db.js +0 -212
  522. package/node_modules/@pome-sh/twin-gmail/dist/src/db.js.map +0 -1
  523. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/drafts.d.ts +0 -41
  524. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/drafts.js +0 -138
  525. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/drafts.js.map +0 -1
  526. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/filters.d.ts +0 -10
  527. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/filters.js +0 -105
  528. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/filters.js.map +0 -1
  529. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/gmail-domain.d.ts +0 -121
  530. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/gmail-domain.js +0 -174
  531. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/gmail-domain.js.map +0 -1
  532. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/hydrate.d.ts +0 -8
  533. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/hydrate.js +0 -122
  534. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/hydrate.js.map +0 -1
  535. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/index.d.ts +0 -4
  536. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/index.js +0 -5
  537. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/index.js.map +0 -1
  538. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/labels.d.ts +0 -40
  539. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/labels.js +0 -122
  540. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/labels.js.map +0 -1
  541. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/messages.d.ts +0 -49
  542. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/messages.js +0 -276
  543. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/messages.js.map +0 -1
  544. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/search-sql.d.ts +0 -19
  545. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/search-sql.js +0 -179
  546. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/search-sql.js.map +0 -1
  547. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/settings.d.ts +0 -27
  548. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/settings.js +0 -98
  549. package/node_modules/@pome-sh/twin-gmail/dist/src/domain/settings.js.map +0 -1
  550. package/node_modules/@pome-sh/twin-gmail/dist/src/errors.d.ts +0 -12
  551. package/node_modules/@pome-sh/twin-gmail/dist/src/errors.js +0 -117
  552. package/node_modules/@pome-sh/twin-gmail/dist/src/errors.js.map +0 -1
  553. package/node_modules/@pome-sh/twin-gmail/dist/src/faults.d.ts +0 -21
  554. package/node_modules/@pome-sh/twin-gmail/dist/src/faults.js +0 -52
  555. package/node_modules/@pome-sh/twin-gmail/dist/src/faults.js.map +0 -1
  556. package/node_modules/@pome-sh/twin-gmail/dist/src/identity.d.ts +0 -5
  557. package/node_modules/@pome-sh/twin-gmail/dist/src/identity.js +0 -18
  558. package/node_modules/@pome-sh/twin-gmail/dist/src/identity.js.map +0 -1
  559. package/node_modules/@pome-sh/twin-gmail/dist/src/index.d.ts +0 -15
  560. package/node_modules/@pome-sh/twin-gmail/dist/src/index.js +0 -17
  561. package/node_modules/@pome-sh/twin-gmail/dist/src/index.js.map +0 -1
  562. package/node_modules/@pome-sh/twin-gmail/dist/src/mcp-schemas.d.ts +0 -224
  563. package/node_modules/@pome-sh/twin-gmail/dist/src/mcp-schemas.js +0 -185
  564. package/node_modules/@pome-sh/twin-gmail/dist/src/mcp-schemas.js.map +0 -1
  565. package/node_modules/@pome-sh/twin-gmail/dist/src/mcp.d.ts +0 -3
  566. package/node_modules/@pome-sh/twin-gmail/dist/src/mcp.js +0 -306
  567. package/node_modules/@pome-sh/twin-gmail/dist/src/mcp.js.map +0 -1
  568. package/node_modules/@pome-sh/twin-gmail/dist/src/mime.d.ts +0 -49
  569. package/node_modules/@pome-sh/twin-gmail/dist/src/mime.js +0 -315
  570. package/node_modules/@pome-sh/twin-gmail/dist/src/mime.js.map +0 -1
  571. package/node_modules/@pome-sh/twin-gmail/dist/src/page-tokens.d.ts +0 -11
  572. package/node_modules/@pome-sh/twin-gmail/dist/src/page-tokens.js +0 -70
  573. package/node_modules/@pome-sh/twin-gmail/dist/src/page-tokens.js.map +0 -1
  574. package/node_modules/@pome-sh/twin-gmail/dist/src/recording.d.ts +0 -6
  575. package/node_modules/@pome-sh/twin-gmail/dist/src/recording.js +0 -74
  576. package/node_modules/@pome-sh/twin-gmail/dist/src/recording.js.map +0 -1
  577. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-common.d.ts +0 -28
  578. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-common.js +0 -120
  579. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-common.js.map +0 -1
  580. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-drafts.d.ts +0 -3
  581. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-drafts.js +0 -84
  582. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-drafts.js.map +0 -1
  583. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-kit.d.ts +0 -18
  584. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-kit.js +0 -52
  585. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-kit.js.map +0 -1
  586. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-messages.d.ts +0 -3
  587. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-messages.js +0 -143
  588. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-messages.js.map +0 -1
  589. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-resources.d.ts +0 -3
  590. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-resources.js +0 -203
  591. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes-resources.js.map +0 -1
  592. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes.d.ts +0 -4
  593. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes.js +0 -11
  594. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-routes.js.map +0 -1
  595. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-serializers.d.ts +0 -16
  596. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-serializers.js +0 -151
  597. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-serializers.js.map +0 -1
  598. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-upload.d.ts +0 -12
  599. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-upload.js +0 -127
  600. package/node_modules/@pome-sh/twin-gmail/dist/src/rest-upload.js.map +0 -1
  601. package/node_modules/@pome-sh/twin-gmail/dist/src/search-match.d.ts +0 -4
  602. package/node_modules/@pome-sh/twin-gmail/dist/src/search-match.js +0 -179
  603. package/node_modules/@pome-sh/twin-gmail/dist/src/search-match.js.map +0 -1
  604. package/node_modules/@pome-sh/twin-gmail/dist/src/search-parse.d.ts +0 -61
  605. package/node_modules/@pome-sh/twin-gmail/dist/src/search-parse.js +0 -318
  606. package/node_modules/@pome-sh/twin-gmail/dist/src/search-parse.js.map +0 -1
  607. package/node_modules/@pome-sh/twin-gmail/dist/src/search.d.ts +0 -3
  608. package/node_modules/@pome-sh/twin-gmail/dist/src/search.js +0 -3
  609. package/node_modules/@pome-sh/twin-gmail/dist/src/search.js.map +0 -1
  610. package/node_modules/@pome-sh/twin-gmail/dist/src/seed.d.ts +0 -239
  611. package/node_modules/@pome-sh/twin-gmail/dist/src/seed.js +0 -271
  612. package/node_modules/@pome-sh/twin-gmail/dist/src/seed.js.map +0 -1
  613. package/node_modules/@pome-sh/twin-gmail/dist/src/seeding.d.ts +0 -3
  614. package/node_modules/@pome-sh/twin-gmail/dist/src/seeding.js +0 -89
  615. package/node_modules/@pome-sh/twin-gmail/dist/src/seeding.js.map +0 -1
  616. package/node_modules/@pome-sh/twin-gmail/dist/src/server.d.ts +0 -2
  617. package/node_modules/@pome-sh/twin-gmail/dist/src/server.js +0 -21
  618. package/node_modules/@pome-sh/twin-gmail/dist/src/server.js.map +0 -1
  619. package/node_modules/@pome-sh/twin-gmail/dist/src/state.d.ts +0 -55
  620. package/node_modules/@pome-sh/twin-gmail/dist/src/state.js +0 -225
  621. package/node_modules/@pome-sh/twin-gmail/dist/src/state.js.map +0 -1
  622. package/node_modules/@pome-sh/twin-gmail/dist/src/storage.d.ts +0 -20
  623. package/node_modules/@pome-sh/twin-gmail/dist/src/storage.js +0 -171
  624. package/node_modules/@pome-sh/twin-gmail/dist/src/storage.js.map +0 -1
  625. package/node_modules/@pome-sh/twin-gmail/dist/src/twin.d.ts +0 -16
  626. package/node_modules/@pome-sh/twin-gmail/dist/src/twin.js +0 -96
  627. package/node_modules/@pome-sh/twin-gmail/dist/src/twin.js.map +0 -1
  628. package/node_modules/@pome-sh/twin-gmail/dist/src/types.d.ts +0 -150
  629. package/node_modules/@pome-sh/twin-gmail/dist/src/types.js +0 -2
  630. package/node_modules/@pome-sh/twin-gmail/dist/src/types.js.map +0 -1
  631. package/node_modules/@pome-sh/twin-gmail/fidelity.inventory.json +0 -565
  632. package/node_modules/@pome-sh/twin-gmail/fixtures/README.md +0 -28
  633. package/node_modules/@pome-sh/twin-gmail/fixtures/gmail-discovery-v1.meta.json +0 -6
  634. package/node_modules/@pome-sh/twin-gmail/fixtures/gmail-discovery-v1.raw.json +0 -4510
  635. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-initialize.meta.json +0 -8
  636. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-initialize.raw.json +0 -1
  637. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-tools-call-unauth-error.raw.json +0 -1
  638. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-tools-call.representative.json +0 -508
  639. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-tools-list.canonical.json +0 -1209
  640. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-tools-list.meta.json +0 -29
  641. package/node_modules/@pome-sh/twin-gmail/fixtures/mcp-tools-list.raw.json +0 -1
  642. package/node_modules/@pome-sh/twin-gmail/fixtures/rest-surface.json +0 -3502
  643. package/node_modules/@pome-sh/twin-gmail/package.json +0 -76
  644. package/node_modules/@pome-sh/twin-linear/CHANGELOG.md +0 -204
  645. package/node_modules/@pome-sh/twin-linear/FIDELITY.md +0 -62
  646. package/node_modules/@pome-sh/twin-linear/HOSTED.md +0 -46
  647. package/node_modules/@pome-sh/twin-linear/LIMITS.md +0 -54
  648. package/node_modules/@pome-sh/twin-linear/README.md +0 -151
  649. package/node_modules/@pome-sh/twin-linear/REFERENCE-DIVERGENCES.md +0 -50
  650. package/node_modules/@pome-sh/twin-linear/dist/fixtures/mcp-tools-list.canonical.json +0 -353
  651. package/node_modules/@pome-sh/twin-linear/dist/src/auth-credential.d.ts +0 -8
  652. package/node_modules/@pome-sh/twin-linear/dist/src/auth-credential.js +0 -55
  653. package/node_modules/@pome-sh/twin-linear/dist/src/auth-credential.js.map +0 -1
  654. package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.d.ts +0 -10
  655. package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.js +0 -129
  656. package/node_modules/@pome-sh/twin-linear/dist/src/check-comments.js.map +0 -1
  657. package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.d.ts +0 -25
  658. package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.js +0 -238
  659. package/node_modules/@pome-sh/twin-linear/dist/src/check-issues.js.map +0 -1
  660. package/node_modules/@pome-sh/twin-linear/dist/src/check-kind.d.ts +0 -3
  661. package/node_modules/@pome-sh/twin-linear/dist/src/check-kind.js +0 -9
  662. package/node_modules/@pome-sh/twin-linear/dist/src/check-kind.js.map +0 -1
  663. package/node_modules/@pome-sh/twin-linear/dist/src/check-params.d.ts +0 -8
  664. package/node_modules/@pome-sh/twin-linear/dist/src/check-params.js +0 -94
  665. package/node_modules/@pome-sh/twin-linear/dist/src/check-params.js.map +0 -1
  666. package/node_modules/@pome-sh/twin-linear/dist/src/check-state.d.ts +0 -123
  667. package/node_modules/@pome-sh/twin-linear/dist/src/check-state.js +0 -184
  668. package/node_modules/@pome-sh/twin-linear/dist/src/check-state.js.map +0 -1
  669. package/node_modules/@pome-sh/twin-linear/dist/src/check-tape.d.ts +0 -2
  670. package/node_modules/@pome-sh/twin-linear/dist/src/check-tape.js +0 -100
  671. package/node_modules/@pome-sh/twin-linear/dist/src/check-tape.js.map +0 -1
  672. package/node_modules/@pome-sh/twin-linear/dist/src/check-worlds.d.ts +0 -44
  673. package/node_modules/@pome-sh/twin-linear/dist/src/check-worlds.js +0 -93
  674. package/node_modules/@pome-sh/twin-linear/dist/src/check-worlds.js.map +0 -1
  675. package/node_modules/@pome-sh/twin-linear/dist/src/checks.d.ts +0 -29
  676. package/node_modules/@pome-sh/twin-linear/dist/src/checks.js +0 -52
  677. package/node_modules/@pome-sh/twin-linear/dist/src/checks.js.map +0 -1
  678. package/node_modules/@pome-sh/twin-linear/dist/src/db.d.ts +0 -10
  679. package/node_modules/@pome-sh/twin-linear/dist/src/db.js +0 -382
  680. package/node_modules/@pome-sh/twin-linear/dist/src/db.js.map +0 -1
  681. package/node_modules/@pome-sh/twin-linear/dist/src/domain/agents.d.ts +0 -32
  682. package/node_modules/@pome-sh/twin-linear/dist/src/domain/agents.js +0 -107
  683. package/node_modules/@pome-sh/twin-linear/dist/src/domain/agents.js.map +0 -1
  684. package/node_modules/@pome-sh/twin-linear/dist/src/domain/catalog.d.ts +0 -9
  685. package/node_modules/@pome-sh/twin-linear/dist/src/domain/catalog.js +0 -41
  686. package/node_modules/@pome-sh/twin-linear/dist/src/domain/catalog.js.map +0 -1
  687. package/node_modules/@pome-sh/twin-linear/dist/src/domain/comments.d.ts +0 -13
  688. package/node_modules/@pome-sh/twin-linear/dist/src/domain/comments.js +0 -108
  689. package/node_modules/@pome-sh/twin-linear/dist/src/domain/comments.js.map +0 -1
  690. package/node_modules/@pome-sh/twin-linear/dist/src/domain/documents.d.ts +0 -31
  691. package/node_modules/@pome-sh/twin-linear/dist/src/domain/documents.js +0 -113
  692. package/node_modules/@pome-sh/twin-linear/dist/src/domain/documents.js.map +0 -1
  693. package/node_modules/@pome-sh/twin-linear/dist/src/domain/index.d.ts +0 -4
  694. package/node_modules/@pome-sh/twin-linear/dist/src/domain/index.js +0 -6
  695. package/node_modules/@pome-sh/twin-linear/dist/src/domain/index.js.map +0 -1
  696. package/node_modules/@pome-sh/twin-linear/dist/src/domain/issue-relations.d.ts +0 -13
  697. package/node_modules/@pome-sh/twin-linear/dist/src/domain/issue-relations.js +0 -60
  698. package/node_modules/@pome-sh/twin-linear/dist/src/domain/issue-relations.js.map +0 -1
  699. package/node_modules/@pome-sh/twin-linear/dist/src/domain/issues.d.ts +0 -57
  700. package/node_modules/@pome-sh/twin-linear/dist/src/domain/issues.js +0 -359
  701. package/node_modules/@pome-sh/twin-linear/dist/src/domain/issues.js.map +0 -1
  702. package/node_modules/@pome-sh/twin-linear/dist/src/domain/labels.d.ts +0 -18
  703. package/node_modules/@pome-sh/twin-linear/dist/src/domain/labels.js +0 -117
  704. package/node_modules/@pome-sh/twin-linear/dist/src/domain/labels.js.map +0 -1
  705. package/node_modules/@pome-sh/twin-linear/dist/src/domain/linear-domain.d.ts +0 -177
  706. package/node_modules/@pome-sh/twin-linear/dist/src/domain/linear-domain.js +0 -315
  707. package/node_modules/@pome-sh/twin-linear/dist/src/domain/linear-domain.js.map +0 -1
  708. package/node_modules/@pome-sh/twin-linear/dist/src/domain/normalize.d.ts +0 -18
  709. package/node_modules/@pome-sh/twin-linear/dist/src/domain/normalize.js +0 -84
  710. package/node_modules/@pome-sh/twin-linear/dist/src/domain/normalize.js.map +0 -1
  711. package/node_modules/@pome-sh/twin-linear/dist/src/domain/oauth-store.d.ts +0 -55
  712. package/node_modules/@pome-sh/twin-linear/dist/src/domain/oauth-store.js +0 -127
  713. package/node_modules/@pome-sh/twin-linear/dist/src/domain/oauth-store.js.map +0 -1
  714. package/node_modules/@pome-sh/twin-linear/dist/src/domain/projects-cycles.d.ts +0 -17
  715. package/node_modules/@pome-sh/twin-linear/dist/src/domain/projects-cycles.js +0 -51
  716. package/node_modules/@pome-sh/twin-linear/dist/src/domain/projects-cycles.js.map +0 -1
  717. package/node_modules/@pome-sh/twin-linear/dist/src/domain/rows.d.ts +0 -211
  718. package/node_modules/@pome-sh/twin-linear/dist/src/domain/rows.js +0 -217
  719. package/node_modules/@pome-sh/twin-linear/dist/src/domain/rows.js.map +0 -1
  720. package/node_modules/@pome-sh/twin-linear/dist/src/domain/webhooks.d.ts +0 -5
  721. package/node_modules/@pome-sh/twin-linear/dist/src/domain/webhooks.js +0 -12
  722. package/node_modules/@pome-sh/twin-linear/dist/src/domain/webhooks.js.map +0 -1
  723. package/node_modules/@pome-sh/twin-linear/dist/src/errors.d.ts +0 -26
  724. package/node_modules/@pome-sh/twin-linear/dist/src/errors.js +0 -128
  725. package/node_modules/@pome-sh/twin-linear/dist/src/errors.js.map +0 -1
  726. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/formatters.d.ts +0 -27
  727. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/formatters.js +0 -261
  728. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/formatters.js.map +0 -1
  729. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/issue-filter.d.ts +0 -5
  730. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/issue-filter.js +0 -122
  731. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/issue-filter.js.map +0 -1
  732. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/mutation-inputs.d.ts +0 -170
  733. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/mutation-inputs.js +0 -260
  734. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/mutation-inputs.js.map +0 -1
  735. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/resolvers.d.ts +0 -6
  736. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/resolvers.js +0 -169
  737. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/resolvers.js.map +0 -1
  738. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/routes.d.ts +0 -6
  739. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/routes.js +0 -176
  740. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/routes.js.map +0 -1
  741. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/schema.d.ts +0 -3
  742. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/schema.js +0 -522
  743. package/node_modules/@pome-sh/twin-linear/dist/src/graphql/schema.js.map +0 -1
  744. package/node_modules/@pome-sh/twin-linear/dist/src/identity.d.ts +0 -7
  745. package/node_modules/@pome-sh/twin-linear/dist/src/identity.js +0 -14
  746. package/node_modules/@pome-sh/twin-linear/dist/src/identity.js.map +0 -1
  747. package/node_modules/@pome-sh/twin-linear/dist/src/ids.d.ts +0 -5
  748. package/node_modules/@pome-sh/twin-linear/dist/src/ids.js +0 -28
  749. package/node_modules/@pome-sh/twin-linear/dist/src/ids.js.map +0 -1
  750. package/node_modules/@pome-sh/twin-linear/dist/src/index.d.ts +0 -18
  751. package/node_modules/@pome-sh/twin-linear/dist/src/index.js +0 -21
  752. package/node_modules/@pome-sh/twin-linear/dist/src/index.js.map +0 -1
  753. package/node_modules/@pome-sh/twin-linear/dist/src/mcp-schemas.d.ts +0 -121
  754. package/node_modules/@pome-sh/twin-linear/dist/src/mcp-schemas.js +0 -126
  755. package/node_modules/@pome-sh/twin-linear/dist/src/mcp-schemas.js.map +0 -1
  756. package/node_modules/@pome-sh/twin-linear/dist/src/mcp.d.ts +0 -4
  757. package/node_modules/@pome-sh/twin-linear/dist/src/mcp.js +0 -430
  758. package/node_modules/@pome-sh/twin-linear/dist/src/mcp.js.map +0 -1
  759. package/node_modules/@pome-sh/twin-linear/dist/src/oauth/routes.d.ts +0 -5
  760. package/node_modules/@pome-sh/twin-linear/dist/src/oauth/routes.js +0 -340
  761. package/node_modules/@pome-sh/twin-linear/dist/src/oauth/routes.js.map +0 -1
  762. package/node_modules/@pome-sh/twin-linear/dist/src/pagination.d.ts +0 -29
  763. package/node_modules/@pome-sh/twin-linear/dist/src/pagination.js +0 -101
  764. package/node_modules/@pome-sh/twin-linear/dist/src/pagination.js.map +0 -1
  765. package/node_modules/@pome-sh/twin-linear/dist/src/recording.d.ts +0 -2
  766. package/node_modules/@pome-sh/twin-linear/dist/src/recording.js +0 -46
  767. package/node_modules/@pome-sh/twin-linear/dist/src/recording.js.map +0 -1
  768. package/node_modules/@pome-sh/twin-linear/dist/src/routes.d.ts +0 -9
  769. package/node_modules/@pome-sh/twin-linear/dist/src/routes.js +0 -10
  770. package/node_modules/@pome-sh/twin-linear/dist/src/routes.js.map +0 -1
  771. package/node_modules/@pome-sh/twin-linear/dist/src/seed/apply.d.ts +0 -4
  772. package/node_modules/@pome-sh/twin-linear/dist/src/seed/apply.js +0 -186
  773. package/node_modules/@pome-sh/twin-linear/dist/src/seed/apply.js.map +0 -1
  774. package/node_modules/@pome-sh/twin-linear/dist/src/seed.d.ts +0 -158
  775. package/node_modules/@pome-sh/twin-linear/dist/src/seed.js +0 -541
  776. package/node_modules/@pome-sh/twin-linear/dist/src/seed.js.map +0 -1
  777. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/comment.d.ts +0 -29
  778. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/comment.js +0 -47
  779. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/comment.js.map +0 -1
  780. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/document.d.ts +0 -15
  781. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/document.js +0 -17
  782. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/document.js.map +0 -1
  783. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/index.d.ts +0 -3
  784. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/index.js +0 -5
  785. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/index.js.map +0 -1
  786. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/issue.d.ts +0 -86
  787. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/issue.js +0 -102
  788. package/node_modules/@pome-sh/twin-linear/dist/src/serializers/issue.js.map +0 -1
  789. package/node_modules/@pome-sh/twin-linear/dist/src/server.d.ts +0 -2
  790. package/node_modules/@pome-sh/twin-linear/dist/src/server.js +0 -41
  791. package/node_modules/@pome-sh/twin-linear/dist/src/server.js.map +0 -1
  792. package/node_modules/@pome-sh/twin-linear/dist/src/state.d.ts +0 -51
  793. package/node_modules/@pome-sh/twin-linear/dist/src/state.js +0 -211
  794. package/node_modules/@pome-sh/twin-linear/dist/src/state.js.map +0 -1
  795. package/node_modules/@pome-sh/twin-linear/dist/src/twin.d.ts +0 -21
  796. package/node_modules/@pome-sh/twin-linear/dist/src/twin.js +0 -107
  797. package/node_modules/@pome-sh/twin-linear/dist/src/twin.js.map +0 -1
  798. package/node_modules/@pome-sh/twin-linear/dist/src/types.d.ts +0 -366
  799. package/node_modules/@pome-sh/twin-linear/dist/src/types.js +0 -19
  800. package/node_modules/@pome-sh/twin-linear/dist/src/types.js.map +0 -1
  801. package/node_modules/@pome-sh/twin-linear/dist/src/webhook-policy.d.ts +0 -27
  802. package/node_modules/@pome-sh/twin-linear/dist/src/webhook-policy.js +0 -107
  803. package/node_modules/@pome-sh/twin-linear/dist/src/webhook-policy.js.map +0 -1
  804. package/node_modules/@pome-sh/twin-linear/dist/src/webhook-url.d.ts +0 -3
  805. package/node_modules/@pome-sh/twin-linear/dist/src/webhook-url.js +0 -26
  806. package/node_modules/@pome-sh/twin-linear/dist/src/webhook-url.js.map +0 -1
  807. package/node_modules/@pome-sh/twin-linear/dist/src/webhooks/dispatch.d.ts +0 -30
  808. package/node_modules/@pome-sh/twin-linear/dist/src/webhooks/dispatch.js +0 -93
  809. package/node_modules/@pome-sh/twin-linear/dist/src/webhooks/dispatch.js.map +0 -1
  810. package/node_modules/@pome-sh/twin-linear/fidelity.inventory.json +0 -249
  811. package/node_modules/@pome-sh/twin-linear/fixtures/README.md +0 -11
  812. package/node_modules/@pome-sh/twin-linear/fixtures/graphql-surface.json +0 -59
  813. package/node_modules/@pome-sh/twin-linear/fixtures/linear-introspection.json +0 -66
  814. package/node_modules/@pome-sh/twin-linear/fixtures/mcp-tools-list.canonical.json +0 -353
  815. package/node_modules/@pome-sh/twin-linear/package.json +0 -72
  816. package/node_modules/@pome-sh/twin-slack/FIDELITY.md +0 -346
  817. package/node_modules/@pome-sh/twin-slack/README.md +0 -211
  818. package/node_modules/@pome-sh/twin-slack/dist/examples/claude-slack-agent.d.ts +0 -1
  819. package/node_modules/@pome-sh/twin-slack/dist/examples/claude-slack-agent.js +0 -105
  820. package/node_modules/@pome-sh/twin-slack/dist/examples/claude-slack-agent.js.map +0 -1
  821. package/node_modules/@pome-sh/twin-slack/dist/examples/mcp-node.d.ts +0 -1
  822. package/node_modules/@pome-sh/twin-slack/dist/examples/mcp-node.js +0 -20
  823. package/node_modules/@pome-sh/twin-slack/dist/examples/mcp-node.js.map +0 -1
  824. package/node_modules/@pome-sh/twin-slack/dist/examples/mini-bot-flow.d.ts +0 -1
  825. package/node_modules/@pome-sh/twin-slack/dist/examples/mini-bot-flow.js +0 -61
  826. package/node_modules/@pome-sh/twin-slack/dist/examples/mini-bot-flow.js.map +0 -1
  827. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.d.ts +0 -1
  828. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.js +0 -92
  829. package/node_modules/@pome-sh/twin-slack/dist/scripts/fidelity-parity.js.map +0 -1
  830. package/node_modules/@pome-sh/twin-slack/dist/scripts/seed.d.ts +0 -1
  831. package/node_modules/@pome-sh/twin-slack/dist/scripts/seed.js +0 -9
  832. package/node_modules/@pome-sh/twin-slack/dist/scripts/seed.js.map +0 -1
  833. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.d.ts +0 -1
  834. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.js +0 -209
  835. package/node_modules/@pome-sh/twin-slack/dist/scripts/smoke.js.map +0 -1
  836. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.d.ts +0 -1
  837. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.js +0 -116
  838. package/node_modules/@pome-sh/twin-slack/dist/scripts/validate-mcp.js.map +0 -1
  839. package/node_modules/@pome-sh/twin-slack/dist/scripts/verify-cloud-token.d.ts +0 -1
  840. package/node_modules/@pome-sh/twin-slack/dist/scripts/verify-cloud-token.js +0 -45
  841. package/node_modules/@pome-sh/twin-slack/dist/scripts/verify-cloud-token.js.map +0 -1
  842. package/node_modules/@pome-sh/twin-slack/dist/src/check-kind.d.ts +0 -3
  843. package/node_modules/@pome-sh/twin-slack/dist/src/check-kind.js +0 -9
  844. package/node_modules/@pome-sh/twin-slack/dist/src/check-kind.js.map +0 -1
  845. package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.d.ts +0 -16
  846. package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.js +0 -207
  847. package/node_modules/@pome-sh/twin-slack/dist/src/check-messages.js.map +0 -1
  848. package/node_modules/@pome-sh/twin-slack/dist/src/check-params.d.ts +0 -5
  849. package/node_modules/@pome-sh/twin-slack/dist/src/check-params.js +0 -56
  850. package/node_modules/@pome-sh/twin-slack/dist/src/check-params.js.map +0 -1
  851. package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.d.ts +0 -2
  852. package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.js +0 -138
  853. package/node_modules/@pome-sh/twin-slack/dist/src/check-secrets.js.map +0 -1
  854. package/node_modules/@pome-sh/twin-slack/dist/src/check-state.d.ts +0 -107
  855. package/node_modules/@pome-sh/twin-slack/dist/src/check-state.js +0 -128
  856. package/node_modules/@pome-sh/twin-slack/dist/src/check-state.js.map +0 -1
  857. package/node_modules/@pome-sh/twin-slack/dist/src/check-worlds.d.ts +0 -7
  858. package/node_modules/@pome-sh/twin-slack/dist/src/check-worlds.js +0 -37
  859. package/node_modules/@pome-sh/twin-slack/dist/src/check-worlds.js.map +0 -1
  860. package/node_modules/@pome-sh/twin-slack/dist/src/checks.d.ts +0 -14
  861. package/node_modules/@pome-sh/twin-slack/dist/src/checks.js +0 -39
  862. package/node_modules/@pome-sh/twin-slack/dist/src/checks.js.map +0 -1
  863. package/node_modules/@pome-sh/twin-slack/dist/src/db.d.ts +0 -4
  864. package/node_modules/@pome-sh/twin-slack/dist/src/db.js +0 -231
  865. package/node_modules/@pome-sh/twin-slack/dist/src/db.js.map +0 -1
  866. package/node_modules/@pome-sh/twin-slack/dist/src/domain/bookmarks.d.ts +0 -16
  867. package/node_modules/@pome-sh/twin-slack/dist/src/domain/bookmarks.js +0 -49
  868. package/node_modules/@pome-sh/twin-slack/dist/src/domain/bookmarks.js.map +0 -1
  869. package/node_modules/@pome-sh/twin-slack/dist/src/domain/canvases.d.ts +0 -37
  870. package/node_modules/@pome-sh/twin-slack/dist/src/domain/canvases.js +0 -182
  871. package/node_modules/@pome-sh/twin-slack/dist/src/domain/canvases.js.map +0 -1
  872. package/node_modules/@pome-sh/twin-slack/dist/src/domain/chat.d.ts +0 -40
  873. package/node_modules/@pome-sh/twin-slack/dist/src/domain/chat.js +0 -167
  874. package/node_modules/@pome-sh/twin-slack/dist/src/domain/chat.js.map +0 -1
  875. package/node_modules/@pome-sh/twin-slack/dist/src/domain/conversations.d.ts +0 -61
  876. package/node_modules/@pome-sh/twin-slack/dist/src/domain/conversations.js +0 -360
  877. package/node_modules/@pome-sh/twin-slack/dist/src/domain/conversations.js.map +0 -1
  878. package/node_modules/@pome-sh/twin-slack/dist/src/domain/emoji.d.ts +0 -13
  879. package/node_modules/@pome-sh/twin-slack/dist/src/domain/emoji.js +0 -31
  880. package/node_modules/@pome-sh/twin-slack/dist/src/domain/emoji.js.map +0 -1
  881. package/node_modules/@pome-sh/twin-slack/dist/src/domain/files.d.ts +0 -24
  882. package/node_modules/@pome-sh/twin-slack/dist/src/domain/files.js +0 -101
  883. package/node_modules/@pome-sh/twin-slack/dist/src/domain/files.js.map +0 -1
  884. package/node_modules/@pome-sh/twin-slack/dist/src/domain/helpers.d.ts +0 -5
  885. package/node_modules/@pome-sh/twin-slack/dist/src/domain/helpers.js +0 -42
  886. package/node_modules/@pome-sh/twin-slack/dist/src/domain/helpers.js.map +0 -1
  887. package/node_modules/@pome-sh/twin-slack/dist/src/domain/index.d.ts +0 -2
  888. package/node_modules/@pome-sh/twin-slack/dist/src/domain/index.js +0 -5
  889. package/node_modules/@pome-sh/twin-slack/dist/src/domain/index.js.map +0 -1
  890. package/node_modules/@pome-sh/twin-slack/dist/src/domain/pins.d.ts +0 -12
  891. package/node_modules/@pome-sh/twin-slack/dist/src/domain/pins.js +0 -63
  892. package/node_modules/@pome-sh/twin-slack/dist/src/domain/pins.js.map +0 -1
  893. package/node_modules/@pome-sh/twin-slack/dist/src/domain/reactions.d.ts +0 -16
  894. package/node_modules/@pome-sh/twin-slack/dist/src/domain/reactions.js +0 -73
  895. package/node_modules/@pome-sh/twin-slack/dist/src/domain/reactions.js.map +0 -1
  896. package/node_modules/@pome-sh/twin-slack/dist/src/domain/search.d.ts +0 -9
  897. package/node_modules/@pome-sh/twin-slack/dist/src/domain/search.js +0 -68
  898. package/node_modules/@pome-sh/twin-slack/dist/src/domain/search.js.map +0 -1
  899. package/node_modules/@pome-sh/twin-slack/dist/src/domain/slack-domain.d.ts +0 -258
  900. package/node_modules/@pome-sh/twin-slack/dist/src/domain/slack-domain.js +0 -510
  901. package/node_modules/@pome-sh/twin-slack/dist/src/domain/slack-domain.js.map +0 -1
  902. package/node_modules/@pome-sh/twin-slack/dist/src/domain/team.d.ts +0 -5
  903. package/node_modules/@pome-sh/twin-slack/dist/src/domain/team.js +0 -25
  904. package/node_modules/@pome-sh/twin-slack/dist/src/domain/team.js.map +0 -1
  905. package/node_modules/@pome-sh/twin-slack/dist/src/domain/topic.d.ts +0 -19
  906. package/node_modules/@pome-sh/twin-slack/dist/src/domain/topic.js +0 -43
  907. package/node_modules/@pome-sh/twin-slack/dist/src/domain/topic.js.map +0 -1
  908. package/node_modules/@pome-sh/twin-slack/dist/src/domain/users.d.ts +0 -24
  909. package/node_modules/@pome-sh/twin-slack/dist/src/domain/users.js +0 -82
  910. package/node_modules/@pome-sh/twin-slack/dist/src/domain/users.js.map +0 -1
  911. package/node_modules/@pome-sh/twin-slack/dist/src/errors.d.ts +0 -16
  912. package/node_modules/@pome-sh/twin-slack/dist/src/errors.js +0 -61
  913. package/node_modules/@pome-sh/twin-slack/dist/src/errors.js.map +0 -1
  914. package/node_modules/@pome-sh/twin-slack/dist/src/index.d.ts +0 -8
  915. package/node_modules/@pome-sh/twin-slack/dist/src/index.js +0 -8
  916. package/node_modules/@pome-sh/twin-slack/dist/src/index.js.map +0 -1
  917. package/node_modules/@pome-sh/twin-slack/dist/src/routes.d.ts +0 -4
  918. package/node_modules/@pome-sh/twin-slack/dist/src/routes.js +0 -211
  919. package/node_modules/@pome-sh/twin-slack/dist/src/routes.js.map +0 -1
  920. package/node_modules/@pome-sh/twin-slack/dist/src/seed.d.ts +0 -54
  921. package/node_modules/@pome-sh/twin-slack/dist/src/seed.js +0 -152
  922. package/node_modules/@pome-sh/twin-slack/dist/src/seed.js.map +0 -1
  923. package/node_modules/@pome-sh/twin-slack/dist/src/serializers.d.ts +0 -141
  924. package/node_modules/@pome-sh/twin-slack/dist/src/serializers.js +0 -378
  925. package/node_modules/@pome-sh/twin-slack/dist/src/serializers.js.map +0 -1
  926. package/node_modules/@pome-sh/twin-slack/dist/src/server.d.ts +0 -2
  927. package/node_modules/@pome-sh/twin-slack/dist/src/server.js +0 -42
  928. package/node_modules/@pome-sh/twin-slack/dist/src/server.js.map +0 -1
  929. package/node_modules/@pome-sh/twin-slack/dist/src/tools.d.ts +0 -123
  930. package/node_modules/@pome-sh/twin-slack/dist/src/tools.js +0 -219
  931. package/node_modules/@pome-sh/twin-slack/dist/src/tools.js.map +0 -1
  932. package/node_modules/@pome-sh/twin-slack/dist/src/twin.d.ts +0 -22
  933. package/node_modules/@pome-sh/twin-slack/dist/src/twin.js +0 -179
  934. package/node_modules/@pome-sh/twin-slack/dist/src/twin.js.map +0 -1
  935. package/node_modules/@pome-sh/twin-slack/dist/src/types.d.ts +0 -182
  936. package/node_modules/@pome-sh/twin-slack/dist/src/types.js +0 -2
  937. package/node_modules/@pome-sh/twin-slack/dist/src/types.js.map +0 -1
  938. package/node_modules/@pome-sh/twin-slack/dist/src/unsupported-envelope.d.ts +0 -12
  939. package/node_modules/@pome-sh/twin-slack/dist/src/unsupported-envelope.js +0 -68
  940. package/node_modules/@pome-sh/twin-slack/dist/src/unsupported-envelope.js.map +0 -1
  941. package/node_modules/@pome-sh/twin-slack/dist/src/upstream-types.d.ts +0 -16
  942. package/node_modules/@pome-sh/twin-slack/dist/src/upstream-types.js +0 -2
  943. package/node_modules/@pome-sh/twin-slack/dist/src/upstream-types.js.map +0 -1
  944. package/node_modules/@pome-sh/twin-slack/dist/src/util.d.ts +0 -30
  945. package/node_modules/@pome-sh/twin-slack/dist/src/util.js +0 -132
  946. package/node_modules/@pome-sh/twin-slack/dist/src/util.js.map +0 -1
  947. package/node_modules/@pome-sh/twin-slack/fidelity.inventory.json +0 -377
  948. package/node_modules/@pome-sh/twin-slack/package.json +0 -63
  949. package/node_modules/@pome-sh/twin-stripe/FIDELITY.md +0 -380
  950. package/node_modules/@pome-sh/twin-stripe/README.md +0 -280
  951. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.d.ts +0 -1
  952. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.js +0 -186
  953. package/node_modules/@pome-sh/twin-stripe/dist/scripts/fidelity-parity.js.map +0 -1
  954. package/node_modules/@pome-sh/twin-stripe/dist/scripts/seed.d.ts +0 -1
  955. package/node_modules/@pome-sh/twin-stripe/dist/scripts/seed.js +0 -9
  956. package/node_modules/@pome-sh/twin-stripe/dist/scripts/seed.js.map +0 -1
  957. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.d.ts +0 -1
  958. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.js +0 -224
  959. package/node_modules/@pome-sh/twin-stripe/dist/scripts/smoke.js.map +0 -1
  960. package/node_modules/@pome-sh/twin-stripe/dist/src/api-keys.d.ts +0 -27
  961. package/node_modules/@pome-sh/twin-stripe/dist/src/api-keys.js +0 -49
  962. package/node_modules/@pome-sh/twin-stripe/dist/src/api-keys.js.map +0 -1
  963. package/node_modules/@pome-sh/twin-stripe/dist/src/check-kind.d.ts +0 -3
  964. package/node_modules/@pome-sh/twin-stripe/dist/src/check-kind.js +0 -9
  965. package/node_modules/@pome-sh/twin-stripe/dist/src/check-kind.js.map +0 -1
  966. package/node_modules/@pome-sh/twin-stripe/dist/src/check-params.d.ts +0 -8
  967. package/node_modules/@pome-sh/twin-stripe/dist/src/check-params.js +0 -123
  968. package/node_modules/@pome-sh/twin-stripe/dist/src/check-params.js.map +0 -1
  969. package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.d.ts +0 -18
  970. package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.js +0 -280
  971. package/node_modules/@pome-sh/twin-stripe/dist/src/check-payments.js.map +0 -1
  972. package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.d.ts +0 -8
  973. package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.js +0 -130
  974. package/node_modules/@pome-sh/twin-stripe/dist/src/check-refunds.js.map +0 -1
  975. package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.d.ts +0 -107
  976. package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.js +0 -123
  977. package/node_modules/@pome-sh/twin-stripe/dist/src/check-state.js.map +0 -1
  978. package/node_modules/@pome-sh/twin-stripe/dist/src/check-tape.d.ts +0 -9
  979. package/node_modules/@pome-sh/twin-stripe/dist/src/check-tape.js +0 -338
  980. package/node_modules/@pome-sh/twin-stripe/dist/src/check-tape.js.map +0 -1
  981. package/node_modules/@pome-sh/twin-stripe/dist/src/check-worlds.d.ts +0 -24
  982. package/node_modules/@pome-sh/twin-stripe/dist/src/check-worlds.js +0 -131
  983. package/node_modules/@pome-sh/twin-stripe/dist/src/check-worlds.js.map +0 -1
  984. package/node_modules/@pome-sh/twin-stripe/dist/src/checks.d.ts +0 -22
  985. package/node_modules/@pome-sh/twin-stripe/dist/src/checks.js +0 -97
  986. package/node_modules/@pome-sh/twin-stripe/dist/src/checks.js.map +0 -1
  987. package/node_modules/@pome-sh/twin-stripe/dist/src/db.d.ts +0 -4
  988. package/node_modules/@pome-sh/twin-stripe/dist/src/db.js +0 -167
  989. package/node_modules/@pome-sh/twin-stripe/dist/src/db.js.map +0 -1
  990. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/balance.d.ts +0 -53
  991. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/balance.js +0 -77
  992. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/balance.js.map +0 -1
  993. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.d.ts +0 -101
  994. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.js +0 -195
  995. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/billing.js.map +0 -1
  996. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.d.ts +0 -45
  997. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.js +0 -59
  998. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/charges.js.map +0 -1
  999. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/constants.d.ts +0 -25
  1000. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/constants.js +0 -26
  1001. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/constants.js.map +0 -1
  1002. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.d.ts +0 -47
  1003. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.js +0 -103
  1004. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/customers.js.map +0 -1
  1005. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.d.ts +0 -27
  1006. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.js +0 -45
  1007. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/events.js.map +0 -1
  1008. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.d.ts +0 -18
  1009. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.js +0 -16
  1010. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/index.js.map +0 -1
  1011. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.d.ts +0 -150
  1012. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.js +0 -449
  1013. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-intents.js.map +0 -1
  1014. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.d.ts +0 -45
  1015. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.js +0 -159
  1016. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/payment-methods.js.map +0 -1
  1017. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.d.ts +0 -48
  1018. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.js +0 -111
  1019. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/refunds.js.map +0 -1
  1020. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.d.ts +0 -9
  1021. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.js +0 -275
  1022. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/schema.js.map +0 -1
  1023. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.d.ts +0 -779
  1024. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.js +0 -670
  1025. package/node_modules/@pome-sh/twin-stripe/dist/src/domain/stripe-domain.js.map +0 -1
  1026. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.d.ts +0 -76
  1027. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.js +0 -99
  1028. package/node_modules/@pome-sh/twin-stripe/dist/src/errors.js.map +0 -1
  1029. package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.d.ts +0 -25
  1030. package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.js +0 -235
  1031. package/node_modules/@pome-sh/twin-stripe/dist/src/idempotency.js.map +0 -1
  1032. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.d.ts +0 -30
  1033. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.js +0 -58
  1034. package/node_modules/@pome-sh/twin-stripe/dist/src/ids.js.map +0 -1
  1035. package/node_modules/@pome-sh/twin-stripe/dist/src/index.d.ts +0 -11
  1036. package/node_modules/@pome-sh/twin-stripe/dist/src/index.js +0 -16
  1037. package/node_modules/@pome-sh/twin-stripe/dist/src/index.js.map +0 -1
  1038. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.d.ts +0 -37
  1039. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js +0 -264
  1040. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/_helpers.js.map +0 -1
  1041. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/balance.d.ts +0 -4
  1042. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/balance.js +0 -14
  1043. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/balance.js.map +0 -1
  1044. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.d.ts +0 -4
  1045. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.js +0 -117
  1046. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/billing.js.map +0 -1
  1047. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/charges.d.ts +0 -4
  1048. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/charges.js +0 -15
  1049. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/charges.js.map +0 -1
  1050. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.d.ts +0 -4
  1051. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.js +0 -47
  1052. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/customers.js.map +0 -1
  1053. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/events.d.ts +0 -4
  1054. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/events.js +0 -14
  1055. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/events.js.map +0 -1
  1056. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.d.ts +0 -4
  1057. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.js +0 -36
  1058. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/index.js.map +0 -1
  1059. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.d.ts +0 -4
  1060. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.js +0 -81
  1061. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-intents.js.map +0 -1
  1062. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.d.ts +0 -4
  1063. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.js +0 -33
  1064. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/payment-methods.js.map +0 -1
  1065. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/refunds.d.ts +0 -4
  1066. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/refunds.js +0 -63
  1067. package/node_modules/@pome-sh/twin-stripe/dist/src/routes/refunds.js.map +0 -1
  1068. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.d.ts +0 -205
  1069. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.js +0 -226
  1070. package/node_modules/@pome-sh/twin-stripe/dist/src/seed.js.map +0 -1
  1071. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.d.ts +0 -347
  1072. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.js +0 -483
  1073. package/node_modules/@pome-sh/twin-stripe/dist/src/serializers.js.map +0 -1
  1074. package/node_modules/@pome-sh/twin-stripe/dist/src/server.d.ts +0 -2
  1075. package/node_modules/@pome-sh/twin-stripe/dist/src/server.js +0 -53
  1076. package/node_modules/@pome-sh/twin-stripe/dist/src/server.js.map +0 -1
  1077. package/node_modules/@pome-sh/twin-stripe/dist/src/session.d.ts +0 -8
  1078. package/node_modules/@pome-sh/twin-stripe/dist/src/session.js +0 -113
  1079. package/node_modules/@pome-sh/twin-stripe/dist/src/session.js.map +0 -1
  1080. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.d.ts +0 -254
  1081. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.js +0 -375
  1082. package/node_modules/@pome-sh/twin-stripe/dist/src/tools.js.map +0 -1
  1083. package/node_modules/@pome-sh/twin-stripe/dist/src/twin.d.ts +0 -42
  1084. package/node_modules/@pome-sh/twin-stripe/dist/src/twin.js +0 -286
  1085. package/node_modules/@pome-sh/twin-stripe/dist/src/twin.js.map +0 -1
  1086. package/node_modules/@pome-sh/twin-stripe/dist/src/types.d.ts +0 -252
  1087. package/node_modules/@pome-sh/twin-stripe/dist/src/types.js +0 -2
  1088. package/node_modules/@pome-sh/twin-stripe/dist/src/types.js.map +0 -1
  1089. package/node_modules/@pome-sh/twin-stripe/dist/src/upstream-types.d.ts +0 -22
  1090. package/node_modules/@pome-sh/twin-stripe/dist/src/upstream-types.js +0 -2
  1091. package/node_modules/@pome-sh/twin-stripe/dist/src/upstream-types.js.map +0 -1
  1092. package/node_modules/@pome-sh/twin-stripe/dist/src/util.d.ts +0 -3
  1093. package/node_modules/@pome-sh/twin-stripe/dist/src/util.js +0 -12
  1094. package/node_modules/@pome-sh/twin-stripe/dist/src/util.js.map +0 -1
  1095. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.d.ts +0 -162
  1096. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.js +0 -506
  1097. package/node_modules/@pome-sh/twin-stripe/dist/src/x402.js.map +0 -1
  1098. package/node_modules/@pome-sh/twin-stripe/fidelity.inventory.json +0 -425
  1099. package/node_modules/@pome-sh/twin-stripe/package.json +0 -64
  1100. package/node_modules/graphql/LICENSE +0 -21
  1101. package/node_modules/graphql/NotSupportedTSVersion.d.ts +0 -1
  1102. package/node_modules/graphql/README.md +0 -203
  1103. package/node_modules/graphql/error/GraphQLError.d.ts +0 -288
  1104. package/node_modules/graphql/error/GraphQLError.js +0 -398
  1105. package/node_modules/graphql/error/GraphQLError.mjs +0 -384
  1106. package/node_modules/graphql/error/index.d.ts +0 -15
  1107. package/node_modules/graphql/error/index.js +0 -41
  1108. package/node_modules/graphql/error/index.mjs +0 -9
  1109. package/node_modules/graphql/error/locatedError.d.ts +0 -33
  1110. package/node_modules/graphql/error/locatedError.js +0 -61
  1111. package/node_modules/graphql/error/locatedError.mjs +0 -52
  1112. package/node_modules/graphql/error/syntaxError.d.ts +0 -26
  1113. package/node_modules/graphql/error/syntaxError.js +0 -35
  1114. package/node_modules/graphql/error/syntaxError.mjs +0 -27
  1115. package/node_modules/graphql/execution/collectFields.d.ts +0 -45
  1116. package/node_modules/graphql/execution/collectFields.js +0 -235
  1117. package/node_modules/graphql/execution/collectFields.mjs +0 -219
  1118. package/node_modules/graphql/execution/execute.d.ts +0 -402
  1119. package/node_modules/graphql/execution/execute.js +0 -1295
  1120. package/node_modules/graphql/execution/execute.mjs +0 -1266
  1121. package/node_modules/graphql/execution/index.d.ts +0 -24
  1122. package/node_modules/graphql/execution/index.js +0 -73
  1123. package/node_modules/graphql/execution/index.mjs +0 -19
  1124. package/node_modules/graphql/execution/mapAsyncIterator.d.ts +0 -11
  1125. package/node_modules/graphql/execution/mapAsyncIterator.js +0 -70
  1126. package/node_modules/graphql/execution/mapAsyncIterator.mjs +0 -63
  1127. package/node_modules/graphql/execution/subscribe.d.ts +0 -262
  1128. package/node_modules/graphql/execution/subscribe.js +0 -388
  1129. package/node_modules/graphql/execution/subscribe.mjs +0 -366
  1130. package/node_modules/graphql/execution/values.d.ts +0 -236
  1131. package/node_modules/graphql/execution/values.js +0 -444
  1132. package/node_modules/graphql/execution/values.mjs +0 -406
  1133. package/node_modules/graphql/graphql.d.ts +0 -189
  1134. package/node_modules/graphql/graphql.js +0 -218
  1135. package/node_modules/graphql/graphql.mjs +0 -212
  1136. package/node_modules/graphql/index.d.ts +0 -423
  1137. package/node_modules/graphql/index.js +0 -1311
  1138. package/node_modules/graphql/index.mjs +0 -256
  1139. package/node_modules/graphql/jsutils/Maybe.d.ts +0 -6
  1140. package/node_modules/graphql/jsutils/Maybe.js +0 -5
  1141. package/node_modules/graphql/jsutils/Maybe.mjs +0 -1
  1142. package/node_modules/graphql/jsutils/ObjMap.d.ts +0 -20
  1143. package/node_modules/graphql/jsutils/ObjMap.js +0 -5
  1144. package/node_modules/graphql/jsutils/ObjMap.mjs +0 -1
  1145. package/node_modules/graphql/jsutils/Path.d.ts +0 -50
  1146. package/node_modules/graphql/jsutils/Path.js +0 -62
  1147. package/node_modules/graphql/jsutils/Path.mjs +0 -54
  1148. package/node_modules/graphql/jsutils/PromiseOrValue.d.ts +0 -2
  1149. package/node_modules/graphql/jsutils/PromiseOrValue.js +0 -5
  1150. package/node_modules/graphql/jsutils/PromiseOrValue.mjs +0 -1
  1151. package/node_modules/graphql/jsutils/devAssert.d.ts +0 -2
  1152. package/node_modules/graphql/jsutils/devAssert.js +0 -15
  1153. package/node_modules/graphql/jsutils/devAssert.mjs +0 -8
  1154. package/node_modules/graphql/jsutils/didYouMean.d.ts +0 -11
  1155. package/node_modules/graphql/jsutils/didYouMean.js +0 -41
  1156. package/node_modules/graphql/jsutils/didYouMean.mjs +0 -35
  1157. package/node_modules/graphql/jsutils/groupBy.d.ts +0 -9
  1158. package/node_modules/graphql/jsutils/groupBy.js +0 -28
  1159. package/node_modules/graphql/jsutils/groupBy.mjs +0 -21
  1160. package/node_modules/graphql/jsutils/identityFunc.d.ts +0 -6
  1161. package/node_modules/graphql/jsutils/identityFunc.js +0 -15
  1162. package/node_modules/graphql/jsutils/identityFunc.mjs +0 -8
  1163. package/node_modules/graphql/jsutils/inspect.d.ts +0 -6
  1164. package/node_modules/graphql/jsutils/inspect.js +0 -123
  1165. package/node_modules/graphql/jsutils/inspect.mjs +0 -117
  1166. package/node_modules/graphql/jsutils/instanceOf.d.ts +0 -18
  1167. package/node_modules/graphql/jsutils/instanceOf.js +0 -67
  1168. package/node_modules/graphql/jsutils/instanceOf.mjs +0 -59
  1169. package/node_modules/graphql/jsutils/invariant.d.ts +0 -5
  1170. package/node_modules/graphql/jsutils/invariant.js +0 -17
  1171. package/node_modules/graphql/jsutils/invariant.mjs +0 -10
  1172. package/node_modules/graphql/jsutils/isAsyncIterable.d.ts +0 -9
  1173. package/node_modules/graphql/jsutils/isAsyncIterable.js +0 -20
  1174. package/node_modules/graphql/jsutils/isAsyncIterable.mjs +0 -13
  1175. package/node_modules/graphql/jsutils/isIterableObject.d.ts +0 -21
  1176. package/node_modules/graphql/jsutils/isIterableObject.js +0 -33
  1177. package/node_modules/graphql/jsutils/isIterableObject.mjs +0 -26
  1178. package/node_modules/graphql/jsutils/isObjectLike.d.ts +0 -9
  1179. package/node_modules/graphql/jsutils/isObjectLike.js +0 -16
  1180. package/node_modules/graphql/jsutils/isObjectLike.mjs +0 -9
  1181. package/node_modules/graphql/jsutils/isPromise.d.ts +0 -7
  1182. package/node_modules/graphql/jsutils/isPromise.js +0 -19
  1183. package/node_modules/graphql/jsutils/isPromise.mjs +0 -12
  1184. package/node_modules/graphql/jsutils/keyMap.d.ts +0 -25
  1185. package/node_modules/graphql/jsutils/keyMap.js +0 -36
  1186. package/node_modules/graphql/jsutils/keyMap.mjs +0 -29
  1187. package/node_modules/graphql/jsutils/keyValMap.d.ts +0 -26
  1188. package/node_modules/graphql/jsutils/keyValMap.js +0 -36
  1189. package/node_modules/graphql/jsutils/keyValMap.mjs +0 -29
  1190. package/node_modules/graphql/jsutils/mapValue.d.ts +0 -11
  1191. package/node_modules/graphql/jsutils/mapValue.js +0 -22
  1192. package/node_modules/graphql/jsutils/mapValue.mjs +0 -15
  1193. package/node_modules/graphql/jsutils/memoize3.d.ts +0 -11
  1194. package/node_modules/graphql/jsutils/memoize3.js +0 -43
  1195. package/node_modules/graphql/jsutils/memoize3.mjs +0 -36
  1196. package/node_modules/graphql/jsutils/naturalCompare.d.ts +0 -10
  1197. package/node_modules/graphql/jsutils/naturalCompare.js +0 -71
  1198. package/node_modules/graphql/jsutils/naturalCompare.mjs +0 -63
  1199. package/node_modules/graphql/jsutils/printPathArray.d.ts +0 -8
  1200. package/node_modules/graphql/jsutils/printPathArray.js +0 -19
  1201. package/node_modules/graphql/jsutils/printPathArray.mjs +0 -12
  1202. package/node_modules/graphql/jsutils/promiseForObject.d.ts +0 -13
  1203. package/node_modules/graphql/jsutils/promiseForObject.js +0 -27
  1204. package/node_modules/graphql/jsutils/promiseForObject.mjs +0 -20
  1205. package/node_modules/graphql/jsutils/promiseReduce.d.ts +0 -15
  1206. package/node_modules/graphql/jsutils/promiseReduce.js +0 -29
  1207. package/node_modules/graphql/jsutils/promiseReduce.mjs +0 -22
  1208. package/node_modules/graphql/jsutils/suggestionList.d.ts +0 -10
  1209. package/node_modules/graphql/jsutils/suggestionList.js +0 -143
  1210. package/node_modules/graphql/jsutils/suggestionList.mjs +0 -134
  1211. package/node_modules/graphql/jsutils/toError.d.ts +0 -6
  1212. package/node_modules/graphql/jsutils/toError.js +0 -27
  1213. package/node_modules/graphql/jsutils/toError.mjs +0 -20
  1214. package/node_modules/graphql/jsutils/toObjMap.d.ts +0 -6
  1215. package/node_modules/graphql/jsutils/toObjMap.js +0 -25
  1216. package/node_modules/graphql/jsutils/toObjMap.mjs +0 -18
  1217. package/node_modules/graphql/language/ast.d.ts +0 -949
  1218. package/node_modules/graphql/language/ast.js +0 -301
  1219. package/node_modules/graphql/language/ast.mjs +0 -285
  1220. package/node_modules/graphql/language/blockString.d.ts +0 -26
  1221. package/node_modules/graphql/language/blockString.js +0 -193
  1222. package/node_modules/graphql/language/blockString.mjs +0 -176
  1223. package/node_modules/graphql/language/characterClasses.d.ts +0 -47
  1224. package/node_modules/graphql/language/characterClasses.js +0 -75
  1225. package/node_modules/graphql/language/characterClasses.mjs +0 -64
  1226. package/node_modules/graphql/language/directiveLocation.d.ts +0 -54
  1227. package/node_modules/graphql/language/directiveLocation.js +0 -43
  1228. package/node_modules/graphql/language/directiveLocation.mjs +0 -37
  1229. package/node_modules/graphql/language/index.d.ts +0 -117
  1230. package/node_modules/graphql/language/index.js +0 -227
  1231. package/node_modules/graphql/language/index.mjs +0 -42
  1232. package/node_modules/graphql/language/kinds.d.ts +0 -112
  1233. package/node_modules/graphql/language/kinds.js +0 -72
  1234. package/node_modules/graphql/language/kinds.mjs +0 -66
  1235. package/node_modules/graphql/language/lexer.d.ts +0 -129
  1236. package/node_modules/graphql/language/lexer.js +0 -1074
  1237. package/node_modules/graphql/language/lexer.mjs +0 -972
  1238. package/node_modules/graphql/language/location.d.ts +0 -29
  1239. package/node_modules/graphql/language/location.js +0 -49
  1240. package/node_modules/graphql/language/location.mjs +0 -41
  1241. package/node_modules/graphql/language/parser.d.ts +0 -829
  1242. package/node_modules/graphql/language/parser.js +0 -1949
  1243. package/node_modules/graphql/language/parser.mjs +0 -1899
  1244. package/node_modules/graphql/language/predicates.d.ts +0 -206
  1245. package/node_modules/graphql/language/predicates.js +0 -292
  1246. package/node_modules/graphql/language/predicates.mjs +0 -274
  1247. package/node_modules/graphql/language/printLocation.d.ts +0 -42
  1248. package/node_modules/graphql/language/printLocation.js +0 -103
  1249. package/node_modules/graphql/language/printLocation.mjs +0 -94
  1250. package/node_modules/graphql/language/printString.d.ts +0 -7
  1251. package/node_modules/graphql/language/printString.js +0 -187
  1252. package/node_modules/graphql/language/printString.mjs +0 -180
  1253. package/node_modules/graphql/language/printer.d.ts +0 -18
  1254. package/node_modules/graphql/language/printer.js +0 -411
  1255. package/node_modules/graphql/language/printer.mjs +0 -398
  1256. package/node_modules/graphql/language/schemaCoordinateLexer.d.ts +0 -45
  1257. package/node_modules/graphql/language/schemaCoordinateLexer.js +0 -175
  1258. package/node_modules/graphql/language/schemaCoordinateLexer.mjs +0 -126
  1259. package/node_modules/graphql/language/source.d.ts +0 -53
  1260. package/node_modules/graphql/language/source.js +0 -97
  1261. package/node_modules/graphql/language/source.mjs +0 -81
  1262. package/node_modules/graphql/language/tokenKind.d.ts +0 -63
  1263. package/node_modules/graphql/language/tokenKind.js +0 -49
  1264. package/node_modules/graphql/language/tokenKind.mjs +0 -43
  1265. package/node_modules/graphql/language/visitor.d.ts +0 -322
  1266. package/node_modules/graphql/language/visitor.js +0 -446
  1267. package/node_modules/graphql/language/visitor.mjs +0 -426
  1268. package/node_modules/graphql/package.json +0 -39
  1269. package/node_modules/graphql/subscription/index.d.ts +0 -25
  1270. package/node_modules/graphql/subscription/index.js +0 -19
  1271. package/node_modules/graphql/subscription/index.mjs +0 -25
  1272. package/node_modules/graphql/type/assertName.d.ts +0 -27
  1273. package/node_modules/graphql/type/assertName.js +0 -77
  1274. package/node_modules/graphql/type/assertName.mjs +0 -61
  1275. package/node_modules/graphql/type/definition.d.ts +0 -3387
  1276. package/node_modules/graphql/type/definition.js +0 -3515
  1277. package/node_modules/graphql/type/definition.mjs +0 -3378
  1278. package/node_modules/graphql/type/directives.d.ts +0 -273
  1279. package/node_modules/graphql/type/directives.js +0 -424
  1280. package/node_modules/graphql/type/directives.mjs +0 -388
  1281. package/node_modules/graphql/type/index.d.ts +0 -157
  1282. package/node_modules/graphql/type/index.js +0 -553
  1283. package/node_modules/graphql/type/index.mjs +0 -110
  1284. package/node_modules/graphql/type/introspection.d.ts +0 -66
  1285. package/node_modules/graphql/type/introspection.js +0 -681
  1286. package/node_modules/graphql/type/introspection.mjs +0 -623
  1287. package/node_modules/graphql/type/scalars.d.ts +0 -46
  1288. package/node_modules/graphql/type/scalars.js +0 -404
  1289. package/node_modules/graphql/type/scalars.mjs +0 -343
  1290. package/node_modules/graphql/type/schema.d.ts +0 -632
  1291. package/node_modules/graphql/type/schema.js +0 -860
  1292. package/node_modules/graphql/type/schema.mjs +0 -839
  1293. package/node_modules/graphql/type/validate.d.ts +0 -48
  1294. package/node_modules/graphql/type/validate.js +0 -738
  1295. package/node_modules/graphql/type/validate.mjs +0 -712
  1296. package/node_modules/graphql/utilities/TypeInfo.d.ts +0 -507
  1297. package/node_modules/graphql/utilities/TypeInfo.js +0 -861
  1298. package/node_modules/graphql/utilities/TypeInfo.mjs +0 -837
  1299. package/node_modules/graphql/utilities/assertValidName.d.ts +0 -38
  1300. package/node_modules/graphql/utilities/assertValidName.js +0 -77
  1301. package/node_modules/graphql/utilities/assertValidName.mjs +0 -65
  1302. package/node_modules/graphql/utilities/astFromValue.d.ts +0 -58
  1303. package/node_modules/graphql/utilities/astFromValue.js +0 -223
  1304. package/node_modules/graphql/utilities/astFromValue.mjs +0 -209
  1305. package/node_modules/graphql/utilities/buildASTSchema.d.ts +0 -94
  1306. package/node_modules/graphql/utilities/buildASTSchema.js +0 -178
  1307. package/node_modules/graphql/utilities/buildASTSchema.mjs +0 -160
  1308. package/node_modules/graphql/utilities/buildClientSchema.d.ts +0 -34
  1309. package/node_modules/graphql/utilities/buildClientSchema.js +0 -404
  1310. package/node_modules/graphql/utilities/buildClientSchema.mjs +0 -380
  1311. package/node_modules/graphql/utilities/coerceInputValue.d.ts +0 -62
  1312. package/node_modules/graphql/utilities/coerceInputValue.js +0 -264
  1313. package/node_modules/graphql/utilities/coerceInputValue.mjs +0 -238
  1314. package/node_modules/graphql/utilities/concatAST.d.ts +0 -21
  1315. package/node_modules/graphql/utilities/concatAST.js +0 -39
  1316. package/node_modules/graphql/utilities/concatAST.mjs +0 -31
  1317. package/node_modules/graphql/utilities/extendSchema.d.ts +0 -93
  1318. package/node_modules/graphql/utilities/extendSchema.js +0 -923
  1319. package/node_modules/graphql/utilities/extendSchema.mjs +0 -912
  1320. package/node_modules/graphql/utilities/findBreakingChanges.d.ts +0 -148
  1321. package/node_modules/graphql/utilities/findBreakingChanges.js +0 -615
  1322. package/node_modules/graphql/utilities/findBreakingChanges.mjs +0 -589
  1323. package/node_modules/graphql/utilities/getIntrospectionQuery.d.ts +0 -336
  1324. package/node_modules/graphql/utilities/getIntrospectionQuery.js +0 -179
  1325. package/node_modules/graphql/utilities/getIntrospectionQuery.mjs +0 -172
  1326. package/node_modules/graphql/utilities/getOperationAST.d.ts +0 -26
  1327. package/node_modules/graphql/utilities/getOperationAST.js +0 -59
  1328. package/node_modules/graphql/utilities/getOperationAST.mjs +0 -51
  1329. package/node_modules/graphql/utilities/getOperationRootType.d.ts +0 -32
  1330. package/node_modules/graphql/utilities/getOperationRootType.js +0 -85
  1331. package/node_modules/graphql/utilities/getOperationRootType.mjs +0 -71
  1332. package/node_modules/graphql/utilities/index.d.ts +0 -73
  1333. package/node_modules/graphql/utilities/index.js +0 -247
  1334. package/node_modules/graphql/utilities/index.mjs +0 -67
  1335. package/node_modules/graphql/utilities/introspectionFromSchema.d.ts +0 -72
  1336. package/node_modules/graphql/utilities/introspectionFromSchema.js +0 -99
  1337. package/node_modules/graphql/utilities/introspectionFromSchema.mjs +0 -86
  1338. package/node_modules/graphql/utilities/lexicographicSortSchema.d.ts +0 -44
  1339. package/node_modules/graphql/utilities/lexicographicSortSchema.js +0 -213
  1340. package/node_modules/graphql/utilities/lexicographicSortSchema.mjs +0 -207
  1341. package/node_modules/graphql/utilities/printSchema.d.ts +0 -68
  1342. package/node_modules/graphql/utilities/printSchema.js +0 -405
  1343. package/node_modules/graphql/utilities/printSchema.mjs +0 -382
  1344. package/node_modules/graphql/utilities/resolveSchemaCoordinate.d.ts +0 -142
  1345. package/node_modules/graphql/utilities/resolveSchemaCoordinate.js +0 -324
  1346. package/node_modules/graphql/utilities/resolveSchemaCoordinate.mjs +0 -306
  1347. package/node_modules/graphql/utilities/separateOperations.d.ts +0 -41
  1348. package/node_modules/graphql/utilities/separateOperations.js +0 -119
  1349. package/node_modules/graphql/utilities/separateOperations.mjs +0 -110
  1350. package/node_modules/graphql/utilities/sortValueNode.d.ts +0 -9
  1351. package/node_modules/graphql/utilities/sortValueNode.js +0 -47
  1352. package/node_modules/graphql/utilities/sortValueNode.mjs +0 -39
  1353. package/node_modules/graphql/utilities/stripIgnoredCharacters.d.ts +0 -69
  1354. package/node_modules/graphql/utilities/stripIgnoredCharacters.js +0 -131
  1355. package/node_modules/graphql/utilities/stripIgnoredCharacters.mjs +0 -113
  1356. package/node_modules/graphql/utilities/typeComparators.d.ts +0 -116
  1357. package/node_modules/graphql/utilities/typeComparators.js +0 -201
  1358. package/node_modules/graphql/utilities/typeComparators.mjs +0 -190
  1359. package/node_modules/graphql/utilities/typeFromAST.d.ts +0 -118
  1360. package/node_modules/graphql/utilities/typeFromAST.js +0 -30
  1361. package/node_modules/graphql/utilities/typeFromAST.mjs +0 -21
  1362. package/node_modules/graphql/utilities/typedQueryDocumentNode.d.ts +0 -26
  1363. package/node_modules/graphql/utilities/typedQueryDocumentNode.js +0 -5
  1364. package/node_modules/graphql/utilities/typedQueryDocumentNode.mjs +0 -1
  1365. package/node_modules/graphql/utilities/valueFromAST.d.ts +0 -67
  1366. package/node_modules/graphql/utilities/valueFromAST.js +0 -246
  1367. package/node_modules/graphql/utilities/valueFromAST.mjs +0 -232
  1368. package/node_modules/graphql/utilities/valueFromASTUntyped.d.ts +0 -36
  1369. package/node_modules/graphql/utilities/valueFromASTUntyped.js +0 -75
  1370. package/node_modules/graphql/utilities/valueFromASTUntyped.mjs +0 -66
  1371. package/node_modules/graphql/validation/ValidationContext.d.ts +0 -495
  1372. package/node_modules/graphql/validation/ValidationContext.js +0 -633
  1373. package/node_modules/graphql/validation/ValidationContext.mjs +0 -614
  1374. package/node_modules/graphql/validation/index.d.ts +0 -47
  1375. package/node_modules/graphql/validation/index.js +0 -331
  1376. package/node_modules/graphql/validation/index.mjs +0 -75
  1377. package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.d.ts +0 -41
  1378. package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.js +0 -75
  1379. package/node_modules/graphql/validation/rules/ExecutableDefinitionsRule.mjs +0 -62
  1380. package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.d.ts +0 -41
  1381. package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js +0 -178
  1382. package/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.mjs +0 -159
  1383. package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.d.ts +0 -42
  1384. package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.js +0 -98
  1385. package/node_modules/graphql/validation/rules/FragmentsOnCompositeTypesRule.mjs +0 -81
  1386. package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.d.ts +0 -49
  1387. package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.js +0 -147
  1388. package/node_modules/graphql/validation/rules/KnownArgumentNamesRule.mjs +0 -128
  1389. package/node_modules/graphql/validation/rules/KnownDirectivesRule.d.ts +0 -44
  1390. package/node_modules/graphql/validation/rules/KnownDirectivesRule.js +0 -200
  1391. package/node_modules/graphql/validation/rules/KnownDirectivesRule.mjs +0 -182
  1392. package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.d.ts +0 -41
  1393. package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.js +0 -65
  1394. package/node_modules/graphql/validation/rules/KnownFragmentNamesRule.mjs +0 -54
  1395. package/node_modules/graphql/validation/rules/KnownTypeNamesRule.d.ts +0 -44
  1396. package/node_modules/graphql/validation/rules/KnownTypeNamesRule.js +0 -118
  1397. package/node_modules/graphql/validation/rules/KnownTypeNamesRule.mjs +0 -105
  1398. package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.d.ts +0 -41
  1399. package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.js +0 -71
  1400. package/node_modules/graphql/validation/rules/LoneAnonymousOperationRule.mjs +0 -62
  1401. package/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.d.ts +0 -31
  1402. package/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.js +0 -89
  1403. package/node_modules/graphql/validation/rules/LoneSchemaDefinitionRule.mjs +0 -78
  1404. package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.d.ts +0 -36
  1405. package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.js +0 -123
  1406. package/node_modules/graphql/validation/rules/MaxIntrospectionDepthRule.mjs +0 -111
  1407. package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.d.ts +0 -41
  1408. package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.js +0 -114
  1409. package/node_modules/graphql/validation/rules/NoFragmentCyclesRule.mjs +0 -106
  1410. package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.d.ts +0 -41
  1411. package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.js +0 -81
  1412. package/node_modules/graphql/validation/rules/NoUndefinedVariablesRule.mjs +0 -73
  1413. package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.d.ts +0 -41
  1414. package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.js +0 -90
  1415. package/node_modules/graphql/validation/rules/NoUnusedFragmentsRule.mjs +0 -79
  1416. package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.d.ts +0 -42
  1417. package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.js +0 -87
  1418. package/node_modules/graphql/validation/rules/NoUnusedVariablesRule.mjs +0 -79
  1419. package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +0 -47
  1420. package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.js +0 -907
  1421. package/node_modules/graphql/validation/rules/OverlappingFieldsCanBeMergedRule.mjs +0 -892
  1422. package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.d.ts +0 -48
  1423. package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.js +0 -132
  1424. package/node_modules/graphql/validation/rules/PossibleFragmentSpreadsRule.mjs +0 -109
  1425. package/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.d.ts +0 -31
  1426. package/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.js +0 -193
  1427. package/node_modules/graphql/validation/rules/PossibleTypeExtensionsRule.mjs +0 -169
  1428. package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.d.ts +0 -46
  1429. package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.js +0 -189
  1430. package/node_modules/graphql/validation/rules/ProvidedRequiredArgumentsRule.mjs +0 -168
  1431. package/node_modules/graphql/validation/rules/ScalarLeafsRule.d.ts +0 -37
  1432. package/node_modules/graphql/validation/rules/ScalarLeafsRule.js +0 -95
  1433. package/node_modules/graphql/validation/rules/ScalarLeafsRule.mjs +0 -85
  1434. package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.d.ts +0 -46
  1435. package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.js +0 -120
  1436. package/node_modules/graphql/validation/rules/SingleFieldSubscriptionsRule.mjs +0 -110
  1437. package/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.d.ts +0 -32
  1438. package/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.js +0 -114
  1439. package/node_modules/graphql/validation/rules/UniqueArgumentDefinitionNamesRule.mjs +0 -102
  1440. package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.d.ts +0 -41
  1441. package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.js +0 -84
  1442. package/node_modules/graphql/validation/rules/UniqueArgumentNamesRule.mjs +0 -72
  1443. package/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.d.ts +0 -31
  1444. package/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.js +0 -76
  1445. package/node_modules/graphql/validation/rules/UniqueDirectiveNamesRule.mjs +0 -68
  1446. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.d.ts +0 -44
  1447. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.js +0 -136
  1448. package/node_modules/graphql/validation/rules/UniqueDirectivesPerLocationRule.mjs +0 -125
  1449. package/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.d.ts +0 -31
  1450. package/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.js +0 -97
  1451. package/node_modules/graphql/validation/rules/UniqueEnumValueNamesRule.mjs +0 -85
  1452. package/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.d.ts +0 -31
  1453. package/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.js +0 -109
  1454. package/node_modules/graphql/validation/rules/UniqueFieldDefinitionNamesRule.mjs +0 -100
  1455. package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.d.ts +0 -40
  1456. package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.js +0 -70
  1457. package/node_modules/graphql/validation/rules/UniqueFragmentNamesRule.mjs +0 -62
  1458. package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.d.ts +0 -45
  1459. package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.js +0 -87
  1460. package/node_modules/graphql/validation/rules/UniqueInputFieldNamesRule.mjs +0 -78
  1461. package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.d.ts +0 -40
  1462. package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.js +0 -75
  1463. package/node_modules/graphql/validation/rules/UniqueOperationNamesRule.mjs +0 -67
  1464. package/node_modules/graphql/validation/rules/UniqueOperationTypesRule.d.ts +0 -31
  1465. package/node_modules/graphql/validation/rules/UniqueOperationTypesRule.js +0 -93
  1466. package/node_modules/graphql/validation/rules/UniqueOperationTypesRule.mjs +0 -85
  1467. package/node_modules/graphql/validation/rules/UniqueTypeNamesRule.d.ts +0 -31
  1468. package/node_modules/graphql/validation/rules/UniqueTypeNamesRule.js +0 -79
  1469. package/node_modules/graphql/validation/rules/UniqueTypeNamesRule.mjs +0 -68
  1470. package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.d.ts +0 -38
  1471. package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.js +0 -78
  1472. package/node_modules/graphql/validation/rules/UniqueVariableNamesRule.mjs +0 -69
  1473. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.d.ts +0 -41
  1474. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js +0 -271
  1475. package/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.mjs +0 -247
  1476. package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.d.ts +0 -45
  1477. package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.js +0 -79
  1478. package/node_modules/graphql/validation/rules/VariablesAreInputTypesRule.mjs +0 -65
  1479. package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.d.ts +0 -40
  1480. package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.js +0 -165
  1481. package/node_modules/graphql/validation/rules/VariablesInAllowedPositionRule.mjs +0 -149
  1482. package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.d.ts +0 -56
  1483. package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.js +0 -173
  1484. package/node_modules/graphql/validation/rules/custom/NoDeprecatedCustomRule.mjs +0 -158
  1485. package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.d.ts +0 -43
  1486. package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.js +0 -70
  1487. package/node_modules/graphql/validation/rules/custom/NoSchemaIntrospectionCustomRule.mjs +0 -60
  1488. package/node_modules/graphql/validation/specifiedRules.d.ts +0 -17
  1489. package/node_modules/graphql/validation/specifiedRules.js +0 -175
  1490. package/node_modules/graphql/validation/specifiedRules.mjs +0 -131
  1491. package/node_modules/graphql/validation/validate.d.ts +0 -122
  1492. package/node_modules/graphql/validation/validate.js +0 -219
  1493. package/node_modules/graphql/validation/validate.mjs +0 -200
  1494. package/node_modules/graphql/version.d.ts +0 -10
  1495. package/node_modules/graphql/version.js +0 -23
  1496. package/node_modules/graphql/version.mjs +0 -14
  1497. package/node_modules/hono/LICENSE +0 -21
  1498. package/node_modules/hono/README.md +0 -85
  1499. package/node_modules/hono/dist/adapter/aws-lambda/conninfo.js +0 -24
  1500. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +0 -364
  1501. package/node_modules/hono/dist/adapter/aws-lambda/index.js +0 -9
  1502. package/node_modules/hono/dist/adapter/aws-lambda/types.js +0 -0
  1503. package/node_modules/hono/dist/adapter/bun/conninfo.js +0 -27
  1504. package/node_modules/hono/dist/adapter/bun/index.js +0 -16
  1505. package/node_modules/hono/dist/adapter/bun/serve-static.js +0 -30
  1506. package/node_modules/hono/dist/adapter/bun/server.js +0 -5
  1507. package/node_modules/hono/dist/adapter/bun/ssg.js +0 -17
  1508. package/node_modules/hono/dist/adapter/bun/websocket.js +0 -73
  1509. package/node_modules/hono/dist/adapter/cloudflare-pages/conninfo.js +0 -9
  1510. package/node_modules/hono/dist/adapter/cloudflare-pages/handler.js +0 -67
  1511. package/node_modules/hono/dist/adapter/cloudflare-pages/index.js +0 -9
  1512. package/node_modules/hono/dist/adapter/cloudflare-workers/conninfo.js +0 -9
  1513. package/node_modules/hono/dist/adapter/cloudflare-workers/index.js +0 -9
  1514. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static-module.js +0 -8
  1515. package/node_modules/hono/dist/adapter/cloudflare-workers/serve-static.js +0 -22
  1516. package/node_modules/hono/dist/adapter/cloudflare-workers/utils.js +0 -35
  1517. package/node_modules/hono/dist/adapter/cloudflare-workers/websocket.js +0 -41
  1518. package/node_modules/hono/dist/adapter/deno/conninfo.js +0 -14
  1519. package/node_modules/hono/dist/adapter/deno/deno.d.js +0 -0
  1520. package/node_modules/hono/dist/adapter/deno/index.js +0 -12
  1521. package/node_modules/hono/dist/adapter/deno/serve-static.js +0 -40
  1522. package/node_modules/hono/dist/adapter/deno/ssg.js +0 -18
  1523. package/node_modules/hono/dist/adapter/deno/websocket.js +0 -32
  1524. package/node_modules/hono/dist/adapter/lambda-edge/conninfo.js +0 -9
  1525. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +0 -96
  1526. package/node_modules/hono/dist/adapter/lambda-edge/index.js +0 -7
  1527. package/node_modules/hono/dist/adapter/netlify/conninfo.js +0 -9
  1528. package/node_modules/hono/dist/adapter/netlify/handler.js +0 -9
  1529. package/node_modules/hono/dist/adapter/netlify/index.js +0 -2
  1530. package/node_modules/hono/dist/adapter/netlify/mod.js +0 -7
  1531. package/node_modules/hono/dist/adapter/service-worker/handler.js +0 -20
  1532. package/node_modules/hono/dist/adapter/service-worker/index.js +0 -9
  1533. package/node_modules/hono/dist/adapter/service-worker/types.js +0 -0
  1534. package/node_modules/hono/dist/adapter/vercel/conninfo.js +0 -10
  1535. package/node_modules/hono/dist/adapter/vercel/handler.js +0 -7
  1536. package/node_modules/hono/dist/adapter/vercel/index.js +0 -7
  1537. package/node_modules/hono/dist/cjs/adapter/aws-lambda/conninfo.js +0 -46
  1538. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +0 -395
  1539. package/node_modules/hono/dist/cjs/adapter/aws-lambda/index.js +0 -34
  1540. package/node_modules/hono/dist/cjs/adapter/aws-lambda/types.js +0 -15
  1541. package/node_modules/hono/dist/cjs/adapter/bun/conninfo.js +0 -49
  1542. package/node_modules/hono/dist/cjs/adapter/bun/index.js +0 -45
  1543. package/node_modules/hono/dist/cjs/adapter/bun/serve-static.js +0 -52
  1544. package/node_modules/hono/dist/cjs/adapter/bun/server.js +0 -27
  1545. package/node_modules/hono/dist/cjs/adapter/bun/ssg.js +0 -40
  1546. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +0 -98
  1547. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/conninfo.js +0 -31
  1548. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/handler.js +0 -91
  1549. package/node_modules/hono/dist/cjs/adapter/cloudflare-pages/index.js +0 -34
  1550. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/conninfo.js +0 -31
  1551. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/index.js +0 -33
  1552. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static-module.js +0 -30
  1553. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/serve-static.js +0 -44
  1554. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/utils.js +0 -57
  1555. package/node_modules/hono/dist/cjs/adapter/cloudflare-workers/websocket.js +0 -63
  1556. package/node_modules/hono/dist/cjs/adapter/deno/conninfo.js +0 -36
  1557. package/node_modules/hono/dist/cjs/adapter/deno/deno.d.js +0 -0
  1558. package/node_modules/hono/dist/cjs/adapter/deno/index.js +0 -38
  1559. package/node_modules/hono/dist/cjs/adapter/deno/serve-static.js +0 -62
  1560. package/node_modules/hono/dist/cjs/adapter/deno/ssg.js +0 -41
  1561. package/node_modules/hono/dist/cjs/adapter/deno/websocket.js +0 -54
  1562. package/node_modules/hono/dist/cjs/adapter/lambda-edge/conninfo.js +0 -31
  1563. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +0 -130
  1564. package/node_modules/hono/dist/cjs/adapter/lambda-edge/index.js +0 -30
  1565. package/node_modules/hono/dist/cjs/adapter/netlify/conninfo.js +0 -31
  1566. package/node_modules/hono/dist/cjs/adapter/netlify/handler.js +0 -31
  1567. package/node_modules/hono/dist/cjs/adapter/netlify/index.js +0 -21
  1568. package/node_modules/hono/dist/cjs/adapter/netlify/mod.js +0 -30
  1569. package/node_modules/hono/dist/cjs/adapter/service-worker/handler.js +0 -42
  1570. package/node_modules/hono/dist/cjs/adapter/service-worker/index.js +0 -32
  1571. package/node_modules/hono/dist/cjs/adapter/service-worker/types.js +0 -15
  1572. package/node_modules/hono/dist/cjs/adapter/vercel/conninfo.js +0 -32
  1573. package/node_modules/hono/dist/cjs/adapter/vercel/handler.js +0 -29
  1574. package/node_modules/hono/dist/cjs/adapter/vercel/index.js +0 -30
  1575. package/node_modules/hono/dist/cjs/client/client.js +0 -204
  1576. package/node_modules/hono/dist/cjs/client/fetch-result-please.js +0 -85
  1577. package/node_modules/hono/dist/cjs/client/index.js +0 -32
  1578. package/node_modules/hono/dist/cjs/client/types.js +0 -15
  1579. package/node_modules/hono/dist/cjs/client/utils.js +0 -105
  1580. package/node_modules/hono/dist/cjs/compose.js +0 -68
  1581. package/node_modules/hono/dist/cjs/context.js +0 -450
  1582. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +0 -43
  1583. package/node_modules/hono/dist/cjs/helper/accepts/index.js +0 -27
  1584. package/node_modules/hono/dist/cjs/helper/adapter/index.js +0 -81
  1585. package/node_modules/hono/dist/cjs/helper/conninfo/index.js +0 -15
  1586. package/node_modules/hono/dist/cjs/helper/conninfo/types.js +0 -15
  1587. package/node_modules/hono/dist/cjs/helper/cookie/index.js +0 -130
  1588. package/node_modules/hono/dist/cjs/helper/css/common.js +0 -273
  1589. package/node_modules/hono/dist/cjs/helper/css/index.js +0 -157
  1590. package/node_modules/hono/dist/cjs/helper/dev/index.js +0 -79
  1591. package/node_modules/hono/dist/cjs/helper/factory/index.js +0 -54
  1592. package/node_modules/hono/dist/cjs/helper/html/index.js +0 -64
  1593. package/node_modules/hono/dist/cjs/helper/proxy/index.js +0 -115
  1594. package/node_modules/hono/dist/cjs/helper/route/index.js +0 -71
  1595. package/node_modules/hono/dist/cjs/helper/ssg/index.js +0 -43
  1596. package/node_modules/hono/dist/cjs/helper/ssg/middleware.js +0 -73
  1597. package/node_modules/hono/dist/cjs/helper/ssg/plugins.js +0 -70
  1598. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +0 -320
  1599. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +0 -93
  1600. package/node_modules/hono/dist/cjs/helper/streaming/index.js +0 -35
  1601. package/node_modules/hono/dist/cjs/helper/streaming/sse.js +0 -91
  1602. package/node_modules/hono/dist/cjs/helper/streaming/stream.js +0 -56
  1603. package/node_modules/hono/dist/cjs/helper/streaming/text.js +0 -34
  1604. package/node_modules/hono/dist/cjs/helper/streaming/utils.js +0 -35
  1605. package/node_modules/hono/dist/cjs/helper/testing/index.js +0 -33
  1606. package/node_modules/hono/dist/cjs/helper/websocket/index.js +0 -81
  1607. package/node_modules/hono/dist/cjs/hono-base.js +0 -406
  1608. package/node_modules/hono/dist/cjs/hono.js +0 -43
  1609. package/node_modules/hono/dist/cjs/http-exception.js +0 -57
  1610. package/node_modules/hono/dist/cjs/index.js +0 -30
  1611. package/node_modules/hono/dist/cjs/jsx/base.js +0 -378
  1612. package/node_modules/hono/dist/cjs/jsx/children.js +0 -44
  1613. package/node_modules/hono/dist/cjs/jsx/components.js +0 -221
  1614. package/node_modules/hono/dist/cjs/jsx/constants.js +0 -42
  1615. package/node_modules/hono/dist/cjs/jsx/context.js +0 -188
  1616. package/node_modules/hono/dist/cjs/jsx/dom/client.js +0 -76
  1617. package/node_modules/hono/dist/cjs/jsx/dom/components.js +0 -55
  1618. package/node_modules/hono/dist/cjs/jsx/dom/context.js +0 -71
  1619. package/node_modules/hono/dist/cjs/jsx/dom/css.js +0 -168
  1620. package/node_modules/hono/dist/cjs/jsx/dom/hooks/index.js +0 -74
  1621. package/node_modules/hono/dist/cjs/jsx/dom/index.js +0 -181
  1622. package/node_modules/hono/dist/cjs/jsx/dom/intrinsic-element/components.js +0 -399
  1623. package/node_modules/hono/dist/cjs/jsx/dom/jsx-dev-runtime.js +0 -52
  1624. package/node_modules/hono/dist/cjs/jsx/dom/jsx-runtime.js +0 -32
  1625. package/node_modules/hono/dist/cjs/jsx/dom/render.js +0 -641
  1626. package/node_modules/hono/dist/cjs/jsx/dom/server.js +0 -67
  1627. package/node_modules/hono/dist/cjs/jsx/dom/utils.js +0 -32
  1628. package/node_modules/hono/dist/cjs/jsx/hooks/index.js +0 -373
  1629. package/node_modules/hono/dist/cjs/jsx/index.js +0 -138
  1630. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/common.js +0 -50
  1631. package/node_modules/hono/dist/cjs/jsx/intrinsic-element/components.js +0 -189
  1632. package/node_modules/hono/dist/cjs/jsx/intrinsic-elements.js +0 -15
  1633. package/node_modules/hono/dist/cjs/jsx/jsx-dev-runtime.js +0 -41
  1634. package/node_modules/hono/dist/cjs/jsx/jsx-runtime.js +0 -71
  1635. package/node_modules/hono/dist/cjs/jsx/streaming.js +0 -179
  1636. package/node_modules/hono/dist/cjs/jsx/types.js +0 -15
  1637. package/node_modules/hono/dist/cjs/jsx/utils.js +0 -200
  1638. package/node_modules/hono/dist/cjs/middleware/basic-auth/index.js +0 -88
  1639. package/node_modules/hono/dist/cjs/middleware/bearer-auth/index.js +0 -114
  1640. package/node_modules/hono/dist/cjs/middleware/body-limit/index.js +0 -75
  1641. package/node_modules/hono/dist/cjs/middleware/cache/index.js +0 -219
  1642. package/node_modules/hono/dist/cjs/middleware/combine/index.js +0 -101
  1643. package/node_modules/hono/dist/cjs/middleware/compress/index.js +0 -97
  1644. package/node_modules/hono/dist/cjs/middleware/context-storage/index.js +0 -47
  1645. package/node_modules/hono/dist/cjs/middleware/cors/index.js +0 -106
  1646. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +0 -77
  1647. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +0 -55
  1648. package/node_modules/hono/dist/cjs/middleware/etag/index.js +0 -96
  1649. package/node_modules/hono/dist/cjs/middleware/ip-restriction/index.js +0 -176
  1650. package/node_modules/hono/dist/cjs/middleware/jsx-renderer/index.js +0 -82
  1651. package/node_modules/hono/dist/cjs/middleware/jwk/index.js +0 -27
  1652. package/node_modules/hono/dist/cjs/middleware/jwk/jwk.js +0 -139
  1653. package/node_modules/hono/dist/cjs/middleware/jwt/index.js +0 -38
  1654. package/node_modules/hono/dist/cjs/middleware/jwt/jwt.js +0 -145
  1655. package/node_modules/hono/dist/cjs/middleware/language/index.js +0 -35
  1656. package/node_modules/hono/dist/cjs/middleware/language/language.js +0 -203
  1657. package/node_modules/hono/dist/cjs/middleware/logger/index.js +0 -72
  1658. package/node_modules/hono/dist/cjs/middleware/method-not-allowed/index.js +0 -90
  1659. package/node_modules/hono/dist/cjs/middleware/method-override/index.js +0 -106
  1660. package/node_modules/hono/dist/cjs/middleware/powered-by/index.js +0 -32
  1661. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +0 -37
  1662. package/node_modules/hono/dist/cjs/middleware/request-id/index.js +0 -27
  1663. package/node_modules/hono/dist/cjs/middleware/request-id/request-id.js +0 -43
  1664. package/node_modules/hono/dist/cjs/middleware/secure-headers/index.js +0 -29
  1665. package/node_modules/hono/dist/cjs/middleware/secure-headers/permissions-policy.js +0 -15
  1666. package/node_modules/hono/dist/cjs/middleware/secure-headers/secure-headers.js +0 -195
  1667. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +0 -99
  1668. package/node_modules/hono/dist/cjs/middleware/serve-static/path.js +0 -40
  1669. package/node_modules/hono/dist/cjs/middleware/timeout/index.js +0 -47
  1670. package/node_modules/hono/dist/cjs/middleware/timing/index.js +0 -35
  1671. package/node_modules/hono/dist/cjs/middleware/timing/timing.js +0 -130
  1672. package/node_modules/hono/dist/cjs/middleware/trailing-slash/index.js +0 -62
  1673. package/node_modules/hono/dist/cjs/package.json +0 -3
  1674. package/node_modules/hono/dist/cjs/preset/quick.js +0 -38
  1675. package/node_modules/hono/dist/cjs/preset/tiny.js +0 -34
  1676. package/node_modules/hono/dist/cjs/request/constants.js +0 -27
  1677. package/node_modules/hono/dist/cjs/request.js +0 -342
  1678. package/node_modules/hono/dist/cjs/router/linear-router/index.js +0 -27
  1679. package/node_modules/hono/dist/cjs/router/linear-router/router.js +0 -140
  1680. package/node_modules/hono/dist/cjs/router/pattern-router/index.js +0 -27
  1681. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +0 -70
  1682. package/node_modules/hono/dist/cjs/router/reg-exp-router/index.js +0 -34
  1683. package/node_modules/hono/dist/cjs/router/reg-exp-router/matcher.js +0 -48
  1684. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +0 -133
  1685. package/node_modules/hono/dist/cjs/router/reg-exp-router/prepared-router.js +0 -166
  1686. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +0 -187
  1687. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +0 -89
  1688. package/node_modules/hono/dist/cjs/router/smart-router/index.js +0 -27
  1689. package/node_modules/hono/dist/cjs/router/smart-router/router.js +0 -80
  1690. package/node_modules/hono/dist/cjs/router/trie-router/index.js +0 -27
  1691. package/node_modules/hono/dist/cjs/router/trie-router/node.js +0 -210
  1692. package/node_modules/hono/dist/cjs/router/trie-router/router.js +0 -48
  1693. package/node_modules/hono/dist/cjs/router.js +0 -40
  1694. package/node_modules/hono/dist/cjs/types.js +0 -28
  1695. package/node_modules/hono/dist/cjs/utils/accept.js +0 -245
  1696. package/node_modules/hono/dist/cjs/utils/basic-auth.js +0 -45
  1697. package/node_modules/hono/dist/cjs/utils/body.js +0 -111
  1698. package/node_modules/hono/dist/cjs/utils/buffer.js +0 -103
  1699. package/node_modules/hono/dist/cjs/utils/color.js +0 -48
  1700. package/node_modules/hono/dist/cjs/utils/compress.js +0 -27
  1701. package/node_modules/hono/dist/cjs/utils/concurrent.js +0 -61
  1702. package/node_modules/hono/dist/cjs/utils/constants.js +0 -27
  1703. package/node_modules/hono/dist/cjs/utils/cookie.js +0 -199
  1704. package/node_modules/hono/dist/cjs/utils/crypto.js +0 -69
  1705. package/node_modules/hono/dist/cjs/utils/encode.js +0 -54
  1706. package/node_modules/hono/dist/cjs/utils/filepath.js +0 -58
  1707. package/node_modules/hono/dist/cjs/utils/handler.js +0 -36
  1708. package/node_modules/hono/dist/cjs/utils/headers.js +0 -15
  1709. package/node_modules/hono/dist/cjs/utils/html.js +0 -150
  1710. package/node_modules/hono/dist/cjs/utils/http-status.js +0 -15
  1711. package/node_modules/hono/dist/cjs/utils/ipaddr.js +0 -318
  1712. package/node_modules/hono/dist/cjs/utils/jwt/index.js +0 -28
  1713. package/node_modules/hono/dist/cjs/utils/jwt/jwa.js +0 -42
  1714. package/node_modules/hono/dist/cjs/utils/jwt/jws.js +0 -215
  1715. package/node_modules/hono/dist/cjs/utils/jwt/jwt.js +0 -219
  1716. package/node_modules/hono/dist/cjs/utils/jwt/types.js +0 -161
  1717. package/node_modules/hono/dist/cjs/utils/jwt/utf8.js +0 -30
  1718. package/node_modules/hono/dist/cjs/utils/mime.js +0 -106
  1719. package/node_modules/hono/dist/cjs/utils/stream.js +0 -103
  1720. package/node_modules/hono/dist/cjs/utils/types.js +0 -15
  1721. package/node_modules/hono/dist/cjs/utils/url.js +0 -256
  1722. package/node_modules/hono/dist/cjs/validator/index.js +0 -27
  1723. package/node_modules/hono/dist/cjs/validator/utils.js +0 -15
  1724. package/node_modules/hono/dist/cjs/validator/validator.js +0 -108
  1725. package/node_modules/hono/dist/client/client.js +0 -189
  1726. package/node_modules/hono/dist/client/fetch-result-please.js +0 -62
  1727. package/node_modules/hono/dist/client/index.js +0 -8
  1728. package/node_modules/hono/dist/client/types.js +0 -0
  1729. package/node_modules/hono/dist/client/utils.js +0 -76
  1730. package/node_modules/hono/dist/compose.js +0 -46
  1731. package/node_modules/hono/dist/context.js +0 -427
  1732. package/node_modules/hono/dist/helper/accepts/accepts.js +0 -20
  1733. package/node_modules/hono/dist/helper/accepts/index.js +0 -5
  1734. package/node_modules/hono/dist/helper/adapter/index.js +0 -56
  1735. package/node_modules/hono/dist/helper/conninfo/index.js +0 -0
  1736. package/node_modules/hono/dist/helper/conninfo/types.js +0 -0
  1737. package/node_modules/hono/dist/helper/cookie/index.js +0 -102
  1738. package/node_modules/hono/dist/helper/css/common.js +0 -236
  1739. package/node_modules/hono/dist/helper/css/index.js +0 -140
  1740. package/node_modules/hono/dist/helper/dev/index.js +0 -55
  1741. package/node_modules/hono/dist/helper/factory/index.js +0 -30
  1742. package/node_modules/hono/dist/helper/html/index.js +0 -41
  1743. package/node_modules/hono/dist/helper/proxy/index.js +0 -93
  1744. package/node_modules/hono/dist/helper/route/index.js +0 -46
  1745. package/node_modules/hono/dist/helper/ssg/index.js +0 -19
  1746. package/node_modules/hono/dist/helper/ssg/middleware.js +0 -45
  1747. package/node_modules/hono/dist/helper/ssg/plugins.js +0 -47
  1748. package/node_modules/hono/dist/helper/ssg/ssg.js +0 -297
  1749. package/node_modules/hono/dist/helper/ssg/utils.js +0 -67
  1750. package/node_modules/hono/dist/helper/streaming/index.js +0 -10
  1751. package/node_modules/hono/dist/helper/streaming/sse.js +0 -68
  1752. package/node_modules/hono/dist/helper/streaming/stream.js +0 -34
  1753. package/node_modules/hono/dist/helper/streaming/text.js +0 -12
  1754. package/node_modules/hono/dist/helper/streaming/utils.js +0 -13
  1755. package/node_modules/hono/dist/helper/testing/index.js +0 -11
  1756. package/node_modules/hono/dist/helper/websocket/index.js +0 -57
  1757. package/node_modules/hono/dist/hono-base.js +0 -384
  1758. package/node_modules/hono/dist/hono.js +0 -21
  1759. package/node_modules/hono/dist/http-exception.js +0 -35
  1760. package/node_modules/hono/dist/index.js +0 -7
  1761. package/node_modules/hono/dist/jsx/base.js +0 -346
  1762. package/node_modules/hono/dist/jsx/children.js +0 -21
  1763. package/node_modules/hono/dist/jsx/components.js +0 -198
  1764. package/node_modules/hono/dist/jsx/constants.js +0 -15
  1765. package/node_modules/hono/dist/jsx/context.js +0 -162
  1766. package/node_modules/hono/dist/jsx/dom/client.js +0 -53
  1767. package/node_modules/hono/dist/jsx/dom/components.js +0 -32
  1768. package/node_modules/hono/dist/jsx/dom/context.js +0 -48
  1769. package/node_modules/hono/dist/jsx/dom/css.js +0 -150
  1770. package/node_modules/hono/dist/jsx/dom/hooks/index.js +0 -48
  1771. package/node_modules/hono/dist/jsx/dom/index.js +0 -142
  1772. package/node_modules/hono/dist/jsx/dom/intrinsic-element/components.js +0 -374
  1773. package/node_modules/hono/dist/jsx/dom/jsx-dev-runtime.js +0 -19
  1774. package/node_modules/hono/dist/jsx/dom/jsx-runtime.js +0 -8
  1775. package/node_modules/hono/dist/jsx/dom/render.js +0 -617
  1776. package/node_modules/hono/dist/jsx/dom/server.js +0 -33
  1777. package/node_modules/hono/dist/jsx/dom/utils.js +0 -10
  1778. package/node_modules/hono/dist/jsx/hooks/index.js +0 -331
  1779. package/node_modules/hono/dist/jsx/index.js +0 -103
  1780. package/node_modules/hono/dist/jsx/intrinsic-element/common.js +0 -24
  1781. package/node_modules/hono/dist/jsx/intrinsic-element/components.js +0 -165
  1782. package/node_modules/hono/dist/jsx/intrinsic-elements.js +0 -0
  1783. package/node_modules/hono/dist/jsx/jsx-dev-runtime.js +0 -18
  1784. package/node_modules/hono/dist/jsx/jsx-runtime.js +0 -44
  1785. package/node_modules/hono/dist/jsx/streaming.js +0 -155
  1786. package/node_modules/hono/dist/jsx/types.js +0 -0
  1787. package/node_modules/hono/dist/jsx/utils.js +0 -175
  1788. package/node_modules/hono/dist/middleware/basic-auth/index.js +0 -66
  1789. package/node_modules/hono/dist/middleware/bearer-auth/index.js +0 -92
  1790. package/node_modules/hono/dist/middleware/body-limit/index.js +0 -53
  1791. package/node_modules/hono/dist/middleware/cache/index.js +0 -197
  1792. package/node_modules/hono/dist/middleware/combine/index.js +0 -77
  1793. package/node_modules/hono/dist/middleware/compress/index.js +0 -74
  1794. package/node_modules/hono/dist/middleware/context-storage/index.js +0 -23
  1795. package/node_modules/hono/dist/middleware/cors/index.js +0 -84
  1796. package/node_modules/hono/dist/middleware/csrf/index.js +0 -55
  1797. package/node_modules/hono/dist/middleware/etag/digest.js +0 -33
  1798. package/node_modules/hono/dist/middleware/etag/index.js +0 -73
  1799. package/node_modules/hono/dist/middleware/ip-restriction/index.js +0 -162
  1800. package/node_modules/hono/dist/middleware/jsx-renderer/index.js +0 -58
  1801. package/node_modules/hono/dist/middleware/jwk/index.js +0 -5
  1802. package/node_modules/hono/dist/middleware/jwk/jwk.js +0 -117
  1803. package/node_modules/hono/dist/middleware/jwt/index.js +0 -11
  1804. package/node_modules/hono/dist/middleware/jwt/jwt.js +0 -119
  1805. package/node_modules/hono/dist/middleware/language/index.js +0 -15
  1806. package/node_modules/hono/dist/middleware/language/language.js +0 -172
  1807. package/node_modules/hono/dist/middleware/logger/index.js +0 -44
  1808. package/node_modules/hono/dist/middleware/method-not-allowed/index.js +0 -68
  1809. package/node_modules/hono/dist/middleware/method-override/index.js +0 -84
  1810. package/node_modules/hono/dist/middleware/powered-by/index.js +0 -10
  1811. package/node_modules/hono/dist/middleware/pretty-json/index.js +0 -15
  1812. package/node_modules/hono/dist/middleware/request-id/index.js +0 -5
  1813. package/node_modules/hono/dist/middleware/request-id/request-id.js +0 -21
  1814. package/node_modules/hono/dist/middleware/secure-headers/index.js +0 -6
  1815. package/node_modules/hono/dist/middleware/secure-headers/permissions-policy.js +0 -0
  1816. package/node_modules/hono/dist/middleware/secure-headers/secure-headers.js +0 -172
  1817. package/node_modules/hono/dist/middleware/serve-static/index.js +0 -77
  1818. package/node_modules/hono/dist/middleware/serve-static/path.js +0 -18
  1819. package/node_modules/hono/dist/middleware/timeout/index.js +0 -25
  1820. package/node_modules/hono/dist/middleware/timing/index.js +0 -9
  1821. package/node_modules/hono/dist/middleware/timing/timing.js +0 -104
  1822. package/node_modules/hono/dist/middleware/trailing-slash/index.js +0 -39
  1823. package/node_modules/hono/dist/preset/quick.js +0 -16
  1824. package/node_modules/hono/dist/preset/tiny.js +0 -12
  1825. package/node_modules/hono/dist/request/constants.js +0 -5
  1826. package/node_modules/hono/dist/request.js +0 -319
  1827. package/node_modules/hono/dist/router/linear-router/index.js +0 -5
  1828. package/node_modules/hono/dist/router/linear-router/router.js +0 -118
  1829. package/node_modules/hono/dist/router/pattern-router/index.js +0 -5
  1830. package/node_modules/hono/dist/router/pattern-router/router.js +0 -48
  1831. package/node_modules/hono/dist/router/reg-exp-router/index.js +0 -9
  1832. package/node_modules/hono/dist/router/reg-exp-router/matcher.js +0 -25
  1833. package/node_modules/hono/dist/router/reg-exp-router/node.js +0 -110
  1834. package/node_modules/hono/dist/router/reg-exp-router/prepared-router.js +0 -142
  1835. package/node_modules/hono/dist/router/reg-exp-router/router.js +0 -169
  1836. package/node_modules/hono/dist/router/reg-exp-router/trie.js +0 -67
  1837. package/node_modules/hono/dist/router/smart-router/index.js +0 -5
  1838. package/node_modules/hono/dist/router/smart-router/router.js +0 -58
  1839. package/node_modules/hono/dist/router/trie-router/index.js +0 -5
  1840. package/node_modules/hono/dist/router/trie-router/node.js +0 -188
  1841. package/node_modules/hono/dist/router/trie-router/router.js +0 -26
  1842. package/node_modules/hono/dist/router.js +0 -14
  1843. package/node_modules/hono/dist/types/adapter/aws-lambda/conninfo.d.ts +0 -27
  1844. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +0 -184
  1845. package/node_modules/hono/dist/types/adapter/aws-lambda/index.d.ts +0 -8
  1846. package/node_modules/hono/dist/types/adapter/aws-lambda/types.d.ts +0 -153
  1847. package/node_modules/hono/dist/types/adapter/bun/conninfo.d.ts +0 -7
  1848. package/node_modules/hono/dist/types/adapter/bun/index.d.ts +0 -10
  1849. package/node_modules/hono/dist/types/adapter/bun/serve-static.d.ts +0 -3
  1850. package/node_modules/hono/dist/types/adapter/bun/server.d.ts +0 -12
  1851. package/node_modules/hono/dist/types/adapter/bun/ssg.d.ts +0 -13
  1852. package/node_modules/hono/dist/types/adapter/bun/websocket.d.ts +0 -39
  1853. package/node_modules/hono/dist/types/adapter/cloudflare-pages/conninfo.d.ts +0 -21
  1854. package/node_modules/hono/dist/types/adapter/cloudflare-pages/handler.d.ts +0 -33
  1855. package/node_modules/hono/dist/types/adapter/cloudflare-pages/index.d.ts +0 -7
  1856. package/node_modules/hono/dist/types/adapter/cloudflare-workers/conninfo.d.ts +0 -2
  1857. package/node_modules/hono/dist/types/adapter/cloudflare-workers/index.d.ts +0 -7
  1858. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static-module.d.ts +0 -4
  1859. package/node_modules/hono/dist/types/adapter/cloudflare-workers/serve-static.d.ts +0 -16
  1860. package/node_modules/hono/dist/types/adapter/cloudflare-workers/utils.d.ts +0 -5
  1861. package/node_modules/hono/dist/types/adapter/cloudflare-workers/websocket.d.ts +0 -2
  1862. package/node_modules/hono/dist/types/adapter/deno/conninfo.d.ts +0 -7
  1863. package/node_modules/hono/dist/types/adapter/deno/index.d.ts +0 -8
  1864. package/node_modules/hono/dist/types/adapter/deno/serve-static.d.ts +0 -3
  1865. package/node_modules/hono/dist/types/adapter/deno/ssg.d.ts +0 -13
  1866. package/node_modules/hono/dist/types/adapter/deno/websocket.d.ts +0 -2
  1867. package/node_modules/hono/dist/types/adapter/lambda-edge/conninfo.d.ts +0 -2
  1868. package/node_modules/hono/dist/types/adapter/lambda-edge/handler.d.ts +0 -87
  1869. package/node_modules/hono/dist/types/adapter/lambda-edge/index.d.ts +0 -7
  1870. package/node_modules/hono/dist/types/adapter/netlify/conninfo.d.ts +0 -21
  1871. package/node_modules/hono/dist/types/adapter/netlify/handler.d.ts +0 -2
  1872. package/node_modules/hono/dist/types/adapter/netlify/index.d.ts +0 -5
  1873. package/node_modules/hono/dist/types/adapter/netlify/mod.d.ts +0 -2
  1874. package/node_modules/hono/dist/types/adapter/service-worker/handler.d.ts +0 -16
  1875. package/node_modules/hono/dist/types/adapter/service-worker/index.d.ts +0 -28
  1876. package/node_modules/hono/dist/types/adapter/service-worker/types.d.ts +0 -12
  1877. package/node_modules/hono/dist/types/adapter/vercel/conninfo.d.ts +0 -2
  1878. package/node_modules/hono/dist/types/adapter/vercel/handler.d.ts +0 -2
  1879. package/node_modules/hono/dist/types/adapter/vercel/index.d.ts +0 -6
  1880. package/node_modules/hono/dist/types/client/client.d.ts +0 -4
  1881. package/node_modules/hono/dist/types/client/fetch-result-please.d.ts +0 -35
  1882. package/node_modules/hono/dist/types/client/index.d.ts +0 -7
  1883. package/node_modules/hono/dist/types/client/types.d.ts +0 -229
  1884. package/node_modules/hono/dist/types/client/utils.d.ts +0 -18
  1885. package/node_modules/hono/dist/types/compose.d.ts +0 -14
  1886. package/node_modules/hono/dist/types/context.d.ts +0 -455
  1887. package/node_modules/hono/dist/types/helper/accepts/accepts.d.ts +0 -30
  1888. package/node_modules/hono/dist/types/helper/accepts/index.d.ts +0 -5
  1889. package/node_modules/hono/dist/types/helper/adapter/index.d.ts +0 -12
  1890. package/node_modules/hono/dist/types/helper/conninfo/index.d.ts +0 -5
  1891. package/node_modules/hono/dist/types/helper/conninfo/types.d.ts +0 -36
  1892. package/node_modules/hono/dist/types/helper/cookie/index.d.ts +0 -24
  1893. package/node_modules/hono/dist/types/helper/css/common.d.ts +0 -59
  1894. package/node_modules/hono/dist/types/helper/css/index.d.ts +0 -80
  1895. package/node_modules/hono/dist/types/helper/dev/index.d.ts +0 -20
  1896. package/node_modules/hono/dist/types/helper/factory/index.d.ts +0 -82
  1897. package/node_modules/hono/dist/types/helper/html/index.d.ts +0 -8
  1898. package/node_modules/hono/dist/types/helper/proxy/index.d.ts +0 -72
  1899. package/node_modules/hono/dist/types/helper/route/index.d.ts +0 -75
  1900. package/node_modules/hono/dist/types/helper/ssg/index.d.ts +0 -7
  1901. package/node_modules/hono/dist/types/helper/ssg/middleware.d.ts +0 -44
  1902. package/node_modules/hono/dist/types/helper/ssg/plugins.d.ts +0 -27
  1903. package/node_modules/hono/dist/types/helper/ssg/ssg.d.ts +0 -91
  1904. package/node_modules/hono/dist/types/helper/ssg/utils.d.ts +0 -16
  1905. package/node_modules/hono/dist/types/helper/streaming/index.d.ts +0 -8
  1906. package/node_modules/hono/dist/types/helper/streaming/sse.d.ts +0 -13
  1907. package/node_modules/hono/dist/types/helper/streaming/stream.d.ts +0 -3
  1908. package/node_modules/hono/dist/types/helper/streaming/text.d.ts +0 -3
  1909. package/node_modules/hono/dist/types/helper/streaming/utils.d.ts +0 -1
  1910. package/node_modules/hono/dist/types/helper/testing/index.d.ts +0 -12
  1911. package/node_modules/hono/dist/types/helper/websocket/index.d.ts +0 -69
  1912. package/node_modules/hono/dist/types/hono-base.d.ts +0 -221
  1913. package/node_modules/hono/dist/types/hono.d.ts +0 -19
  1914. package/node_modules/hono/dist/types/http-exception.d.ts +0 -59
  1915. package/node_modules/hono/dist/types/index.d.ts +0 -37
  1916. package/node_modules/hono/dist/types/jsx/base.d.ts +0 -58
  1917. package/node_modules/hono/dist/types/jsx/children.d.ts +0 -9
  1918. package/node_modules/hono/dist/types/jsx/components.d.ts +0 -15
  1919. package/node_modules/hono/dist/types/jsx/constants.d.ts +0 -6
  1920. package/node_modules/hono/dist/types/jsx/context.d.ts +0 -51
  1921. package/node_modules/hono/dist/types/jsx/dom/client.d.ts +0 -31
  1922. package/node_modules/hono/dist/types/jsx/dom/components.d.ts +0 -10
  1923. package/node_modules/hono/dist/types/jsx/dom/context.d.ts +0 -3
  1924. package/node_modules/hono/dist/types/jsx/dom/css.d.ts +0 -83
  1925. package/node_modules/hono/dist/types/jsx/dom/hooks/index.d.ts +0 -39
  1926. package/node_modules/hono/dist/types/jsx/dom/index.d.ts +0 -88
  1927. package/node_modules/hono/dist/types/jsx/dom/intrinsic-element/components.d.ts +0 -16
  1928. package/node_modules/hono/dist/types/jsx/dom/jsx-dev-runtime.d.ts +0 -8
  1929. package/node_modules/hono/dist/types/jsx/dom/jsx-runtime.d.ts +0 -7
  1930. package/node_modules/hono/dist/types/jsx/dom/render.d.ts +0 -73
  1931. package/node_modules/hono/dist/types/jsx/dom/server.d.ts +0 -106
  1932. package/node_modules/hono/dist/types/jsx/dom/utils.d.ts +0 -1
  1933. package/node_modules/hono/dist/types/jsx/hooks/index.d.ts +0 -47
  1934. package/node_modules/hono/dist/types/jsx/index.d.ts +0 -75
  1935. package/node_modules/hono/dist/types/jsx/intrinsic-element/common.d.ts +0 -6
  1936. package/node_modules/hono/dist/types/jsx/intrinsic-element/components.d.ts +0 -13
  1937. package/node_modules/hono/dist/types/jsx/intrinsic-elements.d.ts +0 -722
  1938. package/node_modules/hono/dist/types/jsx/jsx-dev-runtime.d.ts +0 -8
  1939. package/node_modules/hono/dist/types/jsx/jsx-runtime.d.ts +0 -12
  1940. package/node_modules/hono/dist/types/jsx/streaming.d.ts +0 -36
  1941. package/node_modules/hono/dist/types/jsx/types.d.ts +0 -35
  1942. package/node_modules/hono/dist/types/jsx/utils.d.ts +0 -4
  1943. package/node_modules/hono/dist/types/middleware/basic-auth/index.d.ts +0 -75
  1944. package/node_modules/hono/dist/types/middleware/bearer-auth/index.d.ts +0 -92
  1945. package/node_modules/hono/dist/types/middleware/body-limit/index.d.ts +0 -45
  1946. package/node_modules/hono/dist/types/middleware/cache/index.d.ts +0 -45
  1947. package/node_modules/hono/dist/types/middleware/combine/index.d.ts +0 -85
  1948. package/node_modules/hono/dist/types/middleware/compress/index.d.ts +0 -40
  1949. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +0 -40
  1950. package/node_modules/hono/dist/types/middleware/cors/index.d.ts +0 -55
  1951. package/node_modules/hono/dist/types/middleware/csrf/index.d.ts +0 -78
  1952. package/node_modules/hono/dist/types/middleware/etag/digest.d.ts +0 -1
  1953. package/node_modules/hono/dist/types/middleware/etag/index.d.ts +0 -42
  1954. package/node_modules/hono/dist/types/middleware/ip-restriction/index.d.ts +0 -67
  1955. package/node_modules/hono/dist/types/middleware/jsx-renderer/index.d.ts +0 -77
  1956. package/node_modules/hono/dist/types/middleware/jwk/index.d.ts +0 -1
  1957. package/node_modules/hono/dist/types/middleware/jwk/jwk.d.ts +0 -56
  1958. package/node_modules/hono/dist/types/middleware/jwt/index.d.ts +0 -8
  1959. package/node_modules/hono/dist/types/middleware/jwt/jwt.d.ts +0 -69
  1960. package/node_modules/hono/dist/types/middleware/language/index.d.ts +0 -7
  1961. package/node_modules/hono/dist/types/middleware/language/language.d.ts +0 -120
  1962. package/node_modules/hono/dist/types/middleware/logger/index.d.ts +0 -24
  1963. package/node_modules/hono/dist/types/middleware/method-not-allowed/index.d.ts +0 -49
  1964. package/node_modules/hono/dist/types/middleware/method-override/index.d.ts +0 -48
  1965. package/node_modules/hono/dist/types/middleware/powered-by/index.d.ts +0 -29
  1966. package/node_modules/hono/dist/types/middleware/pretty-json/index.d.ts +0 -42
  1967. package/node_modules/hono/dist/types/middleware/request-id/index.d.ts +0 -7
  1968. package/node_modules/hono/dist/types/middleware/request-id/request-id.d.ts +0 -37
  1969. package/node_modules/hono/dist/types/middleware/secure-headers/index.d.ts +0 -8
  1970. package/node_modules/hono/dist/types/middleware/secure-headers/permissions-policy.d.ts +0 -14
  1971. package/node_modules/hono/dist/types/middleware/secure-headers/secure-headers.d.ts +0 -109
  1972. package/node_modules/hono/dist/types/middleware/serve-static/index.d.ts +0 -31
  1973. package/node_modules/hono/dist/types/middleware/serve-static/path.d.ts +0 -5
  1974. package/node_modules/hono/dist/types/middleware/timeout/index.d.ts +0 -31
  1975. package/node_modules/hono/dist/types/middleware/timing/index.d.ts +0 -7
  1976. package/node_modules/hono/dist/types/middleware/timing/timing.d.ts +0 -129
  1977. package/node_modules/hono/dist/types/middleware/trailing-slash/index.d.ts +0 -94
  1978. package/node_modules/hono/dist/types/package.json +0 -3
  1979. package/node_modules/hono/dist/types/preset/quick.d.ts +0 -10
  1980. package/node_modules/hono/dist/types/preset/tiny.d.ts +0 -10
  1981. package/node_modules/hono/dist/types/request/constants.d.ts +0 -1
  1982. package/node_modules/hono/dist/types/request.d.ts +0 -324
  1983. package/node_modules/hono/dist/types/router/linear-router/index.d.ts +0 -5
  1984. package/node_modules/hono/dist/types/router/linear-router/router.d.ts +0 -7
  1985. package/node_modules/hono/dist/types/router/pattern-router/index.d.ts +0 -5
  1986. package/node_modules/hono/dist/types/router/pattern-router/router.d.ts +0 -7
  1987. package/node_modules/hono/dist/types/router/reg-exp-router/index.d.ts +0 -6
  1988. package/node_modules/hono/dist/types/router/reg-exp-router/matcher.d.ts +0 -7
  1989. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +0 -10
  1990. package/node_modules/hono/dist/types/router/reg-exp-router/prepared-router.d.ts +0 -17
  1991. package/node_modules/hono/dist/types/router/reg-exp-router/router.d.ts +0 -11
  1992. package/node_modules/hono/dist/types/router/reg-exp-router/trie.d.ts +0 -8
  1993. package/node_modules/hono/dist/types/router/smart-router/index.d.ts +0 -5
  1994. package/node_modules/hono/dist/types/router/smart-router/router.d.ts +0 -11
  1995. package/node_modules/hono/dist/types/router/trie-router/index.d.ts +0 -5
  1996. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +0 -7
  1997. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -8
  1998. package/node_modules/hono/dist/types/router.d.ts +0 -97
  1999. package/node_modules/hono/dist/types/types.d.ts +0 -573
  2000. package/node_modules/hono/dist/types/utils/accept.d.ts +0 -6
  2001. package/node_modules/hono/dist/types/utils/basic-auth.d.ts +0 -5
  2002. package/node_modules/hono/dist/types/utils/body.d.ts +0 -79
  2003. package/node_modules/hono/dist/types/utils/buffer.d.ts +0 -17
  2004. package/node_modules/hono/dist/types/utils/color.d.ts +0 -21
  2005. package/node_modules/hono/dist/types/utils/compress.d.ts +0 -8
  2006. package/node_modules/hono/dist/types/utils/concurrent.d.ts +0 -11
  2007. package/node_modules/hono/dist/types/utils/constants.d.ts +0 -4
  2008. package/node_modules/hono/dist/types/utils/cookie.d.ts +0 -40
  2009. package/node_modules/hono/dist/types/utils/crypto.d.ts +0 -15
  2010. package/node_modules/hono/dist/types/utils/encode.d.ts +0 -8
  2011. package/node_modules/hono/dist/types/utils/filepath.d.ts +0 -12
  2012. package/node_modules/hono/dist/types/utils/handler.d.ts +0 -6
  2013. package/node_modules/hono/dist/types/utils/headers.d.ts +0 -8
  2014. package/node_modules/hono/dist/types/utils/html.d.ts +0 -44
  2015. package/node_modules/hono/dist/types/utils/http-status.d.ts +0 -32
  2016. package/node_modules/hono/dist/types/utils/ipaddr.d.ts +0 -56
  2017. package/node_modules/hono/dist/types/utils/jwt/index.d.ts +0 -18
  2018. package/node_modules/hono/dist/types/utils/jwt/jwa.d.ts +0 -23
  2019. package/node_modules/hono/dist/types/utils/jwt/jws.d.ts +0 -12
  2020. package/node_modules/hono/dist/types/utils/jwt/jwt.d.ts +0 -43
  2021. package/node_modules/hono/dist/types/utils/jwt/types.d.ts +0 -86
  2022. package/node_modules/hono/dist/types/utils/jwt/utf8.d.ts +0 -6
  2023. package/node_modules/hono/dist/types/utils/mime.d.ts +0 -70
  2024. package/node_modules/hono/dist/types/utils/stream.d.ts +0 -31
  2025. package/node_modules/hono/dist/types/utils/types.d.ts +0 -74
  2026. package/node_modules/hono/dist/types/utils/url.d.ts +0 -40
  2027. package/node_modules/hono/dist/types/validator/index.d.ts +0 -7
  2028. package/node_modules/hono/dist/types/validator/utils.d.ts +0 -29
  2029. package/node_modules/hono/dist/types/validator/validator.d.ts +0 -16
  2030. package/node_modules/hono/dist/types.js +0 -6
  2031. package/node_modules/hono/dist/utils/accept.js +0 -223
  2032. package/node_modules/hono/dist/utils/basic-auth.js +0 -23
  2033. package/node_modules/hono/dist/utils/body.js +0 -89
  2034. package/node_modules/hono/dist/utils/buffer.js +0 -78
  2035. package/node_modules/hono/dist/utils/color.js +0 -25
  2036. package/node_modules/hono/dist/utils/compress.js +0 -5
  2037. package/node_modules/hono/dist/utils/concurrent.js +0 -39
  2038. package/node_modules/hono/dist/utils/constants.js +0 -5
  2039. package/node_modules/hono/dist/utils/cookie.js +0 -174
  2040. package/node_modules/hono/dist/utils/crypto.js +0 -44
  2041. package/node_modules/hono/dist/utils/encode.js +0 -29
  2042. package/node_modules/hono/dist/utils/filepath.js +0 -35
  2043. package/node_modules/hono/dist/utils/handler.js +0 -13
  2044. package/node_modules/hono/dist/utils/headers.js +0 -0
  2045. package/node_modules/hono/dist/utils/html.js +0 -123
  2046. package/node_modules/hono/dist/utils/http-status.js +0 -0
  2047. package/node_modules/hono/dist/utils/ipaddr.js +0 -288
  2048. package/node_modules/hono/dist/utils/jwt/index.js +0 -6
  2049. package/node_modules/hono/dist/utils/jwt/jwa.js +0 -20
  2050. package/node_modules/hono/dist/utils/jwt/jws.js +0 -192
  2051. package/node_modules/hono/dist/utils/jwt/jwt.js +0 -207
  2052. package/node_modules/hono/dist/utils/jwt/types.js +0 -124
  2053. package/node_modules/hono/dist/utils/jwt/utf8.js +0 -7
  2054. package/node_modules/hono/dist/utils/mime.js +0 -82
  2055. package/node_modules/hono/dist/utils/stream.js +0 -81
  2056. package/node_modules/hono/dist/utils/types.js +0 -0
  2057. package/node_modules/hono/dist/utils/url.js +0 -221
  2058. package/node_modules/hono/dist/validator/index.js +0 -5
  2059. package/node_modules/hono/dist/validator/utils.js +0 -0
  2060. package/node_modules/hono/dist/validator/validator.js +0 -86
  2061. package/node_modules/hono/package.json +0 -706
  2062. package/node_modules/zod/LICENSE +0 -21
  2063. package/node_modules/zod/README.md +0 -191
  2064. package/node_modules/zod/index.cjs +0 -33
  2065. package/node_modules/zod/index.d.cts +0 -4
  2066. package/node_modules/zod/index.d.ts +0 -4
  2067. package/node_modules/zod/index.js +0 -4
  2068. package/node_modules/zod/locales/index.cjs +0 -17
  2069. package/node_modules/zod/locales/index.d.cts +0 -1
  2070. package/node_modules/zod/locales/index.d.ts +0 -1
  2071. package/node_modules/zod/locales/index.js +0 -1
  2072. package/node_modules/zod/locales/package.json +0 -7
  2073. package/node_modules/zod/mini/index.cjs +0 -32
  2074. package/node_modules/zod/mini/index.d.cts +0 -3
  2075. package/node_modules/zod/mini/index.d.ts +0 -3
  2076. package/node_modules/zod/mini/index.js +0 -3
  2077. package/node_modules/zod/mini/package.json +0 -7
  2078. package/node_modules/zod/package.json +0 -135
  2079. package/node_modules/zod/src/index.ts +0 -4
  2080. package/node_modules/zod/src/locales/index.ts +0 -1
  2081. package/node_modules/zod/src/mini/index.ts +0 -3
  2082. package/node_modules/zod/src/v3/ZodError.ts +0 -330
  2083. package/node_modules/zod/src/v3/benchmarks/datetime.ts +0 -58
  2084. package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +0 -80
  2085. package/node_modules/zod/src/v3/benchmarks/index.ts +0 -59
  2086. package/node_modules/zod/src/v3/benchmarks/ipv4.ts +0 -57
  2087. package/node_modules/zod/src/v3/benchmarks/object.ts +0 -69
  2088. package/node_modules/zod/src/v3/benchmarks/primitives.ts +0 -162
  2089. package/node_modules/zod/src/v3/benchmarks/realworld.ts +0 -63
  2090. package/node_modules/zod/src/v3/benchmarks/string.ts +0 -55
  2091. package/node_modules/zod/src/v3/benchmarks/union.ts +0 -80
  2092. package/node_modules/zod/src/v3/errors.ts +0 -13
  2093. package/node_modules/zod/src/v3/external.ts +0 -6
  2094. package/node_modules/zod/src/v3/helpers/enumUtil.ts +0 -17
  2095. package/node_modules/zod/src/v3/helpers/errorUtil.ts +0 -8
  2096. package/node_modules/zod/src/v3/helpers/parseUtil.ts +0 -176
  2097. package/node_modules/zod/src/v3/helpers/partialUtil.ts +0 -34
  2098. package/node_modules/zod/src/v3/helpers/typeAliases.ts +0 -2
  2099. package/node_modules/zod/src/v3/helpers/util.ts +0 -224
  2100. package/node_modules/zod/src/v3/index.ts +0 -4
  2101. package/node_modules/zod/src/v3/locales/en.ts +0 -124
  2102. package/node_modules/zod/src/v3/standard-schema.ts +0 -113
  2103. package/node_modules/zod/src/v3/tests/Mocker.ts +0 -54
  2104. package/node_modules/zod/src/v3/tests/all-errors.test.ts +0 -157
  2105. package/node_modules/zod/src/v3/tests/anyunknown.test.ts +0 -28
  2106. package/node_modules/zod/src/v3/tests/array.test.ts +0 -71
  2107. package/node_modules/zod/src/v3/tests/async-parsing.test.ts +0 -388
  2108. package/node_modules/zod/src/v3/tests/async-refinements.test.ts +0 -46
  2109. package/node_modules/zod/src/v3/tests/base.test.ts +0 -29
  2110. package/node_modules/zod/src/v3/tests/bigint.test.ts +0 -55
  2111. package/node_modules/zod/src/v3/tests/branded.test.ts +0 -53
  2112. package/node_modules/zod/src/v3/tests/catch.test.ts +0 -220
  2113. package/node_modules/zod/src/v3/tests/coerce.test.ts +0 -133
  2114. package/node_modules/zod/src/v3/tests/complex.test.ts +0 -70
  2115. package/node_modules/zod/src/v3/tests/custom.test.ts +0 -31
  2116. package/node_modules/zod/src/v3/tests/date.test.ts +0 -32
  2117. package/node_modules/zod/src/v3/tests/deepmasking.test.ts +0 -186
  2118. package/node_modules/zod/src/v3/tests/default.test.ts +0 -112
  2119. package/node_modules/zod/src/v3/tests/description.test.ts +0 -33
  2120. package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +0 -315
  2121. package/node_modules/zod/src/v3/tests/enum.test.ts +0 -80
  2122. package/node_modules/zod/src/v3/tests/error.test.ts +0 -551
  2123. package/node_modules/zod/src/v3/tests/firstparty.test.ts +0 -87
  2124. package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +0 -21
  2125. package/node_modules/zod/src/v3/tests/function.test.ts +0 -261
  2126. package/node_modules/zod/src/v3/tests/generics.test.ts +0 -48
  2127. package/node_modules/zod/src/v3/tests/instanceof.test.ts +0 -37
  2128. package/node_modules/zod/src/v3/tests/intersection.test.ts +0 -110
  2129. package/node_modules/zod/src/v3/tests/language-server.source.ts +0 -76
  2130. package/node_modules/zod/src/v3/tests/language-server.test.ts +0 -207
  2131. package/node_modules/zod/src/v3/tests/literal.test.ts +0 -36
  2132. package/node_modules/zod/src/v3/tests/map.test.ts +0 -110
  2133. package/node_modules/zod/src/v3/tests/masking.test.ts +0 -4
  2134. package/node_modules/zod/src/v3/tests/mocker.test.ts +0 -19
  2135. package/node_modules/zod/src/v3/tests/nan.test.ts +0 -24
  2136. package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +0 -87
  2137. package/node_modules/zod/src/v3/tests/nullable.test.ts +0 -42
  2138. package/node_modules/zod/src/v3/tests/number.test.ts +0 -176
  2139. package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +0 -29
  2140. package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +0 -29
  2141. package/node_modules/zod/src/v3/tests/object.test.ts +0 -434
  2142. package/node_modules/zod/src/v3/tests/optional.test.ts +0 -42
  2143. package/node_modules/zod/src/v3/tests/parseUtil.test.ts +0 -23
  2144. package/node_modules/zod/src/v3/tests/parser.test.ts +0 -41
  2145. package/node_modules/zod/src/v3/tests/partials.test.ts +0 -243
  2146. package/node_modules/zod/src/v3/tests/pickomit.test.ts +0 -111
  2147. package/node_modules/zod/src/v3/tests/pipeline.test.ts +0 -29
  2148. package/node_modules/zod/src/v3/tests/preprocess.test.ts +0 -186
  2149. package/node_modules/zod/src/v3/tests/primitive.test.ts +0 -440
  2150. package/node_modules/zod/src/v3/tests/promise.test.ts +0 -90
  2151. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -194
  2152. package/node_modules/zod/src/v3/tests/record.test.ts +0 -171
  2153. package/node_modules/zod/src/v3/tests/recursive.test.ts +0 -197
  2154. package/node_modules/zod/src/v3/tests/refine.test.ts +0 -313
  2155. package/node_modules/zod/src/v3/tests/safeparse.test.ts +0 -27
  2156. package/node_modules/zod/src/v3/tests/set.test.ts +0 -142
  2157. package/node_modules/zod/src/v3/tests/standard-schema.test.ts +0 -83
  2158. package/node_modules/zod/src/v3/tests/string.test.ts +0 -916
  2159. package/node_modules/zod/src/v3/tests/transformer.test.ts +0 -233
  2160. package/node_modules/zod/src/v3/tests/tuple.test.ts +0 -90
  2161. package/node_modules/zod/src/v3/tests/unions.test.ts +0 -57
  2162. package/node_modules/zod/src/v3/tests/validations.test.ts +0 -133
  2163. package/node_modules/zod/src/v3/tests/void.test.ts +0 -15
  2164. package/node_modules/zod/src/v3/types.ts +0 -5138
  2165. package/node_modules/zod/src/v4/classic/checks.ts +0 -32
  2166. package/node_modules/zod/src/v4/classic/coerce.ts +0 -27
  2167. package/node_modules/zod/src/v4/classic/compat.ts +0 -70
  2168. package/node_modules/zod/src/v4/classic/errors.ts +0 -82
  2169. package/node_modules/zod/src/v4/classic/external.ts +0 -52
  2170. package/node_modules/zod/src/v4/classic/from-json-schema.ts +0 -659
  2171. package/node_modules/zod/src/v4/classic/index.ts +0 -5
  2172. package/node_modules/zod/src/v4/classic/iso.ts +0 -90
  2173. package/node_modules/zod/src/v4/classic/parse.ts +0 -82
  2174. package/node_modules/zod/src/v4/classic/schemas.ts +0 -2672
  2175. package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +0 -26
  2176. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +0 -59
  2177. package/node_modules/zod/src/v4/classic/tests/array.test.ts +0 -264
  2178. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +0 -216
  2179. package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +0 -381
  2180. package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +0 -68
  2181. package/node_modules/zod/src/v4/classic/tests/base.test.ts +0 -7
  2182. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +0 -54
  2183. package/node_modules/zod/src/v4/classic/tests/brand.test.ts +0 -106
  2184. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +0 -326
  2185. package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +0 -20
  2186. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +0 -573
  2187. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +0 -703
  2188. package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +0 -160
  2189. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +0 -374
  2190. package/node_modules/zod/src/v4/classic/tests/custom.test.ts +0 -40
  2191. package/node_modules/zod/src/v4/classic/tests/date.test.ts +0 -62
  2192. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +0 -302
  2193. package/node_modules/zod/src/v4/classic/tests/default.test.ts +0 -409
  2194. package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +0 -27
  2195. package/node_modules/zod/src/v4/classic/tests/description.test.ts +0 -32
  2196. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +0 -197
  2197. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +0 -694
  2198. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +0 -285
  2199. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +0 -807
  2200. package/node_modules/zod/src/v4/classic/tests/error.test.ts +0 -711
  2201. package/node_modules/zod/src/v4/classic/tests/file.test.ts +0 -96
  2202. package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +0 -179
  2203. package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +0 -26
  2204. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +0 -895
  2205. package/node_modules/zod/src/v4/classic/tests/function.test.ts +0 -360
  2206. package/node_modules/zod/src/v4/classic/tests/generics.test.ts +0 -72
  2207. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +0 -39
  2208. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +0 -68
  2209. package/node_modules/zod/src/v4/classic/tests/index.test.ts +0 -939
  2210. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +0 -60
  2211. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +0 -198
  2212. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +0 -46
  2213. package/node_modules/zod/src/v4/classic/tests/json.test.ts +0 -109
  2214. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +0 -227
  2215. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +0 -117
  2216. package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +0 -29
  2217. package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +0 -24
  2218. package/node_modules/zod/src/v4/classic/tests/map.test.ts +0 -330
  2219. package/node_modules/zod/src/v4/classic/tests/nan.test.ts +0 -21
  2220. package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +0 -168
  2221. package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +0 -101
  2222. package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +0 -22
  2223. package/node_modules/zod/src/v4/classic/tests/number.test.ts +0 -325
  2224. package/node_modules/zod/src/v4/classic/tests/object.test.ts +0 -717
  2225. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +0 -333
  2226. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +0 -450
  2227. package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +0 -211
  2228. package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +0 -101
  2229. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +0 -74
  2230. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +0 -26
  2231. package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +0 -351
  2232. package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +0 -175
  2233. package/node_modules/zod/src/v4/classic/tests/promise.test.ts +0 -81
  2234. package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +0 -23
  2235. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -252
  2236. package/node_modules/zod/src/v4/classic/tests/record.test.ts +0 -717
  2237. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +0 -631
  2238. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +0 -633
  2239. package/node_modules/zod/src/v4/classic/tests/registries.test.ts +0 -243
  2240. package/node_modules/zod/src/v4/classic/tests/set.test.ts +0 -181
  2241. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +0 -134
  2242. package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +0 -125
  2243. package/node_modules/zod/src/v4/classic/tests/string.test.ts +0 -1224
  2244. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +0 -106
  2245. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +0 -771
  2246. package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +0 -438
  2247. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +0 -3125
  2248. package/node_modules/zod/src/v4/classic/tests/transform.test.ts +0 -378
  2249. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +0 -496
  2250. package/node_modules/zod/src/v4/classic/tests/union.test.ts +0 -273
  2251. package/node_modules/zod/src/v4/classic/tests/url.test.ts +0 -13
  2252. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +0 -283
  2253. package/node_modules/zod/src/v4/classic/tests/void.test.ts +0 -12
  2254. package/node_modules/zod/src/v4/core/api.ts +0 -1823
  2255. package/node_modules/zod/src/v4/core/checks.ts +0 -1293
  2256. package/node_modules/zod/src/v4/core/config.ts +0 -15
  2257. package/node_modules/zod/src/v4/core/core.ts +0 -153
  2258. package/node_modules/zod/src/v4/core/doc.ts +0 -44
  2259. package/node_modules/zod/src/v4/core/errors.ts +0 -455
  2260. package/node_modules/zod/src/v4/core/index.ts +0 -16
  2261. package/node_modules/zod/src/v4/core/json-schema-generator.ts +0 -126
  2262. package/node_modules/zod/src/v4/core/json-schema-processors.ts +0 -666
  2263. package/node_modules/zod/src/v4/core/json-schema.ts +0 -147
  2264. package/node_modules/zod/src/v4/core/parse.ts +0 -195
  2265. package/node_modules/zod/src/v4/core/regexes.ts +0 -190
  2266. package/node_modules/zod/src/v4/core/registries.ts +0 -105
  2267. package/node_modules/zod/src/v4/core/schemas.ts +0 -4730
  2268. package/node_modules/zod/src/v4/core/standard-schema.ts +0 -159
  2269. package/node_modules/zod/src/v4/core/tests/extend.test.ts +0 -59
  2270. package/node_modules/zod/src/v4/core/tests/index.test.ts +0 -46
  2271. package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +0 -124
  2272. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +0 -215
  2273. package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +0 -22
  2274. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +0 -181
  2275. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +0 -72
  2276. package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +0 -379
  2277. package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +0 -163
  2278. package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +0 -46
  2279. package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +0 -128
  2280. package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +0 -69
  2281. package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +0 -105
  2282. package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +0 -125
  2283. package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +0 -45
  2284. package/node_modules/zod/src/v4/core/to-json-schema.ts +0 -622
  2285. package/node_modules/zod/src/v4/core/util.ts +0 -983
  2286. package/node_modules/zod/src/v4/core/versions.ts +0 -5
  2287. package/node_modules/zod/src/v4/core/zsf.ts +0 -323
  2288. package/node_modules/zod/src/v4/index.ts +0 -4
  2289. package/node_modules/zod/src/v4/locales/ar.ts +0 -115
  2290. package/node_modules/zod/src/v4/locales/az.ts +0 -111
  2291. package/node_modules/zod/src/v4/locales/be.ts +0 -176
  2292. package/node_modules/zod/src/v4/locales/bg.ts +0 -128
  2293. package/node_modules/zod/src/v4/locales/ca.ts +0 -116
  2294. package/node_modules/zod/src/v4/locales/cs.ts +0 -118
  2295. package/node_modules/zod/src/v4/locales/da.ts +0 -123
  2296. package/node_modules/zod/src/v4/locales/de.ts +0 -116
  2297. package/node_modules/zod/src/v4/locales/el.ts +0 -121
  2298. package/node_modules/zod/src/v4/locales/en.ts +0 -123
  2299. package/node_modules/zod/src/v4/locales/eo.ts +0 -118
  2300. package/node_modules/zod/src/v4/locales/es.ts +0 -141
  2301. package/node_modules/zod/src/v4/locales/fa.ts +0 -126
  2302. package/node_modules/zod/src/v4/locales/fi.ts +0 -121
  2303. package/node_modules/zod/src/v4/locales/fr-CA.ts +0 -116
  2304. package/node_modules/zod/src/v4/locales/fr.ts +0 -132
  2305. package/node_modules/zod/src/v4/locales/he.ts +0 -246
  2306. package/node_modules/zod/src/v4/locales/hr.ts +0 -131
  2307. package/node_modules/zod/src/v4/locales/hu.ts +0 -117
  2308. package/node_modules/zod/src/v4/locales/hy.ts +0 -164
  2309. package/node_modules/zod/src/v4/locales/id.ts +0 -115
  2310. package/node_modules/zod/src/v4/locales/index.ts +0 -52
  2311. package/node_modules/zod/src/v4/locales/is.ts +0 -119
  2312. package/node_modules/zod/src/v4/locales/it.ts +0 -116
  2313. package/node_modules/zod/src/v4/locales/ja.ts +0 -114
  2314. package/node_modules/zod/src/v4/locales/ka.ts +0 -123
  2315. package/node_modules/zod/src/v4/locales/kh.ts +0 -7
  2316. package/node_modules/zod/src/v4/locales/km.ts +0 -119
  2317. package/node_modules/zod/src/v4/locales/ko.ts +0 -121
  2318. package/node_modules/zod/src/v4/locales/lt.ts +0 -239
  2319. package/node_modules/zod/src/v4/locales/mk.ts +0 -118
  2320. package/node_modules/zod/src/v4/locales/ms.ts +0 -115
  2321. package/node_modules/zod/src/v4/locales/nl.ts +0 -121
  2322. package/node_modules/zod/src/v4/locales/no.ts +0 -116
  2323. package/node_modules/zod/src/v4/locales/ota.ts +0 -117
  2324. package/node_modules/zod/src/v4/locales/pl.ts +0 -118
  2325. package/node_modules/zod/src/v4/locales/ps.ts +0 -126
  2326. package/node_modules/zod/src/v4/locales/pt.ts +0 -116
  2327. package/node_modules/zod/src/v4/locales/ro.ts +0 -129
  2328. package/node_modules/zod/src/v4/locales/ru.ts +0 -176
  2329. package/node_modules/zod/src/v4/locales/sl.ts +0 -118
  2330. package/node_modules/zod/src/v4/locales/sv.ts +0 -119
  2331. package/node_modules/zod/src/v4/locales/ta.ts +0 -118
  2332. package/node_modules/zod/src/v4/locales/th.ts +0 -119
  2333. package/node_modules/zod/src/v4/locales/tr.ts +0 -111
  2334. package/node_modules/zod/src/v4/locales/ua.ts +0 -7
  2335. package/node_modules/zod/src/v4/locales/uk.ts +0 -117
  2336. package/node_modules/zod/src/v4/locales/ur.ts +0 -119
  2337. package/node_modules/zod/src/v4/locales/uz.ts +0 -117
  2338. package/node_modules/zod/src/v4/locales/vi.ts +0 -117
  2339. package/node_modules/zod/src/v4/locales/yo.ts +0 -124
  2340. package/node_modules/zod/src/v4/locales/zh-CN.ts +0 -116
  2341. package/node_modules/zod/src/v4/locales/zh-TW.ts +0 -115
  2342. package/node_modules/zod/src/v4/mini/checks.ts +0 -32
  2343. package/node_modules/zod/src/v4/mini/coerce.ts +0 -27
  2344. package/node_modules/zod/src/v4/mini/external.ts +0 -41
  2345. package/node_modules/zod/src/v4/mini/index.ts +0 -3
  2346. package/node_modules/zod/src/v4/mini/iso.ts +0 -66
  2347. package/node_modules/zod/src/v4/mini/parse.ts +0 -14
  2348. package/node_modules/zod/src/v4/mini/schemas.ts +0 -1947
  2349. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +0 -24
  2350. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +0 -129
  2351. package/node_modules/zod/src/v4/mini/tests/brand.test.ts +0 -94
  2352. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +0 -144
  2353. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +0 -548
  2354. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +0 -36
  2355. package/node_modules/zod/src/v4/mini/tests/error.test.ts +0 -22
  2356. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +0 -5
  2357. package/node_modules/zod/src/v4/mini/tests/index.test.ts +0 -993
  2358. package/node_modules/zod/src/v4/mini/tests/number.test.ts +0 -95
  2359. package/node_modules/zod/src/v4/mini/tests/object.test.ts +0 -227
  2360. package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +0 -43
  2361. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +0 -325
  2362. package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +0 -50
  2363. package/node_modules/zod/src/v4/mini/tests/string.test.ts +0 -352
  2364. package/node_modules/zod/src/v4-mini/index.ts +0 -3
  2365. package/node_modules/zod/v3/ZodError.cjs +0 -138
  2366. package/node_modules/zod/v3/ZodError.d.cts +0 -164
  2367. package/node_modules/zod/v3/ZodError.d.ts +0 -164
  2368. package/node_modules/zod/v3/ZodError.js +0 -133
  2369. package/node_modules/zod/v3/errors.cjs +0 -17
  2370. package/node_modules/zod/v3/errors.d.cts +0 -5
  2371. package/node_modules/zod/v3/errors.d.ts +0 -5
  2372. package/node_modules/zod/v3/errors.js +0 -9
  2373. package/node_modules/zod/v3/external.cjs +0 -22
  2374. package/node_modules/zod/v3/external.d.cts +0 -6
  2375. package/node_modules/zod/v3/external.d.ts +0 -6
  2376. package/node_modules/zod/v3/external.js +0 -6
  2377. package/node_modules/zod/v3/helpers/enumUtil.cjs +0 -2
  2378. package/node_modules/zod/v3/helpers/enumUtil.d.cts +0 -8
  2379. package/node_modules/zod/v3/helpers/enumUtil.d.ts +0 -8
  2380. package/node_modules/zod/v3/helpers/enumUtil.js +0 -1
  2381. package/node_modules/zod/v3/helpers/errorUtil.cjs +0 -9
  2382. package/node_modules/zod/v3/helpers/errorUtil.d.cts +0 -9
  2383. package/node_modules/zod/v3/helpers/errorUtil.d.ts +0 -9
  2384. package/node_modules/zod/v3/helpers/errorUtil.js +0 -6
  2385. package/node_modules/zod/v3/helpers/parseUtil.cjs +0 -124
  2386. package/node_modules/zod/v3/helpers/parseUtil.d.cts +0 -78
  2387. package/node_modules/zod/v3/helpers/parseUtil.d.ts +0 -78
  2388. package/node_modules/zod/v3/helpers/parseUtil.js +0 -109
  2389. package/node_modules/zod/v3/helpers/partialUtil.cjs +0 -2
  2390. package/node_modules/zod/v3/helpers/partialUtil.d.cts +0 -8
  2391. package/node_modules/zod/v3/helpers/partialUtil.d.ts +0 -8
  2392. package/node_modules/zod/v3/helpers/partialUtil.js +0 -1
  2393. package/node_modules/zod/v3/helpers/typeAliases.cjs +0 -2
  2394. package/node_modules/zod/v3/helpers/typeAliases.d.cts +0 -2
  2395. package/node_modules/zod/v3/helpers/typeAliases.d.ts +0 -2
  2396. package/node_modules/zod/v3/helpers/typeAliases.js +0 -1
  2397. package/node_modules/zod/v3/helpers/util.cjs +0 -137
  2398. package/node_modules/zod/v3/helpers/util.d.cts +0 -85
  2399. package/node_modules/zod/v3/helpers/util.d.ts +0 -85
  2400. package/node_modules/zod/v3/helpers/util.js +0 -133
  2401. package/node_modules/zod/v3/index.cjs +0 -33
  2402. package/node_modules/zod/v3/index.d.cts +0 -4
  2403. package/node_modules/zod/v3/index.d.ts +0 -4
  2404. package/node_modules/zod/v3/index.js +0 -4
  2405. package/node_modules/zod/v3/locales/en.cjs +0 -112
  2406. package/node_modules/zod/v3/locales/en.d.cts +0 -3
  2407. package/node_modules/zod/v3/locales/en.d.ts +0 -3
  2408. package/node_modules/zod/v3/locales/en.js +0 -109
  2409. package/node_modules/zod/v3/package.json +0 -7
  2410. package/node_modules/zod/v3/standard-schema.cjs +0 -2
  2411. package/node_modules/zod/v3/standard-schema.d.cts +0 -102
  2412. package/node_modules/zod/v3/standard-schema.d.ts +0 -102
  2413. package/node_modules/zod/v3/standard-schema.js +0 -1
  2414. package/node_modules/zod/v3/types.cjs +0 -3777
  2415. package/node_modules/zod/v3/types.d.cts +0 -1034
  2416. package/node_modules/zod/v3/types.d.ts +0 -1034
  2417. package/node_modules/zod/v3/types.js +0 -3695
  2418. package/node_modules/zod/v4/classic/checks.cjs +0 -33
  2419. package/node_modules/zod/v4/classic/checks.d.cts +0 -1
  2420. package/node_modules/zod/v4/classic/checks.d.ts +0 -1
  2421. package/node_modules/zod/v4/classic/checks.js +0 -1
  2422. package/node_modules/zod/v4/classic/coerce.cjs +0 -47
  2423. package/node_modules/zod/v4/classic/coerce.d.cts +0 -17
  2424. package/node_modules/zod/v4/classic/coerce.d.ts +0 -17
  2425. package/node_modules/zod/v4/classic/coerce.js +0 -17
  2426. package/node_modules/zod/v4/classic/compat.cjs +0 -61
  2427. package/node_modules/zod/v4/classic/compat.d.cts +0 -50
  2428. package/node_modules/zod/v4/classic/compat.d.ts +0 -50
  2429. package/node_modules/zod/v4/classic/compat.js +0 -31
  2430. package/node_modules/zod/v4/classic/errors.cjs +0 -74
  2431. package/node_modules/zod/v4/classic/errors.d.cts +0 -30
  2432. package/node_modules/zod/v4/classic/errors.d.ts +0 -30
  2433. package/node_modules/zod/v4/classic/errors.js +0 -48
  2434. package/node_modules/zod/v4/classic/external.cjs +0 -73
  2435. package/node_modules/zod/v4/classic/external.d.cts +0 -16
  2436. package/node_modules/zod/v4/classic/external.d.ts +0 -16
  2437. package/node_modules/zod/v4/classic/external.js +0 -20
  2438. package/node_modules/zod/v4/classic/from-json-schema.cjs +0 -625
  2439. package/node_modules/zod/v4/classic/from-json-schema.d.cts +0 -12
  2440. package/node_modules/zod/v4/classic/from-json-schema.d.ts +0 -12
  2441. package/node_modules/zod/v4/classic/from-json-schema.js +0 -599
  2442. package/node_modules/zod/v4/classic/index.cjs +0 -33
  2443. package/node_modules/zod/v4/classic/index.d.cts +0 -4
  2444. package/node_modules/zod/v4/classic/index.d.ts +0 -4
  2445. package/node_modules/zod/v4/classic/index.js +0 -4
  2446. package/node_modules/zod/v4/classic/iso.cjs +0 -60
  2447. package/node_modules/zod/v4/classic/iso.d.cts +0 -22
  2448. package/node_modules/zod/v4/classic/iso.d.ts +0 -22
  2449. package/node_modules/zod/v4/classic/iso.js +0 -30
  2450. package/node_modules/zod/v4/classic/package.json +0 -7
  2451. package/node_modules/zod/v4/classic/parse.cjs +0 -41
  2452. package/node_modules/zod/v4/classic/parse.d.cts +0 -31
  2453. package/node_modules/zod/v4/classic/parse.d.ts +0 -31
  2454. package/node_modules/zod/v4/classic/parse.js +0 -15
  2455. package/node_modules/zod/v4/classic/schemas.cjs +0 -1511
  2456. package/node_modules/zod/v4/classic/schemas.d.cts +0 -767
  2457. package/node_modules/zod/v4/classic/schemas.d.ts +0 -767
  2458. package/node_modules/zod/v4/classic/schemas.js +0 -1395
  2459. package/node_modules/zod/v4/core/api.cjs +0 -1227
  2460. package/node_modules/zod/v4/core/api.d.cts +0 -325
  2461. package/node_modules/zod/v4/core/api.d.ts +0 -325
  2462. package/node_modules/zod/v4/core/api.js +0 -1087
  2463. package/node_modules/zod/v4/core/checks.cjs +0 -601
  2464. package/node_modules/zod/v4/core/checks.d.cts +0 -278
  2465. package/node_modules/zod/v4/core/checks.d.ts +0 -278
  2466. package/node_modules/zod/v4/core/checks.js +0 -575
  2467. package/node_modules/zod/v4/core/core.cjs +0 -85
  2468. package/node_modules/zod/v4/core/core.d.cts +0 -70
  2469. package/node_modules/zod/v4/core/core.d.ts +0 -70
  2470. package/node_modules/zod/v4/core/core.js +0 -78
  2471. package/node_modules/zod/v4/core/doc.cjs +0 -39
  2472. package/node_modules/zod/v4/core/doc.d.cts +0 -14
  2473. package/node_modules/zod/v4/core/doc.d.ts +0 -14
  2474. package/node_modules/zod/v4/core/doc.js +0 -35
  2475. package/node_modules/zod/v4/core/errors.cjs +0 -216
  2476. package/node_modules/zod/v4/core/errors.d.cts +0 -221
  2477. package/node_modules/zod/v4/core/errors.d.ts +0 -221
  2478. package/node_modules/zod/v4/core/errors.js +0 -185
  2479. package/node_modules/zod/v4/core/index.cjs +0 -47
  2480. package/node_modules/zod/v4/core/index.d.cts +0 -16
  2481. package/node_modules/zod/v4/core/index.d.ts +0 -16
  2482. package/node_modules/zod/v4/core/index.js +0 -16
  2483. package/node_modules/zod/v4/core/json-schema-generator.cjs +0 -99
  2484. package/node_modules/zod/v4/core/json-schema-generator.d.cts +0 -65
  2485. package/node_modules/zod/v4/core/json-schema-generator.d.ts +0 -65
  2486. package/node_modules/zod/v4/core/json-schema-generator.js +0 -95
  2487. package/node_modules/zod/v4/core/json-schema-processors.cjs +0 -644
  2488. package/node_modules/zod/v4/core/json-schema-processors.d.cts +0 -49
  2489. package/node_modules/zod/v4/core/json-schema-processors.d.ts +0 -49
  2490. package/node_modules/zod/v4/core/json-schema-processors.js +0 -601
  2491. package/node_modules/zod/v4/core/json-schema.cjs +0 -2
  2492. package/node_modules/zod/v4/core/json-schema.d.cts +0 -88
  2493. package/node_modules/zod/v4/core/json-schema.d.ts +0 -88
  2494. package/node_modules/zod/v4/core/json-schema.js +0 -1
  2495. package/node_modules/zod/v4/core/package.json +0 -7
  2496. package/node_modules/zod/v4/core/parse.cjs +0 -131
  2497. package/node_modules/zod/v4/core/parse.d.cts +0 -49
  2498. package/node_modules/zod/v4/core/parse.d.ts +0 -49
  2499. package/node_modules/zod/v4/core/parse.js +0 -93
  2500. package/node_modules/zod/v4/core/regexes.cjs +0 -172
  2501. package/node_modules/zod/v4/core/regexes.d.cts +0 -85
  2502. package/node_modules/zod/v4/core/regexes.d.ts +0 -85
  2503. package/node_modules/zod/v4/core/regexes.js +0 -139
  2504. package/node_modules/zod/v4/core/registries.cjs +0 -56
  2505. package/node_modules/zod/v4/core/registries.d.cts +0 -35
  2506. package/node_modules/zod/v4/core/registries.d.ts +0 -35
  2507. package/node_modules/zod/v4/core/registries.js +0 -51
  2508. package/node_modules/zod/v4/core/schemas.cjs +0 -2270
  2509. package/node_modules/zod/v4/core/schemas.d.cts +0 -1184
  2510. package/node_modules/zod/v4/core/schemas.d.ts +0 -1184
  2511. package/node_modules/zod/v4/core/schemas.js +0 -2239
  2512. package/node_modules/zod/v4/core/standard-schema.cjs +0 -2
  2513. package/node_modules/zod/v4/core/standard-schema.d.cts +0 -126
  2514. package/node_modules/zod/v4/core/standard-schema.d.ts +0 -126
  2515. package/node_modules/zod/v4/core/standard-schema.js +0 -1
  2516. package/node_modules/zod/v4/core/to-json-schema.cjs +0 -457
  2517. package/node_modules/zod/v4/core/to-json-schema.d.cts +0 -114
  2518. package/node_modules/zod/v4/core/to-json-schema.d.ts +0 -114
  2519. package/node_modules/zod/v4/core/to-json-schema.js +0 -448
  2520. package/node_modules/zod/v4/core/util.cjs +0 -734
  2521. package/node_modules/zod/v4/core/util.d.cts +0 -200
  2522. package/node_modules/zod/v4/core/util.d.ts +0 -200
  2523. package/node_modules/zod/v4/core/util.js +0 -674
  2524. package/node_modules/zod/v4/core/versions.cjs +0 -8
  2525. package/node_modules/zod/v4/core/versions.d.cts +0 -5
  2526. package/node_modules/zod/v4/core/versions.d.ts +0 -5
  2527. package/node_modules/zod/v4/core/versions.js +0 -5
  2528. package/node_modules/zod/v4/index.cjs +0 -22
  2529. package/node_modules/zod/v4/index.d.cts +0 -3
  2530. package/node_modules/zod/v4/index.d.ts +0 -3
  2531. package/node_modules/zod/v4/index.js +0 -3
  2532. package/node_modules/zod/v4/locales/ar.cjs +0 -133
  2533. package/node_modules/zod/v4/locales/ar.d.cts +0 -5
  2534. package/node_modules/zod/v4/locales/ar.d.ts +0 -4
  2535. package/node_modules/zod/v4/locales/ar.js +0 -106
  2536. package/node_modules/zod/v4/locales/az.cjs +0 -132
  2537. package/node_modules/zod/v4/locales/az.d.cts +0 -5
  2538. package/node_modules/zod/v4/locales/az.d.ts +0 -4
  2539. package/node_modules/zod/v4/locales/az.js +0 -105
  2540. package/node_modules/zod/v4/locales/be.cjs +0 -183
  2541. package/node_modules/zod/v4/locales/be.d.cts +0 -5
  2542. package/node_modules/zod/v4/locales/be.d.ts +0 -4
  2543. package/node_modules/zod/v4/locales/be.js +0 -156
  2544. package/node_modules/zod/v4/locales/bg.cjs +0 -147
  2545. package/node_modules/zod/v4/locales/bg.d.cts +0 -5
  2546. package/node_modules/zod/v4/locales/bg.d.ts +0 -4
  2547. package/node_modules/zod/v4/locales/bg.js +0 -120
  2548. package/node_modules/zod/v4/locales/ca.cjs +0 -134
  2549. package/node_modules/zod/v4/locales/ca.d.cts +0 -5
  2550. package/node_modules/zod/v4/locales/ca.d.ts +0 -4
  2551. package/node_modules/zod/v4/locales/ca.js +0 -107
  2552. package/node_modules/zod/v4/locales/cs.cjs +0 -138
  2553. package/node_modules/zod/v4/locales/cs.d.cts +0 -5
  2554. package/node_modules/zod/v4/locales/cs.d.ts +0 -4
  2555. package/node_modules/zod/v4/locales/cs.js +0 -111
  2556. package/node_modules/zod/v4/locales/da.cjs +0 -142
  2557. package/node_modules/zod/v4/locales/da.d.cts +0 -5
  2558. package/node_modules/zod/v4/locales/da.d.ts +0 -4
  2559. package/node_modules/zod/v4/locales/da.js +0 -115
  2560. package/node_modules/zod/v4/locales/de.cjs +0 -135
  2561. package/node_modules/zod/v4/locales/de.d.cts +0 -5
  2562. package/node_modules/zod/v4/locales/de.d.ts +0 -4
  2563. package/node_modules/zod/v4/locales/de.js +0 -108
  2564. package/node_modules/zod/v4/locales/el.cjs +0 -136
  2565. package/node_modules/zod/v4/locales/el.d.cts +0 -5
  2566. package/node_modules/zod/v4/locales/el.d.ts +0 -4
  2567. package/node_modules/zod/v4/locales/el.js +0 -109
  2568. package/node_modules/zod/v4/locales/en.cjs +0 -140
  2569. package/node_modules/zod/v4/locales/en.d.cts +0 -5
  2570. package/node_modules/zod/v4/locales/en.d.ts +0 -4
  2571. package/node_modules/zod/v4/locales/en.js +0 -113
  2572. package/node_modules/zod/v4/locales/eo.cjs +0 -136
  2573. package/node_modules/zod/v4/locales/eo.d.cts +0 -5
  2574. package/node_modules/zod/v4/locales/eo.d.ts +0 -4
  2575. package/node_modules/zod/v4/locales/eo.js +0 -109
  2576. package/node_modules/zod/v4/locales/es.cjs +0 -159
  2577. package/node_modules/zod/v4/locales/es.d.cts +0 -5
  2578. package/node_modules/zod/v4/locales/es.d.ts +0 -4
  2579. package/node_modules/zod/v4/locales/es.js +0 -132
  2580. package/node_modules/zod/v4/locales/fa.cjs +0 -141
  2581. package/node_modules/zod/v4/locales/fa.d.cts +0 -5
  2582. package/node_modules/zod/v4/locales/fa.d.ts +0 -4
  2583. package/node_modules/zod/v4/locales/fa.js +0 -114
  2584. package/node_modules/zod/v4/locales/fi.cjs +0 -139
  2585. package/node_modules/zod/v4/locales/fi.d.cts +0 -5
  2586. package/node_modules/zod/v4/locales/fi.d.ts +0 -4
  2587. package/node_modules/zod/v4/locales/fi.js +0 -112
  2588. package/node_modules/zod/v4/locales/fr-CA.cjs +0 -134
  2589. package/node_modules/zod/v4/locales/fr-CA.d.cts +0 -5
  2590. package/node_modules/zod/v4/locales/fr-CA.d.ts +0 -4
  2591. package/node_modules/zod/v4/locales/fr-CA.js +0 -107
  2592. package/node_modules/zod/v4/locales/fr.cjs +0 -152
  2593. package/node_modules/zod/v4/locales/fr.d.cts +0 -5
  2594. package/node_modules/zod/v4/locales/fr.d.ts +0 -4
  2595. package/node_modules/zod/v4/locales/fr.js +0 -125
  2596. package/node_modules/zod/v4/locales/he.cjs +0 -241
  2597. package/node_modules/zod/v4/locales/he.d.cts +0 -5
  2598. package/node_modules/zod/v4/locales/he.d.ts +0 -4
  2599. package/node_modules/zod/v4/locales/he.js +0 -214
  2600. package/node_modules/zod/v4/locales/hr.cjs +0 -149
  2601. package/node_modules/zod/v4/locales/hr.d.cts +0 -5
  2602. package/node_modules/zod/v4/locales/hr.d.ts +0 -4
  2603. package/node_modules/zod/v4/locales/hr.js +0 -122
  2604. package/node_modules/zod/v4/locales/hu.cjs +0 -135
  2605. package/node_modules/zod/v4/locales/hu.d.cts +0 -5
  2606. package/node_modules/zod/v4/locales/hu.d.ts +0 -4
  2607. package/node_modules/zod/v4/locales/hu.js +0 -108
  2608. package/node_modules/zod/v4/locales/hy.cjs +0 -174
  2609. package/node_modules/zod/v4/locales/hy.d.cts +0 -5
  2610. package/node_modules/zod/v4/locales/hy.d.ts +0 -4
  2611. package/node_modules/zod/v4/locales/hy.js +0 -147
  2612. package/node_modules/zod/v4/locales/id.cjs +0 -133
  2613. package/node_modules/zod/v4/locales/id.d.cts +0 -5
  2614. package/node_modules/zod/v4/locales/id.d.ts +0 -4
  2615. package/node_modules/zod/v4/locales/id.js +0 -106
  2616. package/node_modules/zod/v4/locales/index.cjs +0 -111
  2617. package/node_modules/zod/v4/locales/index.d.cts +0 -52
  2618. package/node_modules/zod/v4/locales/index.d.ts +0 -52
  2619. package/node_modules/zod/v4/locales/index.js +0 -52
  2620. package/node_modules/zod/v4/locales/is.cjs +0 -136
  2621. package/node_modules/zod/v4/locales/is.d.cts +0 -5
  2622. package/node_modules/zod/v4/locales/is.d.ts +0 -4
  2623. package/node_modules/zod/v4/locales/is.js +0 -109
  2624. package/node_modules/zod/v4/locales/it.cjs +0 -135
  2625. package/node_modules/zod/v4/locales/it.d.cts +0 -5
  2626. package/node_modules/zod/v4/locales/it.d.ts +0 -4
  2627. package/node_modules/zod/v4/locales/it.js +0 -108
  2628. package/node_modules/zod/v4/locales/ja.cjs +0 -134
  2629. package/node_modules/zod/v4/locales/ja.d.cts +0 -5
  2630. package/node_modules/zod/v4/locales/ja.d.ts +0 -4
  2631. package/node_modules/zod/v4/locales/ja.js +0 -107
  2632. package/node_modules/zod/v4/locales/ka.cjs +0 -139
  2633. package/node_modules/zod/v4/locales/ka.d.cts +0 -5
  2634. package/node_modules/zod/v4/locales/ka.d.ts +0 -4
  2635. package/node_modules/zod/v4/locales/ka.js +0 -112
  2636. package/node_modules/zod/v4/locales/kh.cjs +0 -12
  2637. package/node_modules/zod/v4/locales/kh.d.cts +0 -5
  2638. package/node_modules/zod/v4/locales/kh.d.ts +0 -5
  2639. package/node_modules/zod/v4/locales/kh.js +0 -5
  2640. package/node_modules/zod/v4/locales/km.cjs +0 -137
  2641. package/node_modules/zod/v4/locales/km.d.cts +0 -5
  2642. package/node_modules/zod/v4/locales/km.d.ts +0 -4
  2643. package/node_modules/zod/v4/locales/km.js +0 -110
  2644. package/node_modules/zod/v4/locales/ko.cjs +0 -138
  2645. package/node_modules/zod/v4/locales/ko.d.cts +0 -5
  2646. package/node_modules/zod/v4/locales/ko.d.ts +0 -4
  2647. package/node_modules/zod/v4/locales/ko.js +0 -111
  2648. package/node_modules/zod/v4/locales/lt.cjs +0 -230
  2649. package/node_modules/zod/v4/locales/lt.d.cts +0 -5
  2650. package/node_modules/zod/v4/locales/lt.d.ts +0 -4
  2651. package/node_modules/zod/v4/locales/lt.js +0 -203
  2652. package/node_modules/zod/v4/locales/mk.cjs +0 -136
  2653. package/node_modules/zod/v4/locales/mk.d.cts +0 -5
  2654. package/node_modules/zod/v4/locales/mk.d.ts +0 -4
  2655. package/node_modules/zod/v4/locales/mk.js +0 -109
  2656. package/node_modules/zod/v4/locales/ms.cjs +0 -134
  2657. package/node_modules/zod/v4/locales/ms.d.cts +0 -5
  2658. package/node_modules/zod/v4/locales/ms.d.ts +0 -4
  2659. package/node_modules/zod/v4/locales/ms.js +0 -107
  2660. package/node_modules/zod/v4/locales/nl.cjs +0 -137
  2661. package/node_modules/zod/v4/locales/nl.d.cts +0 -5
  2662. package/node_modules/zod/v4/locales/nl.d.ts +0 -4
  2663. package/node_modules/zod/v4/locales/nl.js +0 -110
  2664. package/node_modules/zod/v4/locales/no.cjs +0 -135
  2665. package/node_modules/zod/v4/locales/no.d.cts +0 -5
  2666. package/node_modules/zod/v4/locales/no.d.ts +0 -4
  2667. package/node_modules/zod/v4/locales/no.js +0 -108
  2668. package/node_modules/zod/v4/locales/ota.cjs +0 -136
  2669. package/node_modules/zod/v4/locales/ota.d.cts +0 -5
  2670. package/node_modules/zod/v4/locales/ota.d.ts +0 -4
  2671. package/node_modules/zod/v4/locales/ota.js +0 -109
  2672. package/node_modules/zod/v4/locales/package.json +0 -7
  2673. package/node_modules/zod/v4/locales/pl.cjs +0 -136
  2674. package/node_modules/zod/v4/locales/pl.d.cts +0 -5
  2675. package/node_modules/zod/v4/locales/pl.d.ts +0 -4
  2676. package/node_modules/zod/v4/locales/pl.js +0 -109
  2677. package/node_modules/zod/v4/locales/ps.cjs +0 -141
  2678. package/node_modules/zod/v4/locales/ps.d.cts +0 -5
  2679. package/node_modules/zod/v4/locales/ps.d.ts +0 -4
  2680. package/node_modules/zod/v4/locales/ps.js +0 -114
  2681. package/node_modules/zod/v4/locales/pt.cjs +0 -135
  2682. package/node_modules/zod/v4/locales/pt.d.cts +0 -5
  2683. package/node_modules/zod/v4/locales/pt.d.ts +0 -4
  2684. package/node_modules/zod/v4/locales/pt.js +0 -108
  2685. package/node_modules/zod/v4/locales/ro.cjs +0 -146
  2686. package/node_modules/zod/v4/locales/ro.d.cts +0 -5
  2687. package/node_modules/zod/v4/locales/ro.d.ts +0 -4
  2688. package/node_modules/zod/v4/locales/ro.js +0 -119
  2689. package/node_modules/zod/v4/locales/ru.cjs +0 -183
  2690. package/node_modules/zod/v4/locales/ru.d.cts +0 -5
  2691. package/node_modules/zod/v4/locales/ru.d.ts +0 -4
  2692. package/node_modules/zod/v4/locales/ru.js +0 -156
  2693. package/node_modules/zod/v4/locales/sl.cjs +0 -136
  2694. package/node_modules/zod/v4/locales/sl.d.cts +0 -5
  2695. package/node_modules/zod/v4/locales/sl.d.ts +0 -4
  2696. package/node_modules/zod/v4/locales/sl.js +0 -109
  2697. package/node_modules/zod/v4/locales/sv.cjs +0 -137
  2698. package/node_modules/zod/v4/locales/sv.d.cts +0 -5
  2699. package/node_modules/zod/v4/locales/sv.d.ts +0 -4
  2700. package/node_modules/zod/v4/locales/sv.js +0 -110
  2701. package/node_modules/zod/v4/locales/ta.cjs +0 -137
  2702. package/node_modules/zod/v4/locales/ta.d.cts +0 -5
  2703. package/node_modules/zod/v4/locales/ta.d.ts +0 -4
  2704. package/node_modules/zod/v4/locales/ta.js +0 -110
  2705. package/node_modules/zod/v4/locales/th.cjs +0 -137
  2706. package/node_modules/zod/v4/locales/th.d.cts +0 -5
  2707. package/node_modules/zod/v4/locales/th.d.ts +0 -4
  2708. package/node_modules/zod/v4/locales/th.js +0 -110
  2709. package/node_modules/zod/v4/locales/tr.cjs +0 -132
  2710. package/node_modules/zod/v4/locales/tr.d.cts +0 -5
  2711. package/node_modules/zod/v4/locales/tr.d.ts +0 -4
  2712. package/node_modules/zod/v4/locales/tr.js +0 -105
  2713. package/node_modules/zod/v4/locales/ua.cjs +0 -12
  2714. package/node_modules/zod/v4/locales/ua.d.cts +0 -5
  2715. package/node_modules/zod/v4/locales/ua.d.ts +0 -5
  2716. package/node_modules/zod/v4/locales/ua.js +0 -5
  2717. package/node_modules/zod/v4/locales/uk.cjs +0 -135
  2718. package/node_modules/zod/v4/locales/uk.d.cts +0 -5
  2719. package/node_modules/zod/v4/locales/uk.d.ts +0 -4
  2720. package/node_modules/zod/v4/locales/uk.js +0 -108
  2721. package/node_modules/zod/v4/locales/ur.cjs +0 -137
  2722. package/node_modules/zod/v4/locales/ur.d.cts +0 -5
  2723. package/node_modules/zod/v4/locales/ur.d.ts +0 -4
  2724. package/node_modules/zod/v4/locales/ur.js +0 -110
  2725. package/node_modules/zod/v4/locales/uz.cjs +0 -137
  2726. package/node_modules/zod/v4/locales/uz.d.cts +0 -5
  2727. package/node_modules/zod/v4/locales/uz.d.ts +0 -4
  2728. package/node_modules/zod/v4/locales/uz.js +0 -110
  2729. package/node_modules/zod/v4/locales/vi.cjs +0 -135
  2730. package/node_modules/zod/v4/locales/vi.d.cts +0 -5
  2731. package/node_modules/zod/v4/locales/vi.d.ts +0 -4
  2732. package/node_modules/zod/v4/locales/vi.js +0 -108
  2733. package/node_modules/zod/v4/locales/yo.cjs +0 -134
  2734. package/node_modules/zod/v4/locales/yo.d.cts +0 -5
  2735. package/node_modules/zod/v4/locales/yo.d.ts +0 -4
  2736. package/node_modules/zod/v4/locales/yo.js +0 -107
  2737. package/node_modules/zod/v4/locales/zh-CN.cjs +0 -136
  2738. package/node_modules/zod/v4/locales/zh-CN.d.cts +0 -5
  2739. package/node_modules/zod/v4/locales/zh-CN.d.ts +0 -4
  2740. package/node_modules/zod/v4/locales/zh-CN.js +0 -109
  2741. package/node_modules/zod/v4/locales/zh-TW.cjs +0 -134
  2742. package/node_modules/zod/v4/locales/zh-TW.d.cts +0 -5
  2743. package/node_modules/zod/v4/locales/zh-TW.d.ts +0 -4
  2744. package/node_modules/zod/v4/locales/zh-TW.js +0 -107
  2745. package/node_modules/zod/v4/mini/checks.cjs +0 -34
  2746. package/node_modules/zod/v4/mini/checks.d.cts +0 -1
  2747. package/node_modules/zod/v4/mini/checks.d.ts +0 -1
  2748. package/node_modules/zod/v4/mini/checks.js +0 -1
  2749. package/node_modules/zod/v4/mini/coerce.cjs +0 -52
  2750. package/node_modules/zod/v4/mini/coerce.d.cts +0 -7
  2751. package/node_modules/zod/v4/mini/coerce.d.ts +0 -7
  2752. package/node_modules/zod/v4/mini/coerce.js +0 -22
  2753. package/node_modules/zod/v4/mini/external.cjs +0 -63
  2754. package/node_modules/zod/v4/mini/external.d.cts +0 -13
  2755. package/node_modules/zod/v4/mini/external.d.ts +0 -13
  2756. package/node_modules/zod/v4/mini/external.js +0 -14
  2757. package/node_modules/zod/v4/mini/index.cjs +0 -32
  2758. package/node_modules/zod/v4/mini/index.d.cts +0 -3
  2759. package/node_modules/zod/v4/mini/index.d.ts +0 -3
  2760. package/node_modules/zod/v4/mini/index.js +0 -3
  2761. package/node_modules/zod/v4/mini/iso.cjs +0 -64
  2762. package/node_modules/zod/v4/mini/iso.d.cts +0 -22
  2763. package/node_modules/zod/v4/mini/iso.d.ts +0 -22
  2764. package/node_modules/zod/v4/mini/iso.js +0 -34
  2765. package/node_modules/zod/v4/mini/package.json +0 -7
  2766. package/node_modules/zod/v4/mini/parse.cjs +0 -16
  2767. package/node_modules/zod/v4/mini/parse.d.cts +0 -1
  2768. package/node_modules/zod/v4/mini/parse.d.ts +0 -1
  2769. package/node_modules/zod/v4/mini/parse.js +0 -1
  2770. package/node_modules/zod/v4/mini/schemas.cjs +0 -1083
  2771. package/node_modules/zod/v4/mini/schemas.d.cts +0 -445
  2772. package/node_modules/zod/v4/mini/schemas.d.ts +0 -445
  2773. package/node_modules/zod/v4/mini/schemas.js +0 -961
  2774. package/node_modules/zod/v4/package.json +0 -7
  2775. package/node_modules/zod/v4-mini/index.cjs +0 -32
  2776. package/node_modules/zod/v4-mini/index.d.cts +0 -3
  2777. package/node_modules/zod/v4-mini/index.d.ts +0 -3
  2778. package/node_modules/zod/v4-mini/index.js +0 -3
  2779. package/node_modules/zod/v4-mini/package.json +0 -7
  2780. /package/{dist/src → assets}/demo/first-run-demo.md +0 -0
  2781. /package/{dist/src → assets}/demo/first-run-demo.seed.json +0 -0
  2782. /package/{dist/src → assets}/fix-prompt/prompts/fix-prompt-v1.md +0 -0
@@ -0,0 +1,4390 @@
1
+ import { defineTwin, twinBuildInfo, UnknownToolError, openTwinDatabase, createApp } from './chunk-LZIPGCQJ.js';
2
+ import { z, ZodError } from 'zod';
3
+ import { createHash, randomUUID } from 'node:crypto';
4
+
5
+ // ../packages/twin-github/dist/src/errors.js
6
+ var TwinError = class extends Error {
7
+ status;
8
+ errors;
9
+ constructor(message, status, errors) {
10
+ super(message);
11
+ this.status = status;
12
+ this.errors = errors;
13
+ }
14
+ };
15
+ function githubError(message, status, errors) {
16
+ return {
17
+ message,
18
+ documentation_url: "https://docs.github.com/rest",
19
+ status,
20
+ ...errors ? { errors } : {}
21
+ };
22
+ }
23
+ function notFound(message = "Not Found") {
24
+ throw new TwinError(message, 404);
25
+ }
26
+ function conflict(message) {
27
+ throw new TwinError(message, 409);
28
+ }
29
+ function validationFailed(field, code, value) {
30
+ throw new TwinError("Validation Failed", 422, [
31
+ {
32
+ resource: "Request",
33
+ field,
34
+ code,
35
+ ...value === void 0 ? {} : { value }
36
+ }
37
+ ]);
38
+ }
39
+
40
+ // ../packages/twin-github/dist/src/tools.js
41
+ var pageShape = {
42
+ page: z.coerce.number().int().positive().optional(),
43
+ per_page: z.coerce.number().int().positive().optional(),
44
+ perPage: z.coerce.number().int().positive().optional()
45
+ };
46
+ var ownerRepo = {
47
+ owner: z.string().min(1),
48
+ repo: z.string().min(1)
49
+ };
50
+ var prNumber = {
51
+ pull_number: z.coerce.number().int().positive().optional(),
52
+ pullNumber: z.coerce.number().int().positive().optional()
53
+ };
54
+ ({
55
+ issue_number: z.coerce.number().int().positive(),
56
+ issueNumber: z.coerce.number().int().positive().optional()
57
+ });
58
+ function normalizeIssueNumber(input) {
59
+ return { ...input, issue_number: input.issue_number ?? input.issueNumber };
60
+ }
61
+ function normalizePullNumber(input) {
62
+ return { ...input, pull_number: input.pull_number ?? input.pullNumber };
63
+ }
64
+ function normalizeCommentId(input) {
65
+ return { ...input, comment_id: input.comment_id ?? input.commentId };
66
+ }
67
+ function normalizeMilestoneNumber(input) {
68
+ return { ...input, milestone_number: input.milestone_number ?? input.milestoneNumber };
69
+ }
70
+ function normalizeHeadSha(input) {
71
+ return { ...input, head_sha: input.head_sha ?? input.headSha };
72
+ }
73
+ function normalizeTagName(input) {
74
+ return { ...input, tag_name: input.tag_name ?? input.tagName };
75
+ }
76
+ var toolDefinitions = [
77
+ {
78
+ name: "search_repositories",
79
+ description: "Search local repositories by name or description.",
80
+ schema: z.object({ query: z.string().optional(), q: z.string().optional(), ...pageShape })
81
+ },
82
+ {
83
+ name: "create_repository",
84
+ description: "Create a repository with an initial README and main branch.",
85
+ schema: z.object({ name: z.string().min(1), owner: z.string().min(1).optional(), description: z.string().optional(), private: z.boolean().optional() })
86
+ },
87
+ {
88
+ name: "fork_repository",
89
+ description: "Fork a repository into the current user or an organization.",
90
+ schema: z.object({ ...ownerRepo, organization: z.string().min(1).optional() })
91
+ },
92
+ {
93
+ name: "get_repository",
94
+ description: "Get one repository.",
95
+ schema: z.object({ ...ownerRepo })
96
+ },
97
+ {
98
+ name: "search_code",
99
+ description: "Search files in the local GitHub twin.",
100
+ schema: z.object({ query: z.string().optional(), q: z.string().optional(), owner: z.string().optional(), repo: z.string().optional(), ...pageShape })
101
+ },
102
+ {
103
+ name: "search_users",
104
+ description: "Search seeded users and organizations.",
105
+ schema: z.object({ query: z.string().optional(), q: z.string().optional(), ...pageShape })
106
+ },
107
+ {
108
+ name: "get_file_contents",
109
+ description: "Read a file or directory from a repository branch.",
110
+ schema: z.object({ ...ownerRepo, path: z.string().optional(), ref: z.string().optional() })
111
+ },
112
+ {
113
+ name: "list_commits",
114
+ description: "List commits for a repository.",
115
+ schema: z.object({ ...ownerRepo, sha: z.string().optional(), ...pageShape })
116
+ },
117
+ {
118
+ name: "create_or_update_file",
119
+ description: "Create or update one file and advance the branch head atomically.",
120
+ schema: z.object({ ...ownerRepo, path: z.string().min(1), message: z.string().min(1), content: z.string(), branch: z.string().optional(), sha: z.string().optional(), encoding: z.enum(["utf-8", "base64"]).optional() })
121
+ },
122
+ {
123
+ name: "create_branch",
124
+ description: "Create a branch from an existing branch or SHA.",
125
+ schema: z.object({ ...ownerRepo, branch: z.string().min(1), from_branch: z.string().optional(), sha: z.string().optional() })
126
+ },
127
+ {
128
+ name: "push_files",
129
+ description: "Push multiple files in a single commit.",
130
+ schema: z.object({ ...ownerRepo, branch: z.string().optional(), message: z.string().min(1), files: z.array(z.object({ path: z.string().min(1), content: z.string(), encoding: z.enum(["utf-8", "base64"]).optional() })).min(1) })
131
+ },
132
+ {
133
+ name: "get_issue",
134
+ description: "Get one issue.",
135
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
136
+ },
137
+ {
138
+ name: "update_issue",
139
+ description: "Update an issue title, body, state, labels, or assignees.",
140
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), title: z.string().optional(), body: z.string().optional(), state: z.enum(["open", "closed"]).optional(), labels: z.array(z.string()).optional(), assignees: z.array(z.string()).optional() }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
141
+ },
142
+ {
143
+ name: "search_issues",
144
+ description: "Search all local issues.",
145
+ schema: z.object({ query: z.string().optional(), q: z.string().optional(), state: z.enum(["open", "closed", "all"]).optional(), ...pageShape })
146
+ },
147
+ {
148
+ name: "list_issues",
149
+ description: "List repository issues with common filters.",
150
+ schema: z.object({ ...ownerRepo, state: z.enum(["open", "closed", "all"]).optional(), labels: z.string().optional(), assignee: z.string().optional(), ...pageShape })
151
+ },
152
+ {
153
+ name: "add_issue_comment",
154
+ description: "Add an issue comment.",
155
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), body: z.string().min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
156
+ },
157
+ {
158
+ name: "list_issue_comments",
159
+ description: "List comments on an issue.",
160
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
161
+ },
162
+ {
163
+ name: "create_issue",
164
+ description: "Create an issue.",
165
+ schema: z.object({ ...ownerRepo, title: z.string().min(1), body: z.string().optional(), labels: z.array(z.string()).optional(), assignees: z.array(z.string()).optional() })
166
+ },
167
+ {
168
+ name: "list_repository_labels",
169
+ description: "List labels defined on a repository.",
170
+ schema: z.object({ ...ownerRepo })
171
+ },
172
+ {
173
+ name: "create_label",
174
+ description: "Create a repository label.",
175
+ schema: z.object({ ...ownerRepo, name: z.string().min(1), color: z.string().default("ededed"), description: z.string().default("") })
176
+ },
177
+ {
178
+ name: "list_issue_labels",
179
+ description: "List labels applied to an issue.",
180
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
181
+ },
182
+ {
183
+ name: "add_issue_labels",
184
+ description: "Apply one or more labels to an issue.",
185
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), labels: z.array(z.string().min(1)).min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
186
+ },
187
+ {
188
+ name: "remove_issue_label",
189
+ description: "Remove one label from an issue.",
190
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), label: z.string().min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
191
+ },
192
+ {
193
+ name: "list_collaborators",
194
+ description: "List repository collaborators.",
195
+ schema: z.object({ ...ownerRepo })
196
+ },
197
+ {
198
+ name: "add_assignees",
199
+ description: "Add assignees to an issue.",
200
+ schema: z.object({ ...ownerRepo, issue_number: z.coerce.number().int().positive().optional(), issueNumber: z.coerce.number().int().positive().optional(), assignees: z.array(z.string().min(1)).min(1) }).refine((value) => value.issue_number ?? value.issueNumber, "issue_number is required")
201
+ },
202
+ {
203
+ name: "get_pull_request",
204
+ description: "Get one pull request.",
205
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
206
+ },
207
+ {
208
+ name: "get_pull_request_reviews",
209
+ description: "List pull request reviews.",
210
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
211
+ },
212
+ {
213
+ name: "create_pull_request_review",
214
+ description: "Create a pull request review.",
215
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), body: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
216
+ },
217
+ {
218
+ name: "get_pull_request_comments",
219
+ description: "List review comments on a pull request.",
220
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
221
+ },
222
+ {
223
+ name: "get_pull_request_files",
224
+ description: "List files changed by a pull request.",
225
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
226
+ },
227
+ {
228
+ name: "get_pull_request_status",
229
+ description: "Get combined status for a pull request head commit.",
230
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
231
+ },
232
+ {
233
+ name: "list_pull_requests",
234
+ description: "List repository pull requests.",
235
+ schema: z.object({ ...ownerRepo, state: z.enum(["open", "closed", "all"]).optional(), ...pageShape })
236
+ },
237
+ {
238
+ name: "merge_pull_request",
239
+ description: "Merge a pull request using simplified local merge semantics.",
240
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), commit_title: z.string().optional(), commit_message: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
241
+ },
242
+ {
243
+ name: "update_pull_request_branch",
244
+ description: "Update a PR branch from its base branch.",
245
+ schema: z.object({ ...ownerRepo, pull_number: z.coerce.number().int().positive().optional(), pullNumber: z.coerce.number().int().positive().optional(), expected_head_sha: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
246
+ },
247
+ {
248
+ name: "create_pull_request",
249
+ description: "Create a pull request from a head branch to a base branch.",
250
+ schema: z.object({ ...ownerRepo, title: z.string().min(1), body: z.string().optional(), head: z.string().min(1), base: z.string().optional() })
251
+ },
252
+ // ===== v2 hot paths (FDRS-300) ==========================================
253
+ // Cluster A — branches & files
254
+ {
255
+ name: "list_branches",
256
+ description: "List branches for a repository.",
257
+ schema: z.object({ ...ownerRepo, ...pageShape })
258
+ },
259
+ {
260
+ name: "get_branch",
261
+ description: "Get one branch by name.",
262
+ schema: z.object({ ...ownerRepo, branch: z.string().min(1) })
263
+ },
264
+ {
265
+ name: "delete_branch",
266
+ description: "Delete a branch (cannot delete the default branch or a branch backing an open PR).",
267
+ schema: z.object({ ...ownerRepo, branch: z.string().min(1) })
268
+ },
269
+ {
270
+ name: "delete_file",
271
+ description: "Delete one file and advance the branch head atomically.",
272
+ schema: z.object({ ...ownerRepo, path: z.string().min(1), message: z.string().min(1), sha: z.string().min(1), branch: z.string().optional() })
273
+ },
274
+ // Cluster B — commits & diffs
275
+ {
276
+ name: "get_commit",
277
+ description: "Get one commit with its file changes and stats.",
278
+ schema: z.object({ ...ownerRepo, ref: z.string().min(1) })
279
+ },
280
+ {
281
+ name: "compare_commits",
282
+ description: "Compare two commits, branches, or tags. Returns ahead/behind/identical/diverged.",
283
+ schema: z.object({ ...ownerRepo, base: z.string().min(1), head: z.string().min(1) })
284
+ },
285
+ {
286
+ name: "get_pull_request_diff",
287
+ description: "Get a unified-diff-style text representation of a pull request.",
288
+ schema: z.object({ ...ownerRepo, ...prNumber }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
289
+ },
290
+ // Cluster C — PR deeper
291
+ {
292
+ name: "update_pull_request",
293
+ description: "Update a pull request title, body, state, or base branch.",
294
+ schema: z.object({ ...ownerRepo, ...prNumber, title: z.string().optional(), body: z.string().optional(), state: z.enum(["open", "closed"]).optional(), base: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
295
+ },
296
+ {
297
+ name: "get_pull_request_commits",
298
+ description: "List commits on a pull request, oldest first.",
299
+ schema: z.object({ ...ownerRepo, ...prNumber, ...pageShape }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
300
+ },
301
+ {
302
+ name: "create_pull_request_review_comment",
303
+ description: "Create an inline review comment on a pull request at a file path and line.",
304
+ schema: z.object({ ...ownerRepo, ...prNumber, body: z.string().min(1), path: z.string().min(1), line: z.coerce.number().int().positive(), side: z.enum(["LEFT", "RIGHT"]).optional(), commit_id: z.string().optional(), commitId: z.string().optional() }).refine((value) => value.pull_number ?? value.pullNumber, "pull_number is required")
305
+ },
306
+ {
307
+ name: "add_reply_to_pull_request_comment",
308
+ description: "Reply to an existing pull request review comment.",
309
+ schema: z.object({ ...ownerRepo, ...prNumber, comment_id: z.coerce.number().int().positive().optional(), commentId: z.coerce.number().int().positive().optional(), body: z.string().min(1) }).refine((value) => (value.pull_number ?? value.pullNumber) && (value.comment_id ?? value.commentId), "pull_number and comment_id are required")
310
+ },
311
+ // Cluster D — issue comments deeper
312
+ {
313
+ name: "update_issue_comment",
314
+ description: "Update the body of an existing issue comment.",
315
+ schema: z.object({ ...ownerRepo, comment_id: z.coerce.number().int().positive().optional(), commentId: z.coerce.number().int().positive().optional(), body: z.string().min(1) }).refine((value) => value.comment_id ?? value.commentId, "comment_id is required")
316
+ },
317
+ {
318
+ name: "delete_issue_comment",
319
+ description: "Delete an issue comment by ID.",
320
+ schema: z.object({ ...ownerRepo, comment_id: z.coerce.number().int().positive().optional(), commentId: z.coerce.number().int().positive().optional() }).refine((value) => value.comment_id ?? value.commentId, "comment_id is required")
321
+ },
322
+ // Cluster E — milestones
323
+ {
324
+ name: "list_milestones",
325
+ description: "List milestones for a repository.",
326
+ schema: z.object({ ...ownerRepo, state: z.enum(["open", "closed", "all"]).optional(), ...pageShape })
327
+ },
328
+ {
329
+ name: "create_milestone",
330
+ description: "Create a milestone.",
331
+ schema: z.object({ ...ownerRepo, title: z.string().min(1), description: z.string().optional(), due_on: z.string().optional(), dueOn: z.string().optional(), state: z.enum(["open", "closed"]).optional() })
332
+ },
333
+ {
334
+ name: "update_milestone",
335
+ description: "Update a milestone.",
336
+ schema: z.object({ ...ownerRepo, milestone_number: z.coerce.number().int().positive().optional(), milestoneNumber: z.coerce.number().int().positive().optional(), title: z.string().optional(), description: z.string().optional(), due_on: z.string().optional(), dueOn: z.string().optional(), state: z.enum(["open", "closed"]).optional() }).refine((value) => value.milestone_number ?? value.milestoneNumber, "milestone_number is required")
337
+ },
338
+ {
339
+ name: "delete_milestone",
340
+ description: "Delete a milestone.",
341
+ schema: z.object({ ...ownerRepo, milestone_number: z.coerce.number().int().positive().optional(), milestoneNumber: z.coerce.number().int().positive().optional() }).refine((value) => value.milestone_number ?? value.milestoneNumber, "milestone_number is required")
342
+ },
343
+ // Cluster F — status + checks
344
+ {
345
+ name: "create_commit_status",
346
+ description: "Create a commit status (pending/success/failure/error) on a commit SHA.",
347
+ schema: z.object({ ...ownerRepo, sha: z.string().min(1), state: z.enum(["error", "failure", "pending", "success"]), context: z.string().optional(), description: z.string().optional(), target_url: z.string().optional(), targetUrl: z.string().optional() })
348
+ },
349
+ {
350
+ name: "get_combined_status_for_ref",
351
+ description: "Get the combined status for a ref (SHA, branch, or tag).",
352
+ schema: z.object({ ...ownerRepo, ref: z.string().min(1) })
353
+ },
354
+ {
355
+ name: "create_check_run",
356
+ description: "Create a check run on a commit SHA.",
357
+ schema: z.object({ ...ownerRepo, name: z.string().min(1), head_sha: z.string().min(1).optional(), headSha: z.string().min(1).optional(), status: z.enum(["queued", "in_progress", "completed"]).optional(), conclusion: z.enum(["success", "failure", "neutral", "cancelled", "timed_out", "action_required", "skipped", "stale"]).optional(), details_url: z.string().optional(), detailsUrl: z.string().optional(), external_id: z.string().optional(), externalId: z.string().optional(), output: z.object({ title: z.string().optional(), summary: z.string().optional() }).optional(), started_at: z.string().optional(), startedAt: z.string().optional(), completed_at: z.string().optional(), completedAt: z.string().optional() }).refine((value) => value.head_sha ?? value.headSha, "head_sha is required")
358
+ },
359
+ {
360
+ name: "list_check_runs_for_ref",
361
+ description: "List check runs for a ref (SHA, branch, or tag).",
362
+ schema: z.object({ ...ownerRepo, ref: z.string().min(1), ...pageShape })
363
+ },
364
+ // Cluster G — tags & releases
365
+ {
366
+ name: "list_tags",
367
+ description: "List tags for a repository, most recent first.",
368
+ schema: z.object({ ...ownerRepo, ...pageShape })
369
+ },
370
+ {
371
+ name: "list_releases",
372
+ description: "List releases for a repository, most recent first.",
373
+ schema: z.object({ ...ownerRepo, ...pageShape })
374
+ },
375
+ {
376
+ name: "get_latest_release",
377
+ description: "Get the latest published (non-draft, non-prerelease) release.",
378
+ schema: z.object({ ...ownerRepo })
379
+ },
380
+ {
381
+ name: "create_release",
382
+ description: "Create a release. Auto-creates the tag if it doesn't exist.",
383
+ schema: z.object({ ...ownerRepo, tag_name: z.string().min(1).optional(), tagName: z.string().min(1).optional(), target_commitish: z.string().optional(), targetCommitish: z.string().optional(), name: z.string().optional(), body: z.string().optional(), draft: z.boolean().optional(), prerelease: z.boolean().optional() }).refine((value) => value.tag_name ?? value.tagName, "tag_name is required")
384
+ },
385
+ // Cluster H — identity & collaborators
386
+ {
387
+ name: "get_me",
388
+ description: "Get the authenticated user.",
389
+ schema: z.object({})
390
+ },
391
+ {
392
+ name: "add_collaborator",
393
+ description: "Add a collaborator to a repository. Returns 201 + invitation envelope for new users, 204 when already a collaborator.",
394
+ schema: z.object({ ...ownerRepo, username: z.string().min(1), permission: z.enum(["pull", "push", "admin", "maintain", "triage"]).optional() })
395
+ },
396
+ // M5 hot gaps (F-735)
397
+ {
398
+ name: "search_commits",
399
+ description: "Search commits on repository default branches by message or author.",
400
+ schema: z.object({ query: z.string().optional(), q: z.string().optional(), owner: z.string().optional(), repo: z.string().optional(), ...pageShape })
401
+ },
402
+ {
403
+ name: "get_release_by_tag",
404
+ description: "Get a release by its tag name.",
405
+ schema: z.object({ ...ownerRepo, tag: z.string().min(1) })
406
+ },
407
+ {
408
+ name: "get_tag",
409
+ description: "Get a tag by name, including the commit it points at.",
410
+ schema: z.object({ ...ownerRepo, tag: z.string().min(1) })
411
+ }
412
+ ];
413
+ function listTools() {
414
+ return toolDefinitions.map((tool) => ({
415
+ name: tool.name,
416
+ description: tool.description,
417
+ input_schema: z.toJSONSchema(tool.schema)
418
+ }));
419
+ }
420
+ var MUTATING_TOOL_NAMES = /* @__PURE__ */ new Set([
421
+ "create_repository",
422
+ "fork_repository",
423
+ "create_or_update_file",
424
+ "create_branch",
425
+ "push_files",
426
+ "update_issue",
427
+ "add_issue_comment",
428
+ "create_label",
429
+ "add_issue_labels",
430
+ "remove_issue_label",
431
+ "add_assignees",
432
+ "create_issue",
433
+ "create_pull_request_review",
434
+ "merge_pull_request",
435
+ "update_pull_request_branch",
436
+ "create_pull_request",
437
+ // v2 hot paths (FDRS-300)
438
+ "delete_branch",
439
+ "delete_file",
440
+ "update_pull_request",
441
+ "create_pull_request_review_comment",
442
+ "add_reply_to_pull_request_comment",
443
+ "update_issue_comment",
444
+ "delete_issue_comment",
445
+ "create_milestone",
446
+ "update_milestone",
447
+ "delete_milestone",
448
+ "create_commit_status",
449
+ "create_check_run",
450
+ "create_release",
451
+ "add_collaborator"
452
+ ]);
453
+ function isMutatingTool(name) {
454
+ return MUTATING_TOOL_NAMES.has(name);
455
+ }
456
+ var TAPE_ASSERTABLE_TOOLS = ["create_commit_status", "create_check_run"];
457
+ function executeTool(domain, name, input, onDelta, options = {}) {
458
+ const definition = toolDefinitions.find((tool) => tool.name === name);
459
+ if (!definition) {
460
+ validationFailed("tool", "invalid", name);
461
+ }
462
+ const parsed = definition.schema.parse(input);
463
+ switch (name) {
464
+ case "search_repositories":
465
+ return domain.searchRepositories(parsed);
466
+ case "create_repository":
467
+ return domain.createRepository(parsed, onDelta);
468
+ case "fork_repository":
469
+ return domain.forkRepository(parsed, onDelta);
470
+ case "get_repository":
471
+ return domain.getRepository(parsed);
472
+ case "search_code":
473
+ return domain.searchCode(parsed);
474
+ case "search_users":
475
+ return domain.searchUsers(parsed);
476
+ case "get_file_contents":
477
+ return domain.getFileContents(parsed);
478
+ case "list_commits":
479
+ return domain.listCommits(parsed);
480
+ case "create_or_update_file":
481
+ return domain.createOrUpdateFile(parsed, { actor: options.actor }, onDelta);
482
+ case "create_branch":
483
+ return domain.createBranch(parsed, onDelta);
484
+ case "push_files":
485
+ return domain.pushFiles(parsed, { actor: options.actor }, onDelta);
486
+ case "get_issue":
487
+ return domain.getIssue(normalizeIssueNumber(parsed));
488
+ case "update_issue":
489
+ return domain.updateIssue(normalizeIssueNumber(parsed), onDelta);
490
+ case "search_issues":
491
+ return domain.searchIssues(parsed);
492
+ case "list_issues":
493
+ return domain.listIssues(parsed);
494
+ case "add_issue_comment":
495
+ return domain.addIssueComment(normalizeIssueNumber(parsed), onDelta);
496
+ case "list_issue_comments":
497
+ return domain.listIssueComments(normalizeIssueNumber(parsed));
498
+ case "create_issue":
499
+ return domain.createIssue(parsed, onDelta);
500
+ case "list_repository_labels":
501
+ return domain.listRepositoryLabels(parsed);
502
+ case "create_label":
503
+ return domain.createRepositoryLabel(parsed, onDelta);
504
+ case "list_issue_labels":
505
+ return domain.listIssueLabelsForIssue(normalizeIssueNumber(parsed));
506
+ case "add_issue_labels":
507
+ return domain.addIssueLabels(normalizeIssueNumber(parsed), onDelta);
508
+ case "remove_issue_label":
509
+ return domain.deleteIssueLabel(normalizeIssueNumber(parsed), onDelta);
510
+ case "list_collaborators":
511
+ return domain.listCollaborators(parsed);
512
+ case "add_assignees":
513
+ return domain.addAssignees(normalizeIssueNumber(parsed), onDelta);
514
+ case "get_pull_request":
515
+ return domain.getPullRequest(normalizePullNumber(parsed));
516
+ case "get_pull_request_reviews":
517
+ return domain.getPullRequestReviews(normalizePullNumber(parsed));
518
+ case "create_pull_request_review":
519
+ return domain.createPullRequestReview(normalizePullNumber(parsed), onDelta);
520
+ case "get_pull_request_comments":
521
+ return domain.getPullRequestComments(normalizePullNumber(parsed));
522
+ case "get_pull_request_files":
523
+ return domain.getPullRequestFiles(normalizePullNumber(parsed));
524
+ case "get_pull_request_status":
525
+ return domain.getPullRequestStatus(normalizePullNumber(parsed));
526
+ case "list_pull_requests":
527
+ return domain.listPullRequests(parsed);
528
+ case "merge_pull_request":
529
+ if (!options.actor || !domain.hasRepositoryPermission({ owner: parsed.owner, repo: parsed.repo, username: options.actor, permissions: ["push", "maintain", "admin"] })) {
530
+ throw new TwinError("Must have push access to the repository to merge pull requests.", 403);
531
+ }
532
+ return domain.mergePullRequest(normalizePullNumber(parsed), onDelta);
533
+ case "update_pull_request_branch":
534
+ return domain.updatePullRequestBranch(normalizePullNumber(parsed), onDelta);
535
+ case "create_pull_request":
536
+ return domain.createPullRequest({ ...parsed, actor: parsed.actor ?? options.actor }, onDelta);
537
+ // ===== v2 hot paths (FDRS-300) ========================================
538
+ case "list_branches":
539
+ return domain.listBranchesForRepo(parsed);
540
+ case "get_branch":
541
+ return domain.getBranchByName(parsed);
542
+ case "delete_branch":
543
+ return domain.deleteBranch(parsed, onDelta);
544
+ case "delete_file":
545
+ return domain.deleteFile(parsed, { actor: options.actor }, onDelta);
546
+ case "get_commit":
547
+ return domain.getCommitWithFiles(parsed);
548
+ case "compare_commits":
549
+ return domain.compareCommits(parsed);
550
+ case "get_pull_request_diff":
551
+ return domain.getPullRequestDiff(normalizePullNumber(parsed));
552
+ case "update_pull_request":
553
+ return domain.updatePullRequest(normalizePullNumber(parsed), onDelta);
554
+ case "get_pull_request_commits":
555
+ return domain.getPullRequestCommits(normalizePullNumber(parsed));
556
+ case "create_pull_request_review_comment": {
557
+ const merged = normalizePullNumber(parsed);
558
+ const commitId = merged.commit_id ?? merged.commitId;
559
+ return domain.createPullRequestReviewComment({ ...merged, commit_id: commitId }, { actor: options.actor }, onDelta);
560
+ }
561
+ case "add_reply_to_pull_request_comment":
562
+ return domain.addReplyToPullRequestComment(normalizeCommentId(normalizePullNumber(parsed)), { actor: options.actor }, onDelta);
563
+ case "update_issue_comment":
564
+ return domain.updateIssueComment(normalizeCommentId(parsed), onDelta);
565
+ case "delete_issue_comment":
566
+ return domain.deleteIssueComment(normalizeCommentId(parsed), onDelta);
567
+ case "list_milestones":
568
+ return domain.listMilestones(parsed);
569
+ case "create_milestone": {
570
+ const dueOn = parsed.due_on ?? parsed.dueOn;
571
+ return domain.createMilestone({ ...parsed, due_on: dueOn }, onDelta);
572
+ }
573
+ case "update_milestone": {
574
+ const merged = normalizeMilestoneNumber(parsed);
575
+ const dueOn = merged.due_on ?? merged.dueOn;
576
+ return domain.updateMilestone({ ...merged, due_on: dueOn }, onDelta);
577
+ }
578
+ case "delete_milestone":
579
+ return domain.deleteMilestone(normalizeMilestoneNumber(parsed), onDelta);
580
+ case "create_commit_status": {
581
+ const targetUrl = parsed.target_url ?? parsed.targetUrl;
582
+ return domain.createCommitStatus({ ...parsed, target_url: targetUrl }, onDelta);
583
+ }
584
+ case "get_combined_status_for_ref":
585
+ return domain.getCombinedStatusForRef(parsed);
586
+ case "create_check_run": {
587
+ const merged = normalizeHeadSha(parsed);
588
+ return domain.createCheckRun({
589
+ ...merged,
590
+ details_url: merged.details_url ?? merged.detailsUrl,
591
+ external_id: merged.external_id ?? merged.externalId,
592
+ started_at: merged.started_at ?? merged.startedAt,
593
+ completed_at: merged.completed_at ?? merged.completedAt
594
+ }, onDelta);
595
+ }
596
+ case "list_check_runs_for_ref":
597
+ return domain.listCheckRunsForRef(parsed);
598
+ case "list_tags":
599
+ return domain.listTags(parsed);
600
+ case "list_releases":
601
+ return domain.listReleases(parsed);
602
+ case "get_latest_release":
603
+ return domain.getLatestRelease(parsed);
604
+ case "create_release": {
605
+ const merged = normalizeTagName(parsed);
606
+ return domain.createRelease({
607
+ ...merged,
608
+ target_commitish: merged.target_commitish ?? merged.targetCommitish
609
+ }, { actor: options.actor }, onDelta);
610
+ }
611
+ case "get_me":
612
+ return domain.getMe({ actor: options.actor });
613
+ case "add_collaborator":
614
+ if (!options.actor || !domain.hasRepositoryPermission({ ...parsed, username: options.actor, permissions: ["push", "maintain", "admin"] })) {
615
+ throw new TwinError("Must have push access to the repository to add collaborators.", 403);
616
+ }
617
+ return domain.addCollaboratorAction({ ...parsed, actor: options.actor }, onDelta);
618
+ // M5 hot gaps (F-735)
619
+ case "search_commits":
620
+ return domain.searchCommits(parsed);
621
+ case "get_release_by_tag":
622
+ return domain.getReleaseByTag(parsed);
623
+ case "get_tag":
624
+ return domain.getTag(parsed);
625
+ }
626
+ }
627
+
628
+ // ../packages/twin-github/dist/src/access-control.js
629
+ var githubAccessControlCategorySchema = z.enum([
630
+ "issues",
631
+ "issue_comments",
632
+ "pull_requests",
633
+ "branches_files",
634
+ "commits_diffs",
635
+ "milestones",
636
+ "status_checks",
637
+ "tags_releases",
638
+ "labels",
639
+ "collaborators"
640
+ ]);
641
+ var GITHUB_ACCESS_CONTROL_CATEGORY_LABELS = {
642
+ issues: "Issues",
643
+ issue_comments: "Issue comments",
644
+ pull_requests: "Pull requests",
645
+ branches_files: "Branches & files",
646
+ commits_diffs: "Commits & diffs",
647
+ milestones: "Milestones",
648
+ status_checks: "Status & checks",
649
+ tags_releases: "Tags & releases",
650
+ labels: "Labels",
651
+ collaborators: "Collaborators & identity"
652
+ };
653
+ var GITHUB_ACCESS_CONTROL_CATEGORY_ORDER = [
654
+ "issues",
655
+ "issue_comments",
656
+ "pull_requests",
657
+ "branches_files",
658
+ "commits_diffs",
659
+ "milestones",
660
+ "status_checks",
661
+ "tags_releases",
662
+ "labels",
663
+ "collaborators"
664
+ ];
665
+ var githubAccessControlEndpointSchema = z.object({
666
+ /** MCP tool name (snake_case). Stable id for policy storage. */
667
+ tool: z.string().min(1),
668
+ /** Dashboard label operation segment, e.g. `listIssues`. */
669
+ operation: z.string().min(1),
670
+ method: z.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]),
671
+ category: githubAccessControlCategorySchema,
672
+ /** Default allow/deny when a session has no explicit override. */
673
+ default_allowed: z.boolean(),
674
+ /** FDRS-300 v2 hot-path; false for the original 25-endpoint surface. */
675
+ v2: z.boolean().default(false)
676
+ });
677
+ var githubAccessControlCategoryGroupSchema = z.object({
678
+ category: githubAccessControlCategorySchema,
679
+ label: z.string().min(1),
680
+ endpoints: z.array(githubAccessControlEndpointSchema)
681
+ });
682
+ z.object({
683
+ version: z.literal(2),
684
+ twin: z.literal("github"),
685
+ endpoints: z.array(githubAccessControlEndpointSchema).min(1),
686
+ categories: z.array(githubAccessControlCategoryGroupSchema).min(1)
687
+ });
688
+ function entry(tool, operation, method, category, defaultAllowed, v2 = false) {
689
+ return { tool, operation, method, category, default_allowed: defaultAllowed, v2 };
690
+ }
691
+ var ENDPOINTS = [
692
+ // Issues
693
+ entry("list_issues", "listIssues", "GET", "issues", true),
694
+ entry("get_issue", "getIssue", "GET", "issues", true),
695
+ entry("create_issue", "createIssue", "POST", "issues", true),
696
+ entry("update_issue", "updateIssue", "PATCH", "issues", true),
697
+ entry("add_assignees", "addAssignees", "POST", "issues", false),
698
+ // Issue comments
699
+ entry("add_issue_comment", "addComment", "POST", "issue_comments", true),
700
+ entry("update_issue_comment", "updateIssueComment", "PATCH", "issue_comments", true, true),
701
+ entry("delete_issue_comment", "deleteIssueComment", "DELETE", "issue_comments", false, true),
702
+ // Pull requests
703
+ entry("list_pull_requests", "listPullRequests", "GET", "pull_requests", true),
704
+ entry("get_pull_request", "getPullRequest", "GET", "pull_requests", true),
705
+ entry("create_pull_request", "createPullRequest", "POST", "pull_requests", true),
706
+ entry("update_pull_request", "updatePullRequest", "PATCH", "pull_requests", true, true),
707
+ entry("merge_pull_request", "mergePullRequest", "POST", "pull_requests", false),
708
+ entry("create_pull_request_review", "createReview", "POST", "pull_requests", false),
709
+ entry("get_pull_request_reviews", "getPullRequestReviews", "GET", "pull_requests", true),
710
+ entry("get_pull_request_comments", "getPullRequestComments", "GET", "pull_requests", true),
711
+ entry("get_pull_request_files", "getPullRequestFiles", "GET", "pull_requests", true),
712
+ entry("get_pull_request_status", "getPullRequestStatus", "GET", "pull_requests", true),
713
+ entry("update_pull_request_branch", "updatePullRequestBranch", "POST", "pull_requests", false),
714
+ entry("get_pull_request_diff", "getPullRequestDiff", "GET", "pull_requests", true, true),
715
+ entry("get_pull_request_commits", "getPullRequestCommits", "GET", "pull_requests", true, true),
716
+ entry("create_pull_request_review_comment", "createPullRequestReviewComment", "POST", "pull_requests", true, true),
717
+ entry("add_reply_to_pull_request_comment", "addReplyToPullRequestComment", "POST", "pull_requests", true, true),
718
+ // Branches & files
719
+ entry("create_branch", "createBranch", "POST", "branches_files", true),
720
+ entry("list_branches", "listBranches", "GET", "branches_files", true, true),
721
+ entry("get_branch", "getBranch", "GET", "branches_files", true, true),
722
+ entry("delete_branch", "deleteBranch", "DELETE", "branches_files", false, true),
723
+ entry("get_file_contents", "getContent", "GET", "branches_files", true),
724
+ entry("create_or_update_file", "createOrUpdateFile", "PUT", "branches_files", true),
725
+ entry("delete_file", "deleteFile", "DELETE", "branches_files", false, true),
726
+ entry("push_files", "pushFiles", "POST", "branches_files", false),
727
+ // Commits & diffs
728
+ entry("list_commits", "listCommits", "GET", "commits_diffs", true),
729
+ entry("get_commit", "getCommit", "GET", "commits_diffs", true, true),
730
+ entry("compare_commits", "compareCommits", "GET", "commits_diffs", true, true),
731
+ // Milestones
732
+ entry("list_milestones", "listMilestones", "GET", "milestones", true, true),
733
+ entry("create_milestone", "createMilestone", "POST", "milestones", true, true),
734
+ entry("update_milestone", "updateMilestone", "PATCH", "milestones", true, true),
735
+ entry("delete_milestone", "deleteMilestone", "DELETE", "milestones", false, true),
736
+ // Status & checks
737
+ entry("create_commit_status", "createCommitStatus", "POST", "status_checks", true, true),
738
+ entry("get_combined_status_for_ref", "getCombinedStatusForRef", "GET", "status_checks", true, true),
739
+ entry("create_check_run", "createCheckRun", "POST", "status_checks", true, true),
740
+ entry("list_check_runs_for_ref", "listCheckRunsForRef", "GET", "status_checks", true, true),
741
+ // Tags & releases
742
+ entry("list_tags", "listTags", "GET", "tags_releases", true, true),
743
+ entry("list_releases", "listReleases", "GET", "tags_releases", true, true),
744
+ entry("get_latest_release", "getLatestRelease", "GET", "tags_releases", true, true),
745
+ entry("create_release", "createRelease", "POST", "tags_releases", false, true),
746
+ // Labels
747
+ entry("create_label", "createLabel", "POST", "labels", false),
748
+ entry("add_issue_labels", "addIssueLabels", "POST", "labels", false),
749
+ entry("remove_issue_label", "removeIssueLabel", "DELETE", "labels", false),
750
+ // Collaborators & identity
751
+ entry("list_collaborators", "listCollaborators", "GET", "collaborators", true),
752
+ entry("get_me", "getMe", "GET", "collaborators", true, true),
753
+ entry("add_collaborator", "addCollaborator", "PUT", "collaborators", false, true)
754
+ ];
755
+ function groupGitHubAccessControlByCategory(endpoints = ENDPOINTS) {
756
+ const byCategory = /* @__PURE__ */ new Map();
757
+ for (const category of GITHUB_ACCESS_CONTROL_CATEGORY_ORDER) {
758
+ byCategory.set(category, []);
759
+ }
760
+ for (const endpoint of endpoints) {
761
+ byCategory.get(endpoint.category).push(endpoint);
762
+ }
763
+ return GITHUB_ACCESS_CONTROL_CATEGORY_ORDER.map((category) => ({
764
+ category,
765
+ label: GITHUB_ACCESS_CONTROL_CATEGORY_LABELS[category],
766
+ endpoints: byCategory.get(category)
767
+ })).filter((group) => group.endpoints.length > 0);
768
+ }
769
+ var GITHUB_ACCESS_CONTROL_CATALOG = {
770
+ version: 2,
771
+ twin: "github",
772
+ endpoints: ENDPOINTS,
773
+ categories: groupGitHubAccessControlByCategory(ENDPOINTS)
774
+ };
775
+ function summarizeGitHubAccessControlCatalog(catalog = GITHUB_ACCESS_CONTROL_CATALOG, allowedOverrides) {
776
+ let allowed = 0;
777
+ let denied = 0;
778
+ for (const endpoint of catalog.endpoints) {
779
+ const isAllowed = endpoint.default_allowed;
780
+ if (isAllowed)
781
+ allowed += 1;
782
+ else
783
+ denied += 1;
784
+ }
785
+ return { total: catalog.endpoints.length, allowed, denied };
786
+ }
787
+ function githubAccessControlToolNames(catalog = GITHUB_ACCESS_CONTROL_CATALOG) {
788
+ return catalog.endpoints.map((endpoint) => endpoint.tool);
789
+ }
790
+ function assertAccessControlCatalogMatchesTools() {
791
+ const toolNames = new Set(toolDefinitions.map((tool) => tool.name));
792
+ const missing = githubAccessControlToolNames().filter((name) => !toolNames.has(name));
793
+ if (missing.length > 0) {
794
+ throw new Error(`access-control catalog references unknown tools: ${missing.join(", ")}`);
795
+ }
796
+ }
797
+ function githubAccessControlPayload() {
798
+ assertAccessControlCatalogMatchesTools();
799
+ return {
800
+ ...GITHUB_ACCESS_CONTROL_CATALOG,
801
+ summary: summarizeGitHubAccessControlCatalog()
802
+ };
803
+ }
804
+
805
+ // ../packages/twin-github/dist/src/db.js
806
+ var MIGRATION_SQL = `
807
+ CREATE TABLE IF NOT EXISTS users (
808
+ login TEXT PRIMARY KEY,
809
+ type TEXT NOT NULL DEFAULT 'User',
810
+ name TEXT NOT NULL DEFAULT '',
811
+ created_at TEXT NOT NULL
812
+ );
813
+
814
+ CREATE TABLE IF NOT EXISTS repositories (
815
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
816
+ owner TEXT NOT NULL,
817
+ name TEXT NOT NULL,
818
+ full_name TEXT NOT NULL UNIQUE,
819
+ description TEXT NOT NULL DEFAULT '',
820
+ private INTEGER NOT NULL DEFAULT 0,
821
+ default_branch TEXT NOT NULL DEFAULT 'main',
822
+ fork INTEGER NOT NULL DEFAULT 0,
823
+ parent_full_name TEXT,
824
+ entity_counter INTEGER NOT NULL DEFAULT 0,
825
+ created_at TEXT NOT NULL,
826
+ updated_at TEXT NOT NULL
827
+ );
828
+
829
+ CREATE TABLE IF NOT EXISTS collaborators (
830
+ repo_id INTEGER NOT NULL,
831
+ login TEXT NOT NULL,
832
+ permission TEXT NOT NULL DEFAULT 'push',
833
+ PRIMARY KEY (repo_id, login),
834
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
835
+ );
836
+
837
+ CREATE TABLE IF NOT EXISTS branches (
838
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
839
+ repo_id INTEGER NOT NULL,
840
+ name TEXT NOT NULL,
841
+ head_sha TEXT,
842
+ created_at TEXT NOT NULL,
843
+ updated_at TEXT NOT NULL,
844
+ UNIQUE (repo_id, name),
845
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
846
+ );
847
+
848
+ CREATE TABLE IF NOT EXISTS commits (
849
+ sha TEXT PRIMARY KEY,
850
+ repo_id INTEGER NOT NULL,
851
+ message TEXT NOT NULL,
852
+ author_login TEXT NOT NULL,
853
+ committer_login TEXT NOT NULL,
854
+ parent_sha TEXT,
855
+ tree_sha TEXT NOT NULL,
856
+ created_at TEXT NOT NULL,
857
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
858
+ );
859
+
860
+ CREATE TABLE IF NOT EXISTS files (
861
+ repo_id INTEGER NOT NULL,
862
+ branch TEXT NOT NULL,
863
+ path TEXT NOT NULL,
864
+ content TEXT NOT NULL,
865
+ sha TEXT NOT NULL,
866
+ size INTEGER NOT NULL,
867
+ updated_at TEXT NOT NULL,
868
+ PRIMARY KEY (repo_id, branch, path),
869
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
870
+ );
871
+
872
+ CREATE TABLE IF NOT EXISTS file_versions (
873
+ commit_sha TEXT NOT NULL,
874
+ repo_id INTEGER NOT NULL,
875
+ path TEXT NOT NULL,
876
+ content TEXT NOT NULL,
877
+ sha TEXT NOT NULL,
878
+ status TEXT NOT NULL,
879
+ PRIMARY KEY (commit_sha, path),
880
+ FOREIGN KEY (commit_sha) REFERENCES commits(sha) ON DELETE CASCADE,
881
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
882
+ );
883
+
884
+ CREATE TABLE IF NOT EXISTS labels (
885
+ repo_id INTEGER NOT NULL,
886
+ name TEXT NOT NULL,
887
+ color TEXT NOT NULL,
888
+ description TEXT NOT NULL DEFAULT '',
889
+ PRIMARY KEY (repo_id, name),
890
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
891
+ );
892
+
893
+ CREATE TABLE IF NOT EXISTS milestones (
894
+ repo_id INTEGER NOT NULL,
895
+ number INTEGER NOT NULL,
896
+ title TEXT NOT NULL,
897
+ state TEXT NOT NULL DEFAULT 'open',
898
+ description TEXT NOT NULL DEFAULT '',
899
+ due_on TEXT,
900
+ creator_login TEXT NOT NULL DEFAULT 'pome-agent',
901
+ created_at TEXT NOT NULL DEFAULT '',
902
+ updated_at TEXT NOT NULL DEFAULT '',
903
+ closed_at TEXT,
904
+ PRIMARY KEY (repo_id, number),
905
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
906
+ );
907
+
908
+ CREATE TABLE IF NOT EXISTS tags (
909
+ repo_id INTEGER NOT NULL,
910
+ name TEXT NOT NULL,
911
+ commit_sha TEXT NOT NULL,
912
+ created_at TEXT NOT NULL,
913
+ PRIMARY KEY (repo_id, name),
914
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
915
+ );
916
+
917
+ CREATE TABLE IF NOT EXISTS releases (
918
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
919
+ repo_id INTEGER NOT NULL,
920
+ tag_name TEXT NOT NULL,
921
+ target_commitish TEXT NOT NULL DEFAULT 'main',
922
+ name TEXT,
923
+ body TEXT NOT NULL DEFAULT '',
924
+ draft INTEGER NOT NULL DEFAULT 0,
925
+ prerelease INTEGER NOT NULL DEFAULT 0,
926
+ author_login TEXT NOT NULL DEFAULT 'pome-agent',
927
+ created_at TEXT NOT NULL,
928
+ published_at TEXT,
929
+ UNIQUE (repo_id, tag_name),
930
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
931
+ );
932
+
933
+ CREATE TABLE IF NOT EXISTS check_runs (
934
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
935
+ repo_id INTEGER NOT NULL,
936
+ head_sha TEXT NOT NULL,
937
+ name TEXT NOT NULL,
938
+ status TEXT NOT NULL DEFAULT 'queued',
939
+ conclusion TEXT,
940
+ details_url TEXT NOT NULL DEFAULT '',
941
+ external_id TEXT NOT NULL DEFAULT '',
942
+ output_title TEXT,
943
+ output_summary TEXT,
944
+ started_at TEXT NOT NULL,
945
+ completed_at TEXT,
946
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
947
+ );
948
+
949
+ CREATE TABLE IF NOT EXISTS issues (
950
+ repo_id INTEGER NOT NULL,
951
+ number INTEGER NOT NULL,
952
+ title TEXT NOT NULL,
953
+ body TEXT NOT NULL DEFAULT '',
954
+ state TEXT NOT NULL DEFAULT 'open',
955
+ user_login TEXT NOT NULL DEFAULT 'pome-agent',
956
+ assignee_login TEXT,
957
+ created_at TEXT NOT NULL,
958
+ updated_at TEXT NOT NULL,
959
+ closed_at TEXT,
960
+ PRIMARY KEY (repo_id, number),
961
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
962
+ );
963
+
964
+ CREATE TABLE IF NOT EXISTS issue_assignees (
965
+ repo_id INTEGER NOT NULL,
966
+ issue_number INTEGER NOT NULL,
967
+ login TEXT NOT NULL,
968
+ PRIMARY KEY (repo_id, issue_number, login),
969
+ FOREIGN KEY (repo_id, issue_number) REFERENCES issues(repo_id, number) ON UPDATE CASCADE ON DELETE CASCADE
970
+ );
971
+
972
+ CREATE TABLE IF NOT EXISTS issue_labels (
973
+ repo_id INTEGER NOT NULL,
974
+ issue_number INTEGER NOT NULL,
975
+ label_name TEXT NOT NULL,
976
+ PRIMARY KEY (repo_id, issue_number, label_name),
977
+ FOREIGN KEY (repo_id, issue_number) REFERENCES issues(repo_id, number) ON UPDATE CASCADE ON DELETE CASCADE,
978
+ FOREIGN KEY (repo_id, label_name) REFERENCES labels(repo_id, name) ON DELETE CASCADE
979
+ );
980
+
981
+ -- issue_number names an issue OR a pull request, so no FK to issues \u2014 see
982
+ -- ensureCommentsAllowPullRequests below (F-1151).
983
+ CREATE TABLE IF NOT EXISTS issue_comments (
984
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
985
+ repo_id INTEGER NOT NULL,
986
+ issue_number INTEGER NOT NULL,
987
+ body TEXT NOT NULL,
988
+ user_login TEXT NOT NULL,
989
+ created_at TEXT NOT NULL,
990
+ updated_at TEXT NOT NULL,
991
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
992
+ );
993
+
994
+ CREATE TABLE IF NOT EXISTS pull_requests (
995
+ repo_id INTEGER NOT NULL,
996
+ number INTEGER NOT NULL,
997
+ title TEXT NOT NULL,
998
+ body TEXT NOT NULL DEFAULT '',
999
+ state TEXT NOT NULL DEFAULT 'open',
1000
+ user_login TEXT NOT NULL DEFAULT 'pome-agent',
1001
+ head_repo_id INTEGER NOT NULL,
1002
+ head_ref TEXT NOT NULL,
1003
+ head_sha TEXT,
1004
+ base_repo_id INTEGER NOT NULL,
1005
+ base_ref TEXT NOT NULL,
1006
+ base_sha TEXT,
1007
+ merged INTEGER NOT NULL DEFAULT 0,
1008
+ merge_commit_sha TEXT,
1009
+ created_at TEXT NOT NULL,
1010
+ updated_at TEXT NOT NULL,
1011
+ closed_at TEXT,
1012
+ merged_at TEXT,
1013
+ PRIMARY KEY (repo_id, number),
1014
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE,
1015
+ FOREIGN KEY (head_repo_id) REFERENCES repositories(id) ON DELETE CASCADE,
1016
+ FOREIGN KEY (base_repo_id) REFERENCES repositories(id) ON DELETE CASCADE
1017
+ );
1018
+
1019
+ CREATE TABLE IF NOT EXISTS pull_request_files (
1020
+ repo_id INTEGER NOT NULL,
1021
+ pull_number INTEGER NOT NULL,
1022
+ filename TEXT NOT NULL,
1023
+ status TEXT NOT NULL,
1024
+ additions INTEGER NOT NULL DEFAULT 0,
1025
+ deletions INTEGER NOT NULL DEFAULT 0,
1026
+ changes INTEGER NOT NULL DEFAULT 0,
1027
+ blob_url TEXT NOT NULL DEFAULT '',
1028
+ raw_url TEXT NOT NULL DEFAULT '',
1029
+ contents_url TEXT NOT NULL DEFAULT '',
1030
+ patch TEXT NOT NULL DEFAULT '',
1031
+ PRIMARY KEY (repo_id, pull_number, filename),
1032
+ FOREIGN KEY (repo_id, pull_number) REFERENCES pull_requests(repo_id, number) ON DELETE CASCADE
1033
+ );
1034
+
1035
+ CREATE TABLE IF NOT EXISTS pull_request_reviews (
1036
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
1037
+ repo_id INTEGER NOT NULL,
1038
+ pull_number INTEGER NOT NULL,
1039
+ user_login TEXT NOT NULL,
1040
+ state TEXT NOT NULL,
1041
+ body TEXT NOT NULL DEFAULT '',
1042
+ commit_sha TEXT,
1043
+ submitted_at TEXT NOT NULL,
1044
+ FOREIGN KEY (repo_id, pull_number) REFERENCES pull_requests(repo_id, number) ON DELETE CASCADE
1045
+ );
1046
+
1047
+ CREATE TABLE IF NOT EXISTS pull_request_review_comments (
1048
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
1049
+ repo_id INTEGER NOT NULL,
1050
+ pull_number INTEGER NOT NULL,
1051
+ path TEXT NOT NULL,
1052
+ body TEXT NOT NULL,
1053
+ user_login TEXT NOT NULL,
1054
+ created_at TEXT NOT NULL,
1055
+ updated_at TEXT NOT NULL,
1056
+ FOREIGN KEY (repo_id, pull_number) REFERENCES pull_requests(repo_id, number) ON DELETE CASCADE
1057
+ );
1058
+
1059
+ CREATE TABLE IF NOT EXISTS commit_statuses (
1060
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
1061
+ repo_id INTEGER NOT NULL,
1062
+ sha TEXT NOT NULL,
1063
+ state TEXT NOT NULL,
1064
+ context TEXT NOT NULL,
1065
+ description TEXT NOT NULL DEFAULT '',
1066
+ target_url TEXT NOT NULL DEFAULT '',
1067
+ created_at TEXT NOT NULL,
1068
+ updated_at TEXT NOT NULL,
1069
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
1070
+ );
1071
+
1072
+ CREATE TABLE IF NOT EXISTS audit_log (
1073
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
1074
+ ts TEXT NOT NULL,
1075
+ action TEXT NOT NULL,
1076
+ repo_full_name TEXT,
1077
+ payload_json TEXT NOT NULL
1078
+ );
1079
+ `;
1080
+ var RESET_SQL = `
1081
+ DELETE FROM audit_log;
1082
+ DELETE FROM check_runs;
1083
+ DELETE FROM commit_statuses;
1084
+ DELETE FROM pull_request_review_comments;
1085
+ DELETE FROM pull_request_reviews;
1086
+ DELETE FROM pull_request_files;
1087
+ DELETE FROM pull_requests;
1088
+ DELETE FROM releases;
1089
+ DELETE FROM tags;
1090
+ DELETE FROM issue_comments;
1091
+ DELETE FROM issue_labels;
1092
+ DELETE FROM issue_assignees;
1093
+ DELETE FROM issues;
1094
+ DELETE FROM milestones;
1095
+ DELETE FROM labels;
1096
+ DELETE FROM file_versions;
1097
+ DELETE FROM files;
1098
+ DELETE FROM commits;
1099
+ DELETE FROM branches;
1100
+ DELETE FROM collaborators;
1101
+ DELETE FROM repositories;
1102
+ DELETE FROM users;
1103
+ `;
1104
+ function openGitHubCloneDatabase(path = process.env.GITHUB_CLONE_DB ?? ":memory:") {
1105
+ return openTwinDatabase(path, { migrate });
1106
+ }
1107
+ function migrate(db) {
1108
+ db.exec(MIGRATION_SQL);
1109
+ ensureColumn(db, "repositories", "entity_counter", "INTEGER NOT NULL DEFAULT 0");
1110
+ ensureColumn(db, "pull_requests", "head_sha", "TEXT");
1111
+ ensureColumn(db, "pull_requests", "base_sha", "TEXT");
1112
+ ensureColumn(db, "milestones", "description", "TEXT NOT NULL DEFAULT ''");
1113
+ ensureColumn(db, "milestones", "due_on", "TEXT");
1114
+ ensureColumn(db, "milestones", "creator_login", "TEXT NOT NULL DEFAULT 'pome-agent'");
1115
+ ensureColumn(db, "milestones", "created_at", "TEXT NOT NULL DEFAULT ''");
1116
+ ensureColumn(db, "milestones", "updated_at", "TEXT NOT NULL DEFAULT ''");
1117
+ ensureColumn(db, "milestones", "closed_at", "TEXT");
1118
+ ensureColumn(db, "pull_request_review_comments", "line", "INTEGER");
1119
+ ensureColumn(db, "pull_request_review_comments", "side", "TEXT");
1120
+ ensureColumn(db, "pull_request_review_comments", "commit_sha", "TEXT");
1121
+ ensureColumn(db, "pull_request_review_comments", "in_reply_to_id", "INTEGER");
1122
+ ensureColumn(db, "collaborators", "invitation_state", "TEXT NOT NULL DEFAULT 'accepted'");
1123
+ ensureIssueNumberCascade(db);
1124
+ ensureCommentsAllowPullRequests(db);
1125
+ hydrateDerivedColumns(db);
1126
+ }
1127
+ function resetDatabase(db) {
1128
+ db.exec(RESET_SQL);
1129
+ }
1130
+ function ensureColumn(db, table, column, definition) {
1131
+ const columns = db.prepare(`PRAGMA table_info(${table})`).all();
1132
+ if (!columns.some((row) => row.name === column)) {
1133
+ db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
1134
+ }
1135
+ }
1136
+ function ensureIssueNumberCascade(db) {
1137
+ const tables = ["issue_assignees", "issue_labels"];
1138
+ const needsRebuild = tables.some((table) => {
1139
+ const foreignKeys = db.prepare(`PRAGMA foreign_key_list(${table})`).all();
1140
+ return foreignKeys.some((key) => key.table === "issues" && key.on_update !== "CASCADE");
1141
+ });
1142
+ if (!needsRebuild)
1143
+ return;
1144
+ db.pragma("foreign_keys = OFF");
1145
+ db.exec(`
1146
+ ALTER TABLE issue_assignees RENAME TO issue_assignees_old;
1147
+ CREATE TABLE issue_assignees (
1148
+ repo_id INTEGER NOT NULL,
1149
+ issue_number INTEGER NOT NULL,
1150
+ login TEXT NOT NULL,
1151
+ PRIMARY KEY (repo_id, issue_number, login),
1152
+ FOREIGN KEY (repo_id, issue_number) REFERENCES issues(repo_id, number) ON UPDATE CASCADE ON DELETE CASCADE
1153
+ );
1154
+ INSERT INTO issue_assignees (repo_id, issue_number, login)
1155
+ SELECT repo_id, issue_number, login FROM issue_assignees_old;
1156
+ DROP TABLE issue_assignees_old;
1157
+
1158
+ ALTER TABLE issue_labels RENAME TO issue_labels_old;
1159
+ CREATE TABLE issue_labels (
1160
+ repo_id INTEGER NOT NULL,
1161
+ issue_number INTEGER NOT NULL,
1162
+ label_name TEXT NOT NULL,
1163
+ PRIMARY KEY (repo_id, issue_number, label_name),
1164
+ FOREIGN KEY (repo_id, issue_number) REFERENCES issues(repo_id, number) ON UPDATE CASCADE ON DELETE CASCADE,
1165
+ FOREIGN KEY (repo_id, label_name) REFERENCES labels(repo_id, name) ON DELETE CASCADE
1166
+ );
1167
+ INSERT INTO issue_labels (repo_id, issue_number, label_name)
1168
+ SELECT repo_id, issue_number, label_name FROM issue_labels_old;
1169
+ DROP TABLE issue_labels_old;
1170
+ `);
1171
+ db.pragma("foreign_keys = ON");
1172
+ }
1173
+ function ensureCommentsAllowPullRequests(db) {
1174
+ const foreignKeys = db.prepare("PRAGMA foreign_key_list(issue_comments)").all();
1175
+ if (!foreignKeys.some((key) => key.table === "issues"))
1176
+ return;
1177
+ db.pragma("foreign_keys = OFF");
1178
+ db.exec(`
1179
+ ALTER TABLE issue_comments RENAME TO issue_comments_old;
1180
+ CREATE TABLE issue_comments (
1181
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
1182
+ repo_id INTEGER NOT NULL,
1183
+ issue_number INTEGER NOT NULL,
1184
+ body TEXT NOT NULL,
1185
+ user_login TEXT NOT NULL,
1186
+ created_at TEXT NOT NULL,
1187
+ updated_at TEXT NOT NULL,
1188
+ FOREIGN KEY (repo_id) REFERENCES repositories(id) ON DELETE CASCADE
1189
+ );
1190
+ INSERT INTO issue_comments (id, repo_id, issue_number, body, user_login, created_at, updated_at)
1191
+ SELECT id, repo_id, issue_number, body, user_login, created_at, updated_at FROM issue_comments_old;
1192
+ DROP TABLE issue_comments_old;
1193
+ `);
1194
+ db.pragma("foreign_keys = ON");
1195
+ }
1196
+ function hydrateDerivedColumns(db) {
1197
+ db.exec(`
1198
+ UPDATE repositories
1199
+ SET entity_counter = MAX(
1200
+ entity_counter,
1201
+ COALESCE((SELECT MAX(number) FROM issues WHERE issues.repo_id = repositories.id), 0),
1202
+ COALESCE((SELECT MAX(number) FROM pull_requests WHERE pull_requests.repo_id = repositories.id), 0)
1203
+ );
1204
+
1205
+ UPDATE pull_requests
1206
+ SET
1207
+ head_sha = COALESCE(head_sha, (SELECT head_sha FROM branches WHERE branches.repo_id = pull_requests.head_repo_id AND branches.name = pull_requests.head_ref)),
1208
+ base_sha = COALESCE(base_sha, (SELECT head_sha FROM branches WHERE branches.repo_id = pull_requests.base_repo_id AND branches.name = pull_requests.base_ref));
1209
+ `);
1210
+ }
1211
+ function nowIso() {
1212
+ return (/* @__PURE__ */ new Date()).toISOString();
1213
+ }
1214
+ function stableNumericId(input) {
1215
+ let hash = 0;
1216
+ for (const char of input) {
1217
+ hash = hash * 31 + char.charCodeAt(0) >>> 0;
1218
+ }
1219
+ return hash;
1220
+ }
1221
+ function makeSha(...parts) {
1222
+ return createHash("sha1").update(JSON.stringify(parts)).update(randomUUID()).digest("hex");
1223
+ }
1224
+ function fileSha(content) {
1225
+ return createHash("sha1").update(`blob ${Buffer.byteLength(content)}\0${content}`).digest("hex");
1226
+ }
1227
+ function treeSha(paths) {
1228
+ return createHash("sha1").update(paths.sort().join("\n")).digest("hex");
1229
+ }
1230
+ function encodeContent(content) {
1231
+ return Buffer.from(content, "utf8").toString("base64");
1232
+ }
1233
+ function paginate(items, page = 1, perPage = 30) {
1234
+ const safePage = Math.max(1, page);
1235
+ const safePerPage = Math.min(100, Math.max(1, perPage));
1236
+ const start = (safePage - 1) * safePerPage;
1237
+ return items.slice(start, start + safePerPage);
1238
+ }
1239
+ function linesChanged(before, after) {
1240
+ if (before === void 0) {
1241
+ return { additions: after.split("\n").filter(Boolean).length || 1, deletions: 0 };
1242
+ }
1243
+ const oldLines = before.split("\n");
1244
+ const newLines = after.split("\n");
1245
+ let additions = 0;
1246
+ let deletions = 0;
1247
+ const max = Math.max(oldLines.length, newLines.length);
1248
+ for (let index = 0; index < max; index += 1) {
1249
+ if (oldLines[index] === newLines[index])
1250
+ continue;
1251
+ if (newLines[index] !== void 0)
1252
+ additions += 1;
1253
+ if (oldLines[index] !== void 0)
1254
+ deletions += 1;
1255
+ }
1256
+ return { additions, deletions };
1257
+ }
1258
+ var seedSchema = z.object({
1259
+ users: z.array(z.object({
1260
+ login: z.string().min(1),
1261
+ type: z.enum(["User", "Organization"]).default("User"),
1262
+ name: z.string().default("")
1263
+ })).default([]),
1264
+ repositories: z.array(z.object({
1265
+ owner: z.string().min(1),
1266
+ name: z.string().min(1),
1267
+ description: z.string().default(""),
1268
+ private: z.boolean().default(false),
1269
+ default_branch: z.string().min(1).default("main"),
1270
+ collaborators: z.array(z.string().min(1)).default([]),
1271
+ labels: z.array(z.object({
1272
+ name: z.string().min(1),
1273
+ color: z.string().default("ededed"),
1274
+ description: z.string().default("")
1275
+ })).default([]),
1276
+ files: z.array(z.object({ path: z.string().min(1), content: z.string(), branch: z.string().optional() })).default([]),
1277
+ issues: z.array(z.object({
1278
+ number: z.number().int().positive().optional(),
1279
+ title: z.string().min(1),
1280
+ body: z.string().default(""),
1281
+ state: z.enum(["open", "closed"]).default("open"),
1282
+ labels: z.array(z.string().min(1)).default([]),
1283
+ assignees: z.array(z.string().min(1)).default([])
1284
+ })).default([]),
1285
+ pull_requests: z.array(z.object({
1286
+ number: z.number().int().positive().optional(),
1287
+ title: z.string().min(1),
1288
+ body: z.string().default(""),
1289
+ head: z.string().min(1),
1290
+ base: z.string().min(1).default("main"),
1291
+ state: z.enum(["open", "closed"]).default("open"),
1292
+ author: z.string().min(1).optional(),
1293
+ // Reviews seeded on this PR. `state` mirrors GitHub's review
1294
+ // state enum; `author` must exist in the user/collaborator set.
1295
+ reviews: z.array(z.object({
1296
+ author: z.string().min(1),
1297
+ state: z.enum(["APPROVED", "CHANGES_REQUESTED", "COMMENTED"]).default("APPROVED"),
1298
+ body: z.string().default("")
1299
+ })).default([]),
1300
+ // Commit statuses applied to this PR's head SHA. Wired into the
1301
+ // commit_statuses table so get_pull_request_status and the merge
1302
+ // path see them without needing a separate setup call.
1303
+ statuses: z.array(z.object({
1304
+ context: z.string().min(1).default("ci/build"),
1305
+ state: z.enum(["error", "failure", "pending", "success"]).default("success"),
1306
+ description: z.string().default("")
1307
+ })).default([])
1308
+ })).default([])
1309
+ }))
1310
+ });
1311
+ function parseSeed(input) {
1312
+ const seed = seedSchema.parse(normalizeLegacyGitHubSeed(input));
1313
+ if (seed.repositories.length === 0) {
1314
+ throw new Error("GitHub seed must contain at least one repository");
1315
+ }
1316
+ return seed;
1317
+ }
1318
+ function normalizeLegacyGitHubSeed(input) {
1319
+ if (!input || typeof input !== "object" || Array.isArray(input))
1320
+ return input;
1321
+ const seed = input;
1322
+ if (!Array.isArray(seed.repositories))
1323
+ return input;
1324
+ return {
1325
+ ...seed,
1326
+ repositories: seed.repositories.map((repo) => {
1327
+ if (!repo || typeof repo !== "object" || Array.isArray(repo))
1328
+ return repo;
1329
+ const record = repo;
1330
+ if (!Array.isArray(record.issues))
1331
+ return repo;
1332
+ return {
1333
+ ...record,
1334
+ issues: record.issues.map((issue) => normalizeLegacyIssueAssignee(issue))
1335
+ };
1336
+ })
1337
+ };
1338
+ }
1339
+ function normalizeLegacyIssueAssignee(issue) {
1340
+ if (!issue || typeof issue !== "object" || Array.isArray(issue))
1341
+ return issue;
1342
+ const record = issue;
1343
+ if (!("assignee" in record) || "assignees" in record)
1344
+ return issue;
1345
+ const { assignee, ...rest } = record;
1346
+ if (assignee === null || assignee === void 0 || assignee === "") {
1347
+ return { ...rest, assignees: [] };
1348
+ }
1349
+ if (typeof assignee === "string") {
1350
+ return { ...rest, assignees: [assignee] };
1351
+ }
1352
+ return issue;
1353
+ }
1354
+ function defaultSeedState() {
1355
+ return {
1356
+ users: [
1357
+ { login: "acme", type: "Organization", name: "Acme" },
1358
+ { login: "alice", type: "User", name: "Alice" },
1359
+ { login: "bob", type: "User", name: "Bob" },
1360
+ { login: "pome-agent", type: "User", name: "Pome Agent" }
1361
+ ],
1362
+ repositories: [
1363
+ {
1364
+ owner: "acme",
1365
+ name: "api",
1366
+ description: "Example API service used by GitHub twin tests.",
1367
+ default_branch: "main",
1368
+ collaborators: ["alice", "bob", "pome-agent"],
1369
+ labels: [
1370
+ { name: "bug", color: "d73a4a", description: "Something is not working" },
1371
+ { name: "feature", color: "a2eeef", description: "New feature or request" },
1372
+ { name: "question", color: "d876e3", description: "More information needed" }
1373
+ ],
1374
+ files: [
1375
+ { path: "README.md", content: "# Acme API\n\nA seeded repository for local GitHub twin tests.\n" },
1376
+ { path: "src/index.ts", content: "export function handler() {\n return 'ok';\n}\n" }
1377
+ ],
1378
+ issues: [
1379
+ {
1380
+ number: 1,
1381
+ title: "500 error on POST /orders after deploy",
1382
+ body: "Started failing right after the 14:00 deploy. Stack trace points to OrderController#create.",
1383
+ labels: ["bug"],
1384
+ assignees: []
1385
+ }
1386
+ ]
1387
+ }
1388
+ ]
1389
+ };
1390
+ }
1391
+
1392
+ // ../packages/twin-github/dist/src/serializers.js
1393
+ function repoState(repo) {
1394
+ return {
1395
+ owner: repo.owner,
1396
+ name: repo.name,
1397
+ full_name: repo.full_name,
1398
+ description: repo.description,
1399
+ private: Boolean(repo.private),
1400
+ default_branch: repo.default_branch,
1401
+ fork: Boolean(repo.fork),
1402
+ parent_full_name: repo.parent_full_name,
1403
+ created_at: repo.created_at,
1404
+ updated_at: repo.updated_at
1405
+ };
1406
+ }
1407
+ function branchState(branch, repo) {
1408
+ return {
1409
+ repo: repo.full_name,
1410
+ name: branch.name,
1411
+ head_sha: branch.head_sha,
1412
+ created_at: branch.created_at,
1413
+ updated_at: branch.updated_at
1414
+ };
1415
+ }
1416
+ function fileState(file, repo) {
1417
+ return {
1418
+ repo: repo.full_name,
1419
+ branch: file.branch,
1420
+ path: file.path,
1421
+ content: file.content,
1422
+ sha: file.sha,
1423
+ size: file.size,
1424
+ updated_at: file.updated_at
1425
+ };
1426
+ }
1427
+ function issueState(issue, repo, labels, assignees) {
1428
+ return {
1429
+ repo: repo.full_name,
1430
+ number: issue.number,
1431
+ title: issue.title,
1432
+ body: issue.body,
1433
+ state: issue.state,
1434
+ user_login: issue.user_login,
1435
+ assignee_login: issue.assignee_login,
1436
+ labels,
1437
+ assignees,
1438
+ created_at: issue.created_at,
1439
+ updated_at: issue.updated_at,
1440
+ closed_at: issue.closed_at
1441
+ };
1442
+ }
1443
+ function issueCommentState(comment, repo) {
1444
+ return {
1445
+ repo: repo.full_name,
1446
+ id: comment.id,
1447
+ issue_number: comment.issue_number,
1448
+ body: comment.body,
1449
+ user_login: comment.user_login,
1450
+ created_at: comment.created_at,
1451
+ updated_at: comment.updated_at
1452
+ };
1453
+ }
1454
+ function labelState(label, repo) {
1455
+ return {
1456
+ repo: repo.full_name,
1457
+ name: label.name,
1458
+ color: label.color,
1459
+ description: label.description
1460
+ };
1461
+ }
1462
+ function issueLabelsState(repo, issueNumber2, labels) {
1463
+ return { repo: repo.full_name, issue_number: issueNumber2, labels };
1464
+ }
1465
+ function issueAssigneesState(repo, issueNumber2, assignees) {
1466
+ return { repo: repo.full_name, issue_number: issueNumber2, assignees };
1467
+ }
1468
+ function pullRequestState(pr, repo) {
1469
+ return {
1470
+ repo: repo.full_name,
1471
+ number: pr.number,
1472
+ title: pr.title,
1473
+ body: pr.body,
1474
+ state: pr.state,
1475
+ user_login: pr.user_login,
1476
+ head_ref: pr.head_ref,
1477
+ head_sha: pr.head_sha,
1478
+ base_ref: pr.base_ref,
1479
+ base_sha: pr.base_sha,
1480
+ merged: Boolean(pr.merged),
1481
+ merge_commit_sha: pr.merge_commit_sha,
1482
+ created_at: pr.created_at,
1483
+ updated_at: pr.updated_at,
1484
+ closed_at: pr.closed_at,
1485
+ merged_at: pr.merged_at
1486
+ };
1487
+ }
1488
+ function pullRequestReviewState(review, repo) {
1489
+ return {
1490
+ repo: repo.full_name,
1491
+ pull_number: review.pull_number,
1492
+ id: review.id,
1493
+ user_login: review.user_login,
1494
+ state: review.state,
1495
+ body: review.body,
1496
+ commit_sha: review.commit_sha,
1497
+ submitted_at: review.submitted_at
1498
+ };
1499
+ }
1500
+ function userJson(login, type = "User") {
1501
+ return {
1502
+ login,
1503
+ id: stableNumericId(login),
1504
+ node_id: `U_${stableNumericId(login)}`,
1505
+ avatar_url: `https://avatars.githubusercontent.com/u/${stableNumericId(login)}?v=4`,
1506
+ html_url: `https://github.com/${login}`,
1507
+ type,
1508
+ site_admin: false
1509
+ };
1510
+ }
1511
+ function repoJson(repo) {
1512
+ const parentRef = repo.parent_full_name ? { parent: { full_name: repo.parent_full_name } } : {};
1513
+ return {
1514
+ id: repo.id,
1515
+ node_id: `R_${repo.id}`,
1516
+ name: repo.name,
1517
+ full_name: repo.full_name,
1518
+ owner: userJson(repo.owner, "Organization"),
1519
+ private: Boolean(repo.private),
1520
+ html_url: `https://github.com/${repo.full_name}`,
1521
+ description: repo.description,
1522
+ fork: Boolean(repo.fork),
1523
+ url: `https://api.github.com/repos/${repo.full_name}`,
1524
+ contents_url: `https://api.github.com/repos/${repo.full_name}/contents/{+path}`,
1525
+ issues_url: `https://api.github.com/repos/${repo.full_name}/issues{/number}`,
1526
+ pulls_url: `https://api.github.com/repos/${repo.full_name}/pulls{/number}`,
1527
+ default_branch: repo.default_branch,
1528
+ created_at: repo.created_at,
1529
+ updated_at: repo.updated_at,
1530
+ pushed_at: repo.updated_at,
1531
+ ...parentRef
1532
+ };
1533
+ }
1534
+ function branchJson(branch, repo) {
1535
+ return {
1536
+ name: branch.name,
1537
+ commit: {
1538
+ // Upstream `short-branch.commit.sha` is a non-null string; the twin emits
1539
+ // an empty string (rather than null) when head_sha is unresolved.
1540
+ sha: branch.head_sha ?? "",
1541
+ // Upstream `commit.url` is a required non-null string; the twin surfaces
1542
+ // null in the pre-resolution state (no commit seeded yet). Intentional
1543
+ // twin behavior — narrow the null away for the type anchor only
1544
+ // (FDRS-454: a faithful twin may surface a pre-resolution null), runtime
1545
+ // value unchanged.
1546
+ url: branch.head_sha ? `https://api.github.com/repos/${repo.full_name}/commits/${branch.head_sha}` : null
1547
+ },
1548
+ protected: false
1549
+ };
1550
+ }
1551
+ function commitJson(commit, repo) {
1552
+ return {
1553
+ sha: commit.sha,
1554
+ node_id: `C_${commit.sha}`,
1555
+ commit: {
1556
+ author: {
1557
+ name: commit.author_login,
1558
+ email: `${commit.author_login}@example.local`,
1559
+ date: commit.created_at
1560
+ },
1561
+ committer: {
1562
+ name: commit.committer_login,
1563
+ email: `${commit.committer_login}@example.local`,
1564
+ date: commit.created_at
1565
+ },
1566
+ message: commit.message,
1567
+ tree: {
1568
+ sha: commit.tree_sha,
1569
+ url: `https://api.github.com/repos/${repo.full_name}/git/trees/${commit.tree_sha}`
1570
+ },
1571
+ url: `https://api.github.com/repos/${repo.full_name}/git/commits/${commit.sha}`
1572
+ },
1573
+ url: `https://api.github.com/repos/${repo.full_name}/commits/${commit.sha}`,
1574
+ html_url: `https://github.com/${repo.full_name}/commit/${commit.sha}`,
1575
+ author: userJson(commit.author_login),
1576
+ committer: userJson(commit.committer_login),
1577
+ parents: commit.parent_sha ? [{ sha: commit.parent_sha, url: `https://api.github.com/repos/${repo.full_name}/commits/${commit.parent_sha}` }] : [],
1578
+ comments_url: `https://api.github.com/repos/${repo.full_name}/commits/${commit.sha}/comments`
1579
+ };
1580
+ }
1581
+ function contentFileJson(file, repo) {
1582
+ return {
1583
+ type: "file",
1584
+ encoding: "base64",
1585
+ size: file.size,
1586
+ name: file.path.split("/").at(-1) ?? file.path,
1587
+ path: file.path,
1588
+ content: encodeContent(file.content),
1589
+ sha: file.sha,
1590
+ url: `https://api.github.com/repos/${repo.full_name}/contents/${file.path}`,
1591
+ git_url: `https://api.github.com/repos/${repo.full_name}/git/blobs/${file.sha}`,
1592
+ html_url: `https://github.com/${repo.full_name}/blob/${file.branch}/${file.path}`,
1593
+ download_url: `https://raw.githubusercontent.com/${repo.full_name}/${file.branch}/${file.path}`,
1594
+ _links: {
1595
+ git: file.sha ? `https://api.github.com/repos/${repo.full_name}/git/blobs/${file.sha}` : null,
1596
+ html: `https://github.com/${repo.full_name}/blob/${file.branch}/${file.path}`,
1597
+ self: `https://api.github.com/repos/${repo.full_name}/contents/${file.path}`
1598
+ }
1599
+ };
1600
+ }
1601
+ function contentDirectoryEntryJson(path, repo, branch, file) {
1602
+ const name = path.split("/").filter(Boolean).at(-1) ?? path;
1603
+ const isFile = Boolean(file);
1604
+ return {
1605
+ type: isFile ? "file" : "dir",
1606
+ size: file?.size ?? 0,
1607
+ name,
1608
+ path,
1609
+ sha: file?.sha ?? `dir_${stableNumericId(`${repo.full_name}:${branch}:${path}`)}`,
1610
+ url: `https://api.github.com/repos/${repo.full_name}/contents/${path}`,
1611
+ // `git_url` is a hypermedia link relation (key ends in `_url`). On a directory
1612
+ // entry the twin has no git blob to point at; rather than emit `git_url: null`
1613
+ // (a string→null type-changed against real GitHub's blob URL on files), omit the
1614
+ // key entirely on directories so the field-removed direction is covered by the
1615
+ // categorical hypermedia exemption (FDRS-451) — a faithful twin returning a
1616
+ // SUBSET of GitHub's link relations, not drift (FDRS-454).
1617
+ ...isFile ? { git_url: `https://api.github.com/repos/${repo.full_name}/git/blobs/${file.sha}` } : {},
1618
+ html_url: `https://github.com/${repo.full_name}/${isFile ? "blob" : "tree"}/${branch}/${path}`,
1619
+ download_url: isFile ? `https://raw.githubusercontent.com/${repo.full_name}/${branch}/${path}` : null
1620
+ // `_links` is intentionally omitted — the categorical hypermedia subset
1621
+ // exemption (FDRS-451); DeepPartial makes it optional so omission is legal.
1622
+ // The upstream `content-directory` schema is an ARRAY of entries; this
1623
+ // serializer emits one entry, so it anchors against the element type.
1624
+ };
1625
+ }
1626
+ function labelJson(label) {
1627
+ return {
1628
+ id: stableNumericId(label.name),
1629
+ node_id: `LA_${stableNumericId(label.name)}`,
1630
+ url: `https://api.github.com/labels/${encodeURIComponent(label.name)}`,
1631
+ name: label.name,
1632
+ color: label.color,
1633
+ default: false,
1634
+ description: label.description
1635
+ };
1636
+ }
1637
+ function issueJson(issue, repo, labels = [], assignees = [], comments = 0) {
1638
+ return {
1639
+ id: stableNumericId(`${repo.full_name}#${issue.number}`),
1640
+ node_id: `I_${stableNumericId(`${repo.full_name}#${issue.number}`)}`,
1641
+ number: issue.number,
1642
+ title: issue.title,
1643
+ body: issue.body,
1644
+ state: issue.state,
1645
+ locked: false,
1646
+ user: userJson(issue.user_login),
1647
+ labels: labels.map(labelJson),
1648
+ assignee: issue.assignee_login ? userJson(issue.assignee_login) : null,
1649
+ assignees: assignees.map((login) => userJson(login)),
1650
+ comments,
1651
+ html_url: `https://github.com/${repo.full_name}/issues/${issue.number}`,
1652
+ repository_url: `https://api.github.com/repos/${repo.full_name}`,
1653
+ labels_url: `https://api.github.com/repos/${repo.full_name}/issues/${issue.number}/labels{/name}`,
1654
+ comments_url: `https://api.github.com/repos/${repo.full_name}/issues/${issue.number}/comments`,
1655
+ created_at: issue.created_at,
1656
+ updated_at: issue.updated_at,
1657
+ closed_at: issue.closed_at
1658
+ };
1659
+ }
1660
+ function issueCommentJson(comment, repo, target = "issue") {
1661
+ return {
1662
+ id: comment.id,
1663
+ node_id: `IC_${comment.id}`,
1664
+ body: comment.body,
1665
+ user: userJson(comment.user_login),
1666
+ html_url: `https://github.com/${repo.full_name}/${target === "pull_request" ? "pull" : "issues"}/${comment.issue_number}#issuecomment-${comment.id}`,
1667
+ issue_url: `https://api.github.com/repos/${repo.full_name}/issues/${comment.issue_number}`,
1668
+ created_at: comment.created_at,
1669
+ updated_at: comment.updated_at
1670
+ };
1671
+ }
1672
+ function pullRequestSimpleJson(pr, baseRepo, headRepo, headSha = null, baseSha = null) {
1673
+ return {
1674
+ id: stableNumericId(`${baseRepo.full_name}/pull/${pr.number}`),
1675
+ node_id: `PR_${stableNumericId(`${baseRepo.full_name}/pull/${pr.number}`)}`,
1676
+ number: pr.number,
1677
+ state: pr.state,
1678
+ locked: false,
1679
+ title: pr.title,
1680
+ body: pr.body,
1681
+ user: userJson(pr.user_login),
1682
+ html_url: `https://github.com/${baseRepo.full_name}/pull/${pr.number}`,
1683
+ url: `https://api.github.com/repos/${baseRepo.full_name}/pulls/${pr.number}`,
1684
+ issue_url: `https://api.github.com/repos/${baseRepo.full_name}/issues/${pr.number}`,
1685
+ commits_url: `https://api.github.com/repos/${baseRepo.full_name}/pulls/${pr.number}/commits`,
1686
+ review_comments_url: `https://api.github.com/repos/${baseRepo.full_name}/pulls/${pr.number}/comments`,
1687
+ review_comment_url: `https://api.github.com/repos/${baseRepo.full_name}/pulls/comments{/number}`,
1688
+ comments_url: `https://api.github.com/repos/${baseRepo.full_name}/issues/${pr.number}/comments`,
1689
+ statuses_url: `https://api.github.com/repos/${headRepo.full_name}/statuses/{sha}`,
1690
+ head: {
1691
+ label: `${headRepo.owner}:${pr.head_ref}`,
1692
+ ref: pr.head_ref,
1693
+ // Upstream merge-base `sha` is a non-null string; the twin emits null when
1694
+ // the head SHA is unresolved (no commits seeded yet). Intentional twin
1695
+ // behavior — narrow the null away for the type anchor only (FDRS-454:
1696
+ // faithful twin may surface a pre-resolution null), runtime value unchanged.
1697
+ sha: headSha,
1698
+ repo: repoJson(headRepo),
1699
+ user: userJson(headRepo.owner, "Organization")
1700
+ },
1701
+ base: {
1702
+ label: `${baseRepo.owner}:${pr.base_ref}`,
1703
+ ref: pr.base_ref,
1704
+ // See head.sha note above — same pre-resolution null exemption.
1705
+ sha: baseSha,
1706
+ repo: repoJson(baseRepo),
1707
+ user: userJson(baseRepo.owner, "Organization")
1708
+ },
1709
+ merge_commit_sha: pr.merge_commit_sha,
1710
+ draft: false,
1711
+ created_at: pr.created_at,
1712
+ updated_at: pr.updated_at,
1713
+ closed_at: pr.closed_at,
1714
+ merged_at: pr.merged_at
1715
+ };
1716
+ }
1717
+ function pullRequestListJson(pr, baseRepo, headRepo, headSha = null, baseSha = null) {
1718
+ return pullRequestSimpleJson(pr, baseRepo, headRepo, headSha, baseSha);
1719
+ }
1720
+ function pullRequestJson(pr, baseRepo, headRepo, commits = 1, changedFiles = 0, headSha = null, baseSha = null) {
1721
+ const simple = pullRequestSimpleJson(pr, baseRepo, headRepo, headSha, baseSha);
1722
+ return {
1723
+ ...simple,
1724
+ merged: Boolean(pr.merged),
1725
+ commits,
1726
+ additions: 0,
1727
+ deletions: 0,
1728
+ changed_files: changedFiles
1729
+ };
1730
+ }
1731
+ function pullRequestFileJson(file) {
1732
+ return {
1733
+ sha: `file_${stableNumericId(file.filename)}`,
1734
+ filename: file.filename,
1735
+ status: file.status,
1736
+ additions: file.additions,
1737
+ deletions: file.deletions,
1738
+ changes: file.changes,
1739
+ blob_url: file.blob_url,
1740
+ raw_url: file.raw_url,
1741
+ contents_url: file.contents_url,
1742
+ patch: file.patch
1743
+ };
1744
+ }
1745
+ function reviewJson(review, repo) {
1746
+ return {
1747
+ id: review.id,
1748
+ node_id: `PRR_${review.id}`,
1749
+ user: userJson(review.user_login),
1750
+ body: review.body,
1751
+ state: review.state,
1752
+ html_url: `https://github.com/${repo.full_name}/pull/${review.pull_number}#pullrequestreview-${review.id}`,
1753
+ pull_request_url: `https://api.github.com/repos/${repo.full_name}/pulls/${review.pull_number}`,
1754
+ commit_id: review.commit_sha,
1755
+ submitted_at: review.submitted_at
1756
+ };
1757
+ }
1758
+ function statusJson(status, repo) {
1759
+ return {
1760
+ id: status.id,
1761
+ node_id: `ST_${status.id}`,
1762
+ state: status.state,
1763
+ description: status.description,
1764
+ target_url: status.target_url,
1765
+ context: status.context,
1766
+ created_at: status.created_at,
1767
+ updated_at: status.updated_at,
1768
+ url: `https://api.github.com/repos/${repo.full_name}/statuses/${status.sha}`
1769
+ };
1770
+ }
1771
+ function combinedStatusJson(repo, sha, statuses) {
1772
+ const state = statuses.length === 0 ? "pending" : statuses.some((status) => status.state === "failure" || status.state === "error") ? "failure" : statuses.some((status) => status.state === "pending") ? "pending" : "success";
1773
+ return {
1774
+ state,
1775
+ sha,
1776
+ total_count: statuses.length,
1777
+ statuses: statuses.map((status) => statusJson(status, repo)),
1778
+ repository: repoJson(repo),
1779
+ commit_url: `https://api.github.com/repos/${repo.full_name}/commits/${sha}`,
1780
+ url: `https://api.github.com/repos/${repo.full_name}/commits/${sha}/status`
1781
+ };
1782
+ }
1783
+ function milestoneJson(milestone, repo, openIssues = 0, closedIssues = 0) {
1784
+ return {
1785
+ id: stableNumericId(`${repo.full_name}/milestone/${milestone.number}`),
1786
+ node_id: `MI_${stableNumericId(`${repo.full_name}/milestone/${milestone.number}`)}`,
1787
+ number: milestone.number,
1788
+ title: milestone.title,
1789
+ description: milestone.description,
1790
+ state: milestone.state,
1791
+ creator: userJson(milestone.creator_login),
1792
+ open_issues: openIssues,
1793
+ closed_issues: closedIssues,
1794
+ due_on: milestone.due_on,
1795
+ created_at: milestone.created_at,
1796
+ updated_at: milestone.updated_at,
1797
+ closed_at: milestone.closed_at,
1798
+ html_url: `https://github.com/${repo.full_name}/milestone/${milestone.number}`,
1799
+ url: `https://api.github.com/repos/${repo.full_name}/milestones/${milestone.number}`,
1800
+ labels_url: `https://api.github.com/repos/${repo.full_name}/milestones/${milestone.number}/labels`
1801
+ };
1802
+ }
1803
+ function milestoneState(milestone, repo) {
1804
+ return {
1805
+ repo: repo.full_name,
1806
+ number: milestone.number,
1807
+ title: milestone.title,
1808
+ description: milestone.description,
1809
+ state: milestone.state,
1810
+ due_on: milestone.due_on,
1811
+ creator_login: milestone.creator_login,
1812
+ created_at: milestone.created_at,
1813
+ updated_at: milestone.updated_at,
1814
+ closed_at: milestone.closed_at
1815
+ };
1816
+ }
1817
+ function tagJson(tag, repo) {
1818
+ return {
1819
+ name: tag.name,
1820
+ commit: {
1821
+ sha: tag.commit_sha,
1822
+ url: `https://api.github.com/repos/${repo.full_name}/commits/${tag.commit_sha}`
1823
+ },
1824
+ zipball_url: `https://api.github.com/repos/${repo.full_name}/zipball/refs/tags/${tag.name}`,
1825
+ tarball_url: `https://api.github.com/repos/${repo.full_name}/tarball/refs/tags/${tag.name}`,
1826
+ node_id: `T_${stableNumericId(`${repo.full_name}/tag/${tag.name}`)}`
1827
+ };
1828
+ }
1829
+ function releaseJson(release, repo) {
1830
+ return {
1831
+ id: release.id,
1832
+ node_id: `RE_${release.id}`,
1833
+ tag_name: release.tag_name,
1834
+ target_commitish: release.target_commitish,
1835
+ name: release.name,
1836
+ body: release.body,
1837
+ draft: Boolean(release.draft),
1838
+ prerelease: Boolean(release.prerelease),
1839
+ author: userJson(release.author_login),
1840
+ created_at: release.created_at,
1841
+ published_at: release.published_at,
1842
+ html_url: `https://github.com/${repo.full_name}/releases/tag/${release.tag_name}`,
1843
+ url: `https://api.github.com/repos/${repo.full_name}/releases/${release.id}`,
1844
+ assets_url: `https://api.github.com/repos/${repo.full_name}/releases/${release.id}/assets`,
1845
+ upload_url: `https://uploads.github.com/repos/${repo.full_name}/releases/${release.id}/assets{?name,label}`,
1846
+ tarball_url: `https://api.github.com/repos/${repo.full_name}/tarball/${release.tag_name}`,
1847
+ zipball_url: `https://api.github.com/repos/${repo.full_name}/zipball/${release.tag_name}`,
1848
+ assets: []
1849
+ };
1850
+ }
1851
+ function releaseState(release, repo) {
1852
+ return {
1853
+ repo: repo.full_name,
1854
+ id: release.id,
1855
+ tag_name: release.tag_name,
1856
+ target_commitish: release.target_commitish,
1857
+ name: release.name,
1858
+ body: release.body,
1859
+ draft: Boolean(release.draft),
1860
+ prerelease: Boolean(release.prerelease),
1861
+ author_login: release.author_login,
1862
+ created_at: release.created_at,
1863
+ published_at: release.published_at
1864
+ };
1865
+ }
1866
+ function checkRunJson(run, repo) {
1867
+ return {
1868
+ id: run.id,
1869
+ node_id: `CR_${run.id}`,
1870
+ head_sha: run.head_sha,
1871
+ external_id: run.external_id,
1872
+ url: `https://api.github.com/repos/${repo.full_name}/check-runs/${run.id}`,
1873
+ html_url: `https://github.com/${repo.full_name}/runs/${run.id}`,
1874
+ details_url: run.details_url,
1875
+ status: run.status,
1876
+ // The twin's `conclusion` column carries the full GitHub check-run
1877
+ // conclusion vocabulary including `"stale"`, but the pinned
1878
+ // @octokit/openapi-types version's `check-run.conclusion` enum predates
1879
+ // `"stale"`. The twin faithfully emits a real upstream value; narrow it to
1880
+ // the schema's declared union for the type anchor only (FDRS-454: twin
1881
+ // tracks live GitHub, not a lagging spec snapshot), runtime value unchanged.
1882
+ conclusion: run.conclusion,
1883
+ started_at: run.started_at,
1884
+ completed_at: run.completed_at,
1885
+ output: {
1886
+ title: run.output_title,
1887
+ summary: run.output_summary,
1888
+ text: null,
1889
+ annotations_count: 0,
1890
+ annotations_url: `https://api.github.com/repos/${repo.full_name}/check-runs/${run.id}/annotations`
1891
+ },
1892
+ name: run.name,
1893
+ check_suite: null,
1894
+ app: null,
1895
+ pull_requests: []
1896
+ };
1897
+ }
1898
+ function checkRunState(run, repo) {
1899
+ return {
1900
+ repo: repo.full_name,
1901
+ id: run.id,
1902
+ head_sha: run.head_sha,
1903
+ name: run.name,
1904
+ status: run.status,
1905
+ conclusion: run.conclusion,
1906
+ details_url: run.details_url,
1907
+ external_id: run.external_id,
1908
+ output_title: run.output_title,
1909
+ output_summary: run.output_summary,
1910
+ started_at: run.started_at,
1911
+ completed_at: run.completed_at
1912
+ };
1913
+ }
1914
+ function pullRequestReviewCommentJson(comment, repo) {
1915
+ return {
1916
+ id: comment.id,
1917
+ node_id: `PRC_${comment.id}`,
1918
+ pull_request_review_id: null,
1919
+ diff_hunk: "",
1920
+ path: comment.path,
1921
+ // `position` is the one location field the upstream schema declares
1922
+ // nullable (`number | null`); all the sibling line/position fields below
1923
+ // are non-null in the schema. The twin's row column is `number | null`, so
1924
+ // for the non-null schema fields we narrow the row's pre-resolution null
1925
+ // away for the type anchor only (FDRS-454: a faithful twin may surface a
1926
+ // pre-resolution null on a not-yet-positioned comment), runtime unchanged.
1927
+ position: comment.line,
1928
+ original_position: comment.line,
1929
+ // `commit_sha` row column is `string | null`; schema commit ids are
1930
+ // non-null strings (FDRS-454 pre-resolution null narrow).
1931
+ commit_id: comment.commit_sha,
1932
+ original_commit_id: comment.commit_sha,
1933
+ in_reply_to_id: comment.in_reply_to_id,
1934
+ user: userJson(comment.user_login),
1935
+ body: comment.body,
1936
+ side: comment.side ?? "RIGHT",
1937
+ line: comment.line,
1938
+ original_line: comment.line,
1939
+ start_line: null,
1940
+ original_start_line: null,
1941
+ start_side: null,
1942
+ html_url: `https://github.com/${repo.full_name}/pull/${comment.pull_number}#discussion_r${comment.id}`,
1943
+ pull_request_url: `https://api.github.com/repos/${repo.full_name}/pulls/${comment.pull_number}`,
1944
+ url: `https://api.github.com/repos/${repo.full_name}/pulls/comments/${comment.id}`,
1945
+ created_at: comment.created_at,
1946
+ updated_at: comment.updated_at
1947
+ };
1948
+ }
1949
+ function pullRequestReviewCommentState(comment, repo) {
1950
+ return {
1951
+ repo: repo.full_name,
1952
+ pull_number: comment.pull_number,
1953
+ id: comment.id,
1954
+ path: comment.path,
1955
+ body: comment.body,
1956
+ user_login: comment.user_login,
1957
+ line: comment.line,
1958
+ side: comment.side,
1959
+ commit_sha: comment.commit_sha,
1960
+ in_reply_to_id: comment.in_reply_to_id,
1961
+ created_at: comment.created_at,
1962
+ updated_at: comment.updated_at
1963
+ };
1964
+ }
1965
+ function commitWithFilesJson(commit, repo, files) {
1966
+ const additions = files.reduce((sum, file) => sum + file.additions, 0);
1967
+ const deletions = files.reduce((sum, file) => sum + file.deletions, 0);
1968
+ return {
1969
+ ...commitJson(commit, repo),
1970
+ stats: { additions, deletions, total: additions + deletions },
1971
+ files: files.map(pullRequestFileJson)
1972
+ };
1973
+ }
1974
+ function compareCommitsJson(baseRepo, base, head, commits, files, status, aheadBy, behindBy) {
1975
+ return {
1976
+ url: `https://api.github.com/repos/${baseRepo.full_name}/compare/${base.sha}...${head.sha}`,
1977
+ html_url: `https://github.com/${baseRepo.full_name}/compare/${base.sha}...${head.sha}`,
1978
+ permalink_url: `https://github.com/${baseRepo.full_name}/compare/${base.sha.slice(0, 7)}...${head.sha.slice(0, 7)}`,
1979
+ diff_url: `https://github.com/${baseRepo.full_name}/compare/${base.sha}...${head.sha}.diff`,
1980
+ patch_url: `https://github.com/${baseRepo.full_name}/compare/${base.sha}...${head.sha}.patch`,
1981
+ base_commit: commitJson(base, baseRepo),
1982
+ merge_base_commit: commitJson(base, baseRepo),
1983
+ status,
1984
+ ahead_by: aheadBy,
1985
+ behind_by: behindBy,
1986
+ total_commits: commits.length,
1987
+ commits: commits.map((commit) => commitJson(commit, baseRepo)),
1988
+ files: files.map(pullRequestFileJson)
1989
+ };
1990
+ }
1991
+ function authenticatedUserJson(login) {
1992
+ return {
1993
+ ...userJson(login, "User"),
1994
+ name: login,
1995
+ email: `${login}@example.local`,
1996
+ bio: null,
1997
+ company: null,
1998
+ blog: null,
1999
+ location: null,
2000
+ public_repos: 0,
2001
+ public_gists: 0,
2002
+ followers: 0,
2003
+ following: 0,
2004
+ created_at: "2026-01-01T00:00:00Z",
2005
+ updated_at: "2026-01-01T00:00:00Z"
2006
+ };
2007
+ }
2008
+ function collaboratorAddState(repo, login, invitation, permission) {
2009
+ return {
2010
+ repo: repo.full_name,
2011
+ login,
2012
+ invitation_state: invitation,
2013
+ permission
2014
+ };
2015
+ }
2016
+ function pullRequestDiffText(files) {
2017
+ const blocks = files.map((file) => {
2018
+ const header = `diff --git a/${file.filename} b/${file.filename}`;
2019
+ const status = file.status === "added" ? `new file mode 100644
2020
+ --- /dev/null
2021
+ +++ b/${file.filename}` : file.status === "removed" ? `deleted file mode 100644
2022
+ --- a/${file.filename}
2023
+ +++ /dev/null` : `--- a/${file.filename}
2024
+ +++ b/${file.filename}`;
2025
+ const hunkHeader = `@@ -0,${file.deletions || 0} +0,${file.additions || 0} @@`;
2026
+ return `${header}
2027
+ ${status}
2028
+ ${hunkHeader}
2029
+ ${file.patch || ""}`.trim();
2030
+ });
2031
+ return blocks.join("\n");
2032
+ }
2033
+
2034
+ // ../packages/twin-github/dist/src/domain/checks.js
2035
+ function createStatus(domain, input) {
2036
+ const repo = domain.requireRepo(input.owner, input.repo);
2037
+ const now = nowIso();
2038
+ const result = domain.db.prepare("INSERT INTO commit_statuses (repo_id, sha, state, context, description, target_url, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(repo.id, input.sha, input.state, input.context ?? "continuous-integration/local", input.description ?? "", input.target_url ?? "", now, now);
2039
+ return domain.db.prepare("SELECT * FROM commit_statuses WHERE id = ?").get(result.lastInsertRowid);
2040
+ }
2041
+ function createCommitStatus(domain, input, onDelta) {
2042
+ const repo = domain.requireRepo(input.owner, input.repo);
2043
+ const row = domain.transaction(() => {
2044
+ domain.requireCommitOnRepo(repo.id, input.sha);
2045
+ const now = nowIso();
2046
+ const result = domain.db.prepare("INSERT INTO commit_statuses (repo_id, sha, state, context, description, target_url, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(repo.id, input.sha, input.state, input.context ?? "default", input.description ?? "", input.target_url ?? "", now, now);
2047
+ return domain.db.prepare("SELECT * FROM commit_statuses WHERE id = ?").get(result.lastInsertRowid);
2048
+ });
2049
+ domain.audit("create_commit_status", repo.full_name, input);
2050
+ onDelta?.({
2051
+ before: null,
2052
+ after: { repo: repo.full_name, id: row.id, sha: row.sha, state: row.state, context: row.context }
2053
+ });
2054
+ return statusJson(row, repo);
2055
+ }
2056
+ function getCombinedStatusForRef(domain, input) {
2057
+ const repo = domain.requireRepo(input.owner, input.repo);
2058
+ const sha = domain.resolveRefToSha(repo, input.ref);
2059
+ return combinedStatusJson(repo, sha, domain.latestCommitStatuses(repo.id, sha));
2060
+ }
2061
+ function createCheckRun(domain, input, onDelta) {
2062
+ const repo = domain.requireRepo(input.owner, input.repo);
2063
+ const row = domain.transaction(() => {
2064
+ if (!input.name.trim())
2065
+ validationFailed("name", "missing");
2066
+ domain.requireCommitOnRepo(repo.id, input.head_sha);
2067
+ const status = input.status ?? "queued";
2068
+ if (status === "completed" && !input.conclusion) {
2069
+ validationFailed("conclusion", "missing", "required when status=completed");
2070
+ }
2071
+ if (status !== "completed" && input.conclusion) {
2072
+ validationFailed("conclusion", "invalid", "only allowed when status=completed");
2073
+ }
2074
+ if (status !== "completed" && input.completed_at) {
2075
+ validationFailed("completed_at", "invalid", "only allowed when status=completed");
2076
+ }
2077
+ const started = input.started_at ?? nowIso();
2078
+ const completed = status === "completed" ? input.completed_at ?? nowIso() : input.completed_at ?? null;
2079
+ const result = domain.db.prepare("INSERT INTO check_runs (repo_id, head_sha, name, status, conclusion, details_url, external_id, output_title, output_summary, started_at, completed_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(repo.id, input.head_sha, input.name, status, input.conclusion ?? null, input.details_url ?? "", input.external_id ?? "", input.output?.title ?? null, input.output?.summary ?? null, started, completed);
2080
+ return domain.db.prepare("SELECT * FROM check_runs WHERE id = ?").get(result.lastInsertRowid);
2081
+ });
2082
+ domain.audit("create_check_run", repo.full_name, input);
2083
+ onDelta?.({ before: null, after: checkRunState(row, repo) });
2084
+ return checkRunJson(row, repo);
2085
+ }
2086
+ function listCheckRunsForRef(domain, input) {
2087
+ const repo = domain.requireRepo(input.owner, input.repo);
2088
+ const sha = domain.resolveRefToSha(repo, input.ref);
2089
+ const rows = domain.db.prepare("SELECT * FROM check_runs WHERE repo_id = ? AND head_sha = ? ORDER BY started_at DESC").all(repo.id, sha);
2090
+ const paged = paginate(rows, input.page, input.per_page ?? input.perPage);
2091
+ return {
2092
+ total_count: rows.length,
2093
+ check_runs: paged.map((run) => checkRunJson(run, repo))
2094
+ };
2095
+ }
2096
+
2097
+ // ../packages/twin-github/dist/src/domain/helpers.js
2098
+ function commitIdentityKey(commit) {
2099
+ return [commit.message, commit.author_login, commit.committer_login, commit.tree_sha, commit.created_at].join("");
2100
+ }
2101
+ function contentLineCount(content) {
2102
+ return Math.max(1, content.replace(/\n$/, "").split("\n").length);
2103
+ }
2104
+ function normalizePath(path) {
2105
+ const normalized = path.replace(/^\/+/, "").replace(/\/+/g, "/").trim();
2106
+ if (normalized.includes(".."))
2107
+ validationFailed("path", "invalid", path);
2108
+ return normalized;
2109
+ }
2110
+
2111
+ // ../packages/twin-github/dist/src/domain/git.js
2112
+ function getFileContents(domain, input) {
2113
+ const repo = domain.requireRepo(input.owner, input.repo);
2114
+ const branch = input.ref ?? repo.default_branch;
2115
+ domain.requireBranch(repo.id, branch);
2116
+ const path = normalizePath(input.path ?? "");
2117
+ const direct = domain.getFile(repo.id, branch, path);
2118
+ if (direct)
2119
+ return contentFileJson(direct, repo);
2120
+ const children = domain.listDirectory(repo, branch, path);
2121
+ if (children.length === 0)
2122
+ notFound("Not Found");
2123
+ return children;
2124
+ }
2125
+ function listCommits(domain, input) {
2126
+ const repo = domain.requireRepo(input.owner, input.repo);
2127
+ const branch = input.sha ?? repo.default_branch;
2128
+ const branchRow = domain.requireBranch(repo.id, branch);
2129
+ const allRows = domain.db.prepare("SELECT * FROM commits WHERE repo_id = ?").all(repo.id);
2130
+ const bySha = new Map(allRows.map((commit) => [commit.sha, commit]));
2131
+ const rows = [];
2132
+ for (let sha = branchRow.head_sha; sha; ) {
2133
+ const commit = bySha.get(sha);
2134
+ if (!commit)
2135
+ break;
2136
+ rows.push(commit);
2137
+ sha = commit.parent_sha;
2138
+ }
2139
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((commit) => commitJson(commit, repo));
2140
+ }
2141
+ function createOrUpdateFile(domain, input, options = {}, onDelta) {
2142
+ const repo = domain.requireRepo(input.owner, input.repo);
2143
+ const branch = input.branch ?? repo.default_branch;
2144
+ let before = null;
2145
+ let afterFile = null;
2146
+ const result = domain.transaction(() => {
2147
+ domain.requireBranch(repo.id, branch);
2148
+ const path = normalizePath(input.path);
2149
+ const existing = domain.getFile(repo.id, branch, path);
2150
+ before = existing ? fileState(existing, repo) : null;
2151
+ if (existing && !input.sha)
2152
+ validationFailed("sha", "missing", path);
2153
+ if (existing && input.sha !== existing.sha)
2154
+ validationFailed("sha", "invalid", input.sha);
2155
+ const content = input.encoding === "base64" ? Buffer.from(input.content, "base64").toString("utf8") : input.content;
2156
+ const commit = domain.commitFiles(repo, branch, input.message, [{ path, content }], options.actor ?? "pome-agent");
2157
+ const file = domain.getFile(repo.id, branch, path);
2158
+ afterFile = file;
2159
+ return { content: contentFileJson(file, repo), commit: commitJson(commit, repo) };
2160
+ });
2161
+ domain.audit("create_or_update_file", repo.full_name, { ...input, content: "[redacted]" });
2162
+ onDelta?.({ before, after: afterFile ? fileState(afterFile, repo) : null });
2163
+ return result;
2164
+ }
2165
+ function pushFiles(domain, input, options = {}, onDelta) {
2166
+ const repo = domain.requireRepo(input.owner, input.repo);
2167
+ const branch = input.branch ?? repo.default_branch;
2168
+ domain.requireBranch(repo.id, branch);
2169
+ if (input.files.length === 0)
2170
+ validationFailed("files", "missing");
2171
+ const paths = /* @__PURE__ */ new Set();
2172
+ const files = input.files.map((file) => {
2173
+ const path = normalizePath(file.path);
2174
+ if (paths.has(path))
2175
+ validationFailed("files.path", "duplicate", path);
2176
+ paths.add(path);
2177
+ return { path, content: file.encoding === "base64" ? Buffer.from(file.content, "base64").toString("utf8") : file.content };
2178
+ });
2179
+ const beforeFiles = files.map((file) => {
2180
+ const existing = domain.getFile(repo.id, branch, file.path);
2181
+ return { path: file.path, sha: existing?.sha ?? null };
2182
+ });
2183
+ const commit = domain.transaction(() => domain.commitFiles(repo, branch, input.message, files, options.actor ?? "pome-agent"));
2184
+ domain.audit("push_files", repo.full_name, { ...input, files: files.map((file) => file.path) });
2185
+ const afterFiles = files.map((file) => {
2186
+ const updated = domain.getFile(repo.id, branch, file.path);
2187
+ return { path: file.path, sha: updated.sha };
2188
+ });
2189
+ onDelta?.({
2190
+ before: { repo: repo.full_name, branch, files: beforeFiles },
2191
+ after: { repo: repo.full_name, branch, files: afterFiles, commit_sha: commit.sha }
2192
+ });
2193
+ return { commit: commitJson(commit, repo), files: files.map((file) => contentFileJson(domain.getFile(repo.id, branch, file.path), repo)) };
2194
+ }
2195
+ function createBranch(domain, input, onDelta) {
2196
+ const repo = domain.requireRepo(input.owner, input.repo);
2197
+ const branch = domain.transaction(() => {
2198
+ if (domain.getBranch(repo.id, input.branch))
2199
+ validationFailed("branch", "already_exists", input.branch);
2200
+ const source = input.sha ? { head_sha: input.sha } : domain.requireBranch(repo.id, input.from_branch ?? repo.default_branch);
2201
+ const created2 = domain.createBranchInternal(repo, input.branch, source.head_sha);
2202
+ if (!input.sha) {
2203
+ const sourceBranch = input.from_branch ?? repo.default_branch;
2204
+ const files = domain.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ?").all(repo.id, sourceBranch);
2205
+ for (const file of files) {
2206
+ domain.db.prepare("INSERT INTO files (repo_id, branch, path, content, sha, size, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)").run(repo.id, input.branch, file.path, file.content, file.sha, file.size, nowIso());
2207
+ }
2208
+ }
2209
+ return created2;
2210
+ });
2211
+ domain.audit("create_branch", repo.full_name, input);
2212
+ onDelta?.({ before: null, after: branchState(branch, repo) });
2213
+ return branchJson(branch, repo);
2214
+ }
2215
+ function listBranchesForRepo(domain, input) {
2216
+ const repo = domain.requireRepo(input.owner, input.repo);
2217
+ const rows = domain.listBranches(repo.id);
2218
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((branch) => branchJson(branch, repo));
2219
+ }
2220
+ function getBranchByName(domain, input) {
2221
+ const repo = domain.requireRepo(input.owner, input.repo);
2222
+ const branch = domain.requireBranch(repo.id, input.branch);
2223
+ return branchJson(branch, repo);
2224
+ }
2225
+ function deleteBranch(domain, input, onDelta) {
2226
+ const repo = domain.requireRepo(input.owner, input.repo);
2227
+ let before = null;
2228
+ domain.transaction(() => {
2229
+ const branch = domain.requireBranch(repo.id, input.branch);
2230
+ if (input.branch === repo.default_branch) {
2231
+ validationFailed("branch", "default_branch", input.branch);
2232
+ }
2233
+ const headPr = domain.db.prepare("SELECT number FROM pull_requests WHERE state = 'open' AND head_repo_id = ? AND head_ref = ?").get(repo.id, input.branch);
2234
+ if (headPr)
2235
+ validationFailed("branch", "open_pull_request", input.branch);
2236
+ before = branchState(branch, repo);
2237
+ domain.db.prepare("DELETE FROM files WHERE repo_id = ? AND branch = ?").run(repo.id, input.branch);
2238
+ domain.db.prepare("DELETE FROM branches WHERE repo_id = ? AND name = ?").run(repo.id, input.branch);
2239
+ });
2240
+ domain.audit("delete_branch", repo.full_name, input);
2241
+ onDelta?.({ before, after: null });
2242
+ return { ok: true };
2243
+ }
2244
+ function deleteFile(domain, input, options = {}, onDelta) {
2245
+ const repo = domain.requireRepo(input.owner, input.repo);
2246
+ const branch = input.branch ?? repo.default_branch;
2247
+ let before = null;
2248
+ const commit = domain.transaction(() => {
2249
+ domain.requireBranch(repo.id, branch);
2250
+ const path = normalizePath(input.path);
2251
+ const existing = domain.getFile(repo.id, branch, path);
2252
+ if (!existing)
2253
+ notFound("Not Found");
2254
+ if (!input.sha)
2255
+ validationFailed("sha", "missing", path);
2256
+ if (input.sha !== existing.sha)
2257
+ validationFailed("sha", "invalid", input.sha);
2258
+ before = fileState(existing, repo);
2259
+ return domain.commitFiles(repo, branch, input.message, [{ path, content: "", delete: true }], options.actor ?? "pome-agent");
2260
+ });
2261
+ domain.audit("delete_file", repo.full_name, { ...input });
2262
+ onDelta?.({ before, after: null });
2263
+ return {
2264
+ content: null,
2265
+ commit: commitJson(commit, repo)
2266
+ };
2267
+ }
2268
+ function getCommitWithFiles(domain, input) {
2269
+ const repo = domain.requireRepo(input.owner, input.repo);
2270
+ const commit = domain.resolveCommitByRef(repo, input.ref);
2271
+ const files = domain.computeCommitFiles(repo, commit);
2272
+ return commitWithFilesJson(commit, repo, files);
2273
+ }
2274
+ function compareCommits(domain, input) {
2275
+ const repo = domain.requireRepo(input.owner, input.repo);
2276
+ const baseCommit = domain.resolveCommitByRef(repo, input.base);
2277
+ const headCommit = domain.resolveCommitByRef(repo, input.head);
2278
+ if (baseCommit.sha === headCommit.sha) {
2279
+ return compareCommitsJson(repo, baseCommit, headCommit, [], [], "identical", 0, 0);
2280
+ }
2281
+ const headAncestry = domain.commitAncestry(repo.id, headCommit.sha);
2282
+ const baseAncestry = domain.commitAncestry(repo.id, baseCommit.sha);
2283
+ const headSet = new Set(headAncestry.map((commit) => commit.sha));
2284
+ const baseSet = new Set(baseAncestry.map((commit) => commit.sha));
2285
+ const aheadCommits = headAncestry.filter((commit) => !baseSet.has(commit.sha));
2286
+ const behindCommits = baseAncestry.filter((commit) => !headSet.has(commit.sha));
2287
+ const status = aheadCommits.length > 0 && behindCommits.length > 0 ? "diverged" : aheadCommits.length > 0 ? "ahead" : behindCommits.length > 0 ? "behind" : "identical";
2288
+ const files = domain.computeCompareFiles(repo, baseCommit, headCommit);
2289
+ const commits = [...aheadCommits].reverse();
2290
+ return compareCommitsJson(repo, baseCommit, headCommit, commits, files, status, aheadCommits.length, behindCommits.length);
2291
+ }
2292
+
2293
+ // ../packages/twin-github/dist/src/domain/issues.js
2294
+ function createIssue(domain, input, onDelta) {
2295
+ const repo = domain.requireRepo(input.owner, input.repo);
2296
+ const issue = domain.transaction(() => {
2297
+ if (!input.title.trim())
2298
+ validationFailed("title", "missing");
2299
+ for (const label of input.labels ?? [])
2300
+ if (!domain.getLabel(repo.id, label))
2301
+ validationFailed("labels", "missing", label);
2302
+ for (const assignee of input.assignees ?? [])
2303
+ if (!domain.hasCollaborator(repo.id, assignee))
2304
+ validationFailed("assignees", "invalid", assignee);
2305
+ const now = nowIso();
2306
+ const number = domain.nextNumber(repo.id);
2307
+ domain.db.prepare("INSERT INTO issues (repo_id, number, title, body, state, user_login, assignee_login, created_at, updated_at, closed_at) VALUES (?, ?, ?, ?, 'open', ?, ?, ?, ?, NULL)").run(repo.id, number, input.title, input.body ?? "", "pome-agent", input.assignees?.[0] ?? null, now, now);
2308
+ for (const label of input.labels ?? [])
2309
+ domain.db.prepare("INSERT OR IGNORE INTO issue_labels (repo_id, issue_number, label_name) VALUES (?, ?, ?)").run(repo.id, number, label);
2310
+ for (const assignee of input.assignees ?? [])
2311
+ domain.db.prepare("INSERT OR IGNORE INTO issue_assignees (repo_id, issue_number, login) VALUES (?, ?, ?)").run(repo.id, number, assignee);
2312
+ return domain.requireIssue(repo.id, number);
2313
+ });
2314
+ domain.audit("create_issue", repo.full_name, input);
2315
+ const labels = domain.listIssueLabels(repo.id, issue.number).map((label) => label.name);
2316
+ const assignees = domain.listIssueAssignees(repo.id, issue.number);
2317
+ onDelta?.({ before: null, after: issueState(issue, repo, labels, assignees) });
2318
+ return issueJson(issue, repo, domain.listIssueLabels(repo.id, issue.number), domain.listIssueAssignees(repo.id, issue.number), domain.issueCommentCount(repo.id, issue.number));
2319
+ }
2320
+ function listIssues(domain, input) {
2321
+ const repo = domain.requireRepo(input.owner, input.repo);
2322
+ let rows = domain.listIssuesRows(repo.id);
2323
+ if (input.state && input.state !== "all")
2324
+ rows = rows.filter((issue) => issue.state === input.state);
2325
+ if (input.labels) {
2326
+ const wanted = input.labels.split(",").map((label) => label.trim()).filter(Boolean);
2327
+ rows = rows.filter((issue) => {
2328
+ const names = domain.listIssueLabels(repo.id, issue.number).map((label) => label.name);
2329
+ return wanted.every((label) => names.includes(label));
2330
+ });
2331
+ }
2332
+ if (input.assignee)
2333
+ rows = rows.filter((issue) => domain.listIssueAssignees(repo.id, issue.number).includes(input.assignee));
2334
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((issue) => issueJson(issue, repo, domain.listIssueLabels(repo.id, issue.number), domain.listIssueAssignees(repo.id, issue.number), domain.issueCommentCount(repo.id, issue.number)));
2335
+ }
2336
+ function getIssue(domain, input) {
2337
+ const repo = domain.requireRepo(input.owner, input.repo);
2338
+ const issue = domain.requireIssue(repo.id, input.issue_number);
2339
+ return issueJson(issue, repo, domain.listIssueLabels(repo.id, issue.number), domain.listIssueAssignees(repo.id, issue.number), domain.issueCommentCount(repo.id, issue.number));
2340
+ }
2341
+ function updateIssue(domain, input, onDelta) {
2342
+ const repo = domain.requireRepo(input.owner, input.repo);
2343
+ let before = null;
2344
+ domain.transaction(() => {
2345
+ const issue = domain.requireIssue(repo.id, input.issue_number);
2346
+ before = issueState(issue, repo, domain.listIssueLabels(repo.id, issue.number).map((label) => label.name), domain.listIssueAssignees(repo.id, issue.number));
2347
+ for (const label of input.labels ?? [])
2348
+ if (!domain.getLabel(repo.id, label))
2349
+ validationFailed("labels", "missing", label);
2350
+ for (const assignee of input.assignees ?? [])
2351
+ if (!domain.hasCollaborator(repo.id, assignee))
2352
+ validationFailed("assignees", "invalid", assignee);
2353
+ const state = input.state ?? issue.state;
2354
+ const closedAt = state === "closed" && issue.state !== "closed" ? nowIso() : state === "open" ? null : issue.closed_at;
2355
+ domain.db.prepare("UPDATE issues SET title = ?, body = ?, state = ?, assignee_login = ?, updated_at = ?, closed_at = ? WHERE repo_id = ? AND number = ?").run(input.title ?? issue.title, input.body ?? issue.body, state, input.assignees?.[0] ?? issue.assignee_login, nowIso(), closedAt, repo.id, issue.number);
2356
+ if (input.labels) {
2357
+ domain.db.prepare("DELETE FROM issue_labels WHERE repo_id = ? AND issue_number = ?").run(repo.id, issue.number);
2358
+ for (const label of input.labels)
2359
+ domain.db.prepare("INSERT INTO issue_labels (repo_id, issue_number, label_name) VALUES (?, ?, ?)").run(repo.id, issue.number, label);
2360
+ }
2361
+ if (input.assignees) {
2362
+ domain.db.prepare("DELETE FROM issue_assignees WHERE repo_id = ? AND issue_number = ?").run(repo.id, issue.number);
2363
+ for (const assignee of input.assignees)
2364
+ domain.db.prepare("INSERT INTO issue_assignees (repo_id, issue_number, login) VALUES (?, ?, ?)").run(repo.id, issue.number, assignee);
2365
+ }
2366
+ });
2367
+ domain.audit("update_issue", repo.full_name, input);
2368
+ const updated = domain.requireIssue(repo.id, input.issue_number);
2369
+ const afterLabels = domain.listIssueLabels(repo.id, updated.number).map((label) => label.name);
2370
+ const afterAssignees = domain.listIssueAssignees(repo.id, updated.number);
2371
+ onDelta?.({ before, after: issueState(updated, repo, afterLabels, afterAssignees) });
2372
+ return domain.getIssue(input);
2373
+ }
2374
+ function addIssueComment(domain, input, onDelta) {
2375
+ const repo = domain.requireRepo(input.owner, input.repo);
2376
+ let target = "issue";
2377
+ const comment = domain.transaction(() => {
2378
+ target = domain.requireCommentTarget(repo.id, input.issue_number);
2379
+ if (!input.body.trim())
2380
+ validationFailed("body", "missing");
2381
+ const now = nowIso();
2382
+ const result = domain.db.prepare("INSERT INTO issue_comments (repo_id, issue_number, body, user_login, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)").run(repo.id, input.issue_number, input.body, "pome-agent", now, now);
2383
+ return domain.db.prepare("SELECT * FROM issue_comments WHERE id = ?").get(result.lastInsertRowid);
2384
+ });
2385
+ domain.audit("add_issue_comment", repo.full_name, input);
2386
+ onDelta?.({ before: null, after: issueCommentState(comment, repo) });
2387
+ return issueCommentJson(comment, repo, target);
2388
+ }
2389
+ function listIssueComments(domain, input) {
2390
+ const repo = domain.requireRepo(input.owner, input.repo);
2391
+ const target = domain.requireCommentTarget(repo.id, input.issue_number);
2392
+ const rows = domain.listIssueCommentRows(repo.id, input.issue_number);
2393
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((comment) => issueCommentJson(comment, repo, target));
2394
+ }
2395
+ function listRepositoryLabels(domain, input) {
2396
+ const repo = domain.requireRepo(input.owner, input.repo);
2397
+ return domain.listLabels(repo.id).map(labelJson);
2398
+ }
2399
+ function createRepositoryLabel(domain, input, onDelta) {
2400
+ const repo = domain.requireRepo(input.owner, input.repo);
2401
+ domain.transaction(() => {
2402
+ if (domain.getLabel(repo.id, input.name))
2403
+ validationFailed("name", "already_exists", input.name);
2404
+ domain.createLabel(repo, input.name, input.color ?? "ededed", input.description ?? "");
2405
+ });
2406
+ domain.audit("create_label", repo.full_name, input);
2407
+ const created2 = domain.getLabel(repo.id, input.name);
2408
+ onDelta?.({ before: null, after: labelState(created2, repo) });
2409
+ return labelJson(created2);
2410
+ }
2411
+ function listIssueLabelsForIssue(domain, input) {
2412
+ const repo = domain.requireRepo(input.owner, input.repo);
2413
+ domain.requireIssue(repo.id, input.issue_number);
2414
+ return domain.listIssueLabels(repo.id, input.issue_number).map(labelJson);
2415
+ }
2416
+ function addIssueLabels(domain, input, onDelta) {
2417
+ const repo = domain.requireRepo(input.owner, input.repo);
2418
+ let before = null;
2419
+ domain.transaction(() => {
2420
+ domain.requireIssue(repo.id, input.issue_number);
2421
+ before = issueLabelsState(repo, input.issue_number, domain.listIssueLabels(repo.id, input.issue_number).map((label) => label.name));
2422
+ for (const label of input.labels)
2423
+ if (!domain.getLabel(repo.id, label))
2424
+ validationFailed("labels", "missing", label);
2425
+ for (const label of input.labels)
2426
+ domain.db.prepare("INSERT OR IGNORE INTO issue_labels (repo_id, issue_number, label_name) VALUES (?, ?, ?)").run(repo.id, input.issue_number, label);
2427
+ });
2428
+ domain.audit("add_issue_labels", repo.full_name, input);
2429
+ const after = issueLabelsState(repo, input.issue_number, domain.listIssueLabels(repo.id, input.issue_number).map((label) => label.name));
2430
+ onDelta?.({ before, after });
2431
+ return domain.listIssueLabelsForIssue(input);
2432
+ }
2433
+ function deleteIssueLabel(domain, input, onDelta) {
2434
+ const repo = domain.requireRepo(input.owner, input.repo);
2435
+ domain.requireIssue(repo.id, input.issue_number);
2436
+ const before = issueLabelsState(repo, input.issue_number, domain.listIssueLabels(repo.id, input.issue_number).map((label) => label.name));
2437
+ const result = domain.db.prepare("DELETE FROM issue_labels WHERE repo_id = ? AND issue_number = ? AND label_name = ?").run(repo.id, input.issue_number, input.label);
2438
+ if (!result.changes)
2439
+ notFound("Label not found");
2440
+ domain.audit("delete_issue_label", repo.full_name, input);
2441
+ const after = issueLabelsState(repo, input.issue_number, domain.listIssueLabels(repo.id, input.issue_number).map((label) => label.name));
2442
+ onDelta?.({ before, after });
2443
+ return domain.listIssueLabelsForIssue(input);
2444
+ }
2445
+ function addAssignees(domain, input, onDelta) {
2446
+ const repo = domain.requireRepo(input.owner, input.repo);
2447
+ let before = null;
2448
+ domain.transaction(() => {
2449
+ const issue = domain.requireIssue(repo.id, input.issue_number);
2450
+ before = issueAssigneesState(repo, issue.number, domain.listIssueAssignees(repo.id, issue.number));
2451
+ for (const assignee of input.assignees)
2452
+ if (!domain.hasCollaborator(repo.id, assignee))
2453
+ validationFailed("assignees", "invalid", assignee);
2454
+ for (const assignee of input.assignees)
2455
+ domain.db.prepare("INSERT OR IGNORE INTO issue_assignees (repo_id, issue_number, login) VALUES (?, ?, ?)").run(repo.id, issue.number, assignee);
2456
+ const firstAssignee = input.assignees[0] ?? issue.assignee_login;
2457
+ domain.db.prepare("UPDATE issues SET assignee_login = ?, updated_at = ? WHERE repo_id = ? AND number = ?").run(firstAssignee, nowIso(), repo.id, issue.number);
2458
+ });
2459
+ domain.audit("add_assignees", repo.full_name, input);
2460
+ const after = issueAssigneesState(repo, input.issue_number, domain.listIssueAssignees(repo.id, input.issue_number));
2461
+ onDelta?.({ before, after });
2462
+ return domain.getIssue(input);
2463
+ }
2464
+ function updateIssueComment(domain, input, onDelta) {
2465
+ const repo = domain.requireRepo(input.owner, input.repo);
2466
+ let before = null;
2467
+ const comment = domain.transaction(() => {
2468
+ const row = domain.db.prepare("SELECT * FROM issue_comments WHERE id = ? AND repo_id = ?").get(input.comment_id, repo.id);
2469
+ if (!row)
2470
+ notFound("Issue comment not found");
2471
+ before = issueCommentState(row, repo);
2472
+ if (!input.body.trim())
2473
+ validationFailed("body", "missing");
2474
+ const now = nowIso();
2475
+ domain.db.prepare("UPDATE issue_comments SET body = ?, updated_at = ? WHERE id = ?").run(input.body, now, input.comment_id);
2476
+ return domain.db.prepare("SELECT * FROM issue_comments WHERE id = ?").get(input.comment_id);
2477
+ });
2478
+ domain.audit("update_issue_comment", repo.full_name, input);
2479
+ onDelta?.({ before, after: issueCommentState(comment, repo) });
2480
+ return issueCommentJson(comment, repo, domain.commentTargetKind(repo.id, comment.issue_number) ?? "issue");
2481
+ }
2482
+ function deleteIssueComment(domain, input, onDelta) {
2483
+ const repo = domain.requireRepo(input.owner, input.repo);
2484
+ let before = null;
2485
+ domain.transaction(() => {
2486
+ const row = domain.db.prepare("SELECT * FROM issue_comments WHERE id = ? AND repo_id = ?").get(input.comment_id, repo.id);
2487
+ if (!row)
2488
+ notFound("Issue comment not found");
2489
+ before = issueCommentState(row, repo);
2490
+ domain.db.prepare("DELETE FROM issue_comments WHERE id = ?").run(input.comment_id);
2491
+ });
2492
+ domain.audit("delete_issue_comment", repo.full_name, input);
2493
+ onDelta?.({ before, after: null });
2494
+ return { ok: true };
2495
+ }
2496
+ function listMilestones(domain, input) {
2497
+ const repo = domain.requireRepo(input.owner, input.repo);
2498
+ let rows = domain.db.prepare("SELECT * FROM milestones WHERE repo_id = ? ORDER BY number ASC").all(repo.id);
2499
+ if (input.state && input.state !== "all")
2500
+ rows = rows.filter((milestone) => milestone.state === input.state);
2501
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((milestone) => milestoneJson(milestone, repo));
2502
+ }
2503
+ function createMilestone(domain, input, onDelta) {
2504
+ const repo = domain.requireRepo(input.owner, input.repo);
2505
+ const milestone = domain.transaction(() => {
2506
+ if (!input.title.trim())
2507
+ validationFailed("title", "missing");
2508
+ const duplicate = domain.db.prepare("SELECT number FROM milestones WHERE repo_id = ? AND title = ?").get(repo.id, input.title);
2509
+ if (duplicate)
2510
+ validationFailed("title", "already_exists", input.title);
2511
+ const number = domain.nextMilestoneNumber(repo.id);
2512
+ const now = nowIso();
2513
+ const state = input.state ?? "open";
2514
+ domain.db.prepare("INSERT INTO milestones (repo_id, number, title, state, description, due_on, creator_login, created_at, updated_at, closed_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(repo.id, number, input.title, state, input.description ?? "", input.due_on ?? null, "pome-agent", now, now, state === "closed" ? now : null);
2515
+ return domain.db.prepare("SELECT * FROM milestones WHERE repo_id = ? AND number = ?").get(repo.id, number);
2516
+ });
2517
+ domain.audit("create_milestone", repo.full_name, input);
2518
+ onDelta?.({ before: null, after: milestoneState(milestone, repo) });
2519
+ return milestoneJson(milestone, repo);
2520
+ }
2521
+ function updateMilestone(domain, input, onDelta) {
2522
+ const repo = domain.requireRepo(input.owner, input.repo);
2523
+ let before = null;
2524
+ const milestone = domain.transaction(() => {
2525
+ const existing = domain.db.prepare("SELECT * FROM milestones WHERE repo_id = ? AND number = ?").get(repo.id, input.milestone_number);
2526
+ if (!existing)
2527
+ notFound("Milestone not found");
2528
+ before = milestoneState(existing, repo);
2529
+ const nextTitle = input.title ?? existing.title;
2530
+ if (!nextTitle.trim())
2531
+ validationFailed("title", "missing");
2532
+ if (nextTitle !== existing.title) {
2533
+ const duplicate = domain.db.prepare("SELECT number FROM milestones WHERE repo_id = ? AND title = ? AND number != ?").get(repo.id, nextTitle, existing.number);
2534
+ if (duplicate)
2535
+ validationFailed("title", "already_exists", nextTitle);
2536
+ }
2537
+ const state = input.state ?? existing.state;
2538
+ const closedAt = state === "closed" && existing.state !== "closed" ? nowIso() : state === "open" ? null : existing.closed_at;
2539
+ const now = nowIso();
2540
+ domain.db.prepare("UPDATE milestones SET title = ?, description = ?, state = ?, due_on = ?, updated_at = ?, closed_at = ? WHERE repo_id = ? AND number = ?").run(nextTitle, input.description ?? existing.description, state, input.due_on ?? existing.due_on, now, closedAt, repo.id, existing.number);
2541
+ return domain.db.prepare("SELECT * FROM milestones WHERE repo_id = ? AND number = ?").get(repo.id, existing.number);
2542
+ });
2543
+ domain.audit("update_milestone", repo.full_name, input);
2544
+ onDelta?.({ before, after: milestoneState(milestone, repo) });
2545
+ return milestoneJson(milestone, repo);
2546
+ }
2547
+ function deleteMilestone(domain, input, onDelta) {
2548
+ const repo = domain.requireRepo(input.owner, input.repo);
2549
+ let before = null;
2550
+ domain.transaction(() => {
2551
+ const existing = domain.db.prepare("SELECT * FROM milestones WHERE repo_id = ? AND number = ?").get(repo.id, input.milestone_number);
2552
+ if (!existing)
2553
+ notFound("Milestone not found");
2554
+ before = milestoneState(existing, repo);
2555
+ domain.db.prepare("DELETE FROM milestones WHERE repo_id = ? AND number = ?").run(repo.id, input.milestone_number);
2556
+ });
2557
+ domain.audit("delete_milestone", repo.full_name, input);
2558
+ onDelta?.({ before, after: null });
2559
+ return { ok: true };
2560
+ }
2561
+
2562
+ // ../packages/twin-github/dist/src/domain/pulls.js
2563
+ function createPullRequest(domain, input, onDelta) {
2564
+ const baseRepo = domain.requireRepo(input.owner, input.repo);
2565
+ const baseRef = input.base ?? baseRepo.default_branch;
2566
+ const number = domain.transaction(() => {
2567
+ if (input.head === baseRef || input.head === `${input.owner}:${baseRef}`)
2568
+ validationFailed("head", "invalid", input.head);
2569
+ const { repo: headRepo, ref: headRef } = domain.resolveHeadRef(baseRepo, input.head);
2570
+ const baseBranch = domain.requireBranch(baseRepo.id, baseRef);
2571
+ const headBranch = domain.requireBranch(headRepo.id, headRef);
2572
+ const duplicate = domain.db.prepare("SELECT * FROM pull_requests WHERE repo_id = ? AND state = 'open' AND head_repo_id = ? AND head_ref = ? AND base_ref = ?").get(baseRepo.id, headRepo.id, headRef, baseRef);
2573
+ if (duplicate)
2574
+ validationFailed("head", "already_exists", input.head);
2575
+ const files = domain.calculatePullFiles(baseRepo, baseRef, headRepo, headRef);
2576
+ if (files.length === 0)
2577
+ validationFailed("head", "missing_commits", input.head);
2578
+ const now = nowIso();
2579
+ const pullNumber = domain.nextNumber(baseRepo.id);
2580
+ domain.db.prepare("INSERT INTO pull_requests (repo_id, number, title, body, state, user_login, head_repo_id, head_ref, head_sha, base_repo_id, base_ref, base_sha, merged, merge_commit_sha, created_at, updated_at, closed_at, merged_at) VALUES (?, ?, ?, ?, 'open', ?, ?, ?, ?, ?, ?, ?, 0, NULL, ?, ?, NULL, NULL)").run(baseRepo.id, pullNumber, input.title, input.body ?? "", input.actor ?? "pome-agent", headRepo.id, headRef, headBranch.head_sha, baseRepo.id, baseRef, baseBranch.head_sha, now, now);
2581
+ domain.replacePullFiles(baseRepo.id, pullNumber, files);
2582
+ return pullNumber;
2583
+ });
2584
+ domain.audit("create_pull_request", baseRepo.full_name, input);
2585
+ const createdRow = domain.requirePullRequest(baseRepo.id, number);
2586
+ onDelta?.({ before: null, after: pullRequestState(createdRow, baseRepo) });
2587
+ return domain.getPullRequest({ owner: input.owner, repo: input.repo, pull_number: number });
2588
+ }
2589
+ function listPullRequests(domain, input) {
2590
+ const repo = domain.requireRepo(input.owner, input.repo);
2591
+ let rows = domain.listPullRequestRows(repo.id);
2592
+ if (input.state && input.state !== "all")
2593
+ rows = rows.filter((pr) => pr.state === input.state);
2594
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((pr) => domain.serializePullSimple(pr));
2595
+ }
2596
+ function getPullRequest(domain, input) {
2597
+ const repo = domain.requireRepo(input.owner, input.repo);
2598
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2599
+ return domain.serializePull(pr);
2600
+ }
2601
+ function getPullRequestFiles(domain, input) {
2602
+ const repo = domain.requireRepo(input.owner, input.repo);
2603
+ domain.requirePullRequest(repo.id, input.pull_number);
2604
+ const rows = domain.listPullRequestFileRows(repo.id, input.pull_number);
2605
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map(pullRequestFileJson);
2606
+ }
2607
+ function getPullRequestReviews(domain, input) {
2608
+ const repo = domain.requireRepo(input.owner, input.repo);
2609
+ domain.requirePullRequest(repo.id, input.pull_number);
2610
+ const rows = domain.listPullRequestReviewRows(repo.id, input.pull_number);
2611
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((review) => reviewJson(review, repo));
2612
+ }
2613
+ function createPullRequestReview(domain, input, onDelta) {
2614
+ const repo = domain.requireRepo(input.owner, input.repo);
2615
+ const review = domain.transaction(() => {
2616
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2617
+ if (pr.state !== "open")
2618
+ conflict("Pull request is closed");
2619
+ const state = input.event === "APPROVE" ? "APPROVED" : input.event === "REQUEST_CHANGES" ? "CHANGES_REQUESTED" : "COMMENTED";
2620
+ const headSha = domain.requireBranch(pr.head_repo_id, pr.head_ref).head_sha;
2621
+ const result = domain.db.prepare("INSERT INTO pull_request_reviews (repo_id, pull_number, user_login, state, body, commit_sha, submitted_at) VALUES (?, ?, ?, ?, ?, ?, ?)").run(repo.id, pr.number, "pome-agent", state, input.body ?? "", headSha, nowIso());
2622
+ return domain.db.prepare("SELECT * FROM pull_request_reviews WHERE id = ?").get(result.lastInsertRowid);
2623
+ });
2624
+ domain.audit("create_pull_request_review", repo.full_name, input);
2625
+ onDelta?.({ before: null, after: pullRequestReviewState(review, repo) });
2626
+ return reviewJson(review, repo);
2627
+ }
2628
+ function getPullRequestComments(domain, input) {
2629
+ const repo = domain.requireRepo(input.owner, input.repo);
2630
+ domain.requirePullRequest(repo.id, input.pull_number);
2631
+ const rows = domain.listPullRequestReviewCommentRows(repo.id, input.pull_number);
2632
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((comment) => ({
2633
+ id: comment.id,
2634
+ path: comment.path,
2635
+ body: comment.body,
2636
+ user: userJson(comment.user_login),
2637
+ created_at: comment.created_at,
2638
+ updated_at: comment.updated_at
2639
+ }));
2640
+ }
2641
+ function getPullRequestStatus(domain, input) {
2642
+ const repo = domain.requireRepo(input.owner, input.repo);
2643
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2644
+ const head = domain.requireBranch(pr.head_repo_id, pr.head_ref);
2645
+ const statuses = head.head_sha ? domain.latestCommitStatuses(pr.head_repo_id, head.head_sha) : [];
2646
+ return combinedStatusJson(domain.requireRepoById(pr.head_repo_id), head.head_sha ?? "", statuses);
2647
+ }
2648
+ function mergePullRequest(domain, input, onDelta) {
2649
+ const repo = domain.requireRepo(input.owner, input.repo);
2650
+ let before = null;
2651
+ const commit = domain.transaction(() => {
2652
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2653
+ before = pullRequestState(pr, repo);
2654
+ if (pr.state !== "open")
2655
+ conflict("Pull request is closed");
2656
+ if (pr.merged)
2657
+ conflict("Pull request already merged");
2658
+ const status = domain.getPullRequestStatus(input);
2659
+ if (status.state === "failure")
2660
+ conflict("Required status check failed");
2661
+ const headRepo = domain.requireRepoById(pr.head_repo_id);
2662
+ const files = domain.listPullRequestFileRows(repo.id, pr.number);
2663
+ const changes = files.map((file) => {
2664
+ if (file.status === "removed")
2665
+ return { path: file.filename, content: "", delete: true };
2666
+ const source = domain.getFile(headRepo.id, pr.head_ref, file.filename);
2667
+ if (!source)
2668
+ validationFailed("files", "missing", file.filename);
2669
+ return { path: file.filename, content: source.content };
2670
+ });
2671
+ const mergedCommit = domain.commitFiles(repo, pr.base_ref, input.commit_title ?? `Merge pull request #${pr.number}`, changes, "pome-agent");
2672
+ const now = nowIso();
2673
+ domain.db.prepare("UPDATE pull_requests SET state = 'closed', merged = 1, merge_commit_sha = ?, updated_at = ?, closed_at = ?, merged_at = ? WHERE repo_id = ? AND number = ?").run(mergedCommit.sha, now, now, now, repo.id, pr.number);
2674
+ return mergedCommit;
2675
+ });
2676
+ domain.audit("merge_pull_request", repo.full_name, input);
2677
+ const merged = domain.requirePullRequest(repo.id, input.pull_number);
2678
+ onDelta?.({ before, after: pullRequestState(merged, repo) });
2679
+ return { sha: commit.sha, merged: true, message: "Pull Request successfully merged" };
2680
+ }
2681
+ function updatePullRequestBranch(domain, input, onDelta) {
2682
+ const repo = domain.requireRepo(input.owner, input.repo);
2683
+ let before = null;
2684
+ const pullNumber = domain.transaction(() => {
2685
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2686
+ before = pullRequestState(pr, repo);
2687
+ if (pr.state !== "open")
2688
+ conflict("Pull request is closed");
2689
+ const headRepo = domain.requireRepoById(pr.head_repo_id);
2690
+ const headBranch = domain.requireBranch(headRepo.id, pr.head_ref);
2691
+ if (input.expected_head_sha && headBranch.head_sha !== input.expected_head_sha)
2692
+ conflict("Head SHA did not match");
2693
+ const baseBranch = domain.requireBranch(repo.id, pr.base_ref);
2694
+ const mergeBase = domain.findMergeBase(repo, baseBranch.head_sha, headRepo, headBranch.head_sha);
2695
+ if (baseBranch.head_sha === mergeBase)
2696
+ return pr.number;
2697
+ const changes = domain.mergeChangesFromBase(repo, pr.base_ref, headRepo, pr.head_ref, mergeBase);
2698
+ if (changes.length === 0)
2699
+ return pr.number;
2700
+ const mergeCommit = domain.commitFiles(headRepo, pr.head_ref, `Merge branch '${pr.base_ref}' into ${pr.head_ref}`, changes, "pome-agent");
2701
+ domain.db.prepare("UPDATE pull_requests SET head_sha = ?, updated_at = ? WHERE repo_id = ? AND number = ?").run(mergeCommit.sha, nowIso(), repo.id, pr.number);
2702
+ domain.replacePullFiles(repo.id, pr.number, domain.calculatePullFiles(repo, pr.base_ref, headRepo, pr.head_ref));
2703
+ return pr.number;
2704
+ });
2705
+ domain.audit("update_pull_request_branch", repo.full_name, input);
2706
+ const updated = domain.requirePullRequest(repo.id, pullNumber);
2707
+ onDelta?.({ before, after: pullRequestState(updated, repo) });
2708
+ return { message: "Updating pull request branch.", url: `https://api.github.com/repos/${repo.full_name}/pulls/${pullNumber}/update-branch` };
2709
+ }
2710
+ function getPullRequestDiff(domain, input) {
2711
+ const repo = domain.requireRepo(input.owner, input.repo);
2712
+ domain.requirePullRequest(repo.id, input.pull_number);
2713
+ const files = domain.listPullRequestFileRows(repo.id, input.pull_number);
2714
+ return { diff: pullRequestDiffText(files) };
2715
+ }
2716
+ function updatePullRequest(domain, input, onDelta) {
2717
+ const repo = domain.requireRepo(input.owner, input.repo);
2718
+ let before = null;
2719
+ domain.transaction(() => {
2720
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2721
+ before = pullRequestState(pr, repo);
2722
+ if (pr.merged && (input.state === "open" || input.base !== void 0 && input.base !== pr.base_ref)) {
2723
+ conflict("Cannot reopen or rebase a merged pull request");
2724
+ }
2725
+ const nextBase = input.base ?? pr.base_ref;
2726
+ if (nextBase !== pr.base_ref)
2727
+ domain.requireBranch(repo.id, nextBase);
2728
+ const nextState = input.state ?? pr.state;
2729
+ const closedAt = nextState === "closed" && pr.state !== "closed" ? nowIso() : nextState === "open" ? null : pr.closed_at;
2730
+ const now = nowIso();
2731
+ domain.db.prepare("UPDATE pull_requests SET title = ?, body = ?, state = ?, base_ref = ?, updated_at = ?, closed_at = ? WHERE repo_id = ? AND number = ?").run(input.title ?? pr.title, input.body ?? pr.body, nextState, nextBase, now, closedAt, repo.id, pr.number);
2732
+ if (nextBase !== pr.base_ref) {
2733
+ const headRepo = domain.requireRepoById(pr.head_repo_id);
2734
+ domain.replacePullFiles(repo.id, pr.number, domain.calculatePullFiles(repo, nextBase, headRepo, pr.head_ref));
2735
+ const baseBranch = domain.requireBranch(repo.id, nextBase);
2736
+ domain.db.prepare("UPDATE pull_requests SET base_sha = ? WHERE repo_id = ? AND number = ?").run(baseBranch.head_sha, repo.id, pr.number);
2737
+ }
2738
+ });
2739
+ domain.audit("update_pull_request", repo.full_name, input);
2740
+ const updated = domain.requirePullRequest(repo.id, input.pull_number);
2741
+ onDelta?.({ before, after: pullRequestState(updated, repo) });
2742
+ return domain.getPullRequest({ owner: input.owner, repo: input.repo, pull_number: input.pull_number });
2743
+ }
2744
+ function getPullRequestCommits(domain, input) {
2745
+ const repo = domain.requireRepo(input.owner, input.repo);
2746
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2747
+ const headRepo = domain.requireRepoById(pr.head_repo_id);
2748
+ const headSha = domain.getBranch(headRepo.id, pr.head_ref)?.head_sha ?? pr.head_sha;
2749
+ const baseSha = domain.getBranch(repo.id, pr.base_ref)?.head_sha ?? pr.base_sha;
2750
+ const commits = headSha ? domain.commitsBetween(headRepo.id, headSha, baseSha) : [];
2751
+ const ordered = [...commits].reverse();
2752
+ return paginate(ordered, input.page, input.per_page ?? input.perPage).map((commit) => commitJson(commit, headRepo));
2753
+ }
2754
+ function createPullRequestReviewComment(domain, input, options = {}, onDelta) {
2755
+ const repo = domain.requireRepo(input.owner, input.repo);
2756
+ const comment = domain.transaction(() => {
2757
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2758
+ if (!input.body.trim())
2759
+ validationFailed("body", "missing");
2760
+ if (!input.line)
2761
+ validationFailed("line", "missing");
2762
+ const path = normalizePath(input.path);
2763
+ const prFile = domain.listPullRequestFileRows(repo.id, pr.number).find((file) => file.filename === path);
2764
+ if (!prFile)
2765
+ validationFailed("path", "not_in_pr", path);
2766
+ const side = input.side ?? "RIGHT";
2767
+ const headRepo = domain.requireRepoById(pr.head_repo_id);
2768
+ const targetRepo = side === "LEFT" ? domain.requireRepoById(pr.base_repo_id) : headRepo;
2769
+ const targetRef = side === "LEFT" ? pr.base_ref : pr.head_ref;
2770
+ const targetFile = domain.getFile(targetRepo.id, targetRef, path);
2771
+ if (!targetFile || input.line > contentLineCount(targetFile.content))
2772
+ validationFailed("line", "invalid", input.line);
2773
+ const headSha = domain.getBranch(pr.head_repo_id, pr.head_ref)?.head_sha ?? pr.head_sha;
2774
+ const baseSha = domain.getBranch(repo.id, pr.base_ref)?.head_sha ?? pr.base_sha;
2775
+ const commits = headSha ? domain.commitsBetween(headRepo.id, headSha, baseSha) : [];
2776
+ const commitSha = input.commit_id ?? headSha;
2777
+ if (!commitSha || !commits.some((commit) => commit.sha === commitSha)) {
2778
+ validationFailed("commit_id", "invalid", input.commit_id ?? commitSha ?? "");
2779
+ }
2780
+ const now = nowIso();
2781
+ const result = domain.db.prepare("INSERT INTO pull_request_review_comments (repo_id, pull_number, path, body, user_login, created_at, updated_at, line, side, commit_sha, in_reply_to_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)").run(repo.id, pr.number, path, input.body, options.actor ?? "pome-agent", now, now, input.line ?? null, side, commitSha);
2782
+ return domain.db.prepare("SELECT * FROM pull_request_review_comments WHERE id = ?").get(result.lastInsertRowid);
2783
+ });
2784
+ domain.audit("create_pull_request_review_comment", repo.full_name, input);
2785
+ onDelta?.({ before: null, after: pullRequestReviewCommentState(comment, repo) });
2786
+ return pullRequestReviewCommentJson(comment, repo);
2787
+ }
2788
+ function addReplyToPullRequestComment(domain, input, options = {}, onDelta) {
2789
+ const repo = domain.requireRepo(input.owner, input.repo);
2790
+ const reply = domain.transaction(() => {
2791
+ const pr = domain.requirePullRequest(repo.id, input.pull_number);
2792
+ const parent = domain.db.prepare("SELECT * FROM pull_request_review_comments WHERE id = ? AND repo_id = ? AND pull_number = ?").get(input.comment_id, repo.id, pr.number);
2793
+ if (!parent)
2794
+ notFound("Review comment not found");
2795
+ if (!input.body.trim())
2796
+ validationFailed("body", "missing");
2797
+ const now = nowIso();
2798
+ const result = domain.db.prepare("INSERT INTO pull_request_review_comments (repo_id, pull_number, path, body, user_login, created_at, updated_at, line, side, commit_sha, in_reply_to_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(repo.id, pr.number, parent.path, input.body, options.actor ?? "pome-agent", now, now, parent.line, parent.side, parent.commit_sha, parent.id);
2799
+ return domain.db.prepare("SELECT * FROM pull_request_review_comments WHERE id = ?").get(result.lastInsertRowid);
2800
+ });
2801
+ domain.audit("add_reply_to_pull_request_comment", repo.full_name, input);
2802
+ onDelta?.({ before: null, after: pullRequestReviewCommentState(reply, repo) });
2803
+ return pullRequestReviewCommentJson(reply, repo);
2804
+ }
2805
+
2806
+ // ../packages/twin-github/dist/src/domain/releases.js
2807
+ function listTags(domain, input) {
2808
+ const repo = domain.requireRepo(input.owner, input.repo);
2809
+ const rows = domain.db.prepare("SELECT * FROM tags WHERE repo_id = ? ORDER BY created_at DESC").all(repo.id);
2810
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((tag) => tagJson(tag, repo));
2811
+ }
2812
+ function listReleases(domain, input) {
2813
+ const repo = domain.requireRepo(input.owner, input.repo);
2814
+ const rows = domain.db.prepare("SELECT * FROM releases WHERE repo_id = ? ORDER BY created_at DESC").all(repo.id);
2815
+ return paginate(rows, input.page, input.per_page ?? input.perPage).map((release) => releaseJson(release, repo));
2816
+ }
2817
+ function getLatestRelease(domain, input) {
2818
+ const repo = domain.requireRepo(input.owner, input.repo);
2819
+ const row = domain.db.prepare("SELECT * FROM releases WHERE repo_id = ? AND draft = 0 AND prerelease = 0 AND published_at IS NOT NULL ORDER BY published_at DESC LIMIT 1").get(repo.id);
2820
+ if (!row)
2821
+ notFound("Not Found");
2822
+ return releaseJson(row, repo);
2823
+ }
2824
+ function getReleaseByTag(domain, input) {
2825
+ const repo = domain.requireRepo(input.owner, input.repo);
2826
+ const row = domain.db.prepare("SELECT * FROM releases WHERE repo_id = ? AND tag_name = ?").get(repo.id, input.tag);
2827
+ if (!row)
2828
+ notFound("Not Found");
2829
+ return releaseJson(row, repo);
2830
+ }
2831
+ function getTag(domain, input) {
2832
+ const repo = domain.requireRepo(input.owner, input.repo);
2833
+ const row = domain.db.prepare("SELECT * FROM tags WHERE repo_id = ? AND name = ?").get(repo.id, input.tag);
2834
+ if (!row)
2835
+ notFound("Not Found");
2836
+ return tagJson(row, repo);
2837
+ }
2838
+ function createRelease(domain, input, options = {}, onDelta) {
2839
+ const repo = domain.requireRepo(input.owner, input.repo);
2840
+ const release = domain.transaction(() => {
2841
+ if (!input.tag_name.trim())
2842
+ validationFailed("tag_name", "missing");
2843
+ const existingRelease = domain.db.prepare("SELECT id FROM releases WHERE repo_id = ? AND tag_name = ?").get(repo.id, input.tag_name);
2844
+ if (existingRelease)
2845
+ validationFailed("tag_name", "already_exists", input.tag_name);
2846
+ const target = input.target_commitish ?? repo.default_branch;
2847
+ let tag = domain.db.prepare("SELECT * FROM tags WHERE repo_id = ? AND name = ?").get(repo.id, input.tag_name);
2848
+ if (!tag) {
2849
+ const sha = domain.resolveRefToSha(repo, target);
2850
+ const now2 = nowIso();
2851
+ domain.db.prepare("INSERT INTO tags (repo_id, name, commit_sha, created_at) VALUES (?, ?, ?, ?)").run(repo.id, input.tag_name, sha, now2);
2852
+ tag = { repo_id: repo.id, name: input.tag_name, commit_sha: sha, created_at: now2 };
2853
+ }
2854
+ const draft = input.draft ? 1 : 0;
2855
+ const prerelease = input.prerelease ? 1 : 0;
2856
+ const now = nowIso();
2857
+ const result = domain.db.prepare("INSERT INTO releases (repo_id, tag_name, target_commitish, name, body, draft, prerelease, author_login, created_at, published_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(repo.id, input.tag_name, target, input.name ?? null, input.body ?? "", draft, prerelease, options.actor ?? "pome-agent", now, draft ? null : now);
2858
+ return domain.db.prepare("SELECT * FROM releases WHERE id = ?").get(result.lastInsertRowid);
2859
+ });
2860
+ domain.audit("create_release", repo.full_name, input);
2861
+ onDelta?.({ before: null, after: releaseState(release, repo) });
2862
+ return releaseJson(release, repo);
2863
+ }
2864
+
2865
+ // ../packages/twin-github/dist/src/domain/repos.js
2866
+ function getRepository(domain, input) {
2867
+ return repoJson(domain.requireRepo(input.owner, input.repo));
2868
+ }
2869
+ function createRepository(domain, input, onDelta) {
2870
+ const owner = input.owner ?? "pome-agent";
2871
+ const repo = domain.transaction(() => {
2872
+ domain.upsertUser(owner, "Organization", owner);
2873
+ if (domain.getRepo(owner, input.name))
2874
+ validationFailed("name", "already_exists", input.name);
2875
+ const created2 = domain.insertRepository({
2876
+ owner,
2877
+ name: input.name,
2878
+ description: input.description ?? "",
2879
+ private: input.private ?? false,
2880
+ defaultBranch: "main",
2881
+ fork: false,
2882
+ parentFullName: null
2883
+ });
2884
+ domain.addCollaborator(created2.id, "pome-agent");
2885
+ domain.createBranchInternal(created2, "main", null);
2886
+ domain.commitFiles(created2, "main", "Initial commit", [{ path: "README.md", content: `# ${input.name}
2887
+ ` }], "pome-agent");
2888
+ return created2;
2889
+ });
2890
+ domain.audit("create_repository", repo.full_name, input);
2891
+ const final = domain.requireRepo(owner, input.name);
2892
+ onDelta?.({ before: null, after: repoState(final) });
2893
+ return repoJson(final);
2894
+ }
2895
+ function forkRepository(domain, input, onDelta) {
2896
+ const source = domain.requireRepo(input.owner, input.repo);
2897
+ const owner = input.organization ?? "pome-agent";
2898
+ const fork = domain.transaction(() => {
2899
+ domain.upsertUser(owner, owner === input.organization ? "Organization" : "User", owner);
2900
+ if (domain.getRepo(owner, source.name))
2901
+ validationFailed("name", "already_exists", source.name);
2902
+ const created2 = domain.insertRepository({
2903
+ owner,
2904
+ name: source.name,
2905
+ description: source.description,
2906
+ private: Boolean(source.private),
2907
+ defaultBranch: source.default_branch,
2908
+ fork: true,
2909
+ parentFullName: source.full_name
2910
+ });
2911
+ domain.addCollaborator(created2.id, "pome-agent");
2912
+ const commitShaMap = domain.copyForkCommits(source, created2);
2913
+ for (const branch of domain.listBranches(source.id)) {
2914
+ domain.createBranchInternal(created2, branch.name, branch.head_sha ? commitShaMap.get(branch.head_sha) ?? null : null);
2915
+ const files = domain.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ?").all(source.id, branch.name);
2916
+ for (const file of files) {
2917
+ domain.db.prepare("INSERT INTO files (repo_id, branch, path, content, sha, size, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)").run(created2.id, file.branch, file.path, file.content, file.sha, file.size, nowIso());
2918
+ }
2919
+ }
2920
+ return created2;
2921
+ });
2922
+ domain.audit("fork_repository", fork.full_name, input);
2923
+ onDelta?.({ before: null, after: repoState(fork) });
2924
+ return repoJson(fork);
2925
+ }
2926
+ function listCollaborators(domain, input) {
2927
+ const repo = domain.requireRepo(input.owner, input.repo);
2928
+ const rows = domain.db.prepare("SELECT login FROM collaborators WHERE repo_id = ? ORDER BY login ASC").all(repo.id);
2929
+ return rows.map((row) => userJson(row.login));
2930
+ }
2931
+ function isCollaborator(domain, input) {
2932
+ const repo = domain.requireRepo(input.owner, input.repo);
2933
+ return domain.hasCollaborator(repo.id, input.username);
2934
+ }
2935
+ function hasRepositoryPermission(domain, input) {
2936
+ const repo = domain.requireRepo(input.owner, input.repo);
2937
+ const row = domain.db.prepare("SELECT permission, invitation_state FROM collaborators WHERE repo_id = ? AND login = ?").get(repo.id, input.username);
2938
+ return Boolean(row && row.invitation_state === "accepted" && input.permissions.includes(row.permission));
2939
+ }
2940
+ function getMe(domain, input = {}) {
2941
+ const login = input.actor ?? "pome-agent";
2942
+ return authenticatedUserJson(login);
2943
+ }
2944
+ function addCollaboratorAction(domain, input, onDelta) {
2945
+ const repo = domain.requireRepo(input.owner, input.repo);
2946
+ let invitationState = "accepted";
2947
+ let alreadyCollaborator = false;
2948
+ let beforeState = null;
2949
+ let afterState = null;
2950
+ domain.transaction(() => {
2951
+ if (!input.username.trim())
2952
+ validationFailed("username", "missing");
2953
+ const existing = domain.db.prepare("SELECT * FROM collaborators WHERE repo_id = ? AND login = ?").get(repo.id, input.username);
2954
+ if (existing) {
2955
+ alreadyCollaborator = true;
2956
+ invitationState = existing.invitation_state ?? "accepted";
2957
+ beforeState = collaboratorAddState(repo, input.username, invitationState, existing.permission);
2958
+ const nextPermission = input.permission ?? existing.permission;
2959
+ if (input.permission && input.permission !== existing.permission) {
2960
+ domain.db.prepare("UPDATE collaborators SET permission = ? WHERE repo_id = ? AND login = ?").run(input.permission, repo.id, input.username);
2961
+ }
2962
+ afterState = collaboratorAddState(repo, input.username, invitationState, nextPermission);
2963
+ return;
2964
+ }
2965
+ const isSeededUser = Boolean(domain.db.prepare("SELECT 1 FROM users WHERE login = ?").get(input.username));
2966
+ invitationState = isSeededUser ? "accepted" : "pending";
2967
+ domain.upsertUser(input.username, "User", input.username);
2968
+ domain.db.prepare("INSERT INTO collaborators (repo_id, login, permission, invitation_state) VALUES (?, ?, ?, ?)").run(repo.id, input.username, input.permission ?? "push", invitationState);
2969
+ afterState = collaboratorAddState(repo, input.username, invitationState, input.permission ?? "push");
2970
+ });
2971
+ domain.audit("add_collaborator", repo.full_name, input);
2972
+ onDelta?.({ before: beforeState, after: afterState });
2973
+ if (alreadyCollaborator && invitationState === "accepted") {
2974
+ return { status: 204, body: null };
2975
+ }
2976
+ return {
2977
+ status: 201,
2978
+ body: {
2979
+ id: stableNumericId(`${repo.full_name}:invite:${input.username}`),
2980
+ node_id: `RI_${stableNumericId(`${repo.full_name}:invite:${input.username}`)}`,
2981
+ repository: repoJson(repo),
2982
+ invitee: userJson(input.username),
2983
+ inviter: userJson(input.actor ?? "pome-agent"),
2984
+ permissions: input.permission ?? "push",
2985
+ created_at: nowIso(),
2986
+ expired: false,
2987
+ url: `https://api.github.com/repos/${repo.full_name}/invitations/${input.username}`,
2988
+ html_url: `https://github.com/${repo.full_name}/invitations`
2989
+ }
2990
+ };
2991
+ }
2992
+
2993
+ // ../packages/twin-github/dist/src/domain/search.js
2994
+ function searchRepositories(domain, input) {
2995
+ const query = (input.query ?? input.q ?? "").toLowerCase();
2996
+ const repos = domain.db.prepare("SELECT * FROM repositories ORDER BY full_name ASC").all().filter((repo) => !query || repo.full_name.toLowerCase().includes(query) || repo.description.toLowerCase().includes(query));
2997
+ const items = paginate(repos, input.page, input.per_page ?? input.perPage).map(repoJson);
2998
+ return { total_count: repos.length, incomplete_results: false, items };
2999
+ }
3000
+ function searchUsers(domain, input) {
3001
+ const query = (input.query ?? input.q ?? "").toLowerCase();
3002
+ const rows = domain.db.prepare("SELECT login, type FROM users ORDER BY login ASC").all();
3003
+ const users = rows.filter((user) => !query || user.login.toLowerCase().includes(query));
3004
+ return { total_count: users.length, incomplete_results: false, items: paginate(users, input.page, input.per_page ?? input.perPage).map((user) => userJson(user.login, user.type)) };
3005
+ }
3006
+ function searchCode(domain, input) {
3007
+ const query = (input.query ?? input.q ?? "").toLowerCase();
3008
+ let rows = domain.db.prepare("SELECT files.*, repositories.owner, repositories.name, repositories.full_name, repositories.description, repositories.private, repositories.default_branch, repositories.fork, repositories.parent_full_name, repositories.entity_counter, repositories.created_at, repositories.updated_at FROM files INNER JOIN repositories ON files.repo_id = repositories.id WHERE files.branch = repositories.default_branch ORDER BY repositories.full_name, files.path").all();
3009
+ if (input.owner)
3010
+ rows = rows.filter((row) => row.owner === input.owner);
3011
+ if (input.repo)
3012
+ rows = rows.filter((row) => row.name === input.repo);
3013
+ rows = rows.filter((row) => !query || row.path.toLowerCase().includes(query) || row.content.toLowerCase().includes(query));
3014
+ return {
3015
+ total_count: rows.length,
3016
+ incomplete_results: false,
3017
+ items: paginate(rows, input.page, input.per_page ?? input.perPage).map((row) => ({
3018
+ name: row.path.split("/").at(-1),
3019
+ path: row.path,
3020
+ sha: row.sha,
3021
+ url: `https://api.github.com/repos/${row.full_name}/contents/${row.path}`,
3022
+ git_url: `https://api.github.com/repos/${row.full_name}/git/blobs/${row.sha}`,
3023
+ html_url: `https://github.com/${row.full_name}/blob/${row.branch}/${row.path}`,
3024
+ repository: repoJson(row)
3025
+ }))
3026
+ };
3027
+ }
3028
+ function searchCommits(domain, input) {
3029
+ const query = (input.query ?? input.q ?? "").toLowerCase();
3030
+ let repos = domain.db.prepare("SELECT * FROM repositories ORDER BY full_name ASC").all();
3031
+ if (input.owner)
3032
+ repos = repos.filter((repo) => repo.owner === input.owner);
3033
+ if (input.repo)
3034
+ repos = repos.filter((repo) => repo.name === input.repo);
3035
+ const matches = [];
3036
+ for (const repo of repos) {
3037
+ const branch = domain.db.prepare("SELECT * FROM branches WHERE repo_id = ? AND name = ?").get(repo.id, repo.default_branch);
3038
+ if (!branch?.head_sha)
3039
+ continue;
3040
+ for (const commit of domain.commitAncestry(repo.id, branch.head_sha)) {
3041
+ if (!query || commit.message.toLowerCase().includes(query) || commit.author_login.toLowerCase().includes(query))
3042
+ matches.push({ commit, repo });
3043
+ }
3044
+ }
3045
+ return {
3046
+ total_count: matches.length,
3047
+ incomplete_results: false,
3048
+ items: paginate(matches, input.page, input.per_page ?? input.perPage).map(({ commit, repo }) => ({ ...commitJson(commit, repo), repository: repoJson(repo), score: 1 }))
3049
+ };
3050
+ }
3051
+ function searchIssues(domain, input) {
3052
+ const query = (input.query ?? input.q ?? "").toLowerCase();
3053
+ const rows = domain.db.prepare("SELECT issues.*, repositories.owner, repositories.name, repositories.full_name, repositories.description, repositories.private, repositories.default_branch, repositories.fork, repositories.parent_full_name, repositories.entity_counter, repositories.created_at AS repo_created_at, repositories.updated_at AS repo_updated_at FROM issues INNER JOIN repositories ON issues.repo_id = repositories.id ORDER BY issues.updated_at DESC").all();
3054
+ let filtered = rows.filter((issue) => !query || issue.title.toLowerCase().includes(query) || issue.body.toLowerCase().includes(query) || issue.full_name.toLowerCase().includes(query));
3055
+ if (input.owner)
3056
+ filtered = filtered.filter((issue) => issue.owner === input.owner);
3057
+ if (input.repo)
3058
+ filtered = filtered.filter((issue) => issue.name === input.repo);
3059
+ if (input.state && input.state !== "all")
3060
+ filtered = filtered.filter((issue) => issue.state === input.state);
3061
+ return {
3062
+ total_count: filtered.length,
3063
+ incomplete_results: false,
3064
+ items: paginate(filtered, input.page, input.per_page ?? input.perPage).map((issue) => {
3065
+ const repo = domain.requireRepoById(issue.repo_id);
3066
+ return issueJson(issue, repo, domain.listIssueLabels(issue.repo_id, issue.number), domain.listIssueAssignees(issue.repo_id, issue.number), domain.issueCommentCount(issue.repo_id, issue.number));
3067
+ })
3068
+ };
3069
+ }
3070
+
3071
+ // ../packages/twin-github/dist/src/domain/github-domain.js
3072
+ var GitHubDomain = class {
3073
+ db;
3074
+ constructor(db) {
3075
+ this.db = db;
3076
+ }
3077
+ seed(seed = defaultSeedState(), onDelta) {
3078
+ const parsedSeed = parseSeed(seed);
3079
+ const before = this.summarizeRepositories();
3080
+ const tx = this.db.transaction(() => {
3081
+ resetDatabase(this.db);
3082
+ const users = new Set(parsedSeed.users?.map((user) => user.login) ?? []);
3083
+ for (const repo of parsedSeed.repositories) {
3084
+ users.add(repo.owner);
3085
+ for (const login of repo.collaborators ?? [])
3086
+ users.add(login);
3087
+ for (const issue of repo.issues ?? [])
3088
+ for (const login of issue.assignees ?? [])
3089
+ users.add(login);
3090
+ }
3091
+ users.add("pome-agent");
3092
+ for (const user of parsedSeed.users ?? []) {
3093
+ this.upsertUser(user.login, user.type ?? "User", user.name ?? "");
3094
+ }
3095
+ for (const login of users) {
3096
+ this.upsertUser(login, login === "acme" ? "Organization" : "User", login);
3097
+ }
3098
+ for (const repoSeed of parsedSeed.repositories) {
3099
+ const repo = this.insertRepository({
3100
+ owner: repoSeed.owner,
3101
+ name: repoSeed.name,
3102
+ description: repoSeed.description ?? "",
3103
+ private: repoSeed.private ?? false,
3104
+ defaultBranch: repoSeed.default_branch ?? "main",
3105
+ fork: false,
3106
+ parentFullName: null
3107
+ });
3108
+ for (const login of repoSeed.collaborators ?? [])
3109
+ this.addCollaborator(repo.id, login);
3110
+ this.addCollaborator(repo.id, "pome-agent");
3111
+ for (const label of repoSeed.labels ?? []) {
3112
+ this.createLabel(repo, label.name, label.color ?? "ededed", label.description ?? "");
3113
+ }
3114
+ this.createBranchInternal(repo, repo.default_branch, null);
3115
+ const files = repoSeed.files?.filter((file) => (file.branch ?? repo.default_branch) === repo.default_branch) ?? [];
3116
+ this.commitFiles(repo, repo.default_branch, "Initial seed commit", files, "pome-agent");
3117
+ const nonDefaultBranches = new Set((repoSeed.files ?? []).map((file) => file.branch ?? repo.default_branch).filter((branch) => branch !== repo.default_branch));
3118
+ for (const branch of nonDefaultBranches) {
3119
+ this.createBranch({ owner: repo.owner, repo: repo.name, branch, from_branch: repo.default_branch });
3120
+ const branchFiles = repoSeed.files?.filter((file) => (file.branch ?? repo.default_branch) === branch) ?? [];
3121
+ this.commitFiles(repo, branch, `Seed ${branch}`, branchFiles, "pome-agent");
3122
+ }
3123
+ for (const issue of repoSeed.issues ?? []) {
3124
+ const legacyAssignee = issue.assignee;
3125
+ const assignees = issue.assignees ?? (legacyAssignee ? [legacyAssignee] : []);
3126
+ const created2 = this.createIssue({ owner: repo.owner, repo: repo.name, title: issue.title, body: issue.body ?? "", labels: issue.labels ?? [], assignees });
3127
+ if (issue.number && issue.number !== created2.number) {
3128
+ const from = created2.number;
3129
+ const to = issue.number;
3130
+ this.db.prepare("UPDATE issues SET number = ? WHERE repo_id = ? AND number = ?").run(to, repo.id, from);
3131
+ this.db.prepare("UPDATE issue_labels SET issue_number = ? WHERE repo_id = ? AND issue_number = ?").run(to, repo.id, from);
3132
+ this.db.prepare("UPDATE issue_assignees SET issue_number = ? WHERE repo_id = ? AND issue_number = ?").run(to, repo.id, from);
3133
+ this.db.prepare("UPDATE issue_comments SET issue_number = ? WHERE repo_id = ? AND issue_number = ?").run(to, repo.id, from);
3134
+ this.bumpEntityCounter(repo.id, to);
3135
+ }
3136
+ if (issue.state === "closed")
3137
+ this.updateIssue({ owner: repo.owner, repo: repo.name, issue_number: issue.number ?? created2.number, state: "closed" });
3138
+ }
3139
+ for (const pull of repoSeed.pull_requests ?? []) {
3140
+ const createdPr = this.createPullRequest({ owner: repo.owner, repo: repo.name, title: pull.title, body: pull.body ?? "", head: pull.head, base: pull.base ?? repo.default_branch, actor: pull.author });
3141
+ const prNumber2 = createdPr.number;
3142
+ const seedsHead = (pull.reviews ?? []).length > 0 || (pull.statuses ?? []).length > 0;
3143
+ const prRow = seedsHead ? this.requirePullRequest(repo.id, prNumber2) : null;
3144
+ const headRepo = prRow ? this.requireRepoById(prRow.head_repo_id) : null;
3145
+ const headSha = prRow && headRepo ? this.requireBranch(headRepo.id, prRow.head_ref).head_sha ?? "" : "";
3146
+ for (const review of pull.reviews ?? []) {
3147
+ users.add(review.author);
3148
+ this.upsertUser(review.author, "User", review.author);
3149
+ this.db.prepare("INSERT INTO pull_request_reviews (repo_id, pull_number, user_login, state, body, commit_sha, submitted_at) VALUES (?, ?, ?, ?, ?, ?, ?)").run(
3150
+ repo.id,
3151
+ prNumber2,
3152
+ review.author,
3153
+ // parseSeed defaults this to "APPROVED"; guard direct seed() callers
3154
+ // that pass a hand-built seed with no explicit review state.
3155
+ review.state ?? "APPROVED",
3156
+ review.body ?? "",
3157
+ headSha,
3158
+ nowIso()
3159
+ );
3160
+ }
3161
+ if ((pull.statuses ?? []).length > 0 && headRepo) {
3162
+ for (const status of pull.statuses ?? []) {
3163
+ this.createStatus({
3164
+ owner: headRepo.owner,
3165
+ repo: headRepo.name,
3166
+ sha: headSha,
3167
+ state: status.state ?? "success",
3168
+ context: status.context ?? "ci/build",
3169
+ description: status.description ?? ""
3170
+ });
3171
+ }
3172
+ }
3173
+ }
3174
+ }
3175
+ this.audit("seed", null, { repositories: parsedSeed.repositories.length });
3176
+ });
3177
+ tx();
3178
+ onDelta?.({
3179
+ before: { repositories: before },
3180
+ after: { repositories: this.summarizeRepositories() }
3181
+ });
3182
+ }
3183
+ summarizeRepositories() {
3184
+ const rows = this.db.prepare("SELECT owner, name FROM repositories ORDER BY full_name ASC").all();
3185
+ return rows;
3186
+ }
3187
+ exportState() {
3188
+ const repos = this.db.prepare("SELECT * FROM repositories ORDER BY full_name ASC").all();
3189
+ return {
3190
+ repositories: repos.map((repo) => ({
3191
+ ...repo,
3192
+ branches: this.listBranches(repo.id),
3193
+ files: this.db.prepare("SELECT * FROM files WHERE repo_id = ? ORDER BY branch, path").all(repo.id),
3194
+ labels: this.listLabels(repo.id),
3195
+ issues: this.listIssuesRows(repo.id).map((issue) => ({
3196
+ ...issue,
3197
+ labels: this.listIssueLabels(repo.id, issue.number),
3198
+ assignees: this.listIssueAssignees(repo.id, issue.number),
3199
+ comments: this.listIssueCommentRows(repo.id, issue.number)
3200
+ })),
3201
+ pull_requests: this.listPullRequestRows(repo.id).map((pull) => ({
3202
+ ...pull,
3203
+ files: this.listPullRequestFileRows(repo.id, pull.number),
3204
+ reviews: this.listPullRequestReviewRows(repo.id, pull.number),
3205
+ review_comments: this.listPullRequestReviewCommentRows(repo.id, pull.number),
3206
+ // F-1151. THREE distinct comment surfaces reach a pull request and this
3207
+ // is the third, so the export keeps them apart rather than merging them
3208
+ // into one count a predicate could not attribute:
3209
+ // `reviews[].body` — the prose attached to a review verdict
3210
+ // `review_comments[]` — inline comments anchored to a file and line
3211
+ // `comments[]` — the conversation timeline, THIS one
3212
+ // Read from `issue_comments` because that is where GitHub puts them:
3213
+ // conversation comments on a PR go through the issue-comment endpoints,
3214
+ // and the number space is shared, so a PR's number selects its own rows
3215
+ // and no issue's.
3216
+ comments: this.listIssueCommentRows(repo.id, pull.number)
3217
+ })),
3218
+ commit_statuses: this.db.prepare("SELECT * FROM commit_statuses WHERE repo_id = ? ORDER BY id ASC").all(repo.id),
3219
+ check_runs: this.db.prepare("SELECT * FROM check_runs WHERE repo_id = ? ORDER BY id ASC").all(repo.id)
3220
+ }))
3221
+ };
3222
+ }
3223
+ getRepository(input) {
3224
+ return getRepository(this, input);
3225
+ }
3226
+ createRepository(input, onDelta) {
3227
+ return createRepository(this, input, onDelta);
3228
+ }
3229
+ forkRepository(input, onDelta) {
3230
+ return forkRepository(this, input, onDelta);
3231
+ }
3232
+ searchRepositories(input) {
3233
+ return searchRepositories(this, input);
3234
+ }
3235
+ searchUsers(input) {
3236
+ return searchUsers(this, input);
3237
+ }
3238
+ searchCode(input) {
3239
+ return searchCode(this, input);
3240
+ }
3241
+ searchCommits(input) {
3242
+ return searchCommits(this, input);
3243
+ }
3244
+ getFileContents(input) {
3245
+ return getFileContents(this, input);
3246
+ }
3247
+ listCommits(input) {
3248
+ return listCommits(this, input);
3249
+ }
3250
+ createOrUpdateFile(input, options = {}, onDelta) {
3251
+ return createOrUpdateFile(this, input, options, onDelta);
3252
+ }
3253
+ pushFiles(input, options = {}, onDelta) {
3254
+ return pushFiles(this, input, options, onDelta);
3255
+ }
3256
+ createBranch(input, onDelta) {
3257
+ return createBranch(this, input, onDelta);
3258
+ }
3259
+ createIssue(input, onDelta) {
3260
+ return createIssue(this, input, onDelta);
3261
+ }
3262
+ listIssues(input) {
3263
+ return listIssues(this, input);
3264
+ }
3265
+ searchIssues(input) {
3266
+ return searchIssues(this, input);
3267
+ }
3268
+ getIssue(input) {
3269
+ return getIssue(this, input);
3270
+ }
3271
+ updateIssue(input, onDelta) {
3272
+ return updateIssue(this, input, onDelta);
3273
+ }
3274
+ addIssueComment(input, onDelta) {
3275
+ return addIssueComment(this, input, onDelta);
3276
+ }
3277
+ listIssueComments(input) {
3278
+ return listIssueComments(this, input);
3279
+ }
3280
+ listRepositoryLabels(input) {
3281
+ return listRepositoryLabels(this, input);
3282
+ }
3283
+ createRepositoryLabel(input, onDelta) {
3284
+ return createRepositoryLabel(this, input, onDelta);
3285
+ }
3286
+ listIssueLabelsForIssue(input) {
3287
+ return listIssueLabelsForIssue(this, input);
3288
+ }
3289
+ addIssueLabels(input, onDelta) {
3290
+ return addIssueLabels(this, input, onDelta);
3291
+ }
3292
+ deleteIssueLabel(input, onDelta) {
3293
+ return deleteIssueLabel(this, input, onDelta);
3294
+ }
3295
+ listCollaborators(input) {
3296
+ return listCollaborators(this, input);
3297
+ }
3298
+ isCollaborator(input) {
3299
+ return isCollaborator(this, input);
3300
+ }
3301
+ hasRepositoryPermission(input) {
3302
+ return hasRepositoryPermission(this, input);
3303
+ }
3304
+ addAssignees(input, onDelta) {
3305
+ return addAssignees(this, input, onDelta);
3306
+ }
3307
+ createPullRequest(input, onDelta) {
3308
+ return createPullRequest(this, input, onDelta);
3309
+ }
3310
+ listPullRequests(input) {
3311
+ return listPullRequests(this, input);
3312
+ }
3313
+ getPullRequest(input) {
3314
+ return getPullRequest(this, input);
3315
+ }
3316
+ getPullRequestFiles(input) {
3317
+ return getPullRequestFiles(this, input);
3318
+ }
3319
+ getPullRequestReviews(input) {
3320
+ return getPullRequestReviews(this, input);
3321
+ }
3322
+ createPullRequestReview(input, onDelta) {
3323
+ return createPullRequestReview(this, input, onDelta);
3324
+ }
3325
+ getPullRequestComments(input) {
3326
+ return getPullRequestComments(this, input);
3327
+ }
3328
+ getPullRequestStatus(input) {
3329
+ return getPullRequestStatus(this, input);
3330
+ }
3331
+ mergePullRequest(input, onDelta) {
3332
+ return mergePullRequest(this, input, onDelta);
3333
+ }
3334
+ updatePullRequestBranch(input, onDelta) {
3335
+ return updatePullRequestBranch(this, input, onDelta);
3336
+ }
3337
+ createStatus(input) {
3338
+ return createStatus(this, input);
3339
+ }
3340
+ listBranchesForRepo(input) {
3341
+ return listBranchesForRepo(this, input);
3342
+ }
3343
+ getBranchByName(input) {
3344
+ return getBranchByName(this, input);
3345
+ }
3346
+ deleteBranch(input, onDelta) {
3347
+ return deleteBranch(this, input, onDelta);
3348
+ }
3349
+ deleteFile(input, options = {}, onDelta) {
3350
+ return deleteFile(this, input, options, onDelta);
3351
+ }
3352
+ getCommitWithFiles(input) {
3353
+ return getCommitWithFiles(this, input);
3354
+ }
3355
+ compareCommits(input) {
3356
+ return compareCommits(this, input);
3357
+ }
3358
+ getPullRequestDiff(input) {
3359
+ return getPullRequestDiff(this, input);
3360
+ }
3361
+ updatePullRequest(input, onDelta) {
3362
+ return updatePullRequest(this, input, onDelta);
3363
+ }
3364
+ getPullRequestCommits(input) {
3365
+ return getPullRequestCommits(this, input);
3366
+ }
3367
+ createPullRequestReviewComment(input, options = {}, onDelta) {
3368
+ return createPullRequestReviewComment(this, input, options, onDelta);
3369
+ }
3370
+ addReplyToPullRequestComment(input, options = {}, onDelta) {
3371
+ return addReplyToPullRequestComment(this, input, options, onDelta);
3372
+ }
3373
+ updateIssueComment(input, onDelta) {
3374
+ return updateIssueComment(this, input, onDelta);
3375
+ }
3376
+ deleteIssueComment(input, onDelta) {
3377
+ return deleteIssueComment(this, input, onDelta);
3378
+ }
3379
+ listMilestones(input) {
3380
+ return listMilestones(this, input);
3381
+ }
3382
+ createMilestone(input, onDelta) {
3383
+ return createMilestone(this, input, onDelta);
3384
+ }
3385
+ updateMilestone(input, onDelta) {
3386
+ return updateMilestone(this, input, onDelta);
3387
+ }
3388
+ deleteMilestone(input, onDelta) {
3389
+ return deleteMilestone(this, input, onDelta);
3390
+ }
3391
+ createCommitStatus(input, onDelta) {
3392
+ return createCommitStatus(this, input, onDelta);
3393
+ }
3394
+ getCombinedStatusForRef(input) {
3395
+ return getCombinedStatusForRef(this, input);
3396
+ }
3397
+ createCheckRun(input, onDelta) {
3398
+ return createCheckRun(this, input, onDelta);
3399
+ }
3400
+ listCheckRunsForRef(input) {
3401
+ return listCheckRunsForRef(this, input);
3402
+ }
3403
+ listTags(input) {
3404
+ return listTags(this, input);
3405
+ }
3406
+ listReleases(input) {
3407
+ return listReleases(this, input);
3408
+ }
3409
+ getLatestRelease(input) {
3410
+ return getLatestRelease(this, input);
3411
+ }
3412
+ getReleaseByTag(input) {
3413
+ return getReleaseByTag(this, input);
3414
+ }
3415
+ getTag(input) {
3416
+ return getTag(this, input);
3417
+ }
3418
+ createRelease(input, options = {}, onDelta) {
3419
+ return createRelease(this, input, options, onDelta);
3420
+ }
3421
+ getMe(input = {}) {
3422
+ return getMe(this, input);
3423
+ }
3424
+ addCollaboratorAction(input, onDelta) {
3425
+ return addCollaboratorAction(this, input, onDelta);
3426
+ }
3427
+ // ----- shared helpers (used by domain/* modules) -----
3428
+ latestCommitStatuses(repoId, sha) {
3429
+ const statuses = this.db.prepare("SELECT * FROM commit_statuses WHERE repo_id = ? AND sha = ? ORDER BY updated_at DESC, id DESC").all(repoId, sha);
3430
+ const latestByContext = /* @__PURE__ */ new Map();
3431
+ for (const status of statuses) {
3432
+ if (!latestByContext.has(status.context))
3433
+ latestByContext.set(status.context, status);
3434
+ }
3435
+ return [...latestByContext.values()];
3436
+ }
3437
+ // ===== private helpers added for v2 hot paths ============================
3438
+ requireCommitOnRepo(repoId, sha) {
3439
+ const exists = this.db.prepare("SELECT 1 FROM commits WHERE repo_id = ? AND sha = ?").get(repoId, sha);
3440
+ if (!exists)
3441
+ notFound("No commit found for SHA");
3442
+ }
3443
+ resolveCommitByRef(repo, ref) {
3444
+ const byHash = this.db.prepare("SELECT * FROM commits WHERE repo_id = ? AND sha = ?").get(repo.id, ref);
3445
+ if (byHash)
3446
+ return byHash;
3447
+ const branch = this.getBranch(repo.id, ref);
3448
+ if (branch?.head_sha) {
3449
+ const commit = this.db.prepare("SELECT * FROM commits WHERE repo_id = ? AND sha = ?").get(repo.id, branch.head_sha);
3450
+ if (commit)
3451
+ return commit;
3452
+ }
3453
+ const tag = this.db.prepare("SELECT * FROM tags WHERE repo_id = ? AND name = ?").get(repo.id, ref);
3454
+ if (tag) {
3455
+ const commit = this.db.prepare("SELECT * FROM commits WHERE repo_id = ? AND sha = ?").get(repo.id, tag.commit_sha);
3456
+ if (commit)
3457
+ return commit;
3458
+ }
3459
+ notFound("No commit found for ref");
3460
+ }
3461
+ resolveRefToSha(repo, ref) {
3462
+ return this.resolveCommitByRef(repo, ref).sha;
3463
+ }
3464
+ commitAncestry(repoId, sha) {
3465
+ const all = this.db.prepare("SELECT * FROM commits WHERE repo_id = ?").all(repoId);
3466
+ const bySha = new Map(all.map((commit) => [commit.sha, commit]));
3467
+ const out = [];
3468
+ const seen = /* @__PURE__ */ new Set();
3469
+ const MAX_DEPTH = 2e3;
3470
+ let cursor = sha;
3471
+ while (cursor && out.length < MAX_DEPTH) {
3472
+ if (seen.has(cursor))
3473
+ break;
3474
+ seen.add(cursor);
3475
+ const commit = bySha.get(cursor);
3476
+ if (!commit)
3477
+ break;
3478
+ out.push(commit);
3479
+ cursor = commit.parent_sha;
3480
+ }
3481
+ return out;
3482
+ }
3483
+ findMergeBase(baseRepo, baseSha, headRepo, headSha) {
3484
+ if (!baseSha || !headSha)
3485
+ return null;
3486
+ const headAncestry = this.commitAncestry(headRepo.id, headSha);
3487
+ const headShas = new Set(headAncestry.map((commit) => commit.sha));
3488
+ const headKeys = baseRepo.id === headRepo.id ? null : new Set(headAncestry.map((commit) => commitIdentityKey(commit)));
3489
+ for (const commit of this.commitAncestry(baseRepo.id, baseSha)) {
3490
+ if (headShas.has(commit.sha))
3491
+ return commit.sha;
3492
+ if (headKeys?.has(commitIdentityKey(commit)))
3493
+ return commit.sha;
3494
+ }
3495
+ return null;
3496
+ }
3497
+ /** File state (path → blob) as of a commit, reconstructed from file_versions. */
3498
+ fileStateAtCommit(repoId, sha) {
3499
+ const state = /* @__PURE__ */ new Map();
3500
+ if (!sha)
3501
+ return state;
3502
+ const seen = /* @__PURE__ */ new Set();
3503
+ for (const commit of this.commitAncestry(repoId, sha)) {
3504
+ const versions = this.db.prepare("SELECT path, content, sha, status FROM file_versions WHERE repo_id = ? AND commit_sha = ?").all(repoId, commit.sha);
3505
+ for (const version of versions) {
3506
+ if (seen.has(version.path))
3507
+ continue;
3508
+ seen.add(version.path);
3509
+ if (version.status !== "removed")
3510
+ state.set(version.path, { content: version.content, sha: version.sha });
3511
+ }
3512
+ }
3513
+ return state;
3514
+ }
3515
+ /** Net base-branch changes since the merge base, skipping paths the head branch also touched (head wins). */
3516
+ mergeChangesFromBase(baseRepo, baseRef, headRepo, headRef, mergeBase) {
3517
+ const branchFiles = (repoId, branch) => new Map(this.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ?").all(repoId, branch).map((file) => [file.path, file]));
3518
+ const baseNow = branchFiles(baseRepo.id, baseRef);
3519
+ const headNow = branchFiles(headRepo.id, headRef);
3520
+ const atMergeBase = this.fileStateAtCommit(baseRepo.id, mergeBase);
3521
+ const changes = [];
3522
+ for (const path of /* @__PURE__ */ new Set([...baseNow.keys(), ...atMergeBase.keys()])) {
3523
+ const current = baseNow.get(path);
3524
+ const original = atMergeBase.get(path);
3525
+ if (current?.sha === original?.sha)
3526
+ continue;
3527
+ if (headNow.get(path)?.sha !== original?.sha)
3528
+ continue;
3529
+ if (!current)
3530
+ changes.push({ path, content: "", delete: true });
3531
+ else
3532
+ changes.push({ path, content: current.content });
3533
+ }
3534
+ return changes;
3535
+ }
3536
+ commitsBetween(repoId, headSha, baseSha) {
3537
+ const ancestry = this.commitAncestry(repoId, headSha);
3538
+ if (!baseSha)
3539
+ return ancestry;
3540
+ const stopIndex = ancestry.findIndex((commit) => commit.sha === baseSha);
3541
+ if (stopIndex === -1)
3542
+ return ancestry;
3543
+ return ancestry.slice(0, stopIndex);
3544
+ }
3545
+ computeCommitFiles(repo, commit) {
3546
+ const versions = this.db.prepare("SELECT path, content, sha, status FROM file_versions WHERE repo_id = ? AND commit_sha = ?").all(repo.id, commit.sha);
3547
+ return versions.map((version) => {
3548
+ const additions = version.status === "removed" ? 0 : version.content.split("\n").filter(Boolean).length || 1;
3549
+ const deletions = version.status === "added" ? 0 : version.content.split("\n").filter(Boolean).length || 0;
3550
+ return {
3551
+ repo_id: repo.id,
3552
+ pull_number: 0,
3553
+ filename: version.path,
3554
+ status: version.status,
3555
+ additions,
3556
+ deletions,
3557
+ changes: additions + deletions,
3558
+ blob_url: `https://github.com/${repo.full_name}/blob/${commit.sha}/${version.path}`,
3559
+ raw_url: `https://raw.githubusercontent.com/${repo.full_name}/${commit.sha}/${version.path}`,
3560
+ contents_url: `https://api.github.com/repos/${repo.full_name}/contents/${version.path}?ref=${commit.sha}`,
3561
+ patch: `@@ ${version.path} @@`
3562
+ };
3563
+ });
3564
+ }
3565
+ computeCompareFiles(repo, base, head) {
3566
+ const baseSnapshot = this.snapshotAtCommit(repo.id, base.sha);
3567
+ const headSnapshot = this.snapshotAtCommit(repo.id, head.sha);
3568
+ const paths = [.../* @__PURE__ */ new Set([...baseSnapshot.keys(), ...headSnapshot.keys()])].sort();
3569
+ const rows = [];
3570
+ for (const path of paths) {
3571
+ const baseFile = baseSnapshot.get(path);
3572
+ const headFile = headSnapshot.get(path);
3573
+ if (baseFile?.sha === headFile?.sha)
3574
+ continue;
3575
+ const diff = linesChanged(baseFile?.content, headFile?.content ?? "");
3576
+ rows.push({
3577
+ repo_id: repo.id,
3578
+ pull_number: 0,
3579
+ filename: path,
3580
+ status: baseFile && headFile ? "modified" : headFile ? "added" : "removed",
3581
+ additions: diff.additions,
3582
+ deletions: headFile ? diff.deletions : baseFile?.content.split("\n").length ?? 0,
3583
+ changes: diff.additions + diff.deletions,
3584
+ blob_url: `https://github.com/${repo.full_name}/blob/${head.sha}/${path}`,
3585
+ raw_url: `https://raw.githubusercontent.com/${repo.full_name}/${head.sha}/${path}`,
3586
+ contents_url: `https://api.github.com/repos/${repo.full_name}/contents/${path}?ref=${head.sha}`,
3587
+ patch: `@@ ${path} @@`
3588
+ });
3589
+ }
3590
+ return rows;
3591
+ }
3592
+ snapshotAtCommit(repoId, sha) {
3593
+ const ancestry = this.commitAncestry(repoId, sha).reverse();
3594
+ const out = /* @__PURE__ */ new Map();
3595
+ for (const commit of ancestry) {
3596
+ const versions = this.db.prepare("SELECT path, content, sha, status FROM file_versions WHERE repo_id = ? AND commit_sha = ?").all(repoId, commit.sha);
3597
+ for (const version of versions) {
3598
+ if (version.status === "removed")
3599
+ out.delete(version.path);
3600
+ else
3601
+ out.set(version.path, { content: version.content, sha: version.sha });
3602
+ }
3603
+ }
3604
+ return out;
3605
+ }
3606
+ nextMilestoneNumber(repoId) {
3607
+ const row = this.db.prepare("SELECT COALESCE(MAX(number), 0) AS max FROM milestones WHERE repo_id = ?").get(repoId);
3608
+ return row.max + 1;
3609
+ }
3610
+ transaction(fn) {
3611
+ return this.db.transaction(fn).immediate();
3612
+ }
3613
+ insertRepository(input) {
3614
+ const now = nowIso();
3615
+ this.db.prepare("INSERT INTO repositories (owner, name, full_name, description, private, default_branch, fork, parent_full_name, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(input.owner, input.name, `${input.owner}/${input.name}`, input.description, input.private ? 1 : 0, input.defaultBranch, input.fork ? 1 : 0, input.parentFullName, now, now);
3616
+ return this.requireRepo(input.owner, input.name);
3617
+ }
3618
+ copyForkCommits(source, fork) {
3619
+ const sourceCommits = this.db.prepare("SELECT * FROM commits WHERE repo_id = ?").all(source.id);
3620
+ const bySha = new Map(sourceCommits.map((commit) => [commit.sha, commit]));
3621
+ const copied = /* @__PURE__ */ new Map();
3622
+ const copyCommit = (commit) => {
3623
+ const existing = copied.get(commit.sha);
3624
+ if (existing)
3625
+ return existing;
3626
+ const parent = commit.parent_sha ? bySha.get(commit.parent_sha) : void 0;
3627
+ const parentSha = parent ? copyCommit(parent) : null;
3628
+ const sha = makeSha(fork.full_name, commit.sha);
3629
+ copied.set(commit.sha, sha);
3630
+ this.db.prepare("INSERT INTO commits (sha, repo_id, message, author_login, committer_login, parent_sha, tree_sha, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(sha, fork.id, commit.message, commit.author_login, commit.committer_login, parentSha, commit.tree_sha, commit.created_at);
3631
+ const versions = this.db.prepare("SELECT path, content, sha, status FROM file_versions WHERE repo_id = ? AND commit_sha = ?").all(source.id, commit.sha);
3632
+ for (const version of versions) {
3633
+ this.db.prepare("INSERT INTO file_versions (commit_sha, repo_id, path, content, sha, status) VALUES (?, ?, ?, ?, ?, ?)").run(sha, fork.id, version.path, version.content, version.sha, version.status);
3634
+ }
3635
+ return sha;
3636
+ };
3637
+ for (const commit of sourceCommits)
3638
+ copyCommit(commit);
3639
+ return copied;
3640
+ }
3641
+ commitFiles(repo, branchName, message, files, actor) {
3642
+ const branch = this.requireBranch(repo.id, branchName);
3643
+ const now = nowIso();
3644
+ const normalizedFiles = files.map((file) => ({ ...file, path: normalizePath(file.path) }));
3645
+ const existingPaths = this.db.prepare("SELECT path FROM files WHERE repo_id = ? AND branch = ? ORDER BY path").all(repo.id, branchName).map((row) => row.path);
3646
+ const nextPaths = new Set(existingPaths);
3647
+ for (const file of normalizedFiles) {
3648
+ if (file.delete)
3649
+ nextPaths.delete(file.path);
3650
+ else
3651
+ nextPaths.add(file.path);
3652
+ }
3653
+ const sha = makeSha(repo.full_name, branchName, message, normalizedFiles, now);
3654
+ const commit = {
3655
+ sha,
3656
+ repo_id: repo.id,
3657
+ message,
3658
+ author_login: actor,
3659
+ committer_login: actor,
3660
+ parent_sha: branch.head_sha,
3661
+ tree_sha: treeSha([...nextPaths]),
3662
+ created_at: now
3663
+ };
3664
+ this.db.prepare("INSERT INTO commits (sha, repo_id, message, author_login, committer_login, parent_sha, tree_sha, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(commit.sha, commit.repo_id, commit.message, commit.author_login, commit.committer_login, commit.parent_sha, commit.tree_sha, commit.created_at);
3665
+ for (const file of normalizedFiles) {
3666
+ const path = file.path;
3667
+ const existing = this.getFile(repo.id, branchName, path);
3668
+ if (file.delete) {
3669
+ if (!existing)
3670
+ validationFailed("files", "missing", path);
3671
+ this.db.prepare("INSERT INTO file_versions (commit_sha, repo_id, path, content, sha, status) VALUES (?, ?, ?, ?, ?, 'removed')").run(commit.sha, repo.id, path, existing.content, existing.sha);
3672
+ this.db.prepare("DELETE FROM files WHERE repo_id = ? AND branch = ? AND path = ?").run(repo.id, branchName, path);
3673
+ continue;
3674
+ }
3675
+ const sha2 = fileSha(file.content);
3676
+ this.db.prepare("INSERT INTO file_versions (commit_sha, repo_id, path, content, sha, status) VALUES (?, ?, ?, ?, ?, ?)").run(commit.sha, repo.id, path, file.content, sha2, existing ? "modified" : "added");
3677
+ this.db.prepare("INSERT INTO files (repo_id, branch, path, content, sha, size, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?) ON CONFLICT(repo_id, branch, path) DO UPDATE SET content = excluded.content, sha = excluded.sha, size = excluded.size, updated_at = excluded.updated_at").run(repo.id, branchName, path, file.content, sha2, Buffer.byteLength(file.content), now);
3678
+ }
3679
+ this.db.prepare("UPDATE branches SET head_sha = ?, updated_at = ? WHERE repo_id = ? AND name = ?").run(commit.sha, now, repo.id, branchName);
3680
+ this.db.prepare("UPDATE repositories SET updated_at = ? WHERE id = ?").run(now, repo.id);
3681
+ return commit;
3682
+ }
3683
+ calculatePullFiles(baseRepo, baseRef, headRepo, headRef) {
3684
+ const baseFiles = new Map(this.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ?").all(baseRepo.id, baseRef).map((file) => [file.path, file]));
3685
+ const headFiles = new Map(this.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ?").all(headRepo.id, headRef).map((file) => [file.path, file]));
3686
+ const paths = [.../* @__PURE__ */ new Set([...baseFiles.keys(), ...headFiles.keys()])].sort();
3687
+ const rows = [];
3688
+ for (const path of paths) {
3689
+ const base = baseFiles.get(path);
3690
+ const head = headFiles.get(path);
3691
+ if (base?.sha === head?.sha)
3692
+ continue;
3693
+ const diff = linesChanged(base?.content, head?.content ?? "");
3694
+ rows.push({
3695
+ repo_id: baseRepo.id,
3696
+ pull_number: 0,
3697
+ filename: path,
3698
+ status: base && head ? "modified" : head ? "added" : "removed",
3699
+ additions: diff.additions,
3700
+ deletions: head ? diff.deletions : base?.content.split("\n").length ?? 0,
3701
+ changes: diff.additions + diff.deletions,
3702
+ blob_url: `https://github.com/${headRepo.full_name}/blob/${headRef}/${path}`,
3703
+ raw_url: `https://raw.githubusercontent.com/${headRepo.full_name}/${headRef}/${path}`,
3704
+ contents_url: `https://api.github.com/repos/${headRepo.full_name}/contents/${path}`,
3705
+ patch: `@@ ${path} @@`
3706
+ });
3707
+ }
3708
+ return rows;
3709
+ }
3710
+ replacePullFiles(repoId, pullNumber, files) {
3711
+ this.db.prepare("DELETE FROM pull_request_files WHERE repo_id = ? AND pull_number = ?").run(repoId, pullNumber);
3712
+ for (const file of files) {
3713
+ this.db.prepare("INSERT INTO pull_request_files (repo_id, pull_number, filename, status, additions, deletions, changes, blob_url, raw_url, contents_url, patch) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)").run(repoId, pullNumber, file.filename, file.status, file.additions, file.deletions, file.changes, file.blob_url, file.raw_url, file.contents_url, file.patch);
3714
+ }
3715
+ }
3716
+ // Single-PR GET (full PullRequest shape: keeps merged / commits / additions /
3717
+ // deletions / changed_files).
3718
+ serializePull(pr) {
3719
+ const baseRepo = this.requireRepoById(pr.base_repo_id);
3720
+ const headRepo = this.requireRepoById(pr.head_repo_id);
3721
+ const files = this.db.prepare("SELECT * FROM pull_request_files WHERE repo_id = ? AND pull_number = ?").all(pr.repo_id, pr.number);
3722
+ const headSha = this.getBranch(headRepo.id, pr.head_ref)?.head_sha ?? pr.head_sha;
3723
+ const baseSha = this.getBranch(baseRepo.id, pr.base_ref)?.head_sha ?? pr.base_sha;
3724
+ return pullRequestJson(pr, baseRepo, headRepo, 1, files.length, headSha, baseSha);
3725
+ }
3726
+ // LIST endpoint (leaner PullRequestSimple shape: drops the single-PR-only
3727
+ // diff-stat fields, matching real GitHub).
3728
+ serializePullSimple(pr) {
3729
+ const baseRepo = this.requireRepoById(pr.base_repo_id);
3730
+ const headRepo = this.requireRepoById(pr.head_repo_id);
3731
+ const headSha = this.getBranch(headRepo.id, pr.head_ref)?.head_sha ?? pr.head_sha;
3732
+ const baseSha = this.getBranch(baseRepo.id, pr.base_ref)?.head_sha ?? pr.base_sha;
3733
+ return pullRequestListJson(pr, baseRepo, headRepo, headSha, baseSha);
3734
+ }
3735
+ resolveHeadRef(baseRepo, head) {
3736
+ const [owner, ref] = head.includes(":") ? head.split(":", 2) : [baseRepo.owner, head];
3737
+ const repo = this.requireRepo(owner, baseRepo.name);
3738
+ return { repo, ref };
3739
+ }
3740
+ listDirectory(repo, branch, path) {
3741
+ const prefix = path ? `${path}/` : "";
3742
+ const rows = this.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ? AND path LIKE ? ORDER BY path ASC").all(repo.id, branch, `${prefix}%`);
3743
+ const seen = /* @__PURE__ */ new Set();
3744
+ const entries = [];
3745
+ for (const file of rows) {
3746
+ const rest = file.path.slice(prefix.length);
3747
+ const first = rest.split("/")[0];
3748
+ const childPath = prefix ? `${prefix}${first}` : first;
3749
+ if (seen.has(childPath))
3750
+ continue;
3751
+ seen.add(childPath);
3752
+ entries.push(contentDirectoryEntryJson(childPath, repo, branch, rest.includes("/") ? void 0 : file));
3753
+ }
3754
+ return entries;
3755
+ }
3756
+ createBranchInternal(repo, name, headSha) {
3757
+ const now = nowIso();
3758
+ this.db.prepare("INSERT INTO branches (repo_id, name, head_sha, created_at, updated_at) VALUES (?, ?, ?, ?, ?)").run(repo.id, name, headSha, now, now);
3759
+ return this.requireBranch(repo.id, name);
3760
+ }
3761
+ upsertUser(login, type, name) {
3762
+ this.db.prepare("INSERT INTO users (login, type, name, created_at) VALUES (?, ?, ?, ?) ON CONFLICT(login) DO UPDATE SET type = excluded.type, name = excluded.name").run(login, type, name, nowIso());
3763
+ }
3764
+ addCollaborator(repoId, login) {
3765
+ this.upsertUser(login, "User", login);
3766
+ this.db.prepare("INSERT OR IGNORE INTO collaborators (repo_id, login, permission) VALUES (?, ?, 'push')").run(repoId, login);
3767
+ }
3768
+ createLabel(repo, name, color, description) {
3769
+ this.db.prepare("INSERT OR IGNORE INTO labels (repo_id, name, color, description) VALUES (?, ?, ?, ?)").run(repo.id, name, color, description);
3770
+ return labelJson(this.getLabel(repo.id, name));
3771
+ }
3772
+ getRepo(owner, repo) {
3773
+ return this.db.prepare("SELECT * FROM repositories WHERE owner = ? AND name = ?").get(owner, repo);
3774
+ }
3775
+ requireRepo(owner, repo) {
3776
+ return this.getRepo(owner, repo) ?? notFound("Not Found");
3777
+ }
3778
+ requireRepoById(repoId) {
3779
+ return this.db.prepare("SELECT * FROM repositories WHERE id = ?").get(repoId) ?? notFound("Not Found");
3780
+ }
3781
+ getBranch(repoId, name) {
3782
+ return this.db.prepare("SELECT * FROM branches WHERE repo_id = ? AND name = ?").get(repoId, name);
3783
+ }
3784
+ requireBranch(repoId, name) {
3785
+ return this.getBranch(repoId, name) ?? notFound("Branch not found");
3786
+ }
3787
+ listBranches(repoId) {
3788
+ return this.db.prepare("SELECT * FROM branches WHERE repo_id = ? ORDER BY name ASC").all(repoId);
3789
+ }
3790
+ getFile(repoId, branch, path) {
3791
+ return this.db.prepare("SELECT * FROM files WHERE repo_id = ? AND branch = ? AND path = ?").get(repoId, branch, path);
3792
+ }
3793
+ getLabel(repoId, name) {
3794
+ return this.db.prepare("SELECT * FROM labels WHERE repo_id = ? AND name = ?").get(repoId, name);
3795
+ }
3796
+ listLabels(repoId) {
3797
+ return this.db.prepare("SELECT * FROM labels WHERE repo_id = ? ORDER BY name ASC").all(repoId);
3798
+ }
3799
+ listIssuesRows(repoId) {
3800
+ return this.db.prepare("SELECT * FROM issues WHERE repo_id = ? ORDER BY number ASC").all(repoId);
3801
+ }
3802
+ requireIssue(repoId, number) {
3803
+ return this.db.prepare("SELECT * FROM issues WHERE repo_id = ? AND number = ?").get(repoId, number) ?? notFound("Issue not found");
3804
+ }
3805
+ // F-1151 — what the ISSUE COMMENT endpoints may address.
3806
+ //
3807
+ // Real GitHub models every pull request as an issue and documents
3808
+ // `/repos/:o/:r/issues/:number/comments` as the way to comment on a PR's
3809
+ // conversation; `pulls/:number/comments` is the inline REVIEW comment surface,
3810
+ // which is a different thing. So a comment target is an issue OR a pull
3811
+ // request, and `requireIssue` is too narrow for these two routes — it 404'd
3812
+ // every PR comment, including the only one the bundled `pr-summary-*` examples
3813
+ // know how to write.
3814
+ //
3815
+ // Deliberately NOT widened past the comment routes. Everything else reached
3816
+ // through `requireIssue` (labels, assignees, state) really is issue-only in
3817
+ // this twin, and making a PR answer those would be divergence #16's read half
3818
+ // — a bigger change than a comment target, and still out of scope.
3819
+ //
3820
+ // The lookup order does not matter: `nextNumber()` draws issue and PR numbers
3821
+ // from one per-repo counter, so at most one of the two can match.
3822
+ //
3823
+ // The KIND is returned rather than a boolean because the serializer needs it:
3824
+ // GitHub's `html_url` for a comment on a PR is `/pull/N#issuecomment-…`, not
3825
+ // `/issues/N#…`, and the twin would otherwise ship a divergence nothing had
3826
+ // recorded.
3827
+ commentTargetKind(repoId, number) {
3828
+ if (this.db.prepare("SELECT 1 FROM issues WHERE repo_id = ? AND number = ?").get(repoId, number)) {
3829
+ return "issue";
3830
+ }
3831
+ if (this.db.prepare("SELECT 1 FROM pull_requests WHERE repo_id = ? AND number = ?").get(repoId, number)) {
3832
+ return "pull_request";
3833
+ }
3834
+ return null;
3835
+ }
3836
+ requireCommentTarget(repoId, number) {
3837
+ return this.commentTargetKind(repoId, number) ?? notFound("Issue not found");
3838
+ }
3839
+ listIssueLabels(repoId, issueNumber2) {
3840
+ return this.db.prepare("SELECT labels.* FROM labels INNER JOIN issue_labels ON labels.repo_id = issue_labels.repo_id AND labels.name = issue_labels.label_name WHERE issue_labels.repo_id = ? AND issue_labels.issue_number = ? ORDER BY labels.name ASC").all(repoId, issueNumber2);
3841
+ }
3842
+ listIssueAssignees(repoId, issueNumber2) {
3843
+ const rows = this.db.prepare("SELECT login FROM issue_assignees WHERE repo_id = ? AND issue_number = ? ORDER BY login ASC").all(repoId, issueNumber2);
3844
+ return rows.map((row) => row.login);
3845
+ }
3846
+ issueCommentCount(repoId, issueNumber2) {
3847
+ const row = this.db.prepare("SELECT COUNT(*) AS count FROM issue_comments WHERE repo_id = ? AND issue_number = ?").get(repoId, issueNumber2);
3848
+ return row.count;
3849
+ }
3850
+ listIssueCommentRows(repoId, issueNumber2) {
3851
+ return this.db.prepare("SELECT * FROM issue_comments WHERE repo_id = ? AND issue_number = ? ORDER BY id ASC").all(repoId, issueNumber2);
3852
+ }
3853
+ hasCollaborator(repoId, login) {
3854
+ return Boolean(this.db.prepare("SELECT 1 FROM collaborators WHERE repo_id = ? AND login = ?").get(repoId, login));
3855
+ }
3856
+ listPullRequestRows(repoId) {
3857
+ return this.db.prepare("SELECT * FROM pull_requests WHERE repo_id = ? ORDER BY number ASC").all(repoId);
3858
+ }
3859
+ listPullRequestFileRows(repoId, pullNumber) {
3860
+ return this.db.prepare("SELECT * FROM pull_request_files WHERE repo_id = ? AND pull_number = ? ORDER BY filename ASC").all(repoId, pullNumber);
3861
+ }
3862
+ listPullRequestReviewRows(repoId, pullNumber) {
3863
+ return this.db.prepare("SELECT * FROM pull_request_reviews WHERE repo_id = ? AND pull_number = ? ORDER BY submitted_at ASC").all(repoId, pullNumber);
3864
+ }
3865
+ listPullRequestReviewCommentRows(repoId, pullNumber) {
3866
+ return this.db.prepare("SELECT * FROM pull_request_review_comments WHERE repo_id = ? AND pull_number = ? ORDER BY id ASC").all(repoId, pullNumber);
3867
+ }
3868
+ requirePullRequest(repoId, number) {
3869
+ return this.db.prepare("SELECT * FROM pull_requests WHERE repo_id = ? AND number = ?").get(repoId, number) ?? notFound("Pull request not found");
3870
+ }
3871
+ nextNumber(repoId) {
3872
+ this.db.prepare("UPDATE repositories SET entity_counter = entity_counter + 1 WHERE id = ?").run(repoId);
3873
+ const row = this.db.prepare("SELECT entity_counter AS next FROM repositories WHERE id = ?").get(repoId);
3874
+ return row.next;
3875
+ }
3876
+ bumpEntityCounter(repoId, number) {
3877
+ this.db.prepare("UPDATE repositories SET entity_counter = CASE WHEN entity_counter < ? THEN ? ELSE entity_counter END WHERE id = ?").run(number, number, repoId);
3878
+ }
3879
+ audit(action, repoFullName, payload) {
3880
+ this.db.prepare("INSERT INTO audit_log (ts, action, repo_full_name, payload_json) VALUES (?, ?, ?, ?)").run(nowIso(), action, repoFullName, JSON.stringify(payload));
3881
+ }
3882
+ };
3883
+ function captureDelta(fn) {
3884
+ let delta = null;
3885
+ const value = fn((d) => {
3886
+ delta = d;
3887
+ });
3888
+ return { value, delta };
3889
+ }
3890
+ var createRepoSchema = z.object({ name: z.string().min(1), owner: z.string().min(1).optional(), description: z.string().optional(), private: z.boolean().optional() });
3891
+ var contentSchema = z.object({ message: z.string().min(1), content: z.string(), branch: z.string().optional(), sha: z.string().optional(), encoding: z.enum(["utf-8", "base64"]).optional() });
3892
+ var createIssueSchema = z.object({ title: z.string().min(1), body: z.string().optional(), labels: z.array(z.string()).optional(), assignees: z.array(z.string()).optional() });
3893
+ var updateIssueSchema = z.object({ title: z.string().optional(), body: z.string().optional(), state: z.enum(["open", "closed"]).optional(), labels: z.array(z.string()).optional(), assignees: z.array(z.string()).optional() });
3894
+ var commentSchema = z.object({ body: z.string().min(1) });
3895
+ var labelSchema = z.object({ name: z.string().min(1), color: z.string().default("ededed"), description: z.string().default("") });
3896
+ var labelsSchema = z.object({ labels: z.array(z.string().min(1)).min(1) });
3897
+ var assigneesSchema = z.object({ assignees: z.array(z.string().min(1)).min(1) });
3898
+ var createPullSchema = z.object({ title: z.string().min(1), body: z.string().optional(), head: z.string().min(1), base: z.string().optional() });
3899
+ var reviewSchema = z.object({ event: z.enum(["APPROVE", "REQUEST_CHANGES", "COMMENT"]), body: z.string().optional() });
3900
+ var mergeSchema = z.object({ commit_title: z.string().optional(), commit_message: z.string().optional() });
3901
+ var updateBranchSchema = z.object({ expected_head_sha: z.string().optional() });
3902
+ var deleteFileSchema = z.object({ message: z.string().min(1), sha: z.string().min(1), branch: z.string().optional() });
3903
+ var updatePrSchema = z.object({ title: z.string().optional(), body: z.string().optional(), state: z.enum(["open", "closed"]).optional(), base: z.string().optional() });
3904
+ var reviewCommentSchema = z.object({ body: z.string().min(1), path: z.string().min(1), line: z.coerce.number().int().positive(), side: z.enum(["LEFT", "RIGHT"]).optional(), commit_id: z.string().optional() });
3905
+ var replyCommentSchema = z.object({ body: z.string().min(1) });
3906
+ var updateCommentSchema = z.object({ body: z.string().min(1) });
3907
+ var milestoneSchema = z.object({ title: z.string().min(1), description: z.string().optional(), due_on: z.string().optional(), state: z.enum(["open", "closed"]).optional() });
3908
+ var updateMilestoneSchema = z.object({ title: z.string().optional(), description: z.string().optional(), due_on: z.string().optional(), state: z.enum(["open", "closed"]).optional() });
3909
+ var createStatusSchema = z.object({ state: z.enum(["error", "failure", "pending", "success"]), context: z.string().optional(), description: z.string().optional(), target_url: z.string().optional() });
3910
+ var createCheckRunSchema = z.object({
3911
+ name: z.string().min(1),
3912
+ head_sha: z.string().min(1),
3913
+ status: z.enum(["queued", "in_progress", "completed"]).optional(),
3914
+ conclusion: z.enum(["success", "failure", "neutral", "cancelled", "timed_out", "action_required", "skipped", "stale"]).optional(),
3915
+ details_url: z.string().optional(),
3916
+ external_id: z.string().optional(),
3917
+ output: z.object({ title: z.string().optional(), summary: z.string().optional() }).optional(),
3918
+ started_at: z.string().optional(),
3919
+ completed_at: z.string().optional()
3920
+ });
3921
+ var createReleaseSchema = z.object({
3922
+ tag_name: z.string().min(1),
3923
+ target_commitish: z.string().optional(),
3924
+ name: z.string().optional(),
3925
+ body: z.string().optional(),
3926
+ draft: z.boolean().optional(),
3927
+ prerelease: z.boolean().optional()
3928
+ });
3929
+ var addCollaboratorSchema = z.object({ permission: z.enum(["pull", "push", "admin", "maintain", "triage"]).optional() });
3930
+ function registerGitHubRoutes(session, { domain, recorder }) {
3931
+ const handle = (fn) => recorder.handle({ mutation: false }, async (c) => {
3932
+ const result = await fn(c);
3933
+ return { status: result.status, body: result.body, mutation: result.mutation ?? false, delta: result.delta ?? null };
3934
+ });
3935
+ const handleAs = (tool, fn) => recorder.handle({ mutation: false, tool }, async (c) => {
3936
+ const result = await fn(c);
3937
+ return { status: result.status, body: result.body, mutation: result.mutation ?? false, delta: result.delta ?? null };
3938
+ });
3939
+ session.get("/search/repositories", handle((c) => ok(domain.searchRepositories({ q: c.req.query("q"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3940
+ session.get("/search/code", handle((c) => ok(domain.searchCode({ q: c.req.query("q"), owner: c.req.query("owner"), repo: c.req.query("repo"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3941
+ session.get("/search/issues", handle((c) => ok(domain.searchIssues({ q: c.req.query("q"), owner: c.req.query("owner"), repo: c.req.query("repo"), state: stateQuery(c), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3942
+ session.get("/search/users", handle((c) => ok(domain.searchUsers({ q: c.req.query("q"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3943
+ session.get("/search/commits", handle((c) => ok(domain.searchCommits({ q: c.req.query("q"), owner: c.req.query("owner"), repo: c.req.query("repo"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3944
+ session.get("/repos/:owner/:repo", handle((c) => ok(domain.getRepository(params(c)))));
3945
+ session.post("/user/repos", handle(async (c) => {
3946
+ const args = createRepoSchema.parse(await readJson(c));
3947
+ const { value, delta } = captureDelta((onDelta) => domain.createRepository(args, onDelta));
3948
+ return created(value, delta);
3949
+ }));
3950
+ session.post("/orgs/:owner/repos", handle(async (c) => {
3951
+ const args = { ...createRepoSchema.parse(await readJson(c)), owner: c.req.param("owner") };
3952
+ const { value, delta } = captureDelta((onDelta) => domain.createRepository(args, onDelta));
3953
+ return created(value, delta);
3954
+ }));
3955
+ session.post("/repos/:owner/:repo/forks", handle(async (c) => {
3956
+ const organization = (await maybeJson(c)).organization;
3957
+ const { value, delta } = captureDelta((onDelta) => domain.forkRepository({ ...params(c), organization }, onDelta));
3958
+ return created(value, delta);
3959
+ }));
3960
+ session.get("/repos/:owner/:repo/contents", handle((c) => ok(domain.getFileContents({ ...params(c), path: "", ref: c.req.query("ref") }))));
3961
+ session.get("/repos/:owner/:repo/contents/*", handle((c) => ok(domain.getFileContents({ ...params(c), path: contentPath(c), ref: c.req.query("ref") }))));
3962
+ session.put("/repos/:owner/:repo/contents/*", handle(async (c) => {
3963
+ const body = contentSchema.parse(await readJson(c));
3964
+ const args = { ...params(c), path: contentPath(c), ...body };
3965
+ const actor = sessionLogin(c);
3966
+ const { value, delta } = captureDelta((onDelta) => domain.createOrUpdateFile(args, { actor }, onDelta));
3967
+ const status = delta !== null && delta.before === null ? 201 : 200;
3968
+ return { status, body: value, mutation: true, delta };
3969
+ }));
3970
+ session.get("/repos/:owner/:repo/commits", handle((c) => ok(domain.listCommits({ ...params(c), sha: c.req.query("sha"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3971
+ session.post("/repos/:owner/:repo/git/refs", handle(async (c) => {
3972
+ const body = z.object({ ref: z.string().min(1), sha: z.string().optional() }).parse(await readJson(c));
3973
+ const branch = body.ref.replace(/^refs\/heads\//, "");
3974
+ const { value, delta } = captureDelta((onDelta) => domain.createBranch({ ...params(c), branch, sha: body.sha }, onDelta));
3975
+ return created(value, delta);
3976
+ }));
3977
+ session.get("/repos/:owner/:repo/issues", handle((c) => ok(domain.listIssues({ ...params(c), state: stateQuery(c), labels: c.req.query("labels"), assignee: c.req.query("assignee"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3978
+ session.post("/repos/:owner/:repo/issues", handle(async (c) => {
3979
+ const args = { ...params(c), ...createIssueSchema.parse(await readJson(c)) };
3980
+ const { value, delta } = captureDelta((onDelta) => domain.createIssue(args, onDelta));
3981
+ return created(value, delta);
3982
+ }));
3983
+ session.get("/repos/:owner/:repo/issues/:number", handle((c) => ok(domain.getIssue({ ...params(c), issue_number: numberParam(c, "number") }))));
3984
+ session.patch("/repos/:owner/:repo/issues/:number", handle(async (c) => {
3985
+ const args = { ...params(c), issue_number: numberParam(c, "number"), ...updateIssueSchema.parse(await readJson(c)) };
3986
+ const { value, delta } = captureDelta((onDelta) => domain.updateIssue(args, onDelta));
3987
+ return ok(value, true, delta);
3988
+ }));
3989
+ session.get("/repos/:owner/:repo/issues/:number/comments", handle((c) => ok(domain.listIssueComments({ ...params(c), issue_number: numberParam(c, "number"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
3990
+ session.post("/repos/:owner/:repo/issues/:number/comments", handle(async (c) => {
3991
+ const args = { ...params(c), issue_number: numberParam(c, "number"), ...commentSchema.parse(await readJson(c)) };
3992
+ const { value, delta } = captureDelta((onDelta) => domain.addIssueComment(args, onDelta));
3993
+ return created(value, delta);
3994
+ }));
3995
+ session.get("/repos/:owner/:repo/labels", handle((c) => ok(domain.listRepositoryLabels(params(c)))));
3996
+ session.post("/repos/:owner/:repo/labels", handle(async (c) => {
3997
+ const args = { ...params(c), ...labelSchema.parse(await readJson(c)) };
3998
+ const { value, delta } = captureDelta((onDelta) => domain.createRepositoryLabel(args, onDelta));
3999
+ return created(value, delta);
4000
+ }));
4001
+ session.get("/repos/:owner/:repo/issues/:number/labels", handle((c) => ok(domain.listIssueLabelsForIssue({ ...params(c), issue_number: numberParam(c, "number") }))));
4002
+ session.post("/repos/:owner/:repo/issues/:number/labels", handle(async (c) => {
4003
+ const args = { ...params(c), issue_number: numberParam(c, "number"), ...labelsSchema.parse(await readJson(c)) };
4004
+ const { value, delta } = captureDelta((onDelta) => domain.addIssueLabels(args, onDelta));
4005
+ return ok(value, true, delta);
4006
+ }));
4007
+ session.delete("/repos/:owner/:repo/issues/:number/labels/:name", handle((c) => {
4008
+ const args = { ...params(c), issue_number: numberParam(c, "number"), label: requireParam(c, "name") };
4009
+ const { value, delta } = captureDelta((onDelta) => domain.deleteIssueLabel(args, onDelta));
4010
+ return ok(value, true, delta);
4011
+ }));
4012
+ session.get("/repos/:owner/:repo/collaborators", handle((c) => ok(domain.listCollaborators(params(c)))));
4013
+ session.get("/repos/:owner/:repo/collaborators/:username", handle((c) => {
4014
+ const found = domain.isCollaborator({ ...params(c), username: requireParam(c, "username") });
4015
+ if (!found)
4016
+ throw new TwinError("Not Found", 404);
4017
+ return { status: 204, body: null, mutation: false };
4018
+ }));
4019
+ session.post("/repos/:owner/:repo/issues/:number/assignees", handle(async (c) => {
4020
+ const args = { ...params(c), issue_number: numberParam(c, "number"), ...assigneesSchema.parse(await readJson(c)) };
4021
+ const { value, delta } = captureDelta((onDelta) => domain.addAssignees(args, onDelta));
4022
+ return created(value, delta);
4023
+ }));
4024
+ session.get("/repos/:owner/:repo/pulls", handle((c) => ok(domain.listPullRequests({ ...params(c), state: stateQuery(c), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4025
+ session.post("/repos/:owner/:repo/pulls", handle(async (c) => {
4026
+ const actor = sessionLogin(c);
4027
+ const args = { ...params(c), ...createPullSchema.parse(await readJson(c)), actor };
4028
+ const { value, delta } = captureDelta((onDelta) => domain.createPullRequest(args, onDelta));
4029
+ return created(value, delta);
4030
+ }));
4031
+ session.get("/repos/:owner/:repo/pulls/:number", handle((c) => ok(domain.getPullRequest({ ...params(c), pull_number: numberParam(c, "number") }))));
4032
+ session.get("/repos/:owner/:repo/pulls/:number/files", handle((c) => ok(domain.getPullRequestFiles({ ...params(c), pull_number: numberParam(c, "number"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4033
+ session.get("/repos/:owner/:repo/pulls/:number/reviews", handle((c) => ok(domain.getPullRequestReviews({ ...params(c), pull_number: numberParam(c, "number"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4034
+ session.post("/repos/:owner/:repo/pulls/:number/reviews", handle(async (c) => {
4035
+ const args = { ...params(c), pull_number: numberParam(c, "number"), ...reviewSchema.parse(await readJson(c)) };
4036
+ const { value, delta } = captureDelta((onDelta) => domain.createPullRequestReview(args, onDelta));
4037
+ return created(value, delta);
4038
+ }));
4039
+ session.get("/repos/:owner/:repo/pulls/:number/comments", handle((c) => ok(domain.getPullRequestComments({ ...params(c), pull_number: numberParam(c, "number"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4040
+ session.get("/repos/:owner/:repo/pulls/:number/status", handle((c) => ok(domain.getPullRequestStatus({ ...params(c), pull_number: numberParam(c, "number") }))));
4041
+ session.put("/repos/:owner/:repo/pulls/:number/merge", handle(async (c) => {
4042
+ const args = { ...params(c), pull_number: numberParam(c, "number"), ...mergeSchema.parse(await maybeJson(c)) };
4043
+ const actor = sessionLogin(c);
4044
+ if (!actor || !domain.hasRepositoryPermission({ owner: args.owner, repo: args.repo, username: actor, permissions: ["push", "maintain", "admin"] })) {
4045
+ throw new TwinError("Must have push access to the repository to merge pull requests.", 403);
4046
+ }
4047
+ const { value, delta } = captureDelta((onDelta) => domain.mergePullRequest(args, onDelta));
4048
+ return ok(value, true, delta);
4049
+ }));
4050
+ session.put("/repos/:owner/:repo/pulls/:number/update-branch", handle(async (c) => {
4051
+ const args = { ...params(c), pull_number: numberParam(c, "number"), ...updateBranchSchema.parse(await maybeJson(c)) };
4052
+ const { value, delta } = captureDelta((onDelta) => domain.updatePullRequestBranch(args, onDelta));
4053
+ return ok(value, true, delta);
4054
+ }));
4055
+ session.get("/repos/:owner/:repo/branches", handle((c) => ok(domain.listBranchesForRepo({ ...params(c), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4056
+ session.get("/repos/:owner/:repo/branches/*", handle((c) => ok(domain.getBranchByName({ ...params(c), branch: routeTail(c, "branches/") }))));
4057
+ session.delete("/repos/:owner/:repo/git/refs/heads/*", handle((c) => {
4058
+ const args = { ...params(c), branch: routeTail(c, "git/refs/heads/") };
4059
+ const { delta } = captureDelta((onDelta) => domain.deleteBranch(args, onDelta));
4060
+ return { status: 204, body: null, mutation: true, delta };
4061
+ }));
4062
+ session.delete("/repos/:owner/:repo/contents/*", handle(async (c) => {
4063
+ const body = deleteFileSchema.parse(await readJson(c));
4064
+ const args = { ...params(c), path: contentPath(c), ...body };
4065
+ const actor = sessionLogin(c);
4066
+ const { value, delta } = captureDelta((onDelta) => domain.deleteFile(args, { actor }, onDelta));
4067
+ return ok(value, true, delta);
4068
+ }));
4069
+ session.get("/repos/:owner/:repo/commits/:ref", handle((c) => ok(domain.getCommitWithFiles({ ...params(c), ref: requireParam(c, "ref") }))));
4070
+ session.get("/repos/:owner/:repo/compare/:basehead{.+}", handle((c) => {
4071
+ const basehead = requireParam(c, "basehead");
4072
+ const parts = basehead.split("...");
4073
+ if (parts.length !== 2 || !parts[0] || !parts[1]) {
4074
+ throw new TwinError("Invalid compare ref. Expected 'base...head'.", 422);
4075
+ }
4076
+ return ok(domain.compareCommits({ ...params(c), base: parts[0], head: parts[1] }));
4077
+ }));
4078
+ session.get("/repos/:owner/:repo/pulls/:number/diff", handle((c) => ok(domain.getPullRequestDiff({ ...params(c), pull_number: numberParam(c, "number") }))));
4079
+ session.patch("/repos/:owner/:repo/pulls/:number", handle(async (c) => {
4080
+ const args = { ...params(c), pull_number: numberParam(c, "number"), ...updatePrSchema.parse(await readJson(c)) };
4081
+ const { value, delta } = captureDelta((onDelta) => domain.updatePullRequest(args, onDelta));
4082
+ return ok(value, true, delta);
4083
+ }));
4084
+ session.get("/repos/:owner/:repo/pulls/:number/commits", handle((c) => ok(domain.getPullRequestCommits({ ...params(c), pull_number: numberParam(c, "number"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4085
+ session.post("/repos/:owner/:repo/pulls/:number/comments", handle(async (c) => {
4086
+ const args = { ...params(c), pull_number: numberParam(c, "number"), ...reviewCommentSchema.parse(await readJson(c)) };
4087
+ const actor = sessionLogin(c);
4088
+ const { value, delta } = captureDelta((onDelta) => domain.createPullRequestReviewComment(args, { actor }, onDelta));
4089
+ return created(value, delta);
4090
+ }));
4091
+ session.post("/repos/:owner/:repo/pulls/:number/comments/:comment_id/replies", handle(async (c) => {
4092
+ const args = { ...params(c), pull_number: numberParam(c, "number"), comment_id: numberParam(c, "comment_id"), ...replyCommentSchema.parse(await readJson(c)) };
4093
+ const actor = sessionLogin(c);
4094
+ const { value, delta } = captureDelta((onDelta) => domain.addReplyToPullRequestComment(args, { actor }, onDelta));
4095
+ return created(value, delta);
4096
+ }));
4097
+ session.patch("/repos/:owner/:repo/issues/comments/:comment_id", handle(async (c) => {
4098
+ const args = { ...params(c), comment_id: numberParam(c, "comment_id"), ...updateCommentSchema.parse(await readJson(c)) };
4099
+ const { value, delta } = captureDelta((onDelta) => domain.updateIssueComment(args, onDelta));
4100
+ return ok(value, true, delta);
4101
+ }));
4102
+ session.delete("/repos/:owner/:repo/issues/comments/:comment_id", handle((c) => {
4103
+ const args = { ...params(c), comment_id: numberParam(c, "comment_id") };
4104
+ const { delta } = captureDelta((onDelta) => domain.deleteIssueComment(args, onDelta));
4105
+ return { status: 204, body: null, mutation: true, delta };
4106
+ }));
4107
+ session.get("/repos/:owner/:repo/milestones", handle((c) => ok(domain.listMilestones({ ...params(c), state: stateQuery(c), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4108
+ session.post("/repos/:owner/:repo/milestones", handle(async (c) => {
4109
+ const args = { ...params(c), ...milestoneSchema.parse(await readJson(c)) };
4110
+ const { value, delta } = captureDelta((onDelta) => domain.createMilestone(args, onDelta));
4111
+ return created(value, delta);
4112
+ }));
4113
+ session.patch("/repos/:owner/:repo/milestones/:number", handle(async (c) => {
4114
+ const args = { ...params(c), milestone_number: numberParam(c, "number"), ...updateMilestoneSchema.parse(await readJson(c)) };
4115
+ const { value, delta } = captureDelta((onDelta) => domain.updateMilestone(args, onDelta));
4116
+ return ok(value, true, delta);
4117
+ }));
4118
+ session.delete("/repos/:owner/:repo/milestones/:number", handle((c) => {
4119
+ const args = { ...params(c), milestone_number: numberParam(c, "number") };
4120
+ const { delta } = captureDelta((onDelta) => domain.deleteMilestone(args, onDelta));
4121
+ return { status: 204, body: null, mutation: true, delta };
4122
+ }));
4123
+ session.post("/repos/:owner/:repo/statuses/:sha", handleAs("create_commit_status", async (c) => {
4124
+ const args = { ...params(c), sha: requireParam(c, "sha"), ...createStatusSchema.parse(await readJson(c)) };
4125
+ const { value, delta } = captureDelta((onDelta) => domain.createCommitStatus(args, onDelta));
4126
+ return created(value, delta);
4127
+ }));
4128
+ session.get("/repos/:owner/:repo/commits/:ref/status", handle((c) => ok(domain.getCombinedStatusForRef({ ...params(c), ref: requireParam(c, "ref") }))));
4129
+ session.post("/repos/:owner/:repo/check-runs", handleAs("create_check_run", async (c) => {
4130
+ const args = { ...params(c), ...createCheckRunSchema.parse(await readJson(c)) };
4131
+ const { value, delta } = captureDelta((onDelta) => domain.createCheckRun(args, onDelta));
4132
+ return created(value, delta);
4133
+ }));
4134
+ session.get("/repos/:owner/:repo/commits/:ref/check-runs", handle((c) => ok(domain.listCheckRunsForRef({ ...params(c), ref: requireParam(c, "ref"), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4135
+ session.get("/repos/:owner/:repo/tags", handle((c) => ok(domain.listTags({ ...params(c), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4136
+ session.get("/repos/:owner/:repo/releases", handle((c) => ok(domain.listReleases({ ...params(c), page: numberQuery(c, "page"), per_page: numberQuery(c, "per_page") }))));
4137
+ session.get("/repos/:owner/:repo/releases/latest", handle((c) => ok(domain.getLatestRelease(params(c)))));
4138
+ session.get("/repos/:owner/:repo/releases/tags/*", handle((c) => ok(domain.getReleaseByTag({ ...params(c), tag: routeTail(c, "releases/tags/") }))));
4139
+ session.post("/repos/:owner/:repo/releases", handle(async (c) => {
4140
+ const args = { ...params(c), ...createReleaseSchema.parse(await readJson(c)) };
4141
+ const actor = sessionLogin(c);
4142
+ const { value, delta } = captureDelta((onDelta) => domain.createRelease(args, { actor }, onDelta));
4143
+ return created(value, delta);
4144
+ }));
4145
+ session.get("/user", handle((c) => ok(domain.getMe({ actor: sessionLogin(c) }))));
4146
+ session.put("/repos/:owner/:repo/collaborators/:username", handle(async (c) => {
4147
+ const body = addCollaboratorSchema.parse(await maybeJson(c));
4148
+ const actor = sessionLogin(c);
4149
+ if (!actor || !domain.hasRepositoryPermission({ ...params(c), username: actor, permissions: ["push", "maintain", "admin"] })) {
4150
+ throw new TwinError("Must have push access to the repository to add collaborators.", 403);
4151
+ }
4152
+ const args = { ...params(c), username: requireParam(c, "username"), permission: body.permission };
4153
+ const { value, delta } = captureDelta((onDelta) => domain.addCollaboratorAction({ ...args, actor }, onDelta));
4154
+ return { status: value.status, body: value.body, mutation: true, delta };
4155
+ }));
4156
+ }
4157
+ function ok(body, mutation = false, delta = null) {
4158
+ return { status: 200, body, mutation, delta };
4159
+ }
4160
+ function created(body, delta = null) {
4161
+ return { status: 201, body, mutation: true, delta };
4162
+ }
4163
+ async function readJson(c) {
4164
+ try {
4165
+ return await c.req.json();
4166
+ } catch {
4167
+ throw new SyntaxError("Problems parsing JSON");
4168
+ }
4169
+ }
4170
+ async function maybeJson(c) {
4171
+ try {
4172
+ return await c.req.json();
4173
+ } catch {
4174
+ return {};
4175
+ }
4176
+ }
4177
+ function params(c) {
4178
+ return { owner: requireParam(c, "owner"), repo: requireParam(c, "repo") };
4179
+ }
4180
+ function sessionLogin(c) {
4181
+ const session = c.get("session");
4182
+ return typeof session?.login === "string" ? session.login : void 0;
4183
+ }
4184
+ function numberParam(c, name) {
4185
+ const value = Number(c.req.param(name));
4186
+ if (!Number.isInteger(value) || value < 1)
4187
+ validationFailed(name, "invalid", c.req.param(name));
4188
+ return value;
4189
+ }
4190
+ function requireParam(c, name) {
4191
+ const value = c.req.param(name);
4192
+ if (!value)
4193
+ throw new TwinError(`Missing route parameter: ${name}`, 400);
4194
+ return value;
4195
+ }
4196
+ function contentPath(c) {
4197
+ return routeTail(c, "contents/");
4198
+ }
4199
+ function routeTail(c, marker) {
4200
+ const { owner, repo } = params(c);
4201
+ const pathname = new URL(c.req.url).pathname;
4202
+ const sid = pathname.match(/^\/s\/([^/]+)\//)?.[1] ?? "";
4203
+ const prefix = `/s/${sid}/repos/${owner}/${repo}/${marker}`;
4204
+ const value = decodeURIComponent(pathname.startsWith(prefix) ? pathname.slice(prefix.length) : "");
4205
+ if (!value)
4206
+ throw new TwinError(`Missing route path after ${marker}`, 400);
4207
+ return value;
4208
+ }
4209
+ function numberQuery(c, name) {
4210
+ const value = c.req.query(name);
4211
+ return value ? Number(value) : void 0;
4212
+ }
4213
+ function stateQuery(c) {
4214
+ const state = c.req.query("state");
4215
+ return state === "open" || state === "closed" || state === "all" ? state : void 0;
4216
+ }
4217
+
4218
+ // ../packages/twin-github/dist/src/unsupported-envelope.js
4219
+ var unsupportedEnvelope = {
4220
+ status: 501,
4221
+ body: {
4222
+ message: "This endpoint is not supported by this GitHub twin clone.",
4223
+ _twin: {
4224
+ fidelity: "unsupported",
4225
+ supported_surfaces: [
4226
+ "GitHub-shaped REST",
4227
+ "POST /s/:sid/mcp",
4228
+ "GET /s/:sid/mcp/tools",
4229
+ "POST /s/:sid/mcp/tools/:name",
4230
+ "POST /s/:sid/mcp/call"
4231
+ ]
4232
+ }
4233
+ }
4234
+ };
4235
+
4236
+ // ../packages/twin-github/dist/src/twin.js
4237
+ var seedParser = {
4238
+ parse(input) {
4239
+ if (input === null || input === void 0)
4240
+ throw new SyntaxError("Problems parsing JSON");
4241
+ return parseSeed(input);
4242
+ },
4243
+ safeParse(input) {
4244
+ try {
4245
+ return { success: true, data: seedParser.parse(input) };
4246
+ } catch (error) {
4247
+ return { success: false, error };
4248
+ }
4249
+ }
4250
+ };
4251
+ function actorFromSession(session) {
4252
+ return typeof session?.login === "string" ? session.login : void 0;
4253
+ }
4254
+ function zodIssues(err) {
4255
+ if (err instanceof ZodError)
4256
+ return err.issues;
4257
+ if (err instanceof Error && err.name === "ZodError" && Array.isArray(err.issues)) {
4258
+ return err.issues;
4259
+ }
4260
+ return void 0;
4261
+ }
4262
+ function githubErrorEnvelope(err) {
4263
+ if (err instanceof UnknownToolError) {
4264
+ return {
4265
+ status: 422,
4266
+ body: githubError("Validation Failed", 422, [
4267
+ { resource: "Request", field: "tool", code: "invalid", value: err.tool }
4268
+ ])
4269
+ };
4270
+ }
4271
+ if (err instanceof TwinError) {
4272
+ return { status: err.status, body: githubError(err.message, err.status, err.errors) };
4273
+ }
4274
+ const issues = zodIssues(err);
4275
+ if (issues) {
4276
+ return {
4277
+ status: 422,
4278
+ body: githubError("Validation Failed", 422, issues.map((issue) => ({
4279
+ resource: "Request",
4280
+ field: issue.path.join("."),
4281
+ code: issue.code
4282
+ })))
4283
+ };
4284
+ }
4285
+ if (err instanceof SyntaxError) {
4286
+ return { status: 400, body: githubError("Problems parsing JSON", 400) };
4287
+ }
4288
+ return {
4289
+ status: 500,
4290
+ body: githubError(err instanceof Error ? err.message : "Internal Server Error", 500)
4291
+ };
4292
+ }
4293
+ var toolListing = new Map(listTools().map((tool) => [tool.name, tool]));
4294
+ var githubTwinDefinition = defineTwin({
4295
+ id: "github",
4296
+ version: process.env.POME_TWIN_VERSION ?? "0.1.0",
4297
+ implementation: "github_clone",
4298
+ packageName: "@pome-sh/twin-github",
4299
+ fidelity: { default: "semantic" },
4300
+ seed: seedParser,
4301
+ domain: ({ db, seed }) => {
4302
+ const domain = new GitHubDomain(db ?? openGitHubCloneDatabase());
4303
+ if (seed !== void 0)
4304
+ domain.seed(seed);
4305
+ return domain;
4306
+ },
4307
+ routes: registerGitHubRoutes,
4308
+ state: ({ domain }) => domain.exportState(),
4309
+ admin: {
4310
+ reset: ({ domain, reportDelta }) => {
4311
+ domain.seed(defaultSeedState(), reportDelta);
4312
+ return { ok: true, message: "GitHub twin state reset to default seed." };
4313
+ },
4314
+ seed: ({ domain, seed, reportDelta }) => {
4315
+ domain.seed(seed, reportDelta);
4316
+ return { ok: true, repositories: seed.repositories.length };
4317
+ }
4318
+ // The admin-gate 403 body is the gate's default GitHub envelope
4319
+ // ({message: "Forbidden"}); no per-twin override needed.
4320
+ },
4321
+ tools: toolDefinitions.map((def) => ({
4322
+ name: def.name,
4323
+ description: def.description,
4324
+ schema: def.schema,
4325
+ mutation: isMutatingTool(def.name),
4326
+ inputSchema: toolListing.get(def.name)?.input_schema,
4327
+ handler: (domain, args, ctx) => executeTool(domain, def.name, args, ctx.reportDelta, {
4328
+ actor: actorFromSession(ctx.session)
4329
+ })
4330
+ })),
4331
+ // Frozen healthz shape: {ok, twin, implementation, fidelity, tools,
4332
+ // access_control, runtime} — no version field (github never carried it).
4333
+ healthz: () => ({
4334
+ fidelity: "semantic",
4335
+ access_control: summarizeGitHubAccessControlCatalog()
4336
+ }),
4337
+ // Frozen per-session health shape: implementation + fidelity + runtime,
4338
+ // no version (pre-port /_pome/health).
4339
+ pomeHealth: () => ({
4340
+ implementation: "github_clone",
4341
+ fidelity: "semantic",
4342
+ runtime: twinBuildInfo("@pome-sh/twin-github")
4343
+ }),
4344
+ // Frozen extra session route (CONTRACT.md per-twin table).
4345
+ pomeRoutes: {
4346
+ "access-control": () => githubAccessControlPayload()
4347
+ },
4348
+ // FDRS-402 adapter-rich tape pin: x-pome-correlation-id persists as
4349
+ // tool_call_id on every recorded event (github's frozen tape shape).
4350
+ stampToolCallId: true,
4351
+ // Frozen JSON-RPC unknown-tool result text (the legacy /mcp/call surface
4352
+ // keeps the 422 validation envelope from errorEnvelope above).
4353
+ mcpUnknownTool: (name) => ({ message: `Unknown tool: ${name}` }),
4354
+ unsupported: () => unsupportedEnvelope,
4355
+ errorEnvelope: githubErrorEnvelope,
4356
+ auth: {
4357
+ // F-712 pins (wire-frozen): Bearer-header only (no extra token
4358
+ // resolvers), raw bearer rejected (allowRawBearer=false), sid mismatch
4359
+ // → 401 {message:"Forbidden"}, and every credential failure — expired
4360
+ // JWT included — renders 401 {message:"Bad credentials"}. The pre-port
4361
+ // explicit "Token expired" branch was dead code: hono/jwt's verify
4362
+ // throws JwtTokenExpired before the branch was ever reached, so the
4363
+ // wire always said "Bad credentials" (pre-ruled: deleting it is zero
4364
+ // wire diff).
4365
+ providerToken: { provider: "github", prefixes: ["ghp_pome_", "github_pat_pome_"] },
4366
+ allowRawBearer: false,
4367
+ unauthorized: () => ({
4368
+ status: 401,
4369
+ body: { message: "Bad credentials", documentation_url: "" }
4370
+ }),
4371
+ sidMismatch: () => ({
4372
+ status: 401,
4373
+ body: { message: "Forbidden", documentation_url: "" }
4374
+ }),
4375
+ sessionExtras: (claims) => typeof claims.login === "string" && claims.login.length > 0 ? { login: claims.login } : {}
4376
+ }
4377
+ });
4378
+ function createGitHubCloneApp(options = {}) {
4379
+ return createApp(githubTwinDefinition, {
4380
+ db: options.db ?? openGitHubCloneDatabase(),
4381
+ recorder: options.recorder,
4382
+ runId: options.runId ?? "local",
4383
+ // Pre-port factory semantics: an explicit `db` carries its own state
4384
+ // (the boot path seeds before binding); otherwise seed the supplied or
4385
+ // default world.
4386
+ seed: options.db ? void 0 : options.seed ?? defaultSeedState()
4387
+ });
4388
+ }
4389
+
4390
+ export { GitHubDomain, TAPE_ASSERTABLE_TOOLS, createGitHubCloneApp, defaultSeedState, executeTool, githubTwinDefinition, listTools, openGitHubCloneDatabase, parseSeed, resetDatabase, seedSchema, toolDefinitions };