@bevel-software/platform-core-backend 0.26.0 → 0.27.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 +17 -0
- package/agent-guide/conventions.md +8 -0
- package/agent-guide/html-views.md +83 -0
- package/agent-guide/new-knowledge-base.md +24 -0
- package/agent-guide/tool-manuals.md +10 -0
- package/dist/assets.d.ts +19 -0
- package/dist/assets.d.ts.map +1 -1
- package/dist/assets.js +26 -2
- package/dist/assets.js.map +1 -1
- package/dist/core/catalog-revision.d.ts +19 -1
- package/dist/core/catalog-revision.d.ts.map +1 -1
- package/dist/core/catalog-revision.js +14 -3
- package/dist/core/catalog-revision.js.map +1 -1
- package/dist/core/create-core-server.d.ts +5 -0
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +54 -3
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +26 -0
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +100 -8
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +16 -1
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +18 -1
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core-config.d.ts +21 -0
- package/dist/core-config.d.ts.map +1 -1
- package/dist/core-config.js +22 -1
- package/dist/core-config.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/modules/access/access-control.interface.d.ts +8 -0
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +1 -0
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +11 -0
- package/dist/modules/access/access-control.service.js.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/agent-guide/agent-guide.d.ts +6 -0
- package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.js +8 -0
- package/dist/modules/agent-guide/agent-guide.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 +5 -0
- package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
- package/dist/modules/agent-instructions/compose.js +19 -2
- package/dist/modules/agent-instructions/compose.js.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.js +19 -19
- package/dist/modules/agent-instructions/shared-file-rules.js.map +1 -1
- package/dist/modules/audit/agent-audit.service.d.ts +21 -2
- package/dist/modules/audit/agent-audit.service.d.ts.map +1 -1
- package/dist/modules/audit/agent-audit.service.js +43 -2
- package/dist/modules/audit/agent-audit.service.js.map +1 -1
- package/dist/modules/audit/agent-connection.routes.d.ts +34 -0
- package/dist/modules/audit/agent-connection.routes.d.ts.map +1 -0
- package/dist/modules/audit/agent-connection.routes.js +38 -0
- package/dist/modules/audit/agent-connection.routes.js.map +1 -0
- package/dist/modules/audit/audit.contract.d.ts +24 -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/index.d.ts +1 -0
- package/dist/modules/audit/index.d.ts.map +1 -1
- package/dist/modules/audit/index.js +1 -0
- package/dist/modules/audit/index.js.map +1 -1
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +10 -3
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.middleware.d.ts +7 -0
- package/dist/modules/auth/auth.middleware.d.ts.map +1 -1
- package/dist/modules/auth/auth.middleware.js +1 -1
- package/dist/modules/auth/auth.middleware.js.map +1 -1
- package/dist/modules/code-mode/code-mode.tool.d.ts.map +1 -1
- package/dist/modules/code-mode/code-mode.tool.js +11 -3
- package/dist/modules/code-mode/code-mode.tool.js.map +1 -1
- package/dist/modules/database/core-schema.d.ts +96 -0
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +32 -3
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/embed/account-link.service.d.ts +42 -0
- package/dist/modules/embed/account-link.service.d.ts.map +1 -0
- package/dist/modules/embed/account-link.service.js +50 -0
- package/dist/modules/embed/account-link.service.js.map +1 -0
- package/dist/modules/embed/embed-link.d.ts +58 -0
- package/dist/modules/embed/embed-link.d.ts.map +1 -0
- package/dist/modules/embed/embed-link.js +160 -0
- package/dist/modules/embed/embed-link.js.map +1 -0
- package/dist/modules/embed/embed.errors.d.ts +30 -0
- package/dist/modules/embed/embed.errors.d.ts.map +1 -0
- package/dist/modules/embed/embed.errors.js +42 -0
- package/dist/modules/embed/embed.errors.js.map +1 -0
- package/dist/modules/embed/embed.interface.d.ts +204 -0
- package/dist/modules/embed/embed.interface.d.ts.map +1 -0
- package/dist/modules/embed/embed.interface.js +2 -0
- package/dist/modules/embed/embed.interface.js.map +1 -0
- package/dist/modules/embed/embed.routes.d.ts +59 -0
- package/dist/modules/embed/embed.routes.d.ts.map +1 -0
- package/dist/modules/embed/embed.routes.js +343 -0
- package/dist/modules/embed/embed.routes.js.map +1 -0
- package/dist/modules/embed/embed.service.d.ts +169 -0
- package/dist/modules/embed/embed.service.d.ts.map +1 -0
- package/dist/modules/embed/embed.service.js +627 -0
- package/dist/modules/embed/embed.service.js.map +1 -0
- package/dist/modules/embed/embed.tools.d.ts +51 -0
- package/dist/modules/embed/embed.tools.d.ts.map +1 -0
- package/dist/modules/embed/embed.tools.js +170 -0
- package/dist/modules/embed/embed.tools.js.map +1 -0
- package/dist/modules/embed/mcp-app.d.ts +64 -0
- package/dist/modules/embed/mcp-app.d.ts.map +1 -0
- package/dist/modules/embed/mcp-app.js +147 -0
- package/dist/modules/embed/mcp-app.js.map +1 -0
- package/dist/modules/embed/mcp-app.routes.d.ts +21 -0
- package/dist/modules/embed/mcp-app.routes.d.ts.map +1 -0
- package/dist/modules/embed/mcp-app.routes.js +36 -0
- package/dist/modules/embed/mcp-app.routes.js.map +1 -0
- package/dist/modules/github-app/github-app.connection.d.ts +15 -0
- package/dist/modules/github-app/github-app.connection.d.ts.map +1 -1
- package/dist/modules/github-app/github-app.connection.js +34 -3
- package/dist/modules/github-app/github-app.connection.js.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.d.ts +65 -0
- package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.js +300 -0
- package/dist/modules/kb-fs/locking-filesystem.js.map +1 -1
- package/dist/modules/kb-sync/kb-sync.interface.d.ts +5 -0
- package/dist/modules/kb-sync/kb-sync.interface.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js +6 -0
- package/dist/modules/kb-sync/kb-sync.service.js.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.js +2 -1
- package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +28 -1
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +64 -8
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +24 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +32 -4
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
- package/dist/modules/onboarding/onboarding.contract.d.ts +80 -0
- package/dist/modules/onboarding/onboarding.contract.d.ts.map +1 -0
- package/dist/modules/onboarding/onboarding.contract.js +7 -0
- package/dist/modules/onboarding/onboarding.contract.js.map +1 -0
- package/dist/modules/onboarding/onboarding.routes.d.ts +18 -0
- package/dist/modules/onboarding/onboarding.routes.d.ts.map +1 -0
- package/dist/modules/onboarding/onboarding.routes.js +81 -0
- package/dist/modules/onboarding/onboarding.routes.js.map +1 -0
- package/dist/modules/onboarding/starter-pack.service.d.ts +213 -0
- package/dist/modules/onboarding/starter-pack.service.d.ts.map +1 -0
- package/dist/modules/onboarding/starter-pack.service.js +492 -0
- package/dist/modules/onboarding/starter-pack.service.js.map +1 -0
- package/dist/modules/onboarding/starter-packs.d.ts +78 -0
- package/dist/modules/onboarding/starter-packs.d.ts.map +1 -0
- package/dist/modules/onboarding/starter-packs.js +156 -0
- package/dist/modules/onboarding/starter-packs.js.map +1 -0
- package/dist/modules/plugins/index.d.ts +1 -1
- package/dist/modules/plugins/index.d.ts.map +1 -1
- package/dist/modules/plugins/index.js +1 -1
- package/dist/modules/plugins/index.js.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.d.ts +19 -0
- package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.js +18 -1
- package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +0 -36
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +31 -0
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.d.ts +34 -0
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +134 -1
- package/dist/modules/settings/deployment-settings.service.js.map +1 -1
- package/dist/modules/settings/repository-source.d.ts +1 -0
- package/dist/modules/settings/repository-source.d.ts.map +1 -1
- package/dist/modules/settings/repository-source.js +3 -3
- package/dist/modules/settings/repository-source.js.map +1 -1
- package/dist/modules/skills/skills.tools.d.ts.map +1 -1
- package/dist/modules/skills/skills.tools.js +50 -32
- package/dist/modules/skills/skills.tools.js.map +1 -1
- package/dist/modules/tool-auth/connection-key-rejection.d.ts +10 -1
- package/dist/modules/tool-auth/connection-key-rejection.d.ts.map +1 -1
- package/dist/modules/tool-auth/connection-key-rejection.js +11 -3
- package/dist/modules/tool-auth/connection-key-rejection.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.interface.d.ts +8 -0
- package/dist/modules/tool-auth/external-api-key.interface.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts +24 -2
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js +59 -2
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.js +9 -4
- package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -1
- package/dist/modules/tool-helpers/index.d.ts +28 -1
- package/dist/modules/tool-helpers/index.d.ts.map +1 -1
- package/dist/modules/tool-helpers/index.js +28 -1
- package/dist/modules/tool-helpers/index.js.map +1 -1
- package/dist/modules/tool-helpers/route-argument-check.d.ts +10 -0
- package/dist/modules/tool-helpers/route-argument-check.d.ts.map +1 -0
- package/dist/modules/tool-helpers/route-argument-check.js +132 -0
- package/dist/modules/tool-helpers/route-argument-check.js.map +1 -0
- package/dist/modules/tool-helpers/route-tool-schemas.d.ts +89 -0
- package/dist/modules/tool-helpers/route-tool-schemas.d.ts.map +1 -0
- package/dist/modules/tool-helpers/route-tool-schemas.js +113 -0
- package/dist/modules/tool-helpers/route-tool-schemas.js.map +1 -0
- package/dist/modules/tool-helpers/tool-def.d.ts +71 -0
- package/dist/modules/tool-helpers/tool-def.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-def.js +70 -6
- package/dist/modules/tool-helpers/tool-def.js.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.d.ts +46 -6
- package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.js +157 -8
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.d.ts +9 -0
- 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-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +14 -5
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/tool-registry/description-length.d.ts +6 -2
- package/dist/modules/tool-registry/description-length.d.ts.map +1 -1
- package/dist/modules/tool-registry/description-length.js +27 -5
- package/dist/modules/tool-registry/description-length.js.map +1 -1
- package/dist/modules/tool-registry/guide-first.d.ts +4 -0
- package/dist/modules/tool-registry/guide-first.d.ts.map +1 -1
- package/dist/modules/tool-registry/guide-first.js +9 -1
- package/dist/modules/tool-registry/guide-first.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts +53 -0
- 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 +97 -68
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +8 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +124 -37
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/file-lock.service.d.ts +29 -5
- package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
- package/dist/modules/workflow/file-lock.service.js +62 -5
- package/dist/modules/workflow/file-lock.service.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +72 -1
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +172 -36
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.d.ts +15 -0
- package/dist/modules/workflow/git/node-git-runner.d.ts.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.js +78 -6
- package/dist/modules/workflow/git/node-git-runner.js.map +1 -1
- package/dist/modules/workflow/pending-commits.service.d.ts +15 -0
- package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
- package/dist/modules/workflow/pending-commits.service.js +25 -1
- package/dist/modules/workflow/pending-commits.service.js.map +1 -1
- package/dist/modules/workflow/pending-commits.worker.d.ts +6 -1
- package/dist/modules/workflow/pending-commits.worker.d.ts.map +1 -1
- package/dist/modules/workflow/pending-commits.worker.js +23 -6
- package/dist/modules/workflow/pending-commits.worker.js.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/review-workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +2 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
- package/dist/modules/workflow/sanitize-error.d.ts +16 -0
- package/dist/modules/workflow/sanitize-error.d.ts.map +1 -1
- package/dist/modules/workflow/sanitize-error.js +45 -0
- package/dist/modules/workflow/sanitize-error.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +183 -15
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +805 -106
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/agent-download.builder.d.ts +105 -0
- package/dist/modules/workspace/agent-download.builder.d.ts.map +1 -0
- package/dist/modules/workspace/agent-download.builder.js +238 -0
- package/dist/modules/workspace/agent-download.builder.js.map +1 -0
- package/dist/modules/workspace/agent-download.routes.d.ts +77 -0
- package/dist/modules/workspace/agent-download.routes.d.ts.map +1 -0
- package/dist/modules/workspace/agent-download.routes.js +156 -0
- package/dist/modules/workspace/agent-download.routes.js.map +1 -0
- package/dist/modules/workspace/agent-download.store.d.ts +225 -0
- package/dist/modules/workspace/agent-download.store.d.ts.map +1 -0
- package/dist/modules/workspace/agent-download.store.js +423 -0
- package/dist/modules/workspace/agent-download.store.js.map +1 -0
- package/dist/modules/workspace/agent-upload.store.d.ts +10 -1
- package/dist/modules/workspace/agent-upload.store.d.ts.map +1 -1
- package/dist/modules/workspace/agent-upload.store.js +16 -6
- package/dist/modules/workspace/agent-upload.store.js.map +1 -1
- package/dist/modules/workspace/file-readers/raw-mime.d.ts +6 -0
- package/dist/modules/workspace/file-readers/raw-mime.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/raw-mime.js +38 -0
- package/dist/modules/workspace/file-readers/raw-mime.js.map +1 -0
- package/dist/modules/workspace/file-readers/text-reader.d.ts +5 -5
- package/dist/modules/workspace/file-readers/text-reader.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/text-reader.js +5 -8
- package/dist/modules/workspace/file-readers/text-reader.js.map +1 -1
- package/dist/modules/workspace/first-run.d.ts +111 -0
- package/dist/modules/workspace/first-run.d.ts.map +1 -0
- package/dist/modules/workspace/first-run.js +181 -0
- package/dist/modules/workspace/first-run.js.map +1 -0
- package/dist/modules/workspace/move-links.d.ts +92 -0
- package/dist/modules/workspace/move-links.d.ts.map +1 -0
- package/dist/modules/workspace/move-links.js +173 -0
- package/dist/modules/workspace/move-links.js.map +1 -0
- package/dist/modules/workspace/startup/steps/seed-tree.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +3 -13
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +63 -22
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +75 -2
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +197 -24
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +59 -1
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +443 -65
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/modules/write-access/write-access.d.ts.map +1 -1
- package/dist/modules/write-access/write-access.js +9 -0
- package/dist/modules/write-access/write-access.js.map +1 -1
- package/dist/shared/domain-errors.d.ts +73 -1
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +86 -12
- package/dist/shared/domain-errors.js.map +1 -1
- package/dist/shared/git.contract.d.ts +10 -1
- package/dist/shared/git.contract.d.ts.map +1 -1
- package/dist/shared/git.contract.js.map +1 -1
- package/dist/shared/utf8-text.d.ts +15 -0
- package/dist/shared/utf8-text.d.ts.map +1 -0
- package/dist/shared/utf8-text.js +20 -0
- package/dist/shared/utf8-text.js.map +1 -0
- package/dist/tenancy/static-tenant-source.d.ts +2 -1
- package/dist/tenancy/static-tenant-source.d.ts.map +1 -1
- package/dist/tenancy/static-tenant-source.js +9 -2
- package/dist/tenancy/static-tenant-source.js.map +1 -1
- package/mcp-app/page.html +349 -0
- package/migrations/0017_atlassian_account_links.sql +37 -0
- package/migrations/meta/0017_snapshot.json +2396 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +5 -3
- package/src/__tests__/packaged-assets-ship.test.ts +16 -4
- package/src/assets.ts +28 -2
- package/src/core/__tests__/catalog-revision.test.ts +40 -0
- package/src/core/__tests__/gated-boot.test.ts +1 -0
- package/src/core/__tests__/lifecycle.test.ts +14 -0
- package/src/core/catalog-revision.ts +15 -2
- package/src/core/create-core-server.ts +67 -3
- package/src/core/create-core-services.ts +140 -6
- package/src/core/lifecycle.ts +28 -2
- package/src/core-config.ts +24 -1
- package/src/index.ts +2 -2
- package/src/modules/access/__tests__/access-control.service.test.ts +19 -0
- package/src/modules/access/access-control.interface.ts +13 -0
- package/src/modules/access/access-control.service.ts +16 -0
- package/src/modules/access/directory-sync-bot.ts +1 -1
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +58 -0
- package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +19 -1
- package/src/modules/agent-guide/agent-guide.ts +9 -0
- package/src/modules/agent-guide/index.ts +1 -0
- package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +14 -0
- package/src/modules/agent-instructions/compose.ts +17 -2
- package/src/modules/agent-instructions/shared-file-rules.ts +19 -19
- package/src/modules/audit/__tests__/agent-audit.service.test.ts +64 -4
- package/src/modules/audit/__tests__/agent-connection.routes.test.ts +102 -0
- package/src/modules/audit/agent-audit.service.ts +58 -3
- package/src/modules/audit/agent-connection.routes.ts +56 -0
- package/src/modules/audit/audit.contract.ts +26 -0
- package/src/modules/audit/index.ts +1 -0
- package/src/modules/auth/__tests__/account.routes.test.ts +5 -3
- package/src/modules/auth/account.routes.ts +10 -3
- package/src/modules/auth/auth.middleware.ts +1 -1
- package/src/modules/code-mode/__tests__/code-mode.tool.test.ts +18 -2
- package/src/modules/code-mode/code-mode.tool.ts +13 -2
- package/src/modules/database/core-schema.ts +33 -3
- package/src/modules/embed/__tests__/account-links.migration.test.ts +98 -0
- package/src/modules/embed/__tests__/embed-link.test.ts +122 -0
- package/src/modules/embed/__tests__/embed.routes.test.ts +362 -0
- package/src/modules/embed/__tests__/embed.service.lock.test.ts +193 -0
- package/src/modules/embed/__tests__/embed.service.test.ts +805 -0
- package/src/modules/embed/__tests__/embed.tools.test.ts +304 -0
- package/src/modules/embed/__tests__/mcp-app.test.ts +207 -0
- package/src/modules/embed/account-link.service.ts +76 -0
- package/src/modules/embed/embed-link.ts +180 -0
- package/src/modules/embed/embed.errors.ts +43 -0
- package/src/modules/embed/embed.interface.ts +203 -0
- package/src/modules/embed/embed.routes.ts +363 -0
- package/src/modules/embed/embed.service.ts +705 -0
- package/src/modules/embed/embed.tools.ts +206 -0
- package/src/modules/embed/mcp-app.routes.ts +41 -0
- package/src/modules/embed/mcp-app.ts +173 -0
- package/src/modules/github-app/__tests__/github-app.test.ts +76 -0
- package/src/modules/github-app/github-app.connection.ts +38 -4
- package/src/modules/kb-fs/__tests__/move-with-edits.test.ts +304 -0
- package/src/modules/kb-fs/locking-filesystem.ts +287 -0
- package/src/modules/kb-sync/__tests__/kb-sync.service.test.ts +35 -0
- package/src/modules/kb-sync/kb-sync.interface.ts +2 -0
- package/src/modules/kb-sync/kb-sync.service.ts +6 -0
- package/src/modules/mcp/__tests__/bevel-oauth-provider.test.ts +68 -11
- package/src/modules/mcp/__tests__/mcp-proxy-helpers.test.ts +37 -2
- package/src/modules/mcp/__tests__/mcp.app.e2e.test.ts +200 -0
- package/src/modules/mcp/__tests__/mcp.e2e.test.ts +3 -1
- package/src/modules/mcp/__tests__/mcp.service.test.ts +23 -13
- package/src/modules/mcp/__tests__/tool-call-interface.e2e.test.ts +499 -0
- package/src/modules/mcp/mcp-auth.middleware.ts +2 -1
- package/src/modules/mcp/mcp.service.ts +81 -12
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +42 -4
- package/src/modules/onboarding/__tests__/onboarding.routes.test.ts +163 -0
- package/src/modules/onboarding/__tests__/starter-pack.service.test.ts +635 -0
- package/src/modules/onboarding/__tests__/starter-packs.test.ts +169 -0
- package/src/modules/onboarding/onboarding.contract.ts +85 -0
- package/src/modules/onboarding/onboarding.routes.ts +85 -0
- package/src/modules/onboarding/starter-pack.service.ts +580 -0
- package/src/modules/onboarding/starter-packs.ts +182 -0
- package/src/modules/plugins/__tests__/plugins.tools.test.ts +25 -2
- package/src/modules/plugins/index.ts +1 -0
- package/src/modules/plugins/plugin-provision.service.ts +22 -1
- package/src/modules/plugins/plugins.routes.ts +29 -0
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +150 -1
- package/src/modules/settings/__tests__/repository-source.test.ts +9 -0
- package/src/modules/settings/deployment-settings.service.ts +131 -1
- package/src/modules/settings/repository-source.ts +4 -4
- package/src/modules/skills/__tests__/skills.tools.description.test.ts +5 -1
- package/src/modules/skills/skills.tools.ts +55 -35
- package/src/modules/tool-auth/__tests__/connection-key-rejection.test.ts +32 -0
- package/src/modules/tool-auth/__tests__/external-api-key.service.test.ts +65 -0
- package/src/modules/tool-auth/connection-key-rejection.ts +13 -3
- package/src/modules/tool-auth/external-api-key.interface.ts +9 -0
- package/src/modules/tool-auth/external-api-key.service.ts +61 -4
- package/src/modules/tool-auth/tool-auth.middleware.ts +13 -4
- package/src/modules/tool-helpers/__tests__/branch-declaration.test.ts +502 -0
- package/src/modules/tool-helpers/__tests__/route-argument-check.test.ts +337 -0
- package/src/modules/tool-helpers/index.ts +34 -1
- package/src/modules/tool-helpers/route-argument-check.ts +149 -0
- package/src/modules/tool-helpers/route-tool-schemas.ts +171 -0
- package/src/modules/tool-helpers/tool-def.ts +132 -7
- package/src/modules/tool-helpers/tool-handler.ts +196 -8
- package/src/modules/tool-helpers/tool.contract.ts +9 -0
- package/src/modules/tool-manuals/tool-manuals.tools.ts +15 -5
- package/src/modules/tool-registry/__tests__/own-tool-schemas.test.ts +14 -1
- package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +23 -10
- package/src/modules/tool-registry/description-length.ts +34 -7
- package/src/modules/tool-registry/guide-first.ts +8 -1
- package/src/modules/workflow/__tests__/file-lock.service.deletion-gate.test.ts +104 -0
- package/src/modules/workflow/__tests__/pending-commits.repository-replaced.test.ts +66 -0
- package/src/modules/workflow/__tests__/pending-commits.worker.test.ts +31 -2
- package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +110 -6
- package/src/modules/workflow/__tests__/sanitize-error.test.ts +89 -1
- package/src/modules/workflow/__tests__/workflow.routes.push-refused.test.ts +202 -0
- package/src/modules/workflow/__tests__/workflow.service.branch-in-use.test.ts +6 -6
- package/src/modules/workflow/__tests__/workflow.service.delete-branch.test.ts +1026 -0
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +468 -10
- package/src/modules/workflow/__tests__/workflow.service.folder-proposals.test.ts +4 -0
- package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +5 -4
- package/src/modules/workflow/__tests__/workflow.service.update-from-target.test.ts +54 -2
- package/src/modules/workflow/agent-tools/__tests__/change-request-read.tools.test.ts +41 -5
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +127 -2
- package/src/modules/workflow/agent-tools/change-request-read.tools.ts +157 -122
- package/src/modules/workflow/agent-tools/workflow.tools.ts +129 -35
- package/src/modules/workflow/file-lock.service.ts +67 -5
- package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +164 -0
- package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +48 -1
- package/src/modules/workflow/git/__tests__/node-git-runner.test.ts +231 -2
- package/src/modules/workflow/git/git.service.ts +176 -38
- package/src/modules/workflow/git/node-git-runner.ts +82 -7
- package/src/modules/workflow/pending-commits.service.ts +29 -1
- package/src/modules/workflow/pending-commits.worker.ts +24 -6
- package/src/modules/workflow/recovery-bot.ts +1 -1
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +2 -1
- package/src/modules/workflow/sanitize-error.ts +50 -0
- package/src/modules/workflow/workflow.service.ts +879 -112
- package/src/modules/workspace/__tests__/agent-downloads.test.ts +823 -0
- package/src/modules/workspace/__tests__/first-run.test.ts +234 -0
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +5 -2
- package/src/modules/workspace/__tests__/md-links.test.ts +353 -0
- package/src/modules/workspace/__tests__/move-links.test.ts +261 -0
- package/src/modules/workspace/__tests__/rest-tool-arguments.test.ts +219 -0
- package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +3 -0
- package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +102 -0
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +52 -5
- package/src/modules/workspace/__tests__/workspace.routes.folder-zip-access.test.ts +190 -0
- package/src/modules/workspace/__tests__/workspace.service.forget-clone-races.test.ts +8 -4
- package/src/modules/workspace/__tests__/workspace.service.test.ts +50 -8
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +44 -1
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +409 -12
- package/src/modules/workspace/agent-download.builder.ts +308 -0
- package/src/modules/workspace/agent-download.routes.ts +183 -0
- package/src/modules/workspace/agent-download.store.ts +533 -0
- package/src/modules/workspace/agent-upload.store.ts +23 -7
- package/src/modules/workspace/file-readers/raw-mime.ts +40 -0
- package/src/modules/workspace/file-readers/text-reader.ts +5 -8
- package/src/modules/workspace/first-run.ts +222 -0
- package/src/modules/workspace/move-links.ts +237 -0
- package/src/modules/workspace/startup/steps/seed-tree.ts +3 -12
- package/src/modules/workspace/workspace.routes.ts +64 -22
- package/src/modules/workspace/workspace.service.ts +202 -25
- package/src/modules/workspace/workspace.tools.ts +492 -63
- package/src/modules/write-access/__tests__/write-access.test.ts +13 -0
- package/src/modules/write-access/write-access.ts +9 -0
- package/src/shared/domain-errors.ts +108 -11
- package/src/shared/git.contract.ts +8 -1
- package/src/shared/utf8-text.ts +21 -0
- package/src/tenancy/__tests__/static-tenant-source.test.ts +1 -0
- package/src/tenancy/static-tenant-source.ts +10 -2
- package/starter-packs/README.md +103 -0
- package/starter-packs/engineering/KnowledgeBase/About us.md +9 -0
- package/starter-packs/engineering/KnowledgeBase/Architecture.md +9 -0
- package/starter-packs/engineering/KnowledgeBase/Glossary.md +9 -0
- package/starter-packs/engineering/KnowledgeBase/How we ship.md +9 -0
- package/starter-packs/engineering/Plugins/engineering-starter/LICENSE +21 -0
- package/starter-packs/engineering/Plugins/engineering-starter/SOURCE.md +20 -0
- package/starter-packs/engineering/Plugins/engineering-starter/access.md +19 -0
- package/starter-packs/engineering/Plugins/engineering-starter/plugin.json +10 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/office-hours/SKILL.md +171 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/office-hours/sections/phase-2a-startup-diagnostic.md +157 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/office-hours/sections/phase-2b-builder-brainstorm.md +39 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/plan-ceo-review/SKILL.md +144 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/plan-eng-review/SKILL.md +144 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/review/SKILL.md +80 -0
- package/starter-packs/engineering/Plugins/engineering-starter/skills/review/checklist.md +184 -0
- package/starter-packs/engineering/pack.yaml +11 -0
- package/starter-packs/general/KnowledgeBase/About us.md +9 -0
- package/starter-packs/general/KnowledgeBase/Glossary.md +9 -0
- package/starter-packs/general/KnowledgeBase/How we work.md +9 -0
- package/starter-packs/general/Plugins/general-starter/LICENSE +202 -0
- package/starter-packs/general/Plugins/general-starter/SOURCE.md +10 -0
- package/starter-packs/general/Plugins/general-starter/access.md +19 -0
- package/starter-packs/general/Plugins/general-starter/plugin.json +10 -0
- package/starter-packs/general/Plugins/general-starter/skills/memory-management/SKILL.md +332 -0
- package/starter-packs/general/Plugins/general-starter/skills/productivity-start/SKILL.md +163 -0
- package/starter-packs/general/Plugins/general-starter/skills/productivity-update/SKILL.md +167 -0
- package/starter-packs/general/Plugins/general-starter/skills/task-management/SKILL.md +83 -0
- package/starter-packs/general/pack.yaml +10 -0
- package/starter-packs/operations/KnowledgeBase/Glossary.md +9 -0
- package/starter-packs/operations/KnowledgeBase/How we work.md +9 -0
- package/starter-packs/operations/KnowledgeBase/Processes.md +9 -0
- package/starter-packs/operations/KnowledgeBase/Tools we use.md +9 -0
- package/starter-packs/operations/KnowledgeBase/Vendors.md +9 -0
- package/starter-packs/operations/Plugins/operations-starter/LICENSE +202 -0
- package/starter-packs/operations/Plugins/operations-starter/SOURCE.md +10 -0
- package/starter-packs/operations/Plugins/operations-starter/access.md +19 -0
- package/starter-packs/operations/Plugins/operations-starter/plugin.json +10 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/capacity-plan/SKILL.md +111 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/change-request/SKILL.md +119 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/compliance-tracking/SKILL.md +44 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/process-doc/SKILL.md +80 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/process-optimization/SKILL.md +39 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/risk-assessment/SKILL.md +40 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/runbook/SKILL.md +85 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/status-report/SKILL.md +75 -0
- package/starter-packs/operations/Plugins/operations-starter/skills/vendor-review/SKILL.md +102 -0
- package/starter-packs/operations/pack.yaml +12 -0
- package/starter-packs/sales/KnowledgeBase/About us.md +9 -0
- package/starter-packs/sales/KnowledgeBase/Customers.md +9 -0
- package/starter-packs/sales/KnowledgeBase/Glossary.md +9 -0
- package/starter-packs/sales/KnowledgeBase/How we sell.md +9 -0
- package/starter-packs/sales/KnowledgeBase/Objections.md +9 -0
- package/starter-packs/sales/KnowledgeBase/Pricing.md +9 -0
- package/starter-packs/sales/Plugins/sales-starter/LICENSE +202 -0
- package/starter-packs/sales/Plugins/sales-starter/SOURCE.md +10 -0
- package/starter-packs/sales/Plugins/sales-starter/access.md +19 -0
- package/starter-packs/sales/Plugins/sales-starter/plugin.json +10 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/account-context/SKILL.md +94 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/account-plan/SKILL.md +95 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/account-research/SKILL.md +99 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/account-tiering/SKILL.md +101 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/call-prep/SKILL.md +111 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/call-summary/SKILL.md +111 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/close-plan/SKILL.md +106 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/competitive-intelligence/SKILL.md +102 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/create-an-asset/SKILL.md +105 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/crm-hygiene-check/SKILL.md +103 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/customer-health/SKILL.md +108 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/customer-voice/SKILL.md +94 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/daily-briefing/SKILL.md +61 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/deal-advance-gap/SKILL.md +102 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/deal-review/SKILL.md +105 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/deal-signals/SKILL.md +96 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/deal-slip-scenario/SKILL.md +104 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/draft-outreach/SKILL.md +116 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/end-of-day/SKILL.md +114 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/expansion-whitespace/SKILL.md +97 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/forecast/SKILL.md +100 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/handle-objection/SKILL.md +93 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/inbox-sweep/SKILL.md +114 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/lead-triage/SKILL.md +106 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/log-activity/SKILL.md +111 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/pipeline-review/SKILL.md +97 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/renewal-radar/SKILL.md +95 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/rep-context/SKILL.md +90 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/route-lead/SKILL.md +111 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/sales-setup/SKILL.md +200 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/schedule-meeting/SKILL.md +99 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/stakeholder-map/SKILL.md +107 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/team-pipeline/SKILL.md +105 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/update-opportunity/SKILL.md +112 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/weekly-wrap/SKILL.md +90 -0
- package/starter-packs/sales/Plugins/sales-starter/skills/win-loss-review/SKILL.md +88 -0
- package/starter-packs/sales/pack.yaml +13 -0
- package/starter-packs/support/KnowledgeBase/Escalations.md +9 -0
- package/starter-packs/support/KnowledgeBase/Glossary.md +9 -0
- package/starter-packs/support/KnowledgeBase/Known issues.md +9 -0
- package/starter-packs/support/KnowledgeBase/Products.md +9 -0
- package/starter-packs/support/KnowledgeBase/Tone of voice.md +9 -0
- package/starter-packs/support/Plugins/support-starter/LICENSE +202 -0
- package/starter-packs/support/Plugins/support-starter/SOURCE.md +10 -0
- package/starter-packs/support/Plugins/support-starter/access.md +19 -0
- package/starter-packs/support/Plugins/support-starter/plugin.json +10 -0
- package/starter-packs/support/Plugins/support-starter/skills/customer-escalation/SKILL.md +246 -0
- package/starter-packs/support/Plugins/support-starter/skills/customer-research/SKILL.md +250 -0
- package/starter-packs/support/Plugins/support-starter/skills/draft-response/SKILL.md +416 -0
- package/starter-packs/support/Plugins/support-starter/skills/kb-article/SKILL.md +350 -0
- package/starter-packs/support/Plugins/support-starter/skills/ticket-triage/SKILL.md +273 -0
- package/starter-packs/support/pack.yaml +12 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-handler.js","sourceRoot":"","sources":["../../../src/modules/tool-helpers/tool-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,SAAS,EAAoB,MAAM,oBAAoB,CAAC;AAChF,OAAO,
|
|
1
|
+
{"version":3,"file":"tool-handler.js","sourceRoot":"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G,CAAC,OAAO,EAAE,CAAC,CAAC;oBAChE,OAAO;gBACT,CAAC;gBACD,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;gBACjE,GAAG,CAAC,KAAK,CAAC,iBAAiB,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;gBAC9C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YACvC,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,IAA6B;IAClD,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,MAAM,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;IACzB,OAAO,IAAI,CAAC,MAAM,CAAC;IACnB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -44,6 +44,15 @@ export interface ToolContext {
|
|
|
44
44
|
* still fails closed regardless of this).
|
|
45
45
|
*/
|
|
46
46
|
focusedBranch?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The branch this call runs on, resolved by the tool handler before the tool
|
|
49
|
+
* ran from the tool's branch declaration (see `BranchDeclaration`): the one
|
|
50
|
+
* the caller named, or the deployment's default branch for a
|
|
51
|
+
* `defaults-to-default-branch` tool called without one. Set for every tool
|
|
52
|
+
* that declares a branch, and always a non-empty string then; absent for a
|
|
53
|
+
* tool that takes no branch.
|
|
54
|
+
*/
|
|
55
|
+
branch?: string;
|
|
47
56
|
abortSignal: AbortSignal;
|
|
48
57
|
workspaceService: WorkspaceService;
|
|
49
58
|
workflowService: IWorkflowService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.contract.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-helpers/tool.contract.ts"],"names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EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,WAAW,KACb,OAAO,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;AAE/C;;;;;;;;GAQG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAGhC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBAF1C,OAAO,EAAE,MAAM,EACN,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAA;CAK7C;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAUtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.contract.js","sourceRoot":"","sources":["../../../src/modules/tool-helpers/tool.contract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool.contract.js","sourceRoot":"","sources":["../../../src/modules/tool-helpers/tool.contract.ts"],"names":[],"mappings":"AA8EA;;;;;;;;GAQG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAGvB;IACA;IAHX,YACE,OAAe,EACN,MAAc,EACd,OAAiC;QAE1C,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,WAAM,GAAN,MAAM,CAAQ;QACd,YAAO,GAAP,OAAO,CAA0B;QAG1C,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC1D,MAAM,MAAM,GAAI,GAA4B,CAAC,MAAM,CAAC;IACpD,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ;QAC1B,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC;QACxB,MAAM,IAAI,GAAG;QACb,MAAM,IAAI,GAAG;QACb,OAAQ,GAA6B,CAAC,OAAO,KAAK,QAAQ,CAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-manuals.tools.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-manuals/tool-manuals.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-manuals.tools.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-manuals/tool-manuals.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAI5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,CACP,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,OAAO,CAAC;QAAC,cAAc,EAAE,OAAO,CAAC;QAAC,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC,CAAC;CAC5G;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,kBAAkB,EAC/B,iBAAiB,EAAE,kBAAkB,EACrC,IAAI,EAAE;IACJ,aAAa,EAAE,cAAc,CAAC;IAC9B,cAAc,EAAE,kBAAkB,CAAC;IACnC,yDAAyD;IACzD,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,eAAe,GAAG,oBAAoB,CAAC,CAAC;IAC5D;;;;OAIG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,GACA,IAAI,CAwPN"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { toolDef } from '../tool-helpers/tool-def.js';
|
|
2
|
+
import { declareRouteTool } from '../tool-helpers/route-tool-schemas.js';
|
|
2
3
|
import { utcpNamespacedKey } from '../../shared/utcp-namespace.js';
|
|
3
4
|
/**
|
|
4
5
|
* Registers the tool-manual catalog tools (both surfaces) and hosts their
|
|
@@ -14,6 +15,11 @@ import { utcpNamespacedKey } from '../../shared/utcp-namespace.js';
|
|
|
14
15
|
export function registerToolManualsTools(registry, router, toolAuth, toolHandler, toolManualService, deps) {
|
|
15
16
|
registry.registerExternalTool((ctx) => buildListLocalToolsDef(toolManualService, ctx.userEmail));
|
|
16
17
|
registry.registerInternalTool((ctx) => buildListLocalToolsDef(toolManualService, ctx.userEmail));
|
|
18
|
+
// The def above is built per catalog listing (its description names the
|
|
19
|
+
// tools configured for THIS caller), so declare the arguments here as well:
|
|
20
|
+
// a direct REST call that lands before the first listing must be checked
|
|
21
|
+
// against them too.
|
|
22
|
+
declareRouteTool('list_local_tools', LIST_LOCAL_TOOLS_INPUTS);
|
|
17
23
|
router.post('/agent/tools/list_local_tools', toolAuth, toolHandler(async (_args, ctx) => ({
|
|
18
24
|
tools: await toolManualService.listLocalOnly(ctx.user.email),
|
|
19
25
|
})));
|
|
@@ -32,12 +38,13 @@ export function registerToolManualsTools(registry, router, toolAuth, toolHandler
|
|
|
32
38
|
// answers and the four things an agent cannot read off a field.
|
|
33
39
|
//
|
|
34
40
|
// It sits a few characters under `TOOL_DESCRIPTION_CAP` WITH the guide-first
|
|
35
|
-
// sentence the registry puts in front of it (`tool-registry/guide-first.ts`)
|
|
41
|
+
// sentence the registry puts in front of it (`tool-registry/guide-first.ts`)
|
|
42
|
+
// and the `Call:` line generated ahead of everything,
|
|
36
43
|
// which is why every sentence here is the short form: the `hiddenTools`
|
|
37
44
|
// clause and that opener both came out of the same budget, and what a
|
|
38
45
|
// hidden tool's entry CONTAINS is on the field below rather than here.
|
|
39
|
-
description: 'Configuration status of every `.tool` the current user can access: what each
|
|
40
|
-
'
|
|
46
|
+
description: 'Configuration status of every `.tool` the current user can access: what each needs set up and what is ' +
|
|
47
|
+
'configured, as `{ tools, invalid, onBranchOnly, note? }`. Scoped to the CALLER: a `.tool` it cannot ' +
|
|
41
48
|
'READ is absent, and every flag is the caller\'s own. ' +
|
|
42
49
|
'Secret VALUES are never returned and can never be set through a tool: an admin enters them in the tool ' +
|
|
43
50
|
'editor; users sign in on /connect. ' +
|
|
@@ -48,7 +55,7 @@ export function registerToolManualsTools(registry, router, toolAuth, toolHandler
|
|
|
48
55
|
'The listing is the RELEASED catalog, built from the default branch only: a server or `.tool` you declared on a ' +
|
|
49
56
|
'draft is not listed, callable or signed-in-able until it is merged. Pass `branch` (the draft you wrote the ' +
|
|
50
57
|
'declaration on) and `onBranchOnly` names every tool declared there that the default branch does not serve ' +
|
|
51
|
-
'yet — open a change request and ask the user to merge it
|
|
58
|
+
'yet — open a change request and ask the user to merge it.',
|
|
52
59
|
path: '/api/agent/tools/list_tool_setup',
|
|
53
60
|
inputs: {
|
|
54
61
|
type: 'object',
|
|
@@ -242,6 +249,8 @@ async function localToolsLine(svc, userEmail) {
|
|
|
242
249
|
return 'No local-only tools are currently configured.';
|
|
243
250
|
return `Local-only tools configured for you: ${tools.map((t) => `\`${t.name}\``).join(', ')}.`;
|
|
244
251
|
}
|
|
252
|
+
/** `list_local_tools` takes nothing; a const so the route and the def share one declaration. */
|
|
253
|
+
const LIST_LOCAL_TOOLS_INPUTS = { type: 'object', properties: {}, additionalProperties: false };
|
|
245
254
|
async function buildListLocalToolsDef(svc, userEmail) {
|
|
246
255
|
return toolDef({
|
|
247
256
|
name: 'list_local_tools',
|
|
@@ -256,7 +265,7 @@ async function buildListLocalToolsDef(svc, userEmail) {
|
|
|
256
265
|
'setup by hand. ' +
|
|
257
266
|
(await localToolsLine(svc, userEmail)),
|
|
258
267
|
path: '/api/agent/tools/list_local_tools',
|
|
259
|
-
inputs:
|
|
268
|
+
inputs: LIST_LOCAL_TOOLS_INPUTS,
|
|
260
269
|
outputs: {
|
|
261
270
|
type: 'object',
|
|
262
271
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-manuals.tools.js","sourceRoot":"","sources":["../../../src/modules/tool-manuals/tool-manuals.tools.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-manuals.tools.js","sourceRoot":"","sources":["../../../src/modules/tool-manuals/tool-manuals.tools.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAiBnE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,wBAAwB,CACtC,QAAuB,EACvB,MAAc,EACd,QAAwB,EACxB,WAA+B,EAC/B,iBAAqC,EACrC,IAWC;IAED,QAAQ,CAAC,oBAAoB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,sBAAsB,CAAC,iBAAiB,EAAE,GA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T_SHORT_CUT = 500;
|
|
57
|
+
/** What these measurements read of a tool: its name, its text and the schema its `Call:` line is generated from. */
|
|
58
|
+
export type MeasuredTool = Pick<UtcpTool, 'name' | 'description'> & {
|
|
59
|
+
inputs?: unknown;
|
|
60
|
+
};
|
|
57
61
|
/**
|
|
58
62
|
* Where the tool's OWN opening sentence ends in the text a client is handed:
|
|
59
63
|
* the purpose prefix counted at its cap, as in {@link clientVisibleLength},
|
|
@@ -64,7 +68,7 @@ export declare const CLIENT_SHORT_CUT = 500;
|
|
|
64
68
|
* A description with no sentence-ending punctuation counts whole — the honest
|
|
65
69
|
* answer for text that never finishes a sentence.
|
|
66
70
|
*/
|
|
67
|
-
export declare function firstSentenceEnd(tool:
|
|
71
|
+
export declare function firstSentenceEnd(tool: MeasuredTool): number;
|
|
68
72
|
/**
|
|
69
73
|
* The length of the description as a CLIENT receives it — which for the four
|
|
70
74
|
* knowledge-base tools includes the deployment's purpose prefix, since the MCP
|
|
@@ -76,5 +80,5 @@ export declare function firstSentenceEnd(tool: Pick<UtcpTool, 'name' | 'descript
|
|
|
76
80
|
* The guide-first sentence every listed tool opens with is already in the
|
|
77
81
|
* description the registry lists, so it is measured as the text it is.
|
|
78
82
|
*/
|
|
79
|
-
export declare function clientVisibleLength(tool:
|
|
83
|
+
export declare function clientVisibleLength(tool: MeasuredTool): number;
|
|
80
84
|
//# sourceMappingURL=description-length.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description-length.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-registry/description-length.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"description-length.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-registry/description-length.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,oBAAoB,OAAQ,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,oHAAoH;AACpH,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAkBzF;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAa3D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAG9D"}
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
* with the one sentence sending the agent there (`guide-first.ts`), which is
|
|
11
11
|
* what makes the cap below reachable rather than aspirational.
|
|
12
12
|
*/
|
|
13
|
+
import { callLine, splitCallLine } from '@bevel-software/platform-mcp-core';
|
|
13
14
|
import { TOOL_PREFIX_CAP } from '@bevel-software/platform-shared';
|
|
14
15
|
import { PREFIXED_TOOLS } from '../agent-instructions/compose.js';
|
|
16
|
+
import { EXTERNAL_KB_MANUAL_NAME } from '../tool-manuals/tool-manuals.contract.js';
|
|
15
17
|
import { GUIDE_FIRST_SENTENCE } from './guide-first.js';
|
|
16
18
|
/**
|
|
17
19
|
* The ceiling on what a client is handed for one tool, enforced by
|
|
@@ -56,6 +58,21 @@ export const TOOL_DESCRIPTION_CAP = 1_200;
|
|
|
56
58
|
* rather than a comment.
|
|
57
59
|
*/
|
|
58
60
|
export const CLIENT_SHORT_CUT = 500;
|
|
61
|
+
/**
|
|
62
|
+
* The `Call:` line a client is handed ahead of everything else, and the blank
|
|
63
|
+
* line after it — counted, because it is part of what a client cuts. Taken
|
|
64
|
+
* from the description when it already opens with one (a meta-tool is built
|
|
65
|
+
* with its line), generated from the tool's inputs under the namespace the
|
|
66
|
+
* hosted endpoint serves otherwise, as mcp-core's `withCallExample` does at
|
|
67
|
+
* listing time. The rest of the description comes back beside it.
|
|
68
|
+
*/
|
|
69
|
+
function splitServedCallLine(tool) {
|
|
70
|
+
const { call, rest } = splitCallLine(tool.description ?? '');
|
|
71
|
+
const line = call ?? callLine(`${EXTERNAL_KB_MANUAL_NAME}.${tool.name}`, tool.inputs);
|
|
72
|
+
// The blank line after it only when something follows it.
|
|
73
|
+
const followed = rest !== '' || PREFIXED_TOOLS.has(tool.name);
|
|
74
|
+
return { callChars: line.length + (followed ? 2 : 0), rest };
|
|
75
|
+
}
|
|
59
76
|
/**
|
|
60
77
|
* Where the tool's OWN opening sentence ends in the text a client is handed:
|
|
61
78
|
* the purpose prefix counted at its cap, as in {@link clientVisibleLength},
|
|
@@ -67,8 +84,8 @@ export const CLIENT_SHORT_CUT = 500;
|
|
|
67
84
|
* answer for text that never finishes a sentence.
|
|
68
85
|
*/
|
|
69
86
|
export function firstSentenceEnd(tool) {
|
|
70
|
-
const
|
|
71
|
-
const
|
|
87
|
+
const { callChars, rest: description } = splitServedCallLine(tool);
|
|
88
|
+
const prefix = callChars + (PREFIXED_TOOLS.has(tool.name) ? TOOL_PREFIX_CAP + 2 : 0);
|
|
72
89
|
if (description === '')
|
|
73
90
|
return prefix;
|
|
74
91
|
// The opener and whatever whitespace follows it: `guideFirstDescription`
|
|
@@ -93,14 +110,19 @@ export function firstSentenceEnd(tool) {
|
|
|
93
110
|
* description the registry lists, so it is measured as the text it is.
|
|
94
111
|
*/
|
|
95
112
|
export function clientVisibleLength(tool) {
|
|
96
|
-
const
|
|
113
|
+
const { callChars, rest } = splitServedCallLine(tool);
|
|
114
|
+
return callChars + ownVisibleLength(tool.name, rest);
|
|
115
|
+
}
|
|
116
|
+
/** {@link clientVisibleLength} without the `Call:` line: the purpose prefix and the tool's own text. */
|
|
117
|
+
function ownVisibleLength(name, description) {
|
|
118
|
+
const own = description.length;
|
|
97
119
|
// A prefixed tool with no description of its own is still handed the prefix,
|
|
98
120
|
// and nothing else — `prefixToolDescription` sends the prefix alone, with no
|
|
99
121
|
// blank line after it. Measuring that as zero would under-report the only
|
|
100
122
|
// text the client got.
|
|
101
123
|
if (own === 0)
|
|
102
|
-
return PREFIXED_TOOLS.has(
|
|
124
|
+
return PREFIXED_TOOLS.has(name) ? TOOL_PREFIX_CAP : 0;
|
|
103
125
|
// `+ 2` for the blank line `prefixToolDescription` puts between the two.
|
|
104
|
-
return PREFIXED_TOOLS.has(
|
|
126
|
+
return PREFIXED_TOOLS.has(name) ? own + TOOL_PREFIX_CAP + 2 : own;
|
|
105
127
|
}
|
|
106
128
|
//# sourceMappingURL=description-length.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description-length.js","sourceRoot":"","sources":["../../../src/modules/tool-registry/description-length.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"description-length.js","sourceRoot":"","sources":["../../../src/modules/tool-registry/description-length.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD;;;;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,MAAM,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC;QAC/G,CAAC,CAAC,CAAC,CAAC;IACN,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IACtE,OAAO,MAAM,GAAG,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;AAChD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAkB;IACpD,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACtD,OAAO,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,wGAAwG;AACxG,SAAS,gBAAgB,CAAC,IAAY,EAAE,WAAmB;IACzD,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC;IAC/B,6EAA6E;IAC7E,6EAA6E;IAC7E,0EAA0E;IAC1E,uBAAuB;IACvB,IAAI,GAAG,KAAK,CAAC;QAAE,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,yEAAyE;IACzE,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACpE,CAAC"}
|
|
@@ -16,6 +16,10 @@ export declare const GUIDE_FIRST_SENTENCE = "Call `get_agent_guide` first and re
|
|
|
16
16
|
* sentence is put in front of a description — the registry for the tools it
|
|
17
17
|
* lists, the MCP service for the meta-tools it builds itself — so the two
|
|
18
18
|
* cannot drift apart on what "once" means.
|
|
19
|
+
*
|
|
20
|
+
* Behind a `Call:` line, never ahead of it: the call example is the first
|
|
21
|
+
* line of every description (see mcp-core's `withCallExample`), and the
|
|
22
|
+
* sentence opens what follows it.
|
|
19
23
|
*/
|
|
20
24
|
export declare function guideFirstDescription(description: string | undefined): string;
|
|
21
25
|
/** `tool` as the catalog lists it: the sentence ahead of its own description, except on the guide's own tool. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-first.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-registry/guide-first.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guide-first.d.ts","sourceRoot":"","sources":["../../../src/modules/tool-registry/guide-first.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,0FAAoG,CAAC;AAEtI;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAM7E;AAED,iHAAiH;AACjH,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAIvD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { splitCallLine } from '@bevel-software/platform-mcp-core';
|
|
1
2
|
/** The one tool that returns the platform's guide (see `modules/agent-guide`). */
|
|
2
3
|
export const GET_AGENT_GUIDE_TOOL = 'get_agent_guide';
|
|
3
4
|
/**
|
|
@@ -15,9 +16,16 @@ export const GUIDE_FIRST_SENTENCE = `Call \`${GET_AGENT_GUIDE_TOOL}\` first and
|
|
|
15
16
|
* sentence is put in front of a description — the registry for the tools it
|
|
16
17
|
* lists, the MCP service for the meta-tools it builds itself — so the two
|
|
17
18
|
* cannot drift apart on what "once" means.
|
|
19
|
+
*
|
|
20
|
+
* Behind a `Call:` line, never ahead of it: the call example is the first
|
|
21
|
+
* line of every description (see mcp-core's `withCallExample`), and the
|
|
22
|
+
* sentence opens what follows it.
|
|
18
23
|
*/
|
|
19
24
|
export function guideFirstDescription(description) {
|
|
20
|
-
const
|
|
25
|
+
const { call, rest } = splitCallLine(description ?? '');
|
|
26
|
+
if (call !== null)
|
|
27
|
+
return `${call}\n\n${guideFirstDescription(rest)}`;
|
|
28
|
+
const own = rest;
|
|
21
29
|
if (own.startsWith(GUIDE_FIRST_SENTENCE))
|
|
22
30
|
return own;
|
|
23
31
|
return own ? `${GUIDE_FIRST_SENTENCE} ${own}` : GUIDE_FIRST_SENTENCE;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-first.js","sourceRoot":"","sources":["../../../src/modules/tool-registry/guide-first.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guide-first.js","sourceRoot":"","sources":["../../../src/modules/tool-registry/guide-first.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGlE,kFAAkF;AAClF,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,oBAAoB,mEAAmE,CAAC;AAEtI;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,WAA+B;IACnE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,aAAa,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;IACxD,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,GAAG,IAAI,OAAO,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtE,MAAM,GAAG,GAAG,IAAI,CAAC;IACjB,IAAI,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAAE,OAAO,GAAG,CAAC;IACrD,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,oBAAoB,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC;AACvE,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,cAAc,CAAC,IAAc;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,oBAAoB;QAAE,OAAO,IAAI,CAAC;IACpD,MAAM,WAAW,GAAG,qBAAqB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5D,OAAO,WAAW,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,CAAC;AAC5E,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Router, RequestHandler } from 'express';
|
|
2
|
+
import type { ChangeRequestDetail } from '@bevel-software/platform-shared';
|
|
2
3
|
import type { IToolRegistry } from '../../tool-registry/tool.contract.js';
|
|
4
|
+
import { ToolError, type ToolContext } from '../../tool-helpers/tool.contract.js';
|
|
3
5
|
import type { ToolHandlerFactory } from '../../tool-helpers/tool-handler.js';
|
|
4
6
|
import type { KbContext } from '../../../shared/kb-context.js';
|
|
5
7
|
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
@@ -70,4 +72,55 @@ import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
|
70
72
|
* clone that does not have the merge commit yet.
|
|
71
73
|
*/
|
|
72
74
|
export declare function registerChangeRequestReadTools(registry: IToolRegistry, router: Router, toolAuth: RequestHandler, toolHandler: ToolHandlerFactory, accessControl: Pick<IAccessControl, 'canReadBatchAtRef'>, kb: Pick<KbContext, 'defaultWorkspaceId'>): void;
|
|
75
|
+
/**
|
|
76
|
+
* The detail of request `number` with the access filter applied, or a 404 —
|
|
77
|
+
* the one place the four by-number tools get their data, so they cannot
|
|
78
|
+
* drift on who may see what.
|
|
79
|
+
*/
|
|
80
|
+
export interface ScopedDetail {
|
|
81
|
+
detail: ChangeRequestDetail;
|
|
82
|
+
/**
|
|
83
|
+
* Whether the caller may read one path of this request — the raw per-path
|
|
84
|
+
* verdict, as the access tree gives it at `origin/<base>`.
|
|
85
|
+
*/
|
|
86
|
+
mayRead: (path: string) => boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether this request may NAME `path` to the caller — `mayRead`, minus
|
|
89
|
+
* every name a withheld file goes by. The ONE verdict the tools below ask
|
|
90
|
+
* about a path, so none of them can decide it a second way.
|
|
91
|
+
*
|
|
92
|
+
* The two differ on exactly one shape, and it is the shape that leaks: a
|
|
93
|
+
* file moved out of a folder the caller may not read is readable under
|
|
94
|
+
* its NEW name, yet `fileIsReadable` withholds it whole (its diff shows the
|
|
95
|
+
* old path's content). Anything keyed on that new path — an approval, a
|
|
96
|
+
* comment anchored to it — would otherwise say the request touches a file
|
|
97
|
+
* the file tool refuses to list, under a name it refuses to print.
|
|
98
|
+
*/
|
|
99
|
+
mayShow: (path: string) => boolean;
|
|
100
|
+
/** The request's files the caller may read, in the request's own order. */
|
|
101
|
+
readableFiles: ChangeRequestDetail['files'];
|
|
102
|
+
/**
|
|
103
|
+
* Every name the withheld files go by — for filtering the gate blockers and
|
|
104
|
+
* for deciding `mayShow`. NEVER answered: use `withheldFileCount` to report
|
|
105
|
+
* them.
|
|
106
|
+
*/
|
|
107
|
+
withheldFilePaths: string[];
|
|
108
|
+
/** How many files are withheld. One per file, whatever its move names. */
|
|
109
|
+
withheldFileCount: number;
|
|
110
|
+
viewerIsAuthor: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The access scope of one change request, as every by-number read tool sees
|
|
114
|
+
* it — and as `delete_branch` does, so a deletion's preview or refusal never
|
|
115
|
+
* names a request `get_change_request` answers as not found.
|
|
116
|
+
*/
|
|
117
|
+
export declare function changeRequestScope(accessControl: Pick<IAccessControl, 'canReadBatchAtRef'>, kb: Pick<KbContext, 'defaultWorkspaceId'>): {
|
|
118
|
+
repoGlobalWorkspaceId: (ctx: ToolContext) => Promise<string>;
|
|
119
|
+
readablePaths: (ctx: ToolContext, workspaceId: string, base: string, paths: string[]) => Promise<Set<string>>;
|
|
120
|
+
scopedDetail: (ctx: ToolContext, number: number, opts: {
|
|
121
|
+
patches: boolean;
|
|
122
|
+
}) => Promise<ScopedDetail>;
|
|
123
|
+
notFound: (number: number) => ToolError;
|
|
124
|
+
maySee: (ctx: ToolContext, number: number) => Promise<boolean>;
|
|
125
|
+
};
|
|
73
126
|
//# sourceMappingURL=change-request-read.tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-request-read.tools.d.ts","sourceRoot":"","sources":["../../../../src/modules/workflow/agent-tools/change-request-read.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"change-request-read.tools.d.ts","sourceRoot":"","sources":["../../../../src/modules/workflow/agent-tools/change-request-read.tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,KAAK,EAEV,mBAAmB,EAGpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAoB,MAAM,qCAAqC,CAAC;AAEpG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAsB/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,WAAW,EAAE,kBAAkB,EAC/B,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,EACxD,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,GACxC,IAAI,CA0fN;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,mBAAmB,CAAC;IAC5B;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC;;;;;;;;;;;OAWG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACnC,2EAA2E;IAC3E,aAAa,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC5C;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,0EAA0E;IAC1E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,EACxD,EAAE,EAAE,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC;iCAOC,WAAW,KAAG,OAAO,CAAC,MAAM,CAAC;yBAUhE,WAAW,eACH,MAAM,QACb,MAAM,SACL,MAAM,EAAE,KACd,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBAahB,WAAW,UACR,MAAM,QACR;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KACzB,OAAO,CAAC,YAAY,CAAC;uBA8CE,MAAM,KAAG,SAAS;kBAIjB,WAAW,UAAU,MAAM,KAAG,OAAO,CAAC,OAAO,CAAC;EAW1E"}
|
|
@@ -88,12 +88,6 @@ export function registerChangeRequestReadTools(registry, router, toolAuth, toolH
|
|
|
88
88
|
registry.registerExternalTool(def);
|
|
89
89
|
router.post(path.slice('/api'.length), toolAuth, toolHandler(spec.handler, { write: false }));
|
|
90
90
|
};
|
|
91
|
-
/**
|
|
92
|
-
* A clone to resolve access verdicts in. All clones track the same origin and
|
|
93
|
-
* every verdict here is read at `origin/<base>`, so any existing one answers
|
|
94
|
-
* identically — reusing one avoids cloning a branch just to read a ref.
|
|
95
|
-
*/
|
|
96
|
-
const repoGlobalWorkspaceId = async (ctx) => (await ctx.workspaceService.findAnyWorkspaceId()) ?? kb.defaultWorkspaceId();
|
|
97
91
|
/** A change-request number as the tools accept it. */
|
|
98
92
|
const numberArg = (args) => {
|
|
99
93
|
const n = args.number;
|
|
@@ -105,67 +99,7 @@ export function registerChangeRequestReadTools(registry, router, toolAuth, toolH
|
|
|
105
99
|
}
|
|
106
100
|
return n;
|
|
107
101
|
};
|
|
108
|
-
|
|
109
|
-
* Read verdicts for `paths` at `origin/<base>`, as a membership set of what
|
|
110
|
-
* the caller MAY read. A null answer (the ref or its `roles.yaml` does not
|
|
111
|
-
* resolve) withholds everything, which is the same reading the app's
|
|
112
|
-
* fork-point route gives it.
|
|
113
|
-
*/
|
|
114
|
-
const readablePaths = async (ctx, workspaceId, base, paths) => {
|
|
115
|
-
if (paths.length === 0)
|
|
116
|
-
return new Set();
|
|
117
|
-
const verdicts = await accessControl.canReadBatchAtRef(workspaceId, `origin/${base}`, ctx.user.email, [...new Set(paths)]);
|
|
118
|
-
if (!verdicts)
|
|
119
|
-
return new Set();
|
|
120
|
-
return new Set([...verdicts].filter(([, allowed]) => allowed).map(([p]) => p));
|
|
121
|
-
};
|
|
122
|
-
const scopedDetail = async (ctx, number, opts) => {
|
|
123
|
-
const workspaceId = await repoGlobalWorkspaceId(ctx);
|
|
124
|
-
const detail = await ctx.workflowService.getChangeRequestDetail(number, {
|
|
125
|
-
workspaceId,
|
|
126
|
-
viewerEmail: ctx.user.email,
|
|
127
|
-
patches: opts.patches,
|
|
128
|
-
});
|
|
129
|
-
if (!detail)
|
|
130
|
-
throw notFound(number);
|
|
131
|
-
const viewerIsAuthor = isAuthor(detail, ctx.user.email);
|
|
132
|
-
// Comment paths join the batch: a comment may name a file the request no
|
|
133
|
-
// longer changes, and without a verdict of its own it would be withheld
|
|
134
|
-
// from a caller who can read it perfectly well.
|
|
135
|
-
const commentPaths = detail.comments.map((c) => c.path).filter((p) => !!p);
|
|
136
|
-
// BOTH names of every file: a move is judged on its old path as well as
|
|
137
|
-
// its new one, because the diff of a move shows what was at the old one.
|
|
138
|
-
const readable = await readablePaths(ctx, workspaceId, detail.base, [
|
|
139
|
-
...detail.files.flatMap(pathsOf),
|
|
140
|
-
...commentPaths,
|
|
141
|
-
]);
|
|
142
|
-
const mayRead = (path) => readable.has(path);
|
|
143
|
-
const readableFiles = detail.files.filter((f) => fileIsReadable(f, mayRead));
|
|
144
|
-
if (!maySeeChangeRequest({ readableFiles: readableFiles.length, isAuthor: viewerIsAuthor })) {
|
|
145
|
-
throw notFound(number);
|
|
146
|
-
}
|
|
147
|
-
// Every name a withheld file goes by, so a gate warning quoting either
|
|
148
|
-
// spelling is caught by the blocker filter — and so `mayShow` catches
|
|
149
|
-
// whichever spelling an approval or a comment happens to use.
|
|
150
|
-
const withheldFilePaths = detail.files
|
|
151
|
-
.filter((f) => !fileIsReadable(f, mayRead))
|
|
152
|
-
.flatMap(pathsOf);
|
|
153
|
-
const withheldNames = new Set(withheldFilePaths);
|
|
154
|
-
return {
|
|
155
|
-
detail,
|
|
156
|
-
mayRead,
|
|
157
|
-
mayShow: (path) => mayRead(path) && !withheldNames.has(path),
|
|
158
|
-
readableFiles,
|
|
159
|
-
withheldFilePaths,
|
|
160
|
-
withheldFileCount: detail.files.length - readableFiles.length,
|
|
161
|
-
viewerIsAuthor,
|
|
162
|
-
};
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* The same answer for a number that was never issued and for one the caller
|
|
166
|
-
* may not see — requirement 7. Says nothing a probe could tell apart.
|
|
167
|
-
*/
|
|
168
|
-
const notFound = (number) => new ToolError(`Change request #${number} not found.`, 404);
|
|
102
|
+
const { repoGlobalWorkspaceId, readablePaths, scopedDetail } = changeRequestScope(accessControl, kb);
|
|
169
103
|
/**
|
|
170
104
|
* The changed files of a SUMMARY, as the pairs a read gate decides over.
|
|
171
105
|
*
|
|
@@ -261,7 +195,15 @@ export function registerChangeRequestReadTools(registry, router, toolAuth, toolH
|
|
|
261
195
|
required: ['changeRequests', ...pagingRequired],
|
|
262
196
|
},
|
|
263
197
|
handler: async (args, ctx) => {
|
|
264
|
-
|
|
198
|
+
// The answer spells a merged request `state: merged`, so an agent that
|
|
199
|
+
// copies that word back into the filter is asking for the applied
|
|
200
|
+
// ones. Quietly answering the open ones instead reads as "there are no
|
|
201
|
+
// merged requests" — refuse, and name the filter's own vocabulary.
|
|
202
|
+
const state = args.state === undefined ? 'open' : args.state;
|
|
203
|
+
if (state !== 'open' && state !== 'closed' && state !== 'all') {
|
|
204
|
+
throw new ToolError(`Unknown \`state\` ${JSON.stringify(state)}. Use \`open\` (the default), \`closed\` ` +
|
|
205
|
+
'(applied and declined alike) or `all`; the answer then says `merged` or `closed` for each.', 400);
|
|
206
|
+
}
|
|
265
207
|
const head = typeof args.head === 'string' ? args.head : undefined;
|
|
266
208
|
const base = typeof args.base === 'string' ? args.base : undefined;
|
|
267
209
|
const author = typeof args.author === 'string' ? args.author : undefined;
|
|
@@ -579,4 +521,91 @@ export function registerChangeRequestReadTools(registry, router, toolAuth, toolH
|
|
|
579
521
|
},
|
|
580
522
|
});
|
|
581
523
|
}
|
|
524
|
+
/**
|
|
525
|
+
* The access scope of one change request, as every by-number read tool sees
|
|
526
|
+
* it — and as `delete_branch` does, so a deletion's preview or refusal never
|
|
527
|
+
* names a request `get_change_request` answers as not found.
|
|
528
|
+
*/
|
|
529
|
+
export function changeRequestScope(accessControl, kb) {
|
|
530
|
+
/**
|
|
531
|
+
* A clone to resolve access verdicts in. All clones track the same origin and
|
|
532
|
+
* every verdict here is read at `origin/<base>`, so any existing one answers
|
|
533
|
+
* identically — reusing one avoids cloning a branch just to read a ref.
|
|
534
|
+
*/
|
|
535
|
+
const repoGlobalWorkspaceId = async (ctx) => (await ctx.workspaceService.findAnyWorkspaceId()) ?? kb.defaultWorkspaceId();
|
|
536
|
+
/**
|
|
537
|
+
* Read verdicts for `paths` at `origin/<base>`, as a membership set of what
|
|
538
|
+
* the caller MAY read. A null answer (the ref or its `roles.yaml` does not
|
|
539
|
+
* resolve) withholds everything, which is the same reading the app's
|
|
540
|
+
* fork-point route gives it.
|
|
541
|
+
*/
|
|
542
|
+
const readablePaths = async (ctx, workspaceId, base, paths) => {
|
|
543
|
+
if (paths.length === 0)
|
|
544
|
+
return new Set();
|
|
545
|
+
const verdicts = await accessControl.canReadBatchAtRef(workspaceId, `origin/${base}`, ctx.user.email, [...new Set(paths)]);
|
|
546
|
+
if (!verdicts)
|
|
547
|
+
return new Set();
|
|
548
|
+
return new Set([...verdicts].filter(([, allowed]) => allowed).map(([p]) => p));
|
|
549
|
+
};
|
|
550
|
+
const scopedDetail = async (ctx, number, opts) => {
|
|
551
|
+
const workspaceId = await repoGlobalWorkspaceId(ctx);
|
|
552
|
+
const detail = await ctx.workflowService.getChangeRequestDetail(number, {
|
|
553
|
+
workspaceId,
|
|
554
|
+
viewerEmail: ctx.user.email,
|
|
555
|
+
patches: opts.patches,
|
|
556
|
+
});
|
|
557
|
+
if (!detail)
|
|
558
|
+
throw notFound(number);
|
|
559
|
+
const viewerIsAuthor = isAuthor(detail, ctx.user.email);
|
|
560
|
+
// Comment paths join the batch: a comment may name a file the request no
|
|
561
|
+
// longer changes, and without a verdict of its own it would be withheld
|
|
562
|
+
// from a caller who can read it perfectly well.
|
|
563
|
+
const commentPaths = detail.comments.map((c) => c.path).filter((p) => !!p);
|
|
564
|
+
// BOTH names of every file: a move is judged on its old path as well as
|
|
565
|
+
// its new one, because the diff of a move shows what was at the old one.
|
|
566
|
+
const readable = await readablePaths(ctx, workspaceId, detail.base, [
|
|
567
|
+
...detail.files.flatMap(pathsOf),
|
|
568
|
+
...commentPaths,
|
|
569
|
+
]);
|
|
570
|
+
const mayRead = (path) => readable.has(path);
|
|
571
|
+
const readableFiles = detail.files.filter((f) => fileIsReadable(f, mayRead));
|
|
572
|
+
if (!maySeeChangeRequest({ readableFiles: readableFiles.length, isAuthor: viewerIsAuthor })) {
|
|
573
|
+
throw notFound(number);
|
|
574
|
+
}
|
|
575
|
+
// Every name a withheld file goes by, so a gate warning quoting either
|
|
576
|
+
// spelling is caught by the blocker filter — and so `mayShow` catches
|
|
577
|
+
// whichever spelling an approval or a comment happens to use.
|
|
578
|
+
const withheldFilePaths = detail.files
|
|
579
|
+
.filter((f) => !fileIsReadable(f, mayRead))
|
|
580
|
+
.flatMap(pathsOf);
|
|
581
|
+
const withheldNames = new Set(withheldFilePaths);
|
|
582
|
+
return {
|
|
583
|
+
detail,
|
|
584
|
+
mayRead,
|
|
585
|
+
mayShow: (path) => mayRead(path) && !withheldNames.has(path),
|
|
586
|
+
readableFiles,
|
|
587
|
+
withheldFilePaths,
|
|
588
|
+
withheldFileCount: detail.files.length - readableFiles.length,
|
|
589
|
+
viewerIsAuthor,
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
/**
|
|
593
|
+
* The same answer for a number that was never issued and for one the caller
|
|
594
|
+
* may not see — requirement 7. Says nothing a probe could tell apart.
|
|
595
|
+
*/
|
|
596
|
+
const notFound = (number) => new ToolError(`Change request #${number} not found.`, 404);
|
|
597
|
+
/** Whether the caller may see request `number` at all: what `scopedDetail` answers 404 for, as a no. */
|
|
598
|
+
const maySee = async (ctx, number) => {
|
|
599
|
+
try {
|
|
600
|
+
await scopedDetail(ctx, number, { patches: false });
|
|
601
|
+
return true;
|
|
602
|
+
}
|
|
603
|
+
catch (err) {
|
|
604
|
+
if (err instanceof ToolError && err.status === 404)
|
|
605
|
+
return false;
|
|
606
|
+
throw err;
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
return { repoGlobalWorkspaceId, readablePaths, scopedDetail, notFound, maySee };
|
|
610
|
+
}
|
|
582
611
|
//# sourceMappingURL=change-request-read.tools.js.map
|