@warlock.js/ai 4.4.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 -55
- package/cjs/index.cjs +221 -14147
- 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 +8 -0
- 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/supervisor-result.type.d.mts +14 -2
- package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
- package/esm/contracts/result/workflow-result.type.d.mts +2 -1
- 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/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
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import { Placeholders } from "../placeholders.type.mjs";
|
|
2
|
+
import { PlannerPlan } from "./planner-plan.type.mjs";
|
|
3
|
+
import { PlannerStepSnapshot } from "./planner-result.type.mjs";
|
|
2
4
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
3
5
|
|
|
4
6
|
//#region ../@warlock.js/ai/src/contracts/planner/planner-execute-options.type.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Steering verdict returned by the {@link PlannerExecuteOptions.onStep}
|
|
9
|
+
* hook after a step settles.
|
|
10
|
+
*
|
|
11
|
+
* - `{ type: "continue" }` (or returning nothing) — proceed as normal.
|
|
12
|
+
* - `{ type: "abort" }` — stop the run; remaining steps are recorded
|
|
13
|
+
* `skipped`, exactly as a step failure aborts today.
|
|
14
|
+
* - `{ type: "replan"; feedback }` — re-ask the planning agent for a
|
|
15
|
+
* fresh plan over the REMAINING work, seeded with the executed-step
|
|
16
|
+
* digest plus `feedback`. Bounded by `config.replan.maxReplans`; a
|
|
17
|
+
* `replan` directive with no `replan` config is treated as `continue`.
|
|
18
|
+
*/
|
|
19
|
+
type PlannerStepDirective = {
|
|
20
|
+
type: "continue";
|
|
21
|
+
} | {
|
|
22
|
+
type: "abort";
|
|
23
|
+
} | {
|
|
24
|
+
type: "replan";
|
|
25
|
+
feedback: string;
|
|
26
|
+
};
|
|
5
27
|
/**
|
|
6
28
|
* Options accepted by `planner.execute(goal, options?)`.
|
|
7
29
|
*
|
|
@@ -37,7 +59,32 @@ type PlannerExecuteOptions<TOutput = unknown> = {
|
|
|
37
59
|
* trace queries don't need to walk the tree.
|
|
38
60
|
*/
|
|
39
61
|
sessionId?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Approval gate. `"plan-only"` generates (and validates) the plan and
|
|
64
|
+
* returns WITHOUT executing — `report.status === "awaiting-approval"`
|
|
65
|
+
* and `result.plan` carries the generated plan. Pass that plan back via
|
|
66
|
+
* `approvedPlan` to execute it. Defaults to `"execute"`.
|
|
67
|
+
*
|
|
68
|
+
* **`mode: "plan-only"` with `approvedPlan` is contradictory** —
|
|
69
|
+
* `approvedPlan` wins (the plan is executed).
|
|
70
|
+
*/
|
|
71
|
+
mode?: "execute" | "plan-only";
|
|
72
|
+
/**
|
|
73
|
+
* Execute this exact plan, skipping plan generation entirely. Pairs
|
|
74
|
+
* with a prior `mode: "plan-only"` call's `result.plan`. The plan is
|
|
75
|
+
* still validated against the live capabilities, so a stale plan
|
|
76
|
+
* naming a capability the planner no longer has surfaces a typed
|
|
77
|
+
* `PlannerPlanInvalidError`.
|
|
78
|
+
*/
|
|
79
|
+
approvedPlan?: PlannerPlan;
|
|
80
|
+
/**
|
|
81
|
+
* Per-step hook fired after each step settles (both the sequential and
|
|
82
|
+
* the DAG path). Return a {@link PlannerStepDirective} to steer the
|
|
83
|
+
* run: continue (default), abort, or replan the remainder with
|
|
84
|
+
* feedback. May be async.
|
|
85
|
+
*/
|
|
86
|
+
onStep?: (snapshot: PlannerStepSnapshot, plan: PlannerPlan) => void | PlannerStepDirective | Promise<void | PlannerStepDirective>;
|
|
40
87
|
};
|
|
41
88
|
//#endregion
|
|
42
|
-
export { PlannerExecuteOptions };
|
|
89
|
+
export { PlannerExecuteOptions, PlannerStepDirective };
|
|
43
90
|
//# sourceMappingURL=planner-execute-options.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-execute-options.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner-execute-options.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"planner-execute-options.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner-execute-options.type.ts"],"mappings":";;;;;;;;AAiBA;;;;;;;;;AAG8B;KAHlB,oBAAA;EACN,IAAA;AAAA;EACA,IAAA;AAAA;EACA,IAAA;EAAgB,QAAA;AAAA;;;;;;;KAQV,qBAAA;EAAsB,+DAEhC,KAAA;EAKA;;;;EAAA,YAAA,GAAe,YAAA;EAef;;;;;EATA,MAAA,GAAS,gBAAA,CAAiB,OAAA;EAyC1B;;;;;;;;EAhCA,MAAA,GAAS,WAAA;EAmC6D;;;;;;EA5BtE,SAAA;;;;;;;;;;EAUA,IAAA;;;;;;;;EAQA,YAAA,GAAe,WAAA;;;;;;;EAOf,MAAA,IACE,QAAA,EAAU,mBAAA,EACV,IAAA,EAAM,WAAA,YACI,oBAAA,GAAuB,OAAA,QAAe,oBAAA;AAAA"}
|
|
@@ -82,6 +82,14 @@ type PlannerReport = Omit<BaseReport, "type"> & {
|
|
|
82
82
|
type PlannerResult<TOutput = unknown> = Omit<ExecuteResult<TOutput>, "report"> & {
|
|
83
83
|
/** Discriminant for narrowing a heterogeneous result union. */type: "planner";
|
|
84
84
|
report: PlannerReport;
|
|
85
|
+
/**
|
|
86
|
+
* The generated plan, surfaced WITHOUT execution when the run was
|
|
87
|
+
* invoked with `mode: "plan-only"` (`report.status ===
|
|
88
|
+
* "awaiting-approval"`). Pass it back as `approvedPlan` on a follow-up
|
|
89
|
+
* `execute()` to run it. Absent on a normal execute run — the executed
|
|
90
|
+
* plan lives on `report.plan`.
|
|
91
|
+
*/
|
|
92
|
+
plan?: PlannerPlan;
|
|
85
93
|
};
|
|
86
94
|
//#endregion
|
|
87
95
|
export { PlannerReport, PlannerReportType, PlannerResult, PlannerStepSnapshot };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner-result.type.ts"],"mappings":";;;;;;;;;AAmBA;;;;AAA6B;AAW7B;;;;;;KAXY,iBAAA;;;;;;;;;;KAWA,mBAAA;EAYV,0DAVA,KAAA,UAYA;EAVA,IAAA,EAAM,WAAA,EAYN;EAVA,MAAA,sCAUwB;EARxB,MAAA,YAsBU;EApBV,KAAA,GAAQ,OAAA;EACR,SAAA;EACA,OAAA;EACA,QAAA;EACA,KAAA,EAAO,KAAA,EAqBA;EAnBP,WAAA,GAAc,UAAA;AAAA;;;;;;;;;;;;KAcJ,aAAA,GAAgB,IAAA,CAAK,UAAA;EAC/B,IAAA,EAAM,iBAAA,EAgCI;EA9BV,SAAA,UA8BuB;EA5BvB,IAAA,GAAO,WAAA,EA4B2C;EA1BlD,aAAA,EAAe,mBAAA,IA6BP;EA3BR,WAAA;AAAA
|
|
1
|
+
{"version":3,"file":"planner-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/planner/planner-result.type.ts"],"mappings":";;;;;;;;;AAmBA;;;;AAA6B;AAW7B;;;;;;KAXY,iBAAA;;;;;;;;;;KAWA,mBAAA;EAYV,0DAVA,KAAA,UAYA;EAVA,IAAA,EAAM,WAAA,EAYN;EAVA,MAAA,sCAUwB;EARxB,MAAA,YAsBU;EApBV,KAAA,GAAQ,OAAA;EACR,SAAA;EACA,OAAA;EACA,QAAA;EACA,KAAA,EAAO,KAAA,EAqBA;EAnBP,WAAA,GAAc,UAAA;AAAA;;;;;;;;;;;;KAcJ,aAAA,GAAgB,IAAA,CAAK,UAAA;EAC/B,IAAA,EAAM,iBAAA,EAgCI;EA9BV,SAAA,UA8BuB;EA5BvB,IAAA,GAAO,WAAA,EA4B2C;EA1BlD,aAAA,EAAe,mBAAA,IA6BP;EA3BR,WAAA;AAAA;;;;;;;;;;;;AAmCkB;;;;;;;;;;KAXR,aAAA,sBAAmC,IAAA,CAAK,aAAA,CAAc,OAAA;iEAEhE,IAAA;EACA,MAAA,EAAQ,aAAA;;;;;;;;EAQR,IAAA,GAAO,WAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecutableContract } from "../executable.contract.mjs";
|
|
2
|
-
import { PlannerExecuteOptions } from "./planner-execute-options.type.mjs";
|
|
3
2
|
import { PlannerResult } from "./planner-result.type.mjs";
|
|
3
|
+
import { PlannerExecuteOptions } from "./planner-execute-options.type.mjs";
|
|
4
4
|
|
|
5
5
|
//#region ../@warlock.js/ai/src/contracts/planner/planner.contract.d.ts
|
|
6
6
|
/**
|
|
@@ -7,10 +7,12 @@ import { AgentReport } from "./execution-report.type.mjs";
|
|
|
7
7
|
*
|
|
8
8
|
* **Canonical destructuring:** `const { data, text, report, usage, error }`.
|
|
9
9
|
*
|
|
10
|
-
* `report.trips` / `report.
|
|
11
|
-
* everything the old top-level fields did —
|
|
12
|
-
* `report`
|
|
13
|
-
*
|
|
10
|
+
* `report.trips` / `report.children` / `report.duration` hold
|
|
11
|
+
* everything the old top-level fields did — tool dispatches live as
|
|
12
|
+
* child nodes on `report.children` (filter `type === "tool"`), and
|
|
13
|
+
* moving these under `report` leaves the root clean for the four
|
|
14
|
+
* things callers reach for constantly (`data`, `text`, `usage`,
|
|
15
|
+
* `error`).
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* const { data, error, report, usage } = await agent.execute(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/agent-result.type.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"agent-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/agent-result.type.ts"],"mappings":";;;;;;AAyBA;;;;;;;;;;;;;;;;;AAQqB;;;KART,WAAA,sBAAiC,UAAA;wEAE3C,IAAA;EAEA,IAAA,GAAO,OAAA;EAEP,IAAA;EAEA,MAAA,EAAQ,WAAA;AAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AIError } from "../../errors/ai-error.mjs";
|
|
1
2
|
import { Usage } from "./usage.type.mjs";
|
|
2
3
|
import { AttemptEntry } from "./attempt-entry.type.mjs";
|
|
3
4
|
|
|
@@ -19,7 +20,7 @@ declare const REPORT_SCHEMA_VERSION = 1;
|
|
|
19
20
|
* {@link BaseReport}. Forms a closed union so consumers can narrow on
|
|
20
21
|
* the tree without string-matching on `name`.
|
|
21
22
|
*/
|
|
22
|
-
type ReportType = "tool" | "callback" | "agent" | "workflow" | "supervisor" | "orchestrator" | "batch" | "planner";
|
|
23
|
+
type ReportType = "tool" | "callback" | "agent" | "workflow" | "supervisor" | "team" | "orchestrator" | "batch" | "planner";
|
|
23
24
|
/**
|
|
24
25
|
* Terminal status every executable primitive reports. Unified across
|
|
25
26
|
* tools, agents, workflows, and supervisors so dashboards and
|
|
@@ -39,8 +40,13 @@ type ReportType = "tool" | "callback" | "agent" | "workflow" | "supervisor" | "o
|
|
|
39
40
|
* non-terminal member of this union; consumers branching on
|
|
40
41
|
* `status === "completed"` must treat it as a session-continues path,
|
|
41
42
|
* not a failure. Harmless on non-orchestrator reports.
|
|
43
|
+
* - `"awaiting-approval"` — planner-specific NON-terminal status: a
|
|
44
|
+
* `mode: "plan-only"` run generated and validated a plan but executed
|
|
45
|
+
* nothing, pending sign-off (the plan rides on `result.plan`). Mirrors
|
|
46
|
+
* `"awaiting-input"` at the plan boundary. Harmless on non-planner
|
|
47
|
+
* reports.
|
|
42
48
|
*/
|
|
43
|
-
type ReportStatus = "completed" | "failed" | "cancelled" | "max-iterations" | "awaiting-input";
|
|
49
|
+
type ReportStatus = "completed" | "failed" | "cancelled" | "max-iterations" | "awaiting-input" | "awaiting-approval";
|
|
44
50
|
/**
|
|
45
51
|
* Universal execution report shared by every primitive. Per-primitive
|
|
46
52
|
* report types extend this with their own domain-specific fields
|
|
@@ -108,7 +114,19 @@ type BaseReport = {
|
|
|
108
114
|
*/
|
|
109
115
|
sessionId?: string; /** Discriminator for the kind of executable that produced this report. */
|
|
110
116
|
type: ReportType; /** Terminal status of this execution. */
|
|
111
|
-
status: ReportStatus;
|
|
117
|
+
status: ReportStatus;
|
|
118
|
+
/**
|
|
119
|
+
* Terminal error stamped on a `failed` / `cancelled` node so the typed
|
|
120
|
+
* cause travels WITH the report tree — not only on the result envelope.
|
|
121
|
+
* Essential for the observe path: an {@link import("../../observe/observer.contract").Observer}
|
|
122
|
+
* receives `collect(report)` with no envelope, so a failed root would
|
|
123
|
+
* otherwise expose `status` with no error type/message. Child tool nodes
|
|
124
|
+
* already carry their error this way (`ToolCall.error`); root primitives
|
|
125
|
+
* (agent / workflow / supervisor / orchestrator / planner) stamp it here
|
|
126
|
+
* too. Absent on a `completed` node. Panoptic normalizes it to a JSON-safe
|
|
127
|
+
* span error during projection — the raw `AIError` never has to serialize.
|
|
128
|
+
*/
|
|
129
|
+
error?: AIError; /** ISO-8601 wall-clock timestamp when execution began. */
|
|
112
130
|
startedAt: string; /** ISO-8601 wall-clock timestamp when execution finished. */
|
|
113
131
|
endedAt: string; /** Monotonic duration in milliseconds — `performance.now()` delta. */
|
|
114
132
|
duration: number; /** Rolled-up usage: own cost + sum of `children[].usage`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-report.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-report.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"mappings":";;;;;;;AAeA;;;;AAAkC;AAOlC;;;;cAPa,qBAAA;AA2Cb;;;;AAAwB;AAAxB,KApCY,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCA,YAAA;;;;;;;;AA0HS;;;;;;;;;;;;;;;;;KA1FT,UAAA;sFAEV,KAAA;;;;;;;;;;EAUA,WAAA;;;;;;;EAOA,SAAA;EAEA,IAAA;;;;;;;;;;;;EAYA,OAAA;;;;;;;;;;EAUA,SAAA;EAEA,IAAA,EAAM,UAAA;EAEN,MAAA,EAAQ,YAAA;;;;;;;;;;;;EAYR,KAAA,GAAQ,OAAA;EAER,SAAA;EAEA,OAAA;EAEA,QAAA;EAEA,KAAA,EAAO,KAAA;;;;;;EAMP,QAAA,EAAU,UAAA;;;;;;;;EAQV,QAAA,GAAW,YAAA;;;;;;;;;EASX,mBAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-report.type.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"sourcesContent":["import type { AttemptEntry } from \"./attempt-entry.type\";\nimport type { Usage } from \"./usage.type\";\n\n/**\n * Wire-format version stamped on every root `BaseReport`. Bumped only\n * when we make a BREAKING change to the report shape (field removed,\n * required-ness flipped, semantics changed). Additive changes (new\n * optional fields) do not bump.\n *\n * Panoptic and other downstream consumers branch on this to parse\n * old stored reports with their original-shape rules.\n *\n * Current: **1** — initial Panoptic-readiness shape.\n */\nexport const REPORT_SCHEMA_VERSION = 1;\n\n/**\n * Discriminator for the kind of executable that produced a given\n * {@link BaseReport}. Forms a closed union so consumers can narrow on\n * the tree without string-matching on `name`.\n */\nexport type ReportType =\n | \"tool\"\n | \"callback\"\n | \"agent\"\n | \"workflow\"\n | \"supervisor\"\n | \"orchestrator\"\n | \"batch\"\n | \"planner\";\n\n/**\n * Terminal status every executable primitive reports. Unified across\n * tools, agents, workflows, and supervisors so dashboards and\n * generic traversal helpers don't special-case per primitive.\n *\n * - `\"completed\"` — ran to natural end with a usable result.\n * - `\"failed\"` — aborted mid-run or finished without a usable result\n * (crash, schema failure, max-trips, etc.). The\n * accompanying `error` on the envelope carries the typed cause.\n * - `\"cancelled\"` — caller aborted before completion via `AbortSignal`.\n * - `\"max-iterations\"` — supervisor-specific termination when the\n * iteration cap was hit without an explicit `END` / `satisfied`.\n * Harmless on non-supervisor reports; keeping it on the shared\n * union lets consumers write one `switch` for every status.\n * - `\"awaiting-input\"` — orchestrator-specific NON-terminal status: the\n * session is paused waiting for the next user turn (§15.6). The only\n * non-terminal member of this union; consumers branching on\n * `status === \"completed\"` must treat it as a session-continues path,\n * not a failure. Harmless on non-orchestrator reports.\n */\nexport type ReportStatus =\n | \"completed\"\n | \"failed\"\n | \"cancelled\"\n | \"max-iterations\"\n | \"awaiting-input\";\n\n/**\n * Universal execution report shared by every primitive. Per-primitive\n * report types extend this with their own domain-specific fields\n * (agent trips, workflow steps, supervisor iteration snapshots) while\n * keeping the root fields identical. Recursion happens through\n * {@link BaseReport.children} — any executable this node invoked\n * contributes its own full report here, producing a walkable tree of\n * the entire run.\n *\n * **Usage rollup.** `usage` at every node equals this node's own cost\n * plus the sum of each child's `usage`. Leaves (tools) contribute\n * zero own-cost; composites contribute their direct LLM spend only,\n * with children covering everything delegated.\n *\n * @example\n * function totalCost(report: BaseReport): number {\n * return report.usage.total;\n * }\n *\n * function walk(report: BaseReport, depth = 0): void {\n * console.log(`${\" \".repeat(depth)}${report.type} \"${report.name}\" — ${report.status}`);\n * for (const child of report.children) walk(child, depth + 1);\n * }\n */\nexport type BaseReport = {\n /** Stable id for this execution node. Generated per `execute()`/`invoke()` call. */\n runId: string;\n /**\n * Run-id of the immediate parent execution node, when this node was\n * invoked as part of a larger run (e.g. a tool dispatched by an\n * agent; an agent dispatched by a supervisor; an inner primitive\n * wrapped via `asTool()`). Absent on root nodes.\n *\n * Lets Panoptic and other flat-row consumers reconstruct the tree\n * without traversing `children[]` in memory.\n */\n parentRunId?: string;\n /**\n * Run-id of the top-level execution this node belongs to. Equals\n * `runId` on the root node, and is propagated downward to every\n * descendant. Used to slice flat report tables back into per-run\n * groupings.\n */\n rootRunId: string;\n /** Executable identity — the tool/agent/workflow/supervisor name. */\n name: string;\n /**\n * Dev-curated version string mirrored from the primitive's config\n * (`AgentConfig.version`, `ToolConfig.version`, etc.). Free-form —\n * the framework neither parses nor compares it. Stored verbatim on\n * every report so trip-archive queries can distinguish runs of\n * \"agent X v2.1\" from \"agent X v2.2\" even when name + signature\n * are identical.\n *\n * Stays `undefined` when the dev didn't declare one — never\n * auto-defaulted.\n */\n version?: string;\n /**\n * Caller-supplied identifier that groups multiple `.execute()` calls\n * into one conceptual user session / request. Propagated to every\n * descendant report node so flat queries (\"total spend for session\n * X today\") work without joining the tree.\n *\n * Threaded from `execute()` options on every primitive. Optional —\n * absent when the caller didn't supply one.\n */\n sessionId?: string;\n /** Discriminator for the kind of executable that produced this report. */\n type: ReportType;\n /** Terminal status of this execution. */\n status: ReportStatus;\n /** ISO-8601 wall-clock timestamp when execution began. */\n startedAt: string;\n /** ISO-8601 wall-clock timestamp when execution finished. */\n endedAt: string;\n /** Monotonic duration in milliseconds — `performance.now()` delta. */\n duration: number;\n /** Rolled-up usage: own cost + sum of `children[].usage`. */\n usage: Usage;\n /**\n * Reports of every executable invoked by this node, in invocation\n * order. Empty for leaves (pure tools) and for executables that\n * didn't delegate work.\n */\n children: BaseReport[];\n /**\n * Retry history when middleware (or, for workflow steps, the engine\n * itself) retried this node before it either succeeded or gave up.\n * Absent when zero retries happened — keeps the common-case payload\n * lean. The surviving (final) attempt is NOT duplicated here; its\n * outcome is the report's own `status` / timing.\n */\n attempts?: AttemptEntry[];\n /**\n * Wire-format version of this report shape. Only present on root\n * report nodes — implies the same version for the whole tree.\n * Panoptic / archive consumers branch on this to parse old reports\n * with their original-shape rules.\n *\n * Always equals {@link REPORT_SCHEMA_VERSION} at write time.\n */\n reportSchemaVersion?: number;\n};\n"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"base-report.type.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/base-report.type.ts"],"sourcesContent":["import type { AIError } from \"../../errors/ai-error\";\nimport type { AttemptEntry } from \"./attempt-entry.type\";\nimport type { Usage } from \"./usage.type\";\n\n/**\n * Wire-format version stamped on every root `BaseReport`. Bumped only\n * when we make a BREAKING change to the report shape (field removed,\n * required-ness flipped, semantics changed). Additive changes (new\n * optional fields) do not bump.\n *\n * Panoptic and other downstream consumers branch on this to parse\n * old stored reports with their original-shape rules.\n *\n * Current: **1** — initial Panoptic-readiness shape.\n */\nexport const REPORT_SCHEMA_VERSION = 1;\n\n/**\n * Discriminator for the kind of executable that produced a given\n * {@link BaseReport}. Forms a closed union so consumers can narrow on\n * the tree without string-matching on `name`.\n */\nexport type ReportType =\n | \"tool\"\n | \"callback\"\n | \"agent\"\n | \"workflow\"\n | \"supervisor\"\n | \"team\"\n | \"orchestrator\"\n | \"batch\"\n | \"planner\";\n\n/**\n * Terminal status every executable primitive reports. Unified across\n * tools, agents, workflows, and supervisors so dashboards and\n * generic traversal helpers don't special-case per primitive.\n *\n * - `\"completed\"` — ran to natural end with a usable result.\n * - `\"failed\"` — aborted mid-run or finished without a usable result\n * (crash, schema failure, max-trips, etc.). The\n * accompanying `error` on the envelope carries the typed cause.\n * - `\"cancelled\"` — caller aborted before completion via `AbortSignal`.\n * - `\"max-iterations\"` — supervisor-specific termination when the\n * iteration cap was hit without an explicit `END` / `satisfied`.\n * Harmless on non-supervisor reports; keeping it on the shared\n * union lets consumers write one `switch` for every status.\n * - `\"awaiting-input\"` — orchestrator-specific NON-terminal status: the\n * session is paused waiting for the next user turn (§15.6). The only\n * non-terminal member of this union; consumers branching on\n * `status === \"completed\"` must treat it as a session-continues path,\n * not a failure. Harmless on non-orchestrator reports.\n * - `\"awaiting-approval\"` — planner-specific NON-terminal status: a\n * `mode: \"plan-only\"` run generated and validated a plan but executed\n * nothing, pending sign-off (the plan rides on `result.plan`). Mirrors\n * `\"awaiting-input\"` at the plan boundary. Harmless on non-planner\n * reports.\n */\nexport type ReportStatus =\n | \"completed\"\n | \"failed\"\n | \"cancelled\"\n | \"max-iterations\"\n | \"awaiting-input\"\n | \"awaiting-approval\";\n\n/**\n * Universal execution report shared by every primitive. Per-primitive\n * report types extend this with their own domain-specific fields\n * (agent trips, workflow steps, supervisor iteration snapshots) while\n * keeping the root fields identical. Recursion happens through\n * {@link BaseReport.children} — any executable this node invoked\n * contributes its own full report here, producing a walkable tree of\n * the entire run.\n *\n * **Usage rollup.** `usage` at every node equals this node's own cost\n * plus the sum of each child's `usage`. Leaves (tools) contribute\n * zero own-cost; composites contribute their direct LLM spend only,\n * with children covering everything delegated.\n *\n * @example\n * function totalCost(report: BaseReport): number {\n * return report.usage.total;\n * }\n *\n * function walk(report: BaseReport, depth = 0): void {\n * console.log(`${\" \".repeat(depth)}${report.type} \"${report.name}\" — ${report.status}`);\n * for (const child of report.children) walk(child, depth + 1);\n * }\n */\nexport type BaseReport = {\n /** Stable id for this execution node. Generated per `execute()`/`invoke()` call. */\n runId: string;\n /**\n * Run-id of the immediate parent execution node, when this node was\n * invoked as part of a larger run (e.g. a tool dispatched by an\n * agent; an agent dispatched by a supervisor; an inner primitive\n * wrapped via `asTool()`). Absent on root nodes.\n *\n * Lets Panoptic and other flat-row consumers reconstruct the tree\n * without traversing `children[]` in memory.\n */\n parentRunId?: string;\n /**\n * Run-id of the top-level execution this node belongs to. Equals\n * `runId` on the root node, and is propagated downward to every\n * descendant. Used to slice flat report tables back into per-run\n * groupings.\n */\n rootRunId: string;\n /** Executable identity — the tool/agent/workflow/supervisor name. */\n name: string;\n /**\n * Dev-curated version string mirrored from the primitive's config\n * (`AgentConfig.version`, `ToolConfig.version`, etc.). Free-form —\n * the framework neither parses nor compares it. Stored verbatim on\n * every report so trip-archive queries can distinguish runs of\n * \"agent X v2.1\" from \"agent X v2.2\" even when name + signature\n * are identical.\n *\n * Stays `undefined` when the dev didn't declare one — never\n * auto-defaulted.\n */\n version?: string;\n /**\n * Caller-supplied identifier that groups multiple `.execute()` calls\n * into one conceptual user session / request. Propagated to every\n * descendant report node so flat queries (\"total spend for session\n * X today\") work without joining the tree.\n *\n * Threaded from `execute()` options on every primitive. Optional —\n * absent when the caller didn't supply one.\n */\n sessionId?: string;\n /** Discriminator for the kind of executable that produced this report. */\n type: ReportType;\n /** Terminal status of this execution. */\n status: ReportStatus;\n /**\n * Terminal error stamped on a `failed` / `cancelled` node so the typed\n * cause travels WITH the report tree — not only on the result envelope.\n * Essential for the observe path: an {@link import(\"../../observe/observer.contract\").Observer}\n * receives `collect(report)` with no envelope, so a failed root would\n * otherwise expose `status` with no error type/message. Child tool nodes\n * already carry their error this way (`ToolCall.error`); root primitives\n * (agent / workflow / supervisor / orchestrator / planner) stamp it here\n * too. Absent on a `completed` node. Panoptic normalizes it to a JSON-safe\n * span error during projection — the raw `AIError` never has to serialize.\n */\n error?: AIError;\n /** ISO-8601 wall-clock timestamp when execution began. */\n startedAt: string;\n /** ISO-8601 wall-clock timestamp when execution finished. */\n endedAt: string;\n /** Monotonic duration in milliseconds — `performance.now()` delta. */\n duration: number;\n /** Rolled-up usage: own cost + sum of `children[].usage`. */\n usage: Usage;\n /**\n * Reports of every executable invoked by this node, in invocation\n * order. Empty for leaves (pure tools) and for executables that\n * didn't delegate work.\n */\n children: BaseReport[];\n /**\n * Retry history when middleware (or, for workflow steps, the engine\n * itself) retried this node before it either succeeded or gave up.\n * Absent when zero retries happened — keeps the common-case payload\n * lean. The surviving (final) attempt is NOT duplicated here; its\n * outcome is the report's own `status` / timing.\n */\n attempts?: AttemptEntry[];\n /**\n * Wire-format version of this report shape. Only present on root\n * report nodes — implies the same version for the whole tree.\n * Panoptic / archive consumers branch on this to parse old reports\n * with their original-shape rules.\n *\n * Always equals {@link REPORT_SCHEMA_VERSION} at write time.\n */\n reportSchemaVersion?: number;\n};\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,wBAAwB"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
import { ModelToolCallRequest } from "../model-tool-call-request.type.mjs";
|
|
1
2
|
import { BaseReport, ReportStatus } from "./base-report.type.mjs";
|
|
2
3
|
import { LLMTrip } from "./llm-trip.type.mjs";
|
|
3
4
|
|
|
4
5
|
//#region ../@warlock.js/ai/src/contracts/result/execution-report.type.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* One normalized turn of an agent's assembled conversation, captured
|
|
8
|
+
* onto {@link AgentReport.messages} when `captureMessages` is enabled.
|
|
9
|
+
*
|
|
10
|
+
* A faithful, JSON-safe projection of the runtime `Message`: the `tool`
|
|
11
|
+
* role returns a tool's output; an `assistant` turn that requested tools
|
|
12
|
+
* carries `toolCalls`; a `tool` turn carries the `toolCallId` it answers.
|
|
13
|
+
* `content` is always a string here (the runtime stringifies tool
|
|
14
|
+
* results and flattens text), so the captured array survives JSON
|
|
15
|
+
* serialization and downstream exporters forward it verbatim.
|
|
16
|
+
*/
|
|
17
|
+
type CapturedMessage = {
|
|
18
|
+
/** Who produced this turn. */role: "system" | "user" | "assistant" | "tool"; /** The turn's text content (tool results are stringified JSON). */
|
|
19
|
+
content: string; /** Tool calls the assistant requested — present only on assistant turns that triggered tools. */
|
|
20
|
+
toolCalls?: ModelToolCallRequest[]; /** Provider tool-call id this turn answers — present only on tool-result turns. */
|
|
21
|
+
toolCallId?: string;
|
|
22
|
+
};
|
|
5
23
|
/**
|
|
6
24
|
* Terminal status alias retained for backwards-compatibility with
|
|
7
25
|
* existing imports. Use {@link ReportStatus} directly for new code —
|
|
@@ -44,7 +62,41 @@ type AgentReport = BaseReport & {
|
|
|
44
62
|
provider: string;
|
|
45
63
|
}; /** Every LLM round-trip that happened during execution. */
|
|
46
64
|
trips: LLMTrip[];
|
|
65
|
+
/**
|
|
66
|
+
* The resolved system-prompt text sent as the `role: "system"` message
|
|
67
|
+
* (persona + instructions + any auto-appended structured-output
|
|
68
|
+
* instruction). Captured for observability; absent when the agent ran
|
|
69
|
+
* without a system prompt. Note `LLMTrip.input` holds only the user
|
|
70
|
+
* message — the system prompt is recorded here.
|
|
71
|
+
*/
|
|
72
|
+
systemPrompt?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Registry name of the named `SystemPromptContract` this run resolved —
|
|
75
|
+
* its `meta.name`, addressable in `ai.prompts`. Present ONLY when the agent
|
|
76
|
+
* ran against a *named* prompt; absent for a raw-string prompt, an anonymous
|
|
77
|
+
* contract, or no prompt at all. Together with {@link AgentReport.promptVersion}
|
|
78
|
+
* it links a run to the exact prompt version that produced it, so downstream
|
|
79
|
+
* consumers (Panoptic) can group / filter runs by `promptName@promptVersion`.
|
|
80
|
+
*/
|
|
81
|
+
promptName?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Registry version label of the named prompt this run resolved — its
|
|
84
|
+
* `meta.version` (defaulting to `"1"` when the prompt is named but carries
|
|
85
|
+
* no explicit version, mirroring the `ai.prompts` registry default). Present
|
|
86
|
+
* ONLY alongside {@link AgentReport.promptName}.
|
|
87
|
+
*/
|
|
88
|
+
promptVersion?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The full assembled multi-turn conversation — every role
|
|
91
|
+
* (system / user / assistant / tool), every trip — captured as a
|
|
92
|
+
* {@link CapturedMessage}[]. Present ONLY when the agent's
|
|
93
|
+
* `captureMessages` option was set; absent otherwise (byte-for-byte
|
|
94
|
+
* as before). Opt-in because messages can be large and sensitive.
|
|
95
|
+
* Unlike `trips[].input` (which stubs non-first trips with
|
|
96
|
+
* `"[tool results]"`), this preserves the real turn array.
|
|
97
|
+
*/
|
|
98
|
+
messages?: CapturedMessage[];
|
|
47
99
|
};
|
|
48
100
|
//#endregion
|
|
49
|
-
export { AgentReport, ExecutionReport, ExecutionStatus };
|
|
101
|
+
export { AgentReport, CapturedMessage, ExecutionReport, ExecutionStatus };
|
|
50
102
|
//# sourceMappingURL=execution-report.type.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-report.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/execution-report.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-report.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/execution-report.type.ts"],"mappings":";;;;;;;AAeA;;;;;;;;;KAAY,eAAA;EAQA,8BANV,IAAA,4CAcyB;EAZzB,OAAA,UAYwC;EAVxC,SAAA,GAAY,oBAAoB,IAgBtB;EAdV,UAAA;AAAA;;AAcsC;AAoBxC;;;KA1BY,eAAA,GAAkB,YAAY;;;;;KAM9B,eAAA,GAAkB,UAAU;;;;;;;;;;;;AAgEZ;;;;;;;KA5ChB,WAAA,GAAc,UAAA;;;;;;;;EAQxB,KAAA;IAAS,IAAA;IAAc,QAAA;EAAA;EAEvB,KAAA,EAAO,OAAA;;;;;;;;EAQP,YAAA;;;;;;;;;EASA,UAAA;;;;;;;EAOA,aAAA;;;;;;;;;;EAUA,QAAA,GAAW,eAAA;AAAA"}
|
|
@@ -24,7 +24,14 @@ type SupervisorTerminatedBy = "router" | "route" | "classifier" | "evaluate" | "
|
|
|
24
24
|
* on {@link BaseReport.children}, which duplicates nothing: it's the
|
|
25
25
|
* reports of the child agents/workflows dispatched across iterations.
|
|
26
26
|
*/
|
|
27
|
-
type SupervisorReport =
|
|
27
|
+
type SupervisorReport = BaseReport & {
|
|
28
|
+
/**
|
|
29
|
+
* Discriminator for the supervisor engine. `"team"` when produced by
|
|
30
|
+
* `ai.team` (thin sugar over the same engine) so team runs are
|
|
31
|
+
* distinguishable on the wire — group/filter as their own type — while
|
|
32
|
+
* sharing this report shape; `"supervisor"` for a plain `ai.supervisor`.
|
|
33
|
+
*/
|
|
34
|
+
type: "supervisor" | "team";
|
|
28
35
|
supervisorName: string; /** Structural fingerprint — same value exposed on the instance. */
|
|
29
36
|
signature: string;
|
|
30
37
|
terminatedBy: SupervisorTerminatedBy; /** How many iterations ran (including the terminal one). */
|
|
@@ -77,7 +84,12 @@ type SupervisorReport = Omit<BaseReport, "type"> & {
|
|
|
77
84
|
* return { answer: data, cost: usage.total, turns: report.iterations };
|
|
78
85
|
*/
|
|
79
86
|
type SupervisorResult<TOutput = unknown> = BaseResult & {
|
|
80
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Discriminant for narrowing `SessionSendResult.executionResult`.
|
|
89
|
+
* `"team"` for `ai.team` runs (sugar over the same engine), else
|
|
90
|
+
* `"supervisor"` — matches the report's discriminator.
|
|
91
|
+
*/
|
|
92
|
+
type: "supervisor" | "team";
|
|
81
93
|
data?: TOutput;
|
|
82
94
|
report: SupervisorReport;
|
|
83
95
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/supervisor-result.type.ts"],"mappings":";;;;;;;;AAWA;;;;KAAY,sBAAA;AAsBZ;;;;;;;;;;;;;AAAA,KAAY,gBAAA,GAAmB,
|
|
1
|
+
{"version":3,"file":"supervisor-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/supervisor-result.type.ts"],"mappings":";;;;;;;;AAWA;;;;KAAY,sBAAA;AAsBZ;;;;;;;;;;;;;AAAA,KAAY,gBAAA,GAAmB,UAAA;EAW7B;;;;;;EAJA,IAAA;EACA,cAAA,UAwBA;EAtBA,SAAA;EACA,YAAA,EAAc,sBAAA,EAqBiB;EAnB/B,UAAA,UAkD0B;EAhD1B,WAAA;EACA,SAAA,EAAW,iBAAA;EAsDJ;;;;;;EA/CP,GAAA,GAAM,WAAA;EA+CN;;;;;AACwB;;;EAvCxB,UAAA,GAAa,kBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+BH,gBAAA,sBAAsC,UAAA;;;;;;EAMhD,IAAA;EACA,IAAA,GAAO,OAAA;EACP,MAAA,EAAQ,gBAAA;AAAA"}
|
|
@@ -14,7 +14,8 @@ import { StepSnapshot } from "./step-result.type.mjs";
|
|
|
14
14
|
* structure — one entry per defined step — while `children` gives
|
|
15
15
|
* the cross-cutting tree view shared with other primitives.
|
|
16
16
|
*/
|
|
17
|
-
type WorkflowReport =
|
|
17
|
+
type WorkflowReport = BaseReport & {
|
|
18
|
+
/** Discriminator narrowed to the workflow primitive. */type: "workflow";
|
|
18
19
|
workflowName: string; /** Structural fingerprint — same value exposed on the workflow instance. */
|
|
19
20
|
signature: string; /** ISO-8601 timestamp when cancellation was observed, if any. */
|
|
20
21
|
cancelledAt?: string; /** Per-step snapshots keyed by step name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/workflow-result.type.ts"],"mappings":";;;;;;;;AAeA;;;;;;;;KAAY,cAAA,GAAiB,
|
|
1
|
+
{"version":3,"file":"workflow-result.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/result/workflow-result.type.ts"],"mappings":";;;;;;;;AAeA;;;;;;;;KAAY,cAAA,GAAiB,UAAA;EAWZ,wDATf,IAAA;EACA,YAAA;EAEA,SAAA,UAEA;EAAA,WAAA,WAEO;EAAP,KAAA,EAAO,MAAA,SAAe,YAAA,GAEtB;EAAA,KAAA,EAAO,QAAA,CAAS,MAAA;AAAA;;AAAM;AAgBxB;;;;;;;;;;;KAAY,cAAA,sBAAoC,UAAA;EAC9C,IAAA;EACA,IAAA,GAAO,OAAA;EACP,MAAA,EAAQ,cAAA;EACR,KAAA,GAAQ,OAAA;AAAA"}
|
|
@@ -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 { SupervisorInput } from "./supervisor-input.type.mjs";
|
|
4
5
|
import { SnapshotStore } from "../orchestrator/snapshot-store.contract.mjs";
|
|
5
6
|
import { AgentMiddleware } from "../middleware/middleware.contract.mjs";
|
|
@@ -70,6 +71,15 @@ type SupervisorConfig<TOutput = unknown, TState = TOutput, TIntents extends Reco
|
|
|
70
71
|
* independent.
|
|
71
72
|
*/
|
|
72
73
|
version?: string;
|
|
74
|
+
/**
|
|
75
|
+
* INTERNAL — the report-type discriminator stamped on this run's root
|
|
76
|
+
* report + result envelope. Defaults to `"supervisor"`. `ai.team` sets
|
|
77
|
+
* `"team"` so its runs are distinguishable on the wire (group/filter as
|
|
78
|
+
* their own type) while reusing the supervisor engine wholesale. Not
|
|
79
|
+
* part of the public supervisor surface — plain `ai.supervisor` callers
|
|
80
|
+
* leave it unset.
|
|
81
|
+
*/
|
|
82
|
+
reportType?: "supervisor" | "team";
|
|
73
83
|
/**
|
|
74
84
|
* Opt-in Standard Schema describing this supervisor's input. Purely
|
|
75
85
|
* additive — when set, the supervisor can be dropped straight into an
|
|
@@ -392,6 +402,25 @@ type SupervisorConfig<TOutput = unknown, TState = TOutput, TIntents extends Reco
|
|
|
392
402
|
* }),
|
|
393
403
|
*/
|
|
394
404
|
finalizeArtifacts?: (state: TState, artifacts: TArtifacts) => TState;
|
|
405
|
+
/**
|
|
406
|
+
* Observability for this supervisor. Additive and gated — when
|
|
407
|
+
* omitted, the supervisor follows the global observe-all flag (off
|
|
408
|
+
* unless an observability tool turned it on), so behavior is unchanged
|
|
409
|
+
* by default.
|
|
410
|
+
*
|
|
411
|
+
* - `true` → route this run's completed report to the globally
|
|
412
|
+
* registered observers, even when observe-all is off.
|
|
413
|
+
* - `false` → opt this supervisor out entirely, even when observe-all is on.
|
|
414
|
+
* - an `Observer` object → a flow-local collector receiving only this
|
|
415
|
+
* supervisor's report. Typed as the structural `Observer` so core
|
|
416
|
+
* stays panoptic-agnostic; a panoptic flow-local collector can be
|
|
417
|
+
* passed directly. Observer errors are swallowed — they never break
|
|
418
|
+
* the run.
|
|
419
|
+
*
|
|
420
|
+
* `ai.team(...)` forwards its `observe` here verbatim so a team
|
|
421
|
+
* inherits supervisor observability with no extra wiring.
|
|
422
|
+
*/
|
|
423
|
+
observe?: FlowObserveOption;
|
|
395
424
|
};
|
|
396
425
|
//#endregion
|
|
397
426
|
export { SupervisorConfig, SupervisorEventHandler, SupervisorEventHandlers };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/supervisor/supervisor-config.type.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"supervisor-config.type.d.mts","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/contracts/supervisor/supervisor-config.type.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA;;KAAY,sBAAA,iBAAuC,kBAAA,KACjD,OAAA,EAAS,kBAAA,CAAmB,CAAA;AAAA,KAGlB,uBAAA,GAA0B,OAAA,eACxB,kBAAA,GAAqB,sBAAA,CAAuB,CAAA;;;;;;;;;AAJ1B;AAGhC;;;;;;;;;;;;;;;AAC2D;AAyC3D;;;;;;;;;;;;;KAAY,gBAAA,6BAED,OAAA,mBACQ,MAAA,SAAe,qBAAA,IAAyB,MAAA,SAAe,qBAAA,gBAC3D,MAAA;EAiHJ,sEA9GT,IAAA;EA8GkC;;;;;;;;EApGlC,OAAA;EAiI6C;;;;;;;;EAvH7C,UAAA;EAuMM;;;;;;;;;;;EA1LN,WAAA,GAAc,gBAAA,CAAiB,eAAA;EAvC/B;;;;;EA8CA,YAAA,GAAe,oBAAA;EA5C0C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmFzD,IAAA,YAAgB,oBAAA;EAmFhB;;;;;;;;;;;;;;;;;;;EA9DA,OAAA,GAAU,OAAA;EAiNQ;;;;;;;;EAvMlB,MAAA,GAAS,aAAA,YAAyB,WAAA,CAAY,MAAA;EA2PgB;;;;EArP9D,KAAA,IAAS,GAAA,EAAK,YAAA,CAAa,MAAA,MAAY,IAAA,GAAO,OAAA,CAAQ,IAAA;;;;;;;;;;;EAYtD,OAAA,EAAS,QAAA;;;;;;;;;;EAWT,QAAA,IAAY,GAAA,EAAK,eAAA,CAAgB,MAAA,MAAY,cAAA,GAAiB,OAAA,CAAQ,cAAA;;;;;;;;;;;;;;;;EAiBtE,KAAA,GAAQ,MAAA;;;;;EAMR,aAAA;;;;;EAMA,YAAA;;;;;;;;;;;EAYA,MAAA,GAAS,gBAAA,CAAiB,OAAA;;;;;;;;;;;;;EAc1B,aAAA,GAAgB,aAAA;;;;;;EAOhB,EAAA,GAAK,uBAAA;;;;;;;;;;;;;;;;;EAkBL,GAAA,GAAM,SAAA,CAAU,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwChB,UAAA,GAAa,gBAAA,CAAiB,MAAA;;;;;;;;;;;;;;;;;;;;;;EAsB9B,aAAA;IACE,MAAA;IACA,MAAA;IACA,GAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;EAyBF,eAAA,GAAkB,gBAAA,CAAiB,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BnC,UAAA,GAAa,eAAA;;;;;;;;;;;;;;;;;;;;;;;EAwBb,iBAAA,IAAqB,KAAA,EAAO,MAAA,EAAQ,SAAA,EAAW,UAAA,KAAe,MAAA;;;;;;;;;;;;;;;;;;;EAoB9D,OAAA,GAAU,iBAAA;AAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Placeholders } from "./placeholders.type.mjs";
|
|
2
|
+
import { PromptValidationResult, PromptsValidateOptions } from "../prompts/prompts-manager.type.mjs";
|
|
2
3
|
|
|
3
4
|
//#region ../@warlock.js/ai/src/contracts/system-prompt.contract.d.ts
|
|
4
5
|
/**
|
|
@@ -53,6 +54,53 @@ interface PersonaContract extends SystemPromptBlockContract {
|
|
|
53
54
|
interface InstructionContract extends SystemPromptBlockContract {
|
|
54
55
|
readonly type: "instruction";
|
|
55
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Identity + provenance metadata attached to a `SystemPromptContract`.
|
|
59
|
+
*
|
|
60
|
+
* A prompt that carries a `name` becomes addressable in the `ai.prompts`
|
|
61
|
+
* registry (keyed by `name@version`); anonymous prompts (no `name`) are never
|
|
62
|
+
* registered and exist only for inline composition / display.
|
|
63
|
+
*
|
|
64
|
+
* `composedFrom` records the deterministic source labels a prompt was merged
|
|
65
|
+
* from (e.g. `["base@2", "global-instructions@1"]`) — provenance with no
|
|
66
|
+
* random suffixes, so the same merge always yields the same labels.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* const base = ai.systemPrompt("You are support.", {
|
|
70
|
+
* name: "support",
|
|
71
|
+
* version: "1",
|
|
72
|
+
* description: "Tier-1 support persona.",
|
|
73
|
+
* });
|
|
74
|
+
*/
|
|
75
|
+
interface SystemPromptMeta {
|
|
76
|
+
/** Registry name. When present the prompt auto-registers in `ai.prompts`. */
|
|
77
|
+
readonly name?: string;
|
|
78
|
+
/** Registry version label. Defaults to the next integer when omitted. */
|
|
79
|
+
readonly version?: string;
|
|
80
|
+
/** Human-readable description of the prompt's purpose. */
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
/** Deterministic source labels this prompt was composed from (e.g. `["base@2"]`). */
|
|
83
|
+
readonly composedFrom?: readonly string[];
|
|
84
|
+
/** Placeholder keys callers must supply when resolving this prompt. */
|
|
85
|
+
readonly required?: readonly string[];
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Options for the registry-aware overload of {@link SystemPromptContract.merge}
|
|
89
|
+
* that folds in a named prompt resolved from `ai.prompts`.
|
|
90
|
+
*/
|
|
91
|
+
interface SystemPromptMergeOptions {
|
|
92
|
+
/**
|
|
93
|
+
* Which registered version to fold in when merging by name. Defaults to the
|
|
94
|
+
* latest registered version. Ignored when merging a contract instance.
|
|
95
|
+
*/
|
|
96
|
+
readonly fromVersion?: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* A source that {@link SystemPromptContract.merge} can fold in: a pre-built
|
|
100
|
+
* block, another prompt contract (its blocks are folded — persona replaces,
|
|
101
|
+
* instructions append), or a registered prompt name resolved from `ai.prompts`.
|
|
102
|
+
*/
|
|
103
|
+
type SystemPromptMergeSource = SystemPromptBlockContract | SystemPromptContract | string;
|
|
56
104
|
/**
|
|
57
105
|
* Immutable builder for composing a layered system prompt out of persona and
|
|
58
106
|
* instruction blocks. Every mutating method returns a fresh builder — the
|
|
@@ -92,6 +140,29 @@ interface InstructionContract extends SystemPromptBlockContract {
|
|
|
92
140
|
interface SystemPromptContract {
|
|
93
141
|
/** All blocks in render order. Read-only snapshot — use `persona()` / `instruction()` to derive a new builder. */
|
|
94
142
|
readonly blocks: readonly SystemPromptBlockContract[];
|
|
143
|
+
/**
|
|
144
|
+
* Identity + provenance metadata. Read it via the no-argument
|
|
145
|
+
* {@link SystemPromptContract.meta} accessor (`prompt.meta()`); it is
|
|
146
|
+
* present when the prompt was given a name (via `systemPrompt(input, meta)`
|
|
147
|
+
* or `.meta({ name })`) or acquired `composedFrom` provenance through a
|
|
148
|
+
* `merge`, and `undefined` for a bare anonymous prompt.
|
|
149
|
+
*
|
|
150
|
+
* Exposed as a method (not a bare field) because the same `meta` identifier
|
|
151
|
+
* also serves as the immutable updater — see the call signatures below.
|
|
152
|
+
*/
|
|
153
|
+
/**
|
|
154
|
+
* No-argument form: read the current metadata snapshot (or `undefined` when
|
|
155
|
+
* the prompt is anonymous and carries no provenance).
|
|
156
|
+
*/
|
|
157
|
+
meta(): SystemPromptMeta | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Updater form: return a new builder with `meta` merged onto the current
|
|
160
|
+
* metadata (shallow). Immutable — the original is untouched. Giving the
|
|
161
|
+
* result a `name` registers it in `ai.prompts` under `name@version`
|
|
162
|
+
* (version defaults to the next integer); renaming a forked prompt creates
|
|
163
|
+
* a new registry key while the original entry stays put.
|
|
164
|
+
*/
|
|
165
|
+
meta(meta: SystemPromptMeta): SystemPromptContract;
|
|
95
166
|
/**
|
|
96
167
|
* Set (or replace) the persona block. Returns a new builder. If a persona
|
|
97
168
|
* already exists it's replaced in place (preserving its position);
|
|
@@ -103,6 +174,30 @@ interface SystemPromptContract {
|
|
|
103
174
|
* accumulate — instructions render in the order they were added.
|
|
104
175
|
*/
|
|
105
176
|
instruction(instruction: InstructionContract | string): SystemPromptContract;
|
|
177
|
+
/**
|
|
178
|
+
* Merge N predefined blocks into the prompt in one call. Each block is
|
|
179
|
+
* folded in order through the same per-type rules as `persona()` /
|
|
180
|
+
* `instruction()`: a `persona` block sets/replaces the single, leading
|
|
181
|
+
* persona; every other block is appended in order. Accepts pre-built
|
|
182
|
+
* `ai.persona()` / `ai.instruction()` blocks (or any `SystemPromptBlockContract`)
|
|
183
|
+
* for reuse across prompts. Returns a new builder; the original is untouched.
|
|
184
|
+
*/
|
|
185
|
+
merge(...blocks: readonly SystemPromptBlockContract[]): SystemPromptContract;
|
|
186
|
+
/**
|
|
187
|
+
* Fold in another prompt's blocks. A persona block replaces this prompt's
|
|
188
|
+
* persona; instruction (and any other) blocks append in order. The result's
|
|
189
|
+
* `meta.composedFrom` records the deterministic source labels of both this
|
|
190
|
+
* prompt and the folded one (e.g. `["base@2", "global-instructions@1"]`).
|
|
191
|
+
* Returns a new builder; the original is untouched.
|
|
192
|
+
*/
|
|
193
|
+
merge(source: SystemPromptContract): SystemPromptContract;
|
|
194
|
+
/**
|
|
195
|
+
* Fold in a prompt resolved from the `ai.prompts` registry by name. Uses the
|
|
196
|
+
* latest registered version unless `options.fromVersion` selects another.
|
|
197
|
+
* Throws `InvalidRequestError` when the name (or requested version) is not
|
|
198
|
+
* registered. Provenance is recorded in `meta.composedFrom`.
|
|
199
|
+
*/
|
|
200
|
+
merge(name: string, options?: SystemPromptMergeOptions): SystemPromptContract;
|
|
106
201
|
/**
|
|
107
202
|
* Resolve all placeholders across every block, producing the final system
|
|
108
203
|
* prompt string. Blocks render in insertion order, separated by a blank line.
|
|
@@ -112,7 +207,14 @@ interface SystemPromptContract {
|
|
|
112
207
|
* @param placeholders - Values to inject into `{{mustache}}` slots.
|
|
113
208
|
*/
|
|
114
209
|
resolve(placeholders?: Placeholders): string;
|
|
210
|
+
/**
|
|
211
|
+
* Sugar over `ai.prompts.validate(this, options)`. Runs the deterministic
|
|
212
|
+
* placeholder check (missing required `{{keys}}`) and, when `options.judge`
|
|
213
|
+
* is a model, the Nova-safe LLM-as-judge quality pass. The result's `ok`
|
|
214
|
+
* reflects the deterministic verdict alone; a flaky judge never flips it.
|
|
215
|
+
*/
|
|
216
|
+
validate(options?: PromptsValidateOptions): Promise<PromptValidationResult>;
|
|
115
217
|
}
|
|
116
218
|
//#endregion
|
|
117
|
-
export { InstructionContract, PersonaContract, SystemPromptBlockContract, SystemPromptContract };
|
|
219
|
+
export { InstructionContract, PersonaContract, SystemPromptBlockContract, SystemPromptContract, SystemPromptMergeOptions, SystemPromptMergeSource, SystemPromptMeta };
|
|
118
220
|
//# sourceMappingURL=system-prompt.contract.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.contract.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/system-prompt.contract.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"system-prompt.contract.d.mts","names":[],"sources":["../../../../../../../@warlock.js/ai/src/contracts/system-prompt.contract.ts"],"mappings":";;;;;;AAqBA;;;;;;;;;;AAQqC;AAarC;;UArBiB,yBAAA;EAqBwB;EAAA,SAnB9B,IAAA;EAoCM;EAAA,SAjCN,IAAA;;EAGT,OAAA,CAAQ,YAAA,GAAe,YAAY;AAAA;AAoDrC;;;;;;;;;;AAAA,UAvCiB,eAAA,SAAwB,yBAAyB;EAAA,SACvD,IAAI;AAAA;;;AAgEO;AAQtB;;;;AAEwB;AAuCxB;;;;;UAjGiB,mBAAA,SAA4B,yBAAyB;EAAA,SAC3D,IAAI;AAAA;;;;;;;;;;;;;;;;;;;UAqBE,gBAAA;EAuGf;EAAA,SArGS,IAAA;EAqGJ;EAAA,SAlGI,OAAA;EAyGT;EAAA,SAtGS,WAAA;EAsGD;EAAA,SAnGC,YAAA;EAyGT;EAAA,SAtGS,QAAA;AAAA;;;;;UAOM,wBAAA;EAkHf;;;;EAAA,SA7GS,WAAW;AAAA;;;;;;KAQV,uBAAA,GACR,yBAAA,GACA,oBAAoB;;;;;;;AAgIoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAzF3D,oBAAA;;WAEN,MAAA,WAAiB,yBAAA;;;;;;;;;;;;;;;EAiB1B,IAAA,IAAQ,gBAAA;;;;;;;;EASR,IAAA,CAAK,IAAA,EAAM,gBAAA,GAAmB,oBAAA;;;;;;EAO9B,OAAA,CAAQ,OAAA,EAAS,eAAA,YAA2B,oBAAA;;;;;EAM5C,WAAA,CAAY,WAAA,EAAa,mBAAA,YAA+B,oBAAA;;;;;;;;;EAUxD,KAAA,IAAS,MAAA,WAAiB,yBAAA,KAA8B,oBAAA;;;;;;;;EASxD,KAAA,CAAM,MAAA,EAAQ,oBAAA,GAAuB,oBAAA;;;;;;;EAQrC,KAAA,CACE,IAAA,UACA,OAAA,GAAU,wBAAA,GACT,oBAAA;;;;;;;;;EAUH,OAAA,CAAQ,YAAA,GAAe,YAAA;;;;;;;EAQvB,QAAA,CAAS,OAAA,GAAU,sBAAA,GAAyB,OAAA,CAAQ,sBAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { TeamConfig, TeamGate, TeamGateFn, TeamMemberValue } from "./team-config.type.mjs";
|