@abot-ai/runtime 1.8.1 → 1.9.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/scripts/runtime-setup-files.js +46 -2
- package/dist/src/model-gateway/client/chat.js +9 -5
- package/dist/src/model-gateway/client/invocation-error.d.ts +9 -0
- package/dist/src/model-gateway/client/invocation-error.js +30 -0
- package/dist/src/model-gateway/client/stream-consumer.js +9 -2
- package/dist/src/model-gateway/client/stream-parser.js +2 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.d.ts +5 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/approval.js +15 -1
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/prepared-execution.js +7 -5
- package/dist/src/runtime/adapters/registered-tool-normal-invocations/execution/prepared-snapshot.js +9 -2
- package/dist/src/runtime/automations/service.d.ts +1 -1
- package/dist/src/runtime/capabilities/automation-builder/tool-module.js +4 -4
- package/dist/src/runtime/capabilities/automations/draft-index.d.ts +1 -1
- package/dist/src/runtime/capabilities/automations/tool-module.js +4 -4
- package/dist/src/runtime/capabilities/core-tool-contracts.d.ts +29 -0
- package/dist/src/runtime/capabilities/core-tool-contracts.js +38 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-many.d.ts +4 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-many.js +21 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-targets.d.ts +13 -0
- package/dist/src/runtime/capabilities/knowledge-skills/read-targets.js +44 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-contract.d.ts +141 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-contract.js +58 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-module.d.ts +4 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-module.js +78 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-output.d.ts +12 -0
- package/dist/src/runtime/capabilities/knowledge-skills/tool-output.js +21 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-contract.d.ts +77 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-contract.js +28 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-operations.d.ts +3 -0
- package/dist/src/runtime/capabilities/knowledge-skills/write-operations.js +34 -0
- package/dist/src/runtime/capabilities/scheduling/tool-module.js +3 -3
- package/dist/src/runtime/composition.d.ts +5 -0
- package/dist/src/runtime/context/capability-result-compaction-source.d.ts +3 -1
- package/dist/src/runtime/context/capability-result-compaction-source.js +13 -1
- package/dist/src/runtime/context/core-skill-read-context.d.ts +16 -0
- package/dist/src/runtime/context/core-skill-read-context.js +76 -0
- package/dist/src/runtime/context/exact-evidence-match.d.ts +3 -0
- package/dist/src/runtime/context/exact-evidence-match.js +34 -0
- package/dist/src/runtime/context/model-step-compaction.js +20 -6
- package/dist/src/runtime/context/semantic-compaction/core-skill-read-source.d.ts +9 -0
- package/dist/src/runtime/context/semantic-compaction/core-skill-read-source.js +38 -0
- package/dist/src/runtime/context/semantic-compaction/generation-contracts.d.ts +2 -0
- package/dist/src/runtime/context/semantic-compaction/prompt.js +7 -7
- package/dist/src/runtime/context/semantic-compaction/run.js +10 -3
- package/dist/src/runtime/context/semantic-compaction/super-source-integrity.js +33 -3
- package/dist/src/runtime/context/session-artifact-paths.d.ts +2 -1
- package/dist/src/runtime/context/session-artifact-paths.js +2 -1
- package/dist/src/runtime/context/session-memory/model-step-controller.d.ts +2 -2
- package/dist/src/runtime/context/super-worker-compaction-failure.d.ts +1 -1
- package/dist/src/runtime/context/super-worker-compaction-failure.js +2 -1
- package/dist/src/runtime/context/super-worker-compaction-sidecar.d.ts +2 -1
- package/dist/src/runtime/context/super-worker-compaction-sidecar.js +9 -3
- package/dist/src/runtime/default-environment-adapters.d.ts +2 -1
- package/dist/src/runtime/default-environment-adapters.js +5 -1
- package/dist/src/runtime/knowledge-skills/available-skills-projection.d.ts +17 -0
- package/dist/src/runtime/knowledge-skills/available-skills-projection.js +66 -0
- package/dist/src/runtime/knowledge-skills/available-skills.d.ts +7 -0
- package/dist/src/runtime/knowledge-skills/available-skills.js +17 -0
- package/dist/src/runtime/knowledge-skills/builtins/abot-studio.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/abot-studio.js +27 -0
- package/dist/src/runtime/knowledge-skills/builtins/computer-use.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/computer-use.js +34 -0
- package/dist/src/runtime/knowledge-skills/builtins/skill-creator.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/skill-creator.js +29 -0
- package/dist/src/runtime/knowledge-skills/builtins/technical-work.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/builtins/technical-work.js +27 -0
- package/dist/src/runtime/knowledge-skills/catalog.d.ts +2 -0
- package/dist/src/runtime/knowledge-skills/catalog.js +12 -0
- package/dist/src/runtime/knowledge-skills/personal-contracts.d.ts +48 -0
- package/dist/src/runtime/knowledge-skills/personal-contracts.js +29 -0
- package/dist/src/runtime/knowledge-skills/personal-documents.d.ts +6 -0
- package/dist/src/runtime/knowledge-skills/personal-documents.js +56 -0
- package/dist/src/runtime/knowledge-skills/personal-management.d.ts +9 -0
- package/dist/src/runtime/knowledge-skills/personal-management.js +64 -0
- package/dist/src/runtime/knowledge-skills/personal-repository.d.ts +6 -0
- package/dist/src/runtime/knowledge-skills/personal-repository.js +76 -0
- package/dist/src/runtime/knowledge-skills/personal-store.d.ts +4 -0
- package/dist/src/runtime/knowledge-skills/personal-store.js +33 -0
- package/dist/src/runtime/knowledge-skills/read-evidence.d.ts +3 -0
- package/dist/src/runtime/knowledge-skills/read-evidence.js +13 -0
- package/dist/src/runtime/knowledge-skills/store.d.ts +19 -0
- package/dist/src/runtime/knowledge-skills/store.js +41 -0
- package/dist/src/runtime/local-application.d.ts +2 -1
- package/dist/src/runtime/local-host/app-service-dispatch.d.ts +1 -0
- package/dist/src/runtime/local-host/app-service-dispatch.js +5 -0
- package/dist/src/runtime/local-host/client-services.d.ts +3 -1
- package/dist/src/runtime/local-host/client-services.js +3 -2
- package/dist/src/runtime/long-term-memory/conversation-authoring/context.d.ts +1 -0
- package/dist/src/runtime/long-term-memory/conversation-authoring/context.js +1 -1
- package/dist/src/runtime/long-term-memory/conversation-authoring/plain-text-context.d.ts +5 -0
- package/dist/src/runtime/long-term-memory/conversation-authoring/plain-text-context.js +28 -0
- package/dist/src/runtime/long-term-memory/initial-context.d.ts +1 -0
- package/dist/src/runtime/model/context-compaction-admission.d.ts +1 -0
- package/dist/src/runtime/model/context-compaction-admission.js +35 -1
- package/dist/src/runtime/model/context-compaction-contracts.d.ts +9 -1
- package/dist/src/runtime/model/invoke-step.js +6 -2
- package/dist/src/runtime/model/provider-failure.d.ts +13 -0
- package/dist/src/runtime/model/provider-failure.js +37 -0
- package/dist/src/runtime/orchestration/role-calls/activation-budget.js +1 -0
- package/dist/src/runtime/orchestration/role-calls/candidate-validation.js +2 -0
- package/dist/src/runtime/orchestration/role-calls/checkpoint-state.js +2 -1
- package/dist/src/runtime/orchestration/role-calls/command-decoder.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/skill-read-transition.d.ts +4 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch/skill-read-transition.js +48 -0
- package/dist/src/runtime/orchestration/role-calls/command-dispatch.js +3 -0
- package/dist/src/runtime/orchestration/role-calls/contracts.d.ts +6 -3
- package/dist/src/runtime/orchestration/role-calls/contracts.js +3 -3
- package/dist/src/runtime/orchestration/role-calls/skill-read.d.ts +47 -0
- package/dist/src/runtime/orchestration/role-calls/skill-read.js +196 -0
- package/dist/src/runtime/orchestration/role-executors/activation/model-output-failure.d.ts +1 -1
- package/dist/src/runtime/orchestration/role-executors/activation/model-output-failure.js +4 -2
- package/dist/src/runtime/orchestration/worker-capabilities/binding/create-binding.js +4 -1
- 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/orchestration/worker-capabilities/execution/approval-group.js +5 -3
- package/dist/src/runtime/orchestration/worker-capabilities/payload-compaction-transport.d.ts +2 -0
- package/dist/src/runtime/orchestration/worker-capabilities/payload-compaction-transport.js +7 -2
- package/dist/src/runtime/orchestration/worker-capabilities/supervisor-skill-authority.d.ts +19 -0
- package/dist/src/runtime/orchestration/worker-capabilities/supervisor-skill-authority.js +43 -0
- package/dist/src/runtime/plugins/loader.js +7 -6
- package/dist/src/runtime/request/approval-wait/preflight.js +1 -0
- package/dist/src/runtime/request/bound-runtime-handler.js +1 -0
- package/dist/src/runtime/request/contracts.d.ts +2 -0
- package/dist/src/runtime/request/execution-payload-compacted-evidence.d.ts +2 -2
- package/dist/src/runtime/request/execution-scope-surfaces.d.ts +2 -0
- package/dist/src/runtime/request/execution-scope-surfaces.js +7 -0
- package/dist/src/runtime/request/execution-scope.d.ts +6 -2
- package/dist/src/runtime/request/execution-scope.js +11 -0
- package/dist/src/runtime/request/payload-settled-evidence.d.ts +11 -0
- package/dist/src/runtime/request/payload-settled-evidence.js +29 -0
- package/dist/src/runtime/request/prepared-execution.js +2 -0
- package/dist/src/runtime/request/role-call-delegation-events.d.ts +19 -0
- package/dist/src/runtime/request/role-call-delegation-events.js +52 -0
- package/dist/src/runtime/request/role-call-return-events.d.ts +19 -0
- package/dist/src/runtime/request/role-call-return-events.js +63 -0
- package/dist/src/runtime/request/role-executor-composition.js +2 -2
- package/dist/src/runtime/request/root-capability-binding.d.ts +24 -0
- package/dist/src/runtime/request/root-capability-binding.js +57 -0
- package/dist/src/runtime/request/root-capability-catalog.d.ts +16 -0
- package/dist/src/runtime/request/root-capability-catalog.js +20 -0
- package/dist/src/runtime/request/root-contract.d.ts +11 -1
- package/dist/src/runtime/request/root-execution-kernel.js +35 -68
- package/dist/src/runtime/request/root-reference-action.d.ts +15 -0
- package/dist/src/runtime/request/root-reference-action.js +48 -0
- package/dist/src/runtime/request/root-skill-read.d.ts +13 -0
- package/dist/src/runtime/request/root-skill-read.js +102 -0
- package/dist/src/runtime/request/runner.js +10 -0
- package/dist/src/runtime/request/super-payload-context-failure.js +13 -4
- package/dist/src/runtime/request/supervisor-root-execution.js +48 -1
- package/dist/src/runtime/request/supervisor-skill-edit-target.d.ts +9 -0
- package/dist/src/runtime/request/supervisor-skill-edit-target.js +25 -0
- package/dist/src/runtime/request/supervisor-skill-payload-context.d.ts +21 -0
- package/dist/src/runtime/request/supervisor-skill-payload-context.js +91 -0
- package/dist/src/runtime/request/supervisor-skill-write-preparation.d.ts +25 -0
- package/dist/src/runtime/request/supervisor-skill-write-preparation.js +71 -0
- package/dist/src/runtime/request/worker-capability-composition.d.ts +4 -1
- package/dist/src/runtime/request/worker-capability-composition.js +4 -1
- package/dist/src/runtime/request/worker-capability-payload.d.ts +1 -1
- package/dist/src/runtime/request/worker-capability-payload.js +44 -37
- package/dist/src/runtime/runtime-environment.d.ts +2 -0
- package/dist/src/runtime/runtime-environment.js +12 -1
- package/dist/src/runtime/scheduler/contracts.d.ts +4 -0
- package/dist/src/runtime/scheduler/run-list-filter.d.ts +11 -0
- package/dist/src/runtime/scheduler/run-list-filter.js +56 -0
- package/dist/src/runtime/scheduler/run-list-query.d.ts +2 -2
- package/dist/src/runtime/scheduler/run-list-query.js +4 -1
- package/dist/src/runtime/steps/auditor-decision/contracts.d.ts +2 -0
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.d.ts +2 -2
- package/dist/src/runtime/steps/auditor-decision/evidence-representation.js +2 -34
- package/dist/src/runtime/steps/auditor-decision/input.js +21 -3
- package/dist/src/runtime/steps/auditor-decision/projection.js +5 -0
- package/dist/src/runtime/steps/auditor-decision/prompt.d.ts +1 -1
- package/dist/src/runtime/steps/auditor-decision/prompt.js +14 -3
- package/dist/src/runtime/steps/capability-execution-guidance.d.ts +7 -0
- package/dist/src/runtime/steps/capability-execution-guidance.js +28 -0
- package/dist/src/runtime/steps/capability-execution-instructions.d.ts +0 -2
- package/dist/src/runtime/steps/capability-execution-instructions.js +0 -2
- package/dist/src/runtime/steps/execution-agent/capability-result-context.d.ts +5 -2
- package/dist/src/runtime/steps/execution-agent/capability-result-context.js +22 -3
- package/dist/src/runtime/steps/execution-agent/compaction.d.ts +3 -2
- package/dist/src/runtime/steps/execution-agent/compaction.js +9 -1
- package/dist/src/runtime/steps/execution-agent/direct-response-prompt.js +14 -14
- package/dist/src/runtime/steps/execution-agent/input.js +14 -2
- package/dist/src/runtime/steps/execution-agent/prompt.js +40 -38
- package/dist/src/runtime/steps/execution-agent/refinement-input.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/refinement-prompt.js +4 -1
- package/dist/src/runtime/steps/execution-agent/response-prompt.js +1 -0
- package/dist/src/runtime/steps/execution-agent/response-run.js +1 -1
- package/dist/src/runtime/steps/execution-agent/run.js +1 -1
- package/dist/src/runtime/steps/execution-agent/state-context.js +1 -1
- package/dist/src/runtime/steps/knowledge-skill-instructions.d.ts +3 -0
- package/dist/src/runtime/steps/knowledge-skill-instructions.js +3 -0
- package/dist/src/runtime/steps/planner-decision/capability-brief.d.ts +2 -2
- package/dist/src/runtime/steps/planner-decision/capability-brief.js +5 -1
- package/dist/src/runtime/steps/planner-decision/input.d.ts +2 -2
- package/dist/src/runtime/steps/planner-decision/input.js +7 -1
- package/dist/src/runtime/steps/planner-decision/prompt.js +3 -0
- package/dist/src/runtime/steps/planner-graph/input.d.ts +2 -2
- package/dist/src/runtime/steps/planner-graph/input.js +9 -8
- package/dist/src/runtime/steps/planner-graph/prompt.js +2 -2
- package/dist/src/runtime/steps/planner-graph/run.d.ts +2 -2
- package/dist/src/runtime/steps/planner-graph/run.js +5 -5
- package/dist/src/runtime/steps/planner-graph/skill-guidance.d.ts +5 -0
- package/dist/src/runtime/steps/planner-graph/skill-guidance.js +62 -0
- package/dist/src/runtime/steps/reviewer-decision/final-evidence.d.ts +1 -0
- package/dist/src/runtime/steps/reviewer-decision/final-evidence.js +3 -1
- package/dist/src/runtime/steps/reviewer-decision/input.d.ts +3 -1
- package/dist/src/runtime/steps/reviewer-decision/input.js +2 -22
- package/dist/src/runtime/steps/reviewer-decision/model-context.d.ts +21 -0
- package/dist/src/runtime/steps/reviewer-decision/model-context.js +32 -1
- package/dist/src/runtime/steps/reviewer-decision/projection.js +4 -0
- package/dist/src/runtime/steps/reviewer-decision/prompt.d.ts +1 -1
- package/dist/src/runtime/steps/reviewer-decision/prompt.js +15 -4
- package/dist/src/runtime/steps/reviewer-decision/run.d.ts +2 -0
- package/dist/src/runtime/steps/reviewer-decision/run.js +6 -0
- package/dist/src/runtime/steps/skill-read-decision.d.ts +34 -0
- package/dist/src/runtime/steps/skill-read-decision.js +91 -0
- package/dist/src/runtime/steps/supervisor-decision/artifact-paths.d.ts +22 -0
- package/dist/src/runtime/steps/supervisor-decision/artifact-paths.js +132 -0
- package/dist/src/runtime/steps/supervisor-decision/capability-brief.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/capability-brief.js +9 -2
- package/dist/src/runtime/steps/supervisor-decision/contracts.d.ts +12 -3
- package/dist/src/runtime/steps/supervisor-decision/contracts.js +3 -0
- package/dist/src/runtime/steps/supervisor-decision/decision-phases.d.ts +37 -0
- package/dist/src/runtime/steps/supervisor-decision/decision-phases.js +124 -0
- package/dist/src/runtime/steps/supervisor-decision/diagnostics.d.ts +5 -1
- package/dist/src/runtime/steps/supervisor-decision/diagnostics.js +4 -0
- package/dist/src/runtime/steps/supervisor-decision/format.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-decision/format.js +2 -0
- package/dist/src/runtime/steps/supervisor-decision/input.d.ts +7 -1
- package/dist/src/runtime/steps/supervisor-decision/input.js +30 -11
- package/dist/src/runtime/steps/supervisor-decision/parser.d.ts +1 -0
- package/dist/src/runtime/steps/supervisor-decision/parser.js +11 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation-input.d.ts +26 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation-input.js +39 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation.d.ts +17 -0
- package/dist/src/runtime/steps/supervisor-decision/preparation.js +65 -0
- package/dist/src/runtime/steps/supervisor-decision/presentation.d.ts +13 -0
- package/dist/src/runtime/steps/supervisor-decision/presentation.js +47 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.d.ts +4 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.js +96 -109
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.d.ts +2 -0
- package/dist/src/runtime/steps/supervisor-decision/response-recommendation.js +2 -0
- package/dist/src/runtime/steps/supervisor-decision/resume.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-decision/resume.js +20 -0
- package/dist/src/runtime/steps/supervisor-decision/run.d.ts +6 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +73 -159
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-input.d.ts +21 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection-input.js +29 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection.d.ts +16 -0
- package/dist/src/runtime/steps/supervisor-decision/skill-selection.js +44 -0
- package/dist/src/runtime/steps/supervisor-response/input.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-response/input.js +5 -0
- package/dist/src/runtime/steps/supervisor-response/prompt.js +2 -0
- package/dist/src/runtime/steps/supervisor-response/response-recommendation.d.ts +3 -0
- package/dist/src/runtime/steps/supervisor-response/response-recommendation.js +24 -4
- package/dist/src/runtime/steps/supervisor-response/run.d.ts +5 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/contract.d.ts +43 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/contract.js +85 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/input.d.ts +35 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/input.js +87 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/run.d.ts +10 -0
- package/dist/src/runtime/steps/supervisor-skill-authoring/run.js +35 -0
- package/dist/src/runtime/steps/supervisor-skill-instructions.d.ts +4 -0
- package/dist/src/runtime/steps/supervisor-skill-instructions.js +4 -0
- package/dist/src/runtime/steps/worker-capability-scope-decision.js +14 -1
- package/dist/src/runtime/steps/worker-decision/contracts.d.ts +1 -0
- package/dist/src/runtime/steps/worker-decision/input/execution-guidance.d.ts +5 -0
- package/dist/src/runtime/steps/worker-decision/input/execution-guidance.js +31 -0
- package/dist/src/runtime/steps/worker-decision/input/prompt-context.js +2 -25
- package/dist/src/runtime/steps/worker-decision/input/reference-context.js +4 -0
- package/dist/src/runtime/steps/worker-decision/prompt.js +6 -2
- package/dist/src/runtime/steps/worker-decision/result-author.js +6 -0
- package/dist/src/web-ui/app/app-bootstrap.js +3 -0
- package/dist/src/web-ui/app/app.js +6 -1
- package/dist/src/web-ui/app/components/automations/run-history-controls.js +77 -0
- package/dist/src/web-ui/app/components/automations/run-history.js +55 -0
- package/dist/src/web-ui/app/components/automations/run.js +3 -8
- package/dist/src/web-ui/app/components/automations/workspace.js +11 -2
- package/dist/src/web-ui/app/components/conversation-role-cards.js +27 -0
- package/dist/src/web-ui/app/components/conversation-role-delegations.d.ts +12 -0
- package/dist/src/web-ui/app/components/conversation-role-delegations.js +24 -0
- package/dist/src/web-ui/app/components/conversation-role-history.d.ts +13 -0
- package/dist/src/web-ui/app/components/conversation-role-history.js +81 -0
- package/dist/src/web-ui/app/components/conversation-role-returns.d.ts +12 -0
- package/dist/src/web-ui/app/components/conversation-role-returns.js +23 -0
- package/dist/src/web-ui/app/components/onboarding-workspace-access.js +1 -1
- package/dist/src/web-ui/app/components/skills/workspace.js +119 -0
- package/dist/src/web-ui/app/components/workspace-shell.js +11 -1
- package/dist/src/web-ui/app/controllers/automation-read-projection.js +8 -4
- package/dist/src/web-ui/app/controllers/automation-run-actions.js +3 -1
- package/dist/src/web-ui/app/controllers/automation-run-history.js +159 -0
- package/dist/src/web-ui/app/controllers/automations-controller.js +27 -11
- package/dist/src/web-ui/app/controllers/environment-workspace-preparation.js +6 -2
- package/dist/src/web-ui/app/controllers/realtime-event-controller.js +22 -1
- package/dist/src/web-ui/app/controllers/runtime-selection-controller.js +7 -1
- package/dist/src/web-ui/app/controllers/skills-controller.js +237 -0
- package/dist/src/web-ui/app/lib/conversation-role-model.d.ts +5 -0
- package/dist/src/web-ui/app/lib/conversation-role-model.js +63 -5
- package/dist/src/web-ui/app/lib/event-presentation.js +34 -0
- package/dist/src/web-ui/app/lib/role-delegation-event.d.ts +18 -0
- package/dist/src/web-ui/app/lib/role-delegation-event.js +47 -0
- package/dist/src/web-ui/app/lib/role-return-event.d.ts +19 -0
- package/dist/src/web-ui/app/lib/role-return-event.js +36 -0
- package/dist/src/web-ui/app/lib/tool-activity-event.js +8 -6
- package/dist/src/web-ui/app/lib/tool-skill-activity-fields.js +50 -0
- package/dist/src/web-ui/app/lib/workspace-route.js +1 -0
- package/dist/src/web-ui/app/services/runtime-web-client/automations.d.ts +9 -1
- package/dist/src/web-ui/app/services/runtime-web-client/automations.js +10 -2
- package/dist/src/web-ui/app/services/runtime-web-client/skills.js +23 -0
- package/dist/src/web-ui/app/services/runtime-web-client.js +2 -0
- package/dist/src/web-ui/app/skills-feature.js +36 -0
- package/dist/src/web-ui/app/styles/24-conversation-role-cards.css +58 -0
- package/dist/src/web-ui/app/styles/40-skills.css +34 -0
- package/dist/src/web-ui/app/styles/50-automations.css +24 -3
- package/dist/src/web-ui/app/styles/95-home-widgets.css +2 -1
- package/dist/src/web-ui/app/styles.css +1 -0
- package/dist/src/web-ui/app/ui-behavior.d.ts +1 -1
- package/dist/src/web-ui/app/ui-behavior.js +1 -0
- package/dist/src/web-ui/client-state/store.js +3 -2
- package/dist/src/web-ui/client-state/transaction-order.d.ts +2 -0
- package/dist/src/web-ui/client-state/transaction-order.js +18 -0
- package/dist/src/web-ui/local-runtime/api-router.d.ts +1 -0
- package/dist/src/web-ui/local-runtime/api-router.js +7 -0
- package/dist/src/web-ui/local-runtime/automation-routes.js +2 -1
- package/dist/src/web-ui/local-runtime/automation-run-page.d.ts +5 -0
- package/dist/src/web-ui/local-runtime/automation-run-page.js +26 -0
- package/dist/src/web-ui/local-runtime/skill-management-routes.d.ts +18 -0
- package/dist/src/web-ui/local-runtime/skill-management-routes.js +118 -0
- package/docs/configuration.md +8 -0
- package/docs/runtime-public-contracts.md +37 -0
- package/examples/request-runner.config.example.json +3 -0
- package/package.json +1 -1
- package/plugins/web/skills/web_fetch_skill/SKILL.md +1 -2
- package/plugins/web/skills/web_search_skill/SKILL.md +3 -7
- package/src/runtime/README.md +96 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { resolveCapabilityBriefHeadroom, resolveCapabilityBriefMessageHeadroom, } from "../../context/capability-brief-budget.js";
|
|
2
|
+
import { buildSessionArtifactPathsMessage } from "../../context/session-artifact-paths.js";
|
|
3
|
+
import { estimateMessageTokens } from "../../context/token-estimator.js";
|
|
4
|
+
import { resolveModelContextAdmission } from "../../model/model-context-budget.js";
|
|
5
|
+
import { buildSupervisorCapabilityBriefOptions } from "./capability-brief.js";
|
|
6
|
+
import { SUPERVISOR_DECISION_MODEL_STEP } from "./contracts.js";
|
|
7
|
+
import { buildSupervisorArtifactPathInstructions } from "./prompt.js";
|
|
8
|
+
/** Adds a bounded continuity reference only within the remaining full-context budget. */
|
|
9
|
+
export function projectSupervisorArtifactPaths(params) {
|
|
10
|
+
if (!params.targets?.length)
|
|
11
|
+
return undefined;
|
|
12
|
+
const instructions = [
|
|
13
|
+
params.context.instructions,
|
|
14
|
+
buildSupervisorArtifactPathInstructions(),
|
|
15
|
+
].join("\n");
|
|
16
|
+
// The existing catalog and all history retain priority over this reference.
|
|
17
|
+
const headroom = resolveCapabilityBriefHeadroom({
|
|
18
|
+
context: { ...params.context, instructions },
|
|
19
|
+
additionalBudgetMessages: params.additionalBudgetMessages,
|
|
20
|
+
});
|
|
21
|
+
const artifactPaths = buildSessionArtifactPathsMessage({
|
|
22
|
+
targets: params.targets,
|
|
23
|
+
applicable: true,
|
|
24
|
+
applicability: "supervisor_objective_and_working_directory_reference_only",
|
|
25
|
+
maxTargets: 8,
|
|
26
|
+
fits: (message) => estimateMessageTokens(message, params.context.budget.tokenEstimation) <=
|
|
27
|
+
headroom,
|
|
28
|
+
});
|
|
29
|
+
if (!artifactPaths)
|
|
30
|
+
return undefined;
|
|
31
|
+
return {
|
|
32
|
+
instructions,
|
|
33
|
+
baseInstructions: params.context.instructions,
|
|
34
|
+
message: artifactPaths.message,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/** Optional paths yield to the current attempt's mandatory context and catalog. */
|
|
38
|
+
export function createSupervisorArtifactPathsReadmissionController(request, options) {
|
|
39
|
+
const { controller, projection } = options;
|
|
40
|
+
if (!projection)
|
|
41
|
+
return controller;
|
|
42
|
+
let admittedArtifactMessage;
|
|
43
|
+
return Object.freeze({
|
|
44
|
+
...controller,
|
|
45
|
+
project(messages) {
|
|
46
|
+
admittedArtifactMessage = undefined;
|
|
47
|
+
const artifactIndex = messages.findIndex((message) => matchesBoundArtifactMessage(message, projection.message));
|
|
48
|
+
if (artifactIndex < 0)
|
|
49
|
+
return controller.project(messages);
|
|
50
|
+
const followingMessage = messages[artifactIndex + 1];
|
|
51
|
+
const withoutArtifact = messages.filter((_, index) => index !== artifactIndex);
|
|
52
|
+
const withoutAdditions = options.includeInstructions
|
|
53
|
+
? replaceBoundInstructionPrefix(withoutArtifact, projection.instructions, projection.baseInstructions)
|
|
54
|
+
: withoutArtifact;
|
|
55
|
+
const projected = controller.project(withoutAdditions);
|
|
56
|
+
const withInstructions = options.includeInstructions
|
|
57
|
+
? replaceBoundInstructionPrefix(projected, projection.baseInstructions, projection.instructions)
|
|
58
|
+
: projected;
|
|
59
|
+
const admission = resolveModelContextAdmission({
|
|
60
|
+
runnerConfig: request.runnerConfig,
|
|
61
|
+
agentMode: request.agentMode,
|
|
62
|
+
modelStep: SUPERVISOR_DECISION_MODEL_STEP,
|
|
63
|
+
modelPreference: request.modelPreference,
|
|
64
|
+
modelPolicy: request.modelPolicy,
|
|
65
|
+
requestFormat: options.format,
|
|
66
|
+
});
|
|
67
|
+
const { capabilityBriefBudgetMessages = [] } = buildSupervisorCapabilityBriefOptions(request, {});
|
|
68
|
+
const headroom = resolveCapabilityBriefMessageHeadroom({
|
|
69
|
+
messages: [...withInstructions, ...capabilityBriefBudgetMessages],
|
|
70
|
+
budget: admission.budget,
|
|
71
|
+
format: options.format,
|
|
72
|
+
});
|
|
73
|
+
const artifactPaths = buildSessionArtifactPathsMessage({
|
|
74
|
+
targets: request.sessionArtifactPaths ?? [],
|
|
75
|
+
applicable: true,
|
|
76
|
+
applicability: "supervisor_objective_and_working_directory_reference_only",
|
|
77
|
+
maxTargets: 8,
|
|
78
|
+
fits: (message) => estimateMessageTokens(message, admission.budget.tokenEstimation) <=
|
|
79
|
+
headroom,
|
|
80
|
+
});
|
|
81
|
+
if (!artifactPaths)
|
|
82
|
+
return projected;
|
|
83
|
+
// The current prompt follows the reference and survives compaction verbatim.
|
|
84
|
+
const insertionIndex = followingMessage
|
|
85
|
+
? withInstructions.indexOf(followingMessage)
|
|
86
|
+
: withInstructions.length;
|
|
87
|
+
if (insertionIndex < 0)
|
|
88
|
+
throw new Error("supervisor_artifact_path_position_binding_invalid");
|
|
89
|
+
admittedArtifactMessage = artifactPaths.message;
|
|
90
|
+
return [
|
|
91
|
+
...withInstructions.slice(0, insertionIndex),
|
|
92
|
+
artifactPaths.message,
|
|
93
|
+
...withInstructions.slice(insertionIndex),
|
|
94
|
+
];
|
|
95
|
+
},
|
|
96
|
+
projectForCompaction(messages) {
|
|
97
|
+
const artifactIndex = admittedArtifactMessage
|
|
98
|
+
? messages.indexOf(admittedArtifactMessage)
|
|
99
|
+
: -1;
|
|
100
|
+
if (artifactIndex < 0)
|
|
101
|
+
return controller.projectForCompaction?.(messages) ?? messages;
|
|
102
|
+
const withoutArtifact = messages.filter((_, index) => index !== artifactIndex);
|
|
103
|
+
const withoutAdditions = options.includeInstructions
|
|
104
|
+
? replaceBoundInstructionPrefix(withoutArtifact, projection.instructions, projection.baseInstructions)
|
|
105
|
+
: withoutArtifact;
|
|
106
|
+
return (controller.projectForCompaction?.(withoutAdditions) ?? withoutAdditions);
|
|
107
|
+
},
|
|
108
|
+
getStages: () => controller.getStages(),
|
|
109
|
+
...(controller.hasExhaustedVerifiedCompactionSources
|
|
110
|
+
? {
|
|
111
|
+
hasExhaustedVerifiedCompactionSources: (messages) => controller.hasExhaustedVerifiedCompactionSources(messages),
|
|
112
|
+
}
|
|
113
|
+
: {}),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function matchesBoundArtifactMessage(left, right) {
|
|
117
|
+
return (left === right ||
|
|
118
|
+
(left.role === right.role && left.content === right.content));
|
|
119
|
+
}
|
|
120
|
+
function replaceBoundInstructionPrefix(messages, previous, replacement) {
|
|
121
|
+
const instructions = messages[0];
|
|
122
|
+
if (instructions?.role !== "system" ||
|
|
123
|
+
!instructions.content.startsWith(previous))
|
|
124
|
+
throw new Error("supervisor_artifact_path_instruction_binding_invalid");
|
|
125
|
+
return [
|
|
126
|
+
{
|
|
127
|
+
...instructions,
|
|
128
|
+
content: replacement + instructions.content.slice(previous.length),
|
|
129
|
+
},
|
|
130
|
+
...messages.slice(1),
|
|
131
|
+
];
|
|
132
|
+
}
|
|
@@ -4,6 +4,8 @@ import type { RequestExecutionScope } from "../../request/execution-scope.js";
|
|
|
4
4
|
import type { WorkerCapabilityCatalogGroup } from "../../orchestration/worker-capabilities/index.js";
|
|
5
5
|
type BriefOptions = Readonly<{
|
|
6
6
|
allowedRoleIds?: readonly string[];
|
|
7
|
+
remainingCapabilityExecutions?: number;
|
|
8
|
+
remainingRoleCalls?: number;
|
|
7
9
|
availableWorkerCapabilityCatalog?: readonly WorkerCapabilityCatalogGroup[];
|
|
8
10
|
}>;
|
|
9
11
|
/** Only routing opts in; neither the Worker nor later authoring is changed. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { projectSupervisorWorkerCapabilityBriefEntries } from "../../orchestration/worker-capabilities/supervisor-skill-authority.js";
|
|
1
2
|
import { resolveModelContextAdmission } from "../../model/model-context-budget.js";
|
|
2
3
|
import { resolveRequestCapabilityBriefEntries } from "../../request/capability-brief.js";
|
|
3
4
|
import { appendRequestSteeringContext } from "../../request/request-steering-context.js";
|
|
@@ -5,9 +6,15 @@ import { resolveRequestSteeringInbox } from "../../request/request-steering.js";
|
|
|
5
6
|
import { SUPERVISOR_DECISION_MODEL_STEP, SUPERVISOR_DELEGATE_ROLE_IDS, } from "./contracts.js";
|
|
6
7
|
/** Only routing opts in; neither the Worker nor later authoring is changed. */
|
|
7
8
|
export function buildSupervisorCapabilityBriefOptions(request, options) {
|
|
8
|
-
|
|
9
|
+
const hasCapabilityBrief = canProjectSupervisorCapabilityBrief(options);
|
|
10
|
+
if (!hasCapabilityBrief && !request.sessionArtifactPaths?.length)
|
|
9
11
|
return {};
|
|
10
|
-
const entries =
|
|
12
|
+
const entries = hasCapabilityBrief
|
|
13
|
+
? projectSupervisorWorkerCapabilityBriefEntries({
|
|
14
|
+
authority: request.executionPolicy.authority,
|
|
15
|
+
entries: resolveRequestCapabilityBriefEntries(request.capabilities, options.availableWorkerCapabilityCatalog ?? []),
|
|
16
|
+
})
|
|
17
|
+
: undefined;
|
|
11
18
|
const admission = resolveModelContextAdmission({
|
|
12
19
|
runnerConfig: request.runnerConfig,
|
|
13
20
|
agentMode: request.agentMode,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { MemoryRecallDecision } from "../memory-recall-decision.js";
|
|
2
|
+
import type { SkillReadDecision } from "../skill-read-decision.js";
|
|
3
|
+
import type { SupervisorSkillAuthoringSelection } from "../supervisor-skill-authoring/contract.js";
|
|
2
4
|
import { type RuntimeDelegateRoleId } from "../../orchestration/roles.js";
|
|
3
5
|
import type { RoleCapabilityDeclaredEffect, RoleChildReturnContext, RoleCallWorkerCapabilityScope } from "../../orchestration/role-calls/index.js";
|
|
4
6
|
export declare const SUPERVISOR_DECISION_MODEL_STEP: "supervisor.decision";
|
|
@@ -8,7 +10,7 @@ export declare const SUPERVISOR_DECISION_ACTIONS: readonly ["respond", "invoke_r
|
|
|
8
10
|
export declare const SUPERVISOR_ACKNOWLEDGEMENT_MAX_LENGTH = 220;
|
|
9
11
|
export declare const SUPERVISOR_TITLE_MAX_LENGTH = 80;
|
|
10
12
|
export declare const SUPERVISOR_OBJECTIVE_MAX_LENGTH = 8192;
|
|
11
|
-
export declare const SUPERVISOR_DECISION_PHASES: readonly ["routing", "working_directory"];
|
|
13
|
+
export declare const SUPERVISOR_DECISION_PHASES: readonly ["presentation", "skill_selection", "skill_authoring", "routing", "working_directory"];
|
|
12
14
|
export type SupervisorDelegateRoleId = RuntimeDelegateRoleId;
|
|
13
15
|
export type SupervisorWorkerCapabilityAffordance = Readonly<{
|
|
14
16
|
purpose: string;
|
|
@@ -39,7 +41,10 @@ export type SupervisorInvokeRoleDecision = Readonly<SupervisorInvokeRoleDecision
|
|
|
39
41
|
}> | Readonly<SupervisorInvokeRoleDecisionBase & {
|
|
40
42
|
roleId: Exclude<SupervisorDelegateRoleId, "planner" | "worker">;
|
|
41
43
|
}>;
|
|
42
|
-
export type SupervisorDecision = MemoryRecallDecision | SupervisorRespondDecision | SupervisorInvokeRoleDecision
|
|
44
|
+
export type SupervisorDecision = MemoryRecallDecision | SkillReadDecision | SupervisorRespondDecision | SupervisorInvokeRoleDecision | (SupervisorSkillAuthoringSelection & Readonly<{
|
|
45
|
+
acknowledgement?: string;
|
|
46
|
+
title?: string;
|
|
47
|
+
}>);
|
|
43
48
|
export type SupervisorDecisionOutcome = Readonly<{
|
|
44
49
|
decision: SupervisorDecision;
|
|
45
50
|
steeringVersion: number;
|
|
@@ -54,7 +59,11 @@ export type SupervisorRoutingInvokeRoleDecision = Readonly<SupervisorInvokeRoleD
|
|
|
54
59
|
}> | Readonly<SupervisorInvokeRoleDecisionMetadata & {
|
|
55
60
|
roleId: "reviewer";
|
|
56
61
|
}>;
|
|
57
|
-
export type SupervisorRoutingDecision = MemoryRecallDecision | SupervisorRespondDecision | SupervisorRoutingInvokeRoleDecision
|
|
62
|
+
export type SupervisorRoutingDecision = MemoryRecallDecision | SupervisorRespondDecision | SupervisorRoutingInvokeRoleDecision | Readonly<{
|
|
63
|
+
action: "author_skill";
|
|
64
|
+
acknowledgement?: never;
|
|
65
|
+
title?: never;
|
|
66
|
+
}>;
|
|
58
67
|
export type SupervisorWorkingDirectoryRoutingDecision = Extract<SupervisorRoutingInvokeRoleDecision, Readonly<{
|
|
59
68
|
roleId: "planner" | "worker";
|
|
60
69
|
}>>;
|
|
@@ -11,6 +11,9 @@ export const SUPERVISOR_ACKNOWLEDGEMENT_MAX_LENGTH = 220;
|
|
|
11
11
|
export const SUPERVISOR_TITLE_MAX_LENGTH = 80;
|
|
12
12
|
export const SUPERVISOR_OBJECTIVE_MAX_LENGTH = 8_192;
|
|
13
13
|
export const SUPERVISOR_DECISION_PHASES = Object.freeze([
|
|
14
|
+
"presentation",
|
|
15
|
+
"skill_selection",
|
|
16
|
+
"skill_authoring",
|
|
14
17
|
"routing",
|
|
15
18
|
"working_directory",
|
|
16
19
|
]);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ModelStepContextCompactionController } from "../../model/model-step-port.js";
|
|
2
|
+
import type { RequestExecutionScope } from "../../request/execution-scope.js";
|
|
3
|
+
import type { RequestSteeringInbox } from "../../request/request-steering.js";
|
|
4
|
+
import type { SupervisorDecision, SupervisorDecisionOutcome, SupervisorDecisionDiagnosticContext, SupervisorRoutingDecision, SupervisorWorkingDirectoryDecision, SupervisorWorkingDirectoryRoutingDecision } from "./contracts.js";
|
|
5
|
+
import { buildSupervisorDecisionInput } from "./input.js";
|
|
6
|
+
import { buildSupervisorWorkingDirectoryInput } from "./working-directory.js";
|
|
7
|
+
type AcceptedSupervisorPhase<T> = Readonly<{
|
|
8
|
+
decision: T;
|
|
9
|
+
steeringVersion: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function createDecisionOutcome(decision: SupervisorDecision, steeringVersion: number): SupervisorDecisionOutcome;
|
|
12
|
+
export declare function runRoutingPhase(params: {
|
|
13
|
+
request: RequestExecutionScope;
|
|
14
|
+
requestSteering: RequestSteeringInbox;
|
|
15
|
+
boundSteeringVersion?: number;
|
|
16
|
+
input: ReturnType<typeof buildSupervisorDecisionInput>;
|
|
17
|
+
diagnostic: SupervisorDecisionDiagnosticContext;
|
|
18
|
+
contextCompaction: ModelStepContextCompactionController;
|
|
19
|
+
}): Promise<AcceptedSupervisorPhase<SupervisorRoutingDecision>>;
|
|
20
|
+
export declare function runWorkingDirectoryPhase(params: {
|
|
21
|
+
request: RequestExecutionScope;
|
|
22
|
+
requestSteering: RequestSteeringInbox;
|
|
23
|
+
boundSteeringVersion?: number;
|
|
24
|
+
input: ReturnType<typeof buildSupervisorWorkingDirectoryInput>;
|
|
25
|
+
frozenDecision: SupervisorWorkingDirectoryRoutingDecision;
|
|
26
|
+
diagnostic: SupervisorDecisionDiagnosticContext;
|
|
27
|
+
contextCompaction: ModelStepContextCompactionController;
|
|
28
|
+
}): Promise<AcceptedSupervisorPhase<SupervisorWorkingDirectoryDecision>>;
|
|
29
|
+
export declare function requiresWorkingDirectory(decision: SupervisorRoutingDecision): decision is SupervisorWorkingDirectoryRoutingDecision;
|
|
30
|
+
export declare function tracePhaseSuperseded(params: {
|
|
31
|
+
diagnostic: SupervisorDecisionDiagnosticContext;
|
|
32
|
+
requestSteering: RequestSteeringInbox;
|
|
33
|
+
routingSteeringVersion: number;
|
|
34
|
+
workingDirectorySteeringVersion?: number;
|
|
35
|
+
checkpoint: "before_working_directory" | "after_working_directory";
|
|
36
|
+
}): void;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { invokeStructuredModelStep, StructuredModelInvalidOutputError } from "../../model/invoke-structured-step.js";
|
|
2
|
+
import { traceSupervisorDecisionPhaseSuperseded, traceSupervisorModelCompleted, traceSupervisorModelFailed, traceSupervisorModelStarted, traceSupervisorWorkingDirectoryModelStarted } from "./diagnostics.js";
|
|
3
|
+
import { parseSupervisorDecisionOutput } from "./parser.js";
|
|
4
|
+
import { mergeSupervisorWorkingDirectory, parseSupervisorWorkingDirectoryOutput } from "./working-directory.js";
|
|
5
|
+
export function createDecisionOutcome(decision, steeringVersion) {
|
|
6
|
+
return Object.freeze({ decision: Object.freeze(decision), steeringVersion });
|
|
7
|
+
}
|
|
8
|
+
export async function runRoutingPhase(params) {
|
|
9
|
+
const startedAt = Date.now();
|
|
10
|
+
traceSupervisorModelStarted({
|
|
11
|
+
diagnostic: params.diagnostic,
|
|
12
|
+
allowMemoryRecall: params.input.allowMemoryRecall,
|
|
13
|
+
allowSkillAuthoring: params.input.allowSkillAuthoring,
|
|
14
|
+
messageCount: params.input.context.messages.length,
|
|
15
|
+
messageCharacterCount: params.input.context.messages.reduce((total, message) => total + message.content.length, 0),
|
|
16
|
+
includeAcknowledgement: params.input.includeAcknowledgement,
|
|
17
|
+
includeTitle: params.input.includeTitle,
|
|
18
|
+
allowedRoleIds: params.input.allowedRoleIds,
|
|
19
|
+
availableWorkerCapabilityCatalog: params.input.availableWorkerCapabilityCatalog,
|
|
20
|
+
});
|
|
21
|
+
try {
|
|
22
|
+
const accepted = await invokeStructuredModelStep({
|
|
23
|
+
request: params.request,
|
|
24
|
+
boundSteeringVersion: params.boundSteeringVersion,
|
|
25
|
+
modelStep: params.input.modelStep,
|
|
26
|
+
format: params.input.format,
|
|
27
|
+
messages: params.input.context.messages,
|
|
28
|
+
contextCompaction: params.contextCompaction,
|
|
29
|
+
timeoutReason: "supervisor_decision_timeout",
|
|
30
|
+
invalidOutputReason: "invalid_supervisor_decision",
|
|
31
|
+
parse: (text) => captureAcceptedPhase(parseSupervisorDecisionOutput(text, {
|
|
32
|
+
includeAcknowledgement: params.input.includeAcknowledgement,
|
|
33
|
+
includeTitle: params.input.includeTitle,
|
|
34
|
+
includeResponseRecommendation: params.input.includeResponseRecommendation,
|
|
35
|
+
allowMemoryRecall: params.input.allowMemoryRecall,
|
|
36
|
+
allowSkillAuthoring: params.input.allowSkillAuthoring,
|
|
37
|
+
allowedRoleIds: params.input.allowedRoleIds,
|
|
38
|
+
availableWorkerCapabilityCatalog: params.input.availableWorkerCapabilityCatalog,
|
|
39
|
+
diagnostic: params.diagnostic,
|
|
40
|
+
}), params.requestSteering),
|
|
41
|
+
});
|
|
42
|
+
traceSupervisorModelCompleted({
|
|
43
|
+
diagnostic: params.diagnostic,
|
|
44
|
+
decision: accepted.decision,
|
|
45
|
+
durationMs: Date.now() - startedAt,
|
|
46
|
+
});
|
|
47
|
+
return accepted;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
tracePhaseFailure(params.diagnostic, startedAt, error);
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export async function runWorkingDirectoryPhase(params) {
|
|
55
|
+
const startedAt = Date.now();
|
|
56
|
+
traceSupervisorWorkingDirectoryModelStarted({
|
|
57
|
+
diagnostic: params.diagnostic,
|
|
58
|
+
messageCount: params.input.messages.length,
|
|
59
|
+
messageCharacterCount: params.input.messages.reduce((total, message) => total + message.content.length, 0),
|
|
60
|
+
frozenDecision: params.frozenDecision,
|
|
61
|
+
});
|
|
62
|
+
try {
|
|
63
|
+
const accepted = await invokeStructuredModelStep({
|
|
64
|
+
request: params.request,
|
|
65
|
+
boundSteeringVersion: params.boundSteeringVersion,
|
|
66
|
+
modelStep: params.input.modelStep,
|
|
67
|
+
format: params.input.format,
|
|
68
|
+
messages: params.input.messages,
|
|
69
|
+
contextCompaction: params.contextCompaction,
|
|
70
|
+
timeoutReason: "supervisor_decision_timeout",
|
|
71
|
+
invalidOutputReason: "invalid_supervisor_decision",
|
|
72
|
+
parse: (text) => captureAcceptedPhase(parseSupervisorWorkingDirectoryOutput(text, {
|
|
73
|
+
diagnostic: params.diagnostic,
|
|
74
|
+
}), params.requestSteering),
|
|
75
|
+
});
|
|
76
|
+
traceSupervisorModelCompleted({
|
|
77
|
+
diagnostic: params.diagnostic,
|
|
78
|
+
decision: mergeSupervisorWorkingDirectory(params.frozenDecision, accepted.decision),
|
|
79
|
+
durationMs: Date.now() - startedAt,
|
|
80
|
+
});
|
|
81
|
+
return accepted;
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
tracePhaseFailure(params.diagnostic, startedAt, error);
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function captureAcceptedPhase(parsed, requestSteering) {
|
|
89
|
+
if (!parsed.ok) {
|
|
90
|
+
return parsed;
|
|
91
|
+
}
|
|
92
|
+
return Object.freeze({
|
|
93
|
+
ok: true,
|
|
94
|
+
decision: Object.freeze({
|
|
95
|
+
decision: parsed.decision,
|
|
96
|
+
steeringVersion: requestSteering.snapshot().version,
|
|
97
|
+
}),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export function requiresWorkingDirectory(decision) {
|
|
101
|
+
return (decision.action === "invoke_role" &&
|
|
102
|
+
(decision.roleId === "planner" || decision.roleId === "worker"));
|
|
103
|
+
}
|
|
104
|
+
function tracePhaseFailure(diagnostic, startedAt, error) {
|
|
105
|
+
traceSupervisorModelFailed({
|
|
106
|
+
diagnostic,
|
|
107
|
+
durationMs: Date.now() - startedAt,
|
|
108
|
+
errorType: error instanceof Error && error.name ? error.name : typeof error,
|
|
109
|
+
invalidStructuredOutput: error instanceof StructuredModelInvalidOutputError,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
export function tracePhaseSuperseded(params) {
|
|
113
|
+
traceSupervisorDecisionPhaseSuperseded({
|
|
114
|
+
diagnostic: params.diagnostic,
|
|
115
|
+
routingSteeringVersion: params.routingSteeringVersion,
|
|
116
|
+
currentSteeringVersion: params.requestSteering.snapshot().version,
|
|
117
|
+
...(params.workingDirectorySteeringVersion === undefined
|
|
118
|
+
? {}
|
|
119
|
+
: {
|
|
120
|
+
workingDirectorySteeringVersion: params.workingDirectorySteeringVersion,
|
|
121
|
+
}),
|
|
122
|
+
checkpoint: params.checkpoint,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
@@ -16,6 +16,8 @@ export declare function traceSupervisorContextProjected(params: {
|
|
|
16
16
|
completedChildSummaryLength: number;
|
|
17
17
|
allowedRoleIds: readonly SupervisorDelegateRoleId[];
|
|
18
18
|
allowMemoryRecall: boolean;
|
|
19
|
+
allowSkillAuthoring?: boolean;
|
|
20
|
+
allowSkillReads?: boolean;
|
|
19
21
|
workerCapabilityAffordances: readonly SupervisorWorkerCapabilityAffordance[];
|
|
20
22
|
availableWorkerCapabilityCatalog: readonly WorkerCapabilityCatalogGroup[];
|
|
21
23
|
capabilityBrief: CapabilityBriefProjection;
|
|
@@ -52,7 +54,7 @@ export declare function traceSupervisorAcknowledgementNormalized(params: {
|
|
|
52
54
|
export declare function traceSupervisorDecisionRejected(params: {
|
|
53
55
|
diagnostic: SupervisorDecisionDiagnosticContext;
|
|
54
56
|
issues: readonly SupervisorDecisionValidationIssue[];
|
|
55
|
-
selectedAction?: SupervisorDecision["action"];
|
|
57
|
+
selectedAction?: SupervisorDecision["action"] | SupervisorRoutingDecision["action"];
|
|
56
58
|
}): void;
|
|
57
59
|
export declare function traceSupervisorModelStarted(params: {
|
|
58
60
|
diagnostic: SupervisorDecisionDiagnosticContext;
|
|
@@ -62,6 +64,8 @@ export declare function traceSupervisorModelStarted(params: {
|
|
|
62
64
|
includeTitle: boolean;
|
|
63
65
|
allowedRoleIds: readonly SupervisorDelegateRoleId[];
|
|
64
66
|
allowMemoryRecall: boolean;
|
|
67
|
+
allowSkillAuthoring?: boolean;
|
|
68
|
+
allowSkillReads?: boolean;
|
|
65
69
|
availableWorkerCapabilityCatalog: readonly WorkerCapabilityCatalogGroup[];
|
|
66
70
|
}): void;
|
|
67
71
|
export declare function traceSupervisorModelCompleted(params: {
|
|
@@ -286,5 +286,9 @@ function projectSupervisorAllowedActions(params) {
|
|
|
286
286
|
: ["respond"];
|
|
287
287
|
if (params.allowMemoryRecall)
|
|
288
288
|
actions.push("recall_memory");
|
|
289
|
+
if (params.allowSkillReads)
|
|
290
|
+
actions.push("list_skills", "read_skills");
|
|
291
|
+
if (params.allowSkillAuthoring)
|
|
292
|
+
actions.push("author_skill");
|
|
289
293
|
return actions;
|
|
290
294
|
}
|
|
@@ -6,6 +6,7 @@ export declare function createSupervisorDecisionFormat(params?: Readonly<{
|
|
|
6
6
|
includeTitle?: boolean;
|
|
7
7
|
includeResponseRecommendation?: boolean;
|
|
8
8
|
allowMemoryRecall?: boolean;
|
|
9
|
+
allowSkillAuthoring?: boolean;
|
|
9
10
|
allowedRoleIds?: readonly SupervisorDelegateRoleId[];
|
|
10
11
|
availableWorkerCapabilityCatalog?: readonly WorkerCapabilityCatalogGroup[];
|
|
11
12
|
}>): ModelGatewayJsonSchemaFormat;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createMemoryRecallDecisionSchema } from "../memory-recall-decision.js";
|
|
2
|
+
import { SUPERVISOR_SKILL_AUTHORING_ROUTE_SCHEMA } from "../supervisor-skill-authoring/contract.js";
|
|
2
3
|
import { createStructuredDecisionEnvelopeSchema, structuredDecisionVariantSchemaPath, } from "../../model/structured-decision-envelope.js";
|
|
3
4
|
import { SUPERVISOR_RESPONSE_RECOMMENDATION_MAX_LENGTH } from "./response-recommendation.js";
|
|
4
5
|
import { createWorkerCapabilityScopeDecisionContract } from "../worker-capability-scope-decision.js";
|
|
@@ -38,6 +39,7 @@ export function createSupervisorDecisionFormat(params = {}) {
|
|
|
38
39
|
const variants = [
|
|
39
40
|
respondSchema(includeAcknowledgement, includeTitle, includeResponseRecommendation),
|
|
40
41
|
...invokeVariants,
|
|
42
|
+
...(params.allowSkillAuthoring ? [SUPERVISOR_SKILL_AUTHORING_ROUTE_SCHEMA] : []),
|
|
41
43
|
...(params.allowMemoryRecall
|
|
42
44
|
? [
|
|
43
45
|
createMemoryRecallDecisionSchema({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RoleCallLedgerHead } from "../../orchestration/role-calls/index.js";
|
|
1
2
|
import type { ChatMessage, ModelGatewayJsonSchemaFormat } from "../../../model-gateway/types.js";
|
|
2
3
|
import type { ToolAvailabilityEntry } from "../../../capabilities/tool-types.js";
|
|
3
4
|
import type { RequestContextProjection } from "../../context/request-context-contracts.js";
|
|
@@ -5,12 +6,15 @@ import { type RequestToolResultsView } from "../../context/request-tool-results.
|
|
|
5
6
|
import { type WorkerCapabilityCatalogGroup } from "../../orchestration/worker-capabilities/index.js";
|
|
6
7
|
import type { RequestExecutionSeed } from "../../request/contracts.js";
|
|
7
8
|
import { SUPERVISOR_DECISION_MODEL_STEP, type SupervisorDecisionDiagnosticContext, type SupervisorDelegateRoleId, type SupervisorResumeContext, type SupervisorWorkerCapabilityAffordance } from "./contracts.js";
|
|
8
|
-
|
|
9
|
+
import { type SupervisorArtifactPathsProjection } from "./artifact-paths.js";
|
|
10
|
+
export type SupervisorDecisionInputRequest = Pick<RequestExecutionSeed, "requestId" | "prompt" | "historyMessages" | "sessionKind" | "runnerConfig" | "attachments" | "agentMode" | "modelPreference" | "modelPolicy"> & Partial<Pick<RequestExecutionSeed, "shouldGenerateSessionTitle" | "onEvent" | "temporalContext" | "scheduledExecution" | "sessionMemory" | "sessionArtifactPaths" | "longTermMemory">>;
|
|
9
11
|
export declare function buildSupervisorDecisionInput(request: SupervisorDecisionInputRequest, options: Readonly<{
|
|
10
12
|
toolResults: RequestToolResultsView;
|
|
13
|
+
skillReadHead?: RoleCallLedgerHead;
|
|
11
14
|
includeAcknowledgement?: boolean;
|
|
12
15
|
includeTitle?: boolean;
|
|
13
16
|
allowMemoryRecall?: boolean;
|
|
17
|
+
allowSkillAuthoring?: boolean;
|
|
14
18
|
memoryRecallMessage?: ChatMessage;
|
|
15
19
|
initialMemoryMessage?: ChatMessage;
|
|
16
20
|
allowedRoleIds?: readonly SupervisorDelegateRoleId[];
|
|
@@ -28,7 +32,9 @@ export declare function buildSupervisorDecisionInput(request: SupervisorDecision
|
|
|
28
32
|
includeTitle: boolean;
|
|
29
33
|
includeResponseRecommendation: boolean;
|
|
30
34
|
allowMemoryRecall: boolean;
|
|
35
|
+
allowSkillAuthoring: boolean;
|
|
31
36
|
allowedRoleIds: readonly SupervisorDelegateRoleId[];
|
|
32
37
|
workerCapabilityAffordances: readonly SupervisorWorkerCapabilityAffordance[];
|
|
33
38
|
availableWorkerCapabilityCatalog: readonly WorkerCapabilityCatalogGroup[];
|
|
39
|
+
artifactPathsProjection?: SupervisorArtifactPathsProjection;
|
|
34
40
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { projectSupervisorSkillReadContext } from "../../context/core-skill-read-context.js";
|
|
1
2
|
import { buildSparkConversationInstructions } from "../../context/spark-conversation-policy.js";
|
|
2
3
|
import { projectCapabilityBrief } from "../../context/capability-brief.js";
|
|
3
4
|
import { resolveConfiguredStepInstructionMetadata } from "../../config/runner/step-instructions.js";
|
|
4
5
|
import { projectRequestContext } from "../../context/request-context.js";
|
|
5
6
|
import { projectRootSessionMemory } from "../../context/session-memory/root-projection.js";
|
|
6
|
-
import { buildConversationMemoryAvailabilityInstructions } from "../../long-term-memory/conversation-authoring/prompt.js";
|
|
7
7
|
import { buildRequestTemporalContextMessage } from "../../context/request-temporal-context.js";
|
|
8
8
|
import { projectScheduledExecutionContext } from "../../context/scheduled-execution-context.js";
|
|
9
9
|
import { buildRequestToolResultsMessage, } from "../../context/request-tool-results.js";
|
|
@@ -12,7 +12,8 @@ import { WORKER_CAPABILITY_COUNT_MAX, WORKER_CAPABILITY_SUMMARY_MAX_LENGTH, } fr
|
|
|
12
12
|
import { SUPERVISOR_DECISION_MODEL_STEP, SUPERVISOR_DELEGATE_ROLE_IDS, } from "./contracts.js";
|
|
13
13
|
import { traceSupervisorChildResultProjected, traceSupervisorContextProjected, } from "./diagnostics.js";
|
|
14
14
|
import { createSupervisorDecisionFormat } from "./format.js";
|
|
15
|
-
import {
|
|
15
|
+
import { projectSupervisorArtifactPaths, } from "./artifact-paths.js";
|
|
16
|
+
import { buildSupervisorDecisionInstructions, buildSupervisorMemoryAvailabilityInstructions, } from "./prompt.js";
|
|
16
17
|
import { buildSupervisorContinuationPart } from "./resume.js";
|
|
17
18
|
import { buildSupervisorMemoryRecallContinuationParts } from "./memory-recall-continuation.js";
|
|
18
19
|
import { canRecommendDirectSupervisorResponse } from "./response-recommendation.js";
|
|
@@ -43,6 +44,7 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
43
44
|
: EMPTY_WORKER_CAPABILITY_AFFORDANCES;
|
|
44
45
|
const format = createSupervisorDecisionFormat({
|
|
45
46
|
allowMemoryRecall: options.allowMemoryRecall === true,
|
|
47
|
+
allowSkillAuthoring: options.allowSkillAuthoring === true,
|
|
46
48
|
includeAcknowledgement,
|
|
47
49
|
includeTitle,
|
|
48
50
|
includeResponseRecommendation,
|
|
@@ -65,7 +67,9 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
65
67
|
const initialMemoryMessage = options.memoryRecallMessage
|
|
66
68
|
? undefined
|
|
67
69
|
: options.initialMemoryMessage;
|
|
70
|
+
const skillReadContext = projectSupervisorSkillReadContext(options.skillReadHead);
|
|
68
71
|
const referenceMessages = [
|
|
72
|
+
...skillReadContext.referenceMessages,
|
|
69
73
|
...(initialMemoryMessage ? [initialMemoryMessage] : []),
|
|
70
74
|
...(request.temporalContext
|
|
71
75
|
? [buildRequestTemporalContextMessage(request.temporalContext)]
|
|
@@ -90,6 +94,7 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
90
94
|
const instructions = [
|
|
91
95
|
buildSupervisorDecisionInstructions({
|
|
92
96
|
allowMemoryRecall: options.allowMemoryRecall === true,
|
|
97
|
+
allowSkillAuthoring: options.allowSkillAuthoring === true,
|
|
93
98
|
hasMemoryRecallContext: options.memoryRecallMessage !== undefined,
|
|
94
99
|
hasInitialMemoryContext: initialMemoryMessage !== undefined,
|
|
95
100
|
includeAcknowledgement,
|
|
@@ -101,7 +106,7 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
101
106
|
workerCapabilityAffordances,
|
|
102
107
|
availableWorkerCapabilityCatalog,
|
|
103
108
|
}),
|
|
104
|
-
...
|
|
109
|
+
...buildSupervisorMemoryAvailabilityInstructions(request.longTermMemory?.enabled === true),
|
|
105
110
|
...buildSparkConversationInstructions(request.sessionKind),
|
|
106
111
|
].join("\n");
|
|
107
112
|
const scheduledExecution = projectScheduledExecutionContext(request, instructions, "decision");
|
|
@@ -114,14 +119,17 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
114
119
|
prompt: request.prompt,
|
|
115
120
|
...(request.attachments ? { attachments: request.attachments } : {}),
|
|
116
121
|
...(referenceMessages.length > 0 ? { referenceMessages } : {}),
|
|
117
|
-
continuationParts:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
continuationParts: [
|
|
123
|
+
...(options.memoryRecallMessage
|
|
124
|
+
? buildSupervisorMemoryRecallContinuationParts({
|
|
125
|
+
memoryRecallMessage: options.memoryRecallMessage,
|
|
126
|
+
...(options.resume ? { resume: options.resume } : {}),
|
|
127
|
+
currentCallId: requireSupervisorCallId(diagnostic),
|
|
128
|
+
currentInvocationAttempt: requireSupervisorInvocationAttempt(diagnostic),
|
|
129
|
+
})
|
|
130
|
+
: roleContinuationParts),
|
|
131
|
+
...skillReadContext.continuationParts,
|
|
132
|
+
],
|
|
125
133
|
budget,
|
|
126
134
|
diagnostic,
|
|
127
135
|
...(request.onEvent ? { onEvent: request.onEvent } : {}),
|
|
@@ -139,13 +147,22 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
139
147
|
});
|
|
140
148
|
if (capabilityBrief.message)
|
|
141
149
|
referenceMessages.push(capabilityBrief.message);
|
|
150
|
+
const artifactPaths = projectSupervisorArtifactPaths({
|
|
151
|
+
targets: request.sessionArtifactPaths,
|
|
152
|
+
context: { ...contextInput, referenceMessages },
|
|
153
|
+
additionalBudgetMessages: options.capabilityBriefBudgetMessages,
|
|
154
|
+
});
|
|
155
|
+
if (artifactPaths)
|
|
156
|
+
referenceMessages.push(artifactPaths.message);
|
|
142
157
|
const context = projectRequestContext({
|
|
143
158
|
...contextInput,
|
|
159
|
+
instructions: artifactPaths?.instructions ?? contextInput.instructions,
|
|
144
160
|
...(referenceMessages.length > 0 ? { referenceMessages } : {}),
|
|
145
161
|
});
|
|
146
162
|
traceSupervisorContextProjected({
|
|
147
163
|
diagnostic,
|
|
148
164
|
allowMemoryRecall: options.allowMemoryRecall === true,
|
|
165
|
+
allowSkillAuthoring: options.allowSkillAuthoring === true,
|
|
149
166
|
context,
|
|
150
167
|
format,
|
|
151
168
|
historyMessageCount: sessionMemory.historyMessages.length,
|
|
@@ -178,9 +195,11 @@ export function buildSupervisorDecisionInput(request, options) {
|
|
|
178
195
|
includeTitle,
|
|
179
196
|
includeResponseRecommendation,
|
|
180
197
|
allowMemoryRecall: options.allowMemoryRecall === true,
|
|
198
|
+
allowSkillAuthoring: options.allowSkillAuthoring === true,
|
|
181
199
|
allowedRoleIds,
|
|
182
200
|
workerCapabilityAffordances,
|
|
183
201
|
availableWorkerCapabilityCatalog,
|
|
202
|
+
...(artifactPaths ? { artifactPathsProjection: artifactPaths } : {}),
|
|
184
203
|
};
|
|
185
204
|
}
|
|
186
205
|
const EMPTY_WORKER_CAPABILITY_AFFORDANCES = Object.freeze([]);
|
|
@@ -5,6 +5,7 @@ export declare function parseSupervisorDecisionOutput(text: string, options?: Re
|
|
|
5
5
|
includeTitle?: boolean;
|
|
6
6
|
includeResponseRecommendation?: boolean;
|
|
7
7
|
allowMemoryRecall?: boolean;
|
|
8
|
+
allowSkillAuthoring?: boolean;
|
|
8
9
|
allowedRoleIds?: readonly SupervisorDelegateRoleId[];
|
|
9
10
|
availableWorkerCapabilityCatalog?: readonly WorkerCapabilityCatalogGroup[];
|
|
10
11
|
diagnostic?: SupervisorDecisionDiagnosticContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isSupervisorDelegateRoleId, SUPERVISOR_ACKNOWLEDGEMENT_MAX_LENGTH, SUPERVISOR_DECISION_ACTIONS, SUPERVISOR_DELEGATE_ROLE_IDS, SUPERVISOR_OBJECTIVE_MAX_LENGTH, SUPERVISOR_TITLE_MAX_LENGTH, } from "./contracts.js";
|
|
2
|
+
import { parseSupervisorSkillAuthoringRoute } from "../supervisor-skill-authoring/contract.js";
|
|
2
3
|
import { createWorkerCapabilityScopeDecisionContract, parseWorkerCapabilityScopeDecision, } from "../worker-capability-scope-decision.js";
|
|
3
4
|
import { traceSupervisorAcknowledgementNormalized, traceSupervisorDecisionAccepted, traceSupervisorDecisionRejected, traceSupervisorEnvelopeAccepted, traceSupervisorEnvelopeRejected, } from "./diagnostics.js";
|
|
4
5
|
import { readStructuredDecisionEnvelope } from "../../model/structured-decision-envelope.js";
|
|
@@ -41,6 +42,16 @@ export function parseSupervisorDecisionOutput(text, options = {}) {
|
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
const issues = [];
|
|
45
|
+
if (record.action === "author_skill") {
|
|
46
|
+
const parsed = parseSupervisorSkillAuthoringRoute(record, options.allowSkillAuthoring === true);
|
|
47
|
+
if (diagnostic) {
|
|
48
|
+
if (parsed.ok)
|
|
49
|
+
traceSupervisorDecisionAccepted({ diagnostic, decision: parsed.decision });
|
|
50
|
+
else
|
|
51
|
+
traceSupervisorDecisionRejected({ diagnostic, selectedAction: "author_skill", issues: parsed.issues });
|
|
52
|
+
}
|
|
53
|
+
return parsed.ok ? parsed : { ...parsed, stage: "domain_parser" };
|
|
54
|
+
}
|
|
44
55
|
if (isMemoryRecallDecisionRecord(record)) {
|
|
45
56
|
const recalled = parseMemoryRecallDecision(record, {
|
|
46
57
|
allowMemoryRecall: options.allowMemoryRecall,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ModelGatewayJsonSchemaFormat } from "../../../model-gateway/types.js";
|
|
2
|
+
import type { RequestExecutionScope } from "../../request/execution-scope.js";
|
|
3
|
+
import type { KnowledgeSkillMetadata } from "../../knowledge-skills/store.js";
|
|
4
|
+
import { type SupervisorDecisionDiagnosticContext } from "./contracts.js";
|
|
5
|
+
/** Preparation sees the current request, not routing state or prior tool/document bodies. */
|
|
6
|
+
export declare function buildSupervisorPreparationInput(request: RequestExecutionScope, options: {
|
|
7
|
+
instructions: string;
|
|
8
|
+
format: ModelGatewayJsonSchemaFormat;
|
|
9
|
+
diagnostic: SupervisorDecisionDiagnosticContext;
|
|
10
|
+
availableSkills?: readonly KnowledgeSkillMetadata[];
|
|
11
|
+
expandedCatalog?: boolean;
|
|
12
|
+
}): {
|
|
13
|
+
format: ModelGatewayJsonSchemaFormat;
|
|
14
|
+
context: Readonly<{
|
|
15
|
+
messages: import("../../../model-gateway/types.js").ChatMessage[];
|
|
16
|
+
selectedHistoryMessageIds: string[];
|
|
17
|
+
omittedHistoryMessageIds: string[];
|
|
18
|
+
budget: import("../../context/request-context-contracts.js").RequestContextBudgetEstimate & {
|
|
19
|
+
parts: import("../../context/request-context-contracts.js").RequestContextBudgetParts;
|
|
20
|
+
};
|
|
21
|
+
compaction: Readonly<{
|
|
22
|
+
applied: boolean;
|
|
23
|
+
compactedSourceRefs: readonly string[];
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
};
|