@noodleseed/one 0.162.0 → 0.164.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 (326) hide show
  1. package/dist/banner.d.ts +6 -0
  2. package/dist/banner.d.ts.map +1 -0
  3. package/dist/banner.js +29 -0
  4. package/dist/banner.js.map +1 -0
  5. package/dist/commands/billing-catalog-ops.d.ts +4 -0
  6. package/dist/commands/billing-catalog-ops.d.ts.map +1 -0
  7. package/dist/commands/billing-catalog-ops.js +58 -0
  8. package/dist/commands/billing-catalog-ops.js.map +1 -0
  9. package/dist/commands/billing-ops.d.ts.map +1 -1
  10. package/dist/commands/billing-ops.js +3 -0
  11. package/dist/commands/billing-ops.js.map +1 -1
  12. package/dist/commands/catalog.d.ts.map +1 -1
  13. package/dist/commands/catalog.js +2 -0
  14. package/dist/commands/catalog.js.map +1 -1
  15. package/dist/commands/config-values.d.ts.map +1 -1
  16. package/dist/commands/config-values.js +16 -0
  17. package/dist/commands/config-values.js.map +1 -1
  18. package/dist/commands/installation-variables.d.ts +26 -0
  19. package/dist/commands/installation-variables.d.ts.map +1 -0
  20. package/dist/commands/installation-variables.js +171 -0
  21. package/dist/commands/installation-variables.js.map +1 -0
  22. package/dist/commands/project-setup.d.ts.map +1 -1
  23. package/dist/commands/project-setup.js +2 -0
  24. package/dist/commands/project-setup.js.map +1 -1
  25. package/dist/commands/solutions-activity.d.ts +5 -0
  26. package/dist/commands/solutions-activity.d.ts.map +1 -0
  27. package/dist/commands/solutions-activity.js +116 -0
  28. package/dist/commands/solutions-activity.js.map +1 -0
  29. package/dist/commands/solutions-connections.d.ts +7 -0
  30. package/dist/commands/solutions-connections.d.ts.map +1 -0
  31. package/dist/commands/solutions-connections.js +88 -0
  32. package/dist/commands/solutions-connections.js.map +1 -0
  33. package/dist/commands/solutions-installation-options.d.ts +5 -0
  34. package/dist/commands/solutions-installation-options.d.ts.map +1 -0
  35. package/dist/commands/solutions-installation-options.js +52 -0
  36. package/dist/commands/solutions-installation-options.js.map +1 -0
  37. package/dist/commands/solutions-onboarding.d.ts +5 -0
  38. package/dist/commands/solutions-onboarding.d.ts.map +1 -0
  39. package/dist/commands/solutions-onboarding.js +113 -0
  40. package/dist/commands/solutions-onboarding.js.map +1 -0
  41. package/dist/commands/solutions-ops.d.ts.map +1 -1
  42. package/dist/commands/solutions-ops.js +278 -17
  43. package/dist/commands/solutions-ops.js.map +1 -1
  44. package/dist/first-run.d.ts.map +1 -1
  45. package/dist/first-run.js +2 -0
  46. package/dist/first-run.js.map +1 -1
  47. package/dist/index.d.ts +1 -1
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/index.js.map +1 -1
  51. package/node_modules/@noodle-borg/admission-limits/dist/counter-store.d.ts +21 -2
  52. package/node_modules/@noodle-borg/admission-limits/dist/counter-store.js +10 -1
  53. package/node_modules/@noodle-borg/admission-limits/dist/in-memory-counter-store.d.ts +5 -1
  54. package/node_modules/@noodle-borg/admission-limits/dist/in-memory-counter-store.js +31 -2
  55. package/node_modules/@noodle-borg/admission-limits/dist/portable.d.ts +3 -0
  56. package/node_modules/@noodle-borg/admission-limits/dist/portable.js +3 -0
  57. package/node_modules/@noodle-borg/admission-limits/dist/public-admission-assertion.d.ts +28 -0
  58. package/node_modules/@noodle-borg/admission-limits/dist/public-admission-assertion.js +124 -0
  59. package/node_modules/@noodle-borg/admission-limits/dist/public-record-admission.d.ts +54 -0
  60. package/node_modules/@noodle-borg/admission-limits/dist/public-record-admission.js +74 -0
  61. package/node_modules/@noodle-borg/admission-limits/dist/request-attribution.d.ts +11 -0
  62. package/node_modules/@noodle-borg/admission-limits/dist/request-attribution.js +19 -0
  63. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +2 -0
  64. package/node_modules/@noodle-borg/agent-kit/dist/generated/example-files.js +5 -5
  65. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +3 -0
  66. package/node_modules/@noodle-borg/agent-kit/dist/index.d.ts +1 -0
  67. package/node_modules/@noodle-borg/agent-kit/dist/index.js +1 -0
  68. package/node_modules/@noodle-borg/agent-kit/dist/plugin-bootstrap-skill.js +10 -0
  69. package/node_modules/@noodle-borg/agent-kit/dist/skill-authoring-refs.js +15 -3
  70. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +1 -1
  71. package/node_modules/@noodle-borg/agent-kit/dist/welcome-wordmark.d.ts +3 -0
  72. package/node_modules/@noodle-borg/agent-kit/dist/welcome-wordmark.js +10 -0
  73. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  74. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-configuration.d.ts +9 -1
  75. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-configuration.js +33 -2
  76. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-execution-bound.d.ts +3 -0
  77. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-execution-bound.js +29 -0
  78. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interaction-state.d.ts +5 -3
  79. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-interaction-state.js +21 -10
  80. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.d.ts +1 -1
  81. package/node_modules/@noodle-borg/assistant-gateway/dist/assistant-store.js +3 -3
  82. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.d.ts +1 -0
  83. package/node_modules/@noodle-borg/assistant-gateway/dist/portable.js +1 -0
  84. package/node_modules/@noodle-borg/assistant-gateway/dist/session-target.js +5 -4
  85. package/node_modules/@noodle-borg/assistant-gateway/package.json +1 -1
  86. package/node_modules/@noodle-borg/authoring/dist/config.d.ts +20 -0
  87. package/node_modules/@noodle-borg/authoring/dist/config.js +29 -2
  88. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +6 -1
  89. package/node_modules/@noodle-borg/authoring/dist/connectors.js +5 -0
  90. package/node_modules/@noodle-borg/authoring/dist/index.d.ts +2 -2
  91. package/node_modules/@noodle-borg/authoring/dist/json-schema.d.ts +1 -1
  92. package/node_modules/@noodle-borg/authoring/dist/json-schema.js +15 -2
  93. package/node_modules/@noodle-borg/authoring/dist/load-authored.js +1 -1
  94. package/node_modules/@noodle-borg/authoring/dist/managed-collection.d.ts +18 -4
  95. package/node_modules/@noodle-borg/authoring/dist/managed-collection.js +22 -3
  96. package/node_modules/@noodle-borg/authoring/dist/platform.d.ts +3 -0
  97. package/node_modules/@noodle-borg/authoring/dist/platform.js +4 -0
  98. package/node_modules/@noodle-borg/authoring/dist/server-presentation.js +43 -0
  99. package/node_modules/@noodle-borg/authoring/dist/server.d.ts +3 -1
  100. package/node_modules/@noodle-borg/authoring/dist/server.js +4 -44
  101. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-billing.js +18 -0
  102. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-config.js +31 -4
  103. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-solutions.js +778 -0
  104. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-data-tenant-resources.js +0 -241
  105. package/node_modules/@noodle-borg/cli-catalog/dist/catalog-types.js +7 -0
  106. package/node_modules/@noodle-borg/cli-catalog/dist/index.js +20 -0
  107. package/node_modules/@noodle-borg/compiler/dist/artifact/assemble.js +2 -1
  108. package/node_modules/@noodle-borg/compiler/dist/artifact/catalog-emission.js +3 -1
  109. package/node_modules/@noodle-borg/compiler/dist/artifact/config.js +3 -0
  110. package/node_modules/@noodle-borg/compiler/dist/artifact/types.d.ts +17 -1
  111. package/node_modules/@noodle-borg/compiler/dist/artifact/version.d.ts +6 -1
  112. package/node_modules/@noodle-borg/compiler/dist/artifact/version.js +6 -1
  113. package/node_modules/@noodle-borg/compiler/dist/business-variables.d.ts +27 -0
  114. package/node_modules/@noodle-borg/compiler/dist/business-variables.js +230 -0
  115. package/node_modules/@noodle-borg/compiler/dist/compile.js +7 -1
  116. package/node_modules/@noodle-borg/compiler/dist/errors.d.ts +1 -1
  117. package/node_modules/@noodle-borg/compiler/dist/index.d.ts +3 -0
  118. package/node_modules/@noodle-borg/compiler/dist/index.js +3 -0
  119. package/node_modules/@noodle-borg/compiler/dist/managed-collection-controls.d.ts +52 -0
  120. package/node_modules/@noodle-borg/compiler/dist/managed-collection-controls.js +92 -0
  121. package/node_modules/@noodle-borg/compiler/dist/managed-collections.d.ts +26 -1
  122. package/node_modules/@noodle-borg/compiler/dist/managed-collections.js +190 -1
  123. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +100 -36
  124. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +2 -0
  125. package/node_modules/@noodle-borg/compiler/dist/native-record-operations.d.ts +7 -0
  126. package/node_modules/@noodle-borg/compiler/dist/native-record-operations.js +59 -0
  127. package/node_modules/@noodle-borg/connector-defs/dist/compile-http.js +83 -8
  128. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts +31 -1
  129. package/node_modules/@noodle-borg/connector-defs/dist/schema.js +16 -0
  130. package/node_modules/@noodle-borg/connector-http/dist/http-connector.d.ts +12 -3
  131. package/node_modules/@noodle-borg/connector-http/dist/http-connector.js +41 -2
  132. package/node_modules/@noodle-borg/connector-http/dist/http-response.js +3 -2
  133. package/node_modules/@noodle-borg/connector-http/dist/mcp/config.js +1 -1
  134. package/node_modules/@noodle-borg/connector-http/dist/url-resolution.js +1 -1
  135. package/node_modules/@noodle-borg/control-plane/dist/contracts.d.ts +4 -1
  136. package/node_modules/@noodle-borg/control-plane/dist/deploy-gates.js +1 -0
  137. package/node_modules/@noodle-borg/control-plane/dist/in-memory-organization-store.d.ts +3 -0
  138. package/node_modules/@noodle-borg/control-plane/dist/in-memory-organization-store.js +11 -0
  139. package/node_modules/@noodle-borg/control-plane/dist/organization-agreements.d.ts +45 -0
  140. package/node_modules/@noodle-borg/control-plane/dist/organization-agreements.js +74 -0
  141. package/node_modules/@noodle-borg/control-plane/dist/portable.d.ts +1 -0
  142. package/node_modules/@noodle-borg/control-plane/dist/portable.js +1 -0
  143. package/node_modules/@noodle-borg/module/dist/contract.d.ts +22 -0
  144. package/node_modules/@noodle-borg/module/dist/platform-human-identity.d.ts +2 -0
  145. package/node_modules/@noodle-borg/protocol/dist/request-deps.js +1 -0
  146. package/node_modules/@noodle-borg/protocol/dist/request-state.d.ts +1 -0
  147. package/node_modules/@noodle-borg/protocol/dist/request-state.js +11 -2
  148. package/node_modules/@noodle-borg/protocol/dist/sdk-server.d.ts +2 -0
  149. package/node_modules/@noodle-borg/protocol/dist/v2/input-required.js +2 -1
  150. package/node_modules/@noodle-borg/protocol/dist/v2/server.js +2 -1
  151. package/node_modules/@noodle-borg/runtime/dist/ambient-context.js +6 -1
  152. package/node_modules/@noodle-borg/runtime/dist/broker/types.d.ts +2 -0
  153. package/node_modules/@noodle-borg/runtime/dist/business-variables.d.ts +15 -0
  154. package/node_modules/@noodle-borg/runtime/dist/business-variables.js +75 -0
  155. package/node_modules/@noodle-borg/runtime/dist/confirmation-continuation.js +2 -1
  156. package/node_modules/@noodle-borg/runtime/dist/confirmation.js +23 -3
  157. package/node_modules/@noodle-borg/runtime/dist/connector/types.d.ts +17 -1
  158. package/node_modules/@noodle-borg/runtime/dist/connector-snapshot.js +6 -0
  159. package/node_modules/@noodle-borg/runtime/dist/execute.d.ts +18 -3
  160. package/node_modules/@noodle-borg/runtime/dist/execute.js +13 -3
  161. package/node_modules/@noodle-borg/runtime/dist/index.d.ts +2 -0
  162. package/node_modules/@noodle-borg/runtime/dist/index.js +1 -0
  163. package/node_modules/@noodle-borg/runtime/dist/interactive.js +11 -0
  164. package/node_modules/@noodle-borg/runtime/dist/managed-origins.d.ts +3 -1
  165. package/node_modules/@noodle-borg/runtime/dist/managed-origins.js +32 -7
  166. package/node_modules/@noodle-borg/runtime/dist/operation-credential.js +6 -0
  167. package/node_modules/@noodle-borg/runtime/dist/operation-evidence.d.ts +30 -0
  168. package/node_modules/@noodle-borg/runtime/dist/operation-evidence.js +68 -0
  169. package/node_modules/@noodle-borg/runtime/dist/operation-execution.d.ts +2 -2
  170. package/node_modules/@noodle-borg/runtime/dist/operation-execution.js +142 -71
  171. package/node_modules/@noodle-borg/runtime/dist/result.d.ts +6 -4
  172. package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.d.ts +7 -0
  173. package/node_modules/@noodle-borg/runtime/dist/tool-dispatch.js +48 -4
  174. package/node_modules/@noodle-borg/service/dist/admission.js +2 -1
  175. package/node_modules/@noodle-borg/service/dist/application-activity.js +236 -0
  176. package/node_modules/@noodle-borg/service/dist/application-business-notice.js +28 -0
  177. package/node_modules/@noodle-borg/service/dist/application-runtime-target.js +141 -0
  178. package/node_modules/@noodle-borg/service/dist/application-settings-targets.js +72 -0
  179. package/node_modules/@noodle-borg/service/dist/application-settings.js +210 -0
  180. package/node_modules/@noodle-borg/service/dist/business-api-admission.js +121 -0
  181. package/node_modules/@noodle-borg/service/dist/business-information/activity-pagination.js +73 -0
  182. package/node_modules/@noodle-borg/service/dist/business-information/business-notice.d.ts +24 -0
  183. package/node_modules/@noodle-borg/service/dist/business-information/business-notice.js +18 -0
  184. package/node_modules/@noodle-borg/service/dist/business-information/collection-controls.js +51 -0
  185. package/node_modules/@noodle-borg/service/dist/business-information/contracts.d.ts +439 -0
  186. package/node_modules/@noodle-borg/service/dist/business-information/definition-resolver.js +94 -0
  187. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-installation-lifecycle.js +136 -0
  188. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-invitations.js +160 -0
  189. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-locks.js +23 -0
  190. package/node_modules/@noodle-borg/service/dist/business-information/in-memory-store.js +287 -132
  191. package/node_modules/@noodle-borg/service/dist/business-information/installation-capacity.js +10 -0
  192. package/node_modules/@noodle-borg/service/dist/business-information/invitations.js +68 -0
  193. package/node_modules/@noodle-borg/service/dist/business-information/legacy-request-migration.js +60 -0
  194. package/node_modules/@noodle-borg/service/dist/business-information/managed-releases.js +245 -0
  195. package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-blueprints.js +51 -0
  196. package/node_modules/@noodle-borg/service/dist/business-information/managed-solution-executable.js +76 -0
  197. package/node_modules/@noodle-borg/service/dist/business-information/model.js +124 -23
  198. package/node_modules/@noodle-borg/service/dist/business-information/native-query.js +162 -0
  199. package/node_modules/@noodle-borg/service/dist/business-information/native-storage-budget.js +60 -0
  200. package/node_modules/@noodle-borg/service/dist/business-information/pagination.js +28 -0
  201. package/node_modules/@noodle-borg/service/dist/business-information/portable.js +9 -0
  202. package/node_modules/@noodle-borg/service/dist/business-information/principal-authority.d.ts +11 -0
  203. package/node_modules/@noodle-borg/service/dist/business-information/principal-authority.js +42 -0
  204. package/node_modules/@noodle-borg/service/dist/business-information/profiles.js +137 -6
  205. package/node_modules/@noodle-borg/service/dist/business-information/reader-floor.js +26 -0
  206. package/node_modules/@noodle-borg/service/dist/business-information/source-credential-fence.js +79 -0
  207. package/node_modules/@noodle-borg/service/dist/business-information/source-custody-budget.js +30 -0
  208. package/node_modules/@noodle-borg/service/dist/business-information/source-custody-memory.js +122 -0
  209. package/node_modules/@noodle-borg/service/dist/business-information/source-executor.js +191 -0
  210. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-contracts.js +2 -0
  211. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-coordinator.js +136 -0
  212. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-failures.js +32 -0
  213. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-state.js +154 -0
  214. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-store.js +568 -0
  215. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-types.js +26 -0
  216. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-memory-values.js +59 -0
  217. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-pagination.js +54 -0
  218. package/node_modules/@noodle-borg/service/dist/business-information/source-ingestion-validation.js +163 -0
  219. package/node_modules/@noodle-borg/service/dist/business-information/source-refresh-retention.js +29 -0
  220. package/node_modules/@noodle-borg/service/dist/business-information-runtime.js +80 -0
  221. package/node_modules/@noodle-borg/service/dist/business-onboarding.js +73 -0
  222. package/node_modules/@noodle-borg/service/dist/connections/types.js +8 -0
  223. package/node_modules/@noodle-borg/service/dist/credential-binding-index.js +38 -33
  224. package/node_modules/@noodle-borg/service/dist/deployment-execution.js +275 -0
  225. package/node_modules/@noodle-borg/service/dist/external-credential-binding-broker.js +19 -1
  226. package/node_modules/@noodle-borg/service/dist/external-credential-exchange.d.ts +16 -1
  227. package/node_modules/@noodle-borg/service/dist/modules/host.js +4 -1
  228. package/node_modules/@noodle-borg/service/dist/native-record-connector.d.ts +20 -0
  229. package/node_modules/@noodle-borg/service/dist/native-record-connector.js +206 -0
  230. package/node_modules/@noodle-borg/service/dist/oauth/store.d.ts +3 -0
  231. package/node_modules/@noodle-borg/service/dist/operation-evidence.js +89 -0
  232. package/node_modules/@noodle-borg/service/dist/recovery-quarantine.js +49 -0
  233. package/node_modules/@noodle-borg/service/dist/registry-compile.js +60 -11
  234. package/node_modules/@noodle-borg/service/dist/registry-deploy-transaction.js +18 -0
  235. package/node_modules/@noodle-borg/service/dist/registry-rollback.js +2 -1
  236. package/node_modules/@noodle-borg/service/dist/registry-state.d.ts +1 -1
  237. package/node_modules/@noodle-borg/service/dist/registry-state.js +6 -3
  238. package/node_modules/@noodle-borg/service/dist/registry-targets.js +49 -0
  239. package/node_modules/@noodle-borg/service/dist/registry-types.d.ts +2 -0
  240. package/node_modules/@noodle-borg/service/dist/registry.d.ts +15 -3
  241. package/node_modules/@noodle-borg/service/dist/registry.js +177 -137
  242. package/node_modules/@noodle-borg/service/dist/routes/assistant-appearance.js +3 -2
  243. package/node_modules/@noodle-borg/service/dist/routes/assistant-clients.js +2 -1
  244. package/node_modules/@noodle-borg/service/dist/routes/assistant-doctor.js +2 -1
  245. package/node_modules/@noodle-borg/service/dist/routes/assistant-embeds.js +8 -3
  246. package/node_modules/@noodle-borg/service/dist/routes/assistant-interaction-replay.js +1 -1
  247. package/node_modules/@noodle-borg/service/dist/routes/assistant-interactions.js +48 -36
  248. package/node_modules/@noodle-borg/service/dist/routes/assistant-public-configuration.js +3 -2
  249. package/node_modules/@noodle-borg/service/dist/routes/assistant-public-session.js +10 -10
  250. package/node_modules/@noodle-borg/service/dist/routes/assistant-session-target.js +32 -3
  251. package/node_modules/@noodle-borg/service/dist/routes/assistant-suggestions.js +1 -1
  252. package/node_modules/@noodle-borg/service/dist/routes/assistant-transcript.js +1 -1
  253. package/node_modules/@noodle-borg/service/dist/routes/assistant.js +10 -10
  254. package/node_modules/@noodle-borg/service/dist/routes/business-information-activity.js +83 -0
  255. package/node_modules/@noodle-borg/service/dist/routes/business-information-admission.js +26 -0
  256. package/node_modules/@noodle-borg/service/dist/routes/business-information-channels.js +153 -0
  257. package/node_modules/@noodle-borg/service/dist/routes/business-information-connections.js +107 -0
  258. package/node_modules/@noodle-borg/service/dist/routes/business-information-dispatch.js +87 -4
  259. package/node_modules/@noodle-borg/service/dist/routes/business-information-external.js +79 -0
  260. package/node_modules/@noodle-borg/service/dist/routes/business-information-installation.js +24 -0
  261. package/node_modules/@noodle-borg/service/dist/routes/business-information-notice.js +69 -0
  262. package/node_modules/@noodle-borg/service/dist/routes/business-information-onboarding.js +58 -0
  263. package/node_modules/@noodle-borg/service/dist/routes/business-information-paths.js +76 -0
  264. package/node_modules/@noodle-borg/service/dist/routes/business-information-public.js +151 -0
  265. package/node_modules/@noodle-borg/service/dist/routes/business-information-reader-floor.js +15 -0
  266. package/node_modules/@noodle-borg/service/dist/routes/business-information-record-create.js +29 -0
  267. package/node_modules/@noodle-borg/service/dist/routes/business-information-record-reads.js +36 -0
  268. package/node_modules/@noodle-borg/service/dist/routes/business-information-request.js +64 -0
  269. package/node_modules/@noodle-borg/service/dist/routes/business-information-settings.js +64 -0
  270. package/node_modules/@noodle-borg/service/dist/routes/business-information-source.js +249 -0
  271. package/node_modules/@noodle-borg/service/dist/routes/business-information-staff.js +258 -0
  272. package/node_modules/@noodle-borg/service/dist/routes/business-information-wire.js +226 -26
  273. package/node_modules/@noodle-borg/service/dist/routes/business-information.js +238 -197
  274. package/node_modules/@noodle-borg/service/dist/routes/config-values-dispatch.js +1 -1
  275. package/node_modules/@noodle-borg/service/dist/routes/config-values.js +26 -4
  276. package/node_modules/@noodle-borg/service/dist/routes/control-plane.js +33 -234
  277. package/node_modules/@noodle-borg/service/dist/routes/deployment-activation-response.js +13 -4
  278. package/node_modules/@noodle-borg/service/dist/service-resource-cleanup.js +4 -0
  279. package/node_modules/@noodle-borg/service/dist/service.js +57 -11
  280. package/node_modules/@noodle-borg/service/dist/solution-installation-activation.js +149 -0
  281. package/node_modules/@noodle-borg/service/dist/source-configuration-authority.js +94 -0
  282. package/node_modules/@noodle-borg/service/dist/state-catalog.js +6 -5
  283. package/node_modules/@noodle-borg/service/dist/store/config-values.d.ts +42 -17
  284. package/node_modules/@noodle-borg/service/dist/store/config-values.js +123 -24
  285. package/node_modules/@noodle-borg/service/dist/store/in-memory.d.ts +1 -0
  286. package/node_modules/@noodle-borg/service/dist/store/in-memory.js +3 -0
  287. package/node_modules/@noodle-borg/service/dist/store/json-file.d.ts +1 -0
  288. package/node_modules/@noodle-borg/service/dist/store/json-file.js +3 -0
  289. package/node_modules/@noodle-borg/service/dist/store.d.ts +3 -1
  290. package/node_modules/@noodle-borg/service/package.json +2 -2
  291. package/node_modules/@noodle-borg/transport-http/dist/serve-request.js +9 -0
  292. package/node_modules/@noodle-borg/transport-http/package.json +1 -0
  293. package/node_modules/@noodle-borg/wire-contracts/dist/application-activity.d.ts +143 -0
  294. package/node_modules/@noodle-borg/wire-contracts/dist/application-activity.js +90 -0
  295. package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.d.ts +130 -0
  296. package/node_modules/@noodle-borg/wire-contracts/dist/application-channels.js +77 -0
  297. package/node_modules/@noodle-borg/wire-contracts/dist/application-connections.d.ts +105 -0
  298. package/node_modules/@noodle-borg/wire-contracts/dist/application-connections.js +67 -0
  299. package/node_modules/@noodle-borg/wire-contracts/dist/application-onboarding.d.ts +27 -0
  300. package/node_modules/@noodle-borg/wire-contracts/dist/application-onboarding.js +28 -0
  301. package/node_modules/@noodle-borg/wire-contracts/dist/application-settings.d.ts +112 -0
  302. package/node_modules/@noodle-borg/wire-contracts/dist/application-settings.js +88 -0
  303. package/node_modules/@noodle-borg/wire-contracts/dist/assistant.d.ts +1 -1
  304. package/node_modules/@noodle-borg/wire-contracts/dist/billing-catalog.d.ts +62 -0
  305. package/node_modules/@noodle-borg/wire-contracts/dist/billing-catalog.js +57 -0
  306. package/node_modules/@noodle-borg/wire-contracts/dist/billing-enforcement.d.ts +12 -12
  307. package/node_modules/@noodle-borg/wire-contracts/dist/billing-metering.d.ts +4 -4
  308. package/node_modules/@noodle-borg/wire-contracts/dist/billing-org-transfer.d.ts +3 -3
  309. package/node_modules/@noodle-borg/wire-contracts/dist/business-information-query.d.ts +25 -0
  310. package/node_modules/@noodle-borg/wire-contracts/dist/business-information-query.js +37 -0
  311. package/node_modules/@noodle-borg/wire-contracts/dist/business-information.d.ts +1816 -158
  312. package/node_modules/@noodle-borg/wire-contracts/dist/business-information.js +416 -41
  313. package/node_modules/@noodle-borg/wire-contracts/dist/control-plane.d.ts +2 -2
  314. package/node_modules/@noodle-borg/wire-contracts/dist/distribution.d.ts +5 -5
  315. package/node_modules/@noodle-borg/wire-contracts/dist/index.d.ts +8 -0
  316. package/node_modules/@noodle-borg/wire-contracts/dist/index.js +8 -0
  317. package/node_modules/@noodle-borg/wire-contracts/dist/knowledge.d.ts +3 -3
  318. package/node_modules/@noodle-borg/wire-contracts/dist/managed-assistant-sponsorship.d.ts +7 -7
  319. package/node_modules/@noodle-borg/wire-contracts/dist/platform-account-reset.d.ts +5 -0
  320. package/node_modules/@noodle-borg/wire-contracts/dist/platform-account-reset.js +1 -0
  321. package/node_modules/@noodle-borg/wire-contracts/dist/platform-auth.d.ts +66 -66
  322. package/node_modules/@noodle-borg/wire-contracts/dist/solution-onboarding.d.ts +143 -0
  323. package/node_modules/@noodle-borg/wire-contracts/dist/solution-onboarding.js +94 -0
  324. package/node_modules/@noodleseed/assistant/README.md +5 -0
  325. package/node_modules/@noodleseed/assistant/package.json +1 -1
  326. package/package.json +2 -2
@@ -6,14 +6,14 @@ import { DeploymentLockedError, deploymentLockedConflict, deploymentLockedPrefli
6
6
  import { defaultActiveRecord } from './deployment-versioning.js';
7
7
  import { updateRegistryAccess } from './registry-access.js';
8
8
  import { compileRegistryTarget } from './registry-compile.js';
9
- import { preflightRegistryDeploy, resolveDeployAttempt } from './registry-deploy-transaction.js';
9
+ import { preflightRegistryDeploy, resolveDeployAttempt, withDeploymentConfiguration, } from './registry-deploy-transaction.js';
10
10
  import { deploymentOwnerSubject, missingCapabilityErrors, } from './registry-helpers.js';
11
11
  import { registryDeploymentPackage, renderDeploymentPackageSnapshot } from './registry-package.js';
12
12
  import { recoverRegistryRecords } from './registry-recover.js';
13
13
  import { rollbackDeployment, rollbackWithMappedErrors } from './registry-rollback.js';
14
14
  import { activeRecord, activeRecordVersion, persistDeployRecord, reconcilePlatformAccountResetRegistryCache, registryAppArchivedAt, registryArchiveApp, registryCustomerAuthRestoreProjections, registryGetApp, registryGetDeployment, registryGetEnvironment, registryListApps, registryListEnvironments, registryRestoreApp, registrySetProductionEnvironment, registrySweepArchived, setRegistryDeploymentLock, } from './registry-state.js';
15
15
  import { deploymentStatusFor } from './registry-status.js';
16
- import { emptySecretEnvelope, recordTenant, servedTargetFor, targetForPersistedRecord, tenantDeploymentKey, tenantKey, } from './registry-targets.js';
16
+ import { deploymentSourceFor, emptySecretEnvelope, rebindNativeRecords, recordTenant, servedTargetFor, targetForPersistedRecord, tenantDeploymentKey, tenantKey, } from './registry-targets.js';
17
17
  import { withBuiltinStateCatalog } from './state-catalog.js';
18
18
  import { deploymentSummary, matchesDeploymentFilter, validateDeploymentListFilter, } from './store/records.js';
19
19
  import { InMemoryConfigStore, validateTenantRef, } from './store.js';
@@ -23,12 +23,14 @@ export class ServerRegistry {
23
23
  #activeTenants = new Map();
24
24
  #productionEnvironments = new Map();
25
25
  #store;
26
+ #applicationLifecycleObserver;
26
27
  #configStore;
27
28
  #customerVerifierFactory;
28
29
  #policyGate;
29
30
  #transactionalModuleDeploymentActivation;
30
31
  #platformCatalog;
31
32
  #platformConnectors;
33
+ #nativeRecords;
32
34
  #stateHandleStoreFactory;
33
35
  #delegatedCredentialStore;
34
36
  #sealCustomerCredential;
@@ -57,6 +59,7 @@ export class ServerRegistry {
57
59
  options.transactionalModuleDeploymentActivation === true;
58
60
  this.#platformCatalog = withBuiltinStateCatalog(options.platformCatalog ?? []);
59
61
  this.#platformConnectors = options.platformConnectors ?? [];
62
+ this.#nativeRecords = options.nativeRecords;
60
63
  this.#stateHandleStoreFactory = options.stateHandleStoreFactory;
61
64
  this.#delegatedCredentialStore = options.delegatedCredentialStore;
62
65
  this.#sealCustomerCredential = options.sealCustomerCredential;
@@ -80,8 +83,22 @@ export class ServerRegistry {
80
83
  return this.#transactionalModuleDeploymentActivation;
81
84
  }
82
85
  setPlatformConnectors(input) {
83
- this.#platformCatalog = withBuiltinStateCatalog(input.catalog);
84
- this.#platformConnectors = input.connectors;
86
+ if (input.catalog !== undefined)
87
+ this.#platformCatalog = withBuiltinStateCatalog(input.catalog);
88
+ if (input.connectors !== undefined)
89
+ this.#platformConnectors = input.connectors;
90
+ this.#nativeRecords = input.nativeRecords;
91
+ if (input.catalog !== undefined || input.connectors !== undefined) {
92
+ this.#servers.clear();
93
+ return;
94
+ }
95
+ // Bind the new native-record port without resetting unrelated deployment-owned state or hooks.
96
+ for (const [id, target] of this.#servers) {
97
+ const record = this.#records.get(id);
98
+ if (!record)
99
+ continue;
100
+ this.#servers.set(id, rebindNativeRecords(target, record, input.nativeRecords));
101
+ }
85
102
  }
86
103
  setLocalAssetOptions(options) {
87
104
  this.#localAssetOptions = options;
@@ -91,103 +108,80 @@ export class ServerRegistry {
91
108
  return this.#localAssetsByPath.get(pathname);
92
109
  }
93
110
  async deploy(tenant, manifest, options = {}) {
94
- const { connectors, actor, accessMode, hostedAssets, serverVersion, deploymentSource, idempotencyKey, } = options;
95
- const { orgMembershipSources } = options;
96
- const { automationId } = options;
97
- const safeTenant = validateTenantRef(tenant);
98
- const safeServerVersion = serverVersion !== undefined ? normalizeServerVersion(serverVersion) : undefined;
99
- if (safeServerVersion !== undefined) {
100
- const active = await activeRecordVersion(this.#stateView(), safeTenant, safeServerVersion);
101
- if (active?.deploymentLock !== undefined)
102
- return deploymentLockedConflict();
103
- }
104
- const preflight = await preflightRegistryDeploy({
105
- options,
106
- serviceCapabilities: this.#serviceCapabilities,
107
- compile: () => this.#compileTarget(safeTenant, manifest, connectors, hostedAssets, false),
108
- });
109
- if (!preflight.ok)
110
- return preflight;
111
- const attempt = await resolveDeployAttempt({
112
- serverName: preflight.serverName,
113
- ...(idempotencyKey !== undefined ? { idempotencyKey } : {}),
114
- ...(this.#store !== undefined ? { store: this.#store } : {}),
115
- records: this.#records,
116
- tenant: safeTenant,
117
- manifest,
118
- options,
119
- });
120
- if (attempt.replay !== undefined)
121
- return attempt.replay;
122
- const { deploymentId } = attempt;
123
- let appPackageSnapshot = preflight.appPackageSnapshot;
124
- if (preflight.appPackageArtifact !== undefined && appPackageSnapshot === undefined) {
125
- const rendered = renderDeploymentPackageSnapshot(preflight.appPackageArtifact, this.#appPackageRenderer);
126
- if (!rendered.ok)
127
- return rendered;
128
- appPackageSnapshot = rendered.snapshot;
129
- }
130
- const version = Date.now();
131
- const built = preflight.bindDeployment(deploymentId);
132
- const serverAuth = built.artifact.server.auth;
133
- const ownerSubject = accessMode === 'owner-only' ? (options.ownerSubject ?? actor?.subject) : undefined;
134
- const record = {
135
- schemaVersion: 1,
136
- deploymentId,
137
- orgSlug: safeTenant.org,
138
- appSlug: safeTenant.app,
139
- environment: safeTenant.env,
140
- ...(safeServerVersion !== undefined ? { serverVersion: safeServerVersion } : {}),
141
- deploymentVersion: version,
142
- active: automationId === undefined,
143
- serverName: built.artifact.server.name,
144
- createdAt: new Date().toISOString(),
145
- ...(actor ? { createdBySubject: actor.subject, createdByEmail: actor.email } : {}),
146
- ...(ownerSubject !== undefined ? { ownerSubject } : {}),
147
- ...(deploymentSource !== undefined ? { deploymentSource } : {}),
148
- ...(accessMode !== undefined ? { accessMode } : {}),
149
- ...(orgMembershipSources !== undefined ? { orgMembershipSources } : {}),
150
- ...(serverAuth !== undefined ? { serverAuth } : {}),
151
- manifest,
152
- ...(connectors !== undefined ? { connectors } : {}),
153
- ...(hostedAssets !== undefined && hostedAssets.length > 0 ? { hostedAssets } : {}),
154
- ...(appPackageSnapshot !== undefined ? { appPackageSnapshot } : {}),
155
- secrets: emptySecretEnvelope(),
156
- };
157
- if (await this.#hasCustomerAuthAudienceConflict(record, serverAuth)) {
158
- return customerAuthAudienceConflictFailure();
159
- }
160
- let active;
161
- try {
162
- active = await withKnowledgePublication(this.#knowledgeHooks, safeTenant, deploymentId, built.artifact.server.knowledge, () => persistDeployRecord(this.#stateView(), record, safeTenant, automationId === undefined));
163
- }
164
- catch (error) {
165
- if (error instanceof KnowledgePublicationError) {
166
- return { ok: false, errors: error.errors };
111
+ return withDeploymentConfiguration(this.#configStore, tenant.org, async () => {
112
+ const { connectors, actor, accessMode, hostedAssets, serverVersion, deploymentSource, idempotencyKey, } = options;
113
+ const { orgMembershipSources } = options;
114
+ const { automationId } = options;
115
+ const safeTenant = validateTenantRef(tenant);
116
+ const safeServerVersion = serverVersion !== undefined ? normalizeServerVersion(serverVersion) : undefined;
117
+ if (safeServerVersion !== undefined) {
118
+ const active = await activeRecordVersion(this.#stateView(), safeTenant, safeServerVersion);
119
+ if (active?.deploymentLock !== undefined)
120
+ return deploymentLockedConflict();
121
+ }
122
+ const preflight = await preflightRegistryDeploy({
123
+ options,
124
+ serviceCapabilities: this.#serviceCapabilities,
125
+ compile: () => this.#compileTarget(safeTenant, manifest, connectors, hostedAssets, false),
126
+ });
127
+ if (!preflight.ok)
128
+ return preflight;
129
+ const attempt = await resolveDeployAttempt({
130
+ serverName: preflight.serverName,
131
+ ...(idempotencyKey !== undefined ? { idempotencyKey } : {}),
132
+ ...(this.#store !== undefined ? { store: this.#store } : {}),
133
+ records: this.#records,
134
+ tenant: safeTenant,
135
+ manifest,
136
+ options,
137
+ });
138
+ if (attempt.replay !== undefined)
139
+ return attempt.replay;
140
+ const { deploymentId } = attempt;
141
+ let appPackageSnapshot = preflight.appPackageSnapshot;
142
+ if (preflight.appPackageArtifact !== undefined && appPackageSnapshot === undefined) {
143
+ const rendered = renderDeploymentPackageSnapshot(preflight.appPackageArtifact, this.#appPackageRenderer);
144
+ if (!rendered.ok)
145
+ return rendered;
146
+ appPackageSnapshot = rendered.snapshot;
167
147
  }
168
- if (error instanceof CustomerAuthAudienceConflictError) {
148
+ const version = Date.now();
149
+ const built = preflight.bindDeployment(deploymentId);
150
+ const serverAuth = built.artifact.server.auth;
151
+ const ownerSubject = accessMode === 'owner-only' ? (options.ownerSubject ?? actor?.subject) : undefined;
152
+ const record = {
153
+ schemaVersion: 1,
154
+ deploymentId,
155
+ orgSlug: safeTenant.org,
156
+ appSlug: safeTenant.app,
157
+ environment: safeTenant.env,
158
+ ...(safeServerVersion !== undefined ? { serverVersion: safeServerVersion } : {}),
159
+ deploymentVersion: version,
160
+ active: automationId === undefined,
161
+ serverName: built.artifact.server.name,
162
+ createdAt: new Date().toISOString(),
163
+ ...(actor ? { createdBySubject: actor.subject, createdByEmail: actor.email } : {}),
164
+ ...(ownerSubject !== undefined ? { ownerSubject } : {}),
165
+ ...(deploymentSource !== undefined ? { deploymentSource } : {}),
166
+ ...(accessMode !== undefined ? { accessMode } : {}),
167
+ ...(orgMembershipSources !== undefined ? { orgMembershipSources } : {}),
168
+ ...(serverAuth !== undefined ? { serverAuth } : {}),
169
+ manifest,
170
+ ...(connectors !== undefined ? { connectors } : {}),
171
+ ...(hostedAssets !== undefined && hostedAssets.length > 0 ? { hostedAssets } : {}),
172
+ ...(appPackageSnapshot !== undefined ? { appPackageSnapshot } : {}),
173
+ secrets: emptySecretEnvelope(),
174
+ };
175
+ if (await this.#hasCustomerAuthAudienceConflict(record, serverAuth)) {
169
176
  return customerAuthAudienceConflictFailure();
170
177
  }
171
- if (error instanceof DeploymentLockedError)
172
- return deploymentLockedConflict();
173
- throw error;
174
- }
175
- if (automationId !== undefined) {
176
- let activation;
178
+ let active;
177
179
  try {
178
- activation = await this.#store?.activateDeployment(safeTenant, deploymentId, undefined, {
179
- automationId,
180
- });
180
+ active = await withKnowledgePublication(this.#knowledgeHooks, safeTenant, deploymentId, built.artifact.server.knowledge, () => persistDeployRecord(this.#stateView(), record, safeTenant, automationId === undefined));
181
181
  }
182
182
  catch (error) {
183
- if (error instanceof DeploymentActivationError && error.code === 'automation_superseded') {
184
- return {
185
- ok: false,
186
- superseded: true,
187
- deploymentId,
188
- deploymentVersion: version,
189
- ...(safeServerVersion !== undefined ? { serverVersion: safeServerVersion } : {}),
190
- };
183
+ if (error instanceof KnowledgePublicationError) {
184
+ return { ok: false, errors: error.errors };
191
185
  }
192
186
  if (error instanceof CustomerAuthAudienceConflictError) {
193
187
  return customerAuthAudienceConflictFailure();
@@ -196,40 +190,66 @@ export class ServerRegistry {
196
190
  return deploymentLockedConflict();
197
191
  throw error;
198
192
  }
199
- if (activation === undefined) {
200
- return {
201
- ok: false,
202
- errors: [
203
- {
204
- code: 'run_activation_failed',
205
- path: 'deploymentId',
206
- message: 'deployment could not be activated for this automation run',
207
- },
208
- ],
209
- };
193
+ if (automationId !== undefined) {
194
+ let activation;
195
+ try {
196
+ activation = await this.#store?.activateDeployment(safeTenant, deploymentId, undefined, {
197
+ automationId,
198
+ });
199
+ }
200
+ catch (error) {
201
+ if (error instanceof DeploymentActivationError &&
202
+ error.code === 'automation_superseded') {
203
+ return {
204
+ ok: false,
205
+ superseded: true,
206
+ deploymentId,
207
+ deploymentVersion: version,
208
+ ...(safeServerVersion !== undefined ? { serverVersion: safeServerVersion } : {}),
209
+ };
210
+ }
211
+ if (error instanceof CustomerAuthAudienceConflictError) {
212
+ return customerAuthAudienceConflictFailure();
213
+ }
214
+ if (error instanceof DeploymentLockedError)
215
+ return deploymentLockedConflict();
216
+ throw error;
217
+ }
218
+ if (activation === undefined) {
219
+ return {
220
+ ok: false,
221
+ errors: [
222
+ {
223
+ code: 'run_activation_failed',
224
+ path: 'deploymentId',
225
+ message: 'deployment could not be activated for this automation run',
226
+ },
227
+ ],
228
+ };
229
+ }
230
+ active = activation.active;
231
+ this.#records.set(active.deploymentId, active);
232
+ const previous = activation.previousActive;
233
+ if (previous !== undefined && previous.deploymentId !== active.deploymentId) {
234
+ this.#records.set(previous.deploymentId, { ...previous, active: false });
235
+ }
210
236
  }
211
- active = activation.active;
212
- this.#records.set(active.deploymentId, active);
213
- const previous = activation.previousActive;
214
- if (previous !== undefined && previous.deploymentId !== active.deploymentId) {
215
- this.#records.set(previous.deploymentId, { ...previous, active: false });
237
+ if (await this.#hasCustomerAuthAudienceConflict(active, serverAuth)) {
238
+ return customerAuthAudienceConflictFailure();
216
239
  }
217
- }
218
- if (await this.#hasCustomerAuthAudienceConflict(active, serverAuth)) {
219
- return customerAuthAudienceConflictFailure();
220
- }
221
- this.#servers.set(deploymentId, servedTargetFor(active, built, this.#customerVerifierFactory));
222
- this.#activeTenants.set(tenantDeploymentKey(safeTenant, safeServerVersion), deploymentId);
223
- this.#activeTenants.delete(tenantKey(safeTenant));
224
- const activeOwnerSubject = deploymentOwnerSubject(active);
225
- return {
226
- ok: true,
227
- deploymentId,
228
- deploymentVersion: version,
229
- ...(safeServerVersion !== undefined ? { serverVersion: safeServerVersion } : {}),
230
- ...(accessMode !== undefined ? { accessMode } : {}),
231
- ...(activeOwnerSubject !== undefined ? { ownerSubject: activeOwnerSubject } : {}),
232
- };
240
+ this.#servers.set(deploymentId, servedTargetFor(active, built, this.#customerVerifierFactory));
241
+ this.#activeTenants.set(tenantDeploymentKey(safeTenant, safeServerVersion), deploymentId);
242
+ this.#activeTenants.delete(tenantKey(safeTenant));
243
+ const activeOwnerSubject = deploymentOwnerSubject(active);
244
+ return {
245
+ ok: true,
246
+ deploymentId,
247
+ deploymentVersion: version,
248
+ ...(safeServerVersion !== undefined ? { serverVersion: safeServerVersion } : {}),
249
+ ...(accessMode !== undefined ? { accessMode } : {}),
250
+ ...(activeOwnerSubject !== undefined ? { ownerSubject: activeOwnerSubject } : {}),
251
+ };
252
+ });
233
253
  }
234
254
  /** Read-only deploy validation used by the CLI before config writes, asset upload, or persistence. */
235
255
  async preflightDeploy(tenant, manifest, options = {}) {
@@ -264,6 +284,7 @@ export class ServerRegistry {
264
284
  }
265
285
  async #compileTarget(tenant, manifest, connectors, hostedAssets, renderAppPackage = false, deploymentId) {
266
286
  return compileRegistryTarget({
287
+ activeArtifact: async () => (await this.getActiveByTenant(tenant))?.served.artifact,
267
288
  configStore: this.#configStore,
268
289
  platformCatalog: this.#platformCatalog,
269
290
  localAssetOptions: this.#localAssetOptions,
@@ -277,6 +298,7 @@ export class ServerRegistry {
277
298
  googleWorkloadIdentity: this.#googleWorkloadIdentity,
278
299
  stateHandleStoreFactory: this.#stateHandleStoreFactory,
279
300
  platformConnectors: this.#platformConnectors,
301
+ nativeRecords: this.#nativeRecords,
280
302
  policyGate: this.#policyGate,
281
303
  appPackageRenderer: this.#appPackageRenderer,
282
304
  knowledgeSearch: this.#knowledgeSearch,
@@ -293,12 +315,10 @@ export class ServerRegistry {
293
315
  const cached = this.#servers.get(deploymentId);
294
316
  if (cached)
295
317
  return cached;
296
- if (!this.#store)
297
- return undefined;
298
318
  const inflight = this.#inflight.get(deploymentId);
299
319
  if (inflight)
300
320
  return inflight;
301
- const promise = this.#loadAndCompile(this.#store, deploymentId).finally(() => {
321
+ const promise = this.#loadAndCompile(deploymentId).finally(() => {
302
322
  this.#inflight.delete(deploymentId);
303
323
  });
304
324
  this.#inflight.set(deploymentId, promise);
@@ -362,18 +382,29 @@ export class ServerRegistry {
362
382
  getAppArchivedAt(org, app) {
363
383
  return registryAppArchivedAt(this.#stateView(), org, app);
364
384
  }
365
- archiveApp(org, app, at) {
366
- return registryArchiveApp(this.#stateView(), org, app, at);
385
+ setApplicationLifecycleObserver(observer) {
386
+ this.#applicationLifecycleObserver = observer;
387
+ }
388
+ async archiveApp(org, app, at) {
389
+ const result = await registryArchiveApp(this.#stateView(), org, app, at);
390
+ if (result)
391
+ await this.#applicationLifecycleObserver?.(org, app, result.archivedAt);
392
+ return result;
367
393
  }
368
394
  restoreApp(org, app) {
369
395
  return registryRestoreApp(this.#stateView(), org, app, (record) => this.#compilePersistedRecord(record));
370
396
  }
371
397
  sweepArchived(before) {
372
- return registrySweepArchived(this.#stateView(), before);
398
+ return registrySweepArchived(this.#stateView(), before, this.#applicationLifecycleObserver);
373
399
  }
374
400
  listApps(org, opts = {}) {
375
401
  return registryListApps(this.#stateView(), org, opts);
376
402
  }
403
+ async getAppGeneration(org, app) {
404
+ return this.#store
405
+ ? this.#store.getAppGeneration(org, app)
406
+ : (await this.getApp(org, app))?.createdAt;
407
+ }
377
408
  getApp(org, app) {
378
409
  return registryGetApp(this.#stateView(), org, app);
379
410
  }
@@ -386,6 +417,10 @@ export class ServerRegistry {
386
417
  setProductionEnvironment(org, app, env) {
387
418
  return registrySetProductionEnvironment(this.#stateView(), org, app, env);
388
419
  }
420
+ /** Immutable executable bytes for a same-tenant installation; never includes configuration or credentials. */
421
+ getDeploymentSource(tenant, deploymentId) {
422
+ return deploymentSourceFor(this.#stateView(), tenant, deploymentId);
423
+ }
389
424
  getDeployment(org, deploymentId) {
390
425
  return registryGetDeployment(this.#stateView(), org, deploymentId);
391
426
  }
@@ -428,6 +463,8 @@ export class ServerRegistry {
428
463
  async rollback(ref, deploymentId) {
429
464
  const safe = validateTenantRef(ref);
430
465
  return rollbackWithMappedErrors({
466
+ configStore: this.#configStore,
467
+ org: safe.org,
431
468
  run: () => rollbackDeployment(this.#stateView(), safe, deploymentId, (record) => this.#compilePersistedRecord(record), this.#serviceCapabilities, this.#customerVerifierFactory, (record, auth) => this.#hasCustomerAuthAudienceConflict(record, auth)),
432
469
  pairKnowledge: async () => this.#knowledgeHooks?.rollback(deploymentId),
433
470
  isAudienceConflict: (error) => error instanceof CustomerAuthAudienceConflictError,
@@ -447,7 +484,6 @@ export class ServerRegistry {
447
484
  return this.#knowledgeSearch;
448
485
  }
449
486
  async #targetForPersistedRecord(record) {
450
- const store = this.#store;
451
487
  return targetForPersistedRecord(record, {
452
488
  records: this.#records,
453
489
  servers: this.#servers,
@@ -455,11 +491,15 @@ export class ServerRegistry {
455
491
  ? { customerVerifierFactory: this.#customerVerifierFactory }
456
492
  : {}),
457
493
  hasCustomerAuthConflict: (candidate, auth) => this.#hasCustomerAuthAudienceConflict(candidate, auth),
458
- ...(store ? { load: () => this.#loadAndCompile(store, record) } : {}),
494
+ load: () => this.#loadAndCompile(record),
459
495
  });
460
496
  }
461
- async #loadAndCompile(store, source) {
462
- const record = typeof source === 'string' ? await store.get(source) : source;
497
+ async #loadAndCompile(source) {
498
+ const record = typeof source === 'string'
499
+ ? this.#store
500
+ ? await this.#store.get(source)
501
+ : this.#records.get(source)
502
+ : source;
463
503
  if (!record)
464
504
  return undefined;
465
505
  const deploymentId = record.deploymentId;
@@ -2,6 +2,7 @@ import { assistantAppearanceOverrideSchema, assistantBrowserConfiguration, resol
2
2
  import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
3
3
  import { sendForbidden } from '../http-util.js';
4
4
  import { now } from './assistant-route-http.js';
5
+ import { activeAssistantTarget } from './assistant-session-target.js';
5
6
  import { authorizeControlPlane } from './control-plane.js';
6
7
  export async function handleAssistantAppearance(req, res, tenant, deps) {
7
8
  const store = deps.appearance;
@@ -52,7 +53,7 @@ export async function handleAssistantAppearance(req, res, tenant, deps) {
52
53
  currentRevision: updated.currentRevision,
53
54
  });
54
55
  }
55
- const target = await deps.registry.getActiveByTenant(tenant);
56
+ const target = await activeAssistantTarget({ registry: deps.registry }, tenant);
56
57
  await deps.audit.emit({
57
58
  eventType: updated.record.override === undefined
58
59
  ? 'assistant.appearance.reset'
@@ -73,7 +74,7 @@ export async function handleAssistantAppearance(req, res, tenant, deps) {
73
74
  return respond(res, tenant, deps, updated.record, target);
74
75
  }
75
76
  async function respond(res, tenant, deps, knownRecord, knownTarget) {
76
- const target = knownTarget ?? (await deps.registry.getActiveByTenant(tenant));
77
+ const target = knownTarget ?? (await activeAssistantTarget({ registry: deps.registry }, tenant));
77
78
  const developer = target && assistantBrowserConfiguration(target.served.artifact.server);
78
79
  const record = knownRecord ?? (await deps.appearance?.get(tenant));
79
80
  const resolution = resolveAssistantAppearanceConfiguration(developer, record?.override);
@@ -1,6 +1,7 @@
1
1
  import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
2
2
  import { sendForbidden } from '../http-util.js';
3
3
  import { now } from './assistant-route-http.js';
4
+ import { activeAssistantTarget } from './assistant-session-target.js';
4
5
  import { authorizeControlPlane } from './control-plane.js';
5
6
  export async function handleAssistantClients(req, res, tenant, id, action, deps) {
6
7
  const identity = await authorizeControlPlane(req, res, deps.gate, { requireIdentity: false });
@@ -29,7 +30,7 @@ export async function handleAssistantClients(req, res, tenant, id, action, deps)
29
30
  if (typeof name !== 'string' || name.trim().length < 1 || name.length > 80) {
30
31
  return sendJson(res, 400, { error: '"name" must be a non-empty string' });
31
32
  }
32
- const target = await deps.registry.getActiveByTenant(tenant);
33
+ const target = await activeAssistantTarget({ registry: deps.registry }, tenant);
33
34
  const assistant = target?.served.artifact.server.assistant;
34
35
  if (!target?.deploymentId || !assistant)
35
36
  return sendJson(res, 409, { error: 'deployment has no embedded assistant' });
@@ -7,6 +7,7 @@ import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
7
7
  import { sendForbidden } from '../http-util.js';
8
8
  import { resolveAssistantModelBinding } from './assistant-model-binding.js';
9
9
  import { now } from './assistant-route-http.js';
10
+ import { activeAssistantTarget } from './assistant-session-target.js';
10
11
  import { authorizeControlPlane } from './control-plane.js';
11
12
  /**
12
13
  * The doctor half of the assistant boundary, kept out of `assistant.ts` for the same reason the
@@ -43,7 +44,7 @@ export async function handleAssistantDoctor(req, res, tenant, deps) {
43
44
  (typeof userId !== 'string' || userId.length < 1 || userId.length > 240))) {
44
45
  return sendJson(res, 400, { error: 'clientId, clientSecret, and origin are required' });
45
46
  }
46
- const target = await deps.registry.getActiveByTenant(tenant);
47
+ const target = await activeAssistantTarget({ registry: deps.registry }, tenant);
47
48
  const assistant = target?.served.artifact.server.assistant;
48
49
  const deploymentOk = Boolean(target?.deploymentId && assistant);
49
50
  const client = await deps.store.authenticateClient(clientId, clientSecret);
@@ -3,6 +3,7 @@ import { assistantEmbedOperatorView, parsePublicEmbedBudget, publicSurfaceOf, su
3
3
  import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
4
4
  import { sendForbidden } from '../http-util.js';
5
5
  import { now } from './assistant-route-http.js';
6
+ import { activeAssistantTarget } from './assistant-session-target.js';
6
7
  import { authorizeControlPlane } from './control-plane.js';
7
8
  /**
8
9
  * The operator's view of a tenant's public surfaces, and the one control over them.
@@ -45,6 +46,9 @@ export async function handleAssistantEmbeds(req, res, tenant, embedId, deps) {
45
46
  const budget = parsePublicEmbedBudget(body.value);
46
47
  if (!budget.ok)
47
48
  return sendJson(res, 400, { error: budget.error });
49
+ const owned = (await embeds.list(tenant)).some((record) => record.embedId === embedId && record.revokedAt === undefined);
50
+ if (!owned)
51
+ return sendJson(res, 404, { error: 'embed not found' });
48
52
  const updated = await embeds.setBudget(embedId, budget.value, now(deps));
49
53
  // 404 here rather than the mint route's 403: this caller has already proven org membership, so
50
54
  // telling them an id of theirs does not exist is information they are entitled to.
@@ -59,13 +63,14 @@ export async function handleAssistantEmbeds(req, res, tenant, embedId, deps) {
59
63
  return sendJson(res, 405, { error: 'method not allowed' });
60
64
  }
61
65
  async function view(record, tenant, defaults, deps, counters) {
62
- const target = await deps.registry.getActiveByTenant(tenant);
66
+ const target = await activeAssistantTarget({ registry: deps.registry }, tenant);
63
67
  const at = now(deps);
64
68
  // The same bounds admission resolves, not the bare defaults: a sponsored surface enforces the
65
69
  // hosted envelope, and reporting the unsponsored one told an operator a number nothing honours.
66
70
  const deploymentId = target?.deploymentId ?? '';
67
- const bounds = (await deps.managedModelResolver?.resolve({ tenant, deploymentId }))
68
- ?.publicAdmission;
71
+ const bounds = target?.served.artifact.server.assistant?.model?.kind === 'noodle-managed'
72
+ ? (await deps.managedModelResolver?.resolve({ tenant, deploymentId }))?.publicAdmission
73
+ : undefined;
69
74
  return assistantEmbedOperatorView({
70
75
  record,
71
76
  surface: publicSurfaceOf(target?.served.artifact.server.assistant),
@@ -62,7 +62,7 @@ export async function replayOrConflict(res, deps, session, interaction, action)
62
62
  const tool = assistantInteractionTool(current) ?? 'unknown_tool';
63
63
  const result = current.publicOutcome.result ?? current.publicOutcome;
64
64
  writeToolCompleted(res, current.id, tool, result, true);
65
- const deployment = await sessionScopedTarget(deps.registry, session);
65
+ const deployment = await sessionScopedTarget(deps.registry, session, deps.resolveRuntimeTarget);
66
66
  const view = deployment
67
67
  ? assistantViewAvailableData(deployment.served.artifact, {
68
68
  id: current.id,