@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FileTreeEntry, IWorkspaceService } from '@bevel-software/platform-shared';
|
|
2
|
-
import { WorkflowDomainError } from '
|
|
2
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
3
3
|
import { accessMdPathForFolder } from './access-mutation.service.js';
|
|
4
4
|
import {
|
|
5
5
|
EVERYONE_CANONICAL,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseOwnAccessEntries,
|
|
10
10
|
type ParsedEntry,
|
|
11
11
|
type Verb,
|
|
12
|
-
} from '
|
|
12
|
+
} from '../access-model/access-grammar.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* WHERE access rules are DECLARED inside a folder — a read-only inventory, not
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
KNOWN_VERBS,
|
|
42
42
|
ROLE_TOKEN_PREFIX,
|
|
43
43
|
canonicalRoleName,
|
|
44
|
-
} from '
|
|
44
|
+
} from '../access-model/access-grammar.js';
|
|
45
45
|
import {
|
|
46
46
|
spliceRevoke,
|
|
47
47
|
spliceGrant,
|
|
@@ -49,8 +49,8 @@ import {
|
|
|
49
49
|
AccessSpliceError,
|
|
50
50
|
type Principal,
|
|
51
51
|
type TokenMatch,
|
|
52
|
-
} from '
|
|
53
|
-
import { WorkflowDomainError } from '
|
|
52
|
+
} from '../access-model/access-splice.js';
|
|
53
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
54
54
|
|
|
55
55
|
/** Whether the dialog target is a folder (edit folder access.md) or a file (edit node frontmatter). */
|
|
56
56
|
export type TargetKind = 'folder' | 'file';
|
|
@@ -7,12 +7,12 @@ import type {
|
|
|
7
7
|
GrantSources,
|
|
8
8
|
} from './access-control.interface.js';
|
|
9
9
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
10
|
-
import { branchForWorkspaceId, workspaceIdForBranch } from '
|
|
10
|
+
import { branchForWorkspaceId, workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
11
11
|
import type { AuthService } from '../auth/auth.service.js';
|
|
12
12
|
import type { WorkflowService } from '../workflow/workflow.service.js';
|
|
13
13
|
import type { WorkflowEventBus } from '../workflow/event-bus.js';
|
|
14
|
-
import { WorkflowDomainError } from '
|
|
15
|
-
import { AccessDeniedError } from '
|
|
14
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
15
|
+
import { AccessDeniedError } from '../access-model/access-errors.js';
|
|
16
16
|
import {
|
|
17
17
|
AccessMutationService,
|
|
18
18
|
AccessMutationError,
|
|
@@ -24,11 +24,11 @@ import {
|
|
|
24
24
|
EVERYONE_CANONICAL,
|
|
25
25
|
ROLE_TOKEN_PREFIX,
|
|
26
26
|
type Verb,
|
|
27
|
-
} from '
|
|
27
|
+
} from '../access-model/access-grammar.js';
|
|
28
28
|
import { listAccessDeclarationsUnder } from './access-declarations.js';
|
|
29
29
|
import { toHttpError as sharedToHttpError, requireNonEmptyString as sharedRequireNonEmptyString } from './admin-route-helpers.js';
|
|
30
30
|
import { RolesAdminService } from './roles-admin.service.js';
|
|
31
|
-
import type { Principal } from '
|
|
31
|
+
import type { Principal } from '../access-model/access-splice.js';
|
|
32
32
|
import type { Database } from '../database/connection.js';
|
|
33
33
|
import { users } from '../database/schema.js';
|
|
34
34
|
import '../auth/auth.middleware.js';
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
|
|
48
48
|
import path from 'node:path';
|
|
49
49
|
|
|
50
|
-
import { LockingFilesystem } from '../
|
|
51
|
-
import { PushNeedsAgentResolutionError, WorkflowDomainError } from '
|
|
50
|
+
import { LockingFilesystem } from '../kb-fs/locking-filesystem.js';
|
|
51
|
+
import { PushNeedsAgentResolutionError, WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
52
52
|
import type { AuthUser, IWorkspaceService, IWorkflowService } from '@bevel-software/platform-shared';
|
|
53
53
|
import type { FileContent } from '@mastra/core/workspace';
|
|
54
54
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import type express from 'express';
|
|
16
|
-
import { WorkflowDomainError } from '
|
|
16
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
17
17
|
|
|
18
18
|
/** One error shape for every access-family route. */
|
|
19
19
|
export function toHttpError(
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* really a group; the roles admin surface flags it with a convert action.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { ADMIN_CANONICAL, canonicalRoleName } from '
|
|
21
|
+
import { ADMIN_CANONICAL, canonicalRoleName } from '../access-model/access-grammar.js';
|
|
22
22
|
|
|
23
23
|
/** A capability an app surface gates on. Grow this union with the gates. */
|
|
24
24
|
export type Capability =
|
|
@@ -37,78 +37,15 @@ import path from 'node:path';
|
|
|
37
37
|
|
|
38
38
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
39
39
|
import type { IAccessControl } from './access-control.interface.js';
|
|
40
|
-
import { spliceGrant, type Principal } from '
|
|
41
|
-
import { isAccessMdPath } from '
|
|
42
|
-
import { toKbRelative } from '
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
* file's CURRENT text under its lock and write `apply(current)` ('' when
|
|
50
|
-
* absent), never a precomputed fresh file: two concurrent creators can
|
|
51
|
-
* both plan a seed for the same new directory, and a blind overwrite
|
|
52
|
-
* would silently revoke whichever grant landed first. Skip the write when
|
|
53
|
-
* `apply` returns the input unchanged, and call `noteAccessFileWritten`
|
|
54
|
-
* after a write so the resolver cache drops.
|
|
55
|
-
* - `frontmatter`: run the new file's content through `apply` before
|
|
56
|
-
* writing it, so the grant lands atomically inside the created file.
|
|
57
|
-
*/
|
|
58
|
-
export type CreationGrantPlan =
|
|
59
|
-
| { kind: 'seed-access-md'; wsRelPath: string; apply: (current: string) => string }
|
|
60
|
-
| { kind: 'frontmatter'; apply: (content: string) => string };
|
|
61
|
-
|
|
62
|
-
/** The creator identity a grant is written for. */
|
|
63
|
-
export interface Creator {
|
|
64
|
-
name: string;
|
|
65
|
-
email: string;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Injection seam for the creation surfaces (routes, lock-aware filesystem,
|
|
70
|
-
* upload apply). Kept as an interface so callers depend on the contract, not
|
|
71
|
-
* the class.
|
|
72
|
-
*/
|
|
73
|
-
export interface ICreatorAccess {
|
|
74
|
-
planForCreate(
|
|
75
|
-
workspaceId: string,
|
|
76
|
-
creator: Creator,
|
|
77
|
-
wsRelPath: string,
|
|
78
|
-
kind: 'file' | 'dir',
|
|
79
|
-
): Promise<CreationGrantPlan | null>;
|
|
80
|
-
|
|
81
|
-
grantInExtractedFile(
|
|
82
|
-
workspaceId: string,
|
|
83
|
-
creator: Creator,
|
|
84
|
-
wsRelPath: string,
|
|
85
|
-
): Promise<string | null>;
|
|
86
|
-
|
|
87
|
-
noteAccessFileWritten(workspaceId: string): void;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* The splice-safe principal for a creator — exported because plugin
|
|
92
|
-
* provisioning (`PluginProvisionService`) writes the same `Name <email>`
|
|
93
|
-
* entries into the access.md files it seeds, and two spellings of the same
|
|
94
|
-
* person would read as two people.
|
|
95
|
-
*/
|
|
96
|
-
export function creatorPrincipal(creator: Creator): Principal {
|
|
97
|
-
return { kind: 'user', email: creator.email, displayName: safeDisplayName(creator) };
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* `Name <email>`-safe display name: `validatePrincipal` rejects control
|
|
102
|
-
* chars, `<`, `>`, and `#`, so strip those from the user's name and fall
|
|
103
|
-
* back to the email local part (which the email regex already keeps free of
|
|
104
|
-
* `<>`/whitespace) when nothing usable remains.
|
|
105
|
-
*/
|
|
106
|
-
function safeDisplayName(creator: Creator): string {
|
|
107
|
-
const strip = (s: string) =>
|
|
108
|
-
// eslint-disable-next-line no-control-regex -- same intentional control-char guard as access-splice
|
|
109
|
-
s.replace(/[<>#\u0000-\u001f\u007f]/g, ' ').replace(/\s+/g, ' ').trim();
|
|
110
|
-
return strip(creator.name) || strip(creator.email.split('@')[0] ?? '') || 'KB user';
|
|
111
|
-
}
|
|
40
|
+
import { spliceGrant, type Principal } from '../access-model/access-splice.js';
|
|
41
|
+
import { isAccessMdPath } from '../access-model/access-grammar.js';
|
|
42
|
+
import { toKbRelative } from '../access-model/kb-read-filter.js';
|
|
43
|
+
import {
|
|
44
|
+
creatorPrincipal,
|
|
45
|
+
type CreationGrantPlan,
|
|
46
|
+
type Creator,
|
|
47
|
+
type ICreatorAccess,
|
|
48
|
+
} from '../access-model/creator.js';
|
|
112
49
|
|
|
113
50
|
export class CreatorAccessService implements ICreatorAccess {
|
|
114
51
|
constructor(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import type { AuthUser } from '@bevel-software/platform-shared';
|
|
3
3
|
import type { IAdminAccessService } from '../admin/admin.interface.js';
|
|
4
|
-
import { canonicalRoleName } from '
|
|
4
|
+
import { canonicalRoleName } from '../access-model/access-grammar.js';
|
|
5
5
|
import { sendError as sharedSendError, requireNonEmptyString as sharedRequireNonEmptyString } from './admin-route-helpers.js';
|
|
6
6
|
import type { GroupsAdminService } from './groups-admin.service.js';
|
|
7
7
|
import '../auth/auth.middleware.js'; // Express Request augmentation
|
|
@@ -25,21 +25,20 @@
|
|
|
25
25
|
* "repair" by re-creating groups over live bytes).
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import { workspaceIdForBranch } from '
|
|
28
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
29
29
|
import type { WorkflowEventBus } from '../workflow/event-bus.js';
|
|
30
30
|
import type { AuthUser, IWorkspaceService, IWorkflowService } from '@bevel-software/platform-shared';
|
|
31
|
-
import { WorkflowDomainError } from '
|
|
31
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
32
32
|
import type { IAccessControl } from './access-control.interface.js';
|
|
33
33
|
import {
|
|
34
34
|
GROUP_REF_PREFIX,
|
|
35
35
|
canonicalRoleName,
|
|
36
36
|
hasAccessFrontmatterExtension,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} from '
|
|
40
|
-
import { GROUPS_YAML, SYNCED_GROUPS_YAML, validateGroupsFile } from './group-files.js';
|
|
37
|
+
} from '../access-model/access-grammar.js';
|
|
38
|
+
import { loadActiveGroups, type GroupsHealth } from './access-control.service.js';
|
|
39
|
+
import { GROUPS_YAML, SYNCED_GROUPS_YAML, validateGroupsFile } from '../access-model/group-files.js';
|
|
41
40
|
import { parseRolesModel, removeGroupRefsEverywhere, renameGroupRefs, isGroupRefMember } from './roles-edit.js';
|
|
42
|
-
import { makeRolesYamlWriteValidator } from '
|
|
41
|
+
import { makeRolesYamlWriteValidator } from '../access-model/roles-yaml-guard.js';
|
|
43
42
|
import {
|
|
44
43
|
GroupsEditError,
|
|
45
44
|
parseGroupsModel,
|
|
@@ -20,8 +20,8 @@ import {
|
|
|
20
20
|
EMAIL_REGEX,
|
|
21
21
|
GROUP_REF_PREFIX,
|
|
22
22
|
RESERVED_ROLE_NAMES,
|
|
23
|
-
} from '
|
|
24
|
-
import { GROUPS_YAML, parseGroupsFile, unsafeNameReason } from '
|
|
23
|
+
} from '../access-model/access-grammar.js';
|
|
24
|
+
import { GROUPS_YAML, parseGroupsFile, unsafeNameReason } from '../access-model/group-files.js';
|
|
25
25
|
|
|
26
26
|
/** Bad-input failure when editing groups.yaml. */
|
|
27
27
|
export class GroupsEditError extends Error {
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
* sweep the GET pays for).
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
import { workspaceIdForBranch } from '
|
|
35
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
36
36
|
import type { WorkflowEventBus } from '../workflow/event-bus.js';
|
|
37
37
|
import type { AuthUser, IWorkspaceService, IWorkflowService } from '@bevel-software/platform-shared';
|
|
38
|
-
import { WorkflowDomainError } from '
|
|
38
|
+
import { WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
39
39
|
import type { IAccessControl } from './access-control.interface.js';
|
|
40
40
|
import {
|
|
41
41
|
ADMIN_CANONICAL,
|
|
42
42
|
ROLE_TOKEN_PREFIX,
|
|
43
43
|
canonicalRoleName,
|
|
44
44
|
canonicalEmail,
|
|
45
|
-
|
|
46
|
-
} from './access-control.service.js';
|
|
47
|
-
import { makeRolesYamlWriteValidator } from '
|
|
48
|
-
import { renderRolesYaml } from '
|
|
45
|
+
} from '../access-model/access-grammar.js';
|
|
46
|
+
import { loadActiveGroups } from './access-control.service.js';
|
|
47
|
+
import { makeRolesYamlWriteValidator } from '../access-model/roles-yaml-guard.js';
|
|
48
|
+
import { renderRolesYaml } from '../access-model/render-roles-yaml.js';
|
|
49
49
|
import {
|
|
50
50
|
parseRolesModel,
|
|
51
51
|
deleteRole as editDeleteRole,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
RolesEditError,
|
|
58
58
|
type EditResult,
|
|
59
59
|
} from './roles-edit.js';
|
|
60
|
-
import { GROUPS_YAML, SYNCED_GROUPS_YAML, validateGroupsFile } from '
|
|
60
|
+
import { GROUPS_YAML, SYNCED_GROUPS_YAML, validateGroupsFile } from '../access-model/group-files.js';
|
|
61
61
|
import {
|
|
62
62
|
GroupsEditError,
|
|
63
63
|
assertSafeGroupDisplayName,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
parseGroupsModel,
|
|
66
66
|
} from './groups-edit.js';
|
|
67
67
|
import { capabilityRoleFor, isLegacyPeopleSetRole } from './capability-registry.js';
|
|
68
|
-
import { GROUP_REF_PREFIX, RESERVED_ROLE_NAMES } from '
|
|
68
|
+
import { GROUP_REF_PREFIX, RESERVED_ROLE_NAMES } from '../access-model/access-grammar.js';
|
|
69
69
|
import { AdminLockedCommits } from './admin-locked-commit.js';
|
|
70
70
|
import { KbReferenceScanner } from './reference-scan.js';
|
|
71
71
|
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
canonicalEmail,
|
|
40
40
|
EMAIL_REGEX,
|
|
41
41
|
GROUP_REF_PREFIX,
|
|
42
|
-
} from '
|
|
42
|
+
} from '../access-model/access-grammar.js';
|
|
43
43
|
|
|
44
44
|
/** Bad-input failure when editing roles.yaml (invalid name/email, unknown role). */
|
|
45
45
|
export class RolesEditError extends Error {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import type { AuthUser, IWorkflowService } from '@bevel-software/platform-shared';
|
|
3
3
|
import type { WorkspaceService } from '../workspace/workspace.service.js';
|
|
4
|
-
import { workspaceIdForBranch } from '
|
|
4
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
5
5
|
import type { AccessControlService } from './access-control.service.js';
|
|
6
|
-
import { SYNCED_GROUPS_YAML } from '
|
|
6
|
+
import { SYNCED_GROUPS_YAML } from '../access-model/group-files.js';
|
|
7
7
|
import type { WorkflowEventBus } from '../workflow/event-bus.js';
|
|
8
|
-
import { LockingFilesystem } from '../
|
|
9
|
-
import { PushNeedsAgentResolutionError, WorkflowDomainError } from '
|
|
8
|
+
import { LockingFilesystem } from '../kb-fs/locking-filesystem.js';
|
|
9
|
+
import { PushNeedsAgentResolutionError, WorkflowDomainError } from '../../shared/domain-errors.js';
|
|
10
10
|
import type { SyncedGroupsWriterDeps } from './synced-groups-writer.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
canonicalEmail,
|
|
5
5
|
canonicalRoleName,
|
|
6
6
|
RESERVED_ROLE_NAMES,
|
|
7
|
-
} from '
|
|
8
|
-
import { unsafeNameReason } from '
|
|
7
|
+
} from '../access-model/access-grammar.js';
|
|
8
|
+
import { unsafeNameReason } from '../access-model/group-files.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Locale-independent code-unit comparator. `localeCompare` would make the
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { parseYamlSubset } from '../access-grammar.js';
|
|
3
|
+
import { parseGroupsFile } from '../group-files.js';
|
|
4
|
+
|
|
5
|
+
describe('parseYamlSubset — inline empty collections', () => {
|
|
6
|
+
it('reads `key: []` as an empty list, not the scalar "[]"', () => {
|
|
7
|
+
const res = parseYamlSubset('owner: []');
|
|
8
|
+
expect(res.ok).toBe(true);
|
|
9
|
+
if (res.ok) expect(res.value).toEqual({ owner: [] });
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('reads `key: {}` as an empty mapping, not the scalar "{}"', () => {
|
|
13
|
+
const res = parseYamlSubset('groups: {}');
|
|
14
|
+
expect(res.ok).toBe(true);
|
|
15
|
+
if (res.ok) expect(res.value).toEqual({ groups: {} });
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('parseGroupsFile — empty group sources', () => {
|
|
20
|
+
it('accepts a bare `groups:` as a valid empty set', () => {
|
|
21
|
+
const res = parseGroupsFile('groups:\n', 'groups.yaml');
|
|
22
|
+
expect(res.ok).toBe(true);
|
|
23
|
+
if (res.ok) expect(res.groups.size).toBe(0);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('accepts the hand-written `groups: {}` as the same valid empty set', () => {
|
|
27
|
+
const res = parseGroupsFile('groups: {}\n', 'groups.yaml');
|
|
28
|
+
expect(res.ok).toBe(true);
|
|
29
|
+
if (res.ok) expect(res.groups.size).toBe(0);
|
|
30
|
+
});
|
|
31
|
+
});
|