@bevel-software/platform-core-backend 0.1.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/LICENSE +202 -0
- package/dist/assets.d.ts +5 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/assets.js +23 -0
- package/dist/assets.js.map +1 -0
- package/dist/core/core-ports.d.ts +83 -0
- package/dist/core/core-ports.d.ts.map +1 -0
- package/dist/core/core-ports.js +12 -0
- package/dist/core/core-ports.js.map +1 -0
- package/dist/core/create-core-server.d.ts +62 -0
- package/dist/core/create-core-server.d.ts.map +1 -0
- package/dist/core/create-core-server.js +204 -0
- package/dist/core/create-core-server.js.map +1 -0
- package/dist/core/create-core-services.d.ts +95 -0
- package/dist/core/create-core-services.d.ts.map +1 -0
- package/dist/core/create-core-services.js +352 -0
- package/dist/core/create-core-services.js.map +1 -0
- package/dist/core-config.d.ts +119 -0
- package/dist/core-config.d.ts.map +1 -0
- package/dist/core-config.js +240 -0
- package/dist/core-config.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/access/access-control.interface.d.ts +348 -0
- package/dist/modules/access/access-control.interface.d.ts.map +1 -0
- package/dist/modules/access/access-control.interface.js +2 -0
- package/dist/modules/access/access-control.interface.js.map +1 -0
- package/dist/modules/access/access-control.service.d.ts +323 -0
- package/dist/modules/access/access-control.service.d.ts.map +1 -0
- package/dist/modules/access/access-control.service.js +1431 -0
- package/dist/modules/access/access-control.service.js.map +1 -0
- package/dist/modules/access/access-errors.d.ts +34 -0
- package/dist/modules/access/access-errors.d.ts.map +1 -0
- package/dist/modules/access/access-errors.js +40 -0
- package/dist/modules/access/access-errors.js.map +1 -0
- package/dist/modules/access/access-mutation.service.d.ts +176 -0
- package/dist/modules/access/access-mutation.service.d.ts.map +1 -0
- package/dist/modules/access/access-mutation.service.js +307 -0
- package/dist/modules/access/access-mutation.service.js.map +1 -0
- package/dist/modules/access/access-splice.d.ts +98 -0
- package/dist/modules/access/access-splice.d.ts.map +1 -0
- package/dist/modules/access/access-splice.js +346 -0
- package/dist/modules/access/access-splice.js.map +1 -0
- package/dist/modules/access/access.routes.d.ts +10 -0
- package/dist/modules/access/access.routes.d.ts.map +1 -0
- package/dist/modules/access/access.routes.js +757 -0
- package/dist/modules/access/access.routes.js.map +1 -0
- package/dist/modules/access/creator-access.d.ts +113 -0
- package/dist/modules/access/creator-access.d.ts.map +1 -0
- package/dist/modules/access/creator-access.js +212 -0
- package/dist/modules/access/creator-access.js.map +1 -0
- package/dist/modules/access/kb-read-filter.d.ts +41 -0
- package/dist/modules/access/kb-read-filter.d.ts.map +1 -0
- package/dist/modules/access/kb-read-filter.js +60 -0
- package/dist/modules/access/kb-read-filter.js.map +1 -0
- package/dist/modules/access/roles-admin.service.d.ts +240 -0
- package/dist/modules/access/roles-admin.service.d.ts.map +1 -0
- package/dist/modules/access/roles-admin.service.js +630 -0
- package/dist/modules/access/roles-admin.service.js.map +1 -0
- package/dist/modules/access/roles-edit.d.ts +91 -0
- package/dist/modules/access/roles-edit.d.ts.map +1 -0
- package/dist/modules/access/roles-edit.js +232 -0
- package/dist/modules/access/roles-edit.js.map +1 -0
- package/dist/modules/access/roles-yaml-guard.d.ts +56 -0
- package/dist/modules/access/roles-yaml-guard.d.ts.map +1 -0
- package/dist/modules/access/roles-yaml-guard.js +79 -0
- package/dist/modules/access/roles-yaml-guard.js.map +1 -0
- package/dist/modules/admin/admin-access.routes.d.ts +18 -0
- package/dist/modules/admin/admin-access.routes.d.ts.map +1 -0
- package/dist/modules/admin/admin-access.routes.js +26 -0
- package/dist/modules/admin/admin-access.routes.js.map +1 -0
- package/dist/modules/admin/admin-access.service.d.ts +24 -0
- package/dist/modules/admin/admin-access.service.d.ts.map +1 -0
- package/dist/modules/admin/admin-access.service.js +41 -0
- package/dist/modules/admin/admin-access.service.js.map +1 -0
- package/dist/modules/admin/admin.interface.d.ts +11 -0
- package/dist/modules/admin/admin.interface.d.ts.map +1 -0
- package/dist/modules/admin/admin.interface.js +2 -0
- package/dist/modules/admin/admin.interface.js.map +1 -0
- package/dist/modules/auth/account-erasure.service.d.ts +80 -0
- package/dist/modules/auth/account-erasure.service.d.ts.map +1 -0
- package/dist/modules/auth/account-erasure.service.js +91 -0
- package/dist/modules/auth/account-erasure.service.js.map +1 -0
- package/dist/modules/auth/auth.middleware.d.ts +23 -0
- package/dist/modules/auth/auth.middleware.d.ts.map +1 -0
- package/dist/modules/auth/auth.middleware.js +68 -0
- package/dist/modules/auth/auth.middleware.js.map +1 -0
- package/dist/modules/auth/auth.routes.d.ts +25 -0
- package/dist/modules/auth/auth.routes.d.ts.map +1 -0
- package/dist/modules/auth/auth.routes.js +72 -0
- package/dist/modules/auth/auth.routes.js.map +1 -0
- package/dist/modules/auth/auth.service.d.ts +76 -0
- package/dist/modules/auth/auth.service.d.ts.map +1 -0
- package/dist/modules/auth/auth.service.js +168 -0
- package/dist/modules/auth/auth.service.js.map +1 -0
- package/dist/modules/code-mode/code-mode-names.d.ts +16 -0
- package/dist/modules/code-mode/code-mode-names.d.ts.map +1 -0
- package/dist/modules/code-mode/code-mode-names.js +30 -0
- package/dist/modules/code-mode/code-mode-names.js.map +1 -0
- package/dist/modules/code-mode/code-mode.tool.d.ts +13 -0
- package/dist/modules/code-mode/code-mode.tool.d.ts.map +1 -0
- package/dist/modules/code-mode/code-mode.tool.js +112 -0
- package/dist/modules/code-mode/code-mode.tool.js.map +1 -0
- package/dist/modules/code-mode/index.d.ts +3 -0
- package/dist/modules/code-mode/index.d.ts.map +1 -0
- package/dist/modules/code-mode/index.js +3 -0
- package/dist/modules/code-mode/index.js.map +1 -0
- package/dist/modules/database/connection.d.ts +6 -0
- package/dist/modules/database/connection.d.ts.map +1 -0
- package/dist/modules/database/connection.js +12 -0
- package/dist/modules/database/connection.js.map +1 -0
- package/dist/modules/database/core-schema.d.ts +2273 -0
- package/dist/modules/database/core-schema.d.ts.map +1 -0
- package/dist/modules/database/core-schema.js +413 -0
- package/dist/modules/database/core-schema.js.map +1 -0
- package/dist/modules/database/migrate.d.ts +10 -0
- package/dist/modules/database/migrate.d.ts.map +1 -0
- package/dist/modules/database/migrate.js +40 -0
- package/dist/modules/database/migrate.js.map +1 -0
- package/dist/modules/database/schema.d.ts +12 -0
- package/dist/modules/database/schema.d.ts.map +1 -0
- package/dist/modules/database/schema.js +12 -0
- package/dist/modules/database/schema.js.map +1 -0
- package/dist/modules/diff/diff-paths.d.ts +2 -0
- package/dist/modules/diff/diff-paths.d.ts.map +1 -0
- package/dist/modules/diff/diff-paths.js +9 -0
- package/dist/modules/diff/diff-paths.js.map +1 -0
- package/dist/modules/diff/diff.config.d.ts +8 -0
- package/dist/modules/diff/diff.config.d.ts.map +1 -0
- package/dist/modules/diff/diff.config.js +13 -0
- package/dist/modules/diff/diff.config.js.map +1 -0
- package/dist/modules/diff/diff.interface.d.ts +73 -0
- package/dist/modules/diff/diff.interface.d.ts.map +1 -0
- package/dist/modules/diff/diff.interface.js +2 -0
- package/dist/modules/diff/diff.interface.js.map +1 -0
- package/dist/modules/diff/diff.routes.d.ts +35 -0
- package/dist/modules/diff/diff.routes.d.ts.map +1 -0
- package/dist/modules/diff/diff.routes.js +228 -0
- package/dist/modules/diff/diff.routes.js.map +1 -0
- package/dist/modules/diff/diff.service.d.ts +51 -0
- package/dist/modules/diff/diff.service.d.ts.map +1 -0
- package/dist/modules/diff/diff.service.js +489 -0
- package/dist/modules/diff/diff.service.js.map +1 -0
- package/dist/modules/diff/line-diff.d.ts +16 -0
- package/dist/modules/diff/line-diff.d.ts.map +1 -0
- package/dist/modules/diff/line-diff.js +67 -0
- package/dist/modules/diff/line-diff.js.map +1 -0
- package/dist/modules/mcp/mcp-auth.middleware.d.ts +27 -0
- package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -0
- package/dist/modules/mcp/mcp-auth.middleware.js +116 -0
- package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -0
- package/dist/modules/mcp/mcp-session-store.d.ts +74 -0
- package/dist/modules/mcp/mcp-session-store.d.ts.map +1 -0
- package/dist/modules/mcp/mcp-session-store.js +131 -0
- package/dist/modules/mcp/mcp-session-store.js.map +1 -0
- package/dist/modules/mcp/mcp.routes.d.ts +24 -0
- package/dist/modules/mcp/mcp.routes.d.ts.map +1 -0
- package/dist/modules/mcp/mcp.routes.js +229 -0
- package/dist/modules/mcp/mcp.routes.js.map +1 -0
- package/dist/modules/mcp/mcp.service.d.ts +198 -0
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -0
- package/dist/modules/mcp/mcp.service.js +840 -0
- package/dist/modules/mcp/mcp.service.js.map +1 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +76 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +291 -0
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -0
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts +18 -0
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts.map +1 -0
- package/dist/modules/mcp/oauth/oauth-consent.routes.js +52 -0
- package/dist/modules/mcp/oauth/oauth-consent.routes.js.map +1 -0
- package/dist/modules/mcp/oauth/oauth-state.d.ts +32 -0
- package/dist/modules/mcp/oauth/oauth-state.d.ts.map +1 -0
- package/dist/modules/mcp/oauth/oauth-state.js +34 -0
- package/dist/modules/mcp/oauth/oauth-state.js.map +1 -0
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts +92 -0
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts.map +1 -0
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +728 -0
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -0
- package/dist/modules/secrets-vault/index.d.ts +7 -0
- package/dist/modules/secrets-vault/index.d.ts.map +1 -0
- package/dist/modules/secrets-vault/index.js +6 -0
- package/dist/modules/secrets-vault/index.js.map +1 -0
- package/dist/modules/secrets-vault/mcp-oauth-discovery.service.d.ts +63 -0
- package/dist/modules/secrets-vault/mcp-oauth-discovery.service.d.ts.map +1 -0
- package/dist/modules/secrets-vault/mcp-oauth-discovery.service.js +269 -0
- package/dist/modules/secrets-vault/mcp-oauth-discovery.service.js.map +1 -0
- package/dist/modules/secrets-vault/secrets-variable-loader.d.ts +46 -0
- package/dist/modules/secrets-vault/secrets-variable-loader.d.ts.map +1 -0
- package/dist/modules/secrets-vault/secrets-variable-loader.js +87 -0
- package/dist/modules/secrets-vault/secrets-variable-loader.js.map +1 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts +210 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.d.ts.map +1 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.js +90 -0
- package/dist/modules/secrets-vault/secrets-vault.contract.js.map +1 -0
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +30 -0
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -0
- package/dist/modules/secrets-vault/secrets-vault.routes.js +490 -0
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -0
- package/dist/modules/skills/index.d.ts +5 -0
- package/dist/modules/skills/index.d.ts.map +1 -0
- package/dist/modules/skills/index.js +4 -0
- package/dist/modules/skills/index.js.map +1 -0
- package/dist/modules/skills/skills.contract.d.ts +58 -0
- package/dist/modules/skills/skills.contract.d.ts.map +1 -0
- package/dist/modules/skills/skills.contract.js +10 -0
- package/dist/modules/skills/skills.contract.js.map +1 -0
- package/dist/modules/skills/skills.routes.d.ts +15 -0
- package/dist/modules/skills/skills.routes.d.ts.map +1 -0
- package/dist/modules/skills/skills.routes.js +34 -0
- package/dist/modules/skills/skills.routes.js.map +1 -0
- package/dist/modules/skills/skills.service.d.ts +21 -0
- package/dist/modules/skills/skills.service.d.ts.map +1 -0
- package/dist/modules/skills/skills.service.js +202 -0
- package/dist/modules/skills/skills.service.js.map +1 -0
- package/dist/modules/skills/skills.tools.d.ts +15 -0
- package/dist/modules/skills/skills.tools.d.ts.map +1 -0
- package/dist/modules/skills/skills.tools.js +96 -0
- package/dist/modules/skills/skills.tools.js.map +1 -0
- package/dist/modules/tool-auth/external-api-key.errors.d.ts +14 -0
- package/dist/modules/tool-auth/external-api-key.errors.d.ts.map +1 -0
- package/dist/modules/tool-auth/external-api-key.errors.js +23 -0
- package/dist/modules/tool-auth/external-api-key.errors.js.map +1 -0
- package/dist/modules/tool-auth/external-api-key.interface.d.ts +90 -0
- package/dist/modules/tool-auth/external-api-key.interface.d.ts.map +1 -0
- package/dist/modules/tool-auth/external-api-key.interface.js +2 -0
- package/dist/modules/tool-auth/external-api-key.interface.js.map +1 -0
- package/dist/modules/tool-auth/external-api-key.service.d.ts +25 -0
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -0
- package/dist/modules/tool-auth/external-api-key.service.js +164 -0
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -0
- package/dist/modules/tool-auth/internal-token.service.d.ts +62 -0
- package/dist/modules/tool-auth/internal-token.service.d.ts.map +1 -0
- package/dist/modules/tool-auth/internal-token.service.js +85 -0
- package/dist/modules/tool-auth/internal-token.service.js.map +1 -0
- package/dist/modules/tool-auth/llm-usage-meter.d.ts +16 -0
- package/dist/modules/tool-auth/llm-usage-meter.d.ts.map +1 -0
- package/dist/modules/tool-auth/llm-usage-meter.js +6 -0
- package/dist/modules/tool-auth/llm-usage-meter.js.map +1 -0
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts +101 -0
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -0
- package/dist/modules/tool-auth/tool-auth.middleware.js +166 -0
- package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -0
- package/dist/modules/tool-helpers/index.d.ts +19 -0
- package/dist/modules/tool-helpers/index.d.ts.map +1 -0
- package/dist/modules/tool-helpers/index.js +18 -0
- package/dist/modules/tool-helpers/index.js.map +1 -0
- package/dist/modules/tool-helpers/tool-context.d.ts +35 -0
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -0
- package/dist/modules/tool-helpers/tool-context.js +66 -0
- package/dist/modules/tool-helpers/tool-context.js.map +1 -0
- package/dist/modules/tool-helpers/tool-def.d.ts +33 -0
- package/dist/modules/tool-helpers/tool-def.d.ts.map +1 -0
- package/dist/modules/tool-helpers/tool-def.js +57 -0
- package/dist/modules/tool-helpers/tool-def.js.map +1 -0
- package/dist/modules/tool-helpers/tool-handler.d.ts +19 -0
- package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -0
- package/dist/modules/tool-helpers/tool-handler.js +84 -0
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -0
- package/dist/modules/tool-helpers/tool.contract.d.ts +64 -0
- package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -0
- package/dist/modules/tool-helpers/tool.contract.js +24 -0
- package/dist/modules/tool-helpers/tool.contract.js.map +1 -0
- package/dist/modules/tool-helpers/validate-token.d.ts +31 -0
- package/dist/modules/tool-helpers/validate-token.d.ts.map +1 -0
- package/dist/modules/tool-helpers/validate-token.js +20 -0
- package/dist/modules/tool-helpers/validate-token.js.map +1 -0
- package/dist/modules/tool-manuals/index.d.ts +5 -0
- package/dist/modules/tool-manuals/index.d.ts.map +1 -0
- package/dist/modules/tool-manuals/index.js +5 -0
- package/dist/modules/tool-manuals/index.js.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts +182 -0
- package/dist/modules/tool-manuals/tool-manuals.contract.d.ts.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.contract.js +19 -0
- package/dist/modules/tool-manuals/tool-manuals.contract.js.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts +24 -0
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.routes.js +102 -0
- package/dist/modules/tool-manuals/tool-manuals.routes.js.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +108 -0
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.service.js +710 -0
- package/dist/modules/tool-manuals/tool-manuals.service.js.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +35 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.js +157 -0
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -0
- package/dist/modules/tool-registry/manual.routes.d.ts +6 -0
- package/dist/modules/tool-registry/manual.routes.d.ts.map +1 -0
- package/dist/modules/tool-registry/manual.routes.js +76 -0
- package/dist/modules/tool-registry/manual.routes.js.map +1 -0
- package/dist/modules/tool-registry/tool-registry.d.ts +23 -0
- package/dist/modules/tool-registry/tool-registry.d.ts.map +1 -0
- package/dist/modules/tool-registry/tool-registry.js +46 -0
- package/dist/modules/tool-registry/tool-registry.js.map +1 -0
- package/dist/modules/tool-registry/tool.contract.d.ts +48 -0
- package/dist/modules/tool-registry/tool.contract.d.ts.map +1 -0
- package/dist/modules/tool-registry/tool.contract.js +2 -0
- package/dist/modules/tool-registry/tool.contract.js.map +1 -0
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +14 -0
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -0
- package/dist/modules/workflow/agent-tools/workflow.tools.js +437 -0
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -0
- package/dist/modules/workflow/event-bus.d.ts +107 -0
- package/dist/modules/workflow/event-bus.d.ts.map +1 -0
- package/dist/modules/workflow/event-bus.js +224 -0
- package/dist/modules/workflow/event-bus.js.map +1 -0
- package/dist/modules/workflow/events.routes.d.ts +80 -0
- package/dist/modules/workflow/events.routes.d.ts.map +1 -0
- package/dist/modules/workflow/events.routes.js +216 -0
- package/dist/modules/workflow/events.routes.js.map +1 -0
- package/dist/modules/workflow/file-change-notifier.d.ts +38 -0
- package/dist/modules/workflow/file-change-notifier.d.ts.map +1 -0
- package/dist/modules/workflow/file-change-notifier.js +22 -0
- package/dist/modules/workflow/file-change-notifier.js.map +1 -0
- package/dist/modules/workflow/file-lock.service.d.ts +57 -0
- package/dist/modules/workflow/file-lock.service.d.ts.map +1 -0
- package/dist/modules/workflow/file-lock.service.js +202 -0
- package/dist/modules/workflow/file-lock.service.js.map +1 -0
- package/dist/modules/workflow/git/branch-name.d.ts +10 -0
- package/dist/modules/workflow/git/branch-name.d.ts.map +1 -0
- package/dist/modules/workflow/git/branch-name.js +76 -0
- package/dist/modules/workflow/git/branch-name.js.map +1 -0
- package/dist/modules/workflow/git/clone-config.d.ts +61 -0
- package/dist/modules/workflow/git/clone-config.d.ts.map +1 -0
- package/dist/modules/workflow/git/clone-config.js +69 -0
- package/dist/modules/workflow/git/clone-config.js.map +1 -0
- package/dist/modules/workflow/git/git-version.d.ts +34 -0
- package/dist/modules/workflow/git/git-version.d.ts.map +1 -0
- package/dist/modules/workflow/git/git-version.js +63 -0
- package/dist/modules/workflow/git/git-version.js.map +1 -0
- package/dist/modules/workflow/git/git.service.d.ts +427 -0
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -0
- package/dist/modules/workflow/git/git.service.js +1987 -0
- package/dist/modules/workflow/git/git.service.js.map +1 -0
- package/dist/modules/workflow/git/mutex.d.ts +11 -0
- package/dist/modules/workflow/git/mutex.d.ts.map +1 -0
- package/dist/modules/workflow/git/mutex.js +23 -0
- package/dist/modules/workflow/git/mutex.js.map +1 -0
- package/dist/modules/workflow/git/pull-request.service.d.ts +124 -0
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -0
- package/dist/modules/workflow/git/pull-request.service.js +328 -0
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -0
- package/dist/modules/workflow/locking-filesystem.d.ts +133 -0
- package/dist/modules/workflow/locking-filesystem.d.ts.map +1 -0
- package/dist/modules/workflow/locking-filesystem.js +400 -0
- package/dist/modules/workflow/locking-filesystem.js.map +1 -0
- package/dist/modules/workflow/pending-commits.service.d.ts +221 -0
- package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -0
- package/dist/modules/workflow/pending-commits.service.js +364 -0
- package/dist/modules/workflow/pending-commits.service.js.map +1 -0
- package/dist/modules/workflow/pending-commits.worker.d.ts +148 -0
- package/dist/modules/workflow/pending-commits.worker.d.ts.map +1 -0
- package/dist/modules/workflow/pending-commits.worker.js +245 -0
- package/dist/modules/workflow/pending-commits.worker.js.map +1 -0
- package/dist/modules/workflow/read-only-filesystem.d.ts +24 -0
- package/dist/modules/workflow/read-only-filesystem.d.ts.map +1 -0
- package/dist/modules/workflow/read-only-filesystem.js +39 -0
- package/dist/modules/workflow/read-only-filesystem.js.map +1 -0
- package/dist/modules/workflow/recovery-bot.d.ts +31 -0
- package/dist/modules/workflow/recovery-bot.d.ts.map +1 -0
- package/dist/modules/workflow/recovery-bot.js +64 -0
- package/dist/modules/workflow/recovery-bot.js.map +1 -0
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts +137 -0
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts.map +1 -0
- package/dist/modules/workflow/review-workflow/review-workflow.interface.js +2 -0
- package/dist/modules/workflow/review-workflow/review-workflow.interface.js.map +1 -0
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts +26 -0
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -0
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +636 -0
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -0
- package/dist/modules/workflow/sanitize-error.d.ts +29 -0
- package/dist/modules/workflow/sanitize-error.d.ts.map +1 -0
- package/dist/modules/workflow/sanitize-error.js +60 -0
- package/dist/modules/workflow/sanitize-error.js.map +1 -0
- package/dist/modules/workflow/session-ontology.policy.d.ts +52 -0
- package/dist/modules/workflow/session-ontology.policy.d.ts.map +1 -0
- package/dist/modules/workflow/session-ontology.policy.js +62 -0
- package/dist/modules/workflow/session-ontology.policy.js.map +1 -0
- package/dist/modules/workflow/session-ontology.service.d.ts +100 -0
- package/dist/modules/workflow/session-ontology.service.d.ts.map +1 -0
- package/dist/modules/workflow/session-ontology.service.js +143 -0
- package/dist/modules/workflow/session-ontology.service.js.map +1 -0
- package/dist/modules/workflow/workflow-hooks.d.ts +87 -0
- package/dist/modules/workflow/workflow-hooks.d.ts.map +1 -0
- package/dist/modules/workflow/workflow-hooks.js +35 -0
- package/dist/modules/workflow/workflow-hooks.js.map +1 -0
- package/dist/modules/workflow/workflow.errors.d.ts +171 -0
- package/dist/modules/workflow/workflow.errors.d.ts.map +1 -0
- package/dist/modules/workflow/workflow.errors.js +260 -0
- package/dist/modules/workflow/workflow.errors.js.map +1 -0
- package/dist/modules/workflow/workflow.routes.d.ts +26 -0
- package/dist/modules/workflow/workflow.routes.d.ts.map +1 -0
- package/dist/modules/workflow/workflow.routes.js +804 -0
- package/dist/modules/workflow/workflow.routes.js.map +1 -0
- package/dist/modules/workflow/workflow.service.d.ts +385 -0
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -0
- package/dist/modules/workflow/workflow.service.js +1155 -0
- package/dist/modules/workflow/workflow.service.js.map +1 -0
- package/dist/modules/workspace/bevel-ignore.d.ts +25 -0
- package/dist/modules/workspace/bevel-ignore.d.ts.map +1 -0
- package/dist/modules/workspace/bevel-ignore.js +57 -0
- package/dist/modules/workspace/bevel-ignore.js.map +1 -0
- package/dist/modules/workspace/kb-seed.interface.d.ts +36 -0
- package/dist/modules/workspace/kb-seed.interface.d.ts.map +1 -0
- package/dist/modules/workspace/kb-seed.interface.js +2 -0
- package/dist/modules/workspace/kb-seed.interface.js.map +1 -0
- package/dist/modules/workspace/kb-seed.service.d.ts +70 -0
- package/dist/modules/workspace/kb-seed.service.d.ts.map +1 -0
- package/dist/modules/workspace/kb-seed.service.js +325 -0
- package/dist/modules/workspace/kb-seed.service.js.map +1 -0
- package/dist/modules/workspace/routine-write-policy.d.ts +49 -0
- package/dist/modules/workspace/routine-write-policy.d.ts.map +1 -0
- package/dist/modules/workspace/routine-write-policy.js +46 -0
- package/dist/modules/workspace/routine-write-policy.js.map +1 -0
- package/dist/modules/workspace/session-ontology.gate.d.ts +112 -0
- package/dist/modules/workspace/session-ontology.gate.d.ts.map +1 -0
- package/dist/modules/workspace/session-ontology.gate.js +161 -0
- package/dist/modules/workspace/session-ontology.gate.js.map +1 -0
- package/dist/modules/workspace/session-sink.d.ts +25 -0
- package/dist/modules/workspace/session-sink.d.ts.map +1 -0
- package/dist/modules/workspace/session-sink.js +8 -0
- package/dist/modules/workspace/session-sink.js.map +1 -0
- package/dist/modules/workspace/spill-store.d.ts +24 -0
- package/dist/modules/workspace/spill-store.d.ts.map +1 -0
- package/dist/modules/workspace/spill-store.js +87 -0
- package/dist/modules/workspace/spill-store.js.map +1 -0
- package/dist/modules/workspace/workspace.routes.d.ts +25 -0
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -0
- package/dist/modules/workspace/workspace.routes.js +1046 -0
- package/dist/modules/workspace/workspace.routes.js.map +1 -0
- package/dist/modules/workspace/workspace.service.d.ts +339 -0
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -0
- package/dist/modules/workspace/workspace.service.js +1221 -0
- package/dist/modules/workspace/workspace.service.js.map +1 -0
- package/dist/modules/workspace/workspace.tools.d.ts +19 -0
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -0
- package/dist/modules/workspace/workspace.tools.js +767 -0
- package/dist/modules/workspace/workspace.tools.js.map +1 -0
- package/dist/shared/frontmatter-id.d.ts +35 -0
- package/dist/shared/frontmatter-id.d.ts.map +1 -0
- package/dist/shared/frontmatter-id.js +68 -0
- package/dist/shared/frontmatter-id.js.map +1 -0
- package/dist/shared/fs-walk.d.ts +9 -0
- package/dist/shared/fs-walk.d.ts.map +1 -0
- package/dist/shared/fs-walk.js +34 -0
- package/dist/shared/fs-walk.js.map +1 -0
- package/dist/shared/hash-email.d.ts +11 -0
- package/dist/shared/hash-email.d.ts.map +1 -0
- package/dist/shared/hash-email.js +14 -0
- package/dist/shared/hash-email.js.map +1 -0
- package/dist/shared/kb-layout.d.ts +38 -0
- package/dist/shared/kb-layout.d.ts.map +1 -0
- package/dist/shared/kb-layout.js +102 -0
- package/dist/shared/kb-layout.js.map +1 -0
- package/dist/shared/kb-layout.test.d.ts +2 -0
- package/dist/shared/kb-layout.test.d.ts.map +1 -0
- package/dist/shared/kb-layout.test.js +67 -0
- package/dist/shared/kb-layout.test.js.map +1 -0
- package/dist/shared/ssrf.d.ts +20 -0
- package/dist/shared/ssrf.d.ts.map +1 -0
- package/dist/shared/ssrf.js +89 -0
- package/dist/shared/ssrf.js.map +1 -0
- package/dist/shared/token-crypto.d.ts +16 -0
- package/dist/shared/token-crypto.d.ts.map +1 -0
- package/dist/shared/token-crypto.js +49 -0
- package/dist/shared/token-crypto.js.map +1 -0
- package/dist/shared/ttl-cache.d.ts +16 -0
- package/dist/shared/ttl-cache.d.ts.map +1 -0
- package/dist/shared/ttl-cache.js +27 -0
- package/dist/shared/ttl-cache.js.map +1 -0
- package/dist/shared/utcp-namespace.d.ts +46 -0
- package/dist/shared/utcp-namespace.d.ts.map +1 -0
- package/dist/shared/utcp-namespace.js +82 -0
- package/dist/shared/utcp-namespace.js.map +1 -0
- package/dist/version.d.ts +17 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +19 -0
- package/dist/version.js.map +1 -0
- package/kb-template/.bevelignore +21 -0
- package/kb-template/Agents/.gitkeep +0 -0
- package/kb-template/Agents/README.md +38 -0
- package/kb-template/CLAUDE.md +419 -0
- package/kb-template/Data/.gitkeep +0 -0
- package/kb-template/Data/README.md +39 -0
- package/kb-template/KnowledgeBase/.gitkeep +0 -0
- package/kb-template/KnowledgeBase/README.md +37 -0
- package/kb-template/Pipelines/.gitkeep +0 -0
- package/kb-template/Pipelines/README.md +38 -0
- package/kb-template/Skills/.gitkeep +0 -0
- package/kb-template/Skills/README.md +32 -0
- package/kb-template/Tools/.gitkeep +0 -0
- package/kb-template/Tools/README.md +42 -0
- package/kb-template/access.md +36 -0
- package/migrations/0000_core_init.sql +243 -0
- package/migrations/meta/0000_snapshot.json +1480 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +80 -0
- package/src/assets.ts +25 -0
- package/src/core/core-ports.ts +91 -0
- package/src/core/create-core-server.ts +338 -0
- package/src/core/create-core-services.ts +501 -0
- package/src/core-config.ts +257 -0
- package/src/index.ts +69 -0
- package/src/modules/access/__tests__/access-control.atref-batch.test.ts +98 -0
- package/src/modules/access/__tests__/access-control.read-batch.test.ts +132 -0
- package/src/modules/access/__tests__/access-control.service.test.ts +1011 -0
- package/src/modules/access/__tests__/access-mutation.service.test.ts +439 -0
- package/src/modules/access/__tests__/access-splice.test.ts +247 -0
- package/src/modules/access/__tests__/access.routes.revoke.test.ts +407 -0
- package/src/modules/access/__tests__/creator-access.test.ts +217 -0
- package/src/modules/access/__tests__/grant-sources.test.ts +204 -0
- package/src/modules/access/__tests__/kb-read-filter.test.ts +70 -0
- package/src/modules/access/__tests__/roles-admin.service.test.ts +469 -0
- package/src/modules/access/__tests__/roles-edit.test.ts +138 -0
- package/src/modules/access/__tests__/roles-yaml-guard.test.ts +70 -0
- package/src/modules/access/__tests__/roles.routes.test.ts +234 -0
- package/src/modules/access/access-control.interface.ts +383 -0
- package/src/modules/access/access-control.service.ts +1794 -0
- package/src/modules/access/access-errors.ts +60 -0
- package/src/modules/access/access-mutation.service.ts +369 -0
- package/src/modules/access/access-splice.ts +413 -0
- package/src/modules/access/access.routes.ts +894 -0
- package/src/modules/access/creator-access.ts +270 -0
- package/src/modules/access/kb-read-filter.ts +76 -0
- package/src/modules/access/roles-admin.service.ts +741 -0
- package/src/modules/access/roles-edit.ts +248 -0
- package/src/modules/access/roles-yaml-guard.ts +89 -0
- package/src/modules/admin/admin-access.routes.ts +29 -0
- package/src/modules/admin/admin-access.service.ts +38 -0
- package/src/modules/admin/admin.interface.ts +10 -0
- package/src/modules/auth/account-erasure.service.ts +183 -0
- package/src/modules/auth/auth.middleware.ts +78 -0
- package/src/modules/auth/auth.routes.ts +97 -0
- package/src/modules/auth/auth.service.ts +199 -0
- package/src/modules/code-mode/code-mode-names.ts +38 -0
- package/src/modules/code-mode/code-mode.tool.ts +117 -0
- package/src/modules/code-mode/index.ts +6 -0
- package/src/modules/database/connection.ts +15 -0
- package/src/modules/database/core-schema.ts +431 -0
- package/src/modules/database/migrate.ts +43 -0
- package/src/modules/database/schema.ts +11 -0
- package/src/modules/diff/__tests__/diff.routes.read-gate.test.ts +87 -0
- package/src/modules/diff/__tests__/diff.routes.rejectPathsLocked.test.ts +150 -0
- package/src/modules/diff/__tests__/diff.service.seed-atomicity.test.ts +184 -0
- package/src/modules/diff/__tests__/diff.service.test.ts +202 -0
- package/src/modules/diff/diff-paths.ts +9 -0
- package/src/modules/diff/diff.config.ts +12 -0
- package/src/modules/diff/diff.interface.ts +78 -0
- package/src/modules/diff/diff.routes.ts +277 -0
- package/src/modules/diff/diff.service.ts +508 -0
- package/src/modules/diff/line-diff.ts +79 -0
- package/src/modules/mcp/__tests__/bevel-oauth-provider.test.ts +287 -0
- package/src/modules/mcp/__tests__/mcp-auth.middleware.test.ts +249 -0
- package/src/modules/mcp/__tests__/mcp-proxy-helpers.test.ts +253 -0
- package/src/modules/mcp/__tests__/mcp-session-store.test.ts +151 -0
- package/src/modules/mcp/__tests__/mcp.e2e.test.ts +150 -0
- package/src/modules/mcp/__tests__/mcp.routes.delete.test.ts +92 -0
- package/src/modules/mcp/__tests__/mcp.service.test.ts +414 -0
- package/src/modules/mcp/mcp-auth.middleware.ts +126 -0
- package/src/modules/mcp/mcp-session-store.ts +162 -0
- package/src/modules/mcp/mcp.routes.ts +263 -0
- package/src/modules/mcp/mcp.service.ts +973 -0
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +401 -0
- package/src/modules/mcp/oauth/oauth-consent.routes.ts +60 -0
- package/src/modules/mcp/oauth/oauth-state.ts +61 -0
- package/src/modules/secrets-vault/__tests__/connect-pending.route.test.ts +277 -0
- package/src/modules/secrets-vault/__tests__/db-secrets-vault.oauth.test.ts +206 -0
- package/src/modules/secrets-vault/__tests__/mcp-oauth-discovery.service.test.ts +178 -0
- package/src/modules/secrets-vault/__tests__/scopes-covered.test.ts +101 -0
- package/src/modules/secrets-vault/__tests__/secrets-variable-loader.test.ts +54 -0
- package/src/modules/secrets-vault/__tests__/tool-owner-gate.route.test.ts +143 -0
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +792 -0
- package/src/modules/secrets-vault/index.ts +25 -0
- package/src/modules/secrets-vault/mcp-oauth-discovery.service.ts +289 -0
- package/src/modules/secrets-vault/secrets-variable-loader.ts +104 -0
- package/src/modules/secrets-vault/secrets-vault.contract.ts +270 -0
- package/src/modules/secrets-vault/secrets-vault.routes.ts +526 -0
- package/src/modules/skills/__tests__/skills.service.test.ts +176 -0
- package/src/modules/skills/index.ts +10 -0
- package/src/modules/skills/skills.contract.ts +54 -0
- package/src/modules/skills/skills.routes.ts +38 -0
- package/src/modules/skills/skills.service.ts +245 -0
- package/src/modules/skills/skills.tools.ts +121 -0
- package/src/modules/tool-auth/__tests__/external-api-key.service.test.ts +358 -0
- package/src/modules/tool-auth/__tests__/internal-token.service.test.ts +79 -0
- package/src/modules/tool-auth/__tests__/manual-auth.middleware.test.ts +88 -0
- package/src/modules/tool-auth/external-api-key.errors.ts +25 -0
- package/src/modules/tool-auth/external-api-key.interface.ts +99 -0
- package/src/modules/tool-auth/external-api-key.service.ts +209 -0
- package/src/modules/tool-auth/internal-token.service.ts +124 -0
- package/src/modules/tool-auth/llm-usage-meter.ts +19 -0
- package/src/modules/tool-auth/tool-auth.middleware.ts +220 -0
- package/src/modules/tool-helpers/__tests__/phase0-loopback-spike.test.ts +129 -0
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +95 -0
- package/src/modules/tool-helpers/__tests__/tools-surface.test.ts +146 -0
- package/src/modules/tool-helpers/__tests__/validate-token.test.ts +75 -0
- package/src/modules/tool-helpers/index.ts +18 -0
- package/src/modules/tool-helpers/tool-context.ts +98 -0
- package/src/modules/tool-helpers/tool-def.ts +73 -0
- package/src/modules/tool-helpers/tool-handler.ts +91 -0
- package/src/modules/tool-helpers/tool.contract.ts +85 -0
- package/src/modules/tool-helpers/validate-token.ts +50 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.mcp-oauth.test.ts +200 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.service.test.ts +499 -0
- package/src/modules/tool-manuals/__tests__/tool-manuals.tools.test.ts +156 -0
- package/src/modules/tool-manuals/index.ts +12 -0
- package/src/modules/tool-manuals/tool-manuals.contract.ts +183 -0
- package/src/modules/tool-manuals/tool-manuals.routes.ts +110 -0
- package/src/modules/tool-manuals/tool-manuals.service.ts +781 -0
- package/src/modules/tool-manuals/tool-manuals.tools.ts +202 -0
- package/src/modules/tool-registry/__tests__/tool-registry.test.ts +64 -0
- package/src/modules/tool-registry/manual.routes.ts +87 -0
- package/src/modules/tool-registry/tool-registry.ts +55 -0
- package/src/modules/tool-registry/tool.contract.ts +52 -0
- package/src/modules/workflow/__tests__/event-bus.test.ts +322 -0
- package/src/modules/workflow/__tests__/file-change-notifier.test.ts +51 -0
- package/src/modules/workflow/__tests__/format-affected-owners.test.ts +67 -0
- package/src/modules/workflow/__tests__/locking-filesystem.test.ts +445 -0
- package/src/modules/workflow/__tests__/pending-commits.canonical.test.ts +36 -0
- package/src/modules/workflow/__tests__/pending-commits.worker.test.ts +243 -0
- package/src/modules/workflow/__tests__/preserve-roles-yaml.test.ts +308 -0
- package/src/modules/workflow/__tests__/sanitize-error.test.ts +67 -0
- package/src/modules/workflow/__tests__/session-ontology.policy.test.ts +62 -0
- package/src/modules/workflow/__tests__/session-ontology.service.test.ts +200 -0
- package/src/modules/workflow/__tests__/workflow.service.commitFileWhileLocked.test.ts +232 -0
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +380 -0
- package/src/modules/workflow/__tests__/workflow.service.releaseLock.test.ts +340 -0
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +192 -0
- package/src/modules/workflow/agent-tools/workflow.tools.ts +502 -0
- package/src/modules/workflow/event-bus.ts +262 -0
- package/src/modules/workflow/events.routes.ts +266 -0
- package/src/modules/workflow/file-change-notifier.ts +54 -0
- package/src/modules/workflow/file-lock.service.ts +269 -0
- package/src/modules/workflow/git/__tests__/branch-name.test.ts +86 -0
- package/src/modules/workflow/git/__tests__/branchAuthor.test.ts +80 -0
- package/src/modules/workflow/git/__tests__/clone-config.test.ts +15 -0
- package/src/modules/workflow/git/__tests__/git-test-helpers.ts +47 -0
- package/src/modules/workflow/git/__tests__/git-version.failure.test.ts +24 -0
- package/src/modules/workflow/git/__tests__/git-version.test.ts +49 -0
- package/src/modules/workflow/git/__tests__/git.service.accessGating.test.ts +389 -0
- package/src/modules/workflow/git/__tests__/git.service.changedFilesForPr.test.ts +124 -0
- package/src/modules/workflow/git/__tests__/git.service.commitChanges.test.ts +105 -0
- package/src/modules/workflow/git/__tests__/git.service.commitFile.test.ts +211 -0
- package/src/modules/workflow/git/__tests__/git.service.createBranch.test.ts +154 -0
- package/src/modules/workflow/git/__tests__/git.service.deleteBranch.test.ts +320 -0
- package/src/modules/workflow/git/__tests__/git.service.diffFileAtCommit.test.ts +202 -0
- package/src/modules/workflow/git/__tests__/git.service.diffFileBetweenBranches.test.ts +453 -0
- package/src/modules/workflow/git/__tests__/git.service.list-branches.test.ts +198 -0
- package/src/modules/workflow/git/__tests__/git.service.listTrackedFiles.test.ts +125 -0
- package/src/modules/workflow/git/__tests__/git.service.logForFile.test.ts +219 -0
- package/src/modules/workflow/git/__tests__/git.service.mergeChangeRequest.test.ts +145 -0
- package/src/modules/workflow/git/__tests__/git.service.pendingChanges.test.ts +240 -0
- package/src/modules/workflow/git/__tests__/git.service.postMergePull.test.ts +272 -0
- package/src/modules/workflow/git/__tests__/git.service.pull.test.ts +232 -0
- package/src/modules/workflow/git/__tests__/git.service.readFileAtRef.test.ts +101 -0
- package/src/modules/workflow/git/__tests__/git.service.status.test.ts +127 -0
- package/src/modules/workflow/git/__tests__/mutex.test.ts +78 -0
- package/src/modules/workflow/git/__tests__/pull-request.service.test.ts +225 -0
- package/src/modules/workflow/git/__tests__/pull-request.service.viewer-can-cancel.test.ts +101 -0
- package/src/modules/workflow/git/branch-name.ts +70 -0
- package/src/modules/workflow/git/clone-config.ts +71 -0
- package/src/modules/workflow/git/git-version.ts +70 -0
- package/src/modules/workflow/git/git.service.ts +2248 -0
- package/src/modules/workflow/git/mutex.ts +22 -0
- package/src/modules/workflow/git/pull-request.service.ts +447 -0
- package/src/modules/workflow/locking-filesystem.ts +489 -0
- package/src/modules/workflow/pending-commits.service.ts +444 -0
- package/src/modules/workflow/pending-commits.worker.ts +361 -0
- package/src/modules/workflow/read-only-filesystem.ts +54 -0
- package/src/modules/workflow/recovery-bot.ts +73 -0
- package/src/modules/workflow/review-workflow/__tests__/approval-states.test.ts +560 -0
- package/src/modules/workflow/review-workflow/__tests__/cancel-pr.test.ts +176 -0
- package/src/modules/workflow/review-workflow/__tests__/merge-gate.test.ts +258 -0
- package/src/modules/workflow/review-workflow/review-workflow.interface.ts +199 -0
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +806 -0
- package/src/modules/workflow/sanitize-error.ts +62 -0
- package/src/modules/workflow/session-ontology.policy.ts +70 -0
- package/src/modules/workflow/session-ontology.service.ts +178 -0
- package/src/modules/workflow/workflow-hooks.ts +101 -0
- package/src/modules/workflow/workflow.errors.ts +285 -0
- package/src/modules/workflow/workflow.routes.ts +858 -0
- package/src/modules/workflow/workflow.service.ts +1555 -0
- package/src/modules/workspace/__tests__/kb-seed.service.test.ts +213 -0
- package/src/modules/workspace/__tests__/routine-write-policy.test.ts +68 -0
- package/src/modules/workspace/__tests__/session-ontology.gate.test.ts +237 -0
- package/src/modules/workspace/__tests__/spill-store.test.ts +43 -0
- package/src/modules/workspace/__tests__/workspace.routes.create-grant.test.ts +233 -0
- package/src/modules/workspace/__tests__/workspace.routes.delete.test.ts +176 -0
- package/src/modules/workspace/__tests__/workspace.routes.download.test.ts +303 -0
- package/src/modules/workspace/__tests__/workspace.routes.read-gate.test.ts +276 -0
- package/src/modules/workspace/__tests__/workspace.service.read-filter.test.ts +120 -0
- package/src/modules/workspace/__tests__/workspace.service.test.ts +565 -0
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +504 -0
- package/src/modules/workspace/bevel-ignore.ts +62 -0
- package/src/modules/workspace/kb-seed.interface.ts +36 -0
- package/src/modules/workspace/kb-seed.service.ts +361 -0
- package/src/modules/workspace/routine-write-policy.ts +79 -0
- package/src/modules/workspace/session-ontology.gate.ts +189 -0
- package/src/modules/workspace/session-sink.ts +25 -0
- package/src/modules/workspace/spill-store.ts +87 -0
- package/src/modules/workspace/workspace.routes.ts +1114 -0
- package/src/modules/workspace/workspace.service.ts +1343 -0
- package/src/modules/workspace/workspace.tools.ts +885 -0
- package/src/shared/__tests__/frontmatter-id.test.ts +88 -0
- package/src/shared/__tests__/fs-walk.test.ts +42 -0
- package/src/shared/__tests__/ssrf.test.ts +53 -0
- package/src/shared/__tests__/utcp-namespace.test.ts +19 -0
- package/src/shared/frontmatter-id.ts +72 -0
- package/src/shared/fs-walk.ts +30 -0
- package/src/shared/hash-email.ts +14 -0
- package/src/shared/kb-layout.test.ts +88 -0
- package/src/shared/kb-layout.ts +101 -0
- package/src/shared/ssrf.ts +78 -0
- package/src/shared/token-crypto.ts +54 -0
- package/src/shared/ttl-cache.ts +27 -0
- package/src/shared/utcp-namespace.ts +88 -0
- package/src/version.ts +19 -0
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import type { AuthUser, BranchInfo, CommitAttribution, IGitService, PrFileStatus, PullRequestFile, ShareChangesRequest, WorkingTreeStatus } from '@bevel-software/platform-shared';
|
|
2
|
+
import type { WorkspaceService } from '../../workspace/workspace.service.js';
|
|
3
|
+
import type { WorkflowHooks } from '../workflow-hooks.js';
|
|
4
|
+
import type { IAccessControl } from '../../access/access-control.interface.js';
|
|
5
|
+
import { WorkspaceMutex } from './mutex.js';
|
|
6
|
+
import { PROTECTED_BRANCHES } from './branch-name.js';
|
|
7
|
+
/**
|
|
8
|
+
* Git parses `--author="Name <email>"` by scanning for the last `<` and `>` and
|
|
9
|
+
* taking everything before the `<` as the name. Stray angle brackets, newlines, or
|
|
10
|
+
* carriage returns in either field break that parser or let a caller forge a
|
|
11
|
+
* different author line. Reject rather than try to escape.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Parse the NUL-delimited output of `git status --porcelain=v1 -z` into a
|
|
15
|
+
* deduplicated list of paths the next commit would include. For a rename /
|
|
16
|
+
* copy entry the record spans two NUL-separated fields (new-path, old-path);
|
|
17
|
+
* we keep the new path and discard the old one.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parsePorcelainZ(stdout: string): string[];
|
|
20
|
+
export declare class GitService implements IGitService {
|
|
21
|
+
private readonly workspaceService;
|
|
22
|
+
/**
|
|
23
|
+
* Workflow lifecycle hooks. This service only consults the ADVISORY
|
|
24
|
+
* `commitValidation` hooks (registered by the enterprise kb module in the
|
|
25
|
+
* composition root — the constructor-injected `IKbValidator` this
|
|
26
|
+
* replaced). No hooks registered = no commit-time validation, which is
|
|
27
|
+
* safe because validation is advisory and never blocks a commit.
|
|
28
|
+
*/
|
|
29
|
+
private readonly hooks;
|
|
30
|
+
private readonly kbDirName;
|
|
31
|
+
private readonly mutex;
|
|
32
|
+
private readonly accessControl;
|
|
33
|
+
private readonly fetchLocks;
|
|
34
|
+
private readonly lastImplicitFetchAt;
|
|
35
|
+
private static readonly IMPLICIT_FETCH_TTL_MS;
|
|
36
|
+
private static readonly MAX_AHEAD_BEHIND_CONCURRENCY;
|
|
37
|
+
constructor(workspaceService: WorkspaceService,
|
|
38
|
+
/**
|
|
39
|
+
* Workflow lifecycle hooks. This service only consults the ADVISORY
|
|
40
|
+
* `commitValidation` hooks (registered by the enterprise kb module in the
|
|
41
|
+
* composition root — the constructor-injected `IKbValidator` this
|
|
42
|
+
* replaced). No hooks registered = no commit-time validation, which is
|
|
43
|
+
* safe because validation is advisory and never blocks a commit.
|
|
44
|
+
*/
|
|
45
|
+
hooks: WorkflowHooks, kbDirName: string, mutex?: WorkspaceMutex, accessControl?: IAccessControl | null);
|
|
46
|
+
/**
|
|
47
|
+
* "Does the pending-commits queue hold rows for this workspace?" — used by
|
|
48
|
+
* `statusInternal` to tell an expected dirty tree (queued saves still
|
|
49
|
+
* draining) from a genuinely orphaned one. Injected as a narrow probe via
|
|
50
|
+
* setter (not constructor) because the queue service is constructed after
|
|
51
|
+
* this one in the composition root; `null` (e.g. in tests) keeps the old
|
|
52
|
+
* always-warn behavior.
|
|
53
|
+
*/
|
|
54
|
+
private pendingCommitsProbe;
|
|
55
|
+
setPendingCommitsProbe(probe: (workspaceId: string) => Promise<boolean>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Mark a workspace as freshly fetched. Called by `WorkspaceService` right
|
|
58
|
+
* after a branch's clone is created — `git clone` already downloaded every
|
|
59
|
+
* ref, so the first `listBranches` can skip the redundant implicit
|
|
60
|
+
* `git fetch` (see `fetchOriginIfStale`).
|
|
61
|
+
*/
|
|
62
|
+
noteWorkspaceFetched(workspaceId: string): void;
|
|
63
|
+
/**
|
|
64
|
+
* Run the registered ADVISORY commit-validation hooks at a commit site.
|
|
65
|
+
* Preserves the semantics of the injected validator this replaced: a
|
|
66
|
+
* `mustFix` report is logged (via `formatWarning`) but never blocks, and a
|
|
67
|
+
* hook that throws is caught and logged — we'd rather land the commit than
|
|
68
|
+
* refuse the save because a validator crashed. Each hook gets its own
|
|
69
|
+
* try/catch so one crashing hook can't silence another.
|
|
70
|
+
*/
|
|
71
|
+
private runCommitValidationHooks;
|
|
72
|
+
/**
|
|
73
|
+
* Resolve write permission for a list of repo-relative paths against the
|
|
74
|
+
* access tree at a specific ref. Throws `AccessDeniedError` for the first
|
|
75
|
+
* path the caller lacks `write` on, with the eligible-roles + users
|
|
76
|
+
* payload attached so the frontend can render a useful refusal message.
|
|
77
|
+
*
|
|
78
|
+
* Always uses an at-ref lookup (never the working tree) so a user can't
|
|
79
|
+
* grant themselves access by editing `roles.yaml` / `access.md` locally.
|
|
80
|
+
* Callers pass:
|
|
81
|
+
* - `HEAD` for commit / revert gates — the pre-operation state is the
|
|
82
|
+
* authoritative source for whether the user can write these paths.
|
|
83
|
+
* - `origin/<branch>` for push gates — the published state is the
|
|
84
|
+
* authoritative source; local rebases or commit-tree manipulation
|
|
85
|
+
* can't slip changes past this check.
|
|
86
|
+
*
|
|
87
|
+
* Bootstrap: if the ref doesn't carry usable config (no `roles.yaml` /
|
|
88
|
+
* malformed / first commit creating the system), `canWriteBatchAtRef`
|
|
89
|
+
* returns null and we treat that as "no rules in force yet" → allow.
|
|
90
|
+
* Once config exists at the ref, gating kicks in.
|
|
91
|
+
*
|
|
92
|
+
* `accessControl` is optional on the constructor so existing tests that
|
|
93
|
+
* don't exercise these paths can keep their stub WorkspaceService — when
|
|
94
|
+
* it's null we skip the check entirely (legacy behaviour, only the
|
|
95
|
+
* branch-name guards remain). Production wires it up via composition root.
|
|
96
|
+
*/
|
|
97
|
+
private assertCanWriteAtRef;
|
|
98
|
+
status(workspaceId: string): Promise<WorkingTreeStatus>;
|
|
99
|
+
listBranches(workspaceId: string, opts?: {
|
|
100
|
+
freshFetch?: boolean;
|
|
101
|
+
}): Promise<BranchInfo[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Run `git fetch --prune origin` outside the workspace mutex, with a short
|
|
104
|
+
* TTL so back-to-back callers (mount + dropdown-open + 30s poll) coalesce
|
|
105
|
+
* onto a single in-flight fetch instead of each waiting their turn behind
|
|
106
|
+
* the network round-trip. Failures (offline, bad auth, no remote) are
|
|
107
|
+
* logged and swallowed so the branch list still serves stale local data
|
|
108
|
+
* instead of returning 500.
|
|
109
|
+
*
|
|
110
|
+
* Safe to keep outside the mutex: fetch only writes remote-tracking refs
|
|
111
|
+
* and the object store, neither of which checkout/status/commit touch.
|
|
112
|
+
*/
|
|
113
|
+
private fetchOriginIfStale;
|
|
114
|
+
createBranch(workspaceId: string, name: string, fromBase?: string): Promise<BranchInfo>;
|
|
115
|
+
deleteBranch(workspaceId: string, name: string, user: AuthUser, opts?: {
|
|
116
|
+
onlyIfNoRemote?: boolean;
|
|
117
|
+
}): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* True iff the given ref (e.g. `refs/heads/foo`, `refs/remotes/origin/foo`)
|
|
120
|
+
* exists in this workspace's clone. Wraps `git show-ref --verify --quiet`
|
|
121
|
+
* — exits 0 when the ref is present, 1 with no stderr when it's missing.
|
|
122
|
+
* Any other exit code / stderr means a real failure and is rethrown so
|
|
123
|
+
* "ref not found" can't silently mask filesystem / repo corruption.
|
|
124
|
+
*
|
|
125
|
+
* `this.git()` wraps execFile failures and stores the original exit code on
|
|
126
|
+
* `wrapped.exitCode` (not `.code`) — check the wrapped property name, or
|
|
127
|
+
* the "ref not found" path silently becomes "rethrow every show-ref error".
|
|
128
|
+
*/
|
|
129
|
+
private refExists;
|
|
130
|
+
commit(workspaceId: string, user: AuthUser, req: ShareChangesRequest): Promise<CommitAttribution>;
|
|
131
|
+
/**
|
|
132
|
+
* Commit a single path — bypasses the one-file-per-change guard in
|
|
133
|
+
* `commit()` because the caller has already scoped the change to one
|
|
134
|
+
* path (typically the lock-release flow, where the lock itself
|
|
135
|
+
* guarantees the file is the only one whose edits this user owns).
|
|
136
|
+
*
|
|
137
|
+
* `git add <path>` then `git commit` — other dirty paths in the working
|
|
138
|
+
* tree are left alone. Validation + protected-branch access gating still
|
|
139
|
+
* run, since `path` could itself be `roles.yaml` / `access.md`.
|
|
140
|
+
*
|
|
141
|
+
* Returns `null` when the path has nothing to commit (no diff against
|
|
142
|
+
* HEAD, not untracked) — keeps lock-release idempotent on "I opened the
|
|
143
|
+
* editor but didn't actually change anything" flows.
|
|
144
|
+
*/
|
|
145
|
+
/**
|
|
146
|
+
* Reset the file's working-tree state to HEAD — used when a write
|
|
147
|
+
* partially completed but the surrounding flow can't commit it
|
|
148
|
+
* (validator was advisory so this is rare, but op-throws + push-
|
|
149
|
+
* blocked-by-access-control still hit this path). Tracked files
|
|
150
|
+
* `git checkout HEAD --` reverts to the committed content; untracked
|
|
151
|
+
* files (a half-written new file) are deleted outright. Either way
|
|
152
|
+
* the working tree returns to a clean state so the next acquirer
|
|
153
|
+
* doesn't inherit half-finished bytes.
|
|
154
|
+
*
|
|
155
|
+
* Idempotent: a path that's already clean stays clean. Missing paths
|
|
156
|
+
* are silently ignored.
|
|
157
|
+
*/
|
|
158
|
+
discardPath(workspaceId: string, relativePath: string): Promise<void>;
|
|
159
|
+
commitFile(workspaceId: string, user: AuthUser, relativePath: string, summary?: string, skipValidator?: boolean): Promise<CommitAttribution | null>;
|
|
160
|
+
/**
|
|
161
|
+
* Atomic multi-file commit — commits whatever is currently dirty in the
|
|
162
|
+
* working tree as ONE commit attributed to `user`, then returns its
|
|
163
|
+
* attribution (or null when the tree is clean — idempotent re-apply). The
|
|
164
|
+
* multi-file sibling of `commit()`: same `git add -A` + commit, but WITHOUT
|
|
165
|
+
* the one-file-per-change guard — the caller has assembled + written + validated
|
|
166
|
+
* a batch (bulk node upload; the role-rename rewrite via `LockingFilesystem`).
|
|
167
|
+
*
|
|
168
|
+
* Deliberately does NOT write file content itself — disk writes are the
|
|
169
|
+
* caller's job. This is the git layer: it only stages + commits what is already
|
|
170
|
+
* on disk (the working tree is expected otherwise-clean under save=share, so
|
|
171
|
+
* `git add -A` stages exactly the caller's batch). Caller pushes separately
|
|
172
|
+
* (mirrors `commitFile` + `push`).
|
|
173
|
+
*/
|
|
174
|
+
commitChanges(workspaceId: string, user: AuthUser, summary: string): Promise<CommitAttribution | null>;
|
|
175
|
+
push(workspaceId: string, user: AuthUser): Promise<void>;
|
|
176
|
+
/**
|
|
177
|
+
* Attempt a local merge of `origin/<targetBranch>` into the currently-
|
|
178
|
+
* checked-out branch. Used by the workflow module to auto-merge target →
|
|
179
|
+
* source when a change request is opened or refreshed (PLAN §1).
|
|
180
|
+
*
|
|
181
|
+
* Two outcomes:
|
|
182
|
+
* - `{ kind: 'clean', alreadyUpToDate }` — merge succeeded, possibly as a
|
|
183
|
+
* no-op (`alreadyUpToDate: true`) or with a new merge commit attributed
|
|
184
|
+
* to `user` with a descriptive subject + body so reviewers can see why
|
|
185
|
+
* the merge landed without inspecting the diff.
|
|
186
|
+
* - `{ kind: 'conflicts', paths }` — `git merge` reported conflicts. The
|
|
187
|
+
* merge is aborted to leave the working tree clean before returning
|
|
188
|
+
* the conflicting paths so the caller can route to the agent for
|
|
189
|
+
* resolution.
|
|
190
|
+
*
|
|
191
|
+
* Requires the source branch to already be checked out and the working
|
|
192
|
+
* tree clean — both refused with structured errors before any git op runs.
|
|
193
|
+
*/
|
|
194
|
+
mergeFromOrigin(workspaceId: string, sourceBranch: string, targetBranch: string, user: AuthUser): Promise<{
|
|
195
|
+
kind: 'clean';
|
|
196
|
+
alreadyUpToDate: boolean;
|
|
197
|
+
} | {
|
|
198
|
+
kind: 'conflicts';
|
|
199
|
+
paths: string[];
|
|
200
|
+
}>;
|
|
201
|
+
/**
|
|
202
|
+
* Merge a change request locally and publish it to the target branch — the
|
|
203
|
+
* provider-agnostic replacement for `gh pr merge`. Runs in the *base* branch's
|
|
204
|
+
* workspace: reset to the published base tip, merge the source's published
|
|
205
|
+
* tip as a `--no-ff` commit authored by the human triggerer, and push.
|
|
206
|
+
*
|
|
207
|
+
* Serialized per base workspace via the mutex, with a bounded retry: if the
|
|
208
|
+
* push is rejected because the base advanced (a concurrent merge), we reset to
|
|
209
|
+
* the new base and re-merge on top of it. Conflicts are deterministic — they
|
|
210
|
+
* return immediately (no retry) so the caller can route into resolution.
|
|
211
|
+
*
|
|
212
|
+
* Returns the merge commit SHA, or the conflicting paths.
|
|
213
|
+
*/
|
|
214
|
+
mergeChangeRequest(baseWorkspaceId: string, sourceBranch: string, targetBranch: string, commit: {
|
|
215
|
+
subject: string;
|
|
216
|
+
body: string;
|
|
217
|
+
}, user: AuthUser): Promise<{
|
|
218
|
+
kind: 'merged';
|
|
219
|
+
sha: string;
|
|
220
|
+
} | {
|
|
221
|
+
kind: 'conflicts';
|
|
222
|
+
paths: string[];
|
|
223
|
+
}>;
|
|
224
|
+
/** Conflicted paths from a half-done merge, parsed from porcelain status. */
|
|
225
|
+
private conflictedPaths;
|
|
226
|
+
/**
|
|
227
|
+
* Paths changed in commits that exist locally but not on the upstream ref —
|
|
228
|
+
* i.e. exactly what the next `push` would publish. Falls back to "every
|
|
229
|
+
* commit not reachable from any remote ref" when there's no upstream yet
|
|
230
|
+
* (first push).
|
|
231
|
+
*/
|
|
232
|
+
private unpushedTouchedPaths;
|
|
233
|
+
fetch(workspaceId: string): Promise<void>;
|
|
234
|
+
/**
|
|
235
|
+
* Collapse the clone's drifted tracking config back to one fetch refspec and
|
|
236
|
+
* one upstream ref, then refresh `refs/remotes/origin/<branch>` through an
|
|
237
|
+
* explicit refspec — never touching the shared `FETCH_HEAD`. Returns the ref
|
|
238
|
+
* the caller should operate on.
|
|
239
|
+
*
|
|
240
|
+
* Both halves matter, and neither is sufficient alone:
|
|
241
|
+
*
|
|
242
|
+
* - The self-heal. A multi-valued `branch.<name>.merge` makes every bare
|
|
243
|
+
* fetch in this clone write more than one *for-merge* FETCH_HEAD entry,
|
|
244
|
+
* which is the ammunition behind the failure below; a duplicated
|
|
245
|
+
* `remote.origin.fetch` refspec is the same class of drift (see
|
|
246
|
+
* `clone-config.ts`). `--replace-all` collapses either back to the single
|
|
247
|
+
* value the clone was created with. Best effort — the fetch names its refs
|
|
248
|
+
* explicitly, so a failure here is harmless.
|
|
249
|
+
*
|
|
250
|
+
* - Never reading or writing `FETCH_HEAD`. `git pull` is a two-step
|
|
251
|
+
* operation — fetch, then read the rebase target out of `.git/FETCH_HEAD`
|
|
252
|
+
* — and `FETCH_HEAD` is a single mutable file shared by every git process
|
|
253
|
+
* in the clone. This service is not the only writer: `fetchOriginIfStale`
|
|
254
|
+
* (outside the workspace mutex, see `listBranches`) and
|
|
255
|
+
* `WorkspaceService.ensureRemotesFetched` (outside it entirely, driven by
|
|
256
|
+
* the CR-list poll) both run bare `git fetch --prune origin`, and a bare
|
|
257
|
+
* fetch writes one for-merge entry per `branch.<name>.merge` value. Let one
|
|
258
|
+
* of those land in the window between the pull's own fetch and its read, on
|
|
259
|
+
* a clone whose merge config has drifted to two values, and pull sees two
|
|
260
|
+
* merge heads and dies with "Cannot rebase onto multiple branches" — the
|
|
261
|
+
* reported failure. (Measured: ~40% of refreshes with one concurrent fetch
|
|
262
|
+
* loop. The drifted config alone never breaks it — an explicit
|
|
263
|
+
* `pull --rebase origin <branch>` survives every drift shape on its own.)
|
|
264
|
+
*
|
|
265
|
+
* So: fetch with an explicit destination refspec, which updates
|
|
266
|
+
* `refs/remotes/origin/<branch>` regardless of any `remote.origin.fetch`
|
|
267
|
+
* drift, and let the caller name that ref. `--no-write-fetch-head` (git
|
|
268
|
+
* 2.29+, asserted at boot by `git-version.ts`) keeps this refresh from
|
|
269
|
+
* perturbing anyone else's `FETCH_HEAD` in turn. Nothing here reads shared
|
|
270
|
+
* mutable state, so no concurrent git process can steer or break it.
|
|
271
|
+
*
|
|
272
|
+
* Shared by the two refresh paths (`pull`, `resetToRemote`) so they can't
|
|
273
|
+
* drift apart — which is precisely the failure class this guards against.
|
|
274
|
+
*/
|
|
275
|
+
private refreshRemoteBranchRef;
|
|
276
|
+
pull(workspaceId: string): Promise<void>;
|
|
277
|
+
/**
|
|
278
|
+
* Hard-reset the workspace's checked-out branch to `origin/<branch>`, fetching
|
|
279
|
+
* first. This is the break-glass primitive behind roles.yaml recovery: it
|
|
280
|
+
* makes the local clone EXACTLY match origin, discarding any local divergence
|
|
281
|
+
* (e.g. a half-finished recovery commit from a prior failed push, or commits
|
|
282
|
+
* the clone was behind on). The caller then writes its fix on top of the
|
|
283
|
+
* current origin tip, so the follow-up push fast-forwards instead of being
|
|
284
|
+
* rejected non-fast-forward.
|
|
285
|
+
*
|
|
286
|
+
* Destructive by design and intentionally NOT gated on the protected-branch
|
|
287
|
+
* rule — it only ever moves the LOCAL ref to match origin (no remote mutation),
|
|
288
|
+
* and recovery must work precisely on the protected default branch. Under
|
|
289
|
+
* save=share there is no precious unpushed local work to lose (every save
|
|
290
|
+
* auto-pushes); the one exception is a failed recovery commit, which the
|
|
291
|
+
* caller re-creates.
|
|
292
|
+
*/
|
|
293
|
+
resetToRemote(workspaceId: string, branch: string): Promise<void>;
|
|
294
|
+
resolveForkBase(workspaceId: string, branch: string): Promise<string | null>;
|
|
295
|
+
/**
|
|
296
|
+
* Count commits on `branch` that aren't on `baseBranch`. Identical to the
|
|
297
|
+
* "ahead" half of `tryAheadBehind` but exposed as a public method because
|
|
298
|
+
* background callers (the routine runner) need to gate "open a CR or
|
|
299
|
+
* clean the branch up?" on it. Returns 0 when either ref can't be
|
|
300
|
+
* resolved — a missing branch can't possibly be ahead of anything, and
|
|
301
|
+
* misreporting as `> 0` would block legitimate cleanup.
|
|
302
|
+
*/
|
|
303
|
+
countCommitsAhead(workspaceId: string, branch: string, baseBranch: string): Promise<number>;
|
|
304
|
+
/**
|
|
305
|
+
* Whether `head` and `origin/<base>` have any common ancestor. False when
|
|
306
|
+
* `head` is an orphan branch or was created from an unrelated history —
|
|
307
|
+
* GitHub refuses PRs in that state with a `no history in common` error,
|
|
308
|
+
* so PR creation pre-flights this and hands off to the agent on false.
|
|
309
|
+
*/
|
|
310
|
+
haveSharedHistory(workspaceId: string, base: string, head: string): Promise<boolean>;
|
|
311
|
+
diffStat(workspaceId: string, base?: string): Promise<string[]>;
|
|
312
|
+
pendingChanges(workspaceId: string): Promise<string[]>;
|
|
313
|
+
/**
|
|
314
|
+
* Repo-relative paths of every VCS-tracked file (NUL-delimited, so paths with
|
|
315
|
+
* spaces or bracketed prefixes survive intact). Untracked / ignored files are
|
|
316
|
+
* excluded — the caller gets exactly the working tree's committed contents.
|
|
317
|
+
*/
|
|
318
|
+
listTrackedFiles(workspaceId: string): Promise<string[]>;
|
|
319
|
+
revertCommit(workspaceId: string, user: AuthUser, sha: string): Promise<CommitAttribution>;
|
|
320
|
+
logForFile(workspaceId: string, relativePath: string, limit?: number): Promise<CommitAttribution[]>;
|
|
321
|
+
diffFileAtCommit(workspaceId: string, relativePath: string, sha: string): Promise<string>;
|
|
322
|
+
diffFileBetweenBranches(workspaceId: string, relativePath: string, fromBranch: string, toBranch: string): Promise<string>;
|
|
323
|
+
/**
|
|
324
|
+
* Head/base commit SHAs for a change request, computed locally — no provider
|
|
325
|
+
* API. `head` is the source branch tip, `base` the target branch tip, both
|
|
326
|
+
* resolved on `origin/*` after a fetch so a force-push is reflected. These are
|
|
327
|
+
* what approvals pin against and what the diff range is built from.
|
|
328
|
+
*/
|
|
329
|
+
resolvePrShas(workspaceId: string, baseBranch: string, headBranch: string): Promise<{
|
|
330
|
+
baseSha: string;
|
|
331
|
+
headSha: string;
|
|
332
|
+
}>;
|
|
333
|
+
/**
|
|
334
|
+
* The changed-file list for a change request, computed locally via three-dot
|
|
335
|
+
* (merge-base) diff — the same semantics a GitHub PR shows. Replaces the
|
|
336
|
+
* `gh api …/pulls/:n/files` call so any git host works.
|
|
337
|
+
*
|
|
338
|
+
* `--name-status` + `--numstat` (both rename-aware via `-M`) drive the file
|
|
339
|
+
* list, statuses, and +/- counts; per-file patches are generated for up to
|
|
340
|
+
* `patchCap` files (default 400) — beyond that `patch` is left undefined,
|
|
341
|
+
* exactly like the old API's binary/oversized files (the UI renders those with
|
|
342
|
+
* no inline diff). Patch generation is skipped for binary files.
|
|
343
|
+
*/
|
|
344
|
+
changedFilesForPr(workspaceId: string, baseBranch: string, headBranch: string, opts?: {
|
|
345
|
+
patchCap?: number;
|
|
346
|
+
}): Promise<PullRequestFile[]>;
|
|
347
|
+
/**
|
|
348
|
+
* Just the repo-relative paths changed by a change request (three-dot), no
|
|
349
|
+
* patches — the cheap version used to build CR-list summaries and owner
|
|
350
|
+
* routing. `changedFilesForPr` is the full version with statuses + diffs.
|
|
351
|
+
*/
|
|
352
|
+
changedPathsForPr(workspaceId: string, baseBranch: string, headBranch: string): Promise<string[]>;
|
|
353
|
+
/** Fetch the two branches a CR spans so origin refs reflect the latest push. */
|
|
354
|
+
private fetchPrRefs;
|
|
355
|
+
/** Unified-diff patch for one file across the CR range (rename-aware). */
|
|
356
|
+
private filePatchForPr;
|
|
357
|
+
/**
|
|
358
|
+
* Strip the `knowledge-base/` prefix from a workspace-relative path so
|
|
359
|
+
* it lines up with where git actually runs (`cwd = repoDir`, i.e. inside
|
|
360
|
+
* `knowledge-base/`). The frontend stores `openFilePath` as a
|
|
361
|
+
* workspace-relative path including that prefix because the file viewer
|
|
362
|
+
* reads/writes through `WorkspaceService.readFile`, which resolves from
|
|
363
|
+
* the workspace root. Git pathspecs, on the other hand, are resolved from
|
|
364
|
+
* cwd — so without this normalization `git diff -- knowledge-base/X`
|
|
365
|
+
* silently looks for `knowledge-base/knowledge-base/X` and returns
|
|
366
|
+
* nothing, which the UI renders as "identical".
|
|
367
|
+
*
|
|
368
|
+
* No-op for paths already repo-relative (the agent tools and tests pass
|
|
369
|
+
* those directly).
|
|
370
|
+
*/
|
|
371
|
+
private stripRepoPrefix;
|
|
372
|
+
/**
|
|
373
|
+
* Resolve a branch name to a concrete ref the local clone knows about.
|
|
374
|
+
* Tries the local head first, falls back to the matching remote-tracking
|
|
375
|
+
* ref. The workspace clone fetches all remotes on creation, so protected
|
|
376
|
+
* branches are reachable through `origin/` even when the user has never
|
|
377
|
+
* personally checked them out.
|
|
378
|
+
*/
|
|
379
|
+
private resolveBranchRef;
|
|
380
|
+
private statusInternal;
|
|
381
|
+
private currentBranch;
|
|
382
|
+
/**
|
|
383
|
+
* Ahead/behind of `ref` (a full ref like `refs/heads/foo` or
|
|
384
|
+
* `refs/remotes/origin/foo`). When the branch exists locally (`hasLocal`),
|
|
385
|
+
* prefer its configured upstream; otherwise — or when no upstream is set —
|
|
386
|
+
* fall back to the nearest protected branch on origin, picking whichever
|
|
387
|
+
* minimises "ahead" as a proxy for the fork point.
|
|
388
|
+
*/
|
|
389
|
+
private aheadBehindForBranch;
|
|
390
|
+
private tryAheadBehind;
|
|
391
|
+
/**
|
|
392
|
+
* Read a repo-relative file's contents at an arbitrary git ref (a branch,
|
|
393
|
+
* `origin/<branch>`, or a sha) WITHOUT checking it out. Returns `null` when
|
|
394
|
+
* the path does not exist at that ref (mirrors the access resolver's
|
|
395
|
+
* `showAtRef`) — the caller distinguishes "absent" from "present but empty".
|
|
396
|
+
* Read-only: `git show <ref>:<path>` never mutates the working tree.
|
|
397
|
+
*/
|
|
398
|
+
readFileAtRef(workspaceId: string, ref: string, repoRelativePath: string): Promise<string | null>;
|
|
399
|
+
private repoDir;
|
|
400
|
+
private isPathUntracked;
|
|
401
|
+
private git;
|
|
402
|
+
}
|
|
403
|
+
interface NameStatusEntry {
|
|
404
|
+
status: PrFileStatus;
|
|
405
|
+
path: string;
|
|
406
|
+
previousPath?: string;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Parse `git diff -M -z --name-status` output. NUL-separated tokens: each record
|
|
410
|
+
* is `<statusLetter>\0<path>`, or for a rename/copy `<Rxxx|Cxxx>\0<old>\0<new>`.
|
|
411
|
+
*/
|
|
412
|
+
export declare function parseNameStatusZ(out: string): NameStatusEntry[];
|
|
413
|
+
interface NumstatEntry {
|
|
414
|
+
additions: number;
|
|
415
|
+
deletions: number;
|
|
416
|
+
isBinary: boolean;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Parse `git diff -M -z --numstat` output, in the SAME file order as
|
|
420
|
+
* `--name-status` (both driven by `-M` over the same range). Each record is
|
|
421
|
+
* `<add>\t<del>\t<path>` for a normal change, or `<add>\t<del>\t\0<old>\0<new>`
|
|
422
|
+
* for a rename (empty path segment before the two NUL-separated names). Binary
|
|
423
|
+
* files report `-` for both counts.
|
|
424
|
+
*/
|
|
425
|
+
export declare function parseNumstatZ(out: string): NumstatEntry[];
|
|
426
|
+
export { PROTECTED_BRANCHES };
|
|
427
|
+
//# sourceMappingURL=git.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/workflow/git/git.service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAA2B,MAAM,sBAAsB,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAKL,kBAAkB,EACnB,MAAM,kBAAkB,CAAC;AA6B1B;;;;;GAKG;AACH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBxD;AA2ID,qBAAa,UAAW,YAAW,WAAW;IAiB1C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,aAAa;IArBhC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoC;IAC/D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAA6B;IACjE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAS;IAKtD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAA4B,CAAK;gBAGtC,gBAAgB,EAAE,gBAAgB;IACnD;;;;;;OAMG;IAC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