@bevel-software/platform-core-backend 0.31.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 +14 -2
- package/dist/core/create-core-services.d.ts.map +1 -1
- package/dist/core/create-core-services.js +34 -7
- 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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.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 +29 -0
- package/dist/modules/access-model/index.d.ts.map +1 -0
- package/dist/modules/access-model/index.js +26 -0
- package/dist/modules/access-model/index.js.map +1 -0
- 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-hooks.d.ts +4 -6
- package/dist/modules/auth/account-hooks.d.ts.map +1 -1
- package/dist/modules/auth/account-hooks.js +7 -17
- package/dist/modules/auth/account-hooks.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 +10 -9
- package/dist/modules/auth/auth.service.d.ts.map +1 -1
- package/dist/modules/auth/auth.service.js +22 -21
- 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 +128 -235
- package/dist/modules/database/core-schema.d.ts.map +1 -1
- package/dist/modules/database/core-schema.js +55 -36
- 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 +29 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.d.ts.map +1 -1
- package/dist/modules/mcp/oauth/bevel-oauth-provider.js +167 -40
- 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 +15 -2
- package/dist/modules/workflow/agent-tools/change-request-summary.d.ts.map +1 -1
- package/dist/modules/workflow/agent-tools/change-request-summary.js +12 -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 +51 -68
- package/dist/modules/workflow/agent-tools/workflow.tools.js.map +1 -1
- package/dist/modules/workflow/change-request-hooks.d.ts +78 -0
- package/dist/modules/workflow/change-request-hooks.d.ts.map +1 -0
- package/dist/modules/workflow/change-request-hooks.js +15 -0
- package/dist/modules/workflow/change-request-hooks.js.map +1 -0
- 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 +16 -7
- package/dist/modules/workflow/git/pull-request.service.d.ts.map +1 -1
- package/dist/modules/workflow/git/pull-request.service.js +49 -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 +112 -62
- package/dist/modules/workflow/workflow.service.d.ts.map +1 -1
- package/dist/modules/workflow/workflow.service.js +367 -172
- 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/dist/shared/listener-seam.d.ts +34 -0
- package/dist/shared/listener-seam.d.ts.map +1 -0
- package/dist/shared/listener-seam.js +42 -0
- package/dist/shared/listener-seam.js.map +1 -0
- package/migrations/0019_oauth_token_rotated_at.sql +7 -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/0019_snapshot.json +2435 -0
- package/migrations/meta/0020_snapshot.json +2321 -0
- package/migrations/meta/0021_snapshot.json +2353 -0
- package/migrations/meta/_journal.json +21 -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 +49 -5
- package/src/core/lifecycle.ts +10 -0
- package/src/core/public-config.ts +10 -0
- package/src/index.ts +7 -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 +29 -0
- 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/__tests__/account-deactivation.test.ts +38 -2
- package/src/modules/auth/account-erasure.service.ts +4 -9
- package/src/modules/auth/account-hooks.ts +13 -21
- 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 +23 -22
- 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 +59 -37
- 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__/bevel-oauth-provider.pg.test.ts +279 -0
- package/src/modules/mcp/__tests__/bevel-oauth-provider.test.ts +190 -15
- 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 +216 -50
- 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__/change-request-hooks.test.ts +62 -0
- 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.routes.open-change-request.test.ts +79 -0
- package/src/modules/workflow/__tests__/workflow.service.delete-branch.test.ts +9 -1
- package/src/modules/workflow/__tests__/workflow.service.facade.test.ts +342 -22
- 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 +43 -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 +26 -3
- package/src/modules/workflow/agent-tools/workflow.tools.ts +55 -75
- package/src/modules/workflow/change-request-hooks.ts +96 -0
- 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 +44 -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 +444 -215
- 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/shared/listener-seam.ts +52 -0
- package/src/modules/workflow/__tests__/format-affected-owners.test.ts +0 -85
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { extractionMarker, fileExtension } from './doc-extract.types.js';
|
|
2
2
|
import { DocExtractionCache, gitBlobSha } from './extraction-cache.js';
|
|
3
|
+
/**
|
|
4
|
+
* How long an extraction stopped over its budget, or whose worker died under
|
|
5
|
+
* it, is remembered: an overrun is a property of the moment (a busy server, a
|
|
6
|
+
* large file), not of the bytes, so it is tried again after this. A parser's
|
|
7
|
+
* refusal is a property of the bytes and is remembered like a success
|
|
8
|
+
* (decided 2026-10-15/19).
|
|
9
|
+
*/
|
|
10
|
+
export const TIMEOUT_MEMORY_MS = 60 * 60 * 1000;
|
|
3
11
|
/**
|
|
4
12
|
* The content-hash CACHE wrap around document text extraction. The per-format
|
|
5
13
|
* `DocumentReader`s in the file-reader registry stay pure (each pairs one
|
|
@@ -15,7 +23,15 @@ import { DocExtractionCache, gitBlobSha } from './extraction-cache.js';
|
|
|
15
23
|
* extract DIFFERENTLY per format: a `.odt` renamed `.ods` must run the ods
|
|
16
24
|
* extractor, not return the odt extraction. Extraction is deterministic
|
|
17
25
|
* (stable slide/sheet/page ordering), which is what makes a content-keyed
|
|
18
|
-
* cache correct.
|
|
26
|
+
* cache correct.
|
|
27
|
+
*
|
|
28
|
+
* Extraction itself runs in a worker, under a budget (`IDocumentExtractor`),
|
|
29
|
+
* and its FAILURES are remembered under the same key: a parser's refusal for
|
|
30
|
+
* good, so damaged bytes cost the server once for as long as the entry is
|
|
31
|
+
* kept (the cache evicts by size, as it does successes), and a timeout or a
|
|
32
|
+
* crash for {@link TIMEOUT_MEMORY_MS}. A re-saved file is new content and is
|
|
33
|
+
* extracted again. Only "no worker was free" is not remembered: it says
|
|
34
|
+
* nothing about the file. The key also carries
|
|
19
35
|
* `EXTRACTION_SCHEMA`, so an upgrade that changes what an extractor emits does
|
|
20
36
|
* not keep serving the previous release's text for unchanged bytes.
|
|
21
37
|
*/
|
|
@@ -38,7 +54,10 @@ import { DocExtractionCache, gitBlobSha } from './extraction-cache.js';
|
|
|
38
54
|
*/
|
|
39
55
|
export const EXTRACTION_SCHEMA = 'v3';
|
|
40
56
|
export class DocExtractService {
|
|
57
|
+
extractor;
|
|
41
58
|
cache;
|
|
59
|
+
now;
|
|
60
|
+
onUnreadable;
|
|
42
61
|
/**
|
|
43
62
|
* Cold extractions currently running, by cache key. Two reads of the same
|
|
44
63
|
* document arriving together would otherwise BOTH parse it — the expensive
|
|
@@ -46,48 +65,81 @@ export class DocExtractService {
|
|
|
46
65
|
* written the cache entry yet when the other looked.
|
|
47
66
|
*/
|
|
48
67
|
inFlight = new Map();
|
|
49
|
-
constructor(cacheRoot) {
|
|
68
|
+
constructor(cacheRoot, extractor, opts = {}) {
|
|
69
|
+
this.extractor = extractor;
|
|
50
70
|
this.cache = new DocExtractionCache(cacheRoot);
|
|
71
|
+
this.now = opts.now ?? Date.now;
|
|
72
|
+
this.onUnreadable = opts.onUnreadable;
|
|
51
73
|
}
|
|
52
74
|
/**
|
|
53
|
-
*
|
|
54
|
-
* never extracts. `grep` uses this
|
|
55
|
-
* search already-extracted documents
|
|
56
|
-
*
|
|
75
|
+
* What the cache REMEMBERS for these bytes — the extraction, or the notice
|
|
76
|
+
* of a failed one — or undefined on a miss; never extracts. `grep` uses this
|
|
77
|
+
* (via `DocumentReader.cachedRead`) to search already-extracted documents
|
|
78
|
+
* for free, skip remembered failures for free, and apply its per-walk budget
|
|
79
|
+
* only to cold ones; `file_stat` uses it to report a remembered failure.
|
|
57
80
|
*/
|
|
58
81
|
async getCached(path, bytes) {
|
|
59
|
-
const hit = await this.cache.get(this.cacheKey(path, bytes));
|
|
60
|
-
|
|
82
|
+
const hit = await this.cache.get(this.cacheKey(path, bytes), this.now());
|
|
83
|
+
if (!hit)
|
|
84
|
+
return undefined;
|
|
85
|
+
return hit.failed
|
|
86
|
+
? { ok: false, message: hit.message }
|
|
87
|
+
: { ok: true, marker: extractionMarker(path, hit.summary), text: hit.text };
|
|
61
88
|
}
|
|
62
|
-
/**
|
|
63
|
-
|
|
89
|
+
/**
|
|
90
|
+
* The extraction of `bytes` (remembered, or run in the extractor's worker
|
|
91
|
+
* and remembered). `path` supplies the marker AND the key's format part;
|
|
92
|
+
* `origin`, when given, is where a fresh failure is reported.
|
|
93
|
+
*/
|
|
94
|
+
async extract(path, bytes, origin) {
|
|
64
95
|
const key = this.cacheKey(path, bytes);
|
|
65
|
-
const
|
|
66
|
-
if (
|
|
67
|
-
return
|
|
96
|
+
const remembered = await this.getCached(path, bytes);
|
|
97
|
+
if (remembered)
|
|
98
|
+
return remembered;
|
|
68
99
|
const running = this.inFlight.get(key);
|
|
69
100
|
const result = await (running ??
|
|
70
101
|
(() => {
|
|
71
102
|
// The cache write stays INSIDE the shared promise: were the entry
|
|
72
103
|
// dropped as soon as parsing settled, a read arriving during the
|
|
73
104
|
// write would miss both the cache and the in-flight map — and parse
|
|
74
|
-
// the same document again.
|
|
105
|
+
// the same document again. The bytes are hashed (above) BEFORE the
|
|
106
|
+
// extractor takes its copy of them.
|
|
75
107
|
const started = (async () => {
|
|
76
|
-
const res = await
|
|
77
|
-
if (res.ok)
|
|
108
|
+
const res = await this.extractor.extract(fileExtension(path), bytes);
|
|
109
|
+
if (res.ok) {
|
|
78
110
|
await this.cache.put(key, { summary: res.summary, text: res.text });
|
|
111
|
+
}
|
|
112
|
+
else if (res.failure !== 'busy') {
|
|
113
|
+
const until = res.failure === 'parser' ? undefined : this.now() + TIMEOUT_MEMORY_MS;
|
|
114
|
+
await this.cache.put(key, { failed: true, message: res.message, ...(until === undefined ? {} : { until }) });
|
|
115
|
+
if (origin)
|
|
116
|
+
this.notifyUnreadable({ workspaceId: origin.workspaceId, path, reason: reasonOf(res.message) });
|
|
117
|
+
}
|
|
79
118
|
return res;
|
|
80
119
|
})().finally(() => this.inFlight.delete(key));
|
|
81
120
|
this.inFlight.set(key, started);
|
|
82
121
|
return started;
|
|
83
122
|
})());
|
|
84
123
|
if (!result.ok)
|
|
85
|
-
return result;
|
|
124
|
+
return { ok: false, message: result.message };
|
|
86
125
|
return { ok: true, marker: extractionMarker(path, result.summary), text: result.text };
|
|
87
126
|
}
|
|
127
|
+
/** Best-effort, like every event: a listener that throws never fails the read. */
|
|
128
|
+
notifyUnreadable(doc) {
|
|
129
|
+
try {
|
|
130
|
+
this.onUnreadable?.(doc);
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
// the read still answers its notice
|
|
134
|
+
}
|
|
135
|
+
}
|
|
88
136
|
/** Content hash + lowercased extension — e.g. `…sha….odt` (see the class doc). */
|
|
89
137
|
cacheKey(path, bytes) {
|
|
90
138
|
return `${gitBlobSha(bytes)}${fileExtension(path)}.${EXTRACTION_SCHEMA}`;
|
|
91
139
|
}
|
|
92
140
|
}
|
|
141
|
+
/** A failure's notice, worded to follow "Could not be read:" (the explorer's copy) without saying it twice. */
|
|
142
|
+
function reasonOf(message) {
|
|
143
|
+
return message.replace(/^could not be read: /, '');
|
|
144
|
+
}
|
|
93
145
|
//# sourceMappingURL=doc-extract.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-extract.service.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/doc-extract.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doc-extract.service.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/doc-extract.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAkCvE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC,MAAM,OAAO,iBAAiB;IAcT;IAbF,KAAK,CAAqB;IAC1B,GAAG,CAAe;IAClB,YAAY,CAAkD;IAC/E;;;;;OAKG;IACc,QAAQ,GAAG,IAAI,GAAG,EAAuC,CAAC;IAE3E,YACE,SAAiB,EACA,SAA6B,EAC9C,OAAiC,EAAE;QADlB,cAAS,GAAT,SAAS,CAAoB;QAG9C,IAAI,CAAC,KAAK,GAAG,IAAI,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,KAAa;QACzC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,OAAO,GAAG,CAAC,MAAM;YACf,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;YACrC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC;IAChF,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,KAAa,EAAE,MAAmB;QAC5D,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACvC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,UAAU;YAAE,OAAO,UAAU,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO;YAC3B,CAAC,GAAG,EAAE;gBACJ,kEAAkE;gBAClE,iEAAiE;gBACjE,oEAAoE;gBACpE,mEAAmE;gBACnE,oCAAoC;gBACpC,MAAM,OAAO,GAAG,CAAC,KAAK,IAAiC,EAAE;oBACvD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;oBACrE,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;wBACX,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;oBACtE,CAAC;yBAAM,IAAI,GAAG,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;wBAClC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,iBAAiB,CAAC;wBACpF,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;wBAC7G,IAAI,MAAM;4BAAE,IAAI,CAAC,gBAAgB,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;oBAC9G,CAAC;oBACD,OAAO,GAAG,CAAC;gBACb,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC9C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;gBAChC,OAAO,OAAO,CAAC;YACjB,CAAC,CAAC,EAAE,CAAC,CAAC;QACR,IAAI,CAAC,MAAM,CAAC,EAAE;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;QAC9D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;IACzF,CAAC;IAED,kFAAkF;IAC1E,gBAAgB,CAAC,GAAuB;QAC9C,IAAI,CAAC;YACH,IAAI,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,oCAAoC;QACtC,CAAC;IACH,CAAC;IAED,kFAAkF;IAC1E,QAAQ,CAAC,IAAY,EAAE,KAAa;QAC1C,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,iBAAiB,EAAE,CAAC;IAC3E,CAAC;CACF;AAED,+GAA+G;AAC/G,SAAS,QAAQ,CAAC,OAAe;IAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -33,12 +33,19 @@ export type ExtractResult = ({
|
|
|
33
33
|
} & ExtractedDoc) | {
|
|
34
34
|
ok: false;
|
|
35
35
|
message: string;
|
|
36
|
+
/**
|
|
37
|
+
* Set when the failure is the reader's, not the file's — the parser
|
|
38
|
+
* itself did not load — so it is not remembered as the file's answer
|
|
39
|
+
* the way a refusal of its bytes is.
|
|
40
|
+
*/
|
|
41
|
+
transient?: true;
|
|
36
42
|
};
|
|
37
43
|
/**
|
|
38
44
|
* A format's PURE extract function — bytes in, `ExtractResult` out (async for
|
|
39
45
|
* pdf.js). One per supported format (extract-docx.ts and friends); each is
|
|
40
|
-
* paired with its extension
|
|
41
|
-
*
|
|
46
|
+
* paired with its extension in the extraction worker's table
|
|
47
|
+
* (`document-extractors.ts`), run there under a budget, and cache-wrapped by
|
|
48
|
+
* `DocExtractService`.
|
|
42
49
|
*/
|
|
43
50
|
export type ExtractFn = (bytes: Buffer) => ExtractResult | Promise<ExtractResult>;
|
|
44
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-extract.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/doc-extract.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,uHAAuH;IACvH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,YAAY,CAAC,GAC7B;
|
|
1
|
+
{"version":3,"file":"doc-extract.types.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/doc-extract.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,6EAA6E;AAC7E,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,uHAAuH;IACvH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,MAAM,aAAa,GACrB,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,YAAY,CAAC,GAC7B;IACE,EAAE,EAAE,KAAK,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB,CAAC;AAEN;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AAElF;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doc-extract.types.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/doc-extract.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"doc-extract.types.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/doc-extract.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAwC7D;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,OAAe;IAC5D,OAAO,sBAAsB,aAAa,CAAC,IAAI,CAAC,MAAM,OAAO,GAAG,CAAC;AACnE,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ExtractedDoc } from './doc-extract.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The contract for running a document's extractor: what `DocExtractService`
|
|
4
|
+
* depends on, so it never holds a concrete engine. The one implementation is
|
|
5
|
+
* `WorkerDocumentExtractor` (`extract-in-worker.ts`), owned by the
|
|
6
|
+
* composition root and closed with the graph.
|
|
7
|
+
*
|
|
8
|
+
* A parser can hang on crafted input and can reject promises it never hands
|
|
9
|
+
* back, so an implementation must never run one on the request thread, must
|
|
10
|
+
* stop an extraction that outlives its budget, and must answer every failure
|
|
11
|
+
* — a parser error, a dangling rejection, a crash — as an outcome, never as a
|
|
12
|
+
* rejection of `extract` and never as an event on the server's process.
|
|
13
|
+
*/
|
|
14
|
+
export interface IDocumentExtractor {
|
|
15
|
+
/** Extract `bytes` as a file of `extension` (lowercased, with its dot). The caller's buffer is left as it was. */
|
|
16
|
+
extract(extension: string, bytes: Buffer): Promise<IsolatedExtraction>;
|
|
17
|
+
/** Ends the workers; an extraction after this is answered `busy`. */
|
|
18
|
+
close(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Why an extraction failed, which is what decides how long the failure is
|
|
22
|
+
* remembered (see `DocExtractService`):
|
|
23
|
+
* - `parser`: the parser refused the bytes, threw, or left a rejection behind
|
|
24
|
+
* it — a property of the content;
|
|
25
|
+
* - `timeout`: the extraction outlived its budget and was stopped;
|
|
26
|
+
* - `crashed`: the worker failed or died under the job without answering
|
|
27
|
+
* (out of memory, a script that would not load), or the parser itself did
|
|
28
|
+
* not load — a fault of the moment;
|
|
29
|
+
* - `busy`: no worker could take the job — nothing was learned about the file.
|
|
30
|
+
*/
|
|
31
|
+
export type ExtractionFailure = 'parser' | 'timeout' | 'crashed' | 'busy';
|
|
32
|
+
export type IsolatedExtraction = ({
|
|
33
|
+
ok: true;
|
|
34
|
+
} & ExtractedDoc) | {
|
|
35
|
+
ok: false;
|
|
36
|
+
message: string;
|
|
37
|
+
failure: ExtractionFailure;
|
|
38
|
+
};
|
|
39
|
+
/** The notice an extraction stopped over its budget answers with. */
|
|
40
|
+
export declare function extractionTimeoutNotice(budgetMs: number): string;
|
|
41
|
+
//# sourceMappingURL=document-extractor.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-extractor.contract.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-extractor.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,kHAAkH;IAClH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvE,qEAAqE;IACrE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1E,MAAM,MAAM,kBAAkB,GAC1B,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG,YAAY,CAAC,GAC7B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAA;CAAE,CAAC;AAE/D,qEAAqE;AACrE,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The notice an extraction stopped over its budget answers with. */
|
|
2
|
+
export function extractionTimeoutNotice(budgetMs) {
|
|
3
|
+
return `could not be read: extracting its text took longer than ${budgetMs / 1000} seconds`;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=document-extractor.contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-extractor.contract.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-extractor.contract.ts"],"names":[],"mappings":"AAsCA,qEAAqE;AACrE,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,2DAA2D,QAAQ,GAAG,IAAI,UAAU,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DocumentExtension } from './document-formats.js';
|
|
2
|
+
import type { ExtractFn } from './doc-extract.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which pure extract function owns which document format. Loaded by the
|
|
5
|
+
* extraction worker only (`extract.worker.ts`): no parser runs on the
|
|
6
|
+
* server's request thread.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DOCUMENT_EXTRACTORS: Readonly<Record<DocumentExtension, ExtractFn>>;
|
|
9
|
+
//# sourceMappingURL=document-extractors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-extractors.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-extractors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAWxD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAU9E,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { extractDocx } from './extract-docx.js';
|
|
2
|
+
import { extractEml } from './extract-eml.js';
|
|
3
|
+
import { extractMsg } from './extract-msg.js';
|
|
4
|
+
import { extractOdp } from './extract-odp.js';
|
|
5
|
+
import { extractOds } from './extract-ods.js';
|
|
6
|
+
import { extractOdt } from './extract-odt.js';
|
|
7
|
+
import { extractPdf } from './extract-pdf.js';
|
|
8
|
+
import { extractPptx } from './extract-pptx.js';
|
|
9
|
+
import { extractXlsx } from './extract-xlsx.js';
|
|
10
|
+
/**
|
|
11
|
+
* Which pure extract function owns which document format. Loaded by the
|
|
12
|
+
* extraction worker only (`extract.worker.ts`): no parser runs on the
|
|
13
|
+
* server's request thread.
|
|
14
|
+
*/
|
|
15
|
+
export const DOCUMENT_EXTRACTORS = {
|
|
16
|
+
'.docx': extractDocx,
|
|
17
|
+
'.pptx': extractPptx,
|
|
18
|
+
'.xlsx': extractXlsx,
|
|
19
|
+
'.pdf': extractPdf,
|
|
20
|
+
'.odt': extractOdt,
|
|
21
|
+
'.odp': extractOdp,
|
|
22
|
+
'.ods': extractOds,
|
|
23
|
+
'.eml': extractEml,
|
|
24
|
+
'.msg': extractMsg,
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=document-extractors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-extractors.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-extractors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAmD;IACjF,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;CACnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document formats whose text is EXTRACTED rather than read: the one list
|
|
3
|
+
* both sides of the extraction worker agree on. The file-reader registry
|
|
4
|
+
* builds a reader for each, on the request thread, without loading a single
|
|
5
|
+
* parser; the worker's table (`document-extractors.ts`) is typed by these
|
|
6
|
+
* lists, so a format added here and not there fails to compile.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OFFICE_DOCUMENT_EXTENSIONS: readonly [".docx", ".pptx", ".xlsx", ".pdf", ".odt", ".odp", ".ods"];
|
|
9
|
+
/** Email files: extracted the same way, refused for writing with an email-honest message (see `EmailReader`). */
|
|
10
|
+
export declare const EMAIL_EXTENSIONS: readonly [".eml", ".msg"];
|
|
11
|
+
export type DocumentExtension = (typeof OFFICE_DOCUMENT_EXTENSIONS)[number] | (typeof EMAIL_EXTENSIONS)[number];
|
|
12
|
+
//# sourceMappingURL=document-formats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-formats.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-formats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,sEAAuE,CAAC;AAE/G,iHAAiH;AACjH,eAAO,MAAM,gBAAgB,2BAA4B,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document formats whose text is EXTRACTED rather than read: the one list
|
|
3
|
+
* both sides of the extraction worker agree on. The file-reader registry
|
|
4
|
+
* builds a reader for each, on the request thread, without loading a single
|
|
5
|
+
* parser; the worker's table (`document-extractors.ts`) is typed by these
|
|
6
|
+
* lists, so a format added here and not there fails to compile.
|
|
7
|
+
*/
|
|
8
|
+
export const OFFICE_DOCUMENT_EXTENSIONS = ['.docx', '.pptx', '.xlsx', '.pdf', '.odt', '.odp', '.ods'];
|
|
9
|
+
/** Email files: extracted the same way, refused for writing with an email-honest message (see `EmailReader`). */
|
|
10
|
+
export const EMAIL_EXTENSIONS = ['.eml', '.msg'];
|
|
11
|
+
//# sourceMappingURL=document-formats.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-formats.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-formats.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAE/G,iHAAiH;AACjH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC"}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import type { DocExtractService } from './doc-extract.service.js';
|
|
2
|
-
import type
|
|
3
|
-
import { type FileReader, type ReadResult } from './file-reader.js';
|
|
2
|
+
import { type FileReader, type ReadOrigin, type ReadResult } from './file-reader.js';
|
|
4
3
|
/**
|
|
5
|
-
* FileReader over one document format: a thin wrapper
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* extraction under its honest `[extracted text of …]` marker; a
|
|
9
|
-
* becomes a refusal message, never a 500.
|
|
4
|
+
* FileReader over one document format: a thin wrapper around the shared
|
|
5
|
+
* content-hash extraction service (`DocExtractService`), which runs the
|
|
6
|
+
* format's extractor in a worker and remembers what it answered. Reads return
|
|
7
|
+
* the extraction under its honest `[extracted text of …]` marker; a failed
|
|
8
|
+
* extraction becomes a refusal message, never a 500.
|
|
10
9
|
*
|
|
11
|
-
* `grep` semantics: `
|
|
12
|
-
* costs one small JSON read)
|
|
13
|
-
*
|
|
14
|
-
* which then extracts through `read`
|
|
15
|
-
* grep also branches on
|
|
10
|
+
* `grep` semantics: `cachedRead` answers only what the cache REMEMBERS (a hit
|
|
11
|
+
* costs one small JSON read) — the extraction, or a failure's notice — and
|
|
12
|
+
* undefined for a cold document; whether to spend grep's per-walk extraction
|
|
13
|
+
* budget on a cold one is the walk's call, which then extracts through `read`
|
|
14
|
+
* (see grepWalk in workspace.tools.ts). grep also branches on
|
|
15
|
+
* `instanceof DocumentReader` for exactly that decision.
|
|
16
16
|
*/
|
|
17
17
|
export declare class DocumentReader implements FileReader {
|
|
18
|
-
private readonly extract;
|
|
19
18
|
private readonly service;
|
|
20
19
|
readonly extensions: readonly string[];
|
|
21
20
|
/**
|
|
@@ -25,10 +24,15 @@ export declare class DocumentReader implements FileReader {
|
|
|
25
24
|
*/
|
|
26
25
|
readonly textEditable = false;
|
|
27
26
|
readonly fileKind: "document";
|
|
28
|
-
constructor(extension: string,
|
|
29
|
-
read
|
|
27
|
+
constructor(extension: string, service: DocExtractService);
|
|
28
|
+
/** `origin` names the workspace the file was read in, so a fresh failure can be reported there. */
|
|
29
|
+
read(bytes: Buffer, path: string, origin?: ReadOrigin): Promise<ReadResult>;
|
|
30
|
+
/**
|
|
31
|
+
* What `read` would answer, from the cache alone — the extraction (marker
|
|
32
|
+
* line included, so grep's line numbers match read_file's) or a remembered
|
|
33
|
+
* failure's refusal — or undefined when the document is cold. Never extracts.
|
|
34
|
+
*/
|
|
35
|
+
cachedRead(bytes: Buffer, path: string): Promise<ReadResult | undefined>;
|
|
30
36
|
mimeFor(path: string): string | undefined;
|
|
31
|
-
/** The cached extraction (marker line included, so grep's line numbers match read_file's), or null when cold. */
|
|
32
|
-
greppableText(bytes: Buffer, path: string): Promise<string | null>;
|
|
33
37
|
}
|
|
34
38
|
//# sourceMappingURL=document-reader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-reader.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"document-reader.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-reader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAwB,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG3G;;;;;;;;;;;;;GAaG;AACH,qBAAa,cAAe,YAAW,UAAU;IAY7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IAX1B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,SAAS;IAC9B,QAAQ,CAAC,QAAQ,EAAG,UAAU,CAAU;gBAGtC,SAAS,EAAE,MAAM,EACA,OAAO,EAAE,iBAAiB;IAK7C,mGAAmG;IAC7F,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAcjF;;;;OAIG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAK9E,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAG1C"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { displayPath, oneLine } from './file-reader.js';
|
|
2
2
|
import { extensionMime } from './text-reader.js';
|
|
3
3
|
/**
|
|
4
|
-
* FileReader over one document format: a thin wrapper
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* extraction under its honest `[extracted text of …]` marker; a
|
|
8
|
-
* becomes a refusal message, never a 500.
|
|
4
|
+
* FileReader over one document format: a thin wrapper around the shared
|
|
5
|
+
* content-hash extraction service (`DocExtractService`), which runs the
|
|
6
|
+
* format's extractor in a worker and remembers what it answered. Reads return
|
|
7
|
+
* the extraction under its honest `[extracted text of …]` marker; a failed
|
|
8
|
+
* extraction becomes a refusal message, never a 500.
|
|
9
9
|
*
|
|
10
|
-
* `grep` semantics: `
|
|
11
|
-
* costs one small JSON read)
|
|
12
|
-
*
|
|
13
|
-
* which then extracts through `read`
|
|
14
|
-
* grep also branches on
|
|
10
|
+
* `grep` semantics: `cachedRead` answers only what the cache REMEMBERS (a hit
|
|
11
|
+
* costs one small JSON read) — the extraction, or a failure's notice — and
|
|
12
|
+
* undefined for a cold document; whether to spend grep's per-walk extraction
|
|
13
|
+
* budget on a cold one is the walk's call, which then extracts through `read`
|
|
14
|
+
* (see grepWalk in workspace.tools.ts). grep also branches on
|
|
15
|
+
* `instanceof DocumentReader` for exactly that decision.
|
|
15
16
|
*/
|
|
16
17
|
export class DocumentReader {
|
|
17
|
-
extract;
|
|
18
18
|
service;
|
|
19
19
|
extensions;
|
|
20
20
|
/**
|
|
@@ -24,41 +24,45 @@ export class DocumentReader {
|
|
|
24
24
|
*/
|
|
25
25
|
textEditable = false;
|
|
26
26
|
fileKind = 'document';
|
|
27
|
-
constructor(extension,
|
|
28
|
-
this.extract = extract;
|
|
27
|
+
constructor(extension, service) {
|
|
29
28
|
this.service = service;
|
|
30
29
|
this.extensions = [extension];
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
31
|
+
/** `origin` names the workspace the file was read in, so a fresh failure can be reported there. */
|
|
32
|
+
async read(bytes, path, origin) {
|
|
33
|
+
// The service answers every parser failure as an outcome; a throw here is
|
|
34
|
+
// the service's own fault (the cache's disk, say) — still answered as the
|
|
35
|
+
// file's honest refusal rather than failing the whole tool call with a 500.
|
|
37
36
|
let res;
|
|
38
37
|
try {
|
|
39
|
-
res = await this.service.extract(path, bytes,
|
|
38
|
+
res = await this.service.extract(path, bytes, origin);
|
|
40
39
|
}
|
|
41
40
|
catch (err) {
|
|
42
41
|
const reason = err instanceof Error ? err.message : String(err);
|
|
43
|
-
|
|
44
|
-
kind: 'refusal',
|
|
45
|
-
message: `[${displayPath(path)} could not be extracted (${oneLine(reason)}) — the file may be corrupt or mislabeled. To fix it, replace the document by uploading a new version.]`,
|
|
46
|
-
};
|
|
42
|
+
res = { ok: false, message: `could not be extracted (${reason})` };
|
|
47
43
|
}
|
|
48
|
-
return res
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
return toReadResult(path, res);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* What `read` would answer, from the cache alone — the extraction (marker
|
|
48
|
+
* line included, so grep's line numbers match read_file's) or a remembered
|
|
49
|
+
* failure's refusal — or undefined when the document is cold. Never extracts.
|
|
50
|
+
*/
|
|
51
|
+
async cachedRead(bytes, path) {
|
|
52
|
+
const hit = await this.service.getCached(path, bytes);
|
|
53
|
+
return hit && toReadResult(path, hit);
|
|
54
54
|
}
|
|
55
55
|
mimeFor(path) {
|
|
56
56
|
return extensionMime(path);
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
}
|
|
59
|
+
/** One outcome, one wording: the same refusal whether the failure is fresh or remembered. */
|
|
60
|
+
function toReadResult(path, res) {
|
|
61
|
+
return res.ok
|
|
62
|
+
? { kind: 'text', text: `${res.marker}\n${res.text}` }
|
|
63
|
+
: {
|
|
64
|
+
kind: 'refusal',
|
|
65
|
+
message: `[${displayPath(path)} ${oneLine(res.message)} — the file may be corrupt or mislabeled. To fix it, replace the document by uploading a new version.]`,
|
|
66
|
+
};
|
|
63
67
|
}
|
|
64
68
|
//# sourceMappingURL=document-reader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-reader.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-reader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-reader.js","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/document-reader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAqD,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAAc;IAYN;IAXV,UAAU,CAAoB;IACvC;;;;OAIG;IACM,YAAY,GAAG,KAAK,CAAC;IACrB,QAAQ,GAAG,UAAmB,CAAC;IAExC,YACE,SAAiB,EACA,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;QAE3C,IAAI,CAAC,UAAU,GAAG,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,mGAAmG;IACnG,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,IAAY,EAAE,MAAmB;QACzD,0EAA0E;QAC1E,0EAA0E;QAC1E,4EAA4E;QAC5E,IAAI,GAAsB,CAAC;QAC3B,IAAI,CAAC;YACH,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,MAAM,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAChE,GAAG,GAAG,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,2BAA2B,MAAM,GAAG,EAAE,CAAC;QACrE,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,KAAa,EAAE,IAAY;QAC1C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CAAC,IAAY;QAClB,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,6FAA6F;AAC7F,SAAS,YAAY,CAAC,IAAY,EAAE,GAAsB;IACxD,OAAO,GAAG,CAAC,EAAE;QACX,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,KAAK,GAAG,CAAC,IAAI,EAAE,EAAE;QACtD,CAAC,CAAC;YACE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,wGAAwG;SAC/J,CAAC;AACR,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type IDocumentExtractor, type IsolatedExtraction } from './document-extractor.contract.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extraction time one document may spend in its worker: the platform's rule,
|
|
4
|
+
* not a deployment's (decided 2026-10-19). A longer wait is too unresponsive
|
|
5
|
+
* for a read or a search; the hour a timeout is remembered for is what keeps a
|
|
6
|
+
* hanging file cheap (see `DocExtractService`).
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXTRACTION_BUDGET_MS = 10000;
|
|
9
|
+
/** What a document answers when its worker failed outside the parser: never the worker's own error. */
|
|
10
|
+
export declare const EXTRACTION_WORKER_FAILED = "could not be read: its extraction failed on the server; try again later";
|
|
11
|
+
/** The worker script: a module that calls `serveExtractions` (see `extraction-worker.ts`). */
|
|
12
|
+
export interface ExtractionWorkerEntry {
|
|
13
|
+
url: URL;
|
|
14
|
+
/** Node options for the worker thread — a TypeScript entry needs its loader. */
|
|
15
|
+
execArgv: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface WorkerDocumentExtractorOptions {
|
|
18
|
+
/** Worker time one extraction may spend. Default {@link EXTRACTION_BUDGET_MS}. */
|
|
19
|
+
budgetMs?: number;
|
|
20
|
+
/** Workers kept for extractions at once; one past this waits for a worker. Default 4. */
|
|
21
|
+
poolMax?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Extractions that may wait for a worker at once. A waiting extraction holds
|
|
24
|
+
* the file's bytes, so the queue is capped: past it an extraction is answered
|
|
25
|
+
* `busy`, and nothing about the file is remembered. Default 32.
|
|
26
|
+
*/
|
|
27
|
+
maxWaiting?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The worker script. Default: the document extractors (`extract.worker`).
|
|
30
|
+
* A composition serving other extractors — a test's misbehaving parser —
|
|
31
|
+
* names its own module calling `serveExtractions`.
|
|
32
|
+
*/
|
|
33
|
+
entry?: ExtractionWorkerEntry;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The one place a document's extractor runs (see {@link IDocumentExtractor}):
|
|
37
|
+
* a pooled worker thread — the extraction worker kind of the shared
|
|
38
|
+
* {@link WorkerPool}, which `grep`'s regex matcher is the other kind of —
|
|
39
|
+
* under a budget per file.
|
|
40
|
+
*
|
|
41
|
+
* The bytes are COPIED once on the request thread and the copy transferred,
|
|
42
|
+
* so the caller's buffer (already hashed for the cache key, and possibly a
|
|
43
|
+
* slice of Node's shared pool) is never detached. Past the budget the worker is
|
|
44
|
+
* terminated, which stops a parser mid-loop, and the file answers the timeout
|
|
45
|
+
* notice. A worker that answers with a dangling rejection, raises, or dies is
|
|
46
|
+
* never reused; the pool replaces it. A rejection the worker cannot pin on
|
|
47
|
+
* this job — it had served another before (see `serveExtractions`) — runs the
|
|
48
|
+
* job again in a fresh worker, so one file's failure is never another's.
|
|
49
|
+
*/
|
|
50
|
+
export declare class WorkerDocumentExtractor implements IDocumentExtractor {
|
|
51
|
+
private readonly budgetMs;
|
|
52
|
+
private readonly pool;
|
|
53
|
+
private nextJob;
|
|
54
|
+
private closing;
|
|
55
|
+
constructor(opts?: WorkerDocumentExtractorOptions);
|
|
56
|
+
extract(extension: string, bytes: Buffer): Promise<IsolatedExtraction>;
|
|
57
|
+
private attempt;
|
|
58
|
+
close(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=extract-in-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-in-worker.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/file-readers/extract-in-worker.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,kCAAkC,CAAC;AAM1C;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C,uGAAuG;AACvG,eAAO,MAAM,wBAAwB,4EAA4E,CAAC;AAElH,8FAA8F;AAC9F,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,GAAG,CAAC;IACT,gFAAgF;IAChF,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,8BAA8B;IAC7C,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yFAAyF;IACzF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,qBAAqB,CAAC;CAC/B;AAED;;;;;;;;;;;;;;GAcG;AACH,qBAAa,uBAAwB,YAAW,kBAAkB;IAChE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAS;gBAEZ,IAAI,GAAE,8BAAmC;IAc/C,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;YAe9D,OAAO;IAkDrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAIvB"}
|