@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
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { DEFAULT_GIT_USERNAME } from '../../shared/git.contract.js';
|
|
2
|
+
/**
|
|
3
|
+
* The ways a deployment can be given the repository its knowledge base
|
|
4
|
+
* lives in, in the order the setup screen offers them.
|
|
5
|
+
*
|
|
6
|
+
* - `managed`: the deployment keeps the repository itself.
|
|
7
|
+
* - `github-app`: a repository on GitHub, reached through a GitHub App the
|
|
8
|
+
* admin installed on it.
|
|
9
|
+
* - `token`: any git host, by its address and an access token.
|
|
10
|
+
*/
|
|
11
|
+
export const GIT_MODES = ['managed', 'github-app', 'token'];
|
|
12
|
+
export function isGitMode(value) {
|
|
13
|
+
return typeof value === 'string' && GIT_MODES.includes(value);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* WHERE THE KNOWLEDGE BASE'S REPOSITORY IS, AND WHAT GIT PRESENTS TO IT —
|
|
17
|
+
* the one place that knows there is more than one answer.
|
|
18
|
+
*
|
|
19
|
+
* Everything that runs git asks for two things: an address to clone from,
|
|
20
|
+
* and a credential. Both used to be read straight from two settings, which
|
|
21
|
+
* is one way of having a repository. With three ways, each reader deciding
|
|
22
|
+
* for itself would be three places to disagree, so they all ask here, and
|
|
23
|
+
* what they get back is the same two things as before.
|
|
24
|
+
*
|
|
25
|
+
* TWO MODES, AND THEY ARE NOT ALWAYS THE SAME ONE.
|
|
26
|
+
*
|
|
27
|
+
* - The mode IN EFFECT is the one this process is running on. Its working
|
|
28
|
+
* copies are clones of that mode's repository, and every address and
|
|
29
|
+
* credential this class hands out is that mode's. It is taken when the
|
|
30
|
+
* source is built and changes only in {@link takeEffect}.
|
|
31
|
+
* - The mode CHOSEN is what the settings say. A save changes it at once.
|
|
32
|
+
*
|
|
33
|
+
* They differ between the save that moves a serving deployment and the
|
|
34
|
+
* restart that save owes. Reading the mode live would move the process the
|
|
35
|
+
* moment the setting was stored: the new mode's credential presented to the
|
|
36
|
+
* old mode's repository, which every working copy still points at, and new
|
|
37
|
+
* branches cloned from a repository the startup phase has not prepared. So
|
|
38
|
+
* the process stays where it is until it is started again, which is what
|
|
39
|
+
* the setup screen tells the admin.
|
|
40
|
+
*
|
|
41
|
+
* WITHIN a mode the values are read live, as they always were: a rotated
|
|
42
|
+
* token is the one the next push carries.
|
|
43
|
+
*
|
|
44
|
+
* THE MODE IS INFERRED WHEN NOBODY CHOSE ONE. A deployment configured before
|
|
45
|
+
* there was a choice has an address and a token and no mode; it is in
|
|
46
|
+
* `token` mode, because that is what it has. One with nothing configured has
|
|
47
|
+
* no mode, and the setup screen offers the first.
|
|
48
|
+
*/
|
|
49
|
+
export class RepositorySource {
|
|
50
|
+
opts;
|
|
51
|
+
/** What git authenticates with, read on every call. */
|
|
52
|
+
credentials;
|
|
53
|
+
inEffect;
|
|
54
|
+
constructor(opts) {
|
|
55
|
+
this.opts = opts;
|
|
56
|
+
this.inEffect = this.chosen();
|
|
57
|
+
this.credentials = {
|
|
58
|
+
username: () => this.username(),
|
|
59
|
+
token: () => this.token(),
|
|
60
|
+
prepare: () => this.prepare(),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Without a reader, the mode IN EFFECT. With one, the mode a save of that
|
|
65
|
+
* reader's values would CHOOSE: the answer validation wants, about values
|
|
66
|
+
* that are not stored yet. Null: nothing is configured.
|
|
67
|
+
*/
|
|
68
|
+
mode(read) {
|
|
69
|
+
return read ? this.chosen(read) : this.inEffect;
|
|
70
|
+
}
|
|
71
|
+
/** The mode the settings say, which a restart would put in effect. */
|
|
72
|
+
chosen(read = this.opts.read) {
|
|
73
|
+
const named = read('gitMode').trim();
|
|
74
|
+
if (isGitMode(named))
|
|
75
|
+
return named;
|
|
76
|
+
return read('kbRepoUrl') || this.tokenIn(read) ? 'token' : null;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Put the mode chosen in effect. Called where nothing is using the mode
|
|
80
|
+
* that was: by a save made before the deployment was serving, which the
|
|
81
|
+
* startup phase follows. A process that is serving is never moved; it is
|
|
82
|
+
* restarted, and built on the mode chosen.
|
|
83
|
+
*/
|
|
84
|
+
takeEffect() {
|
|
85
|
+
this.inEffect = this.chosen();
|
|
86
|
+
}
|
|
87
|
+
/** The address git clones from and pushes to. Empty while there is none. Asked as {@link mode} is. */
|
|
88
|
+
url(read) {
|
|
89
|
+
const from = read ?? this.opts.read;
|
|
90
|
+
switch (this.mode(read)) {
|
|
91
|
+
case 'managed':
|
|
92
|
+
return this.opts.managed.path;
|
|
93
|
+
case 'github-app':
|
|
94
|
+
return this.opts.githubApp?.url(from) ?? '';
|
|
95
|
+
case 'token':
|
|
96
|
+
return from('kbRepoUrl');
|
|
97
|
+
default:
|
|
98
|
+
return '';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Whether the repository half of setup is answered: there is somewhere to
|
|
103
|
+
* clone from and, where one is needed, something to present. Asked as
|
|
104
|
+
* {@link mode} is.
|
|
105
|
+
*/
|
|
106
|
+
answered(read) {
|
|
107
|
+
const from = read ?? this.opts.read;
|
|
108
|
+
switch (this.mode(read)) {
|
|
109
|
+
case 'managed':
|
|
110
|
+
return true;
|
|
111
|
+
case 'github-app':
|
|
112
|
+
return this.opts.githubApp?.answered(from) ?? false;
|
|
113
|
+
case 'token':
|
|
114
|
+
return Boolean(from('kbRepoUrl') && this.tokenIn(from));
|
|
115
|
+
default:
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
username() {
|
|
120
|
+
// Only a host that was given a token is given a name to go with it.
|
|
121
|
+
if (this.inEffect !== 'token')
|
|
122
|
+
return DEFAULT_GIT_USERNAME;
|
|
123
|
+
return this.opts.read('gitUsername') || this.opts.fallback?.username || DEFAULT_GIT_USERNAME;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* One mode's credential is never presented to another mode's repository:
|
|
127
|
+
* a deployment that moved to a managed repository still has its old
|
|
128
|
+
* token stored, and a path on its own disk has no use for it. The mode is
|
|
129
|
+
* the one IN EFFECT, because that is the repository git is talking to.
|
|
130
|
+
*/
|
|
131
|
+
token() {
|
|
132
|
+
switch (this.inEffect) {
|
|
133
|
+
case 'token':
|
|
134
|
+
return this.tokenIn(this.opts.read) || null;
|
|
135
|
+
case 'github-app':
|
|
136
|
+
return this.opts.githubApp?.token() ?? null;
|
|
137
|
+
default:
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
async prepare() {
|
|
142
|
+
if (this.inEffect === 'github-app')
|
|
143
|
+
await this.opts.githubApp?.prepare();
|
|
144
|
+
}
|
|
145
|
+
tokenIn(read) {
|
|
146
|
+
// The fallback is the environment's, so it is in effect whatever a save brings.
|
|
147
|
+
return read('gitToken') || this.opts.fallback?.token || '';
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=repository-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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QACd,oEAAoE;QACpE,IAAI,IAAI,CAAC,QAAQ,KAAK,OAAO;YAAE,OAAO,oBAAoB,CAAC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,IAAI,oBAAoB,CAAC;IAC/F,CAAC;IAED;;;;;OAKG;IACK,KAAK;QACX,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;YACtB,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;YAC9C,KAAK,YAAY;gBACf,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC;YAC9C;gBACE,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,OAAO;QACnB,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY;YAAE,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC;IAC3E,CAAC;IAEO,OAAO,CAAC,IAAmB;QACjC,gFAAgF;QAChF,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -6,7 +6,23 @@ import { type ConnectionCheck, type RepositoryConnection } from './connection-ch
|
|
|
6
6
|
import type { KbContext } from '../../shared/kb-context.js';
|
|
7
7
|
import { type GitFailure } from '../../shared/git-failure.js';
|
|
8
8
|
import { listRootFolders } from './git-root-folders.js';
|
|
9
|
+
import { type GitHubAppRepository, type RepositorySource } from './repository-source.js';
|
|
9
10
|
import '../auth/auth.middleware.js';
|
|
11
|
+
/**
|
|
12
|
+
* What setup needs of the ways a deployment can be given its repository:
|
|
13
|
+
* the source every reader of the repository asks, and the one thing a mode
|
|
14
|
+
* has to have DONE before a save that chooses it may go through.
|
|
15
|
+
*/
|
|
16
|
+
export interface RepositorySetup {
|
|
17
|
+
source: RepositorySource;
|
|
18
|
+
/** Create the repository the deployment keeps for itself, if it is not there. Never touches one that is. */
|
|
19
|
+
ensureManaged(initialBranch: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* The connection to GitHub through a GitHub App. Absent, that way is not
|
|
22
|
+
* offered, and a save that names it is refused.
|
|
23
|
+
*/
|
|
24
|
+
githubApp?: Pick<GitHubAppRepository, 'url' | 'answered' | 'prepare' | 'token' | 'permits'>;
|
|
25
|
+
}
|
|
10
26
|
/**
|
|
11
27
|
* The slice of a sync record the status endpoint publishes. Declared here
|
|
12
28
|
* rather than imported from `kb-sync` so this module stays free of that one;
|
|
@@ -22,6 +38,47 @@ export interface LastSyncStatus {
|
|
|
22
38
|
error?: string;
|
|
23
39
|
}>;
|
|
24
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The open change requests, as the repository-change confirmation needs them:
|
|
43
|
+
* how many there are to decide about, and the close the admin may choose.
|
|
44
|
+
*
|
|
45
|
+
* Deliberately narrow — the setup routes never read a request, never write
|
|
46
|
+
* one, and never learn what is in it. Nothing here deletes anything: closing
|
|
47
|
+
* leaves every row where it is.
|
|
48
|
+
*/
|
|
49
|
+
export interface RepositoryChangeRequests {
|
|
50
|
+
/** How many change requests are open right now. */
|
|
51
|
+
countOpen(): Promise<number>;
|
|
52
|
+
/** Close every open request as "repository replaced", releasing the file locks on their branches. Answers how many closed. */
|
|
53
|
+
closeAsRepositoryReplaced(): Promise<number>;
|
|
54
|
+
/**
|
|
55
|
+
* Run the move with no queued commit being written. The startup phase sets
|
|
56
|
+
* working copies aside and clones them again while the deployment is
|
|
57
|
+
* serving, and a commit worker left running would write into a directory
|
|
58
|
+
* that is being renamed away, or into the fresh clone of a repository the
|
|
59
|
+
* commit was never meant for. Absent (a minimal mount has no worker), the
|
|
60
|
+
* move runs as it is.
|
|
61
|
+
*/
|
|
62
|
+
whileCommitsHeld?<T>(work: () => Promise<T>): Promise<T>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* What the admin is asked to confirm before a save MOVES the deployment to
|
|
66
|
+
* another repository, and what they answered about its open change requests.
|
|
67
|
+
*
|
|
68
|
+
* `keep` — the repository only moved: its branches came along, so the open
|
|
69
|
+
* change requests still mean something and stay open.
|
|
70
|
+
* `close` — it is a different repository: none of those branches is in it,
|
|
71
|
+
* so the requests are closed as "repository replaced" (nothing deleted).
|
|
72
|
+
*
|
|
73
|
+
* What happens to the working copies is not a choice, and is decided by the
|
|
74
|
+
* histories, not by this answer (see the startup phase's
|
|
75
|
+
* `reconcileClonesWithConfiguredRepository`): a copy whose history the new
|
|
76
|
+
* repository holds is pointed at it and kept, unpushed commits included; any
|
|
77
|
+
* other is set aside whole and cloned fresh. Nothing is deleted. The
|
|
78
|
+
* confirmation exists so that work which leaves the app this way does so
|
|
79
|
+
* KNOWINGLY.
|
|
80
|
+
*/
|
|
81
|
+
export type RepositoryChangeChoice = 'keep' | 'close';
|
|
25
82
|
/**
|
|
26
83
|
* First-run setup — the deployment's own configuration, for the things that
|
|
27
84
|
* used to be environment-only.
|
|
@@ -85,7 +142,22 @@ oidcRedirectUri?: string,
|
|
|
85
142
|
/** The single sign-on check. Injected so route tests can answer for the provider. */
|
|
86
143
|
checkOidc?: (config: OidcConfiguration) => Promise<OidcCheck>,
|
|
87
144
|
/** The issuer-only half, for a test with no application id or secret yet. */
|
|
88
|
-
checkIssuer?: (issuerUrl: string) => Promise<IssuerCheck
|
|
145
|
+
checkIssuer?: (issuerUrl: string) => Promise<IssuerCheck>,
|
|
146
|
+
/**
|
|
147
|
+
* The ways a deployment can be given its repository. Absent, there is the
|
|
148
|
+
* one there always was: an address and a token, read from the settings.
|
|
149
|
+
*/
|
|
150
|
+
repository?: RepositorySetup,
|
|
151
|
+
/**
|
|
152
|
+
* What a change of the knowledge-base repository has to decide about, and
|
|
153
|
+
* what to do when the admin decides to close.
|
|
154
|
+
*
|
|
155
|
+
* Injected because the setup routes must stay free of the workflow module —
|
|
156
|
+
* and a minimal mount (tests, a distribution without change requests) simply
|
|
157
|
+
* has none: the default answers "no open requests", so the confirmation
|
|
158
|
+
* offers no choice it cannot honour.
|
|
159
|
+
*/
|
|
160
|
+
changeRequests?: RepositoryChangeRequests): express.Router;
|
|
89
161
|
/**
|
|
90
162
|
* Whether the STORED configuration answers everything the deployment needs.
|
|
91
163
|
*
|
|
@@ -99,7 +171,9 @@ checkIssuer?: (issuerUrl: string) => Promise<IssuerCheck>): express.Router;
|
|
|
99
171
|
* deployment signs in perfectly well without it, and gating on it would lock
|
|
100
172
|
* an admin out of the screen where they would set it up.
|
|
101
173
|
*/
|
|
102
|
-
export declare function settingsAnswered(settings: DeploymentSettingsService
|
|
174
|
+
export declare function settingsAnswered(settings: DeploymentSettingsService,
|
|
175
|
+
/** What answers for the repository. Absent: an address and a token, the one way there was. */
|
|
176
|
+
source?: Pick<RepositorySource, 'answered'>): boolean;
|
|
103
177
|
/**
|
|
104
178
|
* Whether THIS PROCESS can actually serve — which is not the same question,
|
|
105
179
|
* and conflating them opened the gate onto a broken app.
|
|
@@ -115,7 +189,7 @@ export declare function settingsAnswered(settings: DeploymentSettingsService): b
|
|
|
115
189
|
* that puts it there. {@link awaitingRestart} is what tells the screen to ask
|
|
116
190
|
* for one rather than claim a field is missing.
|
|
117
191
|
*/
|
|
118
|
-
export declare function isComplete(settings: DeploymentSettingsService, kb: Pick<KbContext, 'isBranchModelConfigured'>): boolean;
|
|
192
|
+
export declare function isComplete(settings: DeploymentSettingsService, kb: Pick<KbContext, 'isBranchModelConfigured'>, source?: Pick<RepositorySource, 'answered'>): boolean;
|
|
119
193
|
/** Answered, but not yet in effect: everything is stored, the process is stale. */
|
|
120
|
-
export declare function awaitingRestart(settings: DeploymentSettingsService, kb: Pick<KbContext, 'isBranchModelConfigured'>): boolean;
|
|
194
|
+
export declare function awaitingRestart(settings: DeploymentSettingsService, kb: Pick<KbContext, 'isBranchModelConfigured'>, source?: Pick<RepositorySource, 'answered'>): boolean;
|
|
121
195
|
//# sourceMappingURL=setup.routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/settings/setup.routes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAIvE,OAAO,EACL,yBAAyB,EAI1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAqB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/settings/setup.routes.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAIvE,OAAO,EACL,yBAAyB,EAI1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAM/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,6BAA6B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