@abot-ai/runtime 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/src/bridge/request-steering.js +60 -15
- package/dist/src/capabilities/normal-invocation/contracts.d.ts +3 -0
- package/dist/src/capabilities/normal-invocation/output-channels.d.ts +10 -0
- package/dist/src/capabilities/normal-invocation/output-channels.js +29 -0
- package/dist/src/capabilities/normal-invocation/validator.js +4 -2
- package/dist/src/capabilities/tool-types.d.ts +1 -1
- package/dist/src/cli/host-companion-bundle.mjs +7570 -6781
- package/dist/src/cli/host-companion-entry.js +5 -22
- package/dist/src/cli/host-companion-input.d.ts +3 -0
- package/dist/src/cli/host-companion-input.js +21 -0
- package/dist/src/cli/host-companion-lifecycle.d.ts +11 -0
- package/dist/src/cli/host-companion-lifecycle.js +32 -0
- package/dist/src/cli/host-companion-setup-target.d.ts +4 -0
- package/dist/src/cli/host-companion-setup-target.js +17 -0
- package/dist/src/cli/host-companion-startup.d.ts +2 -0
- package/dist/src/cli/host-companion-startup.js +7 -2
- package/dist/src/cli/host-companion.d.ts +6 -0
- package/dist/src/cli/host-companion.js +30 -27
- package/dist/src/cli/windows-companion-store-entry.d.ts +9 -0
- package/dist/src/cli/windows-companion-store-entry.js +67 -0
- package/dist/src/computer-access/command-output-capture.d.ts +37 -0
- package/dist/src/computer-access/command-output-capture.js +136 -0
- package/dist/src/computer-access/command-output-retention.d.ts +5 -0
- package/dist/src/computer-access/command-output-retention.js +90 -0
- package/dist/src/computer-access/command-output.d.ts +7 -0
- package/dist/src/computer-access/command-output.js +1 -0
- package/dist/src/computer-access/commands.d.ts +1 -0
- package/dist/src/computer-access/commands.js +1 -1
- package/dist/src/computer-access/companion/command-output-protocol.d.ts +12 -0
- package/dist/src/computer-access/companion/command-output-protocol.js +28 -0
- package/dist/src/computer-access/companion/command-output.d.ts +13 -0
- package/dist/src/computer-access/companion/command-output.js +110 -0
- package/dist/src/computer-access/companion/install-link-macos.d.ts +7 -0
- package/dist/src/computer-access/companion/install-link-macos.js +48 -0
- package/dist/src/computer-access/companion/install-link-registration.d.ts +4 -0
- package/dist/src/computer-access/companion/install-link-registration.js +184 -0
- package/dist/src/computer-access/companion/install-link-windows.d.ts +4 -0
- package/dist/src/computer-access/companion/install-link-windows.js +65 -0
- package/dist/src/computer-access/companion/install-link.d.ts +9 -0
- package/dist/src/computer-access/companion/install-link.js +54 -0
- package/dist/src/computer-access/companion/native-messages.js +3 -0
- package/dist/src/computer-access/companion/native-session.d.ts +1 -0
- package/dist/src/computer-access/companion/native-session.js +14 -2
- package/dist/src/computer-access/companion/native-supervisor.js +1 -0
- package/dist/src/computer-access/companion/notification-windows.d.ts +1 -1
- package/dist/src/computer-access/companion/notification-windows.js +8 -3
- package/dist/src/computer-access/companion/protocol.d.ts +1 -1
- package/dist/src/computer-access/companion/protocol.js +6 -0
- package/dist/src/computer-access/companion/release-version.d.ts +1 -1
- package/dist/src/computer-access/companion/release-version.js +1 -1
- package/dist/src/computer-access/companion/windows-store/connection-error.d.ts +7 -0
- package/dist/src/computer-access/companion/windows-store/connection-error.js +19 -0
- package/dist/src/computer-access/companion/windows-store/connection-link.d.ts +13 -0
- package/dist/src/computer-access/companion/windows-store/connection-link.js +109 -0
- package/dist/src/computer-access/companion/windows-store/identity.d.ts +13 -0
- package/dist/src/computer-access/companion/windows-store/identity.js +13 -0
- package/dist/src/computer-access/companion/windows-store/lifecycle.d.ts +5 -0
- package/dist/src/computer-access/companion/windows-store/lifecycle.js +90 -0
- package/dist/src/computer-access/contracts.d.ts +1 -1
- package/dist/src/computer-access/handlers.d.ts +2 -1
- package/dist/src/computer-access/handlers.js +5 -1
- package/dist/src/computer-access/process-capture.d.ts +6 -0
- package/dist/src/computer-access/process-capture.js +1 -0
- package/dist/src/computer-access/process-result.d.ts +2 -0
- package/dist/src/computer-access/process-result.js +14 -6
- package/dist/src/computer-access/process-runner.d.ts +2 -1
- package/dist/src/computer-access/process-runner.js +21 -13
- package/dist/src/model-gateway/server/configuration.d.ts +2 -0
- package/dist/src/model-gateway/server/configuration.js +73 -21
- package/dist/src/plugin-contract/install-source.d.ts +13 -0
- package/dist/src/plugin-contract/install-source.js +99 -0
- package/dist/src/plugin-contract/manifest.d.ts +2 -1
- package/dist/src/plugin-sdk/computer-access.d.ts +8 -0
- package/dist/src/plugin-sdk/computer-access.js +5 -0
- package/dist/src/runtime/adapters/in-memory-session-store.js +6 -16
- package/dist/src/runtime/admin/config-control.js +2 -1
- package/dist/src/runtime/automations/catalog.d.ts +3 -0
- package/dist/src/runtime/automations/catalog.js +1 -0
- package/dist/src/runtime/automations/model-dependency-projection.d.ts +2 -0
- package/dist/src/runtime/automations/service.d.ts +2 -0
- package/dist/src/runtime/capabilities/automation-builder/authoring-reference.d.ts +10 -5
- package/dist/src/runtime/capabilities/automation-builder/authoring-reference.js +8 -7
- package/dist/src/runtime/capabilities/automation-builder/payload-instructions.d.ts +2 -2
- package/dist/src/runtime/capabilities/automation-builder/payload-instructions.js +2 -2
- package/dist/src/runtime/capabilities/automation-builder/tool-contract.d.ts +2 -2
- package/dist/src/runtime/capabilities/automations/authoring-catalog.js +1 -1
- package/dist/src/runtime/capabilities/automations/authoring-preparation.d.ts +11 -5
- package/dist/src/runtime/capabilities/automations/tool-module.js +1 -1
- package/dist/src/runtime/capabilities/request-permission-catalog.d.ts +3 -1
- package/dist/src/runtime/capabilities/request-permission-catalog.js +21 -2
- package/dist/src/runtime/capabilities/request-permission-tool-registry.d.ts +2 -1
- package/dist/src/runtime/capabilities/request-permission-tool-registry.js +18 -10
- package/dist/src/runtime/capabilities/request-runtime-tool-registry.d.ts +2 -0
- package/dist/src/runtime/capabilities/request-runtime-tool-registry.js +1 -1
- package/dist/src/runtime/capabilities/scheduling/create-operations.d.ts +6 -0
- package/dist/src/runtime/config/builders.js +6 -5
- package/dist/src/runtime/config/effective-model-config-validation.js +4 -35
- package/dist/src/runtime/config/fields.js +15 -0
- package/dist/src/runtime/config/model-context-capacity.d.ts +20 -0
- package/dist/src/runtime/config/model-context-capacity.js +55 -0
- package/dist/src/runtime/config/model-execution-policy.d.ts +5 -1
- package/dist/src/runtime/config/model-execution-policy.js +16 -0
- package/dist/src/runtime/config/model-plugin-config.d.ts +8 -0
- package/dist/src/runtime/config/model-plugin-config.js +40 -0
- package/dist/src/runtime/config/schema.js +5 -1
- package/dist/src/runtime/config/validation/model-profile-validation.js +2 -0
- package/dist/src/runtime/config/validation/runtime-config-validation-contract.d.ts +3 -1
- package/dist/src/runtime/config/validation/runtime-config-validation-contract.js +3 -1
- package/dist/src/runtime/config/validation/runtime-root-section-validation.js +11 -4
- package/dist/src/runtime/config/validation/web-ui-config-validation.js +3 -2
- package/dist/src/runtime/config/web-ui.d.ts +5 -0
- package/dist/src/runtime/config/web-ui.js +5 -0
- package/dist/src/runtime/config.js +2 -0
- package/dist/src/runtime/local-application.d.ts +2 -0
- package/dist/src/runtime/local-host/app-owner.js +50 -6
- package/dist/src/runtime/local-host/app-request-control.d.ts +3 -1
- package/dist/src/runtime/local-host/app-request-control.js +91 -11
- package/dist/src/runtime/local-host/client-requests.js +32 -5
- package/dist/src/runtime/local-host/client-services.d.ts +2 -0
- package/dist/src/runtime/local-host/local-request-diagnostics.d.ts +9 -0
- package/dist/src/runtime/local-host/local-request-diagnostics.js +47 -0
- package/dist/src/runtime/local-host/saved-approvals.js +23 -2
- package/dist/src/runtime/model/model-selection.js +4 -1
- package/dist/src/runtime/observability/request-control-diagnostics.d.ts +6 -0
- package/dist/src/runtime/observability/request-control-diagnostics.js +52 -0
- package/dist/src/runtime/plugins/configuration-context.d.ts +9 -0
- package/dist/src/runtime/plugins/configuration-context.js +42 -0
- package/dist/src/runtime/plugins/configuration-settings.d.ts +2 -0
- package/dist/src/runtime/plugins/configuration-settings.js +26 -0
- package/dist/src/runtime/plugins/configuration-store.d.ts +23 -0
- package/dist/src/runtime/plugins/configuration-store.js +100 -0
- package/dist/src/runtime/plugins/configuration-write.d.ts +5 -0
- package/dist/src/runtime/plugins/configuration-write.js +58 -0
- package/dist/src/runtime/plugins/installation/archive.d.ts +2 -0
- package/dist/src/runtime/plugins/installation/archive.js +107 -0
- package/dist/src/runtime/plugins/installation/github-download.d.ts +9 -0
- package/dist/src/runtime/plugins/installation/github-download.js +72 -0
- package/dist/src/runtime/plugins/installation/installed-package.d.ts +9 -0
- package/dist/src/runtime/plugins/installation/installed-package.js +66 -0
- package/dist/src/runtime/plugins/installation/package.d.ts +45 -0
- package/dist/src/runtime/plugins/installation/package.js +79 -0
- package/dist/src/runtime/plugins/installation/portable-path.d.ts +2 -0
- package/dist/src/runtime/plugins/installation/portable-path.js +10 -0
- package/dist/src/runtime/plugins/installation/publication.d.ts +10 -0
- package/dist/src/runtime/plugins/installation/publication.js +17 -0
- package/dist/src/runtime/plugins/installation/service.d.ts +41 -0
- package/dist/src/runtime/plugins/installation/service.js +80 -0
- package/dist/src/runtime/plugins/loader.js +15 -29
- package/dist/src/runtime/plugins/manifest-projection.js +1 -0
- package/dist/src/runtime/plugins/manifest-validator.js +3 -0
- package/dist/src/runtime/plugins/module-cache.d.ts +2 -0
- package/dist/src/runtime/plugins/module-cache.js +19 -0
- package/dist/src/runtime/plugins/selection.d.ts +2 -0
- package/dist/src/runtime/plugins/selection.js +16 -11
- package/dist/src/runtime/ports.d.ts +6 -4
- package/dist/src/runtime/request/dependencies.d.ts +2 -1
- package/dist/src/runtime/request/execution-payload-compacted-evidence.d.ts +1 -1
- package/dist/src/runtime/request/handler.js +8 -0
- package/dist/src/runtime/request/prepared-execution.js +6 -1
- package/dist/src/runtime/request/request-steering.d.ts +4 -0
- package/dist/src/runtime/request/request-steering.js +37 -12
- package/dist/src/runtime/request/worker-capability-composition.d.ts +2 -0
- package/dist/src/runtime/request/worker-capability-composition.js +4 -1
- package/dist/src/runtime/scheduler/journal-index-state.d.ts +1 -1
- package/dist/src/sessions/assistant-initiative-message.d.ts +3 -0
- package/dist/src/sessions/assistant-initiative-message.js +12 -0
- package/dist/src/sessions/assistant-initiative.d.ts +2 -2
- package/dist/src/sessions/assistant-initiative.js +1 -7
- package/dist/src/sessions/durable-session-commit.d.ts +2 -1
- package/dist/src/sessions/durable-session-commit.js +6 -1
- package/dist/src/sessions/metadata/projection.d.ts +15 -0
- package/dist/src/sessions/metadata/projection.js +55 -0
- package/dist/src/sessions/metadata/publication.d.ts +12 -0
- package/dist/src/sessions/metadata/publication.js +78 -0
- package/dist/src/sessions/metadata/source-receipt.d.ts +5 -0
- package/dist/src/sessions/metadata/source-receipt.js +42 -0
- package/dist/src/sessions/metadata/store.d.ts +7 -0
- package/dist/src/sessions/metadata/store.js +119 -0
- package/dist/src/sessions/record/projection.d.ts +3 -1
- package/dist/src/sessions/record/projection.js +26 -18
- package/dist/src/sessions/request-lifecycle/service.js +3 -3
- package/dist/src/sessions/session-service.d.ts +2 -4
- package/dist/src/sessions/session-service.js +4 -16
- package/dist/src/sessions/session-store.d.ts +2 -1
- package/dist/src/sessions/session-store.js +9 -3
- package/dist/src/sessions/snapshot.d.ts +17 -0
- package/dist/src/sessions/snapshot.js +105 -0
- package/dist/src/sessions/types.d.ts +2 -0
- package/dist/src/shared/tool-selection.d.ts +2 -0
- package/dist/src/shared/tool-selection.js +7 -0
- package/dist/src/web-ui/app/ARCHITECTURE.md +14 -0
- package/dist/src/web-ui/app/app.js +6 -3
- package/dist/src/web-ui/app/components/config-workspace/config-model.js +2 -0
- package/dist/src/web-ui/app/components/config-workspace/model-plugin-permissions.js +130 -0
- package/dist/src/web-ui/app/components/config-workspace/model-plugin-selection.js +180 -0
- package/dist/src/web-ui/app/components/config-workspace/model-plugin-view-state.js +114 -0
- package/dist/src/web-ui/app/components/config-workspace/model-rendering.js +3 -0
- package/dist/src/web-ui/app/components/config-workspace/model-summary.js +39 -0
- package/dist/src/web-ui/app/components/config-workspace/summary-rendering.js +30 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-events.js +37 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-mutations.js +2 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-persistence.js +9 -1
- package/dist/src/web-ui/app/components/config-workspace/workspace-view.js +23 -67
- package/dist/src/web-ui/app/components/config-workspace.js +11 -2
- package/dist/src/web-ui/app/components/conversation-view.js +36 -5
- package/dist/src/web-ui/app/components/dashboard/recent-conversations.js +2 -1
- package/dist/src/web-ui/app/components/dashboard/workspace.js +2 -1
- package/dist/src/web-ui/app/components/operations-summary.js +105 -0
- package/dist/src/web-ui/app/components/passive-learning/home.js +1 -9
- package/dist/src/web-ui/app/components/plugins/configuration-draft.js +34 -0
- package/dist/src/web-ui/app/components/plugins/configuration-editor.js +147 -0
- package/dist/src/web-ui/app/components/plugins/configuration-fields.js +103 -0
- package/dist/src/web-ui/app/components/plugins/configuration-retained-secrets.js +20 -0
- package/dist/src/web-ui/app/components/plugins/configuration-settings.js +108 -0
- package/dist/src/web-ui/app/components/plugins/discovery-rendering.js +37 -0
- package/dist/src/web-ui/app/components/plugins/installation.js +212 -0
- package/dist/src/web-ui/app/components/plugins/manager.js +160 -6
- package/dist/src/web-ui/app/components/plugins/removal.js +130 -0
- package/dist/src/web-ui/app/components/plugins/rendering.js +14 -2
- package/dist/src/web-ui/app/components/plugins/summary.js +54 -0
- package/dist/src/web-ui/app/components/plugins/tabs.js +31 -0
- package/dist/src/web-ui/app/components/plugins/view-state.js +3 -1
- package/dist/src/web-ui/app/components/runtime-setup/connection-form.js +5 -2
- package/dist/src/web-ui/app/components/runtime-setup/connection-state.js +9 -1
- package/dist/src/web-ui/app/components/runtime-setup/context-window-feedback.js +71 -0
- package/dist/src/web-ui/app/components/runtime-setup/optional-steps.js +2 -0
- package/dist/src/web-ui/app/components/runtime-setup-guide.js +15 -3
- package/dist/src/web-ui/app/components/spark-chat/empty-state.js +1 -0
- package/dist/src/web-ui/app/components/spark-chat/panel.js +1 -0
- package/dist/src/web-ui/app/components/system-host/connection-card.js +35 -0
- package/dist/src/web-ui/app/components/system-host/macos-setup.js +1 -1
- package/dist/src/web-ui/app/components/system-host/manager.js +45 -12
- package/dist/src/web-ui/app/components/system-host/rendering.js +111 -106
- package/dist/src/web-ui/app/components/system-host/windows-store-setup.js +293 -0
- package/dist/src/web-ui/app/components/workspace-shell.js +6 -0
- package/dist/src/web-ui/app/computer-access-feature.js +22 -5
- package/dist/src/web-ui/app/configuration-feature.js +35 -2
- package/dist/src/web-ui/app/controllers/app-event-bindings.js +4 -1
- package/dist/src/web-ui/app/controllers/conversation-read-state-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/conversation-read-state-controller.js +7 -3
- package/dist/src/web-ui/app/controllers/conversation-request-hydration.js +88 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.d.ts +9 -3
- package/dist/src/web-ui/app/controllers/conversation-session-controller.js +52 -144
- package/dist/src/web-ui/app/controllers/history-pagination.js +111 -0
- package/dist/src/web-ui/app/controllers/operations-controller.d.ts +12 -0
- package/dist/src/web-ui/app/controllers/operations-controller.js +28 -21
- package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.js +11 -0
- package/dist/src/web-ui/app/controllers/session-controller.js +10 -2
- package/dist/src/web-ui/app/controllers/session-list-pagination.js +71 -0
- package/dist/src/web-ui/app/controllers/session-sidebar-controller.js +6 -4
- package/dist/src/web-ui/app/controllers/spark-chat-reading.js +1 -0
- package/dist/src/web-ui/app/controllers/spark-chat-sync.js +24 -5
- package/dist/src/web-ui/app/controllers/workspace-route-controller.js +21 -19
- package/dist/src/web-ui/app/dashboard-feature.js +2 -2
- package/dist/src/web-ui/app/index.html +6 -2
- package/dist/src/web-ui/app/lib/history-page-messages.js +49 -0
- package/dist/src/web-ui/app/lib/request-lifecycle-view.js +8 -0
- package/dist/src/web-ui/app/lib/workspace-route.d.ts +3 -0
- package/dist/src/web-ui/app/lib/workspace-route.js +4 -0
- package/dist/src/web-ui/app/passive-learning-feature.js +0 -1
- package/dist/src/web-ui/app/runtime-onboarding-feature.js +3 -0
- package/dist/src/web-ui/app/schedules-feature.js +1 -1
- package/dist/src/web-ui/app/services/runtime-web-client/configuration.js +20 -0
- package/dist/src/web-ui/app/services/runtime-web-client/plugin-configuration.js +19 -0
- package/dist/src/web-ui/app/services/runtime-web-client/spark-chat.js +4 -4
- package/dist/src/web-ui/app/services/runtime-web-client/system-host.js +2 -0
- package/dist/src/web-ui/app/services/runtime-web-client.d.ts +6 -1
- package/dist/src/web-ui/app/services/runtime-web-client.js +12 -3
- package/dist/src/web-ui/app/spark-chat-feature.js +76 -19
- package/dist/src/web-ui/app/styles/11-product-links.css +30 -0
- package/dist/src/web-ui/app/styles/41-plugin-configuration.css +79 -0
- package/dist/src/web-ui/app/styles/41-plugin-discovery.css +132 -0
- package/dist/src/web-ui/app/styles/41-plugin-management.css +6 -0
- package/dist/src/web-ui/app/styles/42-model-plugin-permissions.css +173 -0
- package/dist/src/web-ui/app/styles/46-system-host.css +61 -107
- package/dist/src/web-ui/app/styles/47-config-controls.css +13 -1
- package/dist/src/web-ui/app/styles/54-spark-chat.css +33 -1
- package/dist/src/web-ui/app/styles.css +4 -0
- package/dist/src/web-ui/local-runtime/api-router.js +11 -6
- package/dist/src/web-ui/local-runtime/approval-request-attachment.js +14 -5
- package/dist/src/web-ui/local-runtime/configuration-activation-source.d.ts +1 -1
- package/dist/src/web-ui/local-runtime/configuration-activation-source.js +9 -3
- package/dist/src/web-ui/local-runtime/contracts.d.ts +4 -3
- package/dist/src/web-ui/local-runtime/environment-registry.d.ts +5 -1
- package/dist/src/web-ui/local-runtime/environment-registry.js +53 -11
- package/dist/src/web-ui/local-runtime/history-pagination.d.ts +16 -0
- package/dist/src/web-ui/local-runtime/history-pagination.js +20 -0
- package/dist/src/web-ui/local-runtime/plugin-configuration-routes.d.ts +16 -0
- package/dist/src/web-ui/local-runtime/plugin-configuration-routes.js +68 -0
- package/dist/src/web-ui/local-runtime/plugin-installation-routes.d.ts +16 -0
- package/dist/src/web-ui/local-runtime/plugin-installation-routes.js +96 -0
- package/dist/src/web-ui/local-runtime/plugin-management-routes.d.ts +8 -1
- package/dist/src/web-ui/local-runtime/plugin-management-routes.js +17 -0
- package/dist/src/web-ui/local-runtime/plugin-mutation-admission.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/plugin-mutation-admission.js +17 -0
- package/dist/src/web-ui/local-runtime/plugin-removal-routes.d.ts +18 -0
- package/dist/src/web-ui/local-runtime/plugin-removal-routes.js +60 -0
- package/dist/src/web-ui/local-runtime/realtime-controller.js +41 -2
- package/dist/src/web-ui/local-runtime/request-cancellation-route.js +28 -1
- package/dist/src/web-ui/local-runtime/request-control-observation.d.ts +19 -0
- package/dist/src/web-ui/local-runtime/request-control-observation.js +80 -0
- package/dist/src/web-ui/local-runtime/request-execution.js +69 -37
- package/dist/src/web-ui/local-runtime/runtime-setup-context-window.d.ts +20 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-context-window.js +44 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-routes.js +2 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-validation.js +9 -2
- package/dist/src/web-ui/local-runtime/session-routes.d.ts +1 -0
- package/dist/src/web-ui/local-runtime/session-routes.js +16 -4
- package/dist/src/web-ui/local-runtime/spark-chat-routes.js +4 -3
- package/dist/src/web-ui/plugin-capability-selection.js +4 -1
- package/dist/src/web-ui/plugin-configuration-input.d.ts +12 -0
- package/dist/src/web-ui/plugin-configuration-input.js +68 -0
- package/dist/src/web-ui/plugin-configuration-retained-secrets.d.ts +9 -0
- package/dist/src/web-ui/plugin-configuration-retained-secrets.js +48 -0
- package/dist/src/web-ui/plugin-configuration-service.d.ts +52 -0
- package/dist/src/web-ui/plugin-configuration-service.js +66 -0
- package/dist/src/web-ui/plugin-configuration-view.d.ts +25 -0
- package/dist/src/web-ui/plugin-configuration-view.js +45 -0
- package/dist/src/web-ui/plugin-disabled-selection.d.ts +7 -0
- package/dist/src/web-ui/plugin-disabled-selection.js +17 -0
- package/dist/src/web-ui/plugin-management-catalog.d.ts +3 -1
- package/dist/src/web-ui/plugin-management-catalog.js +11 -1
- package/dist/src/web-ui/plugin-management-selection.js +22 -9
- package/dist/src/web-ui/plugin-management-service.d.ts +5 -1
- package/dist/src/web-ui/plugin-management-service.js +11 -7
- package/dist/src/web-ui/plugin-removal-error.d.ts +7 -0
- package/dist/src/web-ui/plugin-removal-error.js +16 -0
- package/dist/src/web-ui/plugin-removal-service.d.ts +30 -0
- package/dist/src/web-ui/plugin-removal-service.js +109 -0
- package/dist/src/web-ui/runtime-setup-gateway.d.ts +6 -2
- package/dist/src/web-ui/runtime-setup-gateway.js +30 -10
- package/dist/src/web-ui/server.js +6 -2
- package/dist/src/web-ui/session-read-state/overview.d.ts +42 -0
- package/dist/src/web-ui/session-read-state/overview.js +16 -0
- package/dist/src/web-ui/session-read-state/pagination.d.ts +15 -0
- package/dist/src/web-ui/session-read-state/pagination.js +42 -0
- package/dist/src/web-ui/session-read-state/projection.d.ts +4 -3
- package/dist/src/web-ui/session-read-state/service.d.ts +213 -20
- package/dist/src/web-ui/session-read-state/service.js +25 -23
- package/dist/src/web-ui/session-read-state/visible-messages.d.ts +3 -3
- package/dist/src/web-ui/system-host-setup/companion-linux.js +1 -1
- package/dist/src/web-ui/system-host-setup/installer-contract.d.ts +1 -1
- package/dist/src/web-ui/system-host-setup/installer-contract.js +2 -2
- package/dist/src/web-ui/system-host-setup/installers.js +0 -7
- package/dist/src/web-ui/system-host-setup/local-connection.d.ts +4 -1
- package/dist/src/web-ui/system-host-setup/local-connection.js +10 -17
- package/dist/src/web-ui/system-host-setup/routes.d.ts +2 -0
- package/dist/src/web-ui/system-host-setup/routes.js +32 -9
- package/dist/src/web-ui/system-host-setup/setup-mutation.d.ts +9 -0
- package/dist/src/web-ui/system-host-setup/setup-mutation.js +27 -0
- package/dist/src/web-ui/system-host-setup/windows-store-route.d.ts +13 -0
- package/dist/src/web-ui/system-host-setup/windows-store-route.js +68 -0
- package/docs/configuration.md +46 -0
- package/docs/installation.md +45 -24
- package/docs/plugins.md +165 -2
- package/docs/projects-and-full-plus.md +2 -6
- package/docs/runtime-library.md +0 -1
- package/docs/windows-companion-store.md +127 -0
- package/package.json +3 -3
- package/plugins/document-reader/plugin.json +1 -0
- package/plugins/exec/plugin.json +3 -0
- package/plugins/filesystem/plugin.json +2 -0
- package/plugins/local-search/plugin.json +1 -0
- package/plugins/system/README.md +43 -3
- package/plugins/system/plugin.json +5 -0
- package/plugins/system/source/companion-command-output.ts +82 -0
- package/plugins/system/source/host-dispatch.ts +4 -0
- package/plugins/system/source/index.ts +11 -5
- package/plugins/system/source/local-command-output.ts +61 -0
- package/plugins/system/source/request-system-modules.ts +2 -0
- package/plugins/system/src/index.cjs +474 -39
- package/plugins/web/README.md +2 -2
- package/plugins/web/plugin.json +4 -0
- package/runtime.config.schema.json +25 -1
- package/src/runtime/README.md +12 -2
- package/dist/src/web-ui/system-host-setup/companion-windows.d.ts +0 -2
- package/dist/src/web-ui/system-host-setup/companion-windows.js +0 -108
- package/docs/publishing.md +0 -167
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { mkdtemp, readFile, readdir, rm } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { PluginInstallError, } from "../../../plugin-contract/install-source.js";
|
|
4
|
+
import { ABOT_RUNTIME_EXTENSION } from "../../../plugin-contract/manifest.js";
|
|
5
|
+
import { parseAgentPluginManifest } from "../manifest-validator.js";
|
|
6
|
+
import { projectManifestRuntimeContract } from "../manifest-projection.js";
|
|
7
|
+
import { discoverConfiguredRuntimePluginManifests } from "../configured-manifests.js";
|
|
8
|
+
import { extractPluginArchive } from "./archive.js";
|
|
9
|
+
import { isPortablePluginPathComponent } from "./portable-path.js";
|
|
10
|
+
import { downloadGitHubPlugin, } from "./github-download.js";
|
|
11
|
+
async function requireAvailableInstallMetadataPath(staging) {
|
|
12
|
+
const names = await readdir(staging);
|
|
13
|
+
if (names.some((name) => name.toLowerCase() === ".abot-install.json"))
|
|
14
|
+
throw new PluginInstallError("plugin_package_invalid", "The selected plugin contains the reserved .abot-install.json path.");
|
|
15
|
+
}
|
|
16
|
+
export async function preparePluginPackage(rootDir, source, download = downloadGitHubPlugin) {
|
|
17
|
+
const downloaded = await download(source);
|
|
18
|
+
if (!/^[a-f0-9]{40}$/u.test(downloaded.source.ref))
|
|
19
|
+
throw new PluginInstallError("plugin_revision_invalid", "The source must resolve to an exact commit.");
|
|
20
|
+
const staging = await mkdtemp(join(rootDir, ".abot-plugin-install-"));
|
|
21
|
+
try {
|
|
22
|
+
const digest = await extractPluginArchive(downloaded.archive, staging, downloaded.source.path);
|
|
23
|
+
await requireAvailableInstallMetadataPath(staging);
|
|
24
|
+
const raw = JSON.parse(await readFile(join(staging, "plugin.json"), "utf8"));
|
|
25
|
+
const manifest = parseAgentPluginManifest(raw, typeof raw.name === "string" ? raw.name : "");
|
|
26
|
+
if (!isPortablePluginPathComponent(manifest.name))
|
|
27
|
+
throw new PluginInstallError("plugin_package_invalid", "The plugin ID cannot be used as a portable installation folder name.");
|
|
28
|
+
const extension = manifest.extensions[ABOT_RUNTIME_EXTENSION];
|
|
29
|
+
if (!extension.entrypoint.endsWith(".cjs"))
|
|
30
|
+
throw new PluginInstallError("plugin_package_not_built", "This plugin must include a ready-to-run CommonJS .cjs entrypoint.");
|
|
31
|
+
const capabilities = Object.keys(extension.capabilities);
|
|
32
|
+
projectManifestRuntimeContract({
|
|
33
|
+
pluginRoot: staging,
|
|
34
|
+
manifestPath: join(staging, "plugin.json"),
|
|
35
|
+
manifest,
|
|
36
|
+
}, capabilities);
|
|
37
|
+
requireNewPluginIdentity(rootDir, manifest.name, capabilities);
|
|
38
|
+
return {
|
|
39
|
+
staging,
|
|
40
|
+
manifest,
|
|
41
|
+
review: {
|
|
42
|
+
source: downloaded.source,
|
|
43
|
+
digest,
|
|
44
|
+
id: manifest.name,
|
|
45
|
+
version: manifest.version ?? "",
|
|
46
|
+
description: manifest.description ?? "",
|
|
47
|
+
capabilities: capabilities.map((id) => ({
|
|
48
|
+
id,
|
|
49
|
+
description: extension.capabilities[id].description,
|
|
50
|
+
operations: Object.entries(extension.capabilities[id].operations).map(([name, operation]) => ({
|
|
51
|
+
name,
|
|
52
|
+
effect: operation.effect,
|
|
53
|
+
approval: operation.approval,
|
|
54
|
+
})),
|
|
55
|
+
})),
|
|
56
|
+
settings: extension.settings?.defaults ?? {},
|
|
57
|
+
secrets: Object.entries(extension.secrets ?? {}).map(([name, secret]) => ({
|
|
58
|
+
name,
|
|
59
|
+
env: secret.env,
|
|
60
|
+
required: secret.required,
|
|
61
|
+
})),
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
await rm(staging, { recursive: true, force: true });
|
|
67
|
+
if (error instanceof PluginInstallError)
|
|
68
|
+
throw error;
|
|
69
|
+
throw new PluginInstallError("plugin_package_invalid", "The selected folder is not a complete, valid ABot plugin. Check plugin.json, its built entrypoint and referenced skills.");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export function requireNewPluginIdentity(rootDir, id, capabilityIds) {
|
|
73
|
+
const installed = discoverConfiguredRuntimePluginManifests(rootDir);
|
|
74
|
+
if (installed.some((plugin) => plugin.manifest.name === id))
|
|
75
|
+
throw new PluginInstallError("plugin_already_installed", "A plugin with this ID is already installed. Existing plugins are never replaced.", 409);
|
|
76
|
+
const existing = new Set(installed.flatMap((plugin) => Object.keys(plugin.manifest.extensions[ABOT_RUNTIME_EXTENSION].capabilities)));
|
|
77
|
+
if (capabilityIds.some((capability) => existing.has(capability)))
|
|
78
|
+
throw new PluginInstallError("plugin_capability_conflict", "This plugin declares a capability ID already provided by another installed plugin.", 409);
|
|
79
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Files and manifest-derived installation folders share the same portable naming rules. */
|
|
2
|
+
export function isPortablePluginPathComponent(name) {
|
|
3
|
+
if (!name || name === "." || name === "..")
|
|
4
|
+
return false;
|
|
5
|
+
if (/[<>:"/\\|?*\u0000-\u001f\u007f]/u.test(name))
|
|
6
|
+
return false;
|
|
7
|
+
if (/[. ]$/u.test(name))
|
|
8
|
+
return false;
|
|
9
|
+
return !/^(con|prn|aux|nul|com[1-9\u00b9\u00b2\u00b3]|lpt[1-9\u00b9\u00b2\u00b3])(?:\.|$)/iu.test(name);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ConfigFileTransaction } from "../../adapters/config-file-transaction.js";
|
|
2
|
+
/** Publish, save selection and roll back under the same lock used by Apply. */
|
|
3
|
+
export declare function publishPluginPackage<T>(options: {
|
|
4
|
+
staging: string;
|
|
5
|
+
target: string;
|
|
6
|
+
pluginId: string;
|
|
7
|
+
configPath: string;
|
|
8
|
+
requireMutationIdle?: () => void;
|
|
9
|
+
saveSelection: (pluginId: string, transaction: ConfigFileTransaction) => Promise<T>;
|
|
10
|
+
}): Promise<T>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { rename, rm } from "node:fs/promises";
|
|
2
|
+
import { withConfigFileTransaction, } from "../../adapters/config-file-transaction.js";
|
|
3
|
+
/** Publish, save selection and roll back under the same lock used by Apply. */
|
|
4
|
+
export function publishPluginPackage(options) {
|
|
5
|
+
return withConfigFileTransaction(options.configPath, async (transaction) => {
|
|
6
|
+
options.requireMutationIdle?.();
|
|
7
|
+
await rename(options.staging, options.target);
|
|
8
|
+
try {
|
|
9
|
+
return await options.saveSelection(options.pluginId, transaction);
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
// Apply cannot load the uncommitted package while rollback is in progress.
|
|
13
|
+
await rm(options.target, { recursive: true, force: true });
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ConfigFileTransaction } from "../../adapters/config-file-transaction.js";
|
|
2
|
+
import type { PluginSourceFetcher } from "./github-download.js";
|
|
3
|
+
export declare function inspectPluginPackage(rootDir: string, input: unknown, download?: PluginSourceFetcher): Promise<{
|
|
4
|
+
source: Readonly<{
|
|
5
|
+
repository: string;
|
|
6
|
+
ref?: string;
|
|
7
|
+
path?: string;
|
|
8
|
+
}> & {
|
|
9
|
+
ref: string;
|
|
10
|
+
};
|
|
11
|
+
digest: string;
|
|
12
|
+
id: string;
|
|
13
|
+
version: string;
|
|
14
|
+
description: string;
|
|
15
|
+
capabilities: {
|
|
16
|
+
id: string;
|
|
17
|
+
description: string;
|
|
18
|
+
operations: {
|
|
19
|
+
name: string;
|
|
20
|
+
effect: import("../../../capabilities/tool-types.js").ToolNormalInvocationEffect;
|
|
21
|
+
approval: import("../../../capabilities/tool-types.js").ToolNormalInvocationApproval;
|
|
22
|
+
}[];
|
|
23
|
+
}[];
|
|
24
|
+
settings: Readonly<Record<string, unknown>>;
|
|
25
|
+
secrets: {
|
|
26
|
+
name: string;
|
|
27
|
+
env: string;
|
|
28
|
+
required: boolean;
|
|
29
|
+
}[];
|
|
30
|
+
}>;
|
|
31
|
+
export declare function installPluginPackage<T>(options: {
|
|
32
|
+
rootDir: string;
|
|
33
|
+
input: unknown;
|
|
34
|
+
download?: PluginSourceFetcher;
|
|
35
|
+
configPath?: string;
|
|
36
|
+
saveSelection: (pluginId: string, transaction: ConfigFileTransaction) => Promise<T>;
|
|
37
|
+
requireMutationIdle?: () => void;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
installed: Awaited<ReturnType<typeof inspectPluginPackage>>;
|
|
40
|
+
snapshot: T;
|
|
41
|
+
}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { lstat, mkdir, realpath, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { PluginInstallError, parsePluginInstallSource, } from "../../../plugin-contract/install-source.js";
|
|
4
|
+
import { inspectRuntimeConfigFileWithMeta } from "../../config/loader.js";
|
|
5
|
+
import { publishPluginPackage } from "./publication.js";
|
|
6
|
+
import { withFileLock } from "../../adapters/long-term-memory/file-lock.js";
|
|
7
|
+
import { preparePluginPackage, requireNewPluginIdentity } from "./package.js";
|
|
8
|
+
function isAbsentPath(error) {
|
|
9
|
+
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
10
|
+
}
|
|
11
|
+
async function installationDirectory(rootDir) {
|
|
12
|
+
const path = join(rootDir, "plugins");
|
|
13
|
+
await mkdir(path, { mode: 0o700 }).catch((error) => {
|
|
14
|
+
if (error.code !== "EEXIST")
|
|
15
|
+
throw error;
|
|
16
|
+
});
|
|
17
|
+
const stat = await lstat(path);
|
|
18
|
+
if (!stat.isDirectory() || stat.isSymbolicLink())
|
|
19
|
+
throw new PluginInstallError("plugin_destination_invalid", "The plugins destination must be a local directory.");
|
|
20
|
+
return path;
|
|
21
|
+
}
|
|
22
|
+
export async function inspectPluginPackage(rootDir, input, download) {
|
|
23
|
+
const root = await realpath(rootDir);
|
|
24
|
+
const prepared = await preparePluginPackage(root, parsePluginInstallSource(input), download);
|
|
25
|
+
try {
|
|
26
|
+
return prepared.review;
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
await rm(prepared.staging, { recursive: true, force: true });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export async function installPluginPackage(options) {
|
|
33
|
+
const input = options.input;
|
|
34
|
+
if (!input ||
|
|
35
|
+
typeof input !== "object" ||
|
|
36
|
+
typeof input.digest !== "string" ||
|
|
37
|
+
!/^[a-f0-9]{64}$/u.test(input.digest))
|
|
38
|
+
throw new PluginInstallError("plugin_review_required", "Review the plugin before installing it.");
|
|
39
|
+
const source = parsePluginInstallSource(input.source);
|
|
40
|
+
if (!source.ref || !/^[a-f0-9]{40}$/u.test(source.ref))
|
|
41
|
+
throw new PluginInstallError("plugin_review_required", "Installation requires the exact reviewed commit.");
|
|
42
|
+
const root = await realpath(options.rootDir);
|
|
43
|
+
const prepared = await preparePluginPackage(root, source, options.download);
|
|
44
|
+
try {
|
|
45
|
+
if (prepared.review.digest !== input.digest ||
|
|
46
|
+
prepared.review.source.ref !== source.ref)
|
|
47
|
+
throw new PluginInstallError("plugin_review_changed", "The plugin changed since review. Inspect it again.", 409);
|
|
48
|
+
return await withFileLock(join(root, ".abot-plugin-installation"), async () => {
|
|
49
|
+
const directory = await installationDirectory(root);
|
|
50
|
+
requireNewPluginIdentity(root, prepared.manifest.name, prepared.review.capabilities.map((capability) => capability.id));
|
|
51
|
+
const target = join(directory, prepared.manifest.name);
|
|
52
|
+
const existing = await lstat(target).catch((error) => {
|
|
53
|
+
if (isAbsentPath(error))
|
|
54
|
+
return undefined;
|
|
55
|
+
throw error;
|
|
56
|
+
});
|
|
57
|
+
if (existing)
|
|
58
|
+
throw new PluginInstallError("plugin_already_installed", "The destination already exists; it will not be overwritten.", 409);
|
|
59
|
+
await writeFile(join(prepared.staging, ".abot-install.json"), JSON.stringify({
|
|
60
|
+
schemaVersion: 1,
|
|
61
|
+
source: prepared.review.source,
|
|
62
|
+
digest: prepared.review.digest,
|
|
63
|
+
installedAt: new Date().toISOString(),
|
|
64
|
+
}) + "\n", { flag: "wx", mode: 0o600 });
|
|
65
|
+
const snapshot = await publishPluginPackage({
|
|
66
|
+
staging: prepared.staging,
|
|
67
|
+
target,
|
|
68
|
+
pluginId: prepared.manifest.name,
|
|
69
|
+
configPath: inspectRuntimeConfigFileWithMeta(root, options.configPath)
|
|
70
|
+
.path,
|
|
71
|
+
requireMutationIdle: options.requireMutationIdle,
|
|
72
|
+
saveSelection: options.saveSelection,
|
|
73
|
+
});
|
|
74
|
+
return { installed: prepared.review, snapshot };
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
await rm(prepared.staging, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { pluginLoadConfiguration } from "./configuration-context.js";
|
|
2
|
+
import { readPluginConfigurationStore, } from "./configuration-store.js";
|
|
1
3
|
import { validateManifestEntrypoint } from "./entrypoint-validation.js";
|
|
2
4
|
import { createRequire } from "node:module";
|
|
3
5
|
import { join } from "node:path";
|
|
@@ -16,9 +18,6 @@ const bundledCatalogCache = new Map();
|
|
|
16
18
|
function isRecord(value) {
|
|
17
19
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
18
20
|
}
|
|
19
|
-
function nonEmptyString(value) {
|
|
20
|
-
return typeof value === "string" && value.trim().length > 0;
|
|
21
|
-
}
|
|
22
21
|
function unwrapPluginExport(rawModule) {
|
|
23
22
|
if (isRecord(rawModule) &&
|
|
24
23
|
"default" in rawModule &&
|
|
@@ -36,32 +35,14 @@ function compiledCapabilityFromDeclaration(tool) {
|
|
|
36
35
|
normalInvocation: tool.normalInvocation,
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
|
-
function createManifestSecretAccessor(pluginId, declarations) {
|
|
40
|
-
if (!declarations || Object.keys(declarations).length === 0) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
for (const [name, declaration] of Object.entries(declarations)) {
|
|
44
|
-
if (declaration.required && !nonEmptyString(process.env[declaration.env])) {
|
|
45
|
-
throw new Error(`Runtime plugin ${pluginId} requires secret ${name} from environment variable ${declaration.env}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return Object.freeze({
|
|
49
|
-
get(name) {
|
|
50
|
-
const declaration = declarations[name];
|
|
51
|
-
if (!declaration) {
|
|
52
|
-
throw new Error(`Runtime plugin ${pluginId} requested undeclared secret ${name}`);
|
|
53
|
-
}
|
|
54
|
-
const value = process.env[declaration.env];
|
|
55
|
-
return nonEmptyString(value) ? value : undefined;
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
38
|
function loadManifestRuntimePlugin(host, discovered, selectedCapabilityIds) {
|
|
60
39
|
const manifest = discovered.manifest;
|
|
61
40
|
const extension = manifest.extensions[ABOT_RUNTIME_EXTENSION];
|
|
62
41
|
const capabilityIds = Object.keys(extension.capabilities);
|
|
63
42
|
const projection = projectManifestRuntimeContract(discovered, selectedCapabilityIds);
|
|
64
|
-
const
|
|
43
|
+
const configuration = pluginLoadConfiguration(manifest.name, extension, Object.hasOwn(host.pluginConfiguration, manifest.name)
|
|
44
|
+
? host.pluginConfiguration[manifest.name]
|
|
45
|
+
: undefined);
|
|
65
46
|
let loaded;
|
|
66
47
|
try {
|
|
67
48
|
loaded = unwrapPluginExport(require(projection.entryPath));
|
|
@@ -80,10 +61,7 @@ function loadManifestRuntimePlugin(host, discovered, selectedCapabilityIds) {
|
|
|
80
61
|
runtimePaths: host.runtimePaths,
|
|
81
62
|
runtimePathResolver: createRuntimeToolPathResolver(host.runtimePaths),
|
|
82
63
|
pluginRoot: discovered.pluginRoot,
|
|
83
|
-
...
|
|
84
|
-
? { config: { ...extension.settings.defaults } }
|
|
85
|
-
: {}),
|
|
86
|
-
...(secrets ? { secrets } : {}),
|
|
64
|
+
...configuration,
|
|
87
65
|
};
|
|
88
66
|
const rawEntrypoint = typeof loaded === "function"
|
|
89
67
|
? loaded(loadContext)
|
|
@@ -134,11 +112,18 @@ export function loadConfiguredRuntimePlugins(config) {
|
|
|
134
112
|
}
|
|
135
113
|
const host = {
|
|
136
114
|
rootDir: config.paths.rootDir,
|
|
115
|
+
pluginConfiguration: readPluginConfigurationStore(config.paths.rootDir)
|
|
116
|
+
.plugins,
|
|
137
117
|
runtimeId: config.runtimeId,
|
|
138
118
|
agentBridgeUrl: config.agentBridgeUrl,
|
|
139
119
|
runtimePaths: config.paths,
|
|
140
120
|
};
|
|
141
|
-
const manifestPlugins = discoverConfiguredRuntimePluginManifests(config.paths.rootDir, {
|
|
121
|
+
const manifestPlugins = discoverConfiguredRuntimePluginManifests(config.paths.rootDir, {
|
|
122
|
+
excludedPluginIds: new Set([
|
|
123
|
+
...selection.deny,
|
|
124
|
+
...selection.disabledPluginIds,
|
|
125
|
+
]),
|
|
126
|
+
})
|
|
142
127
|
.map((plugin) => ({
|
|
143
128
|
plugin,
|
|
144
129
|
selectedCapabilityIds: Object.keys(plugin.manifest.extensions[ABOT_RUNTIME_EXTENSION].capabilities).filter((capabilityId) => isPluginToolSelected({
|
|
@@ -192,6 +177,7 @@ export function loadBundledRuntimePlugins() {
|
|
|
192
177
|
}
|
|
193
178
|
const host = {
|
|
194
179
|
rootDir,
|
|
180
|
+
pluginConfiguration: readPluginConfigurationStore(rootDir).plugins,
|
|
195
181
|
runtimeId: "default",
|
|
196
182
|
agentBridgeUrl: "",
|
|
197
183
|
runtimePaths: createUnconfiguredRuntimePaths(rootDir),
|
|
@@ -71,6 +71,7 @@ export function projectManifestRuntimeContract(discovered, selectedCapabilityIds
|
|
|
71
71
|
operations: Object.entries(capability.operations).map(([operationId, operation]) => ({
|
|
72
72
|
operationId,
|
|
73
73
|
summary: operation.summary,
|
|
74
|
+
...(operation.outputChannels ? { outputChannels: operation.outputChannels } : {}),
|
|
74
75
|
input: operation.input,
|
|
75
76
|
...(operation.selectionControlIds
|
|
76
77
|
? { selectionControlIds: operation.selectionControlIds }
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseOptionalToolOutputChannels } from "../../capabilities/normal-invocation/output-channels.js";
|
|
1
2
|
import { parseRequiredToolPermissionMode } from "../../capabilities/tool-permission-mode.js";
|
|
2
3
|
import { isToolCatalogGroupId } from "../../capabilities/tool-types.js";
|
|
3
4
|
import { parseEventResultMetadata } from "../../capabilities/tool-definition-validator/event-result-metadata.js";
|
|
@@ -276,6 +277,7 @@ function parseOperation(value, path) {
|
|
|
276
277
|
const operation = expectRecord(value, path);
|
|
277
278
|
rejectUnknownKeys(operation, [
|
|
278
279
|
"summary",
|
|
280
|
+
"outputChannels",
|
|
279
281
|
"input",
|
|
280
282
|
"selectionControlIds",
|
|
281
283
|
"effect",
|
|
@@ -309,6 +311,7 @@ function parseOperation(value, path) {
|
|
|
309
311
|
return {
|
|
310
312
|
manifest: {
|
|
311
313
|
summary: operation.summary.trim(),
|
|
314
|
+
...parseOptionalToolOutputChannels(operation.outputChannels, `${path}.outputChannels`),
|
|
312
315
|
input: input,
|
|
313
316
|
...(selectionControlIds ? { selectionControlIds } : {}),
|
|
314
317
|
effect: operation.effect,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { isAbsolute, relative, sep } from "node:path";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
/** Retire only this installation's CommonJS graph, including package-local helpers. */
|
|
5
|
+
export function evictPluginModules(pluginRoot) {
|
|
6
|
+
const removed = new Set();
|
|
7
|
+
for (const [path, module] of Object.entries(require.cache)) {
|
|
8
|
+
const child = relative(pluginRoot, path);
|
|
9
|
+
const outside = isAbsolute(child) || child === ".." || child.startsWith(`..${sep}`);
|
|
10
|
+
if (outside || !module)
|
|
11
|
+
continue;
|
|
12
|
+
removed.add(module);
|
|
13
|
+
delete require.cache[path];
|
|
14
|
+
}
|
|
15
|
+
for (const module of Object.values(require.cache)) {
|
|
16
|
+
if (module)
|
|
17
|
+
module.children = module.children.filter((child) => !removed.has(child));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -3,9 +3,11 @@ export type PluginSelection = Readonly<{
|
|
|
3
3
|
enabled: boolean;
|
|
4
4
|
allow: readonly string[];
|
|
5
5
|
deny: readonly string[];
|
|
6
|
+
disabledPluginIds: readonly string[];
|
|
6
7
|
}>;
|
|
7
8
|
export declare function normalizePluginSelection(config: RuntimePluginConfig | undefined): PluginSelection;
|
|
8
9
|
export declare function pluginSelectionCacheKey(selection: PluginSelection): string;
|
|
10
|
+
export declare function isPluginDisabledById(pluginId: string, selection: PluginSelection): boolean;
|
|
9
11
|
export declare function isPluginCatalogDisabled(selection: PluginSelection): boolean;
|
|
10
12
|
export declare function isPluginToolSelected(params: {
|
|
11
13
|
pluginId: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { matchesToolSelectionId } from "../../shared/tool-selection.js";
|
|
1
2
|
function uniqueSorted(values) {
|
|
2
3
|
return [
|
|
3
4
|
...new Set((values ?? [])
|
|
@@ -10,29 +11,33 @@ export function normalizePluginSelection(config) {
|
|
|
10
11
|
enabled: config?.enabled !== false,
|
|
11
12
|
allow: Object.freeze(uniqueSorted(config?.allow)),
|
|
12
13
|
deny: Object.freeze(uniqueSorted(config?.deny)),
|
|
14
|
+
disabledPluginIds: Object.freeze(uniqueSorted(config?.disabledPluginIds)),
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
17
|
export function pluginSelectionCacheKey(selection) {
|
|
16
|
-
return JSON.stringify([
|
|
18
|
+
return JSON.stringify([
|
|
19
|
+
selection.enabled,
|
|
20
|
+
selection.allow,
|
|
21
|
+
selection.deny,
|
|
22
|
+
selection.disabledPluginIds,
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
export function isPluginDisabledById(pluginId, selection) {
|
|
26
|
+
return selection.disabledPluginIds.includes(pluginId);
|
|
17
27
|
}
|
|
18
28
|
export function isPluginCatalogDisabled(selection) {
|
|
19
29
|
if (!selection.enabled)
|
|
20
30
|
return true;
|
|
21
31
|
return selection.deny.includes("*");
|
|
22
32
|
}
|
|
23
|
-
function matchesPluginToolId(pluginId, toolName, configuredId) {
|
|
24
|
-
return (configuredId === "*" ||
|
|
25
|
-
configuredId === pluginId ||
|
|
26
|
-
configuredId === toolName ||
|
|
27
|
-
configuredId === `${pluginId}.${toolName}`);
|
|
28
|
-
}
|
|
29
33
|
export function isPluginToolSelected(params) {
|
|
30
|
-
if (!params.selection.enabled)
|
|
34
|
+
if (!params.selection.enabled)
|
|
35
|
+
return false;
|
|
36
|
+
if (isPluginDisabledById(params.pluginId, params.selection))
|
|
31
37
|
return false;
|
|
32
|
-
}
|
|
33
38
|
if (params.selection.allow.length > 0 &&
|
|
34
|
-
!params.selection.allow.some((entry) =>
|
|
39
|
+
!params.selection.allow.some((entry) => matchesToolSelectionId(params.pluginId, params.toolName, entry))) {
|
|
35
40
|
return false;
|
|
36
41
|
}
|
|
37
|
-
return !params.selection.deny.some((entry) =>
|
|
42
|
+
return !params.selection.deny.some((entry) => matchesToolSelectionId(params.pluginId, params.toolName, entry));
|
|
38
43
|
}
|
|
@@ -44,6 +44,8 @@ export type RuntimeRequestRunnerConfig = {
|
|
|
44
44
|
configPath: string;
|
|
45
45
|
};
|
|
46
46
|
export type RuntimePluginConfig = {
|
|
47
|
+
/** Exact plugin IDs; never interpreted as capability IDs or wildcards. */
|
|
48
|
+
disabledPluginIds?: string[];
|
|
47
49
|
enabled?: boolean;
|
|
48
50
|
allow?: string[];
|
|
49
51
|
deny?: string[];
|
|
@@ -60,6 +62,9 @@ export type RuntimeConfig = {
|
|
|
60
62
|
agentBridgeToken?: string;
|
|
61
63
|
modelGatewayUrl: string;
|
|
62
64
|
paths: RuntimePaths;
|
|
65
|
+
webUi?: {
|
|
66
|
+
pageSize: number;
|
|
67
|
+
};
|
|
63
68
|
logging?: RuntimeLoggingConfig;
|
|
64
69
|
timeouts?: RuntimeTimeouts;
|
|
65
70
|
plugins?: RuntimePluginConfig;
|
|
@@ -129,10 +134,7 @@ export type SessionStore = SessionMemoryRepository & {
|
|
|
129
134
|
cursor?: string | null;
|
|
130
135
|
}) => Promise<SessionListResult>;
|
|
131
136
|
getSessionById: (sessionId: string) => Promise<SessionRecord | null>;
|
|
132
|
-
getSessionSnapshot: (sessionId: string, options?:
|
|
133
|
-
afterMessageId?: string | number | null;
|
|
134
|
-
includeRequests?: boolean;
|
|
135
|
-
}) => Promise<SessionSnapshot | null>;
|
|
137
|
+
getSessionSnapshot: (sessionId: string, options?: import("../sessions/snapshot.js").SessionSnapshotOptions) => Promise<SessionSnapshot | null>;
|
|
136
138
|
getRequestReplayById: (requestId: string, afterSeq?: number) => Promise<SessionRequestReplay | null>;
|
|
137
139
|
updateSessionTitle: (sessionId: string, title: string) => Promise<SessionRecord | null>;
|
|
138
140
|
updateSessionRuntimeMode?: (sessionId: string, runtimeModeId: string | null) => Promise<SessionRecord | null>;
|
|
@@ -18,7 +18,8 @@ export declare function resolveRequestDependencies(options: RequestHandlerOption
|
|
|
18
18
|
runnerConfig: import("../config/runner/contracts.js").RequestRunnerConfig;
|
|
19
19
|
modelPolicy: import("../../model-gateway/types.js").ModelGatewayPolicyConfig;
|
|
20
20
|
modelExecutionPolicies: Readonly<Record<string, Readonly<{
|
|
21
|
-
policy
|
|
21
|
+
policy?: import("../config/model-execution-policy.js").RequestExecutionPolicyId;
|
|
22
|
+
plugins?: import("../config/model-plugin-config.js").RuntimeModelPluginConfig;
|
|
22
23
|
}>>> | undefined;
|
|
23
24
|
};
|
|
24
25
|
};
|
|
@@ -22,8 +22,8 @@ export declare function projectExecutionPayloadCompactedEvidence(request: Payloa
|
|
|
22
22
|
adapterResult: import("../orchestration/capability-adapters/result.js").CapabilityAdapterResult;
|
|
23
23
|
}> | Readonly<{
|
|
24
24
|
compactedSourceRef: string;
|
|
25
|
-
capabilityId: string;
|
|
26
25
|
summary: string;
|
|
26
|
+
capabilityId: string;
|
|
27
27
|
callId: string;
|
|
28
28
|
outcome: import("../orchestration/role-calls/contracts.js").RoleCapabilityExecutionOutcome;
|
|
29
29
|
executionId: string;
|
|
@@ -7,6 +7,7 @@ import { isRequestCancelled, REQUEST_CANCELLED } from "./cancellation.js";
|
|
|
7
7
|
import { isRequestInterrupted, REQUEST_INTERRUPTED } from "./interruption.js";
|
|
8
8
|
import { RequestToolResources } from "../capabilities/request-tool-resources.js";
|
|
9
9
|
import { traceDebug } from "../observability/debug-logger.js";
|
|
10
|
+
import { traceRequestControl } from "../observability/request-control-diagnostics.js";
|
|
10
11
|
import { RequestLifecycle } from "../orchestration/lifecycle/request-lifecycle.js";
|
|
11
12
|
import { ROLE_CALL_RESPONSE_MAX_LENGTH } from "../orchestration/role-calls/index.js";
|
|
12
13
|
import { runModelAuthoredDegradedFinalization } from "../steps/degraded-finalization/model-authored.js";
|
|
@@ -107,6 +108,13 @@ class RequestHandlingSession {
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
async execute() {
|
|
111
|
+
traceRequestControl("runtime.request_control", "request.entered", {
|
|
112
|
+
requestId: this.input.requestId,
|
|
113
|
+
sessionId: this.input.sessionId,
|
|
114
|
+
environmentId: this.options.runtimeConfig?.runtimeId,
|
|
115
|
+
toolPermissionMode: this.input.toolPermissionMode,
|
|
116
|
+
resumed: Boolean(this.options.approvalExecution?.resume),
|
|
117
|
+
});
|
|
110
118
|
const prepared = await prepareRequestExecution({
|
|
111
119
|
ws: this.ws,
|
|
112
120
|
options: this.options,
|
|
@@ -116,7 +116,9 @@ export async function prepareRequestExecution(params) {
|
|
|
116
116
|
sessionId,
|
|
117
117
|
prompt: initialized.prompt,
|
|
118
118
|
temporalContext: params.temporalContext,
|
|
119
|
-
...(isSparkSession(opened.session)
|
|
119
|
+
...(isSparkSession(opened.session)
|
|
120
|
+
? { sessionKind: "spark" }
|
|
121
|
+
: {}),
|
|
120
122
|
historyMessages,
|
|
121
123
|
shouldGenerateSessionTitle: generateSessionTitle,
|
|
122
124
|
runnerConfig: loaded.runnerConfig,
|
|
@@ -214,6 +216,9 @@ export async function prepareRequestExecution(params) {
|
|
|
214
216
|
requestWorkingDirectory,
|
|
215
217
|
...(filesystemScope ? { filesystemScope } : {}),
|
|
216
218
|
executionPolicyAuthority: executionPolicy.authority,
|
|
219
|
+
...(seed.executionPolicySelection?.plugins
|
|
220
|
+
? { modelPlugins: seed.executionPolicySelection.plugins }
|
|
221
|
+
: {}),
|
|
217
222
|
requestAttachments: toolAttachments,
|
|
218
223
|
...(options.runtimeConfig
|
|
219
224
|
? { runtimeConfig: options.runtimeConfig }
|
|
@@ -33,4 +33,8 @@ export declare function resolveRequestSteeringInbox(inbox: RequestSteeringInbox
|
|
|
33
33
|
export declare function projectRequestSteeringSnapshot(inbox: RequestSteeringInbox | undefined, version: number): RequestSteeringSnapshot;
|
|
34
34
|
export declare function createRequestSteeringInbox(params: {
|
|
35
35
|
requestId: string;
|
|
36
|
+
diagnostics?: Readonly<{
|
|
37
|
+
inboxId?: string;
|
|
38
|
+
origin?: string;
|
|
39
|
+
}>;
|
|
36
40
|
}): RequestSteeringInbox;
|