@bevel-software/platform-core-backend 0.32.0 → 0.33.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 +5 -0
- package/agent-guide/html-views.md +46 -10
- package/dist/core/create-core-server.d.ts.map +1 -1
- package/dist/core/create-core-server.js +29 -4
- package/dist/core/create-core-server.js.map +1 -1
- package/dist/core/create-core-services.d.ts +7 -2
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +22 -6
- package/dist/core/create-core-services.js.map +1 -1
- package/dist/core/lifecycle.d.ts +8 -0
- package/dist/core/lifecycle.d.ts.map +1 -1
- package/dist/core/lifecycle.js +4 -0
- package/dist/core/lifecycle.js.map +1 -1
- package/dist/core/public-config.d.ts +10 -0
- package/dist/core/public-config.d.ts.map +1 -1
- package/dist/core/public-config.js +10 -0
- package/dist/core/public-config.js.map +1 -1
- package/dist/modules/access/access-control.service.d.ts +3 -3
- package/dist/modules/access/access-control.service.d.ts.map +1 -1
- package/dist/modules/access/access-control.service.js +4 -5
- package/dist/modules/access/access-control.service.js.map +1 -1
- package/dist/modules/access/access-declarations.d.ts +1 -1
- package/dist/modules/access/access-declarations.d.ts.map +1 -1
- package/dist/modules/access/access-declarations.js +1 -1
- package/dist/modules/access/access-declarations.js.map +1 -1
- package/dist/modules/access/access-mutation.service.d.ts +8 -3
- package/dist/modules/access/access-mutation.service.d.ts.map +1 -1
- package/dist/modules/access/access-mutation.service.js +3 -3
- package/dist/modules/access/access-mutation.service.js.map +1 -1
- package/dist/modules/access/access-requests.contract.d.ts +1 -1
- package/dist/modules/access/access-requests.contract.d.ts.map +1 -1
- package/dist/modules/access/access-requests.routes.d.ts +3 -3
- package/dist/modules/access/access-requests.routes.d.ts.map +1 -1
- package/dist/modules/access/access-requests.routes.js +7 -7
- package/dist/modules/access/access-requests.routes.js.map +1 -1
- package/dist/modules/access/access-requests.service.d.ts +21 -20
- package/dist/modules/access/access-requests.service.d.ts.map +1 -1
- package/dist/modules/access/access-requests.service.js +22 -68
- package/dist/modules/access/access-requests.service.js.map +1 -1
- package/dist/modules/access/access-view.d.ts +1 -1
- package/dist/modules/access/access-view.d.ts.map +1 -1
- package/dist/modules/access/access-view.js +1 -1
- package/dist/modules/access/access-view.js.map +1 -1
- package/dist/modules/access/access.routes.d.ts +5 -7
- package/dist/modules/access/access.routes.d.ts.map +1 -1
- package/dist/modules/access/access.routes.js +4 -4
- package/dist/modules/access/access.routes.js.map +1 -1
- package/dist/modules/access/admin-locked-commit.d.ts +2 -2
- package/dist/modules/access/admin-locked-commit.d.ts.map +1 -1
- package/dist/modules/access/admin-locked-commit.js +1 -1
- package/dist/modules/access/admin-locked-commit.js.map +1 -1
- package/dist/modules/access/capability-registry.js +1 -1
- package/dist/modules/access/capability-registry.js.map +1 -1
- package/dist/modules/access/change-read-gate.d.ts +2 -2
- package/dist/modules/access/change-read-gate.d.ts.map +1 -1
- package/dist/modules/access/change-read-gate.js +1 -3
- package/dist/modules/access/change-read-gate.js.map +1 -1
- package/dist/modules/access/creator-access.d.ts +2 -2
- package/dist/modules/access/creator-access.d.ts.map +1 -1
- package/dist/modules/access/creator-access.js +2 -4
- package/dist/modules/access/creator-access.js.map +1 -1
- package/dist/modules/access/directory-sync-bot.d.ts +1 -1
- package/dist/modules/access/directory-sync-bot.d.ts.map +1 -1
- package/dist/modules/access/directory-sync-bot.js +1 -1
- package/dist/modules/access/directory-sync-bot.js.map +1 -1
- package/dist/modules/access/groups-admin.routes.d.ts +2 -2
- package/dist/modules/access/groups-admin.routes.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.routes.js +2 -2
- package/dist/modules/access/groups-admin.routes.js.map +1 -1
- package/dist/modules/access/groups-admin.service.d.ts +1 -1
- package/dist/modules/access/groups-admin.service.d.ts.map +1 -1
- package/dist/modules/access/groups-admin.service.js +2 -3
- package/dist/modules/access/groups-admin.service.js.map +1 -1
- package/dist/modules/access/groups-edit.js +2 -2
- package/dist/modules/access/groups-edit.js.map +1 -1
- package/dist/modules/access/index.d.ts +17 -0
- package/dist/modules/access/index.d.ts.map +1 -0
- package/dist/modules/access/index.js +6 -0
- package/dist/modules/access/index.js.map +1 -0
- package/dist/modules/access/reference-scan.js +1 -1
- package/dist/modules/access/reference-scan.js.map +1 -1
- package/dist/modules/access/roles-admin.service.d.ts +1 -1
- package/dist/modules/access/roles-admin.service.d.ts.map +1 -1
- package/dist/modules/access/roles-admin.service.js +2 -5
- package/dist/modules/access/roles-admin.service.js.map +1 -1
- package/dist/modules/access/roles-edit.js +1 -1
- package/dist/modules/access/roles-edit.js.map +1 -1
- package/dist/modules/access/synced-groups-committer.d.ts +2 -2
- package/dist/modules/access/synced-groups-committer.d.ts.map +1 -1
- package/dist/modules/access/synced-groups-committer.js +2 -2
- package/dist/modules/access/synced-groups-committer.js.map +1 -1
- package/dist/modules/access/synced-groups-writer.js +2 -2
- package/dist/modules/access/synced-groups-writer.js.map +1 -1
- package/dist/modules/access/user-access-removal.service.d.ts +1 -1
- package/dist/modules/access/user-access-removal.service.d.ts.map +1 -1
- package/dist/modules/access/user-access-removal.service.js +2 -5
- package/dist/modules/access/user-access-removal.service.js.map +1 -1
- package/dist/modules/access-model/index.d.ts +20 -5
- package/dist/modules/access-model/index.d.ts.map +1 -1
- package/dist/modules/access-model/index.js +18 -5
- package/dist/modules/access-model/index.js.map +1 -1
- package/dist/modules/access-model/roles-yaml-guard.d.ts +1 -1
- package/dist/modules/access-model/roles-yaml-guard.d.ts.map +1 -1
- package/dist/modules/admin/admin-access.routes.d.ts +1 -1
- package/dist/modules/admin/admin-access.routes.d.ts.map +1 -1
- package/dist/modules/admin/admin-access.routes.js +1 -1
- package/dist/modules/admin/admin-access.routes.js.map +1 -1
- package/dist/modules/admin/admin-access.service.d.ts +2 -2
- package/dist/modules/admin/admin-access.service.d.ts.map +1 -1
- package/dist/modules/admin/index.d.ts +8 -0
- package/dist/modules/admin/index.d.ts.map +1 -0
- package/dist/modules/admin/index.js +2 -0
- package/dist/modules/admin/index.js.map +1 -0
- package/dist/modules/agent-guide/agent-guide.js +1 -1
- package/dist/modules/agent-guide/agent-guide.js.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.d.ts +3 -3
- package/dist/modules/agent-guide/agent-guide.tools.d.ts.map +1 -1
- package/dist/modules/agent-guide/agent-guide.tools.js +2 -4
- package/dist/modules/agent-guide/agent-guide.tools.js.map +1 -1
- package/dist/modules/agent-guide/index.d.ts +1 -1
- package/dist/modules/agent-guide/index.d.ts.map +1 -1
- package/dist/modules/agent-guide/index.js +1 -1
- package/dist/modules/agent-guide/index.js.map +1 -1
- package/dist/modules/agent-instructions/read-preamble.d.ts +1 -1
- package/dist/modules/agent-instructions/read-preamble.d.ts.map +1 -1
- package/dist/modules/audit/agent-audit.service.d.ts +2 -2
- package/dist/modules/audit/agent-audit.service.d.ts.map +1 -1
- package/dist/modules/audit/agent-audit.service.js +1 -1
- package/dist/modules/audit/agent-audit.service.js.map +1 -1
- package/dist/modules/audit/agent-connection.routes.d.ts +1 -1
- package/dist/modules/audit/agent-connection.routes.d.ts.map +1 -1
- package/dist/modules/audit/agent-connection.routes.js +1 -1
- package/dist/modules/audit/agent-connection.routes.js.map +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.d.ts +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.d.ts.map +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.js +1 -1
- package/dist/modules/audit/agent-rest-audit.middleware.js.map +1 -1
- package/dist/modules/audit/audit.routes.d.ts +3 -3
- package/dist/modules/audit/audit.routes.d.ts.map +1 -1
- package/dist/modules/audit/audit.routes.js +2 -2
- package/dist/modules/audit/audit.routes.js.map +1 -1
- package/dist/modules/auth/account-erasure.service.d.ts +3 -3
- package/dist/modules/auth/account-erasure.service.d.ts.map +1 -1
- package/dist/modules/auth/account-erasure.service.js +1 -5
- package/dist/modules/auth/account-erasure.service.js.map +1 -1
- package/dist/modules/auth/account-switch-lock.d.ts +1 -1
- package/dist/modules/auth/account-switch-lock.d.ts.map +1 -1
- package/dist/modules/auth/account-switch-lock.js +1 -1
- package/dist/modules/auth/account-switch-lock.js.map +1 -1
- package/dist/modules/auth/account.routes.d.ts +2 -2
- package/dist/modules/auth/account.routes.d.ts.map +1 -1
- package/dist/modules/auth/account.routes.js +1 -1
- package/dist/modules/auth/account.routes.js.map +1 -1
- package/dist/modules/auth/auth.service.d.ts +1 -1
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +3 -3
- package/dist/modules/auth/auth.service.js.map +1 -1
- package/dist/modules/auth/index.d.ts +2 -0
- package/dist/modules/auth/index.d.ts.map +1 -1
- package/dist/modules/auth/oidc-auth-provider.js +1 -1
- package/dist/modules/auth/oidc-auth-provider.js.map +1 -1
- package/dist/modules/code-mode/code-mode.tool.d.ts +1 -1
- package/dist/modules/code-mode/code-mode.tool.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.d.ts +2 -2
- package/dist/modules/connection-probe/connection-probe.service.d.ts.map +1 -1
- package/dist/modules/connection-probe/connection-probe.service.js +1 -4
- package/dist/modules/connection-probe/connection-probe.service.js.map +1 -1
- package/dist/modules/database/core-schema.d.ts +107 -234
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +39 -35
- package/dist/modules/database/core-schema.js.map +1 -1
- package/dist/modules/database/index.d.ts +10 -0
- package/dist/modules/database/index.d.ts.map +1 -0
- package/dist/modules/database/index.js +4 -0
- package/dist/modules/database/index.js.map +1 -0
- package/dist/modules/database/migrate.d.ts.map +1 -1
- package/dist/modules/database/migrate.js +78 -3
- package/dist/modules/database/migrate.js.map +1 -1
- package/dist/modules/declared-variables/declared-variables.routes.d.ts +2 -2
- package/dist/modules/declared-variables/declared-variables.routes.d.ts.map +1 -1
- package/dist/modules/diff/diff.routes.d.ts +3 -3
- package/dist/modules/diff/diff.routes.d.ts.map +1 -1
- package/dist/modules/diff/diff.routes.js +3 -3
- package/dist/modules/diff/diff.routes.js.map +1 -1
- package/dist/modules/diff/diff.service.d.ts +2 -2
- package/dist/modules/diff/diff.service.d.ts.map +1 -1
- package/dist/modules/diff/index.d.ts +7 -0
- package/dist/modules/diff/index.d.ts.map +1 -0
- package/dist/modules/diff/index.js +2 -0
- package/dist/modules/diff/index.js.map +1 -0
- package/dist/modules/embed/account-link.service.d.ts +1 -1
- package/dist/modules/embed/account-link.service.d.ts.map +1 -1
- package/dist/modules/embed/account-link.service.js +1 -1
- package/dist/modules/embed/account-link.service.js.map +1 -1
- package/dist/modules/embed/embed.routes.d.ts +1 -1
- package/dist/modules/embed/embed.routes.d.ts.map +1 -1
- package/dist/modules/embed/embed.routes.js +2 -2
- package/dist/modules/embed/embed.routes.js.map +1 -1
- package/dist/modules/embed/embed.service.d.ts +1 -1
- package/dist/modules/embed/embed.service.d.ts.map +1 -1
- package/dist/modules/embed/embed.tools.d.ts +4 -4
- package/dist/modules/embed/embed.tools.d.ts.map +1 -1
- package/dist/modules/embed/embed.tools.js +3 -5
- package/dist/modules/embed/embed.tools.js.map +1 -1
- package/dist/modules/github-app/github-app.connection.d.ts +1 -1
- package/dist/modules/github-app/github-app.connection.d.ts.map +1 -1
- package/dist/modules/github-app/github-app.routes.d.ts +3 -3
- package/dist/modules/github-app/github-app.routes.d.ts.map +1 -1
- package/dist/modules/github-app/github-app.routes.js +1 -1
- package/dist/modules/github-app/github-app.routes.js.map +1 -1
- package/dist/modules/kb-fs/index.d.ts +10 -0
- package/dist/modules/kb-fs/index.d.ts.map +1 -1
- package/dist/modules/kb-fs/index.js +10 -0
- package/dist/modules/kb-fs/index.js.map +1 -1
- package/dist/modules/kb-fs/locking-filesystem.d.ts +1 -1
- package/dist/modules/kb-fs/locking-filesystem.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.d.ts +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.d.ts.map +1 -1
- package/dist/modules/kb-sync/kb-sync.routes.js +2 -2
- package/dist/modules/kb-sync/kb-sync.routes.js.map +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js +1 -1
- package/dist/modules/kb-sync/kb-sync.service.js.map +1 -1
- package/dist/modules/kb-sync/sync-auth.js +1 -1
- package/dist/modules/kb-sync/sync-auth.js.map +1 -1
- package/dist/modules/kb-sync/sync-payload.js +1 -1
- package/dist/modules/kb-sync/sync-payload.js.map +1 -1
- package/dist/modules/marketplace/git-http.routes.d.ts +1 -1
- package/dist/modules/marketplace/git-http.routes.d.ts.map +1 -1
- package/dist/modules/marketplace/git-http.routes.js +1 -1
- package/dist/modules/marketplace/git-http.routes.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.d.ts +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-admin.routes.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.d.ts +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-codes.store.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.d.ts +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade-credentials.service.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.routes.d.ts +2 -2
- package/dist/modules/marketplace/github-facade/github-facade.routes.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.routes.js +2 -2
- package/dist/modules/marketplace/github-facade/github-facade.routes.js.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.service.d.ts +2 -2
- package/dist/modules/marketplace/github-facade/github-facade.service.d.ts.map +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.service.js +1 -1
- package/dist/modules/marketplace/github-facade/github-facade.service.js.map +1 -1
- package/dist/modules/marketplace/marketplace-repo.service.d.ts +1 -1
- package/dist/modules/marketplace/marketplace-repo.service.d.ts.map +1 -1
- package/dist/modules/marketplace/marketplace-repo.service.js +1 -1
- package/dist/modules/mcp/index.d.ts +8 -0
- package/dist/modules/mcp/index.d.ts.map +1 -0
- package/dist/modules/mcp/index.js +7 -0
- package/dist/modules/mcp/index.js.map +1 -0
- package/dist/modules/mcp/mcp-auth.middleware.d.ts +4 -5
- package/dist/modules/mcp/mcp-auth.middleware.d.ts.map +1 -1
- package/dist/modules/mcp/mcp-auth.middleware.js +4 -4
- package/dist/modules/mcp/mcp-auth.middleware.js.map +1 -1
- package/dist/modules/mcp/mcp.routes.d.ts +2 -4
- package/dist/modules/mcp/mcp.routes.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.routes.js +2 -2
- package/dist/modules/mcp/mcp.routes.js.map +1 -1
- package/dist/modules/mcp/mcp.service.d.ts +14 -4
- package/dist/modules/mcp/mcp.service.d.ts.map +1 -1
- package/dist/modules/mcp/mcp.service.js +17 -7
- package/dist/modules/mcp/mcp.service.js.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js.map +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.js +1 -1
- package/dist/modules/mcp/oauth/oauth-consent.routes.js.map +1 -1
- package/dist/modules/onboarding/onboarding.routes.d.ts +1 -1
- package/dist/modules/onboarding/onboarding.routes.d.ts.map +1 -1
- package/dist/modules/onboarding/onboarding.routes.js +1 -1
- package/dist/modules/onboarding/onboarding.routes.js.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.d.ts +4 -5
- package/dist/modules/onboarding/starter-pack.service.d.ts.map +1 -1
- package/dist/modules/onboarding/starter-pack.service.js +2 -2
- package/dist/modules/onboarding/starter-pack.service.js.map +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.d.ts +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.d.ts.map +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.js +1 -1
- package/dist/modules/plugins/compile/compile-marketplace.js.map +1 -1
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts +3 -3
- package/dist/modules/plugins/compile/marketplace-compiler.service.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.d.ts +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.d.ts.map +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.js +1 -1
- package/dist/modules/plugins/discovery/bundle-dialect/registry.js.map +1 -1
- package/dist/modules/plugins/index.d.ts +1 -0
- package/dist/modules/plugins/index.d.ts.map +1 -1
- package/dist/modules/plugins/index.js +2 -0
- package/dist/modules/plugins/index.js.map +1 -1
- package/dist/modules/plugins/join-proposals.d.ts +2 -2
- package/dist/modules/plugins/join-proposals.d.ts.map +1 -1
- package/dist/modules/plugins/join-proposals.js +1 -1
- package/dist/modules/plugins/join-proposals.js.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts +1 -1
- package/dist/modules/plugins/join-request-jobs.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-jobs.service.js +2 -2
- package/dist/modules/plugins/join-request-jobs.service.js.map +1 -1
- package/dist/modules/plugins/join-request-records.store.d.ts +1 -1
- package/dist/modules/plugins/join-request-records.store.d.ts.map +1 -1
- package/dist/modules/plugins/join-request-records.store.js +1 -1
- package/dist/modules/plugins/join-request-records.store.js.map +1 -1
- package/dist/modules/plugins/join-requests.service.d.ts +3 -3
- package/dist/modules/plugins/join-requests.service.d.ts.map +1 -1
- package/dist/modules/plugins/join-requests.service.js +1 -1
- package/dist/modules/plugins/join-requests.service.js.map +1 -1
- package/dist/modules/plugins/plugin-links.d.ts +3 -3
- package/dist/modules/plugins/plugin-links.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-links.js +1 -1
- package/dist/modules/plugins/plugin-links.js.map +1 -1
- package/dist/modules/plugins/plugin-links.service.d.ts +8 -5
- package/dist/modules/plugins/plugin-links.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-links.service.js +8 -6
- package/dist/modules/plugins/plugin-links.service.js.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.d.ts +2 -2
- package/dist/modules/plugins/plugin-provision.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-provision.service.js +2 -3
- package/dist/modules/plugins/plugin-provision.service.js.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.d.ts +2 -2
- package/dist/modules/plugins/plugin-rename.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugin-rename.service.js +1 -1
- package/dist/modules/plugins/plugin-rename.service.js.map +1 -1
- package/dist/modules/plugins/plugins.contract.d.ts +1 -1
- package/dist/modules/plugins/plugins.contract.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.d.ts +2 -2
- package/dist/modules/plugins/plugins.routes.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.routes.js +3 -3
- package/dist/modules/plugins/plugins.routes.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +4 -4
- package/dist/modules/plugins/plugins.service.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.service.js +1 -1
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/plugins/plugins.tools.d.ts +1 -1
- package/dist/modules/plugins/plugins.tools.d.ts.map +1 -1
- package/dist/modules/plugins/plugins.tools.js +3 -3
- package/dist/modules/plugins/plugins.tools.js.map +1 -1
- package/dist/modules/plugins/teams.routes.d.ts +3 -3
- package/dist/modules/plugins/teams.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.d.ts.map +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js +1 -1
- package/dist/modules/secrets-vault/db-secrets-vault.service.js.map +1 -1
- package/dist/modules/secrets-vault/index.d.ts +1 -0
- package/dist/modules/secrets-vault/index.d.ts.map +1 -1
- package/dist/modules/secrets-vault/index.js +2 -0
- package/dist/modules/secrets-vault/index.js.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts +4 -4
- package/dist/modules/secrets-vault/secrets-vault.routes.d.ts.map +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js +1 -1
- package/dist/modules/secrets-vault/secrets-vault.routes.js.map +1 -1
- package/dist/modules/settings/connection-check.js +1 -1
- package/dist/modules/settings/connection-check.js.map +1 -1
- package/dist/modules/settings/deployment-settings.service.d.ts +7 -1
- package/dist/modules/settings/deployment-settings.service.d.ts.map +1 -1
- package/dist/modules/settings/deployment-settings.service.js +45 -3
- package/dist/modules/settings/deployment-settings.service.js.map +1 -1
- package/dist/modules/settings/git-root-folders.js +1 -1
- package/dist/modules/settings/git-root-folders.js.map +1 -1
- package/dist/modules/settings/index.d.ts +13 -0
- package/dist/modules/settings/index.d.ts.map +1 -0
- package/dist/modules/settings/index.js +3 -0
- package/dist/modules/settings/index.js.map +1 -0
- package/dist/modules/settings/setup.routes.d.ts +3 -3
- package/dist/modules/settings/setup.routes.d.ts.map +1 -1
- package/dist/modules/settings/setup.routes.js +2 -2
- package/dist/modules/settings/setup.routes.js.map +1 -1
- package/dist/modules/skills/allowed-tools-check.d.ts +2 -2
- package/dist/modules/skills/allowed-tools-check.d.ts.map +1 -1
- package/dist/modules/skills/allowed-tools-check.js +1 -1
- package/dist/modules/skills/allowed-tools-check.js.map +1 -1
- package/dist/modules/skills/index.d.ts +1 -0
- package/dist/modules/skills/index.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.d.ts +3 -3
- package/dist/modules/skills/pending-skills.service.d.ts.map +1 -1
- package/dist/modules/skills/pending-skills.service.js.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.d.ts +5 -5
- package/dist/modules/skills/skill-access-requests.routes.d.ts.map +1 -1
- package/dist/modules/skills/skill-access-requests.routes.js +6 -13
- package/dist/modules/skills/skill-access-requests.routes.js.map +1 -1
- package/dist/modules/skills/skills.routes.d.ts +1 -1
- package/dist/modules/skills/skills.routes.d.ts.map +1 -1
- package/dist/modules/skills/skills.routes.js +1 -1
- package/dist/modules/skills/skills.routes.js.map +1 -1
- package/dist/modules/skills/skills.service.d.ts +2 -2
- package/dist/modules/skills/skills.service.d.ts.map +1 -1
- package/dist/modules/skills/skills.tools.d.ts +3 -3
- package/dist/modules/skills/skills.tools.d.ts.map +1 -1
- package/dist/modules/skills/skills.tools.js +3 -7
- package/dist/modules/skills/skills.tools.js.map +1 -1
- package/dist/modules/tool-auth/connection-key-rejection.js +1 -1
- package/dist/modules/tool-auth/connection-key-rejection.js.map +1 -1
- package/dist/modules/tool-auth/connection-keys-admin.routes.d.ts +2 -2
- package/dist/modules/tool-auth/connection-keys-admin.routes.d.ts.map +1 -1
- package/dist/modules/tool-auth/connection-keys-admin.routes.js +1 -1
- package/dist/modules/tool-auth/connection-keys-admin.routes.js.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts +1 -1
- package/dist/modules/tool-auth/external-api-key.service.d.ts.map +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js +1 -1
- package/dist/modules/tool-auth/external-api-key.service.js.map +1 -1
- package/dist/modules/tool-auth/index.d.ts +15 -0
- package/dist/modules/tool-auth/index.d.ts.map +1 -0
- package/dist/modules/tool-auth/index.js +11 -0
- package/dist/modules/tool-auth/index.js.map +1 -0
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts +2 -2
- package/dist/modules/tool-auth/tool-auth.middleware.d.ts.map +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.js +1 -1
- package/dist/modules/tool-auth/tool-auth.middleware.js.map +1 -1
- package/dist/modules/tool-helpers/default-branch-write.d.ts +1 -1
- package/dist/modules/tool-helpers/default-branch-write.d.ts.map +1 -1
- package/dist/modules/tool-helpers/index.d.ts +4 -1
- package/dist/modules/tool-helpers/index.d.ts.map +1 -1
- package/dist/modules/tool-helpers/index.js +3 -0
- package/dist/modules/tool-helpers/index.js.map +1 -1
- package/dist/modules/tool-helpers/route-argument-check.js +1 -1
- package/dist/modules/tool-helpers/route-argument-check.js.map +1 -1
- package/dist/modules/tool-helpers/route-tool-schemas.d.ts +1 -1
- package/dist/modules/tool-helpers/route-tool-schemas.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.d.ts +5 -6
- package/dist/modules/tool-helpers/tool-context.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-context.js +2 -3
- package/dist/modules/tool-helpers/tool-context.js.map +1 -1
- package/dist/modules/tool-helpers/tool-def.d.ts +4 -2
- package/dist/modules/tool-helpers/tool-def.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-def.js +3 -1
- package/dist/modules/tool-helpers/tool-def.js.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.d.ts +2 -2
- package/dist/modules/tool-helpers/tool-handler.d.ts.map +1 -1
- package/dist/modules/tool-helpers/tool-handler.js +2 -2
- package/dist/modules/tool-helpers/tool-handler.js.map +1 -1
- package/dist/modules/tool-helpers/tool.contract.d.ts +2 -2
- package/dist/modules/tool-helpers/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-helpers/validate-token.d.ts +1 -2
- package/dist/modules/tool-helpers/validate-token.d.ts.map +1 -1
- package/dist/modules/tool-helpers/validate-token.js +1 -1
- package/dist/modules/tool-helpers/validate-token.js.map +1 -1
- package/dist/modules/tool-manuals/index.d.ts +5 -0
- package/dist/modules/tool-manuals/index.d.ts.map +1 -1
- package/dist/modules/tool-manuals/index.js +4 -0
- package/dist/modules/tool-manuals/index.js.map +1 -1
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts +2 -2
- package/dist/modules/tool-manuals/mcp-server-edit.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/pending-tools.service.d.ts +2 -2
- package/dist/modules/tool-manuals/pending-tools.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.d.ts +5 -6
- package/dist/modules/tool-manuals/tool-delete.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-delete.service.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts +5 -5
- package/dist/modules/tool-manuals/tool-manuals.routes.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.routes.js +2 -2
- package/dist/modules/tool-manuals/tool-manuals.routes.js.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts +3 -3
- package/dist/modules/tool-manuals/tool-manuals.service.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts +3 -3
- package/dist/modules/tool-manuals/tool-manuals.tools.d.ts.map +1 -1
- package/dist/modules/tool-manuals/tool-manuals.tools.js +1 -2
- package/dist/modules/tool-manuals/tool-manuals.tools.js.map +1 -1
- package/dist/modules/tool-registry/description-length.js +2 -2
- package/dist/modules/tool-registry/description-length.js.map +1 -1
- package/dist/modules/tool-registry/index.d.ts +8 -0
- package/dist/modules/tool-registry/index.d.ts.map +1 -0
- package/dist/modules/tool-registry/index.js +8 -0
- package/dist/modules/tool-registry/index.js.map +1 -0
- package/dist/modules/tool-registry/manual.routes.d.ts +37 -2
- package/dist/modules/tool-registry/manual.routes.d.ts.map +1 -1
- package/dist/modules/tool-registry/manual.routes.js +14 -7
- package/dist/modules/tool-registry/manual.routes.js.map +1 -1
- package/dist/modules/tool-registry/read-only-hints.contract.d.ts +52 -0
- package/dist/modules/tool-registry/read-only-hints.contract.d.ts.map +1 -0
- package/dist/modules/tool-registry/read-only-hints.contract.js +2 -0
- package/dist/modules/tool-registry/read-only-hints.contract.js.map +1 -0
- package/dist/modules/tool-registry/read-only-hints.d.ts +89 -0
- package/dist/modules/tool-registry/read-only-hints.d.ts.map +1 -0
- package/dist/modules/tool-registry/read-only-hints.js +212 -0
- package/dist/modules/tool-registry/read-only-hints.js.map +1 -0
- package/dist/modules/tool-registry/tool.contract.d.ts +8 -0
- package/dist/modules/tool-registry/tool.contract.d.ts.map +1 -1
- package/dist/modules/tool-registry/tool.contract.js +10 -1
- package/dist/modules/tool-registry/tool.contract.js.map +1 -1
- package/dist/modules/update-check/update-check.routes.d.ts +2 -2
- package/dist/modules/update-check/update-check.routes.d.ts.map +1 -1
- package/dist/modules/update-check/update-check.routes.js +1 -1
- package/dist/modules/update-check/update-check.routes.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts +9 -104
- package/dist/modules/workflow/agent-tools/change-request-read-shape.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js +8 -118
- package/dist/modules/workflow/agent-tools/change-request-read-shape.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts +16 -17
- package/dist/modules/workflow/agent-tools/change-request-read.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js +19 -86
- package/dist/modules/workflow/agent-tools/change-request-read.tools.js.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts +5 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js +10 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts +7 -5
- package/dist/modules/workflow/agent-tools/workflow.tools.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/workflow.tools.js +46 -68
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/change-request-hooks.d.ts +1 -1
- package/dist/modules/workflow/event-bus.d.ts.map +1 -1
- package/dist/modules/workflow/event-bus.js +3 -1
- package/dist/modules/workflow/event-bus.js.map +1 -1
- package/dist/modules/workflow/events-delivery.d.ts +120 -0
- package/dist/modules/workflow/events-delivery.d.ts.map +1 -0
- package/dist/modules/workflow/events-delivery.js +202 -0
- package/dist/modules/workflow/events-delivery.js.map +1 -0
- package/dist/modules/workflow/events.routes.d.ts +16 -7
- package/dist/modules/workflow/events.routes.d.ts.map +1 -1
- package/dist/modules/workflow/events.routes.js +23 -4
- package/dist/modules/workflow/events.routes.js.map +1 -1
- package/dist/modules/workflow/file-lock.service.d.ts +1 -1
- package/dist/modules/workflow/file-lock.service.d.ts.map +1 -1
- package/dist/modules/workflow/file-lock.service.js +1 -1
- package/dist/modules/workflow/file-lock.service.js.map +1 -1
- package/dist/modules/workflow/git/git.service.d.ts +2 -2
- package/dist/modules/workflow/git/git.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/git.service.js +3 -6
- package/dist/modules/workflow/git/git.service.js.map +1 -1
- package/dist/modules/workflow/git/node-git-runner.js +1 -1
- package/dist/modules/workflow/git/node-git-runner.js.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.d.ts +6 -7
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +40 -33
- package/dist/modules/workflow/git/pull-request.service.js.map +1 -1
- package/dist/modules/workflow/index.d.ts +14 -2
- package/dist/modules/workflow/index.d.ts.map +1 -1
- package/dist/modules/workflow/index.js +11 -2
- package/dist/modules/workflow/index.js.map +1 -1
- package/dist/modules/workflow/pending-commits.service.d.ts +1 -1
- package/dist/modules/workflow/pending-commits.service.d.ts.map +1 -1
- package/dist/modules/workflow/pending-commits.service.js +1 -1
- package/dist/modules/workflow/pending-commits.service.js.map +1 -1
- package/dist/modules/workflow/read-on-branch.d.ts +1 -1
- package/dist/modules/workflow/read-on-branch.d.ts.map +1 -1
- package/dist/modules/workflow/recovery-bot.d.ts +1 -1
- package/dist/modules/workflow/recovery-bot.d.ts.map +1 -1
- package/dist/modules/workflow/recovery-bot.js +1 -1
- package/dist/modules/workflow/recovery-bot.js.map +1 -1
- package/dist/modules/workflow/review-workflow/approval-lock.d.ts +1 -1
- package/dist/modules/workflow/review-workflow/approval-lock.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts +4 -20
- package/dist/modules/workflow/review-workflow/review-workflow.interface.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts +4 -8
- package/dist/modules/workflow/review-workflow/review-workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/review-workflow/review-workflow.service.js +3 -138
- package/dist/modules/workflow/review-workflow/review-workflow.service.js.map +1 -1
- package/dist/modules/workflow/workflow.routes.d.ts +5 -5
- package/dist/modules/workflow/workflow.routes.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.routes.js +42 -94
- package/dist/modules/workflow/workflow.routes.js.map +1 -1
- package/dist/modules/workflow/workflow.service.d.ts +40 -50
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +218 -154
- package/dist/modules/workflow/workflow.service.js.map +1 -1
- package/dist/modules/workspace/agent-access.gate.d.ts +3 -3
- package/dist/modules/workspace/agent-access.gate.d.ts.map +1 -1
- package/dist/modules/workspace/agent-download.builder.d.ts +1 -1
- package/dist/modules/workspace/agent-download.builder.d.ts.map +1 -1
- package/dist/modules/workspace/agent-download.builder.js +1 -1
- package/dist/modules/workspace/agent-download.builder.js.map +1 -1
- package/dist/modules/workspace/agent-upload.routes.d.ts.map +1 -1
- package/dist/modules/workspace/agent-upload.routes.js +19 -0
- package/dist/modules/workspace/agent-upload.routes.js.map +1 -1
- package/dist/modules/workspace/agent-upload.store.d.ts +11 -0
- package/dist/modules/workspace/agent-upload.store.d.ts.map +1 -1
- package/dist/modules/workspace/agent-upload.store.js +18 -0
- package/dist/modules/workspace/agent-upload.store.js.map +1 -1
- package/dist/modules/workspace/bounded-matcher.d.ts +5 -11
- package/dist/modules/workspace/bounded-matcher.d.ts.map +1 -1
- package/dist/modules/workspace/bounded-matcher.js +26 -87
- package/dist/modules/workspace/bounded-matcher.js.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.service.d.ts +54 -10
- package/dist/modules/workspace/file-readers/doc-extract.service.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.service.js +69 -17
- package/dist/modules/workspace/file-readers/doc-extract.service.js.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.types.d.ts +9 -2
- package/dist/modules/workspace/file-readers/doc-extract.types.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/doc-extract.types.js.map +1 -1
- package/dist/modules/workspace/file-readers/document-extractor.contract.d.ts +41 -0
- package/dist/modules/workspace/file-readers/document-extractor.contract.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/document-extractor.contract.js +5 -0
- package/dist/modules/workspace/file-readers/document-extractor.contract.js.map +1 -0
- package/dist/modules/workspace/file-readers/document-extractors.d.ts +9 -0
- package/dist/modules/workspace/file-readers/document-extractors.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/document-extractors.js +26 -0
- package/dist/modules/workspace/file-readers/document-extractors.js.map +1 -0
- package/dist/modules/workspace/file-readers/document-formats.d.ts +12 -0
- package/dist/modules/workspace/file-readers/document-formats.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/document-formats.js +11 -0
- package/dist/modules/workspace/file-readers/document-formats.js.map +1 -0
- package/dist/modules/workspace/file-readers/document-reader.d.ts +21 -17
- package/dist/modules/workspace/file-readers/document-reader.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/document-reader.js +38 -34
- package/dist/modules/workspace/file-readers/document-reader.js.map +1 -1
- package/dist/modules/workspace/file-readers/extract-in-worker.d.ts +60 -0
- package/dist/modules/workspace/file-readers/extract-in-worker.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/extract-in-worker.js +140 -0
- package/dist/modules/workspace/file-readers/extract-in-worker.js.map +1 -0
- package/dist/modules/workspace/file-readers/extract-pdf.d.ts +2 -0
- package/dist/modules/workspace/file-readers/extract-pdf.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/extract-pdf.js +20 -3
- package/dist/modules/workspace/file-readers/extract-pdf.js.map +1 -1
- package/dist/modules/workspace/file-readers/extract.worker.d.ts +2 -0
- package/dist/modules/workspace/file-readers/extract.worker.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/extract.worker.js +5 -0
- package/dist/modules/workspace/file-readers/extract.worker.js.map +1 -0
- package/dist/modules/workspace/file-readers/extraction-cache.d.ts +21 -5
- package/dist/modules/workspace/file-readers/extraction-cache.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/extraction-cache.js +24 -10
- package/dist/modules/workspace/file-readers/extraction-cache.js.map +1 -1
- package/dist/modules/workspace/file-readers/extraction-worker.d.ts +42 -0
- package/dist/modules/workspace/file-readers/extraction-worker.d.ts.map +1 -0
- package/dist/modules/workspace/file-readers/extraction-worker.js +69 -0
- package/dist/modules/workspace/file-readers/extraction-worker.js.map +1 -0
- package/dist/modules/workspace/file-readers/file-reader.d.ts +13 -4
- package/dist/modules/workspace/file-readers/file-reader.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/file-reader.js.map +1 -1
- package/dist/modules/workspace/file-readers/file-reader.registry.d.ts +3 -2
- package/dist/modules/workspace/file-readers/file-reader.registry.d.ts.map +1 -1
- package/dist/modules/workspace/file-readers/file-reader.registry.js +6 -20
- package/dist/modules/workspace/file-readers/file-reader.registry.js.map +1 -1
- package/dist/modules/workspace/first-run.js +1 -1
- package/dist/modules/workspace/first-run.js.map +1 -1
- package/dist/modules/workspace/git-internals.middleware.d.ts +1 -1
- package/dist/modules/workspace/git-internals.middleware.d.ts.map +1 -1
- package/dist/modules/workspace/git-internals.middleware.js +1 -1
- package/dist/modules/workspace/git-internals.middleware.js.map +1 -1
- package/dist/modules/workspace/index.d.ts +16 -0
- package/dist/modules/workspace/index.d.ts.map +1 -1
- package/dist/modules/workspace/index.js +13 -0
- package/dist/modules/workspace/index.js.map +1 -1
- package/dist/modules/workspace/kb-repository.d.ts.map +1 -1
- package/dist/modules/workspace/kb-repository.js +1 -1
- package/dist/modules/workspace/kb-repository.js.map +1 -1
- package/dist/modules/workspace/not-found.d.ts +1 -1
- package/dist/modules/workspace/not-found.d.ts.map +1 -1
- package/dist/modules/workspace/not-found.js +1 -1
- package/dist/modules/workspace/not-found.js.map +1 -1
- package/dist/modules/workspace/pattern-matcher.contract.d.ts +1 -1
- package/dist/modules/workspace/pattern-matcher.contract.d.ts.map +1 -1
- package/dist/modules/workspace/pattern-matcher.contract.js +1 -1
- package/dist/modules/workspace/pattern-matcher.contract.js.map +1 -1
- package/dist/modules/workspace/routine-write-policy.js +1 -1
- package/dist/modules/workspace/routine-write-policy.js.map +1 -1
- package/dist/modules/workspace/startup/kb-git.js +1 -1
- package/dist/modules/workspace/startup/kb-git.js.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.d.ts.map +1 -1
- package/dist/modules/workspace/startup/kb-startup-runner.js +1 -2
- package/dist/modules/workspace/startup/kb-startup-runner.js.map +1 -1
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js +2 -2
- package/dist/modules/workspace/startup/steps/groups-to-plugins.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/personal-spaces.step.js +2 -2
- package/dist/modules/workspace/startup/steps/personal-spaces.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/plugin-layout.js +1 -1
- package/dist/modules/workspace/startup/steps/plugin-layout.js.map +1 -1
- package/dist/modules/workspace/startup/steps/roles-yaml.step.js +1 -1
- package/dist/modules/workspace/startup/steps/roles-yaml.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/seed-tree.js +2 -2
- package/dist/modules/workspace/startup/steps/seed-tree.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.d.ts.map +1 -1
- package/dist/modules/workspace/startup/steps/template-files.step.js +2 -2
- package/dist/modules/workspace/startup/steps/template-files.step.js.map +1 -1
- package/dist/modules/workspace/startup/steps/template-source.js +2 -2
- package/dist/modules/workspace/startup/steps/template-source.js.map +1 -1
- package/dist/modules/workspace/worker-pool.d.ts +100 -0
- package/dist/modules/workspace/worker-pool.d.ts.map +1 -0
- package/dist/modules/workspace/worker-pool.js +156 -0
- package/dist/modules/workspace/worker-pool.js.map +1 -0
- package/dist/modules/workspace/workspace.routes.d.ts +7 -8
- package/dist/modules/workspace/workspace.routes.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.routes.js +4 -6
- package/dist/modules/workspace/workspace.routes.js.map +1 -1
- package/dist/modules/workspace/workspace.service.d.ts +1 -1
- package/dist/modules/workspace/workspace.service.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.service.js +3 -6
- package/dist/modules/workspace/workspace.service.js.map +1 -1
- package/dist/modules/workspace/workspace.tools.d.ts +7 -7
- package/dist/modules/workspace/workspace.tools.d.ts.map +1 -1
- package/dist/modules/workspace/workspace.tools.js +45 -27
- package/dist/modules/workspace/workspace.tools.js.map +1 -1
- package/dist/modules/workspace/write-denial.d.ts +4 -4
- package/dist/modules/workspace/write-denial.d.ts.map +1 -1
- package/dist/modules/workspace/write-denial.js +2 -3
- package/dist/modules/workspace/write-denial.js.map +1 -1
- package/dist/modules/write-access/index.d.ts +8 -0
- package/dist/modules/write-access/index.d.ts.map +1 -0
- package/dist/modules/write-access/index.js +7 -0
- package/dist/modules/write-access/index.js.map +1 -0
- package/migrations/0020_change_request_body_is_the_description.sql +20 -0
- package/migrations/0021_data_migrations_ledger.sql +11 -0
- package/migrations/meta/0020_snapshot.json +2321 -0
- package/migrations/meta/0021_snapshot.json +2353 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +3 -3
- package/src/core/__tests__/damaged-document.tools.test.ts +374 -0
- package/src/core/__tests__/public-config.test.ts +5 -0
- package/src/core/create-core-server.ts +32 -3
- package/src/core/create-core-services.ts +32 -5
- package/src/core/lifecycle.ts +10 -0
- package/src/core/public-config.ts +10 -0
- package/src/modules/access/__tests__/access-requests.routes.test.ts +29 -15
- package/src/modules/access/access-control.service.ts +5 -6
- package/src/modules/access/access-declarations.ts +1 -1
- package/src/modules/access/access-mutation.service.ts +10 -4
- package/src/modules/access/access-requests.contract.ts +1 -1
- package/src/modules/access/access-requests.routes.ts +10 -15
- package/src/modules/access/access-requests.service.ts +29 -71
- package/src/modules/access/access-view.ts +1 -1
- package/src/modules/access/access.routes.ts +9 -11
- package/src/modules/access/admin-locked-commit.ts +3 -2
- package/src/modules/access/capability-registry.ts +1 -1
- package/src/modules/access/change-read-gate.ts +3 -5
- package/src/modules/access/creator-access.ts +3 -5
- package/src/modules/access/directory-sync-bot.ts +2 -2
- package/src/modules/access/groups-admin.routes.ts +3 -3
- package/src/modules/access/groups-admin.service.ts +3 -4
- package/src/modules/access/groups-edit.ts +2 -2
- package/src/modules/access/index.ts +17 -0
- package/src/modules/access/reference-scan.ts +1 -1
- package/src/modules/access/roles-admin.service.ts +3 -6
- package/src/modules/access/roles-edit.ts +1 -1
- package/src/modules/access/synced-groups-committer.ts +4 -4
- package/src/modules/access/synced-groups-writer.ts +2 -2
- package/src/modules/access/user-access-removal.service.ts +3 -6
- package/src/modules/access-model/index.ts +21 -5
- package/src/modules/access-model/roles-yaml-guard.ts +1 -1
- package/src/modules/admin/admin-access.routes.ts +1 -1
- package/src/modules/admin/admin-access.service.ts +2 -2
- package/src/modules/admin/index.ts +7 -0
- package/src/modules/agent-guide/__tests__/agent-guide.test.ts +5 -0
- package/src/modules/agent-guide/agent-guide.tools.ts +4 -6
- package/src/modules/agent-guide/agent-guide.ts +1 -1
- package/src/modules/agent-guide/index.ts +1 -1
- package/src/modules/agent-instructions/read-preamble.ts +1 -1
- package/src/modules/audit/agent-audit.service.ts +3 -3
- package/src/modules/audit/agent-connection.routes.ts +1 -1
- package/src/modules/audit/agent-rest-audit.middleware.ts +1 -1
- package/src/modules/audit/audit.routes.ts +4 -4
- package/src/modules/auth/account-erasure.service.ts +4 -9
- package/src/modules/auth/account-switch-lock.ts +2 -2
- package/src/modules/auth/account.routes.ts +3 -3
- package/src/modules/auth/auth.service.ts +4 -4
- package/src/modules/auth/index.ts +3 -0
- package/src/modules/auth/oidc-auth-provider.ts +1 -1
- package/src/modules/code-mode/code-mode.tool.ts +1 -1
- package/src/modules/connection-probe/connection-probe.service.ts +3 -6
- package/src/modules/database/__tests__/legacy-change-request-body.test.ts +118 -0
- package/src/modules/database/__tests__/legacy-request-bodies.pg.test.ts +258 -0
- package/src/modules/database/__tests__/pii-backfill.pg.test.ts +15 -18
- package/src/modules/database/core-schema.ts +43 -36
- package/src/modules/database/index.ts +9 -0
- package/src/modules/database/migrate.ts +79 -3
- package/src/modules/declared-variables/declared-variables.routes.ts +2 -2
- package/src/modules/diff/diff.routes.ts +5 -5
- package/src/modules/diff/diff.service.ts +2 -2
- package/src/modules/diff/index.ts +6 -0
- package/src/modules/embed/account-link.service.ts +2 -2
- package/src/modules/embed/embed.routes.ts +2 -2
- package/src/modules/embed/embed.service.ts +1 -1
- package/src/modules/embed/embed.tools.ts +6 -9
- package/src/modules/github-app/github-app.connection.ts +1 -1
- package/src/modules/github-app/github-app.routes.ts +3 -3
- package/src/modules/kb-fs/index.ts +11 -0
- package/src/modules/kb-fs/locking-filesystem.ts +1 -1
- package/src/modules/kb-sync/kb-sync.routes.ts +3 -3
- package/src/modules/kb-sync/kb-sync.service.ts +1 -1
- package/src/modules/kb-sync/sync-auth.ts +1 -1
- package/src/modules/kb-sync/sync-payload.ts +1 -1
- package/src/modules/marketplace/git-http.routes.ts +1 -1
- package/src/modules/marketplace/github-facade/github-facade-admin.routes.ts +1 -1
- package/src/modules/marketplace/github-facade/github-facade-codes.store.ts +2 -2
- package/src/modules/marketplace/github-facade/github-facade-credentials.service.ts +2 -2
- package/src/modules/marketplace/github-facade/github-facade.routes.ts +2 -2
- package/src/modules/marketplace/github-facade/github-facade.service.ts +2 -2
- package/src/modules/marketplace/marketplace-repo.service.ts +2 -2
- package/src/modules/mcp/__tests__/read-only-hint.e2e.test.ts +213 -0
- package/src/modules/mcp/index.ts +7 -0
- package/src/modules/mcp/mcp-auth.middleware.ts +6 -7
- package/src/modules/mcp/mcp.routes.ts +3 -5
- package/src/modules/mcp/mcp.service.ts +30 -13
- package/src/modules/mcp/oauth/bevel-oauth-provider.ts +2 -2
- package/src/modules/mcp/oauth/oauth-consent.routes.ts +1 -1
- package/src/modules/onboarding/onboarding.routes.ts +1 -1
- package/src/modules/onboarding/starter-pack.service.ts +5 -6
- package/src/modules/plugins/__tests__/bundle-dialect.e2e.test.ts +2 -1
- package/src/modules/plugins/__tests__/plugin-links.service.test.ts +2 -1
- package/src/modules/plugins/compile/compile-marketplace.ts +2 -2
- package/src/modules/plugins/compile/marketplace-compiler.service.ts +3 -3
- package/src/modules/plugins/discovery/bundle-dialect/registry.ts +1 -1
- package/src/modules/plugins/index.ts +2 -0
- package/src/modules/plugins/join-proposals.ts +2 -2
- package/src/modules/plugins/join-request-jobs.service.ts +3 -3
- package/src/modules/plugins/join-request-records.store.ts +2 -2
- package/src/modules/plugins/join-requests.service.ts +4 -4
- package/src/modules/plugins/plugin-links.service.ts +10 -11
- package/src/modules/plugins/plugin-links.ts +4 -4
- package/src/modules/plugins/plugin-provision.service.ts +4 -5
- package/src/modules/plugins/plugin-rename.service.ts +3 -3
- package/src/modules/plugins/plugins.contract.ts +1 -1
- package/src/modules/plugins/plugins.routes.ts +4 -4
- package/src/modules/plugins/plugins.service.ts +5 -5
- package/src/modules/plugins/plugins.tools.ts +4 -4
- package/src/modules/plugins/teams.routes.ts +3 -3
- package/src/modules/secrets-vault/db-secrets-vault.service.ts +2 -2
- package/src/modules/secrets-vault/index.ts +2 -0
- package/src/modules/secrets-vault/secrets-vault.routes.ts +4 -4
- package/src/modules/settings/__tests__/deployment-settings.service.test.ts +88 -1
- package/src/modules/settings/connection-check.ts +1 -1
- package/src/modules/settings/deployment-settings.service.ts +44 -4
- package/src/modules/settings/git-root-folders.ts +1 -1
- package/src/modules/settings/index.ts +12 -0
- package/src/modules/settings/setup.routes.ts +5 -4
- package/src/modules/skills/__tests__/allowed-tools-warn.tools.test.ts +2 -2
- package/src/modules/skills/__tests__/skill-access-requests.routes.test.ts +6 -3
- package/src/modules/skills/allowed-tools-check.ts +2 -6
- package/src/modules/skills/index.ts +2 -0
- package/src/modules/skills/pending-skills.service.ts +3 -4
- package/src/modules/skills/skill-access-requests.routes.ts +10 -17
- package/src/modules/skills/skills.routes.ts +1 -1
- package/src/modules/skills/skills.service.ts +2 -2
- package/src/modules/skills/skills.tools.ts +5 -9
- package/src/modules/tool-auth/connection-key-rejection.ts +1 -1
- package/src/modules/tool-auth/connection-keys-admin.routes.ts +2 -2
- package/src/modules/tool-auth/external-api-key.service.ts +2 -2
- package/src/modules/tool-auth/index.ts +14 -0
- package/src/modules/tool-auth/tool-auth.middleware.ts +3 -3
- package/src/modules/tool-helpers/__tests__/agent-roles-write.test.ts +2 -2
- package/src/modules/tool-helpers/__tests__/can-write.tools.test.ts +2 -2
- package/src/modules/tool-helpers/__tests__/phase4-tools.test.ts +2 -2
- package/src/modules/tool-helpers/default-branch-write.ts +1 -1
- package/src/modules/tool-helpers/index.ts +5 -1
- package/src/modules/tool-helpers/route-argument-check.ts +1 -1
- package/src/modules/tool-helpers/route-tool-schemas.ts +1 -1
- package/src/modules/tool-helpers/tool-context.ts +8 -10
- package/src/modules/tool-helpers/tool-def.ts +7 -3
- package/src/modules/tool-helpers/tool-handler.ts +2 -2
- package/src/modules/tool-helpers/tool.contract.ts +2 -2
- package/src/modules/tool-helpers/validate-token.ts +2 -3
- package/src/modules/tool-manuals/index.ts +6 -0
- package/src/modules/tool-manuals/mcp-server-edit.service.ts +2 -2
- package/src/modules/tool-manuals/pending-tools.service.ts +2 -2
- package/src/modules/tool-manuals/tool-delete.service.ts +5 -6
- package/src/modules/tool-manuals/tool-manuals.routes.ts +5 -5
- package/src/modules/tool-manuals/tool-manuals.service.ts +3 -3
- package/src/modules/tool-manuals/tool-manuals.tools.ts +4 -6
- package/src/modules/tool-registry/__tests__/read-only-hints.test.ts +439 -0
- package/src/modules/tool-registry/__tests__/tool-registry.test.ts +9 -2
- package/src/modules/tool-registry/description-length.ts +2 -2
- package/src/modules/tool-registry/index.ts +22 -0
- package/src/modules/tool-registry/manual.routes.ts +14 -8
- package/src/modules/tool-registry/read-only-hints.contract.ts +54 -0
- package/src/modules/tool-registry/read-only-hints.ts +225 -0
- package/src/modules/tool-registry/tool.contract.ts +11 -0
- package/src/modules/update-check/update-check.routes.ts +2 -2
- package/src/modules/workflow/__tests__/event-bus.test.ts +14 -2
- package/src/modules/workflow/__tests__/events-delivery.test.ts +778 -0
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +84 -21
- package/src/modules/workflow/__tests__/workflow.service.update-change-request.pg.test.ts +120 -0
- package/src/modules/workflow/__tests__/workflow.service.update-change-request.test.ts +346 -0
- package/src/modules/workflow/agent-tools/__tests__/change-request-read-shape.test.ts +32 -209
- package/src/modules/workflow/agent-tools/__tests__/change-request-read.tools.test.ts +16 -245
- package/src/modules/workflow/agent-tools/__tests__/update-change-request.parity.test.ts +306 -0
- package/src/modules/workflow/agent-tools/__tests__/workflow.tools.test.ts +33 -57
- package/src/modules/workflow/agent-tools/change-request-read-shape.ts +18 -153
- package/src/modules/workflow/agent-tools/change-request-read.tools.ts +24 -96
- package/src/modules/workflow/agent-tools/change-request-summary.ts +16 -2
- package/src/modules/workflow/agent-tools/workflow.tools.ts +49 -75
- package/src/modules/workflow/change-request-hooks.ts +1 -1
- package/src/modules/workflow/event-bus.ts +3 -1
- package/src/modules/workflow/events-delivery.ts +278 -0
- package/src/modules/workflow/events.routes.ts +30 -9
- package/src/modules/workflow/file-lock.service.ts +2 -2
- package/src/modules/workflow/git/__tests__/pull-request.service.getPrDetail.test.ts +24 -9
- package/src/modules/workflow/git/git.service.ts +5 -8
- package/src/modules/workflow/git/node-git-runner.ts +1 -1
- package/src/modules/workflow/git/pull-request.service.ts +34 -29
- package/src/modules/workflow/index.ts +15 -2
- package/src/modules/workflow/pending-commits.service.ts +2 -2
- package/src/modules/workflow/read-on-branch.ts +1 -1
- package/src/modules/workflow/recovery-bot.ts +2 -2
- package/src/modules/workflow/review-workflow/approval-lock.ts +1 -1
- package/src/modules/workflow/review-workflow/review-workflow.interface.ts +3 -35
- package/src/modules/workflow/review-workflow/review-workflow.service.ts +6 -165
- package/src/modules/workflow/workflow.routes.ts +46 -100
- package/src/modules/workflow/workflow.service.ts +272 -191
- package/src/modules/workspace/__tests__/agent-downloads.test.ts +2 -1
- package/src/modules/workspace/__tests__/agent-uploads.test.ts +87 -1
- package/src/modules/workspace/__tests__/escape-sequences.routes.test.ts +2 -1
- package/src/modules/workspace/__tests__/file-stat-access.test.ts +2 -1
- package/src/modules/workspace/__tests__/git-internals.security.test.ts +2 -1
- package/src/modules/workspace/__tests__/rest-tool-arguments.test.ts +2 -1
- package/src/modules/workspace/__tests__/worker-pool.test.ts +118 -0
- package/src/modules/workspace/__tests__/workspace-paths-inside-the-repo.test.ts +3 -2
- package/src/modules/workspace/__tests__/workspace.service.ensure-remotes-fetched.test.ts +30 -0
- package/src/modules/workspace/__tests__/workspace.tools.agents-file.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.tools.branch-errors.test.ts +2 -1
- package/src/modules/workspace/__tests__/workspace.tools.test.ts +30 -4
- package/src/modules/workspace/agent-access.gate.ts +3 -3
- package/src/modules/workspace/agent-download.builder.ts +1 -1
- package/src/modules/workspace/agent-upload.routes.ts +19 -0
- package/src/modules/workspace/agent-upload.store.ts +18 -0
- package/src/modules/workspace/bounded-matcher.ts +32 -89
- package/src/modules/workspace/file-readers/README.md +9 -0
- package/src/modules/workspace/file-readers/__tests__/doc-extract.service.test.ts +165 -0
- package/src/modules/workspace/file-readers/__tests__/doc-extract.test.ts +21 -16
- package/src/modules/workspace/file-readers/__tests__/extract-in-worker.test.ts +229 -0
- package/src/modules/workspace/file-readers/__tests__/file-reader.registry.test.ts +2 -1
- package/src/modules/workspace/file-readers/__tests__/fixtures/damaged-pdf.ts +34 -0
- package/src/modules/workspace/file-readers/__tests__/fixtures/misbehaving-extract.worker.ts +57 -0
- package/src/modules/workspace/file-readers/__tests__/fixtures/pdf-in-trouble.worker.ts +20 -0
- package/src/modules/workspace/file-readers/__tests__/fixtures/unloadable-extract.worker.ts +2 -0
- package/src/modules/workspace/file-readers/doc-extract.service.ts +95 -20
- package/src/modules/workspace/file-readers/doc-extract.types.ts +13 -3
- package/src/modules/workspace/file-readers/document-extractor.contract.ts +42 -0
- package/src/modules/workspace/file-readers/document-extractors.ts +28 -0
- package/src/modules/workspace/file-readers/document-formats.ts +13 -0
- package/src/modules/workspace/file-readers/document-reader.ts +40 -36
- package/src/modules/workspace/file-readers/extract-in-worker.ts +183 -0
- package/src/modules/workspace/file-readers/extract-pdf.ts +23 -4
- package/src/modules/workspace/file-readers/extract.worker.ts +5 -0
- package/src/modules/workspace/file-readers/extraction-cache.ts +33 -12
- package/src/modules/workspace/file-readers/extraction-worker.ts +86 -0
- package/src/modules/workspace/file-readers/file-reader.registry.ts +6 -20
- package/src/modules/workspace/file-readers/file-reader.ts +14 -4
- package/src/modules/workspace/first-run.ts +1 -1
- package/src/modules/workspace/git-internals.middleware.ts +1 -1
- package/src/modules/workspace/index.ts +17 -0
- package/src/modules/workspace/kb-repository.ts +3 -2
- package/src/modules/workspace/not-found.ts +1 -1
- package/src/modules/workspace/pattern-matcher.contract.ts +1 -1
- package/src/modules/workspace/routine-write-policy.ts +1 -1
- package/src/modules/workspace/startup/kb-git.ts +1 -1
- package/src/modules/workspace/startup/kb-startup-runner.ts +1 -2
- package/src/modules/workspace/startup/steps/groups-to-plugins.step.ts +3 -3
- package/src/modules/workspace/startup/steps/personal-spaces.step.ts +2 -2
- package/src/modules/workspace/startup/steps/plugin-layout.ts +1 -1
- package/src/modules/workspace/startup/steps/roles-yaml.step.ts +1 -1
- package/src/modules/workspace/startup/steps/seed-tree.ts +2 -2
- package/src/modules/workspace/startup/steps/template-files.step.ts +2 -2
- package/src/modules/workspace/startup/steps/template-source.ts +2 -2
- package/src/modules/workspace/worker-pool.ts +193 -0
- package/src/modules/workspace/workspace.routes.ts +9 -12
- package/src/modules/workspace/workspace.service.ts +4 -7
- package/src/modules/workspace/workspace.tools.ts +53 -34
- package/src/modules/workspace/write-denial.ts +4 -5
- package/src/modules/write-access/index.ts +7 -0
- package/src/shared/__tests__/module-boundaries.lint.test.ts +301 -0
- package/src/modules/workflow/__tests__/format-affected-owners.test.ts +0 -85
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Worker } from 'node:worker_threads';
|
|
2
|
-
import {
|
|
2
|
+
import { exchange, MAX_TIMER_MS, sizingOption, WorkerPool } from './worker-pool.js';
|
|
3
|
+
import { ToolError } from '../tool-helpers/index.js';
|
|
3
4
|
import {
|
|
4
5
|
type IPatternMatcher,
|
|
5
6
|
type IPatternSearch,
|
|
@@ -22,8 +23,10 @@ import {
|
|
|
22
23
|
* the same flags and calls `test` on each line — so a pattern within budget
|
|
23
24
|
* matches exactly the lines it always did.
|
|
24
25
|
*
|
|
25
|
-
* The pool is this instance's own
|
|
26
|
-
*
|
|
26
|
+
* The pool is this instance's own (its mechanics are the shared
|
|
27
|
+
* {@link WorkerPool}; the regex worker below is this kind's): the composition
|
|
28
|
+
* root builds one per graph and closes it when the graph stops, so no worker
|
|
29
|
+
* outlives what it served.
|
|
27
30
|
*/
|
|
28
31
|
export interface WorkerPatternMatcherOptions {
|
|
29
32
|
/** Matching time one search may spend, summed over every file it searches. Default 5 s. */
|
|
@@ -96,36 +99,38 @@ type Reply = { hits: number[]; elapsed: number } | { error: string };
|
|
|
96
99
|
type Lease = {
|
|
97
100
|
acquire(): Promise<Worker>;
|
|
98
101
|
release(w: Worker): void;
|
|
102
|
+
discard(w: Worker): void;
|
|
99
103
|
batchEnd(lines: string[], from: number): number;
|
|
100
104
|
readonly batchChars: number;
|
|
101
105
|
};
|
|
102
|
-
type Waiter = { resolve: (w: Worker) => void; reject: (err: Error) => void };
|
|
103
106
|
|
|
104
107
|
export class WorkerPatternMatcher implements IPatternMatcher {
|
|
105
108
|
private readonly budgetMs: number;
|
|
106
|
-
private readonly poolMax: number;
|
|
107
|
-
private readonly maxWaiting: number;
|
|
108
109
|
private readonly maxPatternLength: number;
|
|
109
110
|
private readonly batchChars: number;
|
|
110
111
|
private readonly batchLines: number;
|
|
111
|
-
private readonly
|
|
112
|
-
private readonly all = new Set<Worker>();
|
|
113
|
-
private readonly waiting: Waiter[] = [];
|
|
114
|
-
private closed = false;
|
|
112
|
+
private readonly pool: WorkerPool;
|
|
115
113
|
private readonly lease: Lease;
|
|
116
114
|
|
|
117
115
|
constructor(opts: WorkerPatternMatcherOptions = {}) {
|
|
118
116
|
this.budgetMs = option('budgetMs', opts.budgetMs ?? 5_000, 1, MAX_TIMER_MS - TRANSFER_GRACE_MS);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
this.pool = new WorkerPool(
|
|
118
|
+
() => new Worker(WORKER_SOURCE, { eval: true }),
|
|
119
|
+
{
|
|
120
|
+
// A pool of none would leave every search waiting for a worker that never comes.
|
|
121
|
+
poolMax: option('poolMax', opts.poolMax ?? 4, 1),
|
|
122
|
+
// No queue at all is allowed: every search past the pool is refused busy.
|
|
123
|
+
maxWaiting: option('maxWaiting', opts.maxWaiting ?? 16, 0),
|
|
124
|
+
},
|
|
125
|
+
() => new SearchBusyError(),
|
|
126
|
+
);
|
|
123
127
|
this.maxPatternLength = option('maxPatternLength', opts.maxPatternLength ?? 1_000, 1);
|
|
124
128
|
this.batchChars = option('batchChars', opts.batchChars ?? 1_000_000, 1);
|
|
125
129
|
this.batchLines = option('batchLines', opts.batchLines ?? 10_000, 1);
|
|
126
130
|
this.lease = {
|
|
127
|
-
acquire: () => this.acquire(),
|
|
128
|
-
release: (w) => this.release(w),
|
|
131
|
+
acquire: () => this.pool.acquire(),
|
|
132
|
+
release: (w) => this.pool.release(w),
|
|
133
|
+
discard: (w) => this.pool.discard(w),
|
|
129
134
|
batchEnd: (lines, from) => this.batchEnd(lines, from),
|
|
130
135
|
batchChars: this.batchChars,
|
|
131
136
|
};
|
|
@@ -147,12 +152,8 @@ export class WorkerPatternMatcher implements IPatternMatcher {
|
|
|
147
152
|
return new BoundedSearch(this.lease, source, flags, this.budgetMs);
|
|
148
153
|
}
|
|
149
154
|
|
|
150
|
-
|
|
151
|
-
this.
|
|
152
|
-
for (const waiter of this.waiting.splice(0)) waiter.reject(new SearchBusyError());
|
|
153
|
-
const workers = [...this.all];
|
|
154
|
-
this.idle.length = 0;
|
|
155
|
-
await Promise.all(workers.map((w) => w.terminate()));
|
|
155
|
+
close(): Promise<void> {
|
|
156
|
+
return this.pool.close();
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
/**
|
|
@@ -168,43 +169,6 @@ export class WorkerPatternMatcher implements IPatternMatcher {
|
|
|
168
169
|
while (to < last && (to === from || chars + lines[to]!.length <= this.batchChars)) chars += lines[to++]!.length;
|
|
169
170
|
return to;
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
-
private async acquire(): Promise<Worker> {
|
|
173
|
-
if (this.closed) throw new SearchBusyError();
|
|
174
|
-
if (this.idle.length === 0 && this.all.size >= this.poolMax && this.waiting.length >= this.maxWaiting) {
|
|
175
|
-
throw new SearchBusyError();
|
|
176
|
-
}
|
|
177
|
-
const w =
|
|
178
|
-
this.idle.pop() ??
|
|
179
|
-
(this.all.size < this.poolMax
|
|
180
|
-
? this.spawn()
|
|
181
|
-
: await new Promise<Worker>((resolve, reject) => this.waiting.push({ resolve, reject })));
|
|
182
|
-
w.ref();
|
|
183
|
-
return w;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
private release(w: Worker): void {
|
|
187
|
-
const next = this.waiting.shift();
|
|
188
|
-
if (next) return next.resolve(w);
|
|
189
|
-
// An idle worker must not hold a process's exit open.
|
|
190
|
-
w.unref();
|
|
191
|
-
this.idle.push(w);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
private spawn(): Worker {
|
|
195
|
-
const w = new Worker(WORKER_SOURCE, { eval: true });
|
|
196
|
-
this.all.add(w);
|
|
197
|
-
// A worker that dies — terminated over budget, or out of memory — leaves the pool.
|
|
198
|
-
w.once('exit', () => {
|
|
199
|
-
this.all.delete(w);
|
|
200
|
-
const at = this.idle.indexOf(w);
|
|
201
|
-
if (at >= 0) this.idle.splice(at, 1);
|
|
202
|
-
if (this.closed) return;
|
|
203
|
-
const next = this.waiting.shift();
|
|
204
|
-
if (next) next.resolve(this.spawn());
|
|
205
|
-
});
|
|
206
|
-
return w;
|
|
207
|
-
}
|
|
208
172
|
}
|
|
209
173
|
|
|
210
174
|
/** One search: a caller's pattern, matched off the event loop under one budget. */
|
|
@@ -231,7 +195,7 @@ class BoundedSearch implements IPatternSearch {
|
|
|
231
195
|
}
|
|
232
196
|
} catch (err) {
|
|
233
197
|
// Terminating is what stops a regex mid-backtrack; the pool replaces it.
|
|
234
|
-
|
|
198
|
+
this.pool.discard(w);
|
|
235
199
|
throw err;
|
|
236
200
|
}
|
|
237
201
|
this.pool.release(w);
|
|
@@ -292,37 +256,16 @@ async function shareLine(w: Worker, line: string, chunkChars: number): Promise<S
|
|
|
292
256
|
}
|
|
293
257
|
}
|
|
294
258
|
|
|
295
|
-
function run(w: Worker, message: object, timeoutMs: number): Promise<Reply | 'timeout'> {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
fn();
|
|
303
|
-
};
|
|
304
|
-
const onMessage = (reply: Reply) => settle(() => resolve(reply));
|
|
305
|
-
const onError = (err: Error) => settle(() => reject(err));
|
|
306
|
-
// Terminated under the search by `close()`: answered as busy, not left hanging until the timer.
|
|
307
|
-
const onExit = () => settle(() => reject(new SearchBusyError()));
|
|
308
|
-
const timer = setTimeout(() => settle(() => resolve('timeout')), timeoutMs);
|
|
309
|
-
w.on('message', onMessage);
|
|
310
|
-
w.on('error', onError);
|
|
311
|
-
w.on('exit', onExit);
|
|
312
|
-
w.postMessage(message);
|
|
313
|
-
});
|
|
259
|
+
async function run(w: Worker, message: object, timeoutMs: number): Promise<Reply | 'timeout'> {
|
|
260
|
+
const outcome = await exchange<Reply>(w, message, timeoutMs);
|
|
261
|
+
if ('reply' in outcome) return outcome.reply;
|
|
262
|
+
if ('timeout' in outcome) return 'timeout';
|
|
263
|
+
if ('error' in outcome) throw outcome.error;
|
|
264
|
+
// Terminated under the search by `close()`: answered as busy, not left hanging until the timer.
|
|
265
|
+
throw new SearchBusyError();
|
|
314
266
|
}
|
|
315
267
|
|
|
316
|
-
/**
|
|
317
|
-
* The longest delay `setTimeout` honours. A longer one fires after 1 ms, so a
|
|
318
|
-
* budget past this (less the grace added to it) would stop every search at once.
|
|
319
|
-
*/
|
|
320
|
-
const MAX_TIMER_MS = 2_147_483_647;
|
|
321
|
-
|
|
322
268
|
/** A sizing option as given, refused at construction unless it is an integer from `min` to `max`. */
|
|
323
269
|
function option(name: string, value: number, min: number, max = Number.MAX_SAFE_INTEGER): number {
|
|
324
|
-
|
|
325
|
-
throw new RangeError(`WorkerPatternMatcher: ${name} must be an integer from ${min} to ${max}, got ${value}.`);
|
|
326
|
-
}
|
|
327
|
-
return value;
|
|
270
|
+
return sizingOption('WorkerPatternMatcher', name, value, min, max);
|
|
328
271
|
}
|
|
@@ -8,6 +8,15 @@ under an `[extracted text of …]` marker whose summary states what was left out
|
|
|
8
8
|
When an extractor's OUTPUT changes, bump `EXTRACTION_SCHEMA` in
|
|
9
9
|
`doc-extract.service.ts` so cached extractions of unchanged bytes refresh.
|
|
10
10
|
|
|
11
|
+
No extractor runs on the server's request thread: `DocExtractService` hands the
|
|
12
|
+
bytes to `WorkerDocumentExtractor` (`extract-in-worker.ts`), a pool of worker
|
|
13
|
+
threads running `extract.worker.ts` (the table in `document-extractors.ts`)
|
|
14
|
+
under a 10-second budget per file. A failed extraction is cached under the same
|
|
15
|
+
key — a parser's refusal for good, a timeout or crash for an hour — and a fresh
|
|
16
|
+
failure is reported as the `document-unreadable` event. A new format is added
|
|
17
|
+
to `document-formats.ts` and to the worker's table; the compiler holds the two
|
|
18
|
+
together.
|
|
19
|
+
|
|
11
20
|
## Word (`.docx`)
|
|
12
21
|
|
|
13
22
|
- Paragraphs become lines; table rows become lines of tab-separated cells.
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
2
|
+
import { tmpdir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
5
|
+
import { DocExtractService, TIMEOUT_MEMORY_MS, type UnreadableDocument } from '../doc-extract.service.js';
|
|
6
|
+
import type { IDocumentExtractor, IsolatedExtraction } from '../document-extractor.contract.js';
|
|
7
|
+
import { WorkerDocumentExtractor } from '../extract-in-worker.js';
|
|
8
|
+
import { xrefPdf } from './fixtures/damaged-pdf.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* What `DocExtractService` remembers about a failed extraction, and whom it
|
|
12
|
+
* tells: a parser's refusal for good, a timeout or crash for an hour, "busy"
|
|
13
|
+
* not at all; a fresh failure reported once, a remembered one never.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** An extractor that answers what each test scripts, and counts the extractions it was asked for. */
|
|
17
|
+
function scriptedExtractor(answer: (extension: string, bytes: Buffer) => IsolatedExtraction): IDocumentExtractor & { calls: number } {
|
|
18
|
+
return {
|
|
19
|
+
calls: 0,
|
|
20
|
+
async extract(extension, bytes) {
|
|
21
|
+
this.calls++;
|
|
22
|
+
return answer(extension, bytes);
|
|
23
|
+
},
|
|
24
|
+
close: async () => {},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const TIMEOUT: IsolatedExtraction = {
|
|
29
|
+
ok: false,
|
|
30
|
+
failure: 'timeout',
|
|
31
|
+
message: 'could not be read: extracting its text took longer than 10 seconds',
|
|
32
|
+
};
|
|
33
|
+
const ORIGIN = { workspaceId: 'main' };
|
|
34
|
+
|
|
35
|
+
let cacheRoot = '';
|
|
36
|
+
let clock = 0;
|
|
37
|
+
let told: UnreadableDocument[] = [];
|
|
38
|
+
const now = () => clock;
|
|
39
|
+
const onUnreadable = (doc: UnreadableDocument) => told.push(doc);
|
|
40
|
+
|
|
41
|
+
beforeEach(async () => {
|
|
42
|
+
cacheRoot = await mkdtemp(join(tmpdir(), 'doc-extract-service-'));
|
|
43
|
+
clock = 1_800_000_000_000;
|
|
44
|
+
told = [];
|
|
45
|
+
});
|
|
46
|
+
afterEach(() => rm(cacheRoot, { recursive: true, force: true }));
|
|
47
|
+
|
|
48
|
+
describe('DocExtractService — a damaged PDF, through the real worker', () => {
|
|
49
|
+
let extractor: WorkerDocumentExtractor;
|
|
50
|
+
beforeEach(() => {
|
|
51
|
+
extractor = new WorkerDocumentExtractor();
|
|
52
|
+
});
|
|
53
|
+
afterEach(() => extractor.close());
|
|
54
|
+
|
|
55
|
+
it('is extracted once; every later read and the cheap lookup answer the remembered notice', async () => {
|
|
56
|
+
let extractions = 0;
|
|
57
|
+
const counting: IDocumentExtractor = {
|
|
58
|
+
extract: (ext, bytes) => {
|
|
59
|
+
extractions++;
|
|
60
|
+
return extractor.extract(ext, bytes);
|
|
61
|
+
},
|
|
62
|
+
close: () => extractor.close(),
|
|
63
|
+
};
|
|
64
|
+
const service = new DocExtractService(cacheRoot, counting, { now, onUnreadable });
|
|
65
|
+
const pdf = xrefPdf('Hello', { damage: true });
|
|
66
|
+
const first = await service.extract('kb/Supplier-Agreement.pdf', pdf, ORIGIN);
|
|
67
|
+
expect(first).toEqual({ ok: false, message: "could not extract the PDF's text (Bad (uncompressed) XRef entry: 4R)" });
|
|
68
|
+
expect(await service.extract('kb/Supplier-Agreement.pdf', pdf, ORIGIN)).toEqual(first);
|
|
69
|
+
expect(await service.getCached('kb/Supplier-Agreement.pdf', pdf)).toEqual(first);
|
|
70
|
+
expect(extractions).toBe(1);
|
|
71
|
+
// Told once, for the fresh failure only — under the reason the explorer shows.
|
|
72
|
+
expect(told).toEqual([
|
|
73
|
+
{ workspaceId: 'main', path: 'kb/Supplier-Agreement.pdf', reason: "could not extract the PDF's text (Bad (uncompressed) XRef entry: 4R)" },
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('extracts the repaired file — new content — and reads it normally', async () => {
|
|
78
|
+
const service = new DocExtractService(cacheRoot, extractor, { now, onUnreadable });
|
|
79
|
+
await service.extract('a.pdf', xrefPdf('Hello', { damage: true }), ORIGIN);
|
|
80
|
+
const repaired = await service.extract('a.pdf', xrefPdf('Hello', { damage: false }), ORIGIN);
|
|
81
|
+
expect(repaired).toMatchObject({ ok: true, text: '[page 1]\nHello' });
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe('DocExtractService — how long a failure is remembered', () => {
|
|
86
|
+
it('remembers a parser failure for good — even long past an hour', async () => {
|
|
87
|
+
const extractor = scriptedExtractor(() => ({ ok: false, failure: 'parser', message: 'could not be parsed as a PDF (x)' }));
|
|
88
|
+
const service = new DocExtractService(cacheRoot, extractor, { now });
|
|
89
|
+
const bytes = Buffer.from('damaged');
|
|
90
|
+
await service.extract('a.pdf', bytes);
|
|
91
|
+
clock += 30 * TIMEOUT_MEMORY_MS;
|
|
92
|
+
expect(await service.extract('a.pdf', bytes)).toEqual({ ok: false, message: 'could not be parsed as a PDF (x)' });
|
|
93
|
+
expect(extractor.calls).toBe(1);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('remembers a timeout for one hour, then extracts again', async () => {
|
|
97
|
+
let answer: IsolatedExtraction = TIMEOUT;
|
|
98
|
+
const extractor = scriptedExtractor(() => answer);
|
|
99
|
+
const service = new DocExtractService(cacheRoot, extractor, { now, onUnreadable });
|
|
100
|
+
const bytes = Buffer.from('slow');
|
|
101
|
+
expect(await service.extract('big.pdf', bytes, ORIGIN)).toEqual({ ok: false, message: TIMEOUT.message });
|
|
102
|
+
// Within the hour: the notice, at once, from every read and from the cheap lookup.
|
|
103
|
+
clock += TIMEOUT_MEMORY_MS - 1;
|
|
104
|
+
expect(await service.extract('big.pdf', bytes, ORIGIN)).toEqual({ ok: false, message: TIMEOUT.message });
|
|
105
|
+
expect(await service.getCached('big.pdf', bytes)).toEqual({ ok: false, message: TIMEOUT.message });
|
|
106
|
+
expect(extractor.calls).toBe(1);
|
|
107
|
+
// After it: tried again, and this time the server had the moment to spare.
|
|
108
|
+
clock += 1;
|
|
109
|
+
expect(await service.getCached('big.pdf', bytes)).toBeUndefined();
|
|
110
|
+
answer = { ok: true, summary: '1 page', text: '[page 1]\nfinally' };
|
|
111
|
+
expect(await service.extract('big.pdf', bytes, ORIGIN)).toMatchObject({ ok: true, text: '[page 1]\nfinally' });
|
|
112
|
+
expect(extractor.calls).toBe(2);
|
|
113
|
+
expect(told).toEqual([{ workspaceId: 'main', path: 'big.pdf', reason: 'extracting its text took longer than 10 seconds' }]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('remembers a crashed extraction for an hour, like a timeout', async () => {
|
|
117
|
+
const extractor = scriptedExtractor(() => ({ ok: false, failure: 'crashed', message: 'could not be read: its extraction stopped unexpectedly (exit code 3)' }));
|
|
118
|
+
const service = new DocExtractService(cacheRoot, extractor, { now });
|
|
119
|
+
const bytes = Buffer.from('oom');
|
|
120
|
+
await service.extract('a.pdf', bytes);
|
|
121
|
+
await service.extract('a.pdf', bytes);
|
|
122
|
+
expect(extractor.calls).toBe(1);
|
|
123
|
+
clock += TIMEOUT_MEMORY_MS;
|
|
124
|
+
await service.extract('a.pdf', bytes);
|
|
125
|
+
expect(extractor.calls).toBe(2);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('remembers nothing, and tells no one, when no worker was free', async () => {
|
|
129
|
+
const extractor = scriptedExtractor(() => ({ ok: false, failure: 'busy', message: 'could not be read: too many documents are being extracted at once; try again in a few seconds' }));
|
|
130
|
+
const service = new DocExtractService(cacheRoot, extractor, { now, onUnreadable });
|
|
131
|
+
const bytes = Buffer.from('fine');
|
|
132
|
+
expect((await service.extract('a.pdf', bytes, ORIGIN)).ok).toBe(false);
|
|
133
|
+
expect(await service.getCached('a.pdf', bytes)).toBeUndefined();
|
|
134
|
+
await service.extract('a.pdf', bytes, ORIGIN);
|
|
135
|
+
expect(extractor.calls).toBe(2);
|
|
136
|
+
expect(told).toEqual([]);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('tells no one about a failure of a read with no origin', async () => {
|
|
140
|
+
const extractor = scriptedExtractor(() => TIMEOUT);
|
|
141
|
+
const service = new DocExtractService(cacheRoot, extractor, { now, onUnreadable });
|
|
142
|
+
await service.extract('a.pdf', Buffer.from('x'));
|
|
143
|
+
expect(told).toEqual([]);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('tells once when two reads of the same document fail together', async () => {
|
|
147
|
+
const extractor = scriptedExtractor(() => TIMEOUT);
|
|
148
|
+
const service = new DocExtractService(cacheRoot, extractor, { now, onUnreadable });
|
|
149
|
+
const bytes = Buffer.from('twice');
|
|
150
|
+
await Promise.all([service.extract('a.pdf', bytes, ORIGIN), service.extract('a.pdf', bytes, ORIGIN)]);
|
|
151
|
+
expect(extractor.calls).toBe(1);
|
|
152
|
+
expect(told).toHaveLength(1);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it('still answers the read when whoever is told throws', async () => {
|
|
156
|
+
const extractor = scriptedExtractor(() => TIMEOUT);
|
|
157
|
+
const service = new DocExtractService(cacheRoot, extractor, {
|
|
158
|
+
now,
|
|
159
|
+
onUnreadable: () => {
|
|
160
|
+
throw new Error('listener broke');
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
expect(await service.extract('a.pdf', Buffer.from('x'), ORIGIN)).toEqual({ ok: false, message: TIMEOUT.message });
|
|
164
|
+
});
|
|
165
|
+
});
|
|
@@ -7,18 +7,18 @@ import AdmZip from 'adm-zip';
|
|
|
7
7
|
import * as XLSX from 'xlsx';
|
|
8
8
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
9
9
|
import { extractDocx } from '../extract-docx.js';
|
|
10
|
-
import { extractPptx } from '../extract-pptx.js';
|
|
10
|
+
import { extractPptx, notesTargetFromRels } from '../extract-pptx.js';
|
|
11
11
|
import { extractXlsx } from '../extract-xlsx.js';
|
|
12
12
|
import { extractPdf } from '../extract-pdf.js';
|
|
13
13
|
import { extractOdt } from '../extract-odt.js';
|
|
14
14
|
import { extractOdp } from '../extract-odp.js';
|
|
15
15
|
import { extractOds } from '../extract-ods.js';
|
|
16
16
|
import { DocExtractService, EXTRACTION_SCHEMA } from '../doc-extract.service.js';
|
|
17
|
+
import { WorkerDocumentExtractor } from '../extract-in-worker.js';
|
|
17
18
|
import { DocExtractionCache, gitBlobSha } from '../extraction-cache.js';
|
|
18
19
|
import { fileExtension } from '../doc-extract.types.js';
|
|
19
20
|
import { MAX_ODF_NS_ALIASES, normalizeOdfPrefixes, odfParagraphBlocks } from '../odf-text.js';
|
|
20
21
|
import { decodeXmlEntities, xmlAttrValue, xmlAttrValueByLocalName } from '../ooxml-text.js';
|
|
21
|
-
import { notesTargetFromRels } from '../extract-pptx.js';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* REAL fixtures, no mocks: docx/pptx are handcrafted OOXML zips built with
|
|
@@ -612,7 +612,7 @@ describe('DocExtractService cache', () => {
|
|
|
612
612
|
|
|
613
613
|
beforeEach(async () => {
|
|
614
614
|
cacheRoot = await mkdtemp(join(tmpdir(), 'doc-extract-cache-'));
|
|
615
|
-
service = new DocExtractService(cacheRoot);
|
|
615
|
+
service = new DocExtractService(cacheRoot, new WorkerDocumentExtractor());
|
|
616
616
|
});
|
|
617
617
|
afterEach(async () => {
|
|
618
618
|
await rm(cacheRoot, { recursive: true, force: true });
|
|
@@ -620,7 +620,7 @@ describe('DocExtractService cache', () => {
|
|
|
620
620
|
|
|
621
621
|
it('extracts ONCE per content: the second read is served from the cache file', async () => {
|
|
622
622
|
const bytes = docxBytes(para('Cache me once'));
|
|
623
|
-
const first = await service.extract('a.docx', bytes
|
|
623
|
+
const first = await service.extract('a.docx', bytes);
|
|
624
624
|
expect(first.ok).toBe(true);
|
|
625
625
|
const entries = await readdir(cacheRoot);
|
|
626
626
|
expect(entries).toEqual([`${gitBlobSha(bytes)}.docx.${EXTRACTION_SCHEMA}.json`]);
|
|
@@ -629,7 +629,7 @@ describe('DocExtractService cache', () => {
|
|
|
629
629
|
// text, it came from the cache — the parser did NOT run again. (Real-files
|
|
630
630
|
// proof without spying on module internals.)
|
|
631
631
|
await writeFile(join(cacheRoot, entries[0]), JSON.stringify({ summary: 'tampered summary', text: 'FROM CACHE' }), 'utf8');
|
|
632
|
-
const second = await service.extract('a.docx', bytes
|
|
632
|
+
const second = await service.extract('a.docx', bytes);
|
|
633
633
|
if (!second.ok) throw new Error(second.message);
|
|
634
634
|
expect(second.text).toBe('FROM CACHE');
|
|
635
635
|
expect(second.marker).toBe('[extracted text of a.docx — tampered summary]');
|
|
@@ -638,9 +638,9 @@ describe('DocExtractService cache', () => {
|
|
|
638
638
|
it('is invalidated by CONTENT change (new blob sha → fresh extraction, new entry)', async () => {
|
|
639
639
|
const v1 = docxBytes(para('version one'));
|
|
640
640
|
const v2 = docxBytes(para('version two'));
|
|
641
|
-
await service.extract('a.docx', v1
|
|
641
|
+
await service.extract('a.docx', v1);
|
|
642
642
|
const after1 = await readdir(cacheRoot);
|
|
643
|
-
const res = await service.extract('a.docx', v2
|
|
643
|
+
const res = await service.extract('a.docx', v2);
|
|
644
644
|
if (!res.ok) throw new Error(res.message);
|
|
645
645
|
expect(res.text).toBe('version two');
|
|
646
646
|
const after2 = await readdir(cacheRoot);
|
|
@@ -650,9 +650,9 @@ describe('DocExtractService cache', () => {
|
|
|
650
650
|
|
|
651
651
|
it('keys by content, not path: the same bytes under another path reuse the entry, marker names the read path', async () => {
|
|
652
652
|
const bytes = docxBytes(para('Shared content'));
|
|
653
|
-
await service.extract('one.docx', bytes
|
|
653
|
+
await service.extract('one.docx', bytes);
|
|
654
654
|
expect(await readdir(cacheRoot)).toHaveLength(1);
|
|
655
|
-
const other = await service.extract('two/other.docx', bytes
|
|
655
|
+
const other = await service.extract('two/other.docx', bytes);
|
|
656
656
|
if (!other.ok) throw new Error(other.message);
|
|
657
657
|
expect(other.marker).toMatch(/^\[extracted text of two\/other\.docx — /);
|
|
658
658
|
expect(await readdir(cacheRoot)).toHaveLength(1);
|
|
@@ -661,15 +661,20 @@ describe('DocExtractService cache', () => {
|
|
|
661
661
|
it('getCached misses before extraction and hits after — the grep budget contract', async () => {
|
|
662
662
|
const bytes = docxBytes(para('Budget line'));
|
|
663
663
|
expect(await service.getCached('a.docx', bytes)).toBeUndefined();
|
|
664
|
-
await service.extract('a.docx', bytes
|
|
664
|
+
await service.extract('a.docx', bytes);
|
|
665
665
|
const hit = await service.getCached('a.docx', bytes);
|
|
666
666
|
expect(hit?.text).toBe('Budget line');
|
|
667
667
|
});
|
|
668
668
|
|
|
669
|
-
it('
|
|
670
|
-
|
|
669
|
+
it('remembers a parser failure under the content key — a corrupt file is answered from the cache', async () => {
|
|
670
|
+
// Reversed on purpose (Damaged-Document-Never-Hangs): a damaged file was
|
|
671
|
+
// extracted again on every read and every grep; now its failure is kept
|
|
672
|
+
// like a success, and the cheap lookup answers it too.
|
|
673
|
+
const junk = Buffer.from('junk');
|
|
674
|
+
const res = await service.extract('bad.docx', junk);
|
|
671
675
|
expect(res.ok).toBe(false);
|
|
672
|
-
expect(await readdir(cacheRoot)).
|
|
676
|
+
expect(await readdir(cacheRoot)).toEqual([`${gitBlobSha(junk)}.docx.${EXTRACTION_SCHEMA}.json`]);
|
|
677
|
+
expect(await service.getCached('bad.docx', junk)).toEqual(res);
|
|
673
678
|
});
|
|
674
679
|
|
|
675
680
|
it('computes the git blob sha (matches `git hash-object`)', async () => {
|
|
@@ -679,7 +684,7 @@ describe('DocExtractService cache', () => {
|
|
|
679
684
|
|
|
680
685
|
it('the cached entry on disk is the {summary, text} JSON', async () => {
|
|
681
686
|
const bytes = docxBytes(para('On disk'));
|
|
682
|
-
await service.extract('a.docx', bytes
|
|
687
|
+
await service.extract('a.docx', bytes);
|
|
683
688
|
const raw = JSON.parse(await readFile(join(cacheRoot, `${gitBlobSha(bytes)}.docx.${EXTRACTION_SCHEMA}.json`), 'utf8')) as { summary: string; text: string };
|
|
684
689
|
expect(raw.text).toBe('On disk');
|
|
685
690
|
expect(typeof raw.summary).toBe('string');
|
|
@@ -694,12 +699,12 @@ describe('DocExtractService cache', () => {
|
|
|
694
699
|
`${odsCell('cell')}` +
|
|
695
700
|
'</table:table-row></table:table></office:text>',
|
|
696
701
|
);
|
|
697
|
-
const asOdt = await service.extract('doc.odt', bytes
|
|
702
|
+
const asOdt = await service.extract('doc.odt', bytes);
|
|
698
703
|
if (!asOdt.ok) throw new Error(asOdt.message);
|
|
699
704
|
expect(asOdt.text).toContain('Prose line');
|
|
700
705
|
|
|
701
706
|
// Same bytes, renamed .ods: the odt extraction must NOT come back.
|
|
702
|
-
const asOds = await service.extract('doc.ods', bytes
|
|
707
|
+
const asOds = await service.extract('doc.ods', bytes);
|
|
703
708
|
if (!asOds.ok) throw new Error(asOds.message);
|
|
704
709
|
expect(asOds.text.split('\n')[0]).toBe('[sheet: Grid]');
|
|
705
710
|
expect(asOds.marker).toContain('sheet');
|