@bevel-software/platform-core-backend 0.35.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/directory-structure.md +1 -1
- package/agent-guide/onboarding.md +111 -0
- package/agent-guide/start-here.md +1 -0
- package/agent-guide/tool-manuals.md +1 -0
- 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 +26 -24
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +19 -13
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +68 -56
- 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.service.js +1 -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 +9 -9
- 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/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 +19 -14
- package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.js +42 -18
- package/dist/modules/agent-guide/agent-guide.js.map +1 -1
- package/dist/modules/agent-guide/guide-budget.d.ts +5 -2
- package/dist/modules/agent-guide/guide-budget.d.ts.map +1 -1
- package/dist/modules/agent-guide/guide-budget.js +6 -2
- package/dist/modules/agent-guide/guide-budget.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 +24 -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 +51 -11
- 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/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 +75 -19
- 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 +77 -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 +479 -53
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +2 -1
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +1 -0
- 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 +152 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts.map +1 -1
- 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 +125 -10
- 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/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/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-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-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 +43 -3
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +6 -0
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +51 -5
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +3 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +36 -15
- 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} +31 -31
- 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 +5 -5
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -1
- package/dist/modules/workspace/agent-access.gate.js +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 +2 -1
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +15 -10
- 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/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/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 +4 -4
- package/src/__tests__/account-admin.ts +27 -0
- package/src/__tests__/hexis-catalog.ts +4 -4
- 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__/tool-handler.ts +15 -0
- package/src/__tests__/tool-wiring.ts +10 -4
- 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/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 +39 -25
- package/src/core/create-core-services.ts +79 -63
- 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 +3 -3
- 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__/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.service.ts +1 -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 +11 -11
- 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/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 +19 -4
- package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +1 -1
- package/src/modules/agent-guide/__tests__/guide-matches-code.test.ts +2 -2
- package/src/modules/agent-guide/agent-guide.ts +48 -22
- package/src/modules/agent-guide/guide-budget.ts +6 -2
- 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 +113 -7
- package/src/modules/agent-instructions/agent-instructions.routes.ts +12 -5
- package/src/modules/agent-instructions/compose.ts +24 -9
- package/src/modules/agent-instructions/shared-file-rules.ts +53 -11
- 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/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 +89 -28
- 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 +28 -1
- package/src/modules/secrets-vault/__tests__/managed-sign-in.route.test.ts +351 -0
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +562 -95
- package/src/modules/secrets-vault/index.ts +7 -0
- 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 +152 -0
- package/src/modules/secrets-vault/secrets-vault.routes.ts +157 -10
- 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/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/tool-helpers/__tests__/agent-roles-write.test.ts +4 -4
- 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__/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-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.restart.test.ts +1 -1
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +36 -1
- 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 +41 -3
- package/src/modules/tool-manuals/tool-manuals.service.ts +53 -5
- package/src/modules/tool-manuals/tool-manuals.tools.ts +41 -15
- 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 +6 -6
- 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} +30 -30
- 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 +5 -5
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +5 -5
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +27 -27
- package/src/modules/workspace/agent-access.gate.ts +5 -5
- 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 +17 -10
- package/src/shared/__tests__/canonical-file-identity.test.ts +5 -5
- package/src/shared/__tests__/http-errors.test.ts +4 -4
- 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/pending-proposals.ts +4 -4
- 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/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
|
@@ -13,8 +13,12 @@ import { createAgentDownloadRoutes } from '../modules/workspace/agent-download.r
|
|
|
13
13
|
import { createGitInternalsRouteGuard } from '../modules/workspace/git-internals.middleware.js';
|
|
14
14
|
import { startCore } from './lifecycle.js';
|
|
15
15
|
import { createDiffRoutes } from '../modules/diff/diff.routes.js';
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
createEventAccess,
|
|
18
|
+
createEventsRoutes,
|
|
19
|
+
createVersionControlRoutes,
|
|
20
|
+
EventDelivery,
|
|
21
|
+
} from '../modules/version-control/index.js';
|
|
18
22
|
import { createAccessRoutes } from '../modules/access/access.routes.js';
|
|
19
23
|
import { createAccessRequestRoutes } from '../modules/access/access-requests.routes.js';
|
|
20
24
|
import { AccessRequestsService } from '../modules/access/access-requests.service.js';
|
|
@@ -32,12 +36,12 @@ import {
|
|
|
32
36
|
createToolManualsBrowserRoutes,
|
|
33
37
|
registerToolManualsTools,
|
|
34
38
|
} from '../modules/tool-manuals/index.js';
|
|
35
|
-
import {
|
|
36
|
-
import { changeRequestScope, registerChangeRequestReadTools } from '../modules/
|
|
39
|
+
import { registerVersionControlTools } from '../modules/version-control/agent-tools/version-control.tools.js';
|
|
40
|
+
import { changeRequestScope, registerChangeRequestReadTools } from '../modules/version-control/agent-tools/change-request-read.tools.js';
|
|
37
41
|
import { createOnboardingRoutes } from '../modules/onboarding/onboarding.routes.js';
|
|
38
42
|
import { registerWorkspaceTools } from '../modules/workspace/workspace.tools.js';
|
|
39
43
|
import { registerAgentGuideTool } from '../modules/agent-guide/index.js';
|
|
40
|
-
import { RECOVERY_BOT_EMAIL } from '../modules/
|
|
44
|
+
import { RECOVERY_BOT_EMAIL } from '../modules/version-control/recovery-bot.js';
|
|
41
45
|
import {
|
|
42
46
|
registerSkillsTools,
|
|
43
47
|
createSkillsRoutes,
|
|
@@ -433,6 +437,8 @@ export async function createCoreServer(
|
|
|
433
437
|
publicBackendUrl: core.config.publicBackendUrl,
|
|
434
438
|
publicFrontendUrl: core.config.publicFrontendUrl,
|
|
435
439
|
kb: core.kb,
|
|
440
|
+
// Read at request time: the overlay binds the port after core is built.
|
|
441
|
+
managedSignIns: () => core.managedSignIns,
|
|
436
442
|
};
|
|
437
443
|
app.use('/api', createSecretsVaultPublicRoutes(secretsVaultRoutesDeps));
|
|
438
444
|
|
|
@@ -468,12 +474,12 @@ export async function createCoreServer(
|
|
|
468
474
|
// Shared agent-access gate config, consumed by every tool surface that
|
|
469
475
|
// touches the KB (file tools + graph tools). The gate decides nothing
|
|
470
476
|
// itself: it calls the read and write hooks a deployment registered on
|
|
471
|
-
// `
|
|
477
|
+
// `versionControlService.hooks`, and carries the notes that deployment wants
|
|
472
478
|
// agents to read about the gated tools. Core registers neither, so a
|
|
473
479
|
// core-only deployment refuses nothing and says nothing extra.
|
|
474
480
|
const agentAccessGate: AgentAccessGate = {
|
|
475
481
|
recoveryBotEmail: RECOVERY_BOT_EMAIL,
|
|
476
|
-
hooks: core.
|
|
482
|
+
hooks: core.versionControlService.hooks,
|
|
477
483
|
notes: new ToolDescriptionNotes(),
|
|
478
484
|
};
|
|
479
485
|
// A skill's `allowed-tools`, checked against what the caller can see — on
|
|
@@ -482,8 +488,8 @@ export async function createCoreServer(
|
|
|
482
488
|
const allowedToolsChecker = new AllowedToolsChecker(core.toolRegistry, core.toolManualService, core.kb);
|
|
483
489
|
// `delete_branch` sees change requests as `get_change_request` does.
|
|
484
490
|
// The history tools take the per-file read the file itself takes (`accessControl`).
|
|
485
|
-
|
|
486
|
-
// The five read tools over change requests. Separate from the
|
|
491
|
+
registerVersionControlTools(core.toolRegistry, toolsRouter, ta, th, core.kb, changeRequestScope(core.accessControl, core.kb).maySee, core.accessControl, agentAccessGate);
|
|
492
|
+
// The five read tools over change requests. Separate from the version-control tools
|
|
487
493
|
// because they are the only ones that gate their whole payload on the
|
|
488
494
|
// caller's read access, so they take the access service and nothing else.
|
|
489
495
|
registerChangeRequestReadTools(core.toolRegistry, toolsRouter, ta, th, core.accessControl, core.kb);
|
|
@@ -580,7 +586,14 @@ export async function createCoreServer(
|
|
|
580
586
|
// What every connected agent is told at session start, as the hosted proxy
|
|
581
587
|
// composes it: read by the local `hexis-mcp` bridge at startup and by the
|
|
582
588
|
// External agent access card. Same `manualAuth`, same router, as `all-tools`.
|
|
583
|
-
toolsRouter.use(
|
|
589
|
+
toolsRouter.use(
|
|
590
|
+
createAgentInstructionsRoutes(
|
|
591
|
+
core.manualAuthMiddleware,
|
|
592
|
+
core.readAgentPreamble,
|
|
593
|
+
() => core.kb.layout,
|
|
594
|
+
() => core.kb.defaultBranch,
|
|
595
|
+
),
|
|
596
|
+
);
|
|
584
597
|
// The fingerprint of the caller's released catalog. The local `hexis-mcp`
|
|
585
598
|
// server polls it to learn that a manual or a skill changed under a
|
|
586
599
|
// connection it cannot be pushed to; nothing else consults it. Same
|
|
@@ -610,7 +623,7 @@ export async function createCoreServer(
|
|
|
610
623
|
app.use('/api', toolsRouter);
|
|
611
624
|
|
|
612
625
|
// The same guard on the PARSED body, for the WHOLE `/workspace/:id` prefix
|
|
613
|
-
// and ahead of EVERY router under it — the file routes, the review,
|
|
626
|
+
// and ahead of EVERY router under it — the file routes, the review, version control
|
|
614
627
|
// and access ones, and whatever an extension mounts below. Mounted here,
|
|
615
628
|
// before the extension phase, so an overlay surface added there is covered
|
|
616
629
|
// by its prefix rather than by remembering this. No auth in front of it: the
|
|
@@ -661,7 +674,7 @@ export async function createCoreServer(
|
|
|
661
674
|
app.use('/api', core.authMiddleware, createWorkspaceRoutes(
|
|
662
675
|
core.workspaceService,
|
|
663
676
|
core.authService,
|
|
664
|
-
core.
|
|
677
|
+
core.versionControlService,
|
|
665
678
|
core.eventBus,
|
|
666
679
|
core.accessControl,
|
|
667
680
|
core.kb,
|
|
@@ -671,11 +684,12 @@ export async function createCoreServer(
|
|
|
671
684
|
allowedToolsChecker,
|
|
672
685
|
core.changeGate,
|
|
673
686
|
));
|
|
674
|
-
//
|
|
687
|
+
// Version control is the only branches / changes / change-request surface. The
|
|
675
688
|
// former /git/*, /pr/*, /pr/:n/* routes are gone — every consumer goes
|
|
676
689
|
// through /workflow/* now.
|
|
677
|
-
|
|
678
|
-
|
|
690
|
+
// The `/workflow/` prefix is kept for API compatibility until a core major.
|
|
691
|
+
app.use('/api', core.authMiddleware, createVersionControlRoutes(
|
|
692
|
+
core.versionControlService,
|
|
679
693
|
core.workspaceService,
|
|
680
694
|
core.authService,
|
|
681
695
|
core.eventBus,
|
|
@@ -693,7 +707,7 @@ export async function createCoreServer(
|
|
|
693
707
|
const eventDelivery = new EventDelivery(createEventAccess({
|
|
694
708
|
accessControl: core.accessControl,
|
|
695
709
|
kbDirName: core.kbDirName,
|
|
696
|
-
getChangeRequest: (number) => core.
|
|
710
|
+
getChangeRequest: (number) => core.versionControlService.getChangeRequest(number),
|
|
697
711
|
workspaces: {
|
|
698
712
|
hasWorkspace: (workspaceId) => core.workspaceService.hasBootstrappedWorkspace(workspaceId),
|
|
699
713
|
anyWorkspaceId: async () => (await core.workspaceService.findAnyWorkspaceId()) ?? core.kb.defaultWorkspaceId(),
|
|
@@ -703,7 +717,7 @@ export async function createCoreServer(
|
|
|
703
717
|
app.use('/api', core.authMiddleware, createDiffRoutes(
|
|
704
718
|
core.diffService,
|
|
705
719
|
core.authService,
|
|
706
|
-
core.
|
|
720
|
+
core.versionControlService,
|
|
707
721
|
core.accessControl,
|
|
708
722
|
core.kbDirName,
|
|
709
723
|
));
|
|
@@ -712,7 +726,7 @@ export async function createCoreServer(
|
|
|
712
726
|
core.workspaceService,
|
|
713
727
|
core.authService,
|
|
714
728
|
core.authService,
|
|
715
|
-
core.
|
|
729
|
+
core.versionControlService,
|
|
716
730
|
core.eventBus,
|
|
717
731
|
core.db,
|
|
718
732
|
core.kb,
|
|
@@ -727,7 +741,7 @@ export async function createCoreServer(
|
|
|
727
741
|
accessControl: core.accessControl,
|
|
728
742
|
workspaceService: core.workspaceService,
|
|
729
743
|
authService: core.authService,
|
|
730
|
-
|
|
744
|
+
versionControl: core.versionControlService,
|
|
731
745
|
lifecycle: core.joinRequestsService,
|
|
732
746
|
kb: core.kb,
|
|
733
747
|
}));
|
|
@@ -744,9 +758,9 @@ export async function createCoreServer(
|
|
|
744
758
|
createSkillAccessRequestRoutes({
|
|
745
759
|
skillService: core.skillService,
|
|
746
760
|
accessControl: core.accessControl,
|
|
747
|
-
|
|
761
|
+
versionControl: core.versionControlService,
|
|
748
762
|
requests: new AccessRequestsService({
|
|
749
|
-
|
|
763
|
+
versionControl: core.versionControlService,
|
|
750
764
|
workspaceService: core.workspaceService,
|
|
751
765
|
lifecycle: core.joinRequestsService,
|
|
752
766
|
kb: core.kb,
|
|
@@ -766,7 +780,7 @@ export async function createCoreServer(
|
|
|
766
780
|
app.use('/api', core.authMiddleware, createPluginsRoutes(
|
|
767
781
|
core.pluginIndexService,
|
|
768
782
|
core.accessControl,
|
|
769
|
-
core.
|
|
783
|
+
core.versionControlService,
|
|
770
784
|
core.joinRequestsService,
|
|
771
785
|
core.pluginJoinRequestJobs,
|
|
772
786
|
core.pluginProvisionService,
|
|
@@ -869,12 +883,12 @@ export async function createCoreServer(
|
|
|
869
883
|
githubApp: core.githubApp,
|
|
870
884
|
},
|
|
871
885
|
// What a move to another repository has to decide about, and what it
|
|
872
|
-
// runs under. Bound here rather than handed the whole
|
|
886
|
+
// runs under. Bound here rather than handed the whole version-control service:
|
|
873
887
|
// the setup routes ask two questions, hold the commit worker for the
|
|
874
888
|
// move, and know nothing else about a request or a commit.
|
|
875
889
|
{
|
|
876
|
-
countOpen: () => core.
|
|
877
|
-
closeAsRepositoryReplaced: () => core.
|
|
890
|
+
countOpen: () => core.versionControlService.countOpenChangeRequests(),
|
|
891
|
+
closeAsRepositoryReplaced: () => core.versionControlService.closeOpenChangeRequestsAsRepositoryReplaced(),
|
|
878
892
|
whileCommitsHeld: (work) => core.whileCommitsHeld(work),
|
|
879
893
|
},
|
|
880
894
|
),
|
|
@@ -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,
|
|
@@ -353,9 +355,9 @@ export interface CoreServices {
|
|
|
353
355
|
gitService: GitService;
|
|
354
356
|
pullRequestService: PullRequestService;
|
|
355
357
|
diffService: DiffService;
|
|
356
|
-
|
|
358
|
+
changeRequestReviewService: ChangeRequestReviewService;
|
|
357
359
|
fileLockService: FileLockService;
|
|
358
|
-
|
|
360
|
+
versionControlService: VersionControlService;
|
|
359
361
|
/**
|
|
360
362
|
* The seam for "a change request was opened": a deployment registers here
|
|
361
363
|
* how the reviewers are told (the cloud's mail, say), and the open's answer
|
|
@@ -364,7 +366,7 @@ export interface CoreServices {
|
|
|
364
366
|
changeRequestHooks: IChangeRequestHooks;
|
|
365
367
|
/** Remote sync (`POST /api/sync`): a git host or pipeline makes the clones catch up. */
|
|
366
368
|
kbSyncService: KbSyncService;
|
|
367
|
-
eventBus:
|
|
369
|
+
eventBus: VersionControlEventBus;
|
|
368
370
|
fileChangeNotifier: FileChangeNotifier;
|
|
369
371
|
pendingCommitsService: PendingCommitsService;
|
|
370
372
|
pendingCommitsWorker: PendingCommitsWorker;
|
|
@@ -440,6 +442,12 @@ export interface CoreServices {
|
|
|
440
442
|
// ── Server-time seams (enterprise overwrites after construction) ────────
|
|
441
443
|
/** `start_session` backing — core default {@link UuidSessionSink}. */
|
|
442
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;
|
|
443
451
|
/** Connection-key LLM metering view — core default unmetered. */
|
|
444
452
|
usageMeter: ILlmUsageMeter;
|
|
445
453
|
/** SSO plugins the auth router mounts — same array instance as the port. */
|
|
@@ -922,16 +930,16 @@ export async function createCoreServices(
|
|
|
922
930
|
// registers its listener here, after this returns (see `AccountHooks`).
|
|
923
931
|
const accountHooks = new AccountHooks();
|
|
924
932
|
|
|
925
|
-
//
|
|
933
|
+
// Version-control lifecycle hooks — the ONE registry this composition shares
|
|
926
934
|
// between GitService (advisory commit validation), the agent-access gate
|
|
927
935
|
// (the blocking agentRead / preWrite hooks), and the composition root,
|
|
928
|
-
// which registers module-owned handlers on `
|
|
936
|
+
// which registers module-owned handlers on `versionControlService.hooks` right
|
|
929
937
|
// after this function returns. Core registers none: no commit-time
|
|
930
938
|
// validation (advisory anyway) and nothing that refuses an agent call.
|
|
931
|
-
const
|
|
939
|
+
const versionControlHooks = new VersionControlHooks();
|
|
932
940
|
const gitService = new GitService(
|
|
933
941
|
workspaceService,
|
|
934
|
-
|
|
942
|
+
versionControlHooks,
|
|
935
943
|
kb,
|
|
936
944
|
workspaceMutex,
|
|
937
945
|
accessControl,
|
|
@@ -968,7 +976,7 @@ export async function createCoreServices(
|
|
|
968
976
|
// the post-switch backup reseed — but switchBranch is gone with the
|
|
969
977
|
// per-branch workspace model, so the injection no longer applies.)
|
|
970
978
|
workspaceService.setDiffService(diffService);
|
|
971
|
-
const
|
|
979
|
+
const changeRequestReviewService = new ChangeRequestReviewService(
|
|
972
980
|
db,
|
|
973
981
|
accessControl,
|
|
974
982
|
workspaceService,
|
|
@@ -976,14 +984,14 @@ export async function createCoreServices(
|
|
|
976
984
|
);
|
|
977
985
|
// Late-bind the comment enricher so PullRequestService.getPrDetail includes
|
|
978
986
|
// our DB-backed comments without forcing a circular constructor dependency.
|
|
979
|
-
pullRequestService.setDetailEnricher(
|
|
987
|
+
pullRequestService.setDetailEnricher(changeRequestReviewService);
|
|
980
988
|
|
|
981
|
-
//
|
|
982
|
-
// 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
|
|
983
991
|
// PLAN.md for the migration story. Today it delegates straight through;
|
|
984
|
-
// implementations migrate into the
|
|
992
|
+
// implementations migrate into the version-control module over later steps.
|
|
985
993
|
const fileLockService = new FileLockService(db);
|
|
986
|
-
// Background commit queue. The `
|
|
994
|
+
// Background commit queue. The `VersionControlService.releaseLock` path
|
|
987
995
|
// enqueues a row here instead of running commitFile + push inline; the
|
|
988
996
|
// worker drains the queue out of band so a git hiccup can't block the
|
|
989
997
|
// user-visible save path. See `lock-decoupling-plan.md`.
|
|
@@ -998,11 +1006,11 @@ export async function createCoreServices(
|
|
|
998
1006
|
(await pendingCommitsService.hasAnyForWorkspace(workspaceId)) ||
|
|
999
1007
|
(await fileLockService.hasAnyActive(workspaceId)),
|
|
1000
1008
|
);
|
|
1001
|
-
// In-process event bus: every
|
|
1009
|
+
// In-process event bus: every VersionControlService mutation method that
|
|
1002
1010
|
// succeeds emits a typed event; the SSE route fans it to connected
|
|
1003
1011
|
// browser sessions. Single instance per Node process — survives across
|
|
1004
1012
|
// requests, doesn't survive restarts (clients reconnect + resync).
|
|
1005
|
-
const eventBus = new
|
|
1013
|
+
const eventBus = new VersionControlEventBus();
|
|
1006
1014
|
// Office-document/PDF/email text extraction for `read_file`/`grep`, cached
|
|
1007
1015
|
// by content hash beside the workspaces root (see `DocExtractionCache`),
|
|
1008
1016
|
// failures included. A fresh failure is told to the people looking at the
|
|
@@ -1020,11 +1028,11 @@ export async function createCoreServices(
|
|
|
1020
1028
|
// of a distribution registers its listener here, after this returns (see
|
|
1021
1029
|
// `ChangeRequestHooks`).
|
|
1022
1030
|
const changeRequestHooks = new ChangeRequestHooks();
|
|
1023
|
-
const
|
|
1031
|
+
const versionControlService = new VersionControlService(
|
|
1024
1032
|
db,
|
|
1025
1033
|
gitService,
|
|
1026
1034
|
pullRequestService,
|
|
1027
|
-
|
|
1035
|
+
changeRequestReviewService,
|
|
1028
1036
|
workspaceService,
|
|
1029
1037
|
accessControl,
|
|
1030
1038
|
fileLockService,
|
|
@@ -1033,10 +1041,10 @@ export async function createCoreServices(
|
|
|
1033
1041
|
changeGate,
|
|
1034
1042
|
eventBus,
|
|
1035
1043
|
fileChangeNotifier,
|
|
1036
|
-
// Exposed as `
|
|
1044
|
+
// Exposed as `versionControlService.hooks` — the SAME instance GitService and
|
|
1037
1045
|
// the agent-access gate consult, so a deployment's registrations against
|
|
1038
1046
|
// it reach every hook point.
|
|
1039
|
-
|
|
1047
|
+
versionControlHooks,
|
|
1040
1048
|
// Exposed as `changeRequestHooks`, the same instance, for the same reason.
|
|
1041
1049
|
changeRequestHooks,
|
|
1042
1050
|
// The opened event names the approvers as accounts; auth answers which
|
|
@@ -1045,7 +1053,7 @@ export async function createCoreServices(
|
|
|
1045
1053
|
);
|
|
1046
1054
|
// The leftover-branch cleanup asks the Deployment page at every round, so
|
|
1047
1055
|
// switching it off there applies without a restart.
|
|
1048
|
-
|
|
1056
|
+
versionControlService.leftoverCleanupEnabled = () => retireMergedBranchesOn(settings.resolve('retireMergedBranches'));
|
|
1049
1057
|
|
|
1050
1058
|
// Join requests: derived entirely from two copies of a plugin's `access.md`
|
|
1051
1059
|
// (the request's branch vs the default branch), so it holds no state — it
|
|
@@ -1053,7 +1061,7 @@ export async function createCoreServices(
|
|
|
1053
1061
|
// have all landed.
|
|
1054
1062
|
const joinRequestsService = new JoinRequestsService(
|
|
1055
1063
|
workspaceService,
|
|
1056
|
-
|
|
1064
|
+
versionControlService,
|
|
1057
1065
|
kb,
|
|
1058
1066
|
// Read-only: the one question a request asks of the resolver is whether
|
|
1059
1067
|
// the person it names already holds what it proposes.
|
|
@@ -1065,7 +1073,7 @@ export async function createCoreServices(
|
|
|
1065
1073
|
// answered in a database round-trip instead of a clone, and what survives a
|
|
1066
1074
|
// restart with the request still owed.
|
|
1067
1075
|
const pluginJoinRequestJobs = new PluginJoinRequestJobs(new DbJoinRequestStore(db), {
|
|
1068
|
-
|
|
1076
|
+
versionControl: versionControlService,
|
|
1069
1077
|
workspaceService,
|
|
1070
1078
|
kb,
|
|
1071
1079
|
// A record keys on the plugin's primary FOLDER below the root, which the
|
|
@@ -1095,7 +1103,7 @@ export async function createCoreServices(
|
|
|
1095
1103
|
// index counts, so a link drops that cache too.
|
|
1096
1104
|
const pluginLinksService = new PluginLinksService(
|
|
1097
1105
|
workspaceService,
|
|
1098
|
-
|
|
1106
|
+
versionControlService,
|
|
1099
1107
|
accessControl,
|
|
1100
1108
|
new AccessMutationService(workspaceService, accessControl, kb.kbDirName),
|
|
1101
1109
|
skillService,
|
|
@@ -1108,7 +1116,7 @@ export async function createCoreServices(
|
|
|
1108
1116
|
// then drops every cache that keyed on the old identity.
|
|
1109
1117
|
const pluginRenameService = new PluginRenameService(
|
|
1110
1118
|
workspaceService,
|
|
1111
|
-
|
|
1119
|
+
versionControlService,
|
|
1112
1120
|
accessControl,
|
|
1113
1121
|
pluginSource,
|
|
1114
1122
|
disk,
|
|
@@ -1149,16 +1157,16 @@ export async function createCoreServices(
|
|
|
1149
1157
|
gitRunner,
|
|
1150
1158
|
);
|
|
1151
1159
|
|
|
1152
|
-
// Remote sync. Drives the
|
|
1160
|
+
// Remote sync. Drives the version-control module's per-branch pull-and-announce
|
|
1153
1161
|
// over every clone the workspace service knows about; owns no git of its own.
|
|
1154
|
-
const kbSyncService = new KbSyncService(
|
|
1162
|
+
const kbSyncService = new KbSyncService(versionControlService, workspaceService);
|
|
1155
1163
|
// Server-scoped MCP editing — the tool page's edit form. One server's truth
|
|
1156
1164
|
// spans a plugin's mcp.json AND plugin.json extensions block, and this is
|
|
1157
1165
|
// the ONE writer that rewrites both entries and commits them together (see
|
|
1158
1166
|
// McpServerEditService).
|
|
1159
1167
|
const mcpServerEditService = new McpServerEditService(
|
|
1160
1168
|
workspaceService,
|
|
1161
|
-
|
|
1169
|
+
versionControlService,
|
|
1162
1170
|
accessControl,
|
|
1163
1171
|
toolManualService,
|
|
1164
1172
|
kb,
|
|
@@ -1171,7 +1179,7 @@ export async function createCoreServices(
|
|
|
1171
1179
|
// folder's rules are at HEAD before the endpoint answers.
|
|
1172
1180
|
const pluginProvisionService = new PluginProvisionService(
|
|
1173
1181
|
workspaceService,
|
|
1174
|
-
|
|
1182
|
+
versionControlService,
|
|
1175
1183
|
accessControl,
|
|
1176
1184
|
kb,
|
|
1177
1185
|
eventBus,
|
|
@@ -1181,26 +1189,26 @@ export async function createCoreServices(
|
|
|
1181
1189
|
|
|
1182
1190
|
// Pending skills: the other half of the catalog — skills that exist only on
|
|
1183
1191
|
// an open change request's branch. Built here rather than beside
|
|
1184
|
-
// `skillService` because it needs the
|
|
1192
|
+
// `skillService` because it needs the version-control service, which does not exist
|
|
1185
1193
|
// that early; it holds no state of its own, so where it is constructed is the
|
|
1186
1194
|
// only thing the ordering decides.
|
|
1187
1195
|
const pendingSkillsService = new PendingSkillsService(
|
|
1188
1196
|
workspaceService,
|
|
1189
1197
|
accessControl,
|
|
1190
1198
|
skillService,
|
|
1191
|
-
|
|
1199
|
+
versionControlService,
|
|
1192
1200
|
kb,
|
|
1193
1201
|
);
|
|
1194
1202
|
|
|
1195
1203
|
// The same missing half, for tools: a `.tool` manual or an `mcp.json` server
|
|
1196
1204
|
// an agent proposes is nowhere in the product until its change request
|
|
1197
|
-
// merges. Built here for the same reason — it needs the
|
|
1205
|
+
// merges. Built here for the same reason — it needs the version-control service —
|
|
1198
1206
|
// and stateless for the same reason.
|
|
1199
1207
|
const pendingToolsService = new PendingToolsService(
|
|
1200
1208
|
workspaceService,
|
|
1201
1209
|
accessControl,
|
|
1202
1210
|
toolManualService,
|
|
1203
|
-
|
|
1211
|
+
versionControlService,
|
|
1204
1212
|
kb,
|
|
1205
1213
|
);
|
|
1206
1214
|
|
|
@@ -1238,7 +1246,7 @@ export async function createCoreServices(
|
|
|
1238
1246
|
packsDir: config.starterPacksDir,
|
|
1239
1247
|
kb,
|
|
1240
1248
|
workspaceService,
|
|
1241
|
-
|
|
1249
|
+
versionControl: versionControlService,
|
|
1242
1250
|
adminAccess,
|
|
1243
1251
|
settings,
|
|
1244
1252
|
accessControl,
|
|
@@ -1288,7 +1296,7 @@ export async function createCoreServices(
|
|
|
1288
1296
|
// can only exist once the vault does.
|
|
1289
1297
|
const toolDeleteService = new ToolDeleteService(
|
|
1290
1298
|
workspaceService,
|
|
1291
|
-
|
|
1299
|
+
versionControlService,
|
|
1292
1300
|
accessControl,
|
|
1293
1301
|
toolManualService,
|
|
1294
1302
|
skillService,
|
|
@@ -1335,12 +1343,16 @@ export async function createCoreServices(
|
|
|
1335
1343
|
});
|
|
1336
1344
|
|
|
1337
1345
|
// GDPR erasure path: admin-driven user deletion. The core service erases the
|
|
1338
|
-
// rows it owns; each module contributes its slice as a participant.
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
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
|
+
]);
|
|
1344
1356
|
|
|
1345
1357
|
// MCP (remote agent access). ExternalApiKeyService handles connection-key
|
|
1346
1358
|
// lifecycle. McpService is a GENERIC, STATELESS proxy: per request it
|
|
@@ -1411,7 +1423,7 @@ export async function createCoreServices(
|
|
|
1411
1423
|
workspaceService,
|
|
1412
1424
|
accessControl,
|
|
1413
1425
|
authService,
|
|
1414
|
-
|
|
1426
|
+
versionControlService,
|
|
1415
1427
|
gitService,
|
|
1416
1428
|
accountLinks: new AccountLinkService(db),
|
|
1417
1429
|
// The SAME extension-to-reader registry `read_file` dispatches on, so the
|
|
@@ -1444,9 +1456,12 @@ export async function createCoreServices(
|
|
|
1444
1456
|
// For the needs-authorization setup link surfaced to external agents.
|
|
1445
1457
|
publicFrontendUrl: config.publicFrontendUrl,
|
|
1446
1458
|
readAgentPreamble: readPreamble,
|
|
1447
|
-
// The
|
|
1448
|
-
// 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.
|
|
1449
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,
|
|
1450
1465
|
secretsScope,
|
|
1451
1466
|
// Read at listing time, by when the hints below exist.
|
|
1452
1467
|
readOnlyOverrides: () => readOnlyHints.overrides(),
|
|
@@ -1524,7 +1539,7 @@ export async function createCoreServices(
|
|
|
1524
1539
|
const resolveToolContext = createToolContextResolver({
|
|
1525
1540
|
authService,
|
|
1526
1541
|
workspaceService,
|
|
1527
|
-
|
|
1542
|
+
versionControlService,
|
|
1528
1543
|
events: eventBus,
|
|
1529
1544
|
kbDirName: kbDirName,
|
|
1530
1545
|
creatorAccess,
|
|
@@ -1584,7 +1599,7 @@ export async function createCoreServices(
|
|
|
1584
1599
|
// swallowed the `opts` carrying `skipValidation`, so the burst-validation
|
|
1585
1600
|
// skip was a no-op in production while every unit test — which stubs this
|
|
1586
1601
|
// port — passed. No wrapper, no gap to fall through.
|
|
1587
|
-
|
|
1602
|
+
versionControl: versionControlService,
|
|
1588
1603
|
// Both escalation sinks come through CorePorts: the recovery agent and the
|
|
1589
1604
|
// notice sink are enterprise-owned (background-agent factory / feedback
|
|
1590
1605
|
// dashboard); core defaults skip recovery and log to stderr.
|
|
@@ -1644,7 +1659,7 @@ export async function createCoreServices(
|
|
|
1644
1659
|
source,
|
|
1645
1660
|
...createSyncedGroupsCommitter({
|
|
1646
1661
|
workspaceService,
|
|
1647
|
-
|
|
1662
|
+
versionControlService,
|
|
1648
1663
|
accessControl,
|
|
1649
1664
|
eventBus,
|
|
1650
1665
|
kbDirName,
|
|
@@ -1660,7 +1675,7 @@ export async function createCoreServices(
|
|
|
1660
1675
|
// directory token route drives.
|
|
1661
1676
|
const groupsAdminService = new GroupsAdminService(
|
|
1662
1677
|
workspaceService,
|
|
1663
|
-
|
|
1678
|
+
versionControlService,
|
|
1664
1679
|
accessControl,
|
|
1665
1680
|
disk,
|
|
1666
1681
|
kbDirName,
|
|
@@ -1672,7 +1687,7 @@ export async function createCoreServices(
|
|
|
1672
1687
|
// The deployment owner is never removed this way.
|
|
1673
1688
|
const userAccessRemovalService = new UserAccessRemovalService(
|
|
1674
1689
|
workspaceService,
|
|
1675
|
-
|
|
1690
|
+
versionControlService,
|
|
1676
1691
|
accessControl,
|
|
1677
1692
|
disk,
|
|
1678
1693
|
kbDirName,
|
|
@@ -1754,9 +1769,9 @@ export async function createCoreServices(
|
|
|
1754
1769
|
gitService,
|
|
1755
1770
|
pullRequestService,
|
|
1756
1771
|
diffService,
|
|
1757
|
-
|
|
1772
|
+
changeRequestReviewService,
|
|
1758
1773
|
fileLockService,
|
|
1759
|
-
|
|
1774
|
+
versionControlService,
|
|
1760
1775
|
changeRequestHooks,
|
|
1761
1776
|
kbSyncService,
|
|
1762
1777
|
eventBus,
|
|
@@ -1789,6 +1804,7 @@ export async function createCoreServices(
|
|
|
1789
1804
|
// Server-time seams — defaults here; the enterprise overlay overwrites
|
|
1790
1805
|
// (or, for the array, pushes into) these after construction.
|
|
1791
1806
|
sessionSink: ports.sessionSink ?? new UuidSessionSink(),
|
|
1807
|
+
managedSignIns: ports.managedSignIns ?? null,
|
|
1792
1808
|
usageMeter: ports.usageMeter ?? unmeteredLlmUsage,
|
|
1793
1809
|
authProviders,
|
|
1794
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) {
|