@bevel-software/platform-core-backend 0.25.2 → 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 +251 -0
- package/agent-guide/conventions.md +35 -0
- package/agent-guide/directory-structure.md +145 -0
- package/agent-guide/finding-things.md +7 -0
- package/agent-guide/html-views.md +83 -0
- package/agent-guide/introduction.md +27 -0
- package/agent-guide/new-knowledge-base.md +24 -0
- package/agent-guide/skills.md +47 -0
- package/agent-guide/tool-manuals.md +227 -0
- package/agent-guide/where-a-new-file-goes.md +36 -0
- package/dist/assets.d.ts +26 -0
- package/dist/assets.d.ts.map +1 -1
- package/dist/assets.js +35 -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/core-ports.d.ts +11 -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 +5 -0
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +65 -3
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +35 -0
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +114 -12
- 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 +17 -0
- package/dist/modules/access/access-control.interface.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +2 -0
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +27 -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 +145 -0
- package/dist/modules/agent-guide/agent-guide.d.ts.map +1 -0
- package/dist/modules/agent-guide/agent-guide.js +199 -0
- package/dist/modules/agent-guide/agent-guide.js.map +1 -0
- package/dist/modules/agent-guide/agent-guide.tools.d.ts +24 -0
- package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -0
- package/dist/modules/agent-guide/agent-guide.tools.js +100 -0
- package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -0
- package/dist/modules/agent-guide/index.d.ts +4 -0
- package/dist/modules/agent-guide/index.d.ts.map +1 -0
- package/dist/modules/agent-guide/index.js +4 -0
- package/dist/modules/agent-guide/index.js.map +1 -0
- package/dist/modules/agent-instructions/agent-instructions.routes.d.ts +3 -2
- package/dist/modules/agent-instructions/agent-instructions.routes.d.ts.map +1 -1
- package/dist/modules/agent-instructions/agent-instructions.routes.js +3 -2
- package/dist/modules/agent-instructions/agent-instructions.routes.js.map +1 -1
- package/dist/modules/agent-instructions/compose.d.ts +14 -6
- package/dist/modules/agent-instructions/compose.d.ts.map +1 -1
- package/dist/modules/agent-instructions/compose.js +28 -8
- package/dist/modules/agent-instructions/compose.js.map +1 -1
- package/dist/modules/agent-instructions/index.d.ts +1 -1
- package/dist/modules/agent-instructions/index.d.ts.map +1 -1
- package/dist/modules/agent-instructions/index.js +1 -1
- package/dist/modules/agent-instructions/index.js.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.d.ts +10 -50
- package/dist/modules/agent-instructions/shared-file-rules.d.ts.map +1 -1
- package/dist/modules/agent-instructions/shared-file-rules.js +51 -104
- 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 +57 -3
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +177 -24
- 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/mcp/tool-schema-guard.d.ts +105 -0
- package/dist/modules/mcp/tool-schema-guard.d.ts.map +1 -0
- package/dist/modules/mcp/tool-schema-guard.js +171 -0
- package/dist/modules/mcp/tool-schema-guard.js.map +1 -0
- 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/plugins/plugins.tools.d.ts +36 -2
- package/dist/modules/plugins/plugins.tools.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.tools.js +71 -14
- package/dist/modules/plugins/plugins.tools.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.d.ts +34 -7
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +148 -54
- 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/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +3 -6
- package/dist/modules/settings/setup.routes.js.map +1 -1
- package/dist/modules/skills/skills.tools.d.ts.map +1 -1
- package/dist/modules/skills/skills.tools.js +103 -43
- 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.contract.d.ts +23 -4
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.contract.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +4 -0
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.js +14 -0
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +7 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +77 -38
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/tool-registry/description-length.d.ts +20 -16
- package/dist/modules/tool-registry/description-length.d.ts.map +1 -1
- package/dist/modules/tool-registry/description-length.js +50 -30
- package/dist/modules/tool-registry/description-length.js.map +1 -1
- package/dist/modules/tool-registry/guide-first.d.ts +27 -0
- package/dist/modules/tool-registry/guide-first.d.ts.map +1 -0
- package/dist/modules/tool-registry/guide-first.js +40 -0
- package/dist/modules/tool-registry/guide-first.js.map +1 -0
- package/dist/modules/tool-registry/tool-registry.d.ts +6 -0
- package/dist/modules/tool-registry/tool-registry.d.ts.map +1 -1
- package/dist/modules/tool-registry/tool-registry.js +9 -2
- package/dist/modules/tool-registry/tool-registry.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts +449 -0
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +1 -0
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js +481 -0
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +1 -0
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts +126 -0
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +1 -0
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js +611 -0
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +1 -0
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +12 -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 +5 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.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 +133 -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 +282 -14
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +627 -126
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/merge-commit.d.ts +73 -0
- package/dist/modules/workflow/git/merge-commit.d.ts.map +1 -0
- package/dist/modules/workflow/git/merge-commit.js +89 -0
- package/dist/modules/workflow/git/merge-commit.js.map +1 -0
- 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/git/pull-request.service.d.ts +94 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +332 -37
- package/dist/modules/workflow/git/pull-request.service.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 +35 -0
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +180 -13
- 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.routes.d.ts +6 -2
- package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.routes.js +7 -2
- package/dist/modules/workflow/workflow.routes.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +187 -15
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +808 -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 +24 -39
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts +58 -52
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.js +209 -223
- package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.d.ts +5 -3
- package/dist/modules/workspace/startup/steps/template-source.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.js +5 -3
- package/dist/modules/workspace/startup/steps/template-source.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 +68 -1
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +642 -71
- 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 +84 -1
- package/dist/shared/domain-errors.d.ts.map +1 -1
- package/dist/shared/domain-errors.js +100 -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/hidden-tools.d.ts +44 -0
- package/dist/shared/hidden-tools.d.ts.map +1 -0
- package/dist/shared/hidden-tools.js +13 -0
- package/dist/shared/hidden-tools.js.map +1 -0
- 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/kb-template/.bevelignore +0 -5
- 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 +6 -3
- package/src/__tests__/kb-layout-config.test.ts +10 -100
- package/src/__tests__/packaged-assets-ship.test.ts +66 -0
- package/src/assets.ts +38 -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/core-ports.ts +11 -0
- package/src/core/create-core-server.ts +78 -3
- package/src/core/create-core-services.ts +168 -10
- 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.atref-batch.test.ts +58 -0
- package/src/modules/access/__tests__/access-control.platform-restore.test.ts +8 -7
- package/src/modules/access/__tests__/access-control.service.test.ts +19 -0
- package/src/modules/access/__tests__/access-personal-plugin.test.ts +1 -18
- package/src/modules/access/access-control.interface.ts +28 -0
- package/src/modules/access/access-control.service.ts +37 -0
- package/src/modules/access/directory-sync-bot.ts +1 -1
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +386 -0
- package/src/modules/agent-guide/__tests__/agent-guide.tools.test.ts +207 -0
- package/src/modules/agent-guide/agent-guide.tools.ts +122 -0
- package/src/modules/agent-guide/agent-guide.ts +300 -0
- package/src/modules/agent-guide/index.ts +22 -0
- package/src/modules/agent-instructions/__tests__/shared-file-rules.test.ts +39 -118
- package/src/modules/agent-instructions/agent-instructions.routes.ts +3 -2
- package/src/modules/agent-instructions/compose.ts +26 -8
- package/src/modules/agent-instructions/index.ts +0 -3
- package/src/modules/agent-instructions/shared-file-rules.ts +50 -112
- 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__/fake-downstream-mcp-server.ts +14 -3
- 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 +252 -0
- package/src/modules/mcp/__tests__/mcp.service.test.ts +42 -24
- package/src/modules/mcp/__tests__/tool-call-interface.e2e.test.ts +499 -0
- package/src/modules/mcp/__tests__/tool-schema-guard.test.ts +266 -0
- package/src/modules/mcp/mcp-auth.middleware.ts +2 -1
- package/src/modules/mcp/mcp.service.ts +218 -31
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +42 -4
- package/src/modules/mcp/tool-schema-guard.ts +196 -0
- 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 +177 -4
- 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/plugins/plugins.tools.ts +75 -15
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +176 -56
- package/src/modules/settings/__tests__/repository-source.test.ts +9 -0
- package/src/modules/settings/deployment-settings.service.ts +144 -55
- package/src/modules/settings/repository-source.ts +4 -4
- package/src/modules/settings/setup.routes.ts +3 -6
- package/src/modules/skills/__tests__/skills.tools.description.test.ts +95 -0
- package/src/modules/skills/skills.tools.ts +112 -46
- 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/__tests__/tool-manuals.detail.route.test.ts +57 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +73 -4
- package/src/modules/tool-manuals/tool-manuals.contract.ts +24 -4
- package/src/modules/tool-manuals/tool-manuals.service.ts +17 -0
- package/src/modules/tool-manuals/tool-manuals.tools.ts +86 -38
- package/src/modules/tool-registry/__tests__/own-tool-schemas.test.ts +173 -0
- package/src/modules/tool-registry/__tests__/tool-description-length.test.ts +81 -66
- package/src/modules/tool-registry/description-length.ts +57 -32
- package/src/modules/tool-registry/guide-first.ts +41 -0
- package/src/modules/tool-registry/tool-registry.ts +9 -2
- package/src/modules/workflow/__tests__/apply-failure.test.ts +6 -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-shape.test.ts +705 -0
- package/src/modules/workflow/agent-tools/__tests__/change-request-read.tools.test.ts +1554 -0
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +150 -4
- package/src/modules/workflow/agent-tools/change-request-read-shape.ts +712 -0
- package/src/modules/workflow/agent-tools/change-request-read.tools.ts +759 -0
- package/src/modules/workflow/agent-tools/change-request-summary.ts +5 -1
- package/src/modules/workflow/agent-tools/workflow.tools.ts +137 -35
- package/src/modules/workflow/file-lock.service.ts +67 -5
- package/src/modules/workflow/git/__tests__/git.service.appliedChange.test.ts +285 -0
- package/src/modules/workflow/git/__tests__/git.service.changedFilesForPr.test.ts +124 -0
- package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +164 -0
- package/src/modules/workflow/git/__tests__/git.service.mergeChangeRequest.test.ts +334 -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/__tests__/pull-request.service.list-fetch.test.ts +72 -2
- package/src/modules/workflow/git/__tests__/pull-request.service.placeholder.test.ts +24 -2
- package/src/modules/workflow/git/__tests__/pull-request.service.test.ts +620 -1
- package/src/modules/workflow/git/git.service.ts +714 -133
- package/src/modules/workflow/git/merge-commit.ts +88 -0
- package/src/modules/workflow/git/node-git-runner.ts +82 -7
- package/src/modules/workflow/git/pull-request.service.ts +380 -54
- 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/__tests__/approval-states.test.ts +7 -1
- package/src/modules/workflow/review-workflow/__tests__/merge-records-own-commit.test.ts +407 -0
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +191 -12
- package/src/modules/workflow/sanitize-error.ts +50 -0
- package/src/modules/workflow/workflow.routes.ts +7 -2
- package/src/modules/workflow/workflow.service.ts +886 -112
- package/src/modules/workspace/__tests__/agent-downloads.test.ts +823 -0
- package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +4 -3
- 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.routes.move-platform-files.test.ts +21 -10
- 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.agents-file.test.ts +33 -55
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +44 -1
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +664 -34
- 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/__tests__/steps.test.ts +191 -489
- package/src/modules/workspace/startup/steps/seed-tree.ts +23 -38
- package/src/modules/workspace/startup/steps/template-files.step.ts +217 -249
- package/src/modules/workspace/startup/steps/template-source.ts +5 -3
- 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 +707 -68
- 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 +123 -11
- package/src/shared/git.contract.ts +8 -1
- package/src/shared/hidden-tools.ts +45 -0
- 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
- package/kb-template/AGENTS.md +0 -730
|
@@ -352,6 +352,39 @@ describe('GitService.pull', () => {
|
|
|
352
352
|
await runGit(repo, ['push', 'origin', 'target-company-state']);
|
|
353
353
|
await expect(svc.hasUnpushedCommits(workspaceId)).resolves.toBe(false);
|
|
354
354
|
});
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The question the roles.yaml preservation asks before pushing a restore it
|
|
358
|
+
* finds already committed: not "is there unpushed work" but "would the push
|
|
359
|
+
* fast-forward origin to HEAD". A clone behind origin answers no, and one
|
|
360
|
+
* whose tracking ref git cannot even resolve answers with an error — the
|
|
361
|
+
* guard that asks must fail closed on it, so the probe may not swallow it.
|
|
362
|
+
*/
|
|
363
|
+
it('headContainsOrigin: true in sync and ahead, false behind origin, an error without a tracking ref', async () => {
|
|
364
|
+
const { repo } = await seedWorkspace(root, workspaceId);
|
|
365
|
+
const svc = new GitService(
|
|
366
|
+
stubWorkspaceService({ [workspaceId]: path.join(root, workspaceId) }),
|
|
367
|
+
stubWorkflowHooks(),
|
|
368
|
+
testKbContext(),
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
await expect(svc.headContainsOrigin(workspaceId)).resolves.toBe(true);
|
|
372
|
+
|
|
373
|
+
// Ahead: a local commit on top of origin's tip.
|
|
374
|
+
await fs.writeFile(path.join(repo, 'new.txt'), 'x\n');
|
|
375
|
+
await runGit(repo, ['add', '.']);
|
|
376
|
+
await runGit(repo, ['commit', '-m', 'unpushed']);
|
|
377
|
+
await expect(svc.headContainsOrigin(workspaceId)).resolves.toBe(true);
|
|
378
|
+
|
|
379
|
+
// Behind: publish it, then step the clone back before it.
|
|
380
|
+
await runGit(repo, ['push', 'origin', 'target-company-state']);
|
|
381
|
+
await runGit(repo, ['reset', '--hard', 'HEAD~1']);
|
|
382
|
+
await expect(svc.headContainsOrigin(workspaceId)).resolves.toBe(false);
|
|
383
|
+
|
|
384
|
+
// No tracking ref at all: not "false", an error.
|
|
385
|
+
await runGit(repo, ['checkout', '-b', 'never-pushed']);
|
|
386
|
+
await expect(svc.headContainsOrigin(workspaceId)).rejects.toThrow();
|
|
387
|
+
});
|
|
355
388
|
});
|
|
356
389
|
|
|
357
390
|
/**
|
|
@@ -411,7 +444,10 @@ describe('GitService.pull — an unpushed merge commit', () => {
|
|
|
411
444
|
const workspaceDir = path.join(root, workspaceId);
|
|
412
445
|
const repo = path.join(workspaceDir, 'knowledge-base');
|
|
413
446
|
await fs.mkdir(workspaceDir, { recursive: true });
|
|
414
|
-
|
|
447
|
+
// `core.autocrlf=false` on the clone itself, not only afterwards: a
|
|
448
|
+
// Windows git would otherwise check the files out with CRLF, and the
|
|
449
|
+
// rebase's autostash of that "dirty" tree conflicts on reapply.
|
|
450
|
+
await runGit(root, ['-c', 'core.autocrlf=false', 'clone', '-b', 'alice/deal', upstream, repo]);
|
|
415
451
|
await runGit(repo, ['config', 'user.email', 'workspace@bevel.test']);
|
|
416
452
|
await runGit(repo, ['config', 'user.name', 'bevel Workspace']);
|
|
417
453
|
await runGit(repo, ['config', 'core.autocrlf', 'false']);
|
|
@@ -456,6 +492,17 @@ describe('GitService.pull — an unpushed merge commit', () => {
|
|
|
456
492
|
expect(contains).toBe(false);
|
|
457
493
|
});
|
|
458
494
|
|
|
495
|
+
it('survives the background sync, which may reach the branch before any push does', async () => {
|
|
496
|
+
const { repo, targetTip } = await seedUnpushedMerge();
|
|
497
|
+
await svcFor().syncFromRemote(workspaceId);
|
|
498
|
+
|
|
499
|
+
expect(await gitOut(repo, ['rev-list', '--count', '--merges', 'HEAD'])).toBe('1');
|
|
500
|
+
const contains = await gitOut(repo, [
|
|
501
|
+
'merge-base', '--is-ancestor', targetTip, 'HEAD',
|
|
502
|
+
]).then(() => true, () => false);
|
|
503
|
+
expect(contains).toBe(true);
|
|
504
|
+
});
|
|
505
|
+
|
|
459
506
|
it('survives `preserveMerges`, and the branch still contains the target', async () => {
|
|
460
507
|
const { repo, targetTip } = await seedUnpushedMerge();
|
|
461
508
|
await svcFor().pull(workspaceId, { preserveMerges: true });
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
|
+
import http from 'node:http';
|
|
3
4
|
import os from 'node:os';
|
|
4
5
|
import path from 'node:path';
|
|
6
|
+
import type { AddressInfo } from 'node:net';
|
|
5
7
|
import { NodeGitRunner } from '../node-git-runner.js';
|
|
6
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
GitRunError,
|
|
10
|
+
gitCredentials,
|
|
11
|
+
isGitTimeout,
|
|
12
|
+
type GitCredentials,
|
|
13
|
+
} from '../../../../shared/git.contract.js';
|
|
14
|
+
import { setLogger } from '../../../../shared/logging.js';
|
|
15
|
+
import type { ILogger, LogFields } from '../../../../shared/logger.contract.js';
|
|
7
16
|
|
|
8
17
|
/**
|
|
9
18
|
* These run REAL git, like the rest of this module's suites: the behaviours
|
|
@@ -150,3 +159,223 @@ describe('NodeGitRunner', () => {
|
|
|
150
159
|
}
|
|
151
160
|
});
|
|
152
161
|
});
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* A git host that wants a credential, as a real `ls-remote` over HTTP meets
|
|
165
|
+
* it: a bare repository behind Basic auth, served the dumb way (`info/refs`
|
|
166
|
+
* as a file), which git falls back to when no smart service answers. Every
|
|
167
|
+
* refusal below is git's own — "could not read Username" when it had nothing
|
|
168
|
+
* to offer, "Authentication failed" when what it offered was thrown out.
|
|
169
|
+
*/
|
|
170
|
+
describe('NodeGitRunner: a call the host refuses a credential', () => {
|
|
171
|
+
let root: string;
|
|
172
|
+
let clone: string;
|
|
173
|
+
let server: http.Server;
|
|
174
|
+
let remote: string;
|
|
175
|
+
/** The one token the host accepts. */
|
|
176
|
+
let accepted: string;
|
|
177
|
+
/** How many times the host was asked, and refused, in order. */
|
|
178
|
+
let answers: number[];
|
|
179
|
+
/** No helper from the machine this runs on: the clone's config and the call's `-c` are the whole story. */
|
|
180
|
+
let env: NodeJS.ProcessEnv;
|
|
181
|
+
|
|
182
|
+
beforeEach(async () => {
|
|
183
|
+
root = await fs.mkdtemp(path.join(os.tmpdir(), 'git-runner-auth-'));
|
|
184
|
+
const empty = path.join(root, 'empty-gitconfig');
|
|
185
|
+
await fs.writeFile(empty, '');
|
|
186
|
+
env = { GIT_CONFIG_GLOBAL: empty, GIT_CONFIG_NOSYSTEM: '1' };
|
|
187
|
+
const plain = new NodeGitRunner();
|
|
188
|
+
const seed = path.join(root, 'seed');
|
|
189
|
+
await fs.mkdir(seed);
|
|
190
|
+
await plain.run(seed, ['init', '--initial-branch=main'], { env });
|
|
191
|
+
await plain.run(seed, ['-c', 'user.name=t', '-c', 'user.email=t@x', 'commit', '--allow-empty', '-m', 'init'], { env });
|
|
192
|
+
const upstream = path.join(root, 'upstream.git');
|
|
193
|
+
await plain.run(root, ['clone', '--bare', seed, upstream], { env });
|
|
194
|
+
await plain.run(upstream, ['update-server-info'], { env });
|
|
195
|
+
clone = path.join(root, 'clone');
|
|
196
|
+
await fs.mkdir(clone);
|
|
197
|
+
await plain.run(clone, ['init', '--initial-branch=main'], { env });
|
|
198
|
+
|
|
199
|
+
accepted = 'ghp_good';
|
|
200
|
+
answers = [];
|
|
201
|
+
server = http.createServer(async (req, res) => {
|
|
202
|
+
const expected = `Basic ${Buffer.from(`x-access-token:${accepted}`).toString('base64')}`;
|
|
203
|
+
if (req.headers.authorization !== expected) {
|
|
204
|
+
answers.push(401);
|
|
205
|
+
res.writeHead(401, { 'WWW-Authenticate': 'Basic realm="upstream"' });
|
|
206
|
+
res.end();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
answers.push(200);
|
|
210
|
+
const file = path.join(upstream, new URL(req.url ?? '/', 'http://x').pathname.replace(/^\/upstream\.git\/?/, ''));
|
|
211
|
+
try {
|
|
212
|
+
const bytes = await fs.readFile(file);
|
|
213
|
+
res.writeHead(200, { 'content-type': 'text/plain' });
|
|
214
|
+
res.end(bytes);
|
|
215
|
+
} catch {
|
|
216
|
+
res.writeHead(404);
|
|
217
|
+
res.end();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
await new Promise<void>((r) => server.listen(0, '127.0.0.1', r));
|
|
221
|
+
remote = `http://127.0.0.1:${(server.address() as AddressInfo).port}/upstream.git`;
|
|
222
|
+
await plain.run(clone, ['remote', 'add', 'origin', remote], { env });
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
afterEach(async () => {
|
|
226
|
+
await new Promise<void>((r) => server.close(() => r()));
|
|
227
|
+
await fs.rm(root, { recursive: true, force: true }).catch(() => undefined);
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
/** Credentials whose token a test moves, with a `prepare` that records how it was asked. */
|
|
231
|
+
function moving(initial: string | null, onRefused: (set: (token: string | null) => void) => void = () => undefined) {
|
|
232
|
+
let token = initial;
|
|
233
|
+
const prepare = vi.fn(async (opts?: { refused?: boolean }) => {
|
|
234
|
+
if (opts?.refused) onRefused((next) => { token = next; });
|
|
235
|
+
});
|
|
236
|
+
const credentials: GitCredentials = {
|
|
237
|
+
username: () => 'x-access-token',
|
|
238
|
+
token: () => token,
|
|
239
|
+
prepare,
|
|
240
|
+
};
|
|
241
|
+
return { credentials, prepare };
|
|
242
|
+
}
|
|
243
|
+
const refusals = (prepare: ReturnType<typeof vi.fn>) => prepare.mock.calls.map((c) => (c[0] as { refused?: boolean } | undefined)?.refused ?? false);
|
|
244
|
+
|
|
245
|
+
/** Every line the runner logs during a test. */
|
|
246
|
+
let logged: string[] = [];
|
|
247
|
+
let previousLogger: ILogger | undefined;
|
|
248
|
+
const capturing = (bindings: LogFields = {}): ILogger => {
|
|
249
|
+
const line = (level: string) => (message: string, fields?: LogFields) =>
|
|
250
|
+
void logged.push(`${level} ${message} ${JSON.stringify({ ...bindings, ...fields })}`);
|
|
251
|
+
return { debug: line('debug'), info: line('info'), warn: line('warn'), error: line('error'), child: (m) => capturing({ ...bindings, ...m }) };
|
|
252
|
+
};
|
|
253
|
+
beforeEach(() => {
|
|
254
|
+
logged = [];
|
|
255
|
+
previousLogger = setLogger(capturing());
|
|
256
|
+
});
|
|
257
|
+
afterEach(() => {
|
|
258
|
+
if (previousLogger) setLogger(previousLogger);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
it('authenticates a clone whose config carries no helper: the helper rides the call', async () => {
|
|
262
|
+
const runner = new NodeGitRunner(undefined, gitCredentials('x-access-token', 'ghp_good'));
|
|
263
|
+
const { stdout } = await runner.run(clone, ['ls-remote', 'origin'], { env });
|
|
264
|
+
expect(stdout).toContain('refs/heads/main');
|
|
265
|
+
// Refused once, with nothing offered; then every request carried the token.
|
|
266
|
+
expect(answers.filter((a) => a === 401)).toHaveLength(1);
|
|
267
|
+
expect(answers).toContain(200);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('with nothing to offer, insists on a token and runs the command once more', async () => {
|
|
271
|
+
const { credentials, prepare } = moving(null, (set) => set('ghp_good'));
|
|
272
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
273
|
+
const { stdout } = await runner.run(clone, ['ls-remote', 'origin'], { env });
|
|
274
|
+
expect(stdout).toContain('refs/heads/main');
|
|
275
|
+
// The ordinary renewal before the call, then the one that reports the refusal.
|
|
276
|
+
expect(refusals(prepare)).toEqual([false, true]);
|
|
277
|
+
expect(logged.some((l) => l.includes('the token was renewed and the command runs again'))).toBe(true);
|
|
278
|
+
// The first attempt never got to offer anything (one refusal, and git
|
|
279
|
+
// gave up); the second was refused once more before it offered the token.
|
|
280
|
+
expect(answers.filter((a) => a === 401)).toHaveLength(2);
|
|
281
|
+
expect(answers).toContain(200);
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('with a token the host throws out, renews it and runs the command once more', async () => {
|
|
285
|
+
const { credentials, prepare } = moving('ghp_stale', (set) => set('ghp_good'));
|
|
286
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
287
|
+
const { stdout } = await runner.run(clone, ['ls-remote', 'origin'], { env });
|
|
288
|
+
expect(stdout).toContain('refs/heads/main');
|
|
289
|
+
expect(refusals(prepare)).toEqual([false, true]);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('runs the command again ONCE: a refusal with a token just issued is the answer', async () => {
|
|
293
|
+
const { credentials, prepare } = moving('ghp_stale', (set) => set('ghp_still_stale'));
|
|
294
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
295
|
+
const err = await runner.run(clone, ['ls-remote', 'origin'], { env }).catch((e: unknown) => e);
|
|
296
|
+
expect(err).toBeInstanceOf(GitRunError);
|
|
297
|
+
expect(`${(err as GitRunError).stderr}`).toMatch(/Authentication failed/);
|
|
298
|
+
expect(refusals(prepare).filter(Boolean)).toHaveLength(1);
|
|
299
|
+
// One attempt with a credential offered is two refusals: git asks bare
|
|
300
|
+
// first, then with the token. Two attempts, four — and no third.
|
|
301
|
+
expect(answers).toEqual([401, 401, 401, 401]);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it('does not run the command again when no token can be had, and keeps the refusal', async () => {
|
|
305
|
+
const { credentials, prepare } = moving(null, (set) => set(null));
|
|
306
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
307
|
+
const err = await runner.run(clone, ['ls-remote', 'origin'], { env }).catch((e: unknown) => e);
|
|
308
|
+
expect(err).toBeInstanceOf(GitRunError);
|
|
309
|
+
expect(`${(err as GitRunError).stderr}`).toMatch(/could not read Username/);
|
|
310
|
+
expect(refusals(prepare).filter(Boolean)).toHaveLength(1);
|
|
311
|
+
// One attempt: with nothing to offer, running it again would only repeat the refusal.
|
|
312
|
+
expect(answers).toEqual([401]);
|
|
313
|
+
expect(logged.some((l) => l.includes('no other token could be had'))).toBe(true);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
it('does not run the command again with the SAME token the host just refused', async () => {
|
|
317
|
+
// A provider that cannot replace it: the fixed token of a token-mode
|
|
318
|
+
// deployment, whose `prepare` is absent. Running the command again would
|
|
319
|
+
// only be refused again.
|
|
320
|
+
const runner = new NodeGitRunner(undefined, gitCredentials('x-access-token', 'ghp_stale'));
|
|
321
|
+
const err = await runner.run(clone, ['ls-remote', 'origin'], { env }).catch((e: unknown) => e);
|
|
322
|
+
expect(err).toBeInstanceOf(GitRunError);
|
|
323
|
+
expect(`${(err as GitRunError).stderr}`).toMatch(/Authentication failed/);
|
|
324
|
+
// One attempt: the bare ask, then the token, refused. Nothing after.
|
|
325
|
+
expect(answers).toEqual([401, 401]);
|
|
326
|
+
// And one whose renewal hands back what it had.
|
|
327
|
+
answers = [];
|
|
328
|
+
const { credentials, prepare } = moving('ghp_stale', (set) => set('ghp_stale'));
|
|
329
|
+
await expect(new NodeGitRunner(undefined, credentials).run(clone, ['ls-remote', 'origin'], { env })).rejects.toBeInstanceOf(GitRunError);
|
|
330
|
+
expect(refusals(prepare).filter(Boolean)).toHaveLength(1);
|
|
331
|
+
expect(answers).toEqual([401, 401]);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it('keeps the refusal, and logs why, when the renewal itself fails', async () => {
|
|
335
|
+
let token: string | null = 'ghp_stale';
|
|
336
|
+
const credentials: GitCredentials = {
|
|
337
|
+
username: () => 'x-access-token',
|
|
338
|
+
token: () => token,
|
|
339
|
+
prepare: async (opts) => {
|
|
340
|
+
if (!opts?.refused) return;
|
|
341
|
+
// What the host refused is dropped, and GitHub will not replace it.
|
|
342
|
+
token = null;
|
|
343
|
+
throw new Error('GitHub answered 401 to the app: bad private key');
|
|
344
|
+
},
|
|
345
|
+
};
|
|
346
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
347
|
+
const err = await runner.run(clone, ['ls-remote', 'origin'], { env }).catch((e: unknown) => e);
|
|
348
|
+
expect(err).toBeInstanceOf(GitRunError);
|
|
349
|
+
expect(`${(err as GitRunError).stderr}`).toMatch(/Authentication failed/);
|
|
350
|
+
expect(answers).toEqual([401, 401]);
|
|
351
|
+
const why = logged.find((l) => l.includes('no other token could be had'));
|
|
352
|
+
expect(why).toBeDefined();
|
|
353
|
+
expect(why).toContain('bad private key');
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
it("leaves a credential the caller laid over the call to the caller: the probe's own token is not renewed", async () => {
|
|
357
|
+
const { credentials, prepare } = moving('ghp_good', (set) => set('ghp_good'));
|
|
358
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
359
|
+
const err = await runner
|
|
360
|
+
.run(clone, ['ls-remote', 'origin'], { env: { ...env, GITHUB_TOKEN: 'ghp_being_checked' } })
|
|
361
|
+
.catch((e: unknown) => e);
|
|
362
|
+
expect(err).toBeInstanceOf(GitRunError);
|
|
363
|
+
expect(refusals(prepare).filter(Boolean)).toHaveLength(0);
|
|
364
|
+
expect(answers).toEqual([401, 401]);
|
|
365
|
+
});
|
|
366
|
+
|
|
367
|
+
it('names the command the caller asked for in a failure, never its own helper', async () => {
|
|
368
|
+
const runner = new NodeGitRunner(undefined, gitCredentials('x-access-token', 'ghp_stale'));
|
|
369
|
+
const err = await runner.run(clone, ['ls-remote', 'origin'], { env }).catch((e: unknown) => e);
|
|
370
|
+
expect((err as Error).message).toContain('git ls-remote failed');
|
|
371
|
+
expect((err as Error).message).not.toContain('credential.helper');
|
|
372
|
+
expect(`${(err as GitRunError).stderr}`).not.toContain('credential.helper');
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
it('leaves every other failure alone', async () => {
|
|
376
|
+
const { credentials, prepare } = moving('ghp_good');
|
|
377
|
+
const runner = new NodeGitRunner(undefined, credentials);
|
|
378
|
+
await expect(runner.run(clone, ['checkout', 'no-such-branch'], { env })).rejects.toBeInstanceOf(GitRunError);
|
|
379
|
+
expect(refusals(prepare).filter(Boolean)).toHaveLength(0);
|
|
380
|
+
});
|
|
381
|
+
});
|
|
@@ -5,6 +5,7 @@ import type { Database } from '../../../database/connection.js';
|
|
|
5
5
|
import type { WorkspaceService } from '../../../workspace/workspace.service.js';
|
|
6
6
|
import type { GitService } from '../git.service.js';
|
|
7
7
|
import type { IAccessControl } from '../../../access/access-control.interface.js';
|
|
8
|
+
import { WorkflowValidationError } from '../../../../shared/domain-errors.js';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* What a change-request LIST is allowed to cost.
|
|
@@ -47,8 +48,13 @@ function harness(rows = [row(1, 'suggestions/a/knowledge'), row(2, 'suggestions/
|
|
|
47
48
|
}),
|
|
48
49
|
}),
|
|
49
50
|
} as unknown as Database;
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
// The summary builder asks for the flat paths AND the rename-aware pairs in
|
|
52
|
+
// one call, so this is the method the per-request cost now lands on.
|
|
53
|
+
const changedPathsForPr = vi.fn(async () => ({
|
|
54
|
+
paths: ['Shared/one.pdf'],
|
|
55
|
+
pairs: [{ path: 'Shared/one.pdf' }],
|
|
56
|
+
}));
|
|
57
|
+
const git = { changedPathsAndPairsForPr: changedPathsForPr } as unknown as GitService;
|
|
52
58
|
const ensureRemotesFetched = vi.fn(async () => undefined);
|
|
53
59
|
const workspace = {
|
|
54
60
|
findAnyWorkspaceId: async () => 'ws-main',
|
|
@@ -119,3 +125,67 @@ describe('the change-request list refreshes the clone once, not once per request
|
|
|
119
125
|
expect(changedPathsForPr).toHaveBeenCalledTimes(2);
|
|
120
126
|
});
|
|
121
127
|
});
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* What a list of APPLIED requests is allowed to cost. Each is read from its
|
|
131
|
+
* merge commit, which asks git four times per row and never the network. A
|
|
132
|
+
* merge commit cannot change, so the second list must not ask git again.
|
|
133
|
+
*/
|
|
134
|
+
describe('the list of applied requests reads each merge commit once', () => {
|
|
135
|
+
const applied = (number: number) => ({
|
|
136
|
+
...row(number, `suggestions/${number}/knowledge`),
|
|
137
|
+
state: 'merged',
|
|
138
|
+
mergedSha: `${number}`.padStart(40, 'a'),
|
|
139
|
+
closedAt: new Date('2026-09-19T00:00:00Z'),
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
function appliedHarness(rows: ReturnType<typeof applied>[]) {
|
|
143
|
+
const db = {
|
|
144
|
+
select: () => ({
|
|
145
|
+
from: () => ({
|
|
146
|
+
where: () => ({ orderBy: async () => rows, limit: async () => rows }),
|
|
147
|
+
}),
|
|
148
|
+
}),
|
|
149
|
+
} as unknown as Database;
|
|
150
|
+
const ofAppliedChange = vi.fn(async (_w: string, ref: { number: number }) => ({
|
|
151
|
+
paths: [`Shared/${ref.number}.md`],
|
|
152
|
+
pairs: [{ path: `Shared/${ref.number}.md` }],
|
|
153
|
+
}));
|
|
154
|
+
const git = { changedPathsAndPairsOfAppliedChange: ofAppliedChange } as unknown as GitService;
|
|
155
|
+
const ensureRemotesFetched = vi.fn(async () => undefined);
|
|
156
|
+
const workspace = {
|
|
157
|
+
findAnyWorkspaceId: async () => 'ws-main',
|
|
158
|
+
ensureRemotesFetched,
|
|
159
|
+
} as unknown as WorkspaceService;
|
|
160
|
+
const access = {} as unknown as IAccessControl;
|
|
161
|
+
return { svc: new PullRequestService(db, workspace, access, git), ofAppliedChange, ensureRemotesFetched };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
it('asks git once per request, however often the list is read, and refreshes the clone once per list — never per row', async () => {
|
|
165
|
+
const { svc, ofAppliedChange, ensureRemotesFetched } = appliedHarness([applied(1), applied(2), applied(3)]);
|
|
166
|
+
|
|
167
|
+
const first = await svc.listPrsByState(['merged']);
|
|
168
|
+
const second = await svc.listPrsByState(['merged']);
|
|
169
|
+
|
|
170
|
+
expect(first.map((s) => s.touchedNodePaths)).toEqual([['Shared/1.md'], ['Shared/2.md'], ['Shared/3.md']]);
|
|
171
|
+
expect(second).toEqual(first);
|
|
172
|
+
expect(ofAppliedChange).toHaveBeenCalledTimes(3);
|
|
173
|
+
// One refresh per LIST (TTL-cached underneath), not one per row: a merge
|
|
174
|
+
// commit cannot change, but a clone that has not fetched since the merge
|
|
175
|
+
// does not hold it, and would read every applied request as author-only.
|
|
176
|
+
expect(ensureRemotesFetched).toHaveBeenCalledTimes(2);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
it('asks again for a merge commit the clone did not hold the first time', async () => {
|
|
180
|
+
const { svc, ofAppliedChange } = appliedHarness([applied(1)]);
|
|
181
|
+
ofAppliedChange.mockRejectedValueOnce(new WorkflowValidationError('commit is not in this clone'));
|
|
182
|
+
|
|
183
|
+
const before = await svc.listPrsByState(['merged']);
|
|
184
|
+
const after = await svc.listPrsByState(['merged']);
|
|
185
|
+
|
|
186
|
+
// Fail-closed while the commit is missing, answered once it is there.
|
|
187
|
+
expect(before[0].touchedNodePaths).toEqual([]);
|
|
188
|
+
expect(after[0].touchedNodePaths).toEqual(['Shared/1.md']);
|
|
189
|
+
expect(ofAppliedChange).toHaveBeenCalledTimes(2);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
+
import { isFolderPlaceholder } from '@bevel-software/platform-shared';
|
|
2
3
|
|
|
3
4
|
import { PullRequestService } from '../pull-request.service.js';
|
|
4
5
|
import type { Database } from '../../../database/connection.js';
|
|
@@ -40,8 +41,19 @@ describe('PullRequestService summaries — folder placeholder', () => {
|
|
|
40
41
|
}),
|
|
41
42
|
}),
|
|
42
43
|
} as unknown as Database;
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
// The real `changedPathPairs` drops the placeholder (it is never a file
|
|
45
|
+
// anybody reads) while the flat list keeps it for the empty-request check,
|
|
46
|
+
// so the double answers both the way the service does. It borrows the
|
|
47
|
+
// production predicate rather than spelling one out: `isFolderPlaceholder`
|
|
48
|
+
// matches on the BASENAME, so a root-level `.gitkeep` is a placeholder too,
|
|
49
|
+
// and both of the real readers drop `roles.yaml`.
|
|
50
|
+
const changedPathsForPr = vi.fn(async () => ({
|
|
51
|
+
paths: paths.filter((p) => p !== 'roles.yaml'),
|
|
52
|
+
pairs: paths
|
|
53
|
+
.filter((p) => !isFolderPlaceholder(p) && p !== 'roles.yaml')
|
|
54
|
+
.map((path) => ({ path })),
|
|
55
|
+
}));
|
|
56
|
+
const git = { changedPathsAndPairsForPr: changedPathsForPr } as unknown as GitService;
|
|
45
57
|
const workspace = {
|
|
46
58
|
findAnyWorkspaceId: async () => 'ws-main',
|
|
47
59
|
ensureRemotesFetched: async () => undefined,
|
|
@@ -76,4 +88,14 @@ describe('PullRequestService summaries — folder placeholder', () => {
|
|
|
76
88
|
const { svc } = harness(['Elsewhere/.gitkeep']);
|
|
77
89
|
expect(await svc.listPrsForOwnerEmail('ws-main', 'bob@bevel.software', { fresh: true })).toEqual([]);
|
|
78
90
|
});
|
|
91
|
+
|
|
92
|
+
it('a placeholder at the ROOT is a placeholder too, on both views of the summary', async () => {
|
|
93
|
+
// `isFolderPlaceholder` matches the basename, so `.gitkeep` with no folder
|
|
94
|
+
// in front of it is the same non-file — the corner a filter spelled
|
|
95
|
+
// `endsWith('/.gitkeep')` would get wrong on both the paths and the pairs.
|
|
96
|
+
const { svc } = harness(['.gitkeep', 'Reports/q3.md']);
|
|
97
|
+
const [summary] = await svc.listOpenPrs({ fresh: true });
|
|
98
|
+
expect(summary.touchedNodePaths).toEqual(['Reports/q3.md']);
|
|
99
|
+
expect(summary.touchedNodeFiles).toEqual([{ path: 'Reports/q3.md' }]);
|
|
100
|
+
});
|
|
79
101
|
});
|