@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,21 @@
|
|
|
1
|
+
import type { ToolAvailabilityEntry } from "../../capabilities/tool-types.js";
|
|
2
|
+
import type { ChatMessage } from "../../model-gateway/types.js";
|
|
3
|
+
import type { ToolAvailabilityOverviewGroup } from "../../plugin-sdk/tool-availability-overview.js";
|
|
4
|
+
import type { ModelStepContextCompactionController } from "../model/model-step-port.js";
|
|
5
|
+
import { type CapabilityBriefProjection } from "./capability-brief.js";
|
|
6
|
+
import type { RequestContextBudget } from "./request-context-contracts.js";
|
|
7
|
+
export type CapabilityBriefReadmissionOptions = Readonly<{
|
|
8
|
+
entries?: readonly ToolAvailabilityEntry[];
|
|
9
|
+
groups: readonly ToolAvailabilityOverviewGroup[];
|
|
10
|
+
budget: RequestContextBudget;
|
|
11
|
+
format?: Readonly<{
|
|
12
|
+
schema: unknown;
|
|
13
|
+
}>;
|
|
14
|
+
additionalBudgetMessages?: readonly ChatMessage[];
|
|
15
|
+
}>;
|
|
16
|
+
/** Re-admits an existing optional brief against the current attempt's context. */
|
|
17
|
+
export declare function createCapabilityBriefReadmissionController(params: Readonly<{
|
|
18
|
+
controller: ModelStepContextCompactionController;
|
|
19
|
+
resolveOptions(): CapabilityBriefReadmissionOptions;
|
|
20
|
+
onReadmitted?(projection: CapabilityBriefProjection): void;
|
|
21
|
+
}>): ModelStepContextCompactionController;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isCapabilityBriefMessage, projectCapabilityBriefAtHeadroom, } from "./capability-brief.js";
|
|
2
|
+
import { resolveCapabilityBriefMessageHeadroom } from "./capability-brief-budget.js";
|
|
3
|
+
/** Re-admits an existing optional brief against the current attempt's context. */
|
|
4
|
+
export function createCapabilityBriefReadmissionController(params) {
|
|
5
|
+
const { controller } = params;
|
|
6
|
+
return Object.freeze({
|
|
7
|
+
get compactionScope() {
|
|
8
|
+
return controller.compactionScope;
|
|
9
|
+
},
|
|
10
|
+
project(messages) {
|
|
11
|
+
const projected = controller.project(messages);
|
|
12
|
+
const briefIndex = projected.findIndex(isCapabilityBriefMessage);
|
|
13
|
+
if (briefIndex < 0)
|
|
14
|
+
return projected;
|
|
15
|
+
const withoutBrief = projected.filter((_, index) => index !== briefIndex);
|
|
16
|
+
const options = params.resolveOptions();
|
|
17
|
+
const headroom = resolveCapabilityBriefMessageHeadroom({
|
|
18
|
+
messages: [
|
|
19
|
+
...withoutBrief,
|
|
20
|
+
...(options.additionalBudgetMessages ?? []),
|
|
21
|
+
],
|
|
22
|
+
budget: options.budget,
|
|
23
|
+
format: options.format,
|
|
24
|
+
});
|
|
25
|
+
const replacement = projectCapabilityBriefAtHeadroom({
|
|
26
|
+
entries: options.entries,
|
|
27
|
+
groups: options.groups,
|
|
28
|
+
headroom,
|
|
29
|
+
tokenEstimation: options.budget.tokenEstimation,
|
|
30
|
+
});
|
|
31
|
+
if (replacement.message?.content === projected[briefIndex].content) {
|
|
32
|
+
return projected;
|
|
33
|
+
}
|
|
34
|
+
params.onReadmitted?.(replacement);
|
|
35
|
+
if (!replacement.message)
|
|
36
|
+
return withoutBrief;
|
|
37
|
+
return [
|
|
38
|
+
...projected.slice(0, briefIndex),
|
|
39
|
+
replacement.message,
|
|
40
|
+
...projected.slice(briefIndex + 1),
|
|
41
|
+
];
|
|
42
|
+
},
|
|
43
|
+
prepare(messages) {
|
|
44
|
+
return controller.prepare(messages);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ChatMessage } from "../../model-gateway/types.js";
|
|
1
|
+
import type { ChatMessage, ModelTokenEstimationConfig } from "../../model-gateway/types.js";
|
|
2
2
|
import type { ToolAvailabilityEntry } from "../../capabilities/tool-types.js";
|
|
3
3
|
import { type ToolAvailabilityOverviewGroup, type ToolAvailabilityOverviewLevel } from "../../plugin-sdk/tool-availability-overview.js";
|
|
4
4
|
import type { projectRequestContext } from "./request-context.js";
|
|
5
5
|
export declare const CAPABILITY_BRIEF_KIND = "runtime_capability_brief_v1";
|
|
6
6
|
export declare const CAPABILITY_BRIEF_MAX_TOKENS = 512;
|
|
7
|
-
export type CapabilityBriefLevel = ToolAvailabilityOverviewLevel | "none";
|
|
7
|
+
export type CapabilityBriefLevel = ToolAvailabilityOverviewLevel | "descriptions" | "none";
|
|
8
8
|
export type CapabilityBriefProjection = Readonly<{
|
|
9
9
|
level: CapabilityBriefLevel;
|
|
10
10
|
message?: ChatMessage;
|
|
@@ -20,6 +20,13 @@ export declare function projectCapabilityBrief(params: Readonly<{
|
|
|
20
20
|
context: ContextInput;
|
|
21
21
|
additionalBudgetMessages?: readonly ChatMessage[];
|
|
22
22
|
}>): CapabilityBriefProjection;
|
|
23
|
+
/** Selects complete availability within the current invocation's input budget. */
|
|
24
|
+
export declare function projectCapabilityBriefAtHeadroom(params: Readonly<{
|
|
25
|
+
entries?: readonly ToolAvailabilityEntry[];
|
|
26
|
+
groups: readonly ToolAvailabilityOverviewGroup[];
|
|
27
|
+
headroom: number;
|
|
28
|
+
tokenEstimation?: ModelTokenEstimationConfig;
|
|
29
|
+
}>): CapabilityBriefProjection;
|
|
23
30
|
/** Consumers explicitly remove this optional reference at narrower phases. */
|
|
24
31
|
export declare function isCapabilityBriefMessage(message: ChatMessage): boolean;
|
|
25
32
|
export {};
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { buildToolAvailabilityOverview, } from "../../plugin-sdk/tool-availability-overview.js";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveCapabilityBriefHeadroom } from "./capability-brief-budget.js";
|
|
3
|
+
import { buildCapabilityDescriptions } from "./capability-descriptions.js";
|
|
3
4
|
import { estimateMessageTokens } from "./token-estimator.js";
|
|
4
5
|
export const CAPABILITY_BRIEF_KIND = "runtime_capability_brief_v1";
|
|
5
6
|
export const CAPABILITY_BRIEF_MAX_TOKENS = 512;
|
|
6
7
|
const CAPABILITY_BRIEF_PREFIX = `${CAPABILITY_BRIEF_KIND}\n`;
|
|
7
8
|
/** Optional availability metadata admitted against the full context estimate. */
|
|
8
9
|
export function projectCapabilityBrief(params) {
|
|
9
|
-
|
|
10
|
+
return projectCapabilityBriefAtHeadroom({
|
|
11
|
+
entries: params.entries,
|
|
12
|
+
groups: params.groups,
|
|
13
|
+
headroom: resolveCapabilityBriefHeadroom(params),
|
|
14
|
+
tokenEstimation: params.context.budget.tokenEstimation,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Selects complete availability within the current invocation's input budget. */
|
|
18
|
+
export function projectCapabilityBriefAtHeadroom(params) {
|
|
19
|
+
const headroom = Math.max(0, params.headroom);
|
|
20
|
+
const compactBudgetTokens = Math.min(CAPABILITY_BRIEF_MAX_TOKENS, headroom);
|
|
10
21
|
if (params.groups.length === 0) {
|
|
11
|
-
return omittedBrief(
|
|
22
|
+
return omittedBrief(compactBudgetTokens, "empty_catalog");
|
|
12
23
|
}
|
|
13
24
|
const levels = hasCompleteCapabilityBriefEntries(params.entries, params.groups)
|
|
14
|
-
? ["detailed", "titles", "groups"]
|
|
25
|
+
? ["descriptions", "detailed", "titles", "groups"]
|
|
15
26
|
: ["groups"];
|
|
16
27
|
for (const level of levels) {
|
|
17
|
-
const
|
|
28
|
+
const budgetTokens = level === "descriptions" ? headroom : compactBudgetTokens;
|
|
29
|
+
const body = level === "descriptions"
|
|
30
|
+
? buildCapabilityDescriptions(params.entries ?? [])
|
|
31
|
+
: buildToolAvailabilityOverview(params.entries ?? [], params.groups, level);
|
|
18
32
|
const message = Object.freeze({
|
|
19
33
|
role: "system",
|
|
20
34
|
content: [
|
|
@@ -24,7 +38,7 @@ export function projectCapabilityBrief(params) {
|
|
|
24
38
|
body,
|
|
25
39
|
].join("\n"),
|
|
26
40
|
});
|
|
27
|
-
const estimatedTokens = estimateMessageTokens(message, params.
|
|
41
|
+
const estimatedTokens = estimateMessageTokens(message, params.tokenEstimation);
|
|
28
42
|
if (!fitsCapabilityBriefBudget(estimatedTokens, budgetTokens))
|
|
29
43
|
continue;
|
|
30
44
|
return Object.freeze({
|
|
@@ -35,7 +49,7 @@ export function projectCapabilityBrief(params) {
|
|
|
35
49
|
reason: "complete_catalog",
|
|
36
50
|
});
|
|
37
51
|
}
|
|
38
|
-
return omittedBrief(
|
|
52
|
+
return omittedBrief(compactBudgetTokens, "insufficient_budget");
|
|
39
53
|
}
|
|
40
54
|
/** Consumers explicitly remove this optional reference at narrower phases. */
|
|
41
55
|
export function isCapabilityBriefMessage(message) {
|
|
@@ -43,38 +57,6 @@ export function isCapabilityBriefMessage(message) {
|
|
|
43
57
|
return false;
|
|
44
58
|
return message.content.startsWith(CAPABILITY_BRIEF_PREFIX);
|
|
45
59
|
}
|
|
46
|
-
function resolveCapabilityBriefBudget(params) {
|
|
47
|
-
const { context } = params;
|
|
48
|
-
const messages = [
|
|
49
|
-
{ role: "system", content: context.instructions },
|
|
50
|
-
...(context.priorConversationMessages ?? []),
|
|
51
|
-
...context.historyMessages,
|
|
52
|
-
...(context.referenceMessages ?? []),
|
|
53
|
-
...(context.referenceParts?.flatMap((part) => part.messages) ?? []),
|
|
54
|
-
...(context.continuationMessages ?? []),
|
|
55
|
-
...(context.continuationParts?.flatMap((part) => part.messages) ?? []),
|
|
56
|
-
{
|
|
57
|
-
role: "user",
|
|
58
|
-
content: context.prompt,
|
|
59
|
-
...(context.attachments ? { attachments: context.attachments } : {}),
|
|
60
|
-
},
|
|
61
|
-
...(params.additionalBudgetMessages ?? []),
|
|
62
|
-
];
|
|
63
|
-
const { budget } = assessRequestMessagesBudget({
|
|
64
|
-
messages,
|
|
65
|
-
budget: context.budget,
|
|
66
|
-
...(context.format ? { format: context.format } : {}),
|
|
67
|
-
});
|
|
68
|
-
// Configured methodology is added later; reserve it for the 70% threshold
|
|
69
|
-
// as well as the input ceiling. Strictly below: admission triggers on >=.
|
|
70
|
-
const instructionReserve = context.budget.configuredInstructionReserveTokens ?? 0;
|
|
71
|
-
const compactionHeadroom = budget.compactionTriggerInputTokens -
|
|
72
|
-
1 -
|
|
73
|
-
budget.estimatedInputTokens -
|
|
74
|
-
instructionReserve;
|
|
75
|
-
const admissionHeadroom = budget.availableInputTokens - budget.estimatedInputTokens;
|
|
76
|
-
return Math.max(0, Math.min(CAPABILITY_BRIEF_MAX_TOKENS, compactionHeadroom, admissionHeadroom));
|
|
77
|
-
}
|
|
78
60
|
function hasCompleteCapabilityBriefEntries(entries, groups) {
|
|
79
61
|
if (entries === undefined)
|
|
80
62
|
return false;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Complete request-registry facts; neither a selected subset nor tool schemas. */
|
|
2
|
+
export function buildCapabilityDescriptions(entries) {
|
|
3
|
+
const ordered = [...entries].sort(compareCapabilityDescriptions);
|
|
4
|
+
return JSON.stringify(ordered.map(({ toolName, operationId, summary, catalogGroups }) => ({
|
|
5
|
+
toolName,
|
|
6
|
+
operationId,
|
|
7
|
+
summary,
|
|
8
|
+
catalogGroups: [...new Set(catalogGroups)].sort(compareAscii),
|
|
9
|
+
})));
|
|
10
|
+
}
|
|
11
|
+
function compareCapabilityDescriptions(left, right) {
|
|
12
|
+
const byOperation = compareAscii(left.operationId, right.operationId);
|
|
13
|
+
if (byOperation !== 0)
|
|
14
|
+
return byOperation;
|
|
15
|
+
return compareAscii(left.toolName, right.toolName);
|
|
16
|
+
}
|
|
17
|
+
function compareAscii(left, right) {
|
|
18
|
+
if (left < right)
|
|
19
|
+
return -1;
|
|
20
|
+
if (left > right)
|
|
21
|
+
return 1;
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadRuntimeCapabilityPlugins } from "./plugins/runtime-capability-plugins.js";
|
|
1
2
|
import { join } from "node:path";
|
|
2
3
|
import { buildContextBuckets, buildContextWindow } from "../sessions/index.js";
|
|
3
4
|
import { createModelGatewayClient, embedModelGateway, invokeModelGateway, invokeRawModelGateway, } from "../model-gateway/client.js";
|
|
@@ -9,7 +10,7 @@ import { createSourceWorkspaceProvider } from "./adapters/source-workspace-provi
|
|
|
9
10
|
import { createRuntimeEventBus } from "./events/runtime-emitter.js";
|
|
10
11
|
import { configureDebugLogger } from "./observability/debug-logger.js";
|
|
11
12
|
import { createConfiguredToolRegistry } from "./capabilities/configured-tool-registry.js";
|
|
12
|
-
import {
|
|
13
|
+
import { runtimePluginsToToolModules } from "./plugins/loader.js";
|
|
13
14
|
import { createSchedulingToolModule } from "./capabilities/scheduling/tool-module.js";
|
|
14
15
|
import { createFileLongTermMemoryRepository } from "./adapters/long-term-memory/file-repository.js";
|
|
15
16
|
import { createInMemoryLongTermMemoryRepository } from "./adapters/long-term-memory/in-memory-repository.js";
|
|
@@ -29,9 +30,7 @@ export function createDefaultConversationContextProvider() {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
export function createDefaultToolRegistry(config, scheduling) {
|
|
32
|
-
const plugins = config
|
|
33
|
-
? loadConfiguredRuntimePlugins(config)
|
|
34
|
-
: loadBundledRuntimePlugins();
|
|
33
|
+
const plugins = loadRuntimeCapabilityPlugins(config);
|
|
35
34
|
return createConfiguredToolRegistry(config, [
|
|
36
35
|
...runtimePluginsToToolModules(plugins),
|
|
37
36
|
...(config && scheduling
|
|
@@ -11,12 +11,30 @@ export declare function createLocalRuntimeApplication(config?: RuntimeConfig, op
|
|
|
11
11
|
sessions: import("./ports.js").SessionStore;
|
|
12
12
|
attachments: import("./index.js").RuntimeAttachmentStore;
|
|
13
13
|
scheduler: Omit<import("./scheduler/contracts.js").SchedulerService, "stop" | "start">;
|
|
14
|
+
projects: Readonly<{
|
|
15
|
+
list: () => Promise<readonly import("./projects/contracts.js").RuntimeProject[]>;
|
|
16
|
+
get: (id: string) => Promise<import("./projects/contracts.js").RuntimeProject | null>;
|
|
17
|
+
create: (input: {
|
|
18
|
+
name?: string;
|
|
19
|
+
directory: string;
|
|
20
|
+
}) => Promise<import("./projects/contracts.js").RuntimeProject>;
|
|
21
|
+
browseFolders: (input?: {
|
|
22
|
+
path?: string;
|
|
23
|
+
cursor?: string;
|
|
24
|
+
}) => Promise<import("./projects/contracts.js").ProjectFolderPage>;
|
|
25
|
+
createSession: (projectId: string) => Promise<{
|
|
26
|
+
sessionId: string;
|
|
27
|
+
project: import("../sessions/project-binding.js").SessionProject;
|
|
28
|
+
}>;
|
|
29
|
+
}>;
|
|
14
30
|
config: RuntimeConfig;
|
|
15
31
|
}>;
|
|
16
32
|
requests: RuntimeRequestHandler;
|
|
17
33
|
start: () => Promise<void>;
|
|
18
34
|
stop(): Promise<void>;
|
|
19
35
|
getOwnership: () => "owner" | "client" | undefined;
|
|
36
|
+
isOwnerIdle: () => boolean;
|
|
37
|
+
stopIfIdle(): Promise<boolean>;
|
|
20
38
|
subscribeScheduledEvents: (listener: (event: Record<string, unknown>) => void) => () => void;
|
|
21
39
|
}>;
|
|
22
40
|
export type LocalRuntimeApplication = ReturnType<typeof createLocalRuntimeApplication>;
|
|
@@ -76,6 +76,18 @@ export function createLocalRuntimeApplication(config = loadRuntimeConfig(), opti
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
getOwnership: () => connection?.ownership,
|
|
79
|
+
isOwnerIdle: () => !stopped && connection?.isOwnerIdle() === true,
|
|
80
|
+
stopIfIdle() {
|
|
81
|
+
if (stopped)
|
|
82
|
+
return Promise.resolve(false);
|
|
83
|
+
if (!connection?.isOwnerIdle())
|
|
84
|
+
return Promise.resolve(false);
|
|
85
|
+
// Do not await startup between checking admission and closing intake.
|
|
86
|
+
const closing = connection.closeIfIdle();
|
|
87
|
+
stopped = true;
|
|
88
|
+
client.close();
|
|
89
|
+
return closing;
|
|
90
|
+
},
|
|
79
91
|
subscribeScheduledEvents: client.subscribe.bind(client),
|
|
80
92
|
});
|
|
81
93
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { RuntimeEnvironmentServices } from "../composition.js";
|
|
2
2
|
export declare const LOCAL_SESSION_METHODS: readonly ["getOrCreateSession", "getAllSessions", "listSessions", "getSessionById", "getSessionSnapshot", "getRequestReplayById", "updateSessionTitle", "updateSessionRuntimeMode", "appendMessage", "appendContextEntry", "upsertArtifactPaths", "startRequestStream", "appendRequestEvent", "deleteSession", "deleteSessionWithStats", "resetSession", "clearSessionMessages", "deleteMessage", "deleteMessageWithStats", "compareAndSwapSessionMemoryCheckpoint"];
|
|
3
|
+
export declare const LOCAL_PROJECT_METHODS: readonly ["list", "get", "create", "browseFolders", "createSession"];
|
|
3
4
|
export declare const LOCAL_ATTACHMENT_METHODS: readonly ["saveAttachment", "validateAttachmentReferences", "resolveAttachment", "deleteAttachment", "deleteSessionAttachments"];
|
|
4
5
|
export declare const LOCAL_SCHEDULER_METHODS: readonly ["tick", "create", "list", "get", "update", "pause", "resume", "cancel", "runNow", "deleteSession", "listRuns"];
|
|
5
6
|
export declare function dispatchLocalServiceCall(services: RuntimeEnvironmentServices, method: string, args: readonly unknown[]): Promise<unknown>;
|
|
@@ -20,6 +20,13 @@ export const LOCAL_SESSION_METHODS = [
|
|
|
20
20
|
"deleteMessageWithStats",
|
|
21
21
|
"compareAndSwapSessionMemoryCheckpoint",
|
|
22
22
|
];
|
|
23
|
+
export const LOCAL_PROJECT_METHODS = [
|
|
24
|
+
"list",
|
|
25
|
+
"get",
|
|
26
|
+
"create",
|
|
27
|
+
"browseFolders",
|
|
28
|
+
"createSession",
|
|
29
|
+
];
|
|
23
30
|
export const LOCAL_ATTACHMENT_METHODS = [
|
|
24
31
|
"saveAttachment",
|
|
25
32
|
"validateAttachmentReferences",
|
|
@@ -56,6 +63,8 @@ export async function dispatchLocalServiceCall(services, method, args) {
|
|
|
56
63
|
throw new Error("local_runtime_method_unknown");
|
|
57
64
|
if (service === "sessions")
|
|
58
65
|
return selectServiceMethod(services.sessions, operation, LOCAL_SESSION_METHODS)(...args);
|
|
66
|
+
if (service === "projects")
|
|
67
|
+
return selectServiceMethod(services.projects, operation, LOCAL_PROJECT_METHODS)(...args);
|
|
59
68
|
if (service === "attachments")
|
|
60
69
|
return selectServiceMethod(services.attachments, operation, LOCAL_ATTACHMENT_METHODS)(...args);
|
|
61
70
|
if (service === "scheduler")
|
|
@@ -7,4 +7,20 @@ export declare function createLocalServiceClients(call: LocalRuntimeCallHandler)
|
|
|
7
7
|
sessions: SessionStore;
|
|
8
8
|
attachments: RuntimeAttachmentStore;
|
|
9
9
|
scheduler: Omit<SchedulerService, "stop" | "start">;
|
|
10
|
+
projects: Readonly<{
|
|
11
|
+
list: () => Promise<readonly import("../projects/contracts.js").RuntimeProject[]>;
|
|
12
|
+
get: (id: string) => Promise<import("../projects/contracts.js").RuntimeProject | null>;
|
|
13
|
+
create: (input: {
|
|
14
|
+
name?: string;
|
|
15
|
+
directory: string;
|
|
16
|
+
}) => Promise<import("../projects/contracts.js").RuntimeProject>;
|
|
17
|
+
browseFolders: (input?: {
|
|
18
|
+
path?: string;
|
|
19
|
+
cursor?: string;
|
|
20
|
+
}) => Promise<import("../projects/contracts.js").ProjectFolderPage>;
|
|
21
|
+
createSession: (projectId: string) => Promise<{
|
|
22
|
+
sessionId: string;
|
|
23
|
+
project: import("../../sessions/project-binding.js").SessionProject;
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
10
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { bindManagedSessionAttachmentDeletion } from "../session/session-attachment-deletion.js";
|
|
2
|
-
import { LOCAL_SESSION_METHODS, LOCAL_ATTACHMENT_METHODS, LOCAL_SCHEDULER_METHODS, } from "./app-service-dispatch.js";
|
|
2
|
+
import { LOCAL_SESSION_METHODS, LOCAL_PROJECT_METHODS, LOCAL_ATTACHMENT_METHODS, LOCAL_SCHEDULER_METHODS, } from "./app-service-dispatch.js";
|
|
3
3
|
/** Projections of owner APIs; lifecycle remains with the managed application. */
|
|
4
4
|
export function createLocalServiceClients(call) {
|
|
5
5
|
const service = (prefix, methods) => Object.fromEntries(methods.map((method) => [
|
|
@@ -10,5 +10,6 @@ export function createLocalServiceClients(call) {
|
|
|
10
10
|
const attachments = service("attachments", LOCAL_ATTACHMENT_METHODS);
|
|
11
11
|
const scheduler = service("scheduler", LOCAL_SCHEDULER_METHODS);
|
|
12
12
|
bindManagedSessionAttachmentDeletion(sessions, attachments);
|
|
13
|
-
|
|
13
|
+
const projects = service("projects", LOCAL_PROJECT_METHODS);
|
|
14
|
+
return { sessions, attachments, scheduler, projects };
|
|
14
15
|
}
|
|
@@ -20,6 +20,10 @@ export type LocalRuntimeConnection = Readonly<{
|
|
|
20
20
|
setClientHandler: (handler: LocalRuntimeCallHandler) => void;
|
|
21
21
|
onClose: (listener: () => void) => () => void;
|
|
22
22
|
close: () => Promise<void>;
|
|
23
|
+
/** Only the owning connection can synchronously observe its idle fence. */
|
|
24
|
+
isOwnerIdle: () => boolean;
|
|
25
|
+
/** Closes intake in the same turn as the idle check; clients never close owners. */
|
|
26
|
+
closeIfIdle: () => Promise<boolean>;
|
|
23
27
|
}>;
|
|
24
28
|
export type LocalRuntimeConnectionOptions = Readonly<{
|
|
25
29
|
directory: string;
|
|
@@ -31,20 +31,32 @@ export async function connectToRuntimeOwner(endpoint, deadline) {
|
|
|
31
31
|
authorization: `Bearer ${endpoint.token}`,
|
|
32
32
|
"x-abot-runtime-identity": localRuntimeIdentityHeader(endpoint.identity),
|
|
33
33
|
},
|
|
34
|
-
handshakeTimeout: Math.max(1, deadline - Date.now()),
|
|
35
34
|
maxPayload: 64 * 1024 * 1024,
|
|
36
35
|
perMessageDeflate: false,
|
|
37
36
|
});
|
|
38
37
|
const peer = new LocalRuntimeRpcPeer(socket);
|
|
38
|
+
const cleanupHandshake = () => {
|
|
39
|
+
clearTimeout(startupTimer);
|
|
40
|
+
socket.removeListener("error", failed);
|
|
41
|
+
socket.removeListener("open", opened);
|
|
42
|
+
};
|
|
39
43
|
const failed = (error) => {
|
|
40
|
-
|
|
44
|
+
cleanupHandshake();
|
|
41
45
|
reject(error);
|
|
46
|
+
peer.close();
|
|
42
47
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
const timedOut = () => failed(new Error("local_runtime_owner_start_timeout"));
|
|
49
|
+
const opened = () => {
|
|
50
|
+
if (hasRuntimeOwnerStartupDeadlineExpired(deadline)) {
|
|
51
|
+
timedOut();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
cleanupHandshake();
|
|
46
55
|
resolve(peer);
|
|
47
|
-
}
|
|
56
|
+
};
|
|
57
|
+
const startupTimer = setTimeout(timedOut, Math.max(1, deadline - Date.now()));
|
|
58
|
+
socket.once("error", failed);
|
|
59
|
+
socket.once("open", opened);
|
|
48
60
|
});
|
|
49
61
|
}
|
|
50
62
|
function assertRuntimeOwnerIdentity(endpoint, identity) {
|
|
@@ -52,9 +64,12 @@ function assertRuntimeOwnerIdentity(endpoint, identity) {
|
|
|
52
64
|
throw new Error("local_runtime_identity_mismatch");
|
|
53
65
|
}
|
|
54
66
|
function assertRuntimeOwnerStartupTimeRemaining(deadline) {
|
|
55
|
-
if (
|
|
67
|
+
if (hasRuntimeOwnerStartupDeadlineExpired(deadline))
|
|
56
68
|
throw new Error("local_runtime_owner_start_timeout");
|
|
57
69
|
}
|
|
70
|
+
function hasRuntimeOwnerStartupDeadlineExpired(deadline) {
|
|
71
|
+
return Date.now() >= deadline;
|
|
72
|
+
}
|
|
58
73
|
function isTransientRuntimeOwnerHandshakeFailure(error) {
|
|
59
74
|
if (!(error instanceof Error))
|
|
60
75
|
return false;
|
|
@@ -41,7 +41,7 @@ async function establishRuntimeOwner(options, release) {
|
|
|
41
41
|
await releaseRuntimeOwnerWhenIdle(owner, release);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
});
|
|
44
|
+
}, () => owner?.isIdle?.() === true);
|
|
45
45
|
}
|
|
46
46
|
catch (error) {
|
|
47
47
|
try {
|
|
@@ -58,10 +58,22 @@ async function establishRuntimeOwner(options, release) {
|
|
|
58
58
|
throw error;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function createConnection(peer, ownership, close) {
|
|
61
|
+
function createConnection(peer, ownership, close, isOwnerIdle = () => false) {
|
|
62
62
|
let shutdown;
|
|
63
63
|
return Object.freeze({
|
|
64
64
|
ownership,
|
|
65
|
+
isOwnerIdle: () => !shutdown && isOwnerIdle(),
|
|
66
|
+
closeIfIdle: () => {
|
|
67
|
+
if (ownership !== "owner")
|
|
68
|
+
return Promise.resolve(false);
|
|
69
|
+
if (shutdown)
|
|
70
|
+
return shutdown.then(() => true);
|
|
71
|
+
if (!isOwnerIdle())
|
|
72
|
+
return Promise.resolve(false);
|
|
73
|
+
// close() synchronously closes host intake before its first await.
|
|
74
|
+
shutdown = close();
|
|
75
|
+
return shutdown.then(() => true);
|
|
76
|
+
},
|
|
65
77
|
call: (method, args) => peer.call(method, args),
|
|
66
78
|
subscribe: (listener) => peer.subscribe(listener),
|
|
67
79
|
setClientHandler: (handler) => peer.setHandler(handler),
|
|
@@ -3,6 +3,7 @@ import { createRoleCapabilitySelectionFingerprint, normalizeRoleCapabilitySelect
|
|
|
3
3
|
import { isRoleCapabilitySelectionSupervisionState, } from "./capability-selection-supervision.js";
|
|
4
4
|
import { isValidRoleCapabilitySelectionSupervision } from "./capability-selection-supervision-validation.js";
|
|
5
5
|
import { validateRoleMemoryRecalls } from "./memory-recall-state-validation.js";
|
|
6
|
+
import { isValidAdoptedModelWorkPlan } from "./work-plan-validation.js";
|
|
6
7
|
import { isRoleOperationFingerprint, isRoleOperationOutcomeFingerprintForOutcome, isSameRoleOperationIdentity, replayRoleOperationSupervisionEvidence, } from "./operation-supervision.js";
|
|
7
8
|
import { isIssuedRoleOperationSupervisionInterventionForRequest } from "./operation-supervision-issuance.js";
|
|
8
9
|
import { isRoleOperationSupervisionSettlementHistoryValid, isRoleOperationSupervisionState, } from "./operation-supervision-state-validation.js";
|
|
@@ -134,7 +135,8 @@ export function validateRoleCallState(state, policy) {
|
|
|
134
135
|
(call.parentCallId === null
|
|
135
136
|
? call.objective !== null || call.dependencyResultRefs.length !== 0
|
|
136
137
|
: !isBoundedText(call.objective, policy.limits.maxObjectiveChars)) ||
|
|
137
|
-
!isValidCapabilitySelectionReconsideration(call, policy, state)
|
|
138
|
+
!isValidCapabilitySelectionReconsideration(call, policy, state) ||
|
|
139
|
+
!isValidAdoptedModelWorkPlan(state, call, policy)) {
|
|
138
140
|
issues.push(issue("invalid_role_call_frame", `state.calls.${call.callId}`));
|
|
139
141
|
continue;
|
|
140
142
|
}
|
|
@@ -408,7 +410,7 @@ function isExecutionPolicyAuthoritySnapshot(value) {
|
|
|
408
410
|
"rootContractId",
|
|
409
411
|
"availableSubordinateContractIds",
|
|
410
412
|
"capabilityAuthorities",
|
|
411
|
-
], ["terminalTextMode"]) ||
|
|
413
|
+
], ["terminalTextMode", "modelWorkPlanAuthority"]) ||
|
|
412
414
|
typeof value.id !== "string" ||
|
|
413
415
|
!/^[a-z][a-z0-9-]*$/.test(value.id) ||
|
|
414
416
|
!Number.isInteger(value.version) ||
|
|
@@ -418,6 +420,7 @@ function isExecutionPolicyAuthoritySnapshot(value) {
|
|
|
418
420
|
!isExecutionContractId(value.rootContractId) ||
|
|
419
421
|
!Array.isArray(value.availableSubordinateContractIds) ||
|
|
420
422
|
!Array.isArray(value.capabilityAuthorities) ||
|
|
423
|
+
(value.modelWorkPlanAuthority !== undefined && value.modelWorkPlanAuthority !== "root") ||
|
|
421
424
|
(value.terminalTextMode !== undefined &&
|
|
422
425
|
value.terminalTextMode !== "normalized" &&
|
|
423
426
|
value.terminalTextMode !== "exact")) {
|
|
@@ -6,6 +6,7 @@ import { isRoleCapabilityId, } from "./contracts.js";
|
|
|
6
6
|
import { parseRoleCallPlanBinding } from "./plan.js";
|
|
7
7
|
import { normalizeRoleCallResultReceipt } from "./result-receipt.js";
|
|
8
8
|
import { decodeMemoryRecallCommand } from "./memory-recall-decoder.js";
|
|
9
|
+
import { decodeModelWorkPlanCommand } from "./work-plan-validation.js";
|
|
9
10
|
import { parseRoleCallWorkerCapabilityScope } from "./worker-capability-scope.js";
|
|
10
11
|
import { isRoleCallWorkingDirectoryRoleId, normalizeEstablishedRoleCallWorkingDirectory, normalizeRoleCallWorkingDirectory, } from "./working-directory.js";
|
|
11
12
|
import { exactKeys, isRecord, isRoleCapabilityDeclaredEffect, isRoleCapabilityObservedEffect, isUniqueStringArray, parseCapabilityResultReferences, parseOptionalCapabilityAdapterResult, } from "./reducer-primitives.js";
|
|
@@ -14,6 +15,8 @@ export function decodeRoleCallCommand(input) {
|
|
|
14
15
|
return { ok: false, code: "invalid_command" };
|
|
15
16
|
}
|
|
16
17
|
switch (input.type) {
|
|
18
|
+
case "update_model_work_plan":
|
|
19
|
+
return decodeModelWorkPlanCommand(input);
|
|
17
20
|
case "begin_memory_recall":
|
|
18
21
|
case "settle_memory_recall":
|
|
19
22
|
return decodeMemoryRecallCommand(input);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RoleCallPolicy, RoleCallState, RoleCallTransitionResult } from "../contracts.js";
|
|
2
|
+
import type { UpdateModelWorkPlanCommand } from "../work-plan-contracts.js";
|
|
3
|
+
export declare function updateModelWorkPlan(state: RoleCallState, command: UpdateModelWorkPlanCommand, policy: RoleCallPolicy): RoleCallTransitionResult;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { updatesNameKnownItems } from "../work-plan-validation.js";
|
|
2
|
+
import { areModelWorkPlanDefinitionsEqual, resolveModelWorkPlanSourceDefinition, } from "../work-plan-source.js";
|
|
3
|
+
import { commit, reject } from "../reducer-primitives.js";
|
|
4
|
+
import { replaceCall } from "./call-frame-state.js";
|
|
5
|
+
export function updateModelWorkPlan(state, command, policy) {
|
|
6
|
+
if (policy.authority.modelWorkPlanAuthority !== "root")
|
|
7
|
+
return reject(state, "model_work_plan_update_invalid");
|
|
8
|
+
const call = state.calls.find((candidate) => candidate.callId === command.callId);
|
|
9
|
+
if (!call || call.callId !== state.rootCallId || call.parentCallId !== null)
|
|
10
|
+
return reject(state, "model_work_plan_update_invalid");
|
|
11
|
+
if (state.activeCallId !== call.callId || call.status !== "active")
|
|
12
|
+
return reject(state, "caller_not_active");
|
|
13
|
+
if (call.activationCount !== command.invocationAttempt)
|
|
14
|
+
return reject(state, "capability_invocation_mismatch");
|
|
15
|
+
const update = command.update;
|
|
16
|
+
const definition = resolveModelWorkPlanSourceDefinition(state, call, update.sourceResultRef, policy);
|
|
17
|
+
if (!definition)
|
|
18
|
+
return reject(state, "model_work_plan_update_invalid");
|
|
19
|
+
const previous = call.adoptedWorkPlan;
|
|
20
|
+
const isCurrentSource = previous?.sourceResultRef === update.sourceResultRef;
|
|
21
|
+
if (update.mode === "progress" && !isCurrentSource)
|
|
22
|
+
return reject(state, "model_work_plan_update_invalid");
|
|
23
|
+
if (update.mode === "adopt" &&
|
|
24
|
+
!areModelWorkPlanDefinitionsEqual(update.definition, definition))
|
|
25
|
+
return reject(state, "model_work_plan_update_invalid");
|
|
26
|
+
if (!updatesNameKnownItems(definition, update.itemUpdates))
|
|
27
|
+
return reject(state, "model_work_plan_update_invalid");
|
|
28
|
+
const statusById = new Map(isCurrentSource
|
|
29
|
+
? previous.itemStates.map((item) => [item.itemId, item.status])
|
|
30
|
+
: []);
|
|
31
|
+
for (const item of update.itemUpdates)
|
|
32
|
+
statusById.set(item.itemId, item.status);
|
|
33
|
+
const adoptedWorkPlan = {
|
|
34
|
+
sourceResultRef: update.sourceResultRef,
|
|
35
|
+
definition,
|
|
36
|
+
itemStates: definition.items.map((item) => ({
|
|
37
|
+
itemId: item.itemId,
|
|
38
|
+
status: statusById.get(item.itemId) ?? "pending",
|
|
39
|
+
})),
|
|
40
|
+
};
|
|
41
|
+
// A declaration consumes no extra activation and neither settles work nor resets supervision.
|
|
42
|
+
return commit({ ...state, calls: replaceCall(state.calls, { ...call, adoptedWorkPlan }) }, {
|
|
43
|
+
type: "model_work_plan_updated",
|
|
44
|
+
callId: call.callId,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { beginCapabilityBatch, settleCapabilityBatch, } from "./command-dispatch/capability-batch-transitions.js";
|
|
2
2
|
import { beginCapabilityExecution, settleCapabilityExecution, } from "./command-dispatch/capability-execution-transitions.js";
|
|
3
3
|
import { reconsiderCapabilitySelection } from "./command-dispatch/capability-selection-transition.js";
|
|
4
|
+
import { updateModelWorkPlan } from "./command-dispatch/work-plan-transition.js";
|
|
4
5
|
import { beginMemoryRecall, settleMemoryRecall } from "./command-dispatch/memory-recall-transitions.js";
|
|
5
6
|
import { establishWorkingDirectory, updateCapabilityScope, } from "./command-dispatch/call-scope-transitions.js";
|
|
6
7
|
import { openChild, returnChild, } from "./command-dispatch/child-transitions.js";
|
|
7
8
|
import { completeRootResponse, createRoot, } from "./command-dispatch/root-transitions.js";
|
|
8
9
|
export function dispatchRoleCallCommand(state, command, policy, admittedHeadRevision) {
|
|
9
10
|
switch (command.type) {
|
|
11
|
+
case "update_model_work_plan":
|
|
12
|
+
return updateModelWorkPlan(state, command, policy);
|
|
10
13
|
case "begin_memory_recall":
|
|
11
14
|
return beginMemoryRecall(state, command);
|
|
12
15
|
case "settle_memory_recall":
|