@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AgentTemplate, type ConnectorTemplateFile, type ConnectorTemplateSpec, type PluginManifest } from "@capybara-hq/plugin-sdk";
|
|
2
2
|
import type { KernelSchemaDb, SourceFormat } from "../db/kernel-schema.js";
|
|
3
|
+
import { ApiError } from "../errors.js";
|
|
3
4
|
import { OrgExtensionConfigs, type OrgExtensionInput, type OrgExtensionPutOptions } from "../extensions/org-config.js";
|
|
4
5
|
import { ExtensionRegistry } from "../extensions/registry.js";
|
|
5
6
|
import { KernelConfigService } from "../infra/config/kernel-config.service.js";
|
|
@@ -10,10 +11,10 @@ import { OrgLock } from "../orgs/org-lock.js";
|
|
|
10
11
|
import type { OrgAction } from "../orgs/roles.js";
|
|
11
12
|
import { type SkillConflict, SkillsService } from "../skills/skills.service.js";
|
|
12
13
|
import { StorageService } from "../storage/storage.service.js";
|
|
13
|
-
import type { CreateConnectorInput } from "../tools/connectors.service.js";
|
|
14
|
+
import type { ConnectorDetail, CreateConnectorInput, ToolIssue } from "../tools/connectors.service.js";
|
|
14
15
|
import { ConnectorsService } from "../tools/connectors.service.js";
|
|
15
16
|
import { type CatalogVersionFiles, type TemplateDeps } from "./catalog-content.js";
|
|
16
|
-
import {
|
|
17
|
+
import { type DefinitionRefs } from "./component-state.js";
|
|
17
18
|
/** What an org fills in for one connector template at install (C30). */
|
|
18
19
|
export interface ConnectorInstallInput {
|
|
19
20
|
name?: string;
|
|
@@ -50,9 +51,49 @@ export interface UninstallReport {
|
|
|
50
51
|
kept: {
|
|
51
52
|
kind: ComponentKind;
|
|
52
53
|
ref: string;
|
|
53
|
-
reason: "pre_existing" | "used_by_agents" | "used_by_other_install" | "used_by_connectors" | "used_by_plugins"
|
|
54
|
+
reason: "pre_existing" | "used_by_agents" | "used_by_other_install" | "used_by_connectors" | "used_by_plugins"
|
|
55
|
+
/** A dependency install still wanted on in the org by its own scope: it stays, standalone. */
|
|
56
|
+
| "wanted_by_scope"
|
|
57
|
+
/**
|
|
58
|
+
* A connector the install created, kept by a scope sync uninstall (the plugin disabled or its
|
|
59
|
+
* scope narrowed, spec §5 rule 8): it stays as the org's own, with its credentials.
|
|
60
|
+
*/
|
|
61
|
+
| "org_owned";
|
|
54
62
|
}[];
|
|
55
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* What switching a plugin off would do, read without changing anything: its components, the ones the
|
|
66
|
+
* uninstall rules would keep for a reason visible beforehand (a component that pre-existed, or one an
|
|
67
|
+
* agent uses), and the agents that use the plugin's skills, connectors or agent templates.
|
|
68
|
+
*/
|
|
69
|
+
export interface UninstallPreview {
|
|
70
|
+
installId: string;
|
|
71
|
+
name: string;
|
|
72
|
+
version: string;
|
|
73
|
+
components: {
|
|
74
|
+
kind: ComponentKind;
|
|
75
|
+
ref: string;
|
|
76
|
+
created: boolean;
|
|
77
|
+
}[];
|
|
78
|
+
kept: UninstallReport["kept"];
|
|
79
|
+
agents: {
|
|
80
|
+
id: string;
|
|
81
|
+
name: string;
|
|
82
|
+
uses: {
|
|
83
|
+
kind: ComponentKind;
|
|
84
|
+
ref: string;
|
|
85
|
+
}[];
|
|
86
|
+
}[];
|
|
87
|
+
}
|
|
88
|
+
/** The confirm hash of an uninstall preview: sha256 over its sorted JSON (the scheme of `diffHash`). */
|
|
89
|
+
export declare function uninstallPreviewHash(p: UninstallPreview): string;
|
|
90
|
+
/** Upserts the org's switch row of an item in the caller's transaction (the org lock is held). */
|
|
91
|
+
export declare function upsertOrgSwitch(db: KernelSchemaDb, orgId: string, itemId: string, enabled: boolean, actor: string | null): Promise<void>;
|
|
92
|
+
/** The kernel (actor null, the scope sync) never installs what needs the org's input. */
|
|
93
|
+
export declare class NeedsOrgInput extends ApiError {
|
|
94
|
+
readonly plugin: string;
|
|
95
|
+
constructor(plugin: string);
|
|
96
|
+
}
|
|
56
97
|
/** A plugin install in an org (`GET /orgs/:orgId/plugin-installs`). */
|
|
57
98
|
export interface PluginInstallView {
|
|
58
99
|
id: string;
|
|
@@ -78,13 +119,13 @@ export interface PluginInstallView {
|
|
|
78
119
|
skillVersion: number | null;
|
|
79
120
|
dropped: boolean;
|
|
80
121
|
}[];
|
|
81
|
-
/** The highest version this install can be upgraded to now, null when none (spec §10). */
|
|
82
|
-
upgradeAvailable: string | null;
|
|
83
122
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
123
|
+
* Always null / false since plugin scope phase 2: a platform plugin has one version for the
|
|
124
|
+
* deployment and the platform update moves every org install (ruling F2); kept for the web until
|
|
125
|
+
* its upgrade dialog goes.
|
|
86
126
|
*/
|
|
87
|
-
|
|
127
|
+
upgradeAvailable: null;
|
|
128
|
+
deploymentPending: false;
|
|
88
129
|
}
|
|
89
130
|
/** A dependency resolved against the catalog. */
|
|
90
131
|
export interface ResolvedDependency {
|
|
@@ -149,6 +190,8 @@ export declare class InstallFailure extends Error {
|
|
|
149
190
|
dependency: string[], rolledBack: boolean);
|
|
150
191
|
get code(): string;
|
|
151
192
|
}
|
|
193
|
+
/** Merged into an install's or uninstall's audit detail (a write made through the Platform tool). */
|
|
194
|
+
type AuditDetail = Record<string, unknown>;
|
|
152
195
|
export interface UninstallCtx {
|
|
153
196
|
report: UninstallReport;
|
|
154
197
|
/** The installs this uninstall is removing (none of them counts as still using a component). */
|
|
@@ -160,12 +203,15 @@ export interface UninstallCtx {
|
|
|
160
203
|
reason?: string;
|
|
161
204
|
opts: {
|
|
162
205
|
actorTokenId?: string;
|
|
206
|
+
auditDetail?: AuditDetail;
|
|
163
207
|
};
|
|
208
|
+
/** Uninstalled by the plugin scope sync: the connectors it created stay as the org's own. */
|
|
209
|
+
via?: "scope";
|
|
164
210
|
}
|
|
165
211
|
/**
|
|
166
|
-
* Resolves a plugin's dependencies against the catalog: for each one the
|
|
167
|
-
*
|
|
168
|
-
* dependency nothing satisfies -> `catalog.dependency_unresolved`; a disabled one ->
|
|
212
|
+
* Resolves a plugin's dependencies against the catalog: for each one the platform version of the
|
|
213
|
+
* live item with that name, which must satisfy its range (see `resolveOne`). The whole dependency
|
|
214
|
+
* tree is checked: a dependency nothing satisfies -> `catalog.dependency_unresolved`; a disabled one ->
|
|
169
215
|
* `catalog.dependency_disabled`; a cycle (`a` -> `b` -> `a`, by name) or nesting deeper than
|
|
170
216
|
* {@link DEPENDENCY_DEPTH_LIMIT} -> `catalog.dependency_cycle`. Returns the direct dependencies.
|
|
171
217
|
*/
|
|
@@ -194,9 +240,11 @@ export declare function under(e: unknown, at: string): unknown;
|
|
|
194
240
|
* not run it; already enabled is recorded created=false);
|
|
195
241
|
* 3. connectors from the templates (credentials / clients go to secrets, default policies are
|
|
196
242
|
* recorded `policy_source 'template'`);
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
243
|
+
* The plugin's skills and agent templates are platform components (plugin scope phase 2): stored
|
|
244
|
+
* once for the deployment and on in the org while the plugin is, so an install writes no org rows
|
|
245
|
+
* for them; a skill name the org already uses (its own skill, another plugin's) refuses the install
|
|
246
|
+
* while planning with `plugin.skill_conflict` (spec §9.2, rule 10). Uninstall leaves the org copies
|
|
247
|
+
* earlier installs wrote (linked to the platform components by the migration).
|
|
200
248
|
* Approval follows the installed plugin's policy only (spec §10): dependency components are
|
|
201
249
|
* re-checked against the root item's policy and their own item's disabled state. Each component is
|
|
202
250
|
* recorded in `plugin_install_components` as soon as it exists; if any step fails, the components
|
|
@@ -204,9 +252,10 @@ export declare function under(e: unknown, at: string): unknown;
|
|
|
204
252
|
* install is marked failed (error holds only the step and the error code) and 502
|
|
205
253
|
* `plugin.install_failed` is thrown. Uninstall removes only components with created=true that
|
|
206
254
|
* nothing else uses, and reports what it kept and why. No in-process state; the org row lock
|
|
207
|
-
* serializes writes within one org.
|
|
208
|
-
* (plugin-upgrade.ts
|
|
209
|
-
* `
|
|
255
|
+
* serializes writes within one org. There is no per-org upgrade: a platform plugin is updated
|
|
256
|
+
* once for the deployment (`PlatformPluginUpdater`, plugin-upgrade.ts, ruling F2); an install left
|
|
257
|
+
* `upgrading` by an earlier per-org upgrade is undone from its journal by the next uninstall. The
|
|
258
|
+
* methods without `private` are internal to the catalog, not an API.
|
|
210
259
|
*/
|
|
211
260
|
export declare class PluginInstaller {
|
|
212
261
|
private readonly kdb;
|
|
@@ -217,7 +266,6 @@ export declare class PluginInstaller {
|
|
|
217
266
|
private readonly registry;
|
|
218
267
|
private readonly skills;
|
|
219
268
|
private readonly orgConfigs;
|
|
220
|
-
private readonly requests;
|
|
221
269
|
private readonly config;
|
|
222
270
|
/** Org connectors: installs create, upgrade and remove them. */
|
|
223
271
|
private readonly connectors;
|
|
@@ -227,7 +275,7 @@ export declare class PluginInstaller {
|
|
|
227
275
|
/** The org row lock (orgs/org-lock.ts): joins the caller's transaction. */
|
|
228
276
|
orgLock: OrgLock, storage: StorageService,
|
|
229
277
|
/** The loaded extensions and connectors of this replica (the extension registry). */
|
|
230
|
-
registry: ExtensionRegistry, skills: SkillsService, orgConfigs: OrgExtensionConfigs,
|
|
278
|
+
registry: ExtensionRegistry, skills: SkillsService, orgConfigs: OrgExtensionConfigs, config: KernelConfigService,
|
|
231
279
|
/** Org connectors: installs create, upgrade and remove them. */
|
|
232
280
|
connectors: ConnectorsService, log: KernelLogger, txHost: TransactionHost);
|
|
233
281
|
/** The kernel-schema handle of the current context (the transaction, else the pool). */
|
|
@@ -242,8 +290,11 @@ export declare class PluginInstaller {
|
|
|
242
290
|
preflight(orgId: string, actor: string, itemId: string, version: string): Promise<{
|
|
243
291
|
actions: OrgAction[];
|
|
244
292
|
}>;
|
|
245
|
-
install(orgId: string, actor: string, itemId: string, version: string, input: PluginInstallInput, opts?: {
|
|
293
|
+
install(orgId: string, actor: string | null, itemId: string, version: string, input: PluginInstallInput, opts?: {
|
|
246
294
|
actorTokenId?: string;
|
|
295
|
+
auditDetail?: AuditDetail;
|
|
296
|
+
switchOn?: boolean;
|
|
297
|
+
via?: "scope";
|
|
247
298
|
}): Promise<PluginInstallView>;
|
|
248
299
|
/**
|
|
249
300
|
* Refuses a plan whose skills would overwrite a skill of other provenance (spec §9.2, Decision
|
|
@@ -260,7 +311,20 @@ export declare class PluginInstaller {
|
|
|
260
311
|
* an empty input. `at` prefixes validation paths (`dependencies.<name>.` for a dependency);
|
|
261
312
|
* `approvedBy` is the root item for a dependency.
|
|
262
313
|
*/
|
|
263
|
-
plan(orgId: string, actor: string, itemId: string, version: string, input: PluginInstallInput | null, at: string, approvedBy: string | undefined): Promise<InstallPlan>;
|
|
314
|
+
plan(orgId: string, actor: string | null, itemId: string, version: string, input: PluginInstallInput | null, at: string, approvedBy: string | undefined): Promise<InstallPlan>;
|
|
315
|
+
/**
|
|
316
|
+
* The providers of the templates' connector kinds as implied dependencies: a template whose
|
|
317
|
+
* `plugin` is neither this plugin, a declared dependency nor already enabled in the org makes that
|
|
318
|
+
* plugin a dependency (installed first, recorded like a declared one, so an uninstall hands it
|
|
319
|
+
* back). No such plugin offered by the catalog -> `connector.kind_unavailable` naming it, before
|
|
320
|
+
* anything is written.
|
|
321
|
+
*/
|
|
322
|
+
impliedProviders(orgId: string, manifest: PluginManifest, templates: {
|
|
323
|
+
id: string;
|
|
324
|
+
file: ConnectorTemplateFile;
|
|
325
|
+
}[], declared: {
|
|
326
|
+
name: string;
|
|
327
|
+
}[]): Promise<ResolvedDependency[]>;
|
|
264
328
|
/**
|
|
265
329
|
* The connector input of one template from the org's input (C30), checked without a connection:
|
|
266
330
|
* the template's connector extension deployed, the input valid, the credential / OAuth client it
|
|
@@ -300,12 +364,16 @@ export declare class PluginInstaller {
|
|
|
300
364
|
* {@link InstallFailure} once the row exists (after rolling back); errors before it propagate
|
|
301
365
|
* as they are. Returns the install id.
|
|
302
366
|
*/
|
|
303
|
-
execute(orgId: string, actor: string, plan: InstallPlan, opts: {
|
|
367
|
+
execute(orgId: string, actor: string | null, plan: InstallPlan, opts: {
|
|
304
368
|
actorTokenId?: string;
|
|
369
|
+
auditDetail?: AuditDetail;
|
|
305
370
|
}, ctx: {
|
|
306
371
|
actions: OrgAction[];
|
|
307
372
|
approvedBy?: string;
|
|
308
373
|
parent?: string;
|
|
374
|
+
switchOn?: boolean;
|
|
375
|
+
/** Installed by the plugin scope sync (recorded in the audits). */
|
|
376
|
+
via?: "scope";
|
|
309
377
|
}): Promise<string>;
|
|
310
378
|
/**
|
|
311
379
|
* The install row (role and item policy re-checked under the lock; one live install per org and
|
|
@@ -318,13 +386,8 @@ export declare class PluginInstaller {
|
|
|
318
386
|
* created), and the ledger row is written before the COMMIT, so no concurrent uninstall fits
|
|
319
387
|
* between enabling and recording. Used by the install and the upgrade.
|
|
320
388
|
*/
|
|
321
|
-
enableExtension(orgId: string, name: string, input: OrgExtensionInput, actor: string, actorTokenId: string | undefined, opts: Pick<OrgExtensionPutOptions, "viaItem" | "approvedBy">, record: (c: Component) => Promise<void>): Promise<void>;
|
|
389
|
+
enableExtension(orgId: string, name: string, input: OrgExtensionInput, actor: string | null, actorTokenId: string | undefined, opts: Pick<OrgExtensionPutOptions, "viaItem" | "approvedBy">, record: (c: Component) => Promise<void>): Promise<void>;
|
|
322
390
|
private createInstallRow;
|
|
323
|
-
/**
|
|
324
|
-
* An agent template step: created (or a new version of the org's live template of this plugin and
|
|
325
|
-
* name) and recorded in one transaction of its own, under the org row lock.
|
|
326
|
-
*/
|
|
327
|
-
private installAgentTemplate;
|
|
328
391
|
/** The install `installed` and its `plugin.org_installed` audit, under the org row lock (its own transaction). */
|
|
329
392
|
private markInstalled;
|
|
330
393
|
/** The install `failed` with `{ step, code }` and its `plugin.org_install_failed` audit (its own transaction). */
|
|
@@ -353,7 +416,7 @@ export declare class PluginInstaller {
|
|
|
353
416
|
*/
|
|
354
417
|
private rollbackOne;
|
|
355
418
|
/** Removes one component (one already gone is no error); returns whether anything changed. */
|
|
356
|
-
removeComponent(orgId: string, actor: string, c: Component, reason: string): Promise<boolean>;
|
|
419
|
+
removeComponent(orgId: string, actor: string | null, c: Component, reason: string): Promise<boolean>;
|
|
357
420
|
/**
|
|
358
421
|
* Uninstall (the plugin's component actions, see `requiredActions`, re-checked under the org row
|
|
359
422
|
* lock, one transaction). Removes only components with created=true:
|
|
@@ -376,10 +439,19 @@ export declare class PluginInstaller {
|
|
|
376
439
|
* (a replica crashed midway) - the last two are cleaned up as a rollback (versions added to
|
|
377
440
|
* existing skills are reverted too). Still installing -> `plugin.install_in_progress`.
|
|
378
441
|
*/
|
|
379
|
-
uninstall(orgId: string, actor: string, installId: string, opts?: {
|
|
442
|
+
uninstall(orgId: string, actor: string | null, installId: string, opts?: {
|
|
380
443
|
actorTokenId?: string;
|
|
444
|
+
auditDetail?: AuditDetail;
|
|
445
|
+
via?: "scope";
|
|
446
|
+
}, sw?: {
|
|
447
|
+
expectHash?: string;
|
|
381
448
|
}): Promise<UninstallReport>;
|
|
382
|
-
/**
|
|
449
|
+
/**
|
|
450
|
+
* The uninstall's one transaction; the extensions it disabled are notified once it commits. A
|
|
451
|
+
* scope sync uninstall (`via: "scope"`) re-checks under the org row lock that the item is still
|
|
452
|
+
* not wanted in the org and that no other live install depends on it ({@link ScopeStillWanted},
|
|
453
|
+
* nothing written), and keeps the connectors it created as the org's own (`org_owned`).
|
|
454
|
+
*/
|
|
383
455
|
private writeUninstall;
|
|
384
456
|
/**
|
|
385
457
|
* The oldest other live install (not in `removing`) that has component `kind` / `ref`, or
|
|
@@ -394,7 +466,7 @@ export declare class PluginInstaller {
|
|
|
394
466
|
* outcome of the install itself is returned for the caller to report: `missing`, `kept` (another
|
|
395
467
|
* install outside this uninstall depends on it) or `removed`.
|
|
396
468
|
*/
|
|
397
|
-
uninstallIn(orgId: string, actor: string, installId: string, ctx: UninstallCtx): Promise<"missing" | "kept" | "removed">;
|
|
469
|
+
uninstallIn(orgId: string, actor: string | null, installId: string, ctx: UninstallCtx): Promise<"missing" | "kept" | "removed" | "wanted_by_scope">;
|
|
398
470
|
/**
|
|
399
471
|
* The uninstall rules for one component an install created (a skill, connector or extension;
|
|
400
472
|
* dependency installs recurse through {@link uninstallIn}), in the caller's transaction: kept
|
|
@@ -405,7 +477,7 @@ export declare class PluginInstaller {
|
|
|
405
477
|
* (`used_by_plugins`); otherwise removed (`removed`, or `gone` when it no longer existed). Used
|
|
406
478
|
* by uninstall and by an upgrade's removals.
|
|
407
479
|
*/
|
|
408
|
-
decideRemovalIn(orgId: string, actor: string, c: Component, removing: Set<string>, agentRefs: {
|
|
480
|
+
decideRemovalIn(orgId: string, actor: string | null, c: Component, removing: Set<string>, agentRefs: {
|
|
409
481
|
connectors: Set<string>;
|
|
410
482
|
skills: Set<string>;
|
|
411
483
|
templates: Set<string>;
|
|
@@ -423,21 +495,92 @@ export declare class PluginInstaller {
|
|
|
423
495
|
* extension among them needs `afterDisable` once committed). Used when an upgrade fails and when
|
|
424
496
|
* an interrupted one is cleaned up.
|
|
425
497
|
*/
|
|
426
|
-
undoUpgradeIn(orgId: string, actor: string, installId: string, steps: readonly UpgradeStep[], reason: string): Promise<{
|
|
498
|
+
undoUpgradeIn(orgId: string, actor: string | null, installId: string, steps: readonly UpgradeStep[], reason: string): Promise<{
|
|
427
499
|
kind: ComponentKind;
|
|
428
500
|
ref: string;
|
|
429
501
|
}[]>;
|
|
502
|
+
/**
|
|
503
|
+
* Installs the dependencies an installed plugin's version declares and the org lacks (rule 9),
|
|
504
|
+
* as the kernel (actor null): a platform update can add one. Each is recorded on the install
|
|
505
|
+
* as a `plugin` component (created when this installed it, so an uninstall takes it along). One
|
|
506
|
+
* that needs the org's input (connector templates) is left out and its name returned. A
|
|
507
|
+
* dependency already installed in the org is recorded as it is (created false).
|
|
508
|
+
*/
|
|
509
|
+
addMissingDependencies(orgId: string, installId: string): Promise<string[]>;
|
|
510
|
+
/**
|
|
511
|
+
* The connector templates of an installed plugin that are on in the org (ruling P2-6) and have
|
|
512
|
+
* no live connector there: made from the platform template (`platform_template_id`) or recorded
|
|
513
|
+
* on the install (`template_id`). The org's plugin is `needs_config` while any is missing (ruling
|
|
514
|
+
* P2-10). Empty for a plugin not installed.
|
|
515
|
+
*/
|
|
516
|
+
missingConnectors(orgId: string, itemId: string): Promise<{
|
|
517
|
+
installId: string;
|
|
518
|
+
version: string;
|
|
519
|
+
templates: {
|
|
520
|
+
id: string;
|
|
521
|
+
file: ConnectorTemplateFile;
|
|
522
|
+
}[];
|
|
523
|
+
} | undefined>;
|
|
524
|
+
/**
|
|
525
|
+
* Creates the connectors an installed plugin is missing (ruling P2-10, `POST …/catalog/:itemId/
|
|
526
|
+
* connectors`): `input.connectors` names some of {@link missingConnectors}' templates with the
|
|
527
|
+
* same input as an install (endpoint, credential or OAuth client); each is created as at install
|
|
528
|
+
* and recorded on the install. Returns the created connectors by template.
|
|
529
|
+
*/
|
|
530
|
+
configureConnectors(orgId: string, actor: string, itemId: string, input: PluginInstallInput, opts?: {
|
|
531
|
+
actorTokenId?: string;
|
|
532
|
+
}): Promise<{
|
|
533
|
+
templateId: string;
|
|
534
|
+
connectorId: string;
|
|
535
|
+
}[]>;
|
|
536
|
+
/** A configured connector's ledger row (its own transaction). */
|
|
537
|
+
private recordConnector;
|
|
538
|
+
/**
|
|
539
|
+
* One more connector from a platform connector template on in the org (rulings P4-7, P4-T6-8;
|
|
540
|
+
* `POST …/connector-templates/:templateId/connectors`): `templateId` is the platform connector
|
|
541
|
+
* template's id; `config` is an install's connector input (endpoint, credential or OAuth client,
|
|
542
|
+
* slug) and `name` its name. Without a slug the name and slug default to the first free ones,
|
|
543
|
+
* chosen by the create under the org lock after its outbound calls
|
|
544
|
+
* (`CreateConnectorInput.slugDefault`); only a given slug answers 409 `connector.slug_taken`. Created as at install ({@link planConnector}, then
|
|
545
|
+
* `ConnectorsService.create`, which checks the slug before any outbound call and re-checks it,
|
|
546
|
+
* `connectors.manage`, the item and the template being on under the org lock), linked to the
|
|
547
|
+
* template, and recorded on the plugin's live install in the org when there is one. A template
|
|
548
|
+
* that is missing, deleted or not offered to the org -> 404 `component.not_found`; offered but
|
|
549
|
+
* off there (its plugin not installed, or switched off) -> 409 `component.off`; input errors ->
|
|
550
|
+
* 400 `validation_failed` at `config.<field>`.
|
|
551
|
+
*/
|
|
552
|
+
addTemplateConnector(orgId: string, actor: string, templateId: string, input: {
|
|
553
|
+
name?: string | undefined;
|
|
554
|
+
config: Omit<ConnectorInstallInput, "name">;
|
|
555
|
+
}, opts?: {
|
|
556
|
+
actorTokenId?: string;
|
|
557
|
+
}): Promise<{
|
|
558
|
+
connector: ConnectorDetail;
|
|
559
|
+
issues: ToolIssue[];
|
|
560
|
+
}>;
|
|
561
|
+
/**
|
|
562
|
+
* Records a connector made from a plugin's template on the org's live install of that plugin,
|
|
563
|
+
* when there is one, under the org lock (so an uninstall in between is seen).
|
|
564
|
+
*/
|
|
565
|
+
private recordOnLiveInstall;
|
|
430
566
|
/** The connector kinds an extension provides (the `connector@1` implementations loaded on this replica). */
|
|
431
567
|
connectorKindsOf(plugin: string): string[];
|
|
432
568
|
/**
|
|
433
|
-
* The
|
|
434
|
-
*
|
|
569
|
+
* The uninstall preview of an install (see {@link UninstallPreview}); the real uninstall may keep
|
|
570
|
+
* more (another install using a component, a connector still using an extension). The plugin's
|
|
571
|
+
* skills and agent templates are platform components (phase 2): the ones on in the org through
|
|
572
|
+
* the plugin (`follow`) go off with it, so the agents using them (by the platform id or an
|
|
573
|
+
* unpinned org copy linked to it) are listed, also for the dependency installs it created that
|
|
574
|
+
* go with it; ledger rows of earlier installs' org copies are not removed and not listed (an
|
|
575
|
+
* uninstall keeps legacy copies, like the platform update keeps copies of removed components).
|
|
435
576
|
*/
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
577
|
+
previewUninstall(orgId: string, installId: string): Promise<UninstallPreview>;
|
|
578
|
+
/**
|
|
579
|
+
* The connectors, skills (selected, pinned, or in an inline sub-agent template) and agent
|
|
580
|
+
* templates (`subagents.templates`) referenced by the current definitions of the org's live
|
|
581
|
+
* agents.
|
|
582
|
+
*/
|
|
583
|
+
agentRefs(orgId: string): Promise<DefinitionRefs>;
|
|
441
584
|
}
|
|
442
585
|
/**
|
|
443
586
|
* The skill names of a catalog version, read from each skill's SKILL.md in storage (the names are
|
|
@@ -487,3 +630,4 @@ export type UpgradeStep = {
|
|
|
487
630
|
export declare function journalEntries(upgrade: unknown): UpgradeStep[];
|
|
488
631
|
/** The org actions a plan needs: the union over the plugins it installs (spec §10). */
|
|
489
632
|
export declare function planActions(plan: InstallPlan): OrgAction[];
|
|
633
|
+
export {};
|