@bevel-software/platform-core-backend 0.21.0 → 0.23.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.
- package/dist/core/core-ports.d.ts +11 -1
- package/dist/core/core-ports.d.ts.map +1 -1
- package/dist/core/core-ports.js.map +1 -1
- package/dist/core/create-core-server.d.ts +3 -3
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +62 -13
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +22 -3
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +158 -23
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +34 -1
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +89 -13
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core-config.d.ts +0 -12
- package/dist/core-config.d.ts.map +1 -1
- package/dist/core-config.js +11 -13
- package/dist/core-config.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/access/access-control.interface.d.ts +42 -12
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +67 -10
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +214 -35
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access-requests.contract.d.ts +75 -0
- package/dist/modules/access/access-requests.contract.d.ts.map +1 -0
- package/dist/modules/access/access-requests.contract.js +20 -0
- package/dist/modules/access/access-requests.contract.js.map +1 -0
- package/dist/modules/access/access-requests.routes.d.ts +35 -0
- package/dist/modules/access/access-requests.routes.d.ts.map +1 -0
- package/dist/modules/access/access-requests.routes.js +237 -0
- package/dist/modules/access/access-requests.routes.js.map +1 -0
- package/dist/modules/access/access-requests.service.d.ts +123 -0
- package/dist/modules/access/access-requests.service.d.ts.map +1 -0
- package/dist/modules/access/access-requests.service.js +337 -0
- package/dist/modules/access/access-requests.service.js.map +1 -0
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +13 -15
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access-model/access-grammar.d.ts +12 -0
- package/dist/modules/access-model/access-grammar.d.ts.map +1 -1
- package/dist/modules/access-model/access-grammar.js +24 -0
- package/dist/modules/access-model/access-grammar.js.map +1 -1
- package/dist/modules/auth/account-admission.d.ts +58 -7
- package/dist/modules/auth/account-admission.d.ts.map +1 -1
- package/dist/modules/auth/account-admission.js +44 -1
- package/dist/modules/auth/account-admission.js.map +1 -1
- package/dist/modules/auth/account.routes.d.ts +1 -1
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +61 -5
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.middleware.d.ts +1 -1
- package/dist/modules/auth/auth.middleware.d.ts.map +1 -1
- package/dist/modules/auth/auth.middleware.js +18 -7
- package/dist/modules/auth/auth.middleware.js.map +1 -1
- package/dist/modules/auth/auth.routes.d.ts.map +1 -1
- package/dist/modules/auth/auth.routes.js +8 -0
- package/dist/modules/auth/auth.routes.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +96 -3
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +187 -9
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/oidc-auth-provider.d.ts.map +1 -1
- package/dist/modules/auth/oidc-auth-provider.js +7 -2
- package/dist/modules/auth/oidc-auth-provider.js.map +1 -1
- package/dist/modules/database/core-schema.d.ts +41 -24
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +35 -27
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/github-app/github-app.client.d.ts +101 -0
- package/dist/modules/github-app/github-app.client.d.ts.map +1 -0
- package/dist/modules/github-app/github-app.client.js +222 -0
- package/dist/modules/github-app/github-app.client.js.map +1 -0
- package/dist/modules/github-app/github-app.connection.d.ts +102 -0
- package/dist/modules/github-app/github-app.connection.d.ts.map +1 -0
- package/dist/modules/github-app/github-app.connection.js +185 -0
- package/dist/modules/github-app/github-app.connection.js.map +1 -0
- package/dist/modules/github-app/github-app.routes.d.ts +59 -0
- package/dist/modules/github-app/github-app.routes.d.ts.map +1 -0
- package/dist/modules/github-app/github-app.routes.js +323 -0
- package/dist/modules/github-app/github-app.routes.js.map +1 -0
- package/dist/modules/github-app/index.d.ts +4 -0
- package/dist/modules/github-app/index.d.ts.map +1 -0
- package/dist/modules/github-app/index.js +4 -0
- package/dist/modules/github-app/index.js.map +1 -0
- package/dist/modules/kb-fs/branch-name.d.ts.map +1 -1
- package/dist/modules/kb-fs/branch-name.js +12 -2
- package/dist/modules/kb-fs/branch-name.js.map +1 -1
- package/dist/modules/kb-fs/remote-url.d.ts +22 -0
- package/dist/modules/kb-fs/remote-url.d.ts.map +1 -0
- package/dist/modules/kb-fs/remote-url.js +35 -0
- package/dist/modules/kb-fs/remote-url.js.map +1 -0
- package/dist/modules/kb-fs/repo-path.d.ts +11 -16
- package/dist/modules/kb-fs/repo-path.d.ts.map +1 -1
- package/dist/modules/kb-fs/repo-path.js +79 -0
- package/dist/modules/kb-fs/repo-path.js.map +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.d.ts +2 -2
- package/dist/modules/kb-sync/kb-sync.routes.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.js +14 -3
- package/dist/modules/kb-sync/kb-sync.routes.js.map +1 -1
- package/dist/modules/kb-sync/sync-auth.d.ts +3 -1
- package/dist/modules/kb-sync/sync-auth.d.ts.map +1 -1
- package/dist/modules/kb-sync/sync-auth.js +1 -1
- package/dist/modules/kb-sync/sync-auth.js.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.js +21 -6
- package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +3 -2
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
- package/dist/modules/plugins/join-proposals.d.ts +17 -5
- package/dist/modules/plugins/join-proposals.d.ts.map +1 -1
- package/dist/modules/plugins/join-proposals.js +76 -22
- package/dist/modules/plugins/join-proposals.js.map +1 -1
- package/dist/modules/plugins/join-requests.service.d.ts +111 -18
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +173 -29
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +3 -2
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.d.ts +22 -1
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +101 -7
- package/dist/modules/settings/deployment-settings.service.js.map +1 -1
- package/dist/modules/settings/managed-repository.d.ts +43 -0
- package/dist/modules/settings/managed-repository.d.ts.map +1 -0
- package/dist/modules/settings/managed-repository.js +60 -0
- package/dist/modules/settings/managed-repository.js.map +1 -0
- package/dist/modules/settings/repository-source.d.ts +128 -0
- package/dist/modules/settings/repository-source.d.ts.map +1 -0
- package/dist/modules/settings/repository-source.js +150 -0
- package/dist/modules/settings/repository-source.js.map +1 -0
- package/dist/modules/settings/setup.routes.d.ts +78 -4
- package/dist/modules/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +379 -17
- package/dist/modules/settings/setup.routes.js.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +6 -8
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +24 -63
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
- package/dist/modules/skills/skills.contract.d.ts +90 -18
- package/dist/modules/skills/skills.contract.d.ts.map +1 -1
- package/dist/modules/skills/skills.contract.js +4 -1
- package/dist/modules/skills/skills.contract.js.map +1 -1
- package/dist/modules/skills/skills.service.d.ts +98 -9
- package/dist/modules/skills/skills.service.d.ts.map +1 -1
- package/dist/modules/skills/skills.service.js +239 -37
- package/dist/modules/skills/skills.service.js.map +1 -1
- package/dist/modules/skills/skills.tools.d.ts +7 -0
- package/dist/modules/skills/skills.tools.d.ts.map +1 -1
- package/dist/modules/skills/skills.tools.js +71 -7
- package/dist/modules/skills/skills.tools.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js +4 -2
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
- package/dist/modules/tool-auth/internal-token.service.d.ts +3 -3
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts +16 -7
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.js +34 -12
- package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -1
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.js +15 -0
- package/dist/modules/tool-helpers/tool-context.js.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.d.ts +2 -1
- package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.js +25 -4
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.d.ts +3 -2
- package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.js.map +1 -1
- package/dist/modules/tool-helpers/validate-token.js +1 -1
- package/dist/modules/tool-helpers/validate-token.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +98 -0
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -0
- package/dist/modules/workflow/agent-tools/change-request-summary.js +81 -0
- package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -0
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +113 -37
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/file-lock.service.d.ts +24 -0
- package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
- package/dist/modules/workflow/file-lock.service.js +30 -0
- package/dist/modules/workflow/file-lock.service.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +72 -1
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +170 -6
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.d.ts.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.js +5 -0
- package/dist/modules/workflow/git/node-git-runner.js.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts +45 -0
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +99 -0
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
- package/dist/modules/workflow/pending-commits.service.d.ts +38 -0
- package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
- package/dist/modules/workflow/pending-commits.service.js +55 -0
- package/dist/modules/workflow/pending-commits.service.js.map +1 -1
- package/dist/modules/workflow/workflow-hooks.d.ts +54 -32
- package/dist/modules/workflow/workflow-hooks.d.ts.map +1 -1
- package/dist/modules/workflow/workflow-hooks.js +16 -1
- package/dist/modules/workflow/workflow-hooks.js.map +1 -1
- package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.routes.js +3 -1
- package/dist/modules/workflow/workflow.routes.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +94 -13
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +258 -51
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/agent-access.gate.d.ts +94 -0
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -0
- package/dist/modules/workspace/agent-access.gate.js +123 -0
- package/dist/modules/workspace/agent-access.gate.js.map +1 -0
- package/dist/modules/workspace/routine-write-policy.d.ts +5 -6
- package/dist/modules/workspace/routine-write-policy.d.ts.map +1 -1
- package/dist/modules/workspace/routine-write-policy.js +5 -6
- package/dist/modules/workspace/routine-write-policy.js.map +1 -1
- package/dist/modules/workspace/session-sink.d.ts +5 -5
- package/dist/modules/workspace/set-aside-clone.d.ts +46 -0
- package/dist/modules/workspace/set-aside-clone.d.ts.map +1 -0
- package/dist/modules/workspace/set-aside-clone.js +92 -0
- package/dist/modules/workspace/set-aside-clone.js.map +1 -0
- package/dist/modules/workspace/startup/kb-startup-runner.d.ts +117 -1
- package/dist/modules/workspace/startup/kb-startup-runner.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js +190 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +92 -3
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +115 -5
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +272 -26
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +2 -2
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +337 -117
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/modules/write-access/write-access.d.ts +60 -0
- package/dist/modules/write-access/write-access.d.ts.map +1 -0
- package/dist/modules/write-access/write-access.js +129 -0
- package/dist/modules/write-access/write-access.js.map +1 -0
- package/dist/shared/domain-errors.d.ts +64 -0
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +83 -0
- package/dist/shared/domain-errors.js.map +1 -1
- package/dist/shared/git.contract.d.ts +30 -0
- package/dist/shared/git.contract.d.ts.map +1 -1
- package/dist/shared/git.contract.js +26 -0
- package/dist/shared/git.contract.js.map +1 -1
- package/dist/tenancy/static-tenant-source.d.ts +0 -1
- package/dist/tenancy/static-tenant-source.d.ts.map +1 -1
- package/dist/tenancy/static-tenant-source.js +0 -2
- package/dist/tenancy/static-tenant-source.js.map +1 -1
- package/migrations/0014_change_request_closed_reason.sql +1 -0
- package/migrations/0015_account_deactivation.sql +3 -0
- package/migrations/meta/0014_snapshot.json +2265 -0
- package/migrations/meta/0015_snapshot.json +2271 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +3 -3
- package/src/__tests__/kb-layout-config.test.ts +0 -2
- package/src/__tests__/retired-settings.test.ts +96 -0
- package/src/core/__tests__/gated-boot.test.ts +132 -0
- package/src/core/__tests__/lifecycle.test.ts +170 -1
- package/src/core/__tests__/set-aside-root-is-one-place.test.ts +63 -0
- package/src/core/core-ports.ts +11 -1
- package/src/core/create-core-server.ts +69 -15
- package/src/core/create-core-services.ts +190 -27
- package/src/core/lifecycle.ts +98 -13
- package/src/core-config.ts +13 -14
- package/src/index.ts +12 -1
- package/src/modules/access/__tests__/access-control.preview-relocation.test.ts +385 -0
- package/src/modules/access/__tests__/access-control.prospective.test.ts +94 -18
- package/src/modules/access/__tests__/access-requests.recut.test.ts +134 -0
- package/src/modules/access/__tests__/access-requests.routes.test.ts +610 -0
- package/src/modules/access/__tests__/access.routes.prospective.test.ts +6 -7
- package/src/modules/access/access-control.interface.ts +43 -12
- package/src/modules/access/access-control.service.ts +234 -36
- package/src/modules/access/access-requests.contract.ts +93 -0
- package/src/modules/access/access-requests.routes.ts +286 -0
- package/src/modules/access/access-requests.service.ts +420 -0
- package/src/modules/access/access.routes.ts +13 -15
- package/src/modules/access-model/access-grammar.ts +22 -0
- package/src/modules/agent-instructions/__tests__/agent-instructions.route.test.ts +3 -1
- package/src/modules/auth/__tests__/account-deactivation.test.ts +252 -0
- package/src/modules/auth/__tests__/account.routes.test.ts +81 -3
- package/src/modules/auth/__tests__/auth.middleware.test.ts +45 -22
- package/src/modules/auth/__tests__/auth.service.test.ts +39 -1
- package/src/modules/auth/account-admission.ts +78 -9
- package/src/modules/auth/account.routes.ts +63 -7
- package/src/modules/auth/auth.middleware.ts +19 -8
- package/src/modules/auth/auth.routes.ts +8 -0
- package/src/modules/auth/auth.service.ts +207 -7
- package/src/modules/auth/oidc-auth-provider.ts +7 -2
- package/src/modules/database/core-schema.ts +35 -27
- package/src/modules/github-app/__tests__/github-app.test.ts +848 -0
- package/src/modules/github-app/github-app.client.ts +268 -0
- package/src/modules/github-app/github-app.connection.ts +204 -0
- package/src/modules/github-app/github-app.routes.ts +359 -0
- package/src/modules/github-app/index.ts +19 -0
- package/src/modules/kb-fs/__tests__/branch-name.test.ts +10 -0
- package/src/modules/kb-fs/__tests__/remote-url.test.ts +38 -0
- package/src/modules/kb-fs/__tests__/repo-path.test.ts +123 -0
- package/src/modules/kb-fs/branch-name.ts +14 -1
- package/src/modules/kb-fs/remote-url.ts +35 -0
- package/src/modules/kb-fs/repo-path.ts +85 -0
- package/src/modules/kb-sync/__tests__/kb-sync.routes.test.ts +26 -1
- package/src/modules/kb-sync/kb-sync.routes.ts +14 -4
- package/src/modules/kb-sync/sync-auth.ts +2 -2
- package/src/modules/mcp/__tests__/mcp-auth.middleware.test.ts +60 -3
- package/src/modules/mcp/__tests__/mcp.service.test.ts +68 -6
- package/src/modules/mcp/mcp-auth.middleware.ts +20 -6
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +3 -1
- package/src/modules/plugins/__tests__/join-proposals.test.ts +100 -19
- package/src/modules/plugins/__tests__/join-requests.service.test.ts +27 -11
- package/src/modules/plugins/__tests__/join-requests.settlement.test.ts +371 -0
- package/src/modules/plugins/__tests__/plugins.routes.test.ts +1 -1
- package/src/modules/plugins/__tests__/plugins.tools.test.ts +2 -1
- package/src/modules/plugins/join-proposals.ts +87 -19
- package/src/modules/plugins/join-requests.service.ts +199 -39
- package/src/modules/plugins/plugins.routes.ts +3 -2
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +16 -0
- package/src/modules/settings/__tests__/repository-source.test.ts +191 -0
- package/src/modules/settings/__tests__/setup.routes.git-mode.test.ts +386 -0
- package/src/modules/settings/__tests__/setup.routes.github-app.test.ts +299 -0
- package/src/modules/settings/__tests__/setup.routes.managed-phase.test.ts +236 -0
- package/src/modules/settings/__tests__/setup.routes.repository-change.test.ts +390 -0
- package/src/modules/settings/__tests__/setup.routes.test.ts +3 -0
- package/src/modules/settings/deployment-settings.service.ts +117 -6
- package/src/modules/settings/managed-repository.ts +68 -0
- package/src/modules/settings/repository-source.ts +197 -0
- package/src/modules/settings/setup.routes.ts +463 -15
- package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +2 -1
- package/src/modules/skills/__tests__/branch-skills.tools.test.ts +218 -0
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +5 -1
- package/src/modules/skills/__tests__/skills.service.test.ts +229 -5
- package/src/modules/skills/skill-access-requests.routes.ts +25 -75
- package/src/modules/skills/skills.contract.ts +91 -18
- package/src/modules/skills/skills.service.ts +278 -41
- package/src/modules/skills/skills.tools.ts +80 -8
- package/src/modules/tool-auth/__tests__/manual-auth.middleware.test.ts +14 -1
- package/src/modules/tool-auth/external-api-key.service.ts +4 -2
- package/src/modules/tool-auth/internal-token.service.ts +3 -3
- package/src/modules/tool-auth/tool-auth.middleware.ts +34 -11
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +5 -3
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/validate-token.test.ts +11 -1
- package/src/modules/tool-helpers/tool-context.ts +15 -0
- package/src/modules/tool-helpers/tool-handler.ts +24 -4
- package/src/modules/tool-helpers/tool.contract.ts +3 -2
- package/src/modules/tool-helpers/validate-token.ts +1 -1
- package/src/modules/workflow/__tests__/apply-failure.test.ts +9 -1
- package/src/modules/workflow/__tests__/pending-commits.repository-replaced.test.ts +111 -0
- package/src/modules/workflow/__tests__/workflow.routes.history-read-gate.test.ts +25 -0
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +159 -8
- package/src/modules/workflow/__tests__/workflow.service.repository-replaced.test.ts +249 -0
- package/src/modules/workflow/__tests__/workflow.service.update-from-target.test.ts +146 -40
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +405 -7
- package/src/modules/workflow/agent-tools/change-request-summary.ts +182 -0
- package/src/modules/workflow/agent-tools/workflow.tools.ts +135 -38
- package/src/modules/workflow/file-lock.service.ts +31 -0
- package/src/modules/workflow/git/__tests__/git.service.fileBytesAtCommit.test.ts +260 -0
- package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +121 -0
- package/src/modules/workflow/git/__tests__/pull-request.service.getPrDetail.test.ts +145 -2
- package/src/modules/workflow/git/__tests__/pull-request.service.viewer-can-delete.test.ts +166 -0
- package/src/modules/workflow/git/git.service.ts +193 -4
- package/src/modules/workflow/git/node-git-runner.ts +6 -0
- package/src/modules/workflow/git/pull-request.service.ts +119 -0
- package/src/modules/workflow/pending-commits.service.ts +59 -1
- package/src/modules/workflow/workflow-hooks.ts +64 -26
- package/src/modules/workflow/workflow.routes.ts +3 -1
- package/src/modules/workflow/workflow.service.ts +290 -55
- package/src/modules/workspace/__tests__/agent-access.gate.test.ts +208 -0
- package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +384 -0
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +2 -1
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +2 -1
- package/src/modules/workspace/__tests__/set-aside-clone.test.ts +52 -0
- package/src/modules/workspace/__tests__/workspace.routes.at-ref.test.ts +305 -0
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +2 -0
- package/src/modules/workspace/__tests__/workspace.service.forget-clone-races.test.ts +147 -0
- package/src/modules/workspace/__tests__/workspace.service.replaced-repository.test.ts +326 -0
- package/src/modules/workspace/__tests__/workspace.service.test.ts +20 -9
- package/src/modules/workspace/__tests__/workspace.service.unknown-branch.test.ts +43 -0
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +2 -3
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +235 -10
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +720 -17
- package/src/modules/workspace/agent-access.gate.ts +164 -0
- package/src/modules/workspace/routine-write-policy.ts +5 -6
- package/src/modules/workspace/session-sink.ts +5 -5
- package/src/modules/workspace/set-aside-clone.ts +96 -0
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.test.ts +297 -0
- package/src/modules/workspace/startup/kb-startup-runner.ts +242 -2
- package/src/modules/workspace/workspace.routes.ts +95 -3
- package/src/modules/workspace/workspace.service.ts +273 -25
- package/src/modules/workspace/workspace.tools.ts +373 -119
- package/src/modules/write-access/__tests__/write-access.test.ts +248 -0
- package/src/modules/write-access/write-access.ts +153 -0
- package/src/shared/domain-errors.ts +89 -0
- package/src/shared/git.contract.ts +37 -0
- package/src/tenancy/__tests__/static-tenant-source.test.ts +0 -1
- package/src/tenancy/static-tenant-source.ts +0 -3
- package/dist/modules/workflow/session-ontology.policy.d.ts +0 -52
- package/dist/modules/workflow/session-ontology.policy.d.ts.map +0 -1
- package/dist/modules/workflow/session-ontology.policy.js +0 -62
- package/dist/modules/workflow/session-ontology.policy.js.map +0 -1
- package/dist/modules/workflow/session-ontology.service.d.ts +0 -105
- package/dist/modules/workflow/session-ontology.service.d.ts.map +0 -1
- package/dist/modules/workflow/session-ontology.service.js +0 -147
- package/dist/modules/workflow/session-ontology.service.js.map +0 -1
- package/dist/modules/workspace/session-ontology.gate.d.ts +0 -114
- package/dist/modules/workspace/session-ontology.gate.d.ts.map +0 -1
- package/dist/modules/workspace/session-ontology.gate.js +0 -161
- package/dist/modules/workspace/session-ontology.gate.js.map +0 -1
- package/dist/shared/kb-layout.d.ts +0 -39
- package/dist/shared/kb-layout.d.ts.map +0 -1
- package/dist/shared/kb-layout.js +0 -103
- package/dist/shared/kb-layout.js.map +0 -1
- package/dist/shared/kb-layout.test.d.ts +0 -2
- package/dist/shared/kb-layout.test.d.ts.map +0 -1
- package/dist/shared/kb-layout.test.js +0 -75
- package/dist/shared/kb-layout.test.js.map +0 -1
- package/src/modules/workflow/__tests__/session-ontology.policy.test.ts +0 -62
- package/src/modules/workflow/__tests__/session-ontology.service.test.ts +0 -201
- package/src/modules/workflow/session-ontology.policy.ts +0 -70
- package/src/modules/workflow/session-ontology.service.ts +0 -183
- package/src/modules/workspace/__tests__/session-ontology.gate.test.ts +0 -239
- package/src/modules/workspace/session-ontology.gate.ts +0 -191
- package/src/shared/kb-layout.test.ts +0 -98
- package/src/shared/kb-layout.ts +0 -102
|
@@ -8,6 +8,9 @@ import { isDefaultKbLayout, validateBranchModel, validateKbLayout, } from '@beve
|
|
|
8
8
|
import { failureOf } from '../../shared/git-failure.js';
|
|
9
9
|
import { redactSecret, urlQuerySecrets } from '../../shared/redact-secret.js';
|
|
10
10
|
import { listRootFolders, pickListingBranch } from './git-root-folders.js';
|
|
11
|
+
import { sameRepository } from '../kb-fs/remote-url.js';
|
|
12
|
+
import { MANAGED_DEFAULT_BRANCH } from './managed-repository.js';
|
|
13
|
+
import { GIT_MODES } from './repository-source.js';
|
|
11
14
|
import '../auth/auth.middleware.js'; // Express Request augmentation
|
|
12
15
|
/** Which name a host expects beside the token when none is configured. */
|
|
13
16
|
const DEFAULT_GIT_USERNAME = 'x-access-token';
|
|
@@ -79,8 +82,24 @@ oidcRedirectUri = '',
|
|
|
79
82
|
/** The single sign-on check. Injected so route tests can answer for the provider. */
|
|
80
83
|
checkOidc = checkOidcConfiguration,
|
|
81
84
|
/** The issuer-only half, for a test with no application id or secret yet. */
|
|
82
|
-
checkIssuer = (url) => checkOidcIssuer(url)
|
|
85
|
+
checkIssuer = (url) => checkOidcIssuer(url),
|
|
86
|
+
/**
|
|
87
|
+
* The ways a deployment can be given its repository. Absent, there is the
|
|
88
|
+
* one there always was: an address and a token, read from the settings.
|
|
89
|
+
*/
|
|
90
|
+
repository,
|
|
91
|
+
/**
|
|
92
|
+
* What a change of the knowledge-base repository has to decide about, and
|
|
93
|
+
* what to do when the admin decides to close.
|
|
94
|
+
*
|
|
95
|
+
* Injected because the setup routes must stay free of the workflow module —
|
|
96
|
+
* and a minimal mount (tests, a distribution without change requests) simply
|
|
97
|
+
* has none: the default answers "no open requests", so the confirmation
|
|
98
|
+
* offers no choice it cannot honour.
|
|
99
|
+
*/
|
|
100
|
+
changeRequests = { async countOpen() { return 0; }, async closeAsRepositoryReplaced() { return 0; } }) {
|
|
83
101
|
const router = express.Router();
|
|
102
|
+
const source = repository?.source;
|
|
84
103
|
/**
|
|
85
104
|
* Why the last setup-time run of the KB startup phase FAILED, or null. While
|
|
86
105
|
* set the deployment stays GATED: the settings are saved but the KB was
|
|
@@ -124,7 +143,28 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
124
143
|
return kbStartupRunner.lastFailureKind?.() ?? failureOf(message);
|
|
125
144
|
};
|
|
126
145
|
/** The app-gate answer: settings complete AND the KB phase settled clean, whoever ran it. */
|
|
127
|
-
const kbReady = () => isComplete(settings, kb) && kbInit === null && kbInitInFlight === null && bootFailure() === null;
|
|
146
|
+
const kbReady = () => isComplete(settings, kb, source) && kbInit === null && kbInitInFlight === null && bootFailure() === null;
|
|
147
|
+
/**
|
|
148
|
+
* Which ways of having a repository this deployment offers and which one
|
|
149
|
+
* it is on, for the setup screen. `mode` is the one IN EFFECT, inferred
|
|
150
|
+
* for a deployment that never chose; `chosen` is the one the settings
|
|
151
|
+
* say, which differs from it between a move and the restart the move
|
|
152
|
+
* owes. The screen opens on what was chosen, says a restart is pending
|
|
153
|
+
* when the two differ, and offers the first of `modes` to a deployment
|
|
154
|
+
* that has none. `pinned` names the variable that chose for the
|
|
155
|
+
* deployment, when one did. Nothing at all from a mount without the
|
|
156
|
+
* choice, which the screen reads as the one way there was.
|
|
157
|
+
*/
|
|
158
|
+
const repositoryStatus = () => source
|
|
159
|
+
? {
|
|
160
|
+
repository: {
|
|
161
|
+
mode: source.mode(),
|
|
162
|
+
chosen: source.chosen(),
|
|
163
|
+
...(settings.sourceOf('gitMode') === 'env' ? { pinned: 'GIT_MODE' } : {}),
|
|
164
|
+
modes: GIT_MODES.filter((mode) => mode !== 'github-app' || repository?.githubApp !== undefined),
|
|
165
|
+
},
|
|
166
|
+
}
|
|
167
|
+
: {};
|
|
128
168
|
const requireAdmin = async (req, res, next) => {
|
|
129
169
|
if (!(await adminAccess.isAdmin(req.userEmail))) {
|
|
130
170
|
res.status(403).json({ error: 'Admins only' });
|
|
@@ -157,9 +197,10 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
157
197
|
}
|
|
158
198
|
res.json({
|
|
159
199
|
complete: kbReady(),
|
|
160
|
-
awaitingRestart: awaitingRestart(settings, kb),
|
|
200
|
+
awaitingRestart: awaitingRestart(settings, kb, source),
|
|
161
201
|
isAdmin: true,
|
|
162
202
|
settings: settings.describe(),
|
|
203
|
+
...repositoryStatus(),
|
|
163
204
|
oidcVerification: await settings.oidcVerification(),
|
|
164
205
|
...(kbInit ? { kbInit } : bootFailure() !== null ? { kbInit: bootFailureKind() } : {}),
|
|
165
206
|
...(sync ? { sync: { url: sync.url, last: sync.lastSync() } } : {}),
|
|
@@ -187,6 +228,8 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
187
228
|
});
|
|
188
229
|
async function handleSave(req, res) {
|
|
189
230
|
const body = (req.body ?? {});
|
|
231
|
+
/** Lets the commit worker go again, once a move has held it. */
|
|
232
|
+
let releaseCommits;
|
|
190
233
|
const entries = {};
|
|
191
234
|
for (const [key, value] of Object.entries(body.settings ?? {})) {
|
|
192
235
|
if (typeof value !== 'string') {
|
|
@@ -200,9 +243,37 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
200
243
|
// save that flips it false→true — whichever field arrives last — is the
|
|
201
244
|
// one that must run the KB startup phase, regardless of which save
|
|
202
245
|
// configured the branch model.
|
|
203
|
-
const wasComplete = isComplete(settings, kb);
|
|
246
|
+
const wasComplete = isComplete(settings, kb, source);
|
|
247
|
+
// A different question, asked of the GATE: whether anyone is being
|
|
248
|
+
// served. Settings that are answered are not a deployment that works
|
|
249
|
+
// — one whose first clone failed has answered everything and serves
|
|
250
|
+
// nobody.
|
|
251
|
+
const wasServing = kbReady();
|
|
252
|
+
nameBranchesOfManagedRepository(entries);
|
|
204
253
|
if (!(await connectionHoldsFor(entries, wasComplete, res)))
|
|
205
254
|
return;
|
|
255
|
+
// AFTER the connection check, BEFORE anything is stored. After, because
|
|
256
|
+
// an address the host will not answer for is refused on its own terms
|
|
257
|
+
// and there is then nothing to confirm — nobody should have to agree to
|
|
258
|
+
// losing their working copies only to be told the token was missing.
|
|
259
|
+
// Before, because a refused save must destroy nothing: the check only
|
|
260
|
+
// reads the new address and dry-runs a push to it.
|
|
261
|
+
// Asked only of a deployment that has SERVED on the repository it would
|
|
262
|
+
// leave. A first run whose initialisation failed has answered
|
|
263
|
+
// everything and served nobody: correcting its address is finishing
|
|
264
|
+
// setup, and a question about leaving a repository nobody ever worked
|
|
265
|
+
// on would be a question with nothing behind it.
|
|
266
|
+
const hasServed = wasComplete && kbInit === null;
|
|
267
|
+
const repositoryChange = await repositoryChangeFor(entries, body.confirmRepositoryChange, body.seenOpenChangeRequests, hasServed, res);
|
|
268
|
+
if (!repositoryChange)
|
|
269
|
+
return;
|
|
270
|
+
// HELD FROM HERE, before anything is stored. The way chosen takes
|
|
271
|
+
// effect a few lines down, and with it the credential git is handed; a
|
|
272
|
+
// commit worker still running in between would push a queued commit
|
|
273
|
+
// from a working copy of the repository being left, with the
|
|
274
|
+
// credential of the one moved to. Let go in the `finally` below.
|
|
275
|
+
if (repositoryChange.changing)
|
|
276
|
+
releaseCommits = await holdCommits();
|
|
206
277
|
const oidc = await signInHoldsFor(entries, res);
|
|
207
278
|
if (!oidc)
|
|
208
279
|
return;
|
|
@@ -214,7 +285,76 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
214
285
|
if (oidc.record) {
|
|
215
286
|
await settings.recordOidcVerification(oidc.record.state, oidc.record.credentials);
|
|
216
287
|
}
|
|
217
|
-
|
|
288
|
+
/**
|
|
289
|
+
* How many open change requests this save closed as "repository
|
|
290
|
+
* replaced". Nothing is ever deleted; `keep` leaves them exactly as they
|
|
291
|
+
* are, and answers 0.
|
|
292
|
+
*
|
|
293
|
+
* Closed BEFORE the address is stored, as a PRECONDITION of the save. A
|
|
294
|
+
* close that fails after the address is stored has nowhere to go: the
|
|
295
|
+
* address now matches, so the next save sees no change, asks nothing and
|
|
296
|
+
* never retries — leaving requests open on branches the new repository
|
|
297
|
+
* does not have, and their file locks refusing paths to everybody else,
|
|
298
|
+
* with no way for the admin to put it right. Refusing the save instead
|
|
299
|
+
* destroys nothing: the old address still stands, the working copies are
|
|
300
|
+
* untouched (the phase below never ran), and pressing Save again asks the
|
|
301
|
+
* same question and tries again.
|
|
302
|
+
*
|
|
303
|
+
* The other order of failure — closed, then the save itself fails — is
|
|
304
|
+
* recoverable by the admin, who wanted these requests closed and whose
|
|
305
|
+
* next Save completes the replacement. Closing deletes nothing either
|
|
306
|
+
* way.
|
|
307
|
+
*/
|
|
308
|
+
let closedChangeRequests = 0;
|
|
309
|
+
if (repositoryChange.choice === 'close') {
|
|
310
|
+
try {
|
|
311
|
+
closedChangeRequests = await changeRequests.closeAsRepositoryReplaced();
|
|
312
|
+
}
|
|
313
|
+
catch (err) {
|
|
314
|
+
log.error('the open change requests could not be closed, so the repository was not replaced:', { err });
|
|
315
|
+
res.status(500).json({
|
|
316
|
+
error: 'The open change requests could not be closed, so the repository was not changed. ' +
|
|
317
|
+
'Nothing was saved and no working copy was touched. Try again.',
|
|
318
|
+
});
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
const saved = await settings.save(entries, req.userId ?? null);
|
|
323
|
+
/**
|
|
324
|
+
* THE WAY CHOSEN TAKES EFFECT ON THIS SAVE, in the two cases where the
|
|
325
|
+
* startup phase below runs for it.
|
|
326
|
+
*
|
|
327
|
+
* A deployment that was not serving has nothing on the mode it had: a
|
|
328
|
+
* first run, one whose initialisation failed, a boot that found its
|
|
329
|
+
* repository unreachable. Pinned there, the way out of a repository
|
|
330
|
+
* that does not work would be closed.
|
|
331
|
+
*
|
|
332
|
+
* And a deployment that WAS serving, when its admin has just confirmed
|
|
333
|
+
* the move. The mode in effect was once held until the next restart, so
|
|
334
|
+
* that the running process never presented one way's credential to
|
|
335
|
+
* another way's repository. That reason is answered differently now:
|
|
336
|
+
* the phase below sets the working copies of the repository that was
|
|
337
|
+
* left aside, under a held commit worker, before anything uses the new
|
|
338
|
+
* credential. And an admin of a hosted workspace has no restart to
|
|
339
|
+
* give, so a move that waited for one never happened.
|
|
340
|
+
*
|
|
341
|
+
* What is left pinned is a save that changes the mode WITHOUT moving
|
|
342
|
+
* the repository, which no path produces today; it keeps the restart.
|
|
343
|
+
*/
|
|
344
|
+
if (source && (!wasServing || repositoryChange.changing))
|
|
345
|
+
source.takeEffect();
|
|
346
|
+
/**
|
|
347
|
+
* The restart the mode owes is read off the two modes themselves, not
|
|
348
|
+
* off what this save wrote: it is owed for as long as the mode chosen
|
|
349
|
+
* is not the one in effect, whichever save chose it, and no longer
|
|
350
|
+
* once a save chooses the mode in effect back.
|
|
351
|
+
*/
|
|
352
|
+
const modePending = source !== undefined && source.chosen() !== source.mode();
|
|
353
|
+
const restartKeys = [
|
|
354
|
+
...saved.restartKeys.filter((key) => key !== 'gitMode'),
|
|
355
|
+
...(modePending ? ['gitMode'] : []),
|
|
356
|
+
];
|
|
357
|
+
const restartRequired = restartKeys.length > 0;
|
|
218
358
|
/** Whether this save put the stored folder names into the running process. */
|
|
219
359
|
let layoutApplied = false;
|
|
220
360
|
/** Whether this save put the stored branch model into the running process. */
|
|
@@ -253,11 +393,25 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
253
393
|
* Runs on the false→true completion transition — including when the
|
|
254
394
|
* branch model was configured by an EARLIER save and the repository
|
|
255
395
|
* URL arrives on a later one — and again on any save while a previous
|
|
256
|
-
* setup-time run stands failed (`kbInit`), so a save is the retry.
|
|
257
|
-
*
|
|
258
|
-
*
|
|
396
|
+
* setup-time run stands failed (`kbInit`), so a save is the retry.
|
|
397
|
+
*
|
|
398
|
+
* AND on a save that MOVES THE REPOSITORY, complete and healthy or
|
|
399
|
+
* not. That one is not a quiet moment — the gate is open and sessions
|
|
400
|
+
* may be live — but it is the moment the working copies stop belonging
|
|
401
|
+
* to the configured repository, and leaving them until the next restart
|
|
402
|
+
* is what made Save and Retry fail against a repository that was gone.
|
|
403
|
+
* The admin has just confirmed the move, so the phase runs, with the
|
|
404
|
+
* commit worker held for as long as it does, and the app opens on the
|
|
405
|
+
* new repository's content.
|
|
406
|
+
*
|
|
407
|
+
* Never on an ordinary re-save of a complete, healthy setup: with the
|
|
408
|
+
* gate open, sessions may be live and nothing needs doing.
|
|
259
409
|
*/
|
|
260
|
-
if ((!wasComplete ||
|
|
410
|
+
if ((!wasComplete ||
|
|
411
|
+
kbInit !== null ||
|
|
412
|
+
bootFailure() !== null ||
|
|
413
|
+
repositoryChange.changing) &&
|
|
414
|
+
isComplete(settings, kb, source)) {
|
|
261
415
|
/**
|
|
262
416
|
* The folder names, applied BEFORE the phase for the same reason as
|
|
263
417
|
* the branch model above: they are otherwise applied once at boot, so
|
|
@@ -280,6 +434,9 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
280
434
|
// One run at a time. The save chain already serializes handlers
|
|
281
435
|
// whole, so no second run can start while one executes; the `??=`
|
|
282
436
|
// is defense in depth should another invoker ever appear.
|
|
437
|
+
// A move runs with the commit worker held (see `holdCommits`
|
|
438
|
+
// above): nothing queued is written while working copies are set
|
|
439
|
+
// aside and cloned again.
|
|
283
440
|
kbInitInFlight ??= kbStartupRunner.runAll();
|
|
284
441
|
await kbInitInFlight;
|
|
285
442
|
// Under KB_SAFE_BOOT a run that abandoned the phase still resolves
|
|
@@ -298,6 +455,7 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
298
455
|
const raw = initErr instanceof Error ? initErr.message : String(initErr);
|
|
299
456
|
const msg = redactSecret(raw, [
|
|
300
457
|
settings.resolve('gitToken'),
|
|
458
|
+
source?.credentials.token() ?? '',
|
|
301
459
|
...urlQuerySecrets(settings.resolve('kbRepoUrl')),
|
|
302
460
|
]);
|
|
303
461
|
log.error(`KB initialization failed after setup completed: ${msg}`);
|
|
@@ -321,9 +479,15 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
321
479
|
!(branchModelApplied && BRANCH_KEYS.includes(key)))
|
|
322
480
|
: restartRequired,
|
|
323
481
|
complete: kbReady(),
|
|
324
|
-
awaitingRestart: awaitingRestart(settings, kb),
|
|
482
|
+
awaitingRestart: awaitingRestart(settings, kb, source),
|
|
325
483
|
settings: settings.describe(),
|
|
484
|
+
...repositoryStatus(),
|
|
326
485
|
oidcVerification: await settings.oidcVerification(),
|
|
486
|
+
// Only on the save that changed the repository, so an ordinary save
|
|
487
|
+
// carries no word about change requests at all.
|
|
488
|
+
...(repositoryChange.changing
|
|
489
|
+
? { repositoryChange: { choice: repositoryChange.choice, closedChangeRequests } }
|
|
490
|
+
: {}),
|
|
327
491
|
});
|
|
328
492
|
}
|
|
329
493
|
catch (err) {
|
|
@@ -336,6 +500,180 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
336
500
|
log.error('save failed:', { err });
|
|
337
501
|
res.status(500).json({ error: 'Could not save these settings.' });
|
|
338
502
|
}
|
|
503
|
+
finally {
|
|
504
|
+
releaseCommits?.();
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Stop the commit worker until the function this resolves to is called.
|
|
509
|
+
* The hold the composition root offers runs a piece of work with the
|
|
510
|
+
* worker stopped; a move spans the store, the way taking effect and the
|
|
511
|
+
* startup phase, with refusals in between, so the hold is taken here and
|
|
512
|
+
* let go in the handler's `finally`. A mount without a worker holds
|
|
513
|
+
* nothing.
|
|
514
|
+
*/
|
|
515
|
+
function holdCommits() {
|
|
516
|
+
if (!changeRequests.whileCommitsHeld)
|
|
517
|
+
return Promise.resolve(() => { });
|
|
518
|
+
return new Promise((held, failed) => {
|
|
519
|
+
changeRequests.whileCommitsHeld(() => new Promise((release) => held(release))).catch(failed);
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* What this save does to the knowledge-base repository, and whether the
|
|
524
|
+
* admin has said yes to it.
|
|
525
|
+
*
|
|
526
|
+
* A MOVE IS ANY SAVE AFTER WHICH THE DEPLOYMENT READS ANOTHER REPOSITORY
|
|
527
|
+
* than the one it is running on, however it came about: another address,
|
|
528
|
+
* another way of having the repository (managed, GitHub, address and
|
|
529
|
+
* token), another repository on GitHub. So the question is asked of the
|
|
530
|
+
* one thing that knows where the repository is under every way — the
|
|
531
|
+
* repository source — comparing the address IN EFFECT with the one this
|
|
532
|
+
* save would choose. A mount without a source has the one way there
|
|
533
|
+
* always was, and the address is the setting.
|
|
534
|
+
*
|
|
535
|
+
* A move takes the working copies of the repository that is left out of
|
|
536
|
+
* use: one whose history the new repository holds is pointed at it and
|
|
537
|
+
* kept, any other is set aside and cloned fresh. Work that was never
|
|
538
|
+
* pushed leaves the app with a copy that is set aside. That is not
|
|
539
|
+
* something to discover afterwards, so the save is REFUSED (409) until the
|
|
540
|
+
* answer comes back with the admin's decision.
|
|
541
|
+
*
|
|
542
|
+
* Only a real move asks: an address that differs from the one in effect in
|
|
543
|
+
* nothing but its spelling — a trailing slash, a `.git` suffix, the case
|
|
544
|
+
* of the host — is the same repository (see `kb-fs/remote-url.ts`), and so
|
|
545
|
+
* is a first-run save, where no repository is in effect and nothing on
|
|
546
|
+
* disk could be left.
|
|
547
|
+
*
|
|
548
|
+
* Returns null when it has already answered the request.
|
|
549
|
+
*/
|
|
550
|
+
async function repositoryChangeFor(entries, confirmation,
|
|
551
|
+
/** How many open change requests the screen showed when the answer was given, when it says. */
|
|
552
|
+
seenOpenChangeRequests,
|
|
553
|
+
/** Whether the deployment is serving on the repository in effect. One that never served and has no open request is not asked. */
|
|
554
|
+
hasServed, res) {
|
|
555
|
+
const unchanged = { changing: false, choice: null };
|
|
556
|
+
const after = settings.resolveAfter(entries);
|
|
557
|
+
const now = (source ? source.url() : settings.resolve('kbRepoUrl')).trim();
|
|
558
|
+
const next = (source ? source.url(after) : after('kbRepoUrl')).trim();
|
|
559
|
+
if (now === '' || next === '' || sameRepository(now, next))
|
|
560
|
+
return unchanged;
|
|
561
|
+
// The count is what the choice is ABOUT, so it is read here rather than
|
|
562
|
+
// left for the screen to ask for separately: the two questions would
|
|
563
|
+
// otherwise be answered a round trip apart, and the number on screen
|
|
564
|
+
// would be the one from before whatever happened in between.
|
|
565
|
+
const openChangeRequests = await changeRequests.countOpen();
|
|
566
|
+
// An answer stands for the count it was given about. A request opened
|
|
567
|
+
// while the question stood was never offered "close", and the "keep" the
|
|
568
|
+
// screen sends when there is nothing to choose would decide it unasked:
|
|
569
|
+
// the question is put again, with the count as it is now.
|
|
570
|
+
const answered = confirmation === 'keep' || confirmation === 'close';
|
|
571
|
+
const answerIsCurrent = typeof seenOpenChangeRequests !== 'number' || seenOpenChangeRequests === openChangeRequests;
|
|
572
|
+
if (answered && answerIsCurrent)
|
|
573
|
+
return { changing: true, choice: confirmation };
|
|
574
|
+
// A move all the same, and the phase treats it as one; nobody is asked.
|
|
575
|
+
// Open change requests are themselves proof that the deployment served,
|
|
576
|
+
// whatever `hasServed` says: a move that failed part-way leaves it gated
|
|
577
|
+
// with a failure standing, and the next save must still ask about them.
|
|
578
|
+
if (!answered && !hasServed && openChangeRequests === 0)
|
|
579
|
+
return { changing: true, choice: null };
|
|
580
|
+
res.status(409).json({
|
|
581
|
+
error: 'This moves the deployment to another repository.',
|
|
582
|
+
repositoryChange: {
|
|
583
|
+
openChangeRequests,
|
|
584
|
+
// The way left and the way moved to, for the screen to name them.
|
|
585
|
+
// Equal when the move is within one way (another address, another
|
|
586
|
+
// repository on GitHub); absent from a mount with one way only.
|
|
587
|
+
...(source ? { from: source.mode(), to: source.mode(after) } : {}),
|
|
588
|
+
},
|
|
589
|
+
});
|
|
590
|
+
return null;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* A repository the deployment keeps for itself is new, and empty, and has
|
|
594
|
+
* no branches for anyone to look up: the branch model is ours to name. It
|
|
595
|
+
* is named only when nobody has — an admin's own answer, or one the
|
|
596
|
+
* environment supplies, stands. Every other mode has a repository that
|
|
597
|
+
* already exists, whose branches are asked for, never guessed.
|
|
598
|
+
*/
|
|
599
|
+
function nameBranchesOfManagedRepository(entries) {
|
|
600
|
+
if (!source)
|
|
601
|
+
return;
|
|
602
|
+
const after = settings.resolveAfter(entries);
|
|
603
|
+
if (source.mode(after) !== 'managed')
|
|
604
|
+
return;
|
|
605
|
+
if (after('defaultBranch') || after('protectedBranches'))
|
|
606
|
+
return;
|
|
607
|
+
entries.defaultBranch = MANAGED_DEFAULT_BRANCH;
|
|
608
|
+
entries.protectedBranches = MANAGED_DEFAULT_BRANCH;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* The same rule for a repository reached through a GitHub App: a saved
|
|
612
|
+
* connection is one GitHub has accepted for reading and writing, asked
|
|
613
|
+
* with the token git will present, which is the installation's.
|
|
614
|
+
*
|
|
615
|
+
* That token is also what keeps the repository's NAME honest. It is the
|
|
616
|
+
* one part of this connection an admin types, and a name the installation
|
|
617
|
+
* does not reach is refused here by GitHub, not by a list of ours.
|
|
618
|
+
*
|
|
619
|
+
* The repository has just said what it calls its trunk, so a deployment
|
|
620
|
+
* with no branch model is given that one: the same answer the setup
|
|
621
|
+
* screen fills in for a repository reached by its address.
|
|
622
|
+
*/
|
|
623
|
+
async function githubConnectionHoldsFor(setup, entries, after, wasComplete, res) {
|
|
624
|
+
const refuse = (problem, field = 'githubRepository') => {
|
|
625
|
+
res.status(400).json({ error: problem, problems: { [field]: problem } });
|
|
626
|
+
return false;
|
|
627
|
+
};
|
|
628
|
+
const app = setup.githubApp;
|
|
629
|
+
if (!app)
|
|
630
|
+
return refuse('This deployment cannot connect to GitHub through a GitHub App.', 'gitMode');
|
|
631
|
+
if (!app.answered(after)) {
|
|
632
|
+
return refuse(after('githubRepository')
|
|
633
|
+
? 'Connect GitHub before choosing a repository.'
|
|
634
|
+
: 'Choose the repository the knowledge base lives in.');
|
|
635
|
+
}
|
|
636
|
+
const url = app.url(after);
|
|
637
|
+
const unanswered = validateBranchModel({ defaultBranch: after('defaultBranch'), protectedBranches: after('protectedBranches') }) !== null;
|
|
638
|
+
// Against what is CHOSEN now, not what is in effect: a repository that
|
|
639
|
+
// was proven by the save that chose it is not proven again by the next.
|
|
640
|
+
const stored = (key) => settings.resolve(key);
|
|
641
|
+
const changes = setup.source.chosen() !== 'github-app' || url !== setup.source.url(stored);
|
|
642
|
+
if (!changes && (wasComplete || unanswered))
|
|
643
|
+
return true;
|
|
644
|
+
// BEFORE GitHub is asked anything with the installation token: that
|
|
645
|
+
// token reaches every repository the installation covers, and would
|
|
646
|
+
// answer for one the person connecting it could never have written to.
|
|
647
|
+
if (!app.permits(after('githubRepository'), after)) {
|
|
648
|
+
log.warn('a repository was named that the person who connected GitHub could not push to');
|
|
649
|
+
return refuse('Choose a repository your own GitHub account can write to. If this one should be, press “Refresh the list” so it is brought up to date.');
|
|
650
|
+
}
|
|
651
|
+
try {
|
|
652
|
+
await app.prepare({ asked: true });
|
|
653
|
+
}
|
|
654
|
+
catch (err) {
|
|
655
|
+
log.error('GitHub gave no token for the installation:', { detail: err instanceof Error ? err.message : String(err) });
|
|
656
|
+
}
|
|
657
|
+
const token = app.token();
|
|
658
|
+
if (!token) {
|
|
659
|
+
return refuse('GitHub gave this deployment no access. The app may have been uninstalled: connect it again.', 'gitMode');
|
|
660
|
+
}
|
|
661
|
+
const check = await checkConnection({ url, token, username: DEFAULT_GIT_USERNAME });
|
|
662
|
+
if (check.outcome !== 'connected') {
|
|
663
|
+
return refuse(check.outcome === 'read-only'
|
|
664
|
+
? 'The GitHub App can read that repository but not write to it. Grant it write access to the repository’s contents.'
|
|
665
|
+
: check.reason === 'unreachable'
|
|
666
|
+
? 'GitHub could not be reached. Try again shortly.'
|
|
667
|
+
: 'The GitHub App cannot reach that repository. Add the repository to the app’s installation on GitHub.');
|
|
668
|
+
}
|
|
669
|
+
if (!after('defaultBranch') && !after('protectedBranches')) {
|
|
670
|
+
const trunk = check.defaultBranch || check.branches[0] || (check.empty ? MANAGED_DEFAULT_BRANCH : '');
|
|
671
|
+
if (trunk) {
|
|
672
|
+
entries.defaultBranch = trunk;
|
|
673
|
+
entries.protectedBranches = trunk;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return true;
|
|
339
677
|
}
|
|
340
678
|
/**
|
|
341
679
|
* A SAVED CONNECTION IS ONE THE HOST HAS ACCEPTED FOR READING AND WRITING.
|
|
@@ -358,6 +696,25 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
358
696
|
*/
|
|
359
697
|
async function connectionHoldsFor(entries, wasComplete, res) {
|
|
360
698
|
const after = settings.resolveAfter(entries);
|
|
699
|
+
if (repository && repository.source.mode(after) === 'managed') {
|
|
700
|
+
// Nothing to prove to a host: the repository is the deployment's own.
|
|
701
|
+
// What has to hold is that it EXISTS before the save that points
|
|
702
|
+
// everything at it, so a disk that cannot take it refuses the choice
|
|
703
|
+
// instead of failing the first clone.
|
|
704
|
+
try {
|
|
705
|
+
await repository.ensureManaged(after('defaultBranch') || MANAGED_DEFAULT_BRANCH);
|
|
706
|
+
return true;
|
|
707
|
+
}
|
|
708
|
+
catch (err) {
|
|
709
|
+
log.error('the managed repository could not be created:', { err });
|
|
710
|
+
const problem = 'The repository could not be created on this deployment’s storage. Check that its backups folder is writable, or connect a repository of your own.';
|
|
711
|
+
res.status(400).json({ error: problem, problems: { gitMode: problem } });
|
|
712
|
+
return false;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
if (repository && repository.source.mode(after) === 'github-app') {
|
|
716
|
+
return githubConnectionHoldsFor(repository, entries, after, wasComplete, res);
|
|
717
|
+
}
|
|
361
718
|
const now = {
|
|
362
719
|
url: settings.resolve('kbRepoUrl'),
|
|
363
720
|
token: settings.resolve('gitToken'),
|
|
@@ -381,7 +738,10 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
381
738
|
// the environment, whose field the form cannot even edit) is that token's
|
|
382
739
|
// first and only pairing, not a change of it.
|
|
383
740
|
const tokenSupplied = Boolean(entries.gitToken?.trim());
|
|
384
|
-
|
|
741
|
+
// A different SPELLING of the configured address is the same repository,
|
|
742
|
+
// so the stored token is still the token it was saved for: asking for it
|
|
743
|
+
// again over a trailing slash would be a question with no answer.
|
|
744
|
+
if (now.url && !sameRepository(next.url, now.url) && next.token && !tokenSupplied) {
|
|
385
745
|
return settings.sourceOf('gitToken') === 'env'
|
|
386
746
|
? refuse({
|
|
387
747
|
kbRepoUrl: 'The access token is set by the GIT_TOKEN environment variable and is only used with the repository it was set for — change both there.',
|
|
@@ -670,8 +1030,10 @@ checkIssuer = (url) => checkOidcIssuer(url)) {
|
|
|
670
1030
|
* deployment signs in perfectly well without it, and gating on it would lock
|
|
671
1031
|
* an admin out of the screen where they would set it up.
|
|
672
1032
|
*/
|
|
673
|
-
export function settingsAnswered(settings
|
|
674
|
-
|
|
1033
|
+
export function settingsAnswered(settings,
|
|
1034
|
+
/** What answers for the repository. Absent: an address and a token, the one way there was. */
|
|
1035
|
+
source) {
|
|
1036
|
+
const kb = source ? source.answered() : Boolean(settings.resolve('kbRepoUrl') && settings.resolve('gitToken'));
|
|
675
1037
|
const branches = validateBranchModel({
|
|
676
1038
|
defaultBranch: settings.resolve('defaultBranch'),
|
|
677
1039
|
protectedBranches: settings.resolve('protectedBranches'),
|
|
@@ -693,11 +1055,11 @@ export function settingsAnswered(settings) {
|
|
|
693
1055
|
* that puts it there. {@link awaitingRestart} is what tells the screen to ask
|
|
694
1056
|
* for one rather than claim a field is missing.
|
|
695
1057
|
*/
|
|
696
|
-
export function isComplete(settings, kb) {
|
|
697
|
-
return settingsAnswered(settings) && kb.isBranchModelConfigured();
|
|
1058
|
+
export function isComplete(settings, kb, source) {
|
|
1059
|
+
return settingsAnswered(settings, source) && kb.isBranchModelConfigured();
|
|
698
1060
|
}
|
|
699
1061
|
/** Answered, but not yet in effect: everything is stored, the process is stale. */
|
|
700
|
-
export function awaitingRestart(settings, kb) {
|
|
701
|
-
return settingsAnswered(settings) && !kb.isBranchModelConfigured();
|
|
1062
|
+
export function awaitingRestart(settings, kb, source) {
|
|
1063
|
+
return settingsAnswered(settings, source) && !kb.isBranchModelConfigured();
|
|
702
1064
|
}
|
|
703
1065
|
//# sourceMappingURL=setup.routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.routes.js","sourceRoot":"","sources":["../../../src/modules/settings/setup.routes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAC5B,OAAO,EAEL,uBAAuB,EACvB,mBAAmB,GAEpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,kBAAkB,GAInB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,GAG1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,iCAA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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import '../auth/auth.middleware.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { AuthUser, IWorkflowService } from '@bevel-software/platform-shared';
|
|
4
4
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
5
5
|
import type { KbContext } from '../../shared/kb-context.js';
|
|
6
6
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
@@ -16,13 +16,11 @@ import type { ISkillService } from './skills.contract.js';
|
|
|
16
16
|
*
|
|
17
17
|
* Why it exists: linking a skill into a plugin needs write on the skill's
|
|
18
18
|
* rules (the link grants the plugin's principal there), and a plugin manager
|
|
19
|
-
* often has no say over a skill some other scope owns. The request is
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* path rather than a plugin name — the branch-name convention takes any
|
|
25
|
-
* exact string).
|
|
19
|
+
* often has no say over a skill some other scope owns. The request is opened
|
|
20
|
+
* by the shared `AccessRequestsService` — the same one the Manage access
|
|
21
|
+
* dialog's Request access uses — keyed on the skill FOLDER path, so this
|
|
22
|
+
* button and a Can edit request on that same folder are ONE request, shown in
|
|
23
|
+
* the skill page's banner and in the folder's dialog alike.
|
|
26
24
|
*
|
|
27
25
|
* Fail-closed like the skill catalog: a skill the caller cannot read answers
|
|
28
26
|
* as unknown, and the editors' listing answers `[]` to anyone else.
|