@warlock.js/ai 4.1.1
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 +72 -0
- package/cjs/index.cjs +8625 -0
- package/cjs/index.cjs.map +1 -0
- package/esm/agent/agent-config.type.d.mts +160 -0
- package/esm/agent/agent-config.type.d.mts.map +1 -0
- package/esm/agent/agent-input-builder.mjs +111 -0
- package/esm/agent/agent-input-builder.mjs.map +1 -0
- package/esm/agent/agent-log-event.mjs +101 -0
- package/esm/agent/agent-log-event.mjs.map +1 -0
- package/esm/agent/agent-stream.d.mts +47 -0
- package/esm/agent/agent-stream.d.mts.map +1 -0
- package/esm/agent/agent-stream.mjs +82 -0
- package/esm/agent/agent-stream.mjs.map +1 -0
- package/esm/agent/agent-to-stream-event.mjs +86 -0
- package/esm/agent/agent-to-stream-event.mjs.map +1 -0
- package/esm/agent/agent.d.mts +38 -0
- package/esm/agent/agent.d.mts.map +1 -0
- package/esm/agent/agent.mjs +974 -0
- package/esm/agent/agent.mjs.map +1 -0
- package/esm/agent/index.d.mts +3 -0
- package/esm/agent/index.mjs +4 -0
- package/esm/agent/json-stream-guard.mjs +400 -0
- package/esm/agent/json-stream-guard.mjs.map +1 -0
- package/esm/ai.d.mts +64 -0
- package/esm/ai.d.mts.map +1 -0
- package/esm/ai.mjs +65 -0
- package/esm/ai.mjs.map +1 -0
- package/esm/config.d.mts +79 -0
- package/esm/config.d.mts.map +1 -0
- package/esm/config.mjs +43 -0
- package/esm/config.mjs.map +1 -0
- package/esm/contracts/agent/agent-options.type.d.mts +132 -0
- package/esm/contracts/agent/agent-options.type.d.mts.map +1 -0
- package/esm/contracts/agent/agent.contract.d.mts +92 -0
- package/esm/contracts/agent/agent.contract.d.mts.map +1 -0
- package/esm/contracts/agent/index.d.mts +2 -0
- package/esm/contracts/attachment.type.d.mts +100 -0
- package/esm/contracts/attachment.type.d.mts.map +1 -0
- package/esm/contracts/content-part.type.d.mts +55 -0
- package/esm/contracts/content-part.type.d.mts.map +1 -0
- package/esm/contracts/conversation-message.type.d.mts +51 -0
- package/esm/contracts/conversation-message.type.d.mts.map +1 -0
- package/esm/contracts/embedder.contract.d.mts +69 -0
- package/esm/contracts/embedder.contract.d.mts.map +1 -0
- package/esm/contracts/end.type.d.mts +53 -0
- package/esm/contracts/end.type.d.mts.map +1 -0
- package/esm/contracts/end.type.mjs +47 -0
- package/esm/contracts/end.type.mjs.map +1 -0
- package/esm/contracts/events/agent-events.type.d.mts +71 -0
- package/esm/contracts/events/agent-events.type.d.mts.map +1 -0
- package/esm/contracts/events/complete-event.type.d.mts +33 -0
- package/esm/contracts/events/complete-event.type.d.mts.map +1 -0
- package/esm/contracts/events/event-identity.type.d.mts +30 -0
- package/esm/contracts/events/event-identity.type.d.mts.map +1 -0
- package/esm/contracts/events/event-map.type.d.mts +80 -0
- package/esm/contracts/events/event-map.type.d.mts.map +1 -0
- package/esm/contracts/events/index.d.mts +7 -0
- package/esm/contracts/events/supervisor-events.type.d.mts +162 -0
- package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -0
- package/esm/contracts/events/usage-event.type.d.mts +39 -0
- package/esm/contracts/events/usage-event.type.d.mts.map +1 -0
- package/esm/contracts/events/workflow-events.type.d.mts +51 -0
- package/esm/contracts/events/workflow-events.type.d.mts.map +1 -0
- package/esm/contracts/executable.contract.d.mts +25 -0
- package/esm/contracts/executable.contract.d.mts.map +1 -0
- package/esm/contracts/finish-reason.type.d.mts +17 -0
- package/esm/contracts/finish-reason.type.d.mts.map +1 -0
- package/esm/contracts/index.d.mts +63 -0
- package/esm/contracts/middleware/index.d.mts +3 -0
- package/esm/contracts/middleware/middleware-context.type.d.mts +99 -0
- package/esm/contracts/middleware/middleware-context.type.d.mts.map +1 -0
- package/esm/contracts/middleware/middleware-state.type.d.mts +34 -0
- package/esm/contracts/middleware/middleware-state.type.d.mts.map +1 -0
- package/esm/contracts/middleware/middleware.contract.d.mts +140 -0
- package/esm/contracts/middleware/middleware.contract.d.mts.map +1 -0
- package/esm/contracts/model-tool-call-request.type.d.mts +58 -0
- package/esm/contracts/model-tool-call-request.type.d.mts.map +1 -0
- package/esm/contracts/model.contract.d.mts +164 -0
- package/esm/contracts/model.contract.d.mts.map +1 -0
- package/esm/contracts/placeholders.type.d.mts +23 -0
- package/esm/contracts/placeholders.type.d.mts.map +1 -0
- package/esm/contracts/result/agent-result.type.d.mts +33 -0
- package/esm/contracts/result/agent-result.type.d.mts.map +1 -0
- package/esm/contracts/result/attempt-entry.type.d.mts +40 -0
- package/esm/contracts/result/attempt-entry.type.d.mts.map +1 -0
- package/esm/contracts/result/base-report.type.d.mts +137 -0
- package/esm/contracts/result/base-report.type.d.mts.map +1 -0
- package/esm/contracts/result/base-report.type.mjs +17 -0
- package/esm/contracts/result/base-report.type.mjs.map +1 -0
- package/esm/contracts/result/base-result.type.d.mts +26 -0
- package/esm/contracts/result/base-result.type.d.mts.map +1 -0
- package/esm/contracts/result/execute-result.type.d.mts +40 -0
- package/esm/contracts/result/execute-result.type.d.mts.map +1 -0
- package/esm/contracts/result/execution-report.type.d.mts +50 -0
- package/esm/contracts/result/execution-report.type.d.mts.map +1 -0
- package/esm/contracts/result/index.d.mts +14 -0
- package/esm/contracts/result/llm-trip.type.d.mts +36 -0
- package/esm/contracts/result/llm-trip.type.d.mts.map +1 -0
- package/esm/contracts/result/model-pricing.type.d.mts +51 -0
- package/esm/contracts/result/model-pricing.type.d.mts.map +1 -0
- package/esm/contracts/result/session-send-result.type.d.mts +29 -0
- package/esm/contracts/result/session-send-result.type.d.mts.map +1 -0
- package/esm/contracts/result/step-result.type.d.mts +43 -0
- package/esm/contracts/result/step-result.type.d.mts.map +1 -0
- package/esm/contracts/result/supervisor-result.type.d.mts +86 -0
- package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -0
- package/esm/contracts/result/tool-call.type.d.mts +44 -0
- package/esm/contracts/result/tool-call.type.d.mts.map +1 -0
- package/esm/contracts/result/usage.type.d.mts +57 -0
- package/esm/contracts/result/usage.type.d.mts.map +1 -0
- package/esm/contracts/result/workflow-result.type.d.mts +45 -0
- package/esm/contracts/result/workflow-result.type.d.mts.map +1 -0
- package/esm/contracts/sdk-adapter.contract.d.mts +77 -0
- package/esm/contracts/sdk-adapter.contract.d.mts.map +1 -0
- package/esm/contracts/stream/stream-event.type.d.mts +68 -0
- package/esm/contracts/stream/stream-event.type.d.mts.map +1 -0
- package/esm/contracts/stream/stream.contract.d.mts +61 -0
- package/esm/contracts/stream/stream.contract.d.mts.map +1 -0
- package/esm/contracts/streaming-tool-guard-config.type.d.mts +78 -0
- package/esm/contracts/streaming-tool-guard-config.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/ack-entry.type.d.mts +97 -0
- package/esm/contracts/supervisor/ack-entry.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/classifier-context.type.d.mts +189 -0
- package/esm/contracts/supervisor/classifier-context.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/dispatch-context.type.d.mts +235 -0
- package/esm/contracts/supervisor/dispatch-context.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/evaluate-context.type.d.mts +124 -0
- package/esm/contracts/supervisor/evaluate-context.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/index.d.mts +16 -0
- package/esm/contracts/supervisor/intent-entry.type.d.mts +254 -0
- package/esm/contracts/supervisor/intent-entry.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/iteration-snapshot.type.d.mts +117 -0
- package/esm/contracts/supervisor/iteration-snapshot.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/next.type.d.mts +25 -0
- package/esm/contracts/supervisor/next.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/route-context.type.d.mts +91 -0
- package/esm/contracts/supervisor/route-context.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/router-entry.type.d.mts +67 -0
- package/esm/contracts/supervisor/router-entry.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/supervisor-config.type.d.mts +356 -0
- package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts +90 -0
- package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/supervisor-input.type.d.mts +24 -0
- package/esm/contracts/supervisor/supervisor-input.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +49 -0
- package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts +16 -0
- package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts.map +1 -0
- package/esm/contracts/supervisor/supervisor.contract.d.mts +126 -0
- package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -0
- package/esm/contracts/system-prompt.contract.d.mts +118 -0
- package/esm/contracts/system-prompt.contract.d.mts.map +1 -0
- package/esm/contracts/tool.contract.d.mts +161 -0
- package/esm/contracts/tool.contract.d.mts.map +1 -0
- package/esm/contracts/workflow/index.d.mts +6 -0
- package/esm/contracts/workflow/next-step-result.type.d.mts +17 -0
- package/esm/contracts/workflow/next-step-result.type.d.mts.map +1 -0
- package/esm/contracts/workflow/retry-config.type.d.mts +19 -0
- package/esm/contracts/workflow/retry-config.type.d.mts.map +1 -0
- package/esm/contracts/workflow/step.contract.d.mts +189 -0
- package/esm/contracts/workflow/step.contract.d.mts.map +1 -0
- package/esm/contracts/workflow/workflow-context.type.d.mts +45 -0
- package/esm/contracts/workflow/workflow-context.type.d.mts.map +1 -0
- package/esm/contracts/workflow/workflow-snapshot.type.d.mts +24 -0
- package/esm/contracts/workflow/workflow-snapshot.type.d.mts.map +1 -0
- package/esm/contracts/workflow/workflow.contract.d.mts +142 -0
- package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -0
- package/esm/errors/agent-cancelled-error.d.mts +49 -0
- package/esm/errors/agent-cancelled-error.d.mts.map +1 -0
- package/esm/errors/agent-cancelled-error.mjs +43 -0
- package/esm/errors/agent-cancelled-error.mjs.map +1 -0
- package/esm/errors/agent-execution-error.d.mts +32 -0
- package/esm/errors/agent-execution-error.d.mts.map +1 -0
- package/esm/errors/agent-execution-error.mjs +35 -0
- package/esm/errors/agent-execution-error.mjs.map +1 -0
- package/esm/errors/agent-max-trips-error.d.mts +45 -0
- package/esm/errors/agent-max-trips-error.d.mts.map +1 -0
- package/esm/errors/agent-max-trips-error.mjs +41 -0
- package/esm/errors/agent-max-trips-error.mjs.map +1 -0
- package/esm/errors/ai-error.d.mts +94 -0
- package/esm/errors/ai-error.d.mts.map +1 -0
- package/esm/errors/ai-error.mjs +68 -0
- package/esm/errors/ai-error.mjs.map +1 -0
- package/esm/errors/budget-exceeded-error.d.mts +41 -0
- package/esm/errors/budget-exceeded-error.d.mts.map +1 -0
- package/esm/errors/budget-exceeded-error.mjs +31 -0
- package/esm/errors/budget-exceeded-error.mjs.map +1 -0
- package/esm/errors/content-filter-error.d.mts +33 -0
- package/esm/errors/content-filter-error.d.mts.map +1 -0
- package/esm/errors/content-filter-error.mjs +28 -0
- package/esm/errors/content-filter-error.mjs.map +1 -0
- package/esm/errors/context-length-exceeded-error.d.mts +38 -0
- package/esm/errors/context-length-exceeded-error.d.mts.map +1 -0
- package/esm/errors/context-length-exceeded-error.mjs +31 -0
- package/esm/errors/context-length-exceeded-error.mjs.map +1 -0
- package/esm/errors/error-category.type.d.mts +30 -0
- package/esm/errors/error-category.type.d.mts.map +1 -0
- package/esm/errors/error-code.type.d.mts +19 -0
- package/esm/errors/error-code.type.d.mts.map +1 -0
- package/esm/errors/guardrail-violation-error.d.mts +55 -0
- package/esm/errors/guardrail-violation-error.d.mts.map +1 -0
- package/esm/errors/guardrail-violation-error.mjs +41 -0
- package/esm/errors/guardrail-violation-error.mjs.map +1 -0
- package/esm/errors/index.d.mts +29 -0
- package/esm/errors/index.mjs +29 -0
- package/esm/errors/invalid-request-error.d.mts +27 -0
- package/esm/errors/invalid-request-error.d.mts.map +1 -0
- package/esm/errors/invalid-request-error.mjs +31 -0
- package/esm/errors/invalid-request-error.mjs.map +1 -0
- package/esm/errors/max-iterations-error.d.mts +31 -0
- package/esm/errors/max-iterations-error.d.mts.map +1 -0
- package/esm/errors/max-iterations-error.mjs +32 -0
- package/esm/errors/max-iterations-error.mjs.map +1 -0
- package/esm/errors/max-steps-exceeded-error.d.mts +20 -0
- package/esm/errors/max-steps-exceeded-error.d.mts.map +1 -0
- package/esm/errors/max-steps-exceeded-error.mjs +21 -0
- package/esm/errors/max-steps-exceeded-error.mjs.map +1 -0
- package/esm/errors/provider-auth-error.d.mts +22 -0
- package/esm/errors/provider-auth-error.d.mts.map +1 -0
- package/esm/errors/provider-auth-error.mjs +26 -0
- package/esm/errors/provider-auth-error.mjs.map +1 -0
- package/esm/errors/provider-error.d.mts +38 -0
- package/esm/errors/provider-error.d.mts.map +1 -0
- package/esm/errors/provider-error.mjs +42 -0
- package/esm/errors/provider-error.mjs.map +1 -0
- package/esm/errors/provider-rate-limit-error.d.mts +34 -0
- package/esm/errors/provider-rate-limit-error.d.mts.map +1 -0
- package/esm/errors/provider-rate-limit-error.mjs +31 -0
- package/esm/errors/provider-rate-limit-error.mjs.map +1 -0
- package/esm/errors/provider-timeout-error.d.mts +22 -0
- package/esm/errors/provider-timeout-error.d.mts.map +1 -0
- package/esm/errors/provider-timeout-error.mjs +26 -0
- package/esm/errors/provider-timeout-error.mjs.map +1 -0
- package/esm/errors/quota-exceeded-error.d.mts +36 -0
- package/esm/errors/quota-exceeded-error.d.mts.map +1 -0
- package/esm/errors/quota-exceeded-error.mjs +40 -0
- package/esm/errors/quota-exceeded-error.mjs.map +1 -0
- package/esm/errors/routing-error.d.mts +23 -0
- package/esm/errors/routing-error.d.mts.map +1 -0
- package/esm/errors/routing-error.mjs +23 -0
- package/esm/errors/routing-error.mjs.map +1 -0
- package/esm/errors/schema-validation-error.d.mts +40 -0
- package/esm/errors/schema-validation-error.d.mts.map +1 -0
- package/esm/errors/schema-validation-error.mjs +37 -0
- package/esm/errors/schema-validation-error.mjs.map +1 -0
- package/esm/errors/step-failed-error.d.mts +20 -0
- package/esm/errors/step-failed-error.d.mts.map +1 -0
- package/esm/errors/step-failed-error.mjs +19 -0
- package/esm/errors/step-failed-error.mjs.map +1 -0
- package/esm/errors/supervisor-cancelled-error.d.mts +29 -0
- package/esm/errors/supervisor-cancelled-error.d.mts.map +1 -0
- package/esm/errors/supervisor-cancelled-error.mjs +29 -0
- package/esm/errors/supervisor-cancelled-error.mjs.map +1 -0
- package/esm/errors/supervisor-drift-error.d.mts +31 -0
- package/esm/errors/supervisor-drift-error.d.mts.map +1 -0
- package/esm/errors/supervisor-drift-error.mjs +30 -0
- package/esm/errors/supervisor-drift-error.mjs.map +1 -0
- package/esm/errors/supervisor-failed-error.d.mts +40 -0
- package/esm/errors/supervisor-failed-error.d.mts.map +1 -0
- package/esm/errors/supervisor-failed-error.mjs +43 -0
- package/esm/errors/supervisor-failed-error.mjs.map +1 -0
- package/esm/errors/supervisor-routing-error.d.mts +44 -0
- package/esm/errors/supervisor-routing-error.d.mts.map +1 -0
- package/esm/errors/supervisor-routing-error.mjs +39 -0
- package/esm/errors/supervisor-routing-error.mjs.map +1 -0
- package/esm/errors/tool-execution-error.d.mts +35 -0
- package/esm/errors/tool-execution-error.d.mts.map +1 -0
- package/esm/errors/tool-execution-error.mjs +32 -0
- package/esm/errors/tool-execution-error.mjs.map +1 -0
- package/esm/errors/workflow-cancelled-error.d.mts +23 -0
- package/esm/errors/workflow-cancelled-error.d.mts.map +1 -0
- package/esm/errors/workflow-cancelled-error.mjs +23 -0
- package/esm/errors/workflow-cancelled-error.mjs.map +1 -0
- package/esm/errors/workflow-drift-error.d.mts +25 -0
- package/esm/errors/workflow-drift-error.d.mts.map +1 -0
- package/esm/errors/workflow-drift-error.mjs +24 -0
- package/esm/errors/workflow-drift-error.mjs.map +1 -0
- package/esm/errors/workflow-error.d.mts +15 -0
- package/esm/errors/workflow-error.d.mts.map +1 -0
- package/esm/errors/workflow-error.mjs +18 -0
- package/esm/errors/workflow-error.mjs.map +1 -0
- package/esm/index.d.mts +137 -0
- package/esm/index.mjs +81 -0
- package/esm/middleware/builtins/budget.d.mts +103 -0
- package/esm/middleware/builtins/budget.d.mts.map +1 -0
- package/esm/middleware/builtins/budget.mjs +100 -0
- package/esm/middleware/builtins/budget.mjs.map +1 -0
- package/esm/middleware/builtins/guardrail.d.mts +92 -0
- package/esm/middleware/builtins/guardrail.d.mts.map +1 -0
- package/esm/middleware/builtins/guardrail.mjs +76 -0
- package/esm/middleware/builtins/guardrail.mjs.map +1 -0
- package/esm/middleware/builtins/semantic-cache.d.mts +106 -0
- package/esm/middleware/builtins/semantic-cache.d.mts.map +1 -0
- package/esm/middleware/builtins/semantic-cache.mjs +149 -0
- package/esm/middleware/builtins/semantic-cache.mjs.map +1 -0
- package/esm/middleware/helpers/compose.d.mts +42 -0
- package/esm/middleware/helpers/compose.d.mts.map +1 -0
- package/esm/middleware/helpers/compose.mjs +52 -0
- package/esm/middleware/helpers/compose.mjs.map +1 -0
- package/esm/middleware/helpers/for-tool.d.mts +55 -0
- package/esm/middleware/helpers/for-tool.d.mts.map +1 -0
- package/esm/middleware/helpers/for-tool.mjs +80 -0
- package/esm/middleware/helpers/for-tool.mjs.map +1 -0
- package/esm/middleware/helpers/index.d.mts +2 -0
- package/esm/middleware/index.d.mts +8 -0
- package/esm/middleware/index.mjs +10 -0
- package/esm/middleware/pipeline.d.mts +70 -0
- package/esm/middleware/pipeline.d.mts.map +1 -0
- package/esm/middleware/pipeline.mjs +100 -0
- package/esm/middleware/pipeline.mjs.map +1 -0
- package/esm/middleware/utils/extract-user-text.d.mts +33 -0
- package/esm/middleware/utils/extract-user-text.d.mts.map +1 -0
- package/esm/middleware/utils/extract-user-text.mjs +40 -0
- package/esm/middleware/utils/extract-user-text.mjs.map +1 -0
- package/esm/middleware/utils/index.d.mts +2 -0
- package/esm/middleware/utils/namespaced-state.d.mts +60 -0
- package/esm/middleware/utils/namespaced-state.d.mts.map +1 -0
- package/esm/middleware/utils/namespaced-state.mjs +60 -0
- package/esm/middleware/utils/namespaced-state.mjs.map +1 -0
- package/esm/mock/index.d.mts +4 -0
- package/esm/mock/index.mjs +5 -0
- package/esm/mock/mock-agent.d.mts +41 -0
- package/esm/mock/mock-agent.d.mts.map +1 -0
- package/esm/mock/mock-agent.mjs +39 -0
- package/esm/mock/mock-agent.mjs.map +1 -0
- package/esm/mock/mock-config.type.d.mts +31 -0
- package/esm/mock/mock-config.type.d.mts.map +1 -0
- package/esm/mock/mock-model.d.mts +94 -0
- package/esm/mock/mock-model.d.mts.map +1 -0
- package/esm/mock/mock-model.mjs +150 -0
- package/esm/mock/mock-model.mjs.map +1 -0
- package/esm/mock/mock-sdk.d.mts +25 -0
- package/esm/mock/mock-sdk.d.mts.map +1 -0
- package/esm/mock/mock-sdk.mjs +37 -0
- package/esm/mock/mock-sdk.mjs.map +1 -0
- package/esm/supervisor/as-tool.d.mts +45 -0
- package/esm/supervisor/as-tool.d.mts.map +1 -0
- package/esm/supervisor/as-tool.mjs +80 -0
- package/esm/supervisor/as-tool.mjs.map +1 -0
- package/esm/supervisor/cancellation.d.mts +12 -0
- package/esm/supervisor/cancellation.d.mts.map +1 -0
- package/esm/supervisor/cancellation.mjs +22 -0
- package/esm/supervisor/cancellation.mjs.map +1 -0
- package/esm/supervisor/decide.mjs +272 -0
- package/esm/supervisor/decide.mjs.map +1 -0
- package/esm/supervisor/emitter.d.mts +27 -0
- package/esm/supervisor/emitter.d.mts.map +1 -0
- package/esm/supervisor/emitter.mjs +47 -0
- package/esm/supervisor/emitter.mjs.map +1 -0
- package/esm/supervisor/entries.d.mts +141 -0
- package/esm/supervisor/entries.d.mts.map +1 -0
- package/esm/supervisor/entries.mjs +206 -0
- package/esm/supervisor/entries.mjs.map +1 -0
- package/esm/supervisor/execution.d.mts +637 -0
- package/esm/supervisor/execution.d.mts.map +1 -0
- package/esm/supervisor/execution.mjs +1868 -0
- package/esm/supervisor/execution.mjs.map +1 -0
- package/esm/supervisor/index.d.mts +11 -0
- package/esm/supervisor/index.mjs +12 -0
- package/esm/supervisor/router-prompt.d.mts +56 -0
- package/esm/supervisor/router-prompt.d.mts.map +1 -0
- package/esm/supervisor/router-prompt.mjs +52 -0
- package/esm/supervisor/router-prompt.mjs.map +1 -0
- package/esm/supervisor/signature.d.mts +28 -0
- package/esm/supervisor/signature.d.mts.map +1 -0
- package/esm/supervisor/signature.mjs +89 -0
- package/esm/supervisor/signature.mjs.map +1 -0
- package/esm/supervisor/snapshot.d.mts +54 -0
- package/esm/supervisor/snapshot.d.mts.map +1 -0
- package/esm/supervisor/snapshot.mjs +77 -0
- package/esm/supervisor/snapshot.mjs.map +1 -0
- package/esm/supervisor/supervisor-stream.d.mts +29 -0
- package/esm/supervisor/supervisor-stream.d.mts.map +1 -0
- package/esm/supervisor/supervisor-stream.mjs +89 -0
- package/esm/supervisor/supervisor-stream.mjs.map +1 -0
- package/esm/supervisor/supervisor.d.mts +27 -0
- package/esm/supervisor/supervisor.d.mts.map +1 -0
- package/esm/supervisor/supervisor.mjs +138 -0
- package/esm/supervisor/supervisor.mjs.map +1 -0
- package/esm/system-prompt/instruction.d.mts +52 -0
- package/esm/system-prompt/instruction.d.mts.map +1 -0
- package/esm/system-prompt/instruction.mjs +57 -0
- package/esm/system-prompt/instruction.mjs.map +1 -0
- package/esm/system-prompt/persona.d.mts +52 -0
- package/esm/system-prompt/persona.d.mts.map +1 -0
- package/esm/system-prompt/persona.mjs +57 -0
- package/esm/system-prompt/persona.mjs.map +1 -0
- package/esm/system-prompt/render-placeholders.d.mts +31 -0
- package/esm/system-prompt/render-placeholders.d.mts.map +1 -0
- package/esm/system-prompt/render-placeholders.mjs +58 -0
- package/esm/system-prompt/render-placeholders.mjs.map +1 -0
- package/esm/system-prompt/system-prompt.d.mts +117 -0
- package/esm/system-prompt/system-prompt.d.mts.map +1 -0
- package/esm/system-prompt/system-prompt.mjs +137 -0
- package/esm/system-prompt/system-prompt.mjs.map +1 -0
- package/esm/tool/index.d.mts +1 -0
- package/esm/tool/index.mjs +3 -0
- package/esm/tool/tool.d.mts +64 -0
- package/esm/tool/tool.d.mts.map +1 -0
- package/esm/tool/tool.mjs +184 -0
- package/esm/tool/tool.mjs.map +1 -0
- package/esm/utils/compute-cost.d.mts +58 -0
- package/esm/utils/compute-cost.d.mts.map +1 -0
- package/esm/utils/compute-cost.mjs +87 -0
- package/esm/utils/compute-cost.mjs.map +1 -0
- package/esm/utils/extract-json-payload.d.mts +33 -0
- package/esm/utils/extract-json-payload.d.mts.map +1 -0
- package/esm/utils/extract-json-payload.mjs +39 -0
- package/esm/utils/extract-json-payload.mjs.map +1 -0
- package/esm/utils/generate-run-id.d.mts +20 -0
- package/esm/utils/generate-run-id.d.mts.map +1 -0
- package/esm/utils/generate-run-id.mjs +23 -0
- package/esm/utils/generate-run-id.mjs.map +1 -0
- package/esm/utils/index.d.mts +9 -0
- package/esm/utils/index.mjs +11 -0
- package/esm/utils/json-schema.d.mts +57 -0
- package/esm/utils/json-schema.d.mts.map +1 -0
- package/esm/utils/json-schema.mjs +89 -0
- package/esm/utils/json-schema.mjs.map +1 -0
- package/esm/utils/prepare-attachment-part.d.mts +36 -0
- package/esm/utils/prepare-attachment-part.d.mts.map +1 -0
- package/esm/utils/prepare-attachment-part.mjs +140 -0
- package/esm/utils/prepare-attachment-part.mjs.map +1 -0
- package/esm/utils/resolve-attachment.d.mts +33 -0
- package/esm/utils/resolve-attachment.d.mts.map +1 -0
- package/esm/utils/resolve-attachment.mjs +73 -0
- package/esm/utils/resolve-attachment.mjs.map +1 -0
- package/esm/utils/safe-json-parse.d.mts +14 -0
- package/esm/utils/safe-json-parse.d.mts.map +1 -0
- package/esm/utils/safe-json-parse.mjs +22 -0
- package/esm/utils/safe-json-parse.mjs.map +1 -0
- package/esm/utils/stamp-report-lineage.d.mts +61 -0
- package/esm/utils/stamp-report-lineage.d.mts.map +1 -0
- package/esm/utils/stamp-report-lineage.mjs +47 -0
- package/esm/utils/stamp-report-lineage.mjs.map +1 -0
- package/esm/utils/token-count.d.mts +15 -0
- package/esm/utils/token-count.d.mts.map +1 -0
- package/esm/utils/token-count.mjs +18 -0
- package/esm/utils/token-count.mjs.map +1 -0
- package/esm/workflow/as-tool.mjs +55 -0
- package/esm/workflow/as-tool.mjs.map +1 -0
- package/esm/workflow/cancellation.mjs +44 -0
- package/esm/workflow/cancellation.mjs.map +1 -0
- package/esm/workflow/emitter.mjs +40 -0
- package/esm/workflow/emitter.mjs.map +1 -0
- package/esm/workflow/engine.mjs +362 -0
- package/esm/workflow/engine.mjs.map +1 -0
- package/esm/workflow/index.d.mts +3 -0
- package/esm/workflow/index.mjs +5 -0
- package/esm/workflow/retry.mjs +32 -0
- package/esm/workflow/retry.mjs.map +1 -0
- package/esm/workflow/router.mjs +56 -0
- package/esm/workflow/router.mjs.map +1 -0
- package/esm/workflow/run-scoped-emitter.mjs +32 -0
- package/esm/workflow/run-scoped-emitter.mjs.map +1 -0
- package/esm/workflow/signature.d.mts +7 -0
- package/esm/workflow/signature.d.mts.map +1 -0
- package/esm/workflow/signature.mjs +34 -0
- package/esm/workflow/signature.mjs.map +1 -0
- package/esm/workflow/snapshot.mjs +71 -0
- package/esm/workflow/snapshot.mjs.map +1 -0
- package/esm/workflow/state.mjs +37 -0
- package/esm/workflow/state.mjs.map +1 -0
- package/esm/workflow/step-runner.mjs +371 -0
- package/esm/workflow/step-runner.mjs.map +1 -0
- package/esm/workflow/step.d.mts +19 -0
- package/esm/workflow/step.d.mts.map +1 -0
- package/esm/workflow/step.mjs +37 -0
- package/esm/workflow/step.mjs.map +1 -0
- package/esm/workflow/workflow.d.mts +12 -0
- package/esm/workflow/workflow.d.mts.map +1 -0
- package/esm/workflow/workflow.mjs +116 -0
- package/esm/workflow/workflow.mjs.map +1 -0
- package/llms-full.txt +2293 -0
- package/llms.txt +20 -0
- package/package.json +37 -0
- package/skills/README.md +53 -0
- package/skills/ai-basics/SKILL.md +95 -0
- package/skills/attach-ai-middleware/SKILL.md +184 -0
- package/skills/define-ai-tool/SKILL.md +186 -0
- package/skills/embed-text/SKILL.md +105 -0
- package/skills/handle-ai-errors/SKILL.md +194 -0
- package/skills/log-ai-calls/SKILL.md +141 -0
- package/skills/persist-ai-data/SKILL.md +207 -0
- package/skills/pick-ai-provider/SKILL.md +164 -0
- package/skills/run-ai-agent/SKILL.md +267 -0
- package/skills/run-ai-workflow/SKILL.md +258 -0
- package/skills/run-supervisor/SKILL.md +309 -0
- package/skills/write-system-prompt/SKILL.md +129 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SupervisorCancelledError } from "../errors/supervisor-cancelled-error.mjs";
|
|
2
|
+
import "../errors/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../@warlock.js/ai/src/supervisor/cancellation.ts
|
|
5
|
+
/**
|
|
6
|
+
* Build a `SupervisorCancelledError` from an `AbortSignal`. Extracts a
|
|
7
|
+
* human-readable reason from `signal.reason` whether it was a string,
|
|
8
|
+
* an `Error`, or some other value. Used at between-iteration boundaries
|
|
9
|
+
* and on any mid-iteration cancellation path.
|
|
10
|
+
*/
|
|
11
|
+
function createCancelledError(signal) {
|
|
12
|
+
const reason = signal?.reason;
|
|
13
|
+
const reasonText = typeof reason === "string" ? reason : reason instanceof Error ? reason.message : reason === void 0 ? "" : String(reason);
|
|
14
|
+
return new SupervisorCancelledError(`supervisor cancelled${reasonText ? `: ${reasonText}` : ""}`, {
|
|
15
|
+
cancelledAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
16
|
+
reason: reasonText
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { createCancelledError };
|
|
22
|
+
//# sourceMappingURL=cancellation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancellation.mjs","names":[],"sources":["../../../../../../@warlock.js/ai/src/supervisor/cancellation.ts"],"sourcesContent":["import { SupervisorCancelledError } from \"../errors\";\n\n/**\n * Build a `SupervisorCancelledError` from an `AbortSignal`. Extracts a\n * human-readable reason from `signal.reason` whether it was a string,\n * an `Error`, or some other value. Used at between-iteration boundaries\n * and on any mid-iteration cancellation path.\n */\nexport function createCancelledError(\n signal: AbortSignal | undefined,\n): SupervisorCancelledError {\n const reason = signal?.reason;\n const reasonText =\n typeof reason === \"string\"\n ? reason\n : reason instanceof Error\n ? reason.message\n : reason === undefined\n ? \"\"\n : String(reason);\n\n return new SupervisorCancelledError(\n `supervisor cancelled${reasonText ? `: ${reasonText}` : \"\"}`,\n { cancelledAt: new Date().toISOString(), reason: reasonText },\n );\n}\n"],"mappings":";;;;;;;;;;AAQA,SAAgB,qBACd,QAC0B;CAC1B,MAAM,SAAS,QAAQ;CACvB,MAAM,aACJ,OAAO,WAAW,WACd,SACA,kBAAkB,QAChB,OAAO,UACP,WAAW,SACT,KACA,OAAO,MAAM;CAEvB,OAAO,IAAI,yBACT,uBAAuB,aAAa,KAAK,eAAe,MACxD;EAAE,8BAAa,IAAI,KAAK,GAAE,YAAY;EAAG,QAAQ;CAAW,CAC9D;AACF"}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { AIError } from "../errors/ai-error.mjs";
|
|
2
|
+
import { SupervisorFailedError } from "../errors/supervisor-failed-error.mjs";
|
|
3
|
+
import { SupervisorRoutingError } from "../errors/supervisor-routing-error.mjs";
|
|
4
|
+
import "../errors/index.mjs";
|
|
5
|
+
import { END } from "../contracts/end.type.mjs";
|
|
6
|
+
import { buildRouterContextMessage } from "./router-prompt.mjs";
|
|
7
|
+
|
|
8
|
+
//#region ../../@warlock.js/ai/src/supervisor/decide.ts
|
|
9
|
+
/**
|
|
10
|
+
* Unified dispatch decision entry — calls either the `route` callback
|
|
11
|
+
* or the `router` agent based on the supervisor's configured mode and
|
|
12
|
+
* normalizes the result into a `DispatchDecision`. Runtime validates
|
|
13
|
+
* every routing value against the configured agent keys; unknown keys
|
|
14
|
+
* surface as `SupervisorRoutingError`.
|
|
15
|
+
*/
|
|
16
|
+
async function decide(params) {
|
|
17
|
+
if (params.useInitialAgent && params.config.initialAgent) {
|
|
18
|
+
const intent = params.config.initialAgent;
|
|
19
|
+
validateKey(intent, params.entries);
|
|
20
|
+
return {
|
|
21
|
+
kind: "dispatch",
|
|
22
|
+
intents: [intent],
|
|
23
|
+
source: "initialAgent",
|
|
24
|
+
raw: intent,
|
|
25
|
+
durationMs: 0
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
if (params.config.route) return decideViaCallback(params);
|
|
29
|
+
if (params.config.router) return decideViaRouter(params);
|
|
30
|
+
throw new SupervisorFailedError(`ai.supervisor("${params.config.name}"): neither \`route\` nor \`router\` is configured — factory validation should have prevented this`, { context: { authoring: true } });
|
|
31
|
+
}
|
|
32
|
+
async function decideViaCallback(params) {
|
|
33
|
+
const started = performance.now();
|
|
34
|
+
const ctx = {
|
|
35
|
+
iteration: params.iteration,
|
|
36
|
+
input: params.input,
|
|
37
|
+
state: params.state,
|
|
38
|
+
iterations: params.iterations,
|
|
39
|
+
feedback: typeof params.evaluateFeedback?.feedback === "string" ? params.evaluateFeedback.feedback : void 0,
|
|
40
|
+
evaluateFeedback: params.evaluateFeedback,
|
|
41
|
+
context: params.context,
|
|
42
|
+
history: params.history,
|
|
43
|
+
goal: params.goal,
|
|
44
|
+
classifier: params.classifier
|
|
45
|
+
};
|
|
46
|
+
let raw;
|
|
47
|
+
try {
|
|
48
|
+
raw = await params.config.route(ctx);
|
|
49
|
+
} catch (thrown) {
|
|
50
|
+
throw wrapRouteError(params.config.name, thrown);
|
|
51
|
+
}
|
|
52
|
+
const durationMs = performance.now() - started;
|
|
53
|
+
return normalize(raw, params.entries, "route", durationMs);
|
|
54
|
+
}
|
|
55
|
+
async function decideViaRouter(params) {
|
|
56
|
+
const { agent, placeholders, inputOverride, historySlicer } = resolveRouterEntry(params.config.router);
|
|
57
|
+
const started = performance.now();
|
|
58
|
+
const routeCtx = {
|
|
59
|
+
iteration: params.iteration,
|
|
60
|
+
input: params.input,
|
|
61
|
+
state: params.state,
|
|
62
|
+
iterations: params.iterations,
|
|
63
|
+
feedback: typeof params.evaluateFeedback?.feedback === "string" ? params.evaluateFeedback.feedback : void 0,
|
|
64
|
+
evaluateFeedback: params.evaluateFeedback,
|
|
65
|
+
context: params.context,
|
|
66
|
+
history: params.history,
|
|
67
|
+
goal: params.goal
|
|
68
|
+
};
|
|
69
|
+
const userMessage = inputOverride?.(routeCtx) ?? buildRouterContextMessage({
|
|
70
|
+
entries: params.entries,
|
|
71
|
+
iteration: params.iteration,
|
|
72
|
+
maxIterations: params.maxIterations,
|
|
73
|
+
iterations: params.iterations,
|
|
74
|
+
input: params.input,
|
|
75
|
+
state: params.state,
|
|
76
|
+
feedback: routeCtx.feedback,
|
|
77
|
+
supervisorPrompt: resolveSupervisorPromptText(params.config),
|
|
78
|
+
goal: params.goal
|
|
79
|
+
});
|
|
80
|
+
const resolvedPlaceholders = placeholders?.(routeCtx);
|
|
81
|
+
const routerHistory = resolveRouterHistory(historySlicer, routeCtx, params.history, params.config.historyWindow?.router);
|
|
82
|
+
const routerResult = await agent.execute(userMessage, {
|
|
83
|
+
signal: params.signal,
|
|
84
|
+
output: ROUTER_OUTPUT_SCHEMA,
|
|
85
|
+
...resolvedPlaceholders ? { placeholders: resolvedPlaceholders } : {},
|
|
86
|
+
...routerHistory.length > 0 ? { history: routerHistory } : {}
|
|
87
|
+
});
|
|
88
|
+
const durationMs = performance.now() - started;
|
|
89
|
+
if (routerResult.error) throw routerResult.error instanceof AIError ? routerResult.error : new SupervisorFailedError(`router agent failed`, { cause: routerResult.error });
|
|
90
|
+
const data = routerResult.data;
|
|
91
|
+
if (!data || typeof data !== "object") throw new SupervisorRoutingError(`router agent returned no structured \`next\` — did its output schema include { next, reasoning? }?`, {
|
|
92
|
+
returned: data,
|
|
93
|
+
availableKeys: [...params.entries.keys()]
|
|
94
|
+
});
|
|
95
|
+
const rawNext = data.next;
|
|
96
|
+
const reasoning = data.reasoning;
|
|
97
|
+
if (rawNext === void 0) throw new SupervisorRoutingError(`router agent output missing \`next\` field`, {
|
|
98
|
+
returned: data,
|
|
99
|
+
availableKeys: [...params.entries.keys()]
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
...normalize(rawNext, params.entries, "router", durationMs),
|
|
103
|
+
reasoning: typeof reasoning === "string" ? reasoning : void 0,
|
|
104
|
+
usage: routerResult.usage,
|
|
105
|
+
routerReport: routerResult.report
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Normalize the `router` config field — accepts either a bare
|
|
110
|
+
* `AgentContract` (shorthand) or a full `RouterEntry` — into a
|
|
111
|
+
* uniform `{ agent, placeholders?, inputOverride? }` triple. Centralized
|
|
112
|
+
* so the dispatch path doesn't branch on shape.
|
|
113
|
+
*/
|
|
114
|
+
function resolveRouterEntry(router) {
|
|
115
|
+
if (typeof router.execute === "function") return { agent: router };
|
|
116
|
+
const entry = router;
|
|
117
|
+
return {
|
|
118
|
+
agent: entry.agent,
|
|
119
|
+
placeholders: entry.placeholders,
|
|
120
|
+
inputOverride: entry.input,
|
|
121
|
+
historySlicer: entry.history
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Resolve the supervisor's own `systemPrompt` (string or contract)
|
|
126
|
+
* into plain text. Returns `undefined` when the supervisor didn't
|
|
127
|
+
* configure one. The resolved text is surfaced in the per-turn
|
|
128
|
+
* router user message so the router sees team/domain context without
|
|
129
|
+
* disturbing the router agent's own factory-level system prompt —
|
|
130
|
+
* functionally equivalent to prepending, without requiring an API
|
|
131
|
+
* expansion on `AgentContract` to read the router's system prompt.
|
|
132
|
+
*/
|
|
133
|
+
function resolveSupervisorPromptText(config) {
|
|
134
|
+
if (!config.systemPrompt) return;
|
|
135
|
+
return typeof config.systemPrompt === "string" ? config.systemPrompt : config.systemPrompt.resolve();
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Convert the raw routing value (callback return OR router agent
|
|
139
|
+
* `next` field) into a canonical `DispatchDecision`, validating every
|
|
140
|
+
* named intent against the supervisor's `intents` map.
|
|
141
|
+
*/
|
|
142
|
+
function normalize(raw, entries, source, durationMs) {
|
|
143
|
+
if (isEnd(raw)) return {
|
|
144
|
+
kind: "end",
|
|
145
|
+
source,
|
|
146
|
+
raw,
|
|
147
|
+
durationMs
|
|
148
|
+
};
|
|
149
|
+
if (typeof raw === "string") {
|
|
150
|
+
validateKey(raw, entries);
|
|
151
|
+
return {
|
|
152
|
+
kind: "dispatch",
|
|
153
|
+
intents: [raw],
|
|
154
|
+
source,
|
|
155
|
+
raw,
|
|
156
|
+
durationMs
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (Array.isArray(raw)) {
|
|
160
|
+
if (raw.length === 0) throw new SupervisorRoutingError(`router returned an empty array — must be a non-empty list of agent intents`, {
|
|
161
|
+
returned: raw,
|
|
162
|
+
availableKeys: [...entries.keys()]
|
|
163
|
+
});
|
|
164
|
+
for (const intent of raw) {
|
|
165
|
+
if (typeof intent !== "string") throw new SupervisorRoutingError(`router returned a non-string inside its fan-out array`, {
|
|
166
|
+
returned: raw,
|
|
167
|
+
availableKeys: [...entries.keys()]
|
|
168
|
+
});
|
|
169
|
+
validateKey(intent, entries);
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
kind: "dispatch",
|
|
173
|
+
intents: raw,
|
|
174
|
+
source,
|
|
175
|
+
raw,
|
|
176
|
+
durationMs
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
throw new SupervisorRoutingError(`router returned an unsupported value — expected a string, string[], or END`, {
|
|
180
|
+
returned: raw,
|
|
181
|
+
availableKeys: [...entries.keys()]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function validateKey(intent, entries) {
|
|
185
|
+
if (!entries.has(intent)) throw new SupervisorRoutingError(`router returned unknown agent key "${intent}"`, {
|
|
186
|
+
returned: intent,
|
|
187
|
+
availableKeys: [...entries.keys()]
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function isEnd(value) {
|
|
191
|
+
return value === END;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Resolve the history slice forwarded to the router agent. Mirrors
|
|
195
|
+
* `SupervisorExecution.resolveHistoryFor("router", ...)` — duplicated
|
|
196
|
+
* here so the standalone `decide()` function stays callable without
|
|
197
|
+
* threading the execution instance through. Precedence is identical:
|
|
198
|
+
* entry slicer > `historyWindow.router` > full history.
|
|
199
|
+
*/
|
|
200
|
+
function resolveRouterHistory(slicer, routeCtx, full, window) {
|
|
201
|
+
if (slicer) {
|
|
202
|
+
const sliced = slicer(routeCtx);
|
|
203
|
+
return sliced ? [...sliced] : [];
|
|
204
|
+
}
|
|
205
|
+
if (window === void 0 || window < 0) return [...full];
|
|
206
|
+
if (window === 0) return [];
|
|
207
|
+
return full.slice(-window);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* JSON Schema form of the canonical router output shape. Surfaced via
|
|
211
|
+
* the Standard JSON Schema V1 extension path (`["~standard"].jsonSchema.input`)
|
|
212
|
+
* so `extractJsonSchema()` can pull it for native structured-output
|
|
213
|
+
* enforcement on capable providers (OpenAI strict json_schema mode,
|
|
214
|
+
* Anthropic tool-use shape, etc.). Without this, the model is told to
|
|
215
|
+
* emit JSON only via soft system-prompt instruction — fragile, and
|
|
216
|
+
* skipped entirely when the model advertises `structuredOutput: true`.
|
|
217
|
+
*
|
|
218
|
+
* `next` is intentionally `string` (not a union with arrays) because
|
|
219
|
+
* OpenAI strict mode rejects polymorphic root types — fan-out via
|
|
220
|
+
* `string[]` is still validated at the framework layer; the model
|
|
221
|
+
* just emits a single intent name (or the END sentinel) and the
|
|
222
|
+
* supervisor's own normalizer handles the rest.
|
|
223
|
+
*/
|
|
224
|
+
const ROUTER_OUTPUT_JSON_SCHEMA = {
|
|
225
|
+
type: "object",
|
|
226
|
+
properties: {
|
|
227
|
+
next: {
|
|
228
|
+
type: "string",
|
|
229
|
+
description: "Name of the agent to dispatch next, or the END sentinel to terminate the run."
|
|
230
|
+
},
|
|
231
|
+
reasoning: {
|
|
232
|
+
type: "string",
|
|
233
|
+
description: "One-sentence justification for the routing choice."
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
required: ["next", "reasoning"],
|
|
237
|
+
additionalProperties: false
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Canonical Standard Schema the supervisor injects when calling the
|
|
241
|
+
* router agent. Pragmatic — accepts any `next` shape the router can
|
|
242
|
+
* plausibly emit (`string`, `string[]`, or the `END` literal) plus an
|
|
243
|
+
* optional `reasoning` field. Rejects anything else so a broken
|
|
244
|
+
* router output surfaces cleanly via the agent's own validation path.
|
|
245
|
+
*
|
|
246
|
+
* Exposes `["~standard"].jsonSchema.input()` (Standard JSON Schema V1)
|
|
247
|
+
* so capable providers enforce the shape natively rather than relying
|
|
248
|
+
* on prompt-side coaching.
|
|
249
|
+
*/
|
|
250
|
+
const ROUTER_OUTPUT_SCHEMA = { "~standard": {
|
|
251
|
+
version: 1,
|
|
252
|
+
vendor: "warlock-supervisor",
|
|
253
|
+
jsonSchema: { input: () => ROUTER_OUTPUT_JSON_SCHEMA },
|
|
254
|
+
validate(value) {
|
|
255
|
+
if (!value || typeof value !== "object") return { issues: [{ message: "router output must be an object" }] };
|
|
256
|
+
const record = value;
|
|
257
|
+
const rawNext = record.next;
|
|
258
|
+
if (!(typeof rawNext === "string" || Array.isArray(rawNext) && rawNext.every((element) => typeof element === "string"))) return { issues: [{ message: "router output `next` must be a string, string[], or the END sentinel" }] };
|
|
259
|
+
return { value: {
|
|
260
|
+
next: rawNext,
|
|
261
|
+
reasoning: typeof record.reasoning === "string" ? record.reasoning : void 0
|
|
262
|
+
} };
|
|
263
|
+
}
|
|
264
|
+
} };
|
|
265
|
+
function wrapRouteError(supervisorName, thrown) {
|
|
266
|
+
if (thrown instanceof AIError) return thrown;
|
|
267
|
+
return new SupervisorFailedError(`\`route\` callback threw in supervisor "${supervisorName}": ${thrown instanceof Error ? thrown.message : String(thrown)}`, { cause: thrown });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
//#endregion
|
|
271
|
+
export { decide };
|
|
272
|
+
//# sourceMappingURL=decide.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decide.mjs","names":[],"sources":["../../../../../../@warlock.js/ai/src/supervisor/decide.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type { AgentContract } from \"../contracts/agent/agent.contract\";\nimport type { Message } from \"../contracts/conversation-message.type\";\nimport { END, type EndSentinel } from \"../contracts/end.type\";\nimport type { BaseReport } from \"../contracts/result/base-report.type\";\nimport type { IterationSnapshot } from \"../contracts/supervisor/iteration-snapshot.type\";\nimport type { Next } from \"../contracts/supervisor/next.type\";\nimport type { RouteContext } from \"../contracts/supervisor/route-context.type\";\nimport type { RouterEntry } from \"../contracts/supervisor/router-entry.type\";\nimport type { SupervisorConfig } from \"../contracts/supervisor/supervisor-config.type\";\nimport type { SupervisorInput } from \"../contracts/supervisor/supervisor-input.type\";\nimport { AIError, SupervisorFailedError, SupervisorRoutingError } from \"../errors\";\nimport type { ResolvedIntentEntry } from \"./entries\";\nimport { buildRouterContextMessage } from \"./router-prompt\";\n\n/**\n * Outcome of one dispatch decision — what the iteration loop needs to\n * act on. `kind: \"end\"` signals termination; `kind: \"dispatch\"` carries\n * the resolved intents (always an array; single-agent dispatch has\n * length 1). `source` records which path made the call so the\n * iteration snapshot can surface it to debuggers.\n */\nexport type DispatchDecision =\n | {\n kind: \"end\";\n source: \"route\" | \"router\" | \"initialAgent\" | \"classifier\";\n raw: Next;\n reasoning?: string;\n durationMs: number;\n usage?: { input: number; output: number; total: number };\n /** Full router-agent report when this decision came from a router. */\n routerReport?: BaseReport;\n }\n | {\n kind: \"dispatch\";\n intents: string[];\n source: \"route\" | \"router\" | \"initialAgent\" | \"classifier\";\n raw: Next;\n reasoning?: string;\n durationMs: number;\n usage?: { input: number; output: number; total: number };\n /** Full router-agent report when this decision came from a router. */\n routerReport?: BaseReport;\n };\n\nexport type DecideParams = {\n config: SupervisorConfig<unknown>;\n entries: Map<string, ResolvedIntentEntry>;\n iteration: number;\n maxIterations: number;\n iterations: IterationSnapshot[];\n input: SupervisorInput;\n /**\n * Per-execute state accumulator at the start of this iteration.\n * Threaded into `RouteContext` for the route callback and\n * rendered into the router prompt so routing decisions can be\n * state-aware (Q14).\n */\n state: Record<string, unknown>;\n /**\n * Frozen request-scoped bag from the `execute({ context })` call —\n * surfaced on `RouteContext.context` for both `route` callbacks\n * and `RouterEntry.placeholders` / `RouterEntry.input` resolvers.\n */\n context: Readonly<Record<string, unknown>>;\n /**\n * Frozen prior-conversation history from `execute({ history })` —\n * surfaced on `RouteContext.history` and forwarded to the router\n * agent as `agent.execute(input, { history })` so router decisions\n * are conversation-aware.\n */\n history: ReadonlyArray<Message>;\n /**\n * Resolved natural-language objective from `SupervisorConfig.goal`\n * (materialized to plain text at supervisor construction). Surfaced\n * on `RouteContext.goal` for `route` / `RouterEntry` resolvers, and\n * injected into the router agent's per-turn user message via\n * `buildRouterContextMessage`. `undefined` when no goal was set.\n */\n goal: string | undefined;\n evaluateFeedback?: RouteContext[\"evaluateFeedback\"];\n /**\n * Forensic record of the iter-0 classifier (Phase 7). Threaded into\n * `RouteContext.classifier` so route callbacks and router-agent\n * input composers can read the classification trail without\n * re-parsing state.\n */\n classifier?: RouteContext[\"classifier\"];\n signal?: AbortSignal;\n /**\n * Override for the very first iteration — when `initialAgent` is\n * set, the first turn skips `route`/`router` and dispatches the\n * named intent directly. `runIteration` passes `true` only on turn\n * 0 when the config has `initialAgent`.\n */\n useInitialAgent?: boolean;\n};\n\n/**\n * Unified dispatch decision entry — calls either the `route` callback\n * or the `router` agent based on the supervisor's configured mode and\n * normalizes the result into a `DispatchDecision`. Runtime validates\n * every routing value against the configured agent keys; unknown keys\n * surface as `SupervisorRoutingError`.\n */\nexport async function decide(params: DecideParams): Promise<DispatchDecision> {\n if (params.useInitialAgent && params.config.initialAgent) {\n const intent = params.config.initialAgent;\n validateKey(intent, params.entries);\n\n return {\n kind: \"dispatch\",\n intents: [intent],\n source: \"initialAgent\",\n raw: intent,\n durationMs: 0,\n };\n }\n\n if (params.config.route) {\n return decideViaCallback(params);\n }\n\n if (params.config.router) {\n return decideViaRouter(params);\n }\n\n throw new SupervisorFailedError(\n `ai.supervisor(\"${params.config.name}\"): neither \\`route\\` nor \\`router\\` is configured — factory validation should have prevented this`,\n { context: { authoring: true } },\n );\n}\n\nasync function decideViaCallback(params: DecideParams): Promise<DispatchDecision> {\n const started = performance.now();\n const ctx: RouteContext = {\n iteration: params.iteration,\n input: params.input,\n state: params.state,\n iterations: params.iterations,\n feedback:\n typeof params.evaluateFeedback?.feedback === \"string\"\n ? params.evaluateFeedback.feedback\n : undefined,\n evaluateFeedback: params.evaluateFeedback,\n context: params.context,\n history: params.history,\n goal: params.goal,\n classifier: params.classifier,\n };\n\n let raw: Next;\n\n try {\n raw = await params.config.route!(ctx);\n } catch (thrown) {\n throw wrapRouteError(params.config.name, thrown);\n }\n\n const durationMs = performance.now() - started;\n\n return normalize(raw, params.entries, \"route\", durationMs);\n}\n\nasync function decideViaRouter(params: DecideParams): Promise<DispatchDecision> {\n const { agent, placeholders, inputOverride, historySlicer } = resolveRouterEntry(\n params.config.router!,\n );\n const started = performance.now();\n\n const routeCtx: RouteContext = {\n iteration: params.iteration,\n input: params.input,\n state: params.state,\n iterations: params.iterations,\n feedback:\n typeof params.evaluateFeedback?.feedback === \"string\"\n ? params.evaluateFeedback.feedback\n : undefined,\n evaluateFeedback: params.evaluateFeedback,\n context: params.context,\n history: params.history,\n goal: params.goal,\n };\n\n const userMessage =\n inputOverride?.(routeCtx) ??\n buildRouterContextMessage({\n entries: params.entries,\n iteration: params.iteration,\n maxIterations: params.maxIterations,\n iterations: params.iterations,\n input: params.input,\n state: params.state,\n feedback: routeCtx.feedback,\n supervisorPrompt: resolveSupervisorPromptText(params.config),\n goal: params.goal,\n });\n\n const resolvedPlaceholders = placeholders?.(routeCtx);\n\n // Inject the canonical router output schema so the supervisor gets\n // a predictable `{ next, reasoning? }` shape regardless of what the\n // user scripted on the router agent. Lets the router stay a plain\n // agent — no supervisor-specific config needed at construction.\n const routerHistory = resolveRouterHistory(\n historySlicer,\n routeCtx,\n params.history,\n params.config.historyWindow?.router,\n );\n\n const routerResult = await agent.execute(userMessage, {\n signal: params.signal,\n output: ROUTER_OUTPUT_SCHEMA as unknown as StandardSchemaV1<{\n next: Next;\n reasoning?: string;\n }>,\n ...(resolvedPlaceholders ? { placeholders: resolvedPlaceholders } : {}),\n ...(routerHistory.length > 0 ? { history: routerHistory } : {}),\n });\n\n const durationMs = performance.now() - started;\n\n if (routerResult.error) {\n throw routerResult.error instanceof AIError\n ? routerResult.error\n : new SupervisorFailedError(`router agent failed`, {\n cause: routerResult.error,\n });\n }\n\n const data = routerResult.data;\n\n if (!data || typeof data !== \"object\") {\n throw new SupervisorRoutingError(\n `router agent returned no structured \\`next\\` — did its output schema include { next, reasoning? }?`,\n { returned: data, availableKeys: [...params.entries.keys()] },\n );\n }\n\n const rawNext = (data as { next?: unknown }).next;\n const reasoning = (data as { reasoning?: unknown }).reasoning;\n\n if (rawNext === undefined) {\n throw new SupervisorRoutingError(`router agent output missing \\`next\\` field`, {\n returned: data,\n availableKeys: [...params.entries.keys()],\n });\n }\n\n const decision = normalize(rawNext as Next, params.entries, \"router\", durationMs);\n\n return {\n ...decision,\n reasoning: typeof reasoning === \"string\" ? reasoning : undefined,\n usage: routerResult.usage,\n routerReport: routerResult.report,\n };\n}\n\n/**\n * Normalize the `router` config field — accepts either a bare\n * `AgentContract` (shorthand) or a full `RouterEntry` — into a\n * uniform `{ agent, placeholders?, inputOverride? }` triple. Centralized\n * so the dispatch path doesn't branch on shape.\n */\nfunction resolveRouterEntry(router: AgentContract<unknown> | RouterEntry): {\n agent: AgentContract<unknown>;\n placeholders?: RouterEntry[\"placeholders\"];\n inputOverride?: RouterEntry[\"input\"];\n historySlicer?: RouterEntry[\"history\"];\n} {\n if (typeof (router as { execute?: unknown }).execute === \"function\") {\n return { agent: router as AgentContract<unknown> };\n }\n\n const entry = router as RouterEntry;\n\n return {\n agent: entry.agent,\n placeholders: entry.placeholders,\n inputOverride: entry.input,\n historySlicer: entry.history,\n };\n}\n\n/**\n * Resolve the supervisor's own `systemPrompt` (string or contract)\n * into plain text. Returns `undefined` when the supervisor didn't\n * configure one. The resolved text is surfaced in the per-turn\n * router user message so the router sees team/domain context without\n * disturbing the router agent's own factory-level system prompt —\n * functionally equivalent to prepending, without requiring an API\n * expansion on `AgentContract` to read the router's system prompt.\n */\nfunction resolveSupervisorPromptText(config: SupervisorConfig<unknown>): string | undefined {\n if (!config.systemPrompt) {\n return undefined;\n }\n\n return typeof config.systemPrompt === \"string\"\n ? config.systemPrompt\n : config.systemPrompt.resolve();\n}\n\n/**\n * Convert the raw routing value (callback return OR router agent\n * `next` field) into a canonical `DispatchDecision`, validating every\n * named intent against the supervisor's `intents` map.\n */\nfunction normalize(\n raw: Next,\n entries: Map<string, ResolvedIntentEntry>,\n source: \"route\" | \"router\",\n durationMs: number,\n): DispatchDecision {\n if (isEnd(raw)) {\n return { kind: \"end\", source, raw, durationMs };\n }\n\n if (typeof raw === \"string\") {\n validateKey(raw, entries);\n\n return {\n kind: \"dispatch\",\n intents: [raw],\n source,\n raw,\n durationMs,\n };\n }\n\n if (Array.isArray(raw)) {\n if (raw.length === 0) {\n throw new SupervisorRoutingError(\n `router returned an empty array — must be a non-empty list of agent intents`,\n { returned: raw, availableKeys: [...entries.keys()] },\n );\n }\n\n for (const intent of raw) {\n if (typeof intent !== \"string\") {\n throw new SupervisorRoutingError(`router returned a non-string inside its fan-out array`, {\n returned: raw,\n availableKeys: [...entries.keys()],\n });\n }\n\n validateKey(intent, entries);\n }\n\n return {\n kind: \"dispatch\",\n intents: raw,\n source,\n raw,\n durationMs,\n };\n }\n\n throw new SupervisorRoutingError(\n `router returned an unsupported value — expected a string, string[], or END`,\n { returned: raw, availableKeys: [...entries.keys()] },\n );\n}\n\nfunction validateKey(intent: string, entries: Map<string, ResolvedIntentEntry>): void {\n if (!entries.has(intent)) {\n throw new SupervisorRoutingError(`router returned unknown agent key \"${intent}\"`, {\n returned: intent,\n availableKeys: [...entries.keys()],\n });\n }\n}\n\nfunction isEnd(value: unknown): value is EndSentinel {\n return value === END;\n}\n\n/**\n * Resolve the history slice forwarded to the router agent. Mirrors\n * `SupervisorExecution.resolveHistoryFor(\"router\", ...)` — duplicated\n * here so the standalone `decide()` function stays callable without\n * threading the execution instance through. Precedence is identical:\n * entry slicer > `historyWindow.router` > full history.\n */\nfunction resolveRouterHistory(\n slicer: RouterEntry[\"history\"] | undefined,\n routeCtx: RouteContext,\n full: ReadonlyArray<Message>,\n window: number | undefined,\n): Message[] {\n if (slicer) {\n const sliced = slicer(routeCtx);\n return sliced ? [...sliced] : [];\n }\n\n if (window === undefined || window < 0) {\n return [...full];\n }\n\n if (window === 0) {\n return [];\n }\n\n return full.slice(-window);\n}\n\n/**\n * JSON Schema form of the canonical router output shape. Surfaced via\n * the Standard JSON Schema V1 extension path (`[\"~standard\"].jsonSchema.input`)\n * so `extractJsonSchema()` can pull it for native structured-output\n * enforcement on capable providers (OpenAI strict json_schema mode,\n * Anthropic tool-use shape, etc.). Without this, the model is told to\n * emit JSON only via soft system-prompt instruction — fragile, and\n * skipped entirely when the model advertises `structuredOutput: true`.\n *\n * `next` is intentionally `string` (not a union with arrays) because\n * OpenAI strict mode rejects polymorphic root types — fan-out via\n * `string[]` is still validated at the framework layer; the model\n * just emits a single intent name (or the END sentinel) and the\n * supervisor's own normalizer handles the rest.\n */\nconst ROUTER_OUTPUT_JSON_SCHEMA = {\n type: \"object\",\n properties: {\n next: {\n type: \"string\",\n description: \"Name of the agent to dispatch next, or the END sentinel to terminate the run.\",\n },\n reasoning: {\n type: \"string\",\n description: \"One-sentence justification for the routing choice.\",\n },\n },\n required: [\"next\", \"reasoning\"],\n additionalProperties: false,\n};\n\n/**\n * Canonical Standard Schema the supervisor injects when calling the\n * router agent. Pragmatic — accepts any `next` shape the router can\n * plausibly emit (`string`, `string[]`, or the `END` literal) plus an\n * optional `reasoning` field. Rejects anything else so a broken\n * router output surfaces cleanly via the agent's own validation path.\n *\n * Exposes `[\"~standard\"].jsonSchema.input()` (Standard JSON Schema V1)\n * so capable providers enforce the shape natively rather than relying\n * on prompt-side coaching.\n */\nconst ROUTER_OUTPUT_SCHEMA: StandardSchemaV1<{\n next: Next;\n reasoning?: string;\n}> = {\n \"~standard\": {\n version: 1,\n vendor: \"warlock-supervisor\",\n jsonSchema: {\n input: () => ROUTER_OUTPUT_JSON_SCHEMA,\n },\n validate(value: unknown): StandardSchemaV1.Result<{ next: Next; reasoning?: string }> {\n if (!value || typeof value !== \"object\") {\n return { issues: [{ message: \"router output must be an object\" }] };\n }\n\n const record = value as { next?: unknown; reasoning?: unknown };\n const rawNext = record.next;\n\n const nextIsValid =\n typeof rawNext === \"string\" ||\n (Array.isArray(rawNext) && rawNext.every((element) => typeof element === \"string\"));\n\n if (!nextIsValid) {\n return {\n issues: [\n {\n message: \"router output `next` must be a string, string[], or the END sentinel\",\n },\n ],\n };\n }\n\n const reasoning = typeof record.reasoning === \"string\" ? record.reasoning : undefined;\n\n return {\n value: { next: rawNext as Next, reasoning },\n };\n },\n } as StandardSchemaV1<{ next: Next; reasoning?: string }>[\"~standard\"] & {\n jsonSchema: { input: () => Record<string, unknown> };\n },\n};\n\nfunction wrapRouteError(supervisorName: string, thrown: unknown): AIError {\n if (thrown instanceof AIError) {\n return thrown;\n }\n\n const message = thrown instanceof Error ? thrown.message : String(thrown);\n\n return new SupervisorFailedError(\n `\\`route\\` callback threw in supervisor \"${supervisorName}\": ${message}`,\n { cause: thrown },\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyGA,eAAsB,OAAO,QAAiD;CAC5E,IAAI,OAAO,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AH5C,kBAAkB,QAAQ,OAAO,UAAU,OAAO,MAAM,KAItE,EAAE,OAAO,OAAO,CAClB;AACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SupervisorEventHandler, SupervisorEventHandlers } from "../contracts/supervisor/supervisor-config.type.mjs";
|
|
2
|
+
import { SupervisorEventMap } from "../contracts/events/event-map.type.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../../@warlock.js/ai/src/supervisor/emitter.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Three-tier supervisor event emitter — factory (definition) → instance
|
|
7
|
+
* → per-execution. Mirrors `WorkflowEmitter` structurally; the only
|
|
8
|
+
* difference is the event map. All matching handlers fire in layer
|
|
9
|
+
* order. Handler errors are swallowed so a listener bug can never
|
|
10
|
+
* derail the run.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const emitter = new SupervisorEmitter(definition.on);
|
|
14
|
+
* const unsubscribe = emitter.on("supervisor.completed", (payload) => ...);
|
|
15
|
+
* emitter.emit("supervisor.starting", { runId, rootRunId, supervisorName, input }, perCallHandlers);
|
|
16
|
+
*/
|
|
17
|
+
declare class SupervisorEmitter {
|
|
18
|
+
private readonly factoryHandlers?;
|
|
19
|
+
private readonly instanceHandlers;
|
|
20
|
+
constructor(factoryHandlers?: SupervisorEventHandlers);
|
|
21
|
+
on<K extends keyof SupervisorEventMap>(event: K, handler: SupervisorEventHandler<K>): () => void;
|
|
22
|
+
off<K extends keyof SupervisorEventMap>(event: K, handler: SupervisorEventHandler<K>): void;
|
|
23
|
+
emit<K extends keyof SupervisorEventMap>(event: K, payload: SupervisorEventMap[K], executionHandlers?: SupervisorEventHandlers): void;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SupervisorEmitter };
|
|
27
|
+
//# sourceMappingURL=emitter.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter.d.mts","names":[],"sources":["../../../../../../@warlock.js/ai/src/supervisor/emitter.ts"],"mappings":";;;;;;AAoBA;;;;;;;;;;cAAa,iBAAA;EAAA,iBACM,eAAA;EAAA,iBACA,gBAAA;cAKE,eAAA,GAAkB,uBAAA;EAI9B,EAAA,iBAAmB,kBAAA,CAAA,CACxB,KAAA,EAAO,CAAA,EACP,OAAA,EAAS,sBAAA,CAAuB,CAAA;EAc3B,GAAA,iBAAoB,kBAAA,CAAA,CACzB,KAAA,EAAO,CAAA,EACP,OAAA,EAAS,sBAAA,CAAuB,CAAA;EAK3B,IAAA,iBAAqB,kBAAA,CAAA,CAC1B,KAAA,EAAO,CAAA,EACP,OAAA,EAAS,kBAAA,CAAmB,CAAA,GAC5B,iBAAA,GAAoB,uBAAA;AAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//#region ../../@warlock.js/ai/src/supervisor/emitter.ts
|
|
2
|
+
/**
|
|
3
|
+
* Three-tier supervisor event emitter — factory (definition) → instance
|
|
4
|
+
* → per-execution. Mirrors `WorkflowEmitter` structurally; the only
|
|
5
|
+
* difference is the event map. All matching handlers fire in layer
|
|
6
|
+
* order. Handler errors are swallowed so a listener bug can never
|
|
7
|
+
* derail the run.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* const emitter = new SupervisorEmitter(definition.on);
|
|
11
|
+
* const unsubscribe = emitter.on("supervisor.completed", (payload) => ...);
|
|
12
|
+
* emitter.emit("supervisor.starting", { runId, rootRunId, supervisorName, input }, perCallHandlers);
|
|
13
|
+
*/
|
|
14
|
+
var SupervisorEmitter = class {
|
|
15
|
+
constructor(factoryHandlers) {
|
|
16
|
+
this.instanceHandlers = /* @__PURE__ */ new Map();
|
|
17
|
+
this.factoryHandlers = factoryHandlers;
|
|
18
|
+
}
|
|
19
|
+
on(event, handler) {
|
|
20
|
+
let bucket = this.instanceHandlers.get(event);
|
|
21
|
+
if (!bucket) {
|
|
22
|
+
bucket = /* @__PURE__ */ new Set();
|
|
23
|
+
this.instanceHandlers.set(event, bucket);
|
|
24
|
+
}
|
|
25
|
+
bucket.add(handler);
|
|
26
|
+
return () => this.off(event, handler);
|
|
27
|
+
}
|
|
28
|
+
off(event, handler) {
|
|
29
|
+
this.instanceHandlers.get(event)?.delete(handler);
|
|
30
|
+
}
|
|
31
|
+
emit(event, payload, executionHandlers) {
|
|
32
|
+
invoke(this.factoryHandlers?.[event], payload);
|
|
33
|
+
const bucket = this.instanceHandlers.get(event);
|
|
34
|
+
if (bucket) for (const handler of bucket) invoke(handler, payload);
|
|
35
|
+
invoke(executionHandlers?.[event], payload);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function invoke(handler, payload) {
|
|
39
|
+
if (typeof handler !== "function") return;
|
|
40
|
+
try {
|
|
41
|
+
handler(payload);
|
|
42
|
+
} catch {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SupervisorEmitter };
|
|
47
|
+
//# sourceMappingURL=emitter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter.mjs","names":[],"sources":["../../../../../../@warlock.js/ai/src/supervisor/emitter.ts"],"sourcesContent":["import type { SupervisorEventMap } from \"../contracts/events/event-map.type\";\nimport type {\n SupervisorEventHandler,\n SupervisorEventHandlers,\n} from \"../contracts/supervisor/supervisor-config.type\";\n\ntype AnyHandler = SupervisorEventHandler<keyof SupervisorEventMap>;\n\n/**\n * Three-tier supervisor event emitter — factory (definition) → instance\n * → per-execution. Mirrors `WorkflowEmitter` structurally; the only\n * difference is the event map. All matching handlers fire in layer\n * order. Handler errors are swallowed so a listener bug can never\n * derail the run.\n *\n * @example\n * const emitter = new SupervisorEmitter(definition.on);\n * const unsubscribe = emitter.on(\"supervisor.completed\", (payload) => ...);\n * emitter.emit(\"supervisor.starting\", { runId, rootRunId, supervisorName, input }, perCallHandlers);\n */\nexport class SupervisorEmitter {\n private readonly factoryHandlers?: SupervisorEventHandlers;\n private readonly instanceHandlers = new Map<\n keyof SupervisorEventMap,\n Set<AnyHandler>\n >();\n\n public constructor(factoryHandlers?: SupervisorEventHandlers) {\n this.factoryHandlers = factoryHandlers;\n }\n\n public on<K extends keyof SupervisorEventMap>(\n event: K,\n handler: SupervisorEventHandler<K>,\n ): () => void {\n let bucket = this.instanceHandlers.get(event);\n\n if (!bucket) {\n bucket = new Set();\n this.instanceHandlers.set(event, bucket);\n }\n\n bucket.add(handler as AnyHandler);\n\n return () => this.off(event, handler);\n }\n\n public off<K extends keyof SupervisorEventMap>(\n event: K,\n handler: SupervisorEventHandler<K>,\n ): void {\n this.instanceHandlers.get(event)?.delete(handler as AnyHandler);\n }\n\n public emit<K extends keyof SupervisorEventMap>(\n event: K,\n payload: SupervisorEventMap[K],\n executionHandlers?: SupervisorEventHandlers,\n ): void {\n invoke(this.factoryHandlers?.[event], payload);\n\n const bucket = this.instanceHandlers.get(event);\n\n if (bucket) {\n for (const handler of bucket) {\n invoke(handler, payload);\n }\n }\n\n invoke(executionHandlers?.[event], payload);\n }\n}\n\nfunction invoke<K extends keyof SupervisorEventMap>(\n handler: ((payload: SupervisorEventMap[K]) => void) | undefined,\n payload: SupervisorEventMap[K],\n): void {\n if (typeof handler !== \"function\") {\n return;\n }\n\n try {\n handler(payload);\n } catch {\n // Listener bugs must not derail the supervisor.\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,IAAa,oBAAb,MAA+B;CAO7B,AAAO,YAAY,iBAA2C;0CAL1B,IAAI,IAGtC;EAGA,KAAK,kBAAkB;CACzB;CAEA,AAAO,GACL,OACA,SACY;EACZ,IAAI,SAAS,KAAK,iBAAiB,IAAI,KAAK;EAE5C,IAAI,CAAC,QAAQ;GACX,yBAAS,IAAI,IAAI;GACjB,KAAK,iBAAiB,IAAI,OAAO,MAAM;EACzC;EAEA,OAAO,IAAI,OAAqB;EAEhC,aAAa,KAAK,IAAI,OAAO,OAAO;CACtC;CAEA,AAAO,IACL,OACA,SACM;EACN,KAAK,iBAAiB,IAAI,KAAK,GAAG,OAAO,OAAqB;CAChE;CAEA,AAAO,KACL,OACA,SACA,mBACM;EACN,OAAO,KAAK,kBAAkB,QAAQ,OAAO;EAE7C,MAAM,SAAS,KAAK,iBAAiB,IAAI,KAAK;EAE9C,IAAI,QACF,KAAK,MAAM,WAAW,QACpB,OAAO,SAAS,OAAO;EAI3B,OAAO,oBAAoB,QAAQ,OAAO;CAC5C;AACF;AAEA,SAAS,OACP,SACA,SACM;CACN,IAAI,OAAO,YAAY,YACrB;CAGF,IAAI;EACF,QAAQ,OAAO;CACjB,QAAQ,CAER;AACF"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Message } from "../contracts/conversation-message.type.mjs";
|
|
2
|
+
import { AgentContract } from "../contracts/agent/agent.contract.mjs";
|
|
3
|
+
import { EndSentinel } from "../contracts/end.type.mjs";
|
|
4
|
+
import { WorkflowInstance } from "../contracts/workflow/workflow.contract.mjs";
|
|
5
|
+
import { RouteContext } from "../contracts/supervisor/route-context.type.mjs";
|
|
6
|
+
import { IntentCallback, SupervisorIntentValue } from "../contracts/supervisor/intent-entry.type.mjs";
|
|
7
|
+
import { DispatchContext } from "../contracts/supervisor/dispatch-context.type.mjs";
|
|
8
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
9
|
+
|
|
10
|
+
//#region ../../@warlock.js/ai/src/supervisor/entries.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Normalized internal representation of one entry in a supervisor's
|
|
13
|
+
* `intents` map — resolved at factory time from one of the accepted
|
|
14
|
+
* value forms (bare agent / workflow / callback / object entry).
|
|
15
|
+
*
|
|
16
|
+
* Carrying the explicit `type` discriminator keeps downstream code
|
|
17
|
+
* (execution, signature, router-prompt) from having to re-detect
|
|
18
|
+
* shape on every dispatch. The discriminated union below replaces
|
|
19
|
+
* the flat-shape used in Phase 3 so callbacks can carry their own
|
|
20
|
+
* function reference + dispatch-context-shaped resolvers.
|
|
21
|
+
*
|
|
22
|
+
* Discriminator renamed `kind` → `type` (Q12) for codebase-wide
|
|
23
|
+
* consistency — every other discriminated result/report shape uses
|
|
24
|
+
* `type`.
|
|
25
|
+
*/
|
|
26
|
+
type ResolvedIntentEntry = ResolvedAgentEntry | ResolvedWorkflowEntry | ResolvedCallbackEntry;
|
|
27
|
+
/**
|
|
28
|
+
* Successor directive function type — the resolver-time projection of
|
|
29
|
+
* `IntentEntry.next` / `IntentRunEntry.next`. Single source of truth
|
|
30
|
+
* across the three resolved variants.
|
|
31
|
+
*/
|
|
32
|
+
type IntentNext = (ctx: DispatchContext) => string | string[] | EndSentinel | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Resolver-time projection of `IntentEntry.history` /
|
|
35
|
+
* `RouterEntry.history` / `AckEntry.history`. Custom slicer that
|
|
36
|
+
* REPLACES the default `historyWindow.<role>` slice.
|
|
37
|
+
*/
|
|
38
|
+
type EntryHistorySlicer = (ctx: RouteContext) => Message[] | ReadonlyArray<Message>;
|
|
39
|
+
type ResolvedAgentEntry = {
|
|
40
|
+
intent: string;
|
|
41
|
+
type: "agent";
|
|
42
|
+
unit: AgentContract<unknown>;
|
|
43
|
+
description: string;
|
|
44
|
+
input?: (ctx: RouteContext) => string;
|
|
45
|
+
/**
|
|
46
|
+
* Per-dispatch placeholder values for the agent's systemPrompt
|
|
47
|
+
* template. Forwarded as `agent.execute(input, { placeholders })`.
|
|
48
|
+
* Phase 3.4 (Stage 4b) — replaces the dropped `composeAgentInput`
|
|
49
|
+
* mechanism for threading state into agents.
|
|
50
|
+
*/
|
|
51
|
+
placeholders?: (ctx: DispatchContext) => Record<string, unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* Schema declaring this intent's slice of supervisor state. Agent
|
|
54
|
+
* output is strip-merged against it; only validated keys appear on
|
|
55
|
+
* `IterationSnapshot.result[intent].output` AND merge into
|
|
56
|
+
* supervisor `state`.
|
|
57
|
+
*/
|
|
58
|
+
output?: StandardSchemaV1<unknown>;
|
|
59
|
+
/**
|
|
60
|
+
* Successor directive (Stage 4d / Q24). When present, runs after
|
|
61
|
+
* this branch's slice merges into state to choose the next dispatch
|
|
62
|
+
* (or terminate) without invoking the router.
|
|
63
|
+
*/
|
|
64
|
+
next?: IntentNext;
|
|
65
|
+
/**
|
|
66
|
+
* Custom history slicer — replaces the default
|
|
67
|
+
* `historyWindow.agents` slice when supplied. See `IntentEntry.history`.
|
|
68
|
+
*/
|
|
69
|
+
history?: EntryHistorySlicer;
|
|
70
|
+
/**
|
|
71
|
+
* Phase 5 / decisions §34. `"stream"` runs the agent without
|
|
72
|
+
* structured-output coercion and writes the assembled prose into
|
|
73
|
+
* `state[streamTo]`; `"structured"` is the default. Resolved at
|
|
74
|
+
* factory time — `undefined` here is treated as `"structured"`.
|
|
75
|
+
*/
|
|
76
|
+
mode?: "structured" | "stream"; /** State key the assembled stream-mode prose writes into. Set iff `mode === "stream"`. */
|
|
77
|
+
streamTo?: string;
|
|
78
|
+
};
|
|
79
|
+
type ResolvedWorkflowEntry = {
|
|
80
|
+
intent: string;
|
|
81
|
+
type: "workflow";
|
|
82
|
+
unit: WorkflowInstance<unknown, unknown>;
|
|
83
|
+
description: string;
|
|
84
|
+
input?: (ctx: RouteContext) => string;
|
|
85
|
+
placeholders?: (ctx: DispatchContext) => Record<string, unknown>;
|
|
86
|
+
output?: StandardSchemaV1<unknown>;
|
|
87
|
+
next?: IntentNext;
|
|
88
|
+
history?: EntryHistorySlicer;
|
|
89
|
+
};
|
|
90
|
+
type ResolvedCallbackEntry = {
|
|
91
|
+
intent: string;
|
|
92
|
+
type: "callback";
|
|
93
|
+
/**
|
|
94
|
+
* The callback that actually runs at dispatch time. Always present
|
|
95
|
+
* regardless of whether the user passed bare-function shorthand or
|
|
96
|
+
* the `{ run, ... }` entry form.
|
|
97
|
+
*/
|
|
98
|
+
callback: IntentCallback;
|
|
99
|
+
/**
|
|
100
|
+
* Description is required only when the supervisor uses a router.
|
|
101
|
+
* Callback intents under a router are validated separately
|
|
102
|
+
* (see {@link assertRouterDescriptions}); under deterministic
|
|
103
|
+
* `route` mode this field is `undefined`.
|
|
104
|
+
*/
|
|
105
|
+
description?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Per-intent input resolver. Receives the upcoming
|
|
108
|
+
* `DispatchContext` and returns the value forwarded as
|
|
109
|
+
* `ctx.input` to the callback.
|
|
110
|
+
*/
|
|
111
|
+
input?: (ctx: DispatchContext) => unknown;
|
|
112
|
+
placeholders?: (ctx: DispatchContext) => Record<string, unknown>;
|
|
113
|
+
/**
|
|
114
|
+
* Schema declaring this callback's slice of state. Without it, the
|
|
115
|
+
* full return value shallow-merges; with it, return is strip-merged
|
|
116
|
+
* to declared keys before merging.
|
|
117
|
+
*/
|
|
118
|
+
output?: StandardSchemaV1<unknown>;
|
|
119
|
+
next?: IntentNext;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Validate and normalize the `intents` map into resolved entries.
|
|
123
|
+
* Runs at factory time — throws `SupervisorFailedError` on the first
|
|
124
|
+
* malformed entry so author-time bugs surface immediately rather
|
|
125
|
+
* than mid-run.
|
|
126
|
+
*
|
|
127
|
+
* Validation rules:
|
|
128
|
+
* - Every value must be an agent, a workflow, a callback function,
|
|
129
|
+
* or an object entry with `agent` / `workflow` / `run`.
|
|
130
|
+
* - Object entries with more than one of `{ agent, workflow, run }`
|
|
131
|
+
* throw with code `SUPERVISOR_INTENT_MIXED_DISPATCH`.
|
|
132
|
+
* - Agent / workflow / agent-shaped entries must resolve to a
|
|
133
|
+
* non-empty description from the underlying unit or the entry's
|
|
134
|
+
* `description` override. Bare callback shorthand has no
|
|
135
|
+
* description source — that's enforced separately by
|
|
136
|
+
* {@link assertRouterDescriptions} when a router is configured.
|
|
137
|
+
*/
|
|
138
|
+
declare function resolveIntentEntries(rawIntents: Record<string, SupervisorIntentValue>, supervisorName: string): Map<string, ResolvedIntentEntry>;
|
|
139
|
+
//#endregion
|
|
140
|
+
export { ResolvedIntentEntry, resolveIntentEntries };
|
|
141
|
+
//# sourceMappingURL=entries.d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