@bevel-software/platform-core-backend 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +45 -105
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +33 -5
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +146 -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.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/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/audit/agent-audit.service.d.ts +54 -0
- package/dist/modules/audit/agent-audit.service.d.ts.map +1 -0
- package/dist/modules/audit/agent-audit.service.js +290 -0
- package/dist/modules/audit/agent-audit.service.js.map +1 -0
- package/dist/modules/audit/agent-rest-audit.middleware.d.ts +40 -0
- package/dist/modules/audit/agent-rest-audit.middleware.d.ts.map +1 -0
- package/dist/modules/audit/agent-rest-audit.middleware.js +75 -0
- package/dist/modules/audit/agent-rest-audit.middleware.js.map +1 -0
- package/dist/modules/audit/audit.contract.d.ts +145 -0
- package/dist/modules/audit/audit.contract.d.ts.map +1 -0
- package/dist/modules/audit/audit.contract.js +35 -0
- package/dist/modules/audit/audit.contract.js.map +1 -0
- package/dist/modules/audit/audit.routes.d.ts +21 -0
- package/dist/modules/audit/audit.routes.d.ts.map +1 -0
- package/dist/modules/audit/audit.routes.js +157 -0
- package/dist/modules/audit/audit.routes.js.map +1 -0
- package/dist/modules/audit/event-classifier.d.ts +52 -0
- package/dist/modules/audit/event-classifier.d.ts.map +1 -0
- package/dist/modules/audit/event-classifier.js +123 -0
- package/dist/modules/audit/event-classifier.js.map +1 -0
- package/dist/modules/audit/index.d.ts +7 -0
- package/dist/modules/audit/index.d.ts.map +1 -0
- package/dist/modules/audit/index.js +7 -0
- package/dist/modules/audit/index.js.map +1 -0
- package/dist/modules/audit/request-audit.d.ts +57 -0
- package/dist/modules/audit/request-audit.d.ts.map +1 -0
- package/dist/modules/audit/request-audit.js +117 -0
- package/dist/modules/audit/request-audit.js.map +1 -0
- 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 +19 -1
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +33 -1
- 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/core-schema.d.ts +414 -0
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +99 -0
- package/dist/modules/database/core-schema.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/diff/diff.service.d.ts.map +1 -1
- package/dist/modules/diff/diff.service.js +6 -1
- package/dist/modules/diff/diff.service.js.map +1 -1
- 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/git-guarded-filesystem.d.ts +9 -1
- package/dist/modules/kb-fs/git-guarded-filesystem.d.ts.map +1 -1
- package/dist/modules/kb-fs/git-guarded-filesystem.js +16 -3
- package/dist/modules/kb-fs/git-guarded-filesystem.js.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.d.ts +1 -0
- package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.js +32 -0
- package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
- package/dist/modules/mcp/mcp.routes.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.routes.js +8 -1
- package/dist/modules/mcp/mcp.routes.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +16 -1
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +52 -9
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +59 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +180 -8
- package/dist/modules/mcp/oauth/bevel-oauth-provider.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-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 +3 -1
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +9 -8
- 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 +45 -15
- 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 +22 -10
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +52 -28
- package/dist/modules/settings/deployment-settings.service.js.map +1 -1
- package/dist/modules/settings/setup.routes.d.ts +9 -2
- package/dist/modules/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +20 -14
- 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 +2 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +6 -6
- 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-auth/external-api-key.interface.d.ts +21 -5
- package/dist/modules/tool-auth/external-api-key.interface.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.interface.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts +1 -0
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js +22 -9
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
- package/dist/modules/tool-auth/internal-token.service.d.ts +10 -0
- package/dist/modules/tool-auth/internal-token.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/internal-token.service.js +1 -0
- package/dist/modules/tool-auth/internal-token.service.js.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts +8 -0
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.js +9 -1
- package/dist/modules/tool-auth/tool-auth.middleware.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 +9 -9
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +11 -5
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +23 -14
- 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 +35 -5
- package/dist/modules/workflow/git/node-git-runner.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.service.d.ts +8 -3
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +33 -23
- 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 +5 -8
- package/dist/modules/workspace/startup/kb-startup-runner.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js +35 -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 +26 -12
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +41 -28
- 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 +69 -31
- 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/git-internals.d.ts +7 -1
- package/dist/shared/git-internals.d.ts.map +1 -1
- package/dist/shared/git-internals.js +67 -9
- package/dist/shared/git-internals.js.map +1 -1
- package/dist/shared/git.contract.d.ts +52 -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 +41 -0
- package/migrations/0013_agent_identity_and_key_soft_delete.sql +29 -0
- package/migrations/meta/0012_snapshot.json +2247 -0
- package/migrations/meta/0013_snapshot.json +2259 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +4 -4
- 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 +55 -106
- package/src/core/create-core-services.ts +193 -95
- 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.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.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/agent-instructions/__tests__/read-preamble.test.ts +13 -12
- package/src/modules/agent-instructions/read-preamble.ts +10 -12
- package/src/modules/audit/__tests__/agent-audit.service.test.ts +370 -0
- package/src/modules/audit/__tests__/agent-rest-audit.middleware.test.ts +113 -0
- package/src/modules/audit/__tests__/audit.routes.test.ts +201 -0
- package/src/modules/audit/__tests__/event-classifier.test.ts +121 -0
- package/src/modules/audit/agent-audit.service.ts +316 -0
- package/src/modules/audit/agent-rest-audit.middleware.ts +83 -0
- package/src/modules/audit/audit.contract.ts +164 -0
- package/src/modules/audit/audit.routes.ts +168 -0
- package/src/modules/audit/event-classifier.ts +155 -0
- package/src/modules/audit/index.ts +14 -0
- package/src/modules/audit/request-audit.ts +141 -0
- package/src/modules/auth/__tests__/account.routes.test.ts +15 -0
- package/src/modules/auth/__tests__/auth.service.test.ts +60 -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 +33 -1
- 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/core-schema.ts +104 -0
- 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/diff/diff.service.ts +6 -1
- 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/branch-name.ts +3 -3
- package/src/modules/kb-fs/clone-config.ts +15 -12
- package/src/modules/kb-fs/git-guarded-filesystem.ts +16 -3
- package/src/modules/marketplace/__tests__/marketplace-repo.head.test.ts +2 -1
- package/src/modules/mcp/__tests__/bevel-oauth-provider.test.ts +183 -13
- package/src/modules/mcp/__tests__/mcp-auth.middleware.test.ts +60 -2
- package/src/modules/mcp/__tests__/mcp.routes.local-token.test.ts +24 -4
- package/src/modules/mcp/__tests__/mcp.routes.stateless.test.ts +1 -1
- package/src/modules/mcp/__tests__/mcp.service.test.ts +120 -3
- package/src/modules/mcp/mcp-auth.middleware.ts +31 -0
- package/src/modules/mcp/mcp.routes.ts +11 -1
- package/src/modules/mcp/mcp.service.ts +73 -8
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +184 -6
- 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-request-jobs.service.test.ts +2 -1
- package/src/modules/plugins/__tests__/join-requests.service.test.ts +2 -1
- 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 +11 -2
- 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-request-jobs.service.ts +8 -7
- package/src/modules/plugins/join-requests.service.ts +7 -7
- 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 +45 -15
- 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 +59 -11
- package/src/modules/settings/__tests__/git-root-folders.test.ts +2 -1
- package/src/modules/settings/__tests__/setup.routes.boot-failure.test.ts +2 -1
- package/src/modules/settings/__tests__/setup.routes.layout-phase.test.ts +7 -4
- 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 +68 -28
- package/src/modules/settings/setup.routes.ts +26 -16
- 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 +2 -1
- 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 +7 -7
- package/src/modules/skills/skills.routes.ts +4 -3
- package/src/modules/skills/skills.service.ts +13 -9
- package/src/modules/tool-auth/__tests__/external-api-key.service.test.ts +29 -8
- package/src/modules/tool-auth/__tests__/internal-token.service.test.ts +6 -0
- package/src/modules/tool-auth/external-api-key.interface.ts +22 -5
- package/src/modules/tool-auth/external-api-key.service.ts +25 -8
- package/src/modules/tool-auth/internal-token.service.ts +11 -0
- package/src/modules/tool-auth/tool-auth.middleware.ts +17 -1
- 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-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 +2 -1
- 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 +28 -27
- 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 +2 -1
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +2 -1
- package/src/modules/workflow/agent-tools/workflow.tools.ts +11 -9
- 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 +9 -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/git.service.ts +24 -13
- package/src/modules/workflow/git/node-git-runner.ts +37 -4
- 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.service.ts +31 -24
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +3 -2
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +144 -52
- 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 +2 -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 +4 -3
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +9 -8
- 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 +29 -21
- package/src/modules/workspace/startup/kb-git.ts +15 -22
- package/src/modules/workspace/startup/kb-startup-runner.ts +40 -46
- 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 +39 -27
- package/src/modules/workspace/workspace.tools.ts +68 -31
- package/src/modules/workspace/write-denial.ts +7 -5
- package/src/shared/__tests__/git-internals.test.ts +41 -0
- package/src/shared/__tests__/kb-layout.plugin.test.ts +19 -16
- package/src/shared/git-internals.ts +61 -6
- package/src/shared/git.contract.ts +70 -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
- package/dist/modules/access/access-errors.d.ts +0 -34
- package/dist/modules/access/access-errors.d.ts.map +0 -1
- package/dist/modules/access/access-errors.js +0 -40
- package/dist/modules/access/access-errors.js.map +0 -1
- package/dist/modules/access/access-splice.d.ts +0 -140
- package/dist/modules/access/access-splice.d.ts.map +0 -1
- package/dist/modules/access/access-splice.js +0 -389
- package/dist/modules/access/access-splice.js.map +0 -1
- package/dist/modules/access/group-files.d.ts +0 -83
- package/dist/modules/access/group-files.d.ts.map +0 -1
- package/dist/modules/access/group-files.js +0 -167
- package/dist/modules/access/group-files.js.map +0 -1
- package/dist/modules/access/kb-read-filter.d.ts +0 -41
- package/dist/modules/access/kb-read-filter.d.ts.map +0 -1
- package/dist/modules/access/kb-read-filter.js +0 -60
- package/dist/modules/access/kb-read-filter.js.map +0 -1
- package/dist/modules/access/render-roles-yaml.d.ts +0 -22
- package/dist/modules/access/render-roles-yaml.d.ts.map +0 -1
- package/dist/modules/access/render-roles-yaml.js +0 -56
- package/dist/modules/access/render-roles-yaml.js.map +0 -1
- package/dist/modules/access/roles-yaml-guard.d.ts +0 -56
- package/dist/modules/access/roles-yaml-guard.d.ts.map +0 -1
- package/dist/modules/access/roles-yaml-guard.js +0 -79
- package/dist/modules/access/roles-yaml-guard.js.map +0 -1
- package/dist/modules/diff/diff-paths.d.ts +0 -2
- package/dist/modules/diff/diff-paths.d.ts.map +0 -1
- package/dist/modules/diff/diff-paths.js +0 -9
- package/dist/modules/diff/diff-paths.js.map +0 -1
- package/dist/modules/groups/group-provision.service.d.ts +0 -130
- package/dist/modules/groups/group-provision.service.d.ts.map +0 -1
- package/dist/modules/groups/group-provision.service.js +0 -288
- package/dist/modules/groups/group-provision.service.js.map +0 -1
- package/dist/modules/groups/groups.contract.d.ts +0 -106
- package/dist/modules/groups/groups.contract.d.ts.map +0 -1
- package/dist/modules/groups/groups.contract.js +0 -36
- package/dist/modules/groups/groups.contract.js.map +0 -1
- package/dist/modules/groups/groups.routes.d.ts +0 -42
- package/dist/modules/groups/groups.routes.d.ts.map +0 -1
- package/dist/modules/groups/groups.routes.js +0 -379
- package/dist/modules/groups/groups.routes.js.map +0 -1
- package/dist/modules/groups/groups.service.d.ts +0 -60
- package/dist/modules/groups/groups.service.d.ts.map +0 -1
- package/dist/modules/groups/groups.service.js +0 -172
- package/dist/modules/groups/groups.service.js.map +0 -1
- package/dist/modules/groups/index.d.ts +0 -7
- package/dist/modules/groups/index.d.ts.map +0 -1
- package/dist/modules/groups/index.js +0 -6
- package/dist/modules/groups/index.js.map +0 -1
- package/dist/modules/groups/join-proposals.d.ts +0 -53
- package/dist/modules/groups/join-proposals.d.ts.map +0 -1
- package/dist/modules/groups/join-proposals.js +0 -67
- package/dist/modules/groups/join-proposals.js.map +0 -1
- package/dist/modules/groups/join-requests.service.d.ts +0 -81
- package/dist/modules/groups/join-requests.service.d.ts.map +0 -1
- package/dist/modules/groups/join-requests.service.js +0 -135
- package/dist/modules/groups/join-requests.service.js.map +0 -1
- package/dist/modules/mcp/mcp-session-store.d.ts +0 -74
- package/dist/modules/mcp/mcp-session-store.d.ts.map +0 -1
- package/dist/modules/mcp/mcp-session-store.js +0 -131
- package/dist/modules/mcp/mcp-session-store.js.map +0 -1
- package/dist/modules/workflow/file-change-notifier.d.ts +0 -38
- package/dist/modules/workflow/file-change-notifier.d.ts.map +0 -1
- package/dist/modules/workflow/file-change-notifier.js +0 -22
- package/dist/modules/workflow/file-change-notifier.js.map +0 -1
- package/dist/modules/workflow/git/branch-name.d.ts +0 -10
- package/dist/modules/workflow/git/branch-name.d.ts.map +0 -1
- package/dist/modules/workflow/git/branch-name.js +0 -76
- package/dist/modules/workflow/git/branch-name.js.map +0 -1
- package/dist/modules/workflow/git/clone-config.d.ts +0 -61
- package/dist/modules/workflow/git/clone-config.d.ts.map +0 -1
- package/dist/modules/workflow/git/clone-config.js +0 -69
- package/dist/modules/workflow/git/clone-config.js.map +0 -1
- package/dist/modules/workflow/git/mutex.d.ts +0 -11
- package/dist/modules/workflow/git/mutex.d.ts.map +0 -1
- package/dist/modules/workflow/git/mutex.js +0 -23
- package/dist/modules/workflow/git/mutex.js.map +0 -1
- package/dist/modules/workflow/locking-filesystem.d.ts +0 -137
- package/dist/modules/workflow/locking-filesystem.d.ts.map +0 -1
- package/dist/modules/workflow/locking-filesystem.js +0 -553
- package/dist/modules/workflow/locking-filesystem.js.map +0 -1
- package/dist/modules/workflow/read-only-filesystem.d.ts +0 -24
- package/dist/modules/workflow/read-only-filesystem.d.ts.map +0 -1
- package/dist/modules/workflow/read-only-filesystem.js +0 -39
- package/dist/modules/workflow/read-only-filesystem.js.map +0 -1
- package/dist/modules/workflow/workflow.errors.d.ts +0 -197
- package/dist/modules/workflow/workflow.errors.d.ts.map +0 -1
- package/dist/modules/workflow/workflow.errors.js +0 -298
- package/dist/modules/workflow/workflow.errors.js.map +0 -1
- package/dist/modules/workspace/bevel-ignore.d.ts +0 -30
- package/dist/modules/workspace/bevel-ignore.d.ts.map +0 -1
- package/dist/modules/workspace/bevel-ignore.js +0 -61
- package/dist/modules/workspace/bevel-ignore.js.map +0 -1
- package/dist/modules/workspace/kb-seed.interface.d.ts +0 -36
- package/dist/modules/workspace/kb-seed.interface.d.ts.map +0 -1
- package/dist/modules/workspace/kb-seed.interface.js +0 -2
- package/dist/modules/workspace/kb-seed.interface.js.map +0 -1
- package/dist/modules/workspace/kb-seed.service.d.ts +0 -125
- package/dist/modules/workspace/kb-seed.service.d.ts.map +0 -1
- package/dist/modules/workspace/kb-seed.service.js +0 -535
- package/dist/modules/workspace/kb-seed.service.js.map +0 -1
- package/dist/modules/workspace/plugins-migration.d.ts +0 -50
- package/dist/modules/workspace/plugins-migration.d.ts.map +0 -1
- package/dist/modules/workspace/plugins-migration.js +0 -379
- package/dist/modules/workspace/plugins-migration.js.map +0 -1
- package/dist/shared/fs-errors.d.ts +0 -8
- package/dist/shared/fs-errors.d.ts.map +0 -1
- package/dist/shared/fs-errors.js +0 -11
- package/dist/shared/fs-errors.js.map +0 -1
- package/dist/shared/fs-walk.d.ts +0 -23
- package/dist/shared/fs-walk.d.ts.map +0 -1
- package/dist/shared/fs-walk.js +0 -42
- package/dist/shared/fs-walk.js.map +0 -1
- package/dist/shared/hash-email.d.ts +0 -11
- package/dist/shared/hash-email.d.ts.map +0 -1
- package/dist/shared/hash-email.js +0 -14
- package/dist/shared/hash-email.js.map +0 -1
- package/dist/shared/kb-walk.d.ts +0 -52
- package/dist/shared/kb-walk.d.ts.map +0 -1
- package/dist/shared/kb-walk.js +0 -76
- package/dist/shared/kb-walk.js.map +0 -1
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { PLUGIN_MANIFEST_FILE, linkedSkillRoots, normalizeSkillRoot, pluginManifestName, renderPluginManifest, skillUnderRoot, withLinkedSkillRoots, } from '@bevel-software/platform-shared';
|
|
4
4
|
import { isAbsence } from '../../shared/fs.contract.js';
|
|
5
5
|
import { AccessMutationService, accessMdPathForFolder } from '../access/access-mutation.service.js';
|
|
6
6
|
import { pluginPrincipalKey } from '../access-model/access-grammar.js';
|
|
7
7
|
import { WorkspaceMutex } from '../kb-fs/mutex.js';
|
|
8
|
-
import {
|
|
8
|
+
import { logger } from '../../shared/logging.js';
|
|
9
|
+
const log = logger('plugins');
|
|
10
|
+
/**
|
|
11
|
+
* The commit subject for an automatic repair. It names the plugin, the root
|
|
12
|
+
* and the fact that nobody asked for it — the commit is the ONLY trace a
|
|
13
|
+
* silent repair leaves, so the history has to explain itself. Falls back to
|
|
14
|
+
* the path-derived default when a very long root would blow the 200-character
|
|
15
|
+
* subject limit: a missed explanation is not worth a failed repair.
|
|
16
|
+
*/
|
|
17
|
+
function repairSummary(plugin, root) {
|
|
18
|
+
const subject = `Repair link: ${plugin} → ${root} (automatic, on opening the plugin page)`;
|
|
19
|
+
return subject.length <= 200 ? subject : undefined;
|
|
20
|
+
}
|
|
9
21
|
/** A refusal the route passes through: message + HTTP status + a machine-readable kind. */
|
|
10
22
|
export class PluginLinkError extends Error {
|
|
11
23
|
status;
|
|
@@ -42,7 +54,9 @@ export class PluginLinkError extends Error {
|
|
|
42
54
|
* skill page says so, for a skill editor to remove.
|
|
43
55
|
*
|
|
44
56
|
* Repair re-grants the tokens for a link that exists but whose grant was
|
|
45
|
-
* hand-removed
|
|
57
|
+
* hand-removed — the amber dot's one action, run one link at a time from the
|
|
58
|
+
* skill page, or over a whole plugin's links by `repairAll` the moment
|
|
59
|
+
* somebody who may write that plugin opens its page.
|
|
46
60
|
*
|
|
47
61
|
* Every operation is serialised on BOTH sides it writes — the plugin's
|
|
48
62
|
* manifest slug (the same key provisioning locks on) and the skill root whose
|
|
@@ -56,26 +70,29 @@ export class PluginLinksService {
|
|
|
56
70
|
accessControl;
|
|
57
71
|
skillService;
|
|
58
72
|
links;
|
|
59
|
-
|
|
73
|
+
kb;
|
|
60
74
|
events;
|
|
61
75
|
onChanged;
|
|
62
76
|
locks = new WorkspaceMutex();
|
|
63
77
|
mutation;
|
|
64
|
-
constructor(workspaceService, commits, accessControl, skillService, links,
|
|
78
|
+
constructor(workspaceService, commits, accessControl, skillService, links, kb, events, onChanged) {
|
|
65
79
|
this.workspaceService = workspaceService;
|
|
66
80
|
this.commits = commits;
|
|
67
81
|
this.accessControl = accessControl;
|
|
68
82
|
this.skillService = skillService;
|
|
69
83
|
this.links = links;
|
|
70
|
-
this.
|
|
84
|
+
this.kb = kb;
|
|
71
85
|
this.events = events;
|
|
72
86
|
this.onChanged = onChanged;
|
|
73
|
-
this.mutation = new AccessMutationService(workspaceService, accessControl, kbDirName);
|
|
87
|
+
this.mutation = new AccessMutationService(workspaceService, accessControl, kb.kbDirName);
|
|
88
|
+
}
|
|
89
|
+
get kbDirName() {
|
|
90
|
+
return this.kb.kbDirName;
|
|
74
91
|
}
|
|
75
92
|
async link(user, plugin, rawRoot) {
|
|
76
93
|
const folder = await this.pluginFolder(plugin);
|
|
77
94
|
const root = this.rootOrThrow(rawRoot);
|
|
78
|
-
const wsId =
|
|
95
|
+
const wsId = this.kb.defaultWorkspaceId();
|
|
79
96
|
await this.requirePluginWrite(wsId, user, folder);
|
|
80
97
|
const skills = await this.resolvedSkills(root);
|
|
81
98
|
if (skills.length === 0) {
|
|
@@ -99,7 +116,7 @@ export class PluginLinksService {
|
|
|
99
116
|
// surfaces.
|
|
100
117
|
if (!roots.includes(root)) {
|
|
101
118
|
await this.workspaceService.writeFile(wsId, manifestRel, `${JSON.stringify(withLinkedSkillRoots(manifest, [...roots, root]), null, 2)}\n`);
|
|
102
|
-
await this.commits.runPendingCommit(wsId,
|
|
119
|
+
await this.commits.runPendingCommit(wsId, this.kb.defaultBranch, manifestRel, user);
|
|
103
120
|
}
|
|
104
121
|
await this.grantTokens(wsId, user, folder, root);
|
|
105
122
|
this.changed(wsId);
|
|
@@ -109,7 +126,7 @@ export class PluginLinksService {
|
|
|
109
126
|
async unlink(user, plugin, rawRoot) {
|
|
110
127
|
const folder = await this.pluginFolder(plugin);
|
|
111
128
|
const root = this.rootOrThrow(rawRoot);
|
|
112
|
-
const wsId =
|
|
129
|
+
const wsId = this.kb.defaultWorkspaceId();
|
|
113
130
|
await this.requirePluginWrite(wsId, user, folder);
|
|
114
131
|
return this.locks.runAll(this.lockKeys(folder, root), async () => {
|
|
115
132
|
const { manifest, manifestRel } = await this.readManifest(wsId, folder);
|
|
@@ -133,20 +150,35 @@ export class PluginLinksService {
|
|
|
133
150
|
changed ||= r.changed;
|
|
134
151
|
}
|
|
135
152
|
if (changed) {
|
|
136
|
-
await this.commits.runPendingCommit(wsId,
|
|
153
|
+
await this.commits.runPendingCommit(wsId, this.kb.defaultBranch, `${this.kbDirName}/${accessMdPathForFolder(root)}`, user);
|
|
137
154
|
}
|
|
138
155
|
revoked = true;
|
|
139
156
|
}
|
|
140
157
|
await this.workspaceService.writeFile(wsId, manifestRel, `${JSON.stringify(withLinkedSkillRoots(manifest, roots.filter((r) => r !== root)), null, 2)}\n`);
|
|
141
|
-
await this.commits.runPendingCommit(wsId,
|
|
158
|
+
await this.commits.runPendingCommit(wsId, this.kb.defaultBranch, manifestRel, user);
|
|
142
159
|
this.changed(wsId);
|
|
143
160
|
return { root, revoked };
|
|
144
161
|
});
|
|
145
162
|
}
|
|
146
|
-
|
|
163
|
+
/**
|
|
164
|
+
* Re-grant one link's two tokens. The skill EDITOR's verb (the plugin side
|
|
165
|
+
* is not consulted): the amber dot's one manual action, and the single
|
|
166
|
+
* write the automatic repair runs too — see {@link repairAll}.
|
|
167
|
+
*
|
|
168
|
+
* `summary` is the commit subject when the caller has a better one than the
|
|
169
|
+
* path-derived default; the automatic repair passes one that says it was
|
|
170
|
+
* automatic, because the commit is the only trace it leaves.
|
|
171
|
+
*
|
|
172
|
+
* `written` says whether the file changed. A root that already carried
|
|
173
|
+
* both lines is left alone and reports false — which, for a root the index
|
|
174
|
+
* called ungranted, means the lines are not what is missing (a `deny`
|
|
175
|
+
* beside them is): the automatic repair reads it as "still broken", not as
|
|
176
|
+
* repaired.
|
|
177
|
+
*/
|
|
178
|
+
async repair(user, plugin, rawRoot, opts) {
|
|
147
179
|
const folder = await this.pluginFolder(plugin);
|
|
148
180
|
const root = this.rootOrThrow(rawRoot);
|
|
149
|
-
const wsId =
|
|
181
|
+
const wsId = this.kb.defaultWorkspaceId();
|
|
150
182
|
// Everything under the lock, the manifest read included: a repair that
|
|
151
183
|
// checked the link and then waited on an unlink would re-grant a root the
|
|
152
184
|
// manifest no longer names.
|
|
@@ -161,12 +193,100 @@ export class PluginLinksService {
|
|
|
161
193
|
root,
|
|
162
194
|
});
|
|
163
195
|
}
|
|
164
|
-
await this.grantTokens(wsId, user, folder, root);
|
|
196
|
+
const written = await this.grantTokens(wsId, user, folder, root, opts?.summary);
|
|
165
197
|
this.changed(wsId);
|
|
166
|
-
return { root };
|
|
198
|
+
return { root, written };
|
|
167
199
|
});
|
|
168
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Repair EVERY link of `plugin` that is missing its grants — what opening
|
|
203
|
+
* the plugin's page runs for someone who may write the plugin.
|
|
204
|
+
*
|
|
205
|
+
* Two gates, in this order: the caller must be able to write the PLUGIN
|
|
206
|
+
* (this is the plugin's page repairing its own links, not a way to write
|
|
207
|
+
* other people's access files), and then, per root, to write that root's
|
|
208
|
+
* access file. A root they cannot write is left exactly as it is and comes
|
|
209
|
+
* back in `skipped` with the people who CAN write it, which is the sentence
|
|
210
|
+
* the banner then says. Nothing comes back for a root that was repaired:
|
|
211
|
+
* the commit is the trace, the page simply renders with the link healthy.
|
|
212
|
+
*
|
|
213
|
+
* Root by root through {@link repair} — the same write, the same manifest
|
|
214
|
+
* check, the same pair of locks — so the automatic path and the button on
|
|
215
|
+
* the skill page can never write different things. Each root's failure is
|
|
216
|
+
* caught into `skipped`: one unwritable file must not cost the others their
|
|
217
|
+
* repair, nor the page its render.
|
|
218
|
+
*
|
|
219
|
+
* A root the repair did not have to write is NOT repaired. The work list
|
|
220
|
+
* holds only roots the index called ungranted, so a root whose two lines
|
|
221
|
+
* were already there is broken by something the lines cannot fix — a `deny`
|
|
222
|
+
* of the plugin in that same file — and reporting it repaired would hide
|
|
223
|
+
* the one link the writer opening this page could not see anywhere else.
|
|
224
|
+
*/
|
|
225
|
+
async repairAll(user, plugin) {
|
|
226
|
+
const folder = await this.pluginFolder(plugin);
|
|
227
|
+
const wsId = this.kb.defaultWorkspaceId();
|
|
228
|
+
await this.requirePluginWrite(wsId, user, folder);
|
|
229
|
+
// Read the work list ONCE, before the first write: `repair` invalidates
|
|
230
|
+
// the index, and re-reading it per root would rebuild the whole membership
|
|
231
|
+
// between every commit.
|
|
232
|
+
const work = (await this.links.membership()).byPlugin.get(folder)?.ungrantedRoots ?? [];
|
|
233
|
+
if (work.length === 0)
|
|
234
|
+
return { repaired: [], skipped: [] };
|
|
235
|
+
const named = new Map((await this.skillService.listSkills(undefined)).map((s) => [s.path, s.name]));
|
|
236
|
+
const repaired = [];
|
|
237
|
+
const skipped = [];
|
|
238
|
+
const leftBroken = async (item, reason) => {
|
|
239
|
+
skipped.push({
|
|
240
|
+
root: item.root,
|
|
241
|
+
reason,
|
|
242
|
+
skills: item.skills.map((path) => ({ path, name: named.get(path) ?? path.split('/').pop() ?? path })),
|
|
243
|
+
editors: await this.editorsOf(wsId, item.root),
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
for (const item of work) {
|
|
247
|
+
try {
|
|
248
|
+
const { written } = await this.repair(user, folder, item.root, { summary: repairSummary(folder, item.root) });
|
|
249
|
+
if (written)
|
|
250
|
+
repaired.push(item.root);
|
|
251
|
+
else
|
|
252
|
+
await leftBroken(item, 'denied');
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
const needsWrite = err instanceof PluginLinkError && err.payload.kind === 'needs-skill-write';
|
|
256
|
+
if (!needsWrite)
|
|
257
|
+
log.warn('automatic link repair failed:', { plugin: folder, root: item.root, err });
|
|
258
|
+
await leftBroken(item, needsWrite ? 'needs-skill-write' : 'failed');
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return { repaired, skipped };
|
|
262
|
+
}
|
|
169
263
|
// --- internal --------------------------------------------------------------
|
|
264
|
+
/**
|
|
265
|
+
* Who may edit a root's access file — the principals the banner names as
|
|
266
|
+
* the people who can repair a link this viewer cannot.
|
|
267
|
+
*
|
|
268
|
+
* Plugin principals are dropped: `plugin/gtm/write` is a real holder of the
|
|
269
|
+
* verb, and naming it in a sentence addressed to a person says nothing they
|
|
270
|
+
* could act on. The eligible lists carry emails and no display names, so an
|
|
271
|
+
* email stands in — every name here has to be something a reader can go and
|
|
272
|
+
* ask. A lookup that fails names nobody rather than failing the whole
|
|
273
|
+
* repair — the banner has a sentence for that.
|
|
274
|
+
*/
|
|
275
|
+
async editorsOf(wsId, root) {
|
|
276
|
+
try {
|
|
277
|
+
const writers = await this.accessControl.eligibleWriters(wsId, accessMdPathForFolder(root));
|
|
278
|
+
return {
|
|
279
|
+
roles: writers.principals
|
|
280
|
+
? writers.principals.filter((p) => p.kind !== 'plugin').map((p) => p.name)
|
|
281
|
+
: writers.roles,
|
|
282
|
+
users: writers.users.map((u) => ({ name: u.name || u.email, email: u.email })),
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
catch (err) {
|
|
286
|
+
log.warn("couldn't resolve a skill root's editors:", { root, err });
|
|
287
|
+
return { roles: [], users: [] };
|
|
288
|
+
}
|
|
289
|
+
}
|
|
170
290
|
/**
|
|
171
291
|
* ONE reservation for both sides of a link: the plugin's manifest AND the
|
|
172
292
|
* skill root's access.md. Two plugins linking the same root write the same
|
|
@@ -190,13 +310,23 @@ export class PluginLinksService {
|
|
|
190
310
|
{ kind: 'role', role: pluginPrincipalKey(slug, 'write') },
|
|
191
311
|
];
|
|
192
312
|
}
|
|
193
|
-
|
|
313
|
+
/**
|
|
314
|
+
* The two lines, and a commit only if they were not already there — the
|
|
315
|
+
* `changed` check is what makes re-linking, Repair and the page-open repair
|
|
316
|
+
* idempotent rather than a stream of empty commits. Returns whether the
|
|
317
|
+
* file changed, so a caller can tell a repair that wrote from one that had
|
|
318
|
+
* nothing to write.
|
|
319
|
+
*/
|
|
320
|
+
async grantTokens(wsId, user, folder, root, summary) {
|
|
194
321
|
const [read, write] = this.tokens(folder);
|
|
195
322
|
const a = await this.mutation.grant(wsId, 'folder', root, 'read', read);
|
|
196
323
|
const b = await this.mutation.grant(wsId, 'folder', root, 'write', write);
|
|
197
|
-
if (a.changed || b.changed)
|
|
198
|
-
|
|
199
|
-
}
|
|
324
|
+
if (!(a.changed || b.changed))
|
|
325
|
+
return false;
|
|
326
|
+
await this.commits.runPendingCommit(wsId, this.kb.defaultBranch, `${this.kbDirName}/${a.editPath}`, user, {
|
|
327
|
+
summary,
|
|
328
|
+
});
|
|
329
|
+
return true;
|
|
200
330
|
}
|
|
201
331
|
rootOrThrow(raw) {
|
|
202
332
|
const root = normalizeSkillRoot(raw);
|
|
@@ -289,7 +419,7 @@ export class PluginLinksService {
|
|
|
289
419
|
this.links.invalidate();
|
|
290
420
|
this.accessControl.invalidate(wsId);
|
|
291
421
|
this.onChanged?.();
|
|
292
|
-
this.events?.emit({ kind: 'fs-tree-changed', workspaceId: wsId, branch:
|
|
422
|
+
this.events?.emit({ kind: 'fs-tree-changed', workspaceId: wsId, branch: this.kb.defaultBranch });
|
|
293
423
|
}
|
|
294
424
|
}
|
|
295
425
|
//# sourceMappingURL=plugin-links.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-links.service.js","sourceRoot":"","sources":["../../../src/modules/plugins/plugin-links.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,oBAAoB,EACp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AAC;gBAC/C,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,gBAAgB;YAClB,CAAC;YACD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,MAAM,IAAI,eAAe,CACvB,GAAG,WAAW,oEAAoE,EAClF,GAAG,EACH,EAAE,IAAI,EAAE,cAAc,EAAE,CACzB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,QAAQ,IAAK,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAA6B;YAChH,WAAW;SACZ,CAAC;IACJ,CAAC;IAEO,OAAO,CAAC,IAAY;QAC1B,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAC5F,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"plugin-links.service.js","sourceRoot":"","sources":["../../../src/modules/plugins/plugin-links.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GAErB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,C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5E,QAAQ,GAAG,MAAiC,CAAC;gBAC/C,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,gBAAgB;YAClB,CAAC;YACD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACtB,MAAM,IAAI,eAAe,CACvB,GAAG,WAAW,oEAAoE,EAClF,GAAG,EACH,EAAE,IAAI,EAAE,cAAc,EAAE,CACzB,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,QAAQ,IAAK,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAA6B;YAChH,WAAW;SACZ,CAAC;IACJ,CAAC;IAEO,OAAO,CAAC,IAAY;QAC1B,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC;IACnG,CAAC;CACF"}
|
|
@@ -33,12 +33,16 @@
|
|
|
33
33
|
import type { IFsProbe } from '../../shared/fs.contract.js';
|
|
34
34
|
import type { PluginSource } from './discovery/plugin-source.js';
|
|
35
35
|
import { type AuthUser } from '@bevel-software/platform-shared';
|
|
36
|
+
import type { KbContext } from '../../shared/kb-context.js';
|
|
36
37
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
37
38
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
38
39
|
/** Commit machinery the provision rides — the pending-commit pipeline, run inline. */
|
|
39
40
|
export interface ProvisionCommitDriver {
|
|
40
|
-
runPendingCommit(workspaceId: string, branch: string, targetPath: string, user: AuthUser,
|
|
41
|
+
runPendingCommit(workspaceId: string, branch: string, targetPath: string, user: AuthUser,
|
|
42
|
+
/** `summary` overrides the path-derived commit subject — see `GitService.commitFile`. */
|
|
43
|
+
opts?: {
|
|
41
44
|
systemAuthorized?: boolean;
|
|
45
|
+
summary?: string;
|
|
42
46
|
}): Promise<void>;
|
|
43
47
|
}
|
|
44
48
|
export interface ProvisionedPlugin {
|
|
@@ -68,7 +72,7 @@ export declare class PluginProvisionService {
|
|
|
68
72
|
private readonly workspaceService;
|
|
69
73
|
private readonly commits;
|
|
70
74
|
private readonly accessControl;
|
|
71
|
-
private readonly
|
|
75
|
+
private readonly kb;
|
|
72
76
|
private readonly events;
|
|
73
77
|
/** Which names are TAKEN is discovery's answer — the same one every catalog gets. */
|
|
74
78
|
private readonly source;
|
|
@@ -82,7 +86,7 @@ export declare class PluginProvisionService {
|
|
|
82
86
|
* name can hold the lock at once.
|
|
83
87
|
*/
|
|
84
88
|
private readonly creations;
|
|
85
|
-
constructor(workspaceService: WorkspaceService, commits: ProvisionCommitDriver, accessControl: IAccessControl,
|
|
89
|
+
constructor(workspaceService: WorkspaceService, commits: ProvisionCommitDriver, accessControl: IAccessControl, kb: KbContext, events: {
|
|
86
90
|
emit(event: {
|
|
87
91
|
kind: 'fs-tree-changed';
|
|
88
92
|
workspaceId: string;
|
|
@@ -91,6 +95,9 @@ export declare class PluginProvisionService {
|
|
|
91
95
|
} | undefined,
|
|
92
96
|
/** Which names are TAKEN is discovery's answer — the same one every catalog gets. */
|
|
93
97
|
source: PluginSource, disk: IFsProbe);
|
|
98
|
+
private get kbDirName();
|
|
99
|
+
/** The plugins root's name, read per use: a deployment may rename it from the setup screen. */
|
|
100
|
+
private get pluginsRoot();
|
|
94
101
|
/**
|
|
95
102
|
* Create `Plugins/<name>/` — or `Plugins/<parent>/<name>/` — for `user`.
|
|
96
103
|
* Throws `PluginProvisionError` 422 on a name the filesystem or the model
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-provision.service.d.ts","sourceRoot":"","sources":["../../../src/modules/plugins/plugin-provision.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin-provision.service.d.ts","sourceRoot":"","sources":["../../../src/modules/plugins/plugin-provision.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5E,OAAO,EAWL,KAAK,QAAQ,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAK5E,sFAAsF;AACtF,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,CACd,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,QAAQ;IACd,yFAAyF;IACzF,IAAI,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GACtD,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AA+BD,MAAM,WAAW,iBAAiB;IAChC,wGAAwG;IACxG,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAC;IACb,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IA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G;YACW,aAAa;IAmC3B;;;;;;OAMG;IACG,oBAAoB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAkCtE;;;;;;;;;;;;;;;;;;OAkBG;IACG,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4FpE;;;;OAIG;YACW,iBAAiB;IAY/B;;;OAGG;YACW,cAAc;IAW5B;;;;;;;;;OASG;YACW,oBAAoB;IASlC;;;;;;;OAOG;YACW,kBAAkB;IAWhC,sDAAsD;YACxC,UAAU;IAMxB;;;;;;;;;;;;OAYG;YACW,gBAAgB;IAO9B;;;OAGG;YACW,SAAS;YAmET,gBAAgB;CAI/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAoB/E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAoBjF"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
import { randomUUID } from 'node:crypto';
|
|
34
34
|
import fs from 'node:fs/promises';
|
|
35
35
|
import path from 'node:path';
|
|
36
|
-
import {
|
|
36
|
+
import { PLUGIN_MANIFEST_FILE, PLUGIN_SKILLS_DIR, pluginDisplayNameOf, pluginManifestName, renderPluginManifest, PERSONAL_PLUGIN_PREFIX, isPersonalPluginDir, isPersonalPluginFolder, personalPluginFolderName, validateFilename, } from '@bevel-software/platform-shared';
|
|
37
37
|
import { creatorPrincipal } from '../access-model/creator.js';
|
|
38
38
|
import { spliceGrant } from '../access-model/access-splice.js';
|
|
39
39
|
import { WorkspaceMutex } from '../kb-fs/mutex.js';
|
|
@@ -68,15 +68,15 @@ export class PluginProvisionError extends Error {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
/** The one shape every provisioning answer has: the folder in both spellings, and where its skills go. */
|
|
71
|
-
function provisioned(folder, name, displayName, created) {
|
|
72
|
-
const path = `${
|
|
71
|
+
function provisioned(pluginsDir, folder, name, displayName, created) {
|
|
72
|
+
const path = `${pluginsDir}/${folder}`;
|
|
73
73
|
return { folder, path, skillsDir: `${path}/${PLUGIN_SKILLS_DIR}`, name, displayName, created };
|
|
74
74
|
}
|
|
75
75
|
export class PluginProvisionService {
|
|
76
76
|
workspaceService;
|
|
77
77
|
commits;
|
|
78
78
|
accessControl;
|
|
79
|
-
|
|
79
|
+
kb;
|
|
80
80
|
events;
|
|
81
81
|
source;
|
|
82
82
|
disk;
|
|
@@ -89,17 +89,24 @@ export class PluginProvisionService {
|
|
|
89
89
|
* name can hold the lock at once.
|
|
90
90
|
*/
|
|
91
91
|
creations = new WorkspaceMutex();
|
|
92
|
-
constructor(workspaceService, commits, accessControl,
|
|
92
|
+
constructor(workspaceService, commits, accessControl, kb, events,
|
|
93
93
|
/** Which names are TAKEN is discovery's answer — the same one every catalog gets. */
|
|
94
94
|
source, disk) {
|
|
95
95
|
this.workspaceService = workspaceService;
|
|
96
96
|
this.commits = commits;
|
|
97
97
|
this.accessControl = accessControl;
|
|
98
|
-
this.
|
|
98
|
+
this.kb = kb;
|
|
99
99
|
this.events = events;
|
|
100
100
|
this.source = source;
|
|
101
101
|
this.disk = disk;
|
|
102
102
|
}
|
|
103
|
+
get kbDirName() {
|
|
104
|
+
return this.kb.kbDirName;
|
|
105
|
+
}
|
|
106
|
+
/** The plugins root's name, read per use: a deployment may rename it from the setup screen. */
|
|
107
|
+
get pluginsRoot() {
|
|
108
|
+
return this.kb.layout.pluginsDir;
|
|
109
|
+
}
|
|
103
110
|
/**
|
|
104
111
|
* Create `Plugins/<name>/` — or `Plugins/<parent>/<name>/` — for `user`.
|
|
105
112
|
* Throws `PluginProvisionError` 422 on a name the filesystem or the model
|
|
@@ -162,7 +169,7 @@ export class PluginProvisionService {
|
|
|
162
169
|
// `name` is the creator's own spelling, trimmed — the folder's leaf AND
|
|
163
170
|
// the display name persisted for it, whether or not it equals either.
|
|
164
171
|
await this.provision(user, folder, name, pluginAccessMd(user));
|
|
165
|
-
return provisioned(folder, pluginManifestName(name), name, true);
|
|
172
|
+
return provisioned(this.pluginsRoot, folder, pluginManifestName(name), name, true);
|
|
166
173
|
});
|
|
167
174
|
}
|
|
168
175
|
/**
|
|
@@ -182,7 +189,7 @@ export class PluginProvisionService {
|
|
|
182
189
|
if (segments.some((s) => validateFilename(s) !== null || s.startsWith('.'))) {
|
|
183
190
|
throw new PluginProvisionError(`"${rawParent}" is not a folder name the knowledge base can carry.`, 422);
|
|
184
191
|
}
|
|
185
|
-
const rel = `${
|
|
192
|
+
const rel = `${this.pluginsRoot}/${rawParent}`;
|
|
186
193
|
// The personal namespace is the FIRST segment below the root — the same
|
|
187
194
|
// structural rule as `isPersonalPluginDir`, applied to the parent and
|
|
188
195
|
// everything under it. A `personal-*` folder there is a personal space
|
|
@@ -193,8 +200,8 @@ export class PluginProvisionService {
|
|
|
193
200
|
}
|
|
194
201
|
const wsId = await this.readyWorkspaceId();
|
|
195
202
|
const wsDir = await this.workspaceService.getWorkspacePath(wsId);
|
|
196
|
-
if (!(await this.exactFolderExists(path.join(wsDir, this.kbDirName,
|
|
197
|
-
throw new PluginProvisionError(`There is no folder "${rawParent}" under ${
|
|
203
|
+
if (!(await this.exactFolderExists(path.join(wsDir, this.kbDirName, this.pluginsRoot), segments))) {
|
|
204
|
+
throw new PluginProvisionError(`There is no folder "${rawParent}" under ${this.pluginsRoot}/.`, 404);
|
|
198
205
|
}
|
|
199
206
|
// Judged against every folder discovery CLAIMS, not only the plugins it
|
|
200
207
|
// lists: a twin skipped for its slug still owns its subtree, and a
|
|
@@ -220,7 +227,7 @@ export class PluginProvisionService {
|
|
|
220
227
|
return this.creations.run(`plugin:${pluginManifestName(folder)}`, async () => {
|
|
221
228
|
const existing = await this.existingFolder(folder);
|
|
222
229
|
if (existing !== null) {
|
|
223
|
-
return provisioned(folder, pluginManifestName(folder), await this.persistedDisplayName(existing, folder), false);
|
|
230
|
+
return provisioned(this.pluginsRoot, folder, pluginManifestName(folder), await this.persistedDisplayName(existing, folder), false);
|
|
224
231
|
}
|
|
225
232
|
try {
|
|
226
233
|
await this.provision(user, folder, folder, personalAccessMd(user));
|
|
@@ -230,11 +237,11 @@ export class PluginProvisionService {
|
|
|
230
237
|
// process, a checkout that appeared between check and write): the
|
|
231
238
|
// folder existing is this method's success case, never its error.
|
|
232
239
|
if (err instanceof PluginProvisionError && err.status === 409) {
|
|
233
|
-
return provisioned(folder, pluginManifestName(folder), await this.persistedDisplayName(folder, folder), false);
|
|
240
|
+
return provisioned(this.pluginsRoot, folder, pluginManifestName(folder), await this.persistedDisplayName(folder, folder), false);
|
|
234
241
|
}
|
|
235
242
|
throw err;
|
|
236
243
|
}
|
|
237
|
-
return provisioned(folder, pluginManifestName(folder), folder, true);
|
|
244
|
+
return provisioned(this.pluginsRoot, folder, pluginManifestName(folder), folder, true);
|
|
238
245
|
});
|
|
239
246
|
}
|
|
240
247
|
/**
|
|
@@ -276,14 +283,14 @@ export class PluginProvisionService {
|
|
|
276
283
|
if (!name || segments.some((s) => validateFilename(s) !== null || s.startsWith('.'))) {
|
|
277
284
|
throw new PluginProvisionError('A plugin needs a name.', 422);
|
|
278
285
|
}
|
|
279
|
-
if (isPersonalPluginDir(`${
|
|
286
|
+
if (isPersonalPluginDir(`${this.pluginsRoot}/${name}`, this.kb.layout)) {
|
|
280
287
|
// Personal folders are not plugins (the catalog never lists them), and
|
|
281
288
|
// nobody deletes somebody's private shelf through the plugin door.
|
|
282
289
|
throw new PluginProvisionError('Unknown plugin', 404);
|
|
283
290
|
}
|
|
284
291
|
const wsId = await this.readyWorkspaceId();
|
|
285
292
|
const wsDir = await this.workspaceService.getWorkspacePath(wsId);
|
|
286
|
-
const pluginsDir = path.join(wsDir, this.kbDirName,
|
|
293
|
+
const pluginsDir = path.join(wsDir, this.kbDirName, this.pluginsRoot);
|
|
287
294
|
const folderDir = path.join(pluginsDir, ...segments);
|
|
288
295
|
// Locked on the plugin's IDENTITY — the same key a creation of that name
|
|
289
296
|
// takes — not on a slug of the folder path, which for a nested plugin is a
|
|
@@ -294,7 +301,7 @@ export class PluginProvisionService {
|
|
|
294
301
|
// discovery refuses, as it does for creation. A folder discovery does not
|
|
295
302
|
// list (no manifest at all) locks on its own slug — nothing else can
|
|
296
303
|
// claim that identity either.
|
|
297
|
-
const identity = await this.discoveredIdentity(`${
|
|
304
|
+
const identity = await this.discoveredIdentity(`${this.pluginsRoot}/${name}`, segments[segments.length - 1]);
|
|
298
305
|
return this.creations.run(`plugin:${identity}`, async () => {
|
|
299
306
|
// Exact spelling of EVERY component — the catalog hands the route the
|
|
300
307
|
// on-disk spelling, so a mismatch means the plugin is gone (or was
|
|
@@ -322,7 +329,7 @@ export class PluginProvisionService {
|
|
|
322
329
|
// removes — is skipped for exactly this commit. `commitFile` is
|
|
323
330
|
// path-scoped (`git add -- <path>`), and a folder path stages every
|
|
324
331
|
// deletion under it: one commit, one removed plugin.
|
|
325
|
-
await this.commits.runPendingCommit(wsId,
|
|
332
|
+
await this.commits.runPendingCommit(wsId, this.kb.defaultBranch, `${this.kbDirName}/${this.pluginsRoot}/${name}`, user, { systemAuthorized: true });
|
|
326
333
|
}
|
|
327
334
|
catch (err) {
|
|
328
335
|
// The commit did not land: put the folder back, so a failed delete
|
|
@@ -339,7 +346,7 @@ export class PluginProvisionService {
|
|
|
339
346
|
// The folder's rules left the access model — drop the resolver cache
|
|
340
347
|
// so the very next check runs against a tree without them.
|
|
341
348
|
this.accessControl.invalidate(wsId);
|
|
342
|
-
this.events?.emit({ kind: 'fs-tree-changed', workspaceId: wsId, branch:
|
|
349
|
+
this.events?.emit({ kind: 'fs-tree-changed', workspaceId: wsId, branch: this.kb.defaultBranch });
|
|
343
350
|
});
|
|
344
351
|
}
|
|
345
352
|
/**
|
|
@@ -349,7 +356,7 @@ export class PluginProvisionService {
|
|
|
349
356
|
*/
|
|
350
357
|
async exactFolderExists(root, segments) {
|
|
351
358
|
let dir = root;
|
|
352
|
-
let rel =
|
|
359
|
+
let rel = this.pluginsRoot;
|
|
353
360
|
for (const segment of segments) {
|
|
354
361
|
const entries = await listDirOrIncomplete(this.disk, dir, rel);
|
|
355
362
|
if (!entries?.some((e) => e.isDirectory() && e.name === segment))
|
|
@@ -366,7 +373,7 @@ export class PluginProvisionService {
|
|
|
366
373
|
async existingFolder(name, parent = '') {
|
|
367
374
|
const wsId = await this.readyWorkspaceId();
|
|
368
375
|
const wsDir = await this.workspaceService.getWorkspacePath(wsId);
|
|
369
|
-
const rel = parent ? `${
|
|
376
|
+
const rel = parent ? `${this.pluginsRoot}/${parent}` : this.pluginsRoot;
|
|
370
377
|
// No Plugins/ root yet — nothing can collide.
|
|
371
378
|
const children = await listDirOrIncomplete(this.disk, path.join(wsDir, this.kbDirName, rel), rel);
|
|
372
379
|
if (!children)
|
|
@@ -387,7 +394,7 @@ export class PluginProvisionService {
|
|
|
387
394
|
async persistedDisplayName(folder, fallback) {
|
|
388
395
|
const wsId = await this.readyWorkspaceId();
|
|
389
396
|
const wsDir = await this.workspaceService.getWorkspacePath(wsId);
|
|
390
|
-
const manifest = await this.disk.readJsonObject(path.join(wsDir, this.kbDirName,
|
|
397
|
+
const manifest = await this.disk.readJsonObject(path.join(wsDir, this.kbDirName, this.pluginsRoot, ...folder.split('/'), PLUGIN_MANIFEST_FILE));
|
|
391
398
|
return pluginDisplayNameOf(manifest) || fallback;
|
|
392
399
|
}
|
|
393
400
|
/**
|
|
@@ -441,7 +448,7 @@ export class PluginProvisionService {
|
|
|
441
448
|
*/
|
|
442
449
|
async provision(user, folder, leaf, accessMd) {
|
|
443
450
|
const wsId = await this.readyWorkspaceId();
|
|
444
|
-
const folderPath = `${this.kbDirName}/${
|
|
451
|
+
const folderPath = `${this.kbDirName}/${this.pluginsRoot}/${folder}`;
|
|
445
452
|
const wsRelPath = `${folderPath}/access.md`;
|
|
446
453
|
try {
|
|
447
454
|
// Exclusive create — the fs is the arbiter of a same-name race, not
|
|
@@ -477,7 +484,7 @@ export class PluginProvisionService {
|
|
|
477
484
|
// rule this endpoint exists to carve through. The endpoint has already
|
|
478
485
|
// authorized the write (any signed-in user, unused name, exclusive
|
|
479
486
|
// create), so the per-user gate is skipped for exactly this commit.
|
|
480
|
-
await this.commits.runPendingCommit(wsId,
|
|
487
|
+
await this.commits.runPendingCommit(wsId, this.kb.defaultBranch, folderPath, user, {
|
|
481
488
|
systemAuthorized: true,
|
|
482
489
|
});
|
|
483
490
|
}
|
|
@@ -489,7 +496,7 @@ export class PluginProvisionService {
|
|
|
489
496
|
// so a concurrent writer's bytes can't be collateral.
|
|
490
497
|
try {
|
|
491
498
|
const wsDir = await this.workspaceService.getWorkspacePath(wsId);
|
|
492
|
-
const folderDir = path.join(wsDir, this.kbDirName,
|
|
499
|
+
const folderDir = path.join(wsDir, this.kbDirName, this.pluginsRoot, folder);
|
|
493
500
|
await fs.rm(path.join(folderDir, 'access.md'), { force: true });
|
|
494
501
|
await fs.rm(path.join(folderDir, PLUGIN_MANIFEST_FILE), { force: true });
|
|
495
502
|
await fs.rmdir(folderDir).catch(() => { });
|
|
@@ -502,10 +509,10 @@ export class PluginProvisionService {
|
|
|
502
509
|
// The folder's rules changed the access model — drop the resolver cache
|
|
503
510
|
// so the very next check (the creator's first skill write) sees them.
|
|
504
511
|
this.accessControl.invalidate(wsId);
|
|
505
|
-
this.events?.emit({ kind: 'fs-tree-changed', workspaceId: wsId, branch:
|
|
512
|
+
this.events?.emit({ kind: 'fs-tree-changed', workspaceId: wsId, branch: this.kb.defaultBranch });
|
|
506
513
|
}
|
|
507
514
|
async readyWorkspaceId() {
|
|
508
|
-
const ws = await this.workspaceService.getOrCreateForBranch(
|
|
515
|
+
const ws = await this.workspaceService.getOrCreateForBranch(this.kb.defaultBranch);
|
|
509
516
|
return ws.id;
|
|
510
517
|
}
|
|
511
518
|
}
|