@warlock.js/ai 4.8.1 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/cjs/index.cjs +24451 -244
- package/cjs/index.cjs.map +1 -0
- package/cjs/{magic-string.es-BtxW4VqG.cjs → magic-string.es-BoSa5xIt.cjs} +3 -3
- package/cjs/magic-string.es-BoSa5xIt.cjs.map +1 -0
- package/cjs/{matcher-logic-SBnzYohQ.cjs → matcher-logic-07fFOz7r.cjs} +3 -3
- package/cjs/matcher-logic-07fFOz7r.cjs.map +1 -0
- package/cjs/{matchers-BBh3gyB-.cjs → matchers-DnV47KR_.cjs} +24 -24
- package/cjs/matchers-DnV47KR_.cjs.map +1 -0
- package/esm/agent/agent-config.type.d.mts +1 -1
- package/esm/agent/agent-config.type.d.mts.map +1 -1
- package/esm/agent/agent-input-builder.mjs +1 -1
- package/esm/agent/agent-input-builder.mjs.map +1 -1
- package/esm/agent/agent-log-event.mjs +1 -1
- package/esm/agent/agent-log-event.mjs.map +1 -1
- package/esm/agent/agent-stream.d.mts +1 -1
- package/esm/agent/agent-stream.d.mts.map +1 -1
- package/esm/agent/agent-stream.mjs +1 -1
- package/esm/agent/agent-stream.mjs.map +1 -1
- package/esm/agent/agent-to-stream-event.mjs +1 -1
- package/esm/agent/agent-to-stream-event.mjs.map +1 -1
- package/esm/agent/agent.d.mts +1 -1
- package/esm/agent/agent.d.mts.map +1 -1
- package/esm/agent/agent.mjs +1 -1
- package/esm/agent/agent.mjs.map +1 -1
- package/esm/agent/json-stream-guard.mjs +1 -1
- package/esm/agent/json-stream-guard.mjs.map +1 -1
- package/esm/agent/judge-config.type.d.mts +1 -1
- package/esm/agent/judge-config.type.d.mts.map +1 -1
- package/esm/agent/judge-config.type.mjs +1 -1
- package/esm/agent/judge-config.type.mjs.map +1 -1
- package/esm/agent/signature.mjs +1 -1
- package/esm/agent/signature.mjs.map +1 -1
- package/esm/agent/snapshot.mjs +1 -1
- package/esm/agent/snapshot.mjs.map +1 -1
- package/esm/agent/spawn-sub-agent.d.mts +1 -1
- package/esm/agent/spawn-sub-agent.d.mts.map +1 -1
- package/esm/agent/spawn-sub-agent.mjs +1 -1
- package/esm/agent/spawn-sub-agent.mjs.map +1 -1
- package/esm/ai.d.mts +1 -1
- package/esm/ai.d.mts.map +1 -1
- package/esm/ai.mjs +1 -1
- package/esm/ai.mjs.map +1 -1
- package/esm/batch/batch.d.mts +1 -1
- package/esm/batch/batch.d.mts.map +1 -1
- package/esm/batch/batch.mjs +1 -1
- package/esm/batch/batch.mjs.map +1 -1
- package/esm/batch/batch.type.d.mts +1 -1
- package/esm/batch/batch.type.d.mts.map +1 -1
- package/esm/batch/run-batch-item.mjs +1 -1
- package/esm/batch/run-batch-item.mjs.map +1 -1
- package/esm/batch/run-with-concurrency.mjs +1 -1
- package/esm/batch/run-with-concurrency.mjs.map +1 -1
- package/esm/checkpoint/memory.d.mts +1 -1
- package/esm/checkpoint/memory.d.mts.map +1 -1
- package/esm/checkpoint/memory.mjs +0 -0
- package/esm/checkpoint/memory.mjs.map +1 -1
- package/esm/checkpoint/pg.d.mts +1 -1
- package/esm/checkpoint/pg.d.mts.map +1 -1
- package/esm/checkpoint/pg.mjs +1 -1
- package/esm/checkpoint/pg.mjs.map +1 -1
- package/esm/checkpoint/redis.d.mts +1 -1
- package/esm/checkpoint/redis.d.mts.map +1 -1
- package/esm/checkpoint/redis.mjs +1 -1
- package/esm/checkpoint/redis.mjs.map +1 -1
- package/esm/config.d.mts +1 -1
- package/esm/config.d.mts.map +1 -1
- package/esm/config.mjs +1 -1
- package/esm/config.mjs.map +1 -1
- package/esm/contracts/agent/agent-options.type.d.mts +1 -1
- package/esm/contracts/agent/agent-options.type.d.mts.map +1 -1
- package/esm/contracts/agent/agent-snapshot.type.d.mts +1 -1
- package/esm/contracts/agent/agent-snapshot.type.d.mts.map +1 -1
- package/esm/contracts/agent/agent.contract.d.mts +1 -1
- package/esm/contracts/agent/agent.contract.d.mts.map +1 -1
- package/esm/contracts/agent/eval.type.d.mts +1 -1
- package/esm/contracts/agent/eval.type.d.mts.map +1 -1
- package/esm/contracts/attachment-policy.type.d.mts +1 -1
- package/esm/contracts/attachment-policy.type.d.mts.map +1 -1
- package/esm/contracts/attachment.type.d.mts +1 -1
- package/esm/contracts/attachment.type.d.mts.map +1 -1
- package/esm/contracts/content-part.type.d.mts +1 -1
- package/esm/contracts/content-part.type.d.mts.map +1 -1
- package/esm/contracts/conversation-message.type.d.mts +1 -1
- package/esm/contracts/conversation-message.type.d.mts.map +1 -1
- package/esm/contracts/embedder.contract.d.mts +1 -1
- package/esm/contracts/embedder.contract.d.mts.map +1 -1
- package/esm/contracts/end.type.d.mts +1 -1
- package/esm/contracts/end.type.d.mts.map +1 -1
- package/esm/contracts/end.type.mjs +1 -1
- package/esm/contracts/end.type.mjs.map +1 -1
- package/esm/contracts/events/agent-events.type.d.mts +1 -1
- package/esm/contracts/events/agent-events.type.d.mts.map +1 -1
- package/esm/contracts/events/complete-event.type.d.mts +1 -1
- package/esm/contracts/events/complete-event.type.d.mts.map +1 -1
- package/esm/contracts/events/event-identity.type.d.mts +1 -1
- package/esm/contracts/events/event-identity.type.d.mts.map +1 -1
- package/esm/contracts/events/event-map.type.d.mts +1 -1
- package/esm/contracts/events/event-map.type.d.mts.map +1 -1
- package/esm/contracts/events/supervisor-events.type.d.mts +1 -1
- package/esm/contracts/events/supervisor-events.type.d.mts.map +1 -1
- package/esm/contracts/events/usage-event.type.d.mts +1 -1
- package/esm/contracts/events/usage-event.type.d.mts.map +1 -1
- package/esm/contracts/events/workflow-events.type.d.mts +1 -1
- package/esm/contracts/events/workflow-events.type.d.mts.map +1 -1
- package/esm/contracts/executable.contract.d.mts +1 -1
- package/esm/contracts/executable.contract.d.mts.map +1 -1
- package/esm/contracts/fallback-model.contract.d.mts +1 -1
- package/esm/contracts/fallback-model.contract.d.mts.map +1 -1
- package/esm/contracts/finish-reason.type.d.mts +1 -1
- package/esm/contracts/finish-reason.type.d.mts.map +1 -1
- package/esm/contracts/image-model.contract.d.mts +1 -1
- package/esm/contracts/image-model.contract.d.mts.map +1 -1
- package/esm/contracts/memory/memory-config.type.d.mts +1 -1
- package/esm/contracts/memory/memory-config.type.d.mts.map +1 -1
- package/esm/contracts/memory/memory-item.type.d.mts +1 -1
- package/esm/contracts/memory/memory-item.type.d.mts.map +1 -1
- package/esm/contracts/memory/memory.contract.d.mts +1 -1
- package/esm/contracts/memory/memory.contract.d.mts.map +1 -1
- package/esm/contracts/memory/recall-options.type.d.mts +1 -1
- package/esm/contracts/memory/recall-options.type.d.mts.map +1 -1
- package/esm/contracts/middleware/middleware-context.type.d.mts +1 -1
- package/esm/contracts/middleware/middleware-context.type.d.mts.map +1 -1
- package/esm/contracts/middleware/middleware-state.type.d.mts +1 -1
- package/esm/contracts/middleware/middleware-state.type.d.mts.map +1 -1
- package/esm/contracts/middleware/middleware.contract.d.mts +1 -1
- package/esm/contracts/middleware/middleware.contract.d.mts.map +1 -1
- package/esm/contracts/model-tool-call-request.type.d.mts +1 -1
- package/esm/contracts/model-tool-call-request.type.d.mts.map +1 -1
- package/esm/contracts/model.contract.d.mts +9 -1
- package/esm/contracts/model.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts +1 -1
- package/esm/contracts/orchestrator/checkpoint-store.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts +1 -1
- package/esm/contracts/orchestrator/orchestrator-commands.type.d.mts.map +1 -1
- package/esm/contracts/orchestrator/orchestrator-config.type.d.mts +1 -1
- package/esm/contracts/orchestrator/orchestrator-config.type.d.mts.map +1 -1
- package/esm/contracts/orchestrator/orchestrator-event.type.d.mts +1 -1
- package/esm/contracts/orchestrator/orchestrator-event.type.d.mts.map +1 -1
- package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts +1 -1
- package/esm/contracts/orchestrator/orchestrator-execute-options.type.d.mts.map +1 -1
- package/esm/contracts/orchestrator/orchestrator.contract.d.mts +1 -1
- package/esm/contracts/orchestrator/orchestrator.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/session-lock.contract.d.mts +1 -1
- package/esm/contracts/orchestrator/session-lock.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/session.contract.d.mts +1 -1
- package/esm/contracts/orchestrator/session.contract.d.mts.map +1 -1
- package/esm/contracts/orchestrator/snapshot-store.contract.d.mts +1 -1
- package/esm/contracts/orchestrator/snapshot-store.contract.d.mts.map +1 -1
- package/esm/contracts/placeholders.type.d.mts +1 -1
- package/esm/contracts/placeholders.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-capability.type.d.mts +1 -1
- package/esm/contracts/planner/planner-capability.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-config.type.d.mts +1 -1
- package/esm/contracts/planner/planner-config.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-execute-options.type.d.mts +1 -1
- package/esm/contracts/planner/planner-execute-options.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-plan.type.d.mts +1 -1
- package/esm/contracts/planner/planner-plan.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-result.type.d.mts +1 -1
- package/esm/contracts/planner/planner-result.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner-snapshot.type.d.mts +1 -1
- package/esm/contracts/planner/planner-snapshot.type.d.mts.map +1 -1
- package/esm/contracts/planner/planner.contract.d.mts +1 -1
- package/esm/contracts/planner/planner.contract.d.mts.map +1 -1
- package/esm/contracts/result/agent-result.type.d.mts +1 -1
- package/esm/contracts/result/agent-result.type.d.mts.map +1 -1
- package/esm/contracts/result/attempt-entry.type.d.mts +1 -1
- package/esm/contracts/result/attempt-entry.type.d.mts.map +1 -1
- package/esm/contracts/result/base-report.type.d.mts +1 -1
- package/esm/contracts/result/base-report.type.d.mts.map +1 -1
- package/esm/contracts/result/base-report.type.mjs +1 -1
- package/esm/contracts/result/base-report.type.mjs.map +1 -1
- package/esm/contracts/result/base-result.type.d.mts +1 -1
- package/esm/contracts/result/base-result.type.d.mts.map +1 -1
- package/esm/contracts/result/execute-result.type.d.mts +1 -1
- package/esm/contracts/result/execute-result.type.d.mts.map +1 -1
- package/esm/contracts/result/execution-report.type.d.mts +1 -1
- package/esm/contracts/result/execution-report.type.d.mts.map +1 -1
- package/esm/contracts/result/llm-trip.type.d.mts +1 -1
- package/esm/contracts/result/llm-trip.type.d.mts.map +1 -1
- package/esm/contracts/result/model-pricing.type.d.mts +1 -1
- package/esm/contracts/result/model-pricing.type.d.mts.map +1 -1
- package/esm/contracts/result/orchestrator-result.type.d.mts +1 -1
- package/esm/contracts/result/orchestrator-result.type.d.mts.map +1 -1
- package/esm/contracts/result/session-send-result.type.d.mts +1 -1
- package/esm/contracts/result/session-send-result.type.d.mts.map +1 -1
- package/esm/contracts/result/step-result.type.d.mts +12 -2
- package/esm/contracts/result/step-result.type.d.mts.map +1 -1
- package/esm/contracts/result/supervisor-result.type.d.mts +1 -1
- package/esm/contracts/result/supervisor-result.type.d.mts.map +1 -1
- package/esm/contracts/result/tool-call.type.d.mts +1 -1
- package/esm/contracts/result/tool-call.type.d.mts.map +1 -1
- package/esm/contracts/result/usage.type.d.mts +1 -1
- package/esm/contracts/result/usage.type.d.mts.map +1 -1
- package/esm/contracts/result/workflow-result.type.d.mts +1 -1
- package/esm/contracts/result/workflow-result.type.d.mts.map +1 -1
- package/esm/contracts/sdk-adapter.contract.d.mts +1 -1
- package/esm/contracts/sdk-adapter.contract.d.mts.map +1 -1
- package/esm/contracts/speech-model.contract.d.mts +1 -1
- package/esm/contracts/speech-model.contract.d.mts.map +1 -1
- package/esm/contracts/stream/stream-event.type.d.mts +1 -1
- package/esm/contracts/stream/stream-event.type.d.mts.map +1 -1
- package/esm/contracts/stream/stream.contract.d.mts +1 -1
- package/esm/contracts/stream/stream.contract.d.mts.map +1 -1
- package/esm/contracts/streaming-tool-guard-config.type.d.mts +1 -1
- package/esm/contracts/streaming-tool-guard-config.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/ack-entry.type.d.mts +1 -1
- package/esm/contracts/supervisor/ack-entry.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/classifier-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/classifier-context.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/dispatch-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/dispatch-context.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/evaluate-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/evaluate-context.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/intent-entry.type.d.mts +1 -1
- package/esm/contracts/supervisor/intent-entry.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/iteration-snapshot.type.d.mts +1 -1
- package/esm/contracts/supervisor/iteration-snapshot.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/next.type.d.mts +1 -1
- package/esm/contracts/supervisor/next.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/route-context.type.d.mts +1 -1
- package/esm/contracts/supervisor/route-context.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/router-entry.type.d.mts +1 -1
- package/esm/contracts/supervisor/router-entry.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-config.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-config.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-execute-options.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-input.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-input.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-snapshot.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor-stream-event.type.d.mts.map +1 -1
- package/esm/contracts/supervisor/supervisor.contract.d.mts +1 -1
- package/esm/contracts/supervisor/supervisor.contract.d.mts.map +1 -1
- package/esm/contracts/system-prompt.contract.d.mts +1 -1
- package/esm/contracts/system-prompt.contract.d.mts.map +1 -1
- package/esm/contracts/team/team-config.type.d.mts +1 -1
- package/esm/contracts/team/team-config.type.d.mts.map +1 -1
- package/esm/contracts/tool.contract.d.mts +1 -1
- package/esm/contracts/tool.contract.d.mts.map +1 -1
- package/esm/contracts/transcription-model.contract.d.mts +1 -1
- package/esm/contracts/transcription-model.contract.d.mts.map +1 -1
- package/esm/contracts/workflow/next-step-result.type.d.mts +1 -1
- package/esm/contracts/workflow/next-step-result.type.d.mts.map +1 -1
- package/esm/contracts/workflow/retry-config.type.d.mts +1 -1
- package/esm/contracts/workflow/retry-config.type.d.mts.map +1 -1
- package/esm/contracts/workflow/step.contract.d.mts +1 -1
- package/esm/contracts/workflow/step.contract.d.mts.map +1 -1
- package/esm/contracts/workflow/workflow-context.type.d.mts +1 -1
- package/esm/contracts/workflow/workflow-context.type.d.mts.map +1 -1
- package/esm/contracts/workflow/workflow-snapshot.type.d.mts +1 -1
- package/esm/contracts/workflow/workflow-snapshot.type.d.mts.map +1 -1
- package/esm/contracts/workflow/workflow.contract.d.mts +1 -1
- package/esm/contracts/workflow/workflow.contract.d.mts.map +1 -1
- package/esm/errors/agent-cancelled-error.d.mts +1 -1
- package/esm/errors/agent-cancelled-error.d.mts.map +1 -1
- package/esm/errors/agent-cancelled-error.mjs +1 -1
- package/esm/errors/agent-cancelled-error.mjs.map +1 -1
- package/esm/errors/agent-drift-error.d.mts +1 -1
- package/esm/errors/agent-drift-error.d.mts.map +1 -1
- package/esm/errors/agent-drift-error.mjs +1 -1
- package/esm/errors/agent-drift-error.mjs.map +1 -1
- package/esm/errors/agent-execution-error.d.mts +1 -1
- package/esm/errors/agent-execution-error.d.mts.map +1 -1
- package/esm/errors/agent-execution-error.mjs +1 -1
- package/esm/errors/agent-execution-error.mjs.map +1 -1
- package/esm/errors/agent-max-trips-error.d.mts +1 -1
- package/esm/errors/agent-max-trips-error.d.mts.map +1 -1
- package/esm/errors/agent-max-trips-error.mjs +1 -1
- package/esm/errors/agent-max-trips-error.mjs.map +1 -1
- package/esm/errors/ai-error.d.mts +1 -1
- package/esm/errors/ai-error.d.mts.map +1 -1
- package/esm/errors/ai-error.mjs +1 -1
- package/esm/errors/ai-error.mjs.map +1 -1
- package/esm/errors/budget-exceeded-error.d.mts +1 -1
- package/esm/errors/budget-exceeded-error.d.mts.map +1 -1
- package/esm/errors/budget-exceeded-error.mjs +1 -1
- package/esm/errors/budget-exceeded-error.mjs.map +1 -1
- package/esm/errors/content-filter-error.d.mts +1 -1
- package/esm/errors/content-filter-error.d.mts.map +1 -1
- package/esm/errors/content-filter-error.mjs +1 -1
- package/esm/errors/content-filter-error.mjs.map +1 -1
- package/esm/errors/context-length-exceeded-error.d.mts +1 -1
- package/esm/errors/context-length-exceeded-error.d.mts.map +1 -1
- package/esm/errors/context-length-exceeded-error.mjs +1 -1
- package/esm/errors/context-length-exceeded-error.mjs.map +1 -1
- package/esm/errors/error-category.type.d.mts +1 -1
- package/esm/errors/error-category.type.d.mts.map +1 -1
- package/esm/errors/error-code.type.d.mts +1 -1
- package/esm/errors/error-code.type.d.mts.map +1 -1
- package/esm/errors/guardrail-violation-error.d.mts +1 -1
- package/esm/errors/guardrail-violation-error.d.mts.map +1 -1
- package/esm/errors/guardrail-violation-error.mjs +1 -1
- package/esm/errors/guardrail-violation-error.mjs.map +1 -1
- package/esm/errors/invalid-request-error.d.mts +1 -1
- package/esm/errors/invalid-request-error.d.mts.map +1 -1
- package/esm/errors/invalid-request-error.mjs +1 -1
- package/esm/errors/invalid-request-error.mjs.map +1 -1
- package/esm/errors/max-iterations-error.d.mts +1 -1
- package/esm/errors/max-iterations-error.d.mts.map +1 -1
- package/esm/errors/max-iterations-error.mjs +1 -1
- package/esm/errors/max-iterations-error.mjs.map +1 -1
- package/esm/errors/max-steps-exceeded-error.d.mts +1 -1
- package/esm/errors/max-steps-exceeded-error.d.mts.map +1 -1
- package/esm/errors/max-steps-exceeded-error.mjs +1 -1
- package/esm/errors/max-steps-exceeded-error.mjs.map +1 -1
- package/esm/errors/orchestrator-cancelled-error.d.mts +1 -1
- package/esm/errors/orchestrator-cancelled-error.d.mts.map +1 -1
- package/esm/errors/orchestrator-cancelled-error.mjs +1 -1
- package/esm/errors/orchestrator-cancelled-error.mjs.map +1 -1
- package/esm/errors/orchestrator-config-error.d.mts +1 -1
- package/esm/errors/orchestrator-config-error.d.mts.map +1 -1
- package/esm/errors/orchestrator-config-error.mjs +1 -1
- package/esm/errors/orchestrator-config-error.mjs.map +1 -1
- package/esm/errors/orchestrator-drift-error.d.mts +1 -1
- package/esm/errors/orchestrator-drift-error.d.mts.map +1 -1
- package/esm/errors/orchestrator-drift-error.mjs +1 -1
- package/esm/errors/orchestrator-drift-error.mjs.map +1 -1
- package/esm/errors/orchestrator-failed-error.d.mts +1 -1
- package/esm/errors/orchestrator-failed-error.d.mts.map +1 -1
- package/esm/errors/orchestrator-failed-error.mjs +1 -1
- package/esm/errors/orchestrator-failed-error.mjs.map +1 -1
- package/esm/errors/outbound-policy-error.d.mts +1 -1
- package/esm/errors/outbound-policy-error.d.mts.map +1 -1
- package/esm/errors/outbound-policy-error.mjs +1 -1
- package/esm/errors/outbound-policy-error.mjs.map +1 -1
- package/esm/errors/planner-cancelled-error.d.mts +1 -1
- package/esm/errors/planner-cancelled-error.d.mts.map +1 -1
- package/esm/errors/planner-cancelled-error.mjs +1 -1
- package/esm/errors/planner-cancelled-error.mjs.map +1 -1
- package/esm/errors/planner-drift-error.d.mts +1 -1
- package/esm/errors/planner-drift-error.d.mts.map +1 -1
- package/esm/errors/planner-drift-error.mjs +1 -1
- package/esm/errors/planner-drift-error.mjs.map +1 -1
- package/esm/errors/planner-failed-error.d.mts +1 -1
- package/esm/errors/planner-failed-error.d.mts.map +1 -1
- package/esm/errors/planner-failed-error.mjs +1 -1
- package/esm/errors/planner-failed-error.mjs.map +1 -1
- package/esm/errors/planner-plan-invalid-error.d.mts +1 -1
- package/esm/errors/planner-plan-invalid-error.d.mts.map +1 -1
- package/esm/errors/planner-plan-invalid-error.mjs +1 -1
- package/esm/errors/planner-plan-invalid-error.mjs.map +1 -1
- package/esm/errors/prompt-refinement-error.d.mts +1 -1
- package/esm/errors/prompt-refinement-error.d.mts.map +1 -1
- package/esm/errors/prompt-refinement-error.mjs +1 -1
- package/esm/errors/prompt-refinement-error.mjs.map +1 -1
- package/esm/errors/provider-auth-error.d.mts +1 -1
- package/esm/errors/provider-auth-error.d.mts.map +1 -1
- package/esm/errors/provider-auth-error.mjs +1 -1
- package/esm/errors/provider-auth-error.mjs.map +1 -1
- package/esm/errors/provider-error.d.mts +1 -1
- package/esm/errors/provider-error.d.mts.map +1 -1
- package/esm/errors/provider-error.mjs +1 -1
- package/esm/errors/provider-error.mjs.map +1 -1
- package/esm/errors/provider-rate-limit-error.d.mts +1 -1
- package/esm/errors/provider-rate-limit-error.d.mts.map +1 -1
- package/esm/errors/provider-rate-limit-error.mjs +1 -1
- package/esm/errors/provider-rate-limit-error.mjs.map +1 -1
- package/esm/errors/provider-timeout-error.d.mts +1 -1
- package/esm/errors/provider-timeout-error.d.mts.map +1 -1
- package/esm/errors/provider-timeout-error.mjs +1 -1
- package/esm/errors/provider-timeout-error.mjs.map +1 -1
- package/esm/errors/quota-exceeded-error.d.mts +1 -1
- package/esm/errors/quota-exceeded-error.d.mts.map +1 -1
- package/esm/errors/quota-exceeded-error.mjs +1 -1
- package/esm/errors/quota-exceeded-error.mjs.map +1 -1
- package/esm/errors/routing-error.d.mts +1 -1
- package/esm/errors/routing-error.d.mts.map +1 -1
- package/esm/errors/routing-error.mjs +1 -1
- package/esm/errors/routing-error.mjs.map +1 -1
- package/esm/errors/schema-validation-error.d.mts +1 -1
- package/esm/errors/schema-validation-error.d.mts.map +1 -1
- package/esm/errors/schema-validation-error.mjs +1 -1
- package/esm/errors/schema-validation-error.mjs.map +1 -1
- package/esm/errors/step-failed-error.d.mts +1 -1
- package/esm/errors/step-failed-error.d.mts.map +1 -1
- package/esm/errors/step-failed-error.mjs +1 -1
- package/esm/errors/step-failed-error.mjs.map +1 -1
- package/esm/errors/supervisor-cancelled-error.d.mts +1 -1
- package/esm/errors/supervisor-cancelled-error.d.mts.map +1 -1
- package/esm/errors/supervisor-cancelled-error.mjs +1 -1
- package/esm/errors/supervisor-cancelled-error.mjs.map +1 -1
- package/esm/errors/supervisor-drift-error.d.mts +1 -1
- package/esm/errors/supervisor-drift-error.d.mts.map +1 -1
- package/esm/errors/supervisor-drift-error.mjs +1 -1
- package/esm/errors/supervisor-drift-error.mjs.map +1 -1
- package/esm/errors/supervisor-failed-error.d.mts +1 -1
- package/esm/errors/supervisor-failed-error.d.mts.map +1 -1
- package/esm/errors/supervisor-failed-error.mjs +1 -1
- package/esm/errors/supervisor-failed-error.mjs.map +1 -1
- package/esm/errors/supervisor-routing-error.d.mts +1 -1
- package/esm/errors/supervisor-routing-error.d.mts.map +1 -1
- package/esm/errors/supervisor-routing-error.mjs +1 -1
- package/esm/errors/supervisor-routing-error.mjs.map +1 -1
- package/esm/errors/tool-execution-error.d.mts +1 -1
- package/esm/errors/tool-execution-error.d.mts.map +1 -1
- package/esm/errors/tool-execution-error.mjs +1 -1
- package/esm/errors/tool-execution-error.mjs.map +1 -1
- package/esm/errors/workflow-cancelled-error.d.mts +1 -1
- package/esm/errors/workflow-cancelled-error.d.mts.map +1 -1
- package/esm/errors/workflow-cancelled-error.mjs +1 -1
- package/esm/errors/workflow-cancelled-error.mjs.map +1 -1
- package/esm/errors/workflow-drift-error.d.mts +1 -1
- package/esm/errors/workflow-drift-error.d.mts.map +1 -1
- package/esm/errors/workflow-drift-error.mjs +1 -1
- package/esm/errors/workflow-drift-error.mjs.map +1 -1
- package/esm/errors/workflow-error.d.mts +1 -1
- package/esm/errors/workflow-error.d.mts.map +1 -1
- package/esm/errors/workflow-error.mjs +1 -1
- package/esm/errors/workflow-error.mjs.map +1 -1
- package/esm/eval/dataset.d.mts +1 -1
- package/esm/eval/dataset.d.mts.map +1 -1
- package/esm/eval/dataset.mjs +1 -1
- package/esm/eval/dataset.mjs.map +1 -1
- package/esm/eval/dataset.type.d.mts +1 -1
- package/esm/eval/dataset.type.d.mts.map +1 -1
- package/esm/eval/eval-runner.d.mts +1 -1
- package/esm/eval/eval-runner.d.mts.map +1 -1
- package/esm/eval/eval-runner.mjs +1 -1
- package/esm/eval/eval-runner.mjs.map +1 -1
- package/esm/eval/index.d.mts +1 -1
- package/esm/eval/index.d.mts.map +1 -1
- package/esm/eval/index.mjs +1 -1
- package/esm/eval/index.mjs.map +1 -1
- package/esm/eval/judge-scorer.d.mts +1 -1
- package/esm/eval/judge-scorer.d.mts.map +1 -1
- package/esm/eval/judge-scorer.mjs +1 -1
- package/esm/eval/judge-scorer.mjs.map +1 -1
- package/esm/eval/regression.d.mts +1 -1
- package/esm/eval/regression.d.mts.map +1 -1
- package/esm/eval/regression.mjs +1 -1
- package/esm/eval/regression.mjs.map +1 -1
- package/esm/eval/report-json.d.mts +1 -1
- package/esm/eval/report-json.d.mts.map +1 -1
- package/esm/eval/report-json.mjs +1 -1
- package/esm/eval/report-json.mjs.map +1 -1
- package/esm/eval/report-junit.d.mts +1 -1
- package/esm/eval/report-junit.d.mts.map +1 -1
- package/esm/eval/report-junit.mjs +1 -1
- package/esm/eval/report-junit.mjs.map +1 -1
- package/esm/eval/scorers.d.mts +1 -1
- package/esm/eval/scorers.d.mts.map +1 -1
- package/esm/eval/scorers.mjs +1 -1
- package/esm/eval/scorers.mjs.map +1 -1
- package/esm/guard/contracts/guard-options.type.d.mts +1 -1
- package/esm/guard/contracts/guard-options.type.d.mts.map +1 -1
- package/esm/guard/contracts/guardrail.contract.d.mts +1 -1
- package/esm/guard/contracts/guardrail.contract.d.mts.map +1 -1
- package/esm/guard/contracts/openai-client.contract.d.mts +1 -1
- package/esm/guard/contracts/openai-client.contract.d.mts.map +1 -1
- package/esm/guard/contracts/verdict.type.d.mts +1 -1
- package/esm/guard/contracts/verdict.type.d.mts.map +1 -1
- package/esm/guard/detectors/injection.d.mts +1 -1
- package/esm/guard/detectors/injection.d.mts.map +1 -1
- package/esm/guard/detectors/injection.mjs +1 -1
- package/esm/guard/detectors/injection.mjs.map +1 -1
- package/esm/guard/detectors/moderation.d.mts +1 -1
- package/esm/guard/detectors/moderation.d.mts.map +1 -1
- package/esm/guard/detectors/moderation.mjs +1 -1
- package/esm/guard/detectors/moderation.mjs.map +1 -1
- package/esm/guard/detectors/pii.d.mts +1 -1
- package/esm/guard/detectors/pii.d.mts.map +1 -1
- package/esm/guard/detectors/pii.mjs +1 -1
- package/esm/guard/detectors/pii.mjs.map +1 -1
- package/esm/guard/detectors/topic.d.mts +1 -1
- package/esm/guard/detectors/topic.d.mts.map +1 -1
- package/esm/guard/detectors/topic.mjs +1 -1
- package/esm/guard/detectors/topic.mjs.map +1 -1
- package/esm/guard/errors.d.mts +1 -1
- package/esm/guard/errors.d.mts.map +1 -1
- package/esm/guard/errors.mjs +1 -1
- package/esm/guard/errors.mjs.map +1 -1
- package/esm/guard/guard.d.mts +1 -1
- package/esm/guard/guard.d.mts.map +1 -1
- package/esm/guard/guard.mjs +1 -1
- package/esm/guard/guard.mjs.map +1 -1
- package/esm/guard/guardrail.d.mts +1 -1
- package/esm/guard/guardrail.d.mts.map +1 -1
- package/esm/guard/guardrail.mjs +1 -1
- package/esm/guard/guardrail.mjs.map +1 -1
- package/esm/human/contracts/approval.type.d.mts +1 -1
- package/esm/human/contracts/approval.type.d.mts.map +1 -1
- package/esm/human/contracts/human-approval.type.d.mts +1 -1
- package/esm/human/contracts/human-approval.type.d.mts.map +1 -1
- package/esm/human/contracts/interrupt-store.contract.d.mts +1 -1
- package/esm/human/contracts/interrupt-store.contract.d.mts.map +1 -1
- package/esm/human/contracts/resume.type.d.mts +1 -1
- package/esm/human/contracts/resume.type.d.mts.map +1 -1
- package/esm/human/errors.d.mts +1 -1
- package/esm/human/errors.d.mts.map +1 -1
- package/esm/human/errors.mjs +1 -1
- package/esm/human/errors.mjs.map +1 -1
- package/esm/human/human-approval.d.mts +1 -1
- package/esm/human/human-approval.d.mts.map +1 -1
- package/esm/human/human-approval.mjs +1 -1
- package/esm/human/human-approval.mjs.map +1 -1
- package/esm/human/policy.d.mts +1 -1
- package/esm/human/policy.d.mts.map +1 -1
- package/esm/human/policy.mjs +1 -1
- package/esm/human/policy.mjs.map +1 -1
- package/esm/human/register.mjs +1 -1
- package/esm/human/register.mjs.map +1 -1
- package/esm/human/resume-seed.mjs +1 -1
- package/esm/human/resume-seed.mjs.map +1 -1
- package/esm/human/resume.d.mts +1 -1
- package/esm/human/resume.d.mts.map +1 -1
- package/esm/human/resume.mjs +1 -1
- package/esm/human/resume.mjs.map +1 -1
- package/esm/human/stores/memory.d.mts +1 -1
- package/esm/human/stores/memory.d.mts.map +1 -1
- package/esm/human/stores/memory.mjs +1 -1
- package/esm/human/stores/memory.mjs.map +1 -1
- package/esm/human/stores/pg.d.mts +1 -1
- package/esm/human/stores/pg.d.mts.map +1 -1
- package/esm/human/stores/pg.mjs +1 -1
- package/esm/human/stores/pg.mjs.map +1 -1
- package/esm/human/stores/redis.d.mts +1 -1
- package/esm/human/stores/redis.d.mts.map +1 -1
- package/esm/human/stores/redis.mjs +1 -1
- package/esm/human/stores/redis.mjs.map +1 -1
- package/esm/image/image-cost.d.mts +1 -1
- package/esm/image/image-cost.d.mts.map +1 -1
- package/esm/image/image-cost.mjs +1 -1
- package/esm/image/image-cost.mjs.map +1 -1
- package/esm/image/image.d.mts +1 -1
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/index.d.mts +2 -1
- package/esm/index.mjs +2 -1
- package/esm/memory/derive-id.mjs +1 -1
- package/esm/memory/derive-id.mjs.map +1 -1
- package/esm/memory/episodic-memory.mjs +1 -1
- package/esm/memory/episodic-memory.mjs.map +1 -1
- package/esm/memory/memory.d.mts +1 -1
- package/esm/memory/memory.d.mts.map +1 -1
- package/esm/memory/memory.mjs +1 -1
- package/esm/memory/memory.mjs.map +1 -1
- package/esm/memory/procedural-memory.mjs +1 -1
- package/esm/memory/procedural-memory.mjs.map +1 -1
- package/esm/memory/semantic-memory.mjs +1 -1
- package/esm/memory/semantic-memory.mjs.map +1 -1
- package/esm/memory/working-memory.mjs +1 -1
- package/esm/memory/working-memory.mjs.map +1 -1
- package/esm/middleware/builtins/budget-contract.type.d.mts +1 -1
- package/esm/middleware/builtins/budget-contract.type.d.mts.map +1 -1
- package/esm/middleware/builtins/budget.d.mts +1 -1
- package/esm/middleware/builtins/budget.d.mts.map +1 -1
- package/esm/middleware/builtins/budget.mjs +1 -1
- package/esm/middleware/builtins/budget.mjs.map +1 -1
- package/esm/middleware/builtins/guardrail.d.mts +1 -1
- package/esm/middleware/builtins/guardrail.d.mts.map +1 -1
- package/esm/middleware/builtins/guardrail.mjs +1 -1
- package/esm/middleware/builtins/guardrail.mjs.map +1 -1
- package/esm/middleware/builtins/semantic-cache.d.mts +1 -1
- package/esm/middleware/builtins/semantic-cache.d.mts.map +1 -1
- package/esm/middleware/builtins/semantic-cache.mjs +1 -1
- package/esm/middleware/builtins/semantic-cache.mjs.map +1 -1
- package/esm/middleware/helpers/compose.d.mts +1 -1
- package/esm/middleware/helpers/compose.d.mts.map +1 -1
- package/esm/middleware/helpers/compose.mjs +1 -1
- package/esm/middleware/helpers/compose.mjs.map +1 -1
- package/esm/middleware/helpers/for-tool.d.mts +1 -1
- package/esm/middleware/helpers/for-tool.d.mts.map +1 -1
- package/esm/middleware/helpers/for-tool.mjs +1 -1
- package/esm/middleware/helpers/for-tool.mjs.map +1 -1
- package/esm/middleware/pipeline.d.mts +1 -1
- package/esm/middleware/pipeline.d.mts.map +1 -1
- package/esm/middleware/pipeline.mjs +1 -1
- package/esm/middleware/pipeline.mjs.map +1 -1
- package/esm/middleware/utils/extract-user-text.d.mts +1 -1
- package/esm/middleware/utils/extract-user-text.d.mts.map +1 -1
- package/esm/middleware/utils/extract-user-text.mjs +1 -1
- package/esm/middleware/utils/extract-user-text.mjs.map +1 -1
- package/esm/middleware/utils/namespaced-state.d.mts +1 -1
- package/esm/middleware/utils/namespaced-state.d.mts.map +1 -1
- package/esm/middleware/utils/namespaced-state.mjs +1 -1
- package/esm/middleware/utils/namespaced-state.mjs.map +1 -1
- package/esm/mock/mock-agent.d.mts +1 -1
- package/esm/mock/mock-agent.d.mts.map +1 -1
- package/esm/mock/mock-agent.mjs +1 -1
- package/esm/mock/mock-agent.mjs.map +1 -1
- package/esm/mock/mock-config.type.d.mts +1 -1
- package/esm/mock/mock-config.type.d.mts.map +1 -1
- package/esm/mock/mock-image-model.d.mts +1 -1
- package/esm/mock/mock-image-model.d.mts.map +1 -1
- package/esm/mock/mock-image-model.mjs +1 -1
- package/esm/mock/mock-image-model.mjs.map +1 -1
- package/esm/mock/mock-model.d.mts +1 -1
- package/esm/mock/mock-model.d.mts.map +1 -1
- package/esm/mock/mock-model.mjs +1 -1
- package/esm/mock/mock-model.mjs.map +1 -1
- package/esm/mock/mock-router.d.mts +1 -1
- package/esm/mock/mock-router.d.mts.map +1 -1
- package/esm/mock/mock-router.mjs +1 -1
- package/esm/mock/mock-router.mjs.map +1 -1
- package/esm/mock/mock-sdk.d.mts +1 -1
- package/esm/mock/mock-sdk.d.mts.map +1 -1
- package/esm/mock/mock-sdk.mjs +1 -1
- package/esm/mock/mock-sdk.mjs.map +1 -1
- package/esm/mock/mock-speech-model.d.mts +1 -1
- package/esm/mock/mock-speech-model.d.mts.map +1 -1
- package/esm/mock/mock-speech-model.mjs +1 -1
- package/esm/mock/mock-speech-model.mjs.map +1 -1
- package/esm/mock/mock-transcription-model.d.mts +1 -1
- package/esm/mock/mock-transcription-model.d.mts.map +1 -1
- package/esm/mock/mock-transcription-model.mjs +1 -1
- package/esm/mock/mock-transcription-model.mjs.map +1 -1
- package/esm/model/fallback-model.d.mts +1 -1
- package/esm/model/fallback-model.d.mts.map +1 -1
- package/esm/model/fallback-model.mjs +1 -1
- package/esm/model/fallback-model.mjs.map +1 -1
- package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +1 -1
- package/esm/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +1 -1
- package/esm/node_modules/@vitest/expect/dist/index.mjs +1 -1
- package/esm/node_modules/@vitest/expect/dist/index.mjs.map +1 -1
- package/esm/node_modules/@vitest/pretty-format/dist/index.mjs +1 -1
- package/esm/node_modules/@vitest/pretty-format/dist/index.mjs.map +1 -1
- package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs +1 -1
- package/esm/node_modules/@vitest/runner/dist/chunk-artifact.mjs.map +1 -1
- package/esm/node_modules/@vitest/snapshot/dist/index.mjs +1 -1
- package/esm/node_modules/@vitest/snapshot/dist/index.mjs.map +1 -1
- package/esm/node_modules/@vitest/spy/dist/index.mjs +1 -1
- package/esm/node_modules/@vitest/spy/dist/index.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/diff.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/diff.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/display.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/display.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/error.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/error.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/helpers.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/helpers.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/offset.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/offset.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/serialize.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/serialize.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/source-map.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/source-map.mjs.map +1 -1
- package/esm/node_modules/@vitest/utils/dist/timers.mjs +1 -1
- package/esm/node_modules/@vitest/utils/dist/timers.mjs.map +1 -1
- package/esm/node_modules/chai/index.mjs +1 -1
- package/esm/node_modules/chai/index.mjs.map +1 -1
- package/esm/node_modules/magic-string/dist/magic-string.es.mjs +1 -1
- package/esm/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -1
- package/esm/node_modules/tinyrainbow/dist/index.mjs +1 -1
- package/esm/node_modules/tinyrainbow/dist/index.mjs.map +1 -1
- package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs +1 -1
- package/esm/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.mjs.map +1 -1
- package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs +1 -1
- package/esm/node_modules/vitest/dist/chunks/rpc.MzXet3jl.mjs.map +1 -1
- package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs +1 -1
- package/esm/node_modules/vitest/dist/chunks/test.DNmyFkvJ.mjs.map +1 -1
- package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs +1 -1
- package/esm/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.mjs.map +1 -1
- package/esm/object-stream/parse-partial-json.d.mts +1 -1
- package/esm/object-stream/parse-partial-json.d.mts.map +1 -1
- package/esm/object-stream/parse-partial-json.mjs +1 -1
- package/esm/object-stream/parse-partial-json.mjs.map +1 -1
- package/esm/object-stream/stream-object.d.mts +1 -1
- package/esm/object-stream/stream-object.d.mts.map +1 -1
- package/esm/object-stream/stream-object.mjs +1 -1
- package/esm/object-stream/stream-object.mjs.map +1 -1
- package/esm/observe/observer-registry.d.mts +1 -1
- package/esm/observe/observer-registry.d.mts.map +1 -1
- package/esm/observe/observer-registry.mjs +1 -1
- package/esm/observe/observer-registry.mjs.map +1 -1
- package/esm/observe/observer.contract.d.mts +1 -1
- package/esm/observe/observer.contract.d.mts.map +1 -1
- package/esm/observe/resolve-observers.d.mts +1 -1
- package/esm/observe/resolve-observers.d.mts.map +1 -1
- package/esm/observe/resolve-observers.mjs +1 -1
- package/esm/observe/resolve-observers.mjs.map +1 -1
- package/esm/orchestrator/as-tool.d.mts +1 -1
- package/esm/orchestrator/as-tool.d.mts.map +1 -1
- package/esm/orchestrator/as-tool.mjs +1 -1
- package/esm/orchestrator/as-tool.mjs.map +1 -1
- package/esm/orchestrator/checkpoint.mjs +1 -1
- package/esm/orchestrator/checkpoint.mjs.map +1 -1
- package/esm/orchestrator/commands.d.mts +1 -1
- package/esm/orchestrator/commands.d.mts.map +1 -1
- package/esm/orchestrator/commands.mjs +1 -1
- package/esm/orchestrator/commands.mjs.map +1 -1
- package/esm/orchestrator/compaction.mjs +1 -1
- package/esm/orchestrator/compaction.mjs.map +1 -1
- package/esm/orchestrator/dispatch.mjs +1 -1
- package/esm/orchestrator/dispatch.mjs.map +1 -1
- package/esm/orchestrator/emitter-port.type.d.mts +1 -1
- package/esm/orchestrator/emitter-port.type.d.mts.map +1 -1
- package/esm/orchestrator/emitter.d.mts +1 -1
- package/esm/orchestrator/emitter.d.mts.map +1 -1
- package/esm/orchestrator/emitter.mjs +1 -1
- package/esm/orchestrator/emitter.mjs.map +1 -1
- package/esm/orchestrator/engine-context.type.d.mts +1 -1
- package/esm/orchestrator/engine-context.type.d.mts.map +1 -1
- package/esm/orchestrator/execution.d.mts +1 -1
- package/esm/orchestrator/execution.d.mts.map +1 -1
- package/esm/orchestrator/execution.mjs +1 -1
- package/esm/orchestrator/execution.mjs.map +1 -1
- package/esm/orchestrator/load.mjs +1 -1
- package/esm/orchestrator/load.mjs.map +1 -1
- package/esm/orchestrator/lock.mjs +1 -1
- package/esm/orchestrator/lock.mjs.map +1 -1
- package/esm/orchestrator/memory.d.mts +1 -1
- package/esm/orchestrator/memory.d.mts.map +1 -1
- package/esm/orchestrator/memory.mjs +1 -1
- package/esm/orchestrator/memory.mjs.map +1 -1
- package/esm/orchestrator/orchestrator-stream.d.mts +1 -1
- package/esm/orchestrator/orchestrator-stream.d.mts.map +1 -1
- package/esm/orchestrator/orchestrator-stream.mjs +1 -1
- package/esm/orchestrator/orchestrator-stream.mjs.map +1 -1
- package/esm/orchestrator/orchestrator.d.mts +1 -1
- package/esm/orchestrator/orchestrator.d.mts.map +1 -1
- package/esm/orchestrator/orchestrator.mjs +1 -1
- package/esm/orchestrator/orchestrator.mjs.map +1 -1
- package/esm/orchestrator/resume.mjs +1 -1
- package/esm/orchestrator/resume.mjs.map +1 -1
- package/esm/orchestrator/session-lock.d.mts +1 -1
- package/esm/orchestrator/session-lock.d.mts.map +1 -1
- package/esm/orchestrator/session-lock.mjs +1 -1
- package/esm/orchestrator/session-lock.mjs.map +1 -1
- package/esm/orchestrator/signature.d.mts +1 -1
- package/esm/orchestrator/signature.d.mts.map +1 -1
- package/esm/orchestrator/signature.mjs +1 -1
- package/esm/orchestrator/signature.mjs.map +1 -1
- package/esm/orchestrator/window.mjs +1 -1
- package/esm/orchestrator/window.mjs.map +1 -1
- package/esm/planner/dag-scheduler.mjs +1 -1
- package/esm/planner/dag-scheduler.mjs.map +1 -1
- 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 +1 -1
- package/esm/planner/plan-prompt.mjs.map +1 -1
- package/esm/planner/plan-schema.d.mts +1 -1
- package/esm/planner/plan-schema.d.mts.map +1 -1
- package/esm/planner/plan-schema.mjs +1 -1
- package/esm/planner/plan-schema.mjs.map +1 -1
- package/esm/planner/planner-run.d.mts +1 -1
- package/esm/planner/planner-run.d.mts.map +1 -1
- package/esm/planner/planner-run.mjs +1 -1
- package/esm/planner/planner-run.mjs.map +1 -1
- package/esm/planner/planner.d.mts +1 -1
- package/esm/planner/planner.d.mts.map +1 -1
- package/esm/planner/planner.mjs +1 -1
- package/esm/planner/planner.mjs.map +1 -1
- package/esm/planner/signature.d.mts +1 -1
- package/esm/planner/signature.d.mts.map +1 -1
- package/esm/planner/signature.mjs +1 -1
- package/esm/planner/signature.mjs.map +1 -1
- package/esm/planner/snapshot.mjs +1 -1
- package/esm/planner/snapshot.mjs.map +1 -1
- package/esm/prompt/errors.d.mts +1 -1
- package/esm/prompt/errors.d.mts.map +1 -1
- package/esm/prompt/errors.mjs +1 -1
- package/esm/prompt/errors.mjs.map +1 -1
- package/esm/prompt/prompt-langfuse-sync.mjs +1 -1
- package/esm/prompt/prompt-langfuse-sync.mjs.map +1 -1
- package/esm/prompt/prompt-langfuse-sync.type.d.mts +1 -1
- package/esm/prompt/prompt-langfuse-sync.type.d.mts.map +1 -1
- package/esm/prompt/prompt-validate.mjs +1 -1
- package/esm/prompt/prompt-validate.mjs.map +1 -1
- package/esm/prompt/prompt.d.mts +1 -1
- package/esm/prompt/prompt.d.mts.map +1 -1
- package/esm/prompt/prompt.mjs +1 -1
- package/esm/prompt/prompt.mjs.map +1 -1
- package/esm/prompt/prompt.type.d.mts +1 -1
- package/esm/prompt/prompt.type.d.mts.map +1 -1
- package/esm/prompts/index.d.mts +2 -1
- package/esm/prompts/index.mjs +1 -0
- package/esm/prompts/prompts-manager.contract.d.mts +1 -1
- package/esm/prompts/prompts-manager.contract.d.mts.map +1 -1
- package/esm/prompts/prompts-manager.d.mts +1 -1
- package/esm/prompts/prompts-manager.d.mts.map +1 -1
- package/esm/prompts/prompts-manager.mjs +1 -1
- package/esm/prompts/prompts-manager.mjs.map +1 -1
- package/esm/prompts/prompts-manager.type.d.mts +1 -1
- package/esm/prompts/prompts-manager.type.d.mts.map +1 -1
- package/esm/prompts/prompts-validate.d.mts +44 -0
- package/esm/prompts/prompts-validate.d.mts.map +1 -0
- package/esm/prompts/prompts-validate.mjs +0 -0
- package/esm/prompts/prompts-validate.mjs.map +1 -1
- package/esm/rag/as-tool.mjs +1 -1
- package/esm/rag/as-tool.mjs.map +1 -1
- package/esm/rag/chunk/chunk.d.mts +1 -1
- package/esm/rag/chunk/chunk.d.mts.map +1 -1
- package/esm/rag/chunk/chunk.mjs +1 -1
- package/esm/rag/chunk/chunk.mjs.map +1 -1
- package/esm/rag/chunk/fixed.mjs +1 -1
- package/esm/rag/chunk/fixed.mjs.map +1 -1
- package/esm/rag/chunk/markdown.mjs +1 -1
- package/esm/rag/chunk/markdown.mjs.map +1 -1
- package/esm/rag/chunk/recursive.mjs +1 -1
- package/esm/rag/chunk/recursive.mjs.map +1 -1
- package/esm/rag/chunk/sentence.mjs +1 -1
- package/esm/rag/chunk/sentence.mjs.map +1 -1
- package/esm/rag/contracts/chunk-options.type.d.mts +1 -1
- package/esm/rag/contracts/chunk-options.type.d.mts.map +1 -1
- package/esm/rag/contracts/citation.type.d.mts +1 -1
- package/esm/rag/contracts/citation.type.d.mts.map +1 -1
- package/esm/rag/contracts/rag-config.type.d.mts +1 -1
- package/esm/rag/contracts/rag-config.type.d.mts.map +1 -1
- package/esm/rag/contracts/rag-document.type.d.mts +1 -1
- package/esm/rag/contracts/rag-document.type.d.mts.map +1 -1
- package/esm/rag/hybrid/bm25.d.mts +1 -1
- package/esm/rag/hybrid/bm25.d.mts.map +1 -1
- package/esm/rag/hybrid/bm25.mjs +1 -1
- package/esm/rag/hybrid/bm25.mjs.map +1 -1
- package/esm/rag/hybrid/hybrid-rank.d.mts +1 -1
- package/esm/rag/hybrid/hybrid-rank.d.mts.map +1 -1
- package/esm/rag/hybrid/hybrid-rank.mjs +1 -1
- package/esm/rag/hybrid/hybrid-rank.mjs.map +1 -1
- package/esm/rag/hybrid/rrf.d.mts +1 -1
- package/esm/rag/hybrid/rrf.d.mts.map +1 -1
- package/esm/rag/hybrid/rrf.mjs +1 -1
- package/esm/rag/hybrid/rrf.mjs.map +1 -1
- package/esm/rag/loaders/errors.d.mts +1 -1
- package/esm/rag/loaders/errors.d.mts.map +1 -1
- package/esm/rag/loaders/errors.mjs +1 -1
- package/esm/rag/loaders/errors.mjs.map +1 -1
- package/esm/rag/loaders/load-html.d.mts +1 -1
- package/esm/rag/loaders/load-html.d.mts.map +1 -1
- package/esm/rag/loaders/load-html.mjs +1 -1
- package/esm/rag/loaders/load-html.mjs.map +1 -1
- package/esm/rag/loaders/load-pdf.d.mts +1 -1
- package/esm/rag/loaders/load-pdf.d.mts.map +1 -1
- package/esm/rag/loaders/load-pdf.mjs +1 -1
- package/esm/rag/loaders/load-pdf.mjs.map +1 -1
- package/esm/rag/loaders/load-text.d.mts +1 -1
- package/esm/rag/loaders/load-text.d.mts.map +1 -1
- package/esm/rag/loaders/load-text.mjs +1 -1
- package/esm/rag/loaders/load-text.mjs.map +1 -1
- package/esm/rag/loaders/load-web.d.mts +1 -1
- package/esm/rag/loaders/load-web.d.mts.map +1 -1
- package/esm/rag/loaders/load-web.mjs +1 -1
- package/esm/rag/loaders/load-web.mjs.map +1 -1
- package/esm/rag/loaders/loader.type.d.mts +1 -1
- package/esm/rag/loaders/loader.type.d.mts.map +1 -1
- package/esm/rag/rag.d.mts +1 -1
- package/esm/rag/rag.d.mts.map +1 -1
- package/esm/rag/rag.mjs +1 -1
- package/esm/rag/rag.mjs.map +1 -1
- package/esm/rag/rerank/keyword-reranker.d.mts +1 -1
- package/esm/rag/rerank/keyword-reranker.d.mts.map +1 -1
- package/esm/rag/rerank/keyword-reranker.mjs +1 -1
- package/esm/rag/rerank/keyword-reranker.mjs.map +1 -1
- package/esm/rag/rerank/llm-reranker.d.mts +1 -1
- package/esm/rag/rerank/llm-reranker.d.mts.map +1 -1
- package/esm/rag/rerank/llm-reranker.mjs +1 -1
- package/esm/rag/rerank/llm-reranker.mjs.map +1 -1
- package/esm/rag/rerank/reranker.contract.d.mts +1 -1
- package/esm/rag/rerank/reranker.contract.d.mts.map +1 -1
- package/esm/rag/retrieve.mjs +1 -1
- package/esm/rag/retrieve.mjs.map +1 -1
- package/esm/rag/store/cache-vector-store.d.mts +1 -1
- package/esm/rag/store/cache-vector-store.d.mts.map +1 -1
- package/esm/rag/store/cache-vector-store.mjs +1 -1
- package/esm/rag/store/cache-vector-store.mjs.map +1 -1
- package/esm/rag/store/pg-vector-store.d.mts +1 -1
- package/esm/rag/store/pg-vector-store.d.mts.map +1 -1
- package/esm/rag/store/pg-vector-store.mjs +1 -1
- package/esm/rag/store/pg-vector-store.mjs.map +1 -1
- package/esm/rag/store/vector-store.contract.d.mts +1 -1
- package/esm/rag/store/vector-store.contract.d.mts.map +1 -1
- package/esm/rag/transforms/multi-query.d.mts +1 -1
- package/esm/rag/transforms/multi-query.d.mts.map +1 -1
- package/esm/rag/transforms/multi-query.mjs +1 -1
- package/esm/rag/transforms/multi-query.mjs.map +1 -1
- package/esm/security/outbound-policy.d.mts +1 -1
- package/esm/security/outbound-policy.d.mts.map +1 -1
- package/esm/security/outbound-policy.mjs +1 -1
- package/esm/security/outbound-policy.mjs.map +1 -1
- package/esm/security/outbound-policy.type.d.mts +1 -1
- package/esm/security/outbound-policy.type.d.mts.map +1 -1
- package/esm/security/private-ip.d.mts +1 -1
- package/esm/security/private-ip.d.mts.map +1 -1
- package/esm/security/private-ip.mjs +1 -1
- package/esm/security/private-ip.mjs.map +1 -1
- package/esm/security/redact.d.mts +1 -1
- package/esm/security/redact.d.mts.map +1 -1
- package/esm/security/redact.mjs +8 -2
- package/esm/security/redact.mjs.map +1 -1
- package/esm/serve/serve.d.mts +1 -1
- package/esm/serve/serve.d.mts.map +1 -1
- package/esm/serve/serve.mjs +1 -1
- package/esm/serve/serve.mjs.map +1 -1
- package/esm/serve/sse.d.mts +1 -1
- package/esm/serve/sse.d.mts.map +1 -1
- package/esm/serve/sse.mjs +1 -1
- package/esm/serve/sse.mjs.map +1 -1
- package/esm/serve/stream-to-sse.d.mts +1 -1
- package/esm/serve/stream-to-sse.d.mts.map +1 -1
- package/esm/serve/stream-to-sse.mjs +1 -1
- package/esm/serve/stream-to-sse.mjs.map +1 -1
- package/esm/skills/catalog.d.mts +1 -1
- package/esm/skills/catalog.d.mts.map +1 -1
- package/esm/skills/catalog.mjs +2 -2
- package/esm/skills/catalog.mjs.map +1 -1
- package/esm/skills/contracts/skill-record.type.d.mts +1 -1
- package/esm/skills/contracts/skill-record.type.d.mts.map +1 -1
- package/esm/skills/contracts/skills-config.type.d.mts +1 -1
- package/esm/skills/contracts/skills-config.type.d.mts.map +1 -1
- package/esm/skills/contracts/skills-store.contract.d.mts +1 -1
- package/esm/skills/contracts/skills-store.contract.d.mts.map +1 -1
- package/esm/skills/contracts/skills.contract.d.mts +1 -1
- package/esm/skills/contracts/skills.contract.d.mts.map +1 -1
- package/esm/skills/load-skill-tool.d.mts +1 -1
- package/esm/skills/load-skill-tool.d.mts.map +1 -1
- package/esm/skills/load-skill-tool.mjs +1 -1
- package/esm/skills/load-skill-tool.mjs.map +1 -1
- package/esm/skills/review-gate.d.mts +1 -1
- package/esm/skills/review-gate.d.mts.map +1 -1
- package/esm/skills/review-gate.mjs +1 -1
- package/esm/skills/review-gate.mjs.map +1 -1
- package/esm/skills/save-skill-tool.d.mts +1 -1
- package/esm/skills/save-skill-tool.d.mts.map +1 -1
- package/esm/skills/save-skill-tool.mjs +1 -1
- package/esm/skills/save-skill-tool.mjs.map +1 -1
- package/esm/skills/skills.d.mts +1 -1
- package/esm/skills/skills.d.mts.map +1 -1
- package/esm/skills/skills.mjs +1 -1
- package/esm/skills/skills.mjs.map +1 -1
- package/esm/skills/sources/directory-source.d.mts +1 -1
- package/esm/skills/sources/directory-source.d.mts.map +1 -1
- package/esm/skills/sources/directory-source.mjs +1 -1
- package/esm/skills/sources/directory-source.mjs.map +1 -1
- package/esm/skills/sources/index.d.mts +1 -1
- package/esm/skills/sources/index.d.mts.map +1 -1
- package/esm/skills/sources/index.mjs +1 -1
- package/esm/skills/sources/index.mjs.map +1 -1
- package/esm/skills/sources/parse-frontmatter.d.mts +1 -1
- package/esm/skills/sources/parse-frontmatter.d.mts.map +1 -1
- package/esm/skills/sources/parse-frontmatter.mjs +1 -1
- package/esm/skills/sources/parse-frontmatter.mjs.map +1 -1
- package/esm/skills/sources/store-source.d.mts +1 -1
- package/esm/skills/sources/store-source.d.mts.map +1 -1
- package/esm/skills/sources/store-source.mjs +1 -1
- package/esm/skills/sources/store-source.mjs.map +1 -1
- package/esm/skills/sources/url-source.d.mts +1 -1
- package/esm/skills/sources/url-source.d.mts.map +1 -1
- package/esm/skills/sources/url-source.mjs +1 -1
- package/esm/skills/sources/url-source.mjs.map +1 -1
- package/esm/skills/store/mock-skills-store.d.mts +1 -1
- package/esm/skills/store/mock-skills-store.d.mts.map +1 -1
- package/esm/skills/store/mock-skills-store.mjs +1 -1
- package/esm/skills/store/mock-skills-store.mjs.map +1 -1
- package/esm/skills/store/procedural-skill-store.d.mts +1 -1
- package/esm/skills/store/procedural-skill-store.d.mts.map +1 -1
- package/esm/skills/store/procedural-skill-store.mjs +1 -1
- package/esm/skills/store/procedural-skill-store.mjs.map +1 -1
- package/esm/snapshot/memory.d.mts +1 -1
- package/esm/snapshot/memory.d.mts.map +1 -1
- package/esm/snapshot/memory.mjs +1 -1
- package/esm/snapshot/memory.mjs.map +1 -1
- package/esm/snapshot/pg.d.mts +1 -1
- package/esm/snapshot/pg.d.mts.map +1 -1
- package/esm/snapshot/pg.mjs +1 -1
- package/esm/snapshot/pg.mjs.map +1 -1
- package/esm/snapshot/redis.d.mts +1 -1
- package/esm/snapshot/redis.d.mts.map +1 -1
- package/esm/snapshot/redis.mjs +1 -1
- package/esm/snapshot/redis.mjs.map +1 -1
- package/esm/speech/speech.d.mts +1 -1
- package/esm/speech/speech.d.mts.map +1 -1
- package/esm/speech/speech.mjs +1 -1
- package/esm/speech/speech.mjs.map +1 -1
- package/esm/supervisor/as-tool.d.mts +1 -1
- package/esm/supervisor/as-tool.d.mts.map +1 -1
- package/esm/supervisor/as-tool.mjs +1 -1
- package/esm/supervisor/as-tool.mjs.map +1 -1
- package/esm/supervisor/cancellation.d.mts +1 -1
- package/esm/supervisor/cancellation.d.mts.map +1 -1
- package/esm/supervisor/cancellation.mjs +1 -1
- package/esm/supervisor/cancellation.mjs.map +1 -1
- package/esm/supervisor/decide.mjs +1 -1
- package/esm/supervisor/decide.mjs.map +1 -1
- package/esm/supervisor/emitter.d.mts +1 -1
- package/esm/supervisor/emitter.d.mts.map +1 -1
- package/esm/supervisor/emitter.mjs +1 -1
- package/esm/supervisor/emitter.mjs.map +1 -1
- package/esm/supervisor/entries.d.mts +1 -1
- package/esm/supervisor/entries.d.mts.map +1 -1
- package/esm/supervisor/entries.mjs +1 -1
- package/esm/supervisor/entries.mjs.map +1 -1
- package/esm/supervisor/execution.d.mts +1 -1
- package/esm/supervisor/execution.d.mts.map +1 -1
- package/esm/supervisor/execution.mjs +1 -1
- package/esm/supervisor/execution.mjs.map +1 -1
- package/esm/supervisor/fan-out.d.mts +1 -1
- package/esm/supervisor/fan-out.d.mts.map +1 -1
- package/esm/supervisor/fan-out.mjs +1 -1
- package/esm/supervisor/fan-out.mjs.map +1 -1
- package/esm/supervisor/router-factory.d.mts +1 -1
- package/esm/supervisor/router-factory.d.mts.map +1 -1
- package/esm/supervisor/router-factory.mjs +1 -1
- package/esm/supervisor/router-factory.mjs.map +1 -1
- package/esm/supervisor/router-prompt.d.mts +1 -1
- package/esm/supervisor/router-prompt.d.mts.map +1 -1
- package/esm/supervisor/router-prompt.mjs +1 -1
- package/esm/supervisor/router-prompt.mjs.map +1 -1
- package/esm/supervisor/signature.d.mts +1 -1
- package/esm/supervisor/signature.d.mts.map +1 -1
- package/esm/supervisor/signature.mjs +1 -1
- package/esm/supervisor/signature.mjs.map +1 -1
- package/esm/supervisor/snapshot.d.mts +1 -1
- package/esm/supervisor/snapshot.d.mts.map +1 -1
- package/esm/supervisor/snapshot.mjs +1 -1
- package/esm/supervisor/snapshot.mjs.map +1 -1
- package/esm/supervisor/supervisor-stream.d.mts +1 -1
- package/esm/supervisor/supervisor-stream.d.mts.map +1 -1
- package/esm/supervisor/supervisor-stream.mjs +1 -1
- package/esm/supervisor/supervisor-stream.mjs.map +1 -1
- package/esm/supervisor/supervisor.d.mts +1 -1
- package/esm/supervisor/supervisor.d.mts.map +1 -1
- package/esm/supervisor/supervisor.mjs +1 -1
- package/esm/supervisor/supervisor.mjs.map +1 -1
- package/esm/system-prompt/instruction.d.mts +1 -1
- package/esm/system-prompt/instruction.d.mts.map +1 -1
- package/esm/system-prompt/instruction.mjs +1 -1
- package/esm/system-prompt/instruction.mjs.map +1 -1
- package/esm/system-prompt/persona.d.mts +1 -1
- package/esm/system-prompt/persona.d.mts.map +1 -1
- package/esm/system-prompt/persona.mjs +1 -1
- package/esm/system-prompt/persona.mjs.map +1 -1
- package/esm/system-prompt/refined-system-prompt.d.mts +1 -1
- package/esm/system-prompt/refined-system-prompt.d.mts.map +1 -1
- package/esm/system-prompt/refined-system-prompt.mjs +1 -1
- package/esm/system-prompt/refined-system-prompt.mjs.map +1 -1
- package/esm/system-prompt/render-placeholders.d.mts +1 -1
- package/esm/system-prompt/render-placeholders.d.mts.map +1 -1
- package/esm/system-prompt/render-placeholders.mjs +1 -1
- package/esm/system-prompt/render-placeholders.mjs.map +1 -1
- package/esm/system-prompt/system-prompt.d.mts +1 -1
- package/esm/system-prompt/system-prompt.d.mts.map +1 -1
- package/esm/system-prompt/system-prompt.mjs +1 -1
- package/esm/system-prompt/system-prompt.mjs.map +1 -1
- package/esm/team/gates.mjs +1 -1
- package/esm/team/gates.mjs.map +1 -1
- package/esm/team/team.d.mts +1 -1
- package/esm/team/team.d.mts.map +1 -1
- package/esm/team/team.mjs +1 -1
- package/esm/team/team.mjs.map +1 -1
- package/esm/testing/matcher-logic.d.mts +1 -1
- package/esm/testing/matcher-logic.d.mts.map +1 -1
- package/esm/testing/matcher-logic.mjs +1 -1
- package/esm/testing/matcher-logic.mjs.map +1 -1
- package/esm/testing/matchers.d.mts +1 -1
- package/esm/testing/matchers.d.mts.map +1 -1
- package/esm/testing/matchers.mjs +1 -1
- package/esm/testing/matchers.mjs.map +1 -1
- package/esm/testing/register-lazy.d.mts +1 -1
- package/esm/testing/register-lazy.d.mts.map +1 -1
- package/esm/testing/register-lazy.mjs +1 -1
- package/esm/testing/register-lazy.mjs.map +1 -1
- package/esm/tool/executable-as-tool.d.mts +1 -1
- package/esm/tool/executable-as-tool.d.mts.map +1 -1
- package/esm/tool/executable-as-tool.mjs +1 -1
- package/esm/tool/executable-as-tool.mjs.map +1 -1
- package/esm/tool/tool.d.mts +1 -1
- package/esm/tool/tool.d.mts.map +1 -1
- package/esm/tool/tool.mjs +1 -1
- package/esm/tool/tool.mjs.map +1 -1
- package/esm/transcribe/audio-input.d.mts +1 -1
- package/esm/transcribe/audio-input.d.mts.map +1 -1
- package/esm/transcribe/audio-input.mjs +1 -1
- package/esm/transcribe/audio-input.mjs.map +1 -1
- package/esm/transcribe/transcribe.d.mts +1 -1
- package/esm/transcribe/transcribe.d.mts.map +1 -1
- package/esm/transcribe/transcribe.mjs +1 -1
- package/esm/transcribe/transcribe.mjs.map +1 -1
- package/esm/utils/compute-cost.d.mts +1 -1
- package/esm/utils/compute-cost.d.mts.map +1 -1
- package/esm/utils/compute-cost.mjs +1 -1
- package/esm/utils/compute-cost.mjs.map +1 -1
- package/esm/utils/extract-json-lenient.d.mts +1 -1
- package/esm/utils/extract-json-lenient.d.mts.map +1 -1
- package/esm/utils/extract-json-lenient.mjs +1 -1
- package/esm/utils/extract-json-lenient.mjs.map +1 -1
- package/esm/utils/extract-json-payload.d.mts +1 -1
- package/esm/utils/extract-json-payload.d.mts.map +1 -1
- package/esm/utils/extract-json-payload.mjs +1 -1
- package/esm/utils/extract-json-payload.mjs.map +1 -1
- package/esm/utils/generate-run-id.d.mts +1 -1
- package/esm/utils/generate-run-id.d.mts.map +1 -1
- package/esm/utils/generate-run-id.mjs +1 -1
- package/esm/utils/generate-run-id.mjs.map +1 -1
- package/esm/utils/json-schema.d.mts +1 -1
- package/esm/utils/json-schema.d.mts.map +1 -1
- package/esm/utils/json-schema.mjs +1 -1
- package/esm/utils/json-schema.mjs.map +1 -1
- package/esm/utils/prepare-attachment-part.d.mts +1 -1
- package/esm/utils/prepare-attachment-part.d.mts.map +1 -1
- package/esm/utils/prepare-attachment-part.mjs +1 -1
- package/esm/utils/prepare-attachment-part.mjs.map +1 -1
- package/esm/utils/resolve-attachment.d.mts +1 -1
- package/esm/utils/resolve-attachment.d.mts.map +1 -1
- package/esm/utils/resolve-attachment.mjs +1 -1
- package/esm/utils/resolve-attachment.mjs.map +1 -1
- package/esm/utils/run-context.d.mts +1 -1
- package/esm/utils/run-context.d.mts.map +1 -1
- package/esm/utils/run-context.mjs +1 -1
- package/esm/utils/run-context.mjs.map +1 -1
- package/esm/utils/safe-json-parse.d.mts +1 -1
- package/esm/utils/safe-json-parse.d.mts.map +1 -1
- package/esm/utils/safe-json-parse.mjs +1 -1
- package/esm/utils/safe-json-parse.mjs.map +1 -1
- package/esm/utils/stamp-report-lineage.d.mts +1 -1
- package/esm/utils/stamp-report-lineage.d.mts.map +1 -1
- package/esm/utils/stamp-report-lineage.mjs +1 -1
- package/esm/utils/stamp-report-lineage.mjs.map +1 -1
- package/esm/utils/token-count.d.mts +1 -1
- package/esm/utils/token-count.d.mts.map +1 -1
- package/esm/utils/token-count.mjs +1 -1
- package/esm/utils/token-count.mjs.map +1 -1
- package/esm/vcr/cassette-io.mjs +1 -1
- package/esm/vcr/cassette-io.mjs.map +1 -1
- package/esm/vcr/errors.d.mts +1 -1
- package/esm/vcr/errors.d.mts.map +1 -1
- package/esm/vcr/errors.mjs +1 -1
- package/esm/vcr/errors.mjs.map +1 -1
- package/esm/vcr/hash-request.d.mts +1 -1
- package/esm/vcr/hash-request.d.mts.map +1 -1
- package/esm/vcr/hash-request.mjs +1 -1
- package/esm/vcr/hash-request.mjs.map +1 -1
- package/esm/vcr/vcr.d.mts +1 -1
- package/esm/vcr/vcr.d.mts.map +1 -1
- package/esm/vcr/vcr.mjs +1 -1
- package/esm/vcr/vcr.mjs.map +1 -1
- package/esm/vcr/vcr.type.d.mts +1 -1
- package/esm/vcr/vcr.type.d.mts.map +1 -1
- package/esm/workflow/as-tool.mjs +1 -1
- package/esm/workflow/as-tool.mjs.map +1 -1
- package/esm/workflow/cancellation.mjs +1 -1
- package/esm/workflow/cancellation.mjs.map +1 -1
- package/esm/workflow/emitter.mjs +1 -1
- package/esm/workflow/emitter.mjs.map +1 -1
- package/esm/workflow/engine.mjs +5 -2
- package/esm/workflow/engine.mjs.map +1 -1
- package/esm/workflow/retry.mjs +1 -1
- package/esm/workflow/retry.mjs.map +1 -1
- package/esm/workflow/router.mjs +1 -1
- package/esm/workflow/router.mjs.map +1 -1
- package/esm/workflow/run-scoped-emitter.mjs +1 -1
- package/esm/workflow/run-scoped-emitter.mjs.map +1 -1
- package/esm/workflow/signature.d.mts +1 -1
- package/esm/workflow/signature.d.mts.map +1 -1
- package/esm/workflow/signature.mjs +1 -1
- package/esm/workflow/signature.mjs.map +1 -1
- package/esm/workflow/snapshot.mjs +1 -1
- package/esm/workflow/snapshot.mjs.map +1 -1
- package/esm/workflow/state.mjs +1 -1
- package/esm/workflow/state.mjs.map +1 -1
- package/esm/workflow/step-runner.mjs +25 -6
- package/esm/workflow/step-runner.mjs.map +1 -1
- package/esm/workflow/step.d.mts +1 -1
- package/esm/workflow/step.d.mts.map +1 -1
- package/esm/workflow/step.mjs +1 -1
- package/esm/workflow/step.mjs.map +1 -1
- package/esm/workflow/workflow.d.mts +1 -1
- package/esm/workflow/workflow.d.mts.map +1 -1
- package/esm/workflow/workflow.mjs +1 -1
- package/esm/workflow/workflow.mjs.map +1 -1
- package/llms-full.txt +23 -2
- package/package.json +5 -3
- package/skills/observe-ai-flows/SKILL.md +2 -2
- package/skills/run-ai-workflow/SKILL.md +19 -0
- package/skills/run-supervisor/SKILL.md +2 -0
- package/cjs/magic-string.es-BtxW4VqG.cjs.map +0 -1
- package/cjs/matcher-logic-SBnzYohQ.cjs.map +0 -1
- package/cjs/matchers-BBh3gyB-.cjs.map +0 -1
- package/cjs/src-5ze7nVpa.cjs +0 -25626
- package/cjs/src-5ze7nVpa.cjs.map +0 -1
- package/cjs/src-DTQ4KgBu.cjs +0 -30
- package/esm/ai-openai/src/embedder.mjs +0 -4
- package/esm/ai-openai/src/image.mjs +0 -5
- package/esm/ai-openai/src/index.mjs +0 -7
- package/esm/ai-openai/src/model.mjs +0 -5
- package/esm/ai-openai/src/sdk.mjs +0 -9
- package/esm/ai-openai/src/speech.mjs +0 -5
- package/esm/ai-openai/src/transcription.mjs +0 -6
- package/esm/ai-openai/src/utils/index.mjs +0 -5
- package/esm/ai-openai/src/utils/to-openai-messages.mjs +0 -3
- package/esm/ai-openai/src/utils/to-openai-tools.mjs +0 -3
- package/esm/ai-openai/src/utils/wrap-openai-error.mjs +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume-seed.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"resume-seed.mjs","names":[],"sources":["../../../../../../../ai/src/human/resume-seed.ts"],"sourcesContent":["import type { ApprovalDecision } from \"./contracts\";\n\n/**\n * Process-local registry of decisions pre-seeded for a durable re-run.\n *\n * **Why it exists.** v1 durable resume re-runs the *same* agent turn with\n * the human's decision already in hand (it does **not** rehydrate an\n * in-flight supervisor — that is the deferred v2 lift). The agent's\n * `ai.human.approval(...)` middleware is baked in at construction, so the\n * re-run cannot be handed a different handler. Instead, `ai.human.resume(...)`\n * stashes the decision here keyed by the agent name; the approval\n * middleware's handler consults the registry **before** calling the\n * author's handler and, on a hit, replays the seeded decision exactly once\n * — so the gated tool call this time resolves to the human's ruling instead\n * of pausing again.\n *\n * Keyed by agent name (not interrupt id): the re-run produces a *fresh*\n * interrupt id (the id embeds a random segment), so the seed must be\n * matched to the run, not the prior id. The registry holds at most one\n * seeded decision per agent and consumes it on first read, so a second\n * gated call in the same re-run falls through to the author's handler.\n */\nconst seededDecisions = new Map<string, ApprovalDecision>();\n\n/**\n * Stash a decision to be replayed on the next gated tool call of `agentName`.\n * Overwrites any prior seed for the same agent (a re-run carries exactly one\n * pre-seeded decision).\n */\nexport function seedDecision(agentName: string, decision: ApprovalDecision): void {\n seededDecisions.set(agentName, decision);\n}\n\n/**\n * Take (read **and** remove) the seeded decision for `agentName`, or\n * `undefined` when none is staged. Consuming on read makes the seed\n * one-shot: only the first gated call of a re-run replays it.\n */\nexport function takeSeededDecision(agentName: string): ApprovalDecision | undefined {\n const decision = seededDecisions.get(agentName);\n\n if (decision === undefined) {\n return undefined;\n }\n\n seededDecisions.delete(agentName);\n\n return decision;\n}\n\n/**\n * Drop any staged seed for `agentName` without consuming it as a decision.\n * Used to clean up after a re-run that errored before the seeded call fired,\n * so a stale seed never leaks into an unrelated later run of the same agent.\n */\nexport function clearSeededDecision(agentName: string): void {\n seededDecisions.delete(agentName);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,kCAAkB,IAAI,IAA8B;;;;;;AAO1D,SAAgB,aAAa,WAAmB,UAAkC;CAChF,gBAAgB,IAAI,WAAW,QAAQ;AACzC;;;;;;AAOA,SAAgB,mBAAmB,WAAiD;CAClF,MAAM,WAAW,gBAAgB,IAAI,SAAS;CAE9C,IAAI,aAAa,QACf;CAGF,gBAAgB,OAAO,SAAS;CAEhC,OAAO;AACT;;;;;;AAOA,SAAgB,oBAAoB,WAAyB;CAC3D,gBAAgB,OAAO,SAAS;AAClC"}
|
package/esm/human/resume.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApprovalDecision } from "./contracts/approval.type.mjs";
|
|
2
2
|
import { ResumeOptions, ResumeResult } from "./contracts/resume.type.mjs";
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../ai/src/human/resume.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Apply a human's decision to a persisted interrupt — the out-of-process
|
|
6
6
|
* resume entry point behind `ai.human.resume(interruptId, decision, options)`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"resume.d.mts","names":[],"sources":["../../../../../../../ai/src/human/resume.ts"],"mappings":";;;;;;;AAyIA;;;;;;;;;;;;;;;;;;;;;;AAI+B;;;;;;;;;;;;;;;;;;;;;iBAJT,MAAA,oBACpB,WAAA,UACA,QAAA,EAAU,gBAAA,EACV,OAAA,EAAS,aAAA,CAAc,OAAA,IACtB,OAAA,CAAQ,YAAA,CAAa,OAAA"}
|
package/esm/human/resume.mjs
CHANGED
package/esm/human/resume.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resume.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"resume.mjs","names":[],"sources":["../../../../../../../ai/src/human/resume.ts"],"sourcesContent":["import type {\n ApprovalDecision,\n PendingInterrupt,\n ResumeOptions,\n ResumeResult,\n} from \"./contracts\";\nimport { clearSeededDecision, seedDecision } from \"./resume-seed\";\n\n/**\n * Validate that a decision is a well-formed {@link ApprovalDecision}.\n *\n * `ai.human.resume(...)` is a public, out-of-process entry point — a\n * webhook can hand it anything. Guard the closed `type` union (and the\n * per-variant required fields) before applying it, so a malformed payload\n * fails loudly here rather than silently mis-driving the re-run.\n */\nfunction assertDecision(decision: ApprovalDecision): void {\n if (decision.type === \"approve\") {\n return;\n }\n\n if (decision.type === \"reject\") {\n if (typeof decision.reason !== \"string\") {\n throw new TypeError(\n \"ai.human.resume: a 'reject' decision requires a string 'reason'.\",\n );\n }\n\n return;\n }\n\n if (decision.type === \"edit\") {\n if (!(\"args\" in decision)) {\n throw new TypeError(\n \"ai.human.resume: an 'edit' decision requires replacement 'args'.\",\n );\n }\n\n return;\n }\n\n throw new TypeError(\n `ai.human.resume: unknown decision type '${(decision as { type: string }).type}'. Expected one of: approve, reject, edit.`,\n );\n}\n\n/**\n * Re-run the agent for a resumed interrupt with the decision pre-seeded.\n *\n * Stages the decision in the process-local seed registry (keyed by agent\n * name), then re-executes the original prompt. The agent's\n * `ai.human.approval(...)` middleware consumes the seed on the gated tool\n * call — so this time it resolves to the human's ruling instead of pausing\n * again. The seed is cleared in a `finally` so a re-run that errors before\n * the gated call never leaks a stale seed into a later run.\n */\nasync function rerun<TOutput>(\n pending: PendingInterrupt,\n decision: ApprovalDecision,\n options: ResumeOptions<TOutput>,\n): Promise<ResumeResult<TOutput>> {\n const { agent } = options;\n\n // `agent` is guaranteed by the caller (this is only reached on the\n // re-run path), but narrow for the type system.\n if (!agent) {\n return { type: \"applied\", interruptId: pending.interruptId, decision };\n }\n\n const input = options.input ?? pending.request.context.originalInput ?? \"\";\n\n seedDecision(agent.name, decision);\n\n try {\n const result = await agent.execute(input, options.executeOptions);\n\n return {\n type: \"applied\",\n interruptId: pending.interruptId,\n decision,\n result,\n };\n } finally {\n // If the seeded call never fired (the re-run errored early, or the\n // policy no longer gates the tool), drop the stale seed so it cannot\n // leak into an unrelated later run of the same agent.\n clearSeededDecision(agent.name);\n }\n}\n\n/**\n * Apply a human's decision to a persisted interrupt — the out-of-process\n * resume entry point behind `ai.human.resume(interruptId, decision, options)`.\n *\n * **Durable v1 model — re-run, not mid-supervisor suspend.** This loads the\n * {@link PendingInterrupt} from `options.store`, validates the decision,\n * deletes the pending record, and (when an `agent` is supplied) re-executes\n * the original turn with the decision **pre-seeded**, so the gated tool call\n * resolves to the ruling instead of pausing again. It does **not** rehydrate\n * an in-flight supervisor — that is the deferred v2 lift.\n *\n * **Idempotent.** A second resume of an already-resolved (deleted) or\n * never-raised interrupt is a no-op: it returns `{ type: \"already-resolved\" }`\n * without re-applying the decision or re-running the turn — mirroring the\n * orchestrator resume's drain idempotency. The record is deleted **before**\n * the re-run, so even a re-run that itself raises a fresh interrupt cannot\n * collide with the one being resolved.\n *\n * **Two shapes** (see {@link ResumeOptions}):\n * - **apply-only** — omit `agent`: load, validate, delete, return\n * `{ type: \"applied\", decision }` for a caller-owned re-drive.\n * - **re-run** — pass `agent`: additionally re-execute the turn; the\n * {@link import(\"@warlock.js/ai\").AgentResult} rides `result.result`.\n *\n * @param interruptId - Id of the persisted interrupt to resolve.\n * @param decision - The human's ruling (approve / reject / edit).\n * @param options - The durable `store` (required) plus optional re-run\n * `agent` / `input` / `executeOptions`.\n * @returns A {@link ResumeResult} — `\"applied\"` or idempotent\n * `\"already-resolved\"`.\n *\n * @example\n * // Process B (webhook, hours later) — apply-only:\n * const outcome = await ai.human.resume(interruptId, { type: \"reject\", reason: \"Out of policy\" }, {\n * store,\n * });\n *\n * @example\n * // Re-run the turn with the decision pre-seeded:\n * const outcome = await ai.human.resume(interruptId, { type: \"edit\", args: { amount: 5 } }, {\n * store,\n * agent: support,\n * });\n * if (outcome.type === \"applied\" && outcome.result) {\n * console.log(outcome.result.text);\n * }\n */\nexport async function resume<TOutput = unknown>(\n interruptId: string,\n decision: ApprovalDecision,\n options: ResumeOptions<TOutput>,\n): Promise<ResumeResult<TOutput>> {\n assertDecision(decision);\n\n const { store } = options;\n const pending = await store.load(interruptId);\n\n // No live interrupt — already resolved + deleted, or never raised. Never\n // double-apply; never re-run. Idempotent no-op.\n if (pending === undefined || pending.status !== \"pending\") {\n return { type: \"already-resolved\", interruptId };\n }\n\n // Resolve + delete BEFORE the re-run so a re-run that itself raises a new\n // interrupt cannot collide with the one being resolved, and a concurrent\n // resume of the same id sees it gone.\n await store.delete(interruptId);\n\n if (!options.agent) {\n return { type: \"applied\", interruptId, decision };\n }\n\n return rerun(pending, decision, options);\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAS,eAAe,UAAkC;CACxD,IAAI,SAAS,SAAS,WACpB;CAGF,IAAI,SAAS,SAAS,UAAU;EAC9B,IAAI,OAAO,SAAS,WAAW,UAC7B,MAAM,IAAI,UACR,kEACF;EAGF;CACF;CAEA,IAAI,SAAS,SAAS,QAAQ;EAC5B,IAAI,EAAE,UAAU,WACd,MAAM,IAAI,UACR,kEACF;EAGF;CACF;CAEA,MAAM,IAAI,UACR,2CAA4C,SAA8B,KAAK,2CACjF;AACF;;;;;;;;;;;AAYA,eAAe,MACb,SACA,UACA,SACgC;CAChC,MAAM,EAAE,UAAU;CAIlB,IAAI,CAAC,OACH,OAAO;EAAE,MAAM;EAAW,aAAa,QAAQ;EAAa;CAAS;CAGvE,MAAM,QAAQ,QAAQ,SAAS,QAAQ,QAAQ,QAAQ,iBAAiB;CAExE,aAAa,MAAM,MAAM,QAAQ;CAEjC,IAAI;EACF,MAAM,SAAS,MAAM,MAAM,QAAQ,OAAO,QAAQ,cAAc;EAEhE,OAAO;GACL,MAAM;GACN,aAAa,QAAQ;GACrB;GACA;EACF;CACF,UAAU;EAIR,oBAAoB,MAAM,IAAI;CAChC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,eAAsB,OACpB,aACA,UACA,SACgC;CAChC,eAAe,QAAQ;CAEvB,MAAM,EAAE,UAAU;CAClB,MAAM,UAAU,MAAM,MAAM,KAAK,WAAW;CAI5C,IAAI,YAAY,UAAa,QAAQ,WAAW,WAC9C,OAAO;EAAE,MAAM;EAAoB;CAAY;CAMjD,MAAM,MAAM,OAAO,WAAW;CAE9B,IAAI,CAAC,QAAQ,OACX,OAAO;EAAE,MAAM;EAAW;EAAa;CAAS;CAGlD,OAAO,MAAM,SAAS,UAAU,OAAO;AACzC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InterruptStore } from "../contracts/interrupt-store.contract.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../ai/src/human/stores/memory.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Create an in-memory {@link InterruptStore}. Zero-config — no client, no
|
|
6
6
|
* connection. Suitable for dev, tests, and single-process apps whose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"memory.d.mts","names":[],"sources":["../../../../../../../../ai/src/human/stores/memory.ts"],"mappings":";;;;;AAmGA;;;;AAAwC;;;;;;;;;;;;;;;;;iBAAxB,MAAA,IAAU,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"memory.mjs","names":[],"sources":["../../../../../../../../ai/src/human/stores/memory.ts"],"sourcesContent":["import type {\n InterruptStore,\n PendingInterrupt,\n} from \"../contracts/interrupt-store.contract\";\n\n/**\n * In-memory {@link InterruptStore} — pending interrupts held in a\n * process-local `Map`, never persisted to disk.\n *\n * Owns: the `interruptId → {@link PendingInterrupt}` index and the\n * last-writer-wins `save` / `load` / `delete` / `list` semantics the\n * contract declares. Does NOT own: durability, cross-process sharing, or\n * TTL eviction — it is the zero-config default for dev, tests, and\n * single-process apps whose approval flow stays interactive (the run\n * `await`s the decision in-process and never needs to survive a restart).\n * Reach for `ai.human.interrupt.pg()` / `ai.human.interrupt.redis()` when\n * a reviewer rules out-of-process, hours later.\n *\n * Front it with the {@link memory} factory — callers never `new` it.\n */\nclass MemoryInterruptStore implements InterruptStore {\n /** Pending interrupts keyed by their own `interruptId`. */\n private readonly interrupts = new Map<string, PendingInterrupt>();\n\n /**\n * Persist a pending interrupt, keyed by its own `interruptId`.\n * Overwrites any prior record for the same id — a call has exactly one\n * live interrupt, so a re-save replaces rather than appends.\n */\n public async save(record: PendingInterrupt): Promise<void> {\n this.interrupts.set(record.interruptId, record);\n }\n\n /**\n * Return the interrupt for an `interruptId`, or `undefined` when none is\n * recorded (never raised, or already resolved + deleted).\n */\n public async load(\n interruptId: string,\n ): Promise<PendingInterrupt | undefined> {\n return this.interrupts.get(interruptId);\n }\n\n /**\n * Drop the interrupt for an `interruptId`. Idempotent — deleting an\n * absent id is a no-op.\n */\n public async delete(interruptId: string): Promise<void> {\n this.interrupts.delete(interruptId);\n }\n\n /**\n * List the interrupt ids the store knows, optionally filtered by a\n * prefix. Returns a fresh array each call so a caller can mutate it\n * freely without touching the backing index.\n */\n public async list(prefix?: string): Promise<string[]> {\n const ids = [...this.interrupts.keys()];\n\n if (prefix === undefined) {\n return ids;\n }\n\n return ids.filter((id) => id.startsWith(prefix));\n }\n\n /**\n * The memory store has no backing table — there is nothing to migrate.\n * Returns an empty string so callers can treat `schema()` uniformly\n * across drivers.\n */\n public schema(): string {\n return \"\";\n }\n}\n\n/**\n * Create an in-memory {@link InterruptStore}. Zero-config — no client, no\n * connection. Suitable for dev, tests, and single-process apps whose\n * approval flow stays interactive and doesn't need resume across\n * restarts.\n *\n * @example\n * import { ai } from \"@warlock.js/ai\";\n *\n * const store = ai.human.interrupt.memory();\n *\n * const agent = ai.agent({\n * model,\n * tools: [deleteAccount],\n * middleware: [\n * ai.human.approval({\n * policy: { type: \"allowlist\", tools: [\"deleteAccount\"] },\n * store,\n * handler,\n * }),\n * ],\n * });\n */\nexport function memory(): InterruptStore {\n return new MemoryInterruptStore();\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,IAAM,uBAAN,MAAqD;;oCAErB,IAAI,IAA8B;;;;;;;CAOhE,MAAa,KAAK,QAAyC;EACzD,KAAK,WAAW,IAAI,OAAO,aAAa,MAAM;CAChD;;;;;CAMA,MAAa,KACX,aACuC;EACvC,OAAO,KAAK,WAAW,IAAI,WAAW;CACxC;;;;;CAMA,MAAa,OAAO,aAAoC;EACtD,KAAK,WAAW,OAAO,WAAW;CACpC;;;;;;CAOA,MAAa,KAAK,QAAoC;EACpD,MAAM,MAAM,CAAC,GAAG,KAAK,WAAW,KAAK,CAAC;EAEtC,IAAI,WAAW,QACb,OAAO;EAGT,OAAO,IAAI,QAAQ,OAAO,GAAG,WAAW,MAAM,CAAC;CACjD;;;;;;CAOA,AAAO,SAAiB;EACtB,OAAO;CACT;AACF;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,SAAyB;CACvC,OAAO,IAAI,qBAAqB;AAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"pg.d.mts","names":[],"sources":["../../../../../../../../ai/src/human/stores/pg.ts"],"mappings":";;;;;AAsBA;;;;;;;;;AAWO;AA0TP;;;;UArUiB,kBAAA;EAqUE;EAnUjB,MAAA,GAAS,YAAY;EAmUwC;EAhU7D,gBAAA;;;;;EAMA,KAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0Tc,EAAA,CAAG,OAAA,EAAS,kBAAA,GAAqB,cAAc"}
|
package/esm/human/stores/pg.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/human/stores/pg.ts"],"sourcesContent":["import type {\n InterruptStore,\n PendingInterrupt,\n PgClientLike,\n} from \"../contracts/interrupt-store.contract\";\n\n/**\n * Options for the Postgres {@link InterruptStore}.\n *\n * Two mutually-supportive ways to supply the connection:\n * - **`client`** — pass an already-built `pg.Pool` / `pg.Client` (anything\n * satisfying {@link PgClientLike}). The store only ever calls `query`\n * and never opens or closes it; a single pool can back both an\n * orchestrator's checkpoint/snapshot stores and this interrupt table.\n * - **`connectionString`** — let the store lazily `import(\"pg\")` and build\n * its own `Pool`. `@warlock.js/ai` takes **no** hard dependency on\n * `pg` (it is an optional peer); when it is absent the store throws a\n * curated install string at first use, never a raw module-resolution\n * stack trace at import.\n *\n * Exactly one of the two must be present.\n */\nexport interface PgInterruptOptions {\n /** An already-built `pg.Pool` / `pg.Client` — anything matching {@link PgClientLike}. */\n client?: PgClientLike;\n\n /** Connection string the store passes to a lazily-imported `pg.Pool`. */\n connectionString?: string;\n\n /**\n * Backing table name. Defaults to `warlock_ai_human_interrupts`. Must be\n * a safe SQL identifier — it is interpolated into DDL/DML.\n */\n table?: string;\n}\n\n/**\n * Default backing table — provisions the store with no extra config when\n * the dev runs {@link InterruptStore.schema} through their migration tool.\n */\nconst DEFAULT_TABLE = \"warlock_ai_human_interrupts\";\n\n/**\n * Allowed characters in a Postgres identifier (table name). The table name\n * is interpolated into DDL/DML, so anything outside this conservative\n * ASCII subset is rejected — interpolating an arbitrary string would be a\n * SQL-injection footgun (mirrors `@warlock.js/ai`'s pg stores).\n */\nconst SAFE_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/**\n * Module specifier for the optional `pg` driver. Held in a `string`\n * variable so the dynamic `import()` is not statically resolved at\n * compile time — `pg` is an optional peer that need not be installed for\n * this package to type-check or for a memory-only consumer to run.\n */\nconst PG_MODULE = \"pg\";\n\n/**\n * Curated install string surfaced (at use time) when a `connectionString`\n * is configured but the optional `pg` driver is absent. Never thrown at\n * import — a memory-only consumer must be able to load this module.\n */\nconst PG_INSTALL_INSTRUCTIONS = `\nThe @warlock.js/ai Postgres interrupt store requires the pg package.\nInstall it with:\n\n npm install pg\n\nOr with your preferred package manager:\n\n pnpm add pg\n yarn add pg\n`.trim();\n\n/**\n * Minimal structural view of a `pg.Pool` constructor — just enough of the\n * `pg` module surface for the store to build a client when handed a\n * `connectionString`. Declared locally (rather than `typeof import(\"pg\")`)\n * so this module type-checks even when `pg` is not installed.\n */\ninterface PgModuleLike {\n Pool: new (config: { connectionString: string }) => PgClientLike;\n}\n\n/**\n * Lazily import `pg` and return a `Pool` built from `connectionString`. A\n * bare `catch` rethrows the curated install string — a missing optional\n * peer surfaces as actionable guidance, never a raw resolution error.\n */\nasync function buildPgClient(connectionString: string): Promise<PgClientLike> {\n let sdk: PgModuleLike;\n\n try {\n sdk = (await import(PG_MODULE)) as unknown as PgModuleLike;\n } catch {\n throw new Error(PG_INSTALL_INSTRUCTIONS);\n }\n\n return new sdk.Pool({ connectionString });\n}\n\n/**\n * Coerce a Postgres timestamp/text column to an ISO string. `pg` returns\n * `TIMESTAMPTZ` as a `Date`; normalize to the ISO wire shape the\n * {@link PendingInterrupt} contract declares.\n */\nfunction toIso(value: unknown): string {\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n return value as string;\n}\n\n/**\n * Map a raw DB row to a {@link PendingInterrupt}. Column names match the\n * reference DDL 1:1; the `request` JSONB rides one column, so it is parsed\n * defensively (node-postgres parses `JSONB` already, but some pool\n * wrappers hand back the raw string).\n */\nfunction rowToRecord(row: Record<string, unknown>): PendingInterrupt {\n const request =\n typeof row.request === \"string\" ? JSON.parse(row.request) : row.request;\n\n return {\n interruptId: row.interrupt_id as string,\n request: request as PendingInterrupt[\"request\"],\n status: row.status as PendingInterrupt[\"status\"],\n savedAt: toIso(row.saved_at),\n };\n}\n\n/**\n * Postgres-backed {@link InterruptStore} — one durable row per pending\n * interrupt, keyed by `interrupt_id`.\n *\n * Owns: durable round-tripping of the {@link PendingInterrupt} envelope so\n * a reviewer can rule out-of-process (a webhook approves hours later, in a\n * different process), the reference DDL via {@link PgInterruptStore.schema},\n * and prefix-filtered enumeration. Does NOT own: the connection lifecycle\n * (a dev-supplied client is never closed; a store-built `Pool` from a\n * `connectionString` is also left open for the process to reuse) or schema\n * migration (the dev runs `schema()` through their own tool — never\n * auto-migrated).\n *\n * Like the snapshot store, a call has exactly one live interrupt, so\n * `save()` upserts on the `interrupt_id` primary key.\n *\n * Front it with the {@link pg} factory — callers never `new` it.\n */\nclass PgInterruptStore implements InterruptStore {\n /** Validated backing table name, safe to interpolate into SQL. */\n private readonly table: string;\n\n /**\n * A ready client, or a promise resolving to one the store builds lazily\n * from a `connectionString`. Resolved once and memoized so the optional\n * `pg` import happens at most once.\n */\n private clientPromise: Promise<PgClientLike>;\n\n public constructor(options: PgInterruptOptions) {\n const table = options.table ?? DEFAULT_TABLE;\n\n if (!SAFE_IDENTIFIER.test(table)) {\n throw new TypeError(\n `ai.human.interrupt.pg: invalid table name '${table}'. Allowed: [A-Za-z_][A-Za-z0-9_]*.`,\n );\n }\n\n this.table = table;\n\n if (options.client) {\n if (typeof options.client.query !== \"function\") {\n throw new TypeError(\n \"ai.human.interrupt.pg requires a 'client' option implementing { query(text, params) } — pass a pg.Pool or pg.Client.\",\n );\n }\n\n this.clientPromise = Promise.resolve(options.client);\n\n return;\n }\n\n if (options.connectionString) {\n // Defer the optional `pg` import to first use — a curated install\n // string surfaces from `buildPgClient`, not at construction.\n this.clientPromise = buildPgClient(options.connectionString);\n\n return;\n }\n\n throw new TypeError(\n \"ai.human.interrupt.pg requires either a 'client' or a 'connectionString' option.\",\n );\n }\n\n /**\n * Resolve the backing client, surfacing the lazy `pg` import's curated\n * install string on the first call that needs it.\n */\n private client(): Promise<PgClientLike> {\n return this.clientPromise;\n }\n\n /**\n * Persist a pending interrupt, keyed by its own `interrupt_id`. Upserts\n * — a call has exactly one live interrupt, so a second save for the same\n * id overwrites the payload rather than appending.\n */\n public async save(record: PendingInterrupt): Promise<void> {\n const client = await this.client();\n\n await client.query(\n `INSERT INTO ${this.table} (interrupt_id, request, status, saved_at)\n VALUES ($1, $2::jsonb, $3, $4)\n ON CONFLICT (interrupt_id) DO UPDATE\n SET request = EXCLUDED.request,\n status = EXCLUDED.status,\n saved_at = EXCLUDED.saved_at`,\n [\n record.interruptId,\n JSON.stringify(record.request),\n record.status,\n record.savedAt,\n ],\n );\n }\n\n /**\n * Load the interrupt for an `interruptId`, or `undefined` when none is\n * recorded.\n */\n public async load(\n interruptId: string,\n ): Promise<PendingInterrupt | undefined> {\n const client = await this.client();\n\n const { rows } = await client.query(\n `SELECT interrupt_id, request, status, saved_at\n FROM ${this.table}\n WHERE interrupt_id = $1`,\n [interruptId],\n );\n\n if (rows.length === 0) {\n return undefined;\n }\n\n return rowToRecord(rows[0] as Record<string, unknown>);\n }\n\n /**\n * Drop the interrupt for an `interruptId`. Idempotent — deleting an\n * absent id deletes zero rows.\n */\n public async delete(interruptId: string): Promise<void> {\n const client = await this.client();\n\n await client.query(\n `DELETE FROM ${this.table} WHERE interrupt_id = $1`,\n [interruptId],\n );\n }\n\n /**\n * List the interrupt ids known to the store, optionally filtered by a\n * prefix. The `_` and `%` LIKE wildcards in the prefix are escaped so an\n * opaque interruptId that happens to contain them is matched literally.\n */\n public async list(prefix?: string): Promise<string[]> {\n const client = await this.client();\n\n if (prefix === undefined) {\n const { rows } = await client.query(\n `SELECT interrupt_id FROM ${this.table}`,\n );\n\n return rows.map(\n (row) => (row as Record<string, unknown>).interrupt_id as string,\n );\n }\n\n const escaped = prefix\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/_/g, \"\\\\_\")\n .replace(/%/g, \"\\\\%\");\n\n const { rows } = await client.query(\n `SELECT interrupt_id FROM ${this.table}\n WHERE interrupt_id LIKE $1 ESCAPE '\\\\'`,\n [`${escaped}%`],\n );\n\n return rows.map(\n (row) => (row as Record<string, unknown>).interrupt_id as string,\n );\n }\n\n /**\n * Return the reference DDL for this store's backing table, interpolating\n * the configured table name. The dev runs it through their migration\n * tool — the framework never auto-migrates.\n *\n * @example\n * await pool.query(store.schema());\n */\n public schema(): string {\n return [\n `CREATE TABLE IF NOT EXISTS ${this.table} (`,\n ` interrupt_id TEXT PRIMARY KEY,`,\n ` request JSONB NOT NULL,`,\n ` status TEXT NOT NULL,`,\n ` saved_at TIMESTAMPTZ NOT NULL DEFAULT now()`,\n `);`,\n `CREATE INDEX IF NOT EXISTS idx_${this.table}_saved_at`,\n ` ON ${this.table} (saved_at);`,\n ].join(\"\\n\");\n }\n}\n\n/**\n * Create a Postgres-backed {@link InterruptStore}. Either pass a live\n * `pg.Pool` / `pg.Client` (`{ client }`) — `@warlock.js/ai` never\n * imports `pg` in that case — or a `{ connectionString }` and let the\n * store lazily `import(\"pg\")` to build its own pool. When `pg` is not\n * installed, the curated install string surfaces on first use, never at\n * import. Run {@link InterruptStore.schema} through your migration tool\n * once before use; the store never auto-migrates.\n *\n * @example\n * import { Pool } from \"pg\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * const pool = new Pool({ connectionString: process.env.DATABASE_URL });\n * const store = ai.human.interrupt.pg({ client: pool });\n *\n * // Once, via your migration tooling:\n * // await pool.query(store.schema());\n *\n * @example\n * // Let the store build its own pool from a connection string:\n * const store = ai.human.interrupt.pg({\n * connectionString: process.env.DATABASE_URL,\n * });\n */\nexport function pg(options: PgInterruptOptions): InterruptStore {\n return new PgInterruptStore(options);\n}\n"],"mappings":";;;;;AAwCA,MAAM,gBAAgB;;;;;;;AAQtB,MAAM,kBAAkB;;;;;;;AAQxB,MAAM,YAAY;;;;;;AAOlB,MAAM,0BAA0B;;;;;;;;;;EAU9B,KAAK;;;;;;AAiBP,eAAe,cAAc,kBAAiD;CAC5E,IAAI;CAEJ,IAAI;EACF,MAAO,MAAM,OAAO;CACtB,QAAQ;EACN,MAAM,IAAI,MAAM,uBAAuB;CACzC;CAEA,OAAO,IAAI,IAAI,KAAK,EAAE,iBAAiB,CAAC;AAC1C;;;;;;AAOA,SAAS,MAAM,OAAwB;CACrC,IAAI,iBAAiB,MACnB,OAAO,MAAM,YAAY;CAG3B,OAAO;AACT;;;;;;;AAQA,SAAS,YAAY,KAAgD;CACnE,MAAM,UACJ,OAAO,IAAI,YAAY,WAAW,KAAK,MAAM,IAAI,OAAO,IAAI,IAAI;CAElE,OAAO;EACL,aAAa,IAAI;EACR;EACT,QAAQ,IAAI;EACZ,SAAS,MAAM,IAAI,QAAQ;CAC7B;AACF;;;;;;;;;;;;;;;;;;;AAoBA,IAAM,mBAAN,MAAiD;CAW/C,AAAO,YAAY,SAA6B;EAC9C,MAAM,QAAQ,QAAQ,SAAS;EAE/B,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAC7B,MAAM,IAAI,UACR,8CAA8C,MAAM,oCACtD;EAGF,KAAK,QAAQ;EAEb,IAAI,QAAQ,QAAQ;GAClB,IAAI,OAAO,QAAQ,OAAO,UAAU,YAClC,MAAM,IAAI,UACR,sHACF;GAGF,KAAK,gBAAgB,QAAQ,QAAQ,QAAQ,MAAM;GAEnD;EACF;EAEA,IAAI,QAAQ,kBAAkB;GAG5B,KAAK,gBAAgB,cAAc,QAAQ,gBAAgB;GAE3D;EACF;EAEA,MAAM,IAAI,UACR,kFACF;CACF;;;;;CAMA,AAAQ,SAAgC;EACtC,OAAO,KAAK;CACd;;;;;;CAOA,MAAa,KAAK,QAAyC;EAGzD,OAAM,MAFe,KAAK,OAAO,EAErB,CAAC,MACX,eAAe,KAAK,MAAM;;;;;4CAM1B;GACE,OAAO;GACP,KAAK,UAAU,OAAO,OAAO;GAC7B,OAAO;GACP,OAAO;EACT,CACF;CACF;;;;;CAMA,MAAa,KACX,aACuC;EAGvC,MAAM,EAAE,SAAS,OAAM,MAFF,KAAK,OAAO,EAEJ,CAAC,MAC5B;cACQ,KAAK,MAAM;iCAEnB,CAAC,WAAW,CACd;EAEA,IAAI,KAAK,WAAW,GAClB;EAGF,OAAO,YAAY,KAAK,EAA6B;CACvD;;;;;CAMA,MAAa,OAAO,aAAoC;EAGtD,OAAM,MAFe,KAAK,OAAO,EAErB,CAAC,MACX,eAAe,KAAK,MAAM,2BAC1B,CAAC,WAAW,CACd;CACF;;;;;;CAOA,MAAa,KAAK,QAAoC;EACpD,MAAM,SAAS,MAAM,KAAK,OAAO;EAEjC,IAAI,WAAW,QAAW;GACxB,MAAM,EAAE,SAAS,MAAM,OAAO,MAC5B,4BAA4B,KAAK,OACnC;GAEA,OAAO,KAAK,KACT,QAAS,IAAgC,YAC5C;EACF;EAEA,MAAM,UAAU,OACb,QAAQ,OAAO,MAAM,CAAC,CACtB,QAAQ,MAAM,KAAK,CAAC,CACpB,QAAQ,MAAM,KAAK;EAEtB,MAAM,EAAE,SAAS,MAAM,OAAO,MAC5B,4BAA4B,KAAK,MAAM;gDAEvC,CAAC,GAAG,QAAQ,EAAE,CAChB;EAEA,OAAO,KAAK,KACT,QAAS,IAAgC,YAC5C;CACF;;;;;;;;;CAUA,AAAO,SAAiB;EACtB,OAAO;GACL,8BAA8B,KAAK,MAAM;GACzC;GACA;GACA;GACA;GACA;GACA,kCAAkC,KAAK,MAAM;GAC7C,QAAQ,KAAK,MAAM;EACrB,CAAC,CAAC,KAAK,IAAI;CACb;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,GAAG,SAA6C;CAC9D,OAAO,IAAI,iBAAiB,OAAO;AACrC"}
|
|
1
|
+
{"version":3,"file":"pg.mjs","names":[],"sources":["../../../../../../../../ai/src/human/stores/pg.ts"],"sourcesContent":["import type {\n InterruptStore,\n PendingInterrupt,\n PgClientLike,\n} from \"../contracts/interrupt-store.contract\";\n\n/**\n * Options for the Postgres {@link InterruptStore}.\n *\n * Two mutually-supportive ways to supply the connection:\n * - **`client`** — pass an already-built `pg.Pool` / `pg.Client` (anything\n * satisfying {@link PgClientLike}). The store only ever calls `query`\n * and never opens or closes it; a single pool can back both an\n * orchestrator's checkpoint/snapshot stores and this interrupt table.\n * - **`connectionString`** — let the store lazily `import(\"pg\")` and build\n * its own `Pool`. `@warlock.js/ai` takes **no** hard dependency on\n * `pg` (it is an optional peer); when it is absent the store throws a\n * curated install string at first use, never a raw module-resolution\n * stack trace at import.\n *\n * Exactly one of the two must be present.\n */\nexport interface PgInterruptOptions {\n /** An already-built `pg.Pool` / `pg.Client` — anything matching {@link PgClientLike}. */\n client?: PgClientLike;\n\n /** Connection string the store passes to a lazily-imported `pg.Pool`. */\n connectionString?: string;\n\n /**\n * Backing table name. Defaults to `warlock_ai_human_interrupts`. Must be\n * a safe SQL identifier — it is interpolated into DDL/DML.\n */\n table?: string;\n}\n\n/**\n * Default backing table — provisions the store with no extra config when\n * the dev runs {@link InterruptStore.schema} through their migration tool.\n */\nconst DEFAULT_TABLE = \"warlock_ai_human_interrupts\";\n\n/**\n * Allowed characters in a Postgres identifier (table name). The table name\n * is interpolated into DDL/DML, so anything outside this conservative\n * ASCII subset is rejected — interpolating an arbitrary string would be a\n * SQL-injection footgun (mirrors `@warlock.js/ai`'s pg stores).\n */\nconst SAFE_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/**\n * Module specifier for the optional `pg` driver. Held in a `string`\n * variable so the dynamic `import()` is not statically resolved at\n * compile time — `pg` is an optional peer that need not be installed for\n * this package to type-check or for a memory-only consumer to run.\n */\nconst PG_MODULE = \"pg\";\n\n/**\n * Curated install string surfaced (at use time) when a `connectionString`\n * is configured but the optional `pg` driver is absent. Never thrown at\n * import — a memory-only consumer must be able to load this module.\n */\nconst PG_INSTALL_INSTRUCTIONS = `\nThe @warlock.js/ai Postgres interrupt store requires the pg package.\nInstall it with:\n\n npm install pg\n\nOr with your preferred package manager:\n\n pnpm add pg\n yarn add pg\n`.trim();\n\n/**\n * Minimal structural view of a `pg.Pool` constructor — just enough of the\n * `pg` module surface for the store to build a client when handed a\n * `connectionString`. Declared locally (rather than `typeof import(\"pg\")`)\n * so this module type-checks even when `pg` is not installed.\n */\ninterface PgModuleLike {\n Pool: new (config: { connectionString: string }) => PgClientLike;\n}\n\n/**\n * Lazily import `pg` and return a `Pool` built from `connectionString`. A\n * bare `catch` rethrows the curated install string — a missing optional\n * peer surfaces as actionable guidance, never a raw resolution error.\n */\nasync function buildPgClient(connectionString: string): Promise<PgClientLike> {\n let sdk: PgModuleLike;\n\n try {\n sdk = (await import(PG_MODULE)) as unknown as PgModuleLike;\n } catch {\n throw new Error(PG_INSTALL_INSTRUCTIONS);\n }\n\n return new sdk.Pool({ connectionString });\n}\n\n/**\n * Coerce a Postgres timestamp/text column to an ISO string. `pg` returns\n * `TIMESTAMPTZ` as a `Date`; normalize to the ISO wire shape the\n * {@link PendingInterrupt} contract declares.\n */\nfunction toIso(value: unknown): string {\n if (value instanceof Date) {\n return value.toISOString();\n }\n\n return value as string;\n}\n\n/**\n * Map a raw DB row to a {@link PendingInterrupt}. Column names match the\n * reference DDL 1:1; the `request` JSONB rides one column, so it is parsed\n * defensively (node-postgres parses `JSONB` already, but some pool\n * wrappers hand back the raw string).\n */\nfunction rowToRecord(row: Record<string, unknown>): PendingInterrupt {\n const request =\n typeof row.request === \"string\" ? JSON.parse(row.request) : row.request;\n\n return {\n interruptId: row.interrupt_id as string,\n request: request as PendingInterrupt[\"request\"],\n status: row.status as PendingInterrupt[\"status\"],\n savedAt: toIso(row.saved_at),\n };\n}\n\n/**\n * Postgres-backed {@link InterruptStore} — one durable row per pending\n * interrupt, keyed by `interrupt_id`.\n *\n * Owns: durable round-tripping of the {@link PendingInterrupt} envelope so\n * a reviewer can rule out-of-process (a webhook approves hours later, in a\n * different process), the reference DDL via {@link PgInterruptStore.schema},\n * and prefix-filtered enumeration. Does NOT own: the connection lifecycle\n * (a dev-supplied client is never closed; a store-built `Pool` from a\n * `connectionString` is also left open for the process to reuse) or schema\n * migration (the dev runs `schema()` through their own tool — never\n * auto-migrated).\n *\n * Like the snapshot store, a call has exactly one live interrupt, so\n * `save()` upserts on the `interrupt_id` primary key.\n *\n * Front it with the {@link pg} factory — callers never `new` it.\n */\nclass PgInterruptStore implements InterruptStore {\n /** Validated backing table name, safe to interpolate into SQL. */\n private readonly table: string;\n\n /**\n * A ready client, or a promise resolving to one the store builds lazily\n * from a `connectionString`. Resolved once and memoized so the optional\n * `pg` import happens at most once.\n */\n private clientPromise: Promise<PgClientLike>;\n\n public constructor(options: PgInterruptOptions) {\n const table = options.table ?? DEFAULT_TABLE;\n\n if (!SAFE_IDENTIFIER.test(table)) {\n throw new TypeError(\n `ai.human.interrupt.pg: invalid table name '${table}'. Allowed: [A-Za-z_][A-Za-z0-9_]*.`,\n );\n }\n\n this.table = table;\n\n if (options.client) {\n if (typeof options.client.query !== \"function\") {\n throw new TypeError(\n \"ai.human.interrupt.pg requires a 'client' option implementing { query(text, params) } — pass a pg.Pool or pg.Client.\",\n );\n }\n\n this.clientPromise = Promise.resolve(options.client);\n\n return;\n }\n\n if (options.connectionString) {\n // Defer the optional `pg` import to first use — a curated install\n // string surfaces from `buildPgClient`, not at construction.\n this.clientPromise = buildPgClient(options.connectionString);\n\n return;\n }\n\n throw new TypeError(\n \"ai.human.interrupt.pg requires either a 'client' or a 'connectionString' option.\",\n );\n }\n\n /**\n * Resolve the backing client, surfacing the lazy `pg` import's curated\n * install string on the first call that needs it.\n */\n private client(): Promise<PgClientLike> {\n return this.clientPromise;\n }\n\n /**\n * Persist a pending interrupt, keyed by its own `interrupt_id`. Upserts\n * — a call has exactly one live interrupt, so a second save for the same\n * id overwrites the payload rather than appending.\n */\n public async save(record: PendingInterrupt): Promise<void> {\n const client = await this.client();\n\n await client.query(\n `INSERT INTO ${this.table} (interrupt_id, request, status, saved_at)\n VALUES ($1, $2::jsonb, $3, $4)\n ON CONFLICT (interrupt_id) DO UPDATE\n SET request = EXCLUDED.request,\n status = EXCLUDED.status,\n saved_at = EXCLUDED.saved_at`,\n [\n record.interruptId,\n JSON.stringify(record.request),\n record.status,\n record.savedAt,\n ],\n );\n }\n\n /**\n * Load the interrupt for an `interruptId`, or `undefined` when none is\n * recorded.\n */\n public async load(\n interruptId: string,\n ): Promise<PendingInterrupt | undefined> {\n const client = await this.client();\n\n const { rows } = await client.query(\n `SELECT interrupt_id, request, status, saved_at\n FROM ${this.table}\n WHERE interrupt_id = $1`,\n [interruptId],\n );\n\n if (rows.length === 0) {\n return undefined;\n }\n\n return rowToRecord(rows[0] as Record<string, unknown>);\n }\n\n /**\n * Drop the interrupt for an `interruptId`. Idempotent — deleting an\n * absent id deletes zero rows.\n */\n public async delete(interruptId: string): Promise<void> {\n const client = await this.client();\n\n await client.query(\n `DELETE FROM ${this.table} WHERE interrupt_id = $1`,\n [interruptId],\n );\n }\n\n /**\n * List the interrupt ids known to the store, optionally filtered by a\n * prefix. The `_` and `%` LIKE wildcards in the prefix are escaped so an\n * opaque interruptId that happens to contain them is matched literally.\n */\n public async list(prefix?: string): Promise<string[]> {\n const client = await this.client();\n\n if (prefix === undefined) {\n const { rows } = await client.query(\n `SELECT interrupt_id FROM ${this.table}`,\n );\n\n return rows.map(\n (row) => (row as Record<string, unknown>).interrupt_id as string,\n );\n }\n\n const escaped = prefix\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/_/g, \"\\\\_\")\n .replace(/%/g, \"\\\\%\");\n\n const { rows } = await client.query(\n `SELECT interrupt_id FROM ${this.table}\n WHERE interrupt_id LIKE $1 ESCAPE '\\\\'`,\n [`${escaped}%`],\n );\n\n return rows.map(\n (row) => (row as Record<string, unknown>).interrupt_id as string,\n );\n }\n\n /**\n * Return the reference DDL for this store's backing table, interpolating\n * the configured table name. The dev runs it through their migration\n * tool — the framework never auto-migrates.\n *\n * @example\n * await pool.query(store.schema());\n */\n public schema(): string {\n return [\n `CREATE TABLE IF NOT EXISTS ${this.table} (`,\n ` interrupt_id TEXT PRIMARY KEY,`,\n ` request JSONB NOT NULL,`,\n ` status TEXT NOT NULL,`,\n ` saved_at TIMESTAMPTZ NOT NULL DEFAULT now()`,\n `);`,\n `CREATE INDEX IF NOT EXISTS idx_${this.table}_saved_at`,\n ` ON ${this.table} (saved_at);`,\n ].join(\"\\n\");\n }\n}\n\n/**\n * Create a Postgres-backed {@link InterruptStore}. Either pass a live\n * `pg.Pool` / `pg.Client` (`{ client }`) — `@warlock.js/ai` never\n * imports `pg` in that case — or a `{ connectionString }` and let the\n * store lazily `import(\"pg\")` to build its own pool. When `pg` is not\n * installed, the curated install string surfaces on first use, never at\n * import. Run {@link InterruptStore.schema} through your migration tool\n * once before use; the store never auto-migrates.\n *\n * @example\n * import { Pool } from \"pg\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * const pool = new Pool({ connectionString: process.env.DATABASE_URL });\n * const store = ai.human.interrupt.pg({ client: pool });\n *\n * // Once, via your migration tooling:\n * // await pool.query(store.schema());\n *\n * @example\n * // Let the store build its own pool from a connection string:\n * const store = ai.human.interrupt.pg({\n * connectionString: process.env.DATABASE_URL,\n * });\n */\nexport function pg(options: PgInterruptOptions): InterruptStore {\n return new PgInterruptStore(options);\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"redis.d.mts","names":[],"sources":["../../../../../../../../ai/src/human/stores/redis.ts"],"mappings":";;;;;AAqBA;;;;;;;;;AAYQ;AA+RR;;;UA3SiB,qBAAA;EA2Sc;EAzS7B,MAAA,GAAS,eAAe;EAyS6B;EAtSrD,GAAA;EAsSmE;;;;;EA/RnE,MAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;iBA+Rc,KAAA,CAAM,OAAA,EAAS,qBAAA,GAAwB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.mjs","names":[],"sources":["../../../../../../../../@warlock.js/ai/src/human/stores/redis.ts"],"sourcesContent":["import type {\n InterruptStore,\n PendingInterrupt,\n RedisClientLike,\n} from \"../contracts/interrupt-store.contract\";\n\n/**\n * Options for the Redis {@link InterruptStore}.\n *\n * Two mutually-supportive ways to supply the connection:\n * - **`client`** — pass an already-connected `redis` client (anything\n * satisfying {@link RedisClientLike}). The store only calls\n * `get` / `set` / `del` and never connects or quits it.\n * - **`url`** — let the store lazily `import(\"redis\")`, build a client\n * from the url, and connect it. `@warlock.js/ai` takes **no** hard\n * dependency on `redis` (it is an optional peer); when it is absent the\n * store throws a curated install string at first use, never a raw\n * module-resolution stack trace at import.\n *\n * Exactly one of the two must be present.\n */\nexport interface RedisInterruptOptions {\n /** An already-connected `redis` client — anything matching {@link RedisClientLike}. */\n client?: RedisClientLike;\n\n /** Connection url the store passes to a lazily-imported `createClient`. */\n url?: string;\n\n /**\n * Key prefix prepended to every key this store writes. Lets one Redis\n * database back multiple stores without collision. Defaults to\n * `warlock:ai-human:interrupt:`.\n */\n prefix?: string;\n}\n\n/**\n * Default key prefix — namespaces the store's keys inside a shared Redis\n * database so interrupt records coexist with other data without collision.\n */\nconst DEFAULT_PREFIX = \"warlock:ai-human:interrupt:\";\n\n/**\n * Index key (under the configured prefix) holding the JSON array of live\n * interrupt ids. The structural {@link RedisClientLike} surface exposes no\n * `SCAN` / `KEYS`, so enumeration for `list()` is self-maintained.\n */\nconst INDEX_SUFFIX = \"index\";\n\n/**\n * Module specifier for the optional `redis` driver. Held in a `string`\n * variable so the dynamic `import()` is not statically resolved at compile\n * time — `redis` is an optional peer that need not be installed for this\n * package to type-check or for a memory-only consumer to run.\n */\nconst REDIS_MODULE = \"redis\";\n\n/**\n * Curated install string surfaced (at use time) when a `url` is configured\n * but the optional `redis` driver is absent. Never thrown at import — a\n * memory-only consumer must be able to load this module.\n */\nconst REDIS_INSTALL_INSTRUCTIONS = `\nThe @warlock.js/ai Redis interrupt store requires the redis package.\nInstall it with:\n\n npm install redis\n\nOr with your preferred package manager:\n\n pnpm add redis\n yarn add redis\n`.trim();\n\n/**\n * Minimal structural view of the `redis` module surface — just enough to\n * build and connect a client from a url. Declared locally (rather than\n * `typeof import(\"redis\")`) so this module type-checks even when `redis`\n * is not installed.\n */\ninterface RedisModuleLike {\n createClient(config: {\n url: string;\n }): RedisClientLike & { connect(): Promise<unknown> };\n}\n\n/**\n * Lazily import `redis`, build a client from `url`, and connect it. A bare\n * `catch` rethrows the curated install string — a missing optional peer\n * surfaces as actionable guidance, never a raw resolution error.\n */\nasync function buildRedisClient(url: string): Promise<RedisClientLike> {\n let sdk: RedisModuleLike;\n\n try {\n sdk = (await import(REDIS_MODULE)) as unknown as RedisModuleLike;\n } catch {\n throw new Error(REDIS_INSTALL_INSTRUCTIONS);\n }\n\n const client = sdk.createClient({ url });\n await client.connect();\n\n return client;\n}\n\n/**\n * Redis-backed {@link InterruptStore} — one JSON string value per pending\n * interrupt, under a namespaced key, plus a self-maintained id index so\n * `list()` works without `SCAN`/`KEYS`.\n *\n * Owns: durable round-tripping of the {@link PendingInterrupt} envelope so\n * a reviewer can rule out-of-process, the namespaced key layout, and the\n * per-store id index that backs enumeration. Does NOT own: durability\n * guarantees beyond Redis's own, the connection lifecycle (a dev-supplied\n * client is never disconnected; a store-built client from a `url` is left\n * connected for the process to reuse), or migration —\n * {@link RedisInterruptStore.schema} returns an empty string.\n *\n * A call has exactly one live interrupt, so `save()` overwrites the key.\n *\n * Front it with the {@link redis} factory — callers never `new` it.\n */\nclass RedisInterruptStore implements InterruptStore {\n /** Key prefix namespacing every key this store writes. */\n private readonly prefix: string;\n\n /**\n * A ready client, or a promise resolving to one the store builds lazily\n * from a `url`. Resolved once and memoized so the optional `redis`\n * import + connect happens at most once.\n */\n private clientPromise: Promise<RedisClientLike>;\n\n public constructor(options: RedisInterruptOptions) {\n this.prefix = options.prefix ?? DEFAULT_PREFIX;\n\n if (options.client) {\n if (\n typeof options.client.get !== \"function\" ||\n typeof options.client.set !== \"function\" ||\n typeof options.client.del !== \"function\"\n ) {\n throw new TypeError(\n \"ai.human.interrupt.redis requires a 'client' option implementing { get, set, del } — pass a connected redis client.\",\n );\n }\n\n this.clientPromise = Promise.resolve(options.client);\n\n return;\n }\n\n if (options.url) {\n // Defer the optional `redis` import to first use — a curated install\n // string surfaces from `buildRedisClient`, not at construction.\n this.clientPromise = buildRedisClient(options.url);\n\n return;\n }\n\n throw new TypeError(\n \"ai.human.interrupt.redis requires either a 'client' or a 'url' option.\",\n );\n }\n\n /**\n * Resolve the backing client, surfacing the lazy `redis` import's\n * curated install string on the first call that needs it.\n */\n private client(): Promise<RedisClientLike> {\n return this.clientPromise;\n }\n\n /**\n * Persist a pending interrupt, keyed by its own `interruptId`, and index\n * the id for enumeration. Overwrites any prior record for the same id —\n * a call has exactly one live interrupt.\n */\n public async save(record: PendingInterrupt): Promise<void> {\n const client = await this.client();\n\n await client.set(this.recordKey(record.interruptId), JSON.stringify(record));\n await this.indexId(record.interruptId);\n }\n\n /**\n * Load the interrupt for an `interruptId`, or `undefined` when the key is\n * missing. Redis returns `null` for an absent key — converted to\n * `undefined` at the boundary.\n */\n public async load(\n interruptId: string,\n ): Promise<PendingInterrupt | undefined> {\n const client = await this.client();\n const raw = await client.get(this.recordKey(interruptId));\n\n if (raw === null) {\n return undefined;\n }\n\n return JSON.parse(raw) as PendingInterrupt;\n }\n\n /**\n * Drop the interrupt for an `interruptId` and de-index its id. Idempotent\n * — deleting an absent id is a no-op.\n */\n public async delete(interruptId: string): Promise<void> {\n const client = await this.client();\n\n await client.del(this.recordKey(interruptId));\n await this.deindexId(interruptId);\n }\n\n /**\n * List the interrupt ids known to the store, optionally filtered by a\n * prefix. Reads the self-maintained index document.\n */\n public async list(prefix?: string): Promise<string[]> {\n const ids = await this.readIndex();\n\n if (prefix === undefined) {\n return ids;\n }\n\n return ids.filter((id) => id.startsWith(prefix));\n }\n\n /**\n * Redis needs no relational table — there is nothing to migrate. Returns\n * an empty string so callers can treat `schema()` uniformly across\n * drivers.\n */\n public schema(): string {\n return \"\";\n }\n\n /**\n * Read and parse the id index, defaulting to an empty list when absent.\n */\n private async readIndex(): Promise<string[]> {\n const client = await this.client();\n const raw = await client.get(this.indexKey());\n\n if (raw === null) {\n return [];\n }\n\n return JSON.parse(raw) as string[];\n }\n\n /**\n * Add an interrupt id to the index, no-op when already present.\n */\n private async indexId(interruptId: string): Promise<void> {\n const ids = await this.readIndex();\n\n if (ids.includes(interruptId)) {\n return;\n }\n\n ids.push(interruptId);\n\n const client = await this.client();\n await client.set(this.indexKey(), JSON.stringify(ids));\n }\n\n /**\n * Remove an interrupt id from the index, no-op when absent.\n */\n private async deindexId(interruptId: string): Promise<void> {\n const ids = await this.readIndex();\n const next = ids.filter((id) => id !== interruptId);\n\n if (next.length === ids.length) {\n return;\n }\n\n const client = await this.client();\n await client.set(this.indexKey(), JSON.stringify(next));\n }\n\n /**\n * Key for a single interrupt record — `<prefix><interruptId>`.\n */\n private recordKey(interruptId: string): string {\n return `${this.prefix}${interruptId}`;\n }\n\n /**\n * Key for the self-maintained id index — `<prefix>index`.\n */\n private indexKey(): string {\n return `${this.prefix}${INDEX_SUFFIX}`;\n }\n}\n\n/**\n * Create a Redis-backed {@link InterruptStore}. Either pass a connected\n * `redis` client (`{ client }`) — `@warlock.js/ai` never imports\n * `redis` in that case — or a `{ url }` and let the store lazily\n * `import(\"redis\")`, build, and connect a client. When `redis` is not\n * installed, the curated install string surfaces on first use, never at\n * import. {@link InterruptStore.schema} returns an empty string; Redis\n * needs no migration.\n *\n * @example\n * import { createClient } from \"redis\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * const client = createClient({ url: process.env.REDIS_URL });\n * await client.connect();\n *\n * const store = ai.human.interrupt.redis({ client });\n *\n * @example\n * // Let the store build + connect its own client from a url:\n * const store = ai.human.interrupt.redis({ url: process.env.REDIS_URL });\n */\nexport function redis(options: RedisInterruptOptions): InterruptStore {\n return new RedisInterruptStore(options);\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"redis.mjs","names":[],"sources":["../../../../../../../../ai/src/human/stores/redis.ts"],"sourcesContent":["import type {\n InterruptStore,\n PendingInterrupt,\n RedisClientLike,\n} from \"../contracts/interrupt-store.contract\";\n\n/**\n * Options for the Redis {@link InterruptStore}.\n *\n * Two mutually-supportive ways to supply the connection:\n * - **`client`** — pass an already-connected `redis` client (anything\n * satisfying {@link RedisClientLike}). The store only calls\n * `get` / `set` / `del` and never connects or quits it.\n * - **`url`** — let the store lazily `import(\"redis\")`, build a client\n * from the url, and connect it. `@warlock.js/ai` takes **no** hard\n * dependency on `redis` (it is an optional peer); when it is absent the\n * store throws a curated install string at first use, never a raw\n * module-resolution stack trace at import.\n *\n * Exactly one of the two must be present.\n */\nexport interface RedisInterruptOptions {\n /** An already-connected `redis` client — anything matching {@link RedisClientLike}. */\n client?: RedisClientLike;\n\n /** Connection url the store passes to a lazily-imported `createClient`. */\n url?: string;\n\n /**\n * Key prefix prepended to every key this store writes. Lets one Redis\n * database back multiple stores without collision. Defaults to\n * `warlock:ai-human:interrupt:`.\n */\n prefix?: string;\n}\n\n/**\n * Default key prefix — namespaces the store's keys inside a shared Redis\n * database so interrupt records coexist with other data without collision.\n */\nconst DEFAULT_PREFIX = \"warlock:ai-human:interrupt:\";\n\n/**\n * Index key (under the configured prefix) holding the JSON array of live\n * interrupt ids. The structural {@link RedisClientLike} surface exposes no\n * `SCAN` / `KEYS`, so enumeration for `list()` is self-maintained.\n */\nconst INDEX_SUFFIX = \"index\";\n\n/**\n * Module specifier for the optional `redis` driver. Held in a `string`\n * variable so the dynamic `import()` is not statically resolved at compile\n * time — `redis` is an optional peer that need not be installed for this\n * package to type-check or for a memory-only consumer to run.\n */\nconst REDIS_MODULE = \"redis\";\n\n/**\n * Curated install string surfaced (at use time) when a `url` is configured\n * but the optional `redis` driver is absent. Never thrown at import — a\n * memory-only consumer must be able to load this module.\n */\nconst REDIS_INSTALL_INSTRUCTIONS = `\nThe @warlock.js/ai Redis interrupt store requires the redis package.\nInstall it with:\n\n npm install redis\n\nOr with your preferred package manager:\n\n pnpm add redis\n yarn add redis\n`.trim();\n\n/**\n * Minimal structural view of the `redis` module surface — just enough to\n * build and connect a client from a url. Declared locally (rather than\n * `typeof import(\"redis\")`) so this module type-checks even when `redis`\n * is not installed.\n */\ninterface RedisModuleLike {\n createClient(config: {\n url: string;\n }): RedisClientLike & { connect(): Promise<unknown> };\n}\n\n/**\n * Lazily import `redis`, build a client from `url`, and connect it. A bare\n * `catch` rethrows the curated install string — a missing optional peer\n * surfaces as actionable guidance, never a raw resolution error.\n */\nasync function buildRedisClient(url: string): Promise<RedisClientLike> {\n let sdk: RedisModuleLike;\n\n try {\n sdk = (await import(REDIS_MODULE)) as unknown as RedisModuleLike;\n } catch {\n throw new Error(REDIS_INSTALL_INSTRUCTIONS);\n }\n\n const client = sdk.createClient({ url });\n await client.connect();\n\n return client;\n}\n\n/**\n * Redis-backed {@link InterruptStore} — one JSON string value per pending\n * interrupt, under a namespaced key, plus a self-maintained id index so\n * `list()` works without `SCAN`/`KEYS`.\n *\n * Owns: durable round-tripping of the {@link PendingInterrupt} envelope so\n * a reviewer can rule out-of-process, the namespaced key layout, and the\n * per-store id index that backs enumeration. Does NOT own: durability\n * guarantees beyond Redis's own, the connection lifecycle (a dev-supplied\n * client is never disconnected; a store-built client from a `url` is left\n * connected for the process to reuse), or migration —\n * {@link RedisInterruptStore.schema} returns an empty string.\n *\n * A call has exactly one live interrupt, so `save()` overwrites the key.\n *\n * Front it with the {@link redis} factory — callers never `new` it.\n */\nclass RedisInterruptStore implements InterruptStore {\n /** Key prefix namespacing every key this store writes. */\n private readonly prefix: string;\n\n /**\n * A ready client, or a promise resolving to one the store builds lazily\n * from a `url`. Resolved once and memoized so the optional `redis`\n * import + connect happens at most once.\n */\n private clientPromise: Promise<RedisClientLike>;\n\n public constructor(options: RedisInterruptOptions) {\n this.prefix = options.prefix ?? DEFAULT_PREFIX;\n\n if (options.client) {\n if (\n typeof options.client.get !== \"function\" ||\n typeof options.client.set !== \"function\" ||\n typeof options.client.del !== \"function\"\n ) {\n throw new TypeError(\n \"ai.human.interrupt.redis requires a 'client' option implementing { get, set, del } — pass a connected redis client.\",\n );\n }\n\n this.clientPromise = Promise.resolve(options.client);\n\n return;\n }\n\n if (options.url) {\n // Defer the optional `redis` import to first use — a curated install\n // string surfaces from `buildRedisClient`, not at construction.\n this.clientPromise = buildRedisClient(options.url);\n\n return;\n }\n\n throw new TypeError(\n \"ai.human.interrupt.redis requires either a 'client' or a 'url' option.\",\n );\n }\n\n /**\n * Resolve the backing client, surfacing the lazy `redis` import's\n * curated install string on the first call that needs it.\n */\n private client(): Promise<RedisClientLike> {\n return this.clientPromise;\n }\n\n /**\n * Persist a pending interrupt, keyed by its own `interruptId`, and index\n * the id for enumeration. Overwrites any prior record for the same id —\n * a call has exactly one live interrupt.\n */\n public async save(record: PendingInterrupt): Promise<void> {\n const client = await this.client();\n\n await client.set(this.recordKey(record.interruptId), JSON.stringify(record));\n await this.indexId(record.interruptId);\n }\n\n /**\n * Load the interrupt for an `interruptId`, or `undefined` when the key is\n * missing. Redis returns `null` for an absent key — converted to\n * `undefined` at the boundary.\n */\n public async load(\n interruptId: string,\n ): Promise<PendingInterrupt | undefined> {\n const client = await this.client();\n const raw = await client.get(this.recordKey(interruptId));\n\n if (raw === null) {\n return undefined;\n }\n\n return JSON.parse(raw) as PendingInterrupt;\n }\n\n /**\n * Drop the interrupt for an `interruptId` and de-index its id. Idempotent\n * — deleting an absent id is a no-op.\n */\n public async delete(interruptId: string): Promise<void> {\n const client = await this.client();\n\n await client.del(this.recordKey(interruptId));\n await this.deindexId(interruptId);\n }\n\n /**\n * List the interrupt ids known to the store, optionally filtered by a\n * prefix. Reads the self-maintained index document.\n */\n public async list(prefix?: string): Promise<string[]> {\n const ids = await this.readIndex();\n\n if (prefix === undefined) {\n return ids;\n }\n\n return ids.filter((id) => id.startsWith(prefix));\n }\n\n /**\n * Redis needs no relational table — there is nothing to migrate. Returns\n * an empty string so callers can treat `schema()` uniformly across\n * drivers.\n */\n public schema(): string {\n return \"\";\n }\n\n /**\n * Read and parse the id index, defaulting to an empty list when absent.\n */\n private async readIndex(): Promise<string[]> {\n const client = await this.client();\n const raw = await client.get(this.indexKey());\n\n if (raw === null) {\n return [];\n }\n\n return JSON.parse(raw) as string[];\n }\n\n /**\n * Add an interrupt id to the index, no-op when already present.\n */\n private async indexId(interruptId: string): Promise<void> {\n const ids = await this.readIndex();\n\n if (ids.includes(interruptId)) {\n return;\n }\n\n ids.push(interruptId);\n\n const client = await this.client();\n await client.set(this.indexKey(), JSON.stringify(ids));\n }\n\n /**\n * Remove an interrupt id from the index, no-op when absent.\n */\n private async deindexId(interruptId: string): Promise<void> {\n const ids = await this.readIndex();\n const next = ids.filter((id) => id !== interruptId);\n\n if (next.length === ids.length) {\n return;\n }\n\n const client = await this.client();\n await client.set(this.indexKey(), JSON.stringify(next));\n }\n\n /**\n * Key for a single interrupt record — `<prefix><interruptId>`.\n */\n private recordKey(interruptId: string): string {\n return `${this.prefix}${interruptId}`;\n }\n\n /**\n * Key for the self-maintained id index — `<prefix>index`.\n */\n private indexKey(): string {\n return `${this.prefix}${INDEX_SUFFIX}`;\n }\n}\n\n/**\n * Create a Redis-backed {@link InterruptStore}. Either pass a connected\n * `redis` client (`{ client }`) — `@warlock.js/ai` never imports\n * `redis` in that case — or a `{ url }` and let the store lazily\n * `import(\"redis\")`, build, and connect a client. When `redis` is not\n * installed, the curated install string surfaces on first use, never at\n * import. {@link InterruptStore.schema} returns an empty string; Redis\n * needs no migration.\n *\n * @example\n * import { createClient } from \"redis\";\n * import { ai } from \"@warlock.js/ai\";\n *\n * const client = createClient({ url: process.env.REDIS_URL });\n * await client.connect();\n *\n * const store = ai.human.interrupt.redis({ client });\n *\n * @example\n * // Let the store build + connect its own client from a url:\n * const store = ai.human.interrupt.redis({ url: process.env.REDIS_URL });\n */\nexport function redis(options: RedisInterruptOptions): InterruptStore {\n return new RedisInterruptStore(options);\n}\n"],"mappings":"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"}
|
|
@@ -2,7 +2,7 @@ import { ModelPricing } from "../contracts/result/model-pricing.type.mjs";
|
|
|
2
2
|
import { Usage } from "../contracts/result/usage.type.mjs";
|
|
3
3
|
import { ImageModelPricing } from "../contracts/image-model.contract.mjs";
|
|
4
4
|
|
|
5
|
-
//#region
|
|
5
|
+
//#region ../ai/src/image/image-cost.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Price one image-generation `Usage` against an
|
|
8
8
|
* {@link ImageModelPricing}, returning a `ModelPricing`-shaped USD
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-cost.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"image-cost.d.mts","names":[],"sources":["../../../../../../../ai/src/image/image-cost.ts"],"mappings":";;;;;;;AA4BA;;;;;;;;;;;;;;;;AAKe;;;;;iBALC,gBAAA,CACd,KAAA,EAAO,KAAA,EACP,UAAA,UACA,IAAA,sBACA,OAAA,EAAS,iBAAA,eACR,YAAA"}
|
package/esm/image/image-cost.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computeCost } from "../utils/compute-cost.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../ai/src/image/image-cost.ts
|
|
4
4
|
/**
|
|
5
5
|
* Price one image-generation `Usage` against an
|
|
6
6
|
* {@link ImageModelPricing}, returning a `ModelPricing`-shaped USD
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-cost.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"image-cost.mjs","names":[],"sources":["../../../../../../../ai/src/image/image-cost.ts"],"sourcesContent":["import type { ImageModelPricing } from \"../contracts/image-model.contract\";\nimport type { ModelPricing } from \"../contracts/result/model-pricing.type\";\nimport type { Usage } from \"../contracts/result/usage.type\";\nimport { computeCost } from \"../utils/compute-cost\";\n\n/**\n * Price one image-generation `Usage` against an\n * {@link ImageModelPricing}, returning a `ModelPricing`-shaped USD\n * breakdown so image spend folds into the exact same `Usage.cost`\n * rollup the text path uses (`accumulateCost` / `mergeUsage`). There is\n * no separate image-cost field anywhere downstream — only this one\n * function, which knows the two metering models:\n *\n * - **Per-image** (DALL·E, Imagen): `perImageBySize[size]` (when the\n * request `size` matches a tier) else flat `perImage`, times the\n * number of images returned, attributed to `cost.output` (the image\n * IS the output). Token channels stay 0.\n * - **Token** (gpt-image-1): delegates to the standard\n * {@link computeCost} against the prompt/image token `Usage`.\n *\n * Per-image wins when both shapes are configured (a provider is one or\n * the other). Returns `undefined` when no usable pricing is present —\n * the framework treats that as \"cost unknown\", never a false zero.\n *\n * @example\n * computeImageCost({ input: 0, output: 0, total: 0 }, 2, \"1024x1024\", { perImage: 0.04 });\n * // → { input: 0, output: 0.08 }\n */\nexport function computeImageCost(\n usage: Usage,\n imageCount: number,\n size: string | undefined,\n pricing: ImageModelPricing | undefined,\n): ModelPricing | undefined {\n if (!pricing) {\n return undefined;\n }\n\n const perImageMetered = pricing.perImage !== undefined || pricing.perImageBySize !== undefined;\n\n if (perImageMetered) {\n const perImage = resolvePerImageRate(size, pricing);\n\n if (perImage === undefined) {\n return undefined;\n }\n\n return { input: 0, output: perImage * imageCount };\n }\n\n if (pricing.input !== undefined && pricing.output !== undefined) {\n return computeCost(usage, { input: pricing.input, output: pricing.output });\n }\n\n return undefined;\n}\n\n/**\n * Resolve the USD-per-image rate: a `perImageBySize` tier matching the\n * requested `size` wins, otherwise the flat `perImage`. Returns\n * `undefined` only when neither is set (the caller already gated on\n * per-image metering being configured at all).\n */\nfunction resolvePerImageRate(\n size: string | undefined,\n pricing: ImageModelPricing,\n): number | undefined {\n if (size !== undefined && pricing.perImageBySize?.[size] !== undefined) {\n return pricing.perImageBySize[size];\n }\n\n return pricing.perImage;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,SAAgB,iBACd,OACA,YACA,MACA,SAC0B;CAC1B,IAAI,CAAC,SACH;CAKF,IAFwB,QAAQ,aAAa,UAAa,QAAQ,mBAAmB,QAEhE;EACnB,MAAM,WAAW,oBAAoB,MAAM,OAAO;EAElD,IAAI,aAAa,QACf;EAGF,OAAO;GAAE,OAAO;GAAG,QAAQ,WAAW;EAAW;CACnD;CAEA,IAAI,QAAQ,UAAU,UAAa,QAAQ,WAAW,QACpD,OAAO,YAAY,OAAO;EAAE,OAAO,QAAQ;EAAO,QAAQ,QAAQ;CAAO,CAAC;AAI9E;;;;;;;AAQA,SAAS,oBACP,MACA,SACoB;CACpB,IAAI,SAAS,UAAa,QAAQ,iBAAiB,UAAU,QAC3D,OAAO,QAAQ,eAAe;CAGhC,OAAO,QAAQ;AACjB"}
|
package/esm/image/image.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { ExecuteResult } from "../contracts/result/execute-result.type.mjs";
|
|
|
3
3
|
import { FlowObserveOption } from "../observe/resolve-observers.mjs";
|
|
4
4
|
import { GeneratedImage, ImageModelContract } from "../contracts/image-model.contract.mjs";
|
|
5
5
|
|
|
6
|
-
//#region
|
|
6
|
+
//#region ../ai/src/image/image.d.ts
|
|
7
7
|
/**
|
|
8
8
|
* Parameters for {@link image}. `model` comes from an adapter's
|
|
9
9
|
* `image()` factory (`openai.image({ name })` / `google.image({ name })`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.mts","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"image.d.mts","names":[],"sources":["../../../../../../../ai/src/image/image.ts"],"mappings":";;;;;;;;AAsBA;;;;KAAY,WAAA;EAyBA,gEAvBV,KAAA,EAAO,kBAAA,EA6BS;EA3BhB,MAAA,UAFA;EAIA,KAAA,WAFA;EAIA,IAAA;EAEA,OAAA,WAEA;EAAA,WAAA,WAIA;EAFA,cAAA,WAIS;EAFT,MAAA,WASU;EAPV,MAAA,GAAS,WAAA;EAWT;;;;AAEgB;AAIlB;EAVE,OAAA,GAAU,iBAAA;EAEV,SAAA,WAUsB;EARtB,IAAA,WAiBqB;EAfrB,OAAA,GAAU,MAAA;AAAA;;KAIA,SAAA;EAcV,mEAZA,MAAA,EAAQ,cAAc;AAAA;;;AAcZ;AAQZ;;;KAbY,WAAA,GAAc,UAAU;EAClC,IAAA,WAcQ;EAZR,KAAA;IAAS,IAAA;IAAc,QAAA;EAAA,GAWvB;EATA,UAAA;AAAA;;AAUmB;AA+BrB;;;KAjCY,WAAA,GAAc,aAAA,CAAc,SAAA;EACtC,IAAA;EACA,MAAA,EAAQ,WAAA;AAAA;;;;;;;AA+B2D;;;;;;;;;;;;;;;;;;;;;;iBAA/C,KAAA,CAAM,MAAA,EAAQ,WAAA,GAAc,OAAA,CAAQ,WAAA"}
|
package/esm/image/image.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { stampReportLineage } from "../utils/stamp-report-lineage.mjs";
|
|
|
6
6
|
import { notifyObservers } from "../observe/resolve-observers.mjs";
|
|
7
7
|
import { computeImageCost } from "./image-cost.mjs";
|
|
8
8
|
|
|
9
|
-
//#region
|
|
9
|
+
//#region ../ai/src/image/image.ts
|
|
10
10
|
/**
|
|
11
11
|
* Generate one or more images from a text prompt — the image-output
|
|
12
12
|
* counterpart to `ai.agent`, and the first verb of the output-modality
|
package/esm/image/image.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"image.mjs","names":[],"sources":["../../../../../../../ai/src/image/image.ts"],"sourcesContent":["import type {\n GeneratedImage,\n ImageModelContract,\n} from \"../contracts/image-model.contract\";\nimport type { BaseReport } from \"../contracts/result/base-report.type\";\nimport { REPORT_SCHEMA_VERSION } from \"../contracts/result/base-report.type\";\nimport type { ExecuteResult } from \"../contracts/result/execute-result.type\";\nimport type { Usage } from \"../contracts/result/usage.type\";\nimport { AIError } from \"../errors/ai-error\";\nimport { ProviderError } from \"../errors/provider-error\";\nimport type { FlowObserveOption } from \"../observe/resolve-observers\";\nimport { notifyObservers } from \"../observe/resolve-observers\";\nimport { generateRunId } from \"../utils/generate-run-id\";\nimport { stampReportLineage } from \"../utils/stamp-report-lineage\";\nimport { computeImageCost } from \"./image-cost\";\n\n/**\n * Parameters for {@link image}. `model` comes from an adapter's\n * `image()` factory (`openai.image({ name })` / `google.image({ name })`);\n * the rest are provider-neutral generation knobs plus the standard\n * observability seam every verb shares.\n */\nexport type ImageParams = {\n /** The image model to generate from (`sdk.image({ name })`). */\n model: ImageModelContract;\n /** Text description of the image(s) to generate. */\n prompt: string;\n /** How many images to generate. Adapters clamp to the provider max. */\n count?: number;\n /** Requested pixel size as `\"WxH\"` (e.g. `\"1024x1024\"`). */\n size?: string;\n /** Quality tier (e.g. `\"standard\"` / `\"hd\"`). */\n quality?: string;\n /** Aspect ratio (e.g. `\"1:1\"`, `\"16:9\"`) — ratio-based providers (Imagen). */\n aspectRatio?: string;\n /** Concepts to steer away from (Imagen `negativePrompt`). */\n negativePrompt?: string;\n /** Output container hint (`\"png\"` / `\"jpeg\"` / `\"webp\"`). */\n format?: string;\n /** Cancellation handle, wired into the provider request where supported. */\n signal?: AbortSignal;\n /**\n * Observability routing for this call — same `observe` seam as\n * agents / workflows. `true` routes to the globally registered\n * observers; an `Observer` object routes flow-locally; `false` opts\n * out; omitted follows the global observe-all flag.\n */\n observe?: FlowObserveOption;\n /** Groups this call into a session for flat cost/trace queries. */\n sessionId?: string;\n /** Report node name (defaults to `\"image\"`). */\n name?: string;\n /** Provider-specific options forwarded verbatim to the adapter. */\n options?: Record<string, unknown>;\n};\n\n/** Success payload of an {@link image} run. */\nexport type ImageData = {\n /** The generated images, normalized to the discriminated shape. */\n images: GeneratedImage[];\n};\n\n/**\n * The report node an {@link image} run produces — a {@link BaseReport}\n * (`type: \"image\"`) plus which model ran and how many images came back,\n * so panoptic and any flat-row consumer attribute the cost/latency\n * without special-casing.\n */\nexport type ImageReport = BaseReport & {\n type: \"image\";\n /** Identity of the image model this run used. */\n model: { name: string; provider: string };\n /** Number of images returned (0 on failure). */\n imageCount: number;\n};\n\n/**\n * Result envelope of {@link image} — the same uniform\n * `{ data, error, usage, report }` every executable returns, narrowed\n * with the `\"image\"` discriminant.\n */\nexport type ImageResult = ExecuteResult<ImageData> & {\n type: \"image\";\n report: ImageReport;\n};\n\n/**\n * Generate one or more images from a text prompt — the image-output\n * counterpart to `ai.agent`, and the first verb of the output-modality\n * track (Theme I). Wraps an {@link ImageModelContract} (from\n * `openai.image(...)` / `google.image(...)`) in the framework's uniform\n * result contract:\n *\n * - **Never throws.** Provider failures (auth, rate-limit,\n * content-filter, invalid request) surface as a typed `AIError` on\n * `result.error`; `result.data` is then `undefined`.\n * - **Cost-truth.** When the model carries pricing, `result.usage.cost`\n * is filled in — per-token for gpt-image-1, per-image for\n * DALL·E / Imagen — folding into the same `Usage.cost` rollup as text.\n * - **Observable.** The completed {@link ImageReport} routes to any\n * registered `Observer` (panoptic, OTel, …) via the shared `observe`\n * seam, exactly like an agent run.\n *\n * @example\n * const openai = new OpenAISDK({ apiKey });\n * const { data, error, usage } = await ai.image({\n * model: openai.image({ name: \"gpt-image-1\" }),\n * prompt: \"an isometric office desk, soft studio lighting\",\n * size: \"1024x1024\",\n * });\n *\n * if (error) console.warn(error.code);\n * else for (const img of data.images) save(img); // { type: \"base64\" | \"url\", ... }\n */\nexport async function image(params: ImageParams): Promise<ImageResult> {\n const { model, prompt } = params;\n\n const runId = generateRunId(\"image\");\n const startedAt = new Date().toISOString();\n const startPerf = performance.now();\n\n const usage: Usage = { input: 0, output: 0, total: 0 };\n let data: ImageData | undefined;\n let error: AIError | undefined;\n let status: ImageReport[\"status\"] = \"completed\";\n let imageCount = 0;\n\n try {\n const response = await model.generate(prompt, {\n count: params.count,\n size: params.size,\n quality: params.quality,\n aspectRatio: params.aspectRatio,\n negativePrompt: params.negativePrompt,\n format: params.format,\n signal: params.signal,\n ...params.options,\n });\n\n // Preserve every usage channel the adapter reported (cached /\n // reasoning / cache-write, and any adapter-supplied `cost`), mirroring\n // how the agent path routes provider usage. Then honor a pre-priced\n // response or compute image cost — `usage.cost ??= …` precedence, same\n // as the agent path.\n Object.assign(usage, response.usage);\n\n if (usage.cost === undefined) {\n const cost = computeImageCost(usage, response.images.length, params.size, model.pricing);\n if (cost !== undefined) {\n usage.cost = cost;\n }\n }\n\n data = { images: response.images };\n imageCount = response.images.length;\n } catch (thrown) {\n error = thrown instanceof AIError ? thrown : new ProviderError(toMessage(thrown), { cause: thrown });\n // A caller-aborted run is \"cancelled\", not \"failed\" — keep the typed\n // cause but distinguish the terminal status for dashboards/retry policy.\n status = params.signal?.aborted ? \"cancelled\" : \"failed\";\n }\n\n const report: ImageReport = {\n runId,\n rootRunId: runId,\n name: params.name ?? \"image\",\n type: \"image\",\n status,\n error,\n startedAt,\n endedAt: new Date().toISOString(),\n duration: performance.now() - startPerf,\n usage,\n children: [],\n model: { name: model.name, provider: model.provider },\n imageCount,\n reportSchemaVersion: REPORT_SCHEMA_VERSION,\n };\n\n stampReportLineage(report, { rootRunId: runId, sessionId: params.sessionId });\n\n await notifyObservers(params.observe, report);\n\n return { type: \"image\", data, error, usage, report };\n}\n\n/** Best-effort message for a non-`AIError` thrown value. */\nfunction toMessage(thrown: unknown): string {\n return thrown instanceof Error ? thrown.message : String(thrown);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkHA,eAAsB,MAAM,QAA2C;CACrE,MAAM,EAAE,OAAO,WAAW;CAE1B,MAAM,QAAQ,cAAc,OAAO;CACnC,MAAM,6BAAY,IAAI,KAAK,EAAC,CAAC,YAAY;CACzC,MAAM,YAAY,YAAY,IAAI;CAElC,MAAM,QAAe;EAAE,OAAO;EAAG,QAAQ;EAAG,OAAO;CAAE;CACrD,IAAI;CACJ,IAAI;CACJ,IAAI,SAAgC;CACpC,IAAI,aAAa;CAEjB,IAAI;EACF,MAAM,WAAW,MAAM,MAAM,SAAS,QAAQ;GAC5C,OAAO,OAAO;GACd,MAAM,OAAO;GACb,SAAS,OAAO;GAChB,aAAa,OAAO;GACpB,gBAAgB,OAAO;GACvB,QAAQ,OAAO;GACf,QAAQ,OAAO;GACf,GAAG,OAAO;EACZ,CAAC;EAOD,OAAO,OAAO,OAAO,SAAS,KAAK;EAEnC,IAAI,MAAM,SAAS,QAAW;GAC5B,MAAM,OAAO,iBAAiB,OAAO,SAAS,OAAO,QAAQ,OAAO,MAAM,MAAM,OAAO;GACvF,IAAI,SAAS,QACX,MAAM,OAAO;EAEjB;EAEA,OAAO,EAAE,QAAQ,SAAS,OAAO;EACjC,aAAa,SAAS,OAAO;CAC/B,SAAS,QAAQ;EACf,QAAQ,kBAAkB,UAAU,SAAS,IAAI,cAAc,UAAU,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;EAGnG,SAAS,OAAO,QAAQ,UAAU,cAAc;CAClD;CAEA,MAAM,SAAsB;EAC1B;EACA,WAAW;EACX,MAAM,OAAO,QAAQ;EACrB,MAAM;EACN;EACA;EACA;EACA,0BAAS,IAAI,KAAK,EAAC,CAAC,YAAY;EAChC,UAAU,YAAY,IAAI,IAAI;EAC9B;EACA,UAAU,CAAC;EACX,OAAO;GAAE,MAAM,MAAM;GAAM,UAAU,MAAM;EAAS;EACpD;EACA;CACF;CAEA,mBAAmB,QAAQ;EAAE,WAAW;EAAO,WAAW,OAAO;CAAU,CAAC;CAE5E,MAAM,gBAAgB,OAAO,SAAS,MAAM;CAE5C,OAAO;EAAE,MAAM;EAAS;EAAM;EAAO;EAAO;CAAO;AACrD;;AAGA,SAAS,UAAU,QAAyB;CAC1C,OAAO,kBAAkB,QAAQ,OAAO,UAAU,OAAO,MAAM;AACjE"}
|
package/esm/index.d.mts
CHANGED
|
@@ -291,6 +291,7 @@ import { MiddlewareContextByLevel, MiddlewareLevel, runPipeline } from "./middle
|
|
|
291
291
|
import { extractUserText } from "./middleware/utils/extract-user-text.mjs";
|
|
292
292
|
import { NamespacedStateAccessor, namespacedState } from "./middleware/utils/namespaced-state.mjs";
|
|
293
293
|
import { getObservers, isObserveAll, registerObserver, setObserveAll } from "./observe/observer-registry.mjs";
|
|
294
|
+
import { JudgeOutcome, formatCriteria, judgePromptBody } from "./prompts/prompts-validate.mjs";
|
|
294
295
|
import { assertUrlAllowed, fetchTextWithPolicy, guardedFetch, readTextCapped, resolveOutboundPolicy } from "./security/outbound-policy.mjs";
|
|
295
296
|
import { isPrivateOrReservedIp } from "./security/private-ip.mjs";
|
|
296
297
|
import { DEFAULT_SENSITIVE_KEYS, RedactOptions, RedactedError, SENSITIVE_HEADERS, redact, redactError, redactHeaders, scrubSecrets } from "./security/redact.mjs";
|
|
@@ -311,7 +312,7 @@ import { computeSignature as computeSignature$1 } from "./workflow/signature.mjs
|
|
|
311
312
|
import { MatcherVerdict, matchConverge, matchOutputShape, matchPassStep, matchRouteTo } from "./testing/matcher-logic.mjs";
|
|
312
313
|
import { AiMatchers } from "./testing/matchers.mjs";
|
|
313
314
|
import { registerAiMatchers } from "./testing/register-lazy.mjs";
|
|
314
|
-
export { AIConfig, AIError, type AIErrorCode, type AIErrorOptions, type AckCallback, type AckConfig, type AckEntry, type AckRunEntry, type AckSnapshot, type AgentBranchSnapshot, AgentCancelledError, type AgentCancelledErrorOptions, type AgentCompletedPayload, type AgentConfig, type AgentContract, AgentDriftError, type AgentDriftErrorOptions, type AgentErrorPayload, type AgentEventHandler, type AgentEventMap, type AgentExecuteOptions, AgentExecutionError, AgentMaxTripsError, type AgentMaxTripsErrorOptions, type AgentMiddleware, type AgentMiddlewareExecuteHooks, type AgentMiddlewareSupervisorHooks, type AgentMiddlewareToolHooks, type AgentMiddlewareTripHooks, type AgentReport, type AgentResult, type AgentResumeOptions, type AgentSnapshot, type AgentSnapshotStatus, type AgentStartingPayload, type AgentStreamingPayload, type AgentToolCalledPayload, type AgentToolCallingFailedPayload, type AgentToolCallingPayload, type AgentToolEntry, type AgentTripCompletedPayload, type AgentTripStartedPayload, type Ai, type AiMatchers, type ApprovalDecision, type ApprovalDecisionType, type ApprovalHandler, ApprovalRejectedError, type ApprovalRejectedErrorOptions, type ApprovalRequest, type ApprovalRequestContext, Attachment, AttachmentPolicy, AttachmentSource, type AttemptEntry, AudioInput, type BaseReport, type BaseResult, type BatchItemHandler, type BatchItemResult, type BatchItemStatus, type BatchOptions, type BatchReport, type BatchResult, BinarySource, type BudgetContract, type BudgetContractDimension, type BudgetContractFallback, type BudgetContractViolation, type BudgetContractViolationMode, BudgetExceededError, type BudgetExceededErrorOptions, type BudgetFallbackSignal, type BudgetOptions, type BudgetPricing, type BudgetUnit, type CapturedMessage, type Cassette, type CassetteEntry, type CheckpointRecord, type CheckpointStore, type Chunk, type ChunkOptions, type ChunkType, type Citation, type ClassifierAgentEntry, type ClassifierCallback, type ClassifierConfig, type ClassifierContext, type ClassifierOutput, type ClassifierRefineContext, type ClassifierRefineResult, type ClassifierRunEntry, type ClassifierSnapshot, type CompactionResult, type CompleteEvent, ContentFilterError, type ContentFilterErrorOptions, ContentPart, ContextLengthExceededError, type ContextLengthExceededErrorOptions, DEFAULT_HASH_OPTIONS, DEFAULT_SENSITIVE_KEYS, type DatasetContract, type DatasetEntry, type DatasetOptions, type DecisionSource, type DispatchContext, type DispatchRawResult, END, EmbedderConfig, EmbedderContract, EmbeddingBatchResult, EmbeddingResult, EmbeddingUsage, EndSentinel, type EpisodicMemoryConfig, type ErrorCategory, type EvalCase, type EvalCaseResult, type EvalJudge, type EvalOptions, type EvalPredicate, type EvalReport, type EvalScore, type EvalScorer, type EvalScorerContext, type EvaluateBranchResult, type EvaluateContext, type EvaluateResult, type EventIdentity, ExecutableContract, type ExecutableTool, type ExecuteResult, type ExecutionReport, type ExecutionStatus, type ExportedPrompt, type ExportedPromptVersion, type ExportedRegistry, type ExtractJsonSchemaOptions, type FallbackAttempt, type FallbackModelContract, type FallbackModelOptions, type FallbackRetryPredicate, type FanOutOptions, type FanOutUnit, FinishReason, type FlagRecord, type FlowObserveOption, GeneratedAudio, GeneratedImage, type GuardOptions, type GuardrailAction, type GuardrailBlockEvent, type GuardrailCheck, type GuardrailCheckResult, type GuardrailDetector, type GuardrailDetectorContext, type GuardrailEscalation, type GuardrailFactory, type GuardrailMatch, type GuardrailOptions, type GuardrailPhase, type GuardrailVerdict, GuardrailViolationError, type GuardrailViolationErrorOptions, type HumanApprovalOptions, type HumanErrorCode, type ImageData, ImageGenerationOptions, ImageGenerationResponse, ImageModelConfig, ImageModelContract, ImageModelPricing, type ImageParams, type ImageReport, type ImageResult, ImageSource, type InjectionDetectorOptions, Instruction, InstructionContract, type IntentCallback, type IntentEntry, type IntentRunEntry, type IntentRunner, type IntentRunnerMap, type InterruptPolicy, type InterruptStore, InterruptSuspendedError, type InterruptSuspendedErrorOptions, InvalidRequestError, type IterationDecision, type IterationSnapshot, JUDGE_DEFAULT_REPAIR_ATTEMPTS, type JsonSchemaTarget, type JudgeAgentConfig, type JudgeConfig, type KeywordRerankerOptions, type LLMTrip, type LexicalDoc, type LineageStamp, type LlmRerankerOptions, type LoadHtmlOptions, type LoadPdfOptions, type LoadSkillInput, type LoadSkillResult, type LoadSkillToolDeps, type LoadTextOptions, type LoadWebOptions, type MatcherVerdict, MaxIterationsError, type MaxIterationsErrorOptions, MaxStepsExceededError, type MaxStepsExceededErrorOptions, type MemoryConfig, type MemoryContract, type MemoryItem, type MemoryTier, Message, type MiddlewareAgentRef, type MiddlewareContextByLevel, type MiddlewareExecuteContext, type MiddlewareLevel, type MiddlewareModelRef, type MiddlewareState, type MiddlewareSupervisorContext, type MiddlewareSupervisorRef, type MiddlewareToolContext, type MiddlewareTripContext, type MockImageCall, MockImageModel, type MockImageResponse, MockModel, type MockModelResponse, type MockRouterDecision, type MockRouterExhaustion, type MockRouterOptions, MockSDK, type MockSDKConfig, MockSkillsStore, type MockSpeechCall, MockSpeechModel, type MockSpeechResponse, type MockTranscriptionCall, MockTranscriptionModel, type MockTranscriptionResponse, ModelCallOptions, ModelCapabilities, ModelConfig, ModelContract, type ModelPricing, ModelResponse, ModelStreamChunk, ModelToolCallRequest, type MultiQueryOptions, type NamespacedStateAccessor, type Next, type NextStepResult, OPENAI_INSTALL_INSTRUCTIONS, type ObjectStreamEvent, type Observer, type OpenAiClientLike, type OpenAiModerationCreateBody, type OpenAiModerationOptions, type OpenAiModerationResponse, type OpenAiModerationResult, type OrchestratorAsToolOptions, type OrchestratorAwaitingStatus, OrchestratorCancelledError, type OrchestratorCancelledErrorOptions, type OrchestratorCommandHandlers, type OrchestratorCommands, type OrchestratorConfig, OrchestratorConfigError, type OrchestratorContract, OrchestratorDriftError, type OrchestratorDriftErrorOptions, OrchestratorEmitter, type OrchestratorEvent, type OrchestratorEventHandler, type OrchestratorEventHandlers, type OrchestratorEventMap, type OrchestratorEventName, type OrchestratorExecuteOptions, OrchestratorExecution, type OrchestratorExecutionParams, OrchestratorFailedError, type OrchestratorMemoryConfig, type OrchestratorReport, type OrchestratorReportStatus, type OrchestratorReportType, type OrchestratorResult, type OrchestratorResumeOptions, type OrchestratorSessionScope, type OrchestratorStreamController, type OutboundPolicy, OutboundPolicyError, PDF_PARSE_INSTALL_INSTRUCTIONS, type ParsedFrontmatter, type PendingInterrupt, type PendingInterruptStatus, Persona, PersonaContract, type PgCheckpointOptions, type PgClientLike, type PgInterruptOptions, type PgSnapshotStoreOptions, type PgVectorStoreInstance, type PgVectorStoreOptions, type PiiCategory, type PiiDetectorOptions, Placeholders, PlannerCancelledError, type PlannerCancelledErrorOptions, type PlannerCapability, type PlannerConfig, type PlannerContract, PlannerDriftError, type PlannerDriftErrorOptions, type PlannerExecuteOptions, PlannerFailedError, type PlannerPlan, PlannerPlanInvalidError, type PlannerReport, type PlannerReportType, type PlannerResult, type PlannerResumeOptions, type PlannerRunArgs, type PlannerSnapshot, type PlannerSnapshotStatus, type PlannerStep, type PlannerStepDirective, type PlannerStepSnapshot, type PolicyContext, type PolicyVerdict, type ProceduralMemoryConfig, type PromptDiff, type PromptDiffBlock, type PromptEntry, type PromptJudgeCacheLike, type PromptLangfuseSyncOptions, PromptNotFoundError, PromptRefineOptions, PromptRefinementError, type PromptRefinementErrorOptions, type PromptRefinementFailureReason, type PromptRegistryContract, type PromptRegistryOptions, type PromptResolveOptions, type PromptTemplateVersion, type PromptValidateOptions, type PromptValidateTarget, PromptValidationError, type PromptValidationNote, type PromptValidationReport, type PromptValidationResult, type PromptValidationSeverity, type PromptVersion, type PromptsManagerContract, type PromptsManagerEntry, type PromptsManagerOptions, type PromptsManagerRegisterOptions, type PromptsValidateOptions, ProviderAuthError, ProviderError, ProviderRateLimitError, type ProviderRateLimitErrorOptions, ProviderTimeoutError, QuotaExceededError, REPORT_SCHEMA_VERSION, type Rag, type RagAsToolOptions, type RagConfig, type RagDocument, type RagLoaderMetadata, type RagLoaderOptions, type RagLoaderResult, type RagLoaderType, type RagReranker, type RankedItem, ReasoningEffort, type RecallOptions, type RecalledMemory, type RedactOptions, type RedactedError, type RedisCheckpointOptions, type RedisClientLike, type RedisInterruptOptions, type RedisSnapshotStoreOptions, RefinedPromptStoreLike, RefinedSystemPrompt, RefinedSystemPromptContract, RefinedSystemPromptOptions, type ReportStatus, type ReportType, ResolvedAttachment, type ResolvedIntentEntry, type ResolvedOrchestratorMemory, type ResolvedOutboundPolicy, type ResolvedPrompt, type ResumeOptions, type ResumeResult, type RetrieveOptions, type RetrieveResult, type RetrievedChunk, type RetryBackoff, type RetryConfig, type ReviewOutcome, type RouteContext, type RouterConfig, type RouterEntry, type RouterIntents, type RouterOutput, RoutingError, type RoutingErrorOptions, type RunFrame, SDKAdapterContract, SENSITIVE_HEADERS, SSE_DONE, type SaveSkillInput, type SaveSkillResult, type SaveSkillToolDeps, SchemaValidationError, type SchemaValidationErrorOptions, type SemanticCacheOptions, type SemanticMemoryConfig, type ServableExecutable, type ServeOptions, type SessionContextOverrides, type SessionContract, type SessionLock, type SessionSendResult, type SkillAnalyticsEvent, type SkillCatalogEntry, type SkillInjectMode, type SkillRecord, type SkillReviewGate, type SkillSource, type SkillsConfig, type SkillsContract, type SkillsStoreContract, type SnapshotStore, type SpawnSubAgentSpec, type SpeechData, SpeechGenerationResponse, SpeechModelConfig, SpeechModelContract, SpeechModelPricing, SpeechOptions, type SpeechParams, type SpeechReport, type SpeechResult, type StepAgentInput, type StepDefinition, StepFailedError, type StepFailedErrorOptions, type StepLocalEvents, type StepOutputSpec, type StepSnapshot, StorageFileShape, type StreamContract, type StreamController, type StreamEvent, type StreamEventBody, type StreamLike, type StreamObjectParams, StreamingToolGuardConfig, type SummarizeCallback, type SummarizeConfig, type SupervisorAgentCompletedPayload, type SupervisorAgentFailedPayload, type SupervisorAgentStartingPayload, type SupervisorAgentStreamingPayload, type SupervisorAsToolOptions, SupervisorCancelledError, type SupervisorCancelledErrorOptions, type SupervisorCancelledPayload, type SupervisorCompletedPayload, type SupervisorConfig, type SupervisorContract, SupervisorDriftError, type SupervisorDriftErrorOptions, SupervisorEmitter, type SupervisorErrorPayload, type SupervisorEvaluateVerdictPayload, type SupervisorEventHandler, type SupervisorEventHandlers, type SupervisorEventMap, type SupervisorExecuteOptions, SupervisorExecution, SupervisorFailedError, type SupervisorInput, type SupervisorIntentValue, type SupervisorIterationCompletedPayload, type SupervisorIterationStartingPayload, type SupervisorReport, type SupervisorResult, type SupervisorResumeOptions, type SupervisorRouterDecidedPayload, type SupervisorRouterDecidingPayload, SupervisorRoutingError, type SupervisorRoutingErrorOptions, type SupervisorSnapshot, type SupervisorSnapshotStatus, type SupervisorStartingPayload, type SupervisorStreamController, type SupervisorStreamEvent, type SupervisorTerminatedBy, type SyncGuardrailDetector, SystemPrompt, SystemPromptBlockContract, SystemPromptContract, SystemPromptMergeOptions, SystemPromptMergeSource, SystemPromptMeta, type TeamConfig, type TeamGate, type TeamGateFn, type TeamMemberValue, type TextInput, type ToolCall, ToolConfig, ToolContext, type ToolContract, type ToolEventMeta, ToolExecutionError, type ToolExecutionErrorOptions, type ToolInvokeResult, ToolMeta, ToolMode, type TopicFilterOptions, TranscribeOptions, type TranscribeParams, type TranscriptionData, TranscriptionModelConfig, TranscriptionModelContract, TranscriptionModelPricing, type TranscriptionReport, TranscriptionResponse, type TranscriptionResult, TranscriptionSegment, type TurnSnapshot, type Usage, type UsageEvent, VcrCassetteMissError, type VcrCassetteMissErrorOptions, type VcrMode, type VcrModel, type VcrOptions, type VectorStore, type WithoutIdentity, WorkflowCancelledError, type WorkflowCancelledErrorOptions, type WorkflowCancelledPayload, type WorkflowCompletedPayload, type WorkflowContext, type WorkflowDefinition, WorkflowDriftError, type WorkflowDriftErrorOptions, WorkflowError, type WorkflowErrorPayload, type WorkflowEventHandler, type WorkflowEventHandlers, type WorkflowEventMap, type WorkflowExecuteOptions, type WorkflowInstance, type WorkflowLoopWarningPayload, type WorkflowReport, type WorkflowResult, type WorkflowResumeOptions, type WorkflowRunOptions, type WorkflowSnapshot, type WorkflowStartingPayload, type WorkflowStepCompletedPayload, type WorkflowStepFailedPayload, type WorkflowStepRetryingPayload, type WorkflowStepSkippedPayload, type WorkflowStepStartingPayload, type WorkflowStepStreamingPayload, accumulateCost, agent, ai, approximateTokenCount, assertUrlAllowed, audioFromBuffer, audioFromFile, audioMediaTypeForFilename, batch, bm25Rank, budget, buildCatalog, buildPlanSystemPrompt, buildRouterContextMessage, cacheVectorStore, captureChildReport, memory as checkpointMemory, pg as checkpointPg, redis as checkpointRedis, chunk, collectStreamObject, composeMiddleware, computeCost, computeImageCost, computeOrchestratorSignature, computeSignature as computePlannerSignature, computeSignature$1 as computeSignature, computeSignature$2 as computeSupervisorSignature, contains, createAgentStream, createCommandDispatcher as createOrchestratorCommandDispatcher, createOrchestratorStream, createCancelledError as createSupervisorCancelledError, createSupervisorStream, currentRunFrame, dataset, defaultPromptsManager, diff, directorySource, encodeSSE, evalScorers, evaluatePolicy, exact, executableToTool, extractJsonLenient, extractJsonPayload, extractJsonSchema, extractUserText, fallbackModel, fanOut, fetchTextWithPolicy, forTool, fromJSON, generateRunId, getAIConfig, getObservers, guard, guardedFetch, guardrail, hashRequest, humanApproval, hybridRank, image, inProcessSessionLock, injectMemories as injectOrchestratorMemories, injection, instruction, memory$1 as interruptMemory, pg$1 as interruptPg, redis$1 as interruptRedis, isExecutableTool, isObserveAll, isPrivateOrReservedIp, judge, keywordReranker, llmReranker, loadHtml, loadPdf, loadRecord, loadSkillTool, loadSnapshotForResume as loadSupervisorSnapshotForResume, loadText, loadWeb, matchConverge, matchOutputShape, matchPassStep, matchRouteTo, memory$2 as memory, mergeUsage, mockAgent, mockRouter, moderation, multiQuery, namespacedState, noopSessionLock, normalizeAgentTools, onConfigApplied, orchestrator, asTool as orchestratorAsTool, memoryQueryFromInput as orchestratorMemoryQueryFromInput, outcomeTextFromTurn as orchestratorOutcomeTextFromTurn, parseFrontmatter, parsePartialJson, parseTags, persistSupervisorSnapshot, persona, pgVectorStore, pii, planSchema, planner, predicate, prepareAttachmentPart, proceduralSkillStore, prompt, promptKey, prompts, rag, readBudgetFallbackSignal, readTextCapped, recallForTurn as recallOrchestratorMemory, reciprocalRankFusion, redact, redactError, redactHeaders, registerAiMatchers, registerObserver, rememberTurnOutcome as rememberOrchestratorTurnOutcome, renderCatalogPrompt, renderPlaceholders, resolveAttachment, resolveDefaultCheckpointStore, resolveDefaultSnapshotStore, resolveDefaultStore, resolveIntentEntries, resolveObservers, resolveOrchestratorMemory, resolveOutboundPolicy, resolveSource, resume, router, runEval, runResume as runOrchestratorResume, runTurn as runOrchestratorTurn, runPipeline, runReviewGate, safeJsonParse, saveSkillTool, scrubSecrets, semanticCache, semanticPreselect, serve, setAIConfig, setObserveAll, skills, memory$3 as snapshotMemory, pg$2 as snapshotPg, redis$2 as snapshotRedis, spawnSubAgent, speech, stampReportLineage, step, storeSource, streamObject, streamTurn as streamOrchestratorTurn, streamToSSE, supervisor, asTool$1 as supervisorAsTool, systemPrompt, team, toJSON, toJUnit, tool, topic, transcribe, urlSource, vcr, vectorLiteral, withRunFrame, withoutRunFrame, workflow };
|
|
315
|
+
export { AIConfig, AIError, type AIErrorCode, type AIErrorOptions, type AckCallback, type AckConfig, type AckEntry, type AckRunEntry, type AckSnapshot, type AgentBranchSnapshot, AgentCancelledError, type AgentCancelledErrorOptions, type AgentCompletedPayload, type AgentConfig, type AgentContract, AgentDriftError, type AgentDriftErrorOptions, type AgentErrorPayload, type AgentEventHandler, type AgentEventMap, type AgentExecuteOptions, AgentExecutionError, AgentMaxTripsError, type AgentMaxTripsErrorOptions, type AgentMiddleware, type AgentMiddlewareExecuteHooks, type AgentMiddlewareSupervisorHooks, type AgentMiddlewareToolHooks, type AgentMiddlewareTripHooks, type AgentReport, type AgentResult, type AgentResumeOptions, type AgentSnapshot, type AgentSnapshotStatus, type AgentStartingPayload, type AgentStreamingPayload, type AgentToolCalledPayload, type AgentToolCallingFailedPayload, type AgentToolCallingPayload, type AgentToolEntry, type AgentTripCompletedPayload, type AgentTripStartedPayload, type Ai, type AiMatchers, type ApprovalDecision, type ApprovalDecisionType, type ApprovalHandler, ApprovalRejectedError, type ApprovalRejectedErrorOptions, type ApprovalRequest, type ApprovalRequestContext, Attachment, AttachmentPolicy, AttachmentSource, type AttemptEntry, AudioInput, type BaseReport, type BaseResult, type BatchItemHandler, type BatchItemResult, type BatchItemStatus, type BatchOptions, type BatchReport, type BatchResult, BinarySource, type BudgetContract, type BudgetContractDimension, type BudgetContractFallback, type BudgetContractViolation, type BudgetContractViolationMode, BudgetExceededError, type BudgetExceededErrorOptions, type BudgetFallbackSignal, type BudgetOptions, type BudgetPricing, type BudgetUnit, type CapturedMessage, type Cassette, type CassetteEntry, type CheckpointRecord, type CheckpointStore, type Chunk, type ChunkOptions, type ChunkType, type Citation, type ClassifierAgentEntry, type ClassifierCallback, type ClassifierConfig, type ClassifierContext, type ClassifierOutput, type ClassifierRefineContext, type ClassifierRefineResult, type ClassifierRunEntry, type ClassifierSnapshot, type CompactionResult, type CompleteEvent, ContentFilterError, type ContentFilterErrorOptions, ContentPart, ContextLengthExceededError, type ContextLengthExceededErrorOptions, DEFAULT_HASH_OPTIONS, DEFAULT_SENSITIVE_KEYS, type DatasetContract, type DatasetEntry, type DatasetOptions, type DecisionSource, type DispatchContext, type DispatchRawResult, END, EmbedderConfig, EmbedderContract, EmbeddingBatchResult, EmbeddingResult, EmbeddingUsage, EndSentinel, type EpisodicMemoryConfig, type ErrorCategory, type EvalCase, type EvalCaseResult, type EvalJudge, type EvalOptions, type EvalPredicate, type EvalReport, type EvalScore, type EvalScorer, type EvalScorerContext, type EvaluateBranchResult, type EvaluateContext, type EvaluateResult, type EventIdentity, ExecutableContract, type ExecutableTool, type ExecuteResult, type ExecutionReport, type ExecutionStatus, type ExportedPrompt, type ExportedPromptVersion, type ExportedRegistry, type ExtractJsonSchemaOptions, type FallbackAttempt, type FallbackModelContract, type FallbackModelOptions, type FallbackRetryPredicate, type FanOutOptions, type FanOutUnit, FinishReason, type FlagRecord, type FlowObserveOption, GeneratedAudio, GeneratedImage, type GuardOptions, type GuardrailAction, type GuardrailBlockEvent, type GuardrailCheck, type GuardrailCheckResult, type GuardrailDetector, type GuardrailDetectorContext, type GuardrailEscalation, type GuardrailFactory, type GuardrailMatch, type GuardrailOptions, type GuardrailPhase, type GuardrailVerdict, GuardrailViolationError, type GuardrailViolationErrorOptions, type HumanApprovalOptions, type HumanErrorCode, type ImageData, ImageGenerationOptions, ImageGenerationResponse, ImageModelConfig, ImageModelContract, ImageModelPricing, type ImageParams, type ImageReport, type ImageResult, ImageSource, type InjectionDetectorOptions, Instruction, InstructionContract, type IntentCallback, type IntentEntry, type IntentRunEntry, type IntentRunner, type IntentRunnerMap, type InterruptPolicy, type InterruptStore, InterruptSuspendedError, type InterruptSuspendedErrorOptions, InvalidRequestError, type IterationDecision, type IterationSnapshot, JUDGE_DEFAULT_REPAIR_ATTEMPTS, type JsonSchemaTarget, type JudgeAgentConfig, type JudgeConfig, type JudgeOutcome, type KeywordRerankerOptions, type LLMTrip, type LexicalDoc, type LineageStamp, type LlmRerankerOptions, type LoadHtmlOptions, type LoadPdfOptions, type LoadSkillInput, type LoadSkillResult, type LoadSkillToolDeps, type LoadTextOptions, type LoadWebOptions, type MatcherVerdict, MaxIterationsError, type MaxIterationsErrorOptions, MaxStepsExceededError, type MaxStepsExceededErrorOptions, type MemoryConfig, type MemoryContract, type MemoryItem, type MemoryTier, Message, type MiddlewareAgentRef, type MiddlewareContextByLevel, type MiddlewareExecuteContext, type MiddlewareLevel, type MiddlewareModelRef, type MiddlewareState, type MiddlewareSupervisorContext, type MiddlewareSupervisorRef, type MiddlewareToolContext, type MiddlewareTripContext, type MockImageCall, MockImageModel, type MockImageResponse, MockModel, type MockModelResponse, type MockRouterDecision, type MockRouterExhaustion, type MockRouterOptions, MockSDK, type MockSDKConfig, MockSkillsStore, type MockSpeechCall, MockSpeechModel, type MockSpeechResponse, type MockTranscriptionCall, MockTranscriptionModel, type MockTranscriptionResponse, ModelCallOptions, ModelCapabilities, ModelConfig, ModelContract, type ModelPricing, ModelResponse, ModelStreamChunk, ModelToolCallRequest, type MultiQueryOptions, type NamespacedStateAccessor, type Next, type NextStepResult, OPENAI_INSTALL_INSTRUCTIONS, type ObjectStreamEvent, type Observer, type OpenAiClientLike, type OpenAiModerationCreateBody, type OpenAiModerationOptions, type OpenAiModerationResponse, type OpenAiModerationResult, type OrchestratorAsToolOptions, type OrchestratorAwaitingStatus, OrchestratorCancelledError, type OrchestratorCancelledErrorOptions, type OrchestratorCommandHandlers, type OrchestratorCommands, type OrchestratorConfig, OrchestratorConfigError, type OrchestratorContract, OrchestratorDriftError, type OrchestratorDriftErrorOptions, OrchestratorEmitter, type OrchestratorEvent, type OrchestratorEventHandler, type OrchestratorEventHandlers, type OrchestratorEventMap, type OrchestratorEventName, type OrchestratorExecuteOptions, OrchestratorExecution, type OrchestratorExecutionParams, OrchestratorFailedError, type OrchestratorMemoryConfig, type OrchestratorReport, type OrchestratorReportStatus, type OrchestratorReportType, type OrchestratorResult, type OrchestratorResumeOptions, type OrchestratorSessionScope, type OrchestratorStreamController, type OutboundPolicy, OutboundPolicyError, PDF_PARSE_INSTALL_INSTRUCTIONS, type ParsedFrontmatter, type PendingInterrupt, type PendingInterruptStatus, Persona, PersonaContract, type PgCheckpointOptions, type PgClientLike, type PgInterruptOptions, type PgSnapshotStoreOptions, type PgVectorStoreInstance, type PgVectorStoreOptions, type PiiCategory, type PiiDetectorOptions, Placeholders, PlannerCancelledError, type PlannerCancelledErrorOptions, type PlannerCapability, type PlannerConfig, type PlannerContract, PlannerDriftError, type PlannerDriftErrorOptions, type PlannerExecuteOptions, PlannerFailedError, type PlannerPlan, PlannerPlanInvalidError, type PlannerReport, type PlannerReportType, type PlannerResult, type PlannerResumeOptions, type PlannerRunArgs, type PlannerSnapshot, type PlannerSnapshotStatus, type PlannerStep, type PlannerStepDirective, type PlannerStepSnapshot, type PolicyContext, type PolicyVerdict, type ProceduralMemoryConfig, type PromptDiff, type PromptDiffBlock, type PromptEntry, type PromptJudgeCacheLike, type PromptLangfuseSyncOptions, PromptNotFoundError, PromptRefineOptions, PromptRefinementError, type PromptRefinementErrorOptions, type PromptRefinementFailureReason, type PromptRegistryContract, type PromptRegistryOptions, type PromptResolveOptions, type PromptTemplateVersion, type PromptValidateOptions, type PromptValidateTarget, PromptValidationError, type PromptValidationNote, type PromptValidationReport, type PromptValidationResult, type PromptValidationSeverity, type PromptVersion, type PromptsManagerContract, type PromptsManagerEntry, type PromptsManagerOptions, type PromptsManagerRegisterOptions, type PromptsValidateOptions, ProviderAuthError, ProviderError, ProviderRateLimitError, type ProviderRateLimitErrorOptions, ProviderTimeoutError, QuotaExceededError, REPORT_SCHEMA_VERSION, type Rag, type RagAsToolOptions, type RagConfig, type RagDocument, type RagLoaderMetadata, type RagLoaderOptions, type RagLoaderResult, type RagLoaderType, type RagReranker, type RankedItem, ReasoningEffort, type RecallOptions, type RecalledMemory, type RedactOptions, type RedactedError, type RedisCheckpointOptions, type RedisClientLike, type RedisInterruptOptions, type RedisSnapshotStoreOptions, RefinedPromptStoreLike, RefinedSystemPrompt, RefinedSystemPromptContract, RefinedSystemPromptOptions, type ReportStatus, type ReportType, ResolvedAttachment, type ResolvedIntentEntry, type ResolvedOrchestratorMemory, type ResolvedOutboundPolicy, type ResolvedPrompt, type ResumeOptions, type ResumeResult, type RetrieveOptions, type RetrieveResult, type RetrievedChunk, type RetryBackoff, type RetryConfig, type ReviewOutcome, type RouteContext, type RouterConfig, type RouterEntry, type RouterIntents, type RouterOutput, RoutingError, type RoutingErrorOptions, type RunFrame, SDKAdapterContract, SENSITIVE_HEADERS, SSE_DONE, type SaveSkillInput, type SaveSkillResult, type SaveSkillToolDeps, SchemaValidationError, type SchemaValidationErrorOptions, type SemanticCacheOptions, type SemanticMemoryConfig, type ServableExecutable, type ServeOptions, type SessionContextOverrides, type SessionContract, type SessionLock, type SessionSendResult, type SkillAnalyticsEvent, type SkillCatalogEntry, type SkillInjectMode, type SkillRecord, type SkillReviewGate, type SkillSource, type SkillsConfig, type SkillsContract, type SkillsStoreContract, type SnapshotStore, type SpawnSubAgentSpec, type SpeechData, SpeechGenerationResponse, SpeechModelConfig, SpeechModelContract, SpeechModelPricing, SpeechOptions, type SpeechParams, type SpeechReport, type SpeechResult, type StepAgentInput, type StepDefinition, StepFailedError, type StepFailedErrorOptions, type StepLocalEvents, type StepOutputSpec, type StepSnapshot, StorageFileShape, type StreamContract, type StreamController, type StreamEvent, type StreamEventBody, type StreamLike, type StreamObjectParams, StreamingToolGuardConfig, type SummarizeCallback, type SummarizeConfig, type SupervisorAgentCompletedPayload, type SupervisorAgentFailedPayload, type SupervisorAgentStartingPayload, type SupervisorAgentStreamingPayload, type SupervisorAsToolOptions, SupervisorCancelledError, type SupervisorCancelledErrorOptions, type SupervisorCancelledPayload, type SupervisorCompletedPayload, type SupervisorConfig, type SupervisorContract, SupervisorDriftError, type SupervisorDriftErrorOptions, SupervisorEmitter, type SupervisorErrorPayload, type SupervisorEvaluateVerdictPayload, type SupervisorEventHandler, type SupervisorEventHandlers, type SupervisorEventMap, type SupervisorExecuteOptions, SupervisorExecution, SupervisorFailedError, type SupervisorInput, type SupervisorIntentValue, type SupervisorIterationCompletedPayload, type SupervisorIterationStartingPayload, type SupervisorReport, type SupervisorResult, type SupervisorResumeOptions, type SupervisorRouterDecidedPayload, type SupervisorRouterDecidingPayload, SupervisorRoutingError, type SupervisorRoutingErrorOptions, type SupervisorSnapshot, type SupervisorSnapshotStatus, type SupervisorStartingPayload, type SupervisorStreamController, type SupervisorStreamEvent, type SupervisorTerminatedBy, type SyncGuardrailDetector, SystemPrompt, SystemPromptBlockContract, SystemPromptContract, SystemPromptMergeOptions, SystemPromptMergeSource, SystemPromptMeta, type TeamConfig, type TeamGate, type TeamGateFn, type TeamMemberValue, type TextInput, type ToolCall, ToolConfig, ToolContext, type ToolContract, type ToolEventMeta, ToolExecutionError, type ToolExecutionErrorOptions, type ToolInvokeResult, ToolMeta, ToolMode, type TopicFilterOptions, TranscribeOptions, type TranscribeParams, type TranscriptionData, TranscriptionModelConfig, TranscriptionModelContract, TranscriptionModelPricing, type TranscriptionReport, TranscriptionResponse, type TranscriptionResult, TranscriptionSegment, type TurnSnapshot, type Usage, type UsageEvent, VcrCassetteMissError, type VcrCassetteMissErrorOptions, type VcrMode, type VcrModel, type VcrOptions, type VectorStore, type WithoutIdentity, WorkflowCancelledError, type WorkflowCancelledErrorOptions, type WorkflowCancelledPayload, type WorkflowCompletedPayload, type WorkflowContext, type WorkflowDefinition, WorkflowDriftError, type WorkflowDriftErrorOptions, WorkflowError, type WorkflowErrorPayload, type WorkflowEventHandler, type WorkflowEventHandlers, type WorkflowEventMap, type WorkflowExecuteOptions, type WorkflowInstance, type WorkflowLoopWarningPayload, type WorkflowReport, type WorkflowResult, type WorkflowResumeOptions, type WorkflowRunOptions, type WorkflowSnapshot, type WorkflowStartingPayload, type WorkflowStepCompletedPayload, type WorkflowStepFailedPayload, type WorkflowStepRetryingPayload, type WorkflowStepSkippedPayload, type WorkflowStepStartingPayload, type WorkflowStepStreamingPayload, accumulateCost, agent, ai, approximateTokenCount, assertUrlAllowed, audioFromBuffer, audioFromFile, audioMediaTypeForFilename, batch, bm25Rank, budget, buildCatalog, buildPlanSystemPrompt, buildRouterContextMessage, cacheVectorStore, captureChildReport, memory as checkpointMemory, pg as checkpointPg, redis as checkpointRedis, chunk, collectStreamObject, composeMiddleware, computeCost, computeImageCost, computeOrchestratorSignature, computeSignature as computePlannerSignature, computeSignature$1 as computeSignature, computeSignature$2 as computeSupervisorSignature, contains, createAgentStream, createCommandDispatcher as createOrchestratorCommandDispatcher, createOrchestratorStream, createCancelledError as createSupervisorCancelledError, createSupervisorStream, currentRunFrame, dataset, defaultPromptsManager, diff, directorySource, encodeSSE, evalScorers, evaluatePolicy, exact, executableToTool, extractJsonLenient, extractJsonPayload, extractJsonSchema, extractUserText, fallbackModel, fanOut, fetchTextWithPolicy, forTool, formatCriteria, fromJSON, generateRunId, getAIConfig, getObservers, guard, guardedFetch, guardrail, hashRequest, humanApproval, hybridRank, image, inProcessSessionLock, injectMemories as injectOrchestratorMemories, injection, instruction, memory$1 as interruptMemory, pg$1 as interruptPg, redis$1 as interruptRedis, isExecutableTool, isObserveAll, isPrivateOrReservedIp, judge, judgePromptBody, keywordReranker, llmReranker, loadHtml, loadPdf, loadRecord, loadSkillTool, loadSnapshotForResume as loadSupervisorSnapshotForResume, loadText, loadWeb, matchConverge, matchOutputShape, matchPassStep, matchRouteTo, memory$2 as memory, mergeUsage, mockAgent, mockRouter, moderation, multiQuery, namespacedState, noopSessionLock, normalizeAgentTools, onConfigApplied, orchestrator, asTool as orchestratorAsTool, memoryQueryFromInput as orchestratorMemoryQueryFromInput, outcomeTextFromTurn as orchestratorOutcomeTextFromTurn, parseFrontmatter, parsePartialJson, parseTags, persistSupervisorSnapshot, persona, pgVectorStore, pii, planSchema, planner, predicate, prepareAttachmentPart, proceduralSkillStore, prompt, promptKey, prompts, rag, readBudgetFallbackSignal, readTextCapped, recallForTurn as recallOrchestratorMemory, reciprocalRankFusion, redact, redactError, redactHeaders, registerAiMatchers, registerObserver, rememberTurnOutcome as rememberOrchestratorTurnOutcome, renderCatalogPrompt, renderPlaceholders, resolveAttachment, resolveDefaultCheckpointStore, resolveDefaultSnapshotStore, resolveDefaultStore, resolveIntentEntries, resolveObservers, resolveOrchestratorMemory, resolveOutboundPolicy, resolveSource, resume, router, runEval, runResume as runOrchestratorResume, runTurn as runOrchestratorTurn, runPipeline, runReviewGate, safeJsonParse, saveSkillTool, scrubSecrets, semanticCache, semanticPreselect, serve, setAIConfig, setObserveAll, skills, memory$3 as snapshotMemory, pg$2 as snapshotPg, redis$2 as snapshotRedis, spawnSubAgent, speech, stampReportLineage, step, storeSource, streamObject, streamTurn as streamOrchestratorTurn, streamToSSE, supervisor, asTool$1 as supervisorAsTool, systemPrompt, team, toJSON, toJUnit, tool, topic, transcribe, urlSource, vcr, vectorLiteral, withRunFrame, withoutRunFrame, workflow };
|
|
315
316
|
import "./ai.mjs";
|
|
316
317
|
import "./config.mjs";
|
|
317
318
|
import "./testing/matchers.mjs";
|
package/esm/index.mjs
CHANGED
|
@@ -169,6 +169,7 @@ import { Instruction, instruction } from "./system-prompt/instruction.mjs";
|
|
|
169
169
|
import { Persona, persona } from "./system-prompt/persona.mjs";
|
|
170
170
|
import { RefinedSystemPrompt } from "./system-prompt/refined-system-prompt.mjs";
|
|
171
171
|
import { SystemPrompt, systemPrompt } from "./system-prompt/system-prompt.mjs";
|
|
172
|
+
import { formatCriteria, judgePromptBody } from "./prompts/prompts-validate.mjs";
|
|
172
173
|
import { defaultPromptsManager, promptKey, prompts } from "./prompts/prompts-manager.mjs";
|
|
173
174
|
import { chunk } from "./rag/chunk/chunk.mjs";
|
|
174
175
|
import { cacheVectorStore } from "./rag/store/cache-vector-store.mjs";
|
|
@@ -215,4 +216,4 @@ import "./workflow/index.mjs";
|
|
|
215
216
|
import { matchConverge, matchOutputShape, matchPassStep, matchRouteTo } from "./testing/matcher-logic.mjs";
|
|
216
217
|
import { registerAiMatchers } from "./testing/register-lazy.mjs";
|
|
217
218
|
|
|
218
|
-
export { AIError, AgentCancelledError, AgentDriftError, AgentExecutionError, AgentMaxTripsError, ApprovalRejectedError, BudgetExceededError, ContentFilterError, ContextLengthExceededError, DEFAULT_HASH_OPTIONS, DEFAULT_SENSITIVE_KEYS, END, GuardrailViolationError, Instruction, InterruptSuspendedError, InvalidRequestError, JUDGE_DEFAULT_REPAIR_ATTEMPTS, MaxIterationsError, MaxStepsExceededError, MockImageModel, MockModel, MockSDK, MockSkillsStore, MockSpeechModel, MockTranscriptionModel, OPENAI_INSTALL_INSTRUCTIONS, OrchestratorCancelledError, OrchestratorConfigError, OrchestratorDriftError, OrchestratorEmitter, OrchestratorExecution, OrchestratorFailedError, OutboundPolicyError, PDF_PARSE_INSTALL_INSTRUCTIONS, Persona, PlannerCancelledError, PlannerDriftError, PlannerFailedError, PlannerPlanInvalidError, PromptNotFoundError, PromptRefinementError, PromptValidationError, ProviderAuthError, ProviderError, ProviderRateLimitError, ProviderTimeoutError, QuotaExceededError, REPORT_SCHEMA_VERSION, RefinedSystemPrompt, RoutingError, SENSITIVE_HEADERS, SSE_DONE, SchemaValidationError, StepFailedError, SupervisorCancelledError, SupervisorDriftError, SupervisorEmitter, SupervisorExecution, SupervisorFailedError, SupervisorRoutingError, SystemPrompt, ToolExecutionError, VcrCassetteMissError, WorkflowCancelledError, WorkflowDriftError, WorkflowError, accumulateCost, agent, ai, approximateTokenCount, assertUrlAllowed, audioFromBuffer, audioFromFile, audioMediaTypeForFilename, batch, bm25Rank, budget, buildCatalog, buildPlanSystemPrompt, buildRouterContextMessage, cacheVectorStore, captureChildReport, memory as checkpointMemory, pg as checkpointPg, redis as checkpointRedis, chunk, collectStreamObject, composeMiddleware, computeCost, computeImageCost, computeOrchestratorSignature, computeSignature as computePlannerSignature, computeSignature$1 as computeSignature, computeSignature$2 as computeSupervisorSignature, contains, createAgentStream, createCommandDispatcher as createOrchestratorCommandDispatcher, createOrchestratorStream, createCancelledError as createSupervisorCancelledError, createSupervisorStream, currentRunFrame, dataset, defaultPromptsManager, diff, directorySource, encodeSSE, evalScorers, evaluatePolicy, exact, executableToTool, extractJsonLenient, extractJsonPayload, extractJsonSchema, extractUserText, fallbackModel, fanOut, fetchTextWithPolicy, forTool, fromJSON, generateRunId, getAIConfig, getObservers, guard, guardedFetch, guardrail, hashRequest, humanApproval, hybridRank, image, inProcessSessionLock, injectMemories as injectOrchestratorMemories, injection, instruction, memory$1 as interruptMemory, pg$1 as interruptPg, redis$1 as interruptRedis, isExecutableTool, isObserveAll, isPrivateOrReservedIp, judge, keywordReranker, llmReranker, loadHtml, loadPdf, loadRecord, loadSkillTool, loadSnapshotForResume as loadSupervisorSnapshotForResume, loadText, loadWeb, matchConverge, matchOutputShape, matchPassStep, matchRouteTo, memory$2 as memory, mergeUsage, mockAgent, mockRouter, moderation, multiQuery, namespacedState, noopSessionLock, normalizeAgentTools, onConfigApplied, orchestrator, asTool as orchestratorAsTool, memoryQueryFromInput as orchestratorMemoryQueryFromInput, outcomeTextFromTurn as orchestratorOutcomeTextFromTurn, parseFrontmatter, parsePartialJson, parseTags, persistSupervisorSnapshot, persona, pgVectorStore, pii, planSchema, planner, predicate, prepareAttachmentPart, proceduralSkillStore, prompt, promptKey, prompts, rag, readBudgetFallbackSignal, readTextCapped, recallForTurn as recallOrchestratorMemory, reciprocalRankFusion, redact, redactError, redactHeaders, registerAiMatchers, registerObserver, rememberTurnOutcome as rememberOrchestratorTurnOutcome, renderCatalogPrompt, renderPlaceholders, resolveAttachment, resolveDefaultCheckpointStore, resolveDefaultSnapshotStore, resolveDefaultStore, resolveIntentEntries, resolveObservers, resolveOrchestratorMemory, resolveOutboundPolicy, resolveSource, resume, router, runEval, runResume as runOrchestratorResume, runTurn as runOrchestratorTurn, runPipeline, runReviewGate, safeJsonParse, saveSkillTool, scrubSecrets, semanticCache, semanticPreselect, serve, setAIConfig, setObserveAll, skills, memory$3 as snapshotMemory, pg$2 as snapshotPg, redis$2 as snapshotRedis, spawnSubAgent, speech, stampReportLineage, step, storeSource, streamObject, streamTurn as streamOrchestratorTurn, streamToSSE, supervisor, asTool$1 as supervisorAsTool, systemPrompt, team, toJSON, toJUnit, tool, topic, transcribe, urlSource, vcr, vectorLiteral, withRunFrame, withoutRunFrame, workflow };
|
|
219
|
+
export { AIError, AgentCancelledError, AgentDriftError, AgentExecutionError, AgentMaxTripsError, ApprovalRejectedError, BudgetExceededError, ContentFilterError, ContextLengthExceededError, DEFAULT_HASH_OPTIONS, DEFAULT_SENSITIVE_KEYS, END, GuardrailViolationError, Instruction, InterruptSuspendedError, InvalidRequestError, JUDGE_DEFAULT_REPAIR_ATTEMPTS, MaxIterationsError, MaxStepsExceededError, MockImageModel, MockModel, MockSDK, MockSkillsStore, MockSpeechModel, MockTranscriptionModel, OPENAI_INSTALL_INSTRUCTIONS, OrchestratorCancelledError, OrchestratorConfigError, OrchestratorDriftError, OrchestratorEmitter, OrchestratorExecution, OrchestratorFailedError, OutboundPolicyError, PDF_PARSE_INSTALL_INSTRUCTIONS, Persona, PlannerCancelledError, PlannerDriftError, PlannerFailedError, PlannerPlanInvalidError, PromptNotFoundError, PromptRefinementError, PromptValidationError, ProviderAuthError, ProviderError, ProviderRateLimitError, ProviderTimeoutError, QuotaExceededError, REPORT_SCHEMA_VERSION, RefinedSystemPrompt, RoutingError, SENSITIVE_HEADERS, SSE_DONE, SchemaValidationError, StepFailedError, SupervisorCancelledError, SupervisorDriftError, SupervisorEmitter, SupervisorExecution, SupervisorFailedError, SupervisorRoutingError, SystemPrompt, ToolExecutionError, VcrCassetteMissError, WorkflowCancelledError, WorkflowDriftError, WorkflowError, accumulateCost, agent, ai, approximateTokenCount, assertUrlAllowed, audioFromBuffer, audioFromFile, audioMediaTypeForFilename, batch, bm25Rank, budget, buildCatalog, buildPlanSystemPrompt, buildRouterContextMessage, cacheVectorStore, captureChildReport, memory as checkpointMemory, pg as checkpointPg, redis as checkpointRedis, chunk, collectStreamObject, composeMiddleware, computeCost, computeImageCost, computeOrchestratorSignature, computeSignature as computePlannerSignature, computeSignature$1 as computeSignature, computeSignature$2 as computeSupervisorSignature, contains, createAgentStream, createCommandDispatcher as createOrchestratorCommandDispatcher, createOrchestratorStream, createCancelledError as createSupervisorCancelledError, createSupervisorStream, currentRunFrame, dataset, defaultPromptsManager, diff, directorySource, encodeSSE, evalScorers, evaluatePolicy, exact, executableToTool, extractJsonLenient, extractJsonPayload, extractJsonSchema, extractUserText, fallbackModel, fanOut, fetchTextWithPolicy, forTool, formatCriteria, fromJSON, generateRunId, getAIConfig, getObservers, guard, guardedFetch, guardrail, hashRequest, humanApproval, hybridRank, image, inProcessSessionLock, injectMemories as injectOrchestratorMemories, injection, instruction, memory$1 as interruptMemory, pg$1 as interruptPg, redis$1 as interruptRedis, isExecutableTool, isObserveAll, isPrivateOrReservedIp, judge, judgePromptBody, keywordReranker, llmReranker, loadHtml, loadPdf, loadRecord, loadSkillTool, loadSnapshotForResume as loadSupervisorSnapshotForResume, loadText, loadWeb, matchConverge, matchOutputShape, matchPassStep, matchRouteTo, memory$2 as memory, mergeUsage, mockAgent, mockRouter, moderation, multiQuery, namespacedState, noopSessionLock, normalizeAgentTools, onConfigApplied, orchestrator, asTool as orchestratorAsTool, memoryQueryFromInput as orchestratorMemoryQueryFromInput, outcomeTextFromTurn as orchestratorOutcomeTextFromTurn, parseFrontmatter, parsePartialJson, parseTags, persistSupervisorSnapshot, persona, pgVectorStore, pii, planSchema, planner, predicate, prepareAttachmentPart, proceduralSkillStore, prompt, promptKey, prompts, rag, readBudgetFallbackSignal, readTextCapped, recallForTurn as recallOrchestratorMemory, reciprocalRankFusion, redact, redactError, redactHeaders, registerAiMatchers, registerObserver, rememberTurnOutcome as rememberOrchestratorTurnOutcome, renderCatalogPrompt, renderPlaceholders, resolveAttachment, resolveDefaultCheckpointStore, resolveDefaultSnapshotStore, resolveDefaultStore, resolveIntentEntries, resolveObservers, resolveOrchestratorMemory, resolveOutboundPolicy, resolveSource, resume, router, runEval, runResume as runOrchestratorResume, runTurn as runOrchestratorTurn, runPipeline, runReviewGate, safeJsonParse, saveSkillTool, scrubSecrets, semanticCache, semanticPreselect, serve, setAIConfig, setObserveAll, skills, memory$3 as snapshotMemory, pg$2 as snapshotPg, redis$2 as snapshotRedis, spawnSubAgent, speech, stampReportLineage, step, storeSource, streamObject, streamTurn as streamOrchestratorTurn, streamToSSE, supervisor, asTool$1 as supervisorAsTool, systemPrompt, team, toJSON, toJUnit, tool, topic, transcribe, urlSource, vcr, vectorLiteral, withRunFrame, withoutRunFrame, workflow };
|
package/esm/memory/derive-id.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-id.mjs","names":[],"sources":["
|
|
1
|
+
{"version":3,"file":"derive-id.mjs","names":[],"sources":["../../../../../../../ai/src/memory/derive-id.ts"],"sourcesContent":["/**\n * Derive a stable memory id from its text when the caller didn't supply\n * one. Re-remembering identical text therefore lands on the same id and\n * overwrites in place rather than duplicating.\n *\n * FNV-1a variant — cheap, dependency-free, collision-resistant enough\n * for de-duplicating memory entries. NOT cryptographic: a collision\n * would merge two distinct memories, not breach security in the current\n * trust model. Mirrors the prompt hash in\n * `middleware/builtins/semantic-cache.ts`.\n */\nexport function deriveMemoryId(text: string): string {\n let hash = 0x811c9dc5;\n\n for (let index = 0; index < text.length; index++) {\n hash ^= text.charCodeAt(index);\n hash = Math.imul(hash, 0x01000193);\n }\n\n return (hash >>> 0).toString(16);\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,eAAe,MAAsB;CACnD,IAAI,OAAO;CAEX,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,QAAQ,KAAK,WAAW,KAAK;EAC7B,OAAO,KAAK,KAAK,MAAM,QAAU;CACnC;CAEA,QAAQ,SAAS,EAAC,CAAE,SAAS,EAAE;AACjC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { deriveMemoryId } from "./derive-id.mjs";
|
|
2
2
|
|
|
3
|
-
//#region
|
|
3
|
+
//#region ../ai/src/memory/episodic-memory.ts
|
|
4
4
|
/**
|
|
5
5
|
* How many extra candidates to pull from `similar()` before re-ranking by
|
|
6
6
|
* the recency-blended score and slicing to `k`. Recency can promote a
|