@bevel-software/platform-core-backend 0.34.0 → 0.36.1
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/agent-guide/access-control.md +146 -300
- package/agent-guide/conventions.md +23 -25
- package/agent-guide/directory-structure.md +72 -120
- package/agent-guide/drafts-and-change-requests.md +92 -0
- package/agent-guide/for-git-users.md +47 -0
- package/agent-guide/glossary.md +36 -0
- package/agent-guide/how-agents-find-things.md +49 -0
- package/agent-guide/html-views.md +16 -11
- package/agent-guide/new-knowledge-base.md +9 -8
- package/agent-guide/onboarding.md +111 -0
- package/agent-guide/skills.md +67 -42
- package/agent-guide/start-here.md +66 -0
- package/agent-guide/tool-manuals.md +133 -154
- package/agent-guide/tools.md +67 -0
- package/agent-guide/where-a-new-file-goes.md +45 -28
- package/dist/core/catalog-cache-invalidation.d.ts +2 -2
- package/dist/core/catalog-cache-invalidation.d.ts.map +1 -1
- package/dist/core/compose-embed.d.ts +2 -2
- package/dist/core/compose-embed.d.ts.map +1 -1
- package/dist/core/compose-embed.js +1 -1
- package/dist/core/compose-embed.js.map +1 -1
- package/dist/core/core-ports.d.ts +19 -4
- 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.map +1 -1
- package/dist/core/create-core-server.js +27 -25
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +25 -13
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +75 -60
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +4 -4
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +5 -5
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core-config.d.ts +2 -2
- package/dist/core-config.js +3 -3
- package/dist/core-config.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/modules/access/access-control.interface.d.ts +22 -0
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +3 -1
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +76 -1
- 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 +2 -2
- package/dist/modules/access/access-mutation.service.d.ts.map +1 -1
- package/dist/modules/access/access-mutation.service.js +2 -2
- package/dist/modules/access/access-mutation.service.js.map +1 -1
- package/dist/modules/access/access-requests.routes.d.ts +2 -2
- package/dist/modules/access/access-requests.routes.d.ts.map +1 -1
- package/dist/modules/access/access-requests.routes.js +5 -5
- package/dist/modules/access/access-requests.routes.js.map +1 -1
- package/dist/modules/access/access-requests.service.d.ts +2 -2
- package/dist/modules/access/access-requests.service.d.ts.map +1 -1
- package/dist/modules/access/access-requests.service.js +11 -11
- package/dist/modules/access/access-requests.service.js.map +1 -1
- package/dist/modules/access/access.routes.d.ts +2 -2
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +32 -13
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/admin-locked-commit.d.ts +5 -5
- package/dist/modules/access/admin-locked-commit.d.ts.map +1 -1
- package/dist/modules/access/admin-locked-commit.js +7 -7
- package/dist/modules/access/admin-locked-commit.js.map +1 -1
- package/dist/modules/access/admin-route-helpers.d.ts +1 -1
- package/dist/modules/access/admin-route-helpers.js +5 -5
- package/dist/modules/access/admin-route-helpers.js.map +1 -1
- package/dist/modules/access/change-read-gate.d.ts +1 -1
- package/dist/modules/access/change-read-gate.js +1 -1
- package/dist/modules/access/groups-admin.service.d.ts +7 -7
- package/dist/modules/access/groups-admin.service.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.service.js +6 -6
- package/dist/modules/access/groups-admin.service.js.map +1 -1
- package/dist/modules/access/index.d.ts +1 -1
- package/dist/modules/access/index.d.ts.map +1 -1
- package/dist/modules/access/reference-scan.d.ts +1 -1
- package/dist/modules/access/roles-admin.service.d.ts +7 -7
- package/dist/modules/access/roles-admin.service.d.ts.map +1 -1
- package/dist/modules/access/roles-admin.service.js +8 -8
- package/dist/modules/access/roles-admin.service.js.map +1 -1
- package/dist/modules/access/synced-groups-committer.d.ts +4 -4
- package/dist/modules/access/synced-groups-committer.d.ts.map +1 -1
- package/dist/modules/access/synced-groups-committer.js +7 -7
- package/dist/modules/access/synced-groups-committer.js.map +1 -1
- package/dist/modules/access/user-access-removal.service.d.ts +6 -6
- package/dist/modules/access/user-access-removal.service.d.ts.map +1 -1
- package/dist/modules/access/user-access-removal.service.js +4 -4
- package/dist/modules/access/user-access-removal.service.js.map +1 -1
- package/dist/modules/access-model/access-errors.d.ts +4 -4
- package/dist/modules/access-model/access-errors.d.ts.map +1 -1
- package/dist/modules/access-model/access-errors.js +4 -4
- package/dist/modules/access-model/access-errors.js.map +1 -1
- package/dist/modules/access-model/access-grammar.d.ts +1 -1
- package/dist/modules/access-model/access-grammar.js +4 -4
- package/dist/modules/access-model/change-gate.d.ts +1 -1
- package/dist/modules/access-model/change-gate.js +1 -1
- package/dist/modules/access-model/roles-yaml-guard.d.ts +4 -4
- package/dist/modules/access-model/roles-yaml-guard.d.ts.map +1 -1
- package/dist/modules/access-model/roles-yaml-guard.js +4 -4
- package/dist/modules/access-model/roles-yaml-guard.js.map +1 -1
- package/dist/modules/agent-guide/agent-guide.d.ts +63 -18
- package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.js +144 -30
- package/dist/modules/agent-guide/agent-guide.js.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.d.ts +6 -2
- package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.js +45 -31
- package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -1
- package/dist/modules/agent-guide/guide-budget.d.ts +51 -0
- package/dist/modules/agent-guide/guide-budget.d.ts.map +1 -0
- package/dist/modules/agent-guide/guide-budget.js +71 -0
- package/dist/modules/agent-guide/guide-budget.js.map +1 -0
- package/dist/modules/agent-guide/index.d.ts +2 -1
- package/dist/modules/agent-guide/index.d.ts.map +1 -1
- package/dist/modules/agent-guide/index.js +2 -1
- package/dist/modules/agent-guide/index.js.map +1 -1
- package/dist/modules/agent-instructions/agent-instructions.routes.d.ts +12 -5
- package/dist/modules/agent-instructions/agent-instructions.routes.d.ts.map +1 -1
- package/dist/modules/agent-instructions/agent-instructions.routes.js +13 -6
- package/dist/modules/agent-instructions/agent-instructions.routes.js.map +1 -1
- package/dist/modules/agent-instructions/compose.d.ts +15 -8
- package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
- package/dist/modules/agent-instructions/compose.js +28 -10
- package/dist/modules/agent-instructions/compose.js.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.d.ts +14 -6
- package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.js +60 -18
- package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
- package/dist/modules/auth/account-erasure.service.d.ts +36 -7
- package/dist/modules/auth/account-erasure.service.d.ts.map +1 -1
- package/dist/modules/auth/account-erasure.service.js +30 -10
- package/dist/modules/auth/account-erasure.service.js.map +1 -1
- package/dist/modules/auth/account-hooks.d.ts +20 -0
- package/dist/modules/auth/account-hooks.d.ts.map +1 -1
- package/dist/modules/auth/account-hooks.js +10 -0
- package/dist/modules/auth/account-hooks.js.map +1 -1
- package/dist/modules/auth/account-switch-lock.js +2 -2
- package/dist/modules/auth/account-switch-lock.js.map +1 -1
- package/dist/modules/auth/account.routes.d.ts +7 -2
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +23 -4
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +1 -1
- package/dist/modules/auth/auth.service.js +4 -4
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/index.d.ts +1 -0
- package/dist/modules/auth/index.d.ts.map +1 -1
- package/dist/modules/code-mode/code-mode.tool.js +2 -2
- package/dist/modules/code-mode/code-mode.tool.js.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.d.ts +0 -12
- package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.js +1 -38
- package/dist/modules/connection-probe/connection-probe.service.js.map +1 -1
- package/dist/modules/database/core-schema.js +2 -2
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/diff/diff.routes.d.ts +3 -3
- package/dist/modules/diff/diff.routes.d.ts.map +1 -1
- package/dist/modules/diff/diff.routes.js +7 -7
- package/dist/modules/diff/diff.routes.js.map +1 -1
- package/dist/modules/embed/embed.routes.js +1 -1
- package/dist/modules/embed/embed.routes.js.map +1 -1
- package/dist/modules/embed/embed.service.d.ts +4 -4
- package/dist/modules/embed/embed.service.d.ts.map +1 -1
- package/dist/modules/embed/embed.service.js +18 -18
- package/dist/modules/embed/embed.service.js.map +1 -1
- package/dist/modules/kb-fs/branch-name.js +8 -8
- package/dist/modules/kb-fs/branch-name.js.map +1 -1
- package/dist/modules/kb-fs/file-change-notifier.d.ts +2 -2
- package/dist/modules/kb-fs/locking-filesystem.d.ts +9 -9
- package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.js +27 -27
- package/dist/modules/kb-fs/locking-filesystem.js.map +1 -1
- package/dist/modules/kb-fs/repo-path.js +5 -5
- package/dist/modules/kb-fs/repo-path.js.map +1 -1
- package/dist/modules/kb-fs/tmp-ref.d.ts +2 -2
- package/dist/modules/kb-fs/tmp-ref.d.ts.map +1 -1
- package/dist/modules/kb-fs/tmp-ref.js +2 -2
- package/dist/modules/kb-fs/tmp-ref.js.map +1 -1
- package/dist/modules/kb-sync/index.d.ts +1 -1
- package/dist/modules/kb-sync/index.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.interface.d.ts +3 -3
- package/dist/modules/kb-sync/kb-sync.interface.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.d.ts +3 -3
- package/dist/modules/kb-sync/kb-sync.service.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js +10 -10
- package/dist/modules/kb-sync/kb-sync.service.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +11 -4
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +80 -53
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/onboarding/onboarding.contract.d.ts +1 -1
- package/dist/modules/onboarding/onboarding.routes.js +2 -2
- package/dist/modules/onboarding/onboarding.routes.js.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.d.ts +4 -4
- package/dist/modules/onboarding/starter-pack.service.d.ts.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.js +4 -4
- package/dist/modules/onboarding/starter-pack.service.js.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts +2 -2
- package/dist/modules/plugins/join-request-jobs.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.js +7 -7
- package/dist/modules/plugins/join-request-jobs.service.js.map +1 -1
- package/dist/modules/plugins/join-requests.service.d.ts +3 -3
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +5 -5
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.js +1 -1
- package/dist/modules/plugins/plugin-rename.service.js.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +2 -2
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +8 -8
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts +87 -2
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +635 -74
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +3 -2
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +2 -1
- package/dist/modules/secrets-vault/index.js.map +1 -1
- package/dist/modules/secrets-vault/managed-sign-in-erasure.d.ts +36 -0
- package/dist/modules/secrets-vault/managed-sign-in-erasure.d.ts.map +1 -0
- package/dist/modules/secrets-vault/managed-sign-in-erasure.js +37 -0
- package/dist/modules/secrets-vault/managed-sign-in-erasure.js.map +1 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts +205 -11
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.contract.js +27 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +7 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +206 -45
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/settings/connection-check.js +1 -1
- package/dist/modules/settings/connection-check.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +1 -1
- package/dist/modules/settings/git-root-folders.js +1 -1
- package/dist/modules/settings/git-root-folders.js.map +1 -1
- package/dist/modules/settings/oidc-check.d.ts.map +1 -1
- package/dist/modules/settings/oidc-check.js +5 -17
- package/dist/modules/settings/oidc-check.js.map +1 -1
- package/dist/modules/settings/setup.routes.d.ts +1 -1
- package/dist/modules/settings/setup.routes.js +1 -1
- package/dist/modules/skills/pending-skills.service.d.ts +3 -3
- package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.js +4 -4
- package/dist/modules/skills/pending-skills.service.js.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +2 -2
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +5 -5
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
- package/dist/modules/skills/skills.tools.js +1 -1
- package/dist/modules/skills/skills.tools.js.map +1 -1
- package/dist/modules/tool-helpers/tool-context.d.ts +4 -4
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.js +2 -2
- package/dist/modules/tool-helpers/tool-context.js.map +1 -1
- package/dist/modules/tool-helpers/tool-def.js +1 -1
- package/dist/modules/tool-helpers/tool-def.js.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.js +2 -2
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.d.ts +4 -4
- package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts +7 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.d.ts.map +1 -1
- package/dist/modules/tool-manuals/mcp-json-discovery.js +69 -38
- package/dist/modules/tool-manuals/mcp-json-discovery.js.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/pending-tools.service.d.ts +3 -3
- package/dist/modules/tool-manuals/pending-tools.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.js +4 -4
- package/dist/modules/tool-manuals/pending-tools.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +70 -3
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +18 -8
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +166 -49
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +11 -2
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +66 -24
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/version-control/agent-tools/change-request-read-shape.d.ts.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-read-shape.js.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-read.tools.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/agent-tools/change-request-read.tools.js +2 -2
- package/dist/modules/version-control/agent-tools/change-request-read.tools.js.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-summary.d.ts.map +1 -0
- package/dist/modules/version-control/agent-tools/change-request-summary.js.map +1 -0
- package/dist/modules/{workflow/agent-tools/workflow.tools.d.ts → version-control/agent-tools/version-control.tools.d.ts} +4 -4
- package/dist/modules/version-control/agent-tools/version-control.tools.d.ts.map +1 -0
- package/dist/modules/{workflow/agent-tools/workflow.tools.js → version-control/agent-tools/version-control.tools.js} +53 -49
- package/dist/modules/version-control/agent-tools/version-control.tools.js.map +1 -0
- package/dist/modules/{workflow → version-control}/change-request-hooks.d.ts +1 -1
- package/dist/modules/version-control/change-request-hooks.d.ts.map +1 -0
- package/dist/modules/version-control/change-request-hooks.js.map +1 -0
- package/dist/modules/version-control/change-request-review/approval-lock.d.ts.map +1 -0
- package/dist/modules/version-control/change-request-review/approval-lock.js.map +1 -0
- package/dist/modules/{workflow/review-workflow/review-workflow.interface.d.ts → version-control/change-request-review/change-request-review.interface.d.ts} +2 -2
- package/dist/modules/version-control/change-request-review/change-request-review.interface.d.ts.map +1 -0
- package/dist/modules/version-control/change-request-review/change-request-review.interface.js +2 -0
- package/dist/modules/version-control/change-request-review/change-request-review.interface.js.map +1 -0
- package/dist/modules/{workflow/review-workflow/review-workflow.service.d.ts → version-control/change-request-review/change-request-review.service.d.ts} +3 -3
- package/dist/modules/version-control/change-request-review/change-request-review.service.d.ts.map +1 -0
- package/dist/modules/{workflow/review-workflow/review-workflow.service.js → version-control/change-request-review/change-request-review.service.js} +26 -26
- package/dist/modules/version-control/change-request-review/change-request-review.service.js.map +1 -0
- package/dist/modules/{workflow → version-control}/event-bus.d.ts +8 -8
- package/dist/modules/version-control/event-bus.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/event-bus.js +4 -4
- package/dist/modules/version-control/event-bus.js.map +1 -0
- package/dist/modules/{workflow → version-control}/events-delivery.d.ts +4 -4
- package/dist/modules/version-control/events-delivery.d.ts.map +1 -0
- package/dist/modules/version-control/events-delivery.js.map +1 -0
- package/dist/modules/{workflow → version-control}/events.routes.d.ts +4 -4
- package/dist/modules/version-control/events.routes.d.ts.map +1 -0
- package/dist/modules/version-control/events.routes.js.map +1 -0
- package/dist/modules/{workflow → version-control}/file-lock.service.d.ts +2 -2
- package/dist/modules/version-control/file-lock.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/file-lock.service.js +6 -6
- package/dist/modules/version-control/file-lock.service.js.map +1 -0
- package/dist/modules/version-control/git/change-request-link.d.ts.map +1 -0
- package/dist/modules/version-control/git/change-request-link.js.map +1 -0
- package/dist/modules/version-control/git/git-version.d.ts.map +1 -0
- package/dist/modules/version-control/git/git-version.js.map +1 -0
- package/dist/modules/{workflow → version-control}/git/git.service.d.ts +8 -8
- package/dist/modules/version-control/git/git.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/git/git.service.js +53 -53
- package/dist/modules/version-control/git/git.service.js.map +1 -0
- package/dist/modules/version-control/git/merge-commit.d.ts.map +1 -0
- package/dist/modules/version-control/git/merge-commit.js.map +1 -0
- package/dist/modules/version-control/git/node-git-runner.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/git/node-git-runner.js +1 -1
- package/dist/modules/version-control/git/node-git-runner.js.map +1 -0
- package/dist/modules/{workflow → version-control}/git/pull-request.service.d.ts +5 -5
- package/dist/modules/version-control/git/pull-request.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/git/pull-request.service.js +10 -10
- package/dist/modules/version-control/git/pull-request.service.js.map +1 -0
- package/dist/modules/{workflow → version-control}/index.d.ts +6 -5
- package/dist/modules/version-control/index.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/index.js +3 -2
- package/dist/modules/version-control/index.js.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.service.d.ts +2 -2
- package/dist/modules/version-control/pending-commits.service.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.service.js +2 -2
- package/dist/modules/version-control/pending-commits.service.js.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.worker.d.ts +5 -5
- package/dist/modules/version-control/pending-commits.worker.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/pending-commits.worker.js +3 -3
- package/dist/modules/version-control/pending-commits.worker.js.map +1 -0
- package/dist/modules/{workflow → version-control}/read-on-branch.d.ts +2 -2
- package/dist/modules/version-control/read-on-branch.d.ts.map +1 -0
- package/dist/modules/{workflow → version-control}/read-on-branch.js +2 -2
- package/dist/modules/version-control/read-on-branch.js.map +1 -0
- package/dist/modules/version-control/recovery-bot.d.ts.map +1 -0
- package/dist/modules/version-control/recovery-bot.js.map +1 -0
- package/dist/modules/version-control/sanitize-error.d.ts.map +1 -0
- package/dist/modules/version-control/sanitize-error.js.map +1 -0
- package/dist/modules/{workflow/workflow-hooks.d.ts → version-control/version-control-hooks.d.ts} +4 -4
- package/dist/modules/version-control/version-control-hooks.d.ts.map +1 -0
- package/dist/modules/{workflow/workflow-hooks.js → version-control/version-control-hooks.js} +3 -3
- package/dist/modules/version-control/version-control-hooks.js.map +1 -0
- package/dist/modules/{workflow/workflow.routes.d.ts → version-control/version-control.routes.d.ts} +6 -5
- package/dist/modules/version-control/version-control.routes.d.ts.map +1 -0
- package/dist/modules/{workflow/workflow.routes.js → version-control/version-control.routes.js} +61 -60
- package/dist/modules/version-control/version-control.routes.js.map +1 -0
- package/dist/modules/{workflow/workflow.service.d.ts → version-control/version-control.service.d.ts} +26 -31
- package/dist/modules/version-control/version-control.service.d.ts.map +1 -0
- package/dist/modules/{workflow/workflow.service.js → version-control/version-control.service.js} +89 -94
- package/dist/modules/version-control/version-control.service.js.map +1 -0
- package/dist/modules/workspace/agent-access.gate.d.ts +6 -6
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -1
- package/dist/modules/workspace/agent-access.gate.js +2 -2
- package/dist/modules/workspace/agent-access.gate.js.map +1 -1
- package/dist/modules/workspace/git-internals.middleware.d.ts +1 -1
- package/dist/modules/workspace/git-internals.middleware.js +2 -2
- package/dist/modules/workspace/kb-repository.js +1 -1
- package/dist/modules/workspace/kb-repository.js.map +1 -1
- package/dist/modules/workspace/startup/kb-git.d.ts +1 -1
- package/dist/modules/workspace/startup/kb-git.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-git.js +1 -1
- package/dist/modules/workspace/startup/kb-git.js.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts +2 -2
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts.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/startup/steps/template-files.step.d.ts +2 -2
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.js +2 -2
- package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.d.ts +17 -4
- package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.js +8 -5
- package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
- package/dist/modules/workspace/workspace-tmp.js +3 -3
- package/dist/modules/workspace/workspace-tmp.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts +4 -4
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +22 -22
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +6 -6
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +11 -11
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +5 -3
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +85 -30
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/shared/canonical-file-identity.d.ts +2 -2
- package/dist/shared/canonical-file-identity.js +5 -5
- package/dist/shared/canonical-file-identity.js.map +1 -1
- package/dist/shared/domain-errors.d.ts +39 -39
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +44 -44
- package/dist/shared/domain-errors.js.map +1 -1
- package/dist/shared/git.contract.d.ts +1 -1
- package/dist/shared/git.contract.js +1 -1
- package/dist/shared/http-errors.d.ts +3 -3
- package/dist/shared/http-errors.d.ts.map +1 -1
- package/dist/shared/http-errors.js +1 -1
- package/dist/shared/http-errors.js.map +1 -1
- package/dist/shared/oauth-token-error.d.ts +23 -0
- package/dist/shared/oauth-token-error.d.ts.map +1 -0
- package/dist/shared/oauth-token-error.js +47 -0
- package/dist/shared/oauth-token-error.js.map +1 -0
- package/dist/shared/pending-proposals.d.ts +3 -3
- package/dist/shared/pending-proposals.d.ts.map +1 -1
- package/dist/shared/pending-proposals.js +2 -2
- package/dist/shared/pending-proposals.js.map +1 -1
- package/dist/shared/read-capped.d.ts +19 -0
- package/dist/shared/read-capped.d.ts.map +1 -0
- package/dist/shared/read-capped.js +45 -0
- package/dist/shared/read-capped.js.map +1 -0
- package/dist/tenancy/static-tenant-source.js +1 -1
- package/dist/tenancy/static-tenant-source.js.map +1 -1
- package/migrations/0012_agent_audit.sql +40 -40
- package/migrations/0013_agent_identity_and_key_soft_delete.sql +29 -29
- package/migrations/meta/0012_snapshot.json +2246 -2246
- package/migrations/meta/0013_snapshot.json +2258 -2258
- package/package.json +5 -4
- package/src/__tests__/account-admin.ts +27 -0
- package/src/__tests__/hexis-catalog.ts +144 -0
- package/src/__tests__/kb-context.ts +30 -30
- package/src/__tests__/kb-layout-config.test.ts +21 -0
- package/src/__tests__/open-change-gate.ts +1 -1
- package/src/__tests__/real-disk.ts +21 -0
- package/src/__tests__/tokens.ts +19 -0
- package/src/__tests__/tool-handler.ts +15 -0
- package/src/__tests__/tool-manuals.ts +32 -0
- package/src/__tests__/tool-wiring.ts +31 -0
- package/src/__tests__/workspace-service.ts +1 -1
- package/src/core/__tests__/catalog-cache-invalidation.test.ts +3 -3
- package/src/core/__tests__/compose-embed.test.ts +1 -1
- package/src/core/__tests__/damaged-document.tools.test.ts +3 -3
- package/src/core/__tests__/erasure-slices-wired-once.test.ts +46 -0
- package/src/core/__tests__/gated-boot.test.ts +2 -2
- package/src/core/__tests__/lifecycle.test.ts +9 -9
- package/src/core/__tests__/oauth-sign-in-real-file.test.ts +179 -0
- package/src/core/catalog-cache-invalidation.ts +2 -2
- package/src/core/compose-embed.ts +3 -3
- package/src/core/core-ports.ts +19 -4
- package/src/core/create-core-server.ts +40 -26
- package/src/core/create-core-services.ts +92 -66
- package/src/core/lifecycle.ts +9 -9
- package/src/core-config.ts +3 -3
- package/src/index.ts +5 -5
- package/src/modules/access/__tests__/access-control.admin-root-floor.test.ts +4 -4
- package/src/modules/access/__tests__/access-own-read-grant.test.ts +14 -14
- package/src/modules/access/__tests__/access-requests.routes.test.ts +20 -20
- package/src/modules/access/__tests__/access.routes.admins.test.ts +4 -4
- package/src/modules/access/__tests__/access.routes.batch.test.ts +4 -4
- package/src/modules/access/__tests__/access.routes.folder-governs.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.group-grant.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.overrides.test.ts +5 -5
- package/src/modules/access/__tests__/access.routes.proposal-branch.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.prospective.test.ts +54 -14
- package/src/modules/access/__tests__/access.routes.revoke.test.ts +6 -6
- package/src/modules/access/__tests__/access.routes.unknown-email.test.ts +6 -6
- package/src/modules/access/__tests__/admin-locked-commit.test.ts +6 -6
- package/src/modules/access/__tests__/admin-route-helpers.test.ts +5 -5
- package/src/modules/access/__tests__/groups-admin.service.test.ts +27 -27
- package/src/modules/access/__tests__/holder-changes.test.ts +127 -0
- package/src/modules/access/__tests__/roles-admin.security.test.ts +14 -13
- package/src/modules/access/__tests__/roles-admin.service.test.ts +27 -27
- package/src/modules/access/__tests__/roles-capabilities.test.ts +19 -19
- package/src/modules/access/__tests__/roles.routes.test.ts +6 -6
- package/src/modules/access/__tests__/synced-groups-committer.test.ts +13 -13
- package/src/modules/access/__tests__/user-access-removal.service.test.ts +29 -29
- package/src/modules/access/access-control.interface.ts +26 -0
- package/src/modules/access/access-control.service.ts +93 -1
- package/src/modules/access/access-declarations.ts +2 -2
- package/src/modules/access/access-mutation.service.ts +2 -2
- package/src/modules/access/access-requests.routes.ts +7 -7
- package/src/modules/access/access-requests.service.ts +13 -13
- package/src/modules/access/access.routes.ts +34 -15
- package/src/modules/access/admin-locked-commit.ts +11 -11
- package/src/modules/access/admin-route-helpers.ts +5 -5
- package/src/modules/access/change-read-gate.ts +1 -1
- package/src/modules/access/groups-admin.service.ts +7 -7
- package/src/modules/access/index.ts +1 -1
- package/src/modules/access/reference-scan.ts +1 -1
- package/src/modules/access/roles-admin.service.ts +9 -9
- package/src/modules/access/synced-groups-committer.ts +11 -11
- package/src/modules/access/user-access-removal.service.ts +7 -7
- package/src/modules/access-model/__tests__/access-grammar.test.ts +2 -2
- package/src/modules/access-model/access-errors.ts +4 -4
- package/src/modules/access-model/access-grammar.ts +4 -4
- package/src/modules/access-model/change-gate.ts +1 -1
- package/src/modules/access-model/roles-yaml-guard.ts +4 -4
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +98 -29
- package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +39 -12
- package/src/modules/agent-guide/__tests__/guide-budget.test.ts +95 -0
- package/src/modules/agent-guide/__tests__/guide-eval.test.ts +182 -0
- package/src/modules/agent-guide/__tests__/guide-matches-code.test.ts +263 -0
- package/src/modules/agent-guide/__tests__/tool-surface.json +514 -0
- package/src/modules/agent-guide/__tests__/tool-surface.test.ts +75 -0
- package/src/modules/agent-guide/agent-guide.tools.ts +49 -31
- package/src/modules/agent-guide/agent-guide.ts +165 -32
- package/src/modules/agent-guide/guide-budget.ts +77 -0
- package/src/modules/agent-guide/index.ts +12 -0
- package/src/modules/agent-instructions/__tests__/agent-instructions.route.test.ts +4 -5
- package/src/modules/agent-instructions/__tests__/compose.test.ts +1 -1
- package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +117 -11
- package/src/modules/agent-instructions/agent-instructions.routes.ts +12 -5
- package/src/modules/agent-instructions/compose.ts +28 -9
- package/src/modules/agent-instructions/shared-file-rules.ts +62 -18
- package/src/modules/agent-scope/__tests__/agent-surfaces.connect-as.test.ts +1 -1
- package/src/modules/audit/__tests__/agent-rest-audit.middleware.test.ts +113 -113
- package/src/modules/audit/__tests__/event-classifier.test.ts +121 -121
- package/src/modules/audit/event-classifier.ts +155 -155
- package/src/modules/auth/__tests__/account-deactivation.test.ts +1 -1
- package/src/modules/auth/__tests__/account-erasure.approval-gate.test.ts +4 -4
- package/src/modules/auth/__tests__/account-erasure.participants.test.ts +56 -0
- package/src/modules/auth/__tests__/account-switch-lock.pg.test.ts +2 -2
- package/src/modules/auth/__tests__/account-switch-lock.test.ts +2 -2
- package/src/modules/auth/__tests__/account.routes.test.ts +73 -11
- package/src/modules/auth/__tests__/auth.service.test.ts +1 -1
- package/src/modules/auth/account-erasure.service.ts +27 -9
- package/src/modules/auth/account-hooks.ts +34 -0
- package/src/modules/auth/account-switch-lock.ts +2 -2
- package/src/modules/auth/account.routes.ts +23 -5
- package/src/modules/auth/auth.service.ts +4 -4
- package/src/modules/auth/index.ts +1 -0
- package/src/modules/code-mode/code-mode.tool.ts +2 -2
- package/src/modules/connection-probe/__tests__/connection-probe.service.test.ts +5 -24
- package/src/modules/connection-probe/connection-probe.service.ts +1 -34
- package/src/modules/database/__tests__/advisory-lock.test.ts +169 -169
- package/src/modules/database/__tests__/migrations-unqualified.test.ts +32 -32
- package/src/modules/database/core-schema.ts +2 -2
- package/src/modules/diff/__tests__/diff.routes.read-gate.test.ts +2 -2
- package/src/modules/diff/__tests__/diff.routes.rejectPathsLocked.test.ts +12 -12
- package/src/modules/diff/diff.routes.ts +8 -8
- package/src/modules/embed/__tests__/embed.service.lock.test.ts +7 -7
- package/src/modules/embed/__tests__/embed.service.test.ts +42 -42
- package/src/modules/embed/__tests__/embed.tools.test.ts +1 -1
- package/src/modules/embed/embed.routes.ts +1 -1
- package/src/modules/embed/embed.service.ts +17 -17
- package/src/modules/kb-fs/__tests__/branch-name.test.ts +2 -2
- package/src/modules/kb-fs/__tests__/locking-filesystem.test.ts +260 -260
- package/src/modules/kb-fs/__tests__/move-with-edits.test.ts +34 -34
- package/src/modules/kb-fs/__tests__/repo-path.test.ts +8 -8
- package/src/modules/kb-fs/branch-name.ts +8 -8
- package/src/modules/kb-fs/file-change-notifier.ts +2 -2
- package/src/modules/kb-fs/locking-filesystem.ts +30 -30
- package/src/modules/kb-fs/repo-path.ts +5 -5
- package/src/modules/kb-fs/tmp-ref.ts +3 -3
- package/src/modules/kb-sync/__tests__/kb-sync.service.test.ts +36 -36
- package/src/modules/kb-sync/index.ts +1 -1
- package/src/modules/kb-sync/kb-sync.interface.ts +3 -3
- package/src/modules/kb-sync/kb-sync.service.ts +9 -9
- package/src/modules/marketplace/__tests__/github-facade.test.ts +1 -1
- package/src/modules/marketplace/__tests__/marketplace-git.test.ts +1 -1
- package/src/modules/mcp/__tests__/mcp-proxy-helpers.test.ts +4 -2
- package/src/modules/mcp/__tests__/mcp.e2e.test.ts +69 -8
- package/src/modules/mcp/__tests__/mcp.service.test.ts +91 -13
- package/src/modules/mcp/__tests__/read-only-hint.pg.test.ts +194 -0
- package/src/modules/mcp/mcp.service.ts +93 -62
- package/src/modules/onboarding/__tests__/starter-pack.service.test.ts +55 -55
- package/src/modules/onboarding/onboarding.contract.ts +1 -1
- package/src/modules/onboarding/onboarding.routes.ts +2 -2
- package/src/modules/onboarding/starter-pack.service.ts +6 -6
- package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +1 -1
- package/src/modules/plugins/__tests__/compile-marketplace.test.ts +1 -1
- package/src/modules/plugins/__tests__/join-request-jobs.service.test.ts +43 -43
- package/src/modules/plugins/__tests__/join-requests.service.test.ts +19 -19
- package/src/modules/plugins/__tests__/join-requests.settlement.test.ts +26 -26
- package/src/modules/plugins/__tests__/plugins.routes.test.ts +25 -25
- package/src/modules/plugins/join-request-jobs.service.ts +10 -10
- package/src/modules/plugins/join-requests.service.ts +4 -4
- package/src/modules/plugins/plugin-rename.service.ts +1 -1
- package/src/modules/plugins/plugins.routes.ts +9 -9
- package/src/modules/secrets-vault/__tests__/db-secrets-vault.managed.test.ts +773 -0
- package/src/modules/secrets-vault/__tests__/db-secrets-vault.oauth.test.ts +458 -4
- package/src/modules/secrets-vault/__tests__/managed-sign-in.route.test.ts +351 -0
- package/src/modules/secrets-vault/__tests__/oauth-live-declaration.route.test.ts +218 -0
- package/src/modules/secrets-vault/__tests__/oauth-return-to.route.test.ts +39 -6
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +728 -118
- package/src/modules/secrets-vault/index.ts +8 -1
- package/src/modules/secrets-vault/managed-sign-in-erasure.ts +41 -0
- package/src/modules/secrets-vault/secrets-variable-loader.ts +134 -134
- package/src/modules/secrets-vault/secrets-vault.contract.ts +213 -11
- package/src/modules/secrets-vault/secrets-vault.routes.ts +244 -45
- package/src/modules/settings/__tests__/repository-source.test.ts +1 -1
- package/src/modules/settings/__tests__/setup.routes.layout-phase.test.ts +1 -1
- package/src/modules/settings/__tests__/setup.routes.managed-phase.test.ts +1 -1
- package/src/modules/settings/connection-check.ts +1 -1
- package/src/modules/settings/deployment-settings.service.ts +1 -1
- package/src/modules/settings/git-root-folders.ts +1 -1
- package/src/modules/settings/oidc-check.ts +5 -18
- package/src/modules/settings/setup.routes.ts +1 -1
- package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +3 -3
- package/src/modules/skills/__tests__/branch-skills.tools.test.ts +1 -1
- package/src/modules/skills/__tests__/pending-skills.service.test.ts +8 -8
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +18 -18
- package/src/modules/skills/__tests__/skills.service.test.ts +3 -3
- package/src/modules/skills/pending-skills.service.ts +3 -3
- package/src/modules/skills/skill-access-requests.routes.ts +7 -7
- package/src/modules/skills/skills.tools.ts +1 -1
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +22 -14
- package/src/modules/tool-helpers/__tests__/branch-declaration.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/can-write.tools.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +4 -4
- package/src/modules/tool-helpers/__tests__/route-tool-schemas.catalog.test.ts +38 -0
- package/src/modules/tool-helpers/__tests__/tools-surface.test.ts +3 -3
- package/src/modules/tool-helpers/__tests__/validate-token.test.ts +1 -1
- package/src/modules/tool-helpers/tool-context.ts +6 -6
- package/src/modules/tool-helpers/tool-def.ts +1 -1
- package/src/modules/tool-helpers/tool-handler.ts +2 -2
- package/src/modules/tool-helpers/tool.contract.ts +4 -4
- package/src/modules/tool-manuals/__tests__/pending-tools.service.test.ts +9 -9
- package/src/modules/tool-manuals/__tests__/tool-manuals.managed-sign-in.test.ts +89 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.mcp-oauth.test.ts +197 -11
- package/src/modules/tool-manuals/__tests__/tool-manuals.restart.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +132 -6
- package/src/modules/tool-manuals/mcp-json-discovery.ts +73 -34
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +1 -1
- package/src/modules/tool-manuals/pending-tools.service.ts +3 -3
- package/src/modules/tool-manuals/tool-delete.service.ts +1 -1
- package/src/modules/tool-manuals/tool-manuals.contract.ts +63 -3
- package/src/modules/tool-manuals/tool-manuals.service.ts +191 -51
- package/src/modules/tool-manuals/tool-manuals.tools.ts +93 -28
- package/src/modules/tool-registry/__tests__/own-tool-schemas.test.ts +4 -4
- package/src/modules/tool-registry/__tests__/read-only-hints.test.ts +3 -3
- package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +12 -119
- package/src/modules/{workflow → version-control}/__tests__/apply-failure.test.ts +54 -54
- package/src/modules/{workflow → version-control}/__tests__/event-bus.test.ts +27 -27
- package/src/modules/{workflow → version-control}/__tests__/events-delivery.test.ts +37 -37
- package/src/modules/{workflow → version-control}/__tests__/file-lock.service.deletion-gate.test.ts +2 -2
- package/src/modules/{workflow → version-control}/__tests__/file-lock.service.path-identity.test.ts +8 -8
- package/src/modules/{workflow → version-control}/__tests__/merge-announces-tree.test.ts +11 -11
- package/src/modules/{workflow → version-control}/__tests__/pending-commits.worker.concurrency.test.ts +9 -9
- package/src/modules/{workflow → version-control}/__tests__/pending-commits.worker.test.ts +25 -25
- package/src/modules/{workflow → version-control}/__tests__/preserve-roles-yaml.test.ts +42 -42
- package/src/modules/version-control/__tests__/public-surface.test.ts +114 -0
- package/src/modules/{workflow/__tests__/workflow.routes.folder-proposals.test.ts → version-control/__tests__/version-control.routes.folder-proposals.test.ts} +18 -18
- package/src/modules/{workflow/__tests__/workflow.routes.fork-point-file.test.ts → version-control/__tests__/version-control.routes.fork-point-file.test.ts} +19 -19
- package/src/modules/{workflow/__tests__/workflow.routes.history-read-gate.test.ts → version-control/__tests__/version-control.routes.history-read-gate.test.ts} +13 -13
- package/src/modules/{workflow/__tests__/workflow.routes.lock-path.test.ts → version-control/__tests__/version-control.routes.lock-path.test.ts} +18 -18
- package/src/modules/{workflow/__tests__/workflow.routes.open-change-request.test.ts → version-control/__tests__/version-control.routes.open-change-request.test.ts} +7 -7
- package/src/modules/{workflow/__tests__/workflow.routes.push-refused.test.ts → version-control/__tests__/version-control.routes.push-refused.test.ts} +14 -14
- package/src/modules/{workflow/__tests__/workflow.service.branch-in-use.test.ts → version-control/__tests__/version-control.service.branch-in-use.test.ts} +6 -6
- package/src/modules/{workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts → version-control/__tests__/version-control.service.commitFileWhileLocked.test.ts} +14 -14
- package/src/modules/{workflow/__tests__/workflow.service.delete-branch.test.ts → version-control/__tests__/version-control.service.delete-branch.test.ts} +14 -14
- package/src/modules/{workflow/__tests__/workflow.service.deleted-branch-sweep.test.ts → version-control/__tests__/version-control.service.deleted-branch-sweep.test.ts} +4 -4
- package/src/modules/{workflow/__tests__/workflow.service.facade.test.ts → version-control/__tests__/version-control.service.facade.test.ts} +97 -99
- package/src/modules/{workflow/__tests__/workflow.service.folder-proposals.test.ts → version-control/__tests__/version-control.service.folder-proposals.test.ts} +7 -7
- package/src/modules/{workflow/__tests__/workflow.service.platform-restore.test.ts → version-control/__tests__/version-control.service.platform-restore.test.ts} +6 -6
- package/src/modules/{workflow/__tests__/workflow.service.read-gate.test.ts → version-control/__tests__/version-control.service.read-gate.test.ts} +9 -9
- package/src/modules/{workflow/__tests__/workflow.service.releaseLock.test.ts → version-control/__tests__/version-control.service.releaseLock.test.ts} +42 -42
- package/src/modules/{workflow/__tests__/workflow.service.repository-replaced.test.ts → version-control/__tests__/version-control.service.repository-replaced.test.ts} +4 -4
- package/src/modules/{workflow/__tests__/workflow.service.sync.test.ts → version-control/__tests__/version-control.service.sync.test.ts} +17 -17
- package/src/modules/{workflow/__tests__/workflow.service.update-change-request.pg.test.ts → version-control/__tests__/version-control.service.update-change-request.pg.test.ts} +6 -6
- package/src/modules/{workflow/__tests__/workflow.service.update-change-request.test.ts → version-control/__tests__/version-control.service.update-change-request.test.ts} +11 -11
- package/src/modules/{workflow/__tests__/workflow.service.update-from-target.test.ts → version-control/__tests__/version-control.service.update-from-target.test.ts} +22 -22
- package/src/modules/{workflow → version-control}/agent-tools/__tests__/change-request-read.tools.test.ts +3 -3
- package/src/modules/{workflow → version-control}/agent-tools/__tests__/update-change-request.parity.test.ts +16 -16
- package/src/modules/{workflow/agent-tools/__tests__/workflow.tools.test.ts → version-control/agent-tools/__tests__/version-control.tools.test.ts} +9 -9
- package/src/modules/{workflow → version-control}/agent-tools/change-request-read.tools.ts +2 -2
- package/src/modules/{workflow/agent-tools/workflow.tools.ts → version-control/agent-tools/version-control.tools.ts} +52 -48
- package/src/modules/{workflow → version-control}/change-request-hooks.ts +1 -1
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/approval-states.test.ts +5 -5
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/cancel-pr.test.ts +8 -8
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/carry-approvals-forward.test.ts +6 -6
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/erase-approver.test.ts +5 -5
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/merge-gate.test.ts +3 -3
- package/src/modules/{workflow/review-workflow → version-control/change-request-review}/__tests__/merge-records-own-commit.test.ts +3 -3
- package/src/modules/{workflow/review-workflow/review-workflow.interface.ts → version-control/change-request-review/change-request-review.interface.ts} +1 -1
- package/src/modules/{workflow/review-workflow/review-workflow.service.ts → version-control/change-request-review/change-request-review.service.ts} +28 -28
- package/src/modules/{workflow → version-control}/event-bus.ts +14 -14
- package/src/modules/{workflow → version-control}/events-delivery.ts +11 -11
- package/src/modules/{workflow → version-control}/events.routes.ts +5 -5
- package/src/modules/{workflow → version-control}/file-lock.service.ts +6 -6
- package/src/modules/{workflow → version-control}/git/__tests__/git-test-helpers.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.accessGating.test.ts +5 -5
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.appliedChange.test.ts +4 -4
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.changedFilesForPr.test.ts +16 -16
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.changedPathsMemo.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.commitChanges.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.commitFile.strayPath.test.ts +10 -10
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.commitFile.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.createBranch.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.deleteBranch.test.ts +7 -7
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.diffFileAtCommit.test.ts +9 -9
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.diffFileBetweenBranches.test.ts +23 -23
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.fileBytesAtCommit.test.ts +7 -7
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.fileContentsAtCommit.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.forkPoint.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.history-guards.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.list-branches.test.ts +12 -12
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.listTrackedFiles.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.logForFile.test.ts +6 -6
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.mergeChangeRequest.test.ts +20 -20
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.mergeIntoBranch.test.ts +16 -16
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.pendingChanges.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.postMergePull.test.ts +5 -5
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.prFetchFailure.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.pull.test.ts +12 -12
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.readFileAtRef.test.ts +3 -3
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.revertPathsAndPush.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.status.test.ts +4 -4
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.syncFromRemote.test.ts +8 -8
- package/src/modules/{workflow → version-control}/git/__tests__/git.service.worktrees.test.ts +4 -4
- package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.list-fetch.test.ts +2 -2
- package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.test.ts +6 -6
- package/src/modules/{workflow → version-control}/git/git.service.ts +57 -57
- package/src/modules/{workflow → version-control}/git/node-git-runner.ts +1 -1
- package/src/modules/{workflow → version-control}/git/pull-request.service.ts +12 -12
- package/src/modules/{workflow → version-control}/index.ts +6 -5
- package/src/modules/{workflow → version-control}/pending-commits.service.ts +2 -2
- package/src/modules/{workflow → version-control}/pending-commits.worker.ts +8 -8
- package/src/modules/{workflow → version-control}/read-on-branch.ts +2 -2
- package/src/modules/{workflow/workflow-hooks.ts → version-control/version-control-hooks.ts} +3 -3
- package/src/modules/{workflow/workflow.routes.ts → version-control/version-control.routes.ts} +64 -63
- package/src/modules/{workflow/workflow.service.ts → version-control/version-control.service.ts} +92 -97
- package/src/modules/workspace/__tests__/agent-access.gate.test.ts +8 -8
- package/src/modules/workspace/__tests__/agent-downloads.test.ts +13 -16
- package/src/modules/workspace/__tests__/agent-uploads.test.ts +11 -12
- package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +11 -16
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +3 -3
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +27 -27
- package/src/modules/workspace/__tests__/kb-repository.test.ts +1 -1
- package/src/modules/workspace/__tests__/rest-tool-arguments.test.ts +3 -3
- package/src/modules/workspace/__tests__/start-session.default-branch.test.ts +152 -0
- package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace-tmp.tools.test.ts +13 -14
- package/src/modules/workspace/__tests__/workspace.routes.at-ref.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.branch-errors.test.ts +4 -4
- package/src/modules/workspace/__tests__/workspace.routes.create-grant.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +8 -8
- package/src/modules/workspace/__tests__/workspace.routes.download-implies-read.test.ts +4 -4
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.file-writes.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.folder-zip-access.test.ts +4 -4
- package/src/modules/workspace/__tests__/workspace.routes.folders.test.ts +6 -6
- package/src/modules/workspace/__tests__/workspace.routes.move-platform-files.test.ts +7 -7
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +13 -13
- package/src/modules/workspace/__tests__/workspace.service.any-workspace-credentials.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.service.replaced-repository.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.service.worktrees.test.ts +1 -1
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +12 -14
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +5 -5
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +182 -75
- package/src/modules/workspace/agent-access.gate.ts +6 -6
- package/src/modules/workspace/git-internals.middleware.ts +2 -2
- package/src/modules/workspace/kb-repository.ts +1 -1
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.degraded.test.ts +1 -1
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.test.ts +1 -1
- package/src/modules/workspace/startup/__tests__/kb-startup-runner.worktrees.test.ts +1 -1
- package/src/modules/workspace/startup/kb-git.ts +1 -1
- package/src/modules/workspace/startup/steps/__tests__/steps.test.ts +94 -70
- package/src/modules/workspace/startup/steps/seed-tree.ts +4 -5
- package/src/modules/workspace/startup/steps/template-files.step.ts +4 -5
- package/src/modules/workspace/startup/steps/template-source.ts +21 -6
- package/src/modules/workspace/workspace-tmp.ts +4 -4
- package/src/modules/workspace/workspace.routes.ts +26 -26
- package/src/modules/workspace/workspace.service.ts +11 -11
- package/src/modules/workspace/workspace.tools.ts +90 -30
- package/src/shared/__tests__/canonical-file-identity.test.ts +5 -5
- package/src/shared/__tests__/http-errors.test.ts +4 -4
- package/src/shared/__tests__/read-capped.test.ts +68 -0
- package/src/shared/canonical-file-identity.ts +5 -5
- package/src/shared/domain-errors.ts +44 -44
- package/src/shared/git.contract.ts +1 -1
- package/src/shared/http-errors.ts +3 -3
- package/src/shared/kb-context.ts +130 -130
- package/src/shared/oauth-token-error.ts +46 -0
- package/src/shared/pending-proposals.ts +4 -4
- package/src/shared/read-capped.ts +40 -0
- package/src/tenancy/__tests__/tenant-host.test.ts +372 -372
- package/src/tenancy/__tests__/tenant-runtime.test.ts +221 -221
- package/src/tenancy/__tests__/tenant-secrets.test.ts +35 -35
- package/src/tenancy/index.ts +35 -35
- package/src/tenancy/static-tenant-source.ts +1 -1
- package/src/tenancy/tenant-host.ts +261 -261
- package/src/tenancy/tenant-runtime.ts +208 -208
- package/src/tenancy/tenant-source.contract.ts +59 -59
- package/agent-guide/finding-things.md +0 -7
- package/agent-guide/introduction.md +0 -27
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js.map +0 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +0 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +0 -1
- package/dist/modules/workflow/change-request-hooks.d.ts.map +0 -1
- package/dist/modules/workflow/change-request-hooks.js.map +0 -1
- package/dist/modules/workflow/event-bus.d.ts.map +0 -1
- package/dist/modules/workflow/event-bus.js.map +0 -1
- package/dist/modules/workflow/events-delivery.d.ts.map +0 -1
- package/dist/modules/workflow/events-delivery.js.map +0 -1
- package/dist/modules/workflow/events.routes.d.ts.map +0 -1
- package/dist/modules/workflow/events.routes.js.map +0 -1
- package/dist/modules/workflow/file-lock.service.d.ts.map +0 -1
- package/dist/modules/workflow/file-lock.service.js.map +0 -1
- package/dist/modules/workflow/git/change-request-link.d.ts.map +0 -1
- package/dist/modules/workflow/git/change-request-link.js.map +0 -1
- package/dist/modules/workflow/git/git-version.d.ts.map +0 -1
- package/dist/modules/workflow/git/git-version.js.map +0 -1
- package/dist/modules/workflow/git/git.service.d.ts.map +0 -1
- package/dist/modules/workflow/git/git.service.js.map +0 -1
- package/dist/modules/workflow/git/merge-commit.d.ts.map +0 -1
- package/dist/modules/workflow/git/merge-commit.js.map +0 -1
- package/dist/modules/workflow/git/node-git-runner.d.ts.map +0 -1
- package/dist/modules/workflow/git/node-git-runner.js.map +0 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +0 -1
- package/dist/modules/workflow/git/pull-request.service.js.map +0 -1
- package/dist/modules/workflow/index.d.ts.map +0 -1
- package/dist/modules/workflow/index.js.map +0 -1
- package/dist/modules/workflow/pending-commits.service.d.ts.map +0 -1
- package/dist/modules/workflow/pending-commits.service.js.map +0 -1
- package/dist/modules/workflow/pending-commits.worker.d.ts.map +0 -1
- package/dist/modules/workflow/pending-commits.worker.js.map +0 -1
- package/dist/modules/workflow/read-on-branch.d.ts.map +0 -1
- package/dist/modules/workflow/read-on-branch.js.map +0 -1
- package/dist/modules/workflow/recovery-bot.d.ts.map +0 -1
- package/dist/modules/workflow/recovery-bot.js.map +0 -1
- package/dist/modules/workflow/review-workflow/approval-lock.d.ts.map +0 -1
- package/dist/modules/workflow/review-workflow/approval-lock.js.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.interface.js +0 -2
- package/dist/modules/workflow/review-workflow/review-workflow.interface.js.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +0 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +0 -1
- package/dist/modules/workflow/sanitize-error.d.ts.map +0 -1
- package/dist/modules/workflow/sanitize-error.js.map +0 -1
- package/dist/modules/workflow/workflow-hooks.d.ts.map +0 -1
- package/dist/modules/workflow/workflow-hooks.js.map +0 -1
- package/dist/modules/workflow/workflow.routes.d.ts.map +0 -1
- package/dist/modules/workflow/workflow.routes.js.map +0 -1
- package/dist/modules/workflow/workflow.service.d.ts.map +0 -1
- package/dist/modules/workflow/workflow.service.js.map +0 -1
- package/src/modules/mcp/__tests__/read-only-hint.e2e.test.ts +0 -213
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-read-shape.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-read-shape.js +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-read.tools.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-summary.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/agent-tools/change-request-summary.js +0 -0
- /package/dist/modules/{workflow → version-control}/change-request-hooks.js +0 -0
- /package/dist/modules/{workflow/review-workflow → version-control/change-request-review}/approval-lock.d.ts +0 -0
- /package/dist/modules/{workflow/review-workflow → version-control/change-request-review}/approval-lock.js +0 -0
- /package/dist/modules/{workflow → version-control}/events-delivery.js +0 -0
- /package/dist/modules/{workflow → version-control}/events.routes.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/change-request-link.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/git/change-request-link.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/git-version.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/git/git-version.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/merge-commit.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/git/merge-commit.js +0 -0
- /package/dist/modules/{workflow → version-control}/git/node-git-runner.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/recovery-bot.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/recovery-bot.js +0 -0
- /package/dist/modules/{workflow → version-control}/sanitize-error.d.ts +0 -0
- /package/dist/modules/{workflow → version-control}/sanitize-error.js +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/change-request-hooks.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/fake-file-lock-db.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/pending-commits.canonical.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/pending-commits.enqueue-if-absent.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/pending-commits.repository-replaced.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/__tests__/sanitize-error.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/agent-tools/__tests__/change-request-read-shape.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/agent-tools/change-request-read-shape.ts +0 -0
- /package/src/modules/{workflow → version-control}/agent-tools/change-request-summary.ts +0 -0
- /package/src/modules/{workflow/review-workflow → version-control/change-request-review}/approval-lock.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/branchAuthor.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/change-request-link.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/git-version.failure.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/git-version.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/node-git-runner.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.getPrDetail.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.placeholder.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.viewer-can-cancel.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.viewer-can-delete.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/__tests__/pull-request.service.viewer-can-update.test.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/change-request-link.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/git-version.ts +0 -0
- /package/src/modules/{workflow → version-control}/git/merge-commit.ts +0 -0
- /package/src/modules/{workflow → version-control}/recovery-bot.ts +0 -0
- /package/src/modules/{workflow → version-control}/sanitize-error.ts +0 -0
|
@@ -125,29 +125,31 @@ import {
|
|
|
125
125
|
import {
|
|
126
126
|
DbSecretsVaultService,
|
|
127
127
|
McpOAuthDiscoveryService,
|
|
128
|
+
managedSignInErasure,
|
|
128
129
|
registerBevelSecretsVariableLoader,
|
|
130
|
+
type ManagedSignInPort,
|
|
129
131
|
} from '../modules/secrets-vault/index.js';
|
|
130
132
|
import { ConnectionProbeService } from '../modules/connection-probe/index.js';
|
|
131
|
-
import { GitService } from '../modules/
|
|
132
|
-
import { NodeGitRunner } from '../modules/
|
|
133
|
-
import { PullRequestService } from '../modules/
|
|
133
|
+
import { GitService } from '../modules/version-control/git/git.service.js';
|
|
134
|
+
import { NodeGitRunner } from '../modules/version-control/git/node-git-runner.js';
|
|
135
|
+
import { PullRequestService } from '../modules/version-control/git/pull-request.service.js';
|
|
134
136
|
import { WorkspaceIdMutex, WorkspaceMutex } from '../modules/kb-fs/mutex.js';
|
|
135
|
-
import { assertGitVersion } from '../modules/
|
|
137
|
+
import { assertGitVersion } from '../modules/version-control/git/git-version.js';
|
|
136
138
|
import { DiffService } from '../modules/diff/diff.service.js';
|
|
137
|
-
import {
|
|
138
|
-
import { FileLockService } from '../modules/
|
|
139
|
-
import {
|
|
139
|
+
import { ChangeRequestReviewService } from '../modules/version-control/change-request-review/change-request-review.service.js';
|
|
140
|
+
import { FileLockService } from '../modules/version-control/file-lock.service.js';
|
|
141
|
+
import { VersionControlEventBus } from '../modules/version-control/index.js';
|
|
140
142
|
import { FileChangeNotifier } from '../modules/kb-fs/file-change-notifier.js';
|
|
141
143
|
import { StarterPackService } from '../modules/onboarding/starter-pack.service.js';
|
|
142
|
-
import {
|
|
143
|
-
import {
|
|
144
|
-
import { ChangeRequestHooks, type IChangeRequestHooks } from '../modules/
|
|
145
|
-
import { PendingCommitsService } from '../modules/
|
|
144
|
+
import { VersionControlService } from '../modules/version-control/version-control.service.js';
|
|
145
|
+
import { VersionControlHooks } from '../modules/version-control/version-control-hooks.js';
|
|
146
|
+
import { ChangeRequestHooks, type IChangeRequestHooks } from '../modules/version-control/change-request-hooks.js';
|
|
147
|
+
import { PendingCommitsService } from '../modules/version-control/pending-commits.service.js';
|
|
146
148
|
import {
|
|
147
149
|
PendingCommitsWorker,
|
|
148
150
|
consoleSystemNoticeSink,
|
|
149
|
-
} from '../modules/
|
|
150
|
-
import { ensureRecoveryBotUser } from '../modules/
|
|
151
|
+
} from '../modules/version-control/pending-commits.worker.js';
|
|
152
|
+
import { ensureRecoveryBotUser } from '../modules/version-control/recovery-bot.js';
|
|
151
153
|
import { AdminAccessService } from '../modules/admin/admin-access.service.js';
|
|
152
154
|
import {
|
|
153
155
|
SyncedGroupsWriter,
|
|
@@ -171,6 +173,7 @@ import { AgentAuditService, retentionDaysFrom } from '../modules/audit/agent-aud
|
|
|
171
173
|
import { readAgentPreamble, type AgentPreambleReader } from '../modules/agent-instructions/index.js';
|
|
172
174
|
import {
|
|
173
175
|
agentGuideSections,
|
|
176
|
+
guideStartText,
|
|
174
177
|
joinGuideSections,
|
|
175
178
|
type AgentGuideReader,
|
|
176
179
|
type AgentGuideSectionsReader,
|
|
@@ -296,6 +299,12 @@ export interface CoreServices {
|
|
|
296
299
|
* `read_file` of the guide's name answer. See modules/agent-guide.
|
|
297
300
|
*/
|
|
298
301
|
agentGuide: AgentGuideReader;
|
|
302
|
+
/**
|
|
303
|
+
* The start of that guide and the list of its sections: what a `read_file`
|
|
304
|
+
* of the guide's name answers, the same as `get_agent_guide` with no
|
|
305
|
+
* `section`. See `guideStartText`.
|
|
306
|
+
*/
|
|
307
|
+
agentGuideStart: AgentGuideReader;
|
|
299
308
|
/** The same guide as its sections, each with its title — what `get_agent_guide` lists and serves one of. */
|
|
300
309
|
agentGuideSections: AgentGuideSectionsReader;
|
|
301
310
|
mcpServerEditService: McpServerEditService;
|
|
@@ -346,9 +355,9 @@ export interface CoreServices {
|
|
|
346
355
|
gitService: GitService;
|
|
347
356
|
pullRequestService: PullRequestService;
|
|
348
357
|
diffService: DiffService;
|
|
349
|
-
|
|
358
|
+
changeRequestReviewService: ChangeRequestReviewService;
|
|
350
359
|
fileLockService: FileLockService;
|
|
351
|
-
|
|
360
|
+
versionControlService: VersionControlService;
|
|
352
361
|
/**
|
|
353
362
|
* The seam for "a change request was opened": a deployment registers here
|
|
354
363
|
* how the reviewers are told (the cloud's mail, say), and the open's answer
|
|
@@ -357,7 +366,7 @@ export interface CoreServices {
|
|
|
357
366
|
changeRequestHooks: IChangeRequestHooks;
|
|
358
367
|
/** Remote sync (`POST /api/sync`): a git host or pipeline makes the clones catch up. */
|
|
359
368
|
kbSyncService: KbSyncService;
|
|
360
|
-
eventBus:
|
|
369
|
+
eventBus: VersionControlEventBus;
|
|
361
370
|
fileChangeNotifier: FileChangeNotifier;
|
|
362
371
|
pendingCommitsService: PendingCommitsService;
|
|
363
372
|
pendingCommitsWorker: PendingCommitsWorker;
|
|
@@ -433,6 +442,12 @@ export interface CoreServices {
|
|
|
433
442
|
// ── Server-time seams (enterprise overwrites after construction) ────────
|
|
434
443
|
/** `start_session` backing — core default {@link UuidSessionSink}. */
|
|
435
444
|
sessionSink: ISessionSink;
|
|
445
|
+
/**
|
|
446
|
+
* The managed sign-in port (see `CorePorts.managedSignIns`), or null when
|
|
447
|
+
* the distribution registers none. Mutable for the same reason the session
|
|
448
|
+
* sink is: the overlay builds it after core, from services core returned.
|
|
449
|
+
*/
|
|
450
|
+
managedSignIns: ManagedSignInPort | null;
|
|
436
451
|
/** Connection-key LLM metering view — core default unmetered. */
|
|
437
452
|
usageMeter: ILlmUsageMeter;
|
|
438
453
|
/** SSO plugins the auth router mounts — same array instance as the port. */
|
|
@@ -915,16 +930,16 @@ export async function createCoreServices(
|
|
|
915
930
|
// registers its listener here, after this returns (see `AccountHooks`).
|
|
916
931
|
const accountHooks = new AccountHooks();
|
|
917
932
|
|
|
918
|
-
//
|
|
933
|
+
// Version-control lifecycle hooks — the ONE registry this composition shares
|
|
919
934
|
// between GitService (advisory commit validation), the agent-access gate
|
|
920
935
|
// (the blocking agentRead / preWrite hooks), and the composition root,
|
|
921
|
-
// which registers module-owned handlers on `
|
|
936
|
+
// which registers module-owned handlers on `versionControlService.hooks` right
|
|
922
937
|
// after this function returns. Core registers none: no commit-time
|
|
923
938
|
// validation (advisory anyway) and nothing that refuses an agent call.
|
|
924
|
-
const
|
|
939
|
+
const versionControlHooks = new VersionControlHooks();
|
|
925
940
|
const gitService = new GitService(
|
|
926
941
|
workspaceService,
|
|
927
|
-
|
|
942
|
+
versionControlHooks,
|
|
928
943
|
kb,
|
|
929
944
|
workspaceMutex,
|
|
930
945
|
accessControl,
|
|
@@ -961,7 +976,7 @@ export async function createCoreServices(
|
|
|
961
976
|
// the post-switch backup reseed — but switchBranch is gone with the
|
|
962
977
|
// per-branch workspace model, so the injection no longer applies.)
|
|
963
978
|
workspaceService.setDiffService(diffService);
|
|
964
|
-
const
|
|
979
|
+
const changeRequestReviewService = new ChangeRequestReviewService(
|
|
965
980
|
db,
|
|
966
981
|
accessControl,
|
|
967
982
|
workspaceService,
|
|
@@ -969,14 +984,14 @@ export async function createCoreServices(
|
|
|
969
984
|
);
|
|
970
985
|
// Late-bind the comment enricher so PullRequestService.getPrDetail includes
|
|
971
986
|
// our DB-backed comments without forcing a circular constructor dependency.
|
|
972
|
-
pullRequestService.setDetailEnricher(
|
|
987
|
+
pullRequestService.setDetailEnricher(changeRequestReviewService);
|
|
973
988
|
|
|
974
|
-
//
|
|
975
|
-
// instead of the individual git / PR / review
|
|
989
|
+
// Version-control facade — the abstraction every app consumer should reach for
|
|
990
|
+
// instead of the individual git / PR / change-request-review services. See
|
|
976
991
|
// PLAN.md for the migration story. Today it delegates straight through;
|
|
977
|
-
// implementations migrate into the
|
|
992
|
+
// implementations migrate into the version-control module over later steps.
|
|
978
993
|
const fileLockService = new FileLockService(db);
|
|
979
|
-
// Background commit queue. The `
|
|
994
|
+
// Background commit queue. The `VersionControlService.releaseLock` path
|
|
980
995
|
// enqueues a row here instead of running commitFile + push inline; the
|
|
981
996
|
// worker drains the queue out of band so a git hiccup can't block the
|
|
982
997
|
// user-visible save path. See `lock-decoupling-plan.md`.
|
|
@@ -991,11 +1006,11 @@ export async function createCoreServices(
|
|
|
991
1006
|
(await pendingCommitsService.hasAnyForWorkspace(workspaceId)) ||
|
|
992
1007
|
(await fileLockService.hasAnyActive(workspaceId)),
|
|
993
1008
|
);
|
|
994
|
-
// In-process event bus: every
|
|
1009
|
+
// In-process event bus: every VersionControlService mutation method that
|
|
995
1010
|
// succeeds emits a typed event; the SSE route fans it to connected
|
|
996
1011
|
// browser sessions. Single instance per Node process — survives across
|
|
997
1012
|
// requests, doesn't survive restarts (clients reconnect + resync).
|
|
998
|
-
const eventBus = new
|
|
1013
|
+
const eventBus = new VersionControlEventBus();
|
|
999
1014
|
// Office-document/PDF/email text extraction for `read_file`/`grep`, cached
|
|
1000
1015
|
// by content hash beside the workspaces root (see `DocExtractionCache`),
|
|
1001
1016
|
// failures included. A fresh failure is told to the people looking at the
|
|
@@ -1013,11 +1028,11 @@ export async function createCoreServices(
|
|
|
1013
1028
|
// of a distribution registers its listener here, after this returns (see
|
|
1014
1029
|
// `ChangeRequestHooks`).
|
|
1015
1030
|
const changeRequestHooks = new ChangeRequestHooks();
|
|
1016
|
-
const
|
|
1031
|
+
const versionControlService = new VersionControlService(
|
|
1017
1032
|
db,
|
|
1018
1033
|
gitService,
|
|
1019
1034
|
pullRequestService,
|
|
1020
|
-
|
|
1035
|
+
changeRequestReviewService,
|
|
1021
1036
|
workspaceService,
|
|
1022
1037
|
accessControl,
|
|
1023
1038
|
fileLockService,
|
|
@@ -1026,10 +1041,10 @@ export async function createCoreServices(
|
|
|
1026
1041
|
changeGate,
|
|
1027
1042
|
eventBus,
|
|
1028
1043
|
fileChangeNotifier,
|
|
1029
|
-
// Exposed as `
|
|
1044
|
+
// Exposed as `versionControlService.hooks` — the SAME instance GitService and
|
|
1030
1045
|
// the agent-access gate consult, so a deployment's registrations against
|
|
1031
1046
|
// it reach every hook point.
|
|
1032
|
-
|
|
1047
|
+
versionControlHooks,
|
|
1033
1048
|
// Exposed as `changeRequestHooks`, the same instance, for the same reason.
|
|
1034
1049
|
changeRequestHooks,
|
|
1035
1050
|
// The opened event names the approvers as accounts; auth answers which
|
|
@@ -1038,7 +1053,7 @@ export async function createCoreServices(
|
|
|
1038
1053
|
);
|
|
1039
1054
|
// The leftover-branch cleanup asks the Deployment page at every round, so
|
|
1040
1055
|
// switching it off there applies without a restart.
|
|
1041
|
-
|
|
1056
|
+
versionControlService.leftoverCleanupEnabled = () => retireMergedBranchesOn(settings.resolve('retireMergedBranches'));
|
|
1042
1057
|
|
|
1043
1058
|
// Join requests: derived entirely from two copies of a plugin's `access.md`
|
|
1044
1059
|
// (the request's branch vs the default branch), so it holds no state — it
|
|
@@ -1046,7 +1061,7 @@ export async function createCoreServices(
|
|
|
1046
1061
|
// have all landed.
|
|
1047
1062
|
const joinRequestsService = new JoinRequestsService(
|
|
1048
1063
|
workspaceService,
|
|
1049
|
-
|
|
1064
|
+
versionControlService,
|
|
1050
1065
|
kb,
|
|
1051
1066
|
// Read-only: the one question a request asks of the resolver is whether
|
|
1052
1067
|
// the person it names already holds what it proposes.
|
|
@@ -1058,7 +1073,7 @@ export async function createCoreServices(
|
|
|
1058
1073
|
// answered in a database round-trip instead of a clone, and what survives a
|
|
1059
1074
|
// restart with the request still owed.
|
|
1060
1075
|
const pluginJoinRequestJobs = new PluginJoinRequestJobs(new DbJoinRequestStore(db), {
|
|
1061
|
-
|
|
1076
|
+
versionControl: versionControlService,
|
|
1062
1077
|
workspaceService,
|
|
1063
1078
|
kb,
|
|
1064
1079
|
// A record keys on the plugin's primary FOLDER below the root, which the
|
|
@@ -1088,7 +1103,7 @@ export async function createCoreServices(
|
|
|
1088
1103
|
// index counts, so a link drops that cache too.
|
|
1089
1104
|
const pluginLinksService = new PluginLinksService(
|
|
1090
1105
|
workspaceService,
|
|
1091
|
-
|
|
1106
|
+
versionControlService,
|
|
1092
1107
|
accessControl,
|
|
1093
1108
|
new AccessMutationService(workspaceService, accessControl, kb.kbDirName),
|
|
1094
1109
|
skillService,
|
|
@@ -1101,7 +1116,7 @@ export async function createCoreServices(
|
|
|
1101
1116
|
// then drops every cache that keyed on the old identity.
|
|
1102
1117
|
const pluginRenameService = new PluginRenameService(
|
|
1103
1118
|
workspaceService,
|
|
1104
|
-
|
|
1119
|
+
versionControlService,
|
|
1105
1120
|
accessControl,
|
|
1106
1121
|
pluginSource,
|
|
1107
1122
|
disk,
|
|
@@ -1142,16 +1157,16 @@ export async function createCoreServices(
|
|
|
1142
1157
|
gitRunner,
|
|
1143
1158
|
);
|
|
1144
1159
|
|
|
1145
|
-
// Remote sync. Drives the
|
|
1160
|
+
// Remote sync. Drives the version-control module's per-branch pull-and-announce
|
|
1146
1161
|
// over every clone the workspace service knows about; owns no git of its own.
|
|
1147
|
-
const kbSyncService = new KbSyncService(
|
|
1162
|
+
const kbSyncService = new KbSyncService(versionControlService, workspaceService);
|
|
1148
1163
|
// Server-scoped MCP editing — the tool page's edit form. One server's truth
|
|
1149
1164
|
// spans a plugin's mcp.json AND plugin.json extensions block, and this is
|
|
1150
1165
|
// the ONE writer that rewrites both entries and commits them together (see
|
|
1151
1166
|
// McpServerEditService).
|
|
1152
1167
|
const mcpServerEditService = new McpServerEditService(
|
|
1153
1168
|
workspaceService,
|
|
1154
|
-
|
|
1169
|
+
versionControlService,
|
|
1155
1170
|
accessControl,
|
|
1156
1171
|
toolManualService,
|
|
1157
1172
|
kb,
|
|
@@ -1164,7 +1179,7 @@ export async function createCoreServices(
|
|
|
1164
1179
|
// folder's rules are at HEAD before the endpoint answers.
|
|
1165
1180
|
const pluginProvisionService = new PluginProvisionService(
|
|
1166
1181
|
workspaceService,
|
|
1167
|
-
|
|
1182
|
+
versionControlService,
|
|
1168
1183
|
accessControl,
|
|
1169
1184
|
kb,
|
|
1170
1185
|
eventBus,
|
|
@@ -1174,26 +1189,26 @@ export async function createCoreServices(
|
|
|
1174
1189
|
|
|
1175
1190
|
// Pending skills: the other half of the catalog — skills that exist only on
|
|
1176
1191
|
// an open change request's branch. Built here rather than beside
|
|
1177
|
-
// `skillService` because it needs the
|
|
1192
|
+
// `skillService` because it needs the version-control service, which does not exist
|
|
1178
1193
|
// that early; it holds no state of its own, so where it is constructed is the
|
|
1179
1194
|
// only thing the ordering decides.
|
|
1180
1195
|
const pendingSkillsService = new PendingSkillsService(
|
|
1181
1196
|
workspaceService,
|
|
1182
1197
|
accessControl,
|
|
1183
1198
|
skillService,
|
|
1184
|
-
|
|
1199
|
+
versionControlService,
|
|
1185
1200
|
kb,
|
|
1186
1201
|
);
|
|
1187
1202
|
|
|
1188
1203
|
// The same missing half, for tools: a `.tool` manual or an `mcp.json` server
|
|
1189
1204
|
// an agent proposes is nowhere in the product until its change request
|
|
1190
|
-
// merges. Built here for the same reason — it needs the
|
|
1205
|
+
// merges. Built here for the same reason — it needs the version-control service —
|
|
1191
1206
|
// and stateless for the same reason.
|
|
1192
1207
|
const pendingToolsService = new PendingToolsService(
|
|
1193
1208
|
workspaceService,
|
|
1194
1209
|
accessControl,
|
|
1195
1210
|
toolManualService,
|
|
1196
|
-
|
|
1211
|
+
versionControlService,
|
|
1197
1212
|
kb,
|
|
1198
1213
|
);
|
|
1199
1214
|
|
|
@@ -1231,7 +1246,7 @@ export async function createCoreServices(
|
|
|
1231
1246
|
packsDir: config.starterPacksDir,
|
|
1232
1247
|
kb,
|
|
1233
1248
|
workspaceService,
|
|
1234
|
-
|
|
1249
|
+
versionControl: versionControlService,
|
|
1235
1250
|
adminAccess,
|
|
1236
1251
|
settings,
|
|
1237
1252
|
accessControl,
|
|
@@ -1281,7 +1296,7 @@ export async function createCoreServices(
|
|
|
1281
1296
|
// can only exist once the vault does.
|
|
1282
1297
|
const toolDeleteService = new ToolDeleteService(
|
|
1283
1298
|
workspaceService,
|
|
1284
|
-
|
|
1299
|
+
versionControlService,
|
|
1285
1300
|
accessControl,
|
|
1286
1301
|
toolManualService,
|
|
1287
1302
|
skillService,
|
|
@@ -1328,12 +1343,16 @@ export async function createCoreServices(
|
|
|
1328
1343
|
});
|
|
1329
1344
|
|
|
1330
1345
|
// GDPR erasure path: admin-driven user deletion. The core service erases the
|
|
1331
|
-
// rows it owns; each module contributes its slice as a participant.
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1346
|
+
// rows it owns; each module contributes its slice as a participant. The
|
|
1347
|
+
// vault's runs first: a managed sign-in's tokens are revoked with their
|
|
1348
|
+
// provider before the user row goes and the vault rows cascade with it.
|
|
1349
|
+
// The port's array is held, never copied (see `CorePorts.erasureParticipants`:
|
|
1350
|
+
// the enterprise root fills it AFTER construction) and never written to
|
|
1351
|
+
// (a root that rebuilds a graph over the same array would otherwise keep
|
|
1352
|
+
// every past graph's vault slice): core's own slices travel beside it.
|
|
1353
|
+
const accountErasureService = new AccountErasureService(db, changeRequestReviewService, ports.erasureParticipants ?? [], [
|
|
1354
|
+
managedSignInErasure(secretsVaultService),
|
|
1355
|
+
]);
|
|
1337
1356
|
|
|
1338
1357
|
// MCP (remote agent access). ExternalApiKeyService handles connection-key
|
|
1339
1358
|
// lifecycle. McpService is a GENERIC, STATELESS proxy: per request it
|
|
@@ -1376,11 +1395,13 @@ export async function createCoreServices(
|
|
|
1376
1395
|
// serves the same composition to the local bridge and the frontend card.
|
|
1377
1396
|
const readPreamble: AgentPreambleReader = () => readAgentPreamble(workspaceService, kb, disk);
|
|
1378
1397
|
// The guide every agent is told to read first, composed when asked for —
|
|
1379
|
-
// the layout
|
|
1380
|
-
// without a restart, and the distribution's hook sees
|
|
1398
|
+
// the layout and the default branch are read per call, so a name the setup
|
|
1399
|
+
// save applies lands without a restart, and the distribution's hook sees
|
|
1400
|
+
// every composition.
|
|
1381
1401
|
const agentGuideSectionsReader: AgentGuideSectionsReader = () =>
|
|
1382
|
-
agentGuideSections(kb.layout, ports.agentGuide, { kbDirName });
|
|
1402
|
+
agentGuideSections(kb.layout, ports.agentGuide, { kbDirName, defaultBranch: kb.defaultBranch });
|
|
1383
1403
|
const agentGuide: AgentGuideReader = async () => joinGuideSections(await agentGuideSectionsReader());
|
|
1404
|
+
const agentGuideStart: AgentGuideReader = async () => guideStartText(await agentGuideSectionsReader());
|
|
1384
1405
|
// The Audit log. Records through the proxy below (every call an external
|
|
1385
1406
|
// agent makes), reads keys through the key service so their shape is
|
|
1386
1407
|
// defined once, and prunes past the retention setting — read per sweep, so
|
|
@@ -1402,7 +1423,7 @@ export async function createCoreServices(
|
|
|
1402
1423
|
workspaceService,
|
|
1403
1424
|
accessControl,
|
|
1404
1425
|
authService,
|
|
1405
|
-
|
|
1426
|
+
versionControlService,
|
|
1406
1427
|
gitService,
|
|
1407
1428
|
accountLinks: new AccountLinkService(db),
|
|
1408
1429
|
// The SAME extension-to-reader registry `read_file` dispatches on, so the
|
|
@@ -1435,9 +1456,12 @@ export async function createCoreServices(
|
|
|
1435
1456
|
// For the needs-authorization setup link surfaced to external agents.
|
|
1436
1457
|
publicFrontendUrl: config.publicFrontendUrl,
|
|
1437
1458
|
readAgentPreamble: readPreamble,
|
|
1438
|
-
// The
|
|
1439
|
-
// the setup save applies lands without a restart.
|
|
1459
|
+
// The root-folder and platform-file names the shared file rules spell,
|
|
1460
|
+
// read per request so a layout the setup save applies lands without a restart.
|
|
1440
1461
|
kbLayout: () => kb.layout,
|
|
1462
|
+
// The branch the shared rules name as the one people read — a getter
|
|
1463
|
+
// too, so the name in effect is the one an agent is told.
|
|
1464
|
+
defaultBranch: () => kb.defaultBranch,
|
|
1441
1465
|
secretsScope,
|
|
1442
1466
|
// Read at listing time, by when the hints below exist.
|
|
1443
1467
|
readOnlyOverrides: () => readOnlyHints.overrides(),
|
|
@@ -1515,7 +1539,7 @@ export async function createCoreServices(
|
|
|
1515
1539
|
const resolveToolContext = createToolContextResolver({
|
|
1516
1540
|
authService,
|
|
1517
1541
|
workspaceService,
|
|
1518
|
-
|
|
1542
|
+
versionControlService,
|
|
1519
1543
|
events: eventBus,
|
|
1520
1544
|
kbDirName: kbDirName,
|
|
1521
1545
|
creatorAccess,
|
|
@@ -1575,7 +1599,7 @@ export async function createCoreServices(
|
|
|
1575
1599
|
// swallowed the `opts` carrying `skipValidation`, so the burst-validation
|
|
1576
1600
|
// skip was a no-op in production while every unit test — which stubs this
|
|
1577
1601
|
// port — passed. No wrapper, no gap to fall through.
|
|
1578
|
-
|
|
1602
|
+
versionControl: versionControlService,
|
|
1579
1603
|
// Both escalation sinks come through CorePorts: the recovery agent and the
|
|
1580
1604
|
// notice sink are enterprise-owned (background-agent factory / feedback
|
|
1581
1605
|
// dashboard); core defaults skip recovery and log to stderr.
|
|
@@ -1635,7 +1659,7 @@ export async function createCoreServices(
|
|
|
1635
1659
|
source,
|
|
1636
1660
|
...createSyncedGroupsCommitter({
|
|
1637
1661
|
workspaceService,
|
|
1638
|
-
|
|
1662
|
+
versionControlService,
|
|
1639
1663
|
accessControl,
|
|
1640
1664
|
eventBus,
|
|
1641
1665
|
kbDirName,
|
|
@@ -1651,7 +1675,7 @@ export async function createCoreServices(
|
|
|
1651
1675
|
// directory token route drives.
|
|
1652
1676
|
const groupsAdminService = new GroupsAdminService(
|
|
1653
1677
|
workspaceService,
|
|
1654
|
-
|
|
1678
|
+
versionControlService,
|
|
1655
1679
|
accessControl,
|
|
1656
1680
|
disk,
|
|
1657
1681
|
kbDirName,
|
|
@@ -1663,7 +1687,7 @@ export async function createCoreServices(
|
|
|
1663
1687
|
// The deployment owner is never removed this way.
|
|
1664
1688
|
const userAccessRemovalService = new UserAccessRemovalService(
|
|
1665
1689
|
workspaceService,
|
|
1666
|
-
|
|
1690
|
+
versionControlService,
|
|
1667
1691
|
accessControl,
|
|
1668
1692
|
disk,
|
|
1669
1693
|
kbDirName,
|
|
@@ -1723,6 +1747,7 @@ export async function createCoreServices(
|
|
|
1723
1747
|
pendingToolsService,
|
|
1724
1748
|
readAgentPreamble: readPreamble,
|
|
1725
1749
|
agentGuide,
|
|
1750
|
+
agentGuideStart,
|
|
1726
1751
|
agentGuideSections: agentGuideSectionsReader,
|
|
1727
1752
|
pluginIndexService,
|
|
1728
1753
|
pluginProvisionService,
|
|
@@ -1744,9 +1769,9 @@ export async function createCoreServices(
|
|
|
1744
1769
|
gitService,
|
|
1745
1770
|
pullRequestService,
|
|
1746
1771
|
diffService,
|
|
1747
|
-
|
|
1772
|
+
changeRequestReviewService,
|
|
1748
1773
|
fileLockService,
|
|
1749
|
-
|
|
1774
|
+
versionControlService,
|
|
1750
1775
|
changeRequestHooks,
|
|
1751
1776
|
kbSyncService,
|
|
1752
1777
|
eventBus,
|
|
@@ -1779,6 +1804,7 @@ export async function createCoreServices(
|
|
|
1779
1804
|
// Server-time seams — defaults here; the enterprise overlay overwrites
|
|
1780
1805
|
// (or, for the array, pushes into) these after construction.
|
|
1781
1806
|
sessionSink: ports.sessionSink ?? new UuidSessionSink(),
|
|
1807
|
+
managedSignIns: ports.managedSignIns ?? null,
|
|
1782
1808
|
usageMeter: ports.usageMeter ?? unmeteredLlmUsage,
|
|
1783
1809
|
authProviders,
|
|
1784
1810
|
};
|
package/src/core/lifecycle.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { AdvisoryLease } from '../modules/database/advisory-lock.js';
|
|
|
4
4
|
import { bootMaySurvive, type KbStartupRunner } from '../modules/workspace/startup/kb-startup-runner.js';
|
|
5
5
|
import { noteBesideCheckout } from '../modules/workspace/startup/beside-checkout.js';
|
|
6
6
|
import { unregisterBevelSecretsVariableLoader } from '../modules/secrets-vault/secrets-variable-loader.js';
|
|
7
|
-
import type {
|
|
7
|
+
import type { VersionControlService } from '../modules/version-control/version-control.service.js';
|
|
8
8
|
import type { PluginJoinRequestJobs } from '../modules/plugins/join-request-jobs.service.js';
|
|
9
9
|
import type { TmpSweeper } from '../modules/workspace/workspace-tmp.js';
|
|
10
10
|
import { printable } from '../shared/printable.js';
|
|
@@ -292,7 +292,7 @@ export interface BootableCore {
|
|
|
292
292
|
config: { workspacesRoot: string };
|
|
293
293
|
kbDirName: string;
|
|
294
294
|
kbStartupRunner: Pick<KbStartupRunner, 'runAll' | 'retryUntilMaintained'>;
|
|
295
|
-
|
|
295
|
+
versionControlService: Pick<VersionControlService, 'closeChangeRequestsWithDeletedBranches' | 'tidyAfterSweep'>;
|
|
296
296
|
pluginJoinRequestJobs: Pick<PluginJoinRequestJobs, 'startSweeping'>;
|
|
297
297
|
/** The periodic sweep of every workspace's `tmp/` folder, started here and stopped by {@link stopCore}. */
|
|
298
298
|
tmpSweeper: Pick<TmpSweeper, 'startSweeping'>;
|
|
@@ -393,7 +393,7 @@ export async function startCore<C extends BootableCore>(
|
|
|
393
393
|
// have been unusable since the branch went away, so landing a few seconds
|
|
394
394
|
// into uptime is soon enough. Errors are swallowed inside the sweep, which
|
|
395
395
|
// fails safe by closing nothing.
|
|
396
|
-
void core.
|
|
396
|
+
void core.versionControlService
|
|
397
397
|
.closeChangeRequestsWithDeletedBranches()
|
|
398
398
|
.then((n) => {
|
|
399
399
|
if (n > 0) {
|
|
@@ -404,7 +404,7 @@ export async function startCore<C extends BootableCore>(
|
|
|
404
404
|
// Then the tidy-up: open requests that propose nothing are closed, and the
|
|
405
405
|
// branches merged requests left behind removed (behind its own setting).
|
|
406
406
|
// Fails safe on a failed fetch, and never throws.
|
|
407
|
-
.then(() => core.
|
|
407
|
+
.then(() => core.versionControlService.tidyAfterSweep());
|
|
408
408
|
|
|
409
409
|
// Recorded join requests that are still owed, resumed — now, and then on a
|
|
410
410
|
// timer. SEQUENCED AFTER the startup phase for the same reason as the sweep
|
|
@@ -481,12 +481,12 @@ export interface CoreStopDeps {
|
|
|
481
481
|
*/
|
|
482
482
|
documentExtractor?: { close(): Promise<void> };
|
|
483
483
|
/**
|
|
484
|
-
* The
|
|
484
|
+
* The version-control service, for the tidy-up it runs after each sweep (closing
|
|
485
485
|
* empty requests, removing leftover branches): detached from whatever
|
|
486
486
|
* started it, so stopped and awaited here before the pool goes. Optional:
|
|
487
487
|
* a caller that has not built one passes nothing.
|
|
488
488
|
*/
|
|
489
|
-
|
|
489
|
+
versionControlService?: { stopTidying(): void; drainTidy(): Promise<void> };
|
|
490
490
|
/** The startup phase's retry, if the boot left one asking — see {@link BootableCore.startupRetry}. */
|
|
491
491
|
startupRetry?: { stop(): void } | null;
|
|
492
492
|
/** The database — its pool is ended last, once nothing above can still need it. */
|
|
@@ -582,7 +582,7 @@ async function releaseCore(deps: CoreStopDeps, remaining: () => number, log: (m:
|
|
|
582
582
|
deps.startupRetry?.stop();
|
|
583
583
|
// The post-sweep tidy-up: no new round, and the one under way stops at its
|
|
584
584
|
// next request or branch. Synchronous.
|
|
585
|
-
deps.
|
|
585
|
+
deps.versionControlService?.stopTidying();
|
|
586
586
|
// Clearing the interval stops future ticks; it does nothing to a job a
|
|
587
587
|
// tick already started, which holds a claim it heartbeats through the
|
|
588
588
|
// pool and is mid-clone or mid-push. Awaited here, in the budget: a job
|
|
@@ -614,8 +614,8 @@ async function releaseCore(deps: CoreStopDeps, remaining: () => number, log: (m:
|
|
|
614
614
|
// The tidy-up in flight fetches and deletes branches through the pool and
|
|
615
615
|
// the default branch's checkout: awaited, so the next graph for this
|
|
616
616
|
// tenant cannot find a branch deletion still running under it.
|
|
617
|
-
if (deps.
|
|
618
|
-
await bounded(deps.
|
|
617
|
+
if (deps.versionControlService) {
|
|
618
|
+
await bounded(deps.versionControlService.drainTidy(), remaining(), 'finishing the branch tidy-up', log);
|
|
619
619
|
}
|
|
620
620
|
// Its ripgrep runs end with the graph; a search still running is answered busy or stopped.
|
|
621
621
|
if (deps.patternMatcher) {
|
package/src/core-config.ts
CHANGED
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { defaultKbTemplateDir, defaultStarterPacksDir } from './assets.js';
|
|
5
5
|
import { assertKeyDecodesTo32Bytes } from './shared/token-crypto.js';
|
|
6
|
-
import { DEFAULT_GIT_TIMEOUT_MS } from './modules/
|
|
6
|
+
import { DEFAULT_GIT_TIMEOUT_MS } from './modules/version-control/git/node-git-runner.js';
|
|
7
7
|
import { DEFAULT_DB_SCHEMA, assertSchemaName } from './modules/database/connection.js';
|
|
8
8
|
import { logger } from './shared/logging.js';
|
|
9
9
|
import { hasControlCharacter } from './modules/kb-fs/repo-path.js';
|
|
@@ -145,7 +145,7 @@ export interface ProcessConfig {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* Configuration for the CORE platform: the git-backed workspace
|
|
148
|
+
* Configuration for the CORE platform: the git-backed workspace and version control,
|
|
149
149
|
* skills, tools, secrets vault, access control, and the MCP surface. Contains
|
|
150
150
|
* NO LLM, connector, or SSO-provider settings — those live on the enterprise
|
|
151
151
|
* `AppConfig` (config.ts), which extends this class. A core-only deployment
|
|
@@ -372,7 +372,7 @@ export class CoreConfig implements TenantConfig, ProcessConfig {
|
|
|
372
372
|
readonly trustProxy: string;
|
|
373
373
|
/**
|
|
374
374
|
* Deadline in milliseconds on every git command, after which the child is
|
|
375
|
-
* killed and the call fails (see `modules/
|
|
375
|
+
* killed and the call fails (see `modules/version-control/git/node-git-runner.ts`).
|
|
376
376
|
*
|
|
377
377
|
* Configurable because the right ceiling depends on the deployment's own git
|
|
378
378
|
* host and the size of its knowledge base: a first clone over a slow link can
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @bevel-software/platform-core-backend — the open-source core of the Bevel platform:
|
|
3
|
-
* git-backed knowledge workspace,
|
|
3
|
+
* git-backed knowledge workspace, version control (branches / change requests /
|
|
4
4
|
* locks / SSE), skills, tool manuals + registry + auth, secrets vault, access
|
|
5
5
|
* control, diff/backup ledger, code-mode and the remote MCP surface.
|
|
6
6
|
*
|
|
@@ -122,7 +122,7 @@ export type { ISessionSink } from './modules/workspace/session-sink.js';
|
|
|
122
122
|
export type {
|
|
123
123
|
ISystemNoticeSink,
|
|
124
124
|
RecoveryAgentRunner,
|
|
125
|
-
} from './modules/
|
|
125
|
+
} from './modules/version-control/pending-commits.worker.js';
|
|
126
126
|
export type { ILlmUsageMeter } from './modules/tool-auth/llm-usage-meter.js';
|
|
127
127
|
export type { AuthProviderPlugin } from './modules/auth/auth.routes.js';
|
|
128
128
|
export type { IErasureParticipant } from './modules/auth/account-erasure.service.js';
|
|
@@ -144,17 +144,17 @@ export {
|
|
|
144
144
|
type IAccountAdmission,
|
|
145
145
|
} from './modules/auth/account-admission.js';
|
|
146
146
|
export {
|
|
147
|
-
|
|
147
|
+
VersionControlHooks,
|
|
148
148
|
type CommitValidationHook,
|
|
149
149
|
type CommitValidationContext,
|
|
150
150
|
type AgentOperationContext,
|
|
151
151
|
type AgentReadHook,
|
|
152
152
|
type PreWriteHook,
|
|
153
|
-
} from './modules/
|
|
153
|
+
} from './modules/version-control/version-control-hooks.js';
|
|
154
154
|
export {
|
|
155
155
|
ChangeRequestHooks,
|
|
156
156
|
type ChangeRequestOpenedEvent,
|
|
157
157
|
type ChangeRequestOpenedHook,
|
|
158
158
|
type ChangeRequestPerson,
|
|
159
159
|
type IChangeRequestHooks,
|
|
160
|
-
} from './modules/
|
|
160
|
+
} from './modules/version-control/change-request-hooks.js';
|
|
@@ -9,8 +9,8 @@ import { NodeFs } from '../../kb-fs/node-fs.js';
|
|
|
9
9
|
|
|
10
10
|
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
11
11
|
import type { AuthService } from '../../auth/auth.service.js';
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
12
|
+
import type { VersionControlService } from '../../version-control/version-control.service.js';
|
|
13
|
+
import type { VersionControlEventBus } from '../../version-control/event-bus.js';
|
|
14
14
|
import { usersDbDouble } from './users-db-double.js';
|
|
15
15
|
import { AccessControlService } from '../access-control.service.js';
|
|
16
16
|
import {
|
|
@@ -317,8 +317,8 @@ describe('Admin write floor at the repository root', () => {
|
|
|
317
317
|
acquireLock: async () => ({ acquired: true, lock: {} }),
|
|
318
318
|
releaseLock: async () => undefined,
|
|
319
319
|
releaseLockNoCommit: async () => undefined,
|
|
320
|
-
} as unknown as
|
|
321
|
-
{ emit: () => {} } as unknown as
|
|
320
|
+
} as unknown as VersionControlService,
|
|
321
|
+
{ emit: () => {} } as unknown as VersionControlEventBus,
|
|
322
322
|
usersDbDouble(),
|
|
323
323
|
testKbContext({ kbDirName: KB }),
|
|
324
324
|
new NodeFs(),
|