@abot-ai/runtime 1.8.0 → 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/README.md +216 -222
- package/dist/scripts/runtime-setup-files.js +46 -2
- package/dist/src/capabilities/tool-definition-validator/definition-parser.js +8 -0
- package/dist/src/capabilities/tool-types.d.ts +4 -0
- 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/model-gateway/protocol/message-contract.d.ts +1 -0
- package/dist/src/model-gateway/protocol/message-contract.js +1 -1
- package/dist/src/model-gateway/server/chat-handler.js +5 -7
- package/dist/src/model-gateway/server/chat-stream-response.d.ts +7 -0
- package/dist/src/model-gateway/server/chat-stream-response.js +25 -0
- 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/adapters/registered-tool-worker-capabilities/payload-rejection.d.ts +2 -2
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/payload-rejection.js +2 -2
- package/dist/src/runtime/adapters/registered-tool-worker-capabilities/prepared-execution.js +17 -11
- 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/capabilities/tool-availability.js +6 -0
- package/dist/src/runtime/composition.d.ts +5 -0
- package/dist/src/runtime/context/capability-brief.d.ts +2 -2
- package/dist/src/runtime/context/capability-brief.js +3 -3
- package/dist/src/runtime/context/capability-descriptions.d.ts +3 -2
- package/dist/src/runtime/context/capability-descriptions.js +57 -20
- 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 +7 -1
- package/dist/src/runtime/long-term-memory/conversation-authoring/context.js +51 -25
- 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 +18 -0
- package/dist/src/runtime/long-term-memory/initial-context.js +57 -0
- package/dist/src/runtime/long-term-memory/projection.js +1 -1
- 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 +4 -1
- package/dist/src/runtime/orchestration/role-calls/checkpoint-state.d.ts +1 -1
- package/dist/src/runtime/orchestration/role-calls/checkpoint-state.js +7 -3
- 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 +8 -4
- package/dist/src/runtime/orchestration/role-calls/contracts.js +3 -3
- package/dist/src/runtime/orchestration/role-calls/ledger.d.ts +2 -1
- package/dist/src/runtime/orchestration/role-calls/ledger.js +2 -2
- package/dist/src/runtime/orchestration/role-calls/memory-recall-contract.d.ts +7 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-state-validation.d.ts +2 -0
- package/dist/src/runtime/orchestration/role-calls/memory-recall-state-validation.js +88 -0
- package/dist/src/runtime/orchestration/role-calls/reducer.d.ts +1 -1
- package/dist/src/runtime/orchestration/role-calls/reducer.js +2 -1
- 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 +4 -2
- package/dist/src/runtime/orchestration/worker-capabilities/contracts.js +2 -2
- package/dist/src/runtime/orchestration/worker-capabilities/execution/approval-group.js +10 -4
- package/dist/src/runtime/orchestration/worker-capabilities/execution/execution-freshness.d.ts +5 -0
- package/dist/src/runtime/orchestration/worker-capabilities/execution/execution-freshness.js +31 -0
- 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/plugins/manifest-projection.js +3 -0
- 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/capability-execution-freshness.js +6 -1
- package/dist/src/runtime/request/contracts.d.ts +2 -0
- package/dist/src/runtime/request/execution-agent-root-execution.js +11 -1
- 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 +13 -1
- package/dist/src/runtime/request/root-execution-kernel.js +36 -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 +19 -3
- package/dist/src/runtime/request/super-payload-context-failure.js +13 -4
- package/dist/src/runtime/request/supervisor-root-execution.js +54 -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/contracts.d.ts +10 -0
- package/dist/src/runtime/steps/execution-agent/decision-parsing.js +13 -1
- package/dist/src/runtime/steps/execution-agent/direct-response-configuration.d.ts +3 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-configuration.js +64 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-contract.d.ts +7 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-contract.js +56 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-policy.d.ts +9 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-policy.js +30 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-prompt.d.ts +7 -0
- package/dist/src/runtime/steps/execution-agent/direct-response-prompt.js +43 -0
- package/dist/src/runtime/steps/execution-agent/format.js +2 -0
- package/dist/src/runtime/steps/execution-agent/input.d.ts +2 -0
- package/dist/src/runtime/steps/execution-agent/input.js +35 -2
- package/dist/src/runtime/steps/execution-agent/plugin-catalog.d.ts +4 -0
- package/dist/src/runtime/steps/execution-agent/plugin-catalog.js +8 -0
- package/dist/src/runtime/steps/execution-agent/prompt.d.ts +1 -0
- package/dist/src/runtime/steps/execution-agent/prompt.js +42 -41
- 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 +6 -12
- package/dist/src/runtime/steps/execution-agent/run.js +5 -2
- package/dist/src/runtime/steps/execution-agent/state-context.d.ts +2 -3
- package/dist/src/runtime/steps/execution-agent/state-context.js +3 -40
- 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 +4 -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 +29 -49
- 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 +8 -1
- package/dist/src/runtime/steps/supervisor-decision/input.js +35 -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 +5 -0
- package/dist/src/runtime/steps/supervisor-decision/prompt.js +97 -106
- 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 +7 -0
- package/dist/src/runtime/steps/supervisor-decision/run.js +76 -158
- 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 +7 -0
- package/dist/src/runtime/steps/supervisor-response/run.js +3 -6
- 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/ARCHITECTURE.md +1 -1
- package/dist/src/web-ui/app/app-bootstrap.js +3 -0
- package/dist/src/web-ui/app/app.js +7 -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/timeline.js +3 -2
- 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/dashboard/compact-layout.js +137 -0
- package/dist/src/web-ui/app/components/dashboard/icons.js +5 -0
- package/dist/src/web-ui/app/components/dashboard/widget-card.js +85 -0
- package/dist/src/web-ui/app/components/dashboard/widget-dialog.js +83 -0
- package/dist/src/web-ui/app/components/dashboard/widget-summaries.js +155 -0
- package/dist/src/web-ui/app/components/dashboard/workspace.js +28 -4
- package/dist/src/web-ui/app/components/onboarding-workspace-access.js +1 -1
- package/dist/src/web-ui/app/components/operations-summary.js +2 -1
- package/dist/src/web-ui/app/components/passive-learning/home-widget-preview.js +32 -0
- package/dist/src/web-ui/app/components/passive-learning/home.js +4 -1
- package/dist/src/web-ui/app/components/schedules/details.js +3 -2
- package/dist/src/web-ui/app/components/skills/workspace.js +119 -0
- package/dist/src/web-ui/app/components/spark-chat/panel.js +1 -1
- package/dist/src/web-ui/app/components/spark-chat/settings.js +1 -1
- package/dist/src/web-ui/app/components/system-host/home-widget-permission-preview.js +75 -0
- package/dist/src/web-ui/app/components/system-host/home-widget-summary.js +93 -0
- package/dist/src/web-ui/app/components/system-host/macos-permission-rendering.js +2 -2
- package/dist/src/web-ui/app/components/system-host/native-windows-access.js +1 -1
- package/dist/src/web-ui/app/components/system-host/rendering.js +3 -3
- package/dist/src/web-ui/app/components/system-host/windows-store-setup.js +2 -2
- package/dist/src/web-ui/app/components/workspace-shell.js +11 -1
- package/dist/src/web-ui/app/computer-access-feature.js +13 -1
- package/dist/src/web-ui/app/configuration-feature.js +2 -0
- 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/operations-controller.js +2 -1
- package/dist/src/web-ui/app/controllers/realtime-event-controller.js +22 -1
- package/dist/src/web-ui/app/controllers/reasoning-mode-controller.js +1 -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/dashboard-feature.js +9 -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/reasoning-controls.js +6 -1
- 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/passive-learning-feature.js +2 -2
- 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 +110 -0
- package/dist/src/web-ui/app/styles.css +2 -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/plugins.md +37 -32
- package/docs/runtime-public-contracts.md +37 -0
- package/examples/request-runner.config.example.json +3 -0
- package/package.json +1 -1
- package/plugins/capability-brief/plugin.json +1 -1
- package/plugins/code-outline/plugin.json +1 -1
- package/plugins/document-reader/plugin.json +1 -1
- package/plugins/exec/plugin.json +1 -1
- package/plugins/filesystem/plugin.json +1 -1
- package/plugins/json-inspector/plugin.json +1 -1
- package/plugins/local-search/plugin.json +1 -1
- package/plugins/memory/plugin.json +1 -1
- package/plugins/project-orientation/plugin.json +1 -1
- package/plugins/system/plugin.json +1 -1
- package/plugins/system-probe/plugin.json +1 -1
- package/plugins/web/plugin.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
|
@@ -2,6 +2,7 @@ import { invokeStructuredModelStep, StructuredModelInvalidOutputError, } from ".
|
|
|
2
2
|
import { emitRuntimeStatus } from "../../events/runtime-status.js";
|
|
3
3
|
import { classifyRuntimeErrorType } from "../../observability/error-type.js";
|
|
4
4
|
import { createModelStepCompactionController } from "../../context/model-step-compaction.js";
|
|
5
|
+
import { buildCoreSkillReadContextMessages } from "../../context/core-skill-read-context.js";
|
|
5
6
|
import { superCompactionFailureOwner } from "../../context/super-compaction-failure-owner.js";
|
|
6
7
|
import { createRoleCallReviewerVerdictReceipt } from "../../orchestration/role-calls/index.js";
|
|
7
8
|
import { REVIEWER_DECISION_MODEL_STEP, } from "./contracts.js";
|
|
@@ -77,6 +78,7 @@ export const GENERIC_REVIEWER_EXECUTOR = Object.freeze({
|
|
|
77
78
|
message: "Reviewing high-level completion...",
|
|
78
79
|
});
|
|
79
80
|
const budget = resolveReviewerDecisionContextBudget(context);
|
|
81
|
+
const skillGuidanceMessages = buildCoreSkillReadContextMessages(ledger.current(), "delegate");
|
|
80
82
|
const emptyReferenceDataBudget = Object.freeze({
|
|
81
83
|
maxTokens: 0,
|
|
82
84
|
...(budget.tokenEstimation
|
|
@@ -107,6 +109,7 @@ export const GENERIC_REVIEWER_EXECUTOR = Object.freeze({
|
|
|
107
109
|
call,
|
|
108
110
|
snapshot: budgetAssessmentSnapshot,
|
|
109
111
|
budget,
|
|
112
|
+
skillGuidanceMessages,
|
|
110
113
|
});
|
|
111
114
|
const referenceDataBudget = resolveReviewerReferenceDataBudget({
|
|
112
115
|
context,
|
|
@@ -114,6 +117,7 @@ export const GENERIC_REVIEWER_EXECUTOR = Object.freeze({
|
|
|
114
117
|
budget,
|
|
115
118
|
baseAssessment,
|
|
116
119
|
projectSnapshot,
|
|
120
|
+
skillGuidanceMessages,
|
|
117
121
|
});
|
|
118
122
|
const snapshot = projectSnapshot(referenceDataBudget, true);
|
|
119
123
|
const decision = await runReviewerDecision(context, {
|
|
@@ -121,6 +125,7 @@ export const GENERIC_REVIEWER_EXECUTOR = Object.freeze({
|
|
|
121
125
|
snapshot,
|
|
122
126
|
budget,
|
|
123
127
|
referenceDataBudget,
|
|
128
|
+
skillGuidanceMessages,
|
|
124
129
|
});
|
|
125
130
|
const receipt = createRoleCallReviewerVerdictReceipt({
|
|
126
131
|
reviewerCallId: call.callId,
|
|
@@ -158,6 +163,7 @@ function resolveReviewerReferenceDataBudget(params) {
|
|
|
158
163
|
call: params.call,
|
|
159
164
|
snapshot: candidateSnapshot,
|
|
160
165
|
budget: params.budget,
|
|
166
|
+
skillGuidanceMessages: params.skillGuidanceMessages,
|
|
161
167
|
});
|
|
162
168
|
if (assessment.fits &&
|
|
163
169
|
assessment.budget.estimatedInputTokens <= inputTokenCeiling) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type SkillReadPresentation = Readonly<{
|
|
2
|
+
acknowledgement?: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
}>;
|
|
5
|
+
export type SkillReadDecision = SkillReadPresentation & (Readonly<{
|
|
6
|
+
action: "list_skills";
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
action: "read_skills";
|
|
9
|
+
skillIds: readonly string[];
|
|
10
|
+
}>);
|
|
11
|
+
type SkillReadPresentationContract = Readonly<{
|
|
12
|
+
includeAcknowledgement?: boolean;
|
|
13
|
+
includeTitle?: boolean;
|
|
14
|
+
acknowledgementMaxLength: number;
|
|
15
|
+
titleMaxLength: number;
|
|
16
|
+
}>;
|
|
17
|
+
type SkillReadValidationIssue = Readonly<{
|
|
18
|
+
code: string;
|
|
19
|
+
path: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function createSkillReadDecisionSchemas(options: SkillReadPresentationContract): readonly Record<string, unknown>[];
|
|
23
|
+
export declare function isSkillReadDecisionRecord(record: Readonly<Record<string, unknown>>): boolean;
|
|
24
|
+
export declare function parseSkillReadDecision(record: Readonly<Record<string, unknown>>, options: SkillReadPresentationContract & Readonly<{
|
|
25
|
+
allowSkillReads?: boolean;
|
|
26
|
+
}>): Readonly<{
|
|
27
|
+
ok: true;
|
|
28
|
+
decision: SkillReadDecision;
|
|
29
|
+
}> | Readonly<{
|
|
30
|
+
ok: false;
|
|
31
|
+
stage: "domain_parser";
|
|
32
|
+
issues: readonly SkillReadValidationIssue[];
|
|
33
|
+
}>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { isKnowledgeSkillReadReference, KNOWLEDGE_SKILL_READ_REFERENCE_MAX_LENGTH, } from "../capabilities/knowledge-skills/read-targets.js";
|
|
2
|
+
import { KNOWLEDGE_SKILL_READ_MAX_ITEMS } from "../knowledge-skills/store.js";
|
|
3
|
+
export function createSkillReadDecisionSchemas(options) {
|
|
4
|
+
const presentation = {
|
|
5
|
+
...(options.includeAcknowledgement
|
|
6
|
+
? { acknowledgement: { type: "string", minLength: 2, maxLength: options.acknowledgementMaxLength } }
|
|
7
|
+
: {}),
|
|
8
|
+
...(options.includeTitle
|
|
9
|
+
? { title: { type: "string", minLength: 2, maxLength: options.titleMaxLength } }
|
|
10
|
+
: {}),
|
|
11
|
+
};
|
|
12
|
+
return ["list_skills", "read_skills"].map((action) => {
|
|
13
|
+
const properties = {
|
|
14
|
+
action: { type: "string", enum: [action] },
|
|
15
|
+
...(action === "read_skills"
|
|
16
|
+
? { skillIds: {
|
|
17
|
+
type: "array", minItems: 1, maxItems: KNOWLEDGE_SKILL_READ_MAX_ITEMS,
|
|
18
|
+
items: { type: "string", minLength: 1, maxLength: KNOWLEDGE_SKILL_READ_REFERENCE_MAX_LENGTH },
|
|
19
|
+
} }
|
|
20
|
+
: {}),
|
|
21
|
+
...presentation,
|
|
22
|
+
};
|
|
23
|
+
return { type: "object", properties, required: Object.keys(properties), additionalProperties: false };
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export function isSkillReadDecisionRecord(record) {
|
|
27
|
+
return record.action === "list_skills" || record.action === "read_skills";
|
|
28
|
+
}
|
|
29
|
+
export function parseSkillReadDecision(record, options) {
|
|
30
|
+
if (!options.allowSkillReads)
|
|
31
|
+
return rejectSkillRead("skill_read_unavailable", "action", "Core Skill reads are not available for this decision.");
|
|
32
|
+
if (!isSkillReadDecisionRecord(record))
|
|
33
|
+
return rejectSkillRead("skill_read_action_invalid", "action", "Expected list_skills or read_skills.");
|
|
34
|
+
const expectedKeys = [
|
|
35
|
+
"action",
|
|
36
|
+
...(record.action === "read_skills" ? ["skillIds"] : []),
|
|
37
|
+
...(options.includeAcknowledgement ? ["acknowledgement"] : []),
|
|
38
|
+
...(options.includeTitle ? ["title"] : []),
|
|
39
|
+
];
|
|
40
|
+
const actualKeys = Object.keys(record);
|
|
41
|
+
if (actualKeys.length !== expectedKeys.length || actualKeys.some((key) => !expectedKeys.includes(key)))
|
|
42
|
+
return rejectSkillRead("skill_read_shape_invalid", "", "Fields must match the offered Skill action.");
|
|
43
|
+
if (record.action === "read_skills" && !hasValidSkillReadReferences(record.skillIds))
|
|
44
|
+
return rejectSkillRead("skill_read_references_invalid", "skillIds", "Supply one to eight distinct exact Skill IDs or full names.");
|
|
45
|
+
for (const [field, maximum] of [
|
|
46
|
+
["acknowledgement", options.acknowledgementMaxLength],
|
|
47
|
+
["title", options.titleMaxLength],
|
|
48
|
+
]) {
|
|
49
|
+
if (!expectedKeys.includes(field))
|
|
50
|
+
continue;
|
|
51
|
+
if (!hasBoundedSkillPresentation(record[field], maximum))
|
|
52
|
+
return rejectSkillRead("skill_read_presentation_invalid", field, "Presentation text exceeds the offered bounds.");
|
|
53
|
+
}
|
|
54
|
+
const presentation = {
|
|
55
|
+
...(options.includeAcknowledgement ? { acknowledgement: record.acknowledgement.trim() } : {}),
|
|
56
|
+
...(options.includeTitle ? { title: record.title.trim() } : {}),
|
|
57
|
+
};
|
|
58
|
+
if (record.action === "list_skills")
|
|
59
|
+
return { ok: true, decision: Object.freeze({ action: "list_skills", ...presentation }) };
|
|
60
|
+
return {
|
|
61
|
+
ok: true,
|
|
62
|
+
decision: Object.freeze({
|
|
63
|
+
action: "read_skills",
|
|
64
|
+
skillIds: Object.freeze([...record.skillIds]),
|
|
65
|
+
...presentation,
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function hasValidSkillReadReferences(value) {
|
|
70
|
+
if (!Array.isArray(value))
|
|
71
|
+
return false;
|
|
72
|
+
if (value.length === 0 || value.length > KNOWLEDGE_SKILL_READ_MAX_ITEMS)
|
|
73
|
+
return false;
|
|
74
|
+
if (!value.every(isKnowledgeSkillReadReference))
|
|
75
|
+
return false;
|
|
76
|
+
return new Set(value).size === value.length;
|
|
77
|
+
}
|
|
78
|
+
function hasBoundedSkillPresentation(value, maximum) {
|
|
79
|
+
if (typeof value !== "string")
|
|
80
|
+
return false;
|
|
81
|
+
if (value.length > maximum)
|
|
82
|
+
return false;
|
|
83
|
+
return value.trim().length >= 2;
|
|
84
|
+
}
|
|
85
|
+
function rejectSkillRead(code, field, message) {
|
|
86
|
+
return {
|
|
87
|
+
ok: false,
|
|
88
|
+
stage: "domain_parser",
|
|
89
|
+
issues: Object.freeze([{ code, path: field ? `decision.${field}` : "decision", message }]),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChatMessage, ModelGatewayJsonSchemaFormat } from "../../../model-gateway/types.js";
|
|
2
|
+
import type { projectRequestContext } from "../../context/request-context.js";
|
|
3
|
+
import type { ModelStepContextCompactionController } from "../../model/model-step-port.js";
|
|
4
|
+
import type { RequestExecutionScope } from "../../request/execution-scope.js";
|
|
5
|
+
export type SupervisorArtifactPathsProjection = Readonly<{
|
|
6
|
+
instructions: string;
|
|
7
|
+
baseInstructions: string;
|
|
8
|
+
message: ChatMessage;
|
|
9
|
+
}>;
|
|
10
|
+
/** Adds a bounded continuity reference only within the remaining full-context budget. */
|
|
11
|
+
export declare function projectSupervisorArtifactPaths(params: Readonly<{
|
|
12
|
+
targets: readonly string[] | undefined;
|
|
13
|
+
context: Parameters<typeof projectRequestContext>[0];
|
|
14
|
+
additionalBudgetMessages?: readonly ChatMessage[];
|
|
15
|
+
}>): SupervisorArtifactPathsProjection | undefined;
|
|
16
|
+
/** Optional paths yield to the current attempt's mandatory context and catalog. */
|
|
17
|
+
export declare function createSupervisorArtifactPathsReadmissionController(request: RequestExecutionScope, options: Readonly<{
|
|
18
|
+
controller: ModelStepContextCompactionController;
|
|
19
|
+
projection?: SupervisorArtifactPathsProjection;
|
|
20
|
+
format: ModelGatewayJsonSchemaFormat;
|
|
21
|
+
includeInstructions: boolean;
|
|
22
|
+
}>): ModelStepContextCompactionController;
|
|
@@ -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({
|