@warlock.js/ai 4.3.0 → 4.5.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/CHANGELOG.md +52 -48
- package/cjs/index.cjs +221 -14144
- package/cjs/src-C02yzsLs.cjs +22991 -0
- package/cjs/src-C02yzsLs.cjs.map +1 -0
- package/cjs/src-DFibP2FQ.cjs +30 -0
- package/esm/agent/agent-config.type.d.mts +90 -1
- package/esm/agent/agent-config.type.d.mts.map +1 -1
- package/esm/agent/agent-input-builder.mjs +27 -6
- package/esm/agent/agent-input-builder.mjs.map +1 -1
- package/esm/agent/agent.d.mts +40 -1
- package/esm/agent/agent.d.mts.map +1 -1
- package/esm/agent/agent.mjs +203 -30
- package/esm/agent/agent.mjs.map +1 -1
- package/esm/agent/index.d.mts +2 -1
- package/esm/agent/index.mjs +1 -0
- package/esm/agent/judge-config.type.d.mts +33 -0
- package/esm/agent/judge-config.type.d.mts.map +1 -0
- package/esm/agent/judge-config.type.mjs +13 -0
- package/esm/agent/judge-config.type.mjs.map +1 -0
- package/esm/ai-openai/src/embedder.mjs +4 -0
- package/esm/ai-openai/src/index.mjs +4 -0
- package/esm/ai-openai/src/model.mjs +5 -0
- package/esm/ai-openai/src/sdk.mjs +6 -0
- package/esm/ai-openai/src/utils/index.mjs +4 -0
- package/esm/ai-openai/src/utils/to-openai-tools.mjs +3 -0
- package/esm/ai-openai/src/utils/wrap-openai-error.mjs +4 -0
- package/esm/ai.d.mts +119 -53
- package/esm/ai.d.mts.map +1 -1
- package/esm/ai.mjs +43 -8
- package/esm/ai.mjs.map +1 -1
- package/esm/batch/batch.d.mts.map +1 -1
- package/esm/batch/batch.mjs +21 -1
- package/esm/batch/batch.mjs.map +1 -1
- package/esm/batch/batch.type.d.mts +11 -4
- package/esm/batch/batch.type.d.mts.map +1 -1
- package/esm/config.d.mts +39 -3
- package/esm/config.d.mts.map +1 -1
- package/esm/config.mjs +26 -2
- package/esm/config.mjs.map +1 -1
- package/esm/contracts/agent/agent-options.type.d.mts +11 -3
- package/esm/contracts/agent/agent-options.type.d.mts.map +1 -1
- package/esm/contracts/agent/eval.type.d.mts +43 -2
- package/esm/contracts/agent/eval.type.d.mts.map +1 -1
- package/esm/contracts/attachment-policy.type.d.mts +51 -0
- package/esm/contracts/attachment-policy.type.d.mts.map +1 -0
- package/esm/contracts/attachment.type.d.mts +16 -7
- package/esm/contracts/attachment.type.d.mts.map +1 -1
- package/esm/contracts/content-part.type.d.mts +14 -5
- package/esm/contracts/content-part.type.d.mts.map +1 -1
- package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -1
- package/esm/contracts/index.d.mts +6 -4
- package/esm/contracts/model.contract.d.mts +11 -8
- package/esm/contracts/model.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/index.d.mts +1 -0
- package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +31 -2
- package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -1
- package/esm/contracts/orchestrator/session-lock.contract.d.mts +47 -0
- package/esm/contracts/orchestrator/session-lock.contract.d.mts.map +1 -0
- package/esm/contracts/planner/index.d.mts +1 -1
- package/esm/contracts/planner/planner-config.type.d.mts +31 -0
- package/esm/contracts/planner/planner-config.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-execute-options.type.d.mts +48 -1
- package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-result.type.d.mts +19 -5
- package/esm/contracts/planner/planner-result.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner.contract.d.mts +1 -1
- package/esm/contracts/result/agent-result.type.d.mts +6 -4
- package/esm/contracts/result/agent-result.type.d.mts.map +1 -1
- package/esm/contracts/result/base-report.type.d.mts +21 -3
- package/esm/contracts/result/base-report.type.d.mts.map +1 -1
- package/esm/contracts/result/base-report.type.mjs.map +1 -1
- package/esm/contracts/result/execution-report.type.d.mts +53 -1
- package/esm/contracts/result/execution-report.type.d.mts.map +1 -1
- package/esm/contracts/result/orchestrator-result.type.d.mts +15 -11
- package/esm/contracts/result/orchestrator-result.type.d.mts.map +1 -1
- package/esm/contracts/result/supervisor-result.type.d.mts +13 -1
- package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
- package/esm/contracts/result/tool-call.type.d.mts +2 -2
- package/esm/contracts/result/tool-call.type.d.mts.map +1 -1
- package/esm/contracts/result/workflow-result.type.d.mts +1 -0
- package/esm/contracts/result/workflow-result.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-config.type.d.mts +29 -0
- package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
- package/esm/contracts/system-prompt.contract.d.mts +103 -1
- package/esm/contracts/system-prompt.contract.d.mts.map +1 -1
- package/esm/contracts/team/index.d.mts +1 -0
- package/esm/contracts/team/team-config.type.d.mts +127 -0
- package/esm/contracts/team/team-config.type.d.mts.map +1 -0
- package/esm/contracts/tool.contract.d.mts +4 -2
- package/esm/contracts/tool.contract.d.mts.map +1 -1
- package/esm/contracts/workflow/step.contract.d.mts +30 -5
- package/esm/contracts/workflow/step.contract.d.mts.map +1 -1
- package/esm/contracts/workflow/workflow.contract.d.mts +16 -0
- package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
- package/esm/errors/error-code.type.d.mts +1 -1
- package/esm/errors/index.d.mts +1 -0
- package/esm/errors/index.mjs +1 -0
- package/esm/errors/outbound-policy-error.d.mts +27 -0
- package/esm/errors/outbound-policy-error.d.mts.map +1 -0
- package/esm/errors/outbound-policy-error.mjs +32 -0
- package/esm/errors/outbound-policy-error.mjs.map +1 -0
- package/esm/eval/dataset.d.mts +28 -0
- package/esm/eval/dataset.d.mts.map +1 -0
- package/esm/eval/dataset.mjs +112 -0
- package/esm/eval/dataset.mjs.map +1 -0
- package/esm/eval/dataset.type.d.mts +53 -0
- package/esm/eval/dataset.type.d.mts.map +1 -0
- package/esm/eval/eval-runner.d.mts.map +1 -1
- package/esm/eval/eval-runner.mjs +16 -2
- package/esm/eval/eval-runner.mjs.map +1 -1
- package/esm/eval/index.d.mts +20 -1
- package/esm/eval/index.d.mts.map +1 -1
- package/esm/eval/index.mjs +20 -2
- package/esm/eval/index.mjs.map +1 -1
- package/esm/eval/regression.d.mts +30 -0
- package/esm/eval/regression.d.mts.map +1 -0
- package/esm/eval/regression.mjs +51 -0
- package/esm/eval/regression.mjs.map +1 -0
- package/esm/eval/report-json.d.mts +30 -0
- package/esm/eval/report-json.d.mts.map +1 -0
- package/esm/eval/report-json.mjs +33 -0
- package/esm/eval/report-json.mjs.map +1 -0
- package/esm/eval/report-junit.d.mts +22 -0
- package/esm/eval/report-junit.d.mts.map +1 -0
- package/esm/eval/report-junit.mjs +60 -0
- package/esm/eval/report-junit.mjs.map +1 -0
- package/esm/guard/contracts/guard-options.type.d.mts +165 -0
- package/esm/guard/contracts/guard-options.type.d.mts.map +1 -0
- package/esm/guard/contracts/guardrail.contract.d.mts +78 -0
- package/esm/guard/contracts/guardrail.contract.d.mts.map +1 -0
- package/esm/guard/contracts/index.d.mts +4 -0
- package/esm/guard/contracts/openai-client.contract.d.mts +51 -0
- package/esm/guard/contracts/openai-client.contract.d.mts.map +1 -0
- package/esm/guard/contracts/verdict.type.d.mts +76 -0
- package/esm/guard/contracts/verdict.type.d.mts.map +1 -0
- package/esm/guard/detectors/index.d.mts +4 -0
- package/esm/guard/detectors/index.mjs +6 -0
- package/esm/guard/detectors/injection.d.mts +34 -0
- package/esm/guard/detectors/injection.d.mts.map +1 -0
- package/esm/guard/detectors/injection.mjs +254 -0
- package/esm/guard/detectors/injection.mjs.map +1 -0
- package/esm/guard/detectors/moderation.d.mts +32 -0
- package/esm/guard/detectors/moderation.d.mts.map +1 -0
- package/esm/guard/detectors/moderation.mjs +134 -0
- package/esm/guard/detectors/moderation.mjs.map +1 -0
- package/esm/guard/detectors/pii.d.mts +41 -0
- package/esm/guard/detectors/pii.d.mts.map +1 -0
- package/esm/guard/detectors/pii.mjs +199 -0
- package/esm/guard/detectors/pii.mjs.map +1 -0
- package/esm/guard/detectors/topic.d.mts +29 -0
- package/esm/guard/detectors/topic.d.mts.map +1 -0
- package/esm/guard/detectors/topic.mjs +99 -0
- package/esm/guard/detectors/topic.mjs.map +1 -0
- package/esm/guard/errors.d.mts +12 -0
- package/esm/guard/errors.d.mts.map +1 -0
- package/esm/guard/errors.mjs +18 -0
- package/esm/guard/errors.mjs.map +1 -0
- package/esm/guard/guard.d.mts +67 -0
- package/esm/guard/guard.d.mts.map +1 -0
- package/esm/guard/guard.mjs +209 -0
- package/esm/guard/guard.mjs.map +1 -0
- package/esm/guard/guardrail.d.mts +39 -0
- package/esm/guard/guardrail.d.mts.map +1 -0
- package/esm/guard/guardrail.mjs +22 -0
- package/esm/guard/guardrail.mjs.map +1 -0
- package/esm/human/contracts/approval.type.d.mts +154 -0
- package/esm/human/contracts/approval.type.d.mts.map +1 -0
- package/esm/human/contracts/human-approval.type.d.mts +38 -0
- package/esm/human/contracts/human-approval.type.d.mts.map +1 -0
- package/esm/human/contracts/index.d.mts +4 -0
- package/esm/human/contracts/interrupt-store.contract.d.mts +112 -0
- package/esm/human/contracts/interrupt-store.contract.d.mts.map +1 -0
- package/esm/human/contracts/resume.type.d.mts +77 -0
- package/esm/human/contracts/resume.type.d.mts.map +1 -0
- package/esm/human/errors.d.mts +84 -0
- package/esm/human/errors.d.mts.map +1 -0
- package/esm/human/errors.mjs +60 -0
- package/esm/human/errors.mjs.map +1 -0
- package/esm/human/human-approval.d.mts +57 -0
- package/esm/human/human-approval.d.mts.map +1 -0
- package/esm/human/human-approval.mjs +170 -0
- package/esm/human/human-approval.mjs.map +1 -0
- package/esm/human/policy.d.mts +55 -0
- package/esm/human/policy.d.mts.map +1 -0
- package/esm/human/policy.mjs +67 -0
- package/esm/human/policy.mjs.map +1 -0
- package/esm/human/register.mjs +37 -0
- package/esm/human/register.mjs.map +1 -0
- package/esm/human/resume-seed.mjs +53 -0
- package/esm/human/resume-seed.mjs.map +1 -0
- package/esm/human/resume.d.mts +54 -0
- package/esm/human/resume.d.mts.map +1 -0
- package/esm/human/resume.mjs +121 -0
- package/esm/human/resume.mjs.map +1 -0
- package/esm/human/stores/index.mjs +5 -0
- package/esm/human/stores/memory.d.mts +30 -0
- package/esm/human/stores/memory.d.mts.map +1 -0
- package/esm/human/stores/memory.mjs +91 -0
- package/esm/human/stores/memory.mjs.map +1 -0
- package/esm/human/stores/pg.d.mts +59 -0
- package/esm/human/stores/pg.d.mts.map +1 -0
- package/esm/human/stores/pg.mjs +220 -0
- package/esm/human/stores/pg.mjs.map +1 -0
- package/esm/human/stores/redis.d.mts +56 -0
- package/esm/human/stores/redis.d.mts.map +1 -0
- package/esm/human/stores/redis.mjs +201 -0
- package/esm/human/stores/redis.mjs.map +1 -0
- package/esm/index.d.mts +113 -22
- package/esm/index.mjs +82 -11
- package/esm/middleware/builtins/budget.mjs +6 -2
- package/esm/middleware/builtins/budget.mjs.map +1 -1
- package/esm/middleware/utils/extract-user-text.d.mts +8 -1
- package/esm/middleware/utils/extract-user-text.d.mts.map +1 -1
- package/esm/middleware/utils/extract-user-text.mjs +8 -1
- package/esm/middleware/utils/extract-user-text.mjs.map +1 -1
- package/esm/object-stream/index.d.mts +2 -0
- package/esm/object-stream/index.mjs +4 -0
- package/esm/object-stream/parse-partial-json.d.mts +22 -0
- package/esm/object-stream/parse-partial-json.d.mts.map +1 -0
- package/esm/object-stream/parse-partial-json.mjs +78 -0
- package/esm/object-stream/parse-partial-json.mjs.map +1 -0
- package/esm/object-stream/stream-object.d.mts +68 -0
- package/esm/object-stream/stream-object.d.mts.map +1 -0
- package/esm/object-stream/stream-object.mjs +104 -0
- package/esm/object-stream/stream-object.mjs.map +1 -0
- package/esm/observe/index.mjs +4 -0
- package/esm/observe/observer-registry.d.mts +30 -0
- package/esm/observe/observer-registry.d.mts.map +1 -0
- package/esm/observe/observer-registry.mjs +51 -0
- package/esm/observe/observer-registry.mjs.map +1 -0
- package/esm/observe/observer.contract.d.mts +40 -0
- package/esm/observe/observer.contract.d.mts.map +1 -0
- package/esm/observe/resolve-observers.d.mts +40 -0
- package/esm/observe/resolve-observers.d.mts.map +1 -0
- package/esm/observe/resolve-observers.mjs +73 -0
- package/esm/observe/resolve-observers.mjs.map +1 -0
- package/esm/orchestrator/execution.d.mts.map +1 -1
- package/esm/orchestrator/execution.mjs +5 -2
- package/esm/orchestrator/execution.mjs.map +1 -1
- package/esm/orchestrator/index.d.mts +1 -0
- package/esm/orchestrator/index.mjs +1 -0
- package/esm/orchestrator/orchestrator.d.mts.map +1 -1
- package/esm/orchestrator/orchestrator.mjs +39 -6
- package/esm/orchestrator/orchestrator.mjs.map +1 -1
- package/esm/orchestrator/session-lock.d.mts +25 -0
- package/esm/orchestrator/session-lock.d.mts.map +1 -0
- package/esm/orchestrator/session-lock.mjs +83 -0
- package/esm/orchestrator/session-lock.mjs.map +1 -0
- package/esm/planner/dag-scheduler.mjs +97 -0
- package/esm/planner/dag-scheduler.mjs.map +1 -0
- package/esm/planner/plan-prompt.d.mts +1 -1
- package/esm/planner/plan-prompt.d.mts.map +1 -1
- package/esm/planner/plan-prompt.mjs +2 -1
- package/esm/planner/plan-prompt.mjs.map +1 -1
- package/esm/planner/plan-schema.mjs +17 -14
- package/esm/planner/plan-schema.mjs.map +1 -1
- package/esm/planner/planner-run.d.mts.map +1 -1
- package/esm/planner/planner-run.mjs +300 -29
- package/esm/planner/planner-run.mjs.map +1 -1
- package/esm/planner/planner.mjs +1 -1
- package/esm/planner/planner.mjs.map +1 -1
- package/esm/prompt/errors.d.mts +57 -0
- package/esm/prompt/errors.d.mts.map +1 -0
- package/esm/prompt/errors.mjs +73 -0
- package/esm/prompt/errors.mjs.map +1 -0
- package/esm/prompt/index.d.mts +3 -0
- package/esm/prompt/index.mjs +4 -0
- package/esm/prompt/prompt-langfuse-sync.mjs +104 -0
- package/esm/prompt/prompt-langfuse-sync.mjs.map +1 -0
- package/esm/prompt/prompt-langfuse-sync.type.d.mts +32 -0
- package/esm/prompt/prompt-langfuse-sync.type.d.mts.map +1 -0
- package/esm/prompt/prompt-validate.mjs +170 -0
- package/esm/prompt/prompt-validate.mjs.map +1 -0
- package/esm/prompt/prompt.d.mts +54 -0
- package/esm/prompt/prompt.d.mts.map +1 -0
- package/esm/prompt/prompt.mjs +218 -0
- package/esm/prompt/prompt.mjs.map +1 -0
- package/esm/prompt/prompt.type.d.mts +174 -0
- package/esm/prompt/prompt.type.d.mts.map +1 -0
- package/esm/prompts/index.d.mts +3 -0
- package/esm/prompts/index.mjs +3 -0
- package/esm/prompts/prompts-manager.contract.d.mts +154 -0
- package/esm/prompts/prompts-manager.contract.d.mts.map +1 -0
- package/esm/prompts/prompts-manager.d.mts +38 -0
- package/esm/prompts/prompts-manager.d.mts.map +1 -0
- package/esm/prompts/prompts-manager.mjs +410 -0
- package/esm/prompts/prompts-manager.mjs.map +1 -0
- package/esm/prompts/prompts-manager.type.d.mts +172 -0
- package/esm/prompts/prompts-manager.type.d.mts.map +1 -0
- package/esm/prompts/prompts-validate.mjs +200 -0
- package/esm/prompts/prompts-validate.mjs.map +1 -0
- package/esm/rag/as-tool.mjs +48 -0
- package/esm/rag/as-tool.mjs.map +1 -0
- package/esm/rag/chunk/chunk.d.mts +24 -0
- package/esm/rag/chunk/chunk.d.mts.map +1 -0
- package/esm/rag/chunk/chunk.mjs +44 -0
- package/esm/rag/chunk/chunk.mjs.map +1 -0
- package/esm/rag/chunk/fixed.mjs +32 -0
- package/esm/rag/chunk/fixed.mjs.map +1 -0
- package/esm/rag/chunk/markdown.mjs +75 -0
- package/esm/rag/chunk/markdown.mjs.map +1 -0
- package/esm/rag/chunk/recursive.mjs +132 -0
- package/esm/rag/chunk/recursive.mjs.map +1 -0
- package/esm/rag/chunk/sentence.mjs +73 -0
- package/esm/rag/chunk/sentence.mjs.map +1 -0
- package/esm/rag/contracts/chunk-options.type.d.mts +35 -0
- package/esm/rag/contracts/chunk-options.type.d.mts.map +1 -0
- package/esm/rag/contracts/citation.type.d.mts +35 -0
- package/esm/rag/contracts/citation.type.d.mts.map +1 -0
- package/esm/rag/contracts/index.d.mts +4 -0
- package/esm/rag/contracts/rag-config.type.d.mts +68 -0
- package/esm/rag/contracts/rag-config.type.d.mts.map +1 -0
- package/esm/rag/contracts/rag-document.type.d.mts +21 -0
- package/esm/rag/contracts/rag-document.type.d.mts.map +1 -0
- package/esm/rag/hybrid/bm25.d.mts +23 -0
- package/esm/rag/hybrid/bm25.d.mts.map +1 -0
- package/esm/rag/hybrid/bm25.mjs +51 -0
- package/esm/rag/hybrid/bm25.mjs.map +1 -0
- package/esm/rag/hybrid/hybrid-rank.d.mts +33 -0
- package/esm/rag/hybrid/hybrid-rank.d.mts.map +1 -0
- package/esm/rag/hybrid/hybrid-rank.mjs +29 -0
- package/esm/rag/hybrid/hybrid-rank.mjs.map +1 -0
- package/esm/rag/hybrid/rrf.d.mts +25 -0
- package/esm/rag/hybrid/rrf.d.mts.map +1 -0
- package/esm/rag/hybrid/rrf.mjs +30 -0
- package/esm/rag/hybrid/rrf.mjs.map +1 -0
- package/esm/rag/index.d.mts +15 -0
- package/esm/rag/index.mjs +11 -0
- package/esm/rag/rag.d.mts +38 -0
- package/esm/rag/rag.d.mts.map +1 -0
- package/esm/rag/rag.mjs +126 -0
- package/esm/rag/rag.mjs.map +1 -0
- package/esm/rag/rerank/keyword-reranker.d.mts +32 -0
- package/esm/rag/rerank/keyword-reranker.d.mts.map +1 -0
- package/esm/rag/rerank/keyword-reranker.mjs +58 -0
- package/esm/rag/rerank/keyword-reranker.mjs.map +1 -0
- package/esm/rag/rerank/llm-reranker.d.mts +36 -0
- package/esm/rag/rerank/llm-reranker.d.mts.map +1 -0
- package/esm/rag/rerank/llm-reranker.mjs +85 -0
- package/esm/rag/rerank/llm-reranker.mjs.map +1 -0
- package/esm/rag/rerank/reranker.contract.d.mts +28 -0
- package/esm/rag/rerank/reranker.contract.d.mts.map +1 -0
- package/esm/rag/retrieve.mjs +68 -0
- package/esm/rag/retrieve.mjs.map +1 -0
- package/esm/rag/store/cache-vector-store.d.mts +27 -0
- package/esm/rag/store/cache-vector-store.d.mts.map +1 -0
- package/esm/rag/store/cache-vector-store.mjs +48 -0
- package/esm/rag/store/cache-vector-store.mjs.map +1 -0
- package/esm/rag/store/vector-store.contract.d.mts +38 -0
- package/esm/rag/store/vector-store.contract.d.mts.map +1 -0
- package/esm/rag/transforms/multi-query.d.mts +27 -0
- package/esm/rag/transforms/multi-query.d.mts.map +1 -0
- package/esm/rag/transforms/multi-query.mjs +41 -0
- package/esm/rag/transforms/multi-query.mjs.map +1 -0
- package/esm/security/index.mjs +5 -0
- package/esm/security/outbound-policy.d.mts +46 -0
- package/esm/security/outbound-policy.d.mts.map +1 -0
- package/esm/security/outbound-policy.mjs +187 -0
- package/esm/security/outbound-policy.mjs.map +1 -0
- package/esm/security/outbound-policy.type.d.mts +74 -0
- package/esm/security/outbound-policy.type.d.mts.map +1 -0
- package/esm/security/private-ip.d.mts +15 -0
- package/esm/security/private-ip.d.mts.map +1 -0
- package/esm/security/private-ip.mjs +48 -0
- package/esm/security/private-ip.mjs.map +1 -0
- package/esm/security/redact.d.mts +59 -0
- package/esm/security/redact.d.mts.map +1 -0
- package/esm/security/redact.mjs +122 -0
- package/esm/security/redact.mjs.map +1 -0
- package/esm/serve/serve.d.mts +50 -0
- package/esm/serve/serve.d.mts.map +1 -0
- package/esm/serve/serve.mjs +90 -0
- package/esm/serve/serve.mjs.map +1 -0
- package/esm/serve/sse.d.mts +20 -0
- package/esm/serve/sse.d.mts.map +1 -0
- package/esm/serve/sse.mjs +25 -0
- package/esm/serve/sse.mjs.map +1 -0
- package/esm/serve/stream-to-sse.d.mts +29 -0
- package/esm/serve/stream-to-sse.d.mts.map +1 -0
- package/esm/serve/stream-to-sse.mjs +37 -0
- package/esm/serve/stream-to-sse.mjs.map +1 -0
- package/esm/skills/catalog.d.mts +49 -0
- package/esm/skills/catalog.d.mts.map +1 -0
- package/esm/skills/catalog.mjs +140 -0
- package/esm/skills/catalog.mjs.map +1 -0
- package/esm/skills/contracts/skill-record.type.d.mts +37 -0
- package/esm/skills/contracts/skill-record.type.d.mts.map +1 -0
- package/esm/skills/contracts/skills-config.type.d.mts +108 -0
- package/esm/skills/contracts/skills-config.type.d.mts.map +1 -0
- package/esm/skills/contracts/skills-store.contract.d.mts +28 -0
- package/esm/skills/contracts/skills-store.contract.d.mts.map +1 -0
- package/esm/skills/contracts/skills.contract.d.mts +43 -0
- package/esm/skills/contracts/skills.contract.d.mts.map +1 -0
- package/esm/skills/index.d.mts +16 -0
- package/esm/skills/index.mjs +14 -0
- package/esm/skills/load-skill-tool.d.mts +38 -0
- package/esm/skills/load-skill-tool.d.mts.map +1 -0
- package/esm/skills/load-skill-tool.mjs +65 -0
- package/esm/skills/load-skill-tool.mjs.map +1 -0
- package/esm/skills/review-gate.d.mts +33 -0
- package/esm/skills/review-gate.d.mts.map +1 -0
- package/esm/skills/review-gate.mjs +60 -0
- package/esm/skills/review-gate.mjs.map +1 -0
- package/esm/skills/save-skill-tool.d.mts +39 -0
- package/esm/skills/save-skill-tool.d.mts.map +1 -0
- package/esm/skills/save-skill-tool.mjs +65 -0
- package/esm/skills/save-skill-tool.mjs.map +1 -0
- package/esm/skills/skills.d.mts +33 -0
- package/esm/skills/skills.d.mts.map +1 -0
- package/esm/skills/skills.mjs +109 -0
- package/esm/skills/skills.mjs.map +1 -0
- package/esm/skills/sources/directory-source.d.mts +19 -0
- package/esm/skills/sources/directory-source.d.mts.map +1 -0
- package/esm/skills/sources/directory-source.mjs +108 -0
- package/esm/skills/sources/directory-source.mjs.map +1 -0
- package/esm/skills/sources/index.d.mts +18 -0
- package/esm/skills/sources/index.d.mts.map +1 -0
- package/esm/skills/sources/index.mjs +27 -0
- package/esm/skills/sources/index.mjs.map +1 -0
- package/esm/skills/sources/parse-frontmatter.d.mts +27 -0
- package/esm/skills/sources/parse-frontmatter.d.mts.map +1 -0
- package/esm/skills/sources/parse-frontmatter.mjs +46 -0
- package/esm/skills/sources/parse-frontmatter.mjs.map +1 -0
- package/esm/skills/sources/store-source.d.mts +14 -0
- package/esm/skills/sources/store-source.d.mts.map +1 -0
- package/esm/skills/sources/store-source.mjs +15 -0
- package/esm/skills/sources/store-source.mjs.map +1 -0
- package/esm/skills/sources/url-source.d.mts +29 -0
- package/esm/skills/sources/url-source.d.mts.map +1 -0
- package/esm/skills/sources/url-source.mjs +117 -0
- package/esm/skills/sources/url-source.mjs.map +1 -0
- package/esm/skills/store/mock-skills-store.d.mts +57 -0
- package/esm/skills/store/mock-skills-store.d.mts.map +1 -0
- package/esm/skills/store/mock-skills-store.mjs +100 -0
- package/esm/skills/store/mock-skills-store.mjs.map +1 -0
- package/esm/skills/store/procedural-skill-store.d.mts +30 -0
- package/esm/skills/store/procedural-skill-store.d.mts.map +1 -0
- package/esm/skills/store/procedural-skill-store.mjs +125 -0
- package/esm/skills/store/procedural-skill-store.mjs.map +1 -0
- package/esm/supervisor/as-tool.mjs +2 -2
- package/esm/supervisor/as-tool.mjs.map +1 -1
- package/esm/supervisor/execution.d.mts.map +1 -1
- package/esm/supervisor/execution.mjs +31 -28
- package/esm/supervisor/execution.mjs.map +1 -1
- package/esm/supervisor/supervisor.d.mts.map +1 -1
- package/esm/supervisor/supervisor.mjs +8 -3
- package/esm/supervisor/supervisor.mjs.map +1 -1
- package/esm/system-prompt/index.d.mts +4 -0
- package/esm/system-prompt/system-prompt.d.mts +68 -4
- package/esm/system-prompt/system-prompt.d.mts.map +1 -1
- package/esm/system-prompt/system-prompt.mjs +89 -5
- package/esm/system-prompt/system-prompt.mjs.map +1 -1
- package/esm/team/gates.mjs +48 -0
- package/esm/team/gates.mjs.map +1 -0
- package/esm/team/index.d.mts +1 -0
- package/esm/team/index.mjs +3 -0
- package/esm/team/team.d.mts +42 -0
- package/esm/team/team.d.mts.map +1 -0
- package/esm/team/team.mjs +94 -0
- package/esm/team/team.mjs.map +1 -0
- package/esm/tool/executable-as-tool.d.mts.map +1 -1
- package/esm/tool/executable-as-tool.mjs +2 -2
- package/esm/tool/executable-as-tool.mjs.map +1 -1
- package/esm/tool/tool.d.mts.map +1 -1
- package/esm/tool/tool.mjs +2 -2
- package/esm/tool/tool.mjs.map +1 -1
- package/esm/utils/compute-cost.d.mts +17 -1
- package/esm/utils/compute-cost.d.mts.map +1 -1
- package/esm/utils/compute-cost.mjs +26 -1
- package/esm/utils/compute-cost.mjs.map +1 -1
- package/esm/utils/extract-json-lenient.d.mts +42 -0
- package/esm/utils/extract-json-lenient.d.mts.map +1 -0
- package/esm/utils/extract-json-lenient.mjs +97 -0
- package/esm/utils/extract-json-lenient.mjs.map +1 -0
- package/esm/utils/index.d.mts +4 -2
- package/esm/utils/index.mjs +3 -1
- package/esm/utils/json-schema.d.mts +1 -1
- package/esm/utils/prepare-attachment-part.d.mts +10 -1
- package/esm/utils/prepare-attachment-part.d.mts.map +1 -1
- package/esm/utils/prepare-attachment-part.mjs +103 -11
- package/esm/utils/prepare-attachment-part.mjs.map +1 -1
- package/esm/utils/resolve-attachment.d.mts +4 -3
- package/esm/utils/resolve-attachment.d.mts.map +1 -1
- package/esm/utils/resolve-attachment.mjs +4 -3
- package/esm/utils/resolve-attachment.mjs.map +1 -1
- package/esm/utils/run-context.d.mts +94 -0
- package/esm/utils/run-context.d.mts.map +1 -0
- package/esm/utils/run-context.mjs +98 -0
- package/esm/utils/run-context.mjs.map +1 -0
- package/esm/vcr/cassette-io.mjs +57 -0
- package/esm/vcr/cassette-io.mjs.map +1 -0
- package/esm/vcr/errors.d.mts +42 -0
- package/esm/vcr/errors.d.mts.map +1 -0
- package/esm/vcr/errors.mjs +37 -0
- package/esm/vcr/errors.mjs.map +1 -0
- package/esm/vcr/hash-request.d.mts +28 -0
- package/esm/vcr/hash-request.d.mts.map +1 -0
- package/esm/vcr/hash-request.mjs +118 -0
- package/esm/vcr/hash-request.mjs.map +1 -0
- package/esm/vcr/index.d.mts +4 -0
- package/esm/vcr/index.mjs +5 -0
- package/esm/vcr/vcr.d.mts +32 -0
- package/esm/vcr/vcr.d.mts.map +1 -0
- package/esm/vcr/vcr.mjs +248 -0
- package/esm/vcr/vcr.mjs.map +1 -0
- package/esm/vcr/vcr.type.d.mts +118 -0
- package/esm/vcr/vcr.type.d.mts.map +1 -0
- package/esm/workflow/as-tool.mjs +2 -2
- package/esm/workflow/as-tool.mjs.map +1 -1
- package/esm/workflow/engine.mjs +1 -0
- package/esm/workflow/engine.mjs.map +1 -1
- package/esm/workflow/step-runner.mjs +19 -20
- package/esm/workflow/step-runner.mjs.map +1 -1
- package/esm/workflow/workflow.d.mts.map +1 -1
- package/esm/workflow/workflow.mjs +8 -3
- package/esm/workflow/workflow.mjs.map +1 -1
- package/llms-full.txt +1683 -68
- package/llms.txt +16 -4
- package/package.json +7 -3
- package/skills/README.md +40 -4
- package/skills/ai-dx-helpers/SKILL.md +2 -2
- package/skills/approve-tool-calls/SKILL.md +134 -0
- package/skills/attach-ai-middleware/SKILL.md +1 -1
- package/skills/detect-and-redact-pii/SKILL.md +104 -0
- package/skills/durable-resume/SKILL.md +128 -0
- package/skills/escalate-block-to-human/SKILL.md +85 -0
- package/skills/eval-datasets-and-ci/SKILL.md +117 -0
- package/skills/guard-input-output/SKILL.md +117 -0
- package/skills/manage-prompts/SKILL.md +186 -0
- package/skills/observe-ai-flows/SKILL.md +94 -0
- package/skills/record-replay-llm/SKILL.md +92 -0
- package/skills/run-ai-agent/SKILL.md +26 -1
- package/skills/run-ai-rag/SKILL.md +139 -0
- package/skills/run-ai-team/SKILL.md +107 -0
- package/skills/run-orchestrator/SKILL.md +2 -0
- package/skills/run-planner/SKILL.md +73 -8
- package/skills/run-supervisor/SKILL.md +20 -1
- package/skills/use-runtime-skills/SKILL.md +106 -0
- package/skills/write-system-prompt/SKILL.md +30 -1
- package/cjs/index.cjs.map +0 -1
- package/esm/contracts/result/index.d.mts +0 -15
package/esm/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":[],"sources":["../../../../../../@warlock.js/ai/src/config.ts"],"sourcesContent":["import type { CacheDriver } from \"@warlock.js/cache\";\nimport type { CheckpointStore } from \"./contracts/orchestrator/checkpoint-store.contract\";\nimport type { SnapshotStore } from \"./contracts/orchestrator/snapshot-store.contract\";\n\n/**\n * Process-wide `@warlock.js/ai` configuration. **Intentionally tiny.**\n * Lives here only for genuinely cross-cutting defaults that would\n * otherwise force users to wire the same value into every consumer.\n *\n * **What lives here.** A field earns a slot only when it satisfies\n * all three:\n * 1. Multiple unrelated consumers need the same value.\n * 2. The value is infrastructure (drivers, clients, pools), not\n * behavior (kill-switches, mode flags).\n * 3. Per-call override doesn't make sense for the use case.\n *\n * **What does NOT live here.** Logger config (use\n * `@warlock.js/logger` directly). Per-primitive feature flags\n * (live on the relevant config type). Anything that's really one\n * consumer's concern (lives on that consumer).\n *\n * Phase 3.2 deliberately removed the previous `configureAI()` bag\n * because it was growing unbounded. Treat new fields here with the\n * same suspicion.\n */\nexport
|
|
1
|
+
{"version":3,"file":"config.mjs","names":[],"sources":["../../../../../../@warlock.js/ai/src/config.ts"],"sourcesContent":["import type { CacheDriver } from \"@warlock.js/cache\";\nimport type { CheckpointStore } from \"./contracts/orchestrator/checkpoint-store.contract\";\nimport type { SnapshotStore } from \"./contracts/orchestrator/snapshot-store.contract\";\n\n/**\n * Process-wide `@warlock.js/ai` configuration. **Intentionally tiny.**\n * Lives here only for genuinely cross-cutting defaults that would\n * otherwise force users to wire the same value into every consumer.\n *\n * **What lives here.** A field earns a slot only when it satisfies\n * all three:\n * 1. Multiple unrelated consumers need the same value.\n * 2. The value is infrastructure (drivers, clients, pools), not\n * behavior (kill-switches, mode flags).\n * 3. Per-call override doesn't make sense for the use case.\n *\n * **What does NOT live here.** Logger config (use\n * `@warlock.js/logger` directly). Per-primitive feature flags\n * (live on the relevant config type). Anything that's really one\n * consumer's concern (lives on that consumer).\n *\n * Phase 3.2 deliberately removed the previous `configureAI()` bag\n * because it was growing unbounded. Treat new fields here with the\n * same suspicion.\n *\n * **Augmentable.** Declared as an `interface` (not a `type` alias) so\n * observability/tooling packages can attach their own opaque config slot\n * via declaration merging WITHOUT core importing them — keeping core\n * dependency-free. For example `@warlock.js/ai-panoptic` adds a\n * `panoptic?` field:\n *\n * ```ts\n * declare module \"@warlock.js/ai\" {\n * interface AIConfig {\n * panoptic?: PanopticConfig;\n * }\n * }\n * ```\n *\n * `setAIConfig` stores the whole object via `Object.assign`, so any\n * augmented field is preserved even though core never reads it.\n */\nexport interface AIConfig {\n /**\n * Default `@warlock.js/cache` driver for cache-backed consumers that\n * didn't supply their own `store` — currently the `semanticCache`\n * middleware's vector store. Declaring it once here removes the\n * repetition across middleware declarations.\n *\n * NOT the snapshot-persistence fallback anymore. Supervisor /\n * workflow / orchestrator resume snapshots resolve through\n * {@link AIConfig.defaultSnapshotStore} (a {@link SnapshotStore}),\n * never this driver.\n *\n * Per-declaration overrides (`semanticCache({ store })`) win when\n * supplied. Set this once at app boot, *after* you've constructed\n * your driver.\n *\n * @example\n * import { cache } from \"@warlock.js/cache\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * ai.config({\n * defaultStore: cache.driver(\"redis\", { client: redisClient }),\n * });\n */\n defaultStore?: CacheDriver<any, any>;\n\n /**\n * Default {@link CheckpointStore} for every orchestrator that didn't\n * supply its own `checkpointStore` (orchestrator.md §15.2). Holds\n * durable session state — `state`, `turn_index`, drift `signature`,\n * compaction locks. Per-orchestrator `checkpointStore` wins when\n * supplied. Set once at app boot.\n *\n * @example\n * import { ai } from \"@warlock.js/ai\";\n *\n * ai.config({ defaultCheckpointStore: ai.checkpoint.memory() });\n */\n defaultCheckpointStore?: CheckpointStore;\n\n /**\n * Default {@link SnapshotStore} for every orchestrator that didn't\n * supply its own `snapshotStore` (orchestrator.md §15.2). Holds the\n * internal supervisor run state used to resume an interrupted\n * `iterate: true` turn. Per-orchestrator `snapshotStore` wins when\n * supplied. Set once at app boot.\n *\n * @example\n * import { ai } from \"@warlock.js/ai\";\n *\n * ai.config({ defaultSnapshotStore: ai.snapshot.memory() });\n */\n defaultSnapshotStore?: SnapshotStore;\n};\n\nconst aiConfig: AIConfig = {};\n\n/** A listener notified after every `setAIConfig` merge. */\ntype ConfigListener = (config: AIConfig) => void;\n\nconst configListeners: ConfigListener[] = [];\n\n/**\n * Subscribe to config changes. The listener fires after every\n * {@link setAIConfig} merge with a fresh snapshot of the full config —\n * the seam observability/tooling packages use to react when their\n * augmented slot (e.g. `panoptic`) is set, WITHOUT core importing them.\n *\n * Mirrors the dependency-inversion of the `Observer` registry: core\n * exposes the structural hook; the tool subscribes on its side-effect\n * import. To also catch config that was applied *before* the subscription,\n * read {@link getAIConfig} once right after subscribing.\n *\n * @example\n * import { onConfigApplied, getAIConfig } from \"@warlock.js/ai\";\n * onConfigApplied((config) => applyPanopticConfig(config.panoptic));\n * applyPanopticConfig(getAIConfig().panoptic); // catch pre-set config\n */\nexport function onConfigApplied(listener: ConfigListener): void {\n configListeners.push(listener);\n}\n\n/**\n * Set or extend process-wide AI configuration. Merges over existing\n * values — fields not present in `partial` keep whatever was set\n * before (or stay unset). Call once at app boot, before constructing\n * any agent / supervisor / middleware that should pick up the\n * defaults.\n *\n * Returns the merged config so callers can verify what landed.\n *\n * @example\n * import { cache } from \"@warlock.js/cache\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * ai.config({ defaultStore: cache.driver(\"redis\", { client }) });\n */\nexport function setAIConfig(partial: Partial<AIConfig>): AIConfig {\n Object.assign(aiConfig, partial);\n const snapshot = { ...aiConfig };\n\n // Notify subscribers (e.g. panoptic) after the merge. Errors are\n // swallowed so a misbehaving listener never breaks config application,\n // mirroring the observer / onUsage swallow-on-throw discipline.\n for (const listener of configListeners) {\n try {\n listener(snapshot);\n } catch {\n // intentionally ignored\n }\n }\n\n return snapshot;\n}\n\n/**\n * Read the current AI config snapshot. Returns a shallow copy so\n * callers can't accidentally mutate the source of truth. Used\n * internally by consumers to resolve their `defaultStore` fallback.\n */\nexport function getAIConfig(): AIConfig {\n return { ...aiConfig };\n}\n\n/**\n * Resolve the effective `@warlock.js/cache` driver for a cache-backed\n * consumer that didn't receive an explicit one. Returns the global\n * `defaultStore` if set, otherwise `undefined`. The semantic-cache\n * middleware treats `undefined` as fatal and throws. Snapshot\n * persistence no longer consults this — it resolves through\n * {@link resolveDefaultSnapshotStore}.\n */\nexport function resolveDefaultStore(): CacheDriver<any, any> | undefined {\n return aiConfig.defaultStore;\n}\n\n/**\n * Resolve the global default {@link CheckpointStore} for an\n * orchestrator that didn't receive an explicit `checkpointStore`.\n * Returns `undefined` when none is configured — the orchestrator\n * factory decides whether that's fatal.\n */\nexport function resolveDefaultCheckpointStore(): CheckpointStore | undefined {\n return aiConfig.defaultCheckpointStore;\n}\n\n/**\n * Resolve the global default {@link SnapshotStore} for an orchestrator\n * that didn't receive an explicit `snapshotStore`. Returns `undefined`\n * when none is configured — the orchestrator factory decides whether\n * that's fatal (it is, when `iterate: true`).\n */\nexport function resolveDefaultSnapshotStore(): SnapshotStore | undefined {\n return aiConfig.defaultSnapshotStore;\n}\n"],"mappings":";AAiGA,MAAM,WAAqB,CAAC;AAK5B,MAAM,kBAAoC,CAAC;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,gBAAgB,UAAgC;CAC9D,gBAAgB,KAAK,QAAQ;AAC/B;;;;;;;;;;;;;;;;AAiBA,SAAgB,YAAY,SAAsC;CAChE,OAAO,OAAO,UAAU,OAAO;CAC/B,MAAM,WAAW,EAAE,GAAG,SAAS;CAK/B,KAAK,MAAM,YAAY,iBACrB,IAAI;EACF,SAAS,QAAQ;CACnB,QAAQ,CAER;CAGF,OAAO;AACT;;;;;;AAOA,SAAgB,cAAwB;CACtC,OAAO,EAAE,GAAG,SAAS;AACvB;;;;;;;;;AAUA,SAAgB,sBAAyD;CACvE,OAAO,SAAS;AAClB;;;;;;;AAQA,SAAgB,gCAA6D;CAC3E,OAAO,SAAS;AAClB;;;;;;;AAQA,SAAgB,8BAAyD;CACvE,OAAO,SAAS;AAClB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AttachmentPolicy } from "../attachment-policy.type.mjs";
|
|
1
2
|
import { Attachment } from "../attachment.type.mjs";
|
|
2
3
|
import { Message } from "../conversation-message.type.mjs";
|
|
3
4
|
import { ToolContext } from "../tool.contract.mjs";
|
|
@@ -12,9 +13,9 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
|
12
13
|
* Options passed to AgentContract.execute() to configure a single execution run.
|
|
13
14
|
*
|
|
14
15
|
* @example
|
|
15
|
-
* const result = await agent.execute("
|
|
16
|
+
* const result = await agent.execute("Describe this image", {
|
|
16
17
|
* history: previousMessages,
|
|
17
|
-
* attachments: ["/path/to/
|
|
18
|
+
* attachments: ["/path/to/screenshot.png"],
|
|
18
19
|
* placeholders: { language: "English" },
|
|
19
20
|
* output: z.object({ summary: z.string(), keyPoints: z.array(z.string()) }),
|
|
20
21
|
* on: {
|
|
@@ -25,7 +26,14 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
|
25
26
|
*/
|
|
26
27
|
type AgentExecuteOptions<TOutput = unknown> = {
|
|
27
28
|
/** Prior conversation messages to prepend as context */history?: Message[]; /** Files or URLs to attach to the message */
|
|
28
|
-
attachments?: Attachment[];
|
|
29
|
+
attachments?: Attachment[];
|
|
30
|
+
/**
|
|
31
|
+
* Trust-boundary policy for {@link attachments} (S1) — overrides
|
|
32
|
+
* `AgentConfig.attachmentPolicy` for this call. Governs remote-text
|
|
33
|
+
* fetch (default-deny), the outbound `OutboundPolicy`, and the local-
|
|
34
|
+
* file `allowedRoots` sandbox. Omit to inherit the factory policy.
|
|
35
|
+
*/
|
|
36
|
+
attachmentPolicy?: AttachmentPolicy; /** Values to inject into {{mustache}} placeholders in prompts */
|
|
29
37
|
placeholders?: Placeholders;
|
|
30
38
|
/**
|
|
31
39
|
* Standard Schema for structured output extraction.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-options.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/agent/agent-options.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-options.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/agent/agent-options.type.ts"],"mappings":";;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;KAAY,mBAAA;EAmF4C,wDAjFtD,OAAA,GAAU,OAAA,IA8FA;EA5FV,WAAA,GAAc,UAAA;EAoG+B;;;;;;EA7F7C,gBAAA,GAAmB,gBAAA,EAAnB;EAEA,YAAA,GAAe,YAAA;EAAf;;;;EAKA,MAAA,GAAS,gBAAA,CAAiB,OAAA;EAyB1B;;;;;;;;;;;;;;;;;;;;;AA0ES;;;EA1ET,cAAA,GAAiB,MAAA;;;;;;;;;;;;;;;;;;;;;EAqBjB,MAAA;8EAEE,WAAA;EAAA;EAGF,YAAA,GAAe,oBAAA;;;;;;;;;;;EAWf,MAAA,GAAS,WAAA;EAET,EAAA,GAAK,OAAA,eACS,aAAA,IAAiB,OAAA,EAAS,aAAA,CAAc,CAAA;;;;;;;;;;;;EAatD,OAAA,GAAU,WAAA;;;;;;;;EAQV,kBAAA,GAAqB,wBAAA;;;;;;;;;;;;;EAarB,SAAA;AAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentResult } from "../result/agent-result.type.mjs";
|
|
2
|
+
import { DatasetContract } from "../../eval/dataset.type.mjs";
|
|
2
3
|
import { AgentContract } from "./agent.contract.mjs";
|
|
3
4
|
import { AgentExecuteOptions } from "./agent-options.type.mjs";
|
|
4
5
|
|
|
@@ -92,7 +93,12 @@ type EvalJudge = {
|
|
|
92
93
|
* resolvable per case or the runner throws at author time.
|
|
93
94
|
*/
|
|
94
95
|
type EvalOptions<TOutput = unknown> = {
|
|
95
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* The evaluation cases to run. Either a raw `EvalCase[]` or a
|
|
98
|
+
* {@link DatasetContract} (from `ai.dataset(...)`) — the runner reads
|
|
99
|
+
* `.cases` off a dataset.
|
|
100
|
+
*/
|
|
101
|
+
cases: EvalCase<TOutput>[] | DatasetContract<TOutput>; /** Default scorers applied to every case without its own `scorers`. */
|
|
96
102
|
scorers?: EvalScorer<TOutput>[]; /** LLM-as-judge fallback for cases with no scorers. */
|
|
97
103
|
judge?: EvalJudge;
|
|
98
104
|
/**
|
|
@@ -108,6 +114,36 @@ type EvalOptions<TOutput = unknown> = {
|
|
|
108
114
|
*/
|
|
109
115
|
onFailure?: (caseResult: EvalCaseResult<TOutput>) => void | Promise<void>; /** Execute-options applied to every case (merged under per-case `options`). */
|
|
110
116
|
executeOptions?: AgentExecuteOptions<TOutput>;
|
|
117
|
+
/**
|
|
118
|
+
* A prior {@link EvalReport} to diff against. When set, the new report
|
|
119
|
+
* carries a `regression` block flagging cases whose score dropped more
|
|
120
|
+
* than `tolerance` below the baseline.
|
|
121
|
+
*/
|
|
122
|
+
baseline?: EvalReport<TOutput>;
|
|
123
|
+
/**
|
|
124
|
+
* Maximum allowed per-case score drop vs baseline before it counts as a
|
|
125
|
+
* regression. Only consulted when `baseline` is set. Defaults to `0`
|
|
126
|
+
* (any drop is a regression).
|
|
127
|
+
*/
|
|
128
|
+
tolerance?: number;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Regression verdict attached to an {@link EvalReport} when `agent.eval`
|
|
132
|
+
* is called with a `baseline`. Cases are joined by `name`.
|
|
133
|
+
*/
|
|
134
|
+
type EvalRegression = {
|
|
135
|
+
/**
|
|
136
|
+
* Cases whose score fell more than `tolerance` below the baseline,
|
|
137
|
+
* carrying the before/after scores.
|
|
138
|
+
*/
|
|
139
|
+
regressed: Array<{
|
|
140
|
+
name: string;
|
|
141
|
+
before: number;
|
|
142
|
+
after: number;
|
|
143
|
+
}>; /** Case names present in the baseline but absent in the new report. */
|
|
144
|
+
removed: string[]; /** Case names present in the new report but absent in the baseline. */
|
|
145
|
+
added: string[]; /** `true` when `regressed` is empty — no case regressed beyond tolerance. */
|
|
146
|
+
passed: boolean;
|
|
111
147
|
};
|
|
112
148
|
/**
|
|
113
149
|
* Per-case outcome in an {@link EvalReport}. Bundles the case, the
|
|
@@ -137,7 +173,12 @@ type EvalReport<TOutput = unknown> = {
|
|
|
137
173
|
passed: boolean; /** Per-case results in suite order. */
|
|
138
174
|
cases: EvalCaseResult<TOutput>[]; /** Total wall-clock duration of the whole suite in milliseconds. */
|
|
139
175
|
duration: number;
|
|
176
|
+
/**
|
|
177
|
+
* Regression diff vs a baseline. Present only when `agent.eval` was
|
|
178
|
+
* called with a `baseline`.
|
|
179
|
+
*/
|
|
180
|
+
regression?: EvalRegression;
|
|
140
181
|
};
|
|
141
182
|
//#endregion
|
|
142
|
-
export { EvalCase, EvalCaseResult, EvalJudge, EvalOptions, EvalReport, EvalScore, EvalScorer, EvalScorerContext };
|
|
183
|
+
export { EvalCase, EvalCaseResult, EvalJudge, EvalOptions, EvalRegression, EvalReport, EvalScore, EvalScorer, EvalScorerContext };
|
|
143
184
|
//# sourceMappingURL=eval.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/agent/eval.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"eval.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/agent/eval.type.ts"],"mappings":";;;;;;;;AAYA;;;;;KAAY,SAAA;EASV,6CAPA,KAAA;EAOM;AASR;;;EAXE,MAAA,YAaM;EAXN,MAAA;AAAA;;;;;;;KASU,iBAAA;EAIV,uCAFA,IAAA,EAAM,QAAA,CAAS,OAAA,GAEK;EAApB,MAAA,EAAQ,WAAA,CAAY,OAAA,GAEX;EAAT,MAAA,GAAS,OAAA,EAEL;EAAJ,IAAA;AAAA;;;;;;;KASU,UAAA,uBACV,OAAA,EAAS,iBAAA,CAAkB,OAAA,MACxB,SAAA,GAAY,OAAA,CAAQ,SAAA;;;;;;;KAQb,QAAA;EARK,+DAUf,IAAA,UAVgC;EAYhC,KAAA;EAJU;;;;;EAUV,QAAA,YAIU;EAFV,OAAA,GAAU,UAAA,CAAW,OAAA,KAEQ;EAA7B,OAAA,GAAU,mBAAA,CAAoB,OAAA;AAAA;;;;;;;;;;AAAO;AAevC;;KAAY,SAAA;EAEU,+DAApB,KAAA,EAAO,aAAa;EAAb;;;;AAYM;EANb,MAAA;EAiBqB;;;;;EAXrB,aAAA;AAAA;;;;;;;;;KAWU,WAAA;EA8BW;;;;;EAxBrB,KAAA,EAAO,QAAA,CAAS,OAAA,MAAa,eAAA,CAAgB,OAAA,GAAhB;EAE7B,OAAA,GAAU,UAAA,CAAW,OAAA,KAArB;EAEA,KAAA,GAAQ,SAAA;EAFa;;;;EAOrB,aAAA;EAOyB;;;;;;EAAzB,SAAA,IAAa,UAAA,EAAY,cAAA,CAAe,OAAA,aAAoB,OAAA,QAQ5D;EANA,cAAA,GAAiB,mBAAA,CAAoB,OAAA;EAMf;;;AAMb;AAOX;EAbE,QAAA,GAAW,UAAA,CAAW,OAAA;;;;;;EAMtB,SAAA;AAAA;;;;;KAOU,cAAA;EAmBA;;;;EAdV,SAAA,EAAW,KAAK;IAAG,IAAA;IAAc,MAAA;IAAgB,KAAA;EAAA,IAoBhC;EAlBjB,OAAA,YAcA;EAZA,KAAA,YAYe;EAVf,MAAA;AAAA;;;;;;KAQU,cAAA;EAYF,0CAVR,IAAA,EAAM,QAAA,CAAS,OAAA,GAkBL;EAhBV,MAAA,EAAQ,WAAA,CAAY,OAAA,GAgBA;EAdpB,MAAA,EAAQ,SAAA,IA8BD;EA5BP,KAAA,UAmC2B;EAjC3B,MAAA,WAUqB;EARrB,QAAA;AAAA;;;;;;KAQU,UAAA;EAgBH,0CAdP,SAAA,UAgBA;EAdA,KAAA,UAmBa;EAjBb,WAAA,UAiB2B;EAf3B,WAAA;EAEA,QAAA;EAEA,SAAA;EAEA,MAAA;EAEA,KAAA,EAAO,cAAA,CAAe,OAAA;EAEtB,QAAA;;;;;EAKA,UAAA,GAAa,cAAA;AAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { OutboundPolicy } from "../security/outbound-policy.type.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../@warlock.js/ai/src/contracts/attachment-policy.type.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Trust-boundary policy for agent attachments (S1). Attachment references
|
|
6
|
+
* are frequently user-controlled (chat uploads, document-ingestion
|
|
7
|
+
* endpoints), so the framework treats server-side fetches and local reads
|
|
8
|
+
* as hostile by default.
|
|
9
|
+
*
|
|
10
|
+
* Supply it on `AgentConfig.attachmentPolicy` (factory default) or
|
|
11
|
+
* per-call `AgentExecuteOptions.attachmentPolicy` (overrides the factory
|
|
12
|
+
* one). Omitting it keeps the safe defaults: remote text fetch is denied,
|
|
13
|
+
* and bare-string local paths warn (staged deprecation).
|
|
14
|
+
*/
|
|
15
|
+
type AttachmentPolicy = {
|
|
16
|
+
/**
|
|
17
|
+
* Allow fetching a REMOTE TEXT attachment (an `http`/`https` URL given
|
|
18
|
+
* as a `{ type: "text" }` source). Default `false` — default-deny: such
|
|
19
|
+
* a fetch throws `OutboundPolicyError` unless this is enabled.
|
|
20
|
+
*
|
|
21
|
+
* URL *image* attachments are handed to the provider as a URL and are
|
|
22
|
+
* never fetched server-side, so they are unaffected by this flag.
|
|
23
|
+
*/
|
|
24
|
+
allowRemoteFetch?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* {@link OutboundPolicy} applied to a permitted remote-text fetch
|
|
27
|
+
* (scheme + host allowlist, post-DNS private-IP deny, max bytes,
|
|
28
|
+
* timeout, injectable fetch). Defaults to the strict OutboundPolicy
|
|
29
|
+
* defaults (https-only, private-IP deny on, 5 MiB cap, 10s timeout).
|
|
30
|
+
*/
|
|
31
|
+
outbound?: OutboundPolicy;
|
|
32
|
+
/**
|
|
33
|
+
* Sandbox roots for LOCAL file attachments. When set, a local path must
|
|
34
|
+
* resolve inside one of these absolute roots, else it is rejected with
|
|
35
|
+
* `OutboundPolicyError`. When omitted, local reads are not path-
|
|
36
|
+
* restricted (back-compat) — set this to confine reads to an uploads
|
|
37
|
+
* directory.
|
|
38
|
+
*/
|
|
39
|
+
allowedRoots?: string[];
|
|
40
|
+
/**
|
|
41
|
+
* Allow bare-STRING local paths (e.g. `"./notes.txt"`, `"/etc/passwd"`).
|
|
42
|
+
* Staged deprecation: today bare-string local paths are allowed but warn
|
|
43
|
+
* once (outside tests). Set `false` to hard-deny them now — the typed
|
|
44
|
+
* `{ type, source: { absolutePath } }` StorageFile route stays supported
|
|
45
|
+
* (and is gated by {@link allowedRoots}).
|
|
46
|
+
*/
|
|
47
|
+
allowBareLocalPaths?: boolean;
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { AttachmentPolicy };
|
|
51
|
+
//# sourceMappingURL=attachment-policy.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-policy.type.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/attachment-policy.type.ts"],"mappings":";;;;;AAaA;;;;;;;;;KAAY,gBAAA;EAgCS;;;;;;;;EAvBnB,gBAAA;;;;;;;EAOA,QAAA,GAAW,cAAc;;;;;;;;EAQzB,YAAA;;;;;;;;EAQA,mBAAA;AAAA"}
|
|
@@ -20,8 +20,9 @@ type StorageFileShape = {
|
|
|
20
20
|
*
|
|
21
21
|
* - `string` — local file path or remote URL (auto-detected via the
|
|
22
22
|
* `https?://` prefix).
|
|
23
|
-
* - `StorageFileShape` — a `@warlock.js/core` storage file;
|
|
24
|
-
* over
|
|
23
|
+
* - `StorageFileShape` — a `@warlock.js/core` storage file; `absolutePath`
|
|
24
|
+
* wins over `url` when both are present (prefer the local file the app
|
|
25
|
+
* already has over an extra remote hop).
|
|
25
26
|
* - `{ base64, mediaType }` — raw inline bytes with an explicit IANA
|
|
26
27
|
* media type, useful for in-memory data that never touched disk.
|
|
27
28
|
*/
|
|
@@ -35,12 +36,14 @@ type AttachmentSource = string | StorageFileShape | {
|
|
|
35
36
|
* Two forms:
|
|
36
37
|
*
|
|
37
38
|
* - **Tagged form** (preferred for non-image types and for explicit
|
|
38
|
-
* intent): `{ type: "image" | "text", source }`.
|
|
39
|
+
* intent): `{ type: "image" | "text" | "pdf" | "audio", source }`.
|
|
39
40
|
* - **Shorthand string / StorageFileShape**: the agent infers the
|
|
40
|
-
* media kind from the file extension. Recognized image
|
|
41
|
-
* `.png`, `.jpg`, `.jpeg`, `.webp`, `.gif`.
|
|
42
|
-
*
|
|
43
|
-
* ambiguous inputs causes silent
|
|
41
|
+
* media kind from the file extension. Recognized: image
|
|
42
|
+
* (`.png`, `.jpg`, `.jpeg`, `.webp`, `.gif`), text (`.txt`), pdf
|
|
43
|
+
* (`.pdf`), audio (`.mp3`, `.wav`, `.m4a`, `.ogg`, `.weba`). Anything
|
|
44
|
+
* else throws — silent inference for ambiguous inputs causes silent
|
|
45
|
+
* bugs. The model must declare the matching capability
|
|
46
|
+
* (`vision` / `pdf` / `audio`) or the agent rejects the attachment.
|
|
44
47
|
*
|
|
45
48
|
* @example
|
|
46
49
|
* // Shorthand — extension-inferred image
|
|
@@ -69,6 +72,12 @@ type Attachment = string | StorageFileShape | {
|
|
|
69
72
|
} | {
|
|
70
73
|
type: "text";
|
|
71
74
|
source: AttachmentSource;
|
|
75
|
+
} | {
|
|
76
|
+
type: "pdf";
|
|
77
|
+
source: AttachmentSource;
|
|
78
|
+
} | {
|
|
79
|
+
type: "audio";
|
|
80
|
+
source: AttachmentSource;
|
|
72
81
|
};
|
|
73
82
|
/**
|
|
74
83
|
* A normalized attachment after source resolution — a tagged value the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment.type.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/attachment.type.ts"],"mappings":";;AAUA;;;;AAIc;
|
|
1
|
+
{"version":3,"file":"attachment.type.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/attachment.type.ts"],"mappings":";;AAUA;;;;AAIc;AAgBd;;;;KApBY,gBAAA;EAuBN,6BArBJ,GAAA,WAqB6B;EAnB7B,YAAY;AAAA;;;;;;;;;;;;;;KAgBF,gBAAA,YAER,gBAAgB;EACd,MAAA;EAAgB,SAAA;AAAA;;;;;;;AA4CuB;AAgB7C;;;;;;;;;;;;AAG8C;;;;;;;;;;;;;;;;;KAzBlC,UAAA,YAER,gBAAA;EACE,IAAA;EAAe,MAAA,EAAQ,gBAAA;AAAA;EACvB,IAAA;EAAc,MAAA,EAAQ,gBAAA;AAAA;EACtB,IAAA;EAAa,MAAA,EAAQ,gBAAA;AAAA;EACrB,IAAA;EAAe,MAAA,EAAQ,gBAAA;AAAA;;;;;;;;;;;;;;;KAgBjB,kBAAA;EACN,IAAA;EAAa,KAAA;AAAA;EACb,IAAA;EAAc,KAAA;AAAA;EACd,IAAA;EAAgB,KAAA;EAAe,SAAA;AAAA"}
|
|
@@ -34,22 +34,31 @@ type ContentPart = {
|
|
|
34
34
|
} | {
|
|
35
35
|
type: "image";
|
|
36
36
|
source: ImageSource;
|
|
37
|
+
} | {
|
|
38
|
+
type: "pdf";
|
|
39
|
+
source: BinarySource;
|
|
40
|
+
} | {
|
|
41
|
+
type: "audio";
|
|
42
|
+
source: BinarySource;
|
|
37
43
|
};
|
|
38
44
|
/**
|
|
39
|
-
* Where
|
|
45
|
+
* Where binary media bytes live in a resolved `ContentPart`.
|
|
40
46
|
*
|
|
41
47
|
* - `{ url }` — remote URL the provider can fetch directly. Used for
|
|
42
48
|
* public URLs and StorageFile entries that already expose a URL.
|
|
43
49
|
* - `{ base64, mediaType }` — inlined base64 bytes with an explicit
|
|
44
|
-
* IANA media type (e.g. `"image/png"`
|
|
45
|
-
*
|
|
50
|
+
* IANA media type (e.g. `"image/png"`, `"application/pdf"`,
|
|
51
|
+
* `"audio/mpeg"`). Used for local file paths and StorageFile entries
|
|
52
|
+
* with only an absolute path.
|
|
46
53
|
*/
|
|
47
|
-
type
|
|
54
|
+
type BinarySource = {
|
|
48
55
|
url: string;
|
|
49
56
|
} | {
|
|
50
57
|
base64: string;
|
|
51
58
|
mediaType: string;
|
|
52
59
|
};
|
|
60
|
+
/** Image bytes for an `{ type: "image" }` part. Alias of {@link BinarySource}. */
|
|
61
|
+
type ImageSource = BinarySource;
|
|
53
62
|
//#endregion
|
|
54
|
-
export { ContentPart, ImageSource };
|
|
63
|
+
export { BinarySource, ContentPart, ImageSource };
|
|
55
64
|
//# sourceMappingURL=content-part.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-part.type.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/content-part.type.ts"],"mappings":";;AA6BA
|
|
1
|
+
{"version":3,"file":"content-part.type.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/content-part.type.ts"],"mappings":";;AA6BA;;;;;;;;;;;;;;;;;;;;AAIyC;AAYzC;;;;;;;KAhBY,WAAA;EACN,IAAA;EAAc,IAAA;AAAA;EACd,IAAA;EAAe,MAAA,EAAQ,WAAA;AAAA;EACvB,IAAA;EAAa,MAAA,EAAQ,YAAA;AAAA;EACrB,IAAA;EAAe,MAAA,EAAQ,YAAA;AAAA;;;;;;;;;;;KAYjB,YAAA;EAAiB,GAAA;AAAA;EAAkB,MAAA;EAAgB,SAAA;AAAA;;KAGnD,WAAA,GAAc,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-events.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/events/supervisor-events.type.ts"],"mappings":";;;;;;;;;KAWY,yBAAA;EACV,cAAA;EACA,KAAA,EAAO,eAAe;AAAA;;KAIZ,kCAAA;EAAuC,SAAS;AAAA;;KAGhD,+BAAA;EAAoC,SAAS;AAAA;;KAG7C,8BAAA;EACV,SAAA;EACA,IAAA,EAAM,IAAI;EACV,SAAA;EACA,UAAA;AAAA;
|
|
1
|
+
{"version":3,"file":"supervisor-events.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/events/supervisor-events.type.ts"],"mappings":";;;;;;;;;KAWY,yBAAA;EACV,cAAA;EACA,KAAA,EAAO,eAAe;AAAA;;KAIZ,kCAAA;EAAuC,SAAS;AAAA;;KAGhD,+BAAA;EAAoC,SAAS;AAAA;;KAG7C,8BAAA;EACV,SAAA;EACA,IAAA,EAAM,IAAI;EACV,SAAA;EACA,UAAA;AAAA;AAPF;AAAA,KAWY,8BAAA;EACV,SAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;;;KAQU,+BAAA;EACV,SAAA;EACA,MAAA;EACA,KAAA;AAAA;AAdF;AAAA,KAkBY,+BAAA;EACV,SAAA;EACA,MAAA;EACA,MAAA;EACA,KAAA;IAAS,KAAA;IAAe,MAAA;IAAgB,KAAA;EAAA;EACxC,QAAA;AAAA;;;;;;KAQU,4BAAA;EACV,SAAA;EACA,MAAA;EACA,KAAA,EAAO,OAAO;AAAA;;;;;;KAQJ,mCAAA;EAAwC,SAAS;AAAA;;AAnBnD;AAQV;;;;;KAoBY,oCAAA;EACV,KAAK;AAAA;;AAlBS;AAQhB;;;;KAmBY,oCAAA;EACV,MAAA;IAAU,MAAA;IAAiB,SAAA;IAAoB,UAAA;EAAA;EAC/C,MAAA;EACA,OAAA;EACA,MAAA;EACA,QAAA;EACA,KAAA,GAAQ,KAAK;AAAA;;;;;;KAQH,iCAAA;EACV,KAAA,EAAO,OAAO;AAAA;;AATD;AAQf;;;;KAUY,6BAAA;EACV,KAAK;AAAA;;;AAAA;AAQP;;KAAY,6BAAA;EACV,MAAA;EACA,KAAA,GAAQ,KAAA;EACR,QAAA;EACA,KAAA,GAAQ,OAAO;AAAA;;KAIL,gCAAA;EACV,SAAA;EACA,OAAA,EAAS,cAAc;AAAA;;;;;KAOb,mCAAA;EACV,SAAA;EACA,QAAA,EAAU,iBAAiB;AAAA;AAF7B;AAAA,KAMY,0BAAA;EACV,WAAA;EACA,MAAM;AAAA;;KAII,0BAAA;EACV,MAAA,EAAQ,gBAAgB,CAAC,OAAA;AAAA;AAP3B;;;;AAAA,KAcY,sBAAA;EAA2B,KAAA,EAAO,OAAO;AAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AttachmentPolicy } from "./attachment-policy.type.mjs";
|
|
1
2
|
import { Attachment, AttachmentSource, ResolvedAttachment, StorageFileShape } from "./attachment.type.mjs";
|
|
2
|
-
import { ContentPart, ImageSource } from "./content-part.type.mjs";
|
|
3
|
+
import { BinarySource, ContentPart, ImageSource } from "./content-part.type.mjs";
|
|
3
4
|
import { ModelToolCallRequest } from "./model-tool-call-request.type.mjs";
|
|
4
5
|
import { Message } from "./conversation-message.type.mjs";
|
|
5
6
|
import { ModelPricing } from "./result/model-pricing.type.mjs";
|
|
@@ -10,7 +11,7 @@ import { BaseReport, REPORT_SCHEMA_VERSION, ReportStatus, ReportType } from "./r
|
|
|
10
11
|
import { FinishReason } from "./finish-reason.type.mjs";
|
|
11
12
|
import { ToolCall } from "./result/tool-call.type.mjs";
|
|
12
13
|
import { LLMTrip } from "./result/llm-trip.type.mjs";
|
|
13
|
-
import { AgentReport, ExecutionReport, ExecutionStatus } from "./result/execution-report.type.mjs";
|
|
14
|
+
import { AgentReport, CapturedMessage, ExecutionReport, ExecutionStatus } from "./result/execution-report.type.mjs";
|
|
14
15
|
import { AgentResult } from "./result/agent-result.type.mjs";
|
|
15
16
|
import { AgentCompletedPayload, AgentErrorPayload, AgentStartingPayload, AgentStreamingPayload, AgentToolCalledPayload, AgentToolCallingFailedPayload, AgentToolCallingPayload, AgentTripCompletedPayload, AgentTripStartedPayload, ToolEventMeta } from "./events/agent-events.type.mjs";
|
|
16
17
|
import { EventIdentity, WithoutIdentity } from "./events/event-identity.type.mjs";
|
|
@@ -40,7 +41,7 @@ import { MiddlewareState } from "./middleware/middleware-state.type.mjs";
|
|
|
40
41
|
import { MiddlewareAgentRef, MiddlewareExecuteContext, MiddlewareModelRef, MiddlewareSupervisorContext, MiddlewareSupervisorRef, MiddlewareToolContext, MiddlewareTripContext } from "./middleware/middleware-context.type.mjs";
|
|
41
42
|
import { AgentMiddleware, AgentMiddlewareExecuteHooks, AgentMiddlewareSupervisorHooks, AgentMiddlewareToolHooks, AgentMiddlewareTripHooks } from "./middleware/middleware.contract.mjs";
|
|
42
43
|
import { Placeholders } from "./placeholders.type.mjs";
|
|
43
|
-
import { InstructionContract, PersonaContract, SystemPromptBlockContract, SystemPromptContract } from "./system-prompt.contract.mjs";
|
|
44
|
+
import { InstructionContract, PersonaContract, SystemPromptBlockContract, SystemPromptContract, SystemPromptMergeOptions, SystemPromptMergeSource, SystemPromptMeta } from "./system-prompt.contract.mjs";
|
|
44
45
|
import { RouteContext } from "./supervisor/route-context.type.mjs";
|
|
45
46
|
import { AckCallback, AckConfig, AckEntry, AckRunEntry } from "./supervisor/ack-entry.type.mjs";
|
|
46
47
|
import { DispatchRawResult, IntentCallback, IntentEntry, IntentRunEntry, SupervisorIntentValue } from "./supervisor/intent-entry.type.mjs";
|
|
@@ -66,6 +67,7 @@ import { RecallOptions } from "./memory/recall-options.type.mjs";
|
|
|
66
67
|
import { MemoryContract } from "./memory/memory.contract.mjs";
|
|
67
68
|
import { MemoryConfig, SemanticMemoryConfig } from "./memory/memory-config.type.mjs";
|
|
68
69
|
import { CheckpointRecord, CheckpointStore } from "./orchestrator/checkpoint-store.contract.mjs";
|
|
70
|
+
import { SessionLock } from "./orchestrator/session-lock.contract.mjs";
|
|
69
71
|
import { OrchestratorCommands } from "./orchestrator/orchestrator-commands.type.mjs";
|
|
70
72
|
import { OrchestratorEvent, OrchestratorEventHandler, OrchestratorEventHandlers, OrchestratorEventMap, OrchestratorEventName } from "./orchestrator/orchestrator-event.type.mjs";
|
|
71
73
|
import { OrchestratorExecuteOptions, OrchestratorResumeOptions } from "./orchestrator/orchestrator-execute-options.type.mjs";
|
|
@@ -74,9 +76,9 @@ import { OrchestratorConfig, OrchestratorMemoryConfig, SummarizeCallback, Summar
|
|
|
74
76
|
import { SessionContract } from "./orchestrator/session.contract.mjs";
|
|
75
77
|
import { PlannerCapability } from "./planner/planner-capability.type.mjs";
|
|
76
78
|
import { PlannerConfig } from "./planner/planner-config.type.mjs";
|
|
77
|
-
import { PlannerExecuteOptions } from "./planner/planner-execute-options.type.mjs";
|
|
78
79
|
import { PlannerPlan, PlannerStep } from "./planner/planner-plan.type.mjs";
|
|
79
80
|
import { PlannerReport, PlannerReportType, PlannerResult, PlannerStepSnapshot } from "./planner/planner-result.type.mjs";
|
|
81
|
+
import { PlannerExecuteOptions, PlannerStepDirective } from "./planner/planner-execute-options.type.mjs";
|
|
80
82
|
import { PlannerContract } from "./planner/planner.contract.mjs";
|
|
81
83
|
import { ModelConfig, SDKAdapterContract } from "./sdk-adapter.contract.mjs";
|
|
82
84
|
import { CompleteEvent } from "./events/complete-event.type.mjs";
|
|
@@ -116,17 +116,20 @@ type ModelCapabilities = {
|
|
|
116
116
|
*/
|
|
117
117
|
promptCaching?: boolean;
|
|
118
118
|
/**
|
|
119
|
-
* True when the adapter accepts audio `ContentPart` input.
|
|
120
|
-
*
|
|
121
|
-
* throws upfront rather than dropping them at the wire
|
|
122
|
-
* `vision`).
|
|
119
|
+
* True when the adapter accepts audio `ContentPart` input (A2). The
|
|
120
|
+
* agent gates `{ type: "audio" }` attachments on this flag — when
|
|
121
|
+
* false/absent it throws upfront rather than dropping them at the wire
|
|
122
|
+
* layer (mirrors `vision`). Wired end-to-end: audio `ContentPart` +
|
|
123
|
+
* attachment resolution exist; today Google (Gemini, via `inlineData`)
|
|
124
|
+
* declares it.
|
|
123
125
|
*/
|
|
124
126
|
audio?: boolean;
|
|
125
127
|
/**
|
|
126
|
-
* True when the adapter accepts PDF / document `ContentPart` input.
|
|
127
|
-
*
|
|
128
|
-
* throws upfront
|
|
129
|
-
* `
|
|
128
|
+
* True when the adapter accepts PDF / document `ContentPart` input (A2).
|
|
129
|
+
* The agent gates `{ type: "pdf" }` attachments on this flag — when
|
|
130
|
+
* false/absent it throws upfront (mirrors `vision`). Wired end-to-end:
|
|
131
|
+
* Anthropic (`document` block), Bedrock Converse (`document` block), and
|
|
132
|
+
* Google (Gemini `inlineData`) map PDF parts.
|
|
130
133
|
*/
|
|
131
134
|
pdf?: boolean;
|
|
132
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.contract.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/model.contract.ts"],"mappings":";;;;;;;;;;AAqBA;;;;;;;;;;;;KAAY,gBAAA;EACV,WAAA;EACA,SAAA,WAkBA;EAhBA,KAAA,GAAQ,UAAA;EA2BR;;;;;;;;EAlBA,cAAA,GAAiB,MAAA;EA6CP;;;;AAAe;AAY3B;EAlDE,MAAA,GAAS,WAAA;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"model.contract.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/model.contract.ts"],"mappings":";;;;;;;;;;AAqBA;;;;;;;;;;;;KAAY,gBAAA;EACV,WAAA;EACA,SAAA,WAkBA;EAhBA,KAAA,GAAQ,UAAA;EA2BR;;;;;;;;EAlBA,cAAA,GAAiB,MAAA;EA6CP;;;;AAAe;AAY3B;EAlDE,MAAA,GAAS,WAAA;;;;;;;;;;AA+FN;EApFH,SAAA;IACE,MAAA,GAAS,eAAA;IACT,SAAA;EAAA;EAkGK;;;;;;;;;;;EArFP,YAAA;IACE,WAAA;EAAA,GAkGwB;EAAA,CA/FzB,GAAA;AAAA;;;;;;KAQS,eAAA;;;;;;;;;;;KAYA,iBAAA;EA0FgD;AAAA;AAgB5D;;;;EAnGE,gBAAA;EA8HmB;;;;;;;EAtHnB,MAAA;EA2HsE;;;;;;EApHtE,SAAA;EA0GmB;;;;;EApGnB,aAAA;EAyG2D;;;;;;;;EAhG3D,KAAA;EAqGuF;AAAA;;;;;;EA7FvF,GAAA;AAAA;;;;;;;;;;;KAaU,aAAA;EACV,OAAA;EACA,YAAA,EAAc,YAAA;EACd,KAAA,EAAO,KAAA;EAEP,SAAA,GAAY,oBAAA;AAAA;;;;;;;;;;KAYF,gBAAA;EACN,IAAA;EAAe,OAAA;AAAA;EAEf,IAAA;EACA,EAAA;EACA,IAAA;EACA,KAAA;;;;;;;EAOA,gBAAA,GAAmB,MAAA;AAAA;EAEnB,IAAA;EAAc,YAAA,EAAc,YAAA;EAAc,KAAA,EAAO,KAAA;AAAA;;;;;;;;;;;;;;;UAgBtC,aAAA;;WAEN,IAAA;;WAEA,QAAA;;;;;;WAMA,YAAA,GAAe,iBAAA;;;;;;;;;;;WAYf,OAAA,GAAU,YAAA;;;;EAKnB,QAAA,CAAS,QAAA,EAAU,OAAA,IAAW,OAAA,GAAU,gBAAA,GAAmB,OAAA,CAAQ,aAAA;;;;EAKnE,MAAA,CAAO,QAAA,EAAU,OAAA,IAAW,OAAA,GAAU,gBAAA,GAAmB,aAAA,CAAc,gBAAA;AAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PgClientLike, RedisClientLike, SnapshotStore } from "./snapshot-store.contract.mjs";
|
|
2
2
|
import { CheckpointRecord, CheckpointStore } from "./checkpoint-store.contract.mjs";
|
|
3
|
+
import { SessionLock } from "./session-lock.contract.mjs";
|
|
3
4
|
import { OrchestratorCommands } from "./orchestrator-commands.type.mjs";
|
|
4
5
|
import { OrchestratorEvent, OrchestratorEventHandler, OrchestratorEventHandlers, OrchestratorEventMap, OrchestratorEventName } from "./orchestrator-event.type.mjs";
|
|
5
6
|
import { OrchestratorExecuteOptions, OrchestratorResumeOptions } from "./orchestrator-execute-options.type.mjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Message } from "../conversation-message.type.mjs";
|
|
2
2
|
import { AgentContract } from "../agent/agent.contract.mjs";
|
|
3
|
+
import { FlowObserveOption } from "../../observe/resolve-observers.mjs";
|
|
3
4
|
import { SnapshotStore } from "./snapshot-store.contract.mjs";
|
|
4
5
|
import { ModelContract } from "../model.contract.mjs";
|
|
5
6
|
import { SystemPromptContract } from "../system-prompt.contract.mjs";
|
|
@@ -12,6 +13,7 @@ import { CompactionResult } from "../result/orchestrator-result.type.mjs";
|
|
|
12
13
|
import { MemoryTier } from "../memory/memory-item.type.mjs";
|
|
13
14
|
import { MemoryContract } from "../memory/memory.contract.mjs";
|
|
14
15
|
import { CheckpointStore } from "./checkpoint-store.contract.mjs";
|
|
16
|
+
import { SessionLock } from "./session-lock.contract.mjs";
|
|
15
17
|
import { OrchestratorEventHandlers } from "./orchestrator-event.type.mjs";
|
|
16
18
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
17
19
|
|
|
@@ -124,7 +126,15 @@ type OrchestratorMemoryConfig = {
|
|
|
124
126
|
*/
|
|
125
127
|
type OrchestratorConfig<TOutput, TState = TOutput, TIntents extends Record<string, SupervisorIntentValue> = Record<string, SupervisorIntentValue>> = {
|
|
126
128
|
/** Stable identifier — used in logs, events, checkpoints, signature. */name: string; /** Dev-curated version string. Metadata only (§10.2) — never parsed. */
|
|
127
|
-
version?: string;
|
|
129
|
+
version?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Per-flow observability routing. `true` routes each turn's report to the
|
|
132
|
+
* globally-registered observers (even with observe-all off); `false` opts
|
|
133
|
+
* out; an `Observer` is a flow-local collector; omitted follows the global
|
|
134
|
+
* observe-all flag. Parity with agent/workflow/supervisor — a durable
|
|
135
|
+
* session root no longer needs a manual `observe.collect()`.
|
|
136
|
+
*/
|
|
137
|
+
observe?: FlowObserveOption; /** Prepended to the router agent's system prompt (router mode only). */
|
|
128
138
|
systemPrompt?: SystemPromptContract | string; /** Dispatchable units keyed by intent name (supervisor surface). */
|
|
129
139
|
intents: TIntents; /** Deterministic per-turn dispatch. Mutually exclusive with `router`. */
|
|
130
140
|
route?: (ctx: RouteContext<TState>) => Next | Promise<Next>; /** LLM-driven dispatch. Mutually exclusive with `route`. */
|
|
@@ -151,7 +161,26 @@ type OrchestratorConfig<TOutput, TState = TOutput, TIntents extends Record<strin
|
|
|
151
161
|
}; /** Automatic post-turn compaction policy (§12). */
|
|
152
162
|
summarize?: SummarizeConfig | SummarizeCallback; /** Number of turn snapshots to retain per session. Default 100. */
|
|
153
163
|
keepSnapshots?: number | "all"; /** Durable session-state store. Falls back to `ai.config({ defaultCheckpointStore })`. */
|
|
154
|
-
checkpointStore?: CheckpointStore;
|
|
164
|
+
checkpointStore?: CheckpointStore;
|
|
165
|
+
/**
|
|
166
|
+
* Per-session turn serialization (C4). Each `execute` / `stream` /
|
|
167
|
+
* `resume` turn runs under `sessionLock.withLock(sessionId, …)` so a
|
|
168
|
+
* concurrent same-session turn can't race the checkpoint's read-modify-
|
|
169
|
+
* write and lose an update.
|
|
170
|
+
*
|
|
171
|
+
* - Omitted (default) → an in-process mutex keyed by `sessionId`. Fully
|
|
172
|
+
* serializes same-session turns within ONE process; for a
|
|
173
|
+
* horizontally-scaled deployment supply a distributed lock instead.
|
|
174
|
+
* - A {@link SessionLock} → your own (e.g. Redis/Postgres advisory
|
|
175
|
+
* locks) for cross-process serialization.
|
|
176
|
+
* - `false` → no locking. Only when an external mechanism (sticky
|
|
177
|
+
* routing, single-writer guarantee) already serializes the session.
|
|
178
|
+
*
|
|
179
|
+
* When a durable `checkpointStore` is configured but no explicit lock
|
|
180
|
+
* is supplied, the orchestrator warns once (outside tests) that the
|
|
181
|
+
* in-process default does not protect across processes.
|
|
182
|
+
*/
|
|
183
|
+
sessionLock?: SessionLock | false; /** Internal-supervisor snapshot store. Required when `iterate: true`. */
|
|
155
184
|
snapshotStore?: SnapshotStore;
|
|
156
185
|
/**
|
|
157
186
|
* Optional per-turn memory (memory core M2). When set, the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/orchestrator/orchestrator-config.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"orchestrator-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/orchestrator/orchestrator-config.type.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;;;KAAY,eAAA;EAeE,qEAbZ,UAAA,WAEA;EAAA,IAAA,WAEa;EAAb,UAAA,GAAa,aAAA;EAOC;;;;;EADd,SAAA,IACE,UAAA,EAAY,gBAAA,EACZ,GAAA;IAAO,SAAA;EAAA,MACJ,OAAA,eAEW;EAAhB,IAAA;IAAS,OAAA;EAAA;AAAA;;;;;;;KASC,iBAAA,IACV,OAAA,EAAS,OAAA,OACN,OAAA,CAAQ,gBAAA,IAAoB,gBAAA;;;;;AAAgB;AAmBjD;;;;;;;;;;;;KAAY,wBAAA;EAYR,gFAVF,KAAA,EAAO,cAAA;EAkBP;;;;;AAYS;EAvBT,MAAA;IACE,CAAA;IACA,SAAA;IACA,IAAA,GAAO,UAAA;EAAA;EAmDQ;;;;;;EA3CjB,QAAA;EAkEc;;;;;EA5Dd,YAAA,GAAe,UAAA;EA8DmB;;;;;EAxDlC,SAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BU,kBAAA,mBAED,OAAA,mBACQ,MAAA,SAAe,qBAAA,IAAyB,MAAA,SAEvD,qBAAA;EAcF,wEAVA,IAAA,UAYA;EAVA,OAAA;EAaA;;;;;;;EALA,OAAA,GAAU,iBAAA,EAO4C;EALtD,YAAA,GAAe,oBAAA,WAON;EAJT,OAAA,EAAS,QAAA,EAIqC;EAF9C,KAAA,IAAS,GAAA,EAAK,YAAA,CAAa,MAAA,MAAY,IAAA,GAAO,OAAA,CAAQ,IAAA,GAK/C;EAHP,MAAA,GAAS,aAAA,YAAyB,WAAA,CAAY,MAAA,GAG5C;EADF,QAAA,IACE,GAAA,EAAK,eAAA,CAAgB,MAAA,MAClB,cAAA,GAAiB,OAAA,CAAQ,cAAA,GAAR;EAEtB,KAAA,GAAQ,MAAA,EAAR;EAEA,MAAA,GAAS,gBAAA,CAAiB,OAAA,GAA1B;EAEA,YAAA,WAF0B;EAI1B,aAAA;EAAA;;;;;EAOA,OAAA;EAO8C;;;;;EAD9C,aAAA;IACE,MAAA,cAAoB,QAAA,EAAU,OAAA,OAAc,OAAA;IAC5C,MAAA,cAAoB,QAAA,EAAU,OAAA,OAAc,OAAA;EAAA,GAQ9C;EALA,SAAA,GAAY,eAAA,GAAkB,iBAAA,EAwB9B;EAtBA,aAAA,mBAwBA;EArBA,eAAA,GAAkB,eAAA;EA+BlB;;;;;;AAG8B;;;;;;;;;;;;EAf9B,WAAA,GAAc,WAAA;EAEd,aAAA,GAAgB,aAAA;;;;;;;;;;EAUhB,MAAA,GAAS,cAAA,GAAiB,wBAAA;EAG1B,EAAA,GAAK,yBAAA;AAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//#region ../@warlock.js/ai/src/contracts/orchestrator/session-lock.contract.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Serializes concurrent turns for a single orchestrator session so the
|
|
4
|
+
* read-modify-write of the durable checkpoint can't lose an update
|
|
5
|
+
* (orchestrator C4). The orchestrator wraps each `execute()` / `stream()`
|
|
6
|
+
* / `resume()` turn in `withLock(sessionId, …)`.
|
|
7
|
+
*
|
|
8
|
+
* The framework default is an in-process mutex keyed by `sessionId`
|
|
9
|
+
* ({@link inProcessSessionLock}), which fully serializes same-session
|
|
10
|
+
* turns within ONE process. For a horizontally-scaled deployment (many
|
|
11
|
+
* processes / pods) supply a distributed implementation — Redis
|
|
12
|
+
* `SETNX` / Redlock, Postgres advisory locks, etc. — so the invariant
|
|
13
|
+
* holds across processes too. Set `sessionLock: false` on the config to
|
|
14
|
+
* opt out entirely (only when an external mechanism already serializes
|
|
15
|
+
* same-session turns, e.g. sticky routing).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // A Redis-backed distributed lock.
|
|
19
|
+
* const redisLock: SessionLock = {
|
|
20
|
+
* async withLock(key, fn, { signal } = {}) {
|
|
21
|
+
* await acquireRedisLock(key, { signal });
|
|
22
|
+
* try {
|
|
23
|
+
* return await fn();
|
|
24
|
+
* } finally {
|
|
25
|
+
* await releaseRedisLock(key);
|
|
26
|
+
* }
|
|
27
|
+
* },
|
|
28
|
+
* };
|
|
29
|
+
*/
|
|
30
|
+
interface SessionLock {
|
|
31
|
+
/**
|
|
32
|
+
* Acquire the lock for `key` (the sessionId), run `fn`, and release it
|
|
33
|
+
* — even if `fn` throws or rejects. Concurrent calls for the SAME key
|
|
34
|
+
* run one at a time, in arrival order; calls for DIFFERENT keys never
|
|
35
|
+
* contend.
|
|
36
|
+
*
|
|
37
|
+
* `options.signal` aborts the WAIT for the lock (never the critical
|
|
38
|
+
* section once acquired): a caller cancelled while queued rejects with
|
|
39
|
+
* the signal's reason instead of deadlocking behind a stuck holder.
|
|
40
|
+
*/
|
|
41
|
+
withLock<T>(key: string, fn: () => Promise<T>, options?: {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}): Promise<T>;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { SessionLock };
|
|
47
|
+
//# sourceMappingURL=session-lock.contract.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-lock.contract.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/orchestrator/session-lock.contract.ts"],"mappings":";;AA4BA;;;;;;;;;;;;;;;;;;;;;;AAec;;;;;UAfG,WAAA;;;;;;;;;;;EAWf,QAAA,IACE,GAAA,UACA,EAAA,QAAU,OAAA,CAAQ,CAAA,GAClB,OAAA;IAAY,MAAA,GAAS,WAAA;EAAA,IACpB,OAAA,CAAQ,CAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlannerCapability } from "./planner-capability.type.mjs";
|
|
2
2
|
import { PlannerConfig } from "./planner-config.type.mjs";
|
|
3
|
-
import { PlannerExecuteOptions } from "./planner-execute-options.type.mjs";
|
|
4
3
|
import { PlannerPlan, PlannerStep } from "./planner-plan.type.mjs";
|
|
5
4
|
import { PlannerReport, PlannerReportType, PlannerResult, PlannerStepSnapshot } from "./planner-result.type.mjs";
|
|
5
|
+
import { PlannerExecuteOptions, PlannerStepDirective } from "./planner-execute-options.type.mjs";
|
|
6
6
|
import { PlannerContract } from "./planner.contract.mjs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AgentContract } from "../agent/agent.contract.mjs";
|
|
2
|
+
import { FlowObserveOption } from "../../observe/resolve-observers.mjs";
|
|
2
3
|
import { ModelContract } from "../model.contract.mjs";
|
|
3
4
|
import { SystemPromptContract } from "../system-prompt.contract.mjs";
|
|
4
5
|
import { PlannerCapability } from "./planner-capability.type.mjs";
|
|
@@ -35,6 +36,14 @@ import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
|
35
36
|
type PlannerConfig<TOutput = unknown> = {
|
|
36
37
|
/** Stable identifier — used in logs, events, signature, report `name`. */name: string; /** Dev-curated version string. Metadata only — never parsed. */
|
|
37
38
|
version?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Per-flow observability routing. `true` routes this planner's report to
|
|
41
|
+
* the globally-registered observers (even with observe-all off); `false`
|
|
42
|
+
* opts out; an `Observer` is a flow-local collector; omitted follows the
|
|
43
|
+
* global observe-all flag. Brings the planner to parity with
|
|
44
|
+
* agent/workflow/supervisor instead of only ever routing under observe-all.
|
|
45
|
+
*/
|
|
46
|
+
observe?: FlowObserveOption;
|
|
38
47
|
/**
|
|
39
48
|
* Model used to build the internal planning agent that GENERATES the
|
|
40
49
|
* plan. Mutually exclusive with `planner`.
|
|
@@ -72,6 +81,28 @@ type PlannerConfig<TOutput = unknown> = {
|
|
|
72
81
|
* untyped.
|
|
73
82
|
*/
|
|
74
83
|
output?: StandardSchemaV1<TOutput>;
|
|
84
|
+
/**
|
|
85
|
+
* Schedule independent steps in parallel off `dependsOn`. When true the
|
|
86
|
+
* planner builds a DAG from step `id` / `dependsOn`, runs each ready
|
|
87
|
+
* level concurrently, and feeds each step ONLY its dependencies'
|
|
88
|
+
* outputs. A cycle or a `dependsOn` that names an unknown step raises a
|
|
89
|
+
* typed {@link import("../../errors/planner-plan-invalid-error").PlannerPlanInvalidError}
|
|
90
|
+
* before any step runs. Default `false` ⇒ today's strict array-order
|
|
91
|
+
* loop, byte-for-byte unchanged.
|
|
92
|
+
*/
|
|
93
|
+
dag?: boolean; /** Max concurrent steps when `dag` is true. Default 4. */
|
|
94
|
+
maxConcurrency?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Adaptive re-planning. When set, a failed step (or a `replan` verdict
|
|
97
|
+
* from the `onStep` execute-option) revises the REMAINING plan instead
|
|
98
|
+
* of aborting — re-asking the planning agent for a fresh plan seeded
|
|
99
|
+
* with the executed-step digest plus the feedback. Bounded by
|
|
100
|
+
* `maxReplans`; on exhaustion the run ends with the last failure.
|
|
101
|
+
* Default off ⇒ a failure aborts exactly as today.
|
|
102
|
+
*/
|
|
103
|
+
replan?: {
|
|
104
|
+
maxReplans: number;
|
|
105
|
+
};
|
|
75
106
|
};
|
|
76
107
|
//#endregion
|
|
77
108
|
export { PlannerConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner-config.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"planner-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner-config.type.ts"],"mappings":";;;;;;;;;;AAkCA;;;;;;;;;;;;;;;;;;;;;;;;;KAAY,aAAA;EAiDV,0EA/CA,IAAA,UA+C0B;EA7C1B,OAAA;EAyDA;;;;AASqB;;;EA1DrB,OAAA,GAAU,iBAAA;;;;;EAKV,KAAA,GAAQ,aAAA;;;;;;EAMR,OAAA,GAAU,aAAA;;;;;;EAMV,YAAA,GAAe,oBAAA;;;;;;EAMf,YAAA,EAAc,iBAAA;;;;;;;EAOd,QAAA;;;;;;;EAOA,MAAA,GAAS,gBAAA,CAAiB,OAAA;;;;;;;;;;EAU1B,GAAA;EAEA,cAAA;;;;;;;;;EASA,MAAA;IAAW,UAAA;EAAA;AAAA"}
|