@bevel-software/platform-core-backend 0.11.1 → 0.11.2
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/create-core-services.d.ts +1 -1
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +2 -2
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +1 -253
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +3 -632
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access-declarations.d.ts +2 -2
- package/dist/modules/access/access-declarations.d.ts.map +1 -1
- package/dist/modules/access/access-declarations.js +2 -2
- package/dist/modules/access/access-declarations.js.map +1 -1
- package/dist/modules/access/access-mutation.service.d.ts +3 -3
- package/dist/modules/access/access-mutation.service.d.ts.map +1 -1
- package/dist/modules/access/access-mutation.service.js +3 -3
- package/dist/modules/access/access-mutation.service.js.map +1 -1
- package/dist/modules/access/access.routes.js +4 -4
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/admin-locked-commit.d.ts +2 -2
- package/dist/modules/access/admin-locked-commit.d.ts.map +1 -1
- package/dist/modules/access/admin-locked-commit.js +2 -2
- package/dist/modules/access/admin-locked-commit.js.map +1 -1
- package/dist/modules/access/admin-route-helpers.js +1 -1
- package/dist/modules/access/admin-route-helpers.js.map +1 -1
- package/dist/modules/access/capability-registry.js +1 -1
- package/dist/modules/access/capability-registry.js.map +1 -1
- package/dist/modules/access/creator-access.d.ts +1 -45
- package/dist/modules/access/creator-access.d.ts.map +1 -1
- package/dist/modules/access/creator-access.js +4 -24
- package/dist/modules/access/creator-access.js.map +1 -1
- package/dist/modules/access/groups-admin.routes.js +1 -1
- package/dist/modules/access/groups-admin.routes.js.map +1 -1
- package/dist/modules/access/groups-admin.service.d.ts +1 -1
- package/dist/modules/access/groups-admin.service.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.service.js +6 -5
- package/dist/modules/access/groups-admin.service.js.map +1 -1
- package/dist/modules/access/groups-edit.js +2 -2
- package/dist/modules/access/groups-edit.js.map +1 -1
- package/dist/modules/access/reference-scan.js +1 -1
- package/dist/modules/access/reference-scan.js.map +1 -1
- package/dist/modules/access/roles-admin.service.d.ts +1 -1
- package/dist/modules/access/roles-admin.service.d.ts.map +1 -1
- package/dist/modules/access/roles-admin.service.js +8 -7
- package/dist/modules/access/roles-admin.service.js.map +1 -1
- package/dist/modules/access/roles-edit.js +1 -1
- package/dist/modules/access/roles-edit.js.map +1 -1
- package/dist/modules/access/synced-groups-committer.js +4 -4
- package/dist/modules/access/synced-groups-committer.js.map +1 -1
- package/dist/modules/access/synced-groups-writer.js +2 -2
- package/dist/modules/access/synced-groups-writer.js.map +1 -1
- package/dist/modules/access-model/access-errors.d.ts +34 -0
- package/dist/modules/access-model/access-errors.d.ts.map +1 -0
- package/dist/modules/access-model/access-errors.js +40 -0
- package/dist/modules/access-model/access-errors.js.map +1 -0
- package/dist/modules/access-model/access-grammar.d.ts +266 -0
- package/dist/modules/access-model/access-grammar.d.ts.map +1 -0
- package/dist/modules/access-model/access-grammar.js +644 -0
- package/dist/modules/access-model/access-grammar.js.map +1 -0
- package/dist/modules/access-model/access-splice.d.ts +140 -0
- package/dist/modules/access-model/access-splice.d.ts.map +1 -0
- package/dist/modules/access-model/access-splice.js +389 -0
- package/dist/modules/access-model/access-splice.js.map +1 -0
- package/dist/modules/access-model/creator.d.ts +54 -0
- package/dist/modules/access-model/creator.d.ts.map +1 -0
- package/dist/modules/access-model/creator.js +30 -0
- package/dist/modules/access-model/creator.js.map +1 -0
- package/dist/modules/access-model/group-files.d.ts +83 -0
- package/dist/modules/access-model/group-files.d.ts.map +1 -0
- package/dist/modules/access-model/group-files.js +167 -0
- package/dist/modules/access-model/group-files.js.map +1 -0
- package/dist/modules/access-model/kb-read-filter.d.ts +41 -0
- package/dist/modules/access-model/kb-read-filter.d.ts.map +1 -0
- package/dist/modules/access-model/kb-read-filter.js +60 -0
- package/dist/modules/access-model/kb-read-filter.js.map +1 -0
- package/dist/modules/access-model/render-roles-yaml.d.ts +22 -0
- package/dist/modules/access-model/render-roles-yaml.d.ts.map +1 -0
- package/dist/modules/access-model/render-roles-yaml.js +56 -0
- package/dist/modules/access-model/render-roles-yaml.js.map +1 -0
- package/dist/modules/access-model/roles-yaml-guard.d.ts +56 -0
- package/dist/modules/access-model/roles-yaml-guard.d.ts.map +1 -0
- package/dist/modules/access-model/roles-yaml-guard.js +79 -0
- package/dist/modules/access-model/roles-yaml-guard.js.map +1 -0
- package/dist/modules/admin/admin-access.service.d.ts.map +1 -1
- package/dist/modules/admin/admin-access.service.js +1 -1
- package/dist/modules/admin/admin-access.service.js.map +1 -1
- package/dist/modules/diff/diff.routes.js +4 -4
- package/dist/modules/diff/diff.routes.js.map +1 -1
- package/dist/modules/diff/diff.service.d.ts +1 -1
- package/dist/modules/diff/diff.service.d.ts.map +1 -1
- package/dist/modules/kb-fs/branch-name.d.ts +10 -0
- package/dist/modules/kb-fs/branch-name.d.ts.map +1 -0
- package/dist/modules/kb-fs/branch-name.js +76 -0
- package/dist/modules/kb-fs/branch-name.js.map +1 -0
- package/dist/modules/kb-fs/clone-config.d.ts +61 -0
- package/dist/modules/kb-fs/clone-config.d.ts.map +1 -0
- package/dist/modules/kb-fs/clone-config.js +69 -0
- package/dist/modules/kb-fs/clone-config.js.map +1 -0
- package/dist/modules/kb-fs/file-change-notifier.d.ts +38 -0
- package/dist/modules/kb-fs/file-change-notifier.d.ts.map +1 -0
- package/dist/modules/kb-fs/file-change-notifier.js +22 -0
- package/dist/modules/kb-fs/file-change-notifier.js.map +1 -0
- package/dist/modules/kb-fs/locking-filesystem.d.ts +137 -0
- package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -0
- package/dist/modules/kb-fs/locking-filesystem.js +553 -0
- package/dist/modules/kb-fs/locking-filesystem.js.map +1 -0
- package/dist/modules/kb-fs/mutex.d.ts +11 -0
- package/dist/modules/kb-fs/mutex.d.ts.map +1 -0
- package/dist/modules/kb-fs/mutex.js +23 -0
- package/dist/modules/kb-fs/mutex.js.map +1 -0
- package/dist/modules/kb-fs/read-only-filesystem.d.ts +24 -0
- package/dist/modules/kb-fs/read-only-filesystem.d.ts.map +1 -0
- package/dist/modules/kb-fs/read-only-filesystem.js +39 -0
- package/dist/modules/kb-fs/read-only-filesystem.js.map +1 -0
- package/dist/modules/plugins/join-proposals.d.ts +1 -1
- package/dist/modules/plugins/join-proposals.d.ts.map +1 -1
- package/dist/modules/plugins/join-proposals.js +1 -1
- package/dist/modules/plugins/join-proposals.js.map +1 -1
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +1 -1
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.js +3 -3
- package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +2 -2
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/plugins/plugins.service.js +1 -1
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.js +1 -1
- package/dist/modules/skills/pending-skills.service.js.map +1 -1
- package/dist/modules/skills/skills.service.js +1 -1
- package/dist/modules/skills/skills.service.js.map +1 -1
- package/dist/modules/tool-helpers/tool-context.d.ts +2 -2
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.js +4 -4
- package/dist/modules/tool-helpers/tool-context.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.js +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.js +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/file-lock.service.js +1 -1
- package/dist/modules/workflow/file-lock.service.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +2 -2
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +5 -5
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +1 -1
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +2 -2
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
- package/dist/modules/workflow/session-ontology.service.js +1 -1
- package/dist/modules/workflow/session-ontology.service.js.map +1 -1
- package/dist/modules/workflow/workflow.routes.js +2 -2
- package/dist/modules/workflow/workflow.routes.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +1 -1
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +4 -4
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js +1 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/roles-yaml.step.d.ts +1 -1
- package/dist/modules/workspace/startup/steps/roles-yaml.step.js +2 -2
- package/dist/modules/workspace/startup/steps/roles-yaml.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +5 -4
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +2 -9
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +14 -15
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +3 -3
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/shared/domain-errors.d.ts +202 -0
- package/dist/shared/domain-errors.d.ts.map +1 -0
- package/dist/shared/domain-errors.js +303 -0
- package/dist/shared/domain-errors.js.map +1 -0
- package/dist/shared/workspace-id.d.ts +27 -0
- package/dist/shared/workspace-id.d.ts.map +1 -0
- package/dist/shared/workspace-id.js +36 -0
- package/dist/shared/workspace-id.js.map +1 -0
- package/package.json +3 -3
- package/src/core/create-core-services.ts +2 -2
- package/src/modules/access/__tests__/access-control.service.test.ts +1 -1
- package/src/modules/access/__tests__/access-groups.test.ts +6 -5
- package/src/modules/access/__tests__/access-md-format.test.ts +3 -3
- package/src/modules/access/__tests__/access-mutation.service.test.ts +1 -1
- package/src/modules/access/__tests__/admin-locked-commit.test.ts +1 -1
- package/src/modules/access/__tests__/admin-route-helpers.test.ts +1 -1
- package/src/modules/access/__tests__/roles-admin.service.test.ts +2 -2
- package/src/modules/access/__tests__/roles-edit.test.ts +1 -1
- package/src/modules/access/__tests__/synced-groups-committer.test.ts +1 -1
- package/src/modules/access/__tests__/synced-groups-writer.test.ts +1 -1
- package/src/modules/access/access-control.service.ts +23 -768
- package/src/modules/access/access-declarations.ts +2 -2
- package/src/modules/access/access-mutation.service.ts +3 -3
- package/src/modules/access/access.routes.ts +5 -5
- package/src/modules/access/admin-locked-commit.ts +2 -2
- package/src/modules/access/admin-route-helpers.ts +1 -1
- package/src/modules/access/capability-registry.ts +1 -1
- package/src/modules/access/creator-access.ts +9 -72
- package/src/modules/access/groups-admin.routes.ts +1 -1
- package/src/modules/access/groups-admin.service.ts +6 -7
- package/src/modules/access/groups-edit.ts +2 -2
- package/src/modules/access/reference-scan.ts +1 -1
- package/src/modules/access/roles-admin.service.ts +8 -8
- package/src/modules/access/roles-edit.ts +1 -1
- package/src/modules/access/synced-groups-committer.ts +4 -4
- package/src/modules/access/synced-groups-writer.ts +2 -2
- package/src/modules/access-model/__tests__/access-grammar.test.ts +31 -0
- package/src/modules/{access → access-model}/__tests__/access-splice.test.ts +268 -268
- package/src/modules/{access → access-model}/access-errors.ts +1 -1
- package/src/modules/access-model/access-grammar.ts +778 -0
- package/src/modules/{access → access-model}/access-splice.ts +1 -1
- package/src/modules/access-model/creator.ts +79 -0
- package/src/modules/{access → access-model}/group-files.ts +1 -1
- package/src/modules/{access → access-model}/render-roles-yaml.ts +1 -1
- package/src/modules/{access → access-model}/roles-yaml-guard.ts +2 -2
- package/src/modules/admin/admin-access.service.ts +2 -1
- package/src/modules/diff/__tests__/diff.routes.rejectPathsLocked.test.ts +2 -2
- package/src/modules/diff/__tests__/diff.service.seed-atomicity.test.ts +3 -2
- package/src/modules/diff/__tests__/diff.service.test.ts +3 -2
- package/src/modules/diff/diff.routes.ts +4 -4
- package/src/modules/diff/diff.service.ts +1 -1
- package/src/modules/{workflow/git → kb-fs}/__tests__/branch-name.test.ts +1 -1
- package/src/modules/{workflow → kb-fs}/__tests__/locking-filesystem.test.ts +1 -1
- package/src/modules/{workflow/git → kb-fs}/branch-name.ts +1 -1
- package/src/modules/{workflow → kb-fs}/locking-filesystem.ts +2 -2
- package/src/modules/plugins/__tests__/join-requests.service.test.ts +2 -4
- package/src/modules/plugins/__tests__/plugin-index.service.test.ts +1 -1
- package/src/modules/plugins/__tests__/plugins.routes.test.ts +1 -1
- package/src/modules/plugins/join-proposals.ts +1 -1
- package/src/modules/plugins/join-requests.service.ts +2 -1
- package/src/modules/plugins/plugin-provision.service.ts +3 -3
- package/src/modules/plugins/plugins.routes.ts +2 -2
- package/src/modules/plugins/plugins.service.ts +1 -1
- package/src/modules/secrets-vault/secrets-vault.routes.ts +1 -1
- package/src/modules/skills/__tests__/skills.service.test.ts +1 -1
- package/src/modules/skills/pending-skills.service.ts +2 -1
- package/src/modules/skills/skills.service.ts +1 -1
- package/src/modules/tool-helpers/tool-context.ts +6 -5
- package/src/modules/tool-manuals/__tests__/mcp-server-edit.service.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.archive.route.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.detail.route.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.mcp-oauth.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +1 -1
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +2 -1
- package/src/modules/tool-manuals/tool-manuals.routes.ts +2 -1
- package/src/modules/tool-manuals/tool-manuals.service.ts +1 -1
- package/src/modules/tool-manuals/tool-manuals.tools.ts +1 -1
- package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +1 -1
- package/src/modules/workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts +1 -1
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +1 -1
- package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +1 -1
- package/src/modules/workflow/agent-tools/workflow.tools.ts +1 -1
- package/src/modules/workflow/file-lock.service.ts +1 -1
- package/src/modules/workflow/git/__tests__/git.service.accessGating.test.ts +1 -1
- package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +1 -1
- package/src/modules/workflow/git/__tests__/git.service.diffFileAtCommit.test.ts +1 -1
- package/src/modules/workflow/git/__tests__/git.service.diffFileBetweenBranches.test.ts +1 -1
- package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +1 -1
- package/src/modules/workflow/git/git.service.ts +5 -5
- package/src/modules/workflow/git/pull-request.service.ts +1 -1
- package/src/modules/workflow/review-workflow/__tests__/cancel-pr.test.ts +1 -1
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +2 -2
- package/src/modules/workflow/session-ontology.service.ts +1 -1
- package/src/modules/workflow/workflow.routes.ts +2 -2
- package/src/modules/workflow/workflow.service.ts +5 -5
- package/src/modules/workspace/__tests__/workspace.routes.create-grant.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +2 -2
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.service.read-filter.test.ts +2 -5
- package/src/modules/workspace/__tests__/workspace.service.test.ts +13 -1
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +1 -1
- package/src/modules/workspace/startup/kb-startup-runner.ts +1 -1
- package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +1 -1
- package/src/modules/workspace/startup/steps/groups-to-plugins.step.ts +1 -1
- package/src/modules/workspace/startup/steps/roles-yaml.step.ts +2 -2
- package/src/modules/workspace/startup/steps/seed-tree.ts +1 -1
- package/src/modules/workspace/workspace.routes.ts +6 -5
- package/src/modules/workspace/workspace.service.ts +14 -18
- package/src/modules/workspace/workspace.tools.ts +3 -3
- package/src/shared/__tests__/join-request.test.ts +1 -1
- package/src/shared/__tests__/workspace-id.test.ts +17 -0
- package/src/{modules/workflow/workflow.errors.ts → shared/domain-errors.ts} +6 -1
- package/src/shared/workspace-id.ts +36 -0
- /package/src/modules/{access → access-model}/__tests__/kb-read-filter.test.ts +0 -0
- /package/src/modules/{access → access-model}/__tests__/roles-yaml-guard.test.ts +0 -0
- /package/src/modules/{access → access-model}/kb-read-filter.ts +0 -0
- /package/src/modules/{workflow/git → kb-fs}/__tests__/clone-config.test.ts +0 -0
- /package/src/modules/{workflow → kb-fs}/__tests__/file-change-notifier.test.ts +0 -0
- /package/src/modules/{workflow/git → kb-fs}/__tests__/mutex.test.ts +0 -0
- /package/src/modules/{workflow/git → kb-fs}/clone-config.ts +0 -0
- /package/src/modules/{workflow → kb-fs}/file-change-notifier.ts +0 -0
- /package/src/modules/{workflow/git → kb-fs}/mutex.ts +0 -0
- /package/src/modules/{workflow → kb-fs}/read-only-filesystem.ts +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of the creator read-grant story: the creator identity, the
|
|
3
|
+
* grant-plan contract the creation surfaces consume, and the splice-safe
|
|
4
|
+
* principal for a creator. The service that DECIDES when a creation needs a
|
|
5
|
+
* grant (filesystem stats, access checks) is `modules/access/creator-access.ts`;
|
|
6
|
+
* this file carries only the types and pure helpers so downstream modules
|
|
7
|
+
* (kb-fs, plugins, tool-helpers) never need an edge into the access module.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Principal } from './access-splice.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* How a pending creation gets its creator read grant.
|
|
14
|
+
* - `seed-access-md`: merge the grant into `wsRelPath` (a new directory's
|
|
15
|
+
* own `access.md`, workspace-relative) — BEFORE or alongside the creation,
|
|
16
|
+
* via the caller's own lock+commit machinery. The caller MUST re-read the
|
|
17
|
+
* file's CURRENT text under its lock and write `apply(current)` ('' when
|
|
18
|
+
* absent), never a precomputed fresh file: two concurrent creators can
|
|
19
|
+
* both plan a seed for the same new directory, and a blind overwrite
|
|
20
|
+
* would silently revoke whichever grant landed first. Skip the write when
|
|
21
|
+
* `apply` returns the input unchanged, and call `noteAccessFileWritten`
|
|
22
|
+
* after a write so the resolver cache drops.
|
|
23
|
+
* - `frontmatter`: run the new file's content through `apply` before
|
|
24
|
+
* writing it, so the grant lands atomically inside the created file.
|
|
25
|
+
*/
|
|
26
|
+
export type CreationGrantPlan =
|
|
27
|
+
| { kind: 'seed-access-md'; wsRelPath: string; apply: (current: string) => string }
|
|
28
|
+
| { kind: 'frontmatter'; apply: (content: string) => string };
|
|
29
|
+
|
|
30
|
+
/** The creator identity a grant is written for. */
|
|
31
|
+
export interface Creator {
|
|
32
|
+
name: string;
|
|
33
|
+
email: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Injection seam for the creation surfaces (routes, lock-aware filesystem,
|
|
38
|
+
* upload apply). Kept as an interface so callers depend on the contract, not
|
|
39
|
+
* the class.
|
|
40
|
+
*/
|
|
41
|
+
export interface ICreatorAccess {
|
|
42
|
+
planForCreate(
|
|
43
|
+
workspaceId: string,
|
|
44
|
+
creator: Creator,
|
|
45
|
+
wsRelPath: string,
|
|
46
|
+
kind: 'file' | 'dir',
|
|
47
|
+
): Promise<CreationGrantPlan | null>;
|
|
48
|
+
|
|
49
|
+
grantInExtractedFile(
|
|
50
|
+
workspaceId: string,
|
|
51
|
+
creator: Creator,
|
|
52
|
+
wsRelPath: string,
|
|
53
|
+
): Promise<string | null>;
|
|
54
|
+
|
|
55
|
+
noteAccessFileWritten(workspaceId: string): void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The splice-safe principal for a creator — exported because plugin
|
|
60
|
+
* provisioning (`PluginProvisionService`) writes the same `Name <email>`
|
|
61
|
+
* entries into the access.md files it seeds, and two spellings of the same
|
|
62
|
+
* person would read as two people.
|
|
63
|
+
*/
|
|
64
|
+
export function creatorPrincipal(creator: Creator): Principal {
|
|
65
|
+
return { kind: 'user', email: creator.email, displayName: safeDisplayName(creator) };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* `Name <email>`-safe display name: `validatePrincipal` rejects control
|
|
70
|
+
* chars, `<`, `>`, and `#`, so strip those from the user's name and fall
|
|
71
|
+
* back to the email local part (which the email regex already keeps free of
|
|
72
|
+
* `<>`/whitespace) when nothing usable remains.
|
|
73
|
+
*/
|
|
74
|
+
function safeDisplayName(creator: Creator): string {
|
|
75
|
+
const strip = (s: string) =>
|
|
76
|
+
// eslint-disable-next-line no-control-regex -- same intentional control-char guard as access-splice
|
|
77
|
+
s.replace(/[<>#\u0000-\u001f\u007f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
78
|
+
return strip(creator.name) || strip(creator.email.split('@')[0] ?? '') || 'KB user';
|
|
79
|
+
}
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import type { FileContent } from '@mastra/core/workspace';
|
|
25
|
-
import { parseRolesYaml } from './access-
|
|
26
|
-
import { WorkflowDomainError } from '
|
|
25
|
+
import { parseRolesYaml } from './access-grammar.js';
|
|
26
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
27
27
|
|
|
28
28
|
/** Repo-relative basename of the roles file (it lives at the KB repo root). */
|
|
29
29
|
export const ROLES_YAML_BASENAME = 'roles.yaml';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
2
|
-
import { type WorkspaceService
|
|
2
|
+
import { type WorkspaceService } from '../workspace/workspace.service.js';
|
|
3
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
3
4
|
import type { IAdminAccessService } from './admin.interface.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -4,8 +4,8 @@ import path from 'node:path';
|
|
|
4
4
|
import os from 'node:os';
|
|
5
5
|
import type { AuthUser, IWorkflowService } from '@bevel-software/platform-shared';
|
|
6
6
|
import type { IDiffService } from '../diff.interface.js';
|
|
7
|
-
import { workspaceIdForBranch } from '
|
|
8
|
-
import { WorkflowValidationError } from '
|
|
7
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
8
|
+
import { WorkflowValidationError } from '../../../shared/domain-errors.js';
|
|
9
9
|
import { rejectPathsLocked } from '../diff.routes.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -2,8 +2,9 @@ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { WorkspaceService
|
|
6
|
-
import {
|
|
5
|
+
import { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
6
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
7
|
+
import { WorkspaceMutex } from '../../kb-fs/mutex.js';
|
|
7
8
|
import { DiffService } from '../diff.service.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -2,8 +2,9 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
|
-
import { WorkspaceService
|
|
6
|
-
import {
|
|
5
|
+
import { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
6
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
7
|
+
import { WorkspaceMutex } from '../../kb-fs/mutex.js';
|
|
7
8
|
import { DiffService } from '../diff.service.js';
|
|
8
9
|
|
|
9
10
|
async function mkTmpRoot(prefix: string): Promise<string> {
|
|
@@ -3,10 +3,10 @@ import type { AuthUser, IWorkflowService } from '@bevel-software/platform-shared
|
|
|
3
3
|
import type { IDiffService } from './diff.interface.js';
|
|
4
4
|
import type { AuthService } from '../auth/auth.service.js';
|
|
5
5
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
6
|
-
import { toKbRelative, resolveReadableMap } from '../access/kb-read-filter.js';
|
|
7
|
-
import { WorkflowDomainError, WorkflowValidationError } from '
|
|
8
|
-
import { LockingFilesystem } from '../
|
|
9
|
-
import { branchForWorkspaceId } from '
|
|
6
|
+
import { toKbRelative, resolveReadableMap } from '../access-model/kb-read-filter.js';
|
|
7
|
+
import { WorkflowDomainError, WorkflowValidationError } from '../../shared/domain-errors.js';
|
|
8
|
+
import { LockingFilesystem } from '../kb-fs/locking-filesystem.js';
|
|
9
|
+
import { branchForWorkspaceId } from '../../shared/workspace-id.js';
|
|
10
10
|
import '../auth/auth.middleware.js';
|
|
11
11
|
|
|
12
12
|
function toHttpError(
|
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import type { FileDiffPayload, PendingChange, ReviewSession, ChangeKind } from '@bevel-software/platform-shared';
|
|
4
4
|
import type { IDiffService } from './diff.interface.js';
|
|
5
5
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
6
|
-
import type { WorkspaceMutex } from '../
|
|
6
|
+
import type { WorkspaceMutex } from '../kb-fs/mutex.js';
|
|
7
7
|
import { BevelIgnoreStack } from '../workspace/bevel-ignore.js';
|
|
8
8
|
import { isDiffable } from './diff.config.js';
|
|
9
9
|
import { assertWithinDirectory } from './diff-paths.js';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
assertValidRelativePath,
|
|
5
5
|
isProtectedBranch,
|
|
6
6
|
} from '../branch-name.js';
|
|
7
|
-
import { BranchNameError, WorkflowValidationError } from '
|
|
7
|
+
import { BranchNameError, WorkflowValidationError } from '../../../shared/domain-errors.js';
|
|
8
8
|
|
|
9
9
|
describe('assertValidBranchName', () => {
|
|
10
10
|
it.each([
|
|
@@ -5,7 +5,7 @@ import os from 'node:os';
|
|
|
5
5
|
import type { AuthUser, IWorkflowService } from '@bevel-software/platform-shared';
|
|
6
6
|
import { LocalFilesystem } from '@mastra/core/workspace';
|
|
7
7
|
import { LockingFilesystem } from '../locking-filesystem.js';
|
|
8
|
-
import { PushNeedsAgentResolutionError } from '
|
|
8
|
+
import { PushNeedsAgentResolutionError } from '../../../shared/domain-errors.js';
|
|
9
9
|
|
|
10
10
|
const USER: AuthUser = {
|
|
11
11
|
id: 'user-1',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BranchNameError, WorkflowValidationError } from '
|
|
1
|
+
import { BranchNameError, WorkflowValidationError } from '../../shared/domain-errors.js';
|
|
2
2
|
|
|
3
3
|
// Single source of truth for the protected-branch list lives in `@bevel-software/platform-shared` so
|
|
4
4
|
// the backend guard and the frontend banner/disabling logic can't drift apart.
|
|
@@ -42,9 +42,9 @@ import {
|
|
|
42
42
|
type WriteOptions,
|
|
43
43
|
} from '@mastra/core/workspace';
|
|
44
44
|
import type { AuthUser, Change, IWorkflowService } from '@bevel-software/platform-shared';
|
|
45
|
-
import { PushNeedsAgentResolutionError } from '
|
|
45
|
+
import { PushNeedsAgentResolutionError } from '../../shared/domain-errors.js';
|
|
46
46
|
import type { FileChangeNotifier } from './file-change-notifier.js';
|
|
47
|
-
import type { CreationGrantPlan, ICreatorAccess } from '../access/creator
|
|
47
|
+
import type { CreationGrantPlan, ICreatorAccess } from '../access-model/creator.js';
|
|
48
48
|
|
|
49
49
|
/** How many times to retry a contended acquire before giving up. */
|
|
50
50
|
const ACQUIRE_RETRY_ATTEMPTS = 3;
|
|
@@ -6,10 +6,8 @@ import {
|
|
|
6
6
|
type ChangeRequest,
|
|
7
7
|
type IWorkflowService,
|
|
8
8
|
} from '@bevel-software/platform-shared';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
type WorkspaceService,
|
|
12
|
-
} from '../../workspace/workspace.service.js';
|
|
9
|
+
import { type WorkspaceService } from '../../workspace/workspace.service.js';
|
|
10
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
13
11
|
import { JoinRequestsService } from '../join-requests.service.js';
|
|
14
12
|
|
|
15
13
|
/**
|
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
6
6
|
import { PluginIndexService } from '../plugins.service.js';
|
|
7
|
-
import { workspaceIdForBranch } from '
|
|
7
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
8
8
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
9
9
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
10
10
|
import type { ISkillService, SkillSummary } from '../../skills/skills.contract.js';
|
|
@@ -8,7 +8,7 @@ import { describe, it, expect, afterEach, vi } from 'vitest';
|
|
|
8
8
|
|
|
9
9
|
import { DEFAULT_BRANCH, joinBranchFor } from '@bevel-software/platform-shared';
|
|
10
10
|
import type { ChangeRequest, IWorkflowService } from '@bevel-software/platform-shared';
|
|
11
|
-
import { workspaceIdForBranch } from '
|
|
11
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
12
12
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
13
13
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
14
14
|
import type { ISkillService, SkillSummary } from '../../skills/skills.contract.js';
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
type ChangeRequest,
|
|
6
6
|
type IWorkflowService,
|
|
7
7
|
} from '@bevel-software/platform-shared';
|
|
8
|
-
import {
|
|
8
|
+
import { type WorkspaceService } from '../workspace/workspace.service.js';
|
|
9
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
9
10
|
import { pendingProposals, type JoinProposal } from './join-proposals.js';
|
|
10
11
|
|
|
11
12
|
/** One open join change request, with what it still proposes. */
|
|
@@ -47,9 +47,9 @@ import {
|
|
|
47
47
|
} from '@bevel-software/platform-shared';
|
|
48
48
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
49
49
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
50
|
-
import { creatorPrincipal } from '../access/creator
|
|
51
|
-
import { spliceGrant } from '../access/access-splice.js';
|
|
52
|
-
import { WorkspaceMutex } from '../
|
|
50
|
+
import { creatorPrincipal } from '../access-model/creator.js';
|
|
51
|
+
import { spliceGrant } from '../access-model/access-splice.js';
|
|
52
|
+
import { WorkspaceMutex } from '../kb-fs/mutex.js';
|
|
53
53
|
|
|
54
54
|
/** Commit machinery the provision rides — the pending-commit pipeline, run inline. */
|
|
55
55
|
export interface ProvisionCommitDriver {
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
type IWorkflowService,
|
|
9
9
|
} from '@bevel-software/platform-shared';
|
|
10
10
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
11
|
-
import { spliceGrant } from '../access/access-splice.js';
|
|
12
|
-
import { WorkflowDomainError } from '
|
|
11
|
+
import { spliceGrant } from '../access-model/access-splice.js';
|
|
12
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
13
13
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
14
14
|
import { pluginsWorkspaceId } from './plugins.service.js';
|
|
15
15
|
import { PluginProvisionError, type PluginProvisionService } from './plugin-provision.service.js';
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
isPersonalPluginFolder,
|
|
9
9
|
} from '@bevel-software/platform-shared';
|
|
10
10
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
11
|
-
import { workspaceIdForBranch } from '
|
|
11
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
12
12
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
13
13
|
import type { ISkillService } from '../skills/skills.contract.js';
|
|
14
14
|
import type { IToolManualService } from '../tool-manuals/tool-manuals.contract.js';
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import type { IToolManualService, ToolManualSummary, ToolVariable } from '../tool-manuals/tool-manuals.contract.js';
|
|
13
13
|
import { utcpNamespacedKey } from '../../shared/utcp-namespace.js';
|
|
14
14
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
15
|
-
import { workspaceIdForBranch } from '
|
|
15
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
16
16
|
import '../auth/auth.middleware.js'; // Express Request augmentation (req.userId / req.userEmail)
|
|
17
17
|
|
|
18
18
|
export interface SecretsVaultRoutesDeps {
|
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
6
6
|
import { SkillService } from '../skills.service.js';
|
|
7
|
-
import { workspaceIdForBranch } from '
|
|
7
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
8
8
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
9
9
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
10
10
|
import { readFile as fsReadFile } from 'node:fs/promises';
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
type ChangeRequest,
|
|
5
5
|
type IWorkflowService,
|
|
6
6
|
} from '@bevel-software/platform-shared';
|
|
7
|
-
import {
|
|
7
|
+
import { type WorkspaceService } from '../workspace/workspace.service.js';
|
|
8
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
8
9
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
9
10
|
import { hashEmail } from '../../shared/hash-email.js';
|
|
10
11
|
import { resolveDeclaredId } from '../../shared/frontmatter-id.js';
|
|
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import { parseDocument } from 'yaml';
|
|
4
4
|
import { DEFAULT_BRANCH, PLUGINS_DIR } from '@bevel-software/platform-shared';
|
|
5
5
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
6
|
-
import { workspaceIdForBranch } from '
|
|
6
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
7
7
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
8
8
|
import { extractFrontmatter, resolveDeclaredId, dedupeById } from '../../shared/frontmatter-id.js';
|
|
9
9
|
import { walkFiles } from '../../shared/fs-walk.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { LocalFilesystem } from '@mastra/core/workspace';
|
|
2
2
|
import type { IWorkflowService } from '@bevel-software/platform-shared';
|
|
3
|
-
import { LockingFilesystem } from '../
|
|
4
|
-
import { ReadOnlyFilesystem } from '../
|
|
5
|
-
import { makeRolesYamlWriteValidator } from '../access/roles-yaml-guard.js';
|
|
6
|
-
import type { ICreatorAccess } from '../access/creator
|
|
7
|
-
import {
|
|
3
|
+
import { LockingFilesystem } from '../kb-fs/locking-filesystem.js';
|
|
4
|
+
import { ReadOnlyFilesystem } from '../kb-fs/read-only-filesystem.js';
|
|
5
|
+
import { makeRolesYamlWriteValidator } from '../access-model/roles-yaml-guard.js';
|
|
6
|
+
import type { ICreatorAccess } from '../access-model/creator.js';
|
|
7
|
+
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
8
|
+
import { branchForWorkspaceId } from '../../shared/workspace-id.js';
|
|
8
9
|
import type { WorkflowEventBus } from '../workflow/event-bus.js';
|
|
9
10
|
import type { AuthService } from '../auth/auth.service.js';
|
|
10
11
|
import { ToolError, type ToolContext } from './tool.contract.js';
|
|
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import os from 'node:os';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { DEFAULT_BRANCH, type AuthUser } from '@bevel-software/platform-shared';
|
|
6
|
-
import { workspaceIdForBranch } from '
|
|
6
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
7
7
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
8
8
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
9
9
|
import type { IToolManualService, ToolManualSummary } from '../tool-manuals.contract.js';
|
|
@@ -6,7 +6,7 @@ import express from 'express';
|
|
|
6
6
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
7
7
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
8
8
|
import { createToolManualsAgentRoutes } from '../tool-manuals.routes.js';
|
|
9
|
-
import { workspaceIdForBranch } from '
|
|
9
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
10
10
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
11
11
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
12
12
|
import type { IToolManualService } from '../tool-manuals.contract.js';
|
|
@@ -7,7 +7,7 @@ import { afterEach, describe, expect, it, test, vi } from 'vitest';
|
|
|
7
7
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
8
8
|
import { createToolManualsBrowserRoutes } from '../tool-manuals.routes.js';
|
|
9
9
|
import { ToolManualService } from '../tool-manuals.service.js';
|
|
10
|
-
import { workspaceIdForBranch } from '
|
|
10
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
11
11
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
12
12
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
13
13
|
import type { IToolManualService, ToolManualDetail } from '../tool-manuals.contract.js';
|
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
6
6
|
import { ToolManualService, type McpAuthDiscoveryPort } from '../tool-manuals.service.js';
|
|
7
|
-
import { workspaceIdForBranch } from '
|
|
7
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
8
8
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
9
9
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { DEFAULT_BRANCH } from '@bevel-software/platform-shared';
|
|
6
6
|
import { ToolManualService } from '../tool-manuals.service.js';
|
|
7
|
-
import { workspaceIdForBranch } from '
|
|
7
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
8
8
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
9
9
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
10
10
|
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
PLUGIN_MCP_FILE,
|
|
9
9
|
type AuthUser,
|
|
10
10
|
} from '@bevel-software/platform-shared';
|
|
11
|
-
import {
|
|
11
|
+
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
12
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
12
13
|
import { validatedVariables } from './mcp-json-discovery.js';
|
|
13
14
|
import { assertSafeFetchUrl } from '../../shared/ssrf.js';
|
|
14
15
|
import { containsVariableReference, findReservedVariableRef } from '../../shared/variable-refs.js';
|
|
@@ -3,7 +3,8 @@ import path from 'node:path';
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import AdmZip from 'adm-zip';
|
|
5
5
|
import { DEFAULT_BRANCH, PLUGINS_DIR } from '@bevel-software/platform-shared';
|
|
6
|
-
import {
|
|
6
|
+
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
7
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
7
8
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
8
9
|
import '@utcp/http'; // side effect: register the 'http' call-template type
|
|
9
10
|
import { CallTemplateSerializer, type CallTemplate } from '@utcp/sdk';
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from '@bevel-software/platform-shared';
|
|
18
18
|
import { descriptorsFromMcpJson } from './mcp-json-discovery.js';
|
|
19
19
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
20
|
-
import { workspaceIdForBranch } from '
|
|
20
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
21
21
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
22
22
|
import { assertSafeFetchUrl } from '../../shared/ssrf.js';
|
|
23
23
|
import { RESERVED_VARIABLE_NAMES, findReservedVariableRef } from '../../shared/variable-refs.js';
|
|
@@ -5,7 +5,7 @@ import type { ToolContext } from '../tool-helpers/tool.contract.js';
|
|
|
5
5
|
import { toolDef } from '../tool-helpers/tool-def.js';
|
|
6
6
|
import type { ToolHandlerFactory } from '../tool-helpers/tool-handler.js';
|
|
7
7
|
import type { IAccessControl } from '../access/access-control.interface.js';
|
|
8
|
-
import { workspaceIdForBranch } from '
|
|
8
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
9
9
|
import { utcpNamespacedKey } from '../../shared/utcp-namespace.js';
|
|
10
10
|
import type { IToolManualService } from './tool-manuals.contract.js';
|
|
11
11
|
|
|
@@ -12,7 +12,7 @@ import { FileLockService } from '../file-lock.service.js';
|
|
|
12
12
|
import { PendingCommitsService } from '../pending-commits.service.js';
|
|
13
13
|
import { WorkflowService } from '../workflow.service.js';
|
|
14
14
|
import type { Database } from '../../database/connection.js';
|
|
15
|
-
import { RolesYamlPreservationError } from '
|
|
15
|
+
import { RolesYamlPreservationError } from '../../../shared/domain-errors.js';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Focused tests for the roles.yaml-preservation guard inside
|
|
@@ -10,7 +10,7 @@ import { PendingCommitsService } from '../pending-commits.service.js';
|
|
|
10
10
|
import { WorkflowEventBus } from '../event-bus.js';
|
|
11
11
|
import { WorkflowService } from '../workflow.service.js';
|
|
12
12
|
import type { Database } from '../../database/connection.js';
|
|
13
|
-
import { WorkflowValidationError } from '
|
|
13
|
+
import { WorkflowValidationError } from '../../../shared/domain-errors.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* `commitFileWhileLocked` (autosave checkpoint) has subtler semantics
|
|
@@ -12,7 +12,7 @@ import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
|
12
12
|
import { FileLockService } from '../file-lock.service.js';
|
|
13
13
|
import { PendingCommitsService } from '../pending-commits.service.js';
|
|
14
14
|
import { WorkflowService } from '../workflow.service.js';
|
|
15
|
-
import { PullRebaseConflictError } from '
|
|
15
|
+
import { PullRebaseConflictError } from '../../../shared/domain-errors.js';
|
|
16
16
|
import type { Database } from '../../database/connection.js';
|
|
17
17
|
|
|
18
18
|
// `deleteBranch`'s open-request guard is the only DB touch these tests
|
|
@@ -5,7 +5,7 @@ import { ToolError, type ToolContext, type ToolHandler } from '../../tool-helper
|
|
|
5
5
|
import { toolDef, withBranchInput } from '../../tool-helpers/tool-def.js';
|
|
6
6
|
import type { ToolHandlerFactory } from '../../tool-helpers/tool-handler.js';
|
|
7
7
|
import { requireInternalSource } from '../../tool-auth/tool-auth.middleware.js';
|
|
8
|
-
import { workspaceIdForBranch } from '
|
|
8
|
+
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
9
9
|
|
|
10
10
|
// A function, not a constant: the branch model is applied during boot, and a
|
|
11
11
|
// module-scope capture would freeze this at the empty set that exists before it.
|
|
@@ -21,7 +21,7 @@ import { and, eq, gt, lte } from 'drizzle-orm';
|
|
|
21
21
|
import type { Database } from '../database/connection.js';
|
|
22
22
|
import { fileLocks } from '../database/schema.js';
|
|
23
23
|
import type { AcquireLockResult, AuthUser, FileLock } from '@bevel-software/platform-shared';
|
|
24
|
-
import { WorkflowValidationError } from '
|
|
24
|
+
import { WorkflowValidationError } from '../../shared/domain-errors.js';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Lock lifetime without a heartbeat. The client is expected to heartbeat
|
|
@@ -9,7 +9,7 @@ import type { WorkspaceService } from '../../../workspace/workspace.service.js';
|
|
|
9
9
|
import { WorkflowHooks } from '../../workflow-hooks.js';
|
|
10
10
|
import type { IAccessControl } from '../../../access/access-control.interface.js';
|
|
11
11
|
import { GitService } from '../git.service.js';
|
|
12
|
-
import { AccessDeniedError } from '../../../access/access-errors.js';
|
|
12
|
+
import { AccessDeniedError } from '../../../access-model/access-errors.js';
|
|
13
13
|
|
|
14
14
|
const execFileAsync = promisify(execFile);
|
|
15
15
|
const PROCESS_MAP_DIR = 'knowledge-base';
|
|
@@ -7,7 +7,7 @@ import os from 'node:os';
|
|
|
7
7
|
import type { WorkspaceService } from '../../../workspace/workspace.service.js';
|
|
8
8
|
import { WorkflowHooks } from '../../workflow-hooks.js';
|
|
9
9
|
import { GitService } from '../git.service.js';
|
|
10
|
-
import { WorkflowValidationError } from '
|
|
10
|
+
import { WorkflowValidationError } from '../../../../shared/domain-errors.js';
|
|
11
11
|
|
|
12
12
|
const execFileAsync = promisify(execFile);
|
|
13
13
|
const PROCESS_MAP_DIR = 'knowledge-base';
|
|
@@ -7,7 +7,7 @@ import os from 'node:os';
|
|
|
7
7
|
import type { WorkspaceService } from '../../../workspace/workspace.service.js';
|
|
8
8
|
import { WorkflowHooks } from '../../workflow-hooks.js';
|
|
9
9
|
import { GitService } from '../git.service.js';
|
|
10
|
-
import { WorkflowValidationError, BranchNameError } from '
|
|
10
|
+
import { WorkflowValidationError, BranchNameError } from '../../../../shared/domain-errors.js';
|
|
11
11
|
|
|
12
12
|
const execFileAsync = promisify(execFile);
|
|
13
13
|
const PROCESS_MAP_DIR = 'knowledge-base';
|
|
@@ -3,7 +3,7 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import os from 'node:os';
|
|
5
5
|
import { GitService } from '../git.service.js';
|
|
6
|
-
import { PullRebaseConflictError } from '
|
|
6
|
+
import { PullRebaseConflictError } from '../../../../shared/domain-errors.js';
|
|
7
7
|
import { runGit, gitOut, stubWorkflowHooks, stubWorkspaceService } from './git-test-helpers.js';
|
|
8
8
|
|
|
9
9
|
/** See git.service.createBranch.test.ts — same prod-mirroring layout. */
|