@capybara-hq/kernel 0.0.0-stage → 0.1.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +20 -2
- package/bootstrap.json +22 -0
- package/dist/admin/admin.controller.d.ts +139 -0
- package/dist/admin/admin.controller.js +238 -0
- package/dist/admin/extensions.controller.d.ts +100 -0
- package/dist/admin/extensions.controller.js +226 -0
- package/dist/admin/setup.controller.d.ts +36 -0
- package/dist/admin/setup.controller.js +106 -0
- package/dist/admin/setup.service.d.ts +47 -0
- package/dist/admin/setup.service.js +90 -0
- package/dist/agents/agents.controller.d.ts +205 -0
- package/dist/agents/agents.controller.js +144 -0
- package/dist/agents/agents.service.d.ts +177 -0
- package/dist/agents/agents.service.js +677 -0
- package/dist/agents/definition.d.ts +198 -0
- package/dist/agents/definition.js +152 -0
- package/dist/agents/models.controller.d.ts +13 -0
- package/dist/agents/models.controller.js +31 -0
- package/dist/agents/templates.controller.d.ts +15 -0
- package/dist/agents/templates.controller.js +37 -0
- package/dist/agents/templates.d.ts +83 -0
- package/dist/agents/templates.js +173 -0
- package/dist/catalog/admin-catalog.controller.d.ts +143 -0
- package/dist/catalog/admin-catalog.controller.js +245 -0
- package/dist/catalog/catalog.service.d.ts +430 -0
- package/dist/catalog/catalog.service.js +882 -0
- package/dist/catalog/claude/agents.d.ts +27 -0
- package/dist/catalog/claude/agents.js +270 -0
- package/dist/catalog/claude/commands.d.ts +50 -0
- package/dist/catalog/claude/commands.js +179 -0
- package/dist/catalog/claude/manifest.d.ts +69 -0
- package/dist/catalog/claude/manifest.js +134 -0
- package/dist/catalog/claude/marketplace.d.ts +35 -0
- package/dist/catalog/claude/marketplace.js +194 -0
- package/dist/catalog/claude/mcp.d.ts +33 -0
- package/dist/catalog/claude/mcp.js +226 -0
- package/dist/catalog/claude/report.d.ts +86 -0
- package/dist/catalog/claude/report.js +121 -0
- package/dist/catalog/claude/translate.d.ts +56 -0
- package/dist/catalog/claude/translate.js +857 -0
- package/dist/catalog/cli.d.ts +46 -0
- package/dist/catalog/cli.js +211 -0
- package/dist/catalog/git-source.d.ts +127 -0
- package/dist/catalog/git-source.js +520 -0
- package/dist/catalog/marketplace-fetch.d.ts +99 -0
- package/dist/catalog/marketplace-fetch.js +203 -0
- package/dist/catalog/marketplaces.controller.d.ts +97 -0
- package/dist/catalog/marketplaces.controller.js +197 -0
- package/dist/catalog/marketplaces.service.d.ts +340 -0
- package/dist/catalog/marketplaces.service.js +1217 -0
- package/dist/catalog/org-catalog.controller.d.ts +128 -0
- package/dist/catalog/org-catalog.controller.js +277 -0
- package/dist/catalog/org-catalog.service.d.ts +246 -0
- package/dist/catalog/org-catalog.service.js +625 -0
- package/dist/catalog/plugin-import.d.ts +436 -0
- package/dist/catalog/plugin-import.js +1069 -0
- package/dist/catalog/plugin-install.d.ts +447 -0
- package/dist/catalog/plugin-install.js +1333 -0
- package/dist/catalog/plugin-package.d.ts +143 -0
- package/dist/catalog/plugin-package.js +382 -0
- package/dist/catalog/plugin-upgrade.d.ts +222 -0
- package/dist/catalog/plugin-upgrade.js +1219 -0
- package/dist/catalog/requests.service.d.ts +162 -0
- package/dist/catalog/requests.service.js +504 -0
- package/dist/catalog/schema-path.d.ts +7 -0
- package/dist/catalog/schema-path.js +63 -0
- package/dist/catalog/upgrade-targets.d.ts +59 -0
- package/dist/catalog/upgrade-targets.js +90 -0
- package/dist/catalog/versions.d.ts +31 -0
- package/dist/catalog/versions.js +44 -0
- package/dist/channels/actions.d.ts +37 -0
- package/dist/channels/actions.js +121 -0
- package/dist/channels/cards.d.ts +44 -0
- package/dist/channels/cards.js +156 -0
- package/dist/channels/connections.controller.d.ts +59 -0
- package/dist/channels/connections.controller.js +115 -0
- package/dist/channels/connections.service.d.ts +187 -0
- package/dist/channels/connections.service.js +534 -0
- package/dist/channels/features.d.ts +12 -0
- package/dist/channels/features.js +22 -0
- package/dist/channels/inbound.d.ts +120 -0
- package/dist/channels/inbound.js +332 -0
- package/dist/channels/outbound.d.ts +140 -0
- package/dist/channels/outbound.js +1125 -0
- package/dist/channels/phrases.d.ts +100 -0
- package/dist/channels/phrases.js +81 -0
- package/dist/channels/supervisor.d.ts +182 -0
- package/dist/channels/supervisor.js +625 -0
- package/dist/channels/threads.d.ts +29 -0
- package/dist/channels/threads.js +104 -0
- package/dist/channels/webhook-url.d.ts +16 -0
- package/dist/channels/webhook-url.js +34 -0
- package/dist/channels/webhook.controller.d.ts +19 -0
- package/dist/channels/webhook.controller.js +72 -0
- package/dist/channels/webhook.d.ts +73 -0
- package/dist/channels/webhook.js +274 -0
- package/dist/config/docs.d.ts +9 -0
- package/dist/config/docs.js +85 -0
- package/dist/config/env.d.ts +6 -0
- package/dist/config/env.js +73 -0
- package/dist/config/fields.d.ts +42 -0
- package/dist/config/fields.js +214 -0
- package/dist/config/file-source.d.ts +3 -0
- package/dist/config/file-source.js +31 -0
- package/dist/config/load.d.ts +20 -0
- package/dist/config/load.js +98 -0
- package/dist/config/nacos-source.d.ts +31 -0
- package/dist/config/nacos-source.js +229 -0
- package/dist/config/schema.d.ts +223 -0
- package/dist/config/schema.js +1151 -0
- package/dist/config/sources.d.ts +18 -0
- package/dist/config/sources.js +59 -0
- package/dist/config/types.d.ts +9 -0
- package/dist/config/types.js +7 -0
- package/dist/conversations/artifacts.d.ts +52 -0
- package/dist/conversations/artifacts.js +137 -0
- package/dist/conversations/attachments.controller.d.ts +28 -0
- package/dist/conversations/attachments.controller.js +96 -0
- package/dist/conversations/attachments.service.d.ts +180 -0
- package/dist/conversations/attachments.service.js +578 -0
- package/dist/conversations/conversations.controller.d.ts +288 -0
- package/dist/conversations/conversations.controller.js +607 -0
- package/dist/conversations/conversations.service.d.ts +321 -0
- package/dist/conversations/conversations.service.js +754 -0
- package/dist/conversations/event-log.d.ts +122 -0
- package/dist/conversations/event-log.js +259 -0
- package/dist/conversations/events.d.ts +856 -0
- package/dist/conversations/events.js +639 -0
- package/dist/conversations/files.d.ts +92 -0
- package/dist/conversations/files.js +213 -0
- package/dist/conversations/outputs-read.d.ts +34 -0
- package/dist/conversations/outputs-read.js +37 -0
- package/dist/conversations/queue.d.ts +169 -0
- package/dist/conversations/queue.js +527 -0
- package/dist/conversations/sandbox-status.d.ts +21 -0
- package/dist/conversations/sandbox-status.js +24 -0
- package/dist/conversations/selection.d.ts +46 -0
- package/dist/conversations/selection.js +75 -0
- package/dist/conversations/titles.d.ts +93 -0
- package/dist/conversations/titles.js +422 -0
- package/dist/ctx/bus.d.ts +16 -0
- package/dist/ctx/bus.js +101 -0
- package/dist/ctx/create-ctx.d.ts +109 -0
- package/dist/ctx/create-ctx.js +592 -0
- package/dist/ctx/kv.d.ts +4 -0
- package/dist/ctx/kv.js +31 -0
- package/dist/ctx/lock.d.ts +4 -0
- package/dist/ctx/lock.js +39 -0
- package/dist/ctx/namespace.d.ts +6 -0
- package/dist/ctx/namespace.js +12 -0
- package/dist/ctx/queue.d.ts +25 -0
- package/dist/ctx/queue.js +150 -0
- package/dist/ctx/secrets.d.ts +45 -0
- package/dist/ctx/secrets.js +175 -0
- package/dist/db/kernel-schema.d.ts +1122 -0
- package/dist/db/kernel-schema.js +5 -0
- package/dist/db/migrator.d.ts +28 -0
- package/dist/db/migrator.js +140 -0
- package/dist/db/pool.d.ts +21 -0
- package/dist/db/pool.js +28 -0
- package/dist/db/sql-statements.d.ts +34 -0
- package/dist/db/sql-statements.js +168 -0
- package/dist/errors.d.ts +210 -0
- package/dist/errors.js +212 -0
- package/dist/evals/budget.d.ts +61 -0
- package/dist/evals/budget.js +181 -0
- package/dist/evals/diff.d.ts +55 -0
- package/dist/evals/diff.js +133 -0
- package/dist/evals/judge.d.ts +53 -0
- package/dist/evals/judge.js +149 -0
- package/dist/evals/plan.d.ts +47 -0
- package/dist/evals/plan.js +77 -0
- package/dist/evals/reconstruct.d.ts +137 -0
- package/dist/evals/reconstruct.js +322 -0
- package/dist/evals/recorded-tools.d.ts +54 -0
- package/dist/evals/recorded-tools.js +167 -0
- package/dist/evals/run-replay.d.ts +86 -0
- package/dist/evals/run-replay.js +502 -0
- package/dist/evals/runs.controller.d.ts +100 -0
- package/dist/evals/runs.controller.js +199 -0
- package/dist/evals/runs.service.d.ts +275 -0
- package/dist/evals/runs.service.js +836 -0
- package/dist/evals/sets.controller.d.ts +61 -0
- package/dist/evals/sets.controller.js +183 -0
- package/dist/evals/sets.service.d.ts +128 -0
- package/dist/evals/sets.service.js +558 -0
- package/dist/evals/snapshot.d.ts +76 -0
- package/dist/evals/snapshot.js +207 -0
- package/dist/evals/step-replay.d.ts +113 -0
- package/dist/evals/step-replay.js +181 -0
- package/dist/evals/trajectory.controller.d.ts +41 -0
- package/dist/evals/trajectory.controller.js +88 -0
- package/dist/evals/trajectory.d.ts +144 -0
- package/dist/evals/trajectory.js +338 -0
- package/dist/evals/trajectory.service.d.ts +108 -0
- package/dist/evals/trajectory.service.js +323 -0
- package/dist/evals/worker.d.ts +101 -0
- package/dist/evals/worker.js +789 -0
- package/dist/extensions/admin-ops.d.ts +105 -0
- package/dist/extensions/admin-ops.js +353 -0
- package/dist/extensions/admin-view.d.ts +79 -0
- package/dist/extensions/admin-view.js +327 -0
- package/dist/extensions/approvals.d.ts +119 -0
- package/dist/extensions/approvals.js +205 -0
- package/dist/extensions/blobs.d.ts +45 -0
- package/dist/extensions/blobs.js +160 -0
- package/dist/extensions/bootstrap.d.ts +149 -0
- package/dist/extensions/bootstrap.js +441 -0
- package/dist/extensions/cli.d.ts +61 -0
- package/dist/extensions/cli.js +165 -0
- package/dist/extensions/config-json-schema.d.ts +9 -0
- package/dist/extensions/config-json-schema.js +73 -0
- package/dist/extensions/deployment-config.d.ts +138 -0
- package/dist/extensions/deployment-config.js +394 -0
- package/dist/extensions/enabled.d.ts +31 -0
- package/dist/extensions/enabled.js +55 -0
- package/dist/extensions/hooks.d.ts +161 -0
- package/dist/extensions/hooks.js +425 -0
- package/dist/extensions/host.d.ts +577 -0
- package/dist/extensions/host.js +2071 -0
- package/dist/extensions/inflight.d.ts +69 -0
- package/dist/extensions/inflight.js +277 -0
- package/dist/extensions/installs.d.ts +166 -0
- package/dist/extensions/installs.js +253 -0
- package/dist/extensions/instance.d.ts +167 -0
- package/dist/extensions/instance.js +329 -0
- package/dist/extensions/ledger.d.ts +30 -0
- package/dist/extensions/ledger.js +50 -0
- package/dist/extensions/lifecycle.d.ts +80 -0
- package/dist/extensions/lifecycle.js +152 -0
- package/dist/extensions/migrate-lock.d.ts +51 -0
- package/dist/extensions/migrate-lock.js +100 -0
- package/dist/extensions/org-config.controller.d.ts +24 -0
- package/dist/extensions/org-config.controller.js +59 -0
- package/dist/extensions/org-config.d.ts +169 -0
- package/dist/extensions/org-config.js +520 -0
- package/dist/extensions/package.d.ts +115 -0
- package/dist/extensions/package.js +246 -0
- package/dist/extensions/permission-set.d.ts +117 -0
- package/dist/extensions/permission-set.js +184 -0
- package/dist/extensions/permission-view.d.ts +194 -0
- package/dist/extensions/permission-view.js +284 -0
- package/dist/extensions/registry.d.ts +24 -0
- package/dist/extensions/registry.js +56 -0
- package/dist/extensions/resolve.d.ts +12 -0
- package/dist/extensions/resolve.js +71 -0
- package/dist/extensions/sources.d.ts +69 -0
- package/dist/extensions/sources.js +120 -0
- package/dist/extensions/sync.d.ts +40 -0
- package/dist/extensions/sync.js +242 -0
- package/dist/files/previewers.controller.d.ts +46 -0
- package/dist/files/previewers.controller.js +105 -0
- package/dist/files/previewers.d.ts +100 -0
- package/dist/files/previewers.js +250 -0
- package/dist/http/api.module.d.ts +114 -0
- package/dist/http/api.module.js +448 -0
- package/dist/http/app.d.ts +77 -0
- package/dist/http/app.js +170 -0
- package/dist/http/error.filter.d.ts +21 -0
- package/dist/http/error.filter.js +85 -0
- package/dist/http/gateway.module.d.ts +15 -0
- package/dist/http/gateway.module.js +13 -0
- package/dist/http/health.controller.d.ts +26 -0
- package/dist/http/health.controller.js +79 -0
- package/dist/http/nest-logger.d.ts +20 -0
- package/dist/http/nest-logger.js +28 -0
- package/dist/http/plugin-dispatch.d.ts +68 -0
- package/dist/http/plugin-dispatch.js +200 -0
- package/dist/http/tokens.d.ts +131 -0
- package/dist/http/tokens.js +131 -0
- package/dist/http/zod.pipe.d.ts +8 -0
- package/dist/http/zod.pipe.js +14 -0
- package/dist/identity/accounts.d.ts +93 -0
- package/dist/identity/accounts.js +367 -0
- package/dist/identity/api-tokens.d.ts +73 -0
- package/dist/identity/api-tokens.js +197 -0
- package/dist/identity/audit.d.ts +23 -0
- package/dist/identity/audit.js +41 -0
- package/dist/identity/auth.controller.d.ts +40 -0
- package/dist/identity/auth.controller.js +130 -0
- package/dist/identity/auth.guard.d.ts +41 -0
- package/dist/identity/auth.guard.js +162 -0
- package/dist/identity/binding.d.ts +47 -0
- package/dist/identity/binding.js +84 -0
- package/dist/identity/cookies.d.ts +16 -0
- package/dist/identity/cookies.js +32 -0
- package/dist/identity/credential-check.d.ts +17 -0
- package/dist/identity/credential-check.js +24 -0
- package/dist/identity/enterprise-admin.d.ts +14 -0
- package/dist/identity/enterprise-admin.js +27 -0
- package/dist/identity/external.d.ts +106 -0
- package/dist/identity/external.js +337 -0
- package/dist/identity/hash.d.ts +2 -0
- package/dist/identity/hash.js +3 -0
- package/dist/identity/login.d.ts +6 -0
- package/dist/identity/login.js +20 -0
- package/dist/identity/me.controller.d.ts +61 -0
- package/dist/identity/me.controller.js +159 -0
- package/dist/identity/passwords.d.ts +6 -0
- package/dist/identity/passwords.js +37 -0
- package/dist/identity/principal.d.ts +56 -0
- package/dist/identity/principal.js +38 -0
- package/dist/identity/rate-limit.d.ts +55 -0
- package/dist/identity/rate-limit.js +121 -0
- package/dist/identity/sessions.d.ts +84 -0
- package/dist/identity/sessions.js +306 -0
- package/dist/identity/settings.d.ts +121 -0
- package/dist/identity/settings.js +248 -0
- package/dist/identity/sso.controller.d.ts +59 -0
- package/dist/identity/sso.controller.js +192 -0
- package/dist/identity/sso.d.ts +83 -0
- package/dist/identity/sso.js +202 -0
- package/dist/inbox/inbox.service.d.ts +43 -0
- package/dist/inbox/inbox.service.js +57 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +65 -0
- package/dist/kernel.d.ts +256 -0
- package/dist/kernel.js +1326 -0
- package/dist/log.d.ts +48 -0
- package/dist/log.js +229 -0
- package/dist/models/prices.d.ts +53 -0
- package/dist/models/prices.js +121 -0
- package/dist/models/purposes.controller.d.ts +19 -0
- package/dist/models/purposes.controller.js +56 -0
- package/dist/models/purposes.d.ts +140 -0
- package/dist/models/purposes.js +267 -0
- package/dist/net/proxy.d.ts +44 -0
- package/dist/net/proxy.js +162 -0
- package/dist/net/public-address.d.ts +60 -0
- package/dist/net/public-address.js +271 -0
- package/dist/net/safe-fetch.d.ts +38 -0
- package/dist/net/safe-fetch.js +140 -0
- package/dist/orgs/directory-sync.controller.d.ts +14 -0
- package/dist/orgs/directory-sync.controller.js +40 -0
- package/dist/orgs/directory-sync.d.ts +166 -0
- package/dist/orgs/directory-sync.js +558 -0
- package/dist/orgs/invitations.controller.d.ts +58 -0
- package/dist/orgs/invitations.controller.js +137 -0
- package/dist/orgs/invitations.service.d.ts +80 -0
- package/dist/orgs/invitations.service.js +217 -0
- package/dist/orgs/members.service.d.ts +63 -0
- package/dist/orgs/members.service.js +234 -0
- package/dist/orgs/offboarding.d.ts +141 -0
- package/dist/orgs/offboarding.js +398 -0
- package/dist/orgs/org-lock.d.ts +32 -0
- package/dist/orgs/org-lock.js +46 -0
- package/dist/orgs/org.guard.d.ts +35 -0
- package/dist/orgs/org.guard.js +95 -0
- package/dist/orgs/orgs.controller.d.ts +78 -0
- package/dist/orgs/orgs.controller.js +192 -0
- package/dist/orgs/orgs.service.d.ts +61 -0
- package/dist/orgs/orgs.service.js +209 -0
- package/dist/orgs/roles.d.ts +13 -0
- package/dist/orgs/roles.js +58 -0
- package/dist/orgs/settings.controller.d.ts +20 -0
- package/dist/orgs/settings.controller.js +53 -0
- package/dist/orgs/settings.service.d.ts +120 -0
- package/dist/orgs/settings.service.js +178 -0
- package/dist/packages/npm.d.ts +50 -0
- package/dist/packages/npm.js +218 -0
- package/dist/packages/provenance.d.ts +47 -0
- package/dist/packages/provenance.js +147 -0
- package/dist/packages/tgz.d.ts +76 -0
- package/dist/packages/tgz.js +225 -0
- package/dist/runtime/abort.d.ts +32 -0
- package/dist/runtime/abort.js +71 -0
- package/dist/runtime/checkpointer.d.ts +32 -0
- package/dist/runtime/checkpointer.js +243 -0
- package/dist/runtime/context/build.d.ts +254 -0
- package/dist/runtime/context/build.js +693 -0
- package/dist/runtime/context/claude-tools.d.ts +11 -0
- package/dist/runtime/context/claude-tools.js +24 -0
- package/dist/runtime/context/compaction.d.ts +26 -0
- package/dist/runtime/context/compaction.js +195 -0
- package/dist/runtime/context/pairing.d.ts +11 -0
- package/dist/runtime/context/pairing.js +82 -0
- package/dist/runtime/context/reminders.d.ts +5 -0
- package/dist/runtime/context/reminders.js +11 -0
- package/dist/runtime/context/skills.d.ts +105 -0
- package/dist/runtime/context/skills.js +283 -0
- package/dist/runtime/context/tokens.d.ts +19 -0
- package/dist/runtime/context/tokens.js +104 -0
- package/dist/runtime/conversation-lock.d.ts +40 -0
- package/dist/runtime/conversation-lock.js +97 -0
- package/dist/runtime/hook-calls.d.ts +84 -0
- package/dist/runtime/hook-calls.js +136 -0
- package/dist/runtime/langgraph-loop.d.ts +52 -0
- package/dist/runtime/langgraph-loop.js +247 -0
- package/dist/runtime/loop.d.ts +93 -0
- package/dist/runtime/loop.js +7 -0
- package/dist/runtime/maintenance.d.ts +80 -0
- package/dist/runtime/maintenance.js +147 -0
- package/dist/runtime/media-cache.d.ts +21 -0
- package/dist/runtime/media-cache.js +51 -0
- package/dist/runtime/model-call.d.ts +176 -0
- package/dist/runtime/model-call.js +1049 -0
- package/dist/runtime/providers.d.ts +86 -0
- package/dist/runtime/providers.js +224 -0
- package/dist/runtime/quota.d.ts +29 -0
- package/dist/runtime/quota.js +70 -0
- package/dist/runtime/run-finish.d.ts +45 -0
- package/dist/runtime/run-finish.js +69 -0
- package/dist/runtime/run-queue.d.ts +121 -0
- package/dist/runtime/run-queue.js +493 -0
- package/dist/runtime/run-worker.d.ts +138 -0
- package/dist/runtime/run-worker.js +805 -0
- package/dist/runtime/stream.controller.d.ts +34 -0
- package/dist/runtime/stream.controller.js +122 -0
- package/dist/runtime/stream.d.ts +63 -0
- package/dist/runtime/stream.js +262 -0
- package/dist/runtime/subagents/child.d.ts +80 -0
- package/dist/runtime/subagents/child.js +225 -0
- package/dist/runtime/subagents/definition.d.ts +103 -0
- package/dist/runtime/subagents/definition.js +392 -0
- package/dist/runtime/subagents/dispatch.d.ts +69 -0
- package/dist/runtime/subagents/dispatch.js +502 -0
- package/dist/runtime/subagents/limits.d.ts +23 -0
- package/dist/runtime/subagents/limits.js +34 -0
- package/dist/runtime/subagents/org-agents.d.ts +50 -0
- package/dist/runtime/subagents/org-agents.js +70 -0
- package/dist/runtime/subagents/preamble.d.ts +7 -0
- package/dist/runtime/subagents/preamble.js +11 -0
- package/dist/runtime/subagents/progress.d.ts +26 -0
- package/dist/runtime/subagents/progress.js +36 -0
- package/dist/runtime/subagents/roster.d.ts +55 -0
- package/dist/runtime/subagents/roster.js +111 -0
- package/dist/runtime/subagents/skill-fork.d.ts +123 -0
- package/dist/runtime/subagents/skill-fork.js +259 -0
- package/dist/runtime/usage-report.d.ts +163 -0
- package/dist/runtime/usage-report.js +550 -0
- package/dist/runtime/waits.d.ts +233 -0
- package/dist/runtime/waits.js +883 -0
- package/dist/sandbox/leases.d.ts +169 -0
- package/dist/sandbox/leases.js +515 -0
- package/dist/sandbox/lifecycle.d.ts +21 -0
- package/dist/sandbox/lifecycle.js +68 -0
- package/dist/sandbox/sandbox.service.d.ts +249 -0
- package/dist/sandbox/sandbox.service.js +908 -0
- package/dist/skills/catalog.d.ts +149 -0
- package/dist/skills/catalog.js +405 -0
- package/dist/skills/changes.controller.d.ts +56 -0
- package/dist/skills/changes.controller.js +136 -0
- package/dist/skills/changes.service.d.ts +175 -0
- package/dist/skills/changes.service.js +805 -0
- package/dist/skills/invocable.controller.d.ts +23 -0
- package/dist/skills/invocable.controller.js +50 -0
- package/dist/skills/invocation-keys.d.ts +23 -0
- package/dist/skills/invocation-keys.js +44 -0
- package/dist/skills/invoke.d.ts +135 -0
- package/dist/skills/invoke.js +286 -0
- package/dist/skills/package.d.ts +87 -0
- package/dist/skills/package.js +227 -0
- package/dist/skills/skills.controller.d.ts +40 -0
- package/dist/skills/skills.controller.js +110 -0
- package/dist/skills/skills.service.d.ts +192 -0
- package/dist/skills/skills.service.js +567 -0
- package/dist/storage/prefix.d.ts +36 -0
- package/dist/storage/prefix.js +104 -0
- package/dist/storage/purge.d.ts +27 -0
- package/dist/storage/purge.js +75 -0
- package/dist/storage/storage.service.d.ts +44 -0
- package/dist/storage/storage.service.js +145 -0
- package/dist/text.d.ts +13 -0
- package/dist/text.js +13 -0
- package/dist/tools/approvals.controller.d.ts +53 -0
- package/dist/tools/approvals.controller.js +128 -0
- package/dist/tools/approvals.service.d.ts +172 -0
- package/dist/tools/approvals.service.js +568 -0
- package/dist/tools/breaker.d.ts +28 -0
- package/dist/tools/breaker.js +72 -0
- package/dist/tools/builtins/agent.d.ts +81 -0
- package/dist/tools/builtins/agent.js +223 -0
- package/dist/tools/builtins/ask-user.d.ts +28 -0
- package/dist/tools/builtins/ask-user.js +139 -0
- package/dist/tools/builtins/read-tool-output.d.ts +18 -0
- package/dist/tools/builtins/read-tool-output.js +108 -0
- package/dist/tools/builtins/sandbox/bash.d.ts +16 -0
- package/dist/tools/builtins/sandbox/bash.js +137 -0
- package/dist/tools/builtins/sandbox/common.d.ts +114 -0
- package/dist/tools/builtins/sandbox/common.js +304 -0
- package/dist/tools/builtins/sandbox/deliver.d.ts +5 -0
- package/dist/tools/builtins/sandbox/deliver.js +180 -0
- package/dist/tools/builtins/sandbox/edit.d.ts +4 -0
- package/dist/tools/builtins/sandbox/edit.js +98 -0
- package/dist/tools/builtins/sandbox/glob-match.d.ts +25 -0
- package/dist/tools/builtins/sandbox/glob-match.js +240 -0
- package/dist/tools/builtins/sandbox/glob.d.ts +4 -0
- package/dist/tools/builtins/sandbox/glob.js +104 -0
- package/dist/tools/builtins/sandbox/grep.d.ts +9 -0
- package/dist/tools/builtins/sandbox/grep.js +133 -0
- package/dist/tools/builtins/sandbox/index.d.ts +12 -0
- package/dist/tools/builtins/sandbox/index.js +27 -0
- package/dist/tools/builtins/sandbox/names.d.ts +7 -0
- package/dist/tools/builtins/sandbox/names.js +20 -0
- package/dist/tools/builtins/sandbox/read.d.ts +8 -0
- package/dist/tools/builtins/sandbox/read.js +121 -0
- package/dist/tools/builtins/sandbox/write.d.ts +4 -0
- package/dist/tools/builtins/sandbox/write.js +88 -0
- package/dist/tools/builtins/skill-load.d.ts +53 -0
- package/dist/tools/builtins/skill-load.js +446 -0
- package/dist/tools/builtins/skill-write.d.ts +59 -0
- package/dist/tools/builtins/skill-write.js +244 -0
- package/dist/tools/builtins/tool-search.d.ts +31 -0
- package/dist/tools/builtins/tool-search.js +171 -0
- package/dist/tools/connector-content.controller.d.ts +34 -0
- package/dist/tools/connector-content.controller.js +78 -0
- package/dist/tools/connector-content.d.ts +104 -0
- package/dist/tools/connector-content.js +267 -0
- package/dist/tools/connectors.controller.d.ts +210 -0
- package/dist/tools/connectors.controller.js +234 -0
- package/dist/tools/connectors.service.d.ts +303 -0
- package/dist/tools/connectors.service.js +1102 -0
- package/dist/tools/credentials.d.ts +139 -0
- package/dist/tools/credentials.js +351 -0
- package/dist/tools/drift.d.ts +141 -0
- package/dist/tools/drift.js +539 -0
- package/dist/tools/elicitation.d.ts +81 -0
- package/dist/tools/elicitation.js +266 -0
- package/dist/tools/endpoint.d.ts +18 -0
- package/dist/tools/endpoint.js +115 -0
- package/dist/tools/info.d.ts +67 -0
- package/dist/tools/info.js +113 -0
- package/dist/tools/naming.d.ts +27 -0
- package/dist/tools/naming.js +47 -0
- package/dist/tools/oauth/discovery.d.ts +65 -0
- package/dist/tools/oauth/discovery.js +307 -0
- package/dist/tools/oauth/flow.d.ts +63 -0
- package/dist/tools/oauth/flow.js +237 -0
- package/dist/tools/oauth/oauth.controller.d.ts +31 -0
- package/dist/tools/oauth/oauth.controller.js +95 -0
- package/dist/tools/oauth/tokens.d.ts +111 -0
- package/dist/tools/oauth/tokens.js +258 -0
- package/dist/tools/outputs.d.ts +61 -0
- package/dist/tools/outputs.js +156 -0
- package/dist/tools/pipeline.d.ts +322 -0
- package/dist/tools/pipeline.js +1236 -0
- package/dist/tools/policy.d.ts +60 -0
- package/dist/tools/policy.js +236 -0
- package/dist/tools/questions.controller.d.ts +24 -0
- package/dist/tools/questions.controller.js +58 -0
- package/dist/tools/questions.service.d.ts +103 -0
- package/dist/tools/questions.service.js +295 -0
- package/dist/tools/redact.d.ts +20 -0
- package/dist/tools/redact.js +60 -0
- package/dist/tools/registry.d.ts +246 -0
- package/dist/tools/registry.js +481 -0
- package/dist/tools/resources.d.ts +16 -0
- package/dist/tools/resources.js +76 -0
- package/dist/tools/specs.d.ts +14 -0
- package/dist/tools/specs.js +31 -0
- package/dist/tools/validate.d.ts +20 -0
- package/dist/tools/validate.js +183 -0
- package/dist/tools/view.d.ts +43 -0
- package/dist/tools/view.js +225 -0
- package/dist/ui/embed-token.d.ts +31 -0
- package/dist/ui/embed-token.js +132 -0
- package/dist/ui/registry.d.ts +58 -0
- package/dist/ui/registry.js +90 -0
- package/dist/ui/ui-stream.d.ts +37 -0
- package/dist/ui/ui-stream.js +162 -0
- package/dist/ui/views.controller.d.ts +81 -0
- package/dist/ui/views.controller.js +261 -0
- package/dist/ui/views.d.ts +155 -0
- package/dist/ui/views.js +306 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.js +6 -0
- package/package.json +67 -3
- package/src/migrations/0001_init.sql +8 -0
- package/src/migrations/0002_secrets.sql +8 -0
- package/src/migrations/0003_identity.sql +117 -0
- package/src/migrations/0004_plugin_org_config_nullable.sql +3 -0
- package/src/migrations/0005_agents.sql +27 -0
- package/src/migrations/0006_conversations.sql +37 -0
- package/src/migrations/0007_checkpoints.sql +26 -0
- package/src/migrations/0008_runs_trigger_seq.sql +3 -0
- package/src/migrations/0009_runs_active_unique.sql +4 -0
- package/src/migrations/0010_tools.sql +125 -0
- package/src/migrations/0011_approvals_spec.sql +10 -0
- package/src/migrations/0012_run_waits.sql +24 -0
- package/src/migrations/0013_app_tools_source.sql +4 -0
- package/src/migrations/0014_tool_specs.sql +8 -0
- package/src/migrations/0015_tool_drift.sql +20 -0
- package/src/migrations/0016_plugin_permissions.sql +11 -0
- package/src/migrations/0017_identity_sources.sql +6 -0
- package/src/migrations/0018_channels.sql +74 -0
- package/src/migrations/0019_identity_trust.sql +17 -0
- package/src/migrations/0020_channel_card_lookup.sql +10 -0
- package/src/migrations/0021_org_storage_purge.sql +9 -0
- package/src/migrations/0022_attachments.sql +29 -0
- package/src/migrations/0023_sandboxes.sql +37 -0
- package/src/migrations/0024_skills.sql +46 -0
- package/src/migrations/0025_skills_catalog_idx.sql +6 -0
- package/src/migrations/0026_skill_changes.sql +34 -0
- package/src/migrations/0027_model_prices.sql +18 -0
- package/src/migrations/0028_evals.sql +105 -0
- package/src/migrations/0029_model_purposes.sql +18 -0
- package/src/migrations/0030_plugin_installs.sql +73 -0
- package/src/migrations/0031_plugin_snapshot_source.sql +6 -0
- package/src/migrations/0032_plugin_deployment_configs.sql +10 -0
- package/src/migrations/0033_rename_apps_to_connectors.sql +25 -0
- package/src/migrations/0034_directory.sql +49 -0
- package/src/migrations/0035_catalogs.sql +40 -0
- package/src/migrations/0036_app_import_staging.sql +17 -0
- package/src/migrations/0037_directory_installs.sql +92 -0
- package/src/migrations/0038_channel_inbound_mode.sql +6 -0
- package/src/migrations/0039_channel_card_pending.sql +8 -0
- package/src/migrations/0040_usage_report_sweep.sql +10 -0
- package/src/migrations/0041_rename_plugins_to_extensions.sql +38 -0
- package/src/migrations/0042_rename_directory_to_catalog.sql +80 -0
- package/src/migrations/0043_rename_app_installs_to_plugin_installs.sql +20 -0
- package/src/migrations/0044_catalog_one_kind.sql +90 -0
- package/src/migrations/0045_plugin_dependencies.sql +9 -0
- package/src/migrations/0046_git_sources.sql +25 -0
- package/src/migrations/0047_marketplace_entry_heads.sql +7 -0
- package/src/migrations/0048_marketplace_entry_trees.sql +8 -0
- package/src/migrations/0049_plugin_upgrades.sql +37 -0
- package/src/migrations/0050_bootstrap.sql +53 -0
- package/src/migrations/0051_claude_compat.sql +26 -0
- package/src/migrations/0052_conversations_account_agent_idx.sql +5 -0
- package/src/migrations/0053_subagents.sql +73 -0
- package/src/migrations/0054_subagent_wait_expiry.sql +7 -0
- package/src/migrations/0055_subagent_parent_indexes.sql +10 -0
- package/src/migrations/0056_approval_reason.sql +3 -0
- package/src/migrations/0057_conversation_titles.sql +11 -0
- package/src/migrations/0058_conversation_selection.sql +4 -0
- package/src/migrations/0059_conversation_queue.sql +22 -0
- package/src/migrations/0060_file_previewers.sql +10 -0
- package/src/migrations/0061_queue_selection.sql +5 -0
- package/src/migrations/0062_queued_skill.sql +8 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const NO_SELECTION = { model: null, effort: null };
|
|
2
|
+
export const sameModel = (a, b) => a.provider === b.provider && a.model === b.model;
|
|
3
|
+
export const sameSelection = (a, b) => a.effort === b.effort &&
|
|
4
|
+
(a.model === null || b.model === null ? a.model === b.model : sameModel(a.model, b.model));
|
|
5
|
+
/**
|
|
6
|
+
* The selection a message's pick switches to, or null when it changes nothing (pure; the direct
|
|
7
|
+
* send and queue dispatch share it). A model equal to the agent's means "back to the agent's
|
|
8
|
+
* model" (null); a model change without `effort` resets the effort.
|
|
9
|
+
*/
|
|
10
|
+
export function planSelection(agentModel, current, pick) {
|
|
11
|
+
if (pick.model === undefined && pick.effort === undefined)
|
|
12
|
+
return null;
|
|
13
|
+
const model = pick.model === undefined
|
|
14
|
+
? current.model
|
|
15
|
+
: sameModel(pick.model, agentModel)
|
|
16
|
+
? null
|
|
17
|
+
: { provider: pick.model.provider, model: pick.model.model };
|
|
18
|
+
const modelChanged = !sameSelection({ model, effort: null }, { model: current.model, effort: null });
|
|
19
|
+
const effort = pick.effort ?? (modelChanged ? null : current.effort);
|
|
20
|
+
const next = { model, effort };
|
|
21
|
+
return sameSelection(next, current) ? null : next;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The selection in effect for a run that started at `seq` (its `run_started`): the latest
|
|
25
|
+
* `model_switched` before it. Runtime and replays read it the same way, so a replay honors the
|
|
26
|
+
* switch the original run used.
|
|
27
|
+
*/
|
|
28
|
+
export function selectionAt(events, seq) {
|
|
29
|
+
let out = NO_SELECTION;
|
|
30
|
+
for (const e of events) {
|
|
31
|
+
if (e.seq >= seq)
|
|
32
|
+
break;
|
|
33
|
+
if (e.type === "model_switched") {
|
|
34
|
+
const p = e.payload;
|
|
35
|
+
out = { model: p.model, effort: p.effort };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return out;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The definition a run uses under a selection: `model` replaced by the selected one, `modelParams`
|
|
42
|
+
* = the agent's own (only while the model is the agent's) plus the selected effort. Fallback model
|
|
43
|
+
* and params are untouched. No selection returns the definition itself (old logs stay identical).
|
|
44
|
+
*/
|
|
45
|
+
export function effectiveDefinition(def, sel) {
|
|
46
|
+
if (sel.model === null && sel.effort === null)
|
|
47
|
+
return def;
|
|
48
|
+
const model = sel.model ?? def.model;
|
|
49
|
+
const own = sameModel(model, def.model) ? (def.modelParams ?? {}) : {};
|
|
50
|
+
return {
|
|
51
|
+
...def,
|
|
52
|
+
model,
|
|
53
|
+
modelParams: { ...own, ...(sel.effort !== null && { effort: sel.effort }) },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The selection from the log: the latest `model_switched` (before `beforeSeq` when given). Pass a
|
|
58
|
+
* transaction that holds the conversation row lock to read it consistently with an append.
|
|
59
|
+
*/
|
|
60
|
+
export async function readSelection(db, conversationId, beforeSeq) {
|
|
61
|
+
let q = db
|
|
62
|
+
.selectFrom("conversation_events")
|
|
63
|
+
.select("payload")
|
|
64
|
+
.where("conversation_id", "=", conversationId)
|
|
65
|
+
.where("type", "=", "model_switched")
|
|
66
|
+
.orderBy("seq", "desc")
|
|
67
|
+
.limit(1);
|
|
68
|
+
if (beforeSeq !== undefined)
|
|
69
|
+
q = q.where("seq", "<", String(beforeSeq));
|
|
70
|
+
const row = await q.executeTakeFirst();
|
|
71
|
+
if (!row)
|
|
72
|
+
return NO_SELECTION;
|
|
73
|
+
const p = row.payload;
|
|
74
|
+
return { model: p.model, effort: p.effort };
|
|
75
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type Logger } from "@capybara-hq/plugin-sdk";
|
|
2
|
+
import type { KernelConfig } from "../config/schema.js";
|
|
3
|
+
import type { KernelDb } from "../db/kernel-schema.js";
|
|
4
|
+
import { type ModelPurposesService } from "../models/purposes.js";
|
|
5
|
+
import { type HookRunner } from "../runtime/hook-calls.js";
|
|
6
|
+
import type { UsageReporter } from "../runtime/usage-report.js";
|
|
7
|
+
import type { EventLog } from "./event-log.js";
|
|
8
|
+
/**
|
|
9
|
+
* Model-generated conversation titles (UI refresh B, spec §5.1 "Titles").
|
|
10
|
+
*
|
|
11
|
+
* After a completed run, {@link TitleQueue.maybeEnqueue} queues one job on `cap-kernel-titles`
|
|
12
|
+
* when the conversation is a chat with no title, has not been renamed, has fewer than
|
|
13
|
+
* {@link TITLE_MAX_ATTEMPTS} attempts and the log has an assistant reply with text. The job
|
|
14
|
+
* ({@link runTitleJob}) claims its attempt in PG (one execution per attempt across replicas), sends
|
|
15
|
+
* a short excerpt of the first exchange to the `title` purpose (unmapped → the conversation's
|
|
16
|
+
* current chat model), writes the title only while `title_source IS NULL` (a rename wins, even
|
|
17
|
+
* mid-call), and logs the call's usage as a `usage` event with `purpose: "title"` and no run. The
|
|
18
|
+
* call is not model-visible to the agent (no DriftReason) and replays never run it. A failure
|
|
19
|
+
* leaves the title null; the next completed run enqueues the next attempt.
|
|
20
|
+
*/
|
|
21
|
+
/** The title queue (no `:` in the name). */
|
|
22
|
+
export declare const TITLE_QUEUE = "cap-kernel-titles";
|
|
23
|
+
/** One job per attempt (no `:`: conversation ids are UUIDs). */
|
|
24
|
+
export declare const titleJobId: (conversationId: string, attempt: number) => string;
|
|
25
|
+
/** Attempts before the conversation stays untitled. */
|
|
26
|
+
export declare const TITLE_MAX_ATTEMPTS = 3;
|
|
27
|
+
/** Output cap of the title call. */
|
|
28
|
+
export declare const TITLE_MAX_OUTPUT_TOKENS = 32;
|
|
29
|
+
/** The longest generated title (characters); a rename has the same limit. */
|
|
30
|
+
export declare const TITLE_MAX_CHARS = 120;
|
|
31
|
+
/** Each side of the excerpt is cut to this many characters. */
|
|
32
|
+
export declare const TITLE_EXCERPT_CHARS = 1000;
|
|
33
|
+
/** Time limit of one title call. */
|
|
34
|
+
export declare const TITLE_TIMEOUT_MS = 60000;
|
|
35
|
+
/** The system prompt of the title call (model-facing, English). */
|
|
36
|
+
export declare const TITLE_PROMPT: string;
|
|
37
|
+
/** The user message of the title call: the first user message and reply, each ≤ 1,000 chars. */
|
|
38
|
+
export declare function titleExcerpt(firstUser: string, firstReply: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* The title from a model reply: the first non-empty line, without control or format characters,
|
|
41
|
+
* wrapping quotes or trailing punctuation, at most {@link TITLE_MAX_CHARS} characters; null when
|
|
42
|
+
* nothing is left.
|
|
43
|
+
*/
|
|
44
|
+
export declare function cleanTitle(reply: string): string | null;
|
|
45
|
+
export interface TitleDeps {
|
|
46
|
+
db: KernelDb;
|
|
47
|
+
eventLog: Pick<EventLog, "append" | "readAfter" | "latestOfType" | "notify" | "publishChanged">;
|
|
48
|
+
purposes: Pick<ModelPurposesService, "chat">;
|
|
49
|
+
log: Pick<Logger, "warn">;
|
|
50
|
+
/**
|
|
51
|
+
* Extension hooks: the title call fires `model.request` (policy, then observe; a denial skips the
|
|
52
|
+
* title and uses up the attempt) and `model.response` with `purpose: "title"`, like compaction.
|
|
53
|
+
*/
|
|
54
|
+
hooks?: HookRunner;
|
|
55
|
+
usageReport?: Pick<UsageReporter, "enqueue">;
|
|
56
|
+
/** Aborts the call (worker shutdown). */
|
|
57
|
+
signal?: AbortSignal;
|
|
58
|
+
}
|
|
59
|
+
/** The attempt number to enqueue for this conversation, or null when no title job is due. */
|
|
60
|
+
export declare function titleAttemptDue(db: KernelDb, conversationId: string): Promise<number | null>;
|
|
61
|
+
/**
|
|
62
|
+
* One title attempt. Claims the attempt (`title_attempts = attempt` → `attempt + 1`; a second
|
|
63
|
+
* execution of the same attempt finds nothing to claim and returns), calls the model, writes the
|
|
64
|
+
* title only while `title_source IS NULL`, and appends the call's `usage` event (`purpose: "title"`,
|
|
65
|
+
* no run, idempotent per attempt) in the same transaction. Errors are logged, not thrown.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runTitleJob(d: TitleDeps, conversationId: string, attempt: number): Promise<void>;
|
|
68
|
+
export interface TitleQueueDeps extends Omit<TitleDeps, "signal"> {
|
|
69
|
+
redisUrl: string;
|
|
70
|
+
config: () => KernelConfig;
|
|
71
|
+
log: Logger;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The title queue: `maybeEnqueue` on any role (called by the run worker after a completed run),
|
|
75
|
+
* the worker on the `worker` role. One attempt per job, no BullMQ retries: the next completed run
|
|
76
|
+
* enqueues the next attempt.
|
|
77
|
+
*/
|
|
78
|
+
export declare class TitleQueue {
|
|
79
|
+
private readonly d;
|
|
80
|
+
private queue;
|
|
81
|
+
private queueConn;
|
|
82
|
+
private worker;
|
|
83
|
+
private workerConn;
|
|
84
|
+
private closed;
|
|
85
|
+
private readonly stopping;
|
|
86
|
+
constructor(d: TitleQueueDeps);
|
|
87
|
+
/** Enqueues the next title attempt when one is due. Never throws (logs instead). */
|
|
88
|
+
maybeEnqueue(conversationId: string): Promise<void>;
|
|
89
|
+
startWorker(): void;
|
|
90
|
+
private process;
|
|
91
|
+
stop(): Promise<void>;
|
|
92
|
+
private getQueue;
|
|
93
|
+
}
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import { isModelError, } from "@capybara-hq/plugin-sdk";
|
|
2
|
+
import { Queue, Worker } from "bullmq";
|
|
3
|
+
import { sql } from "kysely";
|
|
4
|
+
import { audit } from "../identity/audit.js";
|
|
5
|
+
import { PurposeAttemptError } from "../models/purposes.js";
|
|
6
|
+
import { fireObserve, hookDeniedAudit, hookDeniedEvent, hookRequestOf, } from "../runtime/hook-calls.js";
|
|
7
|
+
import { bullConnection } from "../runtime/run-queue.js";
|
|
8
|
+
import { HIDDEN_FORMAT_RE } from "../text.js";
|
|
9
|
+
import { typedInvocation } from "./events.js";
|
|
10
|
+
/**
|
|
11
|
+
* Model-generated conversation titles (UI refresh B, spec §5.1 "Titles").
|
|
12
|
+
*
|
|
13
|
+
* After a completed run, {@link TitleQueue.maybeEnqueue} queues one job on `cap-kernel-titles`
|
|
14
|
+
* when the conversation is a chat with no title, has not been renamed, has fewer than
|
|
15
|
+
* {@link TITLE_MAX_ATTEMPTS} attempts and the log has an assistant reply with text. The job
|
|
16
|
+
* ({@link runTitleJob}) claims its attempt in PG (one execution per attempt across replicas), sends
|
|
17
|
+
* a short excerpt of the first exchange to the `title` purpose (unmapped → the conversation's
|
|
18
|
+
* current chat model), writes the title only while `title_source IS NULL` (a rename wins, even
|
|
19
|
+
* mid-call), and logs the call's usage as a `usage` event with `purpose: "title"` and no run. The
|
|
20
|
+
* call is not model-visible to the agent (no DriftReason) and replays never run it. A failure
|
|
21
|
+
* leaves the title null; the next completed run enqueues the next attempt.
|
|
22
|
+
*/
|
|
23
|
+
/** The title queue (no `:` in the name). */
|
|
24
|
+
export const TITLE_QUEUE = "cap-kernel-titles";
|
|
25
|
+
/** One job per attempt (no `:`: conversation ids are UUIDs). */
|
|
26
|
+
export const titleJobId = (conversationId, attempt) => `title-${conversationId}-${attempt}`;
|
|
27
|
+
/** Attempts before the conversation stays untitled. */
|
|
28
|
+
export const TITLE_MAX_ATTEMPTS = 3;
|
|
29
|
+
/** Output cap of the title call. */
|
|
30
|
+
export const TITLE_MAX_OUTPUT_TOKENS = 32;
|
|
31
|
+
/** The longest generated title (characters); a rename has the same limit. */
|
|
32
|
+
export const TITLE_MAX_CHARS = 120;
|
|
33
|
+
/** Each side of the excerpt is cut to this many characters. */
|
|
34
|
+
export const TITLE_EXCERPT_CHARS = 1000;
|
|
35
|
+
/** Time limit of one title call. */
|
|
36
|
+
export const TITLE_TIMEOUT_MS = 60_000;
|
|
37
|
+
/** How far into the log the excerpt is looked for (events). */
|
|
38
|
+
const EXCERPT_SCAN_EVENTS = 2000;
|
|
39
|
+
const PAGE = 500;
|
|
40
|
+
const JOB = "title";
|
|
41
|
+
/** The system prompt of the title call (model-facing, English). */
|
|
42
|
+
export const TITLE_PROMPT = "Write a title of at most 8 words for this conversation, in the language the user writes in. " +
|
|
43
|
+
"Reply with the title only, no quotes or punctuation at the end.";
|
|
44
|
+
const cut = (s) => {
|
|
45
|
+
const cps = Array.from(s);
|
|
46
|
+
return cps.length <= TITLE_EXCERPT_CHARS ? s : `${cps.slice(0, TITLE_EXCERPT_CHARS).join("")}…`;
|
|
47
|
+
};
|
|
48
|
+
/** The user message of the title call: the first user message and reply, each ≤ 1,000 chars. */
|
|
49
|
+
export function titleExcerpt(firstUser, firstReply) {
|
|
50
|
+
return `User message:\n${cut(firstUser.trim())}\n\nAssistant reply:\n${cut(firstReply.trim())}`;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The title from a model reply: the first non-empty line, without control or format characters,
|
|
54
|
+
* wrapping quotes or trailing punctuation, at most {@link TITLE_MAX_CHARS} characters; null when
|
|
55
|
+
* nothing is left.
|
|
56
|
+
*/
|
|
57
|
+
export function cleanTitle(reply) {
|
|
58
|
+
const line = reply
|
|
59
|
+
.split(/\r?\n/)
|
|
60
|
+
.map((l) => l
|
|
61
|
+
.replace(/\p{Cc}/gu, "")
|
|
62
|
+
.replace(HIDDEN_FORMAT_RE, "")
|
|
63
|
+
.trim())
|
|
64
|
+
.find((l) => l !== "") ?? "";
|
|
65
|
+
let t = line
|
|
66
|
+
.replace(/^(?:title|标题)\s*[::]\s*/i, "")
|
|
67
|
+
.replace(/^["'“”‘’「」《》`*]+|["'“”‘’「」《》`*]+$/gu, "")
|
|
68
|
+
.replace(/[.。!!??,,;;::]+$/u, "")
|
|
69
|
+
.trim();
|
|
70
|
+
// counted in code points, so a cut never splits a surrogate pair
|
|
71
|
+
const cps = Array.from(t);
|
|
72
|
+
if (cps.length > TITLE_MAX_CHARS)
|
|
73
|
+
t = cps.slice(0, TITLE_MAX_CHARS).join("").trimEnd();
|
|
74
|
+
return t === "" ? null : t;
|
|
75
|
+
}
|
|
76
|
+
const textOf = (content) => content.flatMap((b) => (b.type === "text" ? [b.text] : [])).join("");
|
|
77
|
+
/**
|
|
78
|
+
* What the person typed in a user message: its first block when that is text. The blocks after it
|
|
79
|
+
* are `@` resource bodies (read with the sender's credentials) and file refs, which never go to the
|
|
80
|
+
* title model.
|
|
81
|
+
*/
|
|
82
|
+
const typedText = (content) => {
|
|
83
|
+
const first = content[0];
|
|
84
|
+
return first?.type === "text" ? first.text : "";
|
|
85
|
+
};
|
|
86
|
+
/** The attempt number to enqueue for this conversation, or null when no title job is due. */
|
|
87
|
+
export async function titleAttemptDue(db, conversationId) {
|
|
88
|
+
const row = await db
|
|
89
|
+
.selectFrom("conversations as c")
|
|
90
|
+
.select("c.title_attempts")
|
|
91
|
+
.where("c.id", "=", conversationId)
|
|
92
|
+
.where("c.kind", "=", "chat")
|
|
93
|
+
.where("c.title", "is", null)
|
|
94
|
+
.where("c.title_source", "is", null)
|
|
95
|
+
.where("c.title_attempts", "<", TITLE_MAX_ATTEMPTS)
|
|
96
|
+
.where((eb) => eb.exists(eb
|
|
97
|
+
.selectFrom("conversation_events as e")
|
|
98
|
+
.select(sql `1`.as("one"))
|
|
99
|
+
.whereRef("e.conversation_id", "=", "c.id")
|
|
100
|
+
.where("e.type", "=", "assistant_message")
|
|
101
|
+
.where(sql `e.payload -> 'content' @> '[{"type":"text"}]'::jsonb`)))
|
|
102
|
+
.executeTakeFirst();
|
|
103
|
+
return row ? row.title_attempts : null;
|
|
104
|
+
}
|
|
105
|
+
/** The first user message's typed text and the first assistant reply with text after it. */
|
|
106
|
+
async function firstExchange(eventLog, conversationId) {
|
|
107
|
+
let user;
|
|
108
|
+
let after = 0;
|
|
109
|
+
for (let read = 0; read < EXCERPT_SCAN_EVENTS;) {
|
|
110
|
+
const page = await eventLog.readAfter(conversationId, after, PAGE);
|
|
111
|
+
for (const e of page) {
|
|
112
|
+
if (e.type === "user_message" && user === undefined) {
|
|
113
|
+
// a skill invocation: what the person typed, never the rendered skill (content[0])
|
|
114
|
+
const t = e.payload.skill !== undefined
|
|
115
|
+
? typedInvocation(e.payload.skill)
|
|
116
|
+
: typedText(e.payload.content);
|
|
117
|
+
if (t.trim() !== "")
|
|
118
|
+
user = t;
|
|
119
|
+
}
|
|
120
|
+
else if (e.type === "assistant_message" && user !== undefined) {
|
|
121
|
+
const t = textOf(e.payload.content);
|
|
122
|
+
if (t.trim() !== "")
|
|
123
|
+
return { user, reply: t };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const last = page.at(-1);
|
|
127
|
+
if (page.length < PAGE || !last)
|
|
128
|
+
break;
|
|
129
|
+
after = last.seq;
|
|
130
|
+
read += page.length;
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* One title attempt. Claims the attempt (`title_attempts = attempt` → `attempt + 1`; a second
|
|
136
|
+
* execution of the same attempt finds nothing to claim and returns), calls the model, writes the
|
|
137
|
+
* title only while `title_source IS NULL`, and appends the call's `usage` event (`purpose: "title"`,
|
|
138
|
+
* no run, idempotent per attempt) in the same transaction. Errors are logged, not thrown.
|
|
139
|
+
*/
|
|
140
|
+
export async function runTitleJob(d, conversationId, attempt) {
|
|
141
|
+
// look for the excerpt first: an attempt is used up only by a call that can be made
|
|
142
|
+
const exchange = await firstExchange(d.eventLog, conversationId);
|
|
143
|
+
if (!exchange)
|
|
144
|
+
return;
|
|
145
|
+
if (d.signal?.aborted)
|
|
146
|
+
return;
|
|
147
|
+
const claimed = await d.db
|
|
148
|
+
.updateTable("conversations")
|
|
149
|
+
.set({ title_attempts: attempt + 1 })
|
|
150
|
+
.where("id", "=", conversationId)
|
|
151
|
+
.where("title_attempts", "=", attempt)
|
|
152
|
+
.where("title_source", "is", null)
|
|
153
|
+
.where("kind", "=", "chat")
|
|
154
|
+
.returning(["org_id", "account_id", "agent_id"])
|
|
155
|
+
.executeTakeFirst();
|
|
156
|
+
if (!claimed)
|
|
157
|
+
return;
|
|
158
|
+
const started = await d.eventLog.latestOfType(conversationId, "run_started");
|
|
159
|
+
const fallback = started?.payload.model;
|
|
160
|
+
const signal = AbortSignal.any([
|
|
161
|
+
AbortSignal.timeout(TITLE_TIMEOUT_MS),
|
|
162
|
+
...(d.signal ? [d.signal] : []),
|
|
163
|
+
]);
|
|
164
|
+
const scope = {
|
|
165
|
+
orgId: claimed.org_id,
|
|
166
|
+
accountId: claimed.account_id,
|
|
167
|
+
agentId: claimed.agent_id,
|
|
168
|
+
agentVersion: started?.payload.agentVersion ?? (await agentVersionOf(d.db, claimed.agent_id)),
|
|
169
|
+
conversationId,
|
|
170
|
+
runId: "",
|
|
171
|
+
};
|
|
172
|
+
let sent;
|
|
173
|
+
let out;
|
|
174
|
+
try {
|
|
175
|
+
out = await d.purposes.chat(claimed.org_id, "title", {
|
|
176
|
+
system: [{ text: TITLE_PROMPT, cache: false }],
|
|
177
|
+
messages: [
|
|
178
|
+
{
|
|
179
|
+
role: "user",
|
|
180
|
+
content: [{ type: "text", text: titleExcerpt(exchange.user, exchange.reply) }],
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
tools: [],
|
|
184
|
+
toolChoice: "none",
|
|
185
|
+
maxOutputTokens: TITLE_MAX_OUTPUT_TOKENS,
|
|
186
|
+
}, signal, {
|
|
187
|
+
...(fallback && { fallback: { model: fallback, params: {} } }),
|
|
188
|
+
beforeSend: async (target, request) => {
|
|
189
|
+
await checkTitleHooks(d, scope, target, request, signal);
|
|
190
|
+
sent = { ...target, at: Date.now() };
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
if (err instanceof TitleDenied) {
|
|
196
|
+
// a policy denial is deterministic: no retries (one audit row, not one per attempt)
|
|
197
|
+
await d.db
|
|
198
|
+
.updateTable("conversations")
|
|
199
|
+
.set({ title_attempts: TITLE_MAX_ATTEMPTS })
|
|
200
|
+
.where("id", "=", conversationId)
|
|
201
|
+
.execute();
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (sent && d.hooks)
|
|
205
|
+
observeTitle(d, scope, sent, null, err, signal);
|
|
206
|
+
// the replica is shutting down: give the attempt back unless something else took over
|
|
207
|
+
if (d.signal?.aborted && !(err instanceof PurposeAttemptError)) {
|
|
208
|
+
await giveBack(d.db, conversationId, attempt);
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
d.log.warn("conversation title call failed", { conversationId, attempt, err });
|
|
212
|
+
// a sent call is billed: log its estimated usage like a successful one
|
|
213
|
+
if (err instanceof PurposeAttemptError) {
|
|
214
|
+
await logUsage(d, conversationId, attempt, {
|
|
215
|
+
provider: err.provider,
|
|
216
|
+
model: err.model,
|
|
217
|
+
usage: {
|
|
218
|
+
inputTokens: err.tokens,
|
|
219
|
+
outputTokens: 0,
|
|
220
|
+
cacheReadTokens: 0,
|
|
221
|
+
cacheWriteTokens: 0,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (sent && d.hooks)
|
|
228
|
+
observeTitle(d, scope, sent, out, null, signal);
|
|
229
|
+
const title = cleanTitle(textOf(out.content));
|
|
230
|
+
const { written, usage } = await d.db.transaction().execute(async (t) => {
|
|
231
|
+
// Append first: it locks the conversation row FOR UPDATE before this transaction touches it.
|
|
232
|
+
// Updating the title first held the row FOR NO KEY UPDATE, which lets in another
|
|
233
|
+
// transaction's foreign key check (FOR KEY SHARE, e.g. inserting an approval); the append's
|
|
234
|
+
// FOR UPDATE then waited for that one while it waited for the title row: 40P01
|
|
235
|
+
const [ev] = await d.eventLog.append(conversationId, [usageEvent(attempt, out)], t);
|
|
236
|
+
const row = title === null
|
|
237
|
+
? undefined
|
|
238
|
+
: await t
|
|
239
|
+
.updateTable("conversations")
|
|
240
|
+
.set({ title, title_source: "generated" })
|
|
241
|
+
.where("id", "=", conversationId)
|
|
242
|
+
.where("title_source", "is", null)
|
|
243
|
+
.returning("id")
|
|
244
|
+
.executeTakeFirst();
|
|
245
|
+
return { written: row !== undefined, usage: ev };
|
|
246
|
+
});
|
|
247
|
+
if (usage) {
|
|
248
|
+
await d.eventLog.notify(conversationId, usage.seq);
|
|
249
|
+
void d.usageReport?.enqueue(conversationId, usage.seq);
|
|
250
|
+
}
|
|
251
|
+
if (written)
|
|
252
|
+
await d.eventLog.publishChanged(conversationId, "title");
|
|
253
|
+
}
|
|
254
|
+
/** A `model.request` policy hook denied the title call (already recorded). */
|
|
255
|
+
class TitleDenied extends Error {
|
|
256
|
+
}
|
|
257
|
+
const usageEvent = (attempt, u) => ({
|
|
258
|
+
type: "usage",
|
|
259
|
+
idemKey: `usage_title:${attempt}`,
|
|
260
|
+
payload: { step: 0, provider: u.provider, model: u.model, ...u.usage, purpose: "title" },
|
|
261
|
+
});
|
|
262
|
+
async function logUsage(d, conversationId, attempt, u) {
|
|
263
|
+
const [ev] = await d.eventLog.append(conversationId, [usageEvent(attempt, u)]);
|
|
264
|
+
if (ev)
|
|
265
|
+
void d.usageReport?.enqueue(conversationId, ev.seq);
|
|
266
|
+
}
|
|
267
|
+
/** Returns a claimed attempt (shutdown before the call was sent). */
|
|
268
|
+
async function giveBack(db, conversationId, attempt) {
|
|
269
|
+
await db
|
|
270
|
+
.updateTable("conversations")
|
|
271
|
+
.set({ title_attempts: attempt })
|
|
272
|
+
.where("id", "=", conversationId)
|
|
273
|
+
.where("title_attempts", "=", attempt + 1)
|
|
274
|
+
.where("title_source", "is", null)
|
|
275
|
+
.execute();
|
|
276
|
+
}
|
|
277
|
+
async function agentVersionOf(db, agentId) {
|
|
278
|
+
const row = await db
|
|
279
|
+
.selectFrom("agents")
|
|
280
|
+
.select("current_version")
|
|
281
|
+
.where("id", "=", agentId)
|
|
282
|
+
.executeTakeFirst();
|
|
283
|
+
return row?.current_version ?? 1;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* `model.request` for the title call (`purpose: "title"`, step 0, attempt 1, run ""). A denial
|
|
287
|
+
* (including a policy extension not loaded on this replica) writes the `hook.denied` audit row and
|
|
288
|
+
* throws {@link TitleDenied}: the title is skipped and no further attempt is made. No `hook_denied`
|
|
289
|
+
* event: the call is not a step of a run.
|
|
290
|
+
*/
|
|
291
|
+
async function checkTitleHooks(d, scope, target, request, signal) {
|
|
292
|
+
if (!d.hooks?.has("model.request"))
|
|
293
|
+
return;
|
|
294
|
+
const verdict = await d.hooks.run("model.request", {
|
|
295
|
+
...scope,
|
|
296
|
+
purpose: "title",
|
|
297
|
+
step: 0,
|
|
298
|
+
attempt: 1,
|
|
299
|
+
provider: target.provider,
|
|
300
|
+
model: target.model,
|
|
301
|
+
request: hookRequestOf(request, d.log),
|
|
302
|
+
}, signal);
|
|
303
|
+
if (verdict.allowed)
|
|
304
|
+
return;
|
|
305
|
+
const site = {
|
|
306
|
+
orgId: scope.orgId,
|
|
307
|
+
conversationId: scope.conversationId,
|
|
308
|
+
runId: "",
|
|
309
|
+
accountId: scope.accountId,
|
|
310
|
+
agentId: scope.agentId,
|
|
311
|
+
idemKey: "",
|
|
312
|
+
};
|
|
313
|
+
const entry = hookDeniedAudit(site, hookDeniedEvent(site, "model.request", verdict, { step: 0, attempt: 1 }).payload, verdict);
|
|
314
|
+
entry.detail = { ...entry.detail, purpose: "title" };
|
|
315
|
+
await d.db.transaction().execute((t) => audit(t, entry));
|
|
316
|
+
d.log.warn("conversation title blocked by a policy hook", {
|
|
317
|
+
conversationId: scope.conversationId,
|
|
318
|
+
plugin: verdict.plugin,
|
|
319
|
+
cause: verdict.cause,
|
|
320
|
+
});
|
|
321
|
+
throw new TitleDenied();
|
|
322
|
+
}
|
|
323
|
+
const errorCodeOf = (err) => {
|
|
324
|
+
const cause = err instanceof PurposeAttemptError ? err.cause : err;
|
|
325
|
+
return isModelError(cause) ? `model.${cause.kind}` : "model.unknown";
|
|
326
|
+
};
|
|
327
|
+
/** `model.response` for a sent title call (observe only, not awaited). */
|
|
328
|
+
function observeTitle(d, scope, sent, out, err, signal) {
|
|
329
|
+
if (!d.hooks)
|
|
330
|
+
return;
|
|
331
|
+
fireObserve(d.hooks, "model.response", {
|
|
332
|
+
...scope,
|
|
333
|
+
purpose: "title",
|
|
334
|
+
step: 0,
|
|
335
|
+
attempt: 1,
|
|
336
|
+
provider: sent.provider,
|
|
337
|
+
model: sent.model,
|
|
338
|
+
outcome: out ? "ok" : "failed",
|
|
339
|
+
content: out?.content ?? [],
|
|
340
|
+
stopReason: out?.stopReason ?? null,
|
|
341
|
+
usage: out?.usage ?? null,
|
|
342
|
+
latencyMs: Date.now() - sent.at,
|
|
343
|
+
...(out === null && { errorCode: errorCodeOf(err) }),
|
|
344
|
+
}, signal, d.log);
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* The title queue: `maybeEnqueue` on any role (called by the run worker after a completed run),
|
|
348
|
+
* the worker on the `worker` role. One attempt per job, no BullMQ retries: the next completed run
|
|
349
|
+
* enqueues the next attempt.
|
|
350
|
+
*/
|
|
351
|
+
export class TitleQueue {
|
|
352
|
+
d;
|
|
353
|
+
queue;
|
|
354
|
+
queueConn;
|
|
355
|
+
worker;
|
|
356
|
+
workerConn;
|
|
357
|
+
closed = false;
|
|
358
|
+
stopping = new AbortController();
|
|
359
|
+
constructor(d) {
|
|
360
|
+
this.d = d;
|
|
361
|
+
}
|
|
362
|
+
/** Enqueues the next title attempt when one is due. Never throws (logs instead). */
|
|
363
|
+
async maybeEnqueue(conversationId) {
|
|
364
|
+
if (this.closed)
|
|
365
|
+
return;
|
|
366
|
+
try {
|
|
367
|
+
const attempt = await titleAttemptDue(this.d.db, conversationId);
|
|
368
|
+
if (attempt === null)
|
|
369
|
+
return;
|
|
370
|
+
await this.getQueue().add(JOB, { conversationId, attempt }, {
|
|
371
|
+
jobId: titleJobId(conversationId, attempt),
|
|
372
|
+
attempts: 1,
|
|
373
|
+
removeOnComplete: true,
|
|
374
|
+
removeOnFail: true,
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
catch (err) {
|
|
378
|
+
this.d.log.warn("cannot enqueue conversation title", { conversationId, err });
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
startWorker() {
|
|
382
|
+
if (this.worker || this.closed)
|
|
383
|
+
return;
|
|
384
|
+
const { jobLockMs, stalledIntervalMs } = this.d.config().runtime;
|
|
385
|
+
this.workerConn = bullConnection(this.d.redisUrl, this.d.log);
|
|
386
|
+
this.worker = new Worker(TITLE_QUEUE, (j) => this.process(j), {
|
|
387
|
+
connection: this.workerConn,
|
|
388
|
+
concurrency: 4,
|
|
389
|
+
lockDuration: jobLockMs,
|
|
390
|
+
stalledInterval: stalledIntervalMs,
|
|
391
|
+
maxStalledCount: 1,
|
|
392
|
+
});
|
|
393
|
+
this.worker.on("error", (err) => this.d.log.error("title worker error", { err }));
|
|
394
|
+
}
|
|
395
|
+
async process(j) {
|
|
396
|
+
await runTitleJob({ ...this.d, signal: this.stopping.signal }, j.data.conversationId, j.data.attempt);
|
|
397
|
+
}
|
|
398
|
+
async stop() {
|
|
399
|
+
this.closed = true;
|
|
400
|
+
this.stopping.abort();
|
|
401
|
+
const w = this.worker;
|
|
402
|
+
this.worker = undefined;
|
|
403
|
+
await w?.close().catch(() => { });
|
|
404
|
+
const q = this.queue;
|
|
405
|
+
this.queue = undefined;
|
|
406
|
+
await q?.close().catch(() => { });
|
|
407
|
+
for (const c of [this.workerConn, this.queueConn]) {
|
|
408
|
+
if (c)
|
|
409
|
+
await c.quit().catch(() => c.disconnect());
|
|
410
|
+
}
|
|
411
|
+
this.workerConn = undefined;
|
|
412
|
+
this.queueConn = undefined;
|
|
413
|
+
}
|
|
414
|
+
getQueue() {
|
|
415
|
+
if (!this.queue) {
|
|
416
|
+
this.queueConn = bullConnection(this.d.redisUrl, this.d.log);
|
|
417
|
+
this.queue = new Queue(TITLE_QUEUE, { connection: this.queueConn });
|
|
418
|
+
this.queue.on("error", (err) => this.d.log.error("title queue error", { err }));
|
|
419
|
+
}
|
|
420
|
+
return this.queue;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExtensionContext, Logger } from "@capybara-hq/plugin-sdk";
|
|
2
|
+
import type { Redis } from "ioredis";
|
|
3
|
+
type RawHandler = (message: string) => void;
|
|
4
|
+
/** 一个进程共用的订阅连接:由内核创建并传入 createBus,不使用模块级状态。 */
|
|
5
|
+
export interface BusSubscriber {
|
|
6
|
+
/** 订阅频道,返回取消函数;频道最后一个 handler 移除时真正 UNSUBSCRIBE。 */
|
|
7
|
+
subscribe(channel: string, handler: RawHandler): Promise<() => Promise<void>>;
|
|
8
|
+
}
|
|
9
|
+
type ErrorLog = Pick<Logger, "error">;
|
|
10
|
+
/** 创建共享订阅者:首次订阅时才惰性打开唯一一条连接,并把频道多路复用到各 handler 集合。 */
|
|
11
|
+
export declare function createBusSubscriber(subFactory: () => Redis, log?: ErrorLog): BusSubscriber & {
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
/** 创建 ctx.bus:频道为 `cap:<namespace>:<topic>`,payload 为 JSON。 */
|
|
15
|
+
export declare function createBus(pub: Redis, subscriber: BusSubscriber, namespace: string, log?: ErrorLog): ExtensionContext["bus"];
|
|
16
|
+
export {};
|