@noodleseed/one 0.22.0 → 0.24.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 (427) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +2 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/author-loop.d.ts +1 -0
  5. package/dist/commands/author-loop.d.ts.map +1 -1
  6. package/dist/commands/author-loop.js +6 -2
  7. package/dist/commands/author-loop.js.map +1 -1
  8. package/dist/commands/catalog-data-core.d.ts.map +1 -1
  9. package/dist/commands/catalog-data-core.js +17 -3
  10. package/dist/commands/catalog-data-core.js.map +1 -1
  11. package/dist/commands/catalog-data-resources.js +2 -2
  12. package/dist/commands/catalog-data-resources.js.map +1 -1
  13. package/dist/commands/catalog-dispatch.d.ts.map +1 -1
  14. package/dist/commands/catalog-dispatch.js +21 -2
  15. package/dist/commands/catalog-dispatch.js.map +1 -1
  16. package/dist/commands/catalog-render.d.ts.map +1 -1
  17. package/dist/commands/catalog-render.js +6 -0
  18. package/dist/commands/catalog-render.js.map +1 -1
  19. package/dist/commands/deploy-ops.d.ts.map +1 -1
  20. package/dist/commands/deploy-ops.js +30 -13
  21. package/dist/commands/deploy-ops.js.map +1 -1
  22. package/dist/commands/deploy-status-ops.d.ts +1 -1
  23. package/dist/commands/deploy-status-ops.d.ts.map +1 -1
  24. package/dist/commands/deploy-status-ops.js +8 -4
  25. package/dist/commands/deploy-status-ops.js.map +1 -1
  26. package/dist/commands/devtools.d.ts +11 -0
  27. package/dist/commands/devtools.d.ts.map +1 -0
  28. package/dist/commands/devtools.js +123 -0
  29. package/dist/commands/devtools.js.map +1 -0
  30. package/dist/commands/mcp-apps.d.ts +0 -1
  31. package/dist/commands/mcp-apps.d.ts.map +1 -1
  32. package/dist/commands/mcp-apps.js +71 -122
  33. package/dist/commands/mcp-apps.js.map +1 -1
  34. package/dist/commands/shared.d.ts +6 -0
  35. package/dist/commands/shared.d.ts.map +1 -1
  36. package/dist/commands/shared.js +19 -0
  37. package/dist/commands/shared.js.map +1 -1
  38. package/dist/deploy.d.ts +1 -1
  39. package/dist/deploy.d.ts.map +1 -1
  40. package/dist/deploy.js +5 -1
  41. package/dist/deploy.js.map +1 -1
  42. package/dist/dev.d.ts.map +1 -1
  43. package/dist/dev.js +13 -1
  44. package/dist/dev.js.map +1 -1
  45. package/dist/fire.js +1 -1
  46. package/dist/fire.js.map +1 -1
  47. package/dist/first-run.d.ts +11 -0
  48. package/dist/first-run.d.ts.map +1 -1
  49. package/dist/first-run.js +19 -4
  50. package/dist/first-run.js.map +1 -1
  51. package/dist/flavor.d.ts +1 -1
  52. package/dist/flavor.d.ts.map +1 -1
  53. package/dist/flavor.js +12 -2
  54. package/dist/flavor.js.map +1 -1
  55. package/dist/project-scaffold-templates.d.ts +11 -0
  56. package/dist/project-scaffold-templates.d.ts.map +1 -0
  57. package/dist/project-scaffold-templates.js +359 -0
  58. package/dist/project-scaffold-templates.js.map +1 -0
  59. package/dist/project.d.ts.map +1 -1
  60. package/dist/project.js +1 -323
  61. package/dist/project.js.map +1 -1
  62. package/dist/react.d.ts +2 -2
  63. package/dist/react.d.ts.map +1 -1
  64. package/dist/react.js +1 -1
  65. package/dist/react.js.map +1 -1
  66. package/dist/validate.d.ts +12 -0
  67. package/dist/validate.d.ts.map +1 -1
  68. package/dist/validate.js +11 -0
  69. package/dist/validate.js.map +1 -1
  70. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +4 -4
  71. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js.map +1 -1
  72. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -1
  73. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +72 -13
  74. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -1
  75. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.d.ts.map +1 -1
  76. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js +8 -3
  77. package/node_modules/@noodle-borg/agent-kit/dist/skill-operations-refs.js.map +1 -1
  78. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  79. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +18 -1
  80. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts.map +1 -1
  81. package/node_modules/@noodle-borg/authoring/dist/connectors.js +17 -4
  82. package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
  83. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +3 -3
  84. package/node_modules/@noodle-borg/authoring/dist/index.d.ts.map +1 -1
  85. package/node_modules/@noodle-borg/authoring/dist/index.js +1 -1
  86. package/node_modules/@noodle-borg/authoring/dist/index.js.map +1 -1
  87. package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts +302 -7
  88. package/node_modules/@noodle-borg/authoring/dist/react/components.d.ts.map +1 -1
  89. package/node_modules/@noodle-borg/authoring/dist/react/components.js +39 -7
  90. package/node_modules/@noodle-borg/authoring/dist/react/components.js.map +1 -1
  91. package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts +4 -2
  92. package/node_modules/@noodle-borg/authoring/dist/react/index.d.ts.map +1 -1
  93. package/node_modules/@noodle-borg/authoring/dist/react/index.js +2 -1
  94. package/node_modules/@noodle-borg/authoring/dist/react/index.js.map +1 -1
  95. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts +2618 -0
  96. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.d.ts.map +1 -0
  97. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js +110 -0
  98. package/node_modules/@noodle-borg/authoring/dist/react/semantic-components.js.map +1 -0
  99. package/node_modules/@noodle-borg/authoring/dist/react.d.ts +2 -2
  100. package/node_modules/@noodle-borg/authoring/dist/react.d.ts.map +1 -1
  101. package/node_modules/@noodle-borg/authoring/dist/react.js +1 -1
  102. package/node_modules/@noodle-borg/authoring/dist/react.js.map +1 -1
  103. package/node_modules/@noodle-borg/authoring/dist/recording.d.ts +1 -1
  104. package/node_modules/@noodle-borg/authoring/dist/recording.d.ts.map +1 -1
  105. package/node_modules/@noodle-borg/authoring/dist/recording.js +38 -6
  106. package/node_modules/@noodle-borg/authoring/dist/recording.js.map +1 -1
  107. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +25 -2
  108. package/node_modules/@noodle-borg/authoring/dist/server.d.ts.map +1 -1
  109. package/node_modules/@noodle-borg/authoring/dist/server.js +64 -6
  110. package/node_modules/@noodle-borg/authoring/dist/server.js.map +1 -1
  111. package/node_modules/@noodle-borg/compiler/dist/compile.d.ts.map +1 -1
  112. package/node_modules/@noodle-borg/compiler/dist/compile.js +20 -8
  113. package/node_modules/@noodle-borg/compiler/dist/compile.js.map +1 -1
  114. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +2 -0
  115. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
  116. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +6 -0
  117. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
  118. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js +1 -1
  119. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js.map +1 -1
  120. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.d.ts +14 -0
  121. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.d.ts.map +1 -0
  122. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.js +66 -0
  123. package/node_modules/@noodle-borg/connector-defs/dist/call-graph.js.map +1 -0
  124. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.d.ts +21 -0
  125. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.d.ts.map +1 -0
  126. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.js +102 -0
  127. package/node_modules/@noodle-borg/connector-defs/dist/compile-auth.js.map +1 -0
  128. package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts +19 -4
  129. package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts.map +1 -1
  130. package/node_modules/@noodle-borg/connector-defs/dist/compile.js +67 -99
  131. package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
  132. package/node_modules/@noodle-borg/connector-defs/dist/index.d.ts +1 -1
  133. package/node_modules/@noodle-borg/connector-defs/dist/index.d.ts.map +1 -1
  134. package/node_modules/@noodle-borg/connector-defs/dist/index.js.map +1 -1
  135. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +168 -10
  136. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts.map +1 -1
  137. package/node_modules/@noodle-borg/connector-defs/dist/schema.js +72 -5
  138. package/node_modules/@noodle-borg/connector-defs/dist/schema.js.map +1 -1
  139. package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts +6 -0
  140. package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts.map +1 -1
  141. package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +2 -0
  142. package/node_modules/@noodle-borg/connector-http/dist/http-connector.js.map +1 -1
  143. package/node_modules/@noodle-borg/connector-http/package.json +1 -1
  144. package/node_modules/@noodle-borg/protocol/dist/mapping.d.ts.map +1 -1
  145. package/node_modules/@noodle-borg/protocol/dist/mapping.js +8 -0
  146. package/node_modules/@noodle-borg/protocol/dist/mapping.js.map +1 -1
  147. package/node_modules/@noodle-borg/runtime/dist/execute.d.ts.map +1 -1
  148. package/node_modules/@noodle-borg/runtime/dist/execute.js +87 -62
  149. package/node_modules/@noodle-borg/runtime/dist/execute.js.map +1 -1
  150. package/node_modules/@noodle-borg/runtime/dist/result.d.ts +1 -1
  151. package/node_modules/@noodle-borg/runtime/dist/result.d.ts.map +1 -1
  152. package/node_modules/@noodle-borg/service/dist/credential-broker.d.ts.map +1 -1
  153. package/node_modules/@noodle-borg/service/dist/credential-broker.js +113 -11
  154. package/node_modules/@noodle-borg/service/dist/credential-broker.js.map +1 -1
  155. package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts +28 -5
  156. package/node_modules/@noodle-borg/service/dist/github/app-client.d.ts.map +1 -1
  157. package/node_modules/@noodle-borg/service/dist/github/app-client.js +116 -7
  158. package/node_modules/@noodle-borg/service/dist/github/app-client.js.map +1 -1
  159. package/node_modules/@noodle-borg/service/dist/github/builder-auth.d.ts +12 -0
  160. package/node_modules/@noodle-borg/service/dist/github/builder-auth.d.ts.map +1 -0
  161. package/node_modules/@noodle-borg/service/dist/github/builder-auth.js +15 -0
  162. package/node_modules/@noodle-borg/service/dist/github/builder-auth.js.map +1 -0
  163. package/node_modules/@noodle-borg/service/dist/github/builder-main.d.ts +3 -0
  164. package/node_modules/@noodle-borg/service/dist/github/builder-main.d.ts.map +1 -0
  165. package/node_modules/@noodle-borg/service/dist/github/builder-main.js +9 -0
  166. package/node_modules/@noodle-borg/service/dist/github/builder-main.js.map +1 -0
  167. package/node_modules/@noodle-borg/service/dist/github/builder-runner.d.ts +21 -0
  168. package/node_modules/@noodle-borg/service/dist/github/builder-runner.d.ts.map +1 -0
  169. package/node_modules/@noodle-borg/service/dist/github/builder-runner.js +192 -0
  170. package/node_modules/@noodle-borg/service/dist/github/builder-runner.js.map +1 -0
  171. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.d.ts +45 -0
  172. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.d.ts.map +1 -0
  173. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.js +60 -0
  174. package/node_modules/@noodle-borg/service/dist/github/cloud-run-job-executor.js.map +1 -0
  175. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.d.ts +64 -0
  176. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.d.ts.map +1 -0
  177. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.js +121 -0
  178. package/node_modules/@noodle-borg/service/dist/github/deploy-pipeline.js.map +1 -0
  179. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.d.ts +33 -0
  180. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.d.ts.map +1 -0
  181. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.js +14 -0
  182. package/node_modules/@noodle-borg/service/dist/github/deploy-run-executor.js.map +1 -0
  183. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.d.ts +36 -0
  184. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.d.ts.map +1 -0
  185. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.js +107 -0
  186. package/node_modules/@noodle-borg/service/dist/github/deploy-run-reconciler.js.map +1 -0
  187. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.d.ts +38 -0
  188. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.d.ts.map +1 -0
  189. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.js +60 -0
  190. package/node_modules/@noodle-borg/service/dist/github/fast-lane-classifier.js.map +1 -0
  191. package/node_modules/@noodle-borg/service/dist/github/local-compile.d.ts +24 -0
  192. package/node_modules/@noodle-borg/service/dist/github/local-compile.d.ts.map +1 -0
  193. package/node_modules/@noodle-borg/service/dist/github/local-compile.js +98 -0
  194. package/node_modules/@noodle-borg/service/dist/github/local-compile.js.map +1 -0
  195. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.d.ts +39 -0
  196. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.d.ts.map +1 -0
  197. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.js +67 -0
  198. package/node_modules/@noodle-borg/service/dist/github/local-process-executor.js.map +1 -0
  199. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.d.ts +18 -0
  200. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.d.ts.map +1 -0
  201. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.js +32 -0
  202. package/node_modules/@noodle-borg/service/dist/github/run-access-mode.js.map +1 -0
  203. package/node_modules/@noodle-borg/service/dist/github/run-token.d.ts +41 -0
  204. package/node_modules/@noodle-borg/service/dist/github/run-token.d.ts.map +1 -0
  205. package/node_modules/@noodle-borg/service/dist/github/run-token.js +59 -0
  206. package/node_modules/@noodle-borg/service/dist/github/run-token.js.map +1 -0
  207. package/node_modules/@noodle-borg/service/dist/http-util.d.ts +7 -1
  208. package/node_modules/@noodle-borg/service/dist/http-util.d.ts.map +1 -1
  209. package/node_modules/@noodle-borg/service/dist/http-util.js +14 -0
  210. package/node_modules/@noodle-borg/service/dist/http-util.js.map +1 -1
  211. package/node_modules/@noodle-borg/service/dist/index.d.ts +13 -2
  212. package/node_modules/@noodle-borg/service/dist/index.d.ts.map +1 -1
  213. package/node_modules/@noodle-borg/service/dist/index.js +12 -1
  214. package/node_modules/@noodle-borg/service/dist/index.js.map +1 -1
  215. package/node_modules/@noodle-borg/service/dist/main.js +72 -0
  216. package/node_modules/@noodle-borg/service/dist/main.js.map +1 -1
  217. package/node_modules/@noodle-borg/service/dist/options.d.ts +26 -3
  218. package/node_modules/@noodle-borg/service/dist/options.d.ts.map +1 -1
  219. package/node_modules/@noodle-borg/service/dist/registry-helpers.d.ts +12 -0
  220. package/node_modules/@noodle-borg/service/dist/registry-helpers.d.ts.map +1 -1
  221. package/node_modules/@noodle-borg/service/dist/registry-helpers.js +3 -0
  222. package/node_modules/@noodle-borg/service/dist/registry-helpers.js.map +1 -1
  223. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +7 -0
  224. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts.map +1 -1
  225. package/node_modules/@noodle-borg/service/dist/registry.d.ts +7 -29
  226. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  227. package/node_modules/@noodle-borg/service/dist/registry.js +62 -57
  228. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  229. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.d.ts +3 -2
  230. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.d.ts.map +1 -1
  231. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.js +36 -8
  232. package/node_modules/@noodle-borg/service/dist/routes/asset-control-plane.js.map +1 -1
  233. package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts +3 -2
  234. package/node_modules/@noodle-borg/service/dist/routes/control-plane.d.ts.map +1 -1
  235. package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +100 -12
  236. package/node_modules/@noodle-borg/service/dist/routes/control-plane.js.map +1 -1
  237. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts +7 -0
  238. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.d.ts.map +1 -1
  239. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js +36 -1
  240. package/node_modules/@noodle-borg/service/dist/routes/github-dispatch.js.map +1 -1
  241. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts +13 -0
  242. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.d.ts.map +1 -0
  243. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js +84 -0
  244. package/node_modules/@noodle-borg/service/dist/routes/github-run-claim.js.map +1 -0
  245. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.d.ts +5 -0
  246. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.d.ts.map +1 -0
  247. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.js +73 -0
  248. package/node_modules/@noodle-borg/service/dist/routes/github-run-status.js.map +1 -0
  249. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts +23 -1
  250. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.d.ts.map +1 -1
  251. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js +41 -0
  252. package/node_modules/@noodle-borg/service/dist/routes/github-webhook.js.map +1 -1
  253. package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts +4 -0
  254. package/node_modules/@noodle-borg/service/dist/routes/paths.d.ts.map +1 -1
  255. package/node_modules/@noodle-borg/service/dist/routes/paths.js +10 -0
  256. package/node_modules/@noodle-borg/service/dist/routes/paths.js.map +1 -1
  257. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.d.ts +85 -0
  258. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.d.ts.map +1 -0
  259. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.js +90 -0
  260. package/node_modules/@noodle-borg/service/dist/routes/run-deploy-auth.js.map +1 -0
  261. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  262. package/node_modules/@noodle-borg/service/dist/serve.js +31 -0
  263. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  264. package/node_modules/@noodle-borg/service/dist/service.d.ts.map +1 -1
  265. package/node_modules/@noodle-borg/service/dist/service.js +8 -13
  266. package/node_modules/@noodle-borg/service/dist/service.js.map +1 -1
  267. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts +1 -0
  268. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.d.ts.map +1 -1
  269. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js +5 -0
  270. package/node_modules/@noodle-borg/service/dist/store/github-connections-json-file.js.map +1 -1
  271. package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts +1 -0
  272. package/node_modules/@noodle-borg/service/dist/store/github-connections.d.ts.map +1 -1
  273. package/node_modules/@noodle-borg/service/dist/store/github-connections.js +5 -0
  274. package/node_modules/@noodle-borg/service/dist/store/github-connections.js.map +1 -1
  275. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.d.ts +120 -0
  276. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.d.ts.map +1 -0
  277. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.js +6 -0
  278. package/node_modules/@noodle-borg/service/dist/store/github-deploy-run-contract.js.map +1 -0
  279. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts +6 -1
  280. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.d.ts.map +1 -1
  281. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js +18 -1
  282. package/node_modules/@noodle-borg/service/dist/store/github-runs-json-file.js.map +1 -1
  283. package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts +22 -1
  284. package/node_modules/@noodle-borg/service/dist/store/github-runs.d.ts.map +1 -1
  285. package/node_modules/@noodle-borg/service/dist/store/github-runs.js +39 -2
  286. package/node_modules/@noodle-borg/service/dist/store/github-runs.js.map +1 -1
  287. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts +13 -1
  288. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.d.ts.map +1 -1
  289. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js +115 -1
  290. package/node_modules/@noodle-borg/service/dist/store/postgres-github-runs.js.map +1 -1
  291. package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts +1 -0
  292. package/node_modules/@noodle-borg/service/dist/store/postgres-github.d.ts.map +1 -1
  293. package/node_modules/@noodle-borg/service/dist/store/postgres-github.js +6 -0
  294. package/node_modules/@noodle-borg/service/dist/store/postgres-github.js.map +1 -1
  295. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts +15 -1
  296. package/node_modules/@noodle-borg/service/dist/store/postgres.d.ts.map +1 -1
  297. package/node_modules/@noodle-borg/service/dist/store/postgres.js +22 -2
  298. package/node_modules/@noodle-borg/service/dist/store/postgres.js.map +1 -1
  299. package/node_modules/@noodle-borg/service/dist/store.d.ts +22 -99
  300. package/node_modules/@noodle-borg/service/dist/store.d.ts.map +1 -1
  301. package/node_modules/@noodle-borg/service/dist/store.js.map +1 -1
  302. package/node_modules/hono/dist/adapter/aws-lambda/handler.js +15 -21
  303. package/node_modules/hono/dist/adapter/bun/websocket.js +3 -1
  304. package/node_modules/hono/dist/adapter/lambda-edge/handler.js +8 -2
  305. package/node_modules/hono/dist/cjs/adapter/aws-lambda/handler.js +15 -21
  306. package/node_modules/hono/dist/cjs/adapter/bun/websocket.js +3 -1
  307. package/node_modules/hono/dist/cjs/adapter/lambda-edge/handler.js +8 -2
  308. package/node_modules/hono/dist/cjs/helper/css/common.js +3 -1
  309. package/node_modules/hono/dist/cjs/helper/css/index.js +9 -1
  310. package/node_modules/hono/dist/cjs/jsx/base.js +8 -14
  311. package/node_modules/hono/dist/cjs/jsx/components.js +41 -21
  312. package/node_modules/hono/dist/cjs/jsx/context.js +131 -5
  313. package/node_modules/hono/dist/cjs/jsx/streaming.js +9 -7
  314. package/node_modules/hono/dist/cjs/middleware/cors/index.js +2 -5
  315. package/node_modules/hono/dist/cjs/middleware/serve-static/index.js +2 -2
  316. package/node_modules/hono/dist/cjs/utils/body.js +12 -4
  317. package/node_modules/hono/dist/cjs/utils/buffer.js +2 -1
  318. package/node_modules/hono/dist/cjs/validator/validator.js +3 -3
  319. package/node_modules/hono/dist/helper/css/common.js +3 -1
  320. package/node_modules/hono/dist/helper/css/index.js +9 -1
  321. package/node_modules/hono/dist/jsx/base.js +15 -15
  322. package/node_modules/hono/dist/jsx/components.js +42 -22
  323. package/node_modules/hono/dist/jsx/context.js +129 -5
  324. package/node_modules/hono/dist/jsx/streaming.js +10 -8
  325. package/node_modules/hono/dist/middleware/cors/index.js +2 -5
  326. package/node_modules/hono/dist/middleware/serve-static/index.js +2 -2
  327. package/node_modules/hono/dist/types/adapter/aws-lambda/handler.d.ts +1 -1
  328. package/node_modules/hono/dist/types/jsx/base.d.ts +1 -3
  329. package/node_modules/hono/dist/types/jsx/context.d.ts +39 -0
  330. package/node_modules/hono/dist/types/middleware/context-storage/index.d.ts +2 -2
  331. package/node_modules/hono/dist/types/utils/body.d.ts +1 -1
  332. package/node_modules/hono/dist/utils/body.js +12 -4
  333. package/node_modules/hono/dist/utils/buffer.js +2 -1
  334. package/node_modules/hono/dist/validator/validator.js +3 -3
  335. package/node_modules/hono/package.json +9 -10
  336. package/node_modules/tailwindcss/dist/chunk-HMCCH6MG.mjs +1 -0
  337. package/node_modules/tailwindcss/dist/default-theme.mjs +1 -1
  338. package/node_modules/tailwindcss/dist/lib.js +13 -13
  339. package/node_modules/tailwindcss/dist/lib.mjs +18 -18
  340. package/node_modules/tailwindcss/package.json +2 -2
  341. package/node_modules/undici/README.md +3 -2
  342. package/node_modules/undici/docs/docs/api/Agent.md +248 -44
  343. package/node_modules/undici/docs/docs/api/BalancedPool.md +246 -48
  344. package/node_modules/undici/docs/docs/api/CacheStorage.md +171 -13
  345. package/node_modules/undici/docs/docs/api/CacheStore.md +294 -98
  346. package/node_modules/undici/docs/docs/api/Client.md +365 -178
  347. package/node_modules/undici/docs/docs/api/ClientStats.md +80 -14
  348. package/node_modules/undici/docs/docs/api/Connector.md +118 -36
  349. package/node_modules/undici/docs/docs/api/ContentType.md +65 -25
  350. package/node_modules/undici/docs/docs/api/Cookies.md +125 -47
  351. package/node_modules/undici/docs/docs/api/Debug.md +34 -18
  352. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +364 -164
  353. package/node_modules/undici/docs/docs/api/Dispatcher.md +479 -1093
  354. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +101 -87
  355. package/node_modules/undici/docs/docs/api/Errors.md +503 -40
  356. package/node_modules/undici/docs/docs/api/EventSource.md +294 -32
  357. package/node_modules/undici/docs/docs/api/Fetch.md +680 -31
  358. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +78 -98
  359. package/node_modules/undici/docs/docs/api/H2CClient.md +298 -176
  360. package/node_modules/undici/docs/docs/api/Interceptors.md +355 -0
  361. package/node_modules/undici/docs/docs/api/MockAgent.md +314 -322
  362. package/node_modules/undici/docs/docs/api/MockCallHistory.md +272 -98
  363. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +189 -26
  364. package/node_modules/undici/docs/docs/api/MockClient.md +151 -33
  365. package/node_modules/undici/docs/docs/api/MockErrors.md +56 -5
  366. package/node_modules/undici/docs/docs/api/MockPool.md +299 -263
  367. package/node_modules/undici/docs/docs/api/Pool.md +235 -43
  368. package/node_modules/undici/docs/docs/api/PoolStats.md +119 -13
  369. package/node_modules/undici/docs/docs/api/ProxyAgent.md +179 -160
  370. package/node_modules/undici/docs/docs/api/RedirectHandler.md +238 -63
  371. package/node_modules/undici/docs/docs/api/RetryAgent.md +113 -26
  372. package/node_modules/undici/docs/docs/api/RetryHandler.md +161 -77
  373. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +166 -72
  374. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +264 -542
  375. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +162 -186
  376. package/node_modules/undici/docs/docs/api/Util.md +68 -11
  377. package/node_modules/undici/docs/docs/api/WebSocket.md +475 -80
  378. package/node_modules/undici/docs/docs/api/api-lifecycle.md +100 -32
  379. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +2 -0
  380. package/node_modules/undici/docs/docs/best-practices/crawling.md +3 -1
  381. package/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +6 -4
  382. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +9 -7
  383. package/node_modules/undici/docs/docs/best-practices/proxy.md +3 -1
  384. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +10 -8
  385. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +2 -0
  386. package/node_modules/undici/docs/docs/{GettingStarted.md → getting-started.md} +22 -19
  387. package/node_modules/undici/docs/docs/index.md +779 -0
  388. package/node_modules/undici/docs/docs/site.json +125 -0
  389. package/node_modules/undici/docs/docs/type-map.json +79 -0
  390. package/node_modules/undici/lib/api/api-request.js +7 -1
  391. package/node_modules/undici/lib/api/readable.js +47 -2
  392. package/node_modules/undici/lib/core/errors.js +20 -0
  393. package/node_modules/undici/lib/core/request.js +1 -1
  394. package/node_modules/undici/lib/core/util.js +24 -1
  395. package/node_modules/undici/lib/dispatcher/client-h1.js +92 -1
  396. package/node_modules/undici/lib/dispatcher/client-h2.js +322 -118
  397. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  398. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +1 -0
  399. package/node_modules/undici/lib/dispatcher/proxy-agent.js +42 -7
  400. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +4 -2
  401. package/node_modules/undici/lib/handler/redirect-handler.js +1 -0
  402. package/node_modules/undici/lib/handler/retry-handler.js +57 -19
  403. package/node_modules/undici/lib/util/cache.js +8 -2
  404. package/node_modules/undici/lib/web/cookies/parse.js +20 -27
  405. package/node_modules/undici/lib/web/cookies/util.js +1 -1
  406. package/node_modules/undici/lib/web/eventsource/eventsource.js +7 -18
  407. package/node_modules/undici/lib/web/eventsource/util.js +32 -1
  408. package/node_modules/undici/lib/web/fetch/body.js +43 -0
  409. package/node_modules/undici/lib/web/fetch/constants.js +1 -1
  410. package/node_modules/undici/lib/web/fetch/index.js +11 -2
  411. package/node_modules/undici/lib/web/fetch/request.js +1 -0
  412. package/node_modules/undici/lib/web/fetch/util.js +4 -1
  413. package/node_modules/undici/lib/web/websocket/receiver.js +20 -3
  414. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -1
  415. package/node_modules/undici/lib/web/websocket/websocket.js +3 -1
  416. package/node_modules/undici/package.json +1 -1
  417. package/node_modules/undici/types/client.d.ts +6 -1
  418. package/node_modules/undici/types/cookies.d.ts +1 -1
  419. package/node_modules/undici/types/errors.d.ts +10 -0
  420. package/node_modules/undici/types/fetch.d.ts +1 -0
  421. package/node_modules/undici/types/handlers.d.ts +2 -0
  422. package/node_modules/undici/types/proxy-agent.d.ts +7 -0
  423. package/package.json +4 -4
  424. package/react/styles.css +510 -5
  425. package/react/styles.source.css +850 -0
  426. package/node_modules/hono/dist/tsconfig.build.tsbuildinfo +0 -1
  427. package/node_modules/tailwindcss/dist/chunk-XVOTX5KS.mjs +0 -1
@@ -0,0 +1,45 @@
1
+ import type { DeployRunDispatchInput, DeployRunExecutor } from './deploy-run-executor.js';
2
+ export interface CloudRunJobsRunRequest {
3
+ readonly name: string;
4
+ readonly body: {
5
+ readonly overrides: {
6
+ readonly containerOverrides: readonly [
7
+ {
8
+ readonly env: readonly {
9
+ readonly name: string;
10
+ readonly value: string;
11
+ }[];
12
+ }
13
+ ];
14
+ readonly taskCount: number;
15
+ readonly timeout: string;
16
+ };
17
+ };
18
+ }
19
+ export interface CloudRunJobsRunClient {
20
+ runJob(request: CloudRunJobsRunRequest): Promise<void>;
21
+ }
22
+ export interface CloudRunJobExecutorOptions {
23
+ readonly project: string;
24
+ readonly region: string;
25
+ readonly job: string;
26
+ readonly environment: string;
27
+ readonly taskTimeoutSeconds?: number;
28
+ readonly client?: CloudRunJobsRunClient;
29
+ }
30
+ /**
31
+ * Production GHD-C3 executor: launches exactly one Cloud Run Job execution for a deploy run.
32
+ * It passes only routing metadata through execution overrides. The builder claims all sensitive
33
+ * credentials from the service after startup, authenticated as its runtime service account.
34
+ */
35
+ export declare class CloudRunJobExecutor implements DeployRunExecutor {
36
+ #private;
37
+ constructor(options: CloudRunJobExecutorOptions);
38
+ dispatch(input: DeployRunDispatchInput): Promise<void>;
39
+ }
40
+ export declare function cloudRunJobName(options: {
41
+ readonly project: string;
42
+ readonly region: string;
43
+ readonly job: string;
44
+ }): string;
45
+ //# sourceMappingURL=cloud-run-job-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-run-job-executor.d.ts","sourceRoot":"","sources":["../../src/github/cloud-run-job-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,SAAS,EAAE;YAClB,QAAQ,CAAC,kBAAkB,EAAE,SAAS;gBACpC;oBACE,QAAQ,CAAC,GAAG,EAAE,SAAS;wBAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;wBAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;qBAAE,EAAE,CAAC;iBAC5E;aACF,CAAC;YACF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;YAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;SAC1B,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAC;CACzC;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,iBAAiB;;gBAM/C,OAAO,EAAE,0BAA0B;IAOzC,QAAQ,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAuB7D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CAET"}
@@ -0,0 +1,60 @@
1
+ import { GoogleAuth } from 'google-auth-library';
2
+ /**
3
+ * Production GHD-C3 executor: launches exactly one Cloud Run Job execution for a deploy run.
4
+ * It passes only routing metadata through execution overrides. The builder claims all sensitive
5
+ * credentials from the service after startup, authenticated as its runtime service account.
6
+ */
7
+ export class CloudRunJobExecutor {
8
+ #name;
9
+ #environment;
10
+ #taskTimeoutSeconds;
11
+ #client;
12
+ constructor(options) {
13
+ this.#name = cloudRunJobName(options);
14
+ this.#environment = options.environment;
15
+ this.#taskTimeoutSeconds = options.taskTimeoutSeconds ?? 180;
16
+ this.#client = options.client ?? new GoogleCloudRunJobsRunClient();
17
+ }
18
+ async dispatch(input) {
19
+ const body = {
20
+ overrides: {
21
+ containerOverrides: [
22
+ {
23
+ env: [
24
+ { name: 'NOODLE_GHD_RUN_ID', value: input.run.runId },
25
+ { name: 'NOODLE_GHD_SERVICE_BASE_URL', value: input.serviceBaseUrl },
26
+ { name: 'NOODLE_GHD_ENVIRONMENT', value: this.#environment },
27
+ ],
28
+ },
29
+ ],
30
+ taskCount: 1,
31
+ timeout: `${this.#taskTimeoutSeconds}s`,
32
+ },
33
+ };
34
+ try {
35
+ await this.#client.runJob({ name: this.#name, body });
36
+ }
37
+ catch {
38
+ // Fire-and-forget contract: dispatch launch failures must not make webhook delivery fail.
39
+ // The sweeper/reconciler owns retry/failover behavior.
40
+ }
41
+ }
42
+ }
43
+ export function cloudRunJobName(options) {
44
+ return `projects/${options.project}/locations/${options.region}/jobs/${options.job}`;
45
+ }
46
+ class GoogleCloudRunJobsRunClient {
47
+ #auth = new GoogleAuth({
48
+ scopes: ['https://www.googleapis.com/auth/cloud-platform'],
49
+ });
50
+ async runJob(request) {
51
+ const client = await this.#auth.getClient();
52
+ const url = `https://run.googleapis.com/v2/${request.name}:run`;
53
+ await client.request({
54
+ url,
55
+ method: 'POST',
56
+ data: request.body,
57
+ });
58
+ }
59
+ }
60
+ //# sourceMappingURL=cloud-run-job-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-run-job-executor.js","sourceRoot":"","sources":["../../src/github/cloud-run-job-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AA+BjD;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IACrB,KAAK,CAAS;IACd,YAAY,CAAS;IACrB,mBAAmB,CAAS;IAC5B,OAAO,CAAwB;IAExC,YAAY,OAAmC;QAC7C,IAAI,CAAC,KAA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AM,CAAC,OAA+B;QAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,GAAG,GAAG,iCAAiC,OAAO,CAAC,IAAI,MAAM,CAAC;QAChE,MAAM,MAAM,CAAC,OAAO,CAAC;YACnB,GAAG;YACH,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,64 @@
1
+ import type { PreparedPackagedAsset } from '@noodle-borg/compiler';
2
+ import type { DeployRunRecord } from '../store.js';
3
+ /**
4
+ * The environment-agnostic untrusted-compile → trusted-deploy pipeline (GHD-3, ADR 0132 Decision 6).
5
+ * Every executor — LocalProcess (C2), CloudRunJob (C3), the E2E harness — shares THIS orchestration;
6
+ * only the injected `compile` (how source becomes a manifest) and `httpFetch` (the wire) differ.
7
+ *
8
+ * The trust split is structural: `compile` runs untrusted source and is NEVER handed the run token or
9
+ * any privileged credential — it only reads files and returns data. Only after it succeeds does the
10
+ * pipeline use the run-scoped token to preflight/upload assets and POST the deploy.
11
+ *
12
+ * Debuggability is the organizing principle (the founder directive): the pipeline walks the run
13
+ * `building → deploying → deployed`, and EVERY failure path reports `failed` with a pre-redacted
14
+ * `errorSummary` that names the stage, the reason, and (via the route's own message) the fix — the
15
+ * exact text `noodle github runs <id>` surfaces. Status reporting is best-effort: a dropped status
16
+ * report is observability loss, never a reason to fail a deploy that otherwise succeeded.
17
+ */
18
+ /**
19
+ * One asset the worker must upload: its preflight metadata plus the bytes to PUT. `prepared` is the
20
+ * wire shape (no `absolutePath` — that stays in the sandbox; only the compile step reads bytes from it).
21
+ */
22
+ export interface PipelineAsset {
23
+ readonly prepared: Omit<PreparedPackagedAsset, 'absolutePath'>;
24
+ readonly bytes: Uint8Array;
25
+ }
26
+ /** What the untrusted compile stage produces — everything the trusted deploy needs, nothing more. */
27
+ export interface CompiledDeployInput {
28
+ readonly manifest: string;
29
+ readonly connectors?: string;
30
+ readonly serverVersion?: string;
31
+ /** Declared access mode from committed `noodle.json`; the deploy route resolves inherit → declared. */
32
+ readonly declaredAccessMode?: string;
33
+ readonly assets?: readonly PipelineAsset[];
34
+ }
35
+ export type CompileStageResult = {
36
+ readonly ok: true;
37
+ readonly input: CompiledDeployInput;
38
+ } | {
39
+ readonly ok: false;
40
+ readonly errorSummary: string;
41
+ };
42
+ export type DeployStage = 'compile' | 'preflight' | 'upload' | 'deploy';
43
+ export type DeployPipelineOutcome = {
44
+ readonly status: 'deployed';
45
+ readonly deploymentId: string;
46
+ } | {
47
+ readonly status: 'superseded';
48
+ } | {
49
+ readonly status: 'failed';
50
+ readonly stage: DeployStage;
51
+ readonly errorSummary: string;
52
+ };
53
+ export interface DeployPipelineDeps {
54
+ readonly run: DeployRunRecord;
55
+ /** Run-scoped credential for the status + preflight + deploy calls (never handed to `compile`). */
56
+ readonly runToken: string;
57
+ readonly serviceBaseUrl: string;
58
+ /** Untrusted compile — reads source, returns data; MUST NOT receive the run token. */
59
+ readonly compile: (run: DeployRunRecord) => Promise<CompileStageResult>;
60
+ /** Injected so tests use a fake and executors use global `fetch`. */
61
+ readonly httpFetch: typeof fetch;
62
+ }
63
+ export declare function runDeployPipeline(deps: DeployPipelineDeps): Promise<DeployPipelineOutcome>;
64
+ //# sourceMappingURL=deploy-pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-pipeline.d.ts","sourceRoot":"","sources":["../../src/github/deploy-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC;IAC/D,QAAQ,C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AAG,EAAE,eAAe,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACxE,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,OAAO,KAAK,CAAC;CAClC;AA0BD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0HhG"}
@@ -0,0 +1,121 @@
1
+ const trimTrailingSlash = (url) => url.replace(/\/+$/, '');
2
+ /** Build a redacted one-line summary from a route's own (secret-free) `{ error, code }` body. */
3
+ async function summarizeHttpFailure(stage, res) {
4
+ let code;
5
+ let message;
6
+ try {
7
+ const body = (await res.json());
8
+ if (typeof body.code === 'string')
9
+ code = body.code;
10
+ if (typeof body.error === 'string')
11
+ message = body.error;
12
+ }
13
+ catch {
14
+ // A non-JSON error body carries no structured reason; the status code still localizes the failure.
15
+ }
16
+ return {
17
+ summary: `${stage} failed (HTTP ${res.status}${code !== undefined ? `, ${code}` : ''})${message !== undefined ? `: ${message}` : ''}`,
18
+ ...(code !== undefined ? { code } : {}),
19
+ };
20
+ }
21
+ export async function runDeployPipeline(deps) {
22
+ const { run, runToken, compile, httpFetch } = deps;
23
+ const baseUrl = trimTrailingSlash(deps.serviceBaseUrl);
24
+ const statusUrl = `${baseUrl}/v1/github/runs/${encodeURIComponent(run.runId)}/status`;
25
+ const tenantBase = `${baseUrl}/v1/orgs/${encodeURIComponent(run.orgSlug)}/apps/${encodeURIComponent(run.appSlug)}/envs/${encodeURIComponent(run.envName)}`;
26
+ const report = async (to, patch) => {
27
+ try {
28
+ await httpFetch(statusUrl, {
29
+ method: 'POST',
30
+ headers: { 'content-type': 'application/json', authorization: `Bearer ${runToken}` },
31
+ body: JSON.stringify({ to, ...patch }),
32
+ });
33
+ }
34
+ catch {
35
+ // Best-effort: a failed status report is observability loss, not a deploy failure.
36
+ }
37
+ };
38
+ const fail = async (stage, errorSummary) => {
39
+ await report('failed', { errorSummary });
40
+ return { status: 'failed', stage, errorSummary };
41
+ };
42
+ let stage = 'compile';
43
+ try {
44
+ await report('building');
45
+ const compiled = await compile(run);
46
+ if (!compiled.ok)
47
+ return await fail('compile', compiled.errorSummary);
48
+ await report('deploying');
49
+ let hostedAssets;
50
+ const assets = compiled.input.assets ?? [];
51
+ if (assets.length > 0) {
52
+ stage = 'preflight';
53
+ const preflightRes = await httpFetch(`${tenantBase}/assets/preflight`, {
54
+ method: 'POST',
55
+ headers: { 'content-type': 'application/json', 'x-noodle-run-token': runToken },
56
+ body: JSON.stringify({ assets: assets.map((asset) => asset.prepared) }),
57
+ });
58
+ if (!preflightRes.ok) {
59
+ const failure = await summarizeHttpFailure('asset preflight', preflightRes);
60
+ return await fail('preflight', failure.summary);
61
+ }
62
+ const plan = (await preflightRes.json());
63
+ stage = 'upload';
64
+ for (const upload of plan.uploads ?? []) {
65
+ const asset = assets.find((candidate) => candidate.prepared.logicalId === upload.logicalId);
66
+ if (asset === undefined) {
67
+ return await fail('upload', `upload: preflight planned an unknown asset "${upload.logicalId}"`);
68
+ }
69
+ const putRes = await httpFetch(upload.uploadUrl, {
70
+ method: upload.method,
71
+ headers: upload.headers,
72
+ body: asset.bytes,
73
+ });
74
+ if (!putRes.ok) {
75
+ return await fail('upload', `upload: asset "${upload.logicalId}" PUT failed (HTTP ${putRes.status})`);
76
+ }
77
+ }
78
+ hostedAssets = plan.assets;
79
+ }
80
+ stage = 'deploy';
81
+ const deployRes = await httpFetch(`${tenantBase}/deploy`, {
82
+ method: 'POST',
83
+ headers: { 'content-type': 'application/json', 'x-noodle-run-token': runToken },
84
+ body: JSON.stringify({
85
+ manifest: compiled.input.manifest,
86
+ ...(compiled.input.connectors !== undefined
87
+ ? { connectors: compiled.input.connectors }
88
+ : {}),
89
+ ...(compiled.input.serverVersion !== undefined
90
+ ? { serverVersion: compiled.input.serverVersion }
91
+ : {}),
92
+ ...(compiled.input.declaredAccessMode !== undefined
93
+ ? { accessMode: compiled.input.declaredAccessMode }
94
+ : {}),
95
+ ...(hostedAssets !== undefined ? { hostedAssets } : {}),
96
+ }),
97
+ });
98
+ if (!deployRes.ok) {
99
+ const failure = await summarizeHttpFailure('deploy', deployRes);
100
+ if (failure.code === 'run_superseded') {
101
+ await report('superseded');
102
+ return { status: 'superseded' };
103
+ }
104
+ return await fail('deploy', failure.summary);
105
+ }
106
+ const deployed = (await deployRes.json());
107
+ if (typeof deployed.deploymentId !== 'string') {
108
+ return await fail('deploy', 'deploy: service returned no deploymentId');
109
+ }
110
+ await report('deployed', { deploymentId: deployed.deploymentId });
111
+ return { status: 'deployed', deploymentId: deployed.deploymentId };
112
+ }
113
+ catch (error) {
114
+ // An unexpected throw (network fault, etc.) still lands the run in `failed` with a redacted,
115
+ // stage-tagged summary — never a silent hang. Only the error's name is included; never a message
116
+ // that could carry a URL, token, or body.
117
+ const name = error instanceof Error ? error.name : 'Error';
118
+ return await fail(stage, `${stage}: unexpected error (${name})`);
119
+ }
120
+ }
121
+ //# sourceMappingURL=deploy-pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-pipeline.js","sourceRoot":"","sources":["../../src/github/deploy-pipeline.ts"],"names":[],"mappings":"AA4DA,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE3E,iGAAiG;AACjG,KAAK,UAAU,oBAAoB,CACjC,KAAa,EACb,GAAa;IAEb,IAAI,IAAwB,CAAC;IAC7B,IAAI,OAA2B,CAAC;IAChC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAwC,CAAC;QACvE,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;YAAE,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACpD,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;YAAE,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;IAC3D,CAAC;IAAC,MAAM,C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AO,MAAM,IAAI,CAAC,QAAQ,EAAE,0CAA0C,CAAC,CAAC;QAC1E,CAAC;QACD,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;QAClE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC;IACrE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,6FAA6F;QAC7F,iGAAiG;QACjG,0CAA0C;QAC1C,MAAM,IAAI,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;QAC3D,OAAO,MAAM,IAAI,CAAC,KAAK,EAAE,GAAG,KAAK,uBAAuB,IAAI,GAAG,CAAC,CAAC;IACnE,CAAC;AACH,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { DeployRunRecord } from '../store.js';
2
+ /**
3
+ * The isolation seam for GHD-3 (ADR 0132 Decision 6). The dispatcher hands an accepted, non-blocked
4
+ * run to an executor; the executor runs the untrusted-compile → trusted-deploy pipeline somewhere
5
+ * isolated and reports progress back through `POST /v1/github/runs/{runId}/status` using the
6
+ * `runToken`. The executor is the ONLY thing that varies by environment:
7
+ *
8
+ * - `CloudRunJobExecutor` (C3, production) — triggers one Cloud Run Job execution per run.
9
+ * - `LocalProcessExecutor` (C2, dev/self-host/E2E) — runs the pipeline as a local child process.
10
+ * - {@link FakeDeployRunExecutor} (tests) — records dispatches, runs nothing.
11
+ *
12
+ * `dispatch` is fire-and-forget from the caller's view (the webhook must answer GitHub immediately);
13
+ * it resolves once the execution is *launched*, not *finished*. It must never throw into the request
14
+ * path — an executor that can't launch records the failure out-of-band and the sweeper retries.
15
+ */
16
+ export interface DeployRunDispatchInput {
17
+ readonly run: DeployRunRecord;
18
+ /** Run-scoped credential the executor uses to report status + deploy (never the sandbox's). */
19
+ readonly runToken: string;
20
+ /** Base URL the executor calls back to (the status/deploy routes). */
21
+ readonly serviceBaseUrl: string;
22
+ }
23
+ export interface DeployRunExecutor {
24
+ dispatch(input: DeployRunDispatchInput): Promise<void>;
25
+ }
26
+ /** Test double: captures every dispatch, launches nothing. */
27
+ export declare class FakeDeployRunExecutor implements DeployRunExecutor {
28
+ #private;
29
+ readonly dispatches: DeployRunDispatchInput[];
30
+ constructor(onDispatch?: (input: DeployRunDispatchInput) => void | Promise<void>);
31
+ dispatch(input: DeployRunDispatchInput): Promise<void>;
32
+ }
33
+ //# sourceMappingURL=deploy-run-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-run-executor.d.ts","sourceRoot":"","sources":["../../src/github/deploy-run-executor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;IAC9B,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD;AAED,8DAA8D;AAC9D,qBAAa,qBAAsB,YAAW,iBAAiB;;IAC7D,QAAQ,CAAC,UAAU,EAAE,sBAAsB,EAAE,CAAM;gBAIvC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1E,QAAQ,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7D"}
@@ -0,0 +1,14 @@
1
+ /** Test double: captures every dispatch, launches nothing. */
2
+ export class FakeDeployRunExecutor {
3
+ dispatches = [];
4
+ /** Optional hook so a test can assert the token/base or simulate a launch failure. */
5
+ #onDispatch;
6
+ constructor(onDispatch) {
7
+ this.#onDispatch = onDispatch;
8
+ }
9
+ async dispatch(input) {
10
+ this.dispatches.push(input);
11
+ await this.#onDispatch?.(input);
12
+ }
13
+ }
14
+ //# sourceMappingURL=deploy-run-executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-run-executor.js","sourceRoot":"","sources":["../../src/github/deploy-run-executor.ts"],"names":[],"mappings":"AA4BA,8DAA8D;AAC9D,MAAM,OAAO,qBAAqB;IACvB,UAAU,GAA6B,EAAE,CAAC;IACnD,sFAAsF;IAC7E,WAAW,CAAwE;IAE5F,YAAY,UAAoE;QAC9E,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAA6B;QAC1C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,36 @@
1
+ import { type Logger } from '@noodle-borg/transport-http';
2
+ import type { GithubConnectionStore, GithubDeployRunStore } from '../store.js';
3
+ import type { DeployRunExecutor } from './deploy-run-executor.js';
4
+ export declare const GITHUB_RUN_RECONCILE_INTERVAL_MS = 60000;
5
+ export declare const GITHUB_RUN_TIMEOUT_MS = 180000;
6
+ export declare const GITHUB_RUN_QUEUED_REDISPATCH_GRACE_MS = 30000;
7
+ export interface GithubDeployRunReconcilerOptions {
8
+ readonly runStore: GithubDeployRunStore;
9
+ readonly connectionStore: GithubConnectionStore;
10
+ readonly executor: DeployRunExecutor;
11
+ readonly webhookSecret: string;
12
+ readonly serviceBaseUrl: string;
13
+ readonly clock?: () => Date;
14
+ readonly logger?: Logger;
15
+ readonly intervalMs?: number;
16
+ readonly runTimeoutMs?: number;
17
+ readonly queuedRedispatchGraceMs?: number;
18
+ readonly limitPerConnection?: number;
19
+ }
20
+ export interface GithubDeployRunReconcileResult {
21
+ readonly connections: number;
22
+ readonly inspected: number;
23
+ readonly dispatched: number;
24
+ readonly failed: number;
25
+ }
26
+ /**
27
+ * Idempotent GitHub deploy-run reconciler. Webhook dispatch is intentionally fire-and-forget; this
28
+ * loop is the recovery path for missed Cloud Run Job launches and abandoned in-flight runs.
29
+ */
30
+ export declare class GithubDeployRunReconciler {
31
+ #private;
32
+ constructor(options: GithubDeployRunReconcilerOptions);
33
+ maybeSweep(): void;
34
+ sweepNow(): Promise<GithubDeployRunReconcileResult>;
35
+ }
36
+ //# sourceMappingURL=deploy-run-reconciler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-run-reconciler.d.ts","sourceRoot":"","sources":["../../src/github/deploy-run-reconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAmB,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,eAAO,MAAM,gCAAgC,QAAS,CAAC;AACvD,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAC7C,eAAO,MAAM,qCAAqC,QAAS,CAAC;AAE5D,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,eAAe,EAAE,qBAAqB,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,yBAAyB;;gBAexB,OAAO,EAAE,gCAAgC;IAerD,UAAU,IAAI,IAAI;IAcZ,QAAQ,IAAI,OAAO,CAAC,8BAA8B,CAAC;CA6D1D"}
@@ -0,0 +1,107 @@
1
+ import { noopLogger } from '@noodle-borg/transport-http';
2
+ import { resolveGithubStateSecret } from './install-nonce.js';
3
+ import { signRunToken } from './run-token.js';
4
+ export const GITHUB_RUN_RECONCILE_INTERVAL_MS = 60_000;
5
+ export const GITHUB_RUN_TIMEOUT_MS = 180_000;
6
+ export const GITHUB_RUN_QUEUED_REDISPATCH_GRACE_MS = 30_000;
7
+ /**
8
+ * Idempotent GitHub deploy-run reconciler. Webhook dispatch is intentionally fire-and-forget; this
9
+ * loop is the recovery path for missed Cloud Run Job launches and abandoned in-flight runs.
10
+ */
11
+ export class GithubDeployRunReconciler {
12
+ #runStore;
13
+ #connectionStore;
14
+ #executor;
15
+ #webhookSecret;
16
+ #serviceBaseUrl;
17
+ #clock;
18
+ #logger;
19
+ #intervalMs;
20
+ #runTimeoutMs;
21
+ #queuedRedispatchGraceMs;
22
+ #limitPerConnection;
23
+ #lastSweepStartedAt = Number.NEGATIVE_INFINITY;
24
+ #inFlight = false;
25
+ constructor(options) {
26
+ this.#runStore = options.runStore;
27
+ this.#connectionStore = options.connectionStore;
28
+ this.#executor = options.executor;
29
+ this.#webhookSecret = resolveGithubStateSecret(options.webhookSecret);
30
+ this.#serviceBaseUrl = options.serviceBaseUrl.replace(/\/+$/, '');
31
+ this.#clock = options.clock ?? (() => new Date());
32
+ this.#logger = options.logger ?? noopLogger;
33
+ this.#intervalMs = options.intervalMs ?? GITHUB_RUN_RECONCILE_INTERVAL_MS;
34
+ this.#runTimeoutMs = options.runTimeoutMs ?? GITHUB_RUN_TIMEOUT_MS;
35
+ this.#queuedRedispatchGraceMs =
36
+ options.queuedRedispatchGraceMs ?? GITHUB_RUN_QUEUED_REDISPATCH_GRACE_MS;
37
+ this.#limitPerConnection = options.limitPerConnection ?? 50;
38
+ }
39
+ maybeSweep() {
40
+ const now = this.#clock().getTime();
41
+ if (this.#inFlight || now - this.#lastSweepStartedAt < this.#intervalMs)
42
+ return;
43
+ this.#lastSweepStartedAt = now;
44
+ this.#inFlight = true;
45
+ void this.sweepNow()
46
+ .catch(() => {
47
+ this.#logger.warn('github.run.reconcile_failed', { status: 500 });
48
+ })
49
+ .finally(() => {
50
+ this.#inFlight = false;
51
+ });
52
+ }
53
+ async sweepNow() {
54
+ const now = this.#clock();
55
+ const connections = await this.#connectionStore.listRepoConnections();
56
+ let inspected = 0;
57
+ let dispatched = 0;
58
+ let failed = 0;
59
+ for (const connection of connections) {
60
+ const result = await this.#runStore.listDeployRuns(connection.orgSlug, connection.appSlug, {
61
+ limit: this.#limitPerConnection,
62
+ });
63
+ for (const run of result.runs) {
64
+ if (run.githubRepositoryId !== connection.githubRepositoryId)
65
+ continue;
66
+ inspected += 1;
67
+ if (run.blockedReason !== undefined)
68
+ continue;
69
+ if (run.status === 'queued') {
70
+ if (!this.#isOlderThan(run.createdAt, now, this.#queuedRedispatchGraceMs))
71
+ continue;
72
+ await this.#dispatch(run);
73
+ dispatched += 1;
74
+ continue;
75
+ }
76
+ if ((run.status === 'building' || run.status === 'deploying') &&
77
+ this.#isOlderThan(run.startedAt ?? run.createdAt, now, this.#runTimeoutMs)) {
78
+ const transition = await this.#runStore.transitionDeployRun(run.orgSlug, run.runId, 'failed', {
79
+ errorSummary: `github build worker timed out after ${Math.round(this.#runTimeoutMs / 1000)}s`,
80
+ });
81
+ if (transition.ok)
82
+ failed += 1;
83
+ }
84
+ }
85
+ }
86
+ return { connections: connections.length, inspected, dispatched, failed };
87
+ }
88
+ async #dispatch(run) {
89
+ const runToken = signRunToken({
90
+ runId: run.runId,
91
+ org: run.orgSlug,
92
+ app: run.appSlug,
93
+ env: run.envName,
94
+ issuedAt: this.#clock().getTime(),
95
+ }, this.#webhookSecret);
96
+ await this.#executor
97
+ .dispatch({ run, runToken, serviceBaseUrl: this.#serviceBaseUrl })
98
+ .catch(() => {
99
+ this.#logger.warn('github.run.dispatch_failed', { status: 200, runId: run.runId });
100
+ });
101
+ }
102
+ #isOlderThan(iso, now, thresholdMs) {
103
+ const started = Date.parse(iso);
104
+ return Number.isFinite(started) && now.getTime() - started >= thresholdMs;
105
+ }
106
+ }
107
+ //# sourceMappingURL=deploy-run-reconciler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-run-reconciler.js","sourceRoot":"","sources":["../../src/github/deploy-run-reconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,gCAAgC,GAAG,MAAM,CAAC;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAC7C,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC;AAuB5D;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IAC3B,SAAS,CAAuB;IAChC,gBAAgB,CAAwB;IACxC,SAAS,CAAoB;IAC7B,cAAc,CAAS;IACvB,eAAe,CAAS;IACxB,MAAM,CAAa;IACnB,OAAO,CAAS;IAChB,WAAW,CAAS;IACpB,aAAa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,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QACrF,CAAC,CAAC,CAAC;IACP,CAAC;IAED,YAAY,CAAC,GAAW,EAAE,GAAS,EAAE,WAAmB;QACtD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,GAAG,OAAO,IAAI,WAAW,CAAC;IAC5E,CAAC;CACF"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Fast-lane eligibility classifier (GHD-3, ADR 0132 Decision 2). A canonical Noodle app imports only
3
+ * the SDK and local files — nothing to install — so its git deploy is structurally *seconds*. This
4
+ * gate enforces exactly that BEFORE any user source executes: a repo whose `package.json` declares
5
+ * third-party dependencies is rejected up front with a structured reason, never compiled. The slow
6
+ * lane (frozen installs) is a later, separate decision behind the same executor seam.
7
+ *
8
+ * Pure over the parsed `package.json` (no fs, no network) so it runs identically in the untrusted
9
+ * sandbox and in unit tests.
10
+ */
11
+ /** SDK package names an app may depend on without leaving the fast lane. */
12
+ export declare const FAST_LANE_ALLOWED_DEPENDENCIES: ReadonlySet<string>;
13
+ export type FastLaneClassification = {
14
+ readonly eligible: true;
15
+ } | {
16
+ readonly eligible: false;
17
+ readonly reason: 'unsupported_dependencies';
18
+ readonly unsupported: readonly string[];
19
+ };
20
+ interface PackageJsonShape {
21
+ readonly dependencies?: Readonly<Record<string, unknown>>;
22
+ readonly devDependencies?: Readonly<Record<string, unknown>>;
23
+ }
24
+ /**
25
+ * Classify a repo from its parsed `package.json` (or `undefined` when the repo has none — a bare
26
+ * `server.ts` app is fast-lane eligible). Any dependency or devDependency outside the SDK allowlist
27
+ * makes the repo slow-lane (unsupported in the MVP): the offending names are returned so the failure
28
+ * can name them.
29
+ */
30
+ export declare function classifyFastLane(pkg: PackageJsonShape | undefined): FastLaneClassification;
31
+ /**
32
+ * Parse a raw `package.json` string, then classify. Malformed JSON is treated as "no package.json"
33
+ * (fast-lane eligible) — the compile step will surface any real problem — rather than failing the
34
+ * run on a formatting quirk. Callers that need strict parsing should classify the parsed object.
35
+ */
36
+ export declare function classifyFastLaneFromRaw(raw: string | undefined): FastLaneClassification;
37
+ export {};
38
+ //# sourceMappingURL=fast-lane-classifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-lane-classifier.d.ts","sourceRoot":"","sources":["../../src/github/fast-lane-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B,EAAE,WAAW,CAAC,MAAM,CAM7D,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAC9B;IAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAA;CAAE,GAC3B;IACE,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC,CAAC;AAEN,UAAU,gBAAgB;IACxB,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1D,QAAQ,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,SAAS,GAAG,sBAAsB,CAe1F;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,sBAAsB,CAOvF"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Fast-lane eligibility classifier (GHD-3, ADR 0132 Decision 2). A canonical Noodle app imports only
3
+ * the SDK and local files — nothing to install — so its git deploy is structurally *seconds*. This
4
+ * gate enforces exactly that BEFORE any user source executes: a repo whose `package.json` declares
5
+ * third-party dependencies is rejected up front with a structured reason, never compiled. The slow
6
+ * lane (frozen installs) is a later, separate decision behind the same executor seam.
7
+ *
8
+ * Pure over the parsed `package.json` (no fs, no network) so it runs identically in the untrusted
9
+ * sandbox and in unit tests.
10
+ */
11
+ /** SDK package names an app may depend on without leaving the fast lane. */
12
+ export const FAST_LANE_ALLOWED_DEPENDENCIES = new Set([
13
+ '@noodleseed/one',
14
+ // The widget runtime the SDK's React surface compiles against — provisioned in the builder image,
15
+ // never installed from a lockfile.
16
+ 'react',
17
+ 'react-dom',
18
+ ]);
19
+ /**
20
+ * Classify a repo from its parsed `package.json` (or `undefined` when the repo has none — a bare
21
+ * `server.ts` app is fast-lane eligible). Any dependency or devDependency outside the SDK allowlist
22
+ * makes the repo slow-lane (unsupported in the MVP): the offending names are returned so the failure
23
+ * can name them.
24
+ */
25
+ export function classifyFastLane(pkg) {
26
+ if (pkg === undefined)
27
+ return { eligible: true };
28
+ const names = new Set();
29
+ for (const record of [pkg.dependencies, pkg.devDependencies]) {
30
+ if (record === undefined)
31
+ continue;
32
+ for (const name of Object.keys(record)) {
33
+ if (!FAST_LANE_ALLOWED_DEPENDENCIES.has(name))
34
+ names.add(name);
35
+ }
36
+ }
37
+ if (names.size === 0)
38
+ return { eligible: true };
39
+ return {
40
+ eligible: false,
41
+ reason: 'unsupported_dependencies',
42
+ unsupported: [...names].sort(),
43
+ };
44
+ }
45
+ /**
46
+ * Parse a raw `package.json` string, then classify. Malformed JSON is treated as "no package.json"
47
+ * (fast-lane eligible) — the compile step will surface any real problem — rather than failing the
48
+ * run on a formatting quirk. Callers that need strict parsing should classify the parsed object.
49
+ */
50
+ export function classifyFastLaneFromRaw(raw) {
51
+ if (raw === undefined)
52
+ return { eligible: true };
53
+ try {
54
+ return classifyFastLane(JSON.parse(raw));
55
+ }
56
+ catch {
57
+ return { eligible: true };
58
+ }
59
+ }
60
+ //# sourceMappingURL=fast-lane-classifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-lane-classifier.js","sourceRoot":"","sources":["../../src/github/fast-lane-classifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,8BAA8B,GAAwB,IAAI,GAAG,CAAC;IACzE,iBAAiB;IACjB,kGAAkG;IAClG,mCAAmC;IACnC,OAAO;IACP,WAAW;CACZ,CAAC,CAAC;AAeH;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAiC;IAChE,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,KAAK,MAAM,MAAM,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;QAC7D,IAAI,MAAM,KAAK,SAAS;YAAE,SAAS;QACnC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACvC,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChD,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,0BAA0B;QAClC,WAAW,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE;KAC/B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAuB;IAC7D,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjD,IAA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