@bevel-software/platform-core-backend 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/dist/core/catalog-cache-invalidation.d.ts +7 -2
  2. package/dist/core/catalog-cache-invalidation.d.ts.map +1 -1
  3. package/dist/core/catalog-cache-invalidation.js +8 -9
  4. package/dist/core/catalog-cache-invalidation.js.map +1 -1
  5. package/dist/core/core-ports.d.ts +19 -0
  6. package/dist/core/core-ports.d.ts.map +1 -1
  7. package/dist/core/core-ports.js.map +1 -1
  8. package/dist/core/create-core-server.d.ts +2 -0
  9. package/dist/core/create-core-server.d.ts.map +1 -1
  10. package/dist/core/create-core-server.js +23 -105
  11. package/dist/core/create-core-server.js.map +1 -1
  12. package/dist/core/create-core-services.d.ts +30 -5
  13. package/dist/core/create-core-services.d.ts.map +1 -1
  14. package/dist/core/create-core-services.js +136 -81
  15. package/dist/core/create-core-services.js.map +1 -1
  16. package/dist/core/lifecycle.d.ts +74 -28
  17. package/dist/core/lifecycle.d.ts.map +1 -1
  18. package/dist/core/lifecycle.js +157 -20
  19. package/dist/core/lifecycle.js.map +1 -1
  20. package/dist/core/public-config.d.ts +5 -1
  21. package/dist/core/public-config.d.ts.map +1 -1
  22. package/dist/core/public-config.js +7 -5
  23. package/dist/core/public-config.js.map +1 -1
  24. package/dist/core-config.d.ts +95 -1
  25. package/dist/core-config.d.ts.map +1 -1
  26. package/dist/core-config.js +24 -8
  27. package/dist/core-config.js.map +1 -1
  28. package/dist/index.d.ts +5 -3
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +6 -3
  31. package/dist/index.js.map +1 -1
  32. package/dist/modules/access/access-control.service.d.ts +18 -1
  33. package/dist/modules/access/access-control.service.d.ts.map +1 -1
  34. package/dist/modules/access/access-control.service.js +19 -8
  35. package/dist/modules/access/access-control.service.js.map +1 -1
  36. package/dist/modules/access/access.routes.d.ts +2 -1
  37. package/dist/modules/access/access.routes.d.ts.map +1 -1
  38. package/dist/modules/access/access.routes.js +10 -10
  39. package/dist/modules/access/access.routes.js.map +1 -1
  40. package/dist/modules/access/change-read-gate.d.ts +6 -3
  41. package/dist/modules/access/change-read-gate.d.ts.map +1 -1
  42. package/dist/modules/access/change-read-gate.js +9 -6
  43. package/dist/modules/access/change-read-gate.js.map +1 -1
  44. package/dist/modules/access/creator-access.d.ts +4 -2
  45. package/dist/modules/access/creator-access.d.ts.map +1 -1
  46. package/dist/modules/access/creator-access.js +7 -4
  47. package/dist/modules/access/creator-access.js.map +1 -1
  48. package/dist/modules/agent-instructions/read-preamble.d.ts +2 -1
  49. package/dist/modules/agent-instructions/read-preamble.d.ts.map +1 -1
  50. package/dist/modules/agent-instructions/read-preamble.js +6 -9
  51. package/dist/modules/agent-instructions/read-preamble.js.map +1 -1
  52. package/dist/modules/auth/account-admission.d.ts +40 -0
  53. package/dist/modules/auth/account-admission.d.ts.map +1 -0
  54. package/dist/modules/auth/account-admission.js +17 -0
  55. package/dist/modules/auth/account-admission.js.map +1 -0
  56. package/dist/modules/auth/account.routes.d.ts.map +1 -1
  57. package/dist/modules/auth/account.routes.js +4 -1
  58. package/dist/modules/auth/account.routes.js.map +1 -1
  59. package/dist/modules/auth/auth.service.d.ts +19 -1
  60. package/dist/modules/auth/auth.service.d.ts.map +1 -1
  61. package/dist/modules/auth/auth.service.js +33 -1
  62. package/dist/modules/auth/auth.service.js.map +1 -1
  63. package/dist/modules/auth/oidc-auth-provider.d.ts.map +1 -1
  64. package/dist/modules/auth/oidc-auth-provider.js +9 -0
  65. package/dist/modules/auth/oidc-auth-provider.js.map +1 -1
  66. package/dist/modules/connection-probe/connection-probe.service.d.ts +13 -1
  67. package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -1
  68. package/dist/modules/connection-probe/connection-probe.service.js +10 -2
  69. package/dist/modules/connection-probe/connection-probe.service.js.map +1 -1
  70. package/dist/modules/database/advisory-lock.d.ts +17 -0
  71. package/dist/modules/database/advisory-lock.d.ts.map +1 -1
  72. package/dist/modules/database/advisory-lock.js +24 -3
  73. package/dist/modules/database/advisory-lock.js.map +1 -1
  74. package/dist/modules/database/connection.d.ts +67 -2
  75. package/dist/modules/database/connection.d.ts.map +1 -1
  76. package/dist/modules/database/connection.js +118 -12
  77. package/dist/modules/database/connection.js.map +1 -1
  78. package/dist/modules/database/migrate.d.ts +1 -1
  79. package/dist/modules/database/migrate.d.ts.map +1 -1
  80. package/dist/modules/database/migrate.js +27 -3
  81. package/dist/modules/database/migrate.js.map +1 -1
  82. package/dist/modules/kb-fs/branch-name.d.ts +0 -1
  83. package/dist/modules/kb-fs/branch-name.d.ts.map +1 -1
  84. package/dist/modules/kb-fs/branch-name.js +3 -3
  85. package/dist/modules/kb-fs/branch-name.js.map +1 -1
  86. package/dist/modules/kb-fs/clone-config.d.ts +9 -8
  87. package/dist/modules/kb-fs/clone-config.d.ts.map +1 -1
  88. package/dist/modules/kb-fs/clone-config.js +14 -12
  89. package/dist/modules/kb-fs/clone-config.js.map +1 -1
  90. package/dist/modules/mcp/mcp.service.d.ts +7 -0
  91. package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
  92. package/dist/modules/mcp/mcp.service.js +4 -4
  93. package/dist/modules/mcp/mcp.service.js.map +1 -1
  94. package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts +4 -4
  95. package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts.map +1 -1
  96. package/dist/modules/plugins/compile/marketplace-compiler.service.js +7 -10
  97. package/dist/modules/plugins/compile/marketplace-compiler.service.js.map +1 -1
  98. package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.d.ts +4 -1
  99. package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.d.ts.map +1 -1
  100. package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.js +5 -3
  101. package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.js.map +1 -1
  102. package/dist/modules/plugins/discovery/kb-plugin-source.d.ts +6 -1
  103. package/dist/modules/plugins/discovery/kb-plugin-source.d.ts.map +1 -1
  104. package/dist/modules/plugins/discovery/kb-plugin-source.js +14 -9
  105. package/dist/modules/plugins/discovery/kb-plugin-source.js.map +1 -1
  106. package/dist/modules/plugins/discovery/native.source.d.ts +4 -1
  107. package/dist/modules/plugins/discovery/native.source.d.ts.map +1 -1
  108. package/dist/modules/plugins/discovery/native.source.js +4 -2
  109. package/dist/modules/plugins/discovery/native.source.js.map +1 -1
  110. package/dist/modules/plugins/index.d.ts +1 -1
  111. package/dist/modules/plugins/index.d.ts.map +1 -1
  112. package/dist/modules/plugins/index.js +1 -1
  113. package/dist/modules/plugins/index.js.map +1 -1
  114. package/dist/modules/plugins/join-request-jobs.service.d.ts +3 -1
  115. package/dist/modules/plugins/join-request-jobs.service.d.ts.map +1 -1
  116. package/dist/modules/plugins/join-request-jobs.service.js +6 -6
  117. package/dist/modules/plugins/join-request-jobs.service.js.map +1 -1
  118. package/dist/modules/plugins/join-requests.service.d.ts +3 -1
  119. package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
  120. package/dist/modules/plugins/join-requests.service.js +9 -8
  121. package/dist/modules/plugins/join-requests.service.js.map +1 -1
  122. package/dist/modules/plugins/plugin-links.d.ts +65 -10
  123. package/dist/modules/plugins/plugin-links.d.ts.map +1 -1
  124. package/dist/modules/plugins/plugin-links.js +136 -31
  125. package/dist/modules/plugins/plugin-links.js.map +1 -1
  126. package/dist/modules/plugins/plugin-links.service.d.ts +107 -5
  127. package/dist/modules/plugins/plugin-links.service.d.ts.map +1 -1
  128. package/dist/modules/plugins/plugin-links.service.js +151 -21
  129. package/dist/modules/plugins/plugin-links.service.js.map +1 -1
  130. package/dist/modules/plugins/plugin-provision.service.d.ts +10 -3
  131. package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
  132. package/dist/modules/plugins/plugin-provision.service.js +33 -26
  133. package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
  134. package/dist/modules/plugins/plugin-rename.service.d.ts +4 -2
  135. package/dist/modules/plugins/plugin-rename.service.d.ts.map +1 -1
  136. package/dist/modules/plugins/plugin-rename.service.js +10 -12
  137. package/dist/modules/plugins/plugin-rename.service.js.map +1 -1
  138. package/dist/modules/plugins/plugins.routes.d.ts +3 -0
  139. package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
  140. package/dist/modules/plugins/plugins.routes.js +45 -15
  141. package/dist/modules/plugins/plugins.routes.js.map +1 -1
  142. package/dist/modules/plugins/plugins.service.d.ts +4 -4
  143. package/dist/modules/plugins/plugins.service.d.ts.map +1 -1
  144. package/dist/modules/plugins/plugins.service.js +7 -10
  145. package/dist/modules/plugins/plugins.service.js.map +1 -1
  146. package/dist/modules/plugins/teams.routes.d.ts +4 -1
  147. package/dist/modules/plugins/teams.routes.d.ts.map +1 -1
  148. package/dist/modules/plugins/teams.routes.js +11 -9
  149. package/dist/modules/plugins/teams.routes.js.map +1 -1
  150. package/dist/modules/secrets-vault/index.d.ts +1 -1
  151. package/dist/modules/secrets-vault/index.d.ts.map +1 -1
  152. package/dist/modules/secrets-vault/index.js +1 -1
  153. package/dist/modules/secrets-vault/index.js.map +1 -1
  154. package/dist/modules/secrets-vault/secrets-variable-loader.d.ts +29 -11
  155. package/dist/modules/secrets-vault/secrets-variable-loader.d.ts.map +1 -1
  156. package/dist/modules/secrets-vault/secrets-variable-loader.js +46 -21
  157. package/dist/modules/secrets-vault/secrets-variable-loader.js.map +1 -1
  158. package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +3 -0
  159. package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
  160. package/dist/modules/secrets-vault/secrets-vault.routes.js +4 -6
  161. package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
  162. package/dist/modules/settings/deployment-settings.service.d.ts +12 -8
  163. package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
  164. package/dist/modules/settings/deployment-settings.service.js +20 -22
  165. package/dist/modules/settings/deployment-settings.service.js.map +1 -1
  166. package/dist/modules/settings/setup.routes.d.ts +9 -2
  167. package/dist/modules/settings/setup.routes.d.ts.map +1 -1
  168. package/dist/modules/settings/setup.routes.js +20 -14
  169. package/dist/modules/settings/setup.routes.js.map +1 -1
  170. package/dist/modules/skills/allowed-tools-check.d.ts +4 -3
  171. package/dist/modules/skills/allowed-tools-check.d.ts.map +1 -1
  172. package/dist/modules/skills/allowed-tools-check.js +8 -8
  173. package/dist/modules/skills/allowed-tools-check.js.map +1 -1
  174. package/dist/modules/skills/pending-skills.service.d.ts +3 -1
  175. package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
  176. package/dist/modules/skills/pending-skills.service.js +9 -6
  177. package/dist/modules/skills/pending-skills.service.js.map +1 -1
  178. package/dist/modules/skills/skill-access-requests.routes.d.ts +2 -1
  179. package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
  180. package/dist/modules/skills/skill-access-requests.routes.js +6 -6
  181. package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
  182. package/dist/modules/skills/skills.routes.d.ts +4 -1
  183. package/dist/modules/skills/skills.routes.d.ts.map +1 -1
  184. package/dist/modules/skills/skills.routes.js +4 -4
  185. package/dist/modules/skills/skills.routes.js.map +1 -1
  186. package/dist/modules/skills/skills.service.d.ts +4 -2
  187. package/dist/modules/skills/skills.service.d.ts.map +1 -1
  188. package/dist/modules/skills/skills.service.js +13 -11
  189. package/dist/modules/skills/skills.service.js.map +1 -1
  190. package/dist/modules/tool-manuals/mcp-json-discovery.d.ts +2 -1
  191. package/dist/modules/tool-manuals/mcp-json-discovery.d.ts.map +1 -1
  192. package/dist/modules/tool-manuals/mcp-json-discovery.js +6 -5
  193. package/dist/modules/tool-manuals/mcp-json-discovery.js.map +1 -1
  194. package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts +4 -2
  195. package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
  196. package/dist/modules/tool-manuals/mcp-server-edit.service.js +12 -10
  197. package/dist/modules/tool-manuals/mcp-server-edit.service.js.map +1 -1
  198. package/dist/modules/tool-manuals/pending-tools.service.d.ts +3 -1
  199. package/dist/modules/tool-manuals/pending-tools.service.d.ts.map +1 -1
  200. package/dist/modules/tool-manuals/pending-tools.service.js +19 -16
  201. package/dist/modules/tool-manuals/pending-tools.service.js.map +1 -1
  202. package/dist/modules/tool-manuals/tool-delete.service.d.ts +4 -2
  203. package/dist/modules/tool-manuals/tool-delete.service.d.ts.map +1 -1
  204. package/dist/modules/tool-manuals/tool-delete.service.js +14 -12
  205. package/dist/modules/tool-manuals/tool-delete.service.js.map +1 -1
  206. package/dist/modules/tool-manuals/tool-manuals.routes.d.ts +3 -1
  207. package/dist/modules/tool-manuals/tool-manuals.routes.d.ts.map +1 -1
  208. package/dist/modules/tool-manuals/tool-manuals.routes.js +7 -7
  209. package/dist/modules/tool-manuals/tool-manuals.routes.js.map +1 -1
  210. package/dist/modules/tool-manuals/tool-manuals.service.d.ts +4 -2
  211. package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
  212. package/dist/modules/tool-manuals/tool-manuals.service.js +15 -12
  213. package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
  214. package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +3 -0
  215. package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
  216. package/dist/modules/tool-manuals/tool-manuals.tools.js +4 -6
  217. package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
  218. package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +3 -2
  219. package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
  220. package/dist/modules/workflow/agent-tools/workflow.tools.js +9 -9
  221. package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
  222. package/dist/modules/workflow/git/git.service.d.ts +11 -5
  223. package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
  224. package/dist/modules/workflow/git/git.service.js +23 -14
  225. package/dist/modules/workflow/git/git.service.js.map +1 -1
  226. package/dist/modules/workflow/git/node-git-runner.d.ts +26 -2
  227. package/dist/modules/workflow/git/node-git-runner.d.ts.map +1 -1
  228. package/dist/modules/workflow/git/node-git-runner.js +35 -5
  229. package/dist/modules/workflow/git/node-git-runner.js.map +1 -1
  230. package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -1
  231. package/dist/modules/workflow/review-workflow/review-workflow.service.js +9 -4
  232. package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
  233. package/dist/modules/workflow/session-ontology.service.d.ts +6 -1
  234. package/dist/modules/workflow/session-ontology.service.d.ts.map +1 -1
  235. package/dist/modules/workflow/session-ontology.service.js +6 -2
  236. package/dist/modules/workflow/session-ontology.service.js.map +1 -1
  237. package/dist/modules/workflow/workflow.service.d.ts +8 -3
  238. package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
  239. package/dist/modules/workflow/workflow.service.js +33 -23
  240. package/dist/modules/workflow/workflow.service.js.map +1 -1
  241. package/dist/modules/workspace/session-ontology.gate.d.ts +3 -1
  242. package/dist/modules/workspace/session-ontology.gate.d.ts.map +1 -1
  243. package/dist/modules/workspace/session-ontology.gate.js +3 -3
  244. package/dist/modules/workspace/session-ontology.gate.js.map +1 -1
  245. package/dist/modules/workspace/startup/kb-git.d.ts +4 -3
  246. package/dist/modules/workspace/startup/kb-git.d.ts.map +1 -1
  247. package/dist/modules/workspace/startup/kb-git.js +15 -13
  248. package/dist/modules/workspace/startup/kb-git.js.map +1 -1
  249. package/dist/modules/workspace/startup/kb-startup-runner.d.ts +5 -8
  250. package/dist/modules/workspace/startup/kb-startup-runner.d.ts.map +1 -1
  251. package/dist/modules/workspace/startup/kb-startup-runner.js +35 -38
  252. package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
  253. package/dist/modules/workspace/startup/steps/groups-to-plugins.step.d.ts +7 -1
  254. package/dist/modules/workspace/startup/steps/groups-to-plugins.step.d.ts.map +1 -1
  255. package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js +23 -16
  256. package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js.map +1 -1
  257. package/dist/modules/workspace/startup/steps/personal-spaces.step.d.ts +7 -1
  258. package/dist/modules/workspace/startup/steps/personal-spaces.step.d.ts.map +1 -1
  259. package/dist/modules/workspace/startup/steps/personal-spaces.step.js +12 -5
  260. package/dist/modules/workspace/startup/steps/personal-spaces.step.js.map +1 -1
  261. package/dist/modules/workspace/startup/steps/plugin-display-names.step.d.ts +7 -1
  262. package/dist/modules/workspace/startup/steps/plugin-display-names.step.d.ts.map +1 -1
  263. package/dist/modules/workspace/startup/steps/plugin-display-names.step.js +12 -5
  264. package/dist/modules/workspace/startup/steps/plugin-display-names.step.js.map +1 -1
  265. package/dist/modules/workspace/startup/steps/plugin-manifests.step.d.ts +7 -1
  266. package/dist/modules/workspace/startup/steps/plugin-manifests.step.d.ts.map +1 -1
  267. package/dist/modules/workspace/startup/steps/plugin-manifests.step.js +12 -5
  268. package/dist/modules/workspace/startup/steps/plugin-manifests.step.js.map +1 -1
  269. package/dist/modules/workspace/startup/steps/seed-tree.d.ts +4 -1
  270. package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
  271. package/dist/modules/workspace/startup/steps/seed-tree.js +14 -11
  272. package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
  273. package/dist/modules/workspace/startup/steps/template-files.step.d.ts +17 -3
  274. package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
  275. package/dist/modules/workspace/startup/steps/template-files.step.js +36 -30
  276. package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
  277. package/dist/modules/workspace/startup/steps/template-source.d.ts +6 -1
  278. package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
  279. package/dist/modules/workspace/startup/steps/template-source.js +10 -6
  280. package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
  281. package/dist/modules/workspace/workspace.routes.d.ts +2 -1
  282. package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
  283. package/dist/modules/workspace/workspace.routes.js +8 -7
  284. package/dist/modules/workspace/workspace.routes.js.map +1 -1
  285. package/dist/modules/workspace/workspace.service.d.ts +18 -12
  286. package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
  287. package/dist/modules/workspace/workspace.service.js +32 -28
  288. package/dist/modules/workspace/workspace.service.js.map +1 -1
  289. package/dist/modules/workspace/workspace.tools.d.ts +2 -1
  290. package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
  291. package/dist/modules/workspace/workspace.tools.js +20 -18
  292. package/dist/modules/workspace/workspace.tools.js.map +1 -1
  293. package/dist/modules/workspace/write-denial.d.ts +3 -2
  294. package/dist/modules/workspace/write-denial.d.ts.map +1 -1
  295. package/dist/modules/workspace/write-denial.js +6 -5
  296. package/dist/modules/workspace/write-denial.js.map +1 -1
  297. package/dist/shared/git.contract.d.ts +52 -7
  298. package/dist/shared/git.contract.d.ts.map +1 -1
  299. package/dist/shared/git.contract.js +30 -8
  300. package/dist/shared/git.contract.js.map +1 -1
  301. package/dist/shared/kb-context.d.ts +76 -0
  302. package/dist/shared/kb-context.d.ts.map +1 -0
  303. package/dist/shared/kb-context.js +108 -0
  304. package/dist/shared/kb-context.js.map +1 -0
  305. package/dist/shared/kb-layout.d.ts +3 -2
  306. package/dist/shared/kb-layout.d.ts.map +1 -1
  307. package/dist/shared/kb-layout.js +4 -3
  308. package/dist/shared/kb-layout.js.map +1 -1
  309. package/dist/shared/kb-layout.test.js +35 -27
  310. package/dist/shared/kb-layout.test.js.map +1 -1
  311. package/dist/shared/pending-proposals.d.ts +4 -1
  312. package/dist/shared/pending-proposals.d.ts.map +1 -1
  313. package/dist/shared/pending-proposals.js +3 -4
  314. package/dist/shared/pending-proposals.js.map +1 -1
  315. package/dist/shared/redact-secret.d.ts +5 -5
  316. package/dist/shared/redact-secret.js +5 -5
  317. package/dist/tenancy/index.d.ts +13 -0
  318. package/dist/tenancy/index.d.ts.map +1 -0
  319. package/dist/tenancy/index.js +13 -0
  320. package/dist/tenancy/index.js.map +1 -0
  321. package/dist/tenancy/static-tenant-source.d.ts +98 -0
  322. package/dist/tenancy/static-tenant-source.d.ts.map +1 -0
  323. package/dist/tenancy/static-tenant-source.js +220 -0
  324. package/dist/tenancy/static-tenant-source.js.map +1 -0
  325. package/dist/tenancy/tenant-host.d.ts +80 -0
  326. package/dist/tenancy/tenant-host.d.ts.map +1 -0
  327. package/dist/tenancy/tenant-host.js +217 -0
  328. package/dist/tenancy/tenant-host.js.map +1 -0
  329. package/dist/tenancy/tenant-runtime.d.ts +91 -0
  330. package/dist/tenancy/tenant-runtime.d.ts.map +1 -0
  331. package/dist/tenancy/tenant-runtime.js +174 -0
  332. package/dist/tenancy/tenant-runtime.js.map +1 -0
  333. package/dist/tenancy/tenant-secrets.d.ts +24 -0
  334. package/dist/tenancy/tenant-secrets.d.ts.map +1 -0
  335. package/dist/tenancy/tenant-secrets.js +30 -0
  336. package/dist/tenancy/tenant-secrets.js.map +1 -0
  337. package/dist/tenancy/tenant-source.contract.d.ts +45 -0
  338. package/dist/tenancy/tenant-source.contract.d.ts.map +1 -0
  339. package/dist/tenancy/tenant-source.contract.js +21 -0
  340. package/dist/tenancy/tenant-source.contract.js.map +1 -0
  341. package/migrations/0000_core_init.sql +14 -14
  342. package/migrations/0003_deployment_settings.sql +1 -1
  343. package/migrations/0005_github_facade.sql +1 -1
  344. package/migrations/0012_agent_audit.sql +6 -6
  345. package/package.json +3 -3
  346. package/src/__tests__/branch-model.test.ts +7 -6
  347. package/src/__tests__/kb-context.ts +30 -0
  348. package/src/__tests__/kb-layout-config.test.ts +35 -30
  349. package/src/core/__tests__/catalog-cache-invalidation.test.ts +2 -1
  350. package/src/core/__tests__/lifecycle.test.ts +78 -1
  351. package/src/core/__tests__/public-config.test.ts +5 -1
  352. package/src/core/catalog-cache-invalidation.ts +16 -11
  353. package/src/core/core-ports.ts +19 -0
  354. package/src/core/create-core-server.ts +27 -106
  355. package/src/core/create-core-services.ts +180 -95
  356. package/src/core/lifecycle.ts +214 -29
  357. package/src/core/public-config.ts +8 -5
  358. package/src/core-config.ts +107 -8
  359. package/src/index.ts +25 -2
  360. package/src/modules/access/__tests__/access-control.admin-root-floor.test.ts +2 -1
  361. package/src/modules/access/__tests__/access.routes.batch.test.ts +2 -1
  362. package/src/modules/access/__tests__/access.routes.folder-governs.test.ts +2 -1
  363. package/src/modules/access/__tests__/access.routes.group-grant.test.ts +2 -1
  364. package/src/modules/access/__tests__/access.routes.overrides.test.ts +2 -1
  365. package/src/modules/access/__tests__/access.routes.proposal-branch.test.ts +2 -1
  366. package/src/modules/access/__tests__/access.routes.prospective.test.ts +2 -1
  367. package/src/modules/access/__tests__/access.routes.revoke.test.ts +2 -1
  368. package/src/modules/access/__tests__/access.routes.unknown-email.test.ts +2 -1
  369. package/src/modules/access/__tests__/change-read-gate.test.ts +13 -11
  370. package/src/modules/access/__tests__/creator-access.test.ts +3 -2
  371. package/src/modules/access/__tests__/roles.routes.test.ts +2 -1
  372. package/src/modules/access/access-control.service.ts +20 -6
  373. package/src/modules/access/access.routes.ts +10 -13
  374. package/src/modules/access/change-read-gate.ts +10 -4
  375. package/src/modules/access/creator-access.ts +7 -2
  376. package/src/modules/agent-instructions/__tests__/read-preamble.test.ts +13 -12
  377. package/src/modules/agent-instructions/read-preamble.ts +10 -12
  378. package/src/modules/auth/__tests__/account.routes.test.ts +15 -0
  379. package/src/modules/auth/__tests__/auth.service.test.ts +60 -0
  380. package/src/modules/auth/account-admission.ts +44 -0
  381. package/src/modules/auth/account.routes.ts +4 -1
  382. package/src/modules/auth/auth.service.ts +33 -1
  383. package/src/modules/auth/oidc-auth-provider.ts +9 -0
  384. package/src/modules/connection-probe/connection-probe.service.ts +7 -1
  385. package/src/modules/database/__tests__/advisory-lock.test.ts +23 -1
  386. package/src/modules/database/__tests__/connection.test.ts +98 -0
  387. package/src/modules/database/__tests__/migrations-unqualified.test.ts +32 -0
  388. package/src/modules/database/advisory-lock.ts +28 -4
  389. package/src/modules/database/connection.ts +143 -13
  390. package/src/modules/database/migrate.ts +48 -14
  391. package/src/modules/diff/__tests__/diff.service.seed-atomicity.test.ts +2 -1
  392. package/src/modules/diff/__tests__/diff.service.test.ts +2 -1
  393. package/src/modules/kb-fs/__tests__/branch-name.test.ts +6 -6
  394. package/src/modules/kb-fs/__tests__/clone-config.test.ts +24 -20
  395. package/src/modules/kb-fs/branch-name.ts +3 -3
  396. package/src/modules/kb-fs/clone-config.ts +15 -12
  397. package/src/modules/marketplace/__tests__/marketplace-repo.head.test.ts +2 -1
  398. package/src/modules/mcp/mcp.service.ts +11 -4
  399. package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +12 -11
  400. package/src/modules/plugins/__tests__/bundle-dialect.test.ts +2 -1
  401. package/src/modules/plugins/__tests__/compile-marketplace.test.ts +6 -4
  402. package/src/modules/plugins/__tests__/join-request-jobs.service.test.ts +2 -1
  403. package/src/modules/plugins/__tests__/join-requests.service.test.ts +2 -1
  404. package/src/modules/plugins/__tests__/plugin-creation-display-name.test.ts +4 -3
  405. package/src/modules/plugins/__tests__/plugin-index.service.test.ts +6 -4
  406. package/src/modules/plugins/__tests__/plugin-links.service.test.ts +220 -5
  407. package/src/modules/plugins/__tests__/plugin-provision.service.test.ts +3 -1
  408. package/src/modules/plugins/__tests__/plugin-rename.service.test.ts +7 -6
  409. package/src/modules/plugins/__tests__/plugins.routes.test.ts +11 -2
  410. package/src/modules/plugins/__tests__/teams.routes.test.ts +2 -1
  411. package/src/modules/plugins/compile/marketplace-compiler.service.ts +7 -9
  412. package/src/modules/plugins/discovery/__tests__/kb-plugin-source.test.ts +20 -16
  413. package/src/modules/plugins/discovery/bundle-dialect/bundle.source.ts +9 -2
  414. package/src/modules/plugins/discovery/kb-plugin-source.ts +15 -8
  415. package/src/modules/plugins/discovery/native.source.ts +4 -1
  416. package/src/modules/plugins/index.ts +1 -1
  417. package/src/modules/plugins/join-request-jobs.service.ts +8 -7
  418. package/src/modules/plugins/join-requests.service.ts +7 -7
  419. package/src/modules/plugins/plugin-links.service.ts +192 -19
  420. package/src/modules/plugins/plugin-links.ts +147 -27
  421. package/src/modules/plugins/plugin-provision.service.ts +54 -27
  422. package/src/modules/plugins/plugin-rename.service.ts +10 -10
  423. package/src/modules/plugins/plugins.routes.ts +45 -15
  424. package/src/modules/plugins/plugins.service.ts +7 -11
  425. package/src/modules/plugins/teams.routes.ts +16 -8
  426. package/src/modules/secrets-vault/__tests__/connect-pending.route.test.ts +7 -0
  427. package/src/modules/secrets-vault/__tests__/secrets-variable-loader.test.ts +40 -0
  428. package/src/modules/secrets-vault/__tests__/tool-owner-gate.route.test.ts +2 -0
  429. package/src/modules/secrets-vault/index.ts +2 -0
  430. package/src/modules/secrets-vault/secrets-variable-loader.ts +51 -21
  431. package/src/modules/secrets-vault/secrets-vault.routes.ts +7 -6
  432. package/src/modules/settings/__tests__/deployment-settings.service.test.ts +24 -11
  433. package/src/modules/settings/__tests__/git-root-folders.test.ts +2 -1
  434. package/src/modules/settings/__tests__/setup.routes.boot-failure.test.ts +2 -1
  435. package/src/modules/settings/__tests__/setup.routes.layout-phase.test.ts +7 -4
  436. package/src/modules/settings/__tests__/setup.routes.oidc.test.ts +2 -0
  437. package/src/modules/settings/__tests__/setup.routes.sync-status.test.ts +2 -0
  438. package/src/modules/settings/__tests__/setup.routes.test.ts +33 -52
  439. package/src/modules/settings/deployment-settings.service.ts +21 -20
  440. package/src/modules/settings/setup.routes.ts +26 -16
  441. package/src/modules/skills/__tests__/allowed-tools-check.test.ts +11 -10
  442. package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +4 -3
  443. package/src/modules/skills/__tests__/pending-skills.service.test.ts +3 -1
  444. package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +2 -1
  445. package/src/modules/skills/__tests__/skills.routes.warnings.test.ts +2 -1
  446. package/src/modules/skills/__tests__/skills.service.test.ts +3 -2
  447. package/src/modules/skills/allowed-tools-check.ts +7 -6
  448. package/src/modules/skills/pending-skills.service.ts +9 -8
  449. package/src/modules/skills/skill-access-requests.routes.ts +7 -7
  450. package/src/modules/skills/skills.routes.ts +4 -3
  451. package/src/modules/skills/skills.service.ts +13 -9
  452. package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +3 -2
  453. package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +3 -2
  454. package/src/modules/tool-manuals/__tests__/mcp-json-discovery.test.ts +17 -12
  455. package/src/modules/tool-manuals/__tests__/mcp-server-edit.service.test.ts +2 -1
  456. package/src/modules/tool-manuals/__tests__/pending-tools.service.test.ts +4 -1
  457. package/src/modules/tool-manuals/__tests__/tool-delete.service.test.ts +2 -1
  458. package/src/modules/tool-manuals/__tests__/tool-manuals.archive.route.test.ts +2 -1
  459. package/src/modules/tool-manuals/__tests__/tool-manuals.cli.test.ts +5 -4
  460. package/src/modules/tool-manuals/__tests__/tool-manuals.detail.route.test.ts +2 -1
  461. package/src/modules/tool-manuals/__tests__/tool-manuals.invalid.routes.test.ts +4 -2
  462. package/src/modules/tool-manuals/__tests__/tool-manuals.invalid.test.ts +13 -5
  463. package/src/modules/tool-manuals/__tests__/tool-manuals.mcp-oauth.test.ts +2 -1
  464. package/src/modules/tool-manuals/__tests__/tool-manuals.restart.test.ts +9 -1
  465. package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +3 -2
  466. package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +2 -0
  467. package/src/modules/tool-manuals/mcp-json-discovery.ts +6 -4
  468. package/src/modules/tool-manuals/mcp-server-edit.service.ts +13 -11
  469. package/src/modules/tool-manuals/pending-tools.service.ts +19 -16
  470. package/src/modules/tool-manuals/tool-delete.service.ts +13 -10
  471. package/src/modules/tool-manuals/tool-manuals.routes.ts +10 -8
  472. package/src/modules/tool-manuals/tool-manuals.service.ts +15 -13
  473. package/src/modules/tool-manuals/tool-manuals.tools.ts +7 -6
  474. package/src/modules/workflow/__tests__/apply-failure.test.ts +2 -1
  475. package/src/modules/workflow/__tests__/merge-announces-tree.test.ts +14 -26
  476. package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +2 -1
  477. package/src/modules/workflow/__tests__/session-ontology.service.test.ts +3 -2
  478. package/src/modules/workflow/__tests__/workflow.routes.lock-path.test.ts +2 -1
  479. package/src/modules/workflow/__tests__/workflow.service.branch-in-use.test.ts +3 -10
  480. package/src/modules/workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts +2 -1
  481. package/src/modules/workflow/__tests__/workflow.service.deleted-branch-sweep.test.ts +3 -10
  482. package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +28 -27
  483. package/src/modules/workflow/__tests__/workflow.service.folder-proposals.test.ts +2 -1
  484. package/src/modules/workflow/__tests__/workflow.service.platform-restore.test.ts +2 -1
  485. package/src/modules/workflow/__tests__/workflow.service.read-gate.test.ts +3 -2
  486. package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +2 -1
  487. package/src/modules/workflow/__tests__/workflow.service.sync.test.ts +5 -4
  488. package/src/modules/workflow/__tests__/workflow.service.update-from-target.test.ts +2 -1
  489. package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +2 -1
  490. package/src/modules/workflow/agent-tools/workflow.tools.ts +11 -9
  491. package/src/modules/workflow/git/__tests__/git.service.accessGating.test.ts +5 -4
  492. package/src/modules/workflow/git/__tests__/git.service.changedFilesForPr.test.ts +12 -11
  493. package/src/modules/workflow/git/__tests__/git.service.commitChanges.test.ts +9 -8
  494. package/src/modules/workflow/git/__tests__/git.service.commitFile.strayPath.test.ts +8 -7
  495. package/src/modules/workflow/git/__tests__/git.service.commitFile.test.ts +6 -5
  496. package/src/modules/workflow/git/__tests__/git.service.createBranch.test.ts +3 -2
  497. package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +3 -2
  498. package/src/modules/workflow/git/__tests__/git.service.diffFileAtCommit.test.ts +7 -6
  499. package/src/modules/workflow/git/__tests__/git.service.diffFileBetweenBranches.test.ts +16 -15
  500. package/src/modules/workflow/git/__tests__/git.service.fileContentsAtCommit.test.ts +3 -2
  501. package/src/modules/workflow/git/__tests__/git.service.forkPoint.test.ts +2 -1
  502. package/src/modules/workflow/git/__tests__/git.service.history-guards.test.ts +2 -1
  503. package/src/modules/workflow/git/__tests__/git.service.list-branches.test.ts +10 -9
  504. package/src/modules/workflow/git/__tests__/git.service.listTrackedFiles.test.ts +2 -1
  505. package/src/modules/workflow/git/__tests__/git.service.logForFile.test.ts +6 -5
  506. package/src/modules/workflow/git/__tests__/git.service.mergeChangeRequest.test.ts +9 -8
  507. package/src/modules/workflow/git/__tests__/git.service.pendingChanges.test.ts +2 -1
  508. package/src/modules/workflow/git/__tests__/git.service.postMergePull.test.ts +4 -3
  509. package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +9 -8
  510. package/src/modules/workflow/git/__tests__/git.service.readFileAtRef.test.ts +2 -1
  511. package/src/modules/workflow/git/__tests__/git.service.revertPathsAndPush.test.ts +2 -1
  512. package/src/modules/workflow/git/__tests__/git.service.status.test.ts +4 -3
  513. package/src/modules/workflow/git/__tests__/git.service.syncFromRemote.test.ts +8 -7
  514. package/src/modules/workflow/git/__tests__/node-git-runner.test.ts +41 -3
  515. package/src/modules/workflow/git/git.service.ts +24 -13
  516. package/src/modules/workflow/git/node-git-runner.ts +37 -4
  517. package/src/modules/workflow/review-workflow/review-workflow.service.ts +9 -6
  518. package/src/modules/workflow/session-ontology.service.ts +7 -2
  519. package/src/modules/workflow/workflow.service.ts +31 -24
  520. package/src/modules/workspace/__tests__/file-stat-access.test.ts +3 -2
  521. package/src/modules/workspace/__tests__/git-internals.security.test.ts +10 -9
  522. package/src/modules/workspace/__tests__/session-ontology.gate.test.ts +4 -2
  523. package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +3 -2
  524. package/src/modules/workspace/__tests__/workspace.routes.branch-errors.test.ts +2 -1
  525. package/src/modules/workspace/__tests__/workspace.routes.create-grant.test.ts +2 -1
  526. package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +2 -1
  527. package/src/modules/workspace/__tests__/workspace.routes.download-implies-read.test.ts +2 -1
  528. package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +2 -1
  529. package/src/modules/workspace/__tests__/workspace.routes.file-writes.test.ts +2 -1
  530. package/src/modules/workspace/__tests__/workspace.routes.folders.test.ts +5 -4
  531. package/src/modules/workspace/__tests__/workspace.routes.move-platform-files.test.ts +2 -1
  532. package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +2 -1
  533. package/src/modules/workspace/__tests__/workspace.service.ensure-remotes-fetched.test.ts +2 -2
  534. package/src/modules/workspace/__tests__/workspace.service.list-cloned.test.ts +6 -5
  535. package/src/modules/workspace/__tests__/workspace.service.move-never-overwrites.test.ts +2 -1
  536. package/src/modules/workspace/__tests__/workspace.service.read-filter.test.ts +2 -1
  537. package/src/modules/workspace/__tests__/workspace.service.test.ts +84 -50
  538. package/src/modules/workspace/__tests__/workspace.service.unknown-branch.test.ts +2 -1
  539. package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +10 -7
  540. package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +4 -3
  541. package/src/modules/workspace/__tests__/workspace.tools.test.ts +9 -8
  542. package/src/modules/workspace/__tests__/write-denial.test.ts +5 -4
  543. package/src/modules/workspace/session-ontology.gate.ts +6 -4
  544. package/src/modules/workspace/startup/__tests__/kb-startup-runner.degraded.test.ts +6 -2
  545. package/src/modules/workspace/startup/__tests__/kb-startup-runner.test.ts +29 -21
  546. package/src/modules/workspace/startup/kb-git.ts +15 -22
  547. package/src/modules/workspace/startup/kb-startup-runner.ts +40 -46
  548. package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +104 -98
  549. package/src/modules/workspace/startup/steps/groups-to-plugins.step.ts +24 -16
  550. package/src/modules/workspace/startup/steps/personal-spaces.step.ts +14 -5
  551. package/src/modules/workspace/startup/steps/plugin-display-names.step.ts +13 -5
  552. package/src/modules/workspace/startup/steps/plugin-manifests.step.ts +14 -5
  553. package/src/modules/workspace/startup/steps/seed-tree.ts +11 -9
  554. package/src/modules/workspace/startup/steps/template-files.step.ts +43 -34
  555. package/src/modules/workspace/startup/steps/template-source.ts +8 -5
  556. package/src/modules/workspace/workspace.routes.ts +8 -7
  557. package/src/modules/workspace/workspace.service.ts +30 -27
  558. package/src/modules/workspace/workspace.tools.ts +21 -20
  559. package/src/modules/workspace/write-denial.ts +7 -5
  560. package/src/shared/__tests__/kb-layout.plugin.test.ts +19 -16
  561. package/src/shared/git.contract.ts +70 -8
  562. package/src/shared/kb-context.ts +130 -0
  563. package/src/shared/kb-layout.test.ts +37 -27
  564. package/src/shared/kb-layout.ts +4 -3
  565. package/src/shared/pending-proposals.ts +7 -4
  566. package/src/shared/redact-secret.ts +5 -5
  567. package/src/tenancy/__tests__/static-tenant-source.test.ts +177 -0
  568. package/src/tenancy/__tests__/tenant-host.test.ts +372 -0
  569. package/src/tenancy/__tests__/tenant-runtime.test.ts +221 -0
  570. package/src/tenancy/__tests__/tenant-secrets.test.ts +35 -0
  571. package/src/tenancy/index.ts +35 -0
  572. package/src/tenancy/static-tenant-source.ts +296 -0
  573. package/src/tenancy/tenant-host.ts +261 -0
  574. package/src/tenancy/tenant-runtime.ts +208 -0
  575. package/src/tenancy/tenant-secrets.ts +41 -0
  576. package/src/tenancy/tenant-source.contract.ts +59 -0
@@ -1,6 +1,9 @@
1
1
  import type { Server } from 'node:http';
2
- import type { Database } from '../modules/database/connection.js';
2
+ import { type Database } from '../modules/database/connection.js';
3
3
  import type { AdvisoryLease } from '../modules/database/advisory-lock.js';
4
+ import { type KbStartupRunner } from '../modules/workspace/startup/kb-startup-runner.js';
5
+ import type { WorkflowService } from '../modules/workflow/workflow.service.js';
6
+ import type { PluginJoinRequestJobs } from '../modules/plugins/join-request-jobs.service.js';
4
7
  /**
5
8
  * The process lifecycle: who may drain the commit queue, and how the process
6
9
  * stops.
@@ -83,27 +86,79 @@ export declare function holdCommitWorkerLease(lease: AdvisoryLease, worker: Leas
83
86
  * anyway; a stop during the task waits for it, then stops the worker.
84
87
  */
85
88
  export declare function withStartupTask(worker: LeasedWorker, task: () => Promise<void>, log?: (message: string) => void): LeasedWorker;
86
- export interface ShutdownDeps {
87
- /** The listening server — stops accepting, then drops what is connected. */
88
- server: Pick<Server, 'close' | 'closeAllConnections'>;
89
+ /**
90
+ * What one knowledge base's graph needs of itself to be STARTED: the boot
91
+ * side effects that used to run inside `createCoreServer`, named so a host
92
+ * can run them for a graph it builds on demand, and stop them again.
93
+ */
94
+ export interface BootableCore {
95
+ config: {
96
+ workspacesRoot: string;
97
+ };
98
+ kbDirName: string;
99
+ kbStartupRunner: Pick<KbStartupRunner, 'runAll' | 'retryUntilMaintained'>;
100
+ workflowService: Pick<WorkflowService, 'closeChangeRequestsWithDeletedBranches'>;
101
+ pluginJoinRequestJobs: Pick<PluginJoinRequestJobs, 'startSweeping'>;
102
+ /**
103
+ * The startup phase's retry, when the boot survived an unreachable remote
104
+ * and is asking again on a timer; null otherwise. Set by {@link startCore},
105
+ * stopped by {@link stopCore}.
106
+ */
107
+ startupRetry: {
108
+ stop(): void;
109
+ } | null;
110
+ }
111
+ /**
112
+ * Bring a built graph up: the distribution's boot hook, the note about what
113
+ * sits beside a checkout, the knowledge-base startup phase with its
114
+ * unreachable-remote fallback, the deleted-branch sweep and the join-request
115
+ * jobs. `createCoreServer` runs this for a single-tenant deployment; a host
116
+ * serving several knowledge bases runs it when a tenant is activated.
117
+ *
118
+ * Throws to stop the boot on every failure but an unreachable remote — the
119
+ * container's restart policy is the retry — see `kb-startup-runner.ts`.
120
+ */
121
+ export declare function startCore<C extends BootableCore>(core: C, ext?: {
122
+ onBoot?(core: C): Promise<void> | void;
123
+ }): Promise<void>;
124
+ /**
125
+ * What one knowledge base's graph holds that must be let go of when it
126
+ * stops: the pieces {@link stopCore} winds down, in the order it winds
127
+ * them down. `createShutdown` takes the same, plus the listening server.
128
+ */
129
+ export interface CoreStopDeps {
89
130
  /** The lease loop from {@link holdCommitWorkerLease}: its stop finishes the in-flight commit and releases the lease. */
90
131
  commitWorker: Pick<LeaseLoopHandle, 'stop'>;
91
132
  /**
92
133
  * Background work to wind down before the pool goes — the join-request
93
- * sweep and its jobs, today. The timer is stopped after the server so
94
- * nothing new is scheduled, then the jobs already running are awaited
95
- * (within the budget) so the pool is not ended under a clone or a push
96
- * that is still writing to it. Optional: a caller that has not built them
97
- * yet passes nothing.
134
+ * sweep and its jobs, today. The timer is stopped first so nothing new is
135
+ * scheduled, then the jobs already running are awaited (within the budget)
136
+ * so the pool is not ended under a clone or a push that is still writing
137
+ * to it. Optional: a caller that has not built them yet passes nothing.
98
138
  */
99
139
  backgroundJobs?: {
100
140
  stopSweeping(): void;
101
141
  drain(): Promise<void>;
102
142
  };
143
+ /** The startup phase's retry, if the boot left one asking — see {@link BootableCore.startupRetry}. */
144
+ startupRetry?: {
145
+ stop(): void;
146
+ } | null;
103
147
  /** The database — its pool is ended last, once nothing above can still need it. */
104
148
  db: Pick<Database, '$client'>;
149
+ /**
150
+ * The scope this graph's secrets vault was registered under with the UTCP
151
+ * variable loader (see `secrets-variable-loader.ts`); forgotten on stop so
152
+ * a descriptor that outlives the graph resolves nothing. Optional: a
153
+ * single-tenant process exits right after, and has nothing to forget.
154
+ */
155
+ secretsScope?: string;
105
156
  log?: (message: string) => void;
106
157
  }
158
+ export interface ShutdownDeps extends CoreStopDeps {
159
+ /** The listening server — stops accepting, then drops what is connected. */
160
+ server: Pick<Server, 'close' | 'closeAllConnections'>;
161
+ }
107
162
  export interface ShutdownOptions {
108
163
  /**
109
164
  * Total time the sequence may take. Default 8s: Docker's `stop_grace_period`
@@ -113,26 +168,17 @@ export interface ShutdownOptions {
113
168
  */
114
169
  deadlineMs?: number;
115
170
  }
171
+ export interface StopCoreOptions {
172
+ /** Total time the stop may take. Default: the shutdown's 8s. */
173
+ deadlineMs?: number;
174
+ }
116
175
  /**
117
- * The shutdown sequence, as a function the process's signal handlers call.
118
- * Idempotent: a second signal awaits the sequence already running rather than
119
- * starting another.
120
- *
121
- * The order is the point:
122
- *
123
- * 1. Stop accepting, and drop every open connection. SSE streams end here;
124
- * the browser's EventSource reconnects on its own, and the replacement
125
- * process — whose replay buffer is empty — answers the reconnect with a
126
- * resync, which is the behaviour the event bus already defines for it.
127
- * No stream is told anything, because nothing it could be told would
128
- * beat that.
129
- * 2. Stop the commit worker, which finishes the commit it is in the middle
130
- * of, then release the lease so the replacement can take it. A commit
131
- * that cannot finish inside the deadline is abandoned as `running` in the
132
- * queue, and the startup reconcile of the next boot returns it to
133
- * `pending` — the recovery the queue has always had for a process that
134
- * died mid-commit, now the exception rather than the rule.
135
- * 3. End the pool.
176
+ * Stop one knowledge base's graph without stopping the process: the
177
+ * shutdown sequence minus closing the server. What a host runs when it
178
+ * evicts a tenant, and what {@link createShutdown} runs after the server
179
+ * has closed. Bounded like the shutdown, so a step that hangs cannot hold
180
+ * the host's event loop hostage.
136
181
  */
182
+ export declare function stopCore(core: CoreStopDeps, opts?: StopCoreOptions): Promise<void>;
137
183
  export declare function createShutdown(deps: ShutdownDeps, opts?: ShutdownOptions): (reason: string) => Promise<void>;
138
184
  //# sourceMappingURL=lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../src/core/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,8CAA8C;AAC9C,MAAM,WAAW,YAAY;IAC3B,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E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E,sGAAsG;IACtG,YAAY,CAAC,EAAE;QAAE,IAAI,IAAI,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACvC,mFAAmF;IACnF,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,4EAA4E;IAC5E,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,qBAAqB,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA0ED,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO5F;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,YAAY,EAClB,IAAI,GAAE,eAAoB,GACzB,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CA0BnC"}
@@ -1,4 +1,11 @@
1
+ import { closeDb } from '../modules/database/connection.js';
2
+ import { KbRemoteUnreachableError } from '../modules/workspace/startup/kb-startup-runner.js';
3
+ import { noteBesideCheckout } from '../modules/workspace/startup/beside-checkout.js';
4
+ import { unregisterBevelSecretsVariableLoader } from '../modules/secrets-vault/secrets-variable-loader.js';
5
+ import { printable } from '../shared/printable.js';
1
6
  import { logger } from '../shared/logging.js';
7
+ const startupLog = logger('kb-startup');
8
+ const crLog = logger('cr');
2
9
  const DEFAULT_RETRY_MS = 5_000;
3
10
  function defaultSleep(ms) {
4
11
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -136,6 +143,107 @@ export function withStartupTask(worker, task, log = (message) => logger('lifecyc
136
143
  },
137
144
  };
138
145
  }
146
+ /**
147
+ * Bring a built graph up: the distribution's boot hook, the note about what
148
+ * sits beside a checkout, the knowledge-base startup phase with its
149
+ * unreachable-remote fallback, the deleted-branch sweep and the join-request
150
+ * jobs. `createCoreServer` runs this for a single-tenant deployment; a host
151
+ * serving several knowledge bases runs it when a tenant is activated.
152
+ *
153
+ * Throws to stop the boot on every failure but an unreachable remote — the
154
+ * container's restart policy is the retry — see `kb-startup-runner.ts`.
155
+ */
156
+ export async function startCore(core, ext = {}) {
157
+ // Overlay boot-time side effects (startup reconciles, periodic sweeps).
158
+ await ext.onBoot?.(core);
159
+ // What is already sitting beside a checkout, named once per boot and touched
160
+ // by nothing. Outside the KB startup phase below on purpose: that phase is
161
+ // gated on the branch model and the repository URL, and a deployment whose
162
+ // setup never finished — or whose remote is down — is exactly one whose
163
+ // strays would otherwise go unmentioned. A diagnostic never stops a boot, so
164
+ // an unreadable workspaces root is logged and the boot carries on.
165
+ try {
166
+ await noteBesideCheckout(core.config.workspacesRoot, core.kbDirName);
167
+ }
168
+ catch (err) {
169
+ // `printable`, because the message quotes a path off the disk (an ENOENT
170
+ // or EACCES names the file it failed on) and a name carrying a control
171
+ // character would forge a second line of the operator's log.
172
+ startupLog.warn('could not look for content beside the checkouts:', {
173
+ detail: printable(err instanceof Error ? err.message : String(err)),
174
+ });
175
+ }
176
+ // The KB startup phase — AFTER the distribution's onBoot, because a FATAL
177
+ // template finding raised there must stop the boot before anything seeds
178
+ // from that template; the runner then brings every branch up to this build
179
+ // before any route can serve KB content. Throws to stop the boot (the
180
+ // container's restart policy is the retry) — see kb-startup-runner.ts.
181
+ //
182
+ // Runs in the booting process whether or not it holds the commit-worker
183
+ // lease, so on a redeploy it overlaps the outgoing holder's commits for the
184
+ // seconds it takes — the documented window at `holdCommitWorkerLease`.
185
+ try {
186
+ await core.kbStartupRunner.runAll();
187
+ }
188
+ catch (err) {
189
+ // The one failure a boot survives: the remote cannot be reached. That
190
+ // says nothing about the knowledge base — what we would write is not
191
+ // known to be wrong, we cannot get there — so refusing to boot only took
192
+ // away the login and setup screens an operator needs to fix it (a
193
+ // rotated token, say). The deployment comes up GATED: the setup routes
194
+ // read the runner's standing failure and keep the app shut, the setup
195
+ // screen shows why, saving it retries, and the runner keeps trying on
196
+ // its own. Every other failure still stops the boot, because it means
197
+ // the template or a step would write something wrong.
198
+ if (!(err instanceof KbRemoteUnreachableError))
199
+ throw err;
200
+ startupLog.error('booting UNMAINTAINED and gated — the knowledge-base remote could not be reached:', {
201
+ detail: err.message,
202
+ });
203
+ // Kept on the graph so that stopping the graph stops the asking: a
204
+ // retry that outlived its graph would clone into a workspaces folder
205
+ // nobody serves any more.
206
+ core.startupRetry = core.kbStartupRunner.retryUntilMaintained();
207
+ }
208
+ // Close change requests whose source branch has been deleted. SEQUENCED
209
+ // AFTER the startup phase above, for two reasons: the sweep's fresh fetch
210
+ // lazily bootstraps and fetches the same default-branch clone the runner
211
+ // maintains (kicking it off earlier races the runner's clone/fetch of that
212
+ // very directory), and on a brand-new deployment it would run before the
213
+ // empty remote is seeded, fail its clone, swallow the error, and leave
214
+ // deleted-branch CRs open for the whole process. Still not awaited from
215
+ // here on: a slow or unreachable remote must not hold up the server —
216
+ // nothing downstream depends on the result, and the requests it closes
217
+ // have been unusable since the branch went away, so landing a few seconds
218
+ // into uptime is soon enough. Errors are swallowed inside the sweep, which
219
+ // fails safe by closing nothing.
220
+ void core.workflowService
221
+ .closeChangeRequestsWithDeletedBranches()
222
+ .then((n) => {
223
+ if (n > 0) {
224
+ crLog.info(`closed ${n} change request${n === 1 ? '' : 's'} with a deleted branch`);
225
+ }
226
+ })
227
+ .catch((err) => crLog.warn('deleted-branch sweep failed:', { err }));
228
+ // Recorded join requests that are still owed, resumed — now, and then on a
229
+ // timer. SEQUENCED AFTER the startup phase for the same reason as the sweep
230
+ // above: the work needs the default-branch clone the runner maintains and
231
+ // the plugin catalog read from it, and a sweep that ran first would refuse
232
+ // every row for a knowledge base that simply was not ready — telling people
233
+ // their request could not be sent when nothing had gone wrong with it.
234
+ //
235
+ // ON A TIMER rather than at boot alone, because boot cannot cover the
236
+ // redeploy: this process sweeps while the outgoing one still holds a
237
+ // record, skips it (correctly — two servers must not do git on one branch),
238
+ // and the outgoing process then exits mid-work. Nothing else would look at
239
+ // that row again. The requester cannot prompt it either: a pending record
240
+ // shows them the "Requested" card, not a button.
241
+ //
242
+ // Not awaited, and nothing to report here but the failure to read the table
243
+ // at all: a first request from a person is a full clone, nothing else at
244
+ // boot depends on it, and each row records its own outcome.
245
+ core.pluginJoinRequestJobs.startSweeping();
246
+ }
139
247
  const DEFAULT_SHUTDOWN_DEADLINE_MS = 8_000;
140
248
  /** Await `promise` for at most `ms`; on expiry log and move on rather than hang the exit. */
141
249
  async function bounded(promise, ms, label, log) {
@@ -177,6 +285,54 @@ async function bounded(promise, ms, label, log) {
177
285
  * died mid-commit, now the exception rather than the rule.
178
286
  * 3. End the pool.
179
287
  */
288
+ /**
289
+ * Let go of everything a graph holds, in order, within `remaining()`.
290
+ * The order is the point — see {@link createShutdown} for why each step
291
+ * sits where it does.
292
+ */
293
+ async function releaseCore(deps, remaining, log) {
294
+ // First, and BEFORE the commit worker is stopped. Stopping that worker
295
+ // awaits an in-flight commit and can spend most of the remaining budget
296
+ // doing it; a sweep tick firing inside that window reads the still-open
297
+ // pool and starts fresh clone/commit/push work that the end of the
298
+ // sequence then kills mid-git. Nothing new can be recorded once the
299
+ // server is closed (or the tenant is no longer routed to), so this is the
300
+ // earliest point the interval is dead weight. Synchronous and unfailing
301
+ // — it just clears an interval — so it needs no budget of its own.
302
+ deps.backgroundJobs?.stopSweeping();
303
+ // A startup phase still asking for an unreachable remote stops asking:
304
+ // synchronous, and nothing after it must be able to clone into a
305
+ // workspaces folder that is about to belong to nobody.
306
+ deps.startupRetry?.stop();
307
+ // Clearing the interval stops future ticks; it does nothing to a job a
308
+ // tick already started, which holds a claim it heartbeats through the
309
+ // pool and is mid-clone or mid-push. Awaited here, in the budget: a job
310
+ // that finishes releases or marks its row; one that cannot in time is
311
+ // killed with the process and its claim goes stale for the next sweep
312
+ // — which is the recovery every crash already gets.
313
+ if (deps.backgroundJobs) {
314
+ await bounded(deps.backgroundJobs.drain(), remaining(), 'finishing the background jobs', log);
315
+ }
316
+ await bounded(deps.commitWorker.stop(), remaining(), 'stopping the commit worker', log);
317
+ if (deps.secretsScope !== undefined)
318
+ unregisterBevelSecretsVariableLoader(deps.secretsScope);
319
+ await bounded(closeDb(deps.db), remaining(), 'ending the database pool', log);
320
+ }
321
+ /**
322
+ * Stop one knowledge base's graph without stopping the process: the
323
+ * shutdown sequence minus closing the server. What a host runs when it
324
+ * evicts a tenant, and what {@link createShutdown} runs after the server
325
+ * has closed. Bounded like the shutdown, so a step that hangs cannot hold
326
+ * the host's event loop hostage.
327
+ */
328
+ export async function stopCore(core, opts = {}) {
329
+ const log = core.log ?? ((message) => logger('lifecycle').info(message));
330
+ const deadlineMs = opts.deadlineMs ?? DEFAULT_SHUTDOWN_DEADLINE_MS;
331
+ const startedAt = Date.now();
332
+ const remaining = () => Math.max(0, deadlineMs - (Date.now() - startedAt));
333
+ await releaseCore(core, remaining, log);
334
+ log(`graph stopped in ${Date.now() - startedAt}ms`);
335
+ }
180
336
  export function createShutdown(deps, opts = {}) {
181
337
  const log = deps.log ?? ((message) => logger('lifecycle').info(message));
182
338
  const deadlineMs = opts.deadlineMs ?? DEFAULT_SHUTDOWN_DEADLINE_MS;
@@ -190,26 +346,7 @@ export function createShutdown(deps, opts = {}) {
190
346
  deps.server.close(() => resolve());
191
347
  deps.server.closeAllConnections();
192
348
  }), remaining(), 'closing the server', log);
193
- // Immediately after the server, and BEFORE the commit worker is stopped.
194
- // Stopping that worker awaits an in-flight commit and can spend most of
195
- // the remaining budget doing it; a sweep tick firing inside that window
196
- // reads the still-open pool and starts fresh clone/commit/push work that
197
- // the `process.exit()` at the end of the sequence then kills mid-git.
198
- // Nothing new can be recorded once the server is closed, so this is the
199
- // earliest point the interval is dead weight. Synchronous and unfailing
200
- // — it just clears an interval — so it needs no budget of its own.
201
- deps.backgroundJobs?.stopSweeping();
202
- // Clearing the interval stops future ticks; it does nothing to a job a
203
- // tick already started, which holds a claim it heartbeats through the
204
- // pool and is mid-clone or mid-push. Awaited here, in the budget: a job
205
- // that finishes releases or marks its row; one that cannot in time is
206
- // killed with the process and its claim goes stale for the next sweep
207
- // — which is the recovery every crash already gets.
208
- if (deps.backgroundJobs) {
209
- await bounded(deps.backgroundJobs.drain(), remaining(), 'finishing the background jobs', log);
210
- }
211
- await bounded(deps.commitWorker.stop(), remaining(), 'stopping the commit worker', log);
212
- await bounded(deps.db.$client.end(), remaining(), 'ending the database pool', log);
349
+ await releaseCore(deps, remaining, log);
213
350
  log(`shutdown complete in ${Date.now() - startedAt}ms`);
214
351
  })();
215
352
  return inFlight;
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../src/core/lifecycle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA4C9C,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B,SAAS,YAAY,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAoB,EACpB,MAAoB,EACpB,OAAyB,EAAE;IAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,gBAAgB,CAAC;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,YAAY,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,O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AAC,OAAO,EAAE,EAAE;gBAC5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;gBACnC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;YACpC,CAAC,CAAC,EACF,SAAS,EAAE,EACX,oBAAoB,EACpB,GAAG,CACJ,CAAC;YACF,MAAM,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;YAExC,GAAG,CAAC,wBAAwB,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,CAAC,CAAC;QAC1D,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { KbContext } from '../shared/kb-context.js';
1
2
  /** The two addresses the server derives once and hands to {@link publicConfig}. */
2
3
  export interface PublicConfigAddresses {
3
4
  /** The per-user marketplace git remote, userinfo stripped. */
@@ -21,8 +22,11 @@ export interface PublicConfigAddresses {
21
22
  * means a rebuild.
22
23
  *
23
24
  * A pure function of its inputs, so the payload is testable without a server.
25
+ * `kb` is read at call time, not captured: the branch model arrives from the
26
+ * setup screen on a fresh deployment, and the next `/api/config` after that
27
+ * save has to carry it.
24
28
  */
25
- export declare function publicConfig({ marketplaceGitUrl, mcpUrl }: PublicConfigAddresses): {
29
+ export declare function publicConfig(kb: KbContext, { marketplaceGitUrl, mcpUrl }: PublicConfigAddresses): {
26
30
  branchModel: {
27
31
  defaultBranch: string;
28
32
  protectedBranches: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"public-config.d.ts","sourceRoot":"","sources":["../../src/core/public-config.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,qBAAqB;;;;;IAM7E;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;;;;;;;;;OAaG;;IAEH;;;;;;;;OAQG;;IAEH;;;;;;;;;;;;OAYG;;EAGN"}
1
+ {"version":3,"file":"public-config.d.ts","sourceRoot":"","sources":["../../src/core/public-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzD,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,EAAE,qBAAqB;;;;;IAM5F;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;;;;;;;;;;OAaG;;IAEH;;;;;;;;OAQG;;IAEH;;;;;;;;;;;;OAYG;;EAGN"}
@@ -1,4 +1,3 @@
1
- import { DEFAULT_BRANCH, PROTECTED_BRANCHES, currentKbLayout } from '@bevel-software/platform-shared';
2
1
  /**
3
2
  * The body of the unauthenticated `GET /api/config`: the handful of facts the
4
3
  * browser needs BEFORE it can render anything, and what a local bridge
@@ -15,19 +14,22 @@ import { DEFAULT_BRANCH, PROTECTED_BRANCHES, currentKbLayout } from '@bevel-soft
15
14
  * means a rebuild.
16
15
  *
17
16
  * A pure function of its inputs, so the payload is testable without a server.
17
+ * `kb` is read at call time, not captured: the branch model arrives from the
18
+ * setup screen on a fresh deployment, and the next `/api/config` after that
19
+ * save has to carry it.
18
20
  */
19
- export function publicConfig({ marketplaceGitUrl, mcpUrl }) {
21
+ export function publicConfig(kb, { marketplaceGitUrl, mcpUrl }) {
20
22
  return {
21
23
  branchModel: {
22
- defaultBranch: DEFAULT_BRANCH,
23
- protectedBranches: [...PROTECTED_BRANCHES],
24
+ defaultBranch: kb.defaultBranch,
25
+ protectedBranches: [...kb.protectedBranches],
24
26
  },
25
27
  /**
26
28
  * The three renameable KB roots, for the same reason as the branch
27
29
  * model: the file tree, the library router and every path rule read
28
30
  * them, and they used to be compile-time constants.
29
31
  */
30
- kbLayout: currentKbLayout(),
32
+ kbLayout: kb.layout,
31
33
  /**
32
34
  * The per-user marketplace git remote (see modules/marketplace). Same
33
35
  * derivation as `mcpUrl`: our address, userinfo stripped; the caller
@@ -1 +1 @@
1
- {"version":3,"file":"public-config.js","sourceRoot":"","sources":["../../src/core/public-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAUtG;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAyB;IAC/E,OAAO;QACL,WAAW,EAAE;YACX,aAAa,EAAE,cAAc;YAC7B,iBAAiB,EAAE,CAAC,GAAG,kBAAkB,CAAC;SAC3C;QACD;;;;WAIG;QACH,QAAQ,EAAE,eAAe,EAAE;QAC3B;;;;WAIG;QACH,iBAAiB;QACjB;;;;;;;;;;;;;WAaG;QACH,MAAM;QACN;;;;;;;;WAQG;QACH,iBAAiB,EAAE,IAAa;QAChC;;;;;;;;;;;;WAYG;QACH,eAAe,EAAE,IAAa;KAC/B,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"public-config.js","sourceRoot":"","sources":["../../src/core/public-config.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,YAAY,CAAC,EAAa,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAyB;IAC9F,OAAO;QACL,WAAW,EAAE;YACX,aAAa,EAAE,EAAE,CAAC,aAAa;YAC/B,iBAAiB,EAAE,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC;SAC7C;QACD;;;;WAIG;QACH,QAAQ,EAAE,EAAE,CAAC,MAAM;QACnB;;;;WAIG;QACH,iBAAiB;QACjB;;;;;;;;;;;;;WAaG;QACH,MAAM;QACN;;;;;;;;WAQG;QACH,iBAAiB,EAAE,IAAa;QAChC;;;;;;;;;;;;WAYG;QACH,eAAe,EAAE,IAAa;KAC/B,CAAC;AACJ,CAAC"}
@@ -27,6 +27,86 @@ export declare function resolveDatabaseUrl(env?: NodeJS.ProcessEnv): string;
27
27
  * the first would leave `ss@` — most of the credential — in what is kept.
28
28
  */
29
29
  export declare function withoutUserinfo(url: string): string;
30
+ /**
31
+ * Everything ONE knowledge base's service graph is built from — the values
32
+ * that differ between two knowledge bases a process might host. A
33
+ * single-tenant deployment reads them from the environment ({@link CoreConfig});
34
+ * a host serving several builds one of these per tenant from its registry.
35
+ * `createCoreServices` takes this shape, so the two are the same code path.
36
+ *
37
+ * `port`, `nodeEnv` and `trustProxy` are process facts a graph still needs
38
+ * (the loopback address the MCP proxy dials, cookie flags, the proxy hop
39
+ * count its Express app trusts), so they appear here as well as on
40
+ * {@link ProcessConfig}: a tenant's config carries the values of the process
41
+ * it runs in.
42
+ */
43
+ export interface TenantConfig {
44
+ readonly port: number;
45
+ readonly databaseUrl: string;
46
+ /** The Postgres schema this knowledge base's tables live in. `public` for a single-tenant deployment. */
47
+ readonly dbSchema: string;
48
+ readonly nodeEnv: string;
49
+ readonly tenantId: string;
50
+ /** The credential prefixes derived from `tenantId` — see the getters on {@link CoreConfig}. */
51
+ readonly externalApiKeyPrefix: string;
52
+ readonly internalTokenPrefix: string;
53
+ readonly uploadTokenPrefix: string;
54
+ readonly mcpOAuthTokenPrefix: string;
55
+ readonly workspacesRoot: string;
56
+ readonly backupsRoot: string;
57
+ readonly spillRoot: string;
58
+ readonly docExtractCacheRoot: string;
59
+ readonly jwtSecret: string;
60
+ readonly adminEmail: string;
61
+ readonly adminPassword: string;
62
+ readonly oidcIssuerUrl: string;
63
+ readonly oidcClientId: string;
64
+ readonly oidcClientSecret: string;
65
+ readonly oidcScopes: string;
66
+ readonly oidcProviderLabel: string;
67
+ readonly kbRepoUrl: string;
68
+ readonly kbDirName: string;
69
+ readonly gitUsername: string;
70
+ readonly gitToken: string;
71
+ readonly kbTemplateDir: string;
72
+ readonly ontologySessionBlock: boolean;
73
+ readonly updateCheckEnabled: boolean;
74
+ readonly loginPasswordEnabled: boolean;
75
+ readonly allowedEmailDomains: string[];
76
+ readonly secretsEncKey: string;
77
+ readonly internalTokenSecret: string;
78
+ readonly trustProxy: string;
79
+ readonly gitTimeoutMs: number;
80
+ readonly publicBackendUrl: string;
81
+ readonly publicFrontendUrl: string;
82
+ readonly configuredPublicFrontendUrl: string | null;
83
+ /**
84
+ * Where this graph's own REST surface is reached from inside the process
85
+ * (the MCP proxy dials it, and seeds it into the UTCP manuals it builds).
86
+ * Unset, `http://127.0.0.1:<port>`; a tenant host names its tenant on the
87
+ * path — see `tenancy/tenant-host.ts`.
88
+ */
89
+ readonly loopbackBaseUrl?: string;
90
+ /**
91
+ * The environment the deployment settings (repository, git credential,
92
+ * branch model, SSO, sync secret, …) resolve against before the stored
93
+ * layer. Unset, the process's own. A tenant host builds one per tenant
94
+ * from its record, so a variable set on the host process never reaches
95
+ * every tenant and a record's values behave as environment-pinned ones.
96
+ */
97
+ readonly settingsEnv?: NodeJS.ProcessEnv;
98
+ }
99
+ /**
100
+ * What the PROCESS is configured with, independent of how many knowledge
101
+ * bases it serves: where it listens, which proxy hops it trusts, and the
102
+ * environment name. A single-tenant deployment's {@link CoreConfig} is both
103
+ * this and its one tenant's {@link TenantConfig}.
104
+ */
105
+ export interface ProcessConfig {
106
+ readonly port: number;
107
+ readonly nodeEnv: string;
108
+ readonly trustProxy: string;
109
+ }
30
110
  /**
31
111
  * Configuration for the CORE platform: the git-backed workspace/workflow,
32
112
  * skills, tools, secrets vault, access control, and the MCP surface. Contains
@@ -34,9 +114,16 @@ export declare function withoutUserinfo(url: string): string;
34
114
  * `AppConfig` (config.ts), which extends this class. A core-only deployment
35
115
  * boots from exactly these env vars.
36
116
  */
37
- export declare class CoreConfig {
117
+ export declare class CoreConfig implements TenantConfig, ProcessConfig {
38
118
  readonly port: number;
39
119
  readonly databaseUrl: string;
120
+ /**
121
+ * The Postgres schema this deployment's tables live in (`DB_SCHEMA`,
122
+ * default `public`). Set it to host this knowledge base beside others in
123
+ * one database, each on a schema of its own; see
124
+ * `modules/database/connection.ts` for what that changes.
125
+ */
126
+ readonly dbSchema: string;
40
127
  readonly nodeEnv: string;
41
128
  /**
42
129
  * Tenant slug injected into every credential prefix so a deploy can brand its
@@ -125,6 +212,13 @@ export declare class CoreConfig {
125
212
  * credential-helper shell snippet.
126
213
  */
127
214
  readonly gitUsername: string;
215
+ /**
216
+ * The git token the environment supplied (`GIT_TOKEN`, or the legacy
217
+ * `GITHUB_TOKEN` / `GH_TOKEN`), or `''`. The setup screen's stored token is
218
+ * read through the settings service instead; the composition root folds
219
+ * the two into the runner's credentials, environment first.
220
+ */
221
+ readonly gitToken: string;
128
222
  /**
129
223
  * Filesystem path to the KB seed template (the `kb-template/` folder shipped
130
224
  * inside this package — see `defaultKbTemplateDir()`). The seeder reads this
@@ -1 +1 @@
1
- {"version":3,"file":"core-config.d.ts","sourceRoot":"","sources":["../src/core-config.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAU/E;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;GAMG;AACH,qBAAa,UAAU;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH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