@capybara-hq/kernel 0.1.0-rc.4 → 0.1.0-rc.6
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/bootstrap.json +61 -5
- package/dist/admin/admin.controller.d.ts +51 -14
- package/dist/admin/admin.controller.js +60 -19
- package/dist/admin/extensions.controller.d.ts +16 -2
- package/dist/admin/extensions.controller.js +26 -6
- package/dist/admin/setup-lock.d.ts +1 -1
- package/dist/admin/setup-lock.js +1 -1
- package/dist/admin/setup.controller.d.ts +1 -1
- package/dist/admin/setup.controller.js +1 -1
- package/dist/admin/setup.service.d.ts +4 -4
- package/dist/admin/setup.service.js +8 -8
- package/dist/agents/agent-lookup.d.ts +16 -0
- package/dist/agents/agent-lookup.js +11 -0
- package/dist/agents/agents.controller.d.ts +76 -1
- package/dist/agents/agents.controller.js +90 -11
- package/dist/agents/agents.module.d.ts +4 -1
- package/dist/agents/agents.module.js +32 -6
- package/dist/agents/agents.service.d.ts +54 -23
- package/dist/agents/agents.service.js +180 -76
- package/dist/agents/definition.d.ts +49 -0
- package/dist/agents/definition.js +45 -0
- package/dist/agents/from-template.d.ts +106 -0
- package/dist/agents/from-template.js +649 -0
- package/dist/agents/from-template.service.d.ts +60 -0
- package/dist/agents/from-template.service.js +161 -0
- package/dist/agents/models.controller.d.ts +34 -5
- package/dist/agents/models.controller.js +50 -6
- package/dist/agents/org-templates.d.ts +176 -0
- package/dist/agents/org-templates.js +827 -0
- package/dist/agents/pending-connector-requests.d.ts +77 -0
- package/dist/agents/pending-connector-requests.js +215 -0
- package/dist/agents/pending-connectors.controller.d.ts +39 -0
- package/dist/agents/pending-connectors.controller.js +91 -0
- package/dist/agents/pending-connectors.service.d.ts +62 -0
- package/dist/agents/pending-connectors.service.js +282 -0
- package/dist/agents/readiness.controller.d.ts +5 -5
- package/dist/agents/readiness.controller.js +6 -6
- package/dist/agents/templates.controller.d.ts +86 -5
- package/dist/agents/templates.controller.js +171 -7
- package/dist/agents/templates.d.ts +127 -23
- package/dist/agents/templates.js +475 -52
- package/dist/background/background.module.js +8 -1
- package/dist/background/finish.d.ts +3 -2
- package/dist/background/launch-lock.d.ts +4 -3
- package/dist/background/launch-lock.js +4 -3
- package/dist/background/poll.job.d.ts +9 -6
- package/dist/background/poll.job.js +30 -22
- package/dist/background/session.d.ts +13 -2
- package/dist/background/session.js +13 -0
- package/dist/background/stop.d.ts +12 -6
- package/dist/background/stop.js +57 -39
- package/dist/background/store.d.ts +18 -6
- package/dist/background/store.js +12 -6
- package/dist/background/tasks.service.d.ts +15 -5
- package/dist/background/tasks.service.js +42 -17
- package/dist/background/wake-rules.d.ts +27 -18
- package/dist/background/wake-rules.js +52 -22
- package/dist/background/wake.d.ts +13 -11
- package/dist/background/wake.js +20 -14
- package/dist/catalog/admin-catalog.controller.d.ts +129 -30
- package/dist/catalog/admin-catalog.controller.js +213 -42
- package/dist/catalog/catalog-content.d.ts +58 -32
- package/dist/catalog/catalog-content.js +34 -8
- package/dist/catalog/catalog-import.module.d.ts +7 -0
- package/dist/catalog/catalog-import.module.js +60 -0
- package/dist/catalog/catalog-items.d.ts +111 -7
- package/dist/catalog/catalog-items.js +279 -13
- package/dist/catalog/catalog-scope.service.d.ts +260 -0
- package/dist/catalog/catalog-scope.service.js +1116 -0
- package/dist/catalog/catalog.module.d.ts +7 -9
- package/dist/catalog/catalog.module.js +41 -31
- package/dist/catalog/catalog.service.d.ts +101 -29
- package/dist/catalog/catalog.service.js +104 -106
- package/dist/catalog/cli.d.ts +11 -1
- package/dist/catalog/cli.js +26 -1
- package/dist/catalog/component-promotion.d.ts +96 -0
- package/dist/catalog/component-promotion.js +395 -0
- package/dist/catalog/component-scope.controller.d.ts +152 -0
- package/dist/catalog/component-scope.controller.js +287 -0
- package/dist/catalog/component-scope.service.d.ts +303 -0
- package/dist/catalog/component-scope.service.js +936 -0
- package/dist/catalog/component-state.d.ts +174 -0
- package/dist/catalog/component-state.js +437 -0
- package/dist/catalog/job-ids.d.ts +30 -0
- package/dist/catalog/job-ids.js +25 -0
- package/dist/catalog/marketplace-fetch.d.ts +1 -1
- package/dist/catalog/marketplaces.controller.d.ts +22 -5
- package/dist/catalog/marketplaces.controller.js +56 -7
- package/dist/catalog/marketplaces.service.d.ts +54 -14
- package/dist/catalog/marketplaces.service.js +71 -22
- package/dist/catalog/org-catalog.controller.d.ts +125 -34
- package/dist/catalog/org-catalog.controller.js +181 -65
- package/dist/catalog/org-catalog.service.d.ts +65 -33
- package/dist/catalog/org-catalog.service.js +324 -157
- package/dist/catalog/org-extension-switch.d.ts +41 -0
- package/dist/catalog/org-extension-switch.js +115 -0
- package/dist/catalog/org-extension.controller.d.ts +119 -0
- package/dist/catalog/org-extension.controller.js +266 -0
- package/dist/catalog/org-plugin-uploads.controller.d.ts +98 -0
- package/dist/catalog/org-plugin-uploads.controller.js +213 -0
- package/dist/catalog/org-plugin-uploads.d.ts +63 -0
- package/dist/catalog/org-plugin-uploads.js +116 -0
- package/dist/catalog/owned-items.d.ts +184 -0
- package/dist/catalog/owned-items.js +789 -0
- package/dist/catalog/owned-plugin-cleanup.d.ts +56 -0
- package/dist/catalog/owned-plugin-cleanup.js +194 -0
- package/dist/catalog/ownership.d.ts +172 -0
- package/dist/catalog/ownership.js +326 -0
- package/dist/catalog/platform-components.d.ts +221 -0
- package/dist/catalog/platform-components.js +761 -0
- package/dist/catalog/platform-migration.d.ts +115 -0
- package/dist/catalog/platform-migration.js +582 -0
- package/dist/catalog/plugin-import.d.ts +178 -34
- package/dist/catalog/plugin-import.js +622 -82
- package/dist/catalog/plugin-install.d.ts +185 -41
- package/dist/catalog/plugin-install.js +758 -126
- package/dist/catalog/plugin-upgrade.d.ts +260 -225
- package/dist/catalog/plugin-upgrade.js +1147 -1136
- package/dist/catalog/request-rules.d.ts +65 -0
- package/dist/catalog/request-rules.js +217 -0
- package/dist/catalog/requests.service.d.ts +193 -118
- package/dist/catalog/requests.service.js +526 -343
- package/dist/catalog/reserved-names.d.ts +8 -0
- package/dist/catalog/reserved-names.js +42 -0
- package/dist/catalog/scope-orgs.d.ts +21 -0
- package/dist/catalog/scope-orgs.js +67 -0
- package/dist/catalog/scope-state.d.ts +35 -0
- package/dist/catalog/scope-state.js +87 -0
- package/dist/catalog/scope-sync-workers.d.ts +7 -0
- package/dist/catalog/scope-sync-workers.js +29 -0
- package/dist/catalog/scope-sync.d.ts +176 -0
- package/dist/catalog/scope-sync.js +576 -0
- package/dist/catalog/scope.d.ts +42 -0
- package/dist/catalog/scope.js +42 -0
- package/dist/catalog/unshare.d.ts +22 -0
- package/dist/catalog/unshare.js +118 -0
- package/dist/channels/actions.js +1 -0
- package/dist/channels/cards.js +20 -2
- package/dist/channels/channels.module.js +2 -0
- package/dist/channels/inbound.d.ts +9 -1
- package/dist/channels/inbound.js +67 -5
- package/dist/channels/phrases.d.ts +35 -0
- package/dist/channels/phrases.js +29 -0
- package/dist/config/docs.js +3 -1
- package/dist/config/schema.d.ts +10 -2
- package/dist/config/schema.js +70 -22
- package/dist/conversations/access.d.ts +6 -4
- package/dist/conversations/access.js +27 -5
- package/dist/conversations/agent-tree.d.ts +46 -0
- package/dist/conversations/agent-tree.js +92 -0
- package/dist/conversations/conversations.controller.d.ts +43 -18
- package/dist/conversations/conversations.controller.js +79 -38
- package/dist/conversations/conversations.module.d.ts +1 -1
- package/dist/conversations/conversations.module.js +7 -7
- package/dist/conversations/conversations.service.d.ts +73 -15
- package/dist/conversations/conversations.service.js +115 -35
- package/dist/conversations/environment-status.d.ts +24 -0
- package/dist/conversations/environment-status.js +71 -0
- package/dist/conversations/event-log.d.ts +20 -5
- package/dist/conversations/event-log.js +60 -0
- package/dist/conversations/events.d.ts +84 -2
- package/dist/conversations/events.js +91 -17
- package/dist/conversations/queue.service.d.ts +1 -1
- package/dist/conversations/queue.service.js +5 -0
- package/dist/conversations/titles.d.ts +5 -3
- package/dist/conversations/titles.js +21 -8
- package/dist/conversations/tree.d.ts +17 -0
- package/dist/conversations/tree.js +42 -0
- package/dist/ctx/create-ctx.d.ts +20 -1
- package/dist/ctx/create-ctx.js +38 -7
- package/dist/db/kernel-schema.d.ts +386 -18
- package/dist/environments/access.d.ts +41 -0
- package/dist/environments/access.js +77 -0
- package/dist/environments/conversation-environments.d.ts +61 -0
- package/dist/environments/conversation-environments.js +170 -0
- package/dist/environments/dto.d.ts +25 -0
- package/dist/environments/dto.js +12 -0
- package/dist/environments/environments.controller.d.ts +33 -0
- package/dist/environments/environments.controller.js +110 -0
- package/dist/environments/environments.module.d.ts +8 -0
- package/dist/environments/environments.module.js +27 -0
- package/dist/environments/environments.service.d.ts +153 -0
- package/dist/environments/environments.service.js +541 -0
- package/dist/environments/legacy-cleanup.job.d.ts +34 -0
- package/dist/environments/legacy-cleanup.job.js +141 -0
- package/dist/errors.d.ts +85 -2
- package/dist/errors.js +85 -2
- package/dist/evals/reconstruct.d.ts +18 -9
- package/dist/evals/reconstruct.js +26 -7
- package/dist/evals/run-replay.d.ts +4 -2
- package/dist/evals/run-replay.js +20 -6
- package/dist/evals/runs.service.d.ts +2 -1
- package/dist/evals/runs.service.js +13 -12
- package/dist/evals/step-replay.d.ts +4 -6
- package/dist/evals/step-replay.js +4 -3
- package/dist/evals/trajectory.service.d.ts +8 -3
- package/dist/evals/trajectory.service.js +26 -14
- package/dist/evals/worker.d.ts +5 -5
- package/dist/evals/worker.js +9 -3
- package/dist/extensions/admin-ops.d.ts +36 -10
- package/dist/extensions/admin-ops.js +65 -42
- package/dist/extensions/admin-view.d.ts +37 -10
- package/dist/extensions/admin-view.js +103 -20
- package/dist/extensions/bootstrap.d.ts +17 -4
- package/dist/extensions/bootstrap.js +70 -9
- package/dist/extensions/cli.d.ts +12 -0
- package/dist/extensions/cli.js +11 -2
- package/dist/extensions/config-hash.d.ts +10 -0
- package/dist/extensions/config-hash.js +38 -0
- package/dist/extensions/deployment-config.d.ts +28 -5
- package/dist/extensions/deployment-config.js +48 -7
- package/dist/extensions/effective-config.d.ts +127 -0
- package/dist/extensions/effective-config.js +368 -0
- package/dist/extensions/extensions.module.js +11 -11
- package/dist/extensions/hooks.d.ts +37 -4
- package/dist/extensions/hooks.js +82 -16
- package/dist/extensions/host.d.ts +24 -10
- package/dist/extensions/host.js +49 -54
- package/dist/extensions/installs.d.ts +20 -8
- package/dist/extensions/installs.js +37 -15
- package/dist/extensions/org-config.d.ts +75 -6
- package/dist/extensions/org-config.js +184 -32
- package/dist/extensions/org-levels.d.ts +37 -0
- package/dist/extensions/org-levels.js +71 -0
- package/dist/extensions/org-overrides.d.ts +151 -0
- package/dist/extensions/org-overrides.js +524 -0
- package/dist/extensions/permission-view.d.ts +16 -4
- package/dist/extensions/permission-view.js +4 -4
- package/dist/extensions/plugin-items.d.ts +21 -0
- package/dist/extensions/plugin-items.js +42 -0
- package/dist/extensions/point-defaults.d.ts +12 -5
- package/dist/extensions/point-defaults.js +37 -9
- package/dist/extensions/resolve.d.ts +5 -1
- package/dist/extensions/resolve.js +15 -2
- package/dist/extensions/state.module.d.ts +9 -0
- package/dist/extensions/state.module.js +38 -0
- package/dist/files/previewers.d.ts +8 -1
- package/dist/files/previewers.js +35 -6
- package/dist/http/api.module.js +25 -3
- package/dist/http/app.d.ts +11 -2
- package/dist/http/app.js +31 -5
- package/dist/http/plugin-dispatch.d.ts +4 -1
- package/dist/http/plugin-dispatch.js +14 -2
- package/dist/identity/accounts.d.ts +29 -29
- package/dist/identity/accounts.js +47 -47
- package/dist/identity/audit.d.ts +2 -1
- package/dist/identity/auth.guard.d.ts +13 -5
- package/dist/identity/auth.guard.js +26 -9
- package/dist/identity/identity.module.d.ts +1 -1
- package/dist/identity/identity.module.js +4 -4
- package/dist/identity/me.controller.js +1 -1
- package/dist/identity/principal.d.ts +3 -3
- package/dist/identity/principal.js +3 -3
- package/dist/identity/settings.d.ts +22 -11
- package/dist/identity/settings.js +53 -18
- package/dist/identity/{enterprise-admin.d.ts → super-admin.d.ts} +5 -5
- package/dist/identity/{enterprise-admin.js → super-admin.js} +24 -24
- package/dist/inbox/inbox.module.d.ts +4 -1
- package/dist/inbox/inbox.module.js +7 -3
- package/dist/inbox/inbox.service.d.ts +62 -3
- package/dist/inbox/inbox.service.js +74 -4
- package/dist/inbox/org-notices.d.ts +63 -0
- package/dist/inbox/org-notices.js +91 -0
- package/dist/inbox/platform-inbox.controller.d.ts +23 -0
- package/dist/inbox/platform-inbox.controller.js +58 -0
- package/dist/inbox/platform-inbox.service.d.ts +151 -0
- package/dist/inbox/platform-inbox.service.js +263 -0
- package/dist/inbox/platform-notices.d.ts +19 -0
- package/dist/inbox/platform-notices.js +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/infra/cli/kernel-cli.module.js +9 -1
- package/dist/infra/config/kernel-config.service.js +24 -1
- package/dist/infra/database/xact-lock.d.ts +1 -1
- package/dist/infra/database/xact-lock.js +1 -1
- package/dist/infra/events/kernel-events.d.ts +19 -2
- package/dist/infra/queue/add-job-once.d.ts +14 -0
- package/dist/infra/queue/add-job-once.js +16 -0
- package/dist/kernel.module.js +6 -0
- package/dist/lifecycle/kernel-lifecycle.d.ts +1 -1
- package/dist/lifecycle/kernel-lifecycle.js +4 -4
- package/dist/models/embeddings.d.ts +82 -0
- package/dist/models/embeddings.js +326 -0
- package/dist/models/enablement.controller.d.ts +40 -0
- package/dist/models/enablement.controller.js +74 -0
- package/dist/models/enablement.d.ts +99 -0
- package/dist/models/enablement.js +263 -0
- package/dist/models/models.module.d.ts +5 -1
- package/dist/models/models.module.js +16 -4
- package/dist/models/prices.d.ts +5 -5
- package/dist/models/prices.js +4 -4
- package/dist/models/purposes.controller.d.ts +6 -4
- package/dist/models/purposes.controller.js +13 -7
- package/dist/models/purposes.d.ts +37 -12
- package/dist/models/purposes.js +63 -17
- package/dist/orgs/directory-sync.d.ts +14 -5
- package/dist/orgs/directory-sync.js +41 -17
- package/dist/orgs/offboarding.d.ts +9 -7
- package/dist/orgs/offboarding.js +28 -17
- package/dist/orgs/org-lock.d.ts +5 -0
- package/dist/orgs/org-lock.js +13 -0
- package/dist/orgs/org.guard.d.ts +10 -0
- package/dist/orgs/org.guard.js +43 -32
- package/dist/orgs/orgs.module.js +3 -0
- package/dist/orgs/orgs.service.d.ts +20 -7
- package/dist/orgs/orgs.service.js +32 -12
- package/dist/orgs/roles.d.ts +1 -1
- package/dist/orgs/roles.js +5 -1
- package/dist/orgs/settings.controller.d.ts +1 -1
- package/dist/orgs/settings.service.d.ts +15 -3
- package/dist/orgs/settings.service.js +6 -2
- package/dist/overrides.d.ts +3 -0
- package/dist/overrides.js +2 -0
- package/dist/platform/actor.d.ts +48 -0
- package/dist/platform/actor.js +100 -0
- package/dist/platform/agent-docs.d.ts +18 -0
- package/dist/platform/agent-docs.js +59 -0
- package/dist/platform/availability.d.ts +14 -0
- package/dist/platform/availability.js +43 -0
- package/dist/platform/errors.d.ts +11 -0
- package/dist/platform/errors.js +26 -0
- package/dist/platform/exclusions.d.ts +12 -0
- package/dist/platform/exclusions.js +1405 -0
- package/dist/platform/method.d.ts +6 -0
- package/dist/platform/method.js +15 -0
- package/dist/platform/operation.d.ts +92 -0
- package/dist/platform/operation.js +35 -0
- package/dist/platform/ops/agent-templates.ops.d.ts +14 -0
- package/dist/platform/ops/agent-templates.ops.js +92 -0
- package/dist/platform/ops/agents.ops.d.ts +19 -0
- package/dist/platform/ops/agents.ops.js +294 -0
- package/dist/platform/ops/connectors.ops.d.ts +15 -0
- package/dist/platform/ops/connectors.ops.js +126 -0
- package/dist/platform/ops/errors.d.ts +11 -0
- package/dist/platform/ops/errors.js +22 -0
- package/dist/platform/ops/extensions.ops.d.ts +19 -0
- package/dist/platform/ops/extensions.ops.js +116 -0
- package/dist/platform/ops/marketplaces.ops.d.ts +16 -0
- package/dist/platform/ops/marketplaces.ops.js +157 -0
- package/dist/platform/ops/paging.d.ts +14 -0
- package/dist/platform/ops/paging.js +20 -0
- package/dist/platform/ops/platform.ops.d.ts +23 -0
- package/dist/platform/ops/platform.ops.js +158 -0
- package/dist/platform/ops/plugins.ops.d.ts +33 -0
- package/dist/platform/ops/plugins.ops.js +377 -0
- package/dist/platform/ops/requests.ops.d.ts +14 -0
- package/dist/platform/ops/requests.ops.js +153 -0
- package/dist/platform/ops/role.d.ts +4 -0
- package/dist/platform/ops/role.js +10 -0
- package/dist/platform/ops/skills.ops.d.ts +13 -0
- package/dist/platform/ops/skills.ops.js +98 -0
- package/dist/platform/ops/summary.d.ts +10 -0
- package/dist/platform/ops/summary.js +18 -0
- package/dist/platform/platform-ops.module.d.ts +7 -0
- package/dist/platform/platform-ops.module.js +55 -0
- package/dist/platform/platform.module.d.ts +8 -0
- package/dist/platform/platform.module.js +25 -0
- package/dist/platform/redact-orgs.d.ts +7 -0
- package/dist/platform/redact-orgs.js +52 -0
- package/dist/platform/registry.d.ts +30 -0
- package/dist/platform/registry.js +111 -0
- package/dist/roles/worker-role.d.ts +6 -4
- package/dist/roles/worker-role.js +14 -7
- package/dist/roles/worker.module.d.ts +1 -1
- package/dist/roles/worker.module.js +9 -1
- package/dist/runtime/context/build.d.ts +6 -4
- package/dist/runtime/context/build.js +26 -7
- package/dist/runtime/context/claude-tools.d.ts +2 -1
- package/dist/runtime/context/claude-tools.js +5 -4
- package/dist/runtime/context/compaction.js +9 -0
- package/dist/runtime/context/reminders.d.ts +2 -0
- package/dist/runtime/context/reminders.js +2 -0
- package/dist/runtime/context/skills.js +9 -2
- package/dist/runtime/context/tool-changes.d.ts +27 -0
- package/dist/runtime/context/tool-changes.js +60 -0
- package/dist/runtime/hook-calls.d.ts +8 -1
- package/dist/runtime/hook-calls.js +40 -7
- package/dist/runtime/langgraph-loop.d.ts +3 -1
- package/dist/runtime/langgraph-loop.js +35 -17
- package/dist/runtime/loop.d.ts +32 -4
- package/dist/runtime/maintenance.d.ts +7 -4
- package/dist/runtime/maintenance.js +23 -8
- package/dist/runtime/model-call.d.ts +38 -11
- package/dist/runtime/model-call.js +97 -24
- package/dist/runtime/providers.d.ts +146 -32
- package/dist/runtime/providers.js +321 -67
- package/dist/runtime/run-control.d.ts +11 -1
- package/dist/runtime/run-control.js +12 -0
- package/dist/runtime/run-drafts.d.ts +85 -0
- package/dist/runtime/run-drafts.js +230 -0
- package/dist/runtime/run-jobs.d.ts +3 -5
- package/dist/runtime/run-jobs.js +3 -7
- package/dist/runtime/run-queue.d.ts +37 -3
- package/dist/runtime/run-queue.js +188 -11
- package/dist/runtime/run-worker.d.ts +12 -6
- package/dist/runtime/run-worker.js +58 -35
- package/dist/runtime/runtime.module.js +3 -0
- package/dist/runtime/step-log.d.ts +9 -4
- package/dist/runtime/step-log.js +8 -5
- package/dist/runtime/stream.controller.d.ts +23 -1
- package/dist/runtime/stream.controller.js +60 -3
- package/dist/runtime/stream.d.ts +4 -1
- package/dist/runtime/stream.js +27 -3
- package/dist/runtime/subagents/child.d.ts +55 -7
- package/dist/runtime/subagents/child.js +105 -7
- package/dist/runtime/subagents/definition.d.ts +12 -3
- package/dist/runtime/subagents/definition.js +46 -32
- package/dist/runtime/subagents/deliveries.d.ts +71 -0
- package/dist/runtime/subagents/deliveries.js +228 -0
- package/dist/runtime/subagents/dispatch.d.ts +115 -26
- package/dist/runtime/subagents/dispatch.js +212 -141
- package/dist/runtime/subagents/limits.d.ts +24 -5
- package/dist/runtime/subagents/limits.js +40 -6
- package/dist/runtime/subagents/messages.d.ts +95 -0
- package/dist/runtime/subagents/messages.js +328 -0
- package/dist/runtime/subagents/preamble.d.ts +4 -4
- package/dist/runtime/subagents/preamble.js +9 -7
- package/dist/runtime/subagents/progress.d.ts +8 -6
- package/dist/runtime/subagents/progress.js +11 -6
- package/dist/runtime/subagents/render.d.ts +30 -0
- package/dist/runtime/subagents/render.js +53 -0
- package/dist/runtime/subagents/roster.d.ts +24 -7
- package/dist/runtime/subagents/roster.js +47 -11
- package/dist/runtime/subagents/skill-fork.d.ts +3 -2
- package/dist/runtime/subagents/skill-fork.js +8 -4
- package/dist/runtime/subagents/status.d.ts +14 -0
- package/dist/runtime/subagents/status.js +23 -0
- package/dist/runtime/subagents/subagents.service.d.ts +7 -4
- package/dist/runtime/subagents/subagents.service.js +11 -6
- package/dist/runtime/usage-report-jobs.d.ts +88 -0
- package/dist/runtime/usage-report-jobs.js +158 -0
- package/dist/runtime/usage-report.d.ts +33 -38
- package/dist/runtime/usage-report.js +169 -96
- package/dist/runtime/waits.d.ts +140 -37
- package/dist/runtime/waits.js +394 -106
- package/dist/sandbox/jobs.d.ts +40 -13
- package/dist/sandbox/jobs.js +57 -20
- package/dist/sandbox/leases.d.ts +37 -54
- package/dist/sandbox/leases.js +71 -115
- package/dist/sandbox/providers.d.ts +2 -2
- package/dist/sandbox/providers.js +1 -1
- package/dist/sandbox/sandbox.module.d.ts +3 -2
- package/dist/sandbox/sandbox.module.js +4 -3
- package/dist/sandbox/sandbox.service.d.ts +229 -134
- package/dist/sandbox/sandbox.service.js +630 -409
- package/dist/skills/catalog.d.ts +3 -2
- package/dist/skills/catalog.js +21 -43
- package/dist/skills/changes.controller.d.ts +7 -0
- package/dist/skills/changes.controller.js +19 -1
- package/dist/skills/invoke.js +8 -3
- package/dist/skills/package.d.ts +20 -1
- package/dist/skills/package.js +28 -1
- package/dist/skills/skills.controller.d.ts +39 -4
- package/dist/skills/skills.controller.js +88 -10
- package/dist/skills/skills.module.js +10 -1
- package/dist/skills/skills.service.d.ts +106 -26
- package/dist/skills/skills.service.js +421 -75
- package/dist/skills/usable.d.ts +81 -0
- package/dist/skills/usable.js +379 -0
- package/dist/tools/approvals.service.d.ts +20 -2
- package/dist/tools/approvals.service.js +23 -4
- package/dist/tools/builtin-names.d.ts +21 -5
- package/dist/tools/builtin-names.js +30 -5
- package/dist/tools/builtins/agent.d.ts +23 -21
- package/dist/tools/builtins/agent.js +62 -55
- package/dist/tools/builtins/builtin-tools.d.ts +6 -2
- package/dist/tools/builtins/builtin-tools.js +37 -12
- package/dist/tools/builtins/handback.d.ts +28 -0
- package/dist/tools/builtins/handback.js +53 -0
- package/dist/tools/builtins/platform.d.ts +34 -0
- package/dist/tools/builtins/platform.js +362 -0
- package/dist/tools/builtins/sandbox/bash.js +13 -3
- package/dist/tools/builtins/sandbox/common.d.ts +43 -24
- package/dist/tools/builtins/sandbox/common.js +80 -45
- package/dist/tools/builtins/sandbox/edit.js +2 -2
- package/dist/tools/builtins/sandbox/glob.js +2 -2
- package/dist/tools/builtins/sandbox/grep.js +2 -4
- package/dist/tools/builtins/sandbox/index.d.ts +1 -1
- package/dist/tools/builtins/sandbox/index.js +1 -1
- package/dist/tools/builtins/sandbox/read.js +1 -1
- package/dist/tools/builtins/sandbox/task-output.d.ts +14 -3
- package/dist/tools/builtins/sandbox/task-output.js +30 -5
- package/dist/tools/builtins/sandbox/task-stop.js +2 -1
- package/dist/tools/builtins/sandbox/write.js +2 -2
- package/dist/tools/builtins/send-message.d.ts +56 -0
- package/dist/tools/builtins/send-message.js +100 -0
- package/dist/tools/builtins/skill-load.d.ts +22 -14
- package/dist/tools/builtins/skill-load.js +86 -57
- package/dist/tools/builtins/skill-write.js +1 -1
- package/dist/tools/builtins/web/extract.js +5 -1
- package/dist/tools/builtins/web/fetch.js +1 -0
- package/dist/tools/builtins/web/search.js +1 -0
- package/dist/tools/connectors.controller.d.ts +10 -0
- package/dist/tools/connectors.controller.js +12 -0
- package/dist/tools/connectors.service.d.ts +46 -5
- package/dist/tools/connectors.service.js +94 -15
- package/dist/tools/extension-tools.controller.d.ts +14 -0
- package/dist/tools/extension-tools.controller.js +37 -0
- package/dist/tools/info.d.ts +42 -1
- package/dist/tools/info.js +64 -1
- package/dist/tools/org-tool-switches.d.ts +74 -0
- package/dist/tools/org-tool-switches.js +184 -0
- package/dist/tools/pipeline.d.ts +46 -40
- package/dist/tools/pipeline.js +193 -364
- package/dist/tools/policy.d.ts +1 -1
- package/dist/tools/policy.js +36 -16
- package/dist/tools/registry.d.ts +98 -5
- package/dist/tools/registry.js +87 -9
- package/dist/tools/tools.module.js +12 -2
- package/dist/ui/views.d.ts +2 -1
- package/dist/ui/views.js +17 -3
- package/package.json +3 -3
- package/src/migrations/0074_subagent_tree.sql +50 -0
- package/src/migrations/0075_plugin_scope.sql +61 -0
- package/src/migrations/0076_skills_created_by_nullable.sql +6 -0
- package/src/migrations/0077_scope_requests.sql +52 -0
- package/src/migrations/0078_scope_grant_switches.sql +18 -0
- package/src/migrations/0079_scope_live_install_switches.sql +19 -0
- package/src/migrations/0080_rename_enterprise_admin.sql +18 -0
- package/src/migrations/0081_platform_components.sql +129 -0
- package/src/migrations/0082_platform_migration.sql +33 -0
- package/src/migrations/0083_plugin_scope_sync_failures.sql +15 -0
- package/src/migrations/0084_org_owned_items.sql +85 -0
- package/src/migrations/0085_agent_templates_phase4.sql +45 -0
- package/src/migrations/0086_org_layering.sql +30 -0
- package/src/migrations/0087_approval_summary.sql +6 -0
- package/src/migrations/0088_environments.sql +80 -0
- package/src/migrations/0089_model_kinds_usage.sql +38 -0
- package/dist/catalog/upgrade-targets.d.ts +0 -56
- package/dist/catalog/upgrade-targets.js +0 -90
- package/dist/conversations/sandbox-status.d.ts +0 -24
- package/dist/conversations/sandbox-status.js +0 -52
- package/dist/extensions/org-config.controller.d.ts +0 -32
- package/dist/extensions/org-config.controller.js +0 -70
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
};
|
|
10
|
+
import { Inject, Injectable } from "@nestjs/common";
|
|
11
|
+
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
12
|
+
import { KernelDb } from "../infra/database/kernel-db.js";
|
|
13
|
+
import { LockService } from "../infra/lock/lock.service.js";
|
|
14
|
+
import { LockedInterval } from "../infra/schedule/locked-interval.js";
|
|
15
|
+
import { KERNEL_LOGGER } from "../infra/tokens.js";
|
|
16
|
+
import { SandboxProviders } from "../sandbox/providers.js";
|
|
17
|
+
/** The job's name (`@LockedInterval`, run lock `cron:environments-legacy-cleanup`). */
|
|
18
|
+
export const LEGACY_CLEANUP_JOB = "environments-legacy-cleanup";
|
|
19
|
+
/** Every 5 minutes, once per tick across replicas. */
|
|
20
|
+
const PERIOD_MS = 5 * 60_000;
|
|
21
|
+
/** Rows handled per tick. */
|
|
22
|
+
const BATCH = 50;
|
|
23
|
+
/** The time limit of one provider call. */
|
|
24
|
+
const CALL_TIMEOUT_MS = 120_000;
|
|
25
|
+
/**
|
|
26
|
+
* The cleanup of the per-conversation sandboxes of before environments (spec
|
|
27
|
+
* 2026-11-07-environments-design §4.2 item 9): for up to {@link BATCH} rows of the legacy
|
|
28
|
+
* `sandboxes` table per tick, the row's provider destroys the instance and the file system named
|
|
29
|
+
* `cap-<conversationId>` (`destroyByName`, `destroyFileSystemByName`; also the instance of the
|
|
30
|
+
* provider it replaced, `prev_provider`, when that one is loaded), then the row is deleted. No
|
|
31
|
+
* lease is taken: nothing holds a legacy row after the upgrade. A row whose provider is not loaded
|
|
32
|
+
* is kept (warned once per hour: on the tick in the first {@link PERIOD_MS} of each hour); a row
|
|
33
|
+
* whose destruction failed is retried at a later tick, after the others (`sweep_failed_at`). With
|
|
34
|
+
* no rows left a tick is one `SELECT … LIMIT 1`. The table is dropped by a later migration.
|
|
35
|
+
*/
|
|
36
|
+
let LegacySandboxCleanupJob = class LegacySandboxCleanupJob {
|
|
37
|
+
db;
|
|
38
|
+
providers;
|
|
39
|
+
config;
|
|
40
|
+
lockService;
|
|
41
|
+
log;
|
|
42
|
+
constructor(db, providers, config, lockService, log) {
|
|
43
|
+
this.db = db;
|
|
44
|
+
this.providers = providers;
|
|
45
|
+
this.config = config;
|
|
46
|
+
this.lockService = lockService;
|
|
47
|
+
this.log = log;
|
|
48
|
+
}
|
|
49
|
+
async tick(signal) {
|
|
50
|
+
const res = await this.runOnce(new Date(), signal);
|
|
51
|
+
if (res.destroyed > 0)
|
|
52
|
+
this.log.info("legacy sandboxes destroyed", { ...res });
|
|
53
|
+
}
|
|
54
|
+
/** One run (see the class); `signal` (the stop, or a lost run lock) is read between rows. */
|
|
55
|
+
async runOnce(now = new Date(), signal) {
|
|
56
|
+
const any = await this.db
|
|
57
|
+
.selectFrom("sandboxes")
|
|
58
|
+
.select("conversation_id")
|
|
59
|
+
.limit(1)
|
|
60
|
+
.executeTakeFirst();
|
|
61
|
+
if (any === undefined)
|
|
62
|
+
return { destroyed: 0, kept: 0 };
|
|
63
|
+
const byProvider = await this.db
|
|
64
|
+
.selectFrom("sandboxes")
|
|
65
|
+
.select(["provider", (eb) => eb.fn.countAll().as("n")])
|
|
66
|
+
.groupBy("provider")
|
|
67
|
+
.execute();
|
|
68
|
+
const loaded = byProvider.filter((p) => this.providers.lookup(p.provider) !== undefined);
|
|
69
|
+
const unloaded = byProvider.filter((p) => this.providers.lookup(p.provider) === undefined);
|
|
70
|
+
const kept = unloaded.reduce((sum, p) => sum + Number(p.n), 0);
|
|
71
|
+
if (unloaded.length > 0 && now.getTime() % 3_600_000 < PERIOD_MS) {
|
|
72
|
+
this.log.warn("legacy sandboxes kept: their provider is not loaded", {
|
|
73
|
+
providers: unloaded.map((p) => p.provider),
|
|
74
|
+
count: kept,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (loaded.length === 0)
|
|
78
|
+
return { destroyed: 0, kept };
|
|
79
|
+
const rows = await this.db
|
|
80
|
+
.selectFrom("sandboxes")
|
|
81
|
+
.select(["conversation_id", "provider", "prev_provider"])
|
|
82
|
+
.where("provider", "in", loaded.map((p) => p.provider))
|
|
83
|
+
.orderBy("sweep_failed_at", (o) => o.asc().nullsFirst())
|
|
84
|
+
.orderBy("conversation_id")
|
|
85
|
+
.limit(BATCH)
|
|
86
|
+
.execute();
|
|
87
|
+
let destroyed = 0;
|
|
88
|
+
for (const row of rows) {
|
|
89
|
+
if (signal?.aborted)
|
|
90
|
+
break;
|
|
91
|
+
const name = `cap-${row.conversation_id}`;
|
|
92
|
+
const impl = this.providers.lookup(row.provider);
|
|
93
|
+
if (impl === undefined)
|
|
94
|
+
continue; // unloaded since the query: kept for a later tick
|
|
95
|
+
const callSignal = () => signal
|
|
96
|
+
? AbortSignal.any([signal, AbortSignal.timeout(CALL_TIMEOUT_MS)])
|
|
97
|
+
: AbortSignal.timeout(CALL_TIMEOUT_MS);
|
|
98
|
+
try {
|
|
99
|
+
await impl.destroyByName(name, callSignal());
|
|
100
|
+
await impl.destroyFileSystemByName(name, callSignal());
|
|
101
|
+
if (row.prev_provider !== null && row.prev_provider !== row.provider) {
|
|
102
|
+
const prev = this.providers.lookup(row.prev_provider);
|
|
103
|
+
if (prev !== undefined)
|
|
104
|
+
await prev.destroyByName(name, callSignal());
|
|
105
|
+
else {
|
|
106
|
+
this.log.warn("legacy sandbox of a replaced provider left: provider not loaded", {
|
|
107
|
+
name,
|
|
108
|
+
provider: row.prev_provider,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
await this.db
|
|
113
|
+
.deleteFrom("sandboxes")
|
|
114
|
+
.where("conversation_id", "=", row.conversation_id)
|
|
115
|
+
.execute();
|
|
116
|
+
destroyed++;
|
|
117
|
+
}
|
|
118
|
+
catch (err) {
|
|
119
|
+
this.log.warn("cannot destroy legacy sandbox; will retry", { name, err });
|
|
120
|
+
await this.db
|
|
121
|
+
.updateTable("sandboxes")
|
|
122
|
+
.set({ sweep_failed_at: now })
|
|
123
|
+
.where("conversation_id", "=", row.conversation_id)
|
|
124
|
+
.execute();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return { destroyed, kept };
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
__decorate([
|
|
131
|
+
LockedInterval(LEGACY_CLEANUP_JOB, () => PERIOD_MS, { ttl: CALL_TIMEOUT_MS })
|
|
132
|
+
], LegacySandboxCleanupJob.prototype, "tick", null);
|
|
133
|
+
LegacySandboxCleanupJob = __decorate([
|
|
134
|
+
Injectable(),
|
|
135
|
+
__param(0, Inject(KernelDb)),
|
|
136
|
+
__param(1, Inject(SandboxProviders)),
|
|
137
|
+
__param(2, Inject(KernelConfigService)),
|
|
138
|
+
__param(3, Inject(LockService)),
|
|
139
|
+
__param(4, Inject(KERNEL_LOGGER))
|
|
140
|
+
], LegacySandboxCleanupJob);
|
|
141
|
+
export { LegacySandboxCleanupJob };
|
package/dist/errors.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const ERROR_CODES: {
|
|
|
14
14
|
readonly rate_limited: 429;
|
|
15
15
|
readonly "account.login_taken": 409;
|
|
16
16
|
readonly "account.not_found": 404;
|
|
17
|
-
readonly "account.
|
|
17
|
+
readonly "account.last_super_admin": 409;
|
|
18
18
|
readonly "auth.account_disabled": 403;
|
|
19
19
|
readonly "auth.required": 401;
|
|
20
20
|
readonly "auth.token_expired": 401;
|
|
@@ -39,10 +39,15 @@ export declare const ERROR_CODES: {
|
|
|
39
39
|
readonly "invitation.expired": 410;
|
|
40
40
|
readonly "invitation.used": 409;
|
|
41
41
|
readonly "extension.not_found": 404;
|
|
42
|
+
/** The extension registers no tool of that name (org tool switches, layering spec A §7). */
|
|
43
|
+
readonly "extension.tool_not_found": 404;
|
|
42
44
|
readonly "extension.unavailable": 503;
|
|
43
45
|
readonly "extension.no_org_config": 400;
|
|
44
46
|
readonly "extension.config_invalid": 400;
|
|
45
47
|
readonly "extension.config_readonly": 409;
|
|
48
|
+
readonly "extension.field_not_overridable": 400;
|
|
49
|
+
readonly "extension.no_org_override": 404;
|
|
50
|
+
readonly "extension.needs_config": 409;
|
|
46
51
|
readonly "extension.dependency_missing": 409;
|
|
47
52
|
readonly "extension.has_dependents": 409;
|
|
48
53
|
readonly "extension.not_enabled": 409;
|
|
@@ -72,12 +77,44 @@ export declare const ERROR_CODES: {
|
|
|
72
77
|
readonly "catalog.dependency_cycle": 409;
|
|
73
78
|
readonly "catalog.version_exists": 409;
|
|
74
79
|
readonly "catalog.item_not_found": 404;
|
|
80
|
+
/** An org-owned item its owner has not made shareable cannot be shown or associated (P3-16). */
|
|
81
|
+
readonly "catalog.not_shareable": 409;
|
|
82
|
+
/** The owner org cannot be removed from its own item's list (P3-17). */
|
|
83
|
+
readonly "catalog.owner_required": 409;
|
|
84
|
+
/**
|
|
85
|
+
* Only the org's own rows can be made shareable: not an agent's skill, not a copy linked to a
|
|
86
|
+
* platform item another owner has (P3-6).
|
|
87
|
+
*/
|
|
88
|
+
readonly "catalog.not_owned": 409;
|
|
89
|
+
/** The item (or the version asked for) waits for the super admin's confirmation (P3-9). */
|
|
90
|
+
readonly "catalog.item_pending": 409;
|
|
91
|
+
/** A super admin confirmation raced the item's removal (P3-21). */
|
|
92
|
+
readonly "catalog.item_removed": 409;
|
|
93
|
+
/** What deleting an org's own plugin does changed since its preview (P3-19). */
|
|
94
|
+
readonly "catalog.preview_stale": 409;
|
|
75
95
|
readonly "catalog.name_conflict": 409;
|
|
76
96
|
readonly "directory.not_configured": 409;
|
|
77
97
|
readonly "catalog.item_disabled": 403;
|
|
98
|
+
readonly "plugin.disabled": 409;
|
|
99
|
+
readonly "plugin.scope_locked": 409;
|
|
100
|
+
readonly "plugin.switch_stale": 409;
|
|
101
|
+
readonly "plugin.builtin": 409;
|
|
102
|
+
readonly "plugin.scope_stale": 409;
|
|
103
|
+
readonly "component.not_found": 404;
|
|
104
|
+
readonly "component.version_stale": 409;
|
|
105
|
+
/** A platform component offered to the org but off there (one more connector from a template). */
|
|
106
|
+
readonly "component.off": 409;
|
|
78
107
|
readonly "catalog.approval_required": 403;
|
|
79
108
|
readonly "catalog.request_not_found": 404;
|
|
109
|
+
/** No open org notice with that id for an admin of the org (inbox). */
|
|
110
|
+
readonly "inbox.notice_not_found": 404;
|
|
80
111
|
readonly "catalog.request_decided": 409;
|
|
112
|
+
/** A pending request of the same kind for the same item or entry exists (spec §5.1 rule 5). */
|
|
113
|
+
readonly "catalog.request_pending": 409;
|
|
114
|
+
/** The item is not in the state the request kind asks to change (already offered, on, ...). */
|
|
115
|
+
readonly "catalog.request_invalid": 409;
|
|
116
|
+
/** The deployment setting `orgMarketplaceBrowse` is off: no marketplace requests. */
|
|
117
|
+
readonly "catalog.marketplace_browse_disabled": 409;
|
|
81
118
|
readonly "catalog.custom_disabled": 403;
|
|
82
119
|
readonly "catalog.not_deployed": 409;
|
|
83
120
|
readonly "catalog.icon_not_found": 404;
|
|
@@ -89,6 +126,7 @@ export declare const ERROR_CODES: {
|
|
|
89
126
|
readonly "marketplace.private_address": 422;
|
|
90
127
|
readonly "marketplace.redirect": 422;
|
|
91
128
|
readonly "marketplace.incompatible": 409;
|
|
129
|
+
readonly "marketplace.entry_deprecated": 409;
|
|
92
130
|
readonly "marketplace.package_mismatch": 409;
|
|
93
131
|
readonly "marketplace.builtin": 409;
|
|
94
132
|
readonly "marketplace.git_failed": 502;
|
|
@@ -97,6 +135,10 @@ export declare const ERROR_CODES: {
|
|
|
97
135
|
readonly "marketplace.host_not_allowed": 403;
|
|
98
136
|
readonly "marketplace.path_unsupported": 422;
|
|
99
137
|
readonly "plugin.review_stale": 409;
|
|
138
|
+
readonly "plugin.name_taken": 409;
|
|
139
|
+
readonly "plugin.name_reserved": 409;
|
|
140
|
+
readonly "plugin.dependency_unavailable": 409;
|
|
141
|
+
readonly "plugin.extension_upload_pending": 501;
|
|
100
142
|
readonly "plugin.staging_not_found": 404;
|
|
101
143
|
readonly "plugin.install_failed": 502;
|
|
102
144
|
readonly "plugin.install_not_found": 404;
|
|
@@ -122,6 +164,27 @@ export declare const ERROR_CODES: {
|
|
|
122
164
|
readonly "agent.pinned_invalid": 400;
|
|
123
165
|
/** `subagents` of an agent definition is refused (details: `{ reason, path, value? }`). */
|
|
124
166
|
readonly "agent.subagents_invalid": 400;
|
|
167
|
+
/** Creating from a template with a visibility other than `private` without `agents.manage`. */
|
|
168
|
+
readonly "agent.visibility_forbidden": 403;
|
|
169
|
+
/** Creating from a template: the template or the org changed since the preview (P4-3). */
|
|
170
|
+
readonly "agent.template_preview_stale": 409;
|
|
171
|
+
/** The agent has no pending connector with that key (ruling P4-6). */
|
|
172
|
+
readonly "agent.pending_connector_not_found": 404;
|
|
173
|
+
/**
|
|
174
|
+
* The connector does not fit the pending entry (ruling P4-T6-1; details `[{ reason }]`:
|
|
175
|
+
* `template` another or no connector template, `protocol` another kind, `tools` none of the
|
|
176
|
+
* entry's tools, `not_synced` no tool snapshot yet: an OAuth connector to authorize first).
|
|
177
|
+
*/
|
|
178
|
+
readonly "agent.pending_connector_mismatch": 400;
|
|
179
|
+
/** Requesting connector setup for an agent with no pending connectors (ruling P4-T6-7). */
|
|
180
|
+
readonly "agent.no_pending_connectors": 409;
|
|
181
|
+
/**
|
|
182
|
+
* An org template's bare name is a type the org can already use (spec §5 rule 10, ruling
|
|
183
|
+
* P4-9; details `[{ owner, templateId }]`, `owner` as `plugin.name_taken`'s).
|
|
184
|
+
*/
|
|
185
|
+
readonly "agent_template.name_taken": 409;
|
|
186
|
+
/** An org template was saved since the editor read it (`expectedVersion` is stale, P4-12). */
|
|
187
|
+
readonly "agent_template.version_conflict": 409;
|
|
125
188
|
readonly "conversation.not_found": 404;
|
|
126
189
|
readonly "conversation.output_not_found": 404;
|
|
127
190
|
readonly "conversation.artifact_not_found": 404;
|
|
@@ -134,18 +197,22 @@ export declare const ERROR_CODES: {
|
|
|
134
197
|
/** A sub-agent's conversation takes no messages from people (sub-agents spec §6.1). */
|
|
135
198
|
readonly "conversation.read_only": 409;
|
|
136
199
|
readonly "run.not_active": 409;
|
|
200
|
+
/** A run that is not one of the conversation's (the live draft route, spec 2026-11-07 §3.2). */
|
|
201
|
+
readonly "run.not_found": 404;
|
|
137
202
|
/** A background task that is not in this conversation (or its sub-agents), or does not exist. */
|
|
138
203
|
readonly "background_task.not_found": 404;
|
|
139
204
|
/** The task's output cannot be read now (its sandbox is not running and no finish recorded it). */
|
|
140
205
|
readonly "background_task.output_unavailable": 409;
|
|
141
206
|
readonly "connector.not_found": 404;
|
|
142
207
|
readonly "connector.slug_taken": 409;
|
|
208
|
+
readonly "connector.kind_unavailable": 409;
|
|
143
209
|
readonly "connector.connect_failed": 502;
|
|
144
210
|
readonly "connector.tool_not_found": 404;
|
|
145
211
|
readonly "connector.tool_not_pending": 409;
|
|
146
212
|
readonly "connector.resources_disabled": 409;
|
|
147
213
|
readonly "approval.not_found": 404;
|
|
148
214
|
readonly "approval.already_decided": 409;
|
|
215
|
+
readonly "approval.scope_not_allowed": 409;
|
|
149
216
|
readonly "question.not_found": 404;
|
|
150
217
|
readonly "question.already_answered": 409;
|
|
151
218
|
readonly "tool_output.not_found": 404;
|
|
@@ -172,7 +239,18 @@ export declare const ERROR_CODES: {
|
|
|
172
239
|
readonly "attachment.too_many_pending": 429;
|
|
173
240
|
readonly "sandbox.unavailable": 503;
|
|
174
241
|
readonly "sandbox.busy": 409;
|
|
175
|
-
|
|
242
|
+
/** The environment is missing, deleted, or not the caller's (never 403, so ids cannot be probed). */
|
|
243
|
+
readonly "environment.not_found": 404;
|
|
244
|
+
/** The environment's file system is gone at the provider; reset its files to start empty. */
|
|
245
|
+
readonly "environment.files_lost": 409;
|
|
246
|
+
/** The caller may see the environment but not use it (project environments, later phases). */
|
|
247
|
+
readonly "environment.forbidden": 403;
|
|
248
|
+
/** The environment's provider is not the deployment's current one, or there is none. */
|
|
249
|
+
readonly "environment.unavailable": 503;
|
|
250
|
+
/** The person already has a live environment with this name (case-insensitive). */
|
|
251
|
+
readonly "environment.name_taken": 409;
|
|
252
|
+
/** The person already has `environments.maxPersonal` live personal environments. */
|
|
253
|
+
readonly "environment.limit_reached": 409;
|
|
176
254
|
readonly "skill.not_found": 404;
|
|
177
255
|
/** Also a skill neither the model nor a person could use (phase D: both invocation flags off). */
|
|
178
256
|
readonly "skill.invalid_package": 400;
|
|
@@ -181,6 +259,8 @@ export declare const ERROR_CODES: {
|
|
|
181
259
|
* (`details: [{ reason: "not_found" }]`) or is hidden from the menu (`not_user_invocable`).
|
|
182
260
|
*/
|
|
183
261
|
readonly "skill.not_invocable": 400;
|
|
262
|
+
/** Creating a skill from text (P3-24, F18): an org-level skill with this name already exists in the org. */
|
|
263
|
+
readonly "skill.name_exists": 409;
|
|
184
264
|
readonly "skill_change.not_found": 404;
|
|
185
265
|
readonly "skill_change.not_owner": 403;
|
|
186
266
|
readonly "skill_change.already_decided": 409;
|
|
@@ -200,6 +280,9 @@ export declare const ERROR_CODES: {
|
|
|
200
280
|
readonly "eval.candidate_invalid": 400;
|
|
201
281
|
readonly "model.unconfigured": 409;
|
|
202
282
|
readonly "model.purpose_unknown": 404;
|
|
283
|
+
readonly "model.provider_not_found": 404;
|
|
284
|
+
/** An extension's `ctx.models.embed` call was denied by a `model.request` policy hook. */
|
|
285
|
+
readonly "model.hook_denied": 403;
|
|
203
286
|
readonly "eval.result_not_found": 404;
|
|
204
287
|
};
|
|
205
288
|
export type ErrorCode = keyof typeof ERROR_CODES;
|
package/dist/errors.js
CHANGED
|
@@ -14,7 +14,7 @@ export const ERROR_CODES = {
|
|
|
14
14
|
rate_limited: 429,
|
|
15
15
|
"account.login_taken": 409,
|
|
16
16
|
"account.not_found": 404,
|
|
17
|
-
"account.
|
|
17
|
+
"account.last_super_admin": 409,
|
|
18
18
|
"auth.account_disabled": 403,
|
|
19
19
|
"auth.required": 401,
|
|
20
20
|
"auth.token_expired": 401,
|
|
@@ -39,10 +39,15 @@ export const ERROR_CODES = {
|
|
|
39
39
|
"invitation.expired": 410,
|
|
40
40
|
"invitation.used": 409,
|
|
41
41
|
"extension.not_found": 404,
|
|
42
|
+
/** The extension registers no tool of that name (org tool switches, layering spec A §7). */
|
|
43
|
+
"extension.tool_not_found": 404,
|
|
42
44
|
"extension.unavailable": 503,
|
|
43
45
|
"extension.no_org_config": 400,
|
|
44
46
|
"extension.config_invalid": 400,
|
|
45
47
|
"extension.config_readonly": 409,
|
|
48
|
+
"extension.field_not_overridable": 400,
|
|
49
|
+
"extension.no_org_override": 404,
|
|
50
|
+
"extension.needs_config": 409,
|
|
46
51
|
"extension.dependency_missing": 409,
|
|
47
52
|
"extension.has_dependents": 409,
|
|
48
53
|
"extension.not_enabled": 409,
|
|
@@ -72,12 +77,44 @@ export const ERROR_CODES = {
|
|
|
72
77
|
"catalog.dependency_cycle": 409,
|
|
73
78
|
"catalog.version_exists": 409,
|
|
74
79
|
"catalog.item_not_found": 404,
|
|
80
|
+
/** An org-owned item its owner has not made shareable cannot be shown or associated (P3-16). */
|
|
81
|
+
"catalog.not_shareable": 409,
|
|
82
|
+
/** The owner org cannot be removed from its own item's list (P3-17). */
|
|
83
|
+
"catalog.owner_required": 409,
|
|
84
|
+
/**
|
|
85
|
+
* Only the org's own rows can be made shareable: not an agent's skill, not a copy linked to a
|
|
86
|
+
* platform item another owner has (P3-6).
|
|
87
|
+
*/
|
|
88
|
+
"catalog.not_owned": 409,
|
|
89
|
+
/** The item (or the version asked for) waits for the super admin's confirmation (P3-9). */
|
|
90
|
+
"catalog.item_pending": 409,
|
|
91
|
+
/** A super admin confirmation raced the item's removal (P3-21). */
|
|
92
|
+
"catalog.item_removed": 409,
|
|
93
|
+
/** What deleting an org's own plugin does changed since its preview (P3-19). */
|
|
94
|
+
"catalog.preview_stale": 409,
|
|
75
95
|
"catalog.name_conflict": 409,
|
|
76
96
|
"directory.not_configured": 409,
|
|
77
97
|
"catalog.item_disabled": 403,
|
|
98
|
+
"plugin.disabled": 409,
|
|
99
|
+
"plugin.scope_locked": 409,
|
|
100
|
+
"plugin.switch_stale": 409,
|
|
101
|
+
"plugin.builtin": 409,
|
|
102
|
+
"plugin.scope_stale": 409,
|
|
103
|
+
"component.not_found": 404,
|
|
104
|
+
"component.version_stale": 409,
|
|
105
|
+
/** A platform component offered to the org but off there (one more connector from a template). */
|
|
106
|
+
"component.off": 409,
|
|
78
107
|
"catalog.approval_required": 403,
|
|
79
108
|
"catalog.request_not_found": 404,
|
|
109
|
+
/** No open org notice with that id for an admin of the org (inbox). */
|
|
110
|
+
"inbox.notice_not_found": 404,
|
|
80
111
|
"catalog.request_decided": 409,
|
|
112
|
+
/** A pending request of the same kind for the same item or entry exists (spec §5.1 rule 5). */
|
|
113
|
+
"catalog.request_pending": 409,
|
|
114
|
+
/** The item is not in the state the request kind asks to change (already offered, on, ...). */
|
|
115
|
+
"catalog.request_invalid": 409,
|
|
116
|
+
/** The deployment setting `orgMarketplaceBrowse` is off: no marketplace requests. */
|
|
117
|
+
"catalog.marketplace_browse_disabled": 409,
|
|
81
118
|
"catalog.custom_disabled": 403,
|
|
82
119
|
"catalog.not_deployed": 409,
|
|
83
120
|
"catalog.icon_not_found": 404,
|
|
@@ -89,6 +126,7 @@ export const ERROR_CODES = {
|
|
|
89
126
|
"marketplace.private_address": 422,
|
|
90
127
|
"marketplace.redirect": 422,
|
|
91
128
|
"marketplace.incompatible": 409,
|
|
129
|
+
"marketplace.entry_deprecated": 409,
|
|
92
130
|
"marketplace.package_mismatch": 409,
|
|
93
131
|
"marketplace.builtin": 409,
|
|
94
132
|
"marketplace.git_failed": 502,
|
|
@@ -97,6 +135,10 @@ export const ERROR_CODES = {
|
|
|
97
135
|
"marketplace.host_not_allowed": 403,
|
|
98
136
|
"marketplace.path_unsupported": 422,
|
|
99
137
|
"plugin.review_stale": 409,
|
|
138
|
+
"plugin.name_taken": 409,
|
|
139
|
+
"plugin.name_reserved": 409,
|
|
140
|
+
"plugin.dependency_unavailable": 409,
|
|
141
|
+
"plugin.extension_upload_pending": 501,
|
|
100
142
|
"plugin.staging_not_found": 404,
|
|
101
143
|
"plugin.install_failed": 502,
|
|
102
144
|
"plugin.install_not_found": 404,
|
|
@@ -122,6 +164,27 @@ export const ERROR_CODES = {
|
|
|
122
164
|
"agent.pinned_invalid": 400,
|
|
123
165
|
/** `subagents` of an agent definition is refused (details: `{ reason, path, value? }`). */
|
|
124
166
|
"agent.subagents_invalid": 400,
|
|
167
|
+
/** Creating from a template with a visibility other than `private` without `agents.manage`. */
|
|
168
|
+
"agent.visibility_forbidden": 403,
|
|
169
|
+
/** Creating from a template: the template or the org changed since the preview (P4-3). */
|
|
170
|
+
"agent.template_preview_stale": 409,
|
|
171
|
+
/** The agent has no pending connector with that key (ruling P4-6). */
|
|
172
|
+
"agent.pending_connector_not_found": 404,
|
|
173
|
+
/**
|
|
174
|
+
* The connector does not fit the pending entry (ruling P4-T6-1; details `[{ reason }]`:
|
|
175
|
+
* `template` another or no connector template, `protocol` another kind, `tools` none of the
|
|
176
|
+
* entry's tools, `not_synced` no tool snapshot yet: an OAuth connector to authorize first).
|
|
177
|
+
*/
|
|
178
|
+
"agent.pending_connector_mismatch": 400,
|
|
179
|
+
/** Requesting connector setup for an agent with no pending connectors (ruling P4-T6-7). */
|
|
180
|
+
"agent.no_pending_connectors": 409,
|
|
181
|
+
/**
|
|
182
|
+
* An org template's bare name is a type the org can already use (spec §5 rule 10, ruling
|
|
183
|
+
* P4-9; details `[{ owner, templateId }]`, `owner` as `plugin.name_taken`'s).
|
|
184
|
+
*/
|
|
185
|
+
"agent_template.name_taken": 409,
|
|
186
|
+
/** An org template was saved since the editor read it (`expectedVersion` is stale, P4-12). */
|
|
187
|
+
"agent_template.version_conflict": 409,
|
|
125
188
|
"conversation.not_found": 404,
|
|
126
189
|
"conversation.output_not_found": 404,
|
|
127
190
|
"conversation.artifact_not_found": 404,
|
|
@@ -134,18 +197,22 @@ export const ERROR_CODES = {
|
|
|
134
197
|
/** A sub-agent's conversation takes no messages from people (sub-agents spec §6.1). */
|
|
135
198
|
"conversation.read_only": 409,
|
|
136
199
|
"run.not_active": 409,
|
|
200
|
+
/** A run that is not one of the conversation's (the live draft route, spec 2026-11-07 §3.2). */
|
|
201
|
+
"run.not_found": 404,
|
|
137
202
|
/** A background task that is not in this conversation (or its sub-agents), or does not exist. */
|
|
138
203
|
"background_task.not_found": 404,
|
|
139
204
|
/** The task's output cannot be read now (its sandbox is not running and no finish recorded it). */
|
|
140
205
|
"background_task.output_unavailable": 409,
|
|
141
206
|
"connector.not_found": 404,
|
|
142
207
|
"connector.slug_taken": 409,
|
|
208
|
+
"connector.kind_unavailable": 409,
|
|
143
209
|
"connector.connect_failed": 502,
|
|
144
210
|
"connector.tool_not_found": 404,
|
|
145
211
|
"connector.tool_not_pending": 409,
|
|
146
212
|
"connector.resources_disabled": 409,
|
|
147
213
|
"approval.not_found": 404,
|
|
148
214
|
"approval.already_decided": 409,
|
|
215
|
+
"approval.scope_not_allowed": 409,
|
|
149
216
|
"question.not_found": 404,
|
|
150
217
|
"question.already_answered": 409,
|
|
151
218
|
"tool_output.not_found": 404,
|
|
@@ -172,7 +239,18 @@ export const ERROR_CODES = {
|
|
|
172
239
|
"attachment.too_many_pending": 429,
|
|
173
240
|
"sandbox.unavailable": 503,
|
|
174
241
|
"sandbox.busy": 409,
|
|
175
|
-
|
|
242
|
+
/** The environment is missing, deleted, or not the caller's (never 403, so ids cannot be probed). */
|
|
243
|
+
"environment.not_found": 404,
|
|
244
|
+
/** The environment's file system is gone at the provider; reset its files to start empty. */
|
|
245
|
+
"environment.files_lost": 409,
|
|
246
|
+
/** The caller may see the environment but not use it (project environments, later phases). */
|
|
247
|
+
"environment.forbidden": 403,
|
|
248
|
+
/** The environment's provider is not the deployment's current one, or there is none. */
|
|
249
|
+
"environment.unavailable": 503,
|
|
250
|
+
/** The person already has a live environment with this name (case-insensitive). */
|
|
251
|
+
"environment.name_taken": 409,
|
|
252
|
+
/** The person already has `environments.maxPersonal` live personal environments. */
|
|
253
|
+
"environment.limit_reached": 409,
|
|
176
254
|
"skill.not_found": 404,
|
|
177
255
|
/** Also a skill neither the model nor a person could use (phase D: both invocation flags off). */
|
|
178
256
|
"skill.invalid_package": 400,
|
|
@@ -181,6 +259,8 @@ export const ERROR_CODES = {
|
|
|
181
259
|
* (`details: [{ reason: "not_found" }]`) or is hidden from the menu (`not_user_invocable`).
|
|
182
260
|
*/
|
|
183
261
|
"skill.not_invocable": 400,
|
|
262
|
+
/** Creating a skill from text (P3-24, F18): an org-level skill with this name already exists in the org. */
|
|
263
|
+
"skill.name_exists": 409,
|
|
184
264
|
"skill_change.not_found": 404,
|
|
185
265
|
"skill_change.not_owner": 403,
|
|
186
266
|
"skill_change.already_decided": 409,
|
|
@@ -200,6 +280,9 @@ export const ERROR_CODES = {
|
|
|
200
280
|
"eval.candidate_invalid": 400,
|
|
201
281
|
"model.unconfigured": 409,
|
|
202
282
|
"model.purpose_unknown": 404,
|
|
283
|
+
"model.provider_not_found": 404,
|
|
284
|
+
/** An extension's `ctx.models.embed` call was denied by a `model.request` policy hook. */
|
|
285
|
+
"model.hook_denied": 403,
|
|
203
286
|
"eval.result_not_found": 404,
|
|
204
287
|
};
|
|
205
288
|
/** 业务代码抛出的 API 错误;由 HTTP 层的错误过滤器转成错误信封。 */
|
|
@@ -63,10 +63,7 @@ export interface ReconstructOptions {
|
|
|
63
63
|
* eval worker reads the current one). Another version than the logged one is a candidate change
|
|
64
64
|
* (`subagent_changed`).
|
|
65
65
|
*/
|
|
66
|
-
subagentTemplate?:
|
|
67
|
-
id: string;
|
|
68
|
-
version: number;
|
|
69
|
-
};
|
|
66
|
+
subagentTemplate?: SubagentTemplateRef;
|
|
70
67
|
/**
|
|
71
68
|
* A child case under another agent version (`agentVersion` differs): that version's own
|
|
72
69
|
* definition, compared with the logged sub-agent for `subagent_changed` (the candidate
|
|
@@ -87,6 +84,16 @@ export declare function reconstructRequest(s: CaseSnapshot, modelCallSeq: number
|
|
|
87
84
|
type SubagentStarted = EventPayload<"subagent_started">;
|
|
88
85
|
/** The `subagent_started` of a sub-agent's (child) log, or undefined for any other conversation. */
|
|
89
86
|
export declare function subagentStartedOf(events: readonly ConversationEvent[]): SubagentStarted | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* A plugin template child's template as a new dispatch would use it: the selected id, the version
|
|
89
|
+
* and the platform template whose content it is (absent: the org's own template; plugin scope
|
|
90
|
+
* phase 2, a linked copy shares its id with both sources, whose version numbers may collide).
|
|
91
|
+
*/
|
|
92
|
+
export interface SubagentTemplateRef {
|
|
93
|
+
id: string;
|
|
94
|
+
version: number;
|
|
95
|
+
platformTemplateId?: string;
|
|
96
|
+
}
|
|
90
97
|
/**
|
|
91
98
|
* Does a candidate change what a sub-agent (child) case would run (`subagent_changed`, spec
|
|
92
99
|
* §15.1)? Pure, from the snapshot alone, comparing the model-visible parts of the effective
|
|
@@ -101,7 +108,12 @@ export declare function subagentStartedOf(events: readonly ConversationEvent[]):
|
|
|
101
108
|
* parent version (its own version is {@link ReconstructOptions.subagentTemplate}). Template
|
|
102
109
|
* narrowing that needs the database (inline and plugin tool allowlists, skill names) is not
|
|
103
110
|
* recomputed: those compare instructions only.
|
|
104
|
-
* Models and params are not part of it: they are candidate axes of their own.
|
|
111
|
+
* Models and params are not part of it: they are candidate axes of their own. Neither is the
|
|
112
|
+
* candidate's `subagents` block as the child's own roster (allowlist, templates, limits; only a
|
|
113
|
+
* template child's entry in its parent's roster counts, `parentSide`) nor whether it offers `Agent`:
|
|
114
|
+
* whether a child has `Agent` follows its depth (`keepAgent` comes only from the logged child), and
|
|
115
|
+
* what a nesting child dispatches is recorded as its `Agent` results, which replay reuses (agent
|
|
116
|
+
* map spec §4.1, §8). A roster-only candidate therefore reports no `subagent_changed`.
|
|
105
117
|
*/
|
|
106
118
|
export declare function subagentChanged(started: SubagentStarted, logged: AgentDefinition, candidate: AgentDefinition, sameVersion: boolean,
|
|
107
119
|
/** The parent's definition at the case's version (the snapshot's), for template children. */
|
|
@@ -115,10 +127,7 @@ export declare function subagentCaseChanged(s: CaseSnapshot, c: {
|
|
|
115
127
|
changed: boolean;
|
|
116
128
|
definition: AgentDefinition;
|
|
117
129
|
agentVersion: number;
|
|
118
|
-
subagentTemplate?:
|
|
119
|
-
id: string;
|
|
120
|
-
version: number;
|
|
121
|
-
};
|
|
130
|
+
subagentTemplate?: SubagentTemplateRef;
|
|
122
131
|
subagentVersion?: AgentDefinition;
|
|
123
132
|
}): boolean;
|
|
124
133
|
/** 还原该请求要查的附件 id(该模型用得到的引用,去重、按出现顺序;见 `mediaRefs`)。 */
|
|
@@ -6,6 +6,7 @@ import { mediaRefs, planMedia, } from "../runtime/context/build.js";
|
|
|
6
6
|
import { assembleModelRequest } from "../runtime/model-call.js";
|
|
7
7
|
import { CHILD_REMOVED_TOOLS } from "../runtime/subagents/definition.js";
|
|
8
8
|
import { PINNED_SKILLS_LIMITS } from "../skills/catalog.js";
|
|
9
|
+
import { AGENT_TOOL } from "../tools/builtin-names.js";
|
|
9
10
|
import { canonicalJson } from "./recorded-tools.js";
|
|
10
11
|
import { toEvents } from "./snapshot.js";
|
|
11
12
|
const DRIFT_ORDER = [
|
|
@@ -210,10 +211,21 @@ export function subagentStartedOf(events) {
|
|
|
210
211
|
const e = events.find((x) => x.type === "subagent_started");
|
|
211
212
|
return e?.type === "subagent_started" ? e.payload : undefined;
|
|
212
213
|
}
|
|
213
|
-
const sameTemplate = (logged, t) => logged.source !== "plugin" ||
|
|
214
|
+
const sameTemplate = (logged, t) => logged.source !== "plugin" ||
|
|
215
|
+
(logged.id === t.id &&
|
|
216
|
+
logged.version === t.version &&
|
|
217
|
+
(logged.platformTemplateId ?? null) === (t.platformTemplateId ?? null));
|
|
214
218
|
const pinsOf = (d) => [...new Set(d.skills?.pinned ?? [])].slice(0, PINNED_SKILLS_LIMITS.count);
|
|
215
|
-
/**
|
|
216
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Tool refs as a sub-agent gets them without template narrowing (general and org agents).
|
|
221
|
+
* `Agent` depends on the child's depth, not on the definition (agent map spec §4.1): it is kept
|
|
222
|
+
* only when the logged child had it, so a child logged without it (at the depth limit, or before
|
|
223
|
+
* nesting) compares equal to a candidate that offers it.
|
|
224
|
+
*/
|
|
225
|
+
const childToolsOf = (d, keepAgent) => canonicalJson(d.tools.filter((t) => t.kind !== "builtin" ||
|
|
226
|
+
(!CHILD_REMOVED_TOOLS.includes(t.name) &&
|
|
227
|
+
(keepAgent || t.name !== AGENT_TOOL))));
|
|
228
|
+
const hasAgent = (d) => d.tools.some((t) => t.kind === "builtin" && t.name === AGENT_TOOL);
|
|
217
229
|
/** The parent's selection a template child depends on: its tools, org skills and roster entry. */
|
|
218
230
|
const parentSide = (d, started) => canonicalJson({
|
|
219
231
|
tools: d.tools,
|
|
@@ -236,22 +248,29 @@ const parentSide = (d, started) => canonicalJson({
|
|
|
236
248
|
* parent version (its own version is {@link ReconstructOptions.subagentTemplate}). Template
|
|
237
249
|
* narrowing that needs the database (inline and plugin tool allowlists, skill names) is not
|
|
238
250
|
* recomputed: those compare instructions only.
|
|
239
|
-
* Models and params are not part of it: they are candidate axes of their own.
|
|
251
|
+
* Models and params are not part of it: they are candidate axes of their own. Neither is the
|
|
252
|
+
* candidate's `subagents` block as the child's own roster (allowlist, templates, limits; only a
|
|
253
|
+
* template child's entry in its parent's roster counts, `parentSide`) nor whether it offers `Agent`:
|
|
254
|
+
* whether a child has `Agent` follows its depth (`keepAgent` comes only from the logged child), and
|
|
255
|
+
* what a nesting child dispatches is recorded as its `Agent` results, which replay reuses (agent
|
|
256
|
+
* map spec §4.1, §8). A roster-only candidate therefore reports no `subagent_changed`.
|
|
240
257
|
*/
|
|
241
258
|
export function subagentChanged(started, logged, candidate, sameVersion,
|
|
242
259
|
/** The parent's definition at the case's version (the snapshot's), for template children. */
|
|
243
260
|
original) {
|
|
261
|
+
const keepAgent = hasAgent(logged);
|
|
262
|
+
const childTools = (d) => childToolsOf(d, keepAgent);
|
|
244
263
|
const differs = (instructions, pinned, tools) => instructions !== logged.instructions ||
|
|
245
264
|
(pinned !== null && canonicalJson(pinned) !== canonicalJson(pinsOf(logged))) ||
|
|
246
|
-
(tools !== null && tools !==
|
|
265
|
+
(tools !== null && tools !== childTools(logged));
|
|
247
266
|
if (sameVersion) {
|
|
248
267
|
return differs(candidate.instructions, pinsOf(candidate), canonicalJson(candidate.tools));
|
|
249
268
|
}
|
|
250
269
|
switch (started.template.source) {
|
|
251
270
|
case "agent":
|
|
252
|
-
return differs(candidate.instructions, pinsOf(candidate),
|
|
271
|
+
return differs(candidate.instructions, pinsOf(candidate), childTools(candidate));
|
|
253
272
|
case "general":
|
|
254
|
-
return (differs(candidate.instructions, [],
|
|
273
|
+
return (differs(candidate.instructions, [], childTools(candidate)) ||
|
|
255
274
|
(original !== undefined && parentSide(original, started) !== parentSide(candidate, started)));
|
|
256
275
|
case "inline": {
|
|
257
276
|
const t = candidate.subagents?.inline?.find((x) => x.name === started.agentType);
|
|
@@ -21,8 +21,10 @@ import type { ResolvedCandidate } from "./step-replay.js";
|
|
|
21
21
|
* 原运行开始时的 `skills_catalog` 照抄;然后写 `runs` 行与 `run_started`,`agent` 用候选定义。
|
|
22
22
|
* - 插话:原运行中途吸收的可吸收事件(user_message, and finished background tasks: background Bash
|
|
23
23
|
* spec §4.4),在「原吸收步骤 ≤ 当前步骤」时追加进评测对话并交给 loop(a recorded finish is
|
|
24
|
-
* appended as recorded: no task starts, polls or stops
|
|
25
|
-
*
|
|
24
|
+
* appended as recorded: no task starts, polls or stops; likewise a sub-agent's delivery, agent map
|
|
25
|
+
* spec §8: no child is dispatched, sent to or woken)。
|
|
26
|
+
* - A wake run (its boundary a finished background task or a sub-agent's delivery, not a message)
|
|
27
|
+
* is seeded from that event.
|
|
26
28
|
* - 计费(C7,与单步回放同一套):每次模型请求(含压缩、重试、兜底)发出前查运行仍在执行、仍持有认领;
|
|
27
29
|
* 收完按真实用量、没收完按估算 `consumeTokens`(越限即 `capped`,下一次请求前停下)。
|
|
28
30
|
* - 附件按快照自己的组织与原对话取(C3)。
|