@abot-ai/runtime 1.3.1 → 1.4.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/dist/plugins/system/source/application-catalog.d.ts +14 -0
- package/dist/plugins/system/source/application-catalog.js +185 -0
- package/dist/plugins/system/source/application-launch.d.ts +10 -0
- package/dist/plugins/system/source/application-launch.js +80 -0
- package/dist/plugins/system/source/application-observation.d.ts +25 -0
- package/dist/plugins/system/source/application-observation.js +53 -0
- package/dist/plugins/system/source/commands.d.ts +7 -0
- package/dist/plugins/system/source/commands.js +71 -0
- package/dist/plugins/system/source/companion/autostart.d.ts +16 -0
- package/dist/plugins/system/source/companion/autostart.js +146 -0
- package/dist/plugins/system/source/companion/broker-location.d.ts +11 -0
- package/dist/plugins/system/source/companion/broker-location.js +76 -0
- package/dist/plugins/system/source/companion/broker-server.d.ts +4 -0
- package/dist/plugins/system/source/companion/broker-server.js +147 -0
- package/dist/plugins/system/source/companion/connection.d.ts +25 -0
- package/dist/plugins/system/source/companion/connection.js +182 -0
- package/dist/plugins/system/source/companion/liveness.d.ts +3 -0
- package/dist/plugins/system/source/companion/liveness.js +20 -0
- package/dist/plugins/system/source/companion/native-address.d.ts +12 -0
- package/dist/plugins/system/source/companion/native-address.js +41 -0
- package/dist/plugins/system/source/companion/native-identity.d.ts +2 -0
- package/dist/plugins/system/source/companion/native-identity.js +23 -0
- package/dist/plugins/system/source/companion/native-messages.d.ts +9 -0
- package/dist/plugins/system/source/companion/native-messages.js +77 -0
- package/dist/plugins/system/source/companion/native-session.d.ts +19 -0
- package/dist/plugins/system/source/companion/native-session.js +205 -0
- package/dist/plugins/system/source/companion/native-state.d.ts +22 -0
- package/dist/plugins/system/source/companion/native-state.js +126 -0
- package/dist/plugins/system/source/companion/native-supervisor.d.ts +10 -0
- package/dist/plugins/system/source/companion/native-supervisor.js +93 -0
- package/dist/plugins/system/source/companion/pairing-store.d.ts +22 -0
- package/dist/plugins/system/source/companion/pairing-store.js +102 -0
- package/dist/plugins/system/source/companion/private-store.d.ts +4 -0
- package/dist/plugins/system/source/companion/private-store.js +59 -0
- package/dist/plugins/system/source/companion/process-owner-identity.d.ts +22 -0
- package/dist/plugins/system/source/companion/process-owner-identity.js +144 -0
- package/dist/plugins/system/source/companion/protocol.d.ts +57 -0
- package/dist/plugins/system/source/companion/protocol.js +66 -0
- package/dist/plugins/system/source/contracts.d.ts +38 -0
- package/dist/plugins/system/source/contracts.js +7 -0
- package/dist/plugins/system/source/elevation.d.ts +8 -0
- package/dist/plugins/system/source/elevation.js +57 -0
- package/dist/plugins/system/source/handlers.d.ts +3 -0
- package/dist/plugins/system/source/handlers.js +90 -0
- package/dist/plugins/system/source/host-evidence.d.ts +4 -0
- package/dist/plugins/system/source/host-evidence.js +52 -0
- package/dist/plugins/system/source/host-observation.d.ts +25 -0
- package/dist/plugins/system/source/host-observation.js +59 -0
- package/dist/plugins/system/source/process-result.d.ts +4 -0
- package/dist/plugins/system/source/process-result.js +86 -0
- package/dist/plugins/system/source/process-runner.d.ts +3 -0
- package/dist/plugins/system/source/process-runner.js +103 -0
- package/dist/plugins/system/source/target-observation.d.ts +18 -0
- package/dist/plugins/system/source/target-observation.js +29 -0
- package/dist/plugins/system/source/targets.d.ts +8 -0
- package/dist/plugins/system/source/targets.js +101 -0
- package/dist/scripts/add-runtime-model.js +10 -53
- package/dist/scripts/runtime-model-addition.d.ts +13 -0
- package/dist/scripts/runtime-model-addition.js +53 -0
- package/dist/scripts/runtime-setup-files.d.ts +3 -1
- package/dist/scripts/runtime-setup-files.js +18 -1
- package/dist/src/capabilities/file-output-presentation.d.ts +43 -0
- package/dist/src/capabilities/file-output-presentation.js +133 -0
- package/dist/src/capabilities/tool-definition-validator/definition-parser.js +2 -0
- package/dist/src/capabilities/tool-definition-validator/event-input-text-options.d.ts +5 -0
- package/dist/src/capabilities/tool-definition-validator/event-input-text-options.js +37 -0
- package/dist/src/capabilities/tool-definition-validator/event-presentation.js +3 -0
- package/dist/src/capabilities/tool-definition-validator/module-registry.js +12 -0
- package/dist/src/capabilities/tool-event-input-text.d.ts +9 -0
- package/dist/src/capabilities/tool-event-input-text.js +64 -0
- package/dist/src/capabilities/tool-event-metadata.js +10 -0
- package/dist/src/capabilities/tool-executor.d.ts +1 -0
- package/dist/src/capabilities/tool-executor.js +1 -0
- package/dist/src/capabilities/tool-permission-mode.d.ts +7 -0
- package/dist/src/capabilities/tool-permission-mode.js +27 -0
- package/dist/src/capabilities/tool-types.d.ts +18 -2
- package/dist/src/cli/abot.js +18 -15
- package/dist/src/cli/host-companion-bundle.mjs +5201 -0
- package/dist/src/cli/host-companion-entry.d.ts +8 -0
- package/dist/src/cli/host-companion-entry.js +70 -0
- package/dist/src/cli/host-companion-startup.d.ts +4 -0
- package/dist/src/cli/host-companion-startup.js +35 -0
- package/dist/src/cli/host-companion.d.ts +5 -0
- package/dist/src/cli/host-companion.js +203 -0
- package/dist/src/model-gateway/server/configuration.js +4 -1
- package/dist/src/model-gateway/server/contracts.d.ts +2 -0
- package/dist/src/plugin-contract/entrypoint.d.ts +4 -2
- package/dist/src/plugin-contract/manifest.d.ts +1 -0
- package/dist/src/runtime/adapters/config-file-transaction.d.ts +46 -0
- package/dist/src/runtime/adapters/config-file-transaction.js +158 -0
- package/dist/src/runtime/adapters/configured-skill-provider.js +3 -3
- package/dist/src/runtime/adapters/in-memory-session-store.js +11 -1
- package/dist/src/runtime/adapters/long-term-memory/file-lock/acquisition.js +7 -3
- package/dist/src/runtime/adapters/long-term-memory/file-lock/contracts.d.ts +4 -1
- package/dist/src/runtime/adapters/long-term-memory/file-lock/install.d.ts +1 -1
- package/dist/src/runtime/adapters/long-term-memory/file-lock/install.js +5 -1
- package/dist/src/runtime/adapters/long-term-memory/file-lock/owner-identity.d.ts +3 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/owner-identity.js +15 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/owner-record.js +2 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-config-repository.js +17 -43
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/catalog/registrations.js +6 -2
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.js +10 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/execution-binding.d.ts +11 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/execution-binding.js +37 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/file-output-presentation.d.ts +7 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/file-output-presentation.js +105 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/run.js +29 -3
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/action-fingerprint.d.ts +1 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/action-fingerprint.js +1 -0
- package/dist/src/runtime/capabilities/configured-tool-registry.js +9 -1
- package/dist/src/runtime/capabilities/file-output-root-identity.d.ts +5 -0
- package/dist/src/runtime/capabilities/file-output-root-identity.js +146 -0
- package/dist/src/runtime/capabilities/file-output-root-marker-creation.d.ts +5 -0
- package/dist/src/runtime/capabilities/file-output-root-marker-creation.js +63 -0
- package/dist/src/runtime/capabilities/request-bound-tool-registry.d.ts +1 -0
- package/dist/src/runtime/capabilities/request-bound-tool-registry.js +6 -1
- package/dist/src/runtime/capabilities/request-module-preparation.d.ts +3 -0
- package/dist/src/runtime/capabilities/request-module-preparation.js +102 -0
- package/dist/src/runtime/capabilities/request-permission-catalog.d.ts +10 -0
- package/dist/src/runtime/capabilities/request-permission-catalog.js +50 -0
- package/dist/src/runtime/capabilities/request-permission-tool-registry.d.ts +4 -0
- package/dist/src/runtime/capabilities/request-permission-tool-registry.js +61 -0
- package/dist/src/runtime/capabilities/request-runtime-tool-registry.d.ts +3 -0
- package/dist/src/runtime/capabilities/request-runtime-tool-registry.js +5 -2
- package/dist/src/runtime/capabilities/request-working-directory.d.ts +3 -0
- package/dist/src/runtime/capabilities/request-working-directory.js +12 -0
- package/dist/src/runtime/composition.d.ts +2 -0
- package/dist/src/runtime/config/runner/loader.d.ts +4 -0
- package/dist/src/runtime/config/runner/loader.js +23 -3
- package/dist/src/runtime/context/capability-brief-budget.d.ts +18 -0
- package/dist/src/runtime/context/capability-brief-budget.js +38 -0
- package/dist/src/runtime/context/capability-brief-readmission.d.ts +21 -0
- package/dist/src/runtime/context/capability-brief-readmission.js +47 -0
- package/dist/src/runtime/context/capability-brief.d.ts +9 -2
- package/dist/src/runtime/context/capability-brief.js +21 -39
- package/dist/src/runtime/context/capability-descriptions.d.ts +3 -0
- package/dist/src/runtime/context/capability-descriptions.js +23 -0
- package/dist/src/runtime/default-environment-adapters.js +3 -4
- package/dist/src/runtime/local-application.d.ts +18 -0
- package/dist/src/runtime/local-application.js +12 -0
- package/dist/src/runtime/local-host/app-service-dispatch.d.ts +1 -0
- package/dist/src/runtime/local-host/app-service-dispatch.js +9 -0
- package/dist/src/runtime/local-host/client-services.d.ts +16 -0
- package/dist/src/runtime/local-host/client-services.js +3 -2
- package/dist/src/runtime/local-host/contracts.d.ts +4 -0
- package/dist/src/runtime/local-host/startup-connection.js +22 -7
- package/dist/src/runtime/local-host/transport.js +14 -2
- package/dist/src/runtime/orchestration/role-calls/candidate-validation.js +5 -2
- package/dist/src/runtime/orchestration/role-calls/command-decoder.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/work-plan-transition.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/work-plan-transition.js +46 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/contracts.d.ts +8 -4
- package/dist/src/runtime/orchestration/role-calls/transactions.js +2 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-contracts.d.ts +48 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-contracts.js +9 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-source.d.ts +7 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-source.js +85 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-transactions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-transactions.js +17 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-validation.d.ts +10 -0
- package/dist/src/runtime/orchestration/role-calls/work-plan-validation.js +149 -0
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.d.ts +1 -1
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.js +1 -1
- package/dist/src/runtime/plugins/compiled-catalog.d.ts +2 -1
- package/dist/src/runtime/plugins/configured-manifests.d.ts +3 -0
- package/dist/src/runtime/plugins/configured-manifests.js +37 -0
- package/dist/src/runtime/plugins/entrypoint-validation.d.ts +6 -0
- package/dist/src/runtime/plugins/entrypoint-validation.js +74 -0
- package/dist/src/runtime/plugins/loader.js +11 -123
- package/dist/src/runtime/plugins/manifest-discovery.d.ts +4 -1
- package/dist/src/runtime/plugins/manifest-discovery.js +8 -1
- package/dist/src/runtime/plugins/manifest-projection.js +3 -0
- package/dist/src/runtime/plugins/manifest-validator.js +7 -1
- package/dist/src/runtime/plugins/runtime-capability-plugins.d.ts +4 -0
- package/dist/src/runtime/plugins/runtime-capability-plugins.js +7 -0
- package/dist/src/runtime/plugins/selection.d.ts +14 -0
- package/dist/src/runtime/plugins/selection.js +38 -0
- package/dist/src/runtime/ports.d.ts +8 -2
- package/dist/src/runtime/projects/contracts.d.ts +40 -0
- package/dist/src/runtime/projects/contracts.js +10 -0
- package/dist/src/runtime/projects/folders.d.ts +7 -0
- package/dist/src/runtime/projects/folders.js +110 -0
- package/dist/src/runtime/projects/repository.d.ts +10 -0
- package/dist/src/runtime/projects/repository.js +54 -0
- package/dist/src/runtime/projects/service.d.ts +3 -0
- package/dist/src/runtime/projects/service.js +34 -0
- package/dist/src/runtime/projects/session-paths.d.ts +5 -0
- package/dist/src/runtime/projects/session-paths.js +13 -0
- package/dist/src/runtime/request/execution-agent-plan-update.d.ts +4 -0
- package/dist/src/runtime/request/execution-agent-plan-update.js +13 -0
- package/dist/src/runtime/request/execution-agent-root-execution.js +9 -1
- package/dist/src/runtime/request/handler.js +9 -2
- package/dist/src/runtime/request/input.d.ts +2 -1
- package/dist/src/runtime/request/input.js +1 -6
- package/dist/src/runtime/request/role-call-planner-events.js +4 -0
- package/dist/src/runtime/request/role-executor-composition.js +9 -1
- package/dist/src/runtime/request/root-contract.d.ts +6 -1
- package/dist/src/runtime/request/root-execution-kernel.js +17 -0
- package/dist/src/runtime/request/root-plan-event-projection.d.ts +3 -0
- package/dist/src/runtime/request/root-plan-event-projection.js +32 -0
- package/dist/src/runtime/request/root-plan-update.d.ts +15 -0
- package/dist/src/runtime/request/root-plan-update.js +20 -0
- package/dist/src/runtime/request/worker-capability-composition.d.ts +1 -0
- package/dist/src/runtime/request/worker-capability-composition.js +2 -0
- package/dist/src/runtime/runtime-environment.d.ts +1 -0
- package/dist/src/runtime/runtime-environment.js +2 -0
- package/dist/src/runtime/steps/auditor-decision/advisory-receipt.d.ts +32 -0
- package/dist/src/runtime/steps/auditor-decision/advisory-receipt.js +106 -0
- package/dist/src/runtime/steps/auditor-decision/advisory-result-budget.d.ts +5 -0
- package/dist/src/runtime/steps/auditor-decision/advisory-result-budget.js +40 -0
- package/dist/src/runtime/steps/auditor-decision/audit-input-state.d.ts +12 -0
- package/dist/src/runtime/steps/auditor-decision/audit-input-state.js +101 -0
- package/dist/src/runtime/steps/auditor-decision/contracts.d.ts +31 -16
- package/dist/src/runtime/steps/auditor-decision/contracts.js +3 -3
- package/dist/src/runtime/steps/auditor-decision/evidence-binding.d.ts +5 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-binding.js +43 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-coverage.d.ts +2 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-coverage.js +71 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-inventory.d.ts +13 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-inventory.js +89 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.d.ts +10 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.js +56 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-selection.d.ts +9 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-selection.js +71 -0
- package/dist/src/runtime/steps/auditor-decision/format.js +44 -2
- package/dist/src/runtime/steps/auditor-decision/index.d.ts +3 -0
- package/dist/src/runtime/steps/auditor-decision/index.js +3 -0
- package/dist/src/runtime/steps/auditor-decision/input.d.ts +2 -2
- package/dist/src/runtime/steps/auditor-decision/input.js +64 -20
- package/dist/src/runtime/steps/auditor-decision/parser.js +38 -23
- package/dist/src/runtime/steps/auditor-decision/projection.js +49 -99
- package/dist/src/runtime/steps/auditor-decision/prompt.d.ts +1 -1
- package/dist/src/runtime/steps/auditor-decision/prompt.js +9 -4
- package/dist/src/runtime/steps/auditor-decision/run.js +79 -47
- package/dist/src/runtime/steps/execution-agent/contracts.d.ts +8 -1
- package/dist/src/runtime/steps/execution-agent/contracts.js +2 -0
- package/dist/src/runtime/steps/execution-agent/decision-parsing.js +4 -0
- package/dist/src/runtime/steps/execution-agent/format.js +4 -3
- package/dist/src/runtime/steps/execution-agent/input.js +10 -11
- package/dist/src/runtime/steps/execution-agent/prompt.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/prompt.js +11 -4
- package/dist/src/runtime/steps/execution-agent/state-context.js +10 -0
- package/dist/src/runtime/steps/execution-agent/work-plan-contract.d.ts +18 -0
- package/dist/src/runtime/steps/execution-agent/work-plan-contract.js +86 -0
- package/dist/src/runtime/steps/execution-agent/work-plan-decision-parsing.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/work-plan-decision-parsing.js +38 -0
- package/dist/src/runtime/steps/execution-agent/work-plan-sources.d.ts +6 -0
- package/dist/src/runtime/steps/execution-agent/work-plan-sources.js +54 -0
- package/dist/src/runtime/steps/planner-decision/capability-brief.d.ts +40 -0
- package/dist/src/runtime/steps/planner-decision/capability-brief.js +47 -0
- package/dist/src/runtime/steps/planner-decision/input.d.ts +4 -2
- package/dist/src/runtime/steps/planner-decision/input.js +23 -13
- package/dist/src/runtime/steps/planner-decision/prompt.js +2 -2
- package/dist/src/runtime/steps/planner-decision/run.js +11 -7
- package/dist/src/runtime/steps/planner-graph/parser.js +0 -11
- package/dist/src/runtime/steps/planner-graph/prompt.js +2 -1
- package/dist/src/runtime/steps/supervisor-decision/capability-brief-readmission.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-decision/capability-brief-readmission.js +39 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +2 -1
- package/dist/src/runtime/steps/worker-decision/parser/accepted-decision.d.ts +3 -1
- package/dist/src/runtime/steps/worker-decision/parser/accepted-decision.js +20 -1
- package/dist/src/runtime/steps/worker-decision/parser/capability-batch-validation.d.ts +1 -1
- package/dist/src/runtime/steps/worker-decision/parser/capability-batch-validation.js +6 -6
- package/dist/src/runtime/steps/worker-decision/parser/capability-invocation-validation.js +2 -1
- package/dist/src/sessions/project-binding.d.ts +12 -0
- package/dist/src/sessions/project-binding.js +49 -0
- package/dist/src/sessions/record/projection.d.ts +6 -1
- package/dist/src/sessions/record/projection.js +1 -0
- package/dist/src/sessions/session-service.d.ts +2 -1
- package/dist/src/sessions/session-service.js +11 -1
- package/dist/src/sessions/types.d.ts +7 -0
- package/dist/src/web-ui/app/ARCHITECTURE.md +121 -1
- package/dist/src/web-ui/app/app-bootstrap.js +3 -0
- package/dist/src/web-ui/app/app-dom.js +3 -0
- package/dist/src/web-ui/app/app-state.js +38 -0
- package/dist/src/web-ui/app/app.js +76 -67
- package/dist/src/web-ui/app/components/config-workspace/config-model.js +23 -3
- package/dist/src/web-ui/app/components/config-workspace/dashboard-rendering.js +2 -0
- package/dist/src/web-ui/app/components/config-workspace/field-rendering.js +2 -0
- package/dist/src/web-ui/app/components/config-workspace/model-rendering.js +6 -0
- package/dist/src/web-ui/app/components/config-workspace/model-setup-entry.js +27 -0
- package/dist/src/web-ui/app/components/config-workspace/raw-config-repair.js +28 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-events.js +5 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-mutations.js +23 -3
- package/dist/src/web-ui/app/components/config-workspace/workspace-persistence.js +26 -8
- package/dist/src/web-ui/app/components/config-workspace/workspace-view.js +56 -0
- package/dist/src/web-ui/app/components/config-workspace.js +11 -0
- package/dist/src/web-ui/app/components/conversation-activity.d.ts +6 -0
- package/dist/src/web-ui/app/components/conversation-activity.js +10 -2
- package/dist/src/web-ui/app/components/conversation-file-action.js +33 -0
- package/dist/src/web-ui/app/components/conversation-file-focus.d.ts +12 -0
- package/dist/src/web-ui/app/components/conversation-file-focus.js +149 -0
- package/dist/src/web-ui/app/components/conversation-file-preview.d.ts +23 -0
- package/dist/src/web-ui/app/components/conversation-file-preview.js +247 -0
- package/dist/src/web-ui/app/components/conversation-role-cards.d.ts +6 -0
- package/dist/src/web-ui/app/components/conversation-role-cards.js +10 -2
- package/dist/src/web-ui/app/components/conversation-tool-evidence.d.ts +9 -0
- package/dist/src/web-ui/app/components/conversation-tool-evidence.js +129 -0
- package/dist/src/web-ui/app/components/conversation-tools.d.ts +6 -0
- package/dist/src/web-ui/app/components/conversation-tools.js +25 -105
- package/dist/src/web-ui/app/components/conversation-view.js +10 -1
- package/dist/src/web-ui/app/components/dashboard/workspace.js +19 -7
- package/dist/src/web-ui/app/components/model-setup/rendering.js +99 -0
- package/dist/src/web-ui/app/components/model-setup/save-flow.js +111 -0
- package/dist/src/web-ui/app/components/model-setup/save-outcome.js +16 -0
- package/dist/src/web-ui/app/components/model-setup/validation.js +125 -0
- package/dist/src/web-ui/app/components/model-setup/wizard.d.ts +44 -0
- package/dist/src/web-ui/app/components/model-setup/wizard.js +370 -0
- package/dist/src/web-ui/app/components/plugins/manager.js +200 -0
- package/dist/src/web-ui/app/components/plugins/rendering.js +124 -0
- package/dist/src/web-ui/app/components/plugins/view-state.js +123 -0
- package/dist/src/web-ui/app/components/project-creation.js +119 -0
- package/dist/src/web-ui/app/components/project-session-groups.js +95 -0
- package/dist/src/web-ui/app/components/runtime-config-activation.js +83 -0
- package/dist/src/web-ui/app/components/runtime-setup/bridge-guide.d.ts +9 -0
- package/dist/src/web-ui/app/components/runtime-setup/bridge-guide.js +198 -0
- package/dist/src/web-ui/app/components/runtime-setup/bridge-rendering.js +107 -0
- package/dist/src/web-ui/app/components/runtime-setup/commands.js +54 -0
- package/dist/src/web-ui/app/components/runtime-setup/configuration-recovery.js +25 -0
- package/dist/src/web-ui/app/components/runtime-setup/connection-form.js +154 -0
- package/dist/src/web-ui/app/components/runtime-setup/connection-state.js +71 -0
- package/dist/src/web-ui/app/components/runtime-setup/context-window.js +18 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-credential-status.d.ts +15 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-credential-status.js +87 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-provider-receipt.js +30 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding-rendering.js +57 -0
- package/dist/src/web-ui/app/components/runtime-setup/embedding.js +284 -0
- package/dist/src/web-ui/app/components/runtime-setup/optional-steps.js +117 -0
- package/dist/src/web-ui/app/components/runtime-setup/plugins.js +173 -0
- package/dist/src/web-ui/app/components/runtime-setup/rendering.js +141 -0
- package/dist/src/web-ui/app/components/runtime-setup/validation.js +69 -0
- package/dist/src/web-ui/app/components/runtime-setup/view-state.js +58 -0
- package/dist/src/web-ui/app/components/runtime-setup/wizard-shell.js +27 -0
- package/dist/src/web-ui/app/components/runtime-setup-guide.d.ts +66 -5
- package/dist/src/web-ui/app/components/runtime-setup-guide.js +415 -461
- package/dist/src/web-ui/app/components/system-host/download.js +38 -0
- package/dist/src/web-ui/app/components/system-host/manager.js +249 -0
- package/dist/src/web-ui/app/components/system-host/rendering.js +88 -0
- package/dist/src/web-ui/app/components/system-host/setup-notice.js +87 -0
- package/dist/src/web-ui/app/components/system-host/visibility.js +35 -0
- package/dist/src/web-ui/app/components/tool-approval-card.d.ts +4 -0
- package/dist/src/web-ui/app/components/tool-approval-card.js +15 -0
- package/dist/src/web-ui/app/configuration-environment-refresh.js +118 -0
- package/dist/src/web-ui/app/configuration-feature.js +125 -4
- package/dist/src/web-ui/app/controllers/app-event-bindings.js +2 -0
- package/dist/src/web-ui/app/controllers/composer-workspace-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/composer-workspace-controller.js +4 -3
- package/dist/src/web-ui/app/controllers/conversation-file-preview-controller.d.ts +24 -0
- package/dist/src/web-ui/app/controllers/conversation-file-preview-controller.js +158 -0
- package/dist/src/web-ui/app/controllers/conversation-file-preview-feature.d.ts +19 -0
- package/dist/src/web-ui/app/controllers/conversation-file-preview-feature.js +63 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.d.ts +1 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.js +2 -0
- package/dist/src/web-ui/app/controllers/conversation-view-feature.js +28 -0
- package/dist/src/web-ui/app/controllers/dashboard-controller.js +17 -0
- package/dist/src/web-ui/app/controllers/projects-controller.d.ts +45 -0
- package/dist/src/web-ui/app/controllers/projects-controller.js +278 -0
- package/dist/src/web-ui/app/controllers/realtime-event-controller.js +3 -0
- package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.js +13 -6
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.d.ts +7 -1
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.js +11 -95
- package/dist/src/web-ui/app/controllers/session-controller.js +64 -57
- package/dist/src/web-ui/app/controllers/tool-permission-mode-controller.d.ts +20 -0
- package/dist/src/web-ui/app/controllers/tool-permission-mode-controller.js +116 -0
- package/dist/src/web-ui/app/dashboard-feature.js +32 -10
- package/dist/src/web-ui/app/index.html +44 -7
- package/dist/src/web-ui/app/lib/conversation-file-preview.d.ts +12 -0
- package/dist/src/web-ui/app/lib/conversation-file-reference.d.ts +30 -0
- package/dist/src/web-ui/app/lib/conversation-file-reference.js +66 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.d.ts +2 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.js +18 -6
- package/dist/src/web-ui/app/lib/tool-activity-model.d.ts +2 -0
- package/dist/src/web-ui/app/lib/tool-activity-model.js +4 -2
- package/dist/src/web-ui/app/lib/tool-permission-mode.d.ts +16 -0
- package/dist/src/web-ui/app/lib/tool-permission-mode.js +60 -0
- package/dist/src/web-ui/app/lib/tool-process-activity-fields.js +102 -0
- package/dist/src/web-ui/app/projects-feature.js +134 -0
- package/dist/src/web-ui/app/runtime-onboarding-feature.d.ts +34 -0
- package/dist/src/web-ui/app/runtime-onboarding-feature.js +92 -0
- package/dist/src/web-ui/app/runtime-setup-page-lifecycle.d.ts +5 -0
- package/dist/src/web-ui/app/runtime-setup-page-lifecycle.js +13 -0
- package/dist/src/web-ui/app/services/client-preferences.d.ts +24 -0
- package/dist/src/web-ui/app/services/client-preferences.js +32 -19
- package/dist/src/web-ui/app/services/runtime-web-client/configuration.js +46 -0
- package/dist/src/web-ui/app/services/runtime-web-client/conversation-files.d.ts +28 -0
- package/dist/src/web-ui/app/services/runtime-web-client/conversation-files.js +75 -0
- package/dist/src/web-ui/app/services/runtime-web-client/projects.d.ts +19 -0
- package/dist/src/web-ui/app/services/runtime-web-client/projects.js +34 -0
- package/dist/src/web-ui/app/services/runtime-web-client/system-host.js +27 -0
- package/dist/src/web-ui/app/services/runtime-web-client.d.ts +52 -0
- package/dist/src/web-ui/app/services/runtime-web-client.js +35 -4
- package/dist/src/web-ui/app/styles/13-projects.css +272 -0
- package/dist/src/web-ui/app/styles/18-dashboard.css +0 -5
- package/dist/src/web-ui/app/styles/19-runtime-setup.css +411 -0
- package/dist/src/web-ui/app/styles/20-chat-composer.css +0 -384
- package/dist/src/web-ui/app/styles/29-conversation-file-preview.css +254 -0
- package/dist/src/web-ui/app/styles/37-runtime-activation.css +26 -0
- package/dist/src/web-ui/app/styles/38-schedule-workspace.css +1 -10
- package/dist/src/web-ui/app/styles/41-plugin-management.css +351 -0
- package/dist/src/web-ui/app/styles/42-runtime-setup-plugins.css +179 -0
- package/dist/src/web-ui/app/styles/43-model-setup.css +73 -0
- package/dist/src/web-ui/app/styles/44-model-provider-cards.css +63 -0
- package/dist/src/web-ui/app/styles/45-bridge-setup.css +44 -0
- package/dist/src/web-ui/app/styles/46-system-host.css +132 -0
- package/dist/src/web-ui/app/styles.css +10 -0
- package/dist/src/web-ui/config-dashboard-backend.d.ts +5 -0
- package/dist/src/web-ui/config-dashboard-backend.js +94 -114
- package/dist/src/web-ui/config-dashboard-model-identity.d.ts +7 -0
- package/dist/src/web-ui/config-dashboard-model-identity.js +45 -0
- package/dist/src/web-ui/config-dashboard-save-transaction.d.ts +5 -0
- package/dist/src/web-ui/config-dashboard-save-transaction.js +21 -0
- package/dist/src/web-ui/environment-config.d.ts +17 -0
- package/dist/src/web-ui/environment-config.js +60 -0
- package/dist/src/web-ui/forwarded-loopback-policy.d.ts +2 -0
- package/dist/src/web-ui/forwarded-loopback-policy.js +14 -0
- package/dist/src/web-ui/local-runtime/api-router.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/api-router.js +136 -12
- package/dist/src/web-ui/local-runtime/config-mutation-request.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/config-mutation-request.js +55 -0
- package/dist/src/web-ui/local-runtime/configuration-activation-environments.d.ts +22 -0
- package/dist/src/web-ui/local-runtime/configuration-activation-environments.js +106 -0
- package/dist/src/web-ui/local-runtime/configuration-activation-source.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/configuration-activation-source.js +36 -0
- package/dist/src/web-ui/local-runtime/configuration-activation.d.ts +20 -0
- package/dist/src/web-ui/local-runtime/configuration-activation.js +107 -0
- package/dist/src/web-ui/local-runtime/contracts.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/conversation-file-access.d.ts +30 -0
- package/dist/src/web-ui/local-runtime/conversation-file-access.js +131 -0
- package/dist/src/web-ui/local-runtime/conversation-file-content.d.ts +21 -0
- package/dist/src/web-ui/local-runtime/conversation-file-content.js +75 -0
- package/dist/src/web-ui/local-runtime/conversation-file-format.d.ts +12 -0
- package/dist/src/web-ui/local-runtime/conversation-file-format.js +87 -0
- package/dist/src/web-ui/local-runtime/conversation-file-native-open.d.ts +10 -0
- package/dist/src/web-ui/local-runtime/conversation-file-native-open.js +94 -0
- package/dist/src/web-ui/local-runtime/conversation-file-native-request.d.ts +4 -0
- package/dist/src/web-ui/local-runtime/conversation-file-native-request.js +72 -0
- package/dist/src/web-ui/local-runtime/conversation-file-routes.d.ts +11 -0
- package/dist/src/web-ui/local-runtime/conversation-file-routes.js +105 -0
- package/dist/src/web-ui/local-runtime/conversation-file-target.d.ts +14 -0
- package/dist/src/web-ui/local-runtime/conversation-file-target.js +158 -0
- package/dist/src/web-ui/local-runtime/environment-registry.d.ts +14 -0
- package/dist/src/web-ui/local-runtime/environment-registry.js +121 -6
- package/dist/src/web-ui/local-runtime/memory-onboarding-routes.d.ts +2 -1
- package/dist/src/web-ui/local-runtime/memory-onboarding-routes.js +15 -10
- package/dist/src/web-ui/local-runtime/model-setup-catalog.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/model-setup-catalog.js +45 -0
- package/dist/src/web-ui/local-runtime/model-setup-identity.d.ts +16 -0
- package/dist/src/web-ui/local-runtime/model-setup-identity.js +20 -0
- package/dist/src/web-ui/local-runtime/model-setup-input.d.ts +24 -0
- package/dist/src/web-ui/local-runtime/model-setup-input.js +107 -0
- package/dist/src/web-ui/local-runtime/model-setup-provider.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/model-setup-provider.js +68 -0
- package/dist/src/web-ui/local-runtime/model-setup-retry.d.ts +14 -0
- package/dist/src/web-ui/local-runtime/model-setup-retry.js +47 -0
- package/dist/src/web-ui/local-runtime/model-setup-routes.d.ts +12 -0
- package/dist/src/web-ui/local-runtime/model-setup-routes.js +50 -0
- package/dist/src/web-ui/local-runtime/model-setup-service.d.ts +30 -0
- package/dist/src/web-ui/local-runtime/model-setup-service.js +93 -0
- package/dist/src/web-ui/local-runtime/model-setup-validation.d.ts +5 -0
- package/dist/src/web-ui/local-runtime/model-setup-validation.js +33 -0
- package/dist/src/web-ui/local-runtime/plugin-management-routes.d.ts +14 -0
- package/dist/src/web-ui/local-runtime/plugin-management-routes.js +50 -0
- package/dist/src/web-ui/local-runtime/project-routes.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/project-routes.js +93 -0
- package/dist/src/web-ui/local-runtime/provider-credential-identity.d.ts +3 -0
- package/dist/src/web-ui/local-runtime/provider-credential-identity.js +18 -0
- package/dist/src/web-ui/local-runtime/request-execution.d.ts +1 -0
- package/dist/src/web-ui/local-runtime/request-execution.js +8 -0
- package/dist/src/web-ui/local-runtime/runtime-availability.js +36 -7
- package/dist/src/web-ui/local-runtime/runtime-setup-completion.d.ts +13 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-completion.js +28 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-connection-edit.d.ts +13 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-connection-edit.js +110 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-credential-completion.d.ts +4 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-credential-completion.js +21 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-credentials.d.ts +14 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-credentials.js +148 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-draft-recovery.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-draft-recovery.js +18 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-draft.d.ts +21 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-draft.js +105 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-embedding-invalidation.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-embedding-invalidation.js +40 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-environment-assignment.d.ts +1 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-environment-assignment.js +27 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-input.d.ts +19 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-input.js +82 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-model-file.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-model-file.js +35 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-provider-ownership-recovery.d.ts +4 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-provider-ownership-recovery.js +23 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-provider-retention.d.ts +11 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-provider-retention.js +31 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-provider.d.ts +11 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-provider.js +60 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-receipt-file.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-receipt-file.js +77 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-routes.d.ts +35 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-routes.js +56 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-scaffold.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-scaffold.js +229 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-service.d.ts +65 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-service.js +195 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-validation.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/runtime-setup-validation.js +35 -0
- package/dist/src/web-ui/local-runtime/saved-model-catalog.d.ts +3 -0
- package/dist/src/web-ui/local-runtime/saved-model-catalog.js +20 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-input.d.ts +8 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-input.js +71 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-provider.d.ts +13 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-provider.js +114 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-routes.d.ts +12 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-routes.js +53 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-service.d.ts +32 -0
- package/dist/src/web-ui/local-runtime/setup-embedding-service.js +59 -0
- package/dist/src/web-ui/local-runtime-backend.d.ts +1 -0
- package/dist/src/web-ui/local-runtime-backend.js +3 -0
- package/dist/src/web-ui/plugin-capability-selection.d.ts +14 -0
- package/dist/src/web-ui/plugin-capability-selection.js +48 -0
- package/dist/src/web-ui/plugin-management-catalog.d.ts +26 -0
- package/dist/src/web-ui/plugin-management-catalog.js +56 -0
- package/dist/src/web-ui/plugin-management-selection.d.ts +16 -0
- package/dist/src/web-ui/plugin-management-selection.js +71 -0
- package/dist/src/web-ui/plugin-management-service.d.ts +29 -0
- package/dist/src/web-ui/plugin-management-service.js +150 -0
- package/dist/src/web-ui/request-authority.d.ts +8 -0
- package/dist/src/web-ui/request-authority.js +129 -0
- package/dist/src/web-ui/runtime-setup-gateway-address.d.ts +3 -0
- package/dist/src/web-ui/runtime-setup-gateway-address.js +26 -0
- package/dist/src/web-ui/runtime-setup-gateway.d.ts +29 -0
- package/dist/src/web-ui/runtime-setup-gateway.js +177 -0
- package/dist/src/web-ui/runtime-setup-shutdown.d.ts +2 -0
- package/dist/src/web-ui/runtime-setup-shutdown.js +20 -0
- package/dist/src/web-ui/server.d.ts +7 -14
- package/dist/src/web-ui/server.js +53 -63
- package/dist/src/web-ui/session-read-state/service.d.ts +12 -2
- package/dist/src/web-ui/system-host-service.d.ts +19 -0
- package/dist/src/web-ui/system-host-service.js +159 -0
- package/dist/src/web-ui/system-host-setup/companion-bundle.d.ts +2 -0
- package/dist/src/web-ui/system-host-setup/companion-bundle.js +12 -0
- package/dist/src/web-ui/system-host-setup/companion-macos.d.ts +2 -0
- package/dist/src/web-ui/system-host-setup/companion-macos.js +74 -0
- package/dist/src/web-ui/system-host-setup/companion-windows.d.ts +2 -0
- package/dist/src/web-ui/system-host-setup/companion-windows.js +105 -0
- package/dist/src/web-ui/system-host-setup/installer-contract.d.ts +18 -0
- package/dist/src/web-ui/system-host-setup/installer-contract.js +51 -0
- package/dist/src/web-ui/system-host-setup/installers.d.ts +6 -0
- package/dist/src/web-ui/system-host-setup/installers.js +30 -0
- package/dist/src/web-ui/system-host-setup/native-authorization.d.ts +3 -0
- package/dist/src/web-ui/system-host-setup/native-authorization.js +11 -0
- package/dist/src/web-ui/system-host-setup/node-distribution.d.ts +19 -0
- package/dist/src/web-ui/system-host-setup/node-distribution.js +9 -0
- package/dist/src/web-ui/system-host-setup/readiness.d.ts +18 -0
- package/dist/src/web-ui/system-host-setup/readiness.js +70 -0
- package/dist/src/web-ui/system-host-setup/routes.d.ts +20 -0
- package/dist/src/web-ui/system-host-setup/routes.js +121 -0
- package/dist/src/web-ui/system-host-setup/windows-script-wrapper.d.ts +2 -0
- package/dist/src/web-ui/system-host-setup/windows-script-wrapper.js +17 -0
- package/dist/src/web-ui/system-host-setup/wsl-interop-config.d.ts +3 -0
- package/dist/src/web-ui/system-host-setup/wsl-interop-config.js +67 -0
- package/dist/src/web-ui/system-host-setup/wsl-interop-windows.d.ts +1 -0
- package/dist/src/web-ui/system-host-setup/wsl-interop-windows.js +49 -0
- package/dist/src/web-ui/system-host-upgrade-authority.d.ts +5 -0
- package/dist/src/web-ui/system-host-upgrade-authority.js +13 -0
- package/docs/architecture.md +6 -1
- package/docs/installation.md +53 -17
- package/docs/known-limitations.md +14 -0
- package/docs/plugins.md +124 -19
- package/docs/projects-and-full-plus.md +218 -0
- package/docs/runtime-invariant-coverage.md +6 -3
- package/docs/runtime-prompt-policy-contracts.md +37 -5
- package/docs/runtime-public-contracts.md +17 -0
- package/package.json +5 -2
- package/plugins/exec/plugin.json +30 -9
- package/plugins/exec/skills/exec_process_skill/SKILL.md +1 -0
- package/plugins/exec/skills/exec_skill/SKILL.md +9 -10
- package/plugins/exec/source/handlers.ts +4 -38
- package/plugins/exec/source/paths.ts +53 -49
- package/plugins/exec/source/types.ts +6 -4
- package/plugins/exec/source/validation.ts +33 -198
- package/plugins/exec/src/index.cjs +62 -204
- package/plugins/filesystem/plugin.json +1 -1
- package/plugins/filesystem/skills/dev_view_skill/SKILL.md +7 -0
- package/plugins/filesystem/source/atomic-write.ts +6 -3
- package/plugins/filesystem/source/dev-view.ts +2 -1
- package/plugins/filesystem/source/directory-authority-write.ts +4 -0
- package/plugins/filesystem/source/edit-file.ts +3 -0
- package/plugins/filesystem/source/file-output-presentation.ts +42 -0
- package/plugins/filesystem/source/mutation-parent.ts +18 -9
- package/plugins/filesystem/source/view-locator.ts +141 -0
- package/plugins/filesystem/source/view-window.ts +12 -25
- package/plugins/filesystem/source/write-file.ts +8 -0
- package/plugins/filesystem/src/index.cjs +162 -35
- package/plugins/system/plugin.json +374 -0
- package/plugins/system/skills/system_actions/SKILL.md +31 -0
- package/plugins/system/source/application-catalog.ts +237 -0
- package/plugins/system/source/application-launch.ts +113 -0
- package/plugins/system/source/application-observation.ts +78 -0
- package/plugins/system/source/commands.ts +106 -0
- package/plugins/system/source/companion/autostart.ts +185 -0
- package/plugins/system/source/companion/broker-client.ts +183 -0
- package/plugins/system/source/companion/broker-location.ts +89 -0
- package/plugins/system/source/companion/broker-server.ts +169 -0
- package/plugins/system/source/companion/connection.ts +211 -0
- package/plugins/system/source/companion/liveness.ts +23 -0
- package/plugins/system/source/companion/native-address.ts +55 -0
- package/plugins/system/source/companion/native-identity.ts +26 -0
- package/plugins/system/source/companion/native-messages.ts +100 -0
- package/plugins/system/source/companion/native-session.ts +268 -0
- package/plugins/system/source/companion/native-state.ts +135 -0
- package/plugins/system/source/companion/native-supervisor.ts +98 -0
- package/plugins/system/source/companion/pairing-store.ts +110 -0
- package/plugins/system/source/companion/private-store.ts +58 -0
- package/plugins/system/source/companion/process-owner-identity.ts +190 -0
- package/plugins/system/source/companion/protocol.ts +108 -0
- package/plugins/system/source/contracts.ts +44 -0
- package/plugins/system/source/elevation.ts +88 -0
- package/plugins/system/source/handlers.ts +120 -0
- package/plugins/system/source/host-dispatch.ts +106 -0
- package/plugins/system/source/host-evidence.ts +72 -0
- package/plugins/system/source/host-observation.ts +66 -0
- package/plugins/system/source/index.ts +8 -0
- package/plugins/system/source/process-result.ts +111 -0
- package/plugins/system/source/process-runner.ts +104 -0
- package/plugins/system/source/request-system-modules.ts +117 -0
- package/plugins/system/source/request-target-snapshot.ts +163 -0
- package/plugins/system/source/target-observation.ts +43 -0
- package/plugins/system/source/targets.ts +147 -0
- package/plugins/system/src/index.cjs +1730 -0
- package/src/runtime/README.md +36 -8
- package/src/runtime/local-host/README.md +7 -0
- package/dist/src/runtime/steps/planner-decision/capability-catalog-context.d.ts +0 -14
- package/dist/src/runtime/steps/planner-decision/capability-catalog-context.js +0 -87
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { applySavedEmbeddingProviderReceipt } from "./embedding-provider-receipt.js";
|
|
2
|
+
import { textOf } from "../../lib/text-format.js";
|
|
3
|
+
import { renderEmbeddingSetup } from "./embedding-rendering.js";
|
|
4
|
+
import {
|
|
5
|
+
DEFAULT_OLLAMA_BASE_URL,
|
|
6
|
+
validateRuntimeSetupBaseUrl,
|
|
7
|
+
validateRuntimeSetupModelId,
|
|
8
|
+
} from "./validation.js";
|
|
9
|
+
|
|
10
|
+
export function createEmbeddingSetupStep({
|
|
11
|
+
container,
|
|
12
|
+
getEnvironmentId,
|
|
13
|
+
getPreferredProvider = () => "",
|
|
14
|
+
loadStatus,
|
|
15
|
+
discoverModels,
|
|
16
|
+
saveEmbedding,
|
|
17
|
+
onChange,
|
|
18
|
+
onComplete,
|
|
19
|
+
}) {
|
|
20
|
+
const state = {
|
|
21
|
+
status: null,
|
|
22
|
+
providers: [],
|
|
23
|
+
provider: "",
|
|
24
|
+
model: "",
|
|
25
|
+
baseUrl: DEFAULT_OLLAMA_BASE_URL,
|
|
26
|
+
models: [],
|
|
27
|
+
busy: false,
|
|
28
|
+
loaded: false,
|
|
29
|
+
error: "",
|
|
30
|
+
message: "",
|
|
31
|
+
};
|
|
32
|
+
let loadedConnectionProvider = "";
|
|
33
|
+
let preferConnectionProvider = false;
|
|
34
|
+
let generation = 0;
|
|
35
|
+
const isCurrentEmbeddingOperation = (revision, environment) =>
|
|
36
|
+
revision === generation && environment === getEnvironmentId();
|
|
37
|
+
const selectedProvider = () =>
|
|
38
|
+
state.providers.find((entry) => entry.id === state.provider);
|
|
39
|
+
const selectedProviderType = () =>
|
|
40
|
+
selectedProvider()?.type || state.provider.replace("new:", "");
|
|
41
|
+
const hasUnchangedEmbeddingSelection = () =>
|
|
42
|
+
state.status?.enabled === true &&
|
|
43
|
+
state.provider === state.status.providerId &&
|
|
44
|
+
state.model.trim() === state.status.model;
|
|
45
|
+
|
|
46
|
+
function clearSecret() {
|
|
47
|
+
const input = container.querySelector(
|
|
48
|
+
'[data-runtime-setup-field="embedding-key"]',
|
|
49
|
+
);
|
|
50
|
+
if (input) input.value = "";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function reset() {
|
|
54
|
+
generation += 1;
|
|
55
|
+
loadedConnectionProvider = "";
|
|
56
|
+
preferConnectionProvider = false;
|
|
57
|
+
clearSecret();
|
|
58
|
+
Object.assign(state, {
|
|
59
|
+
status: null,
|
|
60
|
+
providers: [],
|
|
61
|
+
provider: "",
|
|
62
|
+
model: "",
|
|
63
|
+
baseUrl: DEFAULT_OLLAMA_BASE_URL,
|
|
64
|
+
models: [],
|
|
65
|
+
busy: false,
|
|
66
|
+
loaded: false,
|
|
67
|
+
error: "",
|
|
68
|
+
message: "",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function invalidateConnection() {
|
|
73
|
+
const { provider, model, baseUrl } = state;
|
|
74
|
+
const connectionProviderChanged =
|
|
75
|
+
loadedConnectionProvider !== getPreferredProvider();
|
|
76
|
+
reset();
|
|
77
|
+
preferConnectionProvider = connectionProviderChanged;
|
|
78
|
+
state.baseUrl = baseUrl;
|
|
79
|
+
if (connectionProviderChanged) return;
|
|
80
|
+
Object.assign(state, { provider, model });
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function retainedEmbeddingProvider() {
|
|
84
|
+
const configured = selectedProvider();
|
|
85
|
+
if (configured) return configured.id;
|
|
86
|
+
const isNewProviderChoice = ["new:openai", "new:ollama"].includes(
|
|
87
|
+
state.provider,
|
|
88
|
+
);
|
|
89
|
+
if (!isNewProviderChoice) return "";
|
|
90
|
+
const hasConfiguredType = state.providers.some(
|
|
91
|
+
(provider) => provider.type === state.provider.slice(4),
|
|
92
|
+
);
|
|
93
|
+
if (hasConfiguredType) return "";
|
|
94
|
+
return state.provider;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function initialEmbeddingProvider(connectionProvider) {
|
|
98
|
+
const retained = retainedEmbeddingProvider();
|
|
99
|
+
if (retained) return retained;
|
|
100
|
+
const saved = state.providers.find(
|
|
101
|
+
(provider) => provider.id === state.status.providerId,
|
|
102
|
+
);
|
|
103
|
+
const preserveSavedProvider = saved && !preferConnectionProvider;
|
|
104
|
+
if (preserveSavedProvider) return saved.id;
|
|
105
|
+
const matching = state.providers.filter(
|
|
106
|
+
(provider) => provider.type === connectionProvider,
|
|
107
|
+
);
|
|
108
|
+
const preferred =
|
|
109
|
+
matching.find((provider) => provider.id === connectionProvider) ||
|
|
110
|
+
matching[0];
|
|
111
|
+
if (preferred) return preferred.id;
|
|
112
|
+
return saved?.id || state.providers[0]?.id || "new:openai";
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
async function run(request, apply, failure, onFailure = () => {}) {
|
|
116
|
+
const revision = ++generation;
|
|
117
|
+
const environment = getEnvironmentId();
|
|
118
|
+
state.busy = true;
|
|
119
|
+
state.error = "";
|
|
120
|
+
clearSecret();
|
|
121
|
+
onChange();
|
|
122
|
+
try {
|
|
123
|
+
const payload = await request();
|
|
124
|
+
if (!isCurrentEmbeddingOperation(revision, environment)) return false;
|
|
125
|
+
apply(payload);
|
|
126
|
+
return true;
|
|
127
|
+
} catch (error) {
|
|
128
|
+
if (!isCurrentEmbeddingOperation(revision, environment)) return false;
|
|
129
|
+
onFailure(error?.payload);
|
|
130
|
+
const message = textOf(error?.payload?.message, failure);
|
|
131
|
+
state.error =
|
|
132
|
+
error?.payload?.providerSaved === true
|
|
133
|
+
? `${message} The provider connection was saved; memory is unchanged.`
|
|
134
|
+
: message;
|
|
135
|
+
return false;
|
|
136
|
+
} finally {
|
|
137
|
+
if (isCurrentEmbeddingOperation(revision, environment)) {
|
|
138
|
+
state.busy = false;
|
|
139
|
+
clearSecret();
|
|
140
|
+
onChange();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function load() {
|
|
146
|
+
if (state.loaded || state.busy) return;
|
|
147
|
+
const connectionProvider = getPreferredProvider();
|
|
148
|
+
await run(
|
|
149
|
+
loadStatus,
|
|
150
|
+
(payload) => {
|
|
151
|
+
state.status = payload.status || {};
|
|
152
|
+
state.providers = state.status.providers || [];
|
|
153
|
+
const hasRetainedProvider = Boolean(retainedEmbeddingProvider());
|
|
154
|
+
state.provider = initialEmbeddingProvider(connectionProvider);
|
|
155
|
+
const restoreSavedModel =
|
|
156
|
+
!hasRetainedProvider && state.provider === state.status.providerId;
|
|
157
|
+
if (restoreSavedModel) state.model = state.status.model || "";
|
|
158
|
+
loadedConnectionProvider = connectionProvider;
|
|
159
|
+
preferConnectionProvider = false;
|
|
160
|
+
state.loaded = true;
|
|
161
|
+
},
|
|
162
|
+
"Could not load embedding options. Try again or set this up later.",
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async function discover() {
|
|
167
|
+
if (state.busy || !selectedProvider()) return;
|
|
168
|
+
await run(
|
|
169
|
+
() => discoverModels(state.provider),
|
|
170
|
+
(payload) => {
|
|
171
|
+
state.models = Array.isArray(payload.catalog?.models)
|
|
172
|
+
? payload.catalog.models
|
|
173
|
+
: [];
|
|
174
|
+
state.message =
|
|
175
|
+
payload.catalog?.supported === true
|
|
176
|
+
? `${state.models.length} installed models found. Choose an embedding model.`
|
|
177
|
+
: "This provider does not list models. Enter an embedding model ID.";
|
|
178
|
+
},
|
|
179
|
+
"Could not discover models. You can enter an embedding model ID manually.",
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function apiKeyValue() {
|
|
184
|
+
if (selectedProviderType() !== "openai") return "";
|
|
185
|
+
return textOf(
|
|
186
|
+
container.querySelector('[data-runtime-setup-field="embedding-key"]')
|
|
187
|
+
?.value,
|
|
188
|
+
).trim();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function primaryLabel() {
|
|
192
|
+
return hasUnchangedEmbeddingSelection() && !apiKeyValue()
|
|
193
|
+
? "Continue"
|
|
194
|
+
: "Test and save";
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
async function submit() {
|
|
198
|
+
if (state.busy || !state.loaded) return;
|
|
199
|
+
const apiKey = apiKeyValue();
|
|
200
|
+
if (hasUnchangedEmbeddingSelection() && !apiKey) return onComplete();
|
|
201
|
+
const model = validateRuntimeSetupModelId(state.model);
|
|
202
|
+
if (!model.valid) {
|
|
203
|
+
state.error = "Enter an embedding model ID, or skip this step for now.";
|
|
204
|
+
onChange();
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const input = selectedProvider()
|
|
208
|
+
? { providerId: state.provider, model: model.value }
|
|
209
|
+
: { provider: selectedProviderType(), model: model.value };
|
|
210
|
+
if (!selectedProvider() && selectedProviderType() === "ollama") {
|
|
211
|
+
const address = validateRuntimeSetupBaseUrl(state.baseUrl);
|
|
212
|
+
if (!address.valid) {
|
|
213
|
+
state.error = address.message;
|
|
214
|
+
onChange();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
input.baseUrl = address.value;
|
|
218
|
+
}
|
|
219
|
+
if (selectedProviderType() === "openai" && apiKey) input.apiKey = apiKey;
|
|
220
|
+
const providerSelection = {
|
|
221
|
+
type: selectedProviderType(),
|
|
222
|
+
providerId: input.providerId,
|
|
223
|
+
};
|
|
224
|
+
let saved = false;
|
|
225
|
+
try {
|
|
226
|
+
saved = await run(
|
|
227
|
+
() => saveEmbedding(input),
|
|
228
|
+
(payload) => {
|
|
229
|
+
if (payload.status?.enabled !== true)
|
|
230
|
+
throw new Error("Embedding configuration unavailable");
|
|
231
|
+
state.status = payload.status || {};
|
|
232
|
+
state.providers = state.status.providers || state.providers;
|
|
233
|
+
state.provider = state.status.providerId || state.provider;
|
|
234
|
+
state.model = state.status.model || state.model;
|
|
235
|
+
state.message = "Embedding check passed. Memory is configured.";
|
|
236
|
+
},
|
|
237
|
+
"Embedding check failed. Check the provider, model and connection details, then try again.",
|
|
238
|
+
(payload) =>
|
|
239
|
+
applySavedEmbeddingProviderReceipt(state, payload, providerSelection),
|
|
240
|
+
);
|
|
241
|
+
} finally {
|
|
242
|
+
delete input.apiKey;
|
|
243
|
+
}
|
|
244
|
+
if (saved) onComplete();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function input(field, value) {
|
|
248
|
+
if (state.busy) return;
|
|
249
|
+
if (field === "embedding-model") state.model = value;
|
|
250
|
+
if (field === "embedding-url") state.baseUrl = value;
|
|
251
|
+
const action = container.querySelector(
|
|
252
|
+
'.runtime-setup-action[type="submit"]',
|
|
253
|
+
);
|
|
254
|
+
if (action) action.textContent = primaryLabel();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function change(field, value) {
|
|
258
|
+
if (state.busy || field !== "embedding-provider") return;
|
|
259
|
+
clearSecret();
|
|
260
|
+
state.provider = value;
|
|
261
|
+
state.models = [];
|
|
262
|
+
state.message = "";
|
|
263
|
+
state.error = "";
|
|
264
|
+
onChange();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return {
|
|
268
|
+
state,
|
|
269
|
+
clearSecret,
|
|
270
|
+
reset,
|
|
271
|
+
invalidateConnection,
|
|
272
|
+
load,
|
|
273
|
+
submit,
|
|
274
|
+
input,
|
|
275
|
+
change,
|
|
276
|
+
markup: () =>
|
|
277
|
+
renderEmbeddingSetup(state, selectedProviderType(), selectedProvider()),
|
|
278
|
+
primaryLabel,
|
|
279
|
+
click: (action) => {
|
|
280
|
+
if (action === "embedding-discover") void discover();
|
|
281
|
+
if (action === "embedding-reload") void load();
|
|
282
|
+
},
|
|
283
|
+
};
|
|
284
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { createEmbeddingSetupStep } from "./embedding.js";
|
|
2
|
+
import { createSetupPluginStep } from "./plugins.js";
|
|
3
|
+
import { createSystemHostConnectionManager } from "../system-host/manager.js";
|
|
4
|
+
import { hostSetupIsReady } from "../system-host/rendering.js";
|
|
5
|
+
|
|
6
|
+
/** Optional setup steps retain their owning services and never apply the Runtime. */
|
|
7
|
+
export function createSetupOptionalSteps({
|
|
8
|
+
container,
|
|
9
|
+
getEnvironmentId,
|
|
10
|
+
getPreferredProvider,
|
|
11
|
+
loadEmbeddingStatus,
|
|
12
|
+
discoverEmbeddingModels,
|
|
13
|
+
saveEmbedding,
|
|
14
|
+
loadPlugins,
|
|
15
|
+
setPlugin,
|
|
16
|
+
loadHostConnection,
|
|
17
|
+
downloadHostSetup,
|
|
18
|
+
revokeHostConnection,
|
|
19
|
+
onChange,
|
|
20
|
+
goToStep,
|
|
21
|
+
}) {
|
|
22
|
+
const embedding = createEmbeddingSetupStep({
|
|
23
|
+
container,
|
|
24
|
+
getEnvironmentId,
|
|
25
|
+
getPreferredProvider,
|
|
26
|
+
loadStatus: loadEmbeddingStatus,
|
|
27
|
+
discoverModels: discoverEmbeddingModels,
|
|
28
|
+
saveEmbedding,
|
|
29
|
+
onChange,
|
|
30
|
+
onComplete: () => goToStep(3),
|
|
31
|
+
});
|
|
32
|
+
const plugins = createSetupPluginStep({
|
|
33
|
+
container,
|
|
34
|
+
getEnvironmentId,
|
|
35
|
+
loadPlugins,
|
|
36
|
+
setPlugin,
|
|
37
|
+
onChange,
|
|
38
|
+
});
|
|
39
|
+
const computer = loadHostConnection
|
|
40
|
+
? createSystemHostConnectionManager({
|
|
41
|
+
loadConnection: loadHostConnection,
|
|
42
|
+
downloadSetup: downloadHostSetup,
|
|
43
|
+
revokeConnection: revokeHostConnection,
|
|
44
|
+
onChange,
|
|
45
|
+
})
|
|
46
|
+
: null;
|
|
47
|
+
const readyStep = computer ? 5 : 4;
|
|
48
|
+
function hasFreshComputerReadiness() {
|
|
49
|
+
if (!computer) return false;
|
|
50
|
+
if (computer.state.busy || computer.state.statusUnavailable) return false;
|
|
51
|
+
return hostSetupIsReady(computer.state.snapshot);
|
|
52
|
+
}
|
|
53
|
+
function projection(step) {
|
|
54
|
+
const common = {
|
|
55
|
+
busy: embedding.state.busy || plugins.state.busy,
|
|
56
|
+
content: "",
|
|
57
|
+
canContinue: true,
|
|
58
|
+
memory: embedding.state.status,
|
|
59
|
+
plugins: plugins.state.snapshot,
|
|
60
|
+
hasComputerStep: Boolean(computer),
|
|
61
|
+
readyStep,
|
|
62
|
+
computer: hasFreshComputerReadiness() ? computer.state.snapshot : null,
|
|
63
|
+
};
|
|
64
|
+
if (step === 2)
|
|
65
|
+
return {
|
|
66
|
+
...common,
|
|
67
|
+
content: embedding.markup(),
|
|
68
|
+
canContinue: embedding.state.loaded,
|
|
69
|
+
primaryLabel: embedding.primaryLabel(),
|
|
70
|
+
};
|
|
71
|
+
if (step === 3)
|
|
72
|
+
return {
|
|
73
|
+
...common,
|
|
74
|
+
content: plugins.markup(),
|
|
75
|
+
canContinue: plugins.state.loaded && !plugins.state.error,
|
|
76
|
+
};
|
|
77
|
+
if (step === 4 && computer)
|
|
78
|
+
return {
|
|
79
|
+
...common,
|
|
80
|
+
content: `<div data-onboarding-computer>${computer.markup()}</div>`,
|
|
81
|
+
canContinue: hasFreshComputerReadiness(),
|
|
82
|
+
};
|
|
83
|
+
return common;
|
|
84
|
+
}
|
|
85
|
+
function load(step) {
|
|
86
|
+
computer?.setActive(step === 4);
|
|
87
|
+
if (step === 2) void embedding.load();
|
|
88
|
+
if (step === 3) void plugins.load();
|
|
89
|
+
}
|
|
90
|
+
function afterPaint(step, options) {
|
|
91
|
+
if (step === 3) plugins.afterPaint(options);
|
|
92
|
+
if (step === 4)
|
|
93
|
+
computer?.mount(container.querySelector("[data-onboarding-computer]"));
|
|
94
|
+
}
|
|
95
|
+
function reset() {
|
|
96
|
+
embedding.reset();
|
|
97
|
+
plugins.reset();
|
|
98
|
+
computer?.reset();
|
|
99
|
+
}
|
|
100
|
+
function canContinueComputer(step) {
|
|
101
|
+
if (step !== 4) return false;
|
|
102
|
+
return hasFreshComputerReadiness();
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
embedding,
|
|
106
|
+
plugins,
|
|
107
|
+
readyStep,
|
|
108
|
+
projection,
|
|
109
|
+
load,
|
|
110
|
+
afterPaint,
|
|
111
|
+
reset,
|
|
112
|
+
canContinueComputer,
|
|
113
|
+
hasComputerStep: Boolean(computer),
|
|
114
|
+
hide: () => computer?.setActive(false),
|
|
115
|
+
dispose: () => computer?.dispose(),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { escapeAttribute, escapeHtml } from "../../lib/text-format.js";
|
|
2
|
+
|
|
3
|
+
function blockReason(plugin, capability) {
|
|
4
|
+
if (capability?.blockedReason) return capability.blockedReason;
|
|
5
|
+
if (plugin.blockedByGlobalPolicy)
|
|
6
|
+
return "Blocked by the global plugin policy.";
|
|
7
|
+
if (capability && plugin.pluginEnabled === false)
|
|
8
|
+
return "Enable this plugin to choose individual tools.";
|
|
9
|
+
return capability?.blockedByPolicy
|
|
10
|
+
? "Blocked by an existing plugin policy rule."
|
|
11
|
+
: "";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function checkbox(plugin, capability, busy) {
|
|
15
|
+
const reason = blockReason(plugin, capability);
|
|
16
|
+
const enabled = capability
|
|
17
|
+
? capability.enabled === true
|
|
18
|
+
: plugin.pluginEnabled === true;
|
|
19
|
+
const id = capability?.id || plugin.id;
|
|
20
|
+
const description = capability?.description || "";
|
|
21
|
+
const version =
|
|
22
|
+
!capability && plugin.version
|
|
23
|
+
? `<small class="runtime-plugin-version">v${escapeHtml(plugin.version)}</small>`
|
|
24
|
+
: "";
|
|
25
|
+
return `<label class="runtime-plugin-choice${capability ? "" : " runtime-plugin-master"}">
|
|
26
|
+
<input type="checkbox" data-runtime-plugin-toggle="${escapeAttribute(plugin.id)}" ${capability ? `data-runtime-capability="${escapeAttribute(capability.id)}"` : ""} ${enabled && !reason ? "checked" : ""} ${busy || reason ? "disabled" : ""} />
|
|
27
|
+
<span><strong>${escapeHtml(id)}</strong>${version}${description ? `<small class="runtime-plugin-description" title="${escapeAttribute(description)}">${escapeHtml(description)}</small>` : ""}${reason ? `<small class="runtime-plugin-block">${escapeHtml(reason)}</small>` : ""}</span>
|
|
28
|
+
</label>`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function renderPluginCard(plugin, busy) {
|
|
32
|
+
const capabilities = plugin.capabilities || [];
|
|
33
|
+
return `<li class="runtime-plugin-card">
|
|
34
|
+
${checkbox(plugin, null, busy)}
|
|
35
|
+
<p class="runtime-plugin-summary" title="${escapeAttribute(plugin.description || "")}">${escapeHtml(plugin.description || "Installed Runtime plugin.")}</p>
|
|
36
|
+
<div class="runtime-plugin-tools-heading"><span>Tools</span><span>${plugin.selectedCapabilityCount} of ${capabilities.length} selected</span></div>
|
|
37
|
+
<ul class="runtime-plugin-capabilities" aria-label="${escapeAttribute(`Tools in ${plugin.id}`)}">${capabilities.map((capability) => `<li>${checkbox(plugin, capability, busy)}</li>`).join("")}</ul>
|
|
38
|
+
</li>`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function createSetupPluginStep({
|
|
42
|
+
container,
|
|
43
|
+
getEnvironmentId,
|
|
44
|
+
loadPlugins,
|
|
45
|
+
setPlugin,
|
|
46
|
+
onChange,
|
|
47
|
+
}) {
|
|
48
|
+
const state = {
|
|
49
|
+
snapshot: null,
|
|
50
|
+
loaded: false,
|
|
51
|
+
busy: false,
|
|
52
|
+
error: "",
|
|
53
|
+
message: "",
|
|
54
|
+
};
|
|
55
|
+
let generation = 0;
|
|
56
|
+
let focusTarget = null;
|
|
57
|
+
const isCurrentPluginOperation = (revision, environment) =>
|
|
58
|
+
revision === generation && environment === getEnvironmentId();
|
|
59
|
+
|
|
60
|
+
function reset() {
|
|
61
|
+
generation += 1;
|
|
62
|
+
focusTarget = null;
|
|
63
|
+
Object.assign(state, {
|
|
64
|
+
snapshot: null,
|
|
65
|
+
loaded: false,
|
|
66
|
+
busy: false,
|
|
67
|
+
error: "",
|
|
68
|
+
message: "",
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function load(force = false) {
|
|
73
|
+
if ((!force && state.loaded) || state.busy) return;
|
|
74
|
+
const revision = ++generation;
|
|
75
|
+
const environment = getEnvironmentId();
|
|
76
|
+
state.busy = true;
|
|
77
|
+
state.error = "";
|
|
78
|
+
onChange();
|
|
79
|
+
try {
|
|
80
|
+
const snapshot = await loadPlugins();
|
|
81
|
+
if (!isCurrentPluginOperation(revision, environment)) return;
|
|
82
|
+
state.snapshot = snapshot;
|
|
83
|
+
state.loaded = true;
|
|
84
|
+
} catch {
|
|
85
|
+
if (isCurrentPluginOperation(revision, environment))
|
|
86
|
+
state.error = "Could not load plugins. Try again before continuing.";
|
|
87
|
+
} finally {
|
|
88
|
+
if (isCurrentPluginOperation(revision, environment)) {
|
|
89
|
+
state.busy = false;
|
|
90
|
+
onChange();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function toggle(target) {
|
|
96
|
+
if (state.busy) return;
|
|
97
|
+
const pluginId = target.dataset.runtimePluginToggle;
|
|
98
|
+
const capabilityId = target.dataset.runtimeCapability;
|
|
99
|
+
const plugin = state.snapshot?.plugins?.find(
|
|
100
|
+
(entry) => entry.id === pluginId,
|
|
101
|
+
);
|
|
102
|
+
const capability = capabilityId
|
|
103
|
+
? plugin?.capabilities?.find((entry) => entry.id === capabilityId)
|
|
104
|
+
: null;
|
|
105
|
+
if (
|
|
106
|
+
!plugin ||
|
|
107
|
+
(capabilityId && !capability) ||
|
|
108
|
+
blockReason(plugin, capability)
|
|
109
|
+
)
|
|
110
|
+
return;
|
|
111
|
+
const enabled = target.checked === true;
|
|
112
|
+
const revision = ++generation;
|
|
113
|
+
const environment = getEnvironmentId();
|
|
114
|
+
focusTarget = { pluginId, capabilityId };
|
|
115
|
+
state.busy = true;
|
|
116
|
+
state.error = "";
|
|
117
|
+
state.message = "";
|
|
118
|
+
onChange();
|
|
119
|
+
try {
|
|
120
|
+
const snapshot = await setPlugin({
|
|
121
|
+
pluginId,
|
|
122
|
+
enabled,
|
|
123
|
+
...(capabilityId ? { capabilityId } : {}),
|
|
124
|
+
});
|
|
125
|
+
if (!isCurrentPluginOperation(revision, environment)) return;
|
|
126
|
+
state.snapshot = snapshot;
|
|
127
|
+
state.message =
|
|
128
|
+
"Selection saved. It will take effect when you finish setup.";
|
|
129
|
+
} catch {
|
|
130
|
+
if (isCurrentPluginOperation(revision, environment))
|
|
131
|
+
state.error =
|
|
132
|
+
"Could not save this selection. Your previous selection is still shown. Try again.";
|
|
133
|
+
} finally {
|
|
134
|
+
if (isCurrentPluginOperation(revision, environment)) {
|
|
135
|
+
state.busy = false;
|
|
136
|
+
onChange();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function markup() {
|
|
142
|
+
const plugins = state.snapshot?.plugins || [];
|
|
143
|
+
const globalBlocked =
|
|
144
|
+
state.snapshot?.selection?.enabled === false ||
|
|
145
|
+
state.snapshot?.selection?.deny?.includes("*");
|
|
146
|
+
return `<div class="runtime-setup-plugins">
|
|
147
|
+
<p class="runtime-setup-feedback">All installed plugins start enabled in a new setup. Turn off anything you do not need.</p>
|
|
148
|
+
${globalBlocked ? '<p class="runtime-setup-feedback">An existing global policy blocks plugins. Your saved policy is preserved.</p>' : ""}
|
|
149
|
+
${state.error ? `<p class="runtime-setup-feedback error" role="alert">${escapeHtml(state.error)}</p><button type="button" class="runtime-setup-inline-action" data-runtime-setup-action="plugins-reload">Reload selection</button>` : state.message ? `<p class="runtime-setup-feedback" role="status">${escapeHtml(state.message)}</p>` : ""}
|
|
150
|
+
${state.busy ? '<p class="runtime-setup-feedback" role="status">Saving or loading plugin selection…</p>' : ""}
|
|
151
|
+
<ul class="runtime-plugin-list">${plugins.map((plugin) => renderPluginCard(plugin, state.busy)).join("")}</ul>
|
|
152
|
+
${state.loaded && !plugins.length ? '<p class="runtime-setup-feedback">No installed plugins found. You can add plugins later.</p>' : ""}
|
|
153
|
+
</div>`;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function afterPaint({ restoreFocus = true } = {}) {
|
|
157
|
+
for (const input of container.querySelectorAll?.(
|
|
158
|
+
"[data-runtime-plugin-toggle]",
|
|
159
|
+
) || []) {
|
|
160
|
+
input.addEventListener("change", () => void toggle(input));
|
|
161
|
+
if (
|
|
162
|
+
restoreFocus &&
|
|
163
|
+
!state.busy &&
|
|
164
|
+
focusTarget?.pluginId === input.dataset.runtimePluginToggle &&
|
|
165
|
+
focusTarget?.capabilityId === input.dataset.runtimeCapability
|
|
166
|
+
)
|
|
167
|
+
input.focus?.({ preventScroll: true });
|
|
168
|
+
}
|
|
169
|
+
if (!state.busy) focusTarget = null;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return { state, reset, load, markup, afterPaint, toggle };
|
|
173
|
+
}
|