@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,52 +1,171 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isJoinBranchFor, } from '@bevel-software/platform-shared';
|
|
2
2
|
import { logger } from '../../shared/logging.js';
|
|
3
3
|
const log = logger('plugins');
|
|
4
|
-
import {
|
|
4
|
+
import { rulesFileFor, } from '../access/access-requests.contract.js';
|
|
5
5
|
import { pendingProposals } from './join-proposals.js';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Access requests as PROPOSALS, and the reconciliation that retires them.
|
|
8
8
|
*
|
|
9
9
|
* The lifecycle has no state of its own — it is derived, every time, from two
|
|
10
|
-
* copies of one file:
|
|
10
|
+
* copies of one file (a folder's `access.md`, or a file's own frontmatter):
|
|
11
11
|
*
|
|
12
|
-
* open the branch
|
|
12
|
+
* open the branch proposes something the person does not already hold
|
|
13
13
|
* settled it does not
|
|
14
14
|
*
|
|
15
|
-
* so "approve" is not an operation on the request at all.
|
|
15
|
+
* so "approve" is not an operation on the request at all. An editor grants a
|
|
16
16
|
* principal through the ordinary access path (the same lock + commit every
|
|
17
17
|
* other access edit uses, gated the same way), the default branch gains that
|
|
18
|
-
* entry, and the proposal stops being pending
|
|
19
|
-
* contains it. When the last one goes, the change request has nothing left to
|
|
20
|
-
* say and is rejected, its branch deleted.
|
|
18
|
+
* entry, and the proposal stops being pending.
|
|
21
19
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* "Does not already hold" is stronger than "is not in the file", and
|
|
21
|
+
* deliberately so: Owner covers Can edit, a parent folder's grant covers this
|
|
22
|
+
* one, and a role or group carries access without naming anybody. Each of
|
|
23
|
+
* those would leave a proposal nobody can usefully accept — accepting writes
|
|
24
|
+
* a grant that changes nothing — and the request would sit open forever. See
|
|
25
|
+
* {@link JoinRequestsService.unmetProposals}.
|
|
26
|
+
*
|
|
27
|
+
* That reconciliation runs LAZILY on every listing as well as on demand, so
|
|
28
|
+
* access gained anywhere — this banner, the Manage access dialog, a hand
|
|
29
|
+
* edit, a role someone joined — settles the request that asked for it.
|
|
30
|
+
* Nothing has to remember to.
|
|
25
31
|
*/
|
|
26
32
|
export class JoinRequestsService {
|
|
27
33
|
workspaceService;
|
|
28
34
|
workflow;
|
|
29
|
-
|
|
35
|
+
kb;
|
|
36
|
+
accessControl;
|
|
37
|
+
constructor(workspaceService, workflow, kb,
|
|
38
|
+
/**
|
|
39
|
+
* Read-only, and asked one question only: does this person already hold
|
|
40
|
+
* this verb on the item, on the DEFAULT branch? See {@link unmetProposals}.
|
|
41
|
+
*/
|
|
42
|
+
accessControl) {
|
|
30
43
|
this.workspaceService = workspaceService;
|
|
31
44
|
this.workflow = workflow;
|
|
45
|
+
this.kb = kb;
|
|
46
|
+
this.accessControl = accessControl;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What `branch` still proposes for `target`, minus everything the person it
|
|
50
|
+
* names already holds — or NULL when the branch's own copy could not be read
|
|
51
|
+
* at all.
|
|
52
|
+
*
|
|
53
|
+
* That distinction is the whole point of the return type. "The branch says
|
|
54
|
+
* nothing" is NOT "the branch proposes nothing", and the two arrive as the
|
|
55
|
+
* same empty diff: `pendingProposals` reads an unreadable file as carrying
|
|
56
|
+
* no grants (fail-closed, which is right for deciding what to SHOW). Used as
|
|
57
|
+
* the settle test it is fail-open in the one direction that cannot be taken
|
|
58
|
+
* back — it closes a request nobody answered.
|
|
59
|
+
*
|
|
60
|
+
* And unreadable is the normal case for a few seconds. These reads go
|
|
61
|
+
* through `origin/<branch>` in the DEFAULT branch's clone, whose fetch is
|
|
62
|
+
* throttled; a request opened moments ago names a ref that clone has not
|
|
63
|
+
* heard of. So a miss is retried behind a FORCED fetch before it is believed,
|
|
64
|
+
* and if it still misses the caller is told nothing rather than something
|
|
65
|
+
* false.
|
|
66
|
+
*/
|
|
67
|
+
async proposalsOn(branch, target, opts = {}) {
|
|
68
|
+
const rulesPath = rulesFileFor(target);
|
|
69
|
+
await this.refresh({ force: opts.fresh });
|
|
70
|
+
let branchText = await this.readAt(branch, rulesPath);
|
|
71
|
+
if (branchText === null && !opts.fresh) {
|
|
72
|
+
await this.refresh({ force: true });
|
|
73
|
+
branchText = await this.readAt(branch, rulesPath);
|
|
74
|
+
}
|
|
75
|
+
if (branchText === null)
|
|
76
|
+
return null;
|
|
77
|
+
// `kind` picks the grammar: a folder's rules are block lists in an
|
|
78
|
+
// access.md body, a file's are its own frontmatter, where one grant is
|
|
79
|
+
// written as a scalar. Reading one with the other's grammar yields no
|
|
80
|
+
// grants, which reads as a finished request.
|
|
81
|
+
const proposals = pendingProposals(branchText, await this.readAt(this.kb.defaultBranch, rulesPath), rulesPath, target.kind);
|
|
82
|
+
// Unreadable rules on the branch: say nothing rather than "nothing left".
|
|
83
|
+
if (proposals === null)
|
|
84
|
+
return null;
|
|
85
|
+
return this.unmetProposals(proposals, target);
|
|
32
86
|
}
|
|
33
87
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
88
|
+
* Drop every proposal the live workspace has already ANSWERED, however it
|
|
89
|
+
* was answered.
|
|
90
|
+
*
|
|
91
|
+
* The file diff alone cannot see this. A request asking for `write` is
|
|
92
|
+
* satisfied by an `owner:` line, by a grant on a parent folder, or by a role
|
|
93
|
+
* or group the person has since joined — none of which put their email into
|
|
94
|
+
* this file, so the diff keeps reporting a proposal nobody can usefully
|
|
95
|
+
* accept (accepting writes a grant that changes nothing, and the request
|
|
96
|
+
* never retires). Asking the resolver the question the dialog's own grant
|
|
97
|
+
* would have to satisfy closes those requests instead of stranding them.
|
|
37
98
|
*
|
|
38
|
-
*
|
|
99
|
+
* A proposal naming a ROLE keeps the literal rule: "does this role hold the
|
|
100
|
+
* verb here" is not a question the per-person resolver answers, and a role
|
|
101
|
+
* proposal is answered by the live rules carrying it.
|
|
102
|
+
*/
|
|
103
|
+
async unmetProposals(proposals, target) {
|
|
104
|
+
const out = [];
|
|
105
|
+
for (const proposal of proposals) {
|
|
106
|
+
if (proposal.principal.kind !== 'user') {
|
|
107
|
+
out.push(proposal);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (await this.holds(proposal.principal.email, proposal.verb, target.path))
|
|
111
|
+
continue;
|
|
112
|
+
out.push(proposal);
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Does `email` hold `verb` on the ITEM, on the default branch? The verb
|
|
118
|
+
* folds are the resolver's own (owner covers write, write covers read), so
|
|
119
|
+
* this asks exactly what an accepted grant would have to achieve.
|
|
120
|
+
*
|
|
121
|
+
* Best-effort in ONE direction: a resolver that fails answers "no", which
|
|
122
|
+
* leaves the request open. A failure must never close somebody's request for
|
|
123
|
+
* them.
|
|
124
|
+
*/
|
|
125
|
+
async holds(email, verb, itemPath) {
|
|
126
|
+
const wsId = this.kb.defaultWorkspaceId();
|
|
127
|
+
try {
|
|
128
|
+
switch (verb) {
|
|
129
|
+
case 'owner':
|
|
130
|
+
return await this.accessControl.canOwner(wsId, email, itemPath);
|
|
131
|
+
case 'write':
|
|
132
|
+
return await this.accessControl.canWrite(wsId, email, itemPath);
|
|
133
|
+
case 'download':
|
|
134
|
+
return await this.accessControl.canDownload(wsId, email, itemPath);
|
|
135
|
+
default:
|
|
136
|
+
return await this.accessControl.canRead(wsId, email, itemPath);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
log.warn(`could not resolve ${verb} on "${itemPath}" for a request: ${err instanceof Error ? err.message : String(err)}`);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Open requests for one item, each carrying only what it still proposes.
|
|
146
|
+
* Requests with nothing left are reconciled away (rejected, branch deleted)
|
|
147
|
+
* and omitted.
|
|
148
|
+
*
|
|
149
|
+
* `key` is what named the branch (`joinBranchFor`) — a plugin's name for a
|
|
150
|
+
* Subscribe request, the item's own path for everything the Manage access
|
|
151
|
+
* dialog opens. `target` is the item whose rules those proposals edit; the
|
|
152
|
+
* two differ only for plugins, whose folder is not their name.
|
|
153
|
+
*
|
|
154
|
+
* `actor` is who the reconciliation acts as — an editor of the item, since
|
|
39
155
|
* rejecting a change request requires write on everything it touches.
|
|
40
156
|
*/
|
|
41
|
-
async list(
|
|
42
|
-
await this.refresh();
|
|
43
|
-
const accessPath = `${folder}/access.md`;
|
|
44
|
-
const baseText = await this.readAt(DEFAULT_BRANCH, accessPath);
|
|
157
|
+
async list(key, target, crs, actor) {
|
|
45
158
|
const out = [];
|
|
46
159
|
for (const cr of crs) {
|
|
47
|
-
if (cr.state !== 'open' || !isJoinBranchFor(cr.branch,
|
|
160
|
+
if (cr.state !== 'open' || !isJoinBranchFor(cr.branch, key))
|
|
161
|
+
continue;
|
|
162
|
+
const proposals = await this.confirmedProposals(cr.branch, target);
|
|
163
|
+
// Unreadable: leave it exactly as it is. There is nothing to offer an
|
|
164
|
+
// editor and nothing that says it is finished, and closing it on a read
|
|
165
|
+
// that failed would end somebody's request for them. It stays in Change
|
|
166
|
+
// requests for you, where it can still be answered by hand.
|
|
167
|
+
if (proposals === null)
|
|
48
168
|
continue;
|
|
49
|
-
const proposals = pendingProposals(await this.readAt(cr.branch, accessPath), baseText, accessPath);
|
|
50
169
|
if (proposals.length === 0) {
|
|
51
170
|
await this.settle(cr, actor);
|
|
52
171
|
continue;
|
|
@@ -66,17 +185,40 @@ export class JoinRequestsService {
|
|
|
66
185
|
* it was settled. Called right after a grant so the banner updates in the
|
|
67
186
|
* same round-trip instead of waiting for the next listing.
|
|
68
187
|
*/
|
|
69
|
-
async reconcile(
|
|
70
|
-
if (cr.state !== 'open' || !isJoinBranchFor(cr.branch,
|
|
188
|
+
async reconcile(key, target, cr, actor) {
|
|
189
|
+
if (cr.state !== 'open' || !isJoinBranchFor(cr.branch, key))
|
|
71
190
|
return false;
|
|
72
|
-
await this.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (proposals.length > 0)
|
|
191
|
+
const proposals = await this.confirmedProposals(cr.branch, target);
|
|
192
|
+
// Same rule as the listing: only a branch that was READ and, on a fresh
|
|
193
|
+
// read, proposes nothing is finished.
|
|
194
|
+
if (proposals === null || proposals.length > 0)
|
|
76
195
|
return false;
|
|
77
196
|
await this.settle(cr, actor);
|
|
78
197
|
return true;
|
|
79
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* What the branch proposes, with an EMPTY answer confirmed against freshly
|
|
201
|
+
* fetched refs before anyone acts on it. Null keeps its meaning: nothing
|
|
202
|
+
* could be read, so nothing can be said.
|
|
203
|
+
*
|
|
204
|
+
* The confirmation is there because an empty answer is the terminal one.
|
|
205
|
+
* These reads go through `origin/<branch>` in the default branch's clone,
|
|
206
|
+
* and that clone's fetch is throttled — so a branch whose remote-tracking
|
|
207
|
+
* ref is a few seconds old answers with the commit BEFORE the proposal was
|
|
208
|
+
* pushed. That is a file identical to live, which is an empty diff, which
|
|
209
|
+
* reads as "every grant has landed". A request nobody answered is then
|
|
210
|
+
* closed, its branch deleted, and the person told it was not accepted.
|
|
211
|
+
*
|
|
212
|
+
* One extra fetch, on the one path that cannot be undone — and when that
|
|
213
|
+
* fetch turns up a proposal after all, it is the answer, not a discarded
|
|
214
|
+
* second opinion.
|
|
215
|
+
*/
|
|
216
|
+
async confirmedProposals(branch, target) {
|
|
217
|
+
const first = await this.proposalsOn(branch, target);
|
|
218
|
+
if (first === null || first.length > 0)
|
|
219
|
+
return first;
|
|
220
|
+
return this.proposalsOn(branch, target, { fresh: true });
|
|
221
|
+
}
|
|
80
222
|
/**
|
|
81
223
|
* Close a request whose proposals have all landed, and delete its branch.
|
|
82
224
|
*
|
|
@@ -90,7 +232,7 @@ export class JoinRequestsService {
|
|
|
90
232
|
* next pass tries again.
|
|
91
233
|
*/
|
|
92
234
|
async settle(cr, actor) {
|
|
93
|
-
const wsId =
|
|
235
|
+
const wsId = this.kb.defaultWorkspaceId();
|
|
94
236
|
try {
|
|
95
237
|
await this.workflow.rejectChangeRequest(cr.number, actor, cr.state, cr.authorId ?? null, cr.base, wsId);
|
|
96
238
|
}
|
|
@@ -117,7 +259,7 @@ export class JoinRequestsService {
|
|
|
117
259
|
*/
|
|
118
260
|
async readAt(branch, repoRelPath) {
|
|
119
261
|
try {
|
|
120
|
-
return await this.workspaceService.readFileAtRef(
|
|
262
|
+
return await this.workspaceService.readFileAtRef(this.kb.defaultWorkspaceId(), `origin/${branch}`, repoRelPath);
|
|
121
263
|
}
|
|
122
264
|
catch {
|
|
123
265
|
return null;
|
|
@@ -127,10 +269,13 @@ export class JoinRequestsService {
|
|
|
127
269
|
* Refresh remote-tracking refs before reading them. Throttled inside, and
|
|
128
270
|
* best-effort: a request pushed seconds ago is worth one fetch, but a fetch
|
|
129
271
|
* failure must degrade to "read what we have" rather than empty the list.
|
|
272
|
+
*
|
|
273
|
+
* `force` skips the throttle — for the one caller that has already missed
|
|
274
|
+
* and must not mistake a stale ref list for an answer.
|
|
130
275
|
*/
|
|
131
|
-
async refresh() {
|
|
276
|
+
async refresh(opts = {}) {
|
|
132
277
|
await this.workspaceService
|
|
133
|
-
.ensureRemotesFetched(
|
|
278
|
+
.ensureRemotesFetched(this.kb.defaultWorkspaceId(), opts)
|
|
134
279
|
.catch(() => undefined);
|
|
135
280
|
}
|
|
136
281
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"join-requests.service.js","sourceRoot":"","sources":["../../../src/modules/plugins/join-requests.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"join-requests.service.js","sourceRoot":"","sources":["../../../src/modules/plugins/join-requests.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAIhB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAA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QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACK,KAAK,CAAC,OAAO,CAAC,OAA4B,EAAE;QAClD,MAAM,IAAI,CAAC,gBAAgB;aACxB,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC;aACxD,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
2
|
+
import type { KbContext } from '../../shared/kb-context.js';
|
|
2
3
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
3
4
|
import type { ISkillService } from '../skills/skills.contract.js';
|
|
4
5
|
import type { PluginMembership } from './plugins.contract.js';
|
|
@@ -15,9 +16,32 @@ export interface PluginLinks {
|
|
|
15
16
|
linkedSkills: string[];
|
|
16
17
|
/** Roots that resolve to no released skill — a typo, or a skill not yet merged. */
|
|
17
18
|
unresolvedRoots: string[];
|
|
19
|
+
/**
|
|
20
|
+
* The declared roots whose OWN access file does not carry this plugin's two
|
|
21
|
+
* grant lines, each with the linked skills its members cannot read through
|
|
22
|
+
* it — the automatic repair's work list, and the only thing that says WHICH
|
|
23
|
+
* file to write (`brokenLinks` counts skills, and a root holding twenty of
|
|
24
|
+
* them is still one file). Empty for an unmanaged (dialect) plugin, whose
|
|
25
|
+
* links grant nothing, and for a plugin whose links are all healthy.
|
|
26
|
+
*/
|
|
27
|
+
ungrantedRoots: UngrantedRoot[];
|
|
18
28
|
/** Whether hexis writes these links and checks their grants — see `DiscoveredPlugin`. */
|
|
19
29
|
linksAreManaged: boolean;
|
|
20
30
|
}
|
|
31
|
+
/** One declared root missing its grants, with the skills that go without. */
|
|
32
|
+
export interface UngrantedRoot {
|
|
33
|
+
/** Repo-relative root, exactly as the manifest declares it. */
|
|
34
|
+
root: string;
|
|
35
|
+
/** The released skill folders under it the plugin's members cannot read. */
|
|
36
|
+
skills: string[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The two verbs a link grants — the pair `PluginLinksService.grantTokens`
|
|
40
|
+
* writes and this index looks for. `owner` is deliberately not one of them: a
|
|
41
|
+
* link shares a skill and lets the plugin's managers edit it; it never hands
|
|
42
|
+
* over who validates it.
|
|
43
|
+
*/
|
|
44
|
+
export declare const LINK_GRANT_VERBS: readonly ["read", "write"];
|
|
21
45
|
export interface LinkMembership {
|
|
22
46
|
/** skill path → every plugin that holds it, inline or by link. */
|
|
23
47
|
bySkill: Map<string, PluginMembership[]>;
|
|
@@ -36,10 +60,15 @@ export interface LinkMembership {
|
|
|
36
60
|
* and the global-name dedup, and a second walk here would be a second
|
|
37
61
|
* opinion about what a skill is.
|
|
38
62
|
*
|
|
39
|
-
* `granted` is the consistency check the amber dot renders
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
63
|
+
* `granted` is the consistency check the amber dot renders, and it is a
|
|
64
|
+
* question about the FILE, not about who happens to be able to read the skill
|
|
65
|
+
* today: a link is granted when the declared ROOT's own access file carries
|
|
66
|
+
* both `plugin/<Name>/read` and `plugin/<Name>/write`, and neither is denied
|
|
67
|
+
* at that root or between it and the skill. A root that is readable by
|
|
68
|
+
* everyone, or that inherits a plugin grant from a folder above, is NOT
|
|
69
|
+
* granted — the grant is the link's contract, and a public root merely hides
|
|
70
|
+
* its absence until the day someone restricts the tree. The link service
|
|
71
|
+
* writes those two lines with the link; only a hand edit takes them away.
|
|
43
72
|
*
|
|
44
73
|
* Cached briefly, dropped by `invalidate()` from the same file-change
|
|
45
74
|
* subscriber that drops the plugin index, so a link committed on the default
|
|
@@ -49,21 +78,47 @@ export declare class PluginLinkIndex {
|
|
|
49
78
|
private readonly workspaceService;
|
|
50
79
|
private readonly skillService;
|
|
51
80
|
private readonly accessControl;
|
|
52
|
-
private readonly
|
|
81
|
+
private readonly kb;
|
|
53
82
|
/** Where plugins come from — the one discovery every catalog shares. */
|
|
54
83
|
private readonly source;
|
|
55
84
|
private readonly cache;
|
|
56
|
-
constructor(workspaceService: WorkspaceService, skillService: ISkillService, accessControl: IAccessControl,
|
|
85
|
+
constructor(workspaceService: WorkspaceService, skillService: ISkillService, accessControl: IAccessControl, kb: KbContext,
|
|
57
86
|
/** Where plugins come from — the one discovery every catalog shares. */
|
|
58
87
|
source: PluginSource, now?: () => number);
|
|
88
|
+
private get kbDirName();
|
|
59
89
|
invalidate(): void;
|
|
60
90
|
membership(): Promise<LinkMembership>;
|
|
61
91
|
/** Convenience: the memberships of one skill (empty when it is in no plugin). */
|
|
62
92
|
pluginsOf(skillPath: string): Promise<PluginMembership[]>;
|
|
63
93
|
private build;
|
|
64
|
-
/**
|
|
65
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Whether the ROOT's own access file carries both of the link's grant lines.
|
|
96
|
+
*
|
|
97
|
+
* "Its own" is the whole rule: `grantSources` reports every scope that
|
|
98
|
+
* grants the principal, closest-first, so `[0].kind === 'direct'` is
|
|
99
|
+
* "granted by the file this root's link writes" — a grant inherited from a
|
|
100
|
+
* folder above is an `ancestor` source and does not count, and a root that
|
|
101
|
+
* is simply public names the principal nowhere and yields no source at all.
|
|
102
|
+
* `tokenMatch: 'exact'` pins the comparison to the canonical token the
|
|
103
|
+
* grant is written as, the same spelling `grantTokens` splices.
|
|
104
|
+
*
|
|
105
|
+
* A `deny` of either token in that same file is not granted either, whatever
|
|
106
|
+
* the resolver makes of a grant beside it: the deny is the operator's, the
|
|
107
|
+
* repair never removes it, and reporting the link as healthy would hide the
|
|
108
|
+
* one thing the banner exists to say. `locallyDeniedPrincipals` is what sees
|
|
109
|
+
* it — the per-verb denial walk cannot, since a grant in the same scope wins
|
|
110
|
+
* there and ends the walk.
|
|
111
|
+
*/
|
|
112
|
+
private rootCarriesGrants;
|
|
113
|
+
/**
|
|
114
|
+
* Whether either grant is DENIED below the root — at the skill's own folder
|
|
115
|
+
* or at anything between it and the root.
|
|
116
|
+
*
|
|
117
|
+
* The denial walk stops at a closer grant, and the root's grant is what
|
|
118
|
+
* brought us here, so what this reports is exactly the scopes under the
|
|
119
|
+
* root: a `deny` above the root is dead under closeness-first and is not
|
|
120
|
+
* this link's problem.
|
|
121
|
+
*/
|
|
122
|
+
private deniedBetween;
|
|
66
123
|
}
|
|
67
|
-
/** The default-branch workspace id every link resolution runs against. */
|
|
68
|
-
export declare function linksWorkspaceId(): string;
|
|
69
124
|
//# sourceMappingURL=plugin-links.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-links.d.ts","sourceRoot":"","sources":["../../../src/modules/plugins/plugin-links.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin-links.d.ts","sourceRoot":"","sources":["../../../src/modules/plugins/plugin-links.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,kEAAkE;IAClE,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mFAAmF;IACnF,eAAe,EAAE,MAAM,EAAE,CAA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