@abot-ai/runtime 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/scripts/add-runtime-model.js +4 -0
- package/dist/scripts/configure-long-term-memory.d.ts +6 -0
- package/dist/scripts/configure-long-term-memory.js +139 -0
- package/dist/scripts/init-runtime.js +11 -1
- package/dist/scripts/runtime-setup-files.d.ts +1 -0
- package/dist/scripts/runtime-setup-files.js +4 -0
- package/dist/src/capabilities/normal-invocation/contracts.d.ts +1 -0
- package/dist/src/capabilities/normal-invocation/validator.d.ts +5 -0
- package/dist/src/capabilities/normal-invocation/validator.js +35 -2
- package/dist/src/capabilities/tool-definition-validator/definition-fields.d.ts +7 -0
- package/dist/src/capabilities/tool-definition-validator/definition-fields.js +156 -0
- package/dist/src/capabilities/tool-definition-validator/definition-parser.d.ts +2 -0
- package/dist/src/capabilities/tool-definition-validator/definition-parser.js +76 -0
- package/dist/src/capabilities/tool-definition-validator/definition-shape.d.ts +7 -0
- package/dist/src/capabilities/tool-definition-validator/definition-shape.js +34 -0
- package/dist/src/capabilities/tool-definition-validator/event-presentation.d.ts +2 -0
- package/dist/src/capabilities/tool-definition-validator/event-presentation.js +97 -0
- package/dist/src/capabilities/tool-definition-validator/module-registry.d.ts +3 -0
- package/dist/src/capabilities/tool-definition-validator/module-registry.js +99 -0
- package/dist/src/capabilities/tool-definition-validator/payload-channel-spec.d.ts +2 -0
- package/dist/src/capabilities/tool-definition-validator/payload-channel-spec.js +190 -0
- package/dist/src/capabilities/tool-definition-validator/payload-channel-stage.d.ts +11 -0
- package/dist/src/capabilities/tool-definition-validator/payload-channel-stage.js +155 -0
- package/dist/src/capabilities/tool-definition-validator/payload-stage-conditions.d.ts +24 -0
- package/dist/src/capabilities/tool-definition-validator/payload-stage-conditions.js +193 -0
- package/dist/src/capabilities/tool-definition-validator.d.ts +2 -4
- package/dist/src/capabilities/tool-definition-validator.js +2 -776
- package/dist/src/cli/abot.js +11 -2
- package/dist/src/model-gateway/client/embeddings.d.ts +3 -0
- package/dist/src/model-gateway/client/embeddings.js +48 -0
- package/dist/src/model-gateway/client.d.ts +3 -1
- package/dist/src/model-gateway/client.js +5 -0
- package/dist/src/model-gateway/embeddings/constants.d.ts +1 -0
- package/dist/src/model-gateway/embeddings/constants.js +1 -0
- package/dist/src/model-gateway/embeddings/discovery.d.ts +10 -0
- package/dist/src/model-gateway/embeddings/discovery.js +39 -0
- package/dist/src/model-gateway/embeddings/execution.d.ts +16 -0
- package/dist/src/model-gateway/embeddings/execution.js +64 -0
- package/dist/src/model-gateway/embeddings/fingerprint.d.ts +3 -0
- package/dist/src/model-gateway/embeddings/fingerprint.js +36 -0
- package/dist/src/model-gateway/embeddings/profile.d.ts +11 -0
- package/dist/src/model-gateway/embeddings/profile.js +37 -0
- package/dist/src/model-gateway/embeddings/server-handler.d.ts +3 -0
- package/dist/src/model-gateway/embeddings/server-handler.js +89 -0
- package/dist/src/model-gateway/embeddings/validation.d.ts +7 -0
- package/dist/src/model-gateway/embeddings/validation.js +69 -0
- package/dist/src/model-gateway/index.d.ts +5 -3
- package/dist/src/model-gateway/index.js +3 -1
- package/dist/src/model-gateway/providers/contracts.d.ts +27 -1
- package/dist/src/model-gateway/providers/ollama/adapter.js +4 -0
- package/dist/src/model-gateway/providers/ollama/base-url.d.ts +1 -0
- package/dist/src/model-gateway/providers/ollama/base-url.js +4 -0
- package/dist/src/model-gateway/providers/ollama/embedding-models.d.ts +2 -0
- package/dist/src/model-gateway/providers/ollama/embedding-models.js +31 -0
- package/dist/src/model-gateway/providers/ollama/embeddings.d.ts +2 -0
- package/dist/src/model-gateway/providers/ollama/embeddings.js +43 -0
- package/dist/src/model-gateway/providers/ollama/request-diagnostics.js +2 -1
- package/dist/src/model-gateway/providers/openai/adapter.js +2 -0
- package/dist/src/model-gateway/providers/openai/embeddings.d.ts +2 -0
- package/dist/src/model-gateway/providers/openai/embeddings.js +87 -0
- package/dist/src/model-gateway/providers/openai/payload.js +5 -8
- package/dist/src/model-gateway/server/contracts.d.ts +5 -3
- package/dist/src/model-gateway/server/create-server.js +9 -0
- package/dist/src/model-gateway/server/errors.js +34 -0
- package/dist/src/model-gateway/server/index.d.ts +2 -0
- package/dist/src/model-gateway/server/index.js +2 -0
- package/dist/src/model-gateway/server/provider-fetch.d.ts +5 -3
- package/dist/src/model-gateway/server/provider-fetch.js +3 -1
- package/dist/src/model-gateway/server/request-body.d.ts +1 -1
- package/dist/src/model-gateway/types.d.ts +39 -0
- package/dist/src/plugin-contract/manifest.d.ts +1 -0
- package/dist/src/runtime/adapters/index.d.ts +4 -0
- package/dist/src/runtime/adapters/index.js +4 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/acquisition.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/acquisition.js +77 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/cleanup.d.ts +4 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/cleanup.js +52 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/contracts.d.ts +31 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/contracts.js +17 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/install.d.ts +1 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/install.js +36 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/owner-record.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/owner-record.js +114 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/snapshot.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock/snapshot.js +103 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-lock.js +10 -0
- package/dist/src/runtime/adapters/long-term-memory/file-repository.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/file-repository.js +57 -0
- package/dist/src/runtime/adapters/long-term-memory/in-memory-repository.d.ts +2 -0
- package/dist/src/runtime/adapters/long-term-memory/in-memory-repository.js +21 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-config-repository.d.ts +5 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-config-repository.js +60 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-service.d.ts +8 -0
- package/dist/src/runtime/adapters/long-term-memory/onboarding-service.js +34 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/run.d.ts +7 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/run.js +54 -25
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/executor.js +18 -4
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/payload/lifecycle.d.ts +6 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/payload/lifecycle.js +25 -12
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/action-fingerprint.d.ts +22 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/action-fingerprint.js +65 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/shared/contracts.d.ts +44 -0
- package/dist/src/runtime/adapters/registered-tool-normal-invocations.d.ts +1 -1
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/catalog.js +14 -4
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/execution.js +218 -87
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/failure-outcome-fingerprint.d.ts +7 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/failure-outcome-fingerprint.js +84 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-lifecycle.d.ts +5 -4
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-lifecycle.js +7 -1
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-observability.d.ts +35 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-observability.js +32 -0
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-rejection.d.ts +3 -3
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-rejection.js +13 -8
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-stages.d.ts +5 -4
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-stages.js +4 -2
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/result-observer.js +12 -4
- package/dist/src/runtime/composition.d.ts +3 -0
- package/dist/src/runtime/composition.js +5 -2
- package/dist/src/runtime/config/builders.js +34 -1
- package/dist/src/runtime/config/effective-model-config-validation.js +9 -0
- package/dist/src/runtime/config/embedding-profiles.d.ts +5 -0
- package/dist/src/runtime/config/embedding-profiles.js +66 -0
- package/dist/src/runtime/config/fields.js +22 -0
- package/dist/src/runtime/config/long-term-memory.d.ts +9 -0
- package/dist/src/runtime/config/long-term-memory.js +71 -0
- package/dist/src/runtime/config/runner/config-normalization.d.ts +16 -0
- package/dist/src/runtime/config/runner/config-normalization.js +109 -0
- package/dist/src/runtime/config/runner/loader.d.ts +1 -1
- package/dist/src/runtime/config/runner/loader.js +2 -69
- package/dist/src/runtime/config/runner/model-policy.js +3 -0
- package/dist/src/runtime/config/runner/schema-version.d.ts +14 -0
- package/dist/src/runtime/config/runner/schema-version.js +35 -0
- package/dist/src/runtime/config/runner/versioned-config.d.ts +2 -0
- package/dist/src/runtime/config/runner/versioned-config.js +51 -0
- package/dist/src/runtime/config/schema.js +36 -0
- package/dist/src/runtime/config/types.d.ts +1 -0
- package/dist/src/runtime/config/validation/environment-config-validation.d.ts +1 -0
- package/dist/src/runtime/config/validation/environment-config-validation.js +41 -0
- package/dist/src/runtime/config/validation/model-invocation-config-validation.d.ts +2 -0
- package/dist/src/runtime/config/validation/model-invocation-config-validation.js +64 -0
- package/dist/src/runtime/config/validation/model-invocation-override-validation.d.ts +2 -0
- package/dist/src/runtime/config/validation/model-invocation-override-validation.js +72 -0
- package/dist/src/runtime/config/validation/model-profile-validation.d.ts +4 -0
- package/dist/src/runtime/config/validation/model-profile-validation.js +87 -0
- package/dist/src/runtime/config/validation/model-registry-validation.d.ts +2 -0
- package/dist/src/runtime/config/validation/model-registry-validation.js +118 -0
- package/dist/src/runtime/config/validation/path-config-validation.d.ts +1 -0
- package/dist/src/runtime/config/validation/path-config-validation.js +7 -0
- package/dist/src/runtime/config/validation/runtime-config-field-validation.d.ts +12 -0
- package/dist/src/runtime/config/validation/runtime-config-field-validation.js +158 -0
- package/dist/src/runtime/config/validation/runtime-config-validation-contract.d.ts +9 -0
- package/dist/src/runtime/config/validation/runtime-config-validation-contract.js +13 -0
- package/dist/src/runtime/config/validation/runtime-root-section-validation.d.ts +6 -0
- package/dist/src/runtime/config/validation/runtime-root-section-validation.js +82 -0
- package/dist/src/runtime/config/validation/web-ui-config-validation.d.ts +3 -0
- package/dist/src/runtime/config/validation/web-ui-config-validation.js +26 -0
- package/dist/src/runtime/config/validation.d.ts +4 -15
- package/dist/src/runtime/config/validation.js +27 -499
- package/dist/src/runtime/config.js +3 -0
- package/dist/src/runtime/context/accepted-capability-action.d.ts +11 -0
- package/dist/src/runtime/context/accepted-capability-action.js +29 -0
- package/dist/src/runtime/context/model-step-compaction.js +6 -0
- package/dist/src/runtime/context/operation-supervision-evidence.d.ts +37 -0
- package/dist/src/runtime/context/operation-supervision-evidence.js +90 -0
- package/dist/src/runtime/context/request-tool-results.d.ts +3 -0
- package/dist/src/runtime/context/request-tool-results.js +11 -2
- package/dist/src/runtime/default-adapters.d.ts +3 -0
- package/dist/src/runtime/default-adapters.js +64 -3
- package/dist/src/runtime/index.d.ts +1 -0
- package/dist/src/runtime/index.js +1 -0
- package/dist/src/runtime/lifecycle/request-finalizer.d.ts +3 -0
- package/dist/src/runtime/lifecycle/request-finalizer.js +8 -0
- package/dist/src/runtime/long-term-memory/background-save-queue.d.ts +17 -0
- package/dist/src/runtime/long-term-memory/background-save-queue.js +66 -0
- package/dist/src/runtime/long-term-memory/candidate-persistence.d.ts +16 -0
- package/dist/src/runtime/long-term-memory/candidate-persistence.js +109 -0
- package/dist/src/runtime/long-term-memory/candidate-preparation.d.ts +8 -0
- package/dist/src/runtime/long-term-memory/candidate-preparation.js +36 -0
- package/dist/src/runtime/long-term-memory/candidate-processing.d.ts +9 -0
- package/dist/src/runtime/long-term-memory/candidate-processing.js +79 -0
- package/dist/src/runtime/long-term-memory/contracts.d.ts +108 -0
- package/dist/src/runtime/long-term-memory/contracts.js +1 -0
- package/dist/src/runtime/long-term-memory/diagnostics.d.ts +9 -0
- package/dist/src/runtime/long-term-memory/diagnostics.js +42 -0
- package/dist/src/runtime/long-term-memory/embedding-batches.d.ts +13 -0
- package/dist/src/runtime/long-term-memory/embedding-batches.js +87 -0
- package/dist/src/runtime/long-term-memory/events.d.ts +13 -0
- package/dist/src/runtime/long-term-memory/events.js +15 -0
- package/dist/src/runtime/long-term-memory/finalization.d.ts +8 -0
- package/dist/src/runtime/long-term-memory/finalization.js +24 -0
- package/dist/src/runtime/long-term-memory/index.d.ts +6 -0
- package/dist/src/runtime/long-term-memory/index.js +6 -0
- package/dist/src/runtime/long-term-memory/management/contracts.d.ts +54 -0
- package/dist/src/runtime/long-term-memory/management/contracts.js +1 -0
- package/dist/src/runtime/long-term-memory/management/errors.d.ts +10 -0
- package/dist/src/runtime/long-term-memory/management/errors.js +13 -0
- package/dist/src/runtime/long-term-memory/management/mutations.d.ts +17 -0
- package/dist/src/runtime/long-term-memory/management/mutations.js +178 -0
- package/dist/src/runtime/long-term-memory/management/queries.d.ts +8 -0
- package/dist/src/runtime/long-term-memory/management/queries.js +46 -0
- package/dist/src/runtime/long-term-memory/management/search.d.ts +7 -0
- package/dist/src/runtime/long-term-memory/management/search.js +18 -0
- package/dist/src/runtime/long-term-memory/management/service.d.ts +13 -0
- package/dist/src/runtime/long-term-memory/management/service.js +61 -0
- package/dist/src/runtime/long-term-memory/management/validation.d.ts +24 -0
- package/dist/src/runtime/long-term-memory/management/validation.js +77 -0
- package/dist/src/runtime/long-term-memory/onboarding/configuration.d.ts +14 -0
- package/dist/src/runtime/long-term-memory/onboarding/configuration.js +92 -0
- package/dist/src/runtime/long-term-memory/onboarding/contracts.d.ts +52 -0
- package/dist/src/runtime/long-term-memory/onboarding/contracts.js +1 -0
- package/dist/src/runtime/long-term-memory/onboarding/service.d.ts +21 -0
- package/dist/src/runtime/long-term-memory/onboarding/service.js +88 -0
- package/dist/src/runtime/long-term-memory/policies/normalization.d.ts +10 -0
- package/dist/src/runtime/long-term-memory/policies/normalization.js +45 -0
- package/dist/src/runtime/long-term-memory/policies/reconciliation.d.ts +20 -0
- package/dist/src/runtime/long-term-memory/policies/reconciliation.js +21 -0
- package/dist/src/runtime/long-term-memory/policies/scoring.d.ts +13 -0
- package/dist/src/runtime/long-term-memory/policies/scoring.js +55 -0
- package/dist/src/runtime/long-term-memory/policies/sensitive-data.d.ts +5 -0
- package/dist/src/runtime/long-term-memory/policies/sensitive-data.js +12 -0
- package/dist/src/runtime/long-term-memory/projection.d.ts +4 -0
- package/dist/src/runtime/long-term-memory/projection.js +39 -0
- package/dist/src/runtime/long-term-memory/ranked-search.d.ts +11 -0
- package/dist/src/runtime/long-term-memory/ranked-search.js +111 -0
- package/dist/src/runtime/long-term-memory/repository-state.d.ts +4 -0
- package/dist/src/runtime/long-term-memory/repository-state.js +131 -0
- package/dist/src/runtime/long-term-memory/response-context.d.ts +5 -0
- package/dist/src/runtime/long-term-memory/response-context.js +21 -0
- package/dist/src/runtime/long-term-memory/retrieval.d.ts +8 -0
- package/dist/src/runtime/long-term-memory/retrieval.js +73 -0
- package/dist/src/runtime/long-term-memory/service.d.ts +10 -0
- package/dist/src/runtime/long-term-memory/service.js +83 -0
- package/dist/src/runtime/orchestration/capability-adapters/index.d.ts +2 -0
- package/dist/src/runtime/orchestration/capability-adapters/index.js +2 -0
- package/dist/src/runtime/orchestration/final-response/authoring-contract.d.ts +10 -0
- package/dist/src/runtime/orchestration/final-response/authoring-contract.js +94 -0
- package/dist/src/runtime/orchestration/final-response/finalization.d.ts +1 -0
- package/dist/src/runtime/orchestration/final-response/finalization.js +1 -0
- package/dist/src/runtime/orchestration/final-response/format.d.ts +2 -0
- package/dist/src/runtime/orchestration/final-response/format.js +49 -0
- package/dist/src/runtime/orchestration/final-response/invoke.d.ts +16 -0
- package/dist/src/runtime/orchestration/final-response/invoke.js +24 -0
- package/dist/src/runtime/orchestration/role-calls/activation-budget.d.ts +14 -0
- package/dist/src/runtime/orchestration/role-calls/activation-budget.js +52 -0
- package/dist/src/runtime/orchestration/role-calls/candidate-validation.js +154 -0
- package/dist/src/runtime/orchestration/role-calls/capability-selection-reconsideration.js +1 -8
- package/dist/src/runtime/orchestration/role-calls/capability-selection-supervision-issuance.d.ts +17 -0
- package/dist/src/runtime/orchestration/role-calls/capability-selection-supervision-issuance.js +155 -0
- package/dist/src/runtime/orchestration/role-calls/capability-selection-supervision.d.ts +78 -0
- package/dist/src/runtime/orchestration/role-calls/capability-selection-supervision.js +339 -0
- package/dist/src/runtime/orchestration/role-calls/command-decoder.js +35 -10
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/active-capability-caller.d.ts +6 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/active-capability-caller.js +15 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/call-frame-state.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/call-frame-state.js +6 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/call-scope-transitions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/call-scope-transitions.js +86 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-batch-transitions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-batch-transitions.js +172 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-execution-state.d.ts +9 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-execution-state.js +28 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-execution-transitions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-execution-transitions.js +117 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-invocation.d.ts +4 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-invocation.js +16 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-selection-transition.d.ts +2 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-selection-transition.js +114 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-settlement.d.ts +6 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/capability-settlement.js +54 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/child-transitions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/child-transitions.js +206 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/operation-supervision-intervention.d.ts +13 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/operation-supervision-intervention.js +25 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/root-transitions.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/root-transitions.js +70 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch.d.ts +1 -1
- package/dist/src/runtime/orchestration/role-calls/command-dispatch.js +6 -580
- package/dist/src/runtime/orchestration/role-calls/contracts.d.ts +45 -5
- package/dist/src/runtime/orchestration/role-calls/contracts.js +2 -2
- package/dist/src/runtime/orchestration/role-calls/diagnostics.d.ts +4 -0
- package/dist/src/runtime/orchestration/role-calls/diagnostics.js +152 -1
- package/dist/src/runtime/orchestration/role-calls/index.d.ts +6 -0
- package/dist/src/runtime/orchestration/role-calls/index.js +6 -0
- package/dist/src/runtime/orchestration/role-calls/ledger.js +131 -7
- package/dist/src/runtime/orchestration/role-calls/operation-supervision-issuance.d.ts +11 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision-issuance.js +66 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision-projection.d.ts +16 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision-projection.js +52 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision-state-validation.d.ts +3 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision-state-validation.js +151 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision.d.ts +112 -0
- package/dist/src/runtime/orchestration/role-calls/operation-supervision.js +197 -0
- package/dist/src/runtime/orchestration/role-calls/reconsideration-cause.d.ts +26 -0
- package/dist/src/runtime/orchestration/role-calls/reconsideration-cause.js +127 -0
- package/dist/src/runtime/orchestration/role-calls/reducer-primitives.d.ts +1 -2
- package/dist/src/runtime/orchestration/role-calls/reducer-primitives.js +2 -12
- package/dist/src/runtime/orchestration/role-calls/reducer.js +19 -2
- package/dist/src/runtime/orchestration/role-calls/transactions.js +62 -5
- package/dist/src/runtime/orchestration/role-executors/activation/capability-continuation.d.ts +15 -0
- package/dist/src/runtime/orchestration/role-executors/activation/capability-continuation.js +73 -0
- package/dist/src/runtime/orchestration/role-executors/activation/loop.d.ts +0 -1
- package/dist/src/runtime/orchestration/role-executors/activation/loop.js +16 -54
- package/dist/src/runtime/orchestration/role-executors/activation/result-normalization.js +14 -0
- package/dist/src/runtime/orchestration/role-executors/activation/state-validation.d.ts +13 -1
- package/dist/src/runtime/orchestration/role-executors/activation/state-validation.js +137 -1
- package/dist/src/runtime/orchestration/role-executors/contracts.d.ts +7 -3
- package/dist/src/runtime/orchestration/role-executors/diagnostics.d.ts +2 -0
- package/dist/src/runtime/orchestration/role-executors/diagnostics.js +1 -6
- package/dist/src/runtime/orchestration/worker-capabilities/batch-selection.d.ts +10 -0
- package/dist/src/runtime/orchestration/worker-capabilities/batch-selection.js +8 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/adapter-catalog.d.ts +14 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/adapter-catalog.js +76 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/adapter-normalization.d.ts +10 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/adapter-normalization.js +160 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/binding-rejection.d.ts +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/binding-rejection.js +8 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/bound-capability-session.d.ts +24 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/bound-capability-session.js +100 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/call-authority.d.ts +29 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/call-authority.js +193 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/create-binding.d.ts +11 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/create-binding.js +109 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/dependency-results.d.ts +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/dependency-results.js +34 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/invocation-preparation.d.ts +21 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding/invocation-preparation.js +167 -0
- package/dist/src/runtime/orchestration/worker-capabilities/binding.d.ts +1 -13
- package/dist/src/runtime/orchestration/worker-capabilities/binding.js +1 -625
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.d.ts +57 -14
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.js +3 -1
- package/dist/src/runtime/orchestration/worker-capabilities/controls.d.ts +7 -0
- package/dist/src/runtime/orchestration/worker-capabilities/controls.js +50 -0
- package/dist/src/runtime/orchestration/worker-capabilities/error-fingerprint.d.ts +5 -0
- package/dist/src/runtime/orchestration/worker-capabilities/error-fingerprint.js +119 -0
- package/dist/src/runtime/orchestration/worker-capabilities/errors.d.ts +6 -0
- package/dist/src/runtime/orchestration/worker-capabilities/errors.js +11 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-exact-result.d.ts +7 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-exact-result.js +35 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-execution.d.ts +9 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-execution.js +28 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-result-normalization.d.ts +18 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-result-normalization.js +197 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-result-references.d.ts +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/adapter-result-references.js +44 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/context-projection.d.ts +12 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/context-projection.js +51 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/invocation-preparation.d.ts +25 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/invocation-preparation.js +111 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/ledger-transaction.d.ts +20 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/ledger-transaction.js +142 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution.d.ts +10 -14
- package/dist/src/runtime/orchestration/worker-capabilities/execution.js +84 -357
- package/dist/src/runtime/orchestration/worker-capabilities/index.d.ts +3 -0
- package/dist/src/runtime/orchestration/worker-capabilities/index.js +3 -0
- package/dist/src/runtime/orchestration/worker-capabilities/outcome-fingerprint.d.ts +8 -0
- package/dist/src/runtime/orchestration/worker-capabilities/outcome-fingerprint.js +21 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-author.js +31 -9
- package/dist/src/runtime/orchestration/worker-capabilities/payload-contracts.d.ts +15 -6
- package/dist/src/runtime/orchestration/worker-capabilities/payload-contracts.js +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-instructions.js +4 -4
- package/dist/src/runtime/orchestration/worker-capabilities/preparation-fingerprint.d.ts +23 -0
- package/dist/src/runtime/orchestration/worker-capabilities/preparation-fingerprint.js +109 -0
- package/dist/src/runtime/plugins/manifest-projection.js +3 -0
- package/dist/src/runtime/plugins/manifest-validator.js +20 -0
- package/dist/src/runtime/ports.d.ts +10 -1
- package/dist/src/runtime/request/contracts.d.ts +7 -0
- package/dist/src/runtime/request/dependencies.d.ts +1 -0
- package/dist/src/runtime/request/dependencies.js +10 -1
- package/dist/src/runtime/request/execution-agent-root-execution.js +5 -4
- package/dist/src/runtime/request/execution-facets.d.ts +2 -1
- package/dist/src/runtime/request/execution-facets.js +6 -0
- package/dist/src/runtime/request/execution-scope-surfaces.js +6 -0
- package/dist/src/runtime/request/execution-scope.d.ts +3 -2
- package/dist/src/runtime/request/handler.js +4 -1
- package/dist/src/runtime/request/result.d.ts +2 -0
- package/dist/src/runtime/request/root-contract.d.ts +4 -2
- package/dist/src/runtime/request/root-execution-kernel.js +100 -31
- package/dist/src/runtime/request/supervisor-root-execution.js +4 -2
- package/dist/src/runtime/request/worker-capability-payload-prompts.js +1 -1
- package/dist/src/runtime/steps/execution-agent/capability-invocation-contract.d.ts +24 -0
- package/dist/src/runtime/steps/execution-agent/capability-invocation-contract.js +52 -0
- package/dist/src/runtime/steps/execution-agent/contracts.d.ts +5 -2
- package/dist/src/runtime/steps/execution-agent/format.js +19 -6
- package/dist/src/runtime/steps/execution-agent/input.js +8 -12
- package/dist/src/runtime/steps/execution-agent/parser.js +25 -19
- package/dist/src/runtime/steps/execution-agent/prompt.js +3 -2
- package/dist/src/runtime/steps/execution-agent/reconsideration-context.d.ts +3 -0
- package/dist/src/runtime/steps/execution-agent/reconsideration-context.js +76 -0
- package/dist/src/runtime/steps/execution-agent/refinement-prompt.js +4 -4
- package/dist/src/runtime/steps/execution-agent/refinement-reconsideration.d.ts +3 -0
- package/dist/src/runtime/steps/execution-agent/refinement-reconsideration.js +25 -0
- package/dist/src/runtime/steps/execution-agent/refinement.d.ts +4 -7
- package/dist/src/runtime/steps/execution-agent/refinement.js +24 -35
- package/dist/src/runtime/steps/execution-agent/response-input.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/response-input.js +22 -6
- package/dist/src/runtime/steps/execution-agent/response-prompt.d.ts +1 -1
- package/dist/src/runtime/steps/execution-agent/response-prompt.js +8 -3
- package/dist/src/runtime/steps/execution-agent/response-run.d.ts +6 -0
- package/dist/src/runtime/steps/execution-agent/response-run.js +40 -10
- package/dist/src/runtime/steps/execution-agent/run.js +6 -6
- package/dist/src/runtime/steps/execution-agent/state-context.d.ts +4 -1
- package/dist/src/runtime/steps/execution-agent/state-context.js +40 -23
- package/dist/src/runtime/steps/supervisor-response/index.d.ts +1 -1
- package/dist/src/runtime/steps/supervisor-response/index.js +1 -1
- package/dist/src/runtime/steps/supervisor-response/input.d.ts +13 -5
- package/dist/src/runtime/steps/supervisor-response/input.js +27 -8
- package/dist/src/runtime/steps/supervisor-response/memory-authoring.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-response/memory-authoring.js +125 -0
- package/dist/src/runtime/steps/supervisor-response/prompt.d.ts +4 -0
- package/dist/src/runtime/steps/supervisor-response/prompt.js +19 -0
- package/dist/src/runtime/steps/supervisor-response/run.d.ts +8 -0
- package/dist/src/runtime/steps/supervisor-response/run.js +46 -17
- package/dist/src/runtime/steps/worker-decision/contracts.d.ts +8 -1
- package/dist/src/runtime/steps/worker-decision/contracts.js +3 -0
- package/dist/src/runtime/steps/worker-decision/format.d.ts +4 -0
- package/dist/src/runtime/steps/worker-decision/format.js +97 -22
- package/dist/src/runtime/steps/worker-decision/input/action-policy.d.ts +9 -0
- package/dist/src/runtime/steps/worker-decision/input/action-policy.js +15 -0
- package/dist/src/runtime/steps/worker-decision/input/canonical-state.d.ts +2 -2
- package/dist/src/runtime/steps/worker-decision/input/canonical-state.js +19 -7
- package/dist/src/runtime/steps/worker-decision/input/capability-selection.js +44 -3
- package/dist/src/runtime/steps/worker-decision/input/contract.d.ts +1 -0
- package/dist/src/runtime/steps/worker-decision/input/contract.js +12 -6
- package/dist/src/runtime/steps/worker-decision/input/diagnostic-projection.js +14 -5
- package/dist/src/runtime/steps/worker-decision/input/prompt-context.js +9 -6
- package/dist/src/runtime/steps/worker-decision/input/reference-context.js +21 -3
- package/dist/src/runtime/steps/worker-decision/input/session.js +2 -1
- package/dist/src/runtime/steps/worker-decision/input/types.d.ts +6 -1
- package/dist/src/runtime/steps/worker-decision/input.d.ts +2 -2
- package/dist/src/runtime/steps/worker-decision/input.js +1 -2
- package/dist/src/runtime/steps/worker-decision/parser/accepted-decision.d.ts +3 -0
- package/dist/src/runtime/steps/worker-decision/parser/accepted-decision.js +70 -0
- package/dist/src/runtime/steps/worker-decision/parser/action-validation.d.ts +4 -0
- package/dist/src/runtime/steps/worker-decision/parser/action-validation.js +55 -0
- package/dist/src/runtime/steps/worker-decision/parser/capability-batch-validation.d.ts +3 -0
- package/dist/src/runtime/steps/worker-decision/parser/capability-batch-validation.js +135 -0
- package/dist/src/runtime/steps/worker-decision/parser/capability-controls-validation.d.ts +6 -0
- package/dist/src/runtime/steps/worker-decision/parser/capability-controls-validation.js +132 -0
- package/dist/src/runtime/steps/worker-decision/parser/capability-invocation-validation.d.ts +4 -0
- package/dist/src/runtime/steps/worker-decision/parser/capability-invocation-validation.js +104 -0
- package/dist/src/runtime/steps/worker-decision/parser/decision-shape-validation.d.ts +4 -0
- package/dist/src/runtime/steps/worker-decision/parser/decision-shape-validation.js +28 -0
- package/dist/src/runtime/steps/worker-decision/parser/pending-capability-selection-validation.d.ts +4 -0
- package/dist/src/runtime/steps/worker-decision/parser/pending-capability-selection-validation.js +105 -0
- package/dist/src/runtime/steps/worker-decision/parser/validation-contract.d.ts +50 -0
- package/dist/src/runtime/steps/worker-decision/parser/validation-contract.js +19 -0
- package/dist/src/runtime/steps/worker-decision/parser.d.ts +5 -1
- package/dist/src/runtime/steps/worker-decision/parser.js +32 -426
- package/dist/src/runtime/steps/worker-decision/prompt.d.ts +3 -0
- package/dist/src/runtime/steps/worker-decision/prompt.js +57 -20
- package/dist/src/runtime/steps/worker-decision/result-author.js +11 -1
- package/dist/src/runtime/steps/worker-decision/run.js +97 -19
- package/dist/src/runtime/validation/strict-record.d.ts +2 -0
- package/dist/src/runtime/validation/strict-record.js +12 -0
- package/dist/src/shared/model-step-registry-data.json +9 -0
- package/dist/src/shared/model-step-registry.d.ts +9 -0
- package/dist/src/shared/model-step-registry.generated.d.ts +9 -0
- package/dist/src/shared/model-step-registry.generated.js +9 -0
- package/dist/src/web-ui/app/ARCHITECTURE.md +1 -1
- package/dist/src/web-ui/app/app.js +56 -11
- package/dist/src/web-ui/app/components/config-workspace/config-model.js +320 -0
- package/dist/src/web-ui/app/components/config-workspace/dashboard-rendering.js +155 -0
- package/dist/src/web-ui/app/components/config-workspace/field-rendering.js +278 -0
- package/dist/src/web-ui/app/components/config-workspace/model-rendering.js +251 -0
- package/dist/src/web-ui/app/components/config-workspace/step-rendering.js +145 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-events.js +271 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-mutations.js +195 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-persistence.js +247 -0
- package/dist/src/web-ui/app/components/config-workspace/workspace-view.js +299 -0
- package/dist/src/web-ui/app/components/config-workspace.js +179 -866
- package/dist/src/web-ui/app/components/conversation-activity.d.ts +7 -1
- package/dist/src/web-ui/app/components/long-term-memory/icons.js +16 -0
- package/dist/src/web-ui/app/components/long-term-memory/manager.js +192 -0
- package/dist/src/web-ui/app/components/long-term-memory/record-editor.d.ts +9 -0
- package/dist/src/web-ui/app/components/long-term-memory/record-editor.js +62 -0
- package/dist/src/web-ui/app/components/long-term-memory/record-list.d.ts +5 -0
- package/dist/src/web-ui/app/components/long-term-memory/record-list.js +97 -0
- package/dist/src/web-ui/app/components/long-term-memory/view-model.d.ts +29 -0
- package/dist/src/web-ui/app/components/long-term-memory/view-model.js +69 -0
- package/dist/src/web-ui/app/components/long-term-memory-setup.js +334 -0
- package/dist/src/web-ui/app/components/runtime-setup-guide.d.ts +39 -0
- package/dist/src/web-ui/app/components/tool-approval-card.d.ts +18 -0
- package/dist/src/web-ui/app/components/workspace-shell.js +48 -7
- package/dist/src/web-ui/app/controllers/app-event-bindings.js +43 -6
- package/dist/src/web-ui/app/controllers/composer-attachments-controller.d.ts +92 -0
- package/dist/src/web-ui/app/controllers/composer-queue-controller.d.ts +109 -0
- package/dist/src/web-ui/app/controllers/composer-submit-controller.d.ts +77 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.d.ts +149 -0
- package/dist/src/web-ui/app/controllers/conversation-session-controller.js +43 -3
- package/dist/src/web-ui/app/controllers/long-term-memory/controller.d.ts +87 -0
- package/dist/src/web-ui/app/controllers/long-term-memory/controller.js +302 -0
- package/dist/src/web-ui/app/controllers/long-term-memory/policy.d.ts +14 -0
- package/dist/src/web-ui/app/controllers/long-term-memory/policy.js +61 -0
- package/dist/src/web-ui/app/controllers/long-term-memory/state.js +85 -0
- package/dist/src/web-ui/app/controllers/operations-controller.d.ts +25 -0
- package/dist/src/web-ui/app/controllers/realtime-event-controller.d.ts +57 -0
- package/dist/src/web-ui/app/controllers/runtime-onboarding-controller.d.ts +32 -0
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.d.ts +177 -0
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.js +78 -11
- package/dist/src/web-ui/app/controllers/tool-approval-controller.d.ts +28 -0
- package/dist/src/web-ui/app/index.html +13 -15
- package/dist/src/web-ui/app/services/runtime-web-client/memory.js +127 -0
- package/dist/src/web-ui/app/services/runtime-web-client.d.ts +84 -0
- package/dist/src/web-ui/app/services/runtime-web-client.js +27 -1
- package/dist/src/web-ui/app/styles/30-inspector-config.css +151 -1423
- package/dist/src/web-ui/app/styles/35-memory-onboarding.css +153 -0
- package/dist/src/web-ui/app/styles/36-memory-management.css +419 -0
- package/dist/src/web-ui/app/styles/40-config-workspace.css +992 -0
- package/dist/src/web-ui/app/styles/90-responsive.css +187 -26
- package/dist/src/web-ui/app/styles.css +3 -0
- package/dist/src/web-ui/config-dashboard-backend.js +9 -1
- package/dist/src/web-ui/local-runtime/api-router.d.ts +4 -2
- package/dist/src/web-ui/local-runtime/api-router.js +33 -0
- package/dist/src/web-ui/local-runtime/contracts.d.ts +5 -0
- package/dist/src/web-ui/local-runtime/memory-management-input.d.ts +12 -0
- package/dist/src/web-ui/local-runtime/memory-management-input.js +68 -0
- package/dist/src/web-ui/local-runtime/memory-management-response.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/memory-management-response.js +47 -0
- package/dist/src/web-ui/local-runtime/memory-management-routes.d.ts +24 -0
- package/dist/src/web-ui/local-runtime/memory-management-routes.js +128 -0
- package/dist/src/web-ui/local-runtime/memory-onboarding-routes.d.ts +17 -0
- package/dist/src/web-ui/local-runtime/memory-onboarding-routes.js +81 -0
- package/dist/src/web-ui/local-runtime/request-abort.d.ts +7 -0
- package/dist/src/web-ui/local-runtime/request-abort.js +19 -0
- package/dist/src/web-ui/local-runtime-backend.js +10 -3
- package/dist/src/web-ui/server.d.ts +2 -0
- package/dist/src/web-ui/server.js +3 -0
- package/docs/configuration.md +128 -45
- package/docs/installation.md +21 -0
- package/docs/known-limitations.md +11 -0
- package/docs/long-term-memory.md +181 -0
- package/docs/publishing.md +52 -25
- package/docs/runtime-invariant-coverage.md +1 -1
- package/docs/runtime-library.md +16 -1
- package/docs/runtime-prompt-policy-contracts.md +12 -2
- package/docs/troubleshooting.md +21 -0
- package/examples/models/default.config.json +1 -0
- package/examples/request-runner.config.example.json +16 -22
- package/examples/runtime.config.example.json +4 -0
- package/methodologies/memory-informed-response.md +15 -0
- package/methodologies/response-ux.md +17 -0
- package/package.json +8 -2
- package/plugins/exec/source/handlers.ts +65 -5
- package/plugins/exec/src/index.cjs +39 -3
- package/plugins/filesystem/plugin.json +1 -0
- package/runtime.config.schema.json +30 -0
- package/src/runtime/README.md +77 -38
|
@@ -3,6 +3,8 @@ import { createConfigWorkspace } from "./components/config-workspace.js";
|
|
|
3
3
|
import { createComposerActions } from "./components/composer-actions.js";
|
|
4
4
|
import { createModelSelector } from "./components/model-selector.js";
|
|
5
5
|
import { createRuntimeSetupGuide } from "./components/runtime-setup-guide.js";
|
|
6
|
+
import { createLongTermMemorySetup } from "./components/long-term-memory-setup.js";
|
|
7
|
+
import { createLongTermMemoryManager } from "./components/long-term-memory/manager.js";
|
|
6
8
|
import { createSessionActionsMenu } from "./components/session-actions-menu.js";
|
|
7
9
|
import { createToolApprovalCard } from "./components/tool-approval-card.js";
|
|
8
10
|
import { textOf } from "./lib/text-format.js";
|
|
@@ -24,6 +26,7 @@ import { createConversationSessionController } from "./controllers/conversation-
|
|
|
24
26
|
import { createChatRequestController } from "./controllers/chat-request-controller.js";
|
|
25
27
|
import { createToolApprovalController } from "./controllers/tool-approval-controller.js";
|
|
26
28
|
import { createComposerSubmitController } from "./controllers/composer-submit-controller.js";
|
|
29
|
+
import { createLongTermMemoryController } from "./controllers/long-term-memory/controller.js";
|
|
27
30
|
|
|
28
31
|
const state = {
|
|
29
32
|
config: null,
|
|
@@ -123,10 +126,6 @@ const dom = {
|
|
|
123
126
|
refreshConfigButton: document.getElementById("refreshConfigButton"),
|
|
124
127
|
configStatus: document.getElementById("configStatus"),
|
|
125
128
|
configDashboard: document.getElementById("configDashboard"),
|
|
126
|
-
configRawFileSelect: document.getElementById("configRawFileSelect"),
|
|
127
|
-
configApplyRawButton: document.getElementById("configApplyRawButton"),
|
|
128
|
-
configSaveRawButton: document.getElementById("configSaveRawButton"),
|
|
129
|
-
configRawEditor: document.getElementById("configRawEditor"),
|
|
130
129
|
panelBackdrop: document.getElementById("panelBackdrop"),
|
|
131
130
|
toastRegion: document.getElementById("toastRegion"),
|
|
132
131
|
operationsTabButtons: [
|
|
@@ -146,6 +145,7 @@ let composerQueueController;
|
|
|
146
145
|
let composerSubmitController;
|
|
147
146
|
let realtimeEvents;
|
|
148
147
|
let conversationView;
|
|
148
|
+
let configWorkspace;
|
|
149
149
|
const operationsController = createOperationsController({
|
|
150
150
|
dom,
|
|
151
151
|
client: runtimeClient,
|
|
@@ -190,6 +190,11 @@ const steerController = createSteerController({
|
|
|
190
190
|
|
|
191
191
|
const shell = createWorkspaceShell({
|
|
192
192
|
dom,
|
|
193
|
+
beforeWorkspaceChange: ({ from, to }) => {
|
|
194
|
+
if (from !== "config" || to === "config") return true;
|
|
195
|
+
if (!configWorkspace) return true;
|
|
196
|
+
return configWorkspace.prepareDiscardChanges("leave configuration");
|
|
197
|
+
},
|
|
193
198
|
});
|
|
194
199
|
const runtimeSetupGuide = createRuntimeSetupGuide({
|
|
195
200
|
container: dom.runtimeSetupGuide,
|
|
@@ -422,6 +427,7 @@ const appEventBindings = createAppEventBindings({
|
|
|
422
427
|
saveSessionId: saveSessionIdForEnvironment,
|
|
423
428
|
selectedEnvironmentId,
|
|
424
429
|
rememberModelSelection: rememberCurrentModelSelection,
|
|
430
|
+
invalidateSessionLoads: conversationSession.invalidateEnvironmentLoads,
|
|
425
431
|
clearAttachments: clearPendingAttachments,
|
|
426
432
|
resetLiveRequestView: conversationSession.resetLiveRequestView,
|
|
427
433
|
setCurrentSessionTitle,
|
|
@@ -429,10 +435,13 @@ const appEventBindings = createAppEventBindings({
|
|
|
429
435
|
subscribeSession,
|
|
430
436
|
renderMessages,
|
|
431
437
|
renderAgentPicker,
|
|
438
|
+
savedEnvironmentId,
|
|
439
|
+
beforeEnvironmentChange: () =>
|
|
440
|
+
configWorkspace.prepareDiscardChanges("change environment"),
|
|
432
441
|
saveEnvironmentId,
|
|
433
442
|
loadModels,
|
|
434
443
|
loadAgentMode,
|
|
435
|
-
loadRuntimeConfig: () => loadRuntimeConfig(),
|
|
444
|
+
loadRuntimeConfig: (options) => loadRuntimeConfig(options),
|
|
436
445
|
restoreLastSession,
|
|
437
446
|
configuredEnvironmentOptions,
|
|
438
447
|
removeUnsupportedImages: removeUnsupportedPendingImages,
|
|
@@ -449,15 +458,46 @@ const appEventBindings = createAppEventBindings({
|
|
|
449
458
|
},
|
|
450
459
|
});
|
|
451
460
|
|
|
452
|
-
const
|
|
461
|
+
const longTermMemorySetup = createLongTermMemorySetup({
|
|
462
|
+
getEnvironmentId: selectedEnvironmentId,
|
|
463
|
+
loadStatus: (environmentId) =>
|
|
464
|
+
runtimeClient.loadLongTermMemoryStatus(environmentId),
|
|
465
|
+
discoverModels: (providerId, environmentId) =>
|
|
466
|
+
runtimeClient.discoverLongTermMemoryModels({
|
|
467
|
+
environmentId,
|
|
468
|
+
providerId,
|
|
469
|
+
}),
|
|
470
|
+
enableMemory: (input, environmentId) =>
|
|
471
|
+
runtimeClient.enableLongTermMemory({
|
|
472
|
+
environmentId,
|
|
473
|
+
...input,
|
|
474
|
+
}),
|
|
475
|
+
disableMemory: (environmentId) =>
|
|
476
|
+
runtimeClient.disableLongTermMemory(environmentId),
|
|
477
|
+
recordControlEvent,
|
|
478
|
+
beginRuntimeMutation: () =>
|
|
479
|
+
configWorkspace?.beginExternalRuntimeMutation() ?? false,
|
|
480
|
+
refreshRuntimeConfig: () =>
|
|
481
|
+
configWorkspace?.refreshAfterExternalRuntimeMutation() ??
|
|
482
|
+
Promise.resolve(false),
|
|
483
|
+
endRuntimeMutation: () => configWorkspace?.endExternalRuntimeMutation(),
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
let longTermMemoryManager;
|
|
487
|
+
const longTermMemoryController = createLongTermMemoryController({
|
|
488
|
+
client: runtimeClient,
|
|
489
|
+
getEnvironmentId: selectedEnvironmentId,
|
|
490
|
+
render: (snapshot) => longTermMemoryManager?.render(snapshot),
|
|
491
|
+
});
|
|
492
|
+
longTermMemoryManager = createLongTermMemoryManager({
|
|
493
|
+
actions: longTermMemoryController,
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
configWorkspace = createConfigWorkspace({
|
|
453
497
|
dom: {
|
|
454
498
|
refreshConfigButton: dom.refreshConfigButton,
|
|
455
499
|
configStatus: dom.configStatus,
|
|
456
500
|
configDashboard: dom.configDashboard,
|
|
457
|
-
configRawFileSelect: dom.configRawFileSelect,
|
|
458
|
-
configApplyRawButton: dom.configApplyRawButton,
|
|
459
|
-
configSaveRawButton: dom.configSaveRawButton,
|
|
460
|
-
configRawEditor: dom.configRawEditor,
|
|
461
501
|
},
|
|
462
502
|
loadDashboard: () =>
|
|
463
503
|
runtimeClient.loadConfigDashboard(selectedEnvironmentId()),
|
|
@@ -468,10 +508,15 @@ const configWorkspace = createConfigWorkspace({
|
|
|
468
508
|
id,
|
|
469
509
|
config,
|
|
470
510
|
}),
|
|
511
|
+
memorySetup: longTermMemorySetup,
|
|
512
|
+
memoryManagement: {
|
|
513
|
+
load: () => longTermMemoryController.load(),
|
|
514
|
+
mount: (root) => longTermMemoryManager.mount(root),
|
|
515
|
+
},
|
|
471
516
|
recordControlEvent,
|
|
472
517
|
});
|
|
473
518
|
|
|
474
|
-
const loadRuntimeConfig = () => configWorkspace.load();
|
|
519
|
+
const loadRuntimeConfig = (options) => configWorkspace.load(options);
|
|
475
520
|
|
|
476
521
|
function setConnectionLabel(text, isError = false) {
|
|
477
522
|
dom.connectionLabel.textContent = text;
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { textOf } from "../../lib/text-format.js";
|
|
2
|
+
|
|
3
|
+
export const CONFIG_CATEGORIES = ["memory", "pipeline", "models", "advanced"];
|
|
4
|
+
|
|
5
|
+
const DEFAULT_MODEL_EXECUTION_POLICY = "supervisor-worker-v1";
|
|
6
|
+
|
|
7
|
+
export const MODEL_EXECUTION_ROUTES = Object.freeze({
|
|
8
|
+
"supervisor-worker-v1": Object.freeze({
|
|
9
|
+
label: "Supervisor",
|
|
10
|
+
description:
|
|
11
|
+
"Coordinates the request and may answer directly or delegate planning, execution, and review to specialist roles. Tools run through a Worker.",
|
|
12
|
+
}),
|
|
13
|
+
"execution-agent-v1": Object.freeze({
|
|
14
|
+
label: "Execution Agent",
|
|
15
|
+
description:
|
|
16
|
+
"Handles the request end to end and can run tools directly. It may consult a Planner or Auditor while remaining responsible for execution and the final response.",
|
|
17
|
+
}),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export function isConfigObject(value) {
|
|
21
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function cloneConfig(value) {
|
|
25
|
+
return JSON.parse(JSON.stringify(isConfigObject(value) ? value : {}));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function normalizeConfigForComparison(value) {
|
|
29
|
+
if (Array.isArray(value)) {
|
|
30
|
+
return value.map(normalizeConfigForComparison);
|
|
31
|
+
}
|
|
32
|
+
if (value && typeof value === "object") {
|
|
33
|
+
return Object.fromEntries(
|
|
34
|
+
Object.keys(value)
|
|
35
|
+
.sort((left, right) => left.localeCompare(right))
|
|
36
|
+
.map((key) => [key, normalizeConfigForComparison(value[key])]),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function configValuesEqual(left, right) {
|
|
43
|
+
return (
|
|
44
|
+
JSON.stringify(normalizeConfigForComparison(left)) ===
|
|
45
|
+
JSON.stringify(normalizeConfigForComparison(right))
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function rawConfigDraftHasChanges(draft, config) {
|
|
50
|
+
try {
|
|
51
|
+
const parsed = JSON.parse(textOf(draft));
|
|
52
|
+
return !isConfigObject(parsed) || !configValuesEqual(parsed, config);
|
|
53
|
+
} catch {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function runtimeConfigGraphChanged(baseline, nextConfig) {
|
|
59
|
+
return !configValuesEqual(
|
|
60
|
+
{
|
|
61
|
+
models: baseline?.models,
|
|
62
|
+
requestRunner: baseline?.requestRunner,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
models: nextConfig?.models,
|
|
66
|
+
requestRunner: nextConfig?.requestRunner,
|
|
67
|
+
},
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function configDeclaresModelContextWindow(config) {
|
|
72
|
+
return (
|
|
73
|
+
isConfigObject(config) &&
|
|
74
|
+
Object.prototype.hasOwnProperty.call(config, "contextWindowTokens")
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function modelContextWindowIsPositiveSafeInteger(value) {
|
|
79
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function modelContextWindowValidationError(config) {
|
|
83
|
+
if (!configDeclaresModelContextWindow(config)) return "";
|
|
84
|
+
return modelContextWindowIsPositiveSafeInteger(config.contextWindowTokens)
|
|
85
|
+
? ""
|
|
86
|
+
: "Context window must be a positive integer within the safe numeric range before this model can be saved.";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function resolveModelExecutionRoute(policy) {
|
|
90
|
+
const configuredPolicy = textOf(policy).trim();
|
|
91
|
+
const resolvedPolicy = configuredPolicy || DEFAULT_MODEL_EXECUTION_POLICY;
|
|
92
|
+
const route = MODEL_EXECUTION_ROUTES[resolvedPolicy];
|
|
93
|
+
return {
|
|
94
|
+
policy: resolvedPolicy,
|
|
95
|
+
label: route?.label || "Unsupported route",
|
|
96
|
+
description:
|
|
97
|
+
route?.description ||
|
|
98
|
+
`${resolvedPolicy} is not supported by this Runtime. Choose a supported route before saving.`,
|
|
99
|
+
implicit: configuredPolicy.length === 0,
|
|
100
|
+
supported: Boolean(route),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function executionPolicyValueForConfig(selectedPolicy, baselinePolicy) {
|
|
105
|
+
const policy = resolveModelExecutionRoute(selectedPolicy).policy;
|
|
106
|
+
const baselineUsesImplicitDefault =
|
|
107
|
+
textOf(baselinePolicy).trim().length === 0;
|
|
108
|
+
return policy === DEFAULT_MODEL_EXECUTION_POLICY &&
|
|
109
|
+
baselineUsesImplicitDefault
|
|
110
|
+
? undefined
|
|
111
|
+
: policy;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function formattedConfig(config) {
|
|
115
|
+
return JSON.stringify(isConfigObject(config) ? config : {}, null, 2);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function createConfigWorkspaceModel() {
|
|
119
|
+
const state = {
|
|
120
|
+
configDashboard: null,
|
|
121
|
+
baselinesByKey: new Map(),
|
|
122
|
+
rawDraftsByKey: new Map(),
|
|
123
|
+
savingKeys: new Set(),
|
|
124
|
+
savedKeys: new Set(),
|
|
125
|
+
expandedCalibrationKeys: new Set(),
|
|
126
|
+
selectedConfigModelId: "",
|
|
127
|
+
selectedRawConfigKey: "",
|
|
128
|
+
activeCategory: "memory",
|
|
129
|
+
rawPanelOpen: false,
|
|
130
|
+
loadGeneration: 0,
|
|
131
|
+
loading: false,
|
|
132
|
+
canonicalRefreshInFlight: false,
|
|
133
|
+
externalRuntimeMutationInFlight: false,
|
|
134
|
+
bound: false,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
function configFileKey(file) {
|
|
138
|
+
return `${textOf(file?.kind)}:${textOf(file?.id)}`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function configFileEntries() {
|
|
142
|
+
const files = state.configDashboard?.files;
|
|
143
|
+
if (!files) return [];
|
|
144
|
+
return [
|
|
145
|
+
files.runtime,
|
|
146
|
+
files.requestRunner,
|
|
147
|
+
...(Array.isArray(files.models) ? files.models : []),
|
|
148
|
+
].filter(Boolean);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function configFileMatchesIdentity(file, kind, id) {
|
|
152
|
+
return file.kind === kind && (!id || file.id === id);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function findConfigFile(kind, id = "") {
|
|
156
|
+
return configFileEntries().find((file) =>
|
|
157
|
+
configFileMatchesIdentity(file, kind, id),
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function findConfigFileByKey(key) {
|
|
162
|
+
return configFileEntries().find((file) => configFileKey(file) === key);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function captureBaselines() {
|
|
166
|
+
state.baselinesByKey.clear();
|
|
167
|
+
state.rawDraftsByKey.clear();
|
|
168
|
+
state.savedKeys.clear();
|
|
169
|
+
for (const file of configFileEntries()) {
|
|
170
|
+
const key = configFileKey(file);
|
|
171
|
+
state.baselinesByKey.set(key, cloneConfig(file.config));
|
|
172
|
+
state.rawDraftsByKey.set(key, formattedConfig(file.config));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function baselineFor(file) {
|
|
177
|
+
return state.baselinesByKey.get(configFileKey(file));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function isFileDirty(file) {
|
|
181
|
+
const baseline = baselineFor(file);
|
|
182
|
+
return baseline ? !configValuesEqual(file.config, baseline) : false;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function rawDraftFor(file) {
|
|
186
|
+
const key = configFileKey(file);
|
|
187
|
+
return state.rawDraftsByKey.has(key)
|
|
188
|
+
? state.rawDraftsByKey.get(key)
|
|
189
|
+
: formattedConfig(file.config);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function hasRawDraftChanges(file) {
|
|
193
|
+
return rawConfigDraftHasChanges(rawDraftFor(file), file.config);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function hasPendingFileChanges(file) {
|
|
197
|
+
return isFileDirty(file) || hasRawDraftChanges(file);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function dirtyFiles() {
|
|
201
|
+
return configFileEntries().filter(hasPendingFileChanges);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function hasUnsavedChanges() {
|
|
205
|
+
return dirtyFiles().length > 0;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function dashboardIsBusy() {
|
|
209
|
+
return (
|
|
210
|
+
state.loading ||
|
|
211
|
+
state.canonicalRefreshInFlight ||
|
|
212
|
+
state.externalRuntimeMutationInFlight
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function getConfigPathValue(config, path) {
|
|
217
|
+
let current = config;
|
|
218
|
+
for (const key of path) {
|
|
219
|
+
if (!current || typeof current !== "object") return undefined;
|
|
220
|
+
current = current[key];
|
|
221
|
+
}
|
|
222
|
+
return current;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function setConfigPathValue(config, path, value) {
|
|
226
|
+
let current = config;
|
|
227
|
+
for (let index = 0; index < path.length - 1; index += 1) {
|
|
228
|
+
const key = path[index];
|
|
229
|
+
if (!current[key] || typeof current[key] !== "object") {
|
|
230
|
+
current[key] = {};
|
|
231
|
+
}
|
|
232
|
+
current = current[key];
|
|
233
|
+
}
|
|
234
|
+
current[path[path.length - 1]] = value;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function deleteConfigPathValue(config, path) {
|
|
238
|
+
let current = config;
|
|
239
|
+
for (let index = 0; index < path.length - 1; index += 1) {
|
|
240
|
+
const key = path[index];
|
|
241
|
+
if (!current?.[key] || typeof current[key] !== "object") return;
|
|
242
|
+
current = current[key];
|
|
243
|
+
}
|
|
244
|
+
delete current[path[path.length - 1]];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function pruneEmptyExecutionConfig(config) {
|
|
248
|
+
if (
|
|
249
|
+
isConfigObject(config.execution) &&
|
|
250
|
+
Object.keys(config.execution).length === 0
|
|
251
|
+
) {
|
|
252
|
+
delete config.execution;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function parseConfigPath(value) {
|
|
257
|
+
try {
|
|
258
|
+
const parsed = JSON.parse(textOf(value));
|
|
259
|
+
return Array.isArray(parsed) ? parsed.map(textOf) : [];
|
|
260
|
+
} catch {
|
|
261
|
+
return [];
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function parseNumericConfigInputValue(input) {
|
|
266
|
+
if (input.value.trim() === "") return undefined;
|
|
267
|
+
const value = Number(input.value);
|
|
268
|
+
return Number.isFinite(value) ? value : undefined;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function parseConfigInputValue(input, file, path) {
|
|
272
|
+
const type = input.dataset.valueType || "string";
|
|
273
|
+
if (type === "boolean") return input.checked;
|
|
274
|
+
if (type === "number") return parseNumericConfigInputValue(input);
|
|
275
|
+
if (type === "execution-policy") {
|
|
276
|
+
return executionPolicyValueForConfig(
|
|
277
|
+
input.value,
|
|
278
|
+
getConfigPathValue(baselineFor(file), path),
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
return input.value;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function ensureRawSelection(files = configFileEntries()) {
|
|
285
|
+
if (
|
|
286
|
+
!files.some((file) => configFileKey(file) === state.selectedRawConfigKey)
|
|
287
|
+
) {
|
|
288
|
+
state.selectedRawConfigKey = files[0] ? configFileKey(files[0]) : "";
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function selectedRawConfigFile() {
|
|
293
|
+
return findConfigFileByKey(state.selectedRawConfigKey);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return {
|
|
297
|
+
state,
|
|
298
|
+
baselineFor,
|
|
299
|
+
captureBaselines,
|
|
300
|
+
configFileEntries,
|
|
301
|
+
configFileKey,
|
|
302
|
+
dashboardIsBusy,
|
|
303
|
+
deleteConfigPathValue,
|
|
304
|
+
dirtyFiles,
|
|
305
|
+
ensureRawSelection,
|
|
306
|
+
findConfigFile,
|
|
307
|
+
findConfigFileByKey,
|
|
308
|
+
getConfigPathValue,
|
|
309
|
+
hasPendingFileChanges,
|
|
310
|
+
hasRawDraftChanges,
|
|
311
|
+
hasUnsavedChanges,
|
|
312
|
+
isFileDirty,
|
|
313
|
+
parseConfigInputValue,
|
|
314
|
+
parseConfigPath,
|
|
315
|
+
pruneEmptyExecutionConfig,
|
|
316
|
+
rawDraftFor,
|
|
317
|
+
selectedRawConfigFile,
|
|
318
|
+
setConfigPathValue,
|
|
319
|
+
};
|
|
320
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { escapeAttribute, escapeHtml } from "../../lib/text-format.js";
|
|
2
|
+
|
|
3
|
+
export function createConfigDashboardRendering({
|
|
4
|
+
state,
|
|
5
|
+
configFileEntries,
|
|
6
|
+
configFileKey,
|
|
7
|
+
ensureRawSelection,
|
|
8
|
+
fileStatusText,
|
|
9
|
+
hasRawDraftChanges,
|
|
10
|
+
isFileDirty,
|
|
11
|
+
rawDraftFor,
|
|
12
|
+
selectedRawConfigFile,
|
|
13
|
+
}) {
|
|
14
|
+
function rawConfigStatusText(file, rawDraftIsDirty) {
|
|
15
|
+
if (!file) return "No config files";
|
|
16
|
+
if (rawDraftIsDirty) return "Draft not applied";
|
|
17
|
+
return fileStatusText(file);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function renderRawConfigPanel() {
|
|
21
|
+
const files = configFileEntries();
|
|
22
|
+
ensureRawSelection(files);
|
|
23
|
+
const file = selectedRawConfigFile();
|
|
24
|
+
const rawDirty = file ? hasRawDraftChanges(file) : false;
|
|
25
|
+
const fileDirty = file ? isFileDirty(file) : false;
|
|
26
|
+
const pending = rawDirty || fileDirty;
|
|
27
|
+
const saving = file ? state.savingKeys.has(configFileKey(file)) : false;
|
|
28
|
+
const status = rawConfigStatusText(file, rawDirty);
|
|
29
|
+
return `
|
|
30
|
+
<details
|
|
31
|
+
id="configRawPanel"
|
|
32
|
+
class="config-raw-panel"
|
|
33
|
+
${state.rawPanelOpen ? "open" : ""}
|
|
34
|
+
>
|
|
35
|
+
<summary>Raw JSON</summary>
|
|
36
|
+
<div class="config-raw-toolbar">
|
|
37
|
+
<label class="config-raw-file-select">
|
|
38
|
+
<span>Config file</span>
|
|
39
|
+
<select id="configRawFileSelect" title="Config file" ${
|
|
40
|
+
file ? "" : "disabled"
|
|
41
|
+
}>
|
|
42
|
+
${files
|
|
43
|
+
.map(
|
|
44
|
+
(item) =>
|
|
45
|
+
`<option value="${escapeAttribute(configFileKey(item))}" ${
|
|
46
|
+
configFileKey(item) === state.selectedRawConfigKey
|
|
47
|
+
? "selected"
|
|
48
|
+
: ""
|
|
49
|
+
}>${escapeHtml(item.label)}</option>`,
|
|
50
|
+
)
|
|
51
|
+
.join("")}
|
|
52
|
+
</select>
|
|
53
|
+
</label>
|
|
54
|
+
<span
|
|
55
|
+
class="config-raw-status ${pending ? "dirty" : ""}"
|
|
56
|
+
role="status"
|
|
57
|
+
aria-live="polite"
|
|
58
|
+
>${escapeHtml(status)}</span>
|
|
59
|
+
<div class="config-file-actions">
|
|
60
|
+
<button
|
|
61
|
+
id="configApplyRawButton"
|
|
62
|
+
type="button"
|
|
63
|
+
data-config-action="apply-raw"
|
|
64
|
+
${rawDirty && !saving ? "" : "disabled"}
|
|
65
|
+
>Apply draft</button>
|
|
66
|
+
<button
|
|
67
|
+
type="button"
|
|
68
|
+
data-config-action="reset-file"
|
|
69
|
+
data-kind="${escapeAttribute(file?.kind || "")}"
|
|
70
|
+
data-id="${escapeAttribute(file?.id || "")}"
|
|
71
|
+
${pending && !saving ? "" : "disabled"}
|
|
72
|
+
>Reset</button>
|
|
73
|
+
<button
|
|
74
|
+
id="configSaveRawButton"
|
|
75
|
+
type="button"
|
|
76
|
+
data-config-action="save-raw"
|
|
77
|
+
${pending && !saving ? "" : "disabled"}
|
|
78
|
+
>Save file</button>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
<textarea
|
|
82
|
+
id="configRawEditor"
|
|
83
|
+
class="config-view"
|
|
84
|
+
aria-label="Raw JSON configuration"
|
|
85
|
+
spellcheck="false"
|
|
86
|
+
${file ? "" : "disabled"}
|
|
87
|
+
>${escapeHtml(file ? rawDraftFor(file) : "")}</textarea>
|
|
88
|
+
</details>
|
|
89
|
+
`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function renderConfigMap() {
|
|
93
|
+
return `
|
|
94
|
+
<section class="config-section config-files-section">
|
|
95
|
+
<div class="config-section-header">
|
|
96
|
+
<div class="config-file-meta">
|
|
97
|
+
<h3>Config files</h3>
|
|
98
|
+
<p>Files linked by the active runtime configuration.</p>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="config-file-list">
|
|
102
|
+
${configFileEntries()
|
|
103
|
+
.map(
|
|
104
|
+
(file) => `
|
|
105
|
+
<div class="config-file-row">
|
|
106
|
+
<span>${escapeHtml(file.label)}</span>
|
|
107
|
+
<code>${escapeHtml(file.path)}</code>
|
|
108
|
+
</div>
|
|
109
|
+
`,
|
|
110
|
+
)
|
|
111
|
+
.join("")}
|
|
112
|
+
</div>
|
|
113
|
+
</section>
|
|
114
|
+
${renderRawConfigPanel()}
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function renderCategoryTab(category, label) {
|
|
119
|
+
const active = state.activeCategory === category;
|
|
120
|
+
return `
|
|
121
|
+
<button
|
|
122
|
+
id="configCategory${category[0].toUpperCase()}${category.slice(1)}"
|
|
123
|
+
class="config-category-tab ${active ? "active" : ""}"
|
|
124
|
+
type="button"
|
|
125
|
+
role="tab"
|
|
126
|
+
data-config-action="select-category"
|
|
127
|
+
data-config-category="${escapeAttribute(category)}"
|
|
128
|
+
aria-controls="config${category[0].toUpperCase()}${category.slice(1)}Panel"
|
|
129
|
+
aria-selected="${active ? "true" : "false"}"
|
|
130
|
+
tabindex="${active ? "0" : "-1"}"
|
|
131
|
+
>${escapeHtml(label)}</button>
|
|
132
|
+
`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function renderCategoryPanel(category, content) {
|
|
136
|
+
const capitalized = `${category[0].toUpperCase()}${category.slice(1)}`;
|
|
137
|
+
const active = state.activeCategory === category;
|
|
138
|
+
return `
|
|
139
|
+
<section
|
|
140
|
+
id="config${capitalized}Panel"
|
|
141
|
+
class="config-category-panel ${active ? "active" : ""}"
|
|
142
|
+
role="tabpanel"
|
|
143
|
+
aria-labelledby="configCategory${capitalized}"
|
|
144
|
+
data-config-category-panel="${escapeAttribute(category)}"
|
|
145
|
+
${active ? "" : "hidden"}
|
|
146
|
+
>${content}</section>
|
|
147
|
+
`;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
renderCategoryPanel,
|
|
152
|
+
renderCategoryTab,
|
|
153
|
+
renderConfigMap,
|
|
154
|
+
};
|
|
155
|
+
}
|