@bevel-software/platform-core-backend 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-guide/access-control.md +24 -8
- package/agent-guide/html-views.md +277 -15
- package/agent-guide/tool-manuals.md +1 -1
- package/dist/core/catalog-revision.d.ts +12 -1
- package/dist/core/catalog-revision.d.ts.map +1 -1
- package/dist/core/catalog-revision.js +23 -3
- package/dist/core/catalog-revision.js.map +1 -1
- package/dist/core/core-ports.d.ts +41 -0
- package/dist/core/core-ports.d.ts.map +1 -1
- package/dist/core/core-ports.js.map +1 -1
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +42 -10
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +22 -6
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +58 -17
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +24 -0
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +16 -2
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/public-config.d.ts +10 -0
- package/dist/core/public-config.d.ts.map +1 -1
- package/dist/core/public-config.js +10 -0
- package/dist/core/public-config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/access/access-control.interface.d.ts +17 -9
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +13 -3
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +165 -77
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access-declarations.d.ts +1 -1
- package/dist/modules/access/access-declarations.d.ts.map +1 -1
- package/dist/modules/access/access-declarations.js +1 -1
- package/dist/modules/access/access-declarations.js.map +1 -1
- package/dist/modules/access/access-mutation.service.d.ts +28 -25
- package/dist/modules/access/access-mutation.service.d.ts.map +1 -1
- package/dist/modules/access/access-mutation.service.js +50 -53
- package/dist/modules/access/access-mutation.service.js.map +1 -1
- package/dist/modules/access/access-requests.contract.d.ts +1 -1
- package/dist/modules/access/access-requests.contract.d.ts.map +1 -1
- package/dist/modules/access/access-requests.routes.d.ts +3 -3
- package/dist/modules/access/access-requests.routes.d.ts.map +1 -1
- package/dist/modules/access/access-requests.routes.js +7 -7
- package/dist/modules/access/access-requests.routes.js.map +1 -1
- package/dist/modules/access/access-requests.service.d.ts +21 -20
- package/dist/modules/access/access-requests.service.d.ts.map +1 -1
- package/dist/modules/access/access-requests.service.js +22 -68
- package/dist/modules/access/access-requests.service.js.map +1 -1
- package/dist/modules/access/access-view.d.ts +1 -1
- package/dist/modules/access/access-view.d.ts.map +1 -1
- package/dist/modules/access/access-view.js +12 -11
- package/dist/modules/access/access-view.js.map +1 -1
- package/dist/modules/access/access.routes.d.ts +8 -7
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +38 -32
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/admin-locked-commit.d.ts +2 -2
- package/dist/modules/access/admin-locked-commit.d.ts.map +1 -1
- package/dist/modules/access/admin-locked-commit.js +1 -1
- package/dist/modules/access/admin-locked-commit.js.map +1 -1
- package/dist/modules/access/capability-registry.js +1 -1
- package/dist/modules/access/capability-registry.js.map +1 -1
- package/dist/modules/access/change-read-gate.d.ts +2 -2
- package/dist/modules/access/change-read-gate.d.ts.map +1 -1
- package/dist/modules/access/change-read-gate.js +1 -3
- package/dist/modules/access/change-read-gate.js.map +1 -1
- package/dist/modules/access/creator-access.d.ts +2 -2
- package/dist/modules/access/creator-access.d.ts.map +1 -1
- package/dist/modules/access/creator-access.js +2 -4
- package/dist/modules/access/creator-access.js.map +1 -1
- package/dist/modules/access/directory-sync-bot.d.ts +1 -1
- package/dist/modules/access/directory-sync-bot.d.ts.map +1 -1
- package/dist/modules/access/directory-sync-bot.js +1 -1
- package/dist/modules/access/directory-sync-bot.js.map +1 -1
- package/dist/modules/access/groups-admin.routes.d.ts +2 -2
- package/dist/modules/access/groups-admin.routes.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.routes.js +6 -4
- package/dist/modules/access/groups-admin.routes.js.map +1 -1
- package/dist/modules/access/groups-admin.service.d.ts +45 -14
- package/dist/modules/access/groups-admin.service.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.service.js +80 -39
- package/dist/modules/access/groups-admin.service.js.map +1 -1
- package/dist/modules/access/groups-edit.d.ts +1 -1
- package/dist/modules/access/groups-edit.d.ts.map +1 -1
- package/dist/modules/access/groups-edit.js +3 -3
- package/dist/modules/access/groups-edit.js.map +1 -1
- package/dist/modules/access/index.d.ts +17 -0
- package/dist/modules/access/index.d.ts.map +1 -0
- package/dist/modules/access/index.js +6 -0
- package/dist/modules/access/index.js.map +1 -0
- package/dist/modules/access/reference-scan.d.ts +116 -24
- package/dist/modules/access/reference-scan.d.ts.map +1 -1
- package/dist/modules/access/reference-scan.js +305 -44
- package/dist/modules/access/reference-scan.js.map +1 -1
- package/dist/modules/access/roles-admin.service.d.ts +18 -9
- package/dist/modules/access/roles-admin.service.d.ts.map +1 -1
- package/dist/modules/access/roles-admin.service.js +32 -26
- package/dist/modules/access/roles-admin.service.js.map +1 -1
- package/dist/modules/access/roles-edit.js +1 -1
- package/dist/modules/access/roles-edit.js.map +1 -1
- package/dist/modules/access/synced-groups-committer.d.ts +2 -2
- package/dist/modules/access/synced-groups-committer.d.ts.map +1 -1
- package/dist/modules/access/synced-groups-committer.js +2 -2
- package/dist/modules/access/synced-groups-committer.js.map +1 -1
- package/dist/modules/access/synced-groups-writer.js +2 -2
- package/dist/modules/access/synced-groups-writer.js.map +1 -1
- package/dist/modules/access/user-access-removal.service.d.ts +1 -1
- package/dist/modules/access/user-access-removal.service.d.ts.map +1 -1
- package/dist/modules/access/user-access-removal.service.js +2 -5
- package/dist/modules/access/user-access-removal.service.js.map +1 -1
- package/dist/modules/access-model/access-grammar.d.ts +35 -10
- package/dist/modules/access-model/access-grammar.d.ts.map +1 -1
- package/dist/modules/access-model/access-grammar.js +60 -20
- package/dist/modules/access-model/access-grammar.js.map +1 -1
- package/dist/modules/access-model/access-splice.d.ts +22 -18
- package/dist/modules/access-model/access-splice.d.ts.map +1 -1
- package/dist/modules/access-model/access-splice.js +20 -14
- package/dist/modules/access-model/access-splice.js.map +1 -1
- package/dist/modules/access-model/group-files.d.ts +1 -0
- package/dist/modules/access-model/group-files.d.ts.map +1 -1
- package/dist/modules/access-model/group-files.js +5 -1
- package/dist/modules/access-model/group-files.js.map +1 -1
- package/dist/modules/access-model/index.d.ts +20 -5
- package/dist/modules/access-model/index.d.ts.map +1 -1
- package/dist/modules/access-model/index.js +18 -5
- package/dist/modules/access-model/index.js.map +1 -1
- package/dist/modules/access-model/roles-yaml-guard.d.ts +1 -1
- package/dist/modules/access-model/roles-yaml-guard.d.ts.map +1 -1
- package/dist/modules/admin/admin-access.routes.d.ts +1 -1
- package/dist/modules/admin/admin-access.routes.d.ts.map +1 -1
- package/dist/modules/admin/admin-access.routes.js +1 -1
- package/dist/modules/admin/admin-access.routes.js.map +1 -1
- package/dist/modules/admin/admin-access.service.d.ts +2 -2
- package/dist/modules/admin/admin-access.service.d.ts.map +1 -1
- package/dist/modules/admin/index.d.ts +8 -0
- package/dist/modules/admin/index.d.ts.map +1 -0
- package/dist/modules/admin/index.js +2 -0
- package/dist/modules/admin/index.js.map +1 -0
- package/dist/modules/agent-guide/agent-guide.js +1 -1
- package/dist/modules/agent-guide/agent-guide.js.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.d.ts +3 -3
- package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.js +15 -7
- package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -1
- package/dist/modules/agent-guide/index.d.ts +1 -1
- package/dist/modules/agent-guide/index.d.ts.map +1 -1
- package/dist/modules/agent-guide/index.js +1 -1
- package/dist/modules/agent-guide/index.js.map +1 -1
- package/dist/modules/agent-instructions/compose.d.ts +3 -1
- package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
- package/dist/modules/agent-instructions/compose.js +3 -1
- package/dist/modules/agent-instructions/compose.js.map +1 -1
- package/dist/modules/agent-instructions/read-preamble.d.ts +1 -1
- package/dist/modules/agent-instructions/read-preamble.d.ts.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.d.ts +5 -1
- package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.js +16 -1
- package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
- package/dist/modules/agent-scope/agent-scope.contract.d.ts +67 -0
- package/dist/modules/agent-scope/agent-scope.contract.d.ts.map +1 -0
- package/dist/modules/agent-scope/agent-scope.contract.js +27 -0
- package/dist/modules/agent-scope/agent-scope.contract.js.map +1 -0
- package/dist/modules/agent-scope/connection-scope.d.ts +111 -0
- package/dist/modules/agent-scope/connection-scope.d.ts.map +1 -0
- package/dist/modules/agent-scope/connection-scope.js +165 -0
- package/dist/modules/agent-scope/connection-scope.js.map +1 -0
- package/dist/modules/agent-scope/index.d.ts +3 -0
- package/dist/modules/agent-scope/index.d.ts.map +1 -0
- package/dist/modules/agent-scope/index.js +3 -0
- package/dist/modules/agent-scope/index.js.map +1 -0
- package/dist/modules/audit/agent-audit.service.d.ts +2 -2
- package/dist/modules/audit/agent-audit.service.d.ts.map +1 -1
- package/dist/modules/audit/agent-audit.service.js +3 -1
- package/dist/modules/audit/agent-audit.service.js.map +1 -1
- package/dist/modules/audit/agent-connection.routes.d.ts +1 -1
- package/dist/modules/audit/agent-connection.routes.d.ts.map +1 -1
- package/dist/modules/audit/agent-connection.routes.js +1 -1
- package/dist/modules/audit/agent-connection.routes.js.map +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.d.ts +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.d.ts.map +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.js +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.js.map +1 -1
- package/dist/modules/audit/audit.contract.d.ts +6 -0
- package/dist/modules/audit/audit.contract.d.ts.map +1 -1
- package/dist/modules/audit/audit.contract.js.map +1 -1
- package/dist/modules/audit/audit.routes.d.ts +3 -3
- package/dist/modules/audit/audit.routes.d.ts.map +1 -1
- package/dist/modules/audit/audit.routes.js +2 -2
- package/dist/modules/audit/audit.routes.js.map +1 -1
- package/dist/modules/auth/account-admission.d.ts +12 -0
- package/dist/modules/auth/account-admission.d.ts.map +1 -1
- package/dist/modules/auth/account-admission.js +15 -0
- package/dist/modules/auth/account-admission.js.map +1 -1
- package/dist/modules/auth/account-erasure.service.d.ts +3 -3
- package/dist/modules/auth/account-erasure.service.d.ts.map +1 -1
- package/dist/modules/auth/account-erasure.service.js +1 -5
- package/dist/modules/auth/account-erasure.service.js.map +1 -1
- package/dist/modules/auth/account-switch-lock.d.ts +1 -1
- package/dist/modules/auth/account-switch-lock.d.ts.map +1 -1
- package/dist/modules/auth/account-switch-lock.js +1 -1
- package/dist/modules/auth/account-switch-lock.js.map +1 -1
- package/dist/modules/auth/account.routes.d.ts +2 -2
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +1 -1
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.middleware.d.ts +27 -1
- package/dist/modules/auth/auth.middleware.d.ts.map +1 -1
- package/dist/modules/auth/auth.middleware.js +42 -4
- package/dist/modules/auth/auth.middleware.js.map +1 -1
- package/dist/modules/auth/auth.routes.d.ts +13 -9
- package/dist/modules/auth/auth.routes.d.ts.map +1 -1
- package/dist/modules/auth/auth.routes.js +35 -29
- package/dist/modules/auth/auth.routes.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +56 -7
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +131 -37
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/index.d.ts +3 -1
- package/dist/modules/auth/index.d.ts.map +1 -1
- package/dist/modules/auth/index.js +1 -1
- package/dist/modules/auth/index.js.map +1 -1
- package/dist/modules/auth/oidc-auth-provider.d.ts.map +1 -1
- package/dist/modules/auth/oidc-auth-provider.js +3 -10
- package/dist/modules/auth/oidc-auth-provider.js.map +1 -1
- package/dist/modules/code-mode/code-mode.tool.d.ts +1 -1
- package/dist/modules/code-mode/code-mode.tool.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.d.ts +2 -2
- package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.js +1 -4
- package/dist/modules/connection-probe/connection-probe.service.js.map +1 -1
- package/dist/modules/database/core-schema.d.ts +175 -234
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +72 -35
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/database/index.d.ts +10 -0
- package/dist/modules/database/index.d.ts.map +1 -0
- package/dist/modules/database/index.js +4 -0
- package/dist/modules/database/index.js.map +1 -0
- package/dist/modules/database/migrate.d.ts.map +1 -1
- package/dist/modules/database/migrate.js +78 -3
- package/dist/modules/database/migrate.js.map +1 -1
- package/dist/modules/declared-variables/declared-variables.routes.d.ts +10 -3
- package/dist/modules/declared-variables/declared-variables.routes.d.ts.map +1 -1
- package/dist/modules/declared-variables/declared-variables.routes.js +13 -2
- package/dist/modules/declared-variables/declared-variables.routes.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 +3 -3
- package/dist/modules/diff/diff.routes.js.map +1 -1
- package/dist/modules/diff/diff.service.d.ts +2 -2
- package/dist/modules/diff/diff.service.d.ts.map +1 -1
- package/dist/modules/diff/index.d.ts +7 -0
- package/dist/modules/diff/index.d.ts.map +1 -0
- package/dist/modules/diff/index.js +2 -0
- package/dist/modules/diff/index.js.map +1 -0
- package/dist/modules/embed/account-link.service.d.ts +1 -1
- package/dist/modules/embed/account-link.service.d.ts.map +1 -1
- package/dist/modules/embed/account-link.service.js +1 -1
- package/dist/modules/embed/account-link.service.js.map +1 -1
- package/dist/modules/embed/embed.routes.d.ts +1 -1
- package/dist/modules/embed/embed.routes.d.ts.map +1 -1
- package/dist/modules/embed/embed.routes.js +2 -2
- package/dist/modules/embed/embed.routes.js.map +1 -1
- package/dist/modules/embed/embed.service.d.ts +1 -1
- package/dist/modules/embed/embed.service.d.ts.map +1 -1
- package/dist/modules/embed/embed.tools.d.ts +4 -4
- package/dist/modules/embed/embed.tools.d.ts.map +1 -1
- package/dist/modules/embed/embed.tools.js +8 -5
- package/dist/modules/embed/embed.tools.js.map +1 -1
- package/dist/modules/github-app/github-app.connection.d.ts +1 -1
- package/dist/modules/github-app/github-app.connection.d.ts.map +1 -1
- package/dist/modules/github-app/github-app.routes.d.ts +3 -3
- package/dist/modules/github-app/github-app.routes.d.ts.map +1 -1
- package/dist/modules/github-app/github-app.routes.js +1 -1
- package/dist/modules/github-app/github-app.routes.js.map +1 -1
- package/dist/modules/kb-fs/index.d.ts +12 -0
- package/dist/modules/kb-fs/index.d.ts.map +1 -1
- package/dist/modules/kb-fs/index.js +11 -0
- package/dist/modules/kb-fs/index.js.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.d.ts +1 -1
- package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.js +7 -1
- package/dist/modules/kb-fs/locking-filesystem.js.map +1 -1
- package/dist/modules/kb-fs/repo-path.d.ts +26 -6
- package/dist/modules/kb-fs/repo-path.d.ts.map +1 -1
- package/dist/modules/kb-fs/repo-path.js +22 -7
- package/dist/modules/kb-fs/repo-path.js.map +1 -1
- package/dist/modules/kb-fs/tmp-ref.d.ts +36 -0
- package/dist/modules/kb-fs/tmp-ref.d.ts.map +1 -0
- package/dist/modules/kb-fs/tmp-ref.js +76 -0
- package/dist/modules/kb-fs/tmp-ref.js.map +1 -0
- package/dist/modules/kb-sync/kb-sync.routes.d.ts +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.js +2 -2
- package/dist/modules/kb-sync/kb-sync.routes.js.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js.map +1 -1
- package/dist/modules/kb-sync/sync-auth.js +1 -1
- package/dist/modules/kb-sync/sync-auth.js.map +1 -1
- package/dist/modules/kb-sync/sync-payload.js +1 -1
- package/dist/modules/kb-sync/sync-payload.js.map +1 -1
- package/dist/modules/marketplace/git-http.routes.d.ts +1 -1
- package/dist/modules/marketplace/git-http.routes.d.ts.map +1 -1
- package/dist/modules/marketplace/git-http.routes.js +1 -1
- package/dist/modules/marketplace/git-http.routes.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.d.ts +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.d.ts +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.d.ts +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.routes.d.ts +2 -2
- package/dist/modules/marketplace/github-facade/github-facade.routes.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.routes.js +2 -2
- package/dist/modules/marketplace/github-facade/github-facade.routes.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.service.d.ts +2 -2
- package/dist/modules/marketplace/github-facade/github-facade.service.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.service.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.service.js.map +1 -1
- package/dist/modules/marketplace/marketplace-repo.service.d.ts +1 -1
- package/dist/modules/marketplace/marketplace-repo.service.d.ts.map +1 -1
- package/dist/modules/marketplace/marketplace-repo.service.js +1 -1
- package/dist/modules/mcp/index.d.ts +8 -0
- package/dist/modules/mcp/index.d.ts.map +1 -0
- package/dist/modules/mcp/index.js +7 -0
- package/dist/modules/mcp/index.js.map +1 -0
- package/dist/modules/mcp/mcp-auth.middleware.d.ts +11 -5
- package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.js +18 -5
- package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
- package/dist/modules/mcp/mcp.routes.d.ts +9 -5
- package/dist/modules/mcp/mcp.routes.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.routes.js +41 -6
- package/dist/modules/mcp/mcp.routes.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +25 -4
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +84 -19
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +25 -2
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +46 -11
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts +10 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.js +35 -2
- package/dist/modules/mcp/oauth/oauth-consent.routes.js.map +1 -1
- package/dist/modules/onboarding/onboarding.routes.d.ts +1 -1
- package/dist/modules/onboarding/onboarding.routes.d.ts.map +1 -1
- package/dist/modules/onboarding/onboarding.routes.js +1 -1
- package/dist/modules/onboarding/onboarding.routes.js.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.d.ts +4 -5
- package/dist/modules/onboarding/starter-pack.service.d.ts.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.js +2 -2
- package/dist/modules/onboarding/starter-pack.service.js.map +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.d.ts +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.d.ts.map +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.js +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.js.map +1 -1
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts +3 -3
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.d.ts +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.js +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.js.map +1 -1
- package/dist/modules/plugins/index.d.ts +2 -1
- package/dist/modules/plugins/index.d.ts.map +1 -1
- package/dist/modules/plugins/index.js +2 -0
- package/dist/modules/plugins/index.js.map +1 -1
- package/dist/modules/plugins/join-proposals.d.ts +2 -2
- package/dist/modules/plugins/join-proposals.d.ts.map +1 -1
- package/dist/modules/plugins/join-proposals.js +1 -1
- package/dist/modules/plugins/join-proposals.js.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts +1 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.js +2 -2
- package/dist/modules/plugins/join-request-jobs.service.js.map +1 -1
- package/dist/modules/plugins/join-request-records.store.d.ts +1 -1
- package/dist/modules/plugins/join-request-records.store.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-records.store.js +1 -1
- package/dist/modules/plugins/join-request-records.store.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 +1 -1
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugin-links.d.ts +21 -5
- package/dist/modules/plugins/plugin-links.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-links.js +1 -1
- package/dist/modules/plugins/plugin-links.js.map +1 -1
- package/dist/modules/plugins/plugin-links.service.d.ts +8 -5
- package/dist/modules/plugins/plugin-links.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-links.service.js +8 -6
- package/dist/modules/plugins/plugin-links.service.js.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.d.ts +2 -2
- package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.js +2 -3
- package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.d.ts +2 -2
- package/dist/modules/plugins/plugin-rename.service.d.ts.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.contract.d.ts +1 -1
- package/dist/modules/plugins/plugins.contract.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +7 -3
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +35 -8
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +4 -4
- package/dist/modules/plugins/plugins.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.service.js +1 -1
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/plugins/plugins.tools.d.ts +1 -1
- package/dist/modules/plugins/plugins.tools.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.tools.js +3 -3
- package/dist/modules/plugins/plugins.tools.js.map +1 -1
- package/dist/modules/plugins/teams.routes.d.ts +3 -3
- package/dist/modules/plugins/teams.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +1 -0
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +2 -0
- package/dist/modules/secrets-vault/index.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +13 -4
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +16 -4
- 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.d.ts +7 -1
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +45 -3
- package/dist/modules/settings/deployment-settings.service.js.map +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/index.d.ts +13 -0
- package/dist/modules/settings/index.d.ts.map +1 -0
- package/dist/modules/settings/index.js +3 -0
- package/dist/modules/settings/index.js.map +1 -0
- package/dist/modules/settings/setup.routes.d.ts +3 -3
- package/dist/modules/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +2 -2
- package/dist/modules/settings/setup.routes.js.map +1 -1
- package/dist/modules/skills/allowed-tools-check.d.ts +2 -2
- package/dist/modules/skills/allowed-tools-check.d.ts.map +1 -1
- package/dist/modules/skills/allowed-tools-check.js +1 -1
- package/dist/modules/skills/allowed-tools-check.js.map +1 -1
- package/dist/modules/skills/index.d.ts +4 -3
- package/dist/modules/skills/index.d.ts.map +1 -1
- package/dist/modules/skills/index.js +0 -2
- package/dist/modules/skills/index.js.map +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.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +5 -5
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +6 -13
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
- package/dist/modules/skills/skills.contract.d.ts +16 -0
- package/dist/modules/skills/skills.contract.d.ts.map +1 -1
- package/dist/modules/skills/skills.routes.d.ts +1 -1
- package/dist/modules/skills/skills.routes.d.ts.map +1 -1
- package/dist/modules/skills/skills.routes.js +1 -1
- package/dist/modules/skills/skills.routes.js.map +1 -1
- package/dist/modules/skills/skills.service.d.ts +2 -2
- package/dist/modules/skills/skills.service.d.ts.map +1 -1
- package/dist/modules/skills/skills.service.js +6 -1
- package/dist/modules/skills/skills.service.js.map +1 -1
- package/dist/modules/skills/skills.tools.d.ts +3 -3
- package/dist/modules/skills/skills.tools.d.ts.map +1 -1
- package/dist/modules/skills/skills.tools.js +27 -19
- package/dist/modules/skills/skills.tools.js.map +1 -1
- package/dist/modules/tool-auth/connection-key-rejection.js +1 -1
- package/dist/modules/tool-auth/connection-key-rejection.js.map +1 -1
- package/dist/modules/tool-auth/connection-keys-admin.routes.d.ts +2 -2
- package/dist/modules/tool-auth/connection-keys-admin.routes.d.ts.map +1 -1
- package/dist/modules/tool-auth/connection-keys-admin.routes.js +1 -1
- package/dist/modules/tool-auth/connection-keys-admin.routes.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.interface.d.ts +11 -0
- package/dist/modules/tool-auth/external-api-key.interface.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.interface.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts +2 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js +5 -2
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
- package/dist/modules/tool-auth/index.d.ts +15 -0
- package/dist/modules/tool-auth/index.d.ts.map +1 -0
- package/dist/modules/tool-auth/index.js +11 -0
- package/dist/modules/tool-auth/index.js.map +1 -0
- package/dist/modules/tool-auth/internal-token.service.d.ts +9 -0
- package/dist/modules/tool-auth/internal-token.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/internal-token.service.js +1 -0
- package/dist/modules/tool-auth/internal-token.service.js.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts +29 -5
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.js +33 -7
- package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -1
- package/dist/modules/tool-helpers/default-branch-write.d.ts +1 -1
- package/dist/modules/tool-helpers/default-branch-write.d.ts.map +1 -1
- package/dist/modules/tool-helpers/index.d.ts +4 -1
- package/dist/modules/tool-helpers/index.d.ts.map +1 -1
- package/dist/modules/tool-helpers/index.js +3 -0
- package/dist/modules/tool-helpers/index.js.map +1 -1
- package/dist/modules/tool-helpers/route-argument-check.js +1 -1
- package/dist/modules/tool-helpers/route-argument-check.js.map +1 -1
- package/dist/modules/tool-helpers/route-tool-schemas.d.ts +1 -1
- package/dist/modules/tool-helpers/route-tool-schemas.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.d.ts +12 -6
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.js +5 -3
- package/dist/modules/tool-helpers/tool-context.js.map +1 -1
- package/dist/modules/tool-helpers/tool-def.d.ts +4 -2
- package/dist/modules/tool-helpers/tool-def.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-def.js +3 -1
- package/dist/modules/tool-helpers/tool-def.js.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.d.ts +17 -2
- package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.js +21 -2
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.d.ts +12 -2
- package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.js.map +1 -1
- package/dist/modules/tool-helpers/validate-token.d.ts +3 -2
- package/dist/modules/tool-helpers/validate-token.d.ts.map +1 -1
- package/dist/modules/tool-helpers/validate-token.js +2 -2
- package/dist/modules/tool-helpers/validate-token.js.map +1 -1
- package/dist/modules/tool-manuals/index.d.ts +8 -3
- package/dist/modules/tool-manuals/index.d.ts.map +1 -1
- package/dist/modules/tool-manuals/index.js +4 -2
- package/dist/modules/tool-manuals/index.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts +2 -2
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.d.ts +2 -2
- package/dist/modules/tool-manuals/pending-tools.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.d.ts +5 -6
- package/dist/modules/tool-manuals/tool-delete.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +19 -6
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts +12 -6
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.js +43 -6
- package/dist/modules/tool-manuals/tool-manuals.routes.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +16 -9
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +23 -15
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +3 -3
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +26 -12
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/tool-registry/description-length.js +2 -2
- package/dist/modules/tool-registry/description-length.js.map +1 -1
- package/dist/modules/tool-registry/index.d.ts +8 -0
- package/dist/modules/tool-registry/index.d.ts.map +1 -0
- package/dist/modules/tool-registry/index.js +8 -0
- package/dist/modules/tool-registry/index.js.map +1 -0
- package/dist/modules/tool-registry/manual.routes.d.ts +44 -2
- package/dist/modules/tool-registry/manual.routes.d.ts.map +1 -1
- package/dist/modules/tool-registry/manual.routes.js +38 -11
- package/dist/modules/tool-registry/manual.routes.js.map +1 -1
- package/dist/modules/tool-registry/read-only-hints.contract.d.ts +52 -0
- package/dist/modules/tool-registry/read-only-hints.contract.d.ts.map +1 -0
- package/dist/modules/tool-registry/read-only-hints.contract.js +2 -0
- package/dist/modules/tool-registry/read-only-hints.contract.js.map +1 -0
- package/dist/modules/tool-registry/read-only-hints.d.ts +89 -0
- package/dist/modules/tool-registry/read-only-hints.d.ts.map +1 -0
- package/dist/modules/tool-registry/read-only-hints.js +212 -0
- package/dist/modules/tool-registry/read-only-hints.js.map +1 -0
- package/dist/modules/tool-registry/tool.contract.d.ts +15 -0
- package/dist/modules/tool-registry/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-registry/tool.contract.js +10 -1
- package/dist/modules/tool-registry/tool.contract.js.map +1 -1
- package/dist/modules/update-check/update-check.routes.d.ts +2 -2
- package/dist/modules/update-check/update-check.routes.d.ts.map +1 -1
- package/dist/modules/update-check/update-check.routes.js +1 -1
- package/dist/modules/update-check/update-check.routes.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts +9 -104
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js +8 -118
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts +16 -17
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js +19 -86
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +5 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js +10 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +7 -5
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +60 -77
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/change-request-hooks.d.ts +1 -1
- package/dist/modules/workflow/event-bus.d.ts.map +1 -1
- package/dist/modules/workflow/event-bus.js +3 -1
- package/dist/modules/workflow/event-bus.js.map +1 -1
- package/dist/modules/workflow/events-delivery.d.ts +120 -0
- package/dist/modules/workflow/events-delivery.d.ts.map +1 -0
- package/dist/modules/workflow/events-delivery.js +202 -0
- package/dist/modules/workflow/events-delivery.js.map +1 -0
- package/dist/modules/workflow/events.routes.d.ts +16 -7
- package/dist/modules/workflow/events.routes.d.ts.map +1 -1
- package/dist/modules/workflow/events.routes.js +23 -4
- package/dist/modules/workflow/events.routes.js.map +1 -1
- package/dist/modules/workflow/file-lock.service.d.ts +1 -1
- package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
- package/dist/modules/workflow/file-lock.service.js +1 -1
- package/dist/modules/workflow/file-lock.service.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +4 -4
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +23 -41
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.js +1 -1
- package/dist/modules/workflow/git/node-git-runner.js.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts +6 -7
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +40 -33
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
- package/dist/modules/workflow/index.d.ts +14 -2
- package/dist/modules/workflow/index.d.ts.map +1 -1
- package/dist/modules/workflow/index.js +11 -2
- package/dist/modules/workflow/index.js.map +1 -1
- package/dist/modules/workflow/pending-commits.service.d.ts +1 -1
- package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
- package/dist/modules/workflow/pending-commits.service.js +1 -1
- package/dist/modules/workflow/pending-commits.service.js.map +1 -1
- package/dist/modules/workflow/read-on-branch.d.ts +1 -1
- package/dist/modules/workflow/read-on-branch.d.ts.map +1 -1
- package/dist/modules/workflow/recovery-bot.d.ts +1 -1
- package/dist/modules/workflow/recovery-bot.d.ts.map +1 -1
- package/dist/modules/workflow/recovery-bot.js +1 -1
- package/dist/modules/workflow/recovery-bot.js.map +1 -1
- package/dist/modules/workflow/review-workflow/approval-lock.d.ts +1 -1
- package/dist/modules/workflow/review-workflow/approval-lock.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts +4 -20
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts +4 -8
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +3 -138
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
- package/dist/modules/workflow/workflow.routes.d.ts +5 -5
- package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.routes.js +42 -94
- package/dist/modules/workflow/workflow.routes.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +41 -50
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +221 -154
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/agent-access.gate.d.ts +3 -3
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -1
- package/dist/modules/workspace/agent-download.builder.d.ts +1 -1
- package/dist/modules/workspace/agent-download.builder.d.ts.map +1 -1
- package/dist/modules/workspace/agent-download.builder.js +1 -1
- package/dist/modules/workspace/agent-download.builder.js.map +1 -1
- package/dist/modules/workspace/agent-upload.routes.d.ts.map +1 -1
- package/dist/modules/workspace/agent-upload.routes.js +19 -0
- package/dist/modules/workspace/agent-upload.routes.js.map +1 -1
- package/dist/modules/workspace/agent-upload.store.d.ts +11 -0
- package/dist/modules/workspace/agent-upload.store.d.ts.map +1 -1
- package/dist/modules/workspace/agent-upload.store.js +18 -0
- package/dist/modules/workspace/agent-upload.store.js.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.service.d.ts +82 -14
- package/dist/modules/workspace/file-readers/doc-extract.service.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.service.js +109 -36
- package/dist/modules/workspace/file-readers/doc-extract.service.js.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.types.d.ts +9 -2
- package/dist/modules/workspace/file-readers/doc-extract.types.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.types.js.map +1 -1
- package/dist/modules/workspace/file-readers/document-extractor.contract.d.ts +41 -0
- package/dist/modules/workspace/file-readers/document-extractor.contract.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/document-extractor.contract.js +5 -0
- package/dist/modules/workspace/file-readers/document-extractor.contract.js.map +1 -0
- package/dist/modules/workspace/file-readers/document-extractors.d.ts +9 -0
- package/dist/modules/workspace/file-readers/document-extractors.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/document-extractors.js +26 -0
- package/dist/modules/workspace/file-readers/document-extractors.js.map +1 -0
- package/dist/modules/workspace/file-readers/document-formats.d.ts +12 -0
- package/dist/modules/workspace/file-readers/document-formats.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/document-formats.js +11 -0
- package/dist/modules/workspace/file-readers/document-formats.js.map +1 -0
- package/dist/modules/workspace/file-readers/document-reader.d.ts +21 -17
- package/dist/modules/workspace/file-readers/document-reader.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/document-reader.js +38 -34
- package/dist/modules/workspace/file-readers/document-reader.js.map +1 -1
- package/dist/modules/workspace/file-readers/extract-in-worker.d.ts +60 -0
- package/dist/modules/workspace/file-readers/extract-in-worker.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/extract-in-worker.js +140 -0
- package/dist/modules/workspace/file-readers/extract-in-worker.js.map +1 -0
- package/dist/modules/workspace/file-readers/extract-pdf.d.ts +2 -0
- package/dist/modules/workspace/file-readers/extract-pdf.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/extract-pdf.js +20 -3
- package/dist/modules/workspace/file-readers/extract-pdf.js.map +1 -1
- package/dist/modules/workspace/file-readers/extract.worker.d.ts +2 -0
- package/dist/modules/workspace/file-readers/extract.worker.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/extract.worker.js +5 -0
- package/dist/modules/workspace/file-readers/extract.worker.js.map +1 -0
- package/dist/modules/workspace/file-readers/extraction-cache.d.ts +21 -5
- package/dist/modules/workspace/file-readers/extraction-cache.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/extraction-cache.js +24 -10
- package/dist/modules/workspace/file-readers/extraction-cache.js.map +1 -1
- package/dist/modules/workspace/file-readers/extraction-worker.d.ts +42 -0
- package/dist/modules/workspace/file-readers/extraction-worker.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/extraction-worker.js +69 -0
- package/dist/modules/workspace/file-readers/extraction-worker.js.map +1 -0
- package/dist/modules/workspace/file-readers/file-reader.d.ts +13 -4
- package/dist/modules/workspace/file-readers/file-reader.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/file-reader.js.map +1 -1
- package/dist/modules/workspace/file-readers/file-reader.registry.d.ts +3 -2
- package/dist/modules/workspace/file-readers/file-reader.registry.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/file-reader.registry.js +6 -20
- package/dist/modules/workspace/file-readers/file-reader.registry.js.map +1 -1
- package/dist/modules/workspace/first-run.js +1 -1
- package/dist/modules/workspace/first-run.js.map +1 -1
- package/dist/modules/workspace/git-internals.middleware.d.ts +1 -1
- package/dist/modules/workspace/git-internals.middleware.d.ts.map +1 -1
- package/dist/modules/workspace/git-internals.middleware.js +1 -1
- package/dist/modules/workspace/git-internals.middleware.js.map +1 -1
- package/dist/modules/workspace/index.d.ts +24 -0
- package/dist/modules/workspace/index.d.ts.map +1 -1
- package/dist/modules/workspace/index.js +21 -0
- package/dist/modules/workspace/index.js.map +1 -1
- package/dist/modules/workspace/kb-repository.d.ts.map +1 -1
- package/dist/modules/workspace/kb-repository.js +1 -1
- package/dist/modules/workspace/kb-repository.js.map +1 -1
- package/dist/modules/workspace/not-found.d.ts +1 -1
- package/dist/modules/workspace/not-found.d.ts.map +1 -1
- package/dist/modules/workspace/not-found.js +1 -1
- package/dist/modules/workspace/not-found.js.map +1 -1
- package/dist/modules/workspace/nul-scan.d.ts +19 -0
- package/dist/modules/workspace/nul-scan.d.ts.map +1 -0
- package/dist/modules/workspace/nul-scan.js +55 -0
- package/dist/modules/workspace/nul-scan.js.map +1 -0
- package/dist/modules/workspace/pattern-matcher.contract.d.ts +111 -28
- package/dist/modules/workspace/pattern-matcher.contract.d.ts.map +1 -1
- package/dist/modules/workspace/pattern-matcher.contract.js +31 -14
- package/dist/modules/workspace/pattern-matcher.contract.js.map +1 -1
- package/dist/modules/workspace/ripgrep-search.d.ts +54 -0
- package/dist/modules/workspace/ripgrep-search.d.ts.map +1 -0
- package/dist/modules/workspace/ripgrep-search.js +657 -0
- package/dist/modules/workspace/ripgrep-search.js.map +1 -0
- package/dist/modules/workspace/ripgrep-version.d.ts +15 -0
- package/dist/modules/workspace/ripgrep-version.d.ts.map +1 -0
- package/dist/modules/workspace/ripgrep-version.js +31 -0
- package/dist/modules/workspace/ripgrep-version.js.map +1 -0
- package/dist/modules/workspace/routine-write-policy.js +1 -1
- package/dist/modules/workspace/routine-write-policy.js.map +1 -1
- package/dist/modules/workspace/startup/beside-checkout.d.ts +8 -5
- package/dist/modules/workspace/startup/beside-checkout.d.ts.map +1 -1
- package/dist/modules/workspace/startup/beside-checkout.js +14 -5
- package/dist/modules/workspace/startup/beside-checkout.js.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/kb-startup-runner.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js +1 -2
- package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js +2 -2
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/personal-spaces.step.js +2 -2
- package/dist/modules/workspace/startup/steps/personal-spaces.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-layout.js +1 -1
- package/dist/modules/workspace/startup/steps/plugin-layout.js.map +1 -1
- package/dist/modules/workspace/startup/steps/roles-yaml.step.js +1 -1
- package/dist/modules/workspace/startup/steps/roles-yaml.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +2 -2
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts +1 -1
- 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.js +2 -2
- package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
- package/dist/modules/workspace/worker-pool.d.ts +99 -0
- package/dist/modules/workspace/worker-pool.d.ts.map +1 -0
- package/dist/modules/workspace/worker-pool.js +156 -0
- package/dist/modules/workspace/worker-pool.js.map +1 -0
- package/dist/modules/workspace/workspace-tmp.d.ts +146 -0
- package/dist/modules/workspace/workspace-tmp.d.ts.map +1 -0
- package/dist/modules/workspace/workspace-tmp.js +435 -0
- package/dist/modules/workspace/workspace-tmp.js.map +1 -0
- package/dist/modules/workspace/workspace.routes.d.ts +7 -8
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +9 -32
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +48 -7
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +89 -12
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +7 -7
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +502 -140
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/modules/workspace/write-denial.d.ts +4 -4
- package/dist/modules/workspace/write-denial.d.ts.map +1 -1
- package/dist/modules/workspace/write-denial.js +2 -3
- package/dist/modules/workspace/write-denial.js.map +1 -1
- package/dist/modules/write-access/index.d.ts +8 -0
- package/dist/modules/write-access/index.d.ts.map +1 -0
- package/dist/modules/write-access/index.js +7 -0
- package/dist/modules/write-access/index.js.map +1 -0
- package/dist/shared/path-order.d.ts +28 -8
- package/dist/shared/path-order.d.ts.map +1 -1
- package/dist/shared/path-order.js +37 -8
- package/dist/shared/path-order.js.map +1 -1
- package/migrations/0020_change_request_body_is_the_description.sql +20 -0
- package/migrations/0021_data_migrations_ledger.sql +11 -0
- package/migrations/0022_session_version.sql +6 -0
- package/migrations/0023_agent_path.sql +3 -0
- package/migrations/meta/0020_snapshot.json +2321 -0
- package/migrations/meta/0021_snapshot.json +2353 -0
- package/migrations/meta/0022_snapshot.json +2360 -0
- package/migrations/meta/0023_snapshot.json +2378 -0
- package/migrations/meta/_journal.json +28 -0
- package/package.json +3 -3
- package/src/__tests__/pg-scratch.test.ts +69 -0
- package/src/__tests__/pg-scratch.ts +31 -0
- package/src/__tests__/slow-ripgrep.ts +65 -0
- package/src/core/__tests__/boot-without-ripgrep.test.ts +34 -0
- package/src/core/__tests__/catalog-revision.test.ts +89 -0
- package/src/core/__tests__/damaged-document.tools.test.ts +374 -0
- package/src/core/__tests__/gated-boot.test.ts +8 -1
- package/src/core/__tests__/lifecycle.test.ts +46 -13
- package/src/core/__tests__/public-config.test.ts +5 -0
- package/src/core/catalog-revision.ts +24 -2
- package/src/core/core-ports.ts +42 -0
- package/src/core/create-core-server.ts +45 -3
- package/src/core/create-core-services.ts +81 -17
- package/src/core/lifecycle.ts +36 -2
- package/src/core/public-config.ts +10 -0
- package/src/index.ts +1 -1
- package/src/modules/access/__tests__/access-control.admin-root-floor.test.ts +12 -0
- package/src/modules/access/__tests__/access-control.colliding-name-cases.test.ts +113 -0
- package/src/modules/access/__tests__/access-control.frontmatter-head.test.ts +117 -0
- package/src/modules/access/__tests__/access-control.group-named-admin.test.ts +122 -0
- package/src/modules/access/__tests__/access-control.preview-relocation.test.ts +50 -0
- package/src/modules/access/__tests__/access-declarations.test.ts +19 -0
- package/src/modules/access/__tests__/access-groups.test.ts +55 -22
- package/src/modules/access/__tests__/access-mutation.service.test.ts +85 -59
- package/src/modules/access/__tests__/access-requests.routes.test.ts +29 -15
- package/src/modules/access/__tests__/access-restrict-here.test.ts +7 -5
- package/src/modules/access/__tests__/access.routes.admins.test.ts +1 -0
- package/src/modules/access/__tests__/access.routes.batch.test.ts +2 -0
- package/src/modules/access/__tests__/access.routes.folder-governs.test.ts +2 -0
- package/src/modules/access/__tests__/access.routes.group-grant.test.ts +50 -14
- package/src/modules/access/__tests__/access.routes.overrides.test.ts +2 -1
- package/src/modules/access/__tests__/access.routes.proposal-branch.test.ts +1 -0
- package/src/modules/access/__tests__/access.routes.prospective.test.ts +2 -0
- package/src/modules/access/__tests__/access.routes.revoke.test.ts +18 -13
- package/src/modules/access/__tests__/access.routes.unknown-email.test.ts +2 -0
- package/src/modules/access/__tests__/grant-sources.test.ts +20 -15
- package/src/modules/access/__tests__/groups-admin.routes.test.ts +61 -0
- package/src/modules/access/__tests__/groups-admin.service.test.ts +211 -18
- package/src/modules/access/__tests__/reference-scan.test.ts +366 -14
- package/src/modules/access/__tests__/roles-admin.security.test.ts +1 -1
- package/src/modules/access/__tests__/roles-admin.service.test.ts +43 -22
- package/src/modules/access/__tests__/roles-capabilities.test.ts +6 -2
- package/src/modules/access/__tests__/roles.routes.test.ts +1 -1
- package/src/modules/access/access-control.interface.ts +17 -10
- package/src/modules/access/access-control.service.ts +161 -76
- package/src/modules/access/access-declarations.ts +1 -1
- package/src/modules/access/access-mutation.service.ts +58 -57
- package/src/modules/access/access-requests.contract.ts +1 -1
- package/src/modules/access/access-requests.routes.ts +10 -15
- package/src/modules/access/access-requests.service.ts +29 -71
- package/src/modules/access/access-view.ts +13 -11
- package/src/modules/access/access.routes.ts +51 -43
- package/src/modules/access/admin-locked-commit.ts +3 -2
- package/src/modules/access/capability-registry.ts +1 -1
- package/src/modules/access/change-read-gate.ts +3 -5
- package/src/modules/access/creator-access.ts +3 -5
- package/src/modules/access/directory-sync-bot.ts +2 -2
- package/src/modules/access/groups-admin.routes.ts +7 -5
- package/src/modules/access/groups-admin.service.ts +116 -47
- package/src/modules/access/groups-edit.ts +3 -3
- package/src/modules/access/index.ts +17 -0
- package/src/modules/access/reference-scan.ts +320 -47
- package/src/modules/access/roles-admin.service.ts +45 -31
- package/src/modules/access/roles-edit.ts +1 -1
- package/src/modules/access/synced-groups-committer.ts +4 -4
- package/src/modules/access/synced-groups-writer.ts +3 -3
- package/src/modules/access/user-access-removal.service.ts +3 -6
- package/src/modules/access-model/__tests__/access-grammar.test.ts +38 -1
- package/src/modules/access-model/__tests__/access-splice.test.ts +50 -8
- package/src/modules/access-model/access-grammar.ts +65 -20
- package/src/modules/access-model/access-splice.ts +31 -23
- package/src/modules/access-model/group-files.ts +5 -0
- package/src/modules/access-model/index.ts +21 -5
- package/src/modules/access-model/roles-yaml-guard.ts +1 -1
- package/src/modules/admin/admin-access.routes.ts +1 -1
- package/src/modules/admin/admin-access.service.ts +2 -2
- package/src/modules/admin/index.ts +7 -0
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +36 -0
- package/src/modules/agent-guide/agent-guide.tools.ts +17 -8
- package/src/modules/agent-guide/agent-guide.ts +1 -1
- package/src/modules/agent-guide/index.ts +1 -1
- package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +1 -0
- package/src/modules/agent-instructions/compose.ts +3 -1
- package/src/modules/agent-instructions/read-preamble.ts +1 -1
- package/src/modules/agent-instructions/shared-file-rules.ts +17 -1
- package/src/modules/agent-scope/__tests__/agent-surfaces.connect-as.test.ts +421 -0
- package/src/modules/agent-scope/__tests__/connection-scope.test.ts +46 -0
- package/src/modules/agent-scope/__tests__/in-memory-kb.ts +148 -0
- package/src/modules/agent-scope/agent-scope.contract.ts +83 -0
- package/src/modules/agent-scope/connection-scope.ts +199 -0
- package/src/modules/agent-scope/index.ts +15 -0
- package/src/modules/audit/agent-audit.service.ts +5 -3
- package/src/modules/audit/agent-connection.routes.ts +1 -1
- package/src/modules/audit/agent-rest-audit.middleware.ts +1 -1
- package/src/modules/audit/audit.contract.ts +6 -0
- package/src/modules/audit/audit.routes.ts +4 -4
- package/src/modules/auth/__tests__/auth.middleware.test.ts +30 -2
- package/src/modules/auth/__tests__/auth.routes.test.ts +71 -5
- package/src/modules/auth/__tests__/auth.service.test.ts +90 -9
- package/src/modules/auth/__tests__/password-change-sessions.pg.test.ts +269 -0
- package/src/modules/auth/account-admission.ts +19 -0
- package/src/modules/auth/account-erasure.service.ts +4 -9
- package/src/modules/auth/account-switch-lock.ts +2 -2
- package/src/modules/auth/account.routes.ts +3 -3
- package/src/modules/auth/auth.middleware.ts +45 -4
- package/src/modules/auth/auth.routes.ts +46 -29
- package/src/modules/auth/auth.service.ts +139 -38
- package/src/modules/auth/index.ts +5 -0
- package/src/modules/auth/oidc-auth-provider.ts +3 -10
- package/src/modules/code-mode/code-mode.tool.ts +1 -1
- package/src/modules/connection-probe/connection-probe.service.ts +3 -6
- package/src/modules/database/__tests__/legacy-change-request-body.test.ts +118 -0
- package/src/modules/database/__tests__/legacy-request-bodies.pg.test.ts +258 -0
- package/src/modules/database/__tests__/pii-backfill.pg.test.ts +15 -18
- package/src/modules/database/__tests__/session-version-migration.pg.test.ts +133 -0
- package/src/modules/database/core-schema.ts +76 -36
- package/src/modules/database/index.ts +9 -0
- package/src/modules/database/migrate.ts +79 -3
- package/src/modules/declared-variables/__tests__/declared-variables.route.test.ts +44 -1
- package/src/modules/declared-variables/declared-variables.routes.ts +14 -3
- package/src/modules/diff/diff.routes.ts +5 -5
- package/src/modules/diff/diff.service.ts +2 -2
- package/src/modules/diff/index.ts +6 -0
- package/src/modules/embed/__tests__/embed.tools.test.ts +12 -0
- package/src/modules/embed/account-link.service.ts +2 -2
- package/src/modules/embed/embed.routes.ts +2 -2
- package/src/modules/embed/embed.service.ts +1 -1
- package/src/modules/embed/embed.tools.ts +11 -9
- package/src/modules/github-app/github-app.connection.ts +1 -1
- package/src/modules/github-app/github-app.routes.ts +3 -3
- package/src/modules/kb-fs/__tests__/locking-filesystem.test.ts +25 -0
- package/src/modules/kb-fs/__tests__/repo-path.test.ts +53 -8
- package/src/modules/kb-fs/index.ts +13 -0
- package/src/modules/kb-fs/locking-filesystem.ts +8 -2
- package/src/modules/kb-fs/repo-path.ts +33 -7
- package/src/modules/kb-fs/tmp-ref.ts +81 -0
- package/src/modules/kb-sync/kb-sync.routes.ts +3 -3
- package/src/modules/kb-sync/kb-sync.service.ts +1 -1
- package/src/modules/kb-sync/sync-auth.ts +1 -1
- package/src/modules/kb-sync/sync-payload.ts +1 -1
- package/src/modules/marketplace/git-http.routes.ts +1 -1
- package/src/modules/marketplace/github-facade/github-facade-admin.routes.ts +1 -1
- package/src/modules/marketplace/github-facade/github-facade-codes.store.ts +2 -2
- package/src/modules/marketplace/github-facade/github-facade-credentials.service.ts +2 -2
- package/src/modules/marketplace/github-facade/github-facade.routes.ts +2 -2
- package/src/modules/marketplace/github-facade/github-facade.service.ts +2 -2
- package/src/modules/marketplace/marketplace-repo.service.ts +2 -2
- package/src/modules/mcp/__tests__/connect-as.pg.test.ts +137 -0
- package/src/modules/mcp/__tests__/mcp-auth.middleware.test.ts +29 -5
- package/src/modules/mcp/__tests__/mcp-routes-harness.ts +8 -0
- package/src/modules/mcp/__tests__/mcp.connect-as.test.ts +195 -0
- package/src/modules/mcp/__tests__/mcp.routes.connect-as.test.ts +192 -0
- package/src/modules/mcp/__tests__/oauth-consent.connect-as.test.ts +146 -0
- package/src/modules/mcp/__tests__/read-only-hint.e2e.test.ts +213 -0
- package/src/modules/mcp/index.ts +7 -0
- package/src/modules/mcp/mcp-auth.middleware.ts +25 -9
- package/src/modules/mcp/mcp.routes.ts +42 -8
- package/src/modules/mcp/mcp.service.ts +136 -29
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +48 -10
- package/src/modules/mcp/oauth/oauth-consent.routes.ts +42 -2
- package/src/modules/onboarding/onboarding.routes.ts +1 -1
- package/src/modules/onboarding/starter-pack.service.ts +5 -6
- package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +2 -1
- package/src/modules/plugins/__tests__/plugin-links.service.test.ts +2 -1
- package/src/modules/plugins/__tests__/plugins.tools.test.ts +38 -2
- package/src/modules/plugins/compile/compile-marketplace.ts +2 -2
- package/src/modules/plugins/compile/marketplace-compiler.service.ts +3 -3
- package/src/modules/plugins/discovery/bundle-dialect/registry.ts +1 -1
- package/src/modules/plugins/index.ts +3 -1
- package/src/modules/plugins/join-proposals.ts +2 -2
- package/src/modules/plugins/join-request-jobs.service.ts +3 -3
- package/src/modules/plugins/join-request-records.store.ts +2 -2
- package/src/modules/plugins/join-requests.service.ts +4 -4
- package/src/modules/plugins/plugin-links.service.ts +10 -11
- package/src/modules/plugins/plugin-links.ts +23 -6
- package/src/modules/plugins/plugin-provision.service.ts +4 -5
- package/src/modules/plugins/plugin-rename.service.ts +3 -3
- package/src/modules/plugins/plugins.contract.ts +1 -1
- package/src/modules/plugins/plugins.routes.ts +39 -8
- package/src/modules/plugins/plugins.service.ts +5 -5
- package/src/modules/plugins/plugins.tools.ts +4 -4
- package/src/modules/plugins/teams.routes.ts +3 -3
- package/src/modules/secrets-vault/__tests__/connect-pending.route.test.ts +113 -0
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +2 -2
- package/src/modules/secrets-vault/index.ts +2 -0
- package/src/modules/secrets-vault/secrets-vault.routes.ts +27 -7
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +88 -1
- package/src/modules/settings/connection-check.ts +1 -1
- package/src/modules/settings/deployment-settings.service.ts +44 -4
- package/src/modules/settings/git-root-folders.ts +1 -1
- package/src/modules/settings/index.ts +12 -0
- package/src/modules/settings/setup.routes.ts +5 -4
- package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +2 -2
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +6 -3
- package/src/modules/skills/__tests__/skills.service.test.ts +34 -0
- package/src/modules/skills/allowed-tools-check.ts +2 -6
- package/src/modules/skills/index.ts +9 -2
- package/src/modules/skills/pending-skills.service.ts +3 -4
- package/src/modules/skills/skill-access-requests.routes.ts +10 -17
- package/src/modules/skills/skills.contract.ts +17 -0
- package/src/modules/skills/skills.routes.ts +1 -1
- package/src/modules/skills/skills.service.ts +7 -3
- package/src/modules/skills/skills.tools.ts +49 -22
- package/src/modules/tool-auth/__tests__/external-api-key.service.test.ts +4 -0
- package/src/modules/tool-auth/connection-key-rejection.ts +1 -1
- package/src/modules/tool-auth/connection-keys-admin.routes.ts +2 -2
- package/src/modules/tool-auth/external-api-key.interface.ts +11 -1
- package/src/modules/tool-auth/external-api-key.service.ts +7 -4
- package/src/modules/tool-auth/index.ts +14 -0
- package/src/modules/tool-auth/internal-token.service.ts +10 -0
- package/src/modules/tool-auth/tool-auth.middleware.ts +48 -6
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +2 -2
- package/src/modules/tool-helpers/__tests__/can-write.tools.test.ts +5 -3
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +2 -2
- package/src/modules/tool-helpers/default-branch-write.ts +1 -1
- package/src/modules/tool-helpers/index.ts +5 -1
- package/src/modules/tool-helpers/route-argument-check.ts +1 -1
- package/src/modules/tool-helpers/route-tool-schemas.ts +1 -1
- package/src/modules/tool-helpers/tool-context.ts +18 -10
- package/src/modules/tool-helpers/tool-def.ts +7 -3
- package/src/modules/tool-helpers/tool-handler.ts +36 -2
- package/src/modules/tool-helpers/tool.contract.ts +12 -2
- package/src/modules/tool-helpers/validate-token.ts +5 -4
- package/src/modules/tool-manuals/__tests__/tool-manuals.archive.route.test.ts +80 -4
- package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +42 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +3 -3
- package/src/modules/tool-manuals/index.ts +12 -2
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +2 -2
- package/src/modules/tool-manuals/pending-tools.service.ts +2 -2
- package/src/modules/tool-manuals/tool-delete.service.ts +5 -6
- package/src/modules/tool-manuals/tool-manuals.contract.ts +18 -6
- package/src/modules/tool-manuals/tool-manuals.routes.ts +45 -8
- package/src/modules/tool-manuals/tool-manuals.service.ts +34 -18
- package/src/modules/tool-manuals/tool-manuals.tools.ts +32 -17
- package/src/modules/tool-registry/__tests__/read-only-hints.test.ts +439 -0
- package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +2 -2
- package/src/modules/tool-registry/__tests__/tool-registry.test.ts +9 -2
- package/src/modules/tool-registry/description-length.ts +2 -2
- package/src/modules/tool-registry/index.ts +22 -0
- package/src/modules/tool-registry/manual.routes.ts +38 -11
- package/src/modules/tool-registry/read-only-hints.contract.ts +54 -0
- package/src/modules/tool-registry/read-only-hints.ts +225 -0
- package/src/modules/tool-registry/tool.contract.ts +18 -0
- package/src/modules/update-check/update-check.routes.ts +2 -2
- package/src/modules/workflow/__tests__/event-bus.test.ts +14 -2
- package/src/modules/workflow/__tests__/events-delivery.test.ts +778 -0
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +85 -22
- package/src/modules/workflow/__tests__/workflow.service.sync.test.ts +1 -1
- package/src/modules/workflow/__tests__/workflow.service.update-change-request.pg.test.ts +120 -0
- package/src/modules/workflow/__tests__/workflow.service.update-change-request.test.ts +346 -0
- package/src/modules/workflow/agent-tools/__tests__/change-request-read-shape.test.ts +32 -209
- package/src/modules/workflow/agent-tools/__tests__/change-request-read.tools.test.ts +16 -245
- package/src/modules/workflow/agent-tools/__tests__/update-change-request.parity.test.ts +306 -0
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +87 -60
- package/src/modules/workflow/agent-tools/change-request-read-shape.ts +18 -153
- package/src/modules/workflow/agent-tools/change-request-read.tools.ts +24 -96
- package/src/modules/workflow/agent-tools/change-request-summary.ts +16 -2
- package/src/modules/workflow/agent-tools/workflow.tools.ts +63 -84
- package/src/modules/workflow/change-request-hooks.ts +1 -1
- package/src/modules/workflow/event-bus.ts +3 -1
- package/src/modules/workflow/events-delivery.ts +278 -0
- package/src/modules/workflow/events.routes.ts +30 -9
- package/src/modules/workflow/file-lock.service.ts +2 -2
- package/src/modules/workflow/git/__tests__/git.service.list-branches.test.ts +130 -3
- package/src/modules/workflow/git/__tests__/pull-request.service.getPrDetail.test.ts +24 -9
- package/src/modules/workflow/git/git.service.ts +34 -56
- package/src/modules/workflow/git/node-git-runner.ts +1 -1
- package/src/modules/workflow/git/pull-request.service.ts +34 -29
- package/src/modules/workflow/index.ts +15 -2
- package/src/modules/workflow/pending-commits.service.ts +2 -2
- package/src/modules/workflow/read-on-branch.ts +1 -1
- package/src/modules/workflow/recovery-bot.ts +2 -2
- package/src/modules/workflow/review-workflow/approval-lock.ts +1 -1
- package/src/modules/workflow/review-workflow/review-workflow.interface.ts +3 -35
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +6 -165
- package/src/modules/workflow/workflow.routes.ts +46 -100
- package/src/modules/workflow/workflow.service.ts +277 -191
- package/src/modules/workspace/__tests__/agent-downloads.test.ts +2 -1
- package/src/modules/workspace/__tests__/agent-uploads.test.ts +87 -1
- package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +2 -1
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +2 -1
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +4 -3
- package/src/modules/workspace/__tests__/holds-nul.test.ts +66 -0
- package/src/modules/workspace/__tests__/rest-tool-arguments.test.ts +5 -4
- package/src/modules/workspace/__tests__/ripgrep-search.test.ts +570 -0
- package/src/modules/workspace/__tests__/ripgrep-version.test.ts +29 -0
- package/src/modules/workspace/__tests__/worker-pool.test.ts +118 -0
- package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +3 -2
- package/src/modules/workspace/__tests__/workspace-tmp.tools.test.ts +928 -0
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +17 -37
- package/src/modules/workspace/__tests__/workspace.service.ensure-remotes-fetched.test.ts +30 -0
- package/src/modules/workspace/__tests__/workspace.service.read-filter.test.ts +20 -8
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +4 -3
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +24 -11
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +423 -117
- package/src/modules/workspace/agent-access.gate.ts +3 -3
- package/src/modules/workspace/agent-download.builder.ts +1 -1
- package/src/modules/workspace/agent-upload.routes.ts +19 -0
- package/src/modules/workspace/agent-upload.store.ts +18 -0
- package/src/modules/workspace/file-readers/README.md +9 -0
- package/src/modules/workspace/file-readers/__tests__/doc-extract.service.test.ts +175 -0
- package/src/modules/workspace/file-readers/__tests__/doc-extract.test.ts +21 -16
- package/src/modules/workspace/file-readers/__tests__/extract-in-worker.test.ts +229 -0
- package/src/modules/workspace/file-readers/__tests__/file-reader.registry.test.ts +2 -1
- package/src/modules/workspace/file-readers/__tests__/fixtures/damaged-pdf.ts +34 -0
- package/src/modules/workspace/file-readers/__tests__/fixtures/misbehaving-extract.worker.ts +57 -0
- package/src/modules/workspace/file-readers/__tests__/fixtures/pdf-in-trouble.worker.ts +20 -0
- package/src/modules/workspace/file-readers/__tests__/fixtures/unloadable-extract.worker.ts +2 -0
- package/src/modules/workspace/file-readers/doc-extract.service.ts +144 -36
- package/src/modules/workspace/file-readers/doc-extract.types.ts +13 -3
- package/src/modules/workspace/file-readers/document-extractor.contract.ts +42 -0
- package/src/modules/workspace/file-readers/document-extractors.ts +28 -0
- package/src/modules/workspace/file-readers/document-formats.ts +13 -0
- package/src/modules/workspace/file-readers/document-reader.ts +40 -36
- package/src/modules/workspace/file-readers/extract-in-worker.ts +183 -0
- package/src/modules/workspace/file-readers/extract-pdf.ts +23 -4
- package/src/modules/workspace/file-readers/extract.worker.ts +5 -0
- package/src/modules/workspace/file-readers/extraction-cache.ts +33 -12
- package/src/modules/workspace/file-readers/extraction-worker.ts +86 -0
- package/src/modules/workspace/file-readers/file-reader.registry.ts +6 -20
- package/src/modules/workspace/file-readers/file-reader.ts +14 -4
- package/src/modules/workspace/first-run.ts +1 -1
- package/src/modules/workspace/git-internals.middleware.ts +1 -1
- package/src/modules/workspace/index.ts +37 -0
- package/src/modules/workspace/kb-repository.ts +3 -2
- package/src/modules/workspace/not-found.ts +1 -1
- package/src/modules/workspace/nul-scan.ts +50 -0
- package/src/modules/workspace/pattern-matcher.contract.ts +124 -33
- package/src/modules/workspace/ripgrep-search.ts +715 -0
- package/src/modules/workspace/ripgrep-version.ts +35 -0
- package/src/modules/workspace/routine-write-policy.ts +1 -1
- package/src/modules/workspace/startup/__tests__/beside-checkout.test.ts +11 -0
- package/src/modules/workspace/startup/beside-checkout.ts +13 -5
- package/src/modules/workspace/startup/kb-git.ts +1 -1
- package/src/modules/workspace/startup/kb-startup-runner.ts +1 -2
- package/src/modules/workspace/startup/steps/groups-to-plugins.step.ts +3 -3
- package/src/modules/workspace/startup/steps/personal-spaces.step.ts +2 -2
- package/src/modules/workspace/startup/steps/plugin-layout.ts +1 -1
- package/src/modules/workspace/startup/steps/roles-yaml.step.ts +1 -1
- package/src/modules/workspace/startup/steps/seed-tree.ts +2 -2
- package/src/modules/workspace/startup/steps/template-files.step.ts +2 -2
- package/src/modules/workspace/startup/steps/template-source.ts +2 -2
- package/src/modules/workspace/worker-pool.ts +192 -0
- package/src/modules/workspace/workspace-tmp.ts +457 -0
- package/src/modules/workspace/workspace.routes.ts +15 -39
- package/src/modules/workspace/workspace.service.ts +96 -22
- package/src/modules/workspace/workspace.tools.ts +550 -186
- package/src/modules/workspace/write-denial.ts +4 -5
- package/src/modules/write-access/index.ts +7 -0
- package/src/shared/__tests__/module-boundaries.lint.test.ts +301 -0
- package/src/shared/path-order.ts +37 -8
- package/starter-packs/engineering/Plugins/engineering-starter/access.md +1 -1
- package/starter-packs/general/Plugins/general-starter/access.md +1 -1
- package/starter-packs/operations/Plugins/operations-starter/access.md +1 -1
- package/starter-packs/sales/Plugins/sales-starter/access.md +1 -1
- package/starter-packs/support/Plugins/support-starter/access.md +1 -1
- package/dist/modules/workspace/bounded-matcher.d.ts +0 -79
- package/dist/modules/workspace/bounded-matcher.d.ts.map +0 -1
- package/dist/modules/workspace/bounded-matcher.js +0 -261
- package/dist/modules/workspace/bounded-matcher.js.map +0 -1
- package/src/modules/workflow/__tests__/format-affected-owners.test.ts +0 -85
- package/src/modules/workspace/__tests__/bounded-matcher.test.ts +0 -213
- package/src/modules/workspace/bounded-matcher.ts +0 -328
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import type { Router, RequestHandler } from 'express';
|
|
2
|
-
import type { IToolRegistry, JsonSchema } from '../../tool-registry/
|
|
3
|
-
import { ToolError, hasHttpStatus, type ToolContext, type ToolHandler } from '../../tool-helpers/
|
|
2
|
+
import type { IToolRegistry, JsonSchema } from '../../tool-registry/index.js';
|
|
3
|
+
import { ToolError, hasHttpStatus, type ToolContext, type ToolHandler, toolDef } from '../../tool-helpers/index.js';
|
|
4
4
|
import { isCommitSha } from '../../../shared/git.contract.js';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
5
|
+
import type { ToolHandlerFactory } from '../../tool-helpers/index.js';
|
|
6
|
+
import { requireInternalSource } from '../../tool-auth/index.js';
|
|
7
|
+
import type { IAccessControl } from '../../access/index.js';
|
|
9
8
|
import { assertAgentWriteAllowed, notifyAgentRead, SESSION_ID_INPUT, type AgentAccessGate } from '../../workspace/index.js';
|
|
10
9
|
import { readablePathsAt, readableAtCommits, assertReadableAtCommits } from '../read-on-branch.js';
|
|
11
10
|
import type { KbContext } from '../../../shared/kb-context.js';
|
|
12
11
|
import { workspaceIdForBranch } from '../../../shared/workspace-id.js';
|
|
13
|
-
import { assertInsideRepo, normalizePathArgs } from '../../kb-fs/
|
|
12
|
+
import { assertInsideRepo, normalizePathArgs } from '../../kb-fs/index.js';
|
|
14
13
|
import { RETIRED_TOOL_MESSAGES } from '@bevel-software/platform-mcp-core';
|
|
15
14
|
import {
|
|
16
15
|
CHANGE_REQUEST_INCLUDES,
|
|
@@ -30,18 +29,16 @@ const protectedInline = (kb: Pick<KbContext, 'protectedBranches'>) =>
|
|
|
30
29
|
[...kb.protectedBranches].map((b) => `\`${b}\``).join(' / ');
|
|
31
30
|
|
|
32
31
|
// Output sub-schemas for the git-aliased workflow payloads (Branch, Change,
|
|
33
|
-
//
|
|
32
|
+
// ChangeRequest, …). Defined once and referenced by the individual tool
|
|
34
33
|
// defs below so each tool still declares its own `outputs`.
|
|
35
34
|
const branchSchema: JsonSchema = {
|
|
36
35
|
type: 'object',
|
|
37
36
|
properties: {
|
|
38
37
|
name: { type: 'string' },
|
|
39
38
|
isProtected: { type: 'boolean' },
|
|
40
|
-
ahead: { type: ['integer', 'null'], description: 'Commits ahead of upstream / nearest protected base; null if unresolved.' },
|
|
41
|
-
behind: { type: ['integer', 'null'], description: 'Commits behind; null if unresolved.' },
|
|
42
39
|
hasRemote: { type: 'boolean', description: 'True iff `origin/<name>` exists after the last fetch.' },
|
|
43
40
|
},
|
|
44
|
-
required: ['name', 'isProtected', '
|
|
41
|
+
required: ['name', 'isProtected', 'hasRemote'],
|
|
45
42
|
};
|
|
46
43
|
|
|
47
44
|
const commitSchema: JsonSchema = {
|
|
@@ -75,7 +72,7 @@ const changeRequestApproversSchema: JsonSchema = {
|
|
|
75
72
|
properties: {
|
|
76
73
|
path: { type: 'string' },
|
|
77
74
|
roles: { type: 'array', items: { type: 'string' }, description: 'Roles that confer approval here; `everyone` means any signed-in approver.' },
|
|
78
|
-
users: { type: 'array', items: { type: 'string' }, description: 'Approvers named directly
|
|
75
|
+
users: { type: 'array', items: { type: 'string' }, description: 'Approvers named directly: each by display name, or by email when the access tree resolved no name. Never a blank string.' },
|
|
79
76
|
approved: { type: 'boolean', description: 'True once an eligible approver has approved at the current head.' },
|
|
80
77
|
inMergeGate: { type: 'boolean', description: 'False when the merge gate does not bind this path — then nobody has to approve it.' },
|
|
81
78
|
approversUnknown: { type: 'boolean', description: 'Present when the access tree could not be resolved: empty `roles`/`users` means unknown, not nobody.' },
|
|
@@ -83,22 +80,6 @@ const changeRequestApproversSchema: JsonSchema = {
|
|
|
83
80
|
required: ['path', 'roles', 'users', 'approved', 'inMergeGate'],
|
|
84
81
|
};
|
|
85
82
|
|
|
86
|
-
const commentSchema: JsonSchema = {
|
|
87
|
-
type: 'object',
|
|
88
|
-
properties: {
|
|
89
|
-
id: { type: 'string' },
|
|
90
|
-
author: { type: 'object', properties: { email: { type: 'string' }, name: { type: 'string' } }, required: ['email', 'name'] },
|
|
91
|
-
body: { type: 'string' },
|
|
92
|
-
path: { type: 'string', description: 'Set for file-level / inline comments.' },
|
|
93
|
-
line: { type: 'integer', description: 'Set for inline comments.' },
|
|
94
|
-
headSha: { type: 'string', description: 'Head the comment was anchored to.' },
|
|
95
|
-
parentId: { type: 'string', description: 'Root comment id when this is a reply.' },
|
|
96
|
-
createdAt: { type: 'string', description: 'ISO timestamp.' },
|
|
97
|
-
updatedAt: { type: 'string', description: 'ISO timestamp; present once edited.' },
|
|
98
|
-
},
|
|
99
|
-
required: ['id', 'author', 'body', 'headSha', 'createdAt'],
|
|
100
|
-
};
|
|
101
|
-
|
|
102
83
|
const changeRequestUrlSchema: JsonSchema = {
|
|
103
84
|
type: 'string',
|
|
104
85
|
description:
|
|
@@ -107,13 +88,6 @@ const changeRequestUrlSchema: JsonSchema = {
|
|
|
107
88
|
};
|
|
108
89
|
const changeRequestUrlNoteSchema: JsonSchema = { type: 'string', description: 'Present only when `url` is relative — how to get absolute links.' };
|
|
109
90
|
|
|
110
|
-
/** The link to a change request, for a tool whose payload is not the change request itself. */
|
|
111
|
-
const changeRequestLinkSchema: JsonSchema = {
|
|
112
|
-
type: 'object',
|
|
113
|
-
properties: { number: { type: 'integer' }, url: changeRequestUrlSchema, urlNote: changeRequestUrlNoteSchema },
|
|
114
|
-
required: ['number', 'url'],
|
|
115
|
-
};
|
|
116
|
-
|
|
117
91
|
/** `{ number, url, urlNote? }` of a change request summary or detail. */
|
|
118
92
|
function linkOf(cr: { number: number; url: string; urlNote?: string }): { number: number; url: string; urlNote?: string } {
|
|
119
93
|
return { number: cr.number, url: cr.url, ...(cr.urlNote ? { urlNote: cr.urlNote } : {}) };
|
|
@@ -183,7 +157,9 @@ export function registerWorkflowTools(
|
|
|
183
157
|
/**
|
|
184
158
|
* Whether the caller may see change request `number` — `get_change_request`'s
|
|
185
159
|
* own gate (`changeRequestScope(...).maySee`). `delete_branch` neither names
|
|
186
|
-
* nor links a request it answers no for
|
|
160
|
+
* nor links a request it answers no for, and `update_change_request` answers
|
|
161
|
+
* such a request exactly as `get_change_request` does (404) before reading its
|
|
162
|
+
* state or who may edit it.
|
|
187
163
|
*/
|
|
188
164
|
maySeeChangeRequest: (ctx: ToolContext, number: number) => Promise<boolean>,
|
|
189
165
|
/**
|
|
@@ -261,7 +237,9 @@ export function registerWorkflowTools(
|
|
|
261
237
|
// `getFilesystem` — so the branch-less call the tool handler refuses
|
|
262
238
|
// before this runs would otherwise commit to, or fork from, a
|
|
263
239
|
// workspace literally named "undefined".
|
|
264
|
-
|
|
240
|
+
// The normaliser also refuses a tmp ref (`__tmp__/…`) in every path
|
|
241
|
+
// input: none of these tools takes one (see `kb-fs/tmp-ref.ts`).
|
|
242
|
+
(args, ctx) => spec.handler(normalizePathArgs(args, kbDirName, { tool: spec.name }), ctx),
|
|
265
243
|
{ write: spec.write },
|
|
266
244
|
),
|
|
267
245
|
);
|
|
@@ -280,7 +258,8 @@ export function registerWorkflowTools(
|
|
|
280
258
|
name: 'list_branches',
|
|
281
259
|
description:
|
|
282
260
|
'List every draft known to the repository (protected versions + unprotected drafts, ' +
|
|
283
|
-
'local and on the shared remote). Returns `{ branches: [{ name, isProtected,
|
|
261
|
+
'local and on the shared remote). Returns `{ branches: [{ name, isProtected, hasRemote }] }`; ' +
|
|
262
|
+
'how far one branch is ahead or behind is `branch_status`\'s answer. ' +
|
|
284
263
|
'Takes no arguments — branch listing is repo-global, not scoped to any one draft.',
|
|
285
264
|
// Repo-global: the branch set is the same from any clone, so don't require
|
|
286
265
|
// (and risk cloning) a model-named branch — resolve any existing workspace.
|
|
@@ -472,7 +451,7 @@ export function registerWorkflowTools(
|
|
|
472
451
|
sourceBranch: { type: 'string', minLength: 1, description: 'The draft branch carrying the changes.' },
|
|
473
452
|
targetBranch: { type: 'string', minLength: 1, description: `The branch to apply to (e.g. '${kb.defaultBranch}').` },
|
|
474
453
|
title: { type: 'string', minLength: 1, maxLength: 256, description: 'Short imperative title (≤256 chars).' },
|
|
475
|
-
description: { type: 'string', description: 'Optional markdown body shown verbatim to reviewers.' },
|
|
454
|
+
description: { type: 'string', maxLength: 64_000, description: 'Optional markdown body shown verbatim to reviewers (≤64,000 chars).' },
|
|
476
455
|
include: {
|
|
477
456
|
type: 'array',
|
|
478
457
|
items: { type: 'string', enum: [...CHANGE_REQUEST_INCLUDES] },
|
|
@@ -507,66 +486,62 @@ export function registerWorkflowTools(
|
|
|
507
486
|
});
|
|
508
487
|
|
|
509
488
|
mount({
|
|
510
|
-
name: '
|
|
489
|
+
name: 'update_change_request',
|
|
511
490
|
description:
|
|
512
|
-
'
|
|
513
|
-
'
|
|
491
|
+
'Change the title and/or the description of an OPEN change request. Allowed for its author and for anyone ' +
|
|
492
|
+
'who may merge it (an admin, or someone who may approve every file it changes) — the same rule as the app\'s ' +
|
|
493
|
+
'Edit control; anyone else is refused (403), and so is a merged or closed request (409), in words. ' +
|
|
494
|
+
"`description` replaces the request's description whole — the text `get_change_request` answers as `body`; " +
|
|
495
|
+
'`appendDescription` instead adds a paragraph after the description as it stands when the write happens, so two ' +
|
|
496
|
+
'notes racing each other both land (never together with `description`). Give at least one field; an absent one keeps its text. ' +
|
|
497
|
+
'`get_change_request` answers the new text at once. A request you may not see answers 404, as `get_change_request` does.',
|
|
514
498
|
inputs: {
|
|
515
499
|
type: 'object',
|
|
516
500
|
properties: {
|
|
517
501
|
number: { type: 'integer', minimum: 1, description: 'Change request number.' },
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
parentId: { type: 'string', description: 'Comment id to reply to.' },
|
|
502
|
+
title: { type: 'string', minLength: 1, maxLength: 256, description: 'The new title (≤256 chars).' },
|
|
503
|
+
description: { type: 'string', maxLength: 64_000, description: 'The new description (Markdown, ≤64,000 chars); an empty string clears it.' },
|
|
504
|
+
appendDescription: { type: 'string', maxLength: 64_000, description: 'A paragraph (Markdown) added after the description as stored at the moment of the write; what it leaves is ≤64,000 chars. Not together with `description`.' },
|
|
522
505
|
},
|
|
523
|
-
required: ['number'
|
|
506
|
+
required: ['number'],
|
|
524
507
|
additionalProperties: false,
|
|
525
508
|
},
|
|
526
509
|
outputs: {
|
|
527
510
|
type: 'object',
|
|
528
511
|
properties: {
|
|
529
|
-
|
|
530
|
-
|
|
512
|
+
number: { type: 'integer' },
|
|
513
|
+
url: changeRequestUrlSchema,
|
|
514
|
+
urlNote: changeRequestUrlNoteSchema,
|
|
515
|
+
title: { type: 'string', description: 'The title as it now stands.' },
|
|
531
516
|
},
|
|
532
|
-
required: ['
|
|
517
|
+
required: ['number', 'url', 'title'],
|
|
533
518
|
},
|
|
534
519
|
write: true,
|
|
535
|
-
// Keyed by change-request number
|
|
536
|
-
//
|
|
537
|
-
// than requiring a `branch`.
|
|
520
|
+
// Keyed by change-request number; the service resolves the request's own
|
|
521
|
+
// base branch for the permission check.
|
|
538
522
|
skipBranch: true,
|
|
539
523
|
handler: async (args, ctx: ToolContext) => {
|
|
524
|
+
const title = typeof args.title === 'string' ? args.title : undefined;
|
|
525
|
+
const description = typeof args.description === 'string' ? args.description : undefined;
|
|
526
|
+
const appendDescription = typeof args.appendDescription === 'string' ? args.appendDescription : undefined;
|
|
527
|
+
if (title === undefined && description === undefined && appendDescription === undefined) {
|
|
528
|
+
throw new ToolError('Give a new `title`, a new `description`, or an `appendDescription`.', 400);
|
|
529
|
+
}
|
|
530
|
+
// A request the caller may not read is not found — never a 403 or a
|
|
531
|
+
// state-specific 409, which would tell a probe that it exists.
|
|
540
532
|
const number = args.number as number;
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
// Copy path gives (`/<kbDirName>/…`, its slash already dropped by the
|
|
544
|
-
// mount) carries the clone folder, which no changed file would match.
|
|
545
|
-
const path = typeof args.path === 'string' ? stripKbDir(args.path, kbDirName) : undefined;
|
|
546
|
-
if (line !== undefined && !path) { throw new ToolError('`path` is required when `line` is provided (inline comments anchor to a file).', 400);
|
|
533
|
+
if (!(await maySeeChangeRequest(ctx, number))) {
|
|
534
|
+
throw new ToolError(`Change request #${number} not found.`, 404);
|
|
547
535
|
}
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
536
|
+
const updated = await ctx.workflowService.updateChangeRequest(number, ctx.user, {
|
|
537
|
+
title,
|
|
538
|
+
description,
|
|
539
|
+
appendDescription,
|
|
552
540
|
});
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
// head (see `changeSourceFor`). Say that, rather than letting the service's
|
|
558
|
-
// `head sha is required` surface as a 400 about an argument the caller
|
|
559
|
-
// never passed. An APPLIED request still takes comments — its head is the
|
|
560
|
-
// source tip its merge commit recorded.
|
|
561
|
-
if (!detail.headSha) { throw new ToolError(`Change request #${number} is ${detail.state} and has no commit to anchor a comment to.`, 409);
|
|
562
|
-
}
|
|
563
|
-
const comment = await ctx.workflowService.postComment(
|
|
564
|
-
number,
|
|
565
|
-
ctx.user,
|
|
566
|
-
{ body: args.body as string, path, line, parentId: typeof args.parentId === 'string' ? args.parentId : undefined },
|
|
567
|
-
detail.headSha,
|
|
568
|
-
);
|
|
569
|
-
return { comment, changeRequest: linkOf(detail) };
|
|
541
|
+
return {
|
|
542
|
+
...linkOf(updated),
|
|
543
|
+
title: updated.title,
|
|
544
|
+
};
|
|
570
545
|
},
|
|
571
546
|
});
|
|
572
547
|
|
|
@@ -1004,9 +979,13 @@ export function registerWorkflowTools(
|
|
|
1004
979
|
// and a save or sync landing between two of them is tolerated — the
|
|
1005
980
|
// next call reports it. (The one answer that must be exact, what a
|
|
1006
981
|
// merge is of, is taken under one reservation by `update_branch`.)
|
|
1007
|
-
|
|
982
|
+
// The counts alone wait for the listing: its fetch refreshes the
|
|
983
|
+
// remote-tracking refs they are measured against.
|
|
984
|
+
const [status, [branches, counts], pending, forkBase] = await Promise.all([
|
|
1008
985
|
ctx.workflowService.branchStatus(workspaceId),
|
|
1009
|
-
ctx.workflowService
|
|
986
|
+
ctx.workflowService
|
|
987
|
+
.listBranches(workspaceId)
|
|
988
|
+
.then(async (listed) => [listed, await ctx.workflowService.branchCounts(workspaceId)] as const),
|
|
1010
989
|
ctx.workflowService.listPendingChangePaths(workspaceId),
|
|
1011
990
|
ctx.workflowService.resolveForkBase(workspaceId, branch),
|
|
1012
991
|
]);
|
|
@@ -1026,8 +1005,8 @@ export function registerWorkflowTools(
|
|
|
1026
1005
|
branch,
|
|
1027
1006
|
isProtected: info?.isProtected ?? kb.protectedBranches.has(branch),
|
|
1028
1007
|
hasRemote: info?.hasRemote ?? status.hasUpstream,
|
|
1029
|
-
ahead:
|
|
1030
|
-
behind:
|
|
1008
|
+
ahead: counts.ahead,
|
|
1009
|
+
behind: counts.behind,
|
|
1031
1010
|
behindRemote: status.unmergedFromUpstream,
|
|
1032
1011
|
uncommittedPaths,
|
|
1033
1012
|
forkBase,
|
|
@@ -25,7 +25,7 @@ export interface ChangeRequestOpenedEvent {
|
|
|
25
25
|
openedBy: ChangeRequestPerson;
|
|
26
26
|
/**
|
|
27
27
|
* The distinct people eligible to approve some changed path, as accounts —
|
|
28
|
-
* the eligibility the request's
|
|
28
|
+
* the eligibility the request's per-file approvals show, with the
|
|
29
29
|
* roles and groups expanded to their members, each person once however
|
|
30
30
|
* many paths or roles name them. Only a person with an account is here: a
|
|
31
31
|
* listener writes to accounts. The author is not left out; a listener that
|
|
@@ -179,7 +179,9 @@ export class WorkflowEventBus {
|
|
|
179
179
|
log.warn(`dispatch to session ${sub.sessionId} threw:`, { err });
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
// `pushed`, not delivered: the events route's delivery rule may still
|
|
183
|
+
// withhold the event from a session it was pushed to.
|
|
184
|
+
log.info(`EMIT id=${event.id} kind=${event.kind} → pushed=${matched} skipped=${skipped}`);
|
|
183
185
|
return event;
|
|
184
186
|
}
|
|
185
187
|
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who may receive an event: the per-kind delivery rule the events route
|
|
3
|
+
* applies, once per event per session, before it writes the event out.
|
|
4
|
+
*
|
|
5
|
+
* The bus decides which sessions HEAR about an event — its focus filter
|
|
6
|
+
* (workspace-scoped kinds) and user filter (user-scoped kinds). That is a
|
|
7
|
+
* delivery filter, and a session may name any workspace as its focus. This is
|
|
8
|
+
* the access check on top of it: an event that names something reaches only a
|
|
9
|
+
* person who may read what it names, judged by the same services the routes
|
|
10
|
+
* that serve that thing judge it by.
|
|
11
|
+
*
|
|
12
|
+
* - An event that names a path on a workspace (`file-changed`, the two lock
|
|
13
|
+
* events, and any later kind that carries `workspaceId` and `path`): the
|
|
14
|
+
* person may read the path on that branch, as the file routes judge it —
|
|
15
|
+
* after the one normaliser the file routes put every path through, so a
|
|
16
|
+
* path a client sent without the `<kbDirName>/` prefix (the lock route
|
|
17
|
+
* takes both spellings) is judged as the repository path it names, never
|
|
18
|
+
* as "outside the knowledge base, readable".
|
|
19
|
+
* - `approval-changed`: the person may read the approved path on the
|
|
20
|
+
* request's target branch — judged as a file event on that branch is,
|
|
21
|
+
* from the server's checkout of it (a cached read of the access rules
|
|
22
|
+
* from disk, no git), and only for a target the server holds no checkout
|
|
23
|
+
* of from its published ref. Never by reading the request's detail, which
|
|
24
|
+
* diffs the branch pair with several git subprocesses per person per event.
|
|
25
|
+
* - `change-request-opened`: the person may see the request, by the rule the
|
|
26
|
+
* request tools list and 404 by (`maySeeChangeRequest`): its author, or
|
|
27
|
+
* someone who may read one of its files — both names of a move — at its
|
|
28
|
+
* target, read at `origin/<target>` exactly as the tools read it
|
|
29
|
+
* (`readablePathsAt`), so the event never announces a request the tools
|
|
30
|
+
* answer as not found. The request's file list is read ONCE per event,
|
|
31
|
+
* however many sessions are judged; each person then costs one batch
|
|
32
|
+
* verdict from the access tree cached by commit.
|
|
33
|
+
* - `git-sync-failed`: the event names the workspace's root and, for a sync
|
|
34
|
+
* conflict, each conflicted file (its `reason` quotes them too). The person
|
|
35
|
+
* gets the paths they may read; git's words reach only a person who may
|
|
36
|
+
* read the root and every path the conflict names, and everyone else gets
|
|
37
|
+
* a fixed sentence.
|
|
38
|
+
* - `agent-tool-call`: the person whose agent made the call, as the bus
|
|
39
|
+
* already filters it; the rule says the same, so a bus that passed it on
|
|
40
|
+
* would not widen the audience.
|
|
41
|
+
*
|
|
42
|
+
* Every other kind is delivered as it is. That includes the number-only
|
|
43
|
+
* change-request lifecycle kinds (`-merged`, `-rejected`, `-apply-failed`),
|
|
44
|
+
* which follow an announcement the person was either given or not. A verdict
|
|
45
|
+
* that cannot be reached (the access tree fails to load, the request cannot be
|
|
46
|
+
* read) withholds, or for `git-sync-failed` redacts:
|
|
47
|
+
* failing closed costs a live refresh, failing open names a file.
|
|
48
|
+
*
|
|
49
|
+
* Nothing here changes what publishers emit; the rule only reads the event.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
import type { ChangeRequest, WorkflowEvent } from '@bevel-software/platform-shared';
|
|
53
|
+
import { logger } from '../../shared/logging.js';
|
|
54
|
+
import { workspaceIdForBranch } from '../../shared/workspace-id.js';
|
|
55
|
+
import type { IAccessControl } from '../access/index.js';
|
|
56
|
+
import { canReadWorkspacePath } from '../access-model/index.js';
|
|
57
|
+
import { normalizeWorkspacePath } from '../kb-fs/index.js';
|
|
58
|
+
import { fileIsReadable, isAuthor, maySeeChangeRequest, pathsOf } from './agent-tools/change-request-read-shape.js';
|
|
59
|
+
import { readablePathsAt } from './read-on-branch.js';
|
|
60
|
+
|
|
61
|
+
const log = logger('events');
|
|
62
|
+
|
|
63
|
+
/** What a `git-sync-failed` says in place of git's words. */
|
|
64
|
+
const GIT_SYNC_FAILED_REDACTED_REASON = 'The last push did not land.';
|
|
65
|
+
|
|
66
|
+
/** The person behind a session, as the auth middleware named them. */
|
|
67
|
+
export interface EventViewer {
|
|
68
|
+
userId: string;
|
|
69
|
+
email: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The verdicts the rule asks for. Each one is the question a route already
|
|
74
|
+
* answers for the thing the event names; `createEventAccess` wires them to
|
|
75
|
+
* those services, and tests to a fake.
|
|
76
|
+
*/
|
|
77
|
+
export interface EventAccess {
|
|
78
|
+
/** May `email` read the workspace-relative `wsPath` on `workspaceId` — the file routes' verdict. */
|
|
79
|
+
mayReadPath(workspaceId: string, email: string, wsPath: string): Promise<boolean>;
|
|
80
|
+
/** May `email` read the KB-repo-relative `repoPath` on `workspaceId`; `''` is the root. */
|
|
81
|
+
mayReadRepoPath(workspaceId: string, email: string, repoPath: string): Promise<boolean>;
|
|
82
|
+
/** Which of the KB-repo-relative `repoPaths` `email` may read on `targetBranch` — what a request into that branch is scoped by. */
|
|
83
|
+
readableAtTarget(targetBranch: string, email: string, repoPaths: string[]): Promise<Set<string>>;
|
|
84
|
+
/** Which of the KB-repo-relative `repoPaths` `email` may read at `origin/<base>` — the change-request tools' verdict, `readablePathsAt`. */
|
|
85
|
+
readableAtBase(base: string, email: string, repoPaths: string[]): Promise<Set<string>>;
|
|
86
|
+
/**
|
|
87
|
+
* Request `number` as the request list judges it — its target, author and
|
|
88
|
+
* changed files — or null when there is none. Read once per event: callers
|
|
89
|
+
* judging one event for many sessions share the read.
|
|
90
|
+
*/
|
|
91
|
+
changeRequest(number: number): Promise<ChangeRequestFacts | null>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** What the visibility rule reads of a request. */
|
|
95
|
+
export type ChangeRequestFacts = Pick<ChangeRequest, 'base' | 'authorId' | 'touchedNodeFiles'>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* What the events route asks of the rule. The route depends on this, never on
|
|
99
|
+
* `EventDelivery`, so the rule can be substituted behind it.
|
|
100
|
+
*/
|
|
101
|
+
export interface IEventDelivery {
|
|
102
|
+
/** The event as `viewer` may receive it: itself, a redacted copy, or null. Never rejects. */
|
|
103
|
+
judge(event: WorkflowEvent, viewer: EventViewer): Promise<WorkflowEvent | null>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The deployment's `EventAccess`: the access service the file routes use, read in the server's own checkouts. */
|
|
107
|
+
export function createEventAccess(deps: {
|
|
108
|
+
accessControl: Pick<IAccessControl, 'canRead' | 'canReadBatch' | 'canReadBatchAtRef'>;
|
|
109
|
+
kbDirName: string;
|
|
110
|
+
/** `IWorkflowService.getChangeRequest`: the summary the request list judges, files included. */
|
|
111
|
+
getChangeRequest(number: number): Promise<ChangeRequestFacts | null>;
|
|
112
|
+
workspaces: {
|
|
113
|
+
/** Whether the server holds a checkout for `workspaceId` (the branch's own workspace). */
|
|
114
|
+
hasWorkspace(workspaceId: string): Promise<boolean>;
|
|
115
|
+
/**
|
|
116
|
+
* A workspace to read a published ref in: always for a request's base,
|
|
117
|
+
* and for an approval's target the server holds no checkout of. Every
|
|
118
|
+
* verdict at `origin/<branch>` is the same from any clone of the
|
|
119
|
+
* repository, so any existing one serves.
|
|
120
|
+
*/
|
|
121
|
+
anyWorkspaceId(): Promise<string>;
|
|
122
|
+
};
|
|
123
|
+
}): EventAccess {
|
|
124
|
+
/** A request's read, shared while it is in flight: one per event's fan-out, never a stale one after. */
|
|
125
|
+
const requestsInFlight = new Map<number, Promise<ChangeRequestFacts | null>>();
|
|
126
|
+
return {
|
|
127
|
+
// Normalised first, by the file routes' own normaliser: a path it refuses
|
|
128
|
+
// throws, and the rule withholds the event.
|
|
129
|
+
mayReadPath: async (workspaceId, email, wsPath) =>
|
|
130
|
+
canReadWorkspacePath(
|
|
131
|
+
(w, e, p) => deps.accessControl.canRead(w, e, p),
|
|
132
|
+
workspaceId,
|
|
133
|
+
email,
|
|
134
|
+
deps.kbDirName,
|
|
135
|
+
normalizeWorkspacePath(wsPath, deps.kbDirName),
|
|
136
|
+
),
|
|
137
|
+
mayReadRepoPath: (workspaceId, email, repoPath) => deps.accessControl.canRead(workspaceId, email, repoPath),
|
|
138
|
+
readableAtTarget: async (targetBranch, email, repoPaths) => {
|
|
139
|
+
if (repoPaths.length === 0) return new Set();
|
|
140
|
+
const unique = [...new Set(repoPaths)];
|
|
141
|
+
// The branch's own checkout, when the server has one (the default
|
|
142
|
+
// branch always): the same disk read a file event on that branch gets.
|
|
143
|
+
const own = workspaceIdForBranch(targetBranch);
|
|
144
|
+
const verdicts = (await deps.workspaces.hasWorkspace(own))
|
|
145
|
+
? await deps.accessControl.canReadBatch(own, email, unique)
|
|
146
|
+
: await deps.accessControl.canReadBatchAtRef(
|
|
147
|
+
await deps.workspaces.anyWorkspaceId(),
|
|
148
|
+
`origin/${targetBranch}`,
|
|
149
|
+
email,
|
|
150
|
+
unique,
|
|
151
|
+
);
|
|
152
|
+
// A ref that cannot be resolved answers null: nothing is granted on it.
|
|
153
|
+
return new Set(unique.filter((p) => verdicts?.get(p) === true));
|
|
154
|
+
},
|
|
155
|
+
// The request tools' own rule and reading, never the target's checkout: a
|
|
156
|
+
// grant there that is not yet published must not announce a request
|
|
157
|
+
// `get_change_request` answers as not found.
|
|
158
|
+
readableAtBase: async (base, email, repoPaths) =>
|
|
159
|
+
readablePathsAt(deps.accessControl, await deps.workspaces.anyWorkspaceId(), email, base, repoPaths),
|
|
160
|
+
changeRequest: (number) => {
|
|
161
|
+
const pending = requestsInFlight.get(number);
|
|
162
|
+
if (pending) return pending;
|
|
163
|
+
const read = deps.getChangeRequest(number).finally(() => requestsInFlight.delete(number));
|
|
164
|
+
requestsInFlight.set(number, read);
|
|
165
|
+
return read;
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The event as `viewer` may receive it: the event itself, a redacted copy, or
|
|
172
|
+
* null for nothing at all.
|
|
173
|
+
*/
|
|
174
|
+
async function deliveryFor(
|
|
175
|
+
event: WorkflowEvent,
|
|
176
|
+
viewer: EventViewer,
|
|
177
|
+
access: EventAccess,
|
|
178
|
+
): Promise<WorkflowEvent | null> {
|
|
179
|
+
const email = viewer.email;
|
|
180
|
+
try {
|
|
181
|
+
switch (event.kind) {
|
|
182
|
+
case 'approval-changed':
|
|
183
|
+
return email && (await access.readableAtTarget(event.targetBranch, email, [event.path])).has(event.path)
|
|
184
|
+
? event
|
|
185
|
+
: null;
|
|
186
|
+
case 'change-request-opened':
|
|
187
|
+
return email && (await maySeeRequest(event.number, email, access)) ? event : null;
|
|
188
|
+
case 'git-sync-failed':
|
|
189
|
+
return email ? await gitSyncFailedFor(event, email, access) : redactGitSyncFailed(event, []);
|
|
190
|
+
case 'agent-tool-call':
|
|
191
|
+
return viewer.userId === event.forUserId ? event : null;
|
|
192
|
+
}
|
|
193
|
+
// Structural, not by kind: anything that names a path on a workspace is
|
|
194
|
+
// judged by the path, so a kind added later is covered without a line here.
|
|
195
|
+
const named = pathOnWorkspace(event);
|
|
196
|
+
if (named) return email && (await access.mayReadPath(named.workspaceId, email, named.path)) ? event : null;
|
|
197
|
+
return event;
|
|
198
|
+
} catch (err) {
|
|
199
|
+
log.warn(`delivery verdict failed for event id=${event.id} kind=${event.kind} user=${viewer.userId}; withheld`, { err });
|
|
200
|
+
return event.kind === 'git-sync-failed' ? redactGitSyncFailed(event, []) : null;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The request tools' visibility rule, over the request the list judges: its
|
|
206
|
+
* author sees it; anyone else sees it when one of its files is readable at
|
|
207
|
+
* the target, a move only when both its names are. No request, no file list
|
|
208
|
+
* (a diff that could not be computed): author only, as the tools answer it.
|
|
209
|
+
*/
|
|
210
|
+
async function maySeeRequest(number: number, email: string, access: EventAccess): Promise<boolean> {
|
|
211
|
+
const request = await access.changeRequest(number);
|
|
212
|
+
if (!request) return false;
|
|
213
|
+
if (isAuthor(request, email)) return true;
|
|
214
|
+
const files = request.touchedNodeFiles ?? [];
|
|
215
|
+
const readable = await access.readableAtBase(request.base, email, files.flatMap(pathsOf));
|
|
216
|
+
const readableFiles = files.filter((f) => fileIsReadable(f, (p) => readable.has(p))).length;
|
|
217
|
+
return maySeeChangeRequest({ readableFiles, isAuthor: false });
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
type GitSyncFailed = Extract<WorkflowEvent, { kind: 'git-sync-failed' }>;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Every path the event names is judged: the root, which git's words are about,
|
|
224
|
+
* and each conflicted file, which a conflict's `reason` also quotes. Git's
|
|
225
|
+
* words go out only when every one of them is readable; otherwise the person
|
|
226
|
+
* keeps the conflicted files they may read and a fixed sentence.
|
|
227
|
+
*/
|
|
228
|
+
async function gitSyncFailedFor(event: GitSyncFailed, email: string, access: EventAccess): Promise<WorkflowEvent> {
|
|
229
|
+
const conflicted = event.conflictedPaths ?? [];
|
|
230
|
+
const [root, ...each] = await Promise.all([
|
|
231
|
+
access.mayReadRepoPath(event.workspaceId, email, ''),
|
|
232
|
+
...conflicted.map((p) => access.mayReadRepoPath(event.workspaceId, email, p)),
|
|
233
|
+
]);
|
|
234
|
+
const readable = conflicted.filter((_, i) => each[i]);
|
|
235
|
+
return root && readable.length === conflicted.length ? event : redactGitSyncFailed(event, readable);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function pathOnWorkspace(event: WorkflowEvent): { workspaceId: string; path: string } | null {
|
|
239
|
+
const e = event as { workspaceId?: unknown; path?: unknown };
|
|
240
|
+
return typeof e.workspaceId === 'string' && typeof e.path === 'string'
|
|
241
|
+
? { workspaceId: e.workspaceId, path: e.path }
|
|
242
|
+
: null;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Same shape, so a client parses it as before: git's words are gone, and of
|
|
247
|
+
* the conflicted files only `readable` remain (none, the key absent).
|
|
248
|
+
*/
|
|
249
|
+
function redactGitSyncFailed(event: GitSyncFailed, readable: string[]): WorkflowEvent {
|
|
250
|
+
const redacted: GitSyncFailed = { ...event, reason: GIT_SYNC_FAILED_REDACTED_REASON };
|
|
251
|
+
if (readable.length > 0) redacted.conflictedPaths = readable;
|
|
252
|
+
else delete redacted.conflictedPaths;
|
|
253
|
+
return redacted;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The rule, shared per (event, person) while it is being judged: a person with
|
|
258
|
+
* three tabs open is judged once per event, not three times. A verdict is
|
|
259
|
+
* dropped the moment it settles and never reused, so a replay after a
|
|
260
|
+
* reconnect asks again, and a grant or a revocation since the event was first
|
|
261
|
+
* delivered decides what the replay carries.
|
|
262
|
+
*/
|
|
263
|
+
export class EventDelivery implements IEventDelivery {
|
|
264
|
+
private readonly inFlight = new Map<string, Promise<WorkflowEvent | null>>();
|
|
265
|
+
|
|
266
|
+
constructor(private readonly access: EventAccess) {}
|
|
267
|
+
|
|
268
|
+
judge(event: WorkflowEvent, viewer: EventViewer): Promise<WorkflowEvent | null> {
|
|
269
|
+
const key = `${event.id}\u0000${event.ts}\u0000${viewer.userId}`;
|
|
270
|
+
const pending = this.inFlight.get(key);
|
|
271
|
+
if (pending) return pending;
|
|
272
|
+
// `deliveryFor` never rejects: a verdict it cannot reach withholds the
|
|
273
|
+
// event, or for `git-sync-failed` redacts it.
|
|
274
|
+
const verdict = deliveryFor(event, viewer, this.access).finally(() => this.inFlight.delete(key));
|
|
275
|
+
this.inFlight.set(key, verdict);
|
|
276
|
+
return verdict;
|
|
277
|
+
}
|
|
278
|
+
}
|