@bevel-software/platform-core-backend 0.20.0 → 0.22.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/catalog-cache-invalidation.d.ts +7 -2
- package/dist/core/catalog-cache-invalidation.d.ts.map +1 -1
- package/dist/core/catalog-cache-invalidation.js +8 -9
- package/dist/core/catalog-cache-invalidation.js.map +1 -1
- package/dist/core/core-ports.d.ts +19 -0
- 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 +2 -0
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +55 -107
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +41 -4
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +183 -82
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +74 -28
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +157 -20
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/public-config.d.ts +5 -1
- package/dist/core/public-config.d.ts.map +1 -1
- package/dist/core/public-config.js +7 -5
- package/dist/core/public-config.js.map +1 -1
- package/dist/core-config.d.ts +95 -1
- package/dist/core-config.d.ts.map +1 -1
- package/dist/core-config.js +24 -8
- package/dist/core-config.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +18 -1
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +19 -8
- 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 +2 -1
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +10 -10
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/change-read-gate.d.ts +6 -3
- package/dist/modules/access/change-read-gate.d.ts.map +1 -1
- package/dist/modules/access/change-read-gate.js +9 -6
- package/dist/modules/access/change-read-gate.js.map +1 -1
- package/dist/modules/access/creator-access.d.ts +4 -2
- package/dist/modules/access/creator-access.d.ts.map +1 -1
- package/dist/modules/access/creator-access.js +7 -4
- package/dist/modules/access/creator-access.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/agent-instructions/read-preamble.d.ts +2 -1
- package/dist/modules/agent-instructions/read-preamble.d.ts.map +1 -1
- package/dist/modules/agent-instructions/read-preamble.js +6 -9
- package/dist/modules/agent-instructions/read-preamble.js.map +1 -1
- package/dist/modules/auth/account-admission.d.ts +40 -0
- package/dist/modules/auth/account-admission.d.ts.map +1 -0
- package/dist/modules/auth/account-admission.js +17 -0
- package/dist/modules/auth/account-admission.js.map +1 -0
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +4 -1
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +45 -2
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +44 -3
- 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 +9 -0
- package/dist/modules/auth/oidc-auth-provider.js.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.d.ts +13 -1
- package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.js +10 -2
- package/dist/modules/connection-probe/connection-probe.service.js.map +1 -1
- package/dist/modules/database/advisory-lock.d.ts +17 -0
- package/dist/modules/database/advisory-lock.d.ts.map +1 -1
- package/dist/modules/database/advisory-lock.js +24 -3
- package/dist/modules/database/advisory-lock.js.map +1 -1
- package/dist/modules/database/connection.d.ts +67 -2
- package/dist/modules/database/connection.d.ts.map +1 -1
- package/dist/modules/database/connection.js +118 -12
- package/dist/modules/database/connection.js.map +1 -1
- package/dist/modules/database/migrate.d.ts +1 -1
- package/dist/modules/database/migrate.d.ts.map +1 -1
- package/dist/modules/database/migrate.js +27 -3
- package/dist/modules/database/migrate.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 +0 -1
- package/dist/modules/kb-fs/branch-name.d.ts.map +1 -1
- package/dist/modules/kb-fs/branch-name.js +3 -3
- package/dist/modules/kb-fs/branch-name.js.map +1 -1
- package/dist/modules/kb-fs/clone-config.d.ts +9 -8
- package/dist/modules/kb-fs/clone-config.d.ts.map +1 -1
- package/dist/modules/kb-fs/clone-config.js +14 -12
- package/dist/modules/kb-fs/clone-config.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/mcp/mcp.service.d.ts +7 -0
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +4 -4
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts +4 -4
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts.map +1 -1
- package/dist/modules/plugins/compile/marketplace-compiler.service.js +7 -10
- package/dist/modules/plugins/compile/marketplace-compiler.service.js.map +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.d.ts +4 -1
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.js +5 -3
- package/dist/modules/plugins/discovery/bundle-dialect/bundle.source.js.map +1 -1
- package/dist/modules/plugins/discovery/kb-plugin-source.d.ts +6 -1
- package/dist/modules/plugins/discovery/kb-plugin-source.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/kb-plugin-source.js +14 -9
- package/dist/modules/plugins/discovery/kb-plugin-source.js.map +1 -1
- package/dist/modules/plugins/discovery/native.source.d.ts +4 -1
- package/dist/modules/plugins/discovery/native.source.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/native.source.js +4 -2
- package/dist/modules/plugins/discovery/native.source.js.map +1 -1
- package/dist/modules/plugins/index.d.ts +1 -1
- package/dist/modules/plugins/index.d.ts.map +1 -1
- package/dist/modules/plugins/index.js +1 -1
- package/dist/modules/plugins/index.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-request-jobs.service.d.ts +3 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.js +6 -6
- package/dist/modules/plugins/join-request-jobs.service.js.map +1 -1
- package/dist/modules/plugins/join-requests.service.d.ts +113 -18
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +178 -33
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugin-links.d.ts +65 -10
- package/dist/modules/plugins/plugin-links.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-links.js +136 -31
- package/dist/modules/plugins/plugin-links.js.map +1 -1
- package/dist/modules/plugins/plugin-links.service.d.ts +107 -5
- package/dist/modules/plugins/plugin-links.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-links.service.js +151 -21
- package/dist/modules/plugins/plugin-links.service.js.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.d.ts +10 -3
- package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.js +33 -26
- package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.d.ts +4 -2
- package/dist/modules/plugins/plugin-rename.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.js +10 -12
- package/dist/modules/plugins/plugin-rename.service.js.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +3 -0
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +48 -17
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +4 -4
- package/dist/modules/plugins/plugins.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.service.js +7 -10
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/plugins/teams.routes.d.ts +4 -1
- package/dist/modules/plugins/teams.routes.d.ts.map +1 -1
- package/dist/modules/plugins/teams.routes.js +11 -9
- package/dist/modules/plugins/teams.routes.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +1 -1
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +1 -1
- package/dist/modules/secrets-vault/index.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-variable-loader.d.ts +29 -11
- package/dist/modules/secrets-vault/secrets-variable-loader.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-variable-loader.js +46 -21
- package/dist/modules/secrets-vault/secrets-variable-loader.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +3 -0
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +4 -6
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.d.ts +34 -9
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +113 -26
- 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 +34 -4
- package/dist/modules/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +198 -18
- package/dist/modules/settings/setup.routes.js.map +1 -1
- package/dist/modules/skills/allowed-tools-check.d.ts +4 -3
- package/dist/modules/skills/allowed-tools-check.d.ts.map +1 -1
- package/dist/modules/skills/allowed-tools-check.js +8 -8
- package/dist/modules/skills/allowed-tools-check.js.map +1 -1
- package/dist/modules/skills/pending-skills.service.d.ts +3 -1
- package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.js +9 -6
- package/dist/modules/skills/pending-skills.service.js.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +8 -9
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +26 -65
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
- package/dist/modules/skills/skills.routes.d.ts +4 -1
- package/dist/modules/skills/skills.routes.d.ts.map +1 -1
- package/dist/modules/skills/skills.routes.js +4 -4
- package/dist/modules/skills/skills.routes.js.map +1 -1
- package/dist/modules/skills/skills.service.d.ts +4 -2
- package/dist/modules/skills/skills.service.d.ts.map +1 -1
- package/dist/modules/skills/skills.service.js +13 -11
- package/dist/modules/skills/skills.service.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-manuals/mcp-json-discovery.d.ts +2 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.js +6 -5
- package/dist/modules/tool-manuals/mcp-json-discovery.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts +4 -2
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.js +12 -10
- package/dist/modules/tool-manuals/mcp-server-edit.service.js.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.d.ts +3 -1
- package/dist/modules/tool-manuals/pending-tools.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.js +19 -16
- package/dist/modules/tool-manuals/pending-tools.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.d.ts +4 -2
- package/dist/modules/tool-manuals/tool-delete.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js +14 -12
- package/dist/modules/tool-manuals/tool-delete.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts +3 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.js +7 -7
- package/dist/modules/tool-manuals/tool-manuals.routes.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +4 -2
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +15 -12
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +3 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +4 -6
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +3 -2
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +47 -11
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +14 -6
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +40 -18
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.d.ts +26 -2
- package/dist/modules/workflow/git/node-git-runner.d.ts.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.js +40 -5
- 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/review-workflow/review-workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +9 -4
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
- package/dist/modules/workflow/session-ontology.service.d.ts +6 -1
- package/dist/modules/workflow/session-ontology.service.d.ts.map +1 -1
- package/dist/modules/workflow/session-ontology.service.js +6 -2
- package/dist/modules/workflow/session-ontology.service.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 +42 -10
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +181 -71
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/session-ontology.gate.d.ts +3 -1
- package/dist/modules/workspace/session-ontology.gate.d.ts.map +1 -1
- package/dist/modules/workspace/session-ontology.gate.js +3 -3
- package/dist/modules/workspace/session-ontology.gate.js.map +1 -1
- package/dist/modules/workspace/startup/kb-git.d.ts +4 -3
- package/dist/modules/workspace/startup/kb-git.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-git.js +15 -13
- package/dist/modules/workspace/startup/kb-git.js.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.d.ts +70 -7
- package/dist/modules/workspace/startup/kb-startup-runner.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js +183 -38
- package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.d.ts +7 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js +23 -16
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/personal-spaces.step.d.ts +7 -1
- package/dist/modules/workspace/startup/steps/personal-spaces.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/personal-spaces.step.js +12 -5
- package/dist/modules/workspace/startup/steps/personal-spaces.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-display-names.step.d.ts +7 -1
- package/dist/modules/workspace/startup/steps/plugin-display-names.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-display-names.step.js +12 -5
- package/dist/modules/workspace/startup/steps/plugin-display-names.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.d.ts +7 -1
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.js +12 -5
- package/dist/modules/workspace/startup/steps/plugin-manifests.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts +4 -1
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +14 -11
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts +17 -3
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.js +36 -30
- package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.d.ts +6 -1
- package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.js +10 -6
- package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts +2 -1
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +8 -7
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +18 -12
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +49 -29
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +2 -1
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +48 -20
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/modules/workspace/write-denial.d.ts +3 -2
- package/dist/modules/workspace/write-denial.d.ts.map +1 -1
- package/dist/modules/workspace/write-denial.js +6 -5
- package/dist/modules/workspace/write-denial.js.map +1 -1
- package/dist/shared/domain-errors.d.ts +39 -0
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +55 -0
- package/dist/shared/domain-errors.js.map +1 -1
- package/dist/shared/git.contract.d.ts +62 -7
- package/dist/shared/git.contract.d.ts.map +1 -1
- package/dist/shared/git.contract.js +30 -8
- package/dist/shared/git.contract.js.map +1 -1
- package/dist/shared/kb-context.d.ts +76 -0
- package/dist/shared/kb-context.d.ts.map +1 -0
- package/dist/shared/kb-context.js +108 -0
- package/dist/shared/kb-context.js.map +1 -0
- package/dist/shared/kb-layout.d.ts +3 -2
- package/dist/shared/kb-layout.d.ts.map +1 -1
- package/dist/shared/kb-layout.js +4 -3
- package/dist/shared/kb-layout.js.map +1 -1
- package/dist/shared/kb-layout.test.js +35 -27
- package/dist/shared/kb-layout.test.js.map +1 -1
- package/dist/shared/pending-proposals.d.ts +4 -1
- package/dist/shared/pending-proposals.d.ts.map +1 -1
- package/dist/shared/pending-proposals.js +3 -4
- package/dist/shared/pending-proposals.js.map +1 -1
- package/dist/shared/redact-secret.d.ts +5 -5
- package/dist/shared/redact-secret.js +5 -5
- package/dist/tenancy/index.d.ts +13 -0
- package/dist/tenancy/index.d.ts.map +1 -0
- package/dist/tenancy/index.js +13 -0
- package/dist/tenancy/index.js.map +1 -0
- package/dist/tenancy/static-tenant-source.d.ts +98 -0
- package/dist/tenancy/static-tenant-source.d.ts.map +1 -0
- package/dist/tenancy/static-tenant-source.js +220 -0
- package/dist/tenancy/static-tenant-source.js.map +1 -0
- package/dist/tenancy/tenant-host.d.ts +80 -0
- package/dist/tenancy/tenant-host.d.ts.map +1 -0
- package/dist/tenancy/tenant-host.js +217 -0
- package/dist/tenancy/tenant-host.js.map +1 -0
- package/dist/tenancy/tenant-runtime.d.ts +91 -0
- package/dist/tenancy/tenant-runtime.d.ts.map +1 -0
- package/dist/tenancy/tenant-runtime.js +174 -0
- package/dist/tenancy/tenant-runtime.js.map +1 -0
- package/dist/tenancy/tenant-secrets.d.ts +24 -0
- package/dist/tenancy/tenant-secrets.d.ts.map +1 -0
- package/dist/tenancy/tenant-secrets.js +30 -0
- package/dist/tenancy/tenant-secrets.js.map +1 -0
- package/dist/tenancy/tenant-source.contract.d.ts +45 -0
- package/dist/tenancy/tenant-source.contract.d.ts.map +1 -0
- package/dist/tenancy/tenant-source.contract.js +21 -0
- package/dist/tenancy/tenant-source.contract.js.map +1 -0
- package/migrations/0000_core_init.sql +14 -14
- package/migrations/0003_deployment_settings.sql +1 -1
- package/migrations/0005_github_facade.sql +1 -1
- package/migrations/0012_agent_audit.sql +6 -6
- package/package.json +3 -3
- package/src/__tests__/branch-model.test.ts +7 -6
- package/src/__tests__/kb-context.ts +30 -0
- package/src/__tests__/kb-layout-config.test.ts +35 -30
- package/src/core/__tests__/catalog-cache-invalidation.test.ts +2 -1
- package/src/core/__tests__/lifecycle.test.ts +78 -1
- package/src/core/__tests__/public-config.test.ts +5 -1
- package/src/core/catalog-cache-invalidation.ts +16 -11
- package/src/core/core-ports.ts +19 -0
- package/src/core/create-core-server.ts +64 -107
- package/src/core/create-core-services.ts +238 -96
- package/src/core/lifecycle.ts +214 -29
- package/src/core/public-config.ts +8 -5
- package/src/core-config.ts +107 -8
- package/src/index.ts +25 -2
- package/src/modules/access/__tests__/access-control.admin-root-floor.test.ts +2 -1
- 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.batch.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.folder-governs.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.group-grant.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.overrides.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.proposal-branch.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.prospective.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.revoke.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.unknown-email.test.ts +2 -1
- package/src/modules/access/__tests__/change-read-gate.test.ts +13 -11
- package/src/modules/access/__tests__/creator-access.test.ts +3 -2
- package/src/modules/access/__tests__/roles.routes.test.ts +2 -1
- package/src/modules/access/access-control.service.ts +20 -6
- 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 +10 -13
- package/src/modules/access/change-read-gate.ts +10 -4
- package/src/modules/access/creator-access.ts +7 -2
- package/src/modules/access-model/access-grammar.ts +22 -0
- package/src/modules/agent-instructions/__tests__/read-preamble.test.ts +13 -12
- package/src/modules/agent-instructions/read-preamble.ts +10 -12
- package/src/modules/auth/__tests__/account.routes.test.ts +15 -0
- package/src/modules/auth/__tests__/auth.service.test.ts +98 -0
- package/src/modules/auth/account-admission.ts +44 -0
- package/src/modules/auth/account.routes.ts +4 -1
- package/src/modules/auth/auth.service.ts +61 -2
- package/src/modules/auth/oidc-auth-provider.ts +9 -0
- package/src/modules/connection-probe/connection-probe.service.ts +7 -1
- package/src/modules/database/__tests__/advisory-lock.test.ts +23 -1
- package/src/modules/database/__tests__/connection.test.ts +98 -0
- package/src/modules/database/__tests__/migrations-unqualified.test.ts +32 -0
- package/src/modules/database/advisory-lock.ts +28 -4
- package/src/modules/database/connection.ts +143 -13
- package/src/modules/database/migrate.ts +48 -14
- package/src/modules/diff/__tests__/diff.service.seed-atomicity.test.ts +2 -1
- package/src/modules/diff/__tests__/diff.service.test.ts +2 -1
- 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 +6 -6
- package/src/modules/kb-fs/__tests__/clone-config.test.ts +24 -20
- package/src/modules/kb-fs/__tests__/remote-url.test.ts +38 -0
- package/src/modules/kb-fs/branch-name.ts +3 -3
- package/src/modules/kb-fs/clone-config.ts +15 -12
- package/src/modules/kb-fs/remote-url.ts +35 -0
- package/src/modules/marketplace/__tests__/marketplace-repo.head.test.ts +2 -1
- package/src/modules/mcp/mcp.service.ts +11 -4
- package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +12 -11
- package/src/modules/plugins/__tests__/bundle-dialect.test.ts +2 -1
- package/src/modules/plugins/__tests__/compile-marketplace.test.ts +6 -4
- package/src/modules/plugins/__tests__/join-proposals.test.ts +100 -19
- package/src/modules/plugins/__tests__/join-request-jobs.service.test.ts +2 -1
- package/src/modules/plugins/__tests__/join-requests.service.test.ts +28 -11
- package/src/modules/plugins/__tests__/join-requests.settlement.test.ts +371 -0
- package/src/modules/plugins/__tests__/plugin-creation-display-name.test.ts +4 -3
- package/src/modules/plugins/__tests__/plugin-index.service.test.ts +6 -4
- package/src/modules/plugins/__tests__/plugin-links.service.test.ts +220 -5
- package/src/modules/plugins/__tests__/plugin-provision.service.test.ts +3 -1
- package/src/modules/plugins/__tests__/plugin-rename.service.test.ts +7 -6
- package/src/modules/plugins/__tests__/plugins.routes.test.ts +12 -3
- package/src/modules/plugins/__tests__/teams.routes.test.ts +2 -1
- package/src/modules/plugins/compile/marketplace-compiler.service.ts +7 -9
- package/src/modules/plugins/discovery/__tests__/kb-plugin-source.test.ts +20 -16
- package/src/modules/plugins/discovery/bundle-dialect/bundle.source.ts +9 -2
- package/src/modules/plugins/discovery/kb-plugin-source.ts +15 -8
- package/src/modules/plugins/discovery/native.source.ts +4 -1
- package/src/modules/plugins/index.ts +1 -1
- package/src/modules/plugins/join-proposals.ts +87 -19
- package/src/modules/plugins/join-request-jobs.service.ts +8 -7
- package/src/modules/plugins/join-requests.service.ts +203 -43
- package/src/modules/plugins/plugin-links.service.ts +192 -19
- package/src/modules/plugins/plugin-links.ts +147 -27
- package/src/modules/plugins/plugin-provision.service.ts +54 -27
- package/src/modules/plugins/plugin-rename.service.ts +10 -10
- package/src/modules/plugins/plugins.routes.ts +48 -17
- package/src/modules/plugins/plugins.service.ts +7 -11
- package/src/modules/plugins/teams.routes.ts +16 -8
- package/src/modules/secrets-vault/__tests__/connect-pending.route.test.ts +7 -0
- package/src/modules/secrets-vault/__tests__/secrets-variable-loader.test.ts +40 -0
- package/src/modules/secrets-vault/__tests__/tool-owner-gate.route.test.ts +2 -0
- package/src/modules/secrets-vault/index.ts +2 -0
- package/src/modules/secrets-vault/secrets-variable-loader.ts +51 -21
- package/src/modules/secrets-vault/secrets-vault.routes.ts +7 -6
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +24 -11
- package/src/modules/settings/__tests__/git-root-folders.test.ts +2 -1
- package/src/modules/settings/__tests__/repository-source.test.ts +191 -0
- package/src/modules/settings/__tests__/setup.routes.boot-failure.test.ts +2 -1
- package/src/modules/settings/__tests__/setup.routes.git-mode.test.ts +353 -0
- package/src/modules/settings/__tests__/setup.routes.github-app.test.ts +282 -0
- package/src/modules/settings/__tests__/setup.routes.layout-phase.test.ts +7 -4
- package/src/modules/settings/__tests__/setup.routes.managed-phase.test.ts +233 -0
- package/src/modules/settings/__tests__/setup.routes.oidc.test.ts +2 -0
- package/src/modules/settings/__tests__/setup.routes.sync-status.test.ts +2 -0
- package/src/modules/settings/__tests__/setup.routes.test.ts +33 -52
- package/src/modules/settings/deployment-settings.service.ts +130 -23
- 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 +233 -19
- package/src/modules/skills/__tests__/allowed-tools-check.test.ts +11 -10
- package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +4 -3
- package/src/modules/skills/__tests__/pending-skills.service.test.ts +3 -1
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +7 -2
- package/src/modules/skills/__tests__/skills.routes.warnings.test.ts +2 -1
- package/src/modules/skills/__tests__/skills.service.test.ts +3 -2
- package/src/modules/skills/allowed-tools-check.ts +7 -6
- package/src/modules/skills/pending-skills.service.ts +9 -8
- package/src/modules/skills/skill-access-requests.routes.ts +29 -79
- package/src/modules/skills/skills.routes.ts +4 -3
- package/src/modules/skills/skills.service.ts +13 -9
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +3 -2
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +3 -2
- package/src/modules/tool-helpers/tool-context.ts +15 -0
- package/src/modules/tool-manuals/__tests__/mcp-json-discovery.test.ts +17 -12
- package/src/modules/tool-manuals/__tests__/mcp-server-edit.service.test.ts +2 -1
- package/src/modules/tool-manuals/__tests__/pending-tools.service.test.ts +4 -1
- package/src/modules/tool-manuals/__tests__/tool-delete.service.test.ts +2 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.archive.route.test.ts +2 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.cli.test.ts +5 -4
- package/src/modules/tool-manuals/__tests__/tool-manuals.detail.route.test.ts +2 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.invalid.routes.test.ts +4 -2
- package/src/modules/tool-manuals/__tests__/tool-manuals.invalid.test.ts +13 -5
- package/src/modules/tool-manuals/__tests__/tool-manuals.mcp-oauth.test.ts +2 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.restart.test.ts +9 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +3 -2
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +2 -0
- package/src/modules/tool-manuals/mcp-json-discovery.ts +6 -4
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +13 -11
- package/src/modules/tool-manuals/pending-tools.service.ts +19 -16
- package/src/modules/tool-manuals/tool-delete.service.ts +13 -10
- package/src/modules/tool-manuals/tool-manuals.routes.ts +10 -8
- package/src/modules/tool-manuals/tool-manuals.service.ts +15 -13
- package/src/modules/tool-manuals/tool-manuals.tools.ts +7 -6
- package/src/modules/workflow/__tests__/apply-failure.test.ts +11 -2
- package/src/modules/workflow/__tests__/merge-announces-tree.test.ts +14 -26
- package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +2 -1
- package/src/modules/workflow/__tests__/session-ontology.service.test.ts +3 -2
- package/src/modules/workflow/__tests__/workflow.routes.lock-path.test.ts +2 -1
- package/src/modules/workflow/__tests__/workflow.service.branch-in-use.test.ts +3 -10
- package/src/modules/workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts +2 -1
- package/src/modules/workflow/__tests__/workflow.service.deleted-branch-sweep.test.ts +3 -10
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +187 -35
- package/src/modules/workflow/__tests__/workflow.service.folder-proposals.test.ts +2 -1
- package/src/modules/workflow/__tests__/workflow.service.platform-restore.test.ts +2 -1
- package/src/modules/workflow/__tests__/workflow.service.read-gate.test.ts +3 -2
- package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +2 -1
- package/src/modules/workflow/__tests__/workflow.service.sync.test.ts +5 -4
- package/src/modules/workflow/__tests__/workflow.service.update-from-target.test.ts +148 -41
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +143 -2
- package/src/modules/workflow/agent-tools/workflow.tools.ts +60 -12
- package/src/modules/workflow/git/__tests__/git.service.accessGating.test.ts +5 -4
- package/src/modules/workflow/git/__tests__/git.service.changedFilesForPr.test.ts +12 -11
- package/src/modules/workflow/git/__tests__/git.service.commitChanges.test.ts +9 -8
- package/src/modules/workflow/git/__tests__/git.service.commitFile.strayPath.test.ts +8 -7
- package/src/modules/workflow/git/__tests__/git.service.commitFile.test.ts +6 -5
- package/src/modules/workflow/git/__tests__/git.service.createBranch.test.ts +3 -2
- package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +3 -2
- package/src/modules/workflow/git/__tests__/git.service.diffFileAtCommit.test.ts +7 -6
- package/src/modules/workflow/git/__tests__/git.service.diffFileBetweenBranches.test.ts +16 -15
- package/src/modules/workflow/git/__tests__/git.service.fileContentsAtCommit.test.ts +3 -2
- package/src/modules/workflow/git/__tests__/git.service.forkPoint.test.ts +2 -1
- package/src/modules/workflow/git/__tests__/git.service.history-guards.test.ts +2 -1
- package/src/modules/workflow/git/__tests__/git.service.list-branches.test.ts +10 -9
- package/src/modules/workflow/git/__tests__/git.service.listTrackedFiles.test.ts +2 -1
- package/src/modules/workflow/git/__tests__/git.service.logForFile.test.ts +6 -5
- package/src/modules/workflow/git/__tests__/git.service.mergeChangeRequest.test.ts +9 -8
- package/src/modules/workflow/git/__tests__/git.service.pendingChanges.test.ts +2 -1
- package/src/modules/workflow/git/__tests__/git.service.postMergePull.test.ts +4 -3
- package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +130 -8
- package/src/modules/workflow/git/__tests__/git.service.readFileAtRef.test.ts +2 -1
- package/src/modules/workflow/git/__tests__/git.service.revertPathsAndPush.test.ts +2 -1
- package/src/modules/workflow/git/__tests__/git.service.status.test.ts +4 -3
- package/src/modules/workflow/git/__tests__/git.service.syncFromRemote.test.ts +8 -7
- package/src/modules/workflow/git/__tests__/node-git-runner.test.ts +41 -3
- 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 +49 -17
- package/src/modules/workflow/git/node-git-runner.ts +43 -4
- package/src/modules/workflow/git/pull-request.service.ts +119 -0
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +9 -6
- package/src/modules/workflow/session-ontology.service.ts +7 -2
- package/src/modules/workflow/workflow.routes.ts +3 -1
- package/src/modules/workflow/workflow.service.ts +201 -76
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +3 -2
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +10 -9
- package/src/modules/workspace/__tests__/session-ontology.gate.test.ts +4 -2
- package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +3 -2
- package/src/modules/workspace/__tests__/workspace.routes.branch-errors.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.create-grant.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.download-implies-read.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.file-writes.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.folders.test.ts +5 -4
- package/src/modules/workspace/__tests__/workspace.routes.move-platform-files.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.service.ensure-remotes-fetched.test.ts +2 -2
- package/src/modules/workspace/__tests__/workspace.service.list-cloned.test.ts +6 -5
- package/src/modules/workspace/__tests__/workspace.service.move-never-overwrites.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.service.read-filter.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.service.test.ts +84 -50
- package/src/modules/workspace/__tests__/workspace.service.unknown-branch.test.ts +45 -1
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +10 -7
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +237 -10
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +44 -11
- package/src/modules/workspace/__tests__/write-denial.test.ts +5 -4
- package/src/modules/workspace/session-ontology.gate.ts +6 -4
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.degraded.test.ts +6 -2
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.test.ts +240 -21
- package/src/modules/workspace/startup/kb-git.ts +15 -22
- package/src/modules/workspace/startup/kb-startup-runner.ts +198 -45
- package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +104 -98
- package/src/modules/workspace/startup/steps/groups-to-plugins.step.ts +24 -16
- package/src/modules/workspace/startup/steps/personal-spaces.step.ts +14 -5
- package/src/modules/workspace/startup/steps/plugin-display-names.step.ts +13 -5
- package/src/modules/workspace/startup/steps/plugin-manifests.step.ts +14 -5
- package/src/modules/workspace/startup/steps/seed-tree.ts +11 -9
- package/src/modules/workspace/startup/steps/template-files.step.ts +43 -34
- package/src/modules/workspace/startup/steps/template-source.ts +8 -5
- package/src/modules/workspace/workspace.routes.ts +8 -7
- package/src/modules/workspace/workspace.service.ts +47 -28
- package/src/modules/workspace/workspace.tools.ts +56 -20
- package/src/modules/workspace/write-denial.ts +7 -5
- package/src/shared/__tests__/kb-layout.plugin.test.ts +19 -16
- package/src/shared/domain-errors.ts +58 -0
- package/src/shared/git.contract.ts +80 -8
- package/src/shared/kb-context.ts +130 -0
- package/src/shared/kb-layout.test.ts +37 -27
- package/src/shared/kb-layout.ts +4 -3
- package/src/shared/pending-proposals.ts +7 -4
- package/src/shared/redact-secret.ts +5 -5
- package/src/tenancy/__tests__/static-tenant-source.test.ts +177 -0
- package/src/tenancy/__tests__/tenant-host.test.ts +372 -0
- package/src/tenancy/__tests__/tenant-runtime.test.ts +221 -0
- package/src/tenancy/__tests__/tenant-secrets.test.ts +35 -0
- package/src/tenancy/index.ts +35 -0
- package/src/tenancy/static-tenant-source.ts +296 -0
- package/src/tenancy/tenant-host.ts +261 -0
- package/src/tenancy/tenant-runtime.ts +208 -0
- package/src/tenancy/tenant-secrets.ts +41 -0
- package/src/tenancy/tenant-source.contract.ts +59 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { MarketplaceRepoService, type MarketplaceCompiler } from '../marketplace-repo.service.js';
|
|
3
|
-
import { GitRunError, type IGitRunner } from '../../../shared/git.contract.js';
|
|
3
|
+
import { GitRunError, NO_GIT_CREDENTIALS, type IGitRunner } from '../../../shared/git.contract.js';
|
|
4
4
|
|
|
5
5
|
const SHA = 'a'.repeat(40);
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ const SHA = 'a'.repeat(40);
|
|
|
8
8
|
function runnerFailingRevParse(failure: GitRunError): IGitRunner {
|
|
9
9
|
return {
|
|
10
10
|
defaultTimeoutMs: 1_000,
|
|
11
|
+
credentials: NO_GIT_CREDENTIALS,
|
|
11
12
|
run: (async (_cwd: string, args: string[]) => {
|
|
12
13
|
if (args.includes('rev-parse')) throw failure;
|
|
13
14
|
return { stdout: '', stderr: '' };
|
|
@@ -93,6 +93,13 @@ export interface McpProxyOptions {
|
|
|
93
93
|
readAgentPreamble?: AgentPreambleReader;
|
|
94
94
|
/** Bounds of the downstream (`mcp.json`) connection pool; defaults are 4h idle / 5000 entries. */
|
|
95
95
|
downstreamPool?: Pick<DownstreamPoolOptions<unknown>, 'idleTtlMs' | 'maxEntries' | 'now'>;
|
|
96
|
+
/**
|
|
97
|
+
* The scope this knowledge base's secrets vault was registered under (see
|
|
98
|
+
* `secrets-variable-loader.ts`), so the UTCP clients built here resolve a
|
|
99
|
+
* caller's `${VAR}`s from that vault and no other's. Default: the single
|
|
100
|
+
* knowledge base's.
|
|
101
|
+
*/
|
|
102
|
+
secretsScope?: string;
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
/** Who a request is from — everything the proxy needs, resolved from that request's own bearer. */
|
|
@@ -727,7 +734,7 @@ export class McpService {
|
|
|
727
734
|
*/
|
|
728
735
|
private async buildClient(bearer: string, userId: string, manuals: CallTemplate[]): Promise<CodeModeUtcpClient> {
|
|
729
736
|
const variables = seedBevelHostedManualVars(manuals, this.opts.loopbackBaseUrl, bearer);
|
|
730
|
-
return CodeModeUtcpClient.create(process.cwd(), utcpClientConfig(userId, variables));
|
|
737
|
+
return CodeModeUtcpClient.create(process.cwd(), utcpClientConfig(userId, variables, this.opts.secretsScope));
|
|
731
738
|
}
|
|
732
739
|
|
|
733
740
|
/**
|
|
@@ -959,7 +966,7 @@ export class McpService {
|
|
|
959
966
|
private async connectDownstream(userId: string, template: CallTemplate): Promise<PooledDownstream> {
|
|
960
967
|
// Third-party manuals are never seeded loopback credentials (see
|
|
961
968
|
// `buildClient`), so a pooled client carries no request-scoped bearer.
|
|
962
|
-
const client = await CodeModeUtcpClient.create(process.cwd(), utcpClientConfig(userId, {}));
|
|
969
|
+
const client = await CodeModeUtcpClient.create(process.cwd(), utcpClientConfig(userId, {}, this.opts.secretsScope));
|
|
963
970
|
// Our own copy: registration renames the template in place, and recovery
|
|
964
971
|
// re-registers from exactly what discovery used.
|
|
965
972
|
const own = structuredClone(template);
|
|
@@ -1240,10 +1247,10 @@ function isErrorResult(result: CallToolResult): boolean {
|
|
|
1240
1247
|
* request clients and pooled downstream clients, so both resolve a manual's
|
|
1241
1248
|
* variables through exactly the same tiers.
|
|
1242
1249
|
*/
|
|
1243
|
-
function utcpClientConfig(userId: string, variables: Record<string, string
|
|
1250
|
+
function utcpClientConfig(userId: string, variables: Record<string, string>, secretsScope?: string) {
|
|
1244
1251
|
return new UtcpClientConfigSerializer().validateDict({
|
|
1245
1252
|
variables,
|
|
1246
|
-
load_variables_from: [bevelSecretsLoaderConfig(userId)],
|
|
1253
|
+
load_variables_from: [bevelSecretsLoaderConfig(userId, secretsScope)],
|
|
1247
1254
|
});
|
|
1248
1255
|
}
|
|
1249
1256
|
|
|
@@ -3,7 +3,8 @@ import { NodeFs } from '../../kb-fs/node-fs.js';
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import os from 'node:os';
|
|
5
5
|
import path from 'node:path';
|
|
6
|
-
import { DEFAULT_BRANCH
|
|
6
|
+
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
7
|
+
import { testKbContext } from '../../../__tests__/kb-context.js';
|
|
7
8
|
|
|
8
9
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
9
10
|
import { AccessControlService } from '../../access/access-control.service.js';
|
|
@@ -46,7 +47,8 @@ describe('bundle dialect, end to end', () => {
|
|
|
46
47
|
};
|
|
47
48
|
|
|
48
49
|
beforeEach(async () => {
|
|
49
|
-
|
|
50
|
+
// The customer's root names, read by every consumer through one context.
|
|
51
|
+
const kb = testKbContext({ kbDirName: KB_DIR, layout: { knowledgeBaseDir: 'docs', skillsDir: 'skills', pluginsDir: 'plugins' } });
|
|
50
52
|
root = await fs.mkdtemp(path.join(os.tmpdir(), 'bevel-dialect-'));
|
|
51
53
|
repo = path.join(root, wsId, KB_DIR);
|
|
52
54
|
const workspaceService = {
|
|
@@ -94,17 +96,16 @@ describe('bundle dialect, end to end', () => {
|
|
|
94
96
|
);
|
|
95
97
|
|
|
96
98
|
const disk = new NodeFs();
|
|
97
|
-
const source = new KbPluginSource(disk);
|
|
98
|
-
access = new AccessControlService(workspaceService, KB_DIR, disk);
|
|
99
|
-
skills = new SkillService(workspaceService, access,
|
|
100
|
-
tools = new ToolManualService(workspaceService, access,
|
|
101
|
-
links = new PluginLinkIndex(workspaceService, skills, access,
|
|
102
|
-
index = new PluginIndexService(workspaceService, access, skills, tools,
|
|
103
|
-
compiler = new MarketplaceCompilerService(workspaceService, access, skills, links,
|
|
104
|
-
linkService = new PluginLinksService(workspaceService, { runPendingCommit: async () => undefined }, access, skills, links,
|
|
99
|
+
const source = new KbPluginSource(disk, kb);
|
|
100
|
+
access = new AccessControlService(workspaceService, KB_DIR, disk, [], new NodeGitRunner(), kb);
|
|
101
|
+
skills = new SkillService(workspaceService, access, kb, disk);
|
|
102
|
+
tools = new ToolManualService(workspaceService, access, kb, disk, source);
|
|
103
|
+
links = new PluginLinkIndex(workspaceService, skills, access, kb, source);
|
|
104
|
+
index = new PluginIndexService(workspaceService, access, skills, tools, kb, source, Date.now, links);
|
|
105
|
+
compiler = new MarketplaceCompilerService(workspaceService, access, skills, links, kb, { name: 'acme', owner: 'Acme' }, source, disk, new NodeGitRunner());
|
|
106
|
+
linkService = new PluginLinksService(workspaceService, { runPendingCommit: async () => undefined }, access, skills, links, kb);
|
|
105
107
|
});
|
|
106
108
|
afterEach(async () => {
|
|
107
|
-
configureKbLayout({ ...DEFAULT_KB_LAYOUT });
|
|
108
109
|
await fs.rm(root, { recursive: true, force: true });
|
|
109
110
|
});
|
|
110
111
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { DEFAULT_KB_LAYOUT } from '@bevel-software/platform-shared';
|
|
2
3
|
import fs from 'node:fs/promises';
|
|
3
4
|
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
@@ -147,7 +148,7 @@ describe('bundle: what it says about itself survives', () => {
|
|
|
147
148
|
}),
|
|
148
149
|
);
|
|
149
150
|
const warnings: string[] = [];
|
|
150
|
-
const plugin = await readBundlePlugin(dir, 'plugins/ado', 'ado', null, warnings, []);
|
|
151
|
+
const plugin = await readBundlePlugin(dir, 'plugins/ado', 'ado', null, warnings, [], DEFAULT_KB_LAYOUT);
|
|
151
152
|
expect(plugin?.manifest).toEqual({
|
|
152
153
|
name: 'ado',
|
|
153
154
|
version: '1.3.5',
|
|
@@ -16,6 +16,7 @@ import { NodeGitRunner } from '../../workflow/git/node-git-runner.js';
|
|
|
16
16
|
import express from 'express';
|
|
17
17
|
import { ToolRegistry } from '../../tool-registry/tool-registry.js';
|
|
18
18
|
import { registerSkillsTools } from '../../skills/skills.tools.js';
|
|
19
|
+
import { testKbContext } from '../../../__tests__/kb-context.js';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Source in, distribution out — for one caller. The real resolver decides
|
|
@@ -90,17 +91,18 @@ describe('compileMarketplace', () => {
|
|
|
90
91
|
await write('Skills/Sales/pitch/SKILL.md', '---\ndescription: Pitch.\n---\n');
|
|
91
92
|
|
|
92
93
|
const disk = new NodeFs();
|
|
93
|
-
const
|
|
94
|
+
const kb = testKbContext({ kbDirName: KB_DIR });
|
|
95
|
+
const source = new KbPluginSource(disk, kb);
|
|
94
96
|
const access = new AccessControlService(workspaceService, KB_DIR, disk);
|
|
95
|
-
const skills = new SkillService(workspaceService, access,
|
|
97
|
+
const skills = new SkillService(workspaceService, access, kb, disk);
|
|
96
98
|
catalog = skills;
|
|
97
|
-
const links = new PluginLinkIndex(workspaceService, skills, access,
|
|
99
|
+
const links = new PluginLinkIndex(workspaceService, skills, access, kb, source);
|
|
98
100
|
compiler = new MarketplaceCompilerService(
|
|
99
101
|
workspaceService,
|
|
100
102
|
access,
|
|
101
103
|
skills,
|
|
102
104
|
links,
|
|
103
|
-
|
|
105
|
+
kb,
|
|
104
106
|
{
|
|
105
107
|
name: 'acme-hexis',
|
|
106
108
|
owner: 'Acme',
|
|
@@ -2,8 +2,13 @@ import { describe, it, expect } from 'vitest';
|
|
|
2
2
|
import { pendingProposals } from '../join-proposals.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* What a
|
|
6
|
-
* the request's lifecycle: non-empty ⇒ open, empty ⇒ settled and closed
|
|
5
|
+
* What a request's branch proposes, relative to the default branch. This diff
|
|
6
|
+
* IS the request's lifecycle: non-empty ⇒ open, empty ⇒ settled and closed,
|
|
7
|
+
* null ⇒ the branch could not be read and nothing may be concluded.
|
|
8
|
+
*
|
|
9
|
+
* Which grammar reads it follows the ITEM, and the second describe below is
|
|
10
|
+
* why: a folder's rules are block lists in an access.md body, a file's are its
|
|
11
|
+
* own frontmatter, where a single grant is a scalar.
|
|
7
12
|
*/
|
|
8
13
|
const PATH = 'Plugins/GTM/access.md';
|
|
9
14
|
|
|
@@ -17,7 +22,7 @@ describe('pendingProposals', () => {
|
|
|
17
22
|
const branch = base(
|
|
18
23
|
'read:\n - GTM Team\n - Olga Ivanova <olga@bevel.software>\n - Ali Baba <ali@bevel.software>\n',
|
|
19
24
|
);
|
|
20
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([
|
|
25
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([
|
|
21
26
|
{
|
|
22
27
|
verb: 'read',
|
|
23
28
|
id: 'user:ali@bevel.software',
|
|
@@ -31,7 +36,7 @@ describe('pendingProposals', () => {
|
|
|
31
36
|
// A branch asking for `write` must be visible AS a write request rather
|
|
32
37
|
// than hiding behind "asked to join".
|
|
33
38
|
const branch = base('read:\n - GTM Team\n - Olga Ivanova <olga@bevel.software>\nwrite:\n - Finance Team\n');
|
|
34
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([
|
|
39
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([
|
|
35
40
|
{
|
|
36
41
|
verb: 'write',
|
|
37
42
|
id: 'role:finance team',
|
|
@@ -42,12 +47,12 @@ describe('pendingProposals', () => {
|
|
|
42
47
|
});
|
|
43
48
|
|
|
44
49
|
it('is EMPTY when the branch is identical — the settled state', () => {
|
|
45
|
-
expect(pendingProposals(DEFAULT_MD, DEFAULT_MD, PATH)).toEqual([]);
|
|
50
|
+
expect(pendingProposals(DEFAULT_MD, DEFAULT_MD, PATH, 'folder')).toEqual([]);
|
|
46
51
|
});
|
|
47
52
|
|
|
48
53
|
it('is EMPTY when the branch grants a SUBSET (its proposal already landed)', () => {
|
|
49
54
|
const branch = base('read:\n - Olga Ivanova <olga@bevel.software>\n');
|
|
50
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([]);
|
|
55
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([]);
|
|
51
56
|
});
|
|
52
57
|
|
|
53
58
|
it('ignores a REMOVAL — a branch that drops one grant but keeps the rest proposes nothing', () => {
|
|
@@ -55,36 +60,38 @@ describe('pendingProposals', () => {
|
|
|
55
60
|
// ordinary change request in the review UI. (Distinct from the subset
|
|
56
61
|
// case above: here GTM Team survives and only Olga is dropped.)
|
|
57
62
|
const branch = base('read:\n - GTM Team\n');
|
|
58
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([]);
|
|
63
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([]);
|
|
59
64
|
});
|
|
60
65
|
|
|
61
66
|
it('ignores a `deny` entry — a denial is not something to accept', () => {
|
|
62
67
|
const branch = base(
|
|
63
68
|
'read:\n - GTM Team\n - Olga Ivanova <olga@bevel.software>\n - deny Ali Baba <ali@bevel.software>\n',
|
|
64
69
|
);
|
|
65
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([]);
|
|
70
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([]);
|
|
66
71
|
});
|
|
67
72
|
|
|
68
73
|
it('matches principals canonically (case-insensitive email, canonical role)', () => {
|
|
69
74
|
const branch = base('read:\n - gtm team\n - Olga I <OLGA@Bevel.Software>\n');
|
|
70
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([]);
|
|
75
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([]);
|
|
71
76
|
});
|
|
72
77
|
|
|
73
|
-
it('
|
|
74
|
-
// A body naming a verb but shaped wrong is a hard parse error
|
|
75
|
-
//
|
|
76
|
-
|
|
78
|
+
it('says NOTHING about a malformed branch file — not "nothing to propose"', () => {
|
|
79
|
+
// A body naming a verb but shaped wrong is a hard parse error. The
|
|
80
|
+
// difference matters because an empty answer CLOSES the request: it has
|
|
81
|
+
// to mean the branch asks for nothing more, never that it would not say.
|
|
82
|
+
expect(pendingProposals(base('read: GTM Team\n'), DEFAULT_MD, PATH, 'folder')).toBeNull();
|
|
77
83
|
});
|
|
78
84
|
|
|
79
|
-
it('
|
|
80
|
-
expect(pendingProposals(null, DEFAULT_MD, PATH)).
|
|
85
|
+
it('says NOTHING about a missing branch file either', () => {
|
|
86
|
+
expect(pendingProposals(null, DEFAULT_MD, PATH, 'folder')).toBeNull();
|
|
81
87
|
});
|
|
82
88
|
|
|
83
89
|
it('surfaces every branch grant when the DEFAULT file is missing or unreadable', () => {
|
|
84
|
-
// The safe direction: show the
|
|
85
|
-
//
|
|
90
|
+
// The safe direction on THAT side: show the editor proposals to consider
|
|
91
|
+
// rather than swallowing them against a baseline nobody could read.
|
|
86
92
|
const branch = base('read:\n - Ali Baba <ali@bevel.software>\n');
|
|
87
|
-
expect(pendingProposals(branch, null, PATH)).toHaveLength(1);
|
|
93
|
+
expect(pendingProposals(branch, null, PATH, 'folder')).toHaveLength(1);
|
|
94
|
+
expect(pendingProposals(branch, base('read: broken\n'), PATH, 'folder')).toHaveLength(1);
|
|
88
95
|
});
|
|
89
96
|
|
|
90
97
|
it('does not confuse the SELF-frontmatter with folder rules', () => {
|
|
@@ -96,6 +103,80 @@ describe('pendingProposals', () => {
|
|
|
96
103
|
const branch =
|
|
97
104
|
'---\nread:\n - everyone\n - Ali Baba <ali@bevel.software>\n---\n' +
|
|
98
105
|
'read:\n - GTM Team\n - Olga Ivanova <olga@bevel.software>\n';
|
|
99
|
-
expect(pendingProposals(branch, DEFAULT_MD, PATH)).toEqual([]);
|
|
106
|
+
expect(pendingProposals(branch, DEFAULT_MD, PATH, 'folder')).toEqual([]);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* A FILE's rules are not an access.md. They live in the node's own
|
|
112
|
+
* frontmatter, and `spliceGrant` writes one grant there as the scalar form
|
|
113
|
+
* the resolver accepts — `write: Rita <rita@x.io>`, not a list.
|
|
114
|
+
*
|
|
115
|
+
* Read with the FOLDER grammar that is a hard parse error ("'write:' must be
|
|
116
|
+
* a list"), the whole file yields no grants, and a branch with a perfectly
|
|
117
|
+
* good proposal on it looks like a branch with nothing left to propose. Every
|
|
118
|
+
* request whose target was a file was closed on the editors' first listing
|
|
119
|
+
* because of it — before anyone saw the line, let alone pressed Accept.
|
|
120
|
+
*/
|
|
121
|
+
describe('pendingProposals on a FILE, whose rules are its own frontmatter', () => {
|
|
122
|
+
const FILE = 'Research/Notes.md';
|
|
123
|
+
const LIVE = '---\nnodeType: "[Note](../NodeTypes/Note.md)"\n---\n# Notes\n\nbody\n';
|
|
124
|
+
/** Exactly what `spliceGrant(..., { allowScalar: true, target: 'node' })` writes. */
|
|
125
|
+
const ASKS_WRITE =
|
|
126
|
+
'---\nnodeType: "[Note](../NodeTypes/Note.md)"\nwrite: Rita Reader <rita@x.io>\n---\n# Notes\n\nbody\n';
|
|
127
|
+
|
|
128
|
+
it('reads the scalar grant the splice actually writes', () => {
|
|
129
|
+
expect(pendingProposals(ASKS_WRITE, LIVE, FILE, 'file')).toEqual([
|
|
130
|
+
{
|
|
131
|
+
verb: 'write',
|
|
132
|
+
id: 'user:rita@x.io',
|
|
133
|
+
principal: { kind: 'user', email: 'rita@x.io', displayName: 'Rita Reader' },
|
|
134
|
+
label: 'Rita Reader',
|
|
135
|
+
},
|
|
136
|
+
]);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('is not fooled by the FOLDER grammar, which cannot read it at all', () => {
|
|
140
|
+
// The regression guard. Before, this answered `[]` — indistinguishable
|
|
141
|
+
// from a finished request, which is what closed them.
|
|
142
|
+
expect(pendingProposals(ASKS_WRITE, LIVE, FILE, 'folder')).toBeNull();
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('ignores the non-access keys a node legitimately carries', () => {
|
|
146
|
+
expect(pendingProposals(LIVE, LIVE, FILE, 'file')).toEqual([]);
|
|
147
|
+
// `nodeType` is not a grant, and its presence is not a parse failure.
|
|
148
|
+
expect(pendingProposals(LIVE, null, FILE, 'file')).toEqual([]);
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
it('reads a file with no frontmatter as granting nothing, not as unreadable', () => {
|
|
152
|
+
// Nothing to say is a real answer here; a node need not declare rules.
|
|
153
|
+
expect(pendingProposals('# Just a note\n', LIVE, FILE, 'file')).toEqual([]);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('says NOTHING about a file whose frontmatter is broken — not "nothing to propose"', () => {
|
|
157
|
+
// The same rule the folder side keeps: an empty answer closes somebody's
|
|
158
|
+
// request, so a block that could not be read must not produce one.
|
|
159
|
+
const neverClosed = '---\nnodeType: "[Note](x)"\nwrite: Rita Reader <rita@x.io>\n# Notes\n\nbody\n';
|
|
160
|
+
expect(pendingProposals(neverClosed, LIVE, FILE, 'file')).toBeNull();
|
|
161
|
+
const notAMapping = '---\n- just\n- a list\n---\n# Notes\n';
|
|
162
|
+
expect(pendingProposals(notAMapping, LIVE, FILE, 'file')).toBeNull();
|
|
163
|
+
// An empty block is readable, and says nothing.
|
|
164
|
+
expect(pendingProposals('---\n---\n# Notes\n', LIVE, FILE, 'file')).toEqual([]);
|
|
165
|
+
// A broken copy on LIVE stays the safe direction: every grant looks incoming.
|
|
166
|
+
expect(pendingProposals(ASKS_WRITE, neverClosed, FILE, 'file')).toEqual([
|
|
167
|
+
expect.objectContaining({ verb: 'write', id: 'user:rita@x.io' }),
|
|
168
|
+
]);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('reads the list form too, and an Owner request', () => {
|
|
172
|
+
const asksOwner =
|
|
173
|
+
'---\nnodeType: "[Note](x)"\nowner:\n - Rita Reader <rita@x.io>\n---\n# Notes\n';
|
|
174
|
+
expect(pendingProposals(asksOwner, LIVE, FILE, 'file')).toEqual([
|
|
175
|
+
expect.objectContaining({ verb: 'owner', id: 'user:rita@x.io' }),
|
|
176
|
+
]);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('still settles a file request once the grant is on live', () => {
|
|
180
|
+
expect(pendingProposals(ASKS_WRITE, ASKS_WRITE, FILE, 'file')).toEqual([]);
|
|
100
181
|
});
|
|
101
182
|
});
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
} from '../join-request-jobs.service.js';
|
|
9
9
|
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
10
10
|
import { FakeJoinRequestStore } from './fake-join-request-store.js';
|
|
11
|
+
import { testKbContext } from '../../../__tests__/kb-context.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* The git half of a join request, on its own: what it does to the row it was
|
|
@@ -40,7 +41,7 @@ function harness(over: Partial<JoinRequestJobsDeps> = {}, sharedStore?: FakeJoin
|
|
|
40
41
|
const jobs = new PluginJoinRequestJobs(store, {
|
|
41
42
|
workflow: workflow as never,
|
|
42
43
|
workspaceService: workspaceService as never,
|
|
43
|
-
kbDirName: KB,
|
|
44
|
+
kb: testKbContext({ kbDirName: KB }),
|
|
44
45
|
target: async () => ({ folder: 'Plugins/Finance', displayName: 'Finance' }),
|
|
45
46
|
requester: async (mail) => ({ ...ALI_USER, email: mail }),
|
|
46
47
|
...over,
|
|
@@ -7,8 +7,11 @@ import {
|
|
|
7
7
|
type IWorkflowService,
|
|
8
8
|
} from '@bevel-software/platform-shared';
|
|
9
9
|
import { type WorkspaceService } from '../../workspace/workspace.service.js';
|
|
10
|
+
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
10
11
|
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
11
12
|
import { JoinRequestsService } from '../join-requests.service.js';
|
|
13
|
+
import { folderTarget } from '../../access/access-requests.contract.js';
|
|
14
|
+
import { testKbContext } from '../../../__tests__/kb-context.js';
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* The derived lifecycle: a join request is open exactly while its branch's
|
|
@@ -43,7 +46,7 @@ function cr(over: Partial<ChangeRequest> = {}): ChangeRequest {
|
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
/** `byRef[ref]` is the access.md content at that ref (undefined ⇒ absent). */
|
|
46
|
-
function makeHarness(byRef: Record<string, string>) {
|
|
49
|
+
function makeHarness(byRef: Record<string, string>, holds: Record<string, unknown> = {}) {
|
|
47
50
|
const workspaceService = {
|
|
48
51
|
ensureRemotesFetched: vi.fn(async () => undefined),
|
|
49
52
|
readFileAtRef: vi.fn(async (_ws: string, ref: string, path: string) =>
|
|
@@ -54,7 +57,21 @@ function makeHarness(byRef: Record<string, string>) {
|
|
|
54
57
|
rejectChangeRequest: vi.fn(async () => ({ number: 7, state: 'closed' })),
|
|
55
58
|
deleteBranch: vi.fn(async () => undefined),
|
|
56
59
|
} as unknown as IWorkflowService;
|
|
57
|
-
|
|
60
|
+
// Nobody holds anything by default: every proposal stands on the file diff
|
|
61
|
+
// alone, which is what these cases are about.
|
|
62
|
+
const accessControl = {
|
|
63
|
+
canRead: vi.fn(async () => false),
|
|
64
|
+
canWrite: vi.fn(async () => false),
|
|
65
|
+
canOwner: vi.fn(async () => false),
|
|
66
|
+
canDownload: vi.fn(async () => false),
|
|
67
|
+
...holds,
|
|
68
|
+
} as unknown as IAccessControl;
|
|
69
|
+
return {
|
|
70
|
+
svc: new JoinRequestsService(workspaceService, workflow, testKbContext(), accessControl),
|
|
71
|
+
workflow,
|
|
72
|
+
workspaceService,
|
|
73
|
+
accessControl,
|
|
74
|
+
};
|
|
58
75
|
}
|
|
59
76
|
|
|
60
77
|
const refs = (branchMd: string | undefined, defaultMd = DEFAULT_MD) => ({
|
|
@@ -65,7 +82,7 @@ const refs = (branchMd: string | undefined, defaultMd = DEFAULT_MD) => ({
|
|
|
65
82
|
describe('JoinRequestsService.list', () => {
|
|
66
83
|
it('reports a request with its pending proposals, and leaves it open', async () => {
|
|
67
84
|
const h = makeHarness(refs(PROPOSING_MD));
|
|
68
|
-
const out = await h.svc.list('GTM', FOLDER, [cr()], ACTOR);
|
|
85
|
+
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
69
86
|
expect(out).toHaveLength(1);
|
|
70
87
|
expect(out[0]).toMatchObject({ number: 7, requesterName: 'Ali Baba' });
|
|
71
88
|
expect(out[0].proposals.map((p) => p.label)).toEqual(['Ali Baba']);
|
|
@@ -75,7 +92,7 @@ describe('JoinRequestsService.list', () => {
|
|
|
75
92
|
it('SETTLES a request whose proposals have all landed: closes it, deletes the branch, omits it', async () => {
|
|
76
93
|
// The grant is on the default branch now, so the branch adds nothing.
|
|
77
94
|
const h = makeHarness(refs(PROPOSING_MD, PROPOSING_MD));
|
|
78
|
-
const out = await h.svc.list('GTM', FOLDER, [cr()], ACTOR);
|
|
95
|
+
const out = await h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR);
|
|
79
96
|
expect(out).toEqual([]);
|
|
80
97
|
expect(h.workflow.rejectChangeRequest).toHaveBeenCalledWith(
|
|
81
98
|
7,
|
|
@@ -113,7 +130,7 @@ describe('JoinRequestsService.list', () => {
|
|
|
113
130
|
new Error('gh down'),
|
|
114
131
|
);
|
|
115
132
|
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
116
|
-
await expect(h.svc.list('GTM', FOLDER, [cr()], ACTOR)).resolves.toEqual([]);
|
|
133
|
+
await expect(h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR)).resolves.toEqual([]);
|
|
117
134
|
expect(warn).toHaveBeenCalled();
|
|
118
135
|
warn.mockRestore();
|
|
119
136
|
});
|
|
@@ -124,7 +141,7 @@ describe('JoinRequestsService.list', () => {
|
|
|
124
141
|
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
|
|
125
142
|
// The request still settles (omitted from the list) — the leftover branch
|
|
126
143
|
// is cosmetic, and the failure is logged rather than swallowed.
|
|
127
|
-
await expect(h.svc.list('GTM', FOLDER, [cr()], ACTOR)).resolves.toEqual([]);
|
|
144
|
+
await expect(h.svc.list('GTM', folderTarget(FOLDER), [cr()], ACTOR)).resolves.toEqual([]);
|
|
128
145
|
expect(h.workflow.rejectChangeRequest).toHaveBeenCalled();
|
|
129
146
|
expect(warn).toHaveBeenCalledWith(expect.stringContaining('could not delete'));
|
|
130
147
|
warn.mockRestore();
|
|
@@ -141,10 +158,10 @@ describe('JoinRequestsService.list', () => {
|
|
|
141
158
|
[`origin/${DEFAULT_BRANCH}`]: DEFAULT_MD,
|
|
142
159
|
[`origin/${joinBranchFor(ALI, 'Finance!')}`]: DEFAULT_MD,
|
|
143
160
|
});
|
|
144
|
-
await expect(h.svc.list('finance', 'Plugins/finance', [other], ACTOR)).resolves.toEqual([]);
|
|
161
|
+
await expect(h.svc.list('finance', folderTarget('Plugins/finance'), [other], ACTOR)).resolves.toEqual([]);
|
|
145
162
|
expect(h.workflow.rejectChangeRequest).not.toHaveBeenCalled();
|
|
146
163
|
expect(h.workflow.deleteBranch).not.toHaveBeenCalled();
|
|
147
|
-
await expect(h.svc.reconcile('finance', 'Plugins/finance', other, ACTOR)).resolves.toBe(false);
|
|
164
|
+
await expect(h.svc.reconcile('finance', folderTarget('Plugins/finance'), other, ACTOR)).resolves.toBe(false);
|
|
148
165
|
expect(h.workflow.rejectChangeRequest).not.toHaveBeenCalled();
|
|
149
166
|
});
|
|
150
167
|
});
|
|
@@ -152,21 +169,21 @@ describe('JoinRequestsService.list', () => {
|
|
|
152
169
|
describe('JoinRequestsService.reconcile', () => {
|
|
153
170
|
it('settles and reports true once nothing is pending', async () => {
|
|
154
171
|
const h = makeHarness(refs(PROPOSING_MD, PROPOSING_MD));
|
|
155
|
-
await expect(h.svc.reconcile('GTM', FOLDER, cr(), ACTOR)).resolves.toBe(true);
|
|
172
|
+
await expect(h.svc.reconcile('GTM', folderTarget(FOLDER), cr(), ACTOR)).resolves.toBe(true);
|
|
156
173
|
expect(h.workflow.rejectChangeRequest).toHaveBeenCalled();
|
|
157
174
|
expect(h.workflow.deleteBranch).toHaveBeenCalled();
|
|
158
175
|
});
|
|
159
176
|
|
|
160
177
|
it('leaves a request alone while proposals remain', async () => {
|
|
161
178
|
const h = makeHarness(refs(PROPOSING_MD));
|
|
162
|
-
await expect(h.svc.reconcile('GTM', FOLDER, cr(), ACTOR)).resolves.toBe(false);
|
|
179
|
+
await expect(h.svc.reconcile('GTM', folderTarget(FOLDER), cr(), ACTOR)).resolves.toBe(false);
|
|
163
180
|
expect(h.workflow.rejectChangeRequest).not.toHaveBeenCalled();
|
|
164
181
|
});
|
|
165
182
|
|
|
166
183
|
it('refuses a change request that is not this plugin\'s join branch', async () => {
|
|
167
184
|
const h = makeHarness(refs(PROPOSING_MD, PROPOSING_MD));
|
|
168
185
|
await expect(
|
|
169
|
-
h.svc.reconcile('GTM', FOLDER, cr({ branch: 'ali/some-draft' }), ACTOR),
|
|
186
|
+
h.svc.reconcile('GTM', folderTarget(FOLDER), cr({ branch: 'ali/some-draft' }), ACTOR),
|
|
170
187
|
).resolves.toBe(false);
|
|
171
188
|
expect(h.workflow.rejectChangeRequest).not.toHaveBeenCalled();
|
|
172
189
|
});
|