@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
|
@@ -1,519 +1,473 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { textOf } from "../lib/text-format.js";
|
|
2
|
+
import { renderRuntimeSetup } from "./runtime-setup/rendering.js";
|
|
3
|
+
import { createSetupOptionalSteps } from "./runtime-setup/optional-steps.js";
|
|
4
|
+
import { createSetupViewState } from "./runtime-setup/view-state.js";
|
|
5
|
+
import {
|
|
6
|
+
preserveConfigurationRecovery,
|
|
7
|
+
requiresConfigurationRecovery,
|
|
8
|
+
renderConfigurationRecovery,
|
|
9
|
+
} from "./runtime-setup/configuration-recovery.js";
|
|
10
|
+
import {
|
|
11
|
+
canEditSetupConnection,
|
|
12
|
+
canContinueSavedConnection,
|
|
13
|
+
hasSetupConnectionChanges,
|
|
14
|
+
receiveSetupConnection,
|
|
15
|
+
selectSetupProvider,
|
|
16
|
+
setupConnectionSaveError,
|
|
17
|
+
setupConnectionSubmitLabel,
|
|
18
|
+
updateSetupConnectionField,
|
|
19
|
+
} from "./runtime-setup/connection-state.js";
|
|
20
|
+
import {
|
|
21
|
+
clearConnectionSecret,
|
|
22
|
+
readConnectionSecret,
|
|
23
|
+
validateConnectionFields,
|
|
24
|
+
showConnectionFieldError,
|
|
25
|
+
} from "./runtime-setup/connection-form.js";
|
|
26
|
+
import {
|
|
27
|
+
DEFAULT_OLLAMA_BASE_URL,
|
|
28
|
+
normalizeProvider,
|
|
29
|
+
} from "./runtime-setup/validation.js";
|
|
2
30
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const DEFAULT_OLLAMA_BASE_URL = "http://127.0.0.1:11434";
|
|
31
|
+
export { buildRuntimeSetupCommands } from "./runtime-setup/commands.js";
|
|
32
|
+
export {
|
|
33
|
+
validateRuntimeSetupBaseUrl,
|
|
34
|
+
validateRuntimeSetupModelId,
|
|
35
|
+
} from "./runtime-setup/validation.js";
|
|
9
36
|
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
37
|
+
export function createRuntimeSetupGuide({
|
|
38
|
+
container,
|
|
39
|
+
conversationRegion,
|
|
40
|
+
loadSetup,
|
|
41
|
+
saveSetup,
|
|
42
|
+
applySetup,
|
|
43
|
+
loadEmbeddingStatus,
|
|
44
|
+
discoverEmbeddingModels,
|
|
45
|
+
saveEmbedding,
|
|
46
|
+
loadPlugins,
|
|
47
|
+
setPlugin,
|
|
48
|
+
loadHostConnection,
|
|
49
|
+
downloadHostSetup,
|
|
50
|
+
revokeHostConnection,
|
|
51
|
+
getEnvironmentId = () => "",
|
|
52
|
+
openConfiguration = () => {},
|
|
53
|
+
}) {
|
|
54
|
+
const state = {
|
|
55
|
+
providers: [],
|
|
56
|
+
provider: "",
|
|
57
|
+
modelId: "",
|
|
58
|
+
contextWindowTokens: "",
|
|
59
|
+
baseUrl: DEFAULT_OLLAMA_BASE_URL,
|
|
60
|
+
step: 0,
|
|
61
|
+
loading: false,
|
|
62
|
+
saving: false,
|
|
63
|
+
applying: false,
|
|
64
|
+
loaded: false,
|
|
65
|
+
loadFailed: false,
|
|
66
|
+
error: "",
|
|
67
|
+
activation: null,
|
|
68
|
+
existingModel: null,
|
|
69
|
+
editableConnection: null,
|
|
70
|
+
finishAttempted: false,
|
|
71
|
+
};
|
|
72
|
+
let availability = { status: "loading" };
|
|
73
|
+
let environmentId = getEnvironmentId();
|
|
74
|
+
let revision = 0;
|
|
75
|
+
let bound = false;
|
|
76
|
+
let onCheckAgain = () => {};
|
|
77
|
+
const viewState = createSetupViewState(container);
|
|
78
|
+
const optionalSteps = createSetupOptionalSteps({
|
|
79
|
+
container, getEnvironmentId, getPreferredProvider: () => state.provider,
|
|
80
|
+
loadEmbeddingStatus, discoverEmbeddingModels, saveEmbedding, loadPlugins,
|
|
81
|
+
setPlugin, loadHostConnection, downloadHostSetup, revokeHostConnection,
|
|
82
|
+
onChange: paint, goToStep,
|
|
83
|
+
});
|
|
84
|
+
const { embedding, plugins, readyStep } = optionalSteps;
|
|
14
85
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (modelId.startsWith("--")) {
|
|
21
|
-
return {
|
|
22
|
-
valid: false,
|
|
23
|
-
value: "",
|
|
24
|
-
message: "Model ID cannot start with --.",
|
|
25
|
-
};
|
|
86
|
+
function goToStep(step) {
|
|
87
|
+
state.step = step;
|
|
88
|
+
state.error = "";
|
|
89
|
+
paint({ focus: true });
|
|
90
|
+
optionalSteps.load(step);
|
|
26
91
|
}
|
|
27
|
-
if (!SAFE_MODEL_ID_PATTERN.test(modelId)) {
|
|
28
|
-
return {
|
|
29
|
-
valid: false,
|
|
30
|
-
value: "",
|
|
31
|
-
message:
|
|
32
|
-
"Start with a letter or number. After that, use only letters, numbers, and _ @ + . : / = -.",
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return { valid: true, value: modelId, message: "" };
|
|
36
|
-
}
|
|
37
92
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
parsed = new URL(raw);
|
|
43
|
-
} catch {
|
|
44
|
-
return {
|
|
45
|
-
valid: false,
|
|
46
|
-
value: "",
|
|
47
|
-
message: "Enter an HTTP or HTTPS origin without a path.",
|
|
48
|
-
};
|
|
93
|
+
function clearSecret() {
|
|
94
|
+
clearConnectionSecret(container);
|
|
95
|
+
embedding.clearSecret();
|
|
49
96
|
}
|
|
50
|
-
if (
|
|
51
|
-
!["http:", "https:"].includes(parsed.protocol) ||
|
|
52
|
-
!SAFE_ORIGIN_HOST_PATTERN.test(parsed.host) ||
|
|
53
|
-
parsed.username ||
|
|
54
|
-
parsed.password ||
|
|
55
|
-
parsed.search ||
|
|
56
|
-
parsed.hash ||
|
|
57
|
-
(parsed.pathname && parsed.pathname !== "/")
|
|
58
|
-
) {
|
|
59
|
-
return {
|
|
60
|
-
valid: false,
|
|
61
|
-
value: "",
|
|
62
|
-
message: "Enter an HTTP or HTTPS origin without a path.",
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
valid: true,
|
|
67
|
-
value: `${parsed.protocol}//${parsed.host}`,
|
|
68
|
-
message: "",
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
97
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"web-ui": packaged ? "" : "npm run web-ui",
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function statusMeta(setup) {
|
|
100
|
-
if (setup?.status === "checking") {
|
|
101
|
-
return {
|
|
102
|
-
label: "Checking the model catalog…",
|
|
103
|
-
tone: "checking",
|
|
104
|
-
detail:
|
|
105
|
-
"This refresh only checks whether a configured model is available.",
|
|
106
|
-
};
|
|
98
|
+
function reset() {
|
|
99
|
+
revision += 1;
|
|
100
|
+
optionalSteps.reset();
|
|
101
|
+
viewState.reset();
|
|
102
|
+
clearSecret();
|
|
103
|
+
Object.assign(state, {
|
|
104
|
+
providers: [],
|
|
105
|
+
provider: "",
|
|
106
|
+
modelId: "",
|
|
107
|
+
contextWindowTokens: "",
|
|
108
|
+
baseUrl: DEFAULT_OLLAMA_BASE_URL,
|
|
109
|
+
step: 0,
|
|
110
|
+
loading: false,
|
|
111
|
+
saving: false,
|
|
112
|
+
applying: false,
|
|
113
|
+
loaded: false,
|
|
114
|
+
loadFailed: false,
|
|
115
|
+
error: "",
|
|
116
|
+
activation: null,
|
|
117
|
+
existingModel: null,
|
|
118
|
+
editableConnection: null,
|
|
119
|
+
finishAttempted: false,
|
|
120
|
+
});
|
|
107
121
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
detail: textOf(
|
|
113
|
-
setup.message,
|
|
114
|
-
"Make sure the model gateway and Web UI are running, then try again.",
|
|
115
|
-
),
|
|
116
|
-
};
|
|
122
|
+
|
|
123
|
+
function operationIsCurrent(operationRevision, operationEnvironment) {
|
|
124
|
+
if (operationRevision !== revision) return false;
|
|
125
|
+
return operationEnvironment === getEnvironmentId();
|
|
117
126
|
}
|
|
118
|
-
return {
|
|
119
|
-
label: "Setup needed",
|
|
120
|
-
tone: "setup",
|
|
121
|
-
detail: textOf(
|
|
122
|
-
setup?.message,
|
|
123
|
-
"Connect a provider and model before starting a conversation.",
|
|
124
|
-
),
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
127
|
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
type="button"
|
|
135
|
-
data-runtime-setup-action="copy"
|
|
136
|
-
data-runtime-command="${escapeAttribute(id)}"
|
|
137
|
-
data-runtime-copy-button="${escapeAttribute(id)}"
|
|
138
|
-
aria-describedby="runtimeSetupCopyStatus-${escapeAttribute(id)}"
|
|
139
|
-
${disabled ? "disabled" : ""}
|
|
140
|
-
>Copy</button>
|
|
141
|
-
</div>
|
|
142
|
-
<pre><code data-runtime-command-output="${escapeAttribute(id)}">${escapeHtml(command)}</code></pre>
|
|
143
|
-
<span
|
|
144
|
-
class="runtime-copy-status"
|
|
145
|
-
id="runtimeSetupCopyStatus-${escapeAttribute(id)}"
|
|
146
|
-
data-runtime-copy-status="${escapeAttribute(id)}"
|
|
147
|
-
aria-live="polite"
|
|
148
|
-
></span>
|
|
149
|
-
</div>
|
|
150
|
-
`;
|
|
151
|
-
}
|
|
128
|
+
function guideShouldBeVisible() {
|
|
129
|
+
if (availability.showGuide === false) return false;
|
|
130
|
+
return ["checking", "error", "setup_required"].includes(
|
|
131
|
+
availability.status,
|
|
132
|
+
);
|
|
133
|
+
}
|
|
152
134
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
135
|
+
function paint({ focus = false } = {}) {
|
|
136
|
+
if (!guideShouldBeVisible()) return;
|
|
137
|
+
if (requiresConfigurationRecovery(availability)) {
|
|
138
|
+
clearSecret();
|
|
139
|
+
container.innerHTML = renderConfigurationRecovery(availability);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
viewState.capture();
|
|
143
|
+
clearSecret();
|
|
144
|
+
const optional = optionalSteps.projection(state.step);
|
|
145
|
+
container.innerHTML = renderRuntimeSetup(state, availability, optional);
|
|
146
|
+
optionalSteps.afterPaint(state.step, { restoreFocus: viewState.canRestoreFocus() });
|
|
147
|
+
viewState.restore({ focus, busy: controlsAreBusy() });
|
|
148
|
+
}
|
|
165
149
|
|
|
166
|
-
function
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
150
|
+
async function loadOptions() {
|
|
151
|
+
if (state.loading) return;
|
|
152
|
+
const operationRevision = ++revision;
|
|
153
|
+
const operationEnvironment = getEnvironmentId();
|
|
154
|
+
state.loading = true;
|
|
155
|
+
state.loadFailed = false;
|
|
156
|
+
state.error = "";
|
|
157
|
+
paint();
|
|
158
|
+
try {
|
|
159
|
+
const payload = await loadSetup();
|
|
160
|
+
if (!operationIsCurrent(operationRevision, operationEnvironment)) return;
|
|
161
|
+
if (requiresConfigurationRecovery(payload?.setup))
|
|
162
|
+
availability = { ...availability, recovery: "configuration", message: payload.setup.message };
|
|
163
|
+
state.providers = (payload?.setup?.providers || []).filter((provider) =>
|
|
164
|
+
normalizeProvider(provider.id),
|
|
165
|
+
);
|
|
166
|
+
receiveSetupConnection(state, payload.setup);
|
|
167
|
+
state.loaded = true;
|
|
168
|
+
} catch {
|
|
169
|
+
if (!operationIsCurrent(operationRevision, operationEnvironment)) return;
|
|
170
|
+
state.loadFailed = true;
|
|
171
|
+
state.error = "Could not load connection options. Try again.";
|
|
172
|
+
} finally {
|
|
173
|
+
if (operationIsCurrent(operationRevision, operationEnvironment)) {
|
|
174
|
+
state.loading = false;
|
|
175
|
+
paint();
|
|
176
|
+
if (state.step === 2) void embedding.load();
|
|
177
|
+
}
|
|
178
|
+
}
|
|
173
179
|
}
|
|
174
180
|
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
);
|
|
179
|
-
if (!status) return;
|
|
180
|
-
status.textContent = message;
|
|
181
|
-
status.classList?.toggle("error", failed);
|
|
181
|
+
function fieldError(field, message) {
|
|
182
|
+
state.error = message;
|
|
183
|
+
paint();
|
|
184
|
+
showConnectionFieldError(container, field);
|
|
182
185
|
}
|
|
183
186
|
|
|
184
|
-
function
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
);
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
function connectionInput() {
|
|
188
|
+
const result = validateConnectionFields({
|
|
189
|
+
modelId: state.modelId,
|
|
190
|
+
contextWindowTokens: state.contextWindowTokens,
|
|
191
|
+
providerType: state.provider,
|
|
192
|
+
baseUrl: state.baseUrl,
|
|
193
|
+
});
|
|
194
|
+
if (!result.valid) {
|
|
195
|
+
fieldError(result.field, result.message);
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
const input = { provider: state.provider, ...result.input };
|
|
199
|
+
if (state.editableConnection?.revision)
|
|
200
|
+
input.connectionRevision = state.editableConnection.revision;
|
|
201
|
+
if (state.provider === "ollama") return input;
|
|
202
|
+
const apiKey = readConnectionSecret(container);
|
|
203
|
+
const provider = state.providers.find(
|
|
204
|
+
(entry) => entry.id === state.provider,
|
|
193
205
|
);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
? `Use the exact model name understood by ${provider === "openai" ? "OpenAI" : provider === "ollama" ? "Ollama" : "your provider"}.`
|
|
198
|
-
: validation.message;
|
|
199
|
-
help.classList?.toggle("error", Boolean(modelId) && !validation.valid);
|
|
206
|
+
if (provider?.credentialConfigured !== true && !apiKey) {
|
|
207
|
+
fieldError("api-key", "Enter your OpenAI API key.");
|
|
208
|
+
return null;
|
|
200
209
|
}
|
|
201
|
-
return
|
|
210
|
+
return apiKey ? { ...input, apiKey } : input;
|
|
202
211
|
}
|
|
203
212
|
|
|
204
|
-
function
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
async function submitConnection() {
|
|
214
|
+
const input = connectionInput();
|
|
215
|
+
if (!input) return;
|
|
216
|
+
const connectionChanged = hasSetupConnectionChanges(state);
|
|
217
|
+
const operationRevision = ++revision;
|
|
218
|
+
const operationEnvironment = getEnvironmentId();
|
|
219
|
+
state.saving = true;
|
|
220
|
+
state.error = "";
|
|
221
|
+
clearSecret();
|
|
222
|
+
paint();
|
|
223
|
+
try {
|
|
224
|
+
const payload = await saveSetup({ ...input, deferActivation: true });
|
|
225
|
+
if (!operationIsCurrent(operationRevision, operationEnvironment)) return;
|
|
226
|
+
if (
|
|
227
|
+
!["ready", "restart_required"].includes(payload?.activation?.status)
|
|
228
|
+
) {
|
|
229
|
+
throw new Error("Setup activation unavailable");
|
|
230
|
+
}
|
|
231
|
+
state.activation = payload.activation;
|
|
232
|
+
state.providers = payload.setup?.providers || state.providers;
|
|
233
|
+
state.editableConnection = payload.setup?.editableConnection || null;
|
|
234
|
+
state.existingModel = payload.setup?.existingModel || {
|
|
235
|
+
provider: state.provider,
|
|
236
|
+
model: state.modelId,
|
|
237
|
+
contextWindowTokens: Number(state.contextWindowTokens),
|
|
238
|
+
baseUrl: state.baseUrl,
|
|
239
|
+
};
|
|
240
|
+
if (connectionChanged || payload.embeddingInvalidated)
|
|
241
|
+
embedding.invalidateConnection();
|
|
242
|
+
state.finishAttempted = false;
|
|
243
|
+
state.step = 2;
|
|
244
|
+
} catch (error) {
|
|
245
|
+
if (!operationIsCurrent(operationRevision, operationEnvironment)) return;
|
|
246
|
+
state.error = setupConnectionSaveError(error);
|
|
247
|
+
} finally {
|
|
248
|
+
delete input.apiKey;
|
|
249
|
+
if (operationIsCurrent(operationRevision, operationEnvironment)) {
|
|
250
|
+
state.saving = false;
|
|
251
|
+
paint({ focus: true });
|
|
252
|
+
if (state.step === 2) void embedding.load();
|
|
253
|
+
}
|
|
215
254
|
}
|
|
216
|
-
return validation;
|
|
217
255
|
}
|
|
218
256
|
|
|
219
|
-
function
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
);
|
|
231
|
-
if (
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
257
|
+
async function applyConnection() {
|
|
258
|
+
const operationRevision = ++revision;
|
|
259
|
+
const operationEnvironment = getEnvironmentId();
|
|
260
|
+
let activated = false;
|
|
261
|
+
state.applying = true;
|
|
262
|
+
state.finishAttempted = true;
|
|
263
|
+
state.error = "";
|
|
264
|
+
clearSecret();
|
|
265
|
+
paint();
|
|
266
|
+
try {
|
|
267
|
+
const payload = await applySetup();
|
|
268
|
+
if (!operationIsCurrent(operationRevision, operationEnvironment)) return;
|
|
269
|
+
if (
|
|
270
|
+
!["ready", "restart_required"].includes(payload?.activation?.status)
|
|
271
|
+
) {
|
|
272
|
+
throw new Error("Setup activation unavailable");
|
|
273
|
+
}
|
|
274
|
+
state.activation = payload.activation;
|
|
275
|
+
state.step = readyStep;
|
|
276
|
+
if (state.activation.status === "ready") {
|
|
277
|
+
activated = true;
|
|
278
|
+
await onCheckAgain();
|
|
279
|
+
}
|
|
280
|
+
} catch {
|
|
281
|
+
if (!operationIsCurrent(operationRevision, operationEnvironment)) return;
|
|
282
|
+
state.error = activated
|
|
283
|
+
? "Connection applied. Check model availability again."
|
|
284
|
+
: "Could not apply your saved connection. Try again when your agent is idle.";
|
|
285
|
+
} finally {
|
|
286
|
+
if (operationIsCurrent(operationRevision, operationEnvironment)) {
|
|
287
|
+
state.applying = false;
|
|
288
|
+
paint({ focus: true });
|
|
237
289
|
}
|
|
238
290
|
}
|
|
239
291
|
}
|
|
240
292
|
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
293
|
+
function controlsAreBusy() {
|
|
294
|
+
if (requiresConfigurationRecovery(availability)) return true;
|
|
295
|
+
if (
|
|
296
|
+
state.loading ||
|
|
297
|
+
state.saving ||
|
|
298
|
+
state.applying ||
|
|
299
|
+
embedding.state.busy ||
|
|
300
|
+
plugins.state.busy
|
|
301
|
+
)
|
|
302
|
+
return true;
|
|
303
|
+
return availability.status === "checking";
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function submit(event) {
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
if (controlsAreBusy()) return;
|
|
309
|
+
if (state.step === 0) {
|
|
310
|
+
if (!state.loaded || !state.provider) return;
|
|
311
|
+
state.step = 1;
|
|
312
|
+
state.error = "";
|
|
313
|
+
paint({ focus: true });
|
|
247
314
|
return;
|
|
248
315
|
}
|
|
249
|
-
if (
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
316
|
+
if (state.step === 1) {
|
|
317
|
+
const replacementKey = readConnectionSecret(container);
|
|
318
|
+
if (canContinueSavedConnection(state, replacementKey)) goToStep(2);
|
|
319
|
+
else void submitConnection();
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if (state.step === 2) {
|
|
323
|
+
void embedding.submit();
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
if (state.step === 3 && plugins.state.loaded && !plugins.state.error) {
|
|
327
|
+
goToStep(4);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
if (optionalSteps.canContinueComputer(state.step)) goToStep(readyStep);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function click(event) {
|
|
334
|
+
const action = event.target.closest?.("[data-runtime-setup-action]")
|
|
335
|
+
?.dataset.runtimeSetupAction;
|
|
336
|
+
if (requiresConfigurationRecovery(availability)) {
|
|
337
|
+
if (availability.status === "checking") return;
|
|
338
|
+
if (action === "configuration") openConfiguration();
|
|
339
|
+
if (action === "check") void onCheckAgain();
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (!action || controlsAreBusy()) return;
|
|
343
|
+
const setupWasApplied =
|
|
344
|
+
state.finishAttempted && state.activation?.status === "ready";
|
|
345
|
+
if (setupWasApplied && action !== "check") return;
|
|
346
|
+
if (action === "apply" && state.step === readyStep) {
|
|
347
|
+
void applyConnection();
|
|
255
348
|
return;
|
|
256
349
|
}
|
|
257
|
-
const baseUrlValidation = validateRuntimeSetupBaseUrl(ollamaBaseUrl);
|
|
258
350
|
if (
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
351
|
+
action === "check" &&
|
|
352
|
+
(state.step < 2 ||
|
|
353
|
+
(state.activation?.status === "ready" && state.step === readyStep))
|
|
262
354
|
) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
input?.reportValidity?.();
|
|
266
|
-
input?.focus?.();
|
|
267
|
-
setCopyStatus("setup", baseUrlValidation.message, true);
|
|
355
|
+
clearSecret();
|
|
356
|
+
void onCheckAgain();
|
|
268
357
|
return;
|
|
269
358
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
359
|
+
if (action === "reload") {
|
|
360
|
+
void loadOptions();
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
if (action === "skip-embedding" && state.step === 2) {
|
|
364
|
+
goToStep(3);
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
if (action === "skip-computer" && state.step === 4 && optionalSteps.hasComputerStep) {
|
|
368
|
+
goToStep(readyStep);
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
if (action === "plugins-reload" && state.step === 3) {
|
|
372
|
+
void plugins.load(true);
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
if (action.startsWith("embedding-") && state.step === 2) {
|
|
376
|
+
embedding.click(action);
|
|
377
|
+
return;
|
|
275
378
|
}
|
|
379
|
+
if (action === "back")
|
|
380
|
+
goToStep(Math.max(canEditSetupConnection(state) ? 0 : 1, state.step - 1));
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function input(event) {
|
|
384
|
+
if (controlsAreBusy()) return;
|
|
385
|
+
const field = event.target.closest?.("[data-runtime-setup-field]");
|
|
386
|
+
if (!field) return;
|
|
387
|
+
if (state.step === 2) {
|
|
388
|
+
embedding.input(field.dataset.runtimeSetupField, textOf(field.value));
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
field.removeAttribute?.("aria-invalid");
|
|
392
|
+
updateSetupConnectionField(
|
|
393
|
+
state,
|
|
394
|
+
field.dataset.runtimeSetupField,
|
|
395
|
+
textOf(field.value),
|
|
396
|
+
);
|
|
397
|
+
const action = container.querySelector(
|
|
398
|
+
'.runtime-setup-action[type="submit"]',
|
|
399
|
+
);
|
|
400
|
+
if (action)
|
|
401
|
+
action.textContent = setupConnectionSubmitLabel(
|
|
402
|
+
state,
|
|
403
|
+
readConnectionSecret(container),
|
|
404
|
+
);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
function change(event) {
|
|
408
|
+
if (controlsAreBusy()) return;
|
|
409
|
+
const field = event.target.closest?.("[data-runtime-setup-field]");
|
|
410
|
+
if (state.step === 2) {
|
|
411
|
+
embedding.change(field?.dataset.runtimeSetupField, textOf(field?.value));
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (
|
|
415
|
+
!canEditSetupConnection(state) ||
|
|
416
|
+
field?.dataset.runtimeSetupField !== "provider"
|
|
417
|
+
)
|
|
418
|
+
return;
|
|
419
|
+
selectSetupProvider(state, field.value);
|
|
420
|
+
state.error = "";
|
|
421
|
+
paint();
|
|
422
|
+
container
|
|
423
|
+
.querySelector(
|
|
424
|
+
`[data-runtime-setup-field="provider"][value="${state.provider}"]`,
|
|
425
|
+
)
|
|
426
|
+
?.focus?.({ preventScroll: true });
|
|
276
427
|
}
|
|
277
428
|
|
|
278
429
|
function bind({ onCheckAgain: checkAgain = () => {} } = {}) {
|
|
279
430
|
onCheckAgain = checkAgain;
|
|
280
431
|
if (bound) return;
|
|
281
432
|
bound = true;
|
|
282
|
-
|
|
283
|
-
container.addEventListener("click",
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (action.dataset.runtimeSetupAction === "check") {
|
|
287
|
-
void onCheckAgain();
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
if (action.dataset.runtimeSetupAction === "copy") {
|
|
291
|
-
void copyCommand(action.dataset.runtimeCommand);
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
container.addEventListener("change", (event) => {
|
|
296
|
-
const field = event.target.closest?.("[data-runtime-setup-field]");
|
|
297
|
-
if (field?.dataset.runtimeSetupField !== "provider") return;
|
|
298
|
-
provider = normalizeProvider(field.value);
|
|
299
|
-
render(currentSetup);
|
|
300
|
-
container
|
|
301
|
-
.querySelector(
|
|
302
|
-
`[data-runtime-setup-field="provider"][value="${provider}"]`,
|
|
303
|
-
)
|
|
304
|
-
?.focus?.();
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
container.addEventListener("input", (event) => {
|
|
308
|
-
const field = event.target.closest?.("[data-runtime-setup-field]");
|
|
309
|
-
if (!field) return;
|
|
310
|
-
if (field.dataset.runtimeSetupField === "model-id") {
|
|
311
|
-
modelId = textOf(field.value);
|
|
312
|
-
} else if (field.dataset.runtimeSetupField === "ollama-base-url") {
|
|
313
|
-
ollamaBaseUrl = textOf(field.value);
|
|
314
|
-
} else {
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
field.setCustomValidity?.("");
|
|
318
|
-
updateCommandPreview();
|
|
319
|
-
});
|
|
433
|
+
container.addEventListener("submit", submit);
|
|
434
|
+
container.addEventListener("click", click);
|
|
435
|
+
container.addEventListener("input", input);
|
|
436
|
+
container.addEventListener("change", change);
|
|
320
437
|
}
|
|
321
438
|
|
|
322
439
|
function render(setup) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
440
|
+
const incoming = setup || { status: "loading" };
|
|
441
|
+
availability = environmentId === getEnvironmentId()
|
|
442
|
+
? preserveConfigurationRecovery(availability, incoming)
|
|
443
|
+
: incoming;
|
|
444
|
+
if (requiresConfigurationRecovery(availability)) reset();
|
|
445
|
+
if (environmentId !== getEnvironmentId()) {
|
|
446
|
+
reset();
|
|
447
|
+
environmentId = getEnvironmentId();
|
|
448
|
+
}
|
|
449
|
+
const visible = guideShouldBeVisible();
|
|
328
450
|
container.hidden = !visible;
|
|
329
451
|
conversationRegion.hidden = visible;
|
|
330
452
|
if (!visible) {
|
|
453
|
+
reset();
|
|
331
454
|
container.replaceChildren();
|
|
332
455
|
return;
|
|
333
456
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const baseUrlValidation = validateRuntimeSetupBaseUrl(ollamaBaseUrl);
|
|
339
|
-
const checking = status === "checking";
|
|
340
|
-
const packaged = getSetupCommandMode() === "package";
|
|
341
|
-
const openAiSelected = provider === "openai";
|
|
342
|
-
const ollamaSelected = provider === "ollama";
|
|
343
|
-
const commandStep = ollamaSelected ? 4 : 3;
|
|
344
|
-
const restartStep = ollamaSelected ? 5 : 4;
|
|
345
|
-
|
|
346
|
-
container.innerHTML = `
|
|
347
|
-
<div class="runtime-setup-card" aria-busy="${checking ? "true" : "false"}">
|
|
348
|
-
<div class="runtime-setup-copy">
|
|
349
|
-
<h3>Connect your first model</h3>
|
|
350
|
-
<p>ABot is already running. This guide gives you the commands to finish setup, but it cannot run commands or restart services for you.</p>
|
|
351
|
-
</div>
|
|
352
|
-
|
|
353
|
-
<div class="runtime-setup-status ${escapeAttribute(statusCopy.tone)}" role="status">
|
|
354
|
-
<strong>${escapeHtml(statusCopy.label)}</strong>
|
|
355
|
-
<span>${escapeHtml(statusCopy.detail)}</span>
|
|
356
|
-
</div>
|
|
357
|
-
|
|
358
|
-
<fieldset class="runtime-provider-fieldset">
|
|
359
|
-
<legend><span>1</span> Choose a provider</legend>
|
|
360
|
-
<div class="runtime-provider-options">
|
|
361
|
-
<label class="runtime-provider-option">
|
|
362
|
-
<input
|
|
363
|
-
type="radio"
|
|
364
|
-
name="runtimeSetupProvider"
|
|
365
|
-
value="ollama"
|
|
366
|
-
data-runtime-setup-field="provider"
|
|
367
|
-
data-runtime-setup-provider
|
|
368
|
-
required
|
|
369
|
-
${provider === "ollama" ? "checked" : ""}
|
|
370
|
-
/>
|
|
371
|
-
<span><strong>Ollama</strong><small>Run a model locally.</small></span>
|
|
372
|
-
</label>
|
|
373
|
-
<label class="runtime-provider-option">
|
|
374
|
-
<input
|
|
375
|
-
type="radio"
|
|
376
|
-
name="runtimeSetupProvider"
|
|
377
|
-
value="openai"
|
|
378
|
-
data-runtime-setup-field="provider"
|
|
379
|
-
required
|
|
380
|
-
${openAiSelected ? "checked" : ""}
|
|
381
|
-
/>
|
|
382
|
-
<span><strong>OpenAI</strong><small>Use a hosted OpenAI model.</small></span>
|
|
383
|
-
</label>
|
|
384
|
-
</div>
|
|
385
|
-
</fieldset>
|
|
386
|
-
|
|
387
|
-
<div class="runtime-model-field">
|
|
388
|
-
<label for="runtimeSetupModelId"><span>2</span> Enter the model ID</label>
|
|
389
|
-
<input
|
|
390
|
-
id="runtimeSetupModelId"
|
|
391
|
-
type="text"
|
|
392
|
-
value="${escapeAttribute(modelId)}"
|
|
393
|
-
placeholder="Exact provider model ID"
|
|
394
|
-
autocomplete="off"
|
|
395
|
-
spellcheck="false"
|
|
396
|
-
required
|
|
397
|
-
aria-required="true"
|
|
398
|
-
aria-invalid="${modelId && !modelValidation.valid ? "true" : "false"}"
|
|
399
|
-
aria-describedby="runtimeSetupModelHelp"
|
|
400
|
-
data-runtime-setup-field="model-id"
|
|
401
|
-
data-runtime-setup-model
|
|
402
|
-
/>
|
|
403
|
-
<small id="runtimeSetupModelHelp" data-runtime-model-help>${escapeHtml(
|
|
404
|
-
modelValidation.valid
|
|
405
|
-
? `Use the exact model name understood by ${openAiSelected ? "OpenAI" : provider === "ollama" ? "Ollama" : "your provider"}.`
|
|
406
|
-
: modelValidation.message,
|
|
407
|
-
)}</small>
|
|
408
|
-
</div>
|
|
409
|
-
|
|
410
|
-
${
|
|
411
|
-
ollamaSelected
|
|
412
|
-
? `<div class="runtime-model-field">
|
|
413
|
-
<label for="runtimeSetupBaseUrl"><span>3</span> Enter the Ollama address</label>
|
|
414
|
-
<input
|
|
415
|
-
id="runtimeSetupBaseUrl"
|
|
416
|
-
type="url"
|
|
417
|
-
value="${escapeAttribute(ollamaBaseUrl)}"
|
|
418
|
-
placeholder="http://127.0.0.1:11434"
|
|
419
|
-
autocomplete="off"
|
|
420
|
-
spellcheck="false"
|
|
421
|
-
required
|
|
422
|
-
aria-required="true"
|
|
423
|
-
aria-invalid="${baseUrlValidation.valid ? "false" : "true"}"
|
|
424
|
-
aria-describedby="runtimeSetupBaseUrlHelp"
|
|
425
|
-
data-runtime-setup-field="ollama-base-url"
|
|
426
|
-
data-runtime-setup-base-url
|
|
427
|
-
/>
|
|
428
|
-
<small id="runtimeSetupBaseUrlHelp" data-runtime-base-url-help class="${baseUrlValidation.valid ? "" : "error"}">
|
|
429
|
-
${
|
|
430
|
-
baseUrlValidation.valid
|
|
431
|
-
? `Use the address that ABot can reach. Common setups: same environment — <code>http://127.0.0.1:11434</code>; Docker Desktop with Ollama on the Windows or macOS host — <code>http://host.docker.internal:11434</code>; another host — enter its reachable HTTP address.`
|
|
432
|
-
: escapeHtml(baseUrlValidation.message)
|
|
433
|
-
}
|
|
434
|
-
</small>
|
|
435
|
-
</div>`
|
|
436
|
-
: ""
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
<section class="runtime-setup-section" aria-labelledby="runtimeSetupCommandsTitle">
|
|
440
|
-
<h4 id="runtimeSetupCommandsTitle"><span>${commandStep}</span> Run the generated commands</h4>
|
|
441
|
-
<p>The initializer creates machine-local <code>.env</code> and <code>local/*.config.json</code> files. It keeps existing files unless you explicitly use <code>--force</code>.</p>
|
|
442
|
-
${
|
|
443
|
-
ollamaSelected
|
|
444
|
-
? commandBlock({
|
|
445
|
-
command: commandValues["ollama-pull"],
|
|
446
|
-
disabled: !modelValidation.valid,
|
|
447
|
-
id: "ollama-pull",
|
|
448
|
-
label: "Ollama host terminal · download the model",
|
|
449
|
-
})
|
|
450
|
-
: ""
|
|
451
|
-
}
|
|
452
|
-
${commandBlock({
|
|
453
|
-
command: commandValues.setup,
|
|
454
|
-
disabled:
|
|
455
|
-
!provider ||
|
|
456
|
-
!modelValidation.valid ||
|
|
457
|
-
(ollamaSelected && !baseUrlValidation.valid),
|
|
458
|
-
id: "setup",
|
|
459
|
-
label: openAiSelected
|
|
460
|
-
? "Runtime terminal · initialize OpenAI"
|
|
461
|
-
: ollamaSelected
|
|
462
|
-
? "Runtime terminal · initialize ABot"
|
|
463
|
-
: "Runtime terminal · initialize your provider",
|
|
464
|
-
})}
|
|
465
|
-
${
|
|
466
|
-
openAiSelected
|
|
467
|
-
? `<div class="runtime-secret-note">
|
|
468
|
-
<strong>Keep your API key out of this page</strong>
|
|
469
|
-
<p>After initialization, set <code>OPENAI_API_KEY</code> in <code>.env</code> with your local editor or secret manager. The Web UI does not request, display, or store the secret.</p>
|
|
470
|
-
</div>`
|
|
471
|
-
: ollamaSelected
|
|
472
|
-
? `<p class="runtime-provider-note">Run the download command where Ollama is installed. Run the initializer from the ${packaged ? "consumer project directory" : "ABot repository root"}. These may be the same environment or different ones.</p>`
|
|
473
|
-
: `<p class="runtime-provider-note">Choose Ollama or OpenAI to generate the provider-specific setup command.</p>`
|
|
474
|
-
}
|
|
475
|
-
</section>
|
|
476
|
-
|
|
477
|
-
<section class="runtime-setup-section" aria-labelledby="runtimeSetupRestartTitle">
|
|
478
|
-
<h4 id="runtimeSetupRestartTitle"><span>${restartStep}</span> ${packaged ? "Restart ABot" : "Restart both local services"}</h4>
|
|
479
|
-
<p>${packaged ? "Stop the currently running ABot process with" : "Stop the currently running model gateway and Web UI with"} <kbd>Ctrl</kbd>+<kbd>C</kbd>, then ${packaged ? "start it again" : "start each again in its own terminal"}. A process that started before <code>.env</code> existed cannot discover the new config pointer without a restart.</p>
|
|
480
|
-
<div class="runtime-restart-commands">
|
|
481
|
-
${commandBlock({
|
|
482
|
-
command: commandValues["model-gateway"],
|
|
483
|
-
id: "model-gateway",
|
|
484
|
-
label: packaged
|
|
485
|
-
? "Runtime terminal · ABot services"
|
|
486
|
-
: "Terminal 1 · model gateway",
|
|
487
|
-
})}
|
|
488
|
-
${
|
|
489
|
-
packaged
|
|
490
|
-
? ""
|
|
491
|
-
: commandBlock({
|
|
492
|
-
command: commandValues["web-ui"],
|
|
493
|
-
id: "web-ui",
|
|
494
|
-
label: "Terminal 2 · Web UI",
|
|
495
|
-
})
|
|
496
|
-
}
|
|
497
|
-
</div>
|
|
498
|
-
</section>
|
|
499
|
-
|
|
500
|
-
<div class="runtime-setup-footer">
|
|
501
|
-
<p><strong>Check again</strong> performs one model-catalog refresh. It does not run setup, reread a newly created <code>.env</code>, or restart either service.</p>
|
|
502
|
-
<button
|
|
503
|
-
class="runtime-setup-action"
|
|
504
|
-
type="button"
|
|
505
|
-
data-runtime-setup-action="check"
|
|
506
|
-
${checking ? "disabled" : ""}
|
|
507
|
-
>${checking ? "Checking…" : "Check again"}</button>
|
|
508
|
-
</div>
|
|
509
|
-
</div>
|
|
510
|
-
`;
|
|
511
|
-
updateCommandPreview();
|
|
457
|
+
paint();
|
|
458
|
+
if (requiresConfigurationRecovery(availability)) return;
|
|
459
|
+
if (!state.loaded && !state.loading && !state.loadFailed)
|
|
460
|
+
void loadOptions();
|
|
512
461
|
}
|
|
513
462
|
|
|
514
463
|
function focusAction() {
|
|
515
464
|
container.querySelector('[data-runtime-setup-action="check"]')?.focus?.();
|
|
516
465
|
}
|
|
517
466
|
|
|
518
|
-
|
|
467
|
+
function dispose() {
|
|
468
|
+
reset();
|
|
469
|
+
container.replaceChildren();
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
return { bind, clearSecret, dispose, focusAction, render };
|
|
519
473
|
}
|