@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
@@ -1,10 +1,12 @@
1
1
  import { DEVELOPER_CLI_PATH } from '@noodle-borg/developer-mcp';
2
2
  import { readJsonBody, sendJson } from '@noodle-borg/transport-http';
3
3
  import { configValueSetRequestSchema, EffectiveConfigResponseSchema, formatWireError, RevealSecretResponseSchema, } from '@noodle-borg/wire-contracts';
4
+ import { ApplicationSettings, SettingsError } from '../application-settings.js';
5
+ import { resolveSettingsTargets } from '../application-settings-targets.js';
4
6
  import { projectEffectiveConfig, } from '../config-value-projection.js';
5
7
  import { sendForbidden } from '../http-util.js';
6
8
  import { authorizeControlPlane } from './control-plane.js';
7
- export async function handleConfigValues(req, res, gate, controlPlane, configStore, registry, maxBody, ref, audit, developerGrants) {
9
+ export async function handleConfigValues(req, res, gate, controlPlane, configStore, registry, maxBody, ref, audit, developerGrants, installations) {
8
10
  const identity = await authorizeControlPlane(req, res, gate, {
9
11
  requireIdentity: true,
10
12
  ...developerConfigAccess(developerGrants, controlPlane, ref, req.method),
@@ -51,14 +53,17 @@ export async function handleConfigValues(req, res, gate, controlPlane, configSto
51
53
  return sendJson(res, 400, { error: formatWireError(parsed.error) });
52
54
  }
53
55
  try {
54
- const value = await configStore.setConfigValue({
56
+ const input = {
55
57
  kind: ref.kind,
56
58
  scope: ref.scope,
57
59
  name: ref.name,
58
60
  value: parsed.data.value,
59
61
  ...(identity !== undefined ? { updatedBySubject: identity.subject } : {}),
60
62
  ...(identity?.email !== undefined ? { updatedByEmail: identity.email } : {}),
61
- });
63
+ };
64
+ const value = ref.kind === 'secret'
65
+ ? await configStore.setConfigValue(input)
66
+ : await new ApplicationSettings(configStore).writeTechnical(() => resolveSettingsTargets(registry, ref.scope, installations), input);
62
67
  // Durable audit: config name + scope + actor only — the value is NEVER recorded.
63
68
  await emitConfigAudit(audit, `config.${ref.kind}.set`, ref, identity);
64
69
  return sendJson(res, 200, { ok: true, value });
@@ -68,7 +73,24 @@ export async function handleConfigValues(req, res, gate, controlPlane, configSto
68
73
  }
69
74
  }
70
75
  if (req.method === 'DELETE' && ref.name !== undefined) {
71
- await configStore.deleteConfigValue(ref.kind, ref.scope, ref.name);
76
+ try {
77
+ if (ref.kind === 'secret')
78
+ await configStore.deleteConfigValue(ref.kind, ref.scope, ref.name);
79
+ else
80
+ await new ApplicationSettings(configStore).writeTechnical(() => resolveSettingsTargets(registry, ref.scope, installations), {
81
+ kind: ref.kind,
82
+ scope: ref.scope,
83
+ name: ref.name,
84
+ });
85
+ }
86
+ catch (error) {
87
+ if (!(error instanceof SettingsError))
88
+ throw error;
89
+ return sendJson(res, error.code === 'settings_unavailable' ? 503 : 400, {
90
+ code: error.code,
91
+ error: error.message,
92
+ });
93
+ }
72
94
  await emitConfigAudit(audit, `config.${ref.kind}.deleted`, ref, identity);
73
95
  res.writeHead(204);
74
96
  res.end();
@@ -1,17 +1,13 @@
1
- import { cspFaultsInManifest } from '@noodle-borg/compiler';
2
1
  import { ensurePersonalWorkspace } from '@noodle-borg/control-plane/portable';
3
2
  import { DEVELOPER_ASSISTANT_PATH, DEVELOPER_CLI_PATH, } from '@noodle-borg/developer-mcp';
4
3
  import { normalizeServerVersion } from '@noodle-borg/module';
5
- import { noopLogger, readDeployBody, sendJson } from '@noodle-borg/transport-http';
4
+ import { readDeployBody, sendJson } from '@noodle-borg/transport-http';
6
5
  import { deployRequestSchema, formatWireError, WhoamiIdentityResponseSchema, } from '@noodle-borg/wire-contracts';
7
6
  import { authorizeDeveloperGrant, } from '../auth/developer-grant-guard.js';
7
+ import { executeAuthorizedDeployment } from '../deployment-execution.js';
8
8
  import { baseFromRequest, sendForbidden, sendUnauthorized } from '../http-util.js';
9
9
  import { endpointUrlOptionsForOrg } from '../mcp-public-routing.js';
10
- import { manifestUsesUserRoot } from '../registry-access.js';
11
- import { isIdentityAccessMode } from './access-mode.js';
12
10
  import { validateDeployIdempotency } from './deploy-idempotency.js';
13
- import { provisionPublicEmbed } from './deploy-public-embed.js';
14
- import { respondDeploymentActivationError } from './deployment-activation-response.js';
15
11
  import { tenantMcpUrl } from './endpoint-enrichment.js';
16
12
  import { canManageMembers } from './org-admin.js';
17
13
  export async function handleDeploy(req, res, registry, options, maxBody, tenant, gate, controlPlane, audit) {
@@ -172,235 +168,25 @@ export async function handleDeploy(req, res, registry, options, maxBody, tenant,
172
168
  code: 'owner_only_unsupported_for_automation',
173
169
  });
174
170
  }
175
- // Identity access modes bind the data plane to verified identity, so the deployer must be authenticated.
176
- // (Localhost dev runs the gate open; such deploys are rejected for lack of an owner/audit actor.)
177
- if (isIdentityAccessMode(accessMode) && !identity) {
178
- return sendJson(res, 401, {
179
- error: `${accessMode} deployments require an authenticated deployer`,
180
- });
181
- }
182
- if (accessMode === 'public' && manifestUsesUserRoot(manifest)) {
183
- return sendJson(res, 400, {
184
- error: 'public access mode cannot reference ${user}; use mixed for optional identity',
185
- });
186
- }
187
- // Widget CSP gate (deploy-only): a CSP origin the host renderer will silently drop breaks the widget
188
- // for end users, so the deploy is refused here. The compiler surfaces the same faults as non-blocking
189
- // warnings, so `noodle dev`/`validate` still render the widget locally — only shipping is gated.
190
- const [cspFault] = cspFaultsInManifest(manifest);
191
- if (cspFault !== undefined) {
192
- return sendJson(res, 400, {
193
- error: `widget "${cspFault.widget}" CSP ${cspFault.list} origin "${cspFault.value}" is not an ` +
194
- `absolute https:// origin and would be dropped by the host renderer` +
195
- (cspFault.suggestion !== undefined ? `; use "${cspFault.suggestion}"` : ''),
196
- });
197
- }
198
- if ((await controlPlane.getOrg(tenant.org)) === undefined) {
199
- await audit.emit({
200
- eventType: 'deploy.rejected',
201
- org: tenant.org,
202
- app: tenant.app,
203
- env: tenant.env,
204
- decision: 'deny',
205
- status: 404,
206
- reasonCode: 'organization_not_found',
207
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
208
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
209
- });
210
- return sendJson(res, 404, {
211
- code: 'organization_not_found',
212
- error: 'organization must be created before deploy',
213
- });
214
- }
215
- const logger = options.logger ?? noopLogger;
216
- if (hostedAssets !== undefined && hostedAssets.length > 0) {
217
- if (options.assetStore === undefined) {
218
- await audit.emit({
219
- eventType: 'asset.rejected',
220
- org: tenant.org,
221
- app: tenant.app,
222
- env: tenant.env,
223
- decision: 'deny',
224
- status: 400,
225
- reasonCode: 'asset_store_not_configured',
226
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
227
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
228
- details: { assetCount: hostedAssets.length },
229
- });
230
- return sendJson(res, 400, { error: 'hosted assets are not configured for this service' });
231
- }
232
- const verified = await options.assetStore.verifyUploadedAssets({
233
- scope: tenant,
234
- assets: hostedAssets,
235
- });
236
- if (!verified.ok) {
237
- await audit.emit({
238
- eventType: 'asset.rejected',
239
- org: tenant.org,
240
- app: tenant.app,
241
- env: tenant.env,
242
- decision: 'deny',
243
- status: 400,
244
- reasonCode: 'asset_verification_failed',
245
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
246
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
247
- details: { assetCount: hostedAssets.length },
248
- });
249
- return sendJson(res, 400, { error: verified.error });
250
- }
251
- hostedAssets = verified.assets;
252
- }
253
- let result;
254
- try {
255
- result = await registry.deploy(tenant, manifest, {
256
- connectors,
257
- actor: identity || undefined,
258
- accessMode,
259
- ownerSubject,
260
- ...(orgMembershipSources !== undefined ? { orgMembershipSources } : {}),
261
- hostedAssets,
262
- serverVersion,
263
- deploymentSource: automationId === undefined ? (deploymentSource ?? 'api') : 'github',
264
- ...(idempotency.key !== undefined ? { idempotencyKey: idempotency.key } : {}),
265
- ...(automationId === undefined ? {} : { automationId }),
266
- });
267
- }
268
- catch (error) {
269
- const handled = await respondDeploymentActivationError(res, error, {
270
- audit,
271
- eventType: 'deploy.rejected',
272
- org: tenant.org,
273
- app: tenant.app,
274
- env: tenant.env,
275
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
276
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
277
- });
278
- if (handled)
279
- return;
280
- throw error;
281
- }
282
- if (!result.ok) {
283
- if ('conflict' in result) {
284
- if (result.code === 'deployment_locked') {
285
- await audit.emit({
286
- eventType: 'deploy.rejected',
287
- org: tenant.org,
288
- app: tenant.app,
289
- env: tenant.env,
290
- decision: 'deny',
291
- status: 409,
292
- reasonCode: result.code,
293
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
294
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
295
- details: { serverVersion },
296
- });
297
- }
298
- return sendJson(res, 409, {
299
- ok: false,
300
- code: result.code,
301
- error: result.message,
302
- });
303
- }
304
- if ('superseded' in result) {
305
- if (automationId !== undefined) {
306
- await options.deploymentAutomation
307
- ?.recordSuperseded?.({ automationId, target: tenant })
308
- .catch(() => undefined);
309
- }
310
- return sendJson(res, 409, {
311
- ok: false,
312
- code: 'run_superseded',
313
- error: 'a newer GitHub deploy run exists for this app/env; this run was not activated',
314
- deploymentId: result.deploymentId,
315
- ...(result.serverVersion !== undefined ? { serverVersion: result.serverVersion } : {}),
316
- });
317
- }
318
- // Codes are safe enum strings; never a path-with-value. No secret name or value is logged.
319
- const codes = result.errors.map((error) => error.code).join(',');
320
- logger.warn('deploy.rejected', {
321
- status: 400,
322
- errorCount: result.errors.length,
323
- codes,
324
- });
325
- // Durable audit: a rejected deploy is a governance event. Safe fields only — no manifest body.
326
- await audit.emit({
327
- eventType: 'deploy.rejected',
328
- org: tenant.org,
329
- app: tenant.app,
330
- env: tenant.env,
331
- decision: 'deny',
332
- status: 400,
333
- reasonCode: 'compile_failed',
334
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
335
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
336
- details: { errorCount: result.errors.length, codes },
337
- });
338
- return sendJson(res, 400, { ok: false, errors: result.errors });
339
- }
340
- // Counts only — never secret names or values.
341
- logger.info('deploy.ok', {
342
- deploymentId: result.deploymentId,
343
- serverVersion: result.serverVersion,
344
- org: tenant.org,
345
- app: tenant.app,
346
- env: tenant.env,
347
- hasConnectors: connectors !== undefined,
348
- });
349
- await audit.emit({
350
- eventType: 'deploy.accepted',
351
- org: tenant.org,
352
- app: tenant.app,
353
- env: tenant.env,
354
- decision: 'allow',
355
- status: 201,
356
- ...(result.deploymentId !== undefined ? { deploymentId: result.deploymentId } : {}),
357
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
358
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
359
- details: {
360
- accessMode: result.accessMode ?? accessMode,
361
- deploymentSource: automationId === undefined ? (deploymentSource ?? 'api') : 'github',
362
- ...(ownerSubject !== undefined ? { ownerSubject } : {}),
363
- serverVersion: result.serverVersion,
364
- hasConnectors: connectors !== undefined,
365
- },
366
- });
367
- // Tenant-safe developer-facing log (M3, ADR 0101): a safe deploy-lifecycle record the developer can read
368
- // via `noodle logs`. Only scalar metadata, no manifest/secret/payload material.
369
- await options.userAppLogStore?.emit({
370
- level: 'info',
371
- message: 'deployment live',
372
- org: tenant.org,
373
- app: tenant.app,
374
- env: tenant.env,
375
- ...(result.deploymentId !== undefined ? { deploymentId: result.deploymentId } : {}),
376
- details: { accessMode: result.accessMode ?? accessMode, serverVersion: result.serverVersion },
377
- });
378
- if (result.ok && hostedAssets !== undefined && hostedAssets.length > 0) {
379
- await audit.emit({
380
- eventType: 'asset.activation.accepted',
381
- org: tenant.org,
382
- app: tenant.app,
383
- env: tenant.env,
384
- decision: 'allow',
385
- status: 201,
386
- deploymentId: result.deploymentId,
387
- ...(identity?.subject !== undefined ? { actorSubject: identity.subject } : {}),
388
- ...(identity?.email !== undefined ? { actorEmail: identity.email } : {}),
389
- details: {
390
- assetCount: hostedAssets.length,
391
- totalBytes: hostedAssets.reduce((sum, asset) => sum + asset.byteLength, 0),
392
- },
393
- });
394
- await options.assetStore?.recordReachability({
395
- scope: tenant,
396
- deploymentId: result.deploymentId,
397
- deploymentVersion: result.deploymentVersion,
398
- assets: hostedAssets,
399
- });
400
- }
171
+ const executed = await executeAuthorizedDeployment({
172
+ tenant,
173
+ manifest,
174
+ connectors,
175
+ hostedAssets,
176
+ accessMode,
177
+ identity,
178
+ ownerSubject,
179
+ orgMembershipSources,
180
+ deploymentSource,
181
+ serverVersion,
182
+ idempotencyKey: idempotency.key,
183
+ automationId,
184
+ }, { registry, options, controlPlane, audit });
185
+ if (!executed.ok)
186
+ return sendJson(res, executed.status, executed.body);
187
+ const { result, embedId } = executed;
401
188
  const base = options.publicBaseUrl ?? baseFromRequest(req, options.tls ?? {});
402
189
  const endpointOptions = await endpointUrlOptionsForOrg(options, controlPlane, tenant.org);
403
- const embedId = await provisionPublicEmbed(registry, options, tenant, result.deploymentId);
404
190
  return sendJson(res, 201, {
405
191
  ok: true,
406
192
  org: tenant.org,
@@ -470,7 +256,20 @@ export async function handleWhoami(req, res, gate, controlPlane, options = {}, s
470
256
  const orgs = identity.superAdmin
471
257
  ? await controlPlane.listOrgs()
472
258
  : await controlPlane.listOrgsForSubject(identity.subject);
473
- return sendJson(res, 200, { ok: true, identity, orgs });
259
+ return sendJson(res, 200, {
260
+ ok: true,
261
+ identity: {
262
+ subject: identity.subject,
263
+ email: identity.email,
264
+ identityIssuer: identity.identityIssuer,
265
+ givenName: identity.givenName,
266
+ superAdmin: identity.superAdmin,
267
+ developerGrantId: identity.developerGrantId,
268
+ oauthClientId: identity.oauthClientId,
269
+ authTime: identity.authTime,
270
+ },
271
+ orgs,
272
+ });
474
273
  }
475
274
  export async function authorizeTenantControl(req, res, gate, controlPlane, org, developerAccess) {
476
275
  const identity = await authorizeControlPlane(req, res, gate, {
@@ -2,11 +2,18 @@ import { DeploymentActivationError } from '@noodle-borg/module';
2
2
  import { sendJson } from '@noodle-borg/transport-http';
3
3
  /** Translate provider-neutral activation failures without exposing commercial account details. */
4
4
  export async function respondDeploymentActivationError(res, error, context) {
5
- if (!(error instanceof DeploymentActivationError))
5
+ const rejected = await deploymentActivationRejection(error, context);
6
+ if (rejected === undefined)
6
7
  return false;
8
+ sendJson(res, rejected.status, rejected.body);
9
+ return true;
10
+ }
11
+ export async function deploymentActivationRejection(error, context) {
12
+ if (!(error instanceof DeploymentActivationError))
13
+ return undefined;
7
14
  const response = deploymentActivationResponse(error.code);
8
15
  if (response === undefined)
9
- return false;
16
+ return undefined;
10
17
  await context.audit.emit({
11
18
  eventType: context.eventType,
12
19
  org: context.org,
@@ -18,8 +25,10 @@ export async function respondDeploymentActivationError(res, error, context) {
18
25
  ...(context.actorSubject !== undefined ? { actorSubject: context.actorSubject } : {}),
19
26
  ...(context.actorEmail !== undefined ? { actorEmail: context.actorEmail } : {}),
20
27
  });
21
- sendJson(res, response.status, { ok: false, code: error.code, error: response.message });
22
- return true;
28
+ return {
29
+ status: response.status,
30
+ body: { ok: false, code: error.code, error: response.message },
31
+ };
23
32
  }
24
33
  function deploymentActivationResponse(code) {
25
34
  if (code === 'production_app_limit_exceeded') {
@@ -6,6 +6,10 @@ export async function closeServiceResources(input) {
6
6
  clearInterval(input.feedbackOperationsTimer);
7
7
  if (input.businessInformationTimer !== undefined)
8
8
  clearInterval(input.businessInformationTimer);
9
+ input.stopBusinessInformationSweep?.();
10
+ if (input.businessInformationSourceTimer !== undefined) {
11
+ clearInterval(input.businessInformationSourceTimer);
12
+ }
9
13
  clearInterval(input.alertTimer);
10
14
  const errors = [];
11
15
  const moduleHost = input.moduleHost;
@@ -5,11 +5,13 @@ import { dispatchKnowledgeRequest } from '@noodle-borg/knowledge-operations/port
5
5
  import { OPENAI_APPS_CHALLENGE_PATH } from '@noodle-borg/module';
6
6
  import { applySecurityHeaders, createMcpRouter, enforceHttps, noopLogger, sendJson, } from '@noodle-borg/transport-http';
7
7
  import { AnonymousConsumerLimiter, createAdmissionGate } from './admission.js';
8
+ import { ApplicationActivity } from './application-activity.js';
9
+ import { createApplicationServingRuntime } from './application-runtime-target.js';
8
10
  import { createArchivePreflight } from './archive-preflight.js';
9
11
  import { ArchiveSweeper, resolveArchiveRetentionDays } from './archive-sweeper.js';
10
12
  import { serveLocalAsset } from './assets.js';
11
13
  import { resolveBuildInfo, serviceInfoPayload } from './build-info.js';
12
- import { InMemoryBusinessInformationStore } from './business-information/portable.js';
14
+ import { createBusinessInformationRuntime, resolvePrivateInstallationDefinition, } from './business-information-runtime.js';
13
15
  import { serviceCapabilityReport } from './capabilities.js';
14
16
  import { rejectIncompatibleCli } from './client-compatibility.js';
15
17
  import { createDataPlaneMembershipAuthorizer } from './data-plane-membership.js';
@@ -23,6 +25,7 @@ import { createServiceModuleProviders } from './modules/host.js';
23
25
  import { dispatchModuleRoutes } from './modules/route-dispatch.js';
24
26
  import { isAuthServerPath } from './oauth/paths.js';
25
27
  import { createIntentTargetResolver, createObservabilityDispatcher, createObservabilityStores, } from './observability-runtime.js';
28
+ import { createRecoveryQuarantineHandler, resolveRecoveryMode } from './recovery-quarantine.js';
26
29
  import { handleAccessUpdate } from './routes/access.js';
27
30
  import { dispatchAlertRoutes } from './routes/alerts-dispatch.js';
28
31
  import { handleAppPurgeReconciliationRoute, } from './routes/app-purge-reconciliation.js';
@@ -47,13 +50,14 @@ import { dispatchResourceReads } from './routes/resource-read-dispatch.js';
47
50
  import { handleRollback } from './routes/rollback.js';
48
51
  import { createServicePrincipalDispatcher } from './routes/service-principals-dispatch.js';
49
52
  import { servicePrincipalDataPlaneHooks } from './service-principal-data-plane.js';
50
- import { BUILTIN_STATE_CATALOG_CONNECTOR } from './state-catalog.js';
51
53
  import { InMemoryAlertRuleStore } from './store/alert-rules.js';
52
54
  import { StdoutAuditSink } from './store/audit.js';
53
55
  const DEFAULT_MAX_BODY = 1 << 20;
54
56
  const DEFAULT_MAX_DEPLOY_BODY = 32 * 1024 * 1024;
55
57
  /** The combined service listener: tenant-scoped deploy management plus the multi-tenant MCP router. */
56
58
  export function createServiceHandler(registry, options = {}) {
59
+ if (resolveRecoveryMode(options.recoveryMode) === 'quarantined')
60
+ return createRecoveryQuarantineHandler(options);
57
61
  const logger = options.logger ?? noopLogger;
58
62
  const tls = options.tls ?? {};
59
63
  const buildInfo = options.buildInfo ?? resolveBuildInfo();
@@ -66,18 +70,18 @@ export function createServiceHandler(registry, options = {}) {
66
70
  const assistantAppearance = options.assistantAppearance ?? new InMemoryAssistantAppearanceSettingsStore();
67
71
  const anonymousLimiter = new AnonymousConsumerLimiter();
68
72
  const publicCounters = options.admissionCounters ?? new InMemoryDailyCounterStore();
69
- const businessInformationStore = options.businessInformationStore ??
70
- (options.businessInformationEnabled === false
71
- ? undefined
72
- : new InMemoryBusinessInformationStore());
73
- registry.setPlatformConnectors({ catalog: [BUILTIN_STATE_CATALOG_CONNECTOR], connectors: [] });
73
+ const { businessInformationStore, businessInformationSourceStore, sourceCoordinator } = createBusinessInformationRuntime(registry, options, publicCounters);
74
74
  const moduleProviders = createServiceModuleProviders({
75
75
  options,
76
76
  auditMirror: new StdoutAuditSink(logger),
77
77
  admissionGate: createAdmissionGate(anonymousLimiter, { emit: (event) => activeAudit.emit(event) }, options.admissionGate),
78
78
  });
79
79
  const moduleHost = moduleProviders.host;
80
- const providerOptions = moduleProviders.options;
80
+ businessInformationStore?.configurePrincipalAuthority(moduleHost.platformHumanIdentity);
81
+ const providerOptions = {
82
+ ...moduleProviders.options,
83
+ ...(businessInformationStore ? { businessInformationStore } : {}),
84
+ };
81
85
  const verifyOwnerToken = moduleProviders.verifyOwnerToken;
82
86
  const capabilityReport = serviceCapabilityReport(moduleHost);
83
87
  registry.setServiceCapabilities(capabilityReport.capabilities);
@@ -85,8 +89,16 @@ export function createServiceHandler(registry, options = {}) {
85
89
  activeAudit = audit;
86
90
  const { publicTenantRouting } = mcp.mcpRoutingOptions(options, controlPlane);
87
91
  const resolveEndpointOptions = (org) => mcp.endpointUrlOptionsForOrg(options, controlPlane, org);
92
+ const activity = options.operationEvidence === undefined
93
+ ? undefined
94
+ : new ApplicationActivity({
95
+ ...options.operationEvidence,
96
+ allowance: async (org, request) => moduleHost.resolveActivityHistoryAllowance?.(org, request),
97
+ });
88
98
  const withIntentMode = createIntentTargetResolver(intentSettings, intentPreviewOrgs);
89
- const router = createMcpRouter(async (id) => withIntentMode(await registry.getServing(id)), {
99
+ const { activateInstallation, resolveRuntimeTarget, businessOnboarding } = createApplicationServingRuntime(registry, providerOptions, controlPlane, audit, activity);
100
+ const runtimeTarget = async (target) => target === undefined ? undefined : resolveRuntimeTarget(target);
101
+ const router = createMcpRouter(async (id) => withIntentMode(await runtimeTarget(await registry.getServing(id))), {
90
102
  logger,
91
103
  tls,
92
104
  protocolMode: options.mcpProtocolMode ?? 'dual',
@@ -116,9 +128,9 @@ export function createServiceHandler(registry, options = {}) {
116
128
  }),
117
129
  admissionGate: moduleHost.admissionGate,
118
130
  ...(publicTenantRouting !== undefined ? { publicTenantRouting } : {}),
119
- tenantLookup: async (ref) => withIntentMode(ref.serverVersion === undefined
131
+ tenantLookup: async (ref) => withIntentMode(await runtimeTarget(ref.serverVersion === undefined
120
132
  ? await registry.getActiveByTenant(ref)
121
- : await registry.getActiveByTenantVersion(ref, ref.serverVersion), ref),
133
+ : await registry.getActiveByTenantVersion(ref, ref.serverVersion)), ref),
122
134
  tenantPreflight: createArchivePreflight(registry),
123
135
  });
124
136
  const maxBody = options.maxBodyBytes ?? DEFAULT_MAX_BODY;
@@ -268,11 +280,41 @@ export function createServiceHandler(registry, options = {}) {
268
280
  options.businessInformationEnabled !== false &&
269
281
  dispatchBusinessInformationRoutes(req, res, url, {
270
282
  store: businessInformationStore,
283
+ ...(businessOnboarding ? { businessOnboarding } : {}),
284
+ activateInstallation,
285
+ ...(activity === undefined ? {} : { activity }),
286
+ ...(options.connectionRuntime === undefined
287
+ ? {}
288
+ : {
289
+ connections: options.connectionRuntime.connections,
290
+ resolveConnectionTargets: options.connectionRuntime.resolveConnectionTargets,
291
+ }),
292
+ configStore,
293
+ registry,
294
+ resolveEndpointBase: (request) => options.publicBaseUrl ?? baseFromRequest(request, tls),
295
+ resolveEndpointUrlOptions: resolveEndpointOptions,
296
+ ...(options.publicEmbeds === undefined ? {} : { publicEmbeds: options.publicEmbeds }),
297
+ admissionCounters: publicCounters,
298
+ ...(options.admissionEnvelope === undefined
299
+ ? {}
300
+ : { admissionEnvelope: options.admissionEnvelope }),
301
+ ...(options.managedAssistantModelResolver === undefined
302
+ ? {}
303
+ : { managedModelResolver: options.managedAssistantModelResolver }),
271
304
  gate,
272
305
  controlPlane,
273
306
  maxBody,
274
307
  publicCounters,
308
+ audit: activeAudit,
275
309
  trustProxy: tls.trustProxy === true,
310
+ publicIntakeEnabled: options.businessInformationPublicIntakeEnabled !== false,
311
+ resolvePrivateDefinition: (selector) => resolvePrivateInstallationDefinition(registry, selector),
312
+ ...(businessInformationSourceStore === undefined
313
+ ? {}
314
+ : { sourceStore: businessInformationSourceStore }),
315
+ ...(sourceCoordinator === undefined
316
+ ? {}
317
+ : { runSourceIngestion: async () => void (await sourceCoordinator.runOne()) }),
276
318
  ...(options.clock === undefined ? {} : { now: options.clock }),
277
319
  logger,
278
320
  tls,
@@ -283,6 +325,7 @@ export function createServiceHandler(registry, options = {}) {
283
325
  }
284
326
  if (dispatchAssistantRoutes(req, res, url, {
285
327
  registry,
328
+ resolveRuntimeTarget,
286
329
  store: assistantStore,
287
330
  appearance: assistantAppearance,
288
331
  ...(options.publicEmbeds !== undefined ? { publicEmbeds: options.publicEmbeds } : {}),
@@ -423,6 +466,9 @@ export function createServiceHandler(registry, options = {}) {
423
466
  controlPlane,
424
467
  configStore,
425
468
  registry,
469
+ ...(businessInformationStore === undefined
470
+ ? {}
471
+ : { installations: businessInformationStore }),
426
472
  maxBody,
427
473
  audit,
428
474
  ...(options.developerGrantStore !== undefined