@vauban-org/agent-sdk 0.16.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/CONTRACT.md +6968 -0
- package/README.md +205 -0
- package/dist/adapters/hitl/memory-state-store.d.ts +23 -0
- package/dist/adapters/hitl/memory-state-store.d.ts.map +1 -0
- package/dist/adapters/hitl/memory-state-store.js +72 -0
- package/dist/adapters/hitl/memory-state-store.js.map +1 -0
- package/dist/adapters/hitl/postgres-state-store.d.ts +29 -0
- package/dist/adapters/hitl/postgres-state-store.d.ts.map +1 -0
- package/dist/adapters/hitl/postgres-state-store.js +103 -0
- package/dist/adapters/hitl/postgres-state-store.js.map +1 -0
- package/dist/adapters/llm/anthropic-direct.d.ts +28 -0
- package/dist/adapters/llm/anthropic-direct.d.ts.map +1 -0
- package/dist/adapters/llm/anthropic-direct.js +163 -0
- package/dist/adapters/llm/anthropic-direct.js.map +1 -0
- package/dist/adapters/llm/cascade.d.ts +27 -0
- package/dist/adapters/llm/cascade.d.ts.map +1 -0
- package/dist/adapters/llm/cascade.js +88 -0
- package/dist/adapters/llm/cascade.js.map +1 -0
- package/dist/adapters/llm/litellm.d.ts +28 -0
- package/dist/adapters/llm/litellm.d.ts.map +1 -0
- package/dist/adapters/llm/litellm.js +239 -0
- package/dist/adapters/llm/litellm.js.map +1 -0
- package/dist/adapters/messaging/console.d.ts +32 -0
- package/dist/adapters/messaging/console.d.ts.map +1 -0
- package/dist/adapters/messaging/console.js +47 -0
- package/dist/adapters/messaging/console.js.map +1 -0
- package/dist/adapters/messaging/discord.d.ts +34 -0
- package/dist/adapters/messaging/discord.d.ts.map +1 -0
- package/dist/adapters/messaging/discord.js +86 -0
- package/dist/adapters/messaging/discord.js.map +1 -0
- package/dist/adapters/messaging/mcp.d.ts +53 -0
- package/dist/adapters/messaging/mcp.d.ts.map +1 -0
- package/dist/adapters/messaging/mcp.js +43 -0
- package/dist/adapters/messaging/mcp.js.map +1 -0
- package/dist/adapters/messaging/slack.d.ts +21 -0
- package/dist/adapters/messaging/slack.d.ts.map +1 -0
- package/dist/adapters/messaging/slack.js +71 -0
- package/dist/adapters/messaging/slack.js.map +1 -0
- package/dist/adapters/messaging/telegram.d.ts +31 -0
- package/dist/adapters/messaging/telegram.d.ts.map +1 -0
- package/dist/adapters/messaging/telegram.js +85 -0
- package/dist/adapters/messaging/telegram.js.map +1 -0
- package/dist/adapters/registry/memory.d.ts +40 -0
- package/dist/adapters/registry/memory.d.ts.map +1 -0
- package/dist/adapters/registry/memory.js +71 -0
- package/dist/adapters/registry/memory.js.map +1 -0
- package/dist/adapters/registry/postgres.d.ts +39 -0
- package/dist/adapters/registry/postgres.d.ts.map +1 -0
- package/dist/adapters/registry/postgres.js +124 -0
- package/dist/adapters/registry/postgres.js.map +1 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +3 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/trading.d.ts +99 -0
- package/dist/agents/trading.d.ts.map +1 -0
- package/dist/agents/trading.js +39 -0
- package/dist/agents/trading.js.map +1 -0
- package/dist/auth/errors.d.ts +38 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/errors.js +57 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/auth/nonce-store.d.ts +52 -0
- package/dist/auth/nonce-store.d.ts.map +1 -0
- package/dist/auth/nonce-store.js +55 -0
- package/dist/auth/nonce-store.js.map +1 -0
- package/dist/auth/sign-event.d.ts +28 -0
- package/dist/auth/sign-event.d.ts.map +1 -0
- package/dist/auth/sign-event.js +42 -0
- package/dist/auth/sign-event.js.map +1 -0
- package/dist/auth/verify-event.d.ts +36 -0
- package/dist/auth/verify-event.d.ts.map +1 -0
- package/dist/auth/verify-event.js +78 -0
- package/dist/auth/verify-event.js.map +1 -0
- package/dist/boot/init-sdk.d.ts +69 -0
- package/dist/boot/init-sdk.d.ts.map +1 -0
- package/dist/boot/init-sdk.js +53 -0
- package/dist/boot/init-sdk.js.map +1 -0
- package/dist/boot/load-agent-context.d.ts +82 -0
- package/dist/boot/load-agent-context.d.ts.map +1 -0
- package/dist/boot/load-agent-context.js +90 -0
- package/dist/boot/load-agent-context.js.map +1 -0
- package/dist/boot/load-recent-memory.d.ts +47 -0
- package/dist/boot/load-recent-memory.d.ts.map +1 -0
- package/dist/boot/load-recent-memory.js +56 -0
- package/dist/boot/load-recent-memory.js.map +1 -0
- package/dist/budget/budget-state.d.ts +88 -0
- package/dist/budget/budget-state.d.ts.map +1 -0
- package/dist/budget/budget-state.js +172 -0
- package/dist/budget/budget-state.js.map +1 -0
- package/dist/budget/index.d.ts +3 -0
- package/dist/budget/index.d.ts.map +1 -0
- package/dist/budget/index.js +2 -0
- package/dist/budget/index.js.map +1 -0
- package/dist/clients/agents.d.ts +40 -0
- package/dist/clients/agents.d.ts.map +1 -0
- package/dist/clients/agents.js +85 -0
- package/dist/clients/agents.js.map +1 -0
- package/dist/clients/index.d.ts +7 -0
- package/dist/clients/index.d.ts.map +1 -0
- package/dist/clients/index.js +7 -0
- package/dist/clients/index.js.map +1 -0
- package/dist/clients/messaging-adapters.d.ts +51 -0
- package/dist/clients/messaging-adapters.d.ts.map +1 -0
- package/dist/clients/messaging-adapters.js +118 -0
- package/dist/clients/messaging-adapters.js.map +1 -0
- package/dist/clients/pipelines.d.ts +43 -0
- package/dist/clients/pipelines.d.ts.map +1 -0
- package/dist/clients/pipelines.js +96 -0
- package/dist/clients/pipelines.js.map +1 -0
- package/dist/compute/strategies/best-of-n.d.ts +46 -0
- package/dist/compute/strategies/best-of-n.d.ts.map +1 -0
- package/dist/compute/strategies/best-of-n.js +112 -0
- package/dist/compute/strategies/best-of-n.js.map +1 -0
- package/dist/compute/strategies/bon-mav.d.ts +65 -0
- package/dist/compute/strategies/bon-mav.d.ts.map +1 -0
- package/dist/compute/strategies/bon-mav.js +154 -0
- package/dist/compute/strategies/bon-mav.js.map +1 -0
- package/dist/compute/strategies/single-shot.d.ts +17 -0
- package/dist/compute/strategies/single-shot.d.ts.map +1 -0
- package/dist/compute/strategies/single-shot.js +36 -0
- package/dist/compute/strategies/single-shot.js.map +1 -0
- package/dist/compute/types.d.ts +30 -0
- package/dist/compute/types.d.ts.map +1 -0
- package/dist/compute/types.js +8 -0
- package/dist/compute/types.js.map +1 -0
- package/dist/compute/verifier.d.ts +55 -0
- package/dist/compute/verifier.d.ts.map +1 -0
- package/dist/compute/verifier.js +35 -0
- package/dist/compute/verifier.js.map +1 -0
- package/dist/compute/with-compute.d.ts +50 -0
- package/dist/compute/with-compute.d.ts.map +1 -0
- package/dist/compute/with-compute.js +69 -0
- package/dist/compute/with-compute.js.map +1 -0
- package/dist/constitution/axioms.d.ts +65 -0
- package/dist/constitution/axioms.d.ts.map +1 -0
- package/dist/constitution/axioms.js +496 -0
- package/dist/constitution/axioms.js.map +1 -0
- package/dist/constitution/gate.d.ts +47 -0
- package/dist/constitution/gate.d.ts.map +1 -0
- package/dist/constitution/gate.js +143 -0
- package/dist/constitution/gate.js.map +1 -0
- package/dist/constitution/index.d.ts +20 -0
- package/dist/constitution/index.d.ts.map +1 -0
- package/dist/constitution/index.js +15 -0
- package/dist/constitution/index.js.map +1 -0
- package/dist/constitution/scorer.d.ts +67 -0
- package/dist/constitution/scorer.d.ts.map +1 -0
- package/dist/constitution/scorer.js +111 -0
- package/dist/constitution/scorer.js.map +1 -0
- package/dist/constitution/signal.d.ts +41 -0
- package/dist/constitution/signal.d.ts.map +1 -0
- package/dist/constitution/signal.js +61 -0
- package/dist/constitution/signal.js.map +1 -0
- package/dist/constitution/types.d.ts +295 -0
- package/dist/constitution/types.d.ts.map +1 -0
- package/dist/constitution/types.js +59 -0
- package/dist/constitution/types.js.map +1 -0
- package/dist/counterfactual/index.d.ts +11 -0
- package/dist/counterfactual/index.d.ts.map +1 -0
- package/dist/counterfactual/index.js +10 -0
- package/dist/counterfactual/index.js.map +1 -0
- package/dist/counterfactual/replay-with-alt.d.ts +137 -0
- package/dist/counterfactual/replay-with-alt.d.ts.map +1 -0
- package/dist/counterfactual/replay-with-alt.js +191 -0
- package/dist/counterfactual/replay-with-alt.js.map +1 -0
- package/dist/dataops/index.d.ts +5 -0
- package/dist/dataops/index.d.ts.map +1 -0
- package/dist/dataops/index.js +3 -0
- package/dist/dataops/index.js.map +1 -0
- package/dist/dataops/starkscan.d.ts +13 -0
- package/dist/dataops/starkscan.d.ts.map +1 -0
- package/dist/dataops/starkscan.js +12 -0
- package/dist/dataops/starkscan.js.map +1 -0
- package/dist/dataops/voyager.d.ts +58 -0
- package/dist/dataops/voyager.d.ts.map +1 -0
- package/dist/dataops/voyager.js +146 -0
- package/dist/dataops/voyager.js.map +1 -0
- package/dist/deprecation.d.ts +49 -0
- package/dist/deprecation.d.ts.map +1 -0
- package/dist/deprecation.js +84 -0
- package/dist/deprecation.js.map +1 -0
- package/dist/durable/bullmq-runner.d.ts +138 -0
- package/dist/durable/bullmq-runner.d.ts.map +1 -0
- package/dist/durable/bullmq-runner.js +378 -0
- package/dist/durable/bullmq-runner.js.map +1 -0
- package/dist/durable/index.d.ts +3 -0
- package/dist/durable/index.d.ts.map +1 -0
- package/dist/durable/index.js +2 -0
- package/dist/durable/index.js.map +1 -0
- package/dist/economy/circuit-breaker.d.ts +37 -0
- package/dist/economy/circuit-breaker.d.ts.map +1 -0
- package/dist/economy/circuit-breaker.js +104 -0
- package/dist/economy/circuit-breaker.js.map +1 -0
- package/dist/economy/economy-router.d.ts +103 -0
- package/dist/economy/economy-router.d.ts.map +1 -0
- package/dist/economy/economy-router.js +176 -0
- package/dist/economy/economy-router.js.map +1 -0
- package/dist/economy/index.d.ts +16 -0
- package/dist/economy/index.d.ts.map +1 -0
- package/dist/economy/index.js +11 -0
- package/dist/economy/index.js.map +1 -0
- package/dist/economy/outcome-tracker.d.ts +90 -0
- package/dist/economy/outcome-tracker.d.ts.map +1 -0
- package/dist/economy/outcome-tracker.js +172 -0
- package/dist/economy/outcome-tracker.js.map +1 -0
- package/dist/economy/router.d.ts +97 -0
- package/dist/economy/router.d.ts.map +1 -0
- package/dist/economy/router.js +181 -0
- package/dist/economy/router.js.map +1 -0
- package/dist/economy/tier-policy.d.ts +46 -0
- package/dist/economy/tier-policy.d.ts.map +1 -0
- package/dist/economy/tier-policy.js +76 -0
- package/dist/economy/tier-policy.js.map +1 -0
- package/dist/errors.d.ts +102 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +135 -0
- package/dist/errors.js.map +1 -0
- package/dist/evals/datasets/index.d.ts +27 -0
- package/dist/evals/datasets/index.d.ts.map +1 -0
- package/dist/evals/datasets/index.js +279 -0
- package/dist/evals/datasets/index.js.map +1 -0
- package/dist/evals/harness.d.ts +52 -0
- package/dist/evals/harness.d.ts.map +1 -0
- package/dist/evals/harness.js +108 -0
- package/dist/evals/harness.js.map +1 -0
- package/dist/evals/index.d.ts +5 -0
- package/dist/evals/index.d.ts.map +1 -0
- package/dist/evals/index.js +3 -0
- package/dist/evals/index.js.map +1 -0
- package/dist/factory/agent-factory.d.ts +86 -0
- package/dist/factory/agent-factory.d.ts.map +1 -0
- package/dist/factory/agent-factory.js +119 -0
- package/dist/factory/agent-factory.js.map +1 -0
- package/dist/hitl/api.d.ts +38 -0
- package/dist/hitl/api.d.ts.map +1 -0
- package/dist/hitl/api.js +58 -0
- package/dist/hitl/api.js.map +1 -0
- package/dist/hitl/approval-channel.d.ts +84 -0
- package/dist/hitl/approval-channel.d.ts.map +1 -0
- package/dist/hitl/approval-channel.js +59 -0
- package/dist/hitl/approval-channel.js.map +1 -0
- package/dist/hitl/callback-handlers.d.ts +21 -0
- package/dist/hitl/callback-handlers.d.ts.map +1 -0
- package/dist/hitl/callback-handlers.js +30 -0
- package/dist/hitl/callback-handlers.js.map +1 -0
- package/dist/hitl/index.d.ts +3 -0
- package/dist/hitl/index.d.ts.map +1 -0
- package/dist/hitl/index.js +2 -0
- package/dist/hitl/index.js.map +1 -0
- package/dist/hitl/slack.d.ts +76 -0
- package/dist/hitl/slack.d.ts.map +1 -0
- package/dist/hitl/slack.js +243 -0
- package/dist/hitl/slack.js.map +1 -0
- package/dist/hitl/telegram.d.ts +74 -0
- package/dist/hitl/telegram.d.ts.map +1 -0
- package/dist/hitl/telegram.js +227 -0
- package/dist/hitl/telegram.js.map +1 -0
- package/dist/index.d.ts +173 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +147 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/parse-structured-output.d.ts +55 -0
- package/dist/llm/parse-structured-output.d.ts.map +1 -0
- package/dist/llm/parse-structured-output.js +80 -0
- package/dist/llm/parse-structured-output.js.map +1 -0
- package/dist/loop/index.d.ts +7 -0
- package/dist/loop/index.d.ts.map +1 -0
- package/dist/loop/index.js +5 -0
- package/dist/loop/index.js.map +1 -0
- package/dist/loop/minimal-loop.d.ts +81 -0
- package/dist/loop/minimal-loop.d.ts.map +1 -0
- package/dist/loop/minimal-loop.js +318 -0
- package/dist/loop/minimal-loop.js.map +1 -0
- package/dist/loop/sdk-loop.d.ts +103 -0
- package/dist/loop/sdk-loop.d.ts.map +1 -0
- package/dist/loop/sdk-loop.js +344 -0
- package/dist/loop/sdk-loop.js.map +1 -0
- package/dist/mcp/index.d.ts +38 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +113 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/metrics/create-agent-metrics.d.ts +78 -0
- package/dist/metrics/create-agent-metrics.d.ts.map +1 -0
- package/dist/metrics/create-agent-metrics.js +115 -0
- package/dist/metrics/create-agent-metrics.js.map +1 -0
- package/dist/orchestration/bulkhead.d.ts +70 -0
- package/dist/orchestration/bulkhead.d.ts.map +1 -0
- package/dist/orchestration/bulkhead.js +99 -0
- package/dist/orchestration/bulkhead.js.map +1 -0
- package/dist/orchestration/idempotency.d.ts +52 -0
- package/dist/orchestration/idempotency.d.ts.map +1 -0
- package/dist/orchestration/idempotency.js +93 -0
- package/dist/orchestration/idempotency.js.map +1 -0
- package/dist/orchestration/index.d.ts +16 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +15 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/ooda/agent-config-loader.d.ts +67 -0
- package/dist/orchestration/ooda/agent-config-loader.d.ts.map +1 -0
- package/dist/orchestration/ooda/agent-config-loader.js +65 -0
- package/dist/orchestration/ooda/agent-config-loader.js.map +1 -0
- package/dist/orchestration/ooda/agent.d.ts +54 -0
- package/dist/orchestration/ooda/agent.d.ts.map +1 -0
- package/dist/orchestration/ooda/agent.js +730 -0
- package/dist/orchestration/ooda/agent.js.map +1 -0
- package/dist/orchestration/ooda/audit-log.d.ts +26 -0
- package/dist/orchestration/ooda/audit-log.d.ts.map +1 -0
- package/dist/orchestration/ooda/audit-log.js +41 -0
- package/dist/orchestration/ooda/audit-log.js.map +1 -0
- package/dist/orchestration/ooda/brain-context.d.ts +121 -0
- package/dist/orchestration/ooda/brain-context.d.ts.map +1 -0
- package/dist/orchestration/ooda/brain-context.js +149 -0
- package/dist/orchestration/ooda/brain-context.js.map +1 -0
- package/dist/orchestration/ooda/child-agent.d.ts +55 -0
- package/dist/orchestration/ooda/child-agent.d.ts.map +1 -0
- package/dist/orchestration/ooda/child-agent.js +16 -0
- package/dist/orchestration/ooda/child-agent.js.map +1 -0
- package/dist/orchestration/ooda/cron-schedule.d.ts +26 -0
- package/dist/orchestration/ooda/cron-schedule.d.ts.map +1 -0
- package/dist/orchestration/ooda/cron-schedule.js +94 -0
- package/dist/orchestration/ooda/cron-schedule.js.map +1 -0
- package/dist/orchestration/ooda/debate.d.ts +68 -0
- package/dist/orchestration/ooda/debate.d.ts.map +1 -0
- package/dist/orchestration/ooda/debate.js +39 -0
- package/dist/orchestration/ooda/debate.js.map +1 -0
- package/dist/orchestration/ooda/economic-observer.d.ts +50 -0
- package/dist/orchestration/ooda/economic-observer.d.ts.map +1 -0
- package/dist/orchestration/ooda/economic-observer.js +36 -0
- package/dist/orchestration/ooda/economic-observer.js.map +1 -0
- package/dist/orchestration/ooda/errors.d.ts +21 -0
- package/dist/orchestration/ooda/errors.d.ts.map +1 -0
- package/dist/orchestration/ooda/errors.js +30 -0
- package/dist/orchestration/ooda/errors.js.map +1 -0
- package/dist/orchestration/ooda/execution-mode-guard.d.ts +24 -0
- package/dist/orchestration/ooda/execution-mode-guard.d.ts.map +1 -0
- package/dist/orchestration/ooda/execution-mode-guard.js +31 -0
- package/dist/orchestration/ooda/execution-mode-guard.js.map +1 -0
- package/dist/orchestration/ooda/factory.d.ts +12 -0
- package/dist/orchestration/ooda/factory.d.ts.map +1 -0
- package/dist/orchestration/ooda/factory.js +27 -0
- package/dist/orchestration/ooda/factory.js.map +1 -0
- package/dist/orchestration/ooda/guardrails.d.ts +65 -0
- package/dist/orchestration/ooda/guardrails.d.ts.map +1 -0
- package/dist/orchestration/ooda/guardrails.js +127 -0
- package/dist/orchestration/ooda/guardrails.js.map +1 -0
- package/dist/orchestration/ooda/guards/always-on.d.ts +15 -0
- package/dist/orchestration/ooda/guards/always-on.d.ts.map +1 -0
- package/dist/orchestration/ooda/guards/always-on.js +19 -0
- package/dist/orchestration/ooda/guards/always-on.js.map +1 -0
- package/dist/orchestration/ooda/guards/business-hours.d.ts +46 -0
- package/dist/orchestration/ooda/guards/business-hours.d.ts.map +1 -0
- package/dist/orchestration/ooda/guards/business-hours.js +78 -0
- package/dist/orchestration/ooda/guards/business-hours.js.map +1 -0
- package/dist/orchestration/ooda/guards/index.d.ts +14 -0
- package/dist/orchestration/ooda/guards/index.d.ts.map +1 -0
- package/dist/orchestration/ooda/guards/index.js +14 -0
- package/dist/orchestration/ooda/guards/index.js.map +1 -0
- package/dist/orchestration/ooda/guards/redis-circuit-breaker.d.ts +84 -0
- package/dist/orchestration/ooda/guards/redis-circuit-breaker.d.ts.map +1 -0
- package/dist/orchestration/ooda/guards/redis-circuit-breaker.js +96 -0
- package/dist/orchestration/ooda/guards/redis-circuit-breaker.js.map +1 -0
- package/dist/orchestration/ooda/guards/rth-session.d.ts +27 -0
- package/dist/orchestration/ooda/guards/rth-session.d.ts.map +1 -0
- package/dist/orchestration/ooda/guards/rth-session.js +95 -0
- package/dist/orchestration/ooda/guards/rth-session.js.map +1 -0
- package/dist/orchestration/ooda/handoff.d.ts +82 -0
- package/dist/orchestration/ooda/handoff.d.ts.map +1 -0
- package/dist/orchestration/ooda/handoff.js +86 -0
- package/dist/orchestration/ooda/handoff.js.map +1 -0
- package/dist/orchestration/ooda/hitl-gate.d.ts +57 -0
- package/dist/orchestration/ooda/hitl-gate.d.ts.map +1 -0
- package/dist/orchestration/ooda/hitl-gate.js +107 -0
- package/dist/orchestration/ooda/hitl-gate.js.map +1 -0
- package/dist/orchestration/ooda/index.d.ts +48 -0
- package/dist/orchestration/ooda/index.d.ts.map +1 -0
- package/dist/orchestration/ooda/index.js +33 -0
- package/dist/orchestration/ooda/index.js.map +1 -0
- package/dist/orchestration/ooda/inner-monologue.d.ts +69 -0
- package/dist/orchestration/ooda/inner-monologue.d.ts.map +1 -0
- package/dist/orchestration/ooda/inner-monologue.js +69 -0
- package/dist/orchestration/ooda/inner-monologue.js.map +1 -0
- package/dist/orchestration/ooda/learn.d.ts +60 -0
- package/dist/orchestration/ooda/learn.d.ts.map +1 -0
- package/dist/orchestration/ooda/learn.js +94 -0
- package/dist/orchestration/ooda/learn.js.map +1 -0
- package/dist/orchestration/ooda/multimodal.d.ts +91 -0
- package/dist/orchestration/ooda/multimodal.d.ts.map +1 -0
- package/dist/orchestration/ooda/multimodal.js +88 -0
- package/dist/orchestration/ooda/multimodal.js.map +1 -0
- package/dist/orchestration/ooda/phase-routing.d.ts +41 -0
- package/dist/orchestration/ooda/phase-routing.d.ts.map +1 -0
- package/dist/orchestration/ooda/phase-routing.js +43 -0
- package/dist/orchestration/ooda/phase-routing.js.map +1 -0
- package/dist/orchestration/ooda/plan-execute.d.ts +55 -0
- package/dist/orchestration/ooda/plan-execute.d.ts.map +1 -0
- package/dist/orchestration/ooda/plan-execute.js +41 -0
- package/dist/orchestration/ooda/plan-execute.js.map +1 -0
- package/dist/orchestration/ooda/react-loop.d.ts +96 -0
- package/dist/orchestration/ooda/react-loop.d.ts.map +1 -0
- package/dist/orchestration/ooda/react-loop.js +90 -0
- package/dist/orchestration/ooda/react-loop.js.map +1 -0
- package/dist/orchestration/ooda/reflexion.d.ts +56 -0
- package/dist/orchestration/ooda/reflexion.d.ts.map +1 -0
- package/dist/orchestration/ooda/reflexion.js +58 -0
- package/dist/orchestration/ooda/reflexion.js.map +1 -0
- package/dist/orchestration/ooda/resource-limits.d.ts +63 -0
- package/dist/orchestration/ooda/resource-limits.d.ts.map +1 -0
- package/dist/orchestration/ooda/resource-limits.js +107 -0
- package/dist/orchestration/ooda/resource-limits.js.map +1 -0
- package/dist/orchestration/ooda/run-step-persistence.d.ts +50 -0
- package/dist/orchestration/ooda/run-step-persistence.d.ts.map +1 -0
- package/dist/orchestration/ooda/run-step-persistence.js +89 -0
- package/dist/orchestration/ooda/run-step-persistence.js.map +1 -0
- package/dist/orchestration/ooda/skills.d.ts +58 -0
- package/dist/orchestration/ooda/skills.d.ts.map +1 -0
- package/dist/orchestration/ooda/skills.js +19 -0
- package/dist/orchestration/ooda/skills.js.map +1 -0
- package/dist/orchestration/ooda/structured-output.d.ts +46 -0
- package/dist/orchestration/ooda/structured-output.d.ts.map +1 -0
- package/dist/orchestration/ooda/structured-output.js +60 -0
- package/dist/orchestration/ooda/structured-output.js.map +1 -0
- package/dist/orchestration/ooda/types.d.ts +463 -0
- package/dist/orchestration/ooda/types.d.ts.map +1 -0
- package/dist/orchestration/ooda/types.js +38 -0
- package/dist/orchestration/ooda/types.js.map +1 -0
- package/dist/otel/attributes.d.ts +71 -0
- package/dist/otel/attributes.d.ts.map +1 -0
- package/dist/otel/attributes.js +56 -0
- package/dist/otel/attributes.js.map +1 -0
- package/dist/otel/index.d.ts +5 -0
- package/dist/otel/index.d.ts.map +1 -0
- package/dist/otel/index.js +5 -0
- package/dist/otel/index.js.map +1 -0
- package/dist/otel/ingest.d.ts +99 -0
- package/dist/otel/ingest.d.ts.map +1 -0
- package/dist/otel/ingest.js +192 -0
- package/dist/otel/ingest.js.map +1 -0
- package/dist/otel/trace-context.d.ts +48 -0
- package/dist/otel/trace-context.d.ts.map +1 -0
- package/dist/otel/trace-context.js +137 -0
- package/dist/otel/trace-context.js.map +1 -0
- package/dist/otel/types.d.ts +54 -0
- package/dist/otel/types.d.ts.map +1 -0
- package/dist/otel/types.js +12 -0
- package/dist/otel/types.js.map +1 -0
- package/dist/outcomes/client.d.ts +81 -0
- package/dist/outcomes/client.d.ts.map +1 -0
- package/dist/outcomes/client.js +98 -0
- package/dist/outcomes/client.js.map +1 -0
- package/dist/outcomes/compute-roi.d.ts +40 -0
- package/dist/outcomes/compute-roi.d.ts.map +1 -0
- package/dist/outcomes/compute-roi.js +58 -0
- package/dist/outcomes/compute-roi.js.map +1 -0
- package/dist/outcomes/index.d.ts +4 -0
- package/dist/outcomes/index.d.ts.map +1 -0
- package/dist/outcomes/index.js +4 -0
- package/dist/outcomes/index.js.map +1 -0
- package/dist/outcomes/meter.d.ts +73 -0
- package/dist/outcomes/meter.d.ts.map +1 -0
- package/dist/outcomes/meter.js +140 -0
- package/dist/outcomes/meter.js.map +1 -0
- package/dist/outcomes/trajectory.d.ts +53 -0
- package/dist/outcomes/trajectory.d.ts.map +1 -0
- package/dist/outcomes/trajectory.js +110 -0
- package/dist/outcomes/trajectory.js.map +1 -0
- package/dist/outcomes/types.d.ts +93 -0
- package/dist/outcomes/types.d.ts.map +1 -0
- package/dist/outcomes/types.js +8 -0
- package/dist/outcomes/types.js.map +1 -0
- package/dist/patterns/_shared/brain-logger.d.ts +12 -0
- package/dist/patterns/_shared/brain-logger.d.ts.map +1 -0
- package/dist/patterns/_shared/brain-logger.js +6 -0
- package/dist/patterns/_shared/brain-logger.js.map +1 -0
- package/dist/patterns/circuit-breaker/index.d.ts +3 -0
- package/dist/patterns/circuit-breaker/index.d.ts.map +1 -0
- package/dist/patterns/circuit-breaker/index.js +2 -0
- package/dist/patterns/circuit-breaker/index.js.map +1 -0
- package/dist/patterns/circuit-breaker/session-cb.d.ts +3 -0
- package/dist/patterns/circuit-breaker/session-cb.d.ts.map +1 -0
- package/dist/patterns/circuit-breaker/session-cb.js +175 -0
- package/dist/patterns/circuit-breaker/session-cb.js.map +1 -0
- package/dist/patterns/circuit-breaker/types.d.ts +68 -0
- package/dist/patterns/circuit-breaker/types.d.ts.map +1 -0
- package/dist/patterns/circuit-breaker/types.js +2 -0
- package/dist/patterns/circuit-breaker/types.js.map +1 -0
- package/dist/patterns/escalation/index.d.ts +3 -0
- package/dist/patterns/escalation/index.d.ts.map +1 -0
- package/dist/patterns/escalation/index.js +2 -0
- package/dist/patterns/escalation/index.js.map +1 -0
- package/dist/patterns/escalation/pyramid.d.ts +3 -0
- package/dist/patterns/escalation/pyramid.d.ts.map +1 -0
- package/dist/patterns/escalation/pyramid.js +86 -0
- package/dist/patterns/escalation/pyramid.js.map +1 -0
- package/dist/patterns/escalation/types.d.ts +46 -0
- package/dist/patterns/escalation/types.d.ts.map +1 -0
- package/dist/patterns/escalation/types.js +2 -0
- package/dist/patterns/escalation/types.js.map +1 -0
- package/dist/patterns/quality-gate/gate.d.ts +3 -0
- package/dist/patterns/quality-gate/gate.d.ts.map +1 -0
- package/dist/patterns/quality-gate/gate.js +73 -0
- package/dist/patterns/quality-gate/gate.js.map +1 -0
- package/dist/patterns/quality-gate/index.d.ts +3 -0
- package/dist/patterns/quality-gate/index.d.ts.map +1 -0
- package/dist/patterns/quality-gate/index.js +2 -0
- package/dist/patterns/quality-gate/index.js.map +1 -0
- package/dist/patterns/quality-gate/types.d.ts +41 -0
- package/dist/patterns/quality-gate/types.d.ts.map +1 -0
- package/dist/patterns/quality-gate/types.js +2 -0
- package/dist/patterns/quality-gate/types.js.map +1 -0
- package/dist/permissions/capability-gate.d.ts +57 -0
- package/dist/permissions/capability-gate.d.ts.map +1 -0
- package/dist/permissions/capability-gate.js +26 -0
- package/dist/permissions/capability-gate.js.map +1 -0
- package/dist/permissions/index.d.ts +3 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +2 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/permissions/renewal-manager.d.ts +49 -0
- package/dist/permissions/renewal-manager.d.ts.map +1 -0
- package/dist/permissions/renewal-manager.js +60 -0
- package/dist/permissions/renewal-manager.js.map +1 -0
- package/dist/permissions/sdk-permissions.d.ts +48 -0
- package/dist/permissions/sdk-permissions.d.ts.map +1 -0
- package/dist/permissions/sdk-permissions.js +94 -0
- package/dist/permissions/sdk-permissions.js.map +1 -0
- package/dist/ports/agent-registry.d.ts +95 -0
- package/dist/ports/agent-registry.d.ts.map +1 -0
- package/dist/ports/agent-registry.js +16 -0
- package/dist/ports/agent-registry.js.map +1 -0
- package/dist/ports/brain.d.ts +147 -0
- package/dist/ports/brain.d.ts.map +1 -0
- package/dist/ports/brain.js +105 -0
- package/dist/ports/brain.js.map +1 -0
- package/dist/ports/db.d.ts +8 -0
- package/dist/ports/db.d.ts.map +1 -0
- package/dist/ports/db.js +2 -0
- package/dist/ports/db.js.map +1 -0
- package/dist/ports/event-bus.d.ts +167 -0
- package/dist/ports/event-bus.d.ts.map +1 -0
- package/dist/ports/event-bus.js +25 -0
- package/dist/ports/event-bus.js.map +1 -0
- package/dist/ports/eviction-policy.d.ts +92 -0
- package/dist/ports/eviction-policy.d.ts.map +1 -0
- package/dist/ports/eviction-policy.js +120 -0
- package/dist/ports/eviction-policy.js.map +1 -0
- package/dist/ports/hitl.contract.test.d.ts +9 -0
- package/dist/ports/hitl.contract.test.d.ts.map +1 -0
- package/dist/ports/hitl.contract.test.js +100 -0
- package/dist/ports/hitl.contract.test.js.map +1 -0
- package/dist/ports/hitl.d.ts +91 -0
- package/dist/ports/hitl.d.ts.map +1 -0
- package/dist/ports/hitl.js +76 -0
- package/dist/ports/hitl.js.map +1 -0
- package/dist/ports/index.d.ts +19 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +4 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/key-provider.d.ts +113 -0
- package/dist/ports/key-provider.d.ts.map +1 -0
- package/dist/ports/key-provider.js +119 -0
- package/dist/ports/key-provider.js.map +1 -0
- package/dist/ports/llm-provider.contract.d.ts +24 -0
- package/dist/ports/llm-provider.contract.d.ts.map +1 -0
- package/dist/ports/llm-provider.contract.js +111 -0
- package/dist/ports/llm-provider.contract.js.map +1 -0
- package/dist/ports/llm-provider.d.ts +63 -0
- package/dist/ports/llm-provider.d.ts.map +1 -0
- package/dist/ports/llm-provider.js +13 -0
- package/dist/ports/llm-provider.js.map +1 -0
- package/dist/ports/logger.d.ts +18 -0
- package/dist/ports/logger.d.ts.map +1 -0
- package/dist/ports/logger.js +10 -0
- package/dist/ports/logger.js.map +1 -0
- package/dist/ports/messaging.contract.test.d.ts +22 -0
- package/dist/ports/messaging.contract.test.d.ts.map +1 -0
- package/dist/ports/messaging.contract.test.js +296 -0
- package/dist/ports/messaging.contract.test.js.map +1 -0
- package/dist/ports/messaging.d.ts +47 -0
- package/dist/ports/messaging.d.ts.map +1 -0
- package/dist/ports/messaging.js +24 -0
- package/dist/ports/messaging.js.map +1 -0
- package/dist/ports/outcome.d.ts +25 -0
- package/dist/ports/outcome.d.ts.map +1 -0
- package/dist/ports/outcome.js +9 -0
- package/dist/ports/outcome.js.map +1 -0
- package/dist/ports/timestamp.d.ts +53 -0
- package/dist/ports/timestamp.d.ts.map +1 -0
- package/dist/ports/timestamp.js +28 -0
- package/dist/ports/timestamp.js.map +1 -0
- package/dist/privacy/channel.d.ts +137 -0
- package/dist/privacy/channel.d.ts.map +1 -0
- package/dist/privacy/channel.js +196 -0
- package/dist/privacy/channel.js.map +1 -0
- package/dist/privacy/composition.d.ts +140 -0
- package/dist/privacy/composition.d.ts.map +1 -0
- package/dist/privacy/composition.js +182 -0
- package/dist/privacy/composition.js.map +1 -0
- package/dist/privacy/delegation.d.ts +87 -0
- package/dist/privacy/delegation.d.ts.map +1 -0
- package/dist/privacy/delegation.js +67 -0
- package/dist/privacy/delegation.js.map +1 -0
- package/dist/privacy/index.d.ts +25 -0
- package/dist/privacy/index.d.ts.map +1 -0
- package/dist/privacy/index.js +21 -0
- package/dist/privacy/index.js.map +1 -0
- package/dist/privacy/nullifier.d.ts +59 -0
- package/dist/privacy/nullifier.d.ts.map +1 -0
- package/dist/privacy/nullifier.js +70 -0
- package/dist/privacy/nullifier.js.map +1 -0
- package/dist/privacy/poseidon-felt252.d.ts +35 -0
- package/dist/privacy/poseidon-felt252.d.ts.map +1 -0
- package/dist/privacy/poseidon-felt252.js +93 -0
- package/dist/privacy/poseidon-felt252.js.map +1 -0
- package/dist/privacy/uar.d.ts +170 -0
- package/dist/privacy/uar.d.ts.map +1 -0
- package/dist/privacy/uar.js +150 -0
- package/dist/privacy/uar.js.map +1 -0
- package/dist/prompts/build-orient-prompt.d.ts +41 -0
- package/dist/prompts/build-orient-prompt.d.ts.map +1 -0
- package/dist/prompts/build-orient-prompt.js +40 -0
- package/dist/prompts/build-orient-prompt.js.map +1 -0
- package/dist/proof/chain.d.ts +90 -0
- package/dist/proof/chain.d.ts.map +1 -0
- package/dist/proof/chain.js +177 -0
- package/dist/proof/chain.js.map +1 -0
- package/dist/proof/fallback-adapter.d.ts +50 -0
- package/dist/proof/fallback-adapter.d.ts.map +1 -0
- package/dist/proof/fallback-adapter.js +99 -0
- package/dist/proof/fallback-adapter.js.map +1 -0
- package/dist/proof/index.d.ts +35 -0
- package/dist/proof/index.d.ts.map +1 -0
- package/dist/proof/index.js +161 -0
- package/dist/proof/index.js.map +1 -0
- package/dist/proof/load.d.ts +27 -0
- package/dist/proof/load.d.ts.map +1 -0
- package/dist/proof/load.js +44 -0
- package/dist/proof/load.js.map +1 -0
- package/dist/proof/otel.d.ts +25 -0
- package/dist/proof/otel.d.ts.map +1 -0
- package/dist/proof/otel.js +57 -0
- package/dist/proof/otel.js.map +1 -0
- package/dist/proof/receipt-queue.d.ts +97 -0
- package/dist/proof/receipt-queue.d.ts.map +1 -0
- package/dist/proof/receipt-queue.js +131 -0
- package/dist/proof/receipt-queue.js.map +1 -0
- package/dist/proof/sha256.d.ts +27 -0
- package/dist/proof/sha256.d.ts.map +1 -0
- package/dist/proof/sha256.js +65 -0
- package/dist/proof/sha256.js.map +1 -0
- package/dist/proof/types.d.ts +55 -0
- package/dist/proof/types.d.ts.map +1 -0
- package/dist/proof/types.js +10 -0
- package/dist/proof/types.js.map +1 -0
- package/dist/proof/verify.d.ts +28 -0
- package/dist/proof/verify.d.ts.map +1 -0
- package/dist/proof/verify.js +70 -0
- package/dist/proof/verify.js.map +1 -0
- package/dist/registry/agent-capability.d.ts +29 -0
- package/dist/registry/agent-capability.d.ts.map +1 -0
- package/dist/registry/agent-capability.js +21 -0
- package/dist/registry/agent-capability.js.map +1 -0
- package/dist/registry/agent-card.d.ts +86 -0
- package/dist/registry/agent-card.d.ts.map +1 -0
- package/dist/registry/agent-card.js +80 -0
- package/dist/registry/agent-card.js.map +1 -0
- package/dist/registry/agent-ids.d.ts +30 -0
- package/dist/registry/agent-ids.d.ts.map +1 -0
- package/dist/registry/agent-ids.js +46 -0
- package/dist/registry/agent-ids.js.map +1 -0
- package/dist/registry/agent-registry.d.ts +104 -0
- package/dist/registry/agent-registry.d.ts.map +1 -0
- package/dist/registry/agent-registry.js +277 -0
- package/dist/registry/agent-registry.js.map +1 -0
- package/dist/registry/index.d.ts +7 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +4 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/replay/clock.d.ts +69 -0
- package/dist/replay/clock.d.ts.map +1 -0
- package/dist/replay/clock.js +84 -0
- package/dist/replay/clock.js.map +1 -0
- package/dist/replay/cross-cycle.d.ts +143 -0
- package/dist/replay/cross-cycle.d.ts.map +1 -0
- package/dist/replay/cross-cycle.js +271 -0
- package/dist/replay/cross-cycle.js.map +1 -0
- package/dist/replay/http-vcr.d.ts +46 -0
- package/dist/replay/http-vcr.d.ts.map +1 -0
- package/dist/replay/http-vcr.js +87 -0
- package/dist/replay/http-vcr.js.map +1 -0
- package/dist/replay/index.d.ts +18 -0
- package/dist/replay/index.d.ts.map +1 -0
- package/dist/replay/index.js +18 -0
- package/dist/replay/index.js.map +1 -0
- package/dist/replay/llm-cache.d.ts +126 -0
- package/dist/replay/llm-cache.d.ts.map +1 -0
- package/dist/replay/llm-cache.js +114 -0
- package/dist/replay/llm-cache.js.map +1 -0
- package/dist/replay/random.d.ts +114 -0
- package/dist/replay/random.d.ts.map +1 -0
- package/dist/replay/random.js +183 -0
- package/dist/replay/random.js.map +1 -0
- package/dist/replay/replay.d.ts +160 -0
- package/dist/replay/replay.d.ts.map +1 -0
- package/dist/replay/replay.js +115 -0
- package/dist/replay/replay.js.map +1 -0
- package/dist/resilience/bulkhead.d.ts +37 -0
- package/dist/resilience/bulkhead.d.ts.map +1 -0
- package/dist/resilience/bulkhead.js +65 -0
- package/dist/resilience/bulkhead.js.map +1 -0
- package/dist/resilience/circuit-breaker.d.ts +56 -0
- package/dist/resilience/circuit-breaker.d.ts.map +1 -0
- package/dist/resilience/circuit-breaker.js +93 -0
- package/dist/resilience/circuit-breaker.js.map +1 -0
- package/dist/resilience/idempotent.d.ts +61 -0
- package/dist/resilience/idempotent.d.ts.map +1 -0
- package/dist/resilience/idempotent.js +103 -0
- package/dist/resilience/idempotent.js.map +1 -0
- package/dist/resilience/index.d.ts +28 -0
- package/dist/resilience/index.d.ts.map +1 -0
- package/dist/resilience/index.js +25 -0
- package/dist/resilience/index.js.map +1 -0
- package/dist/router/index.d.ts +3 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/index.js +2 -0
- package/dist/router/index.js.map +1 -0
- package/dist/router/provider-router.d.ts +61 -0
- package/dist/router/provider-router.d.ts.map +1 -0
- package/dist/router/provider-router.js +214 -0
- package/dist/router/provider-router.js.map +1 -0
- package/dist/runs/health.d.ts +24 -0
- package/dist/runs/health.d.ts.map +1 -0
- package/dist/runs/health.js +52 -0
- package/dist/runs/health.js.map +1 -0
- package/dist/runs/index.d.ts +4 -0
- package/dist/runs/index.d.ts.map +1 -0
- package/dist/runs/index.js +4 -0
- package/dist/runs/index.js.map +1 -0
- package/dist/runs/subscribe.d.ts +34 -0
- package/dist/runs/subscribe.d.ts.map +1 -0
- package/dist/runs/subscribe.js +228 -0
- package/dist/runs/subscribe.js.map +1 -0
- package/dist/runs/types.d.ts +53 -0
- package/dist/runs/types.d.ts.map +1 -0
- package/dist/runs/types.js +11 -0
- package/dist/runs/types.js.map +1 -0
- package/dist/safety/immune.d.ts +62 -0
- package/dist/safety/immune.d.ts.map +1 -0
- package/dist/safety/immune.js +109 -0
- package/dist/safety/immune.js.map +1 -0
- package/dist/safety/index.d.ts +3 -0
- package/dist/safety/index.d.ts.map +1 -0
- package/dist/safety/index.js +2 -0
- package/dist/safety/index.js.map +1 -0
- package/dist/safety/sanitize.d.ts +71 -0
- package/dist/safety/sanitize.d.ts.map +1 -0
- package/dist/safety/sanitize.js +139 -0
- package/dist/safety/sanitize.js.map +1 -0
- package/dist/sdk-permission-mapping.d.ts +41 -0
- package/dist/sdk-permission-mapping.d.ts.map +1 -0
- package/dist/sdk-permission-mapping.js +96 -0
- package/dist/sdk-permission-mapping.js.map +1 -0
- package/dist/skills/_otel.d.ts +2 -0
- package/dist/skills/_otel.d.ts.map +1 -0
- package/dist/skills/_otel.js +29 -0
- package/dist/skills/_otel.js.map +1 -0
- package/dist/skills/alpaca-quote.d.ts +30 -0
- package/dist/skills/alpaca-quote.d.ts.map +1 -0
- package/dist/skills/alpaca-quote.js +70 -0
- package/dist/skills/alpaca-quote.js.map +1 -0
- package/dist/skills/base-skills.d.ts +30 -0
- package/dist/skills/base-skills.d.ts.map +1 -0
- package/dist/skills/base-skills.js +26 -0
- package/dist/skills/base-skills.js.map +1 -0
- package/dist/skills/brain-query.d.ts +34 -0
- package/dist/skills/brain-query.d.ts.map +1 -0
- package/dist/skills/brain-query.js +46 -0
- package/dist/skills/brain-query.js.map +1 -0
- package/dist/skills/brain-store.d.ts +44 -0
- package/dist/skills/brain-store.d.ts.map +1 -0
- package/dist/skills/brain-store.js +55 -0
- package/dist/skills/brain-store.js.map +1 -0
- package/dist/skills/calendar-check.d.ts +37 -0
- package/dist/skills/calendar-check.d.ts.map +1 -0
- package/dist/skills/calendar-check.js +87 -0
- package/dist/skills/calendar-check.js.map +1 -0
- package/dist/skills/cboe-vix-spot.d.ts +24 -0
- package/dist/skills/cboe-vix-spot.d.ts.map +1 -0
- package/dist/skills/cboe-vix-spot.js +70 -0
- package/dist/skills/cboe-vix-spot.js.map +1 -0
- package/dist/skills/errors.d.ts +33 -0
- package/dist/skills/errors.d.ts.map +1 -0
- package/dist/skills/errors.js +50 -0
- package/dist/skills/errors.js.map +1 -0
- package/dist/skills/hitl-request.d.ts +39 -0
- package/dist/skills/hitl-request.d.ts.map +1 -0
- package/dist/skills/hitl-request.js +55 -0
- package/dist/skills/hitl-request.js.map +1 -0
- package/dist/skills/http-fetch.d.ts +32 -0
- package/dist/skills/http-fetch.d.ts.map +1 -0
- package/dist/skills/http-fetch.js +82 -0
- package/dist/skills/http-fetch.js.map +1 -0
- package/dist/skills/index.d.ts +46 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +32 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/record-outcome.d.ts +49 -0
- package/dist/skills/record-outcome.d.ts.map +1 -0
- package/dist/skills/record-outcome.js +104 -0
- package/dist/skills/record-outcome.js.map +1 -0
- package/dist/skills/run-sql-query.d.ts +33 -0
- package/dist/skills/run-sql-query.d.ts.map +1 -0
- package/dist/skills/run-sql-query.js +78 -0
- package/dist/skills/run-sql-query.js.map +1 -0
- package/dist/skills/send-email.d.ts +39 -0
- package/dist/skills/send-email.d.ts.map +1 -0
- package/dist/skills/send-email.js +100 -0
- package/dist/skills/send-email.js.map +1 -0
- package/dist/skills/skill-ledger.d.ts +62 -0
- package/dist/skills/skill-ledger.d.ts.map +1 -0
- package/dist/skills/skill-ledger.js +40 -0
- package/dist/skills/skill-ledger.js.map +1 -0
- package/dist/skills/skill-registry-builder.d.ts +91 -0
- package/dist/skills/skill-registry-builder.d.ts.map +1 -0
- package/dist/skills/skill-registry-builder.js +173 -0
- package/dist/skills/skill-registry-builder.js.map +1 -0
- package/dist/skills/slack-notify.d.ts +43 -0
- package/dist/skills/slack-notify.d.ts.map +1 -0
- package/dist/skills/slack-notify.js +70 -0
- package/dist/skills/slack-notify.js.map +1 -0
- package/dist/skills/starknet-balance.d.ts +34 -0
- package/dist/skills/starknet-balance.d.ts.map +1 -0
- package/dist/skills/starknet-balance.js +91 -0
- package/dist/skills/starknet-balance.js.map +1 -0
- package/dist/skills/telegram-notify.d.ts +44 -0
- package/dist/skills/telegram-notify.d.ts.map +1 -0
- package/dist/skills/telegram-notify.js +71 -0
- package/dist/skills/telegram-notify.js.map +1 -0
- package/dist/skills/web-search.d.ts +32 -0
- package/dist/skills/web-search.d.ts.map +1 -0
- package/dist/skills/web-search.js +84 -0
- package/dist/skills/web-search.js.map +1 -0
- package/dist/templates/complex-agent.d.ts +105 -0
- package/dist/templates/complex-agent.d.ts.map +1 -0
- package/dist/templates/complex-agent.js +94 -0
- package/dist/templates/complex-agent.js.map +1 -0
- package/dist/templates/index.d.ts +17 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +14 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/reasoning-agent.d.ts +160 -0
- package/dist/templates/reasoning-agent.d.ts.map +1 -0
- package/dist/templates/reasoning-agent.js +119 -0
- package/dist/templates/reasoning-agent.js.map +1 -0
- package/dist/templates/simple-agent.d.ts +108 -0
- package/dist/templates/simple-agent.d.ts.map +1 -0
- package/dist/templates/simple-agent.js +84 -0
- package/dist/templates/simple-agent.js.map +1 -0
- package/dist/testing/brain-conformance.d.ts +45 -0
- package/dist/testing/brain-conformance.d.ts.map +1 -0
- package/dist/testing/brain-conformance.js +68 -0
- package/dist/testing/brain-conformance.js.map +1 -0
- package/dist/testing/chaos.d.ts +126 -0
- package/dist/testing/chaos.d.ts.map +1 -0
- package/dist/testing/chaos.js +176 -0
- package/dist/testing/chaos.js.map +1 -0
- package/dist/testing/contracts/brain-port.contract.d.ts +23 -0
- package/dist/testing/contracts/brain-port.contract.d.ts.map +1 -0
- package/dist/testing/contracts/brain-port.contract.js +79 -0
- package/dist/testing/contracts/brain-port.contract.js.map +1 -0
- package/dist/testing/contracts/economic-observer.contract.d.ts +23 -0
- package/dist/testing/contracts/economic-observer.contract.d.ts.map +1 -0
- package/dist/testing/contracts/economic-observer.contract.js +71 -0
- package/dist/testing/contracts/economic-observer.contract.js.map +1 -0
- package/dist/testing/contracts/event-bus.contract.d.ts +30 -0
- package/dist/testing/contracts/event-bus.contract.d.ts.map +1 -0
- package/dist/testing/contracts/event-bus.contract.js +216 -0
- package/dist/testing/contracts/event-bus.contract.js.map +1 -0
- package/dist/testing/db-conformance.d.ts +22 -0
- package/dist/testing/db-conformance.d.ts.map +1 -0
- package/dist/testing/db-conformance.js +25 -0
- package/dist/testing/db-conformance.js.map +1 -0
- package/dist/testing/eval.d.ts +61 -0
- package/dist/testing/eval.d.ts.map +1 -0
- package/dist/testing/eval.js +98 -0
- package/dist/testing/eval.js.map +1 -0
- package/dist/testing/index.d.ts +32 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +38 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/integration-harness.d.ts +45 -0
- package/dist/testing/integration-harness.d.ts.map +1 -0
- package/dist/testing/integration-harness.js +57 -0
- package/dist/testing/integration-harness.js.map +1 -0
- package/dist/testing/logger-conformance.d.ts +16 -0
- package/dist/testing/logger-conformance.d.ts.map +1 -0
- package/dist/testing/logger-conformance.js +43 -0
- package/dist/testing/logger-conformance.js.map +1 -0
- package/dist/testing/outcome-conformance.d.ts +17 -0
- package/dist/testing/outcome-conformance.d.ts.map +1 -0
- package/dist/testing/outcome-conformance.js +50 -0
- package/dist/testing/outcome-conformance.js.map +1 -0
- package/dist/testing/runner.d.ts +19 -0
- package/dist/testing/runner.d.ts.map +1 -0
- package/dist/testing/runner.js +9 -0
- package/dist/testing/runner.js.map +1 -0
- package/dist/testing/test-brain-port.d.ts +25 -0
- package/dist/testing/test-brain-port.d.ts.map +1 -0
- package/dist/testing/test-brain-port.js +54 -0
- package/dist/testing/test-brain-port.js.map +1 -0
- package/dist/testing/test-child-agent.d.ts +32 -0
- package/dist/testing/test-child-agent.d.ts.map +1 -0
- package/dist/testing/test-child-agent.js +59 -0
- package/dist/testing/test-child-agent.js.map +1 -0
- package/dist/testing/test-event-bus.d.ts +57 -0
- package/dist/testing/test-event-bus.d.ts.map +1 -0
- package/dist/testing/test-event-bus.js +191 -0
- package/dist/testing/test-event-bus.js.map +1 -0
- package/dist/tools/index.d.ts +5 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +4 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registry.d.ts +20 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +102 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/types.d.ts +85 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +13 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/tools/zod-to-json-schema.d.ts +11 -0
- package/dist/tools/zod-to-json-schema.d.ts.map +1 -0
- package/dist/tools/zod-to-json-schema.js +92 -0
- package/dist/tools/zod-to-json-schema.js.map +1 -0
- package/dist/trace/canonical.d.ts +37 -0
- package/dist/trace/canonical.d.ts.map +1 -0
- package/dist/trace/canonical.js +139 -0
- package/dist/trace/canonical.js.map +1 -0
- package/dist/trace/policy.d.ts +103 -0
- package/dist/trace/policy.d.ts.map +1 -0
- package/dist/trace/policy.js +137 -0
- package/dist/trace/policy.js.map +1 -0
- package/dist/trace/schema.d.ts +195 -0
- package/dist/trace/schema.d.ts.map +1 -0
- package/dist/trace/schema.js +18 -0
- package/dist/trace/schema.js.map +1 -0
- package/dist/trace/strict-pii-detector.d.ts +28 -0
- package/dist/trace/strict-pii-detector.d.ts.map +1 -0
- package/dist/trace/strict-pii-detector.js +144 -0
- package/dist/trace/strict-pii-detector.js.map +1 -0
- package/dist/tracing/traced-port.d.ts +50 -0
- package/dist/tracing/traced-port.d.ts.map +1 -0
- package/dist/tracing/traced-port.js +108 -0
- package/dist/tracing/traced-port.js.map +1 -0
- package/dist/tracking/agent-run-tracker.d.ts +63 -0
- package/dist/tracking/agent-run-tracker.d.ts.map +1 -0
- package/dist/tracking/agent-run-tracker.js +132 -0
- package/dist/tracking/agent-run-tracker.js.map +1 -0
- package/dist/tracking/gen-ai.d.ts +54 -0
- package/dist/tracking/gen-ai.d.ts.map +1 -0
- package/dist/tracking/gen-ai.js +101 -0
- package/dist/tracking/gen-ai.js.map +1 -0
- package/dist/tracking/index.d.ts +4 -0
- package/dist/tracking/index.d.ts.map +1 -0
- package/dist/tracking/index.js +3 -0
- package/dist/tracking/index.js.map +1 -0
- package/dist/types/agent.d.ts +84 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +13 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/agent.test.d.ts +11 -0
- package/dist/types/agent.test.d.ts.map +1 -0
- package/dist/types/agent.test.js +144 -0
- package/dist/types/agent.test.js.map +1 -0
- package/dist/types/escalation-mapping.d.ts +30 -0
- package/dist/types/escalation-mapping.d.ts.map +1 -0
- package/dist/types/escalation-mapping.js +32 -0
- package/dist/types/escalation-mapping.js.map +1 -0
- package/docs/byom.md +106 -0
- package/docs/contributing.md +139 -0
- package/docs/economy.md +159 -0
- package/docs/getting-started.md +179 -0
- package/docs/index.md +57 -0
- package/docs/migration/0.15-to-0.17.md +227 -0
- package/docs/papers/bon-mav-notes.md +36 -0
- package/docs/patterns.md +138 -0
- package/docs/platforms.md +137 -0
- package/docs/ports/agent-registry.md +100 -0
- package/docs/ports/event-bus.md +131 -0
- package/docs/ports/hitl.md +105 -0
- package/docs/ports/llm-provider.md +125 -0
- package/docs/ports/messaging.md +94 -0
- package/docs/templates.md +165 -0
- package/package.json +160 -0
- package/src/adapters/hitl/memory-state-store.ts +96 -0
- package/src/adapters/hitl/postgres-state-store.ts +147 -0
- package/src/adapters/llm/anthropic-direct.ts +212 -0
- package/src/adapters/llm/cascade.ts +109 -0
- package/src/adapters/llm/litellm.ts +300 -0
- package/src/adapters/messaging/console.ts +73 -0
- package/src/adapters/messaging/discord.ts +125 -0
- package/src/adapters/messaging/mcp.ts +84 -0
- package/src/adapters/messaging/slack.ts +109 -0
- package/src/adapters/messaging/telegram.ts +134 -0
- package/src/adapters/registry/memory.ts +84 -0
- package/src/adapters/registry/postgres.ts +166 -0
- package/src/agents/index.ts +2 -0
- package/src/agents/trading.ts +114 -0
- package/src/auth/errors.ts +66 -0
- package/src/auth/nonce-store.ts +79 -0
- package/src/auth/sign-event.ts +51 -0
- package/src/auth/verify-event.ts +112 -0
- package/src/boot/init-sdk.ts +92 -0
- package/src/boot/load-agent-context.ts +164 -0
- package/src/boot/load-recent-memory.ts +92 -0
- package/src/budget/budget-state.ts +234 -0
- package/src/budget/index.ts +11 -0
- package/src/clients/agents.ts +140 -0
- package/src/clients/index.ts +6 -0
- package/src/clients/messaging-adapters.ts +173 -0
- package/src/clients/pipelines.ts +160 -0
- package/src/compute/strategies/best-of-n.ts +162 -0
- package/src/compute/strategies/bon-mav.ts +221 -0
- package/src/compute/strategies/single-shot.ts +45 -0
- package/src/compute/types.ts +36 -0
- package/src/compute/verifier.ts +84 -0
- package/src/compute/with-compute.ts +108 -0
- package/src/constitution/axioms.ts +548 -0
- package/src/constitution/gate.ts +180 -0
- package/src/constitution/index.ts +53 -0
- package/src/constitution/scorer.ts +170 -0
- package/src/constitution/signal.ts +114 -0
- package/src/constitution/types.ts +195 -0
- package/src/counterfactual/index.ts +20 -0
- package/src/counterfactual/replay-with-alt.ts +357 -0
- package/src/dataops/index.ts +4 -0
- package/src/dataops/starkscan.ts +13 -0
- package/src/dataops/voyager.ts +215 -0
- package/src/deprecation.ts +102 -0
- package/src/durable/bullmq-runner.ts +560 -0
- package/src/durable/index.ts +11 -0
- package/src/economy/circuit-breaker.ts +130 -0
- package/src/economy/economy-router.ts +242 -0
- package/src/economy/index.ts +28 -0
- package/src/economy/outcome-tracker.ts +228 -0
- package/src/economy/router.ts +246 -0
- package/src/economy/tier-policy.ts +116 -0
- package/src/errors.ts +159 -0
- package/src/evals/datasets/index.ts +343 -0
- package/src/evals/harness.ts +171 -0
- package/src/evals/index.ts +4 -0
- package/src/factory/agent-factory.ts +261 -0
- package/src/hitl/api.ts +78 -0
- package/src/hitl/approval-channel.ts +128 -0
- package/src/hitl/callback-handlers.ts +61 -0
- package/src/hitl/index.ts +9 -0
- package/src/hitl/slack.ts +358 -0
- package/src/hitl/telegram.ts +342 -0
- package/src/index.ts +710 -0
- package/src/llm/parse-structured-output.ts +116 -0
- package/src/loop/index.ts +26 -0
- package/src/loop/minimal-loop.ts +448 -0
- package/src/loop/sdk-loop.ts +505 -0
- package/src/mcp/index.ts +146 -0
- package/src/metrics/create-agent-metrics.ts +231 -0
- package/src/orchestration/bulkhead.ts +145 -0
- package/src/orchestration/idempotency.ts +137 -0
- package/src/orchestration/index.ts +24 -0
- package/src/orchestration/ooda/agent-config-loader.ts +118 -0
- package/src/orchestration/ooda/agent.ts +1009 -0
- package/src/orchestration/ooda/audit-log.ts +57 -0
- package/src/orchestration/ooda/brain-context.ts +269 -0
- package/src/orchestration/ooda/child-agent.ts +60 -0
- package/src/orchestration/ooda/cron-schedule.ts +115 -0
- package/src/orchestration/ooda/debate.ts +100 -0
- package/src/orchestration/ooda/economic-observer.ts +77 -0
- package/src/orchestration/ooda/errors.ts +32 -0
- package/src/orchestration/ooda/execution-mode-guard.ts +37 -0
- package/src/orchestration/ooda/factory.ts +48 -0
- package/src/orchestration/ooda/guardrails.ts +172 -0
- package/src/orchestration/ooda/guards/always-on.ts +21 -0
- package/src/orchestration/ooda/guards/business-hours.ts +134 -0
- package/src/orchestration/ooda/guards/cme-holidays-2026.json +1 -0
- package/src/orchestration/ooda/guards/index.ts +27 -0
- package/src/orchestration/ooda/guards/redis-circuit-breaker.ts +172 -0
- package/src/orchestration/ooda/guards/rth-session.ts +133 -0
- package/src/orchestration/ooda/handoff.ts +150 -0
- package/src/orchestration/ooda/hitl-gate.ts +166 -0
- package/src/orchestration/ooda/index.ts +163 -0
- package/src/orchestration/ooda/inner-monologue.ts +99 -0
- package/src/orchestration/ooda/learn.ts +146 -0
- package/src/orchestration/ooda/multimodal.ts +174 -0
- package/src/orchestration/ooda/phase-routing.ts +74 -0
- package/src/orchestration/ooda/plan-execute.ts +87 -0
- package/src/orchestration/ooda/react-loop.ts +192 -0
- package/src/orchestration/ooda/reflexion.ts +98 -0
- package/src/orchestration/ooda/resource-limits.ts +123 -0
- package/src/orchestration/ooda/run-step-persistence.ts +137 -0
- package/src/orchestration/ooda/skills.ts +60 -0
- package/src/orchestration/ooda/structured-output.ts +93 -0
- package/src/orchestration/ooda/types.ts +508 -0
- package/src/otel/attributes.ts +104 -0
- package/src/otel/index.ts +4 -0
- package/src/otel/ingest.ts +294 -0
- package/src/otel/trace-context.ts +197 -0
- package/src/otel/types.ts +49 -0
- package/src/outcomes/client.ts +194 -0
- package/src/outcomes/compute-roi.ts +89 -0
- package/src/outcomes/index.ts +3 -0
- package/src/outcomes/meter.ts +217 -0
- package/src/outcomes/trajectory.ts +170 -0
- package/src/outcomes/types.ts +88 -0
- package/src/patterns/_shared/brain-logger.ts +18 -0
- package/src/patterns/circuit-breaker/index.ts +8 -0
- package/src/patterns/circuit-breaker/session-cb.ts +198 -0
- package/src/patterns/circuit-breaker/types.ts +72 -0
- package/src/patterns/escalation/index.ts +8 -0
- package/src/patterns/escalation/pyramid.ts +125 -0
- package/src/patterns/escalation/types.ts +62 -0
- package/src/patterns/quality-gate/gate.ts +102 -0
- package/src/patterns/quality-gate/index.ts +8 -0
- package/src/patterns/quality-gate/types.ts +45 -0
- package/src/permissions/capability-gate.ts +63 -0
- package/src/permissions/index.ts +11 -0
- package/src/permissions/renewal-manager.ts +89 -0
- package/src/permissions/sdk-permissions.ts +124 -0
- package/src/ports/agent-registry.ts +104 -0
- package/src/ports/brain.ts +255 -0
- package/src/ports/db.ts +7 -0
- package/src/ports/event-bus.ts +199 -0
- package/src/ports/eviction-policy.ts +179 -0
- package/src/ports/hitl.contract.test.ts +131 -0
- package/src/ports/hitl.ts +153 -0
- package/src/ports/index.ts +48 -0
- package/src/ports/key-provider.ts +179 -0
- package/src/ports/llm-provider.contract.ts +132 -0
- package/src/ports/llm-provider.ts +68 -0
- package/src/ports/logger.ts +23 -0
- package/src/ports/messaging.contract.test.ts +422 -0
- package/src/ports/messaging.ts +53 -0
- package/src/ports/outcome.ts +26 -0
- package/src/ports/timestamp.ts +64 -0
- package/src/privacy/channel.ts +283 -0
- package/src/privacy/composition.ts +289 -0
- package/src/privacy/delegation.ts +128 -0
- package/src/privacy/index.ts +64 -0
- package/src/privacy/nullifier.ts +79 -0
- package/src/privacy/poseidon-felt252.ts +104 -0
- package/src/privacy/uar.ts +234 -0
- package/src/prompts/build-orient-prompt.ts +78 -0
- package/src/proof/chain.ts +249 -0
- package/src/proof/fallback-adapter.ts +117 -0
- package/src/proof/index.ts +207 -0
- package/src/proof/load.ts +61 -0
- package/src/proof/otel.ts +74 -0
- package/src/proof/receipt-queue.ts +235 -0
- package/src/proof/sha256.ts +80 -0
- package/src/proof/types.ts +58 -0
- package/src/proof/verify.ts +89 -0
- package/src/registry/agent-capability.ts +48 -0
- package/src/registry/agent-card.ts +162 -0
- package/src/registry/agent-ids.ts +56 -0
- package/src/registry/agent-registry.ts +378 -0
- package/src/registry/index.ts +23 -0
- package/src/replay/clock.ts +104 -0
- package/src/replay/cross-cycle.ts +406 -0
- package/src/replay/http-vcr.ts +123 -0
- package/src/replay/index.ts +62 -0
- package/src/replay/llm-cache.ts +199 -0
- package/src/replay/random.ts +249 -0
- package/src/replay/replay.ts +271 -0
- package/src/resilience/bulkhead.ts +95 -0
- package/src/resilience/circuit-breaker.ts +129 -0
- package/src/resilience/idempotent.ts +126 -0
- package/src/resilience/index.ts +51 -0
- package/src/router/index.ts +11 -0
- package/src/router/provider-router.ts +319 -0
- package/src/runs/health.ts +84 -0
- package/src/runs/index.ts +3 -0
- package/src/runs/subscribe.ts +263 -0
- package/src/runs/types.ts +63 -0
- package/src/safety/immune.ts +145 -0
- package/src/safety/index.ts +6 -0
- package/src/safety/sanitize.ts +183 -0
- package/src/sdk-permission-mapping.ts +123 -0
- package/src/skills/_otel.ts +31 -0
- package/src/skills/alpaca-quote.ts +82 -0
- package/src/skills/base-skills.ts +38 -0
- package/src/skills/brain-query.ts +62 -0
- package/src/skills/brain-store.ts +69 -0
- package/src/skills/calendar-check.ts +111 -0
- package/src/skills/cboe-vix-spot.ts +89 -0
- package/src/skills/errors.ts +59 -0
- package/src/skills/hitl-request.ts +68 -0
- package/src/skills/http-fetch.ts +92 -0
- package/src/skills/index.ts +71 -0
- package/src/skills/record-outcome.ts +125 -0
- package/src/skills/run-sql-query.ts +87 -0
- package/src/skills/send-email.ts +111 -0
- package/src/skills/skill-ledger.ts +92 -0
- package/src/skills/skill-registry-builder.ts +264 -0
- package/src/skills/slack-notify.ts +90 -0
- package/src/skills/starknet-balance.ts +106 -0
- package/src/skills/telegram-notify.ts +88 -0
- package/src/skills/web-search.ts +108 -0
- package/src/templates/complex-agent.ts +187 -0
- package/src/templates/index.ts +27 -0
- package/src/templates/reasoning-agent.ts +251 -0
- package/src/templates/simple-agent.ts +173 -0
- package/src/testing/brain-conformance.ts +105 -0
- package/src/testing/chaos.ts +266 -0
- package/src/testing/contracts/brain-port.contract.ts +91 -0
- package/src/testing/contracts/economic-observer.contract.ts +87 -0
- package/src/testing/contracts/event-bus.contract.ts +324 -0
- package/src/testing/db-conformance.ts +43 -0
- package/src/testing/eval.ts +161 -0
- package/src/testing/index.ts +59 -0
- package/src/testing/integration-harness.ts +75 -0
- package/src/testing/logger-conformance.ts +57 -0
- package/src/testing/outcome-conformance.ts +62 -0
- package/src/testing/runner.ts +19 -0
- package/src/testing/test-brain-port.ts +69 -0
- package/src/testing/test-child-agent.ts +70 -0
- package/src/testing/test-event-bus.ts +247 -0
- package/src/tools/index.ts +11 -0
- package/src/tools/registry.ts +122 -0
- package/src/tools/types.ts +114 -0
- package/src/tools/zod-to-json-schema.ts +112 -0
- package/src/trace/canonical.ts +158 -0
- package/src/trace/policy.ts +242 -0
- package/src/trace/schema.ts +245 -0
- package/src/trace/strict-pii-detector.ts +156 -0
- package/src/tracing/traced-port.ts +149 -0
- package/src/tracking/agent-run-tracker.ts +228 -0
- package/src/tracking/gen-ai.ts +153 -0
- package/src/tracking/index.ts +19 -0
- package/src/types/agent.ts +93 -0
- package/src/types/escalation-mapping.ts +48 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ReceiptQueue — tamper-evident in-memory queue for TSA receipt retries.
|
|
3
|
+
*
|
|
4
|
+
* CH1-r: Every entry is HMAC-SHA-256 authenticated. process() rejects entries
|
|
5
|
+
* with invalid HMACs before submitting to the TSA — no silent data corruption.
|
|
6
|
+
*
|
|
7
|
+
* Backoff schedule: DEFAULT_BACKOFF_MS defines 5 exponential windows.
|
|
8
|
+
* process() skips entries whose next retry time has not been reached yet
|
|
9
|
+
* (based on queuedAt + DEFAULT_BACKOFF_MS[attempts - 1]).
|
|
10
|
+
*
|
|
11
|
+
* KeyProvider isolation: the key is fetched from the provider at enqueue and
|
|
12
|
+
* process time — never stored in the entry itself.
|
|
13
|
+
*
|
|
14
|
+
* @module proof/receipt-queue
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { canonicalize } from "../trace/canonical.js";
|
|
18
|
+
import type { KeyProvider } from "../ports/key-provider.js";
|
|
19
|
+
import type { TimestampPort } from "../ports/timestamp.js";
|
|
20
|
+
import type { SignedReceipt } from "../trace/schema.js";
|
|
21
|
+
import { hmacSha256 } from "./sha256.js";
|
|
22
|
+
|
|
23
|
+
// ─── Types ────────────────────────────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
export interface ReceiptQueueEntry {
|
|
26
|
+
runId: string;
|
|
27
|
+
rootHash: string;
|
|
28
|
+
/** Unix epoch milliseconds when this entry was first enqueued. */
|
|
29
|
+
queuedAt: number;
|
|
30
|
+
/** Number of prior failed attempts (0 on first enqueue). */
|
|
31
|
+
attempts: number;
|
|
32
|
+
/**
|
|
33
|
+
* HMAC-SHA-256(canonical(entry-without-hmac), key from provider).
|
|
34
|
+
* CH1-r: tamper-evident field. process() rejects if this does not
|
|
35
|
+
* match a freshly computed HMAC.
|
|
36
|
+
*/
|
|
37
|
+
hmac: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface ReceiptQueue {
|
|
41
|
+
/**
|
|
42
|
+
* Add a new entry to the queue. Computes and stores the HMAC.
|
|
43
|
+
*
|
|
44
|
+
* @param entry - Entry without hmac/attempts.
|
|
45
|
+
* @param keyProvider - Provider that supplies the HMAC key.
|
|
46
|
+
* @param keyId - Key identifier for keyProvider.getKey().
|
|
47
|
+
*/
|
|
48
|
+
enqueue(
|
|
49
|
+
entry: Omit<ReceiptQueueEntry, "hmac" | "attempts">,
|
|
50
|
+
keyProvider: KeyProvider,
|
|
51
|
+
keyId: string,
|
|
52
|
+
): Promise<void>;
|
|
53
|
+
|
|
54
|
+
/** Return all entries currently in the queue (including those in backoff). */
|
|
55
|
+
pending(): Promise<ReceiptQueueEntry[]>;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Process up to `batchSize` due entries.
|
|
59
|
+
*
|
|
60
|
+
* For each entry:
|
|
61
|
+
* - Recompute HMAC; if mismatch → increment `rejected`, do NOT call adapter.
|
|
62
|
+
* - If backoff window not elapsed → skip (not counted in any bucket).
|
|
63
|
+
* - On success → remove from queue.
|
|
64
|
+
* - On failure → increment `entry.attempts`, apply next backoff.
|
|
65
|
+
*
|
|
66
|
+
* @returns { processed, failed, rejected }
|
|
67
|
+
*/
|
|
68
|
+
process(
|
|
69
|
+
adapter: TimestampPort,
|
|
70
|
+
keyProvider: KeyProvider,
|
|
71
|
+
keyId: string,
|
|
72
|
+
opts?: { batchSize?: number; backoffMs?: readonly number[] },
|
|
73
|
+
): Promise<{ processed: number; failed: number; rejected: number }>;
|
|
74
|
+
|
|
75
|
+
/** Number of entries currently in the queue. Test helper. */
|
|
76
|
+
size?(): Promise<number>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Default exponential backoff schedule (5 levels).
|
|
81
|
+
* Level 0 = 30s, 1 = 5min, 2 = 1h, 3 = 6h, 4 = 24h.
|
|
82
|
+
*/
|
|
83
|
+
export const DEFAULT_BACKOFF_MS = [
|
|
84
|
+
30_000,
|
|
85
|
+
5 * 60_000,
|
|
86
|
+
60 * 60_000,
|
|
87
|
+
6 * 60 * 60_000,
|
|
88
|
+
24 * 60 * 60_000,
|
|
89
|
+
] as const;
|
|
90
|
+
|
|
91
|
+
// ─── Errors ───────────────────────────────────────────────────────────────────
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Thrown internally when a queue entry HMAC fails verification.
|
|
95
|
+
* The error is caught by process() and counted in the `rejected` bucket.
|
|
96
|
+
*/
|
|
97
|
+
export class HmacInvalidError extends Error {
|
|
98
|
+
constructor(runId: string) {
|
|
99
|
+
super(
|
|
100
|
+
`HmacInvalidError: HMAC verification failed for entry runId="${runId}". ` +
|
|
101
|
+
"The entry may have been tampered with. Entry rejected without TSA call.",
|
|
102
|
+
);
|
|
103
|
+
this.name = "HmacInvalidError";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// ─── HMAC helpers ─────────────────────────────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
async function computeEntryHmac(
|
|
110
|
+
entry: Omit<ReceiptQueueEntry, "hmac">,
|
|
111
|
+
keyProvider: KeyProvider,
|
|
112
|
+
keyId: string,
|
|
113
|
+
): Promise<string> {
|
|
114
|
+
const key = await keyProvider.getKey(keyId);
|
|
115
|
+
// Canonical representation excludes the hmac field itself.
|
|
116
|
+
const canonical = canonicalize({
|
|
117
|
+
attempts: entry.attempts,
|
|
118
|
+
queuedAt: entry.queuedAt,
|
|
119
|
+
rootHash: entry.rootHash,
|
|
120
|
+
runId: entry.runId,
|
|
121
|
+
});
|
|
122
|
+
return hmacSha256(key, canonical);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// ─── InMemoryReceiptQueue ─────────────────────────────────────────────────────
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* In-memory ReceiptQueue implementation.
|
|
129
|
+
*
|
|
130
|
+
* Not durable across restarts — for production persistence, implement
|
|
131
|
+
* ReceiptQueue against a PostgreSQL table (see sprint-562 B2).
|
|
132
|
+
*/
|
|
133
|
+
export class InMemoryReceiptQueue implements ReceiptQueue {
|
|
134
|
+
private readonly _entries: ReceiptQueueEntry[] = [];
|
|
135
|
+
|
|
136
|
+
async enqueue(
|
|
137
|
+
entry: Omit<ReceiptQueueEntry, "hmac" | "attempts">,
|
|
138
|
+
keyProvider: KeyProvider,
|
|
139
|
+
keyId: string,
|
|
140
|
+
): Promise<void> {
|
|
141
|
+
// Emit colocation warning if EnvKeyProvider + TRACE_DB_URL detected.
|
|
142
|
+
if (keyProvider.hasColocationRisk()) {
|
|
143
|
+
process.stderr.write(
|
|
144
|
+
`[WARN] InMemoryReceiptQueue.enqueue: KeyProvider reports colocation risk ` +
|
|
145
|
+
`(key and TRACE_DB_URL on same host). ` +
|
|
146
|
+
`For production audit compliance, migrate to ExternalKMSKeyProvider.\n`,
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const withAttempts = { ...entry, attempts: 0 };
|
|
151
|
+
const hmac = await computeEntryHmac(withAttempts, keyProvider, keyId);
|
|
152
|
+
this._entries.push({ ...withAttempts, hmac });
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async pending(): Promise<ReceiptQueueEntry[]> {
|
|
156
|
+
return [...this._entries];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async process(
|
|
160
|
+
adapter: TimestampPort,
|
|
161
|
+
keyProvider: KeyProvider,
|
|
162
|
+
keyId: string,
|
|
163
|
+
opts?: { batchSize?: number; backoffMs?: readonly number[] },
|
|
164
|
+
): Promise<{ processed: number; failed: number; rejected: number }> {
|
|
165
|
+
const backoffMs = opts?.backoffMs ?? DEFAULT_BACKOFF_MS;
|
|
166
|
+
const batchSize = opts?.batchSize ?? this._entries.length;
|
|
167
|
+
|
|
168
|
+
let processed = 0;
|
|
169
|
+
let failed = 0;
|
|
170
|
+
let rejected = 0;
|
|
171
|
+
|
|
172
|
+
const now = Date.now();
|
|
173
|
+
const toRemove: number[] = [];
|
|
174
|
+
|
|
175
|
+
let count = 0;
|
|
176
|
+
for (let i = 0; i < this._entries.length && count < batchSize; i++) {
|
|
177
|
+
const entry = this._entries[i];
|
|
178
|
+
|
|
179
|
+
// CH1-r: recompute HMAC and compare before calling adapter.
|
|
180
|
+
const expectedHmac = await computeEntryHmac(
|
|
181
|
+
{ attempts: entry.attempts, queuedAt: entry.queuedAt, rootHash: entry.rootHash, runId: entry.runId },
|
|
182
|
+
keyProvider,
|
|
183
|
+
keyId,
|
|
184
|
+
);
|
|
185
|
+
if (entry.hmac !== expectedHmac) {
|
|
186
|
+
rejected++;
|
|
187
|
+
toRemove.push(i); // Remove tampered entries immediately.
|
|
188
|
+
count++;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Backoff check: skip if retry window hasn't elapsed.
|
|
193
|
+
if (entry.attempts > 0) {
|
|
194
|
+
const backoffIdx = Math.min(entry.attempts - 1, backoffMs.length - 1);
|
|
195
|
+
const nextRetryAt = entry.queuedAt + backoffMs[backoffIdx];
|
|
196
|
+
if (now < nextRetryAt) {
|
|
197
|
+
// Not due yet — skip but do not count.
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
count++;
|
|
203
|
+
|
|
204
|
+
try {
|
|
205
|
+
// Try to request the TSA receipt.
|
|
206
|
+
const _receipt: SignedReceipt = await adapter.request(entry.rootHash);
|
|
207
|
+
void _receipt;
|
|
208
|
+
// Success — mark for removal.
|
|
209
|
+
toRemove.push(i);
|
|
210
|
+
processed++;
|
|
211
|
+
} catch {
|
|
212
|
+
// Failure — increment attempts and recompute HMAC for updated entry.
|
|
213
|
+
entry.attempts += 1;
|
|
214
|
+
const newHmac = await computeEntryHmac(
|
|
215
|
+
{ attempts: entry.attempts, queuedAt: entry.queuedAt, rootHash: entry.rootHash, runId: entry.runId },
|
|
216
|
+
keyProvider,
|
|
217
|
+
keyId,
|
|
218
|
+
);
|
|
219
|
+
entry.hmac = newHmac;
|
|
220
|
+
failed++;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Remove processed/rejected entries (reverse order to keep indices stable).
|
|
225
|
+
for (const idx of toRemove.slice().sort((a, b) => b - a)) {
|
|
226
|
+
this._entries.splice(idx, 1);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return { processed, failed, rejected };
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
async size(): Promise<number> {
|
|
233
|
+
return this._entries.length;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* sha256 / hmacSha256 — Web Crypto API wrappers.
|
|
3
|
+
*
|
|
4
|
+
* Zero external dependencies. Uses globalThis.crypto.subtle (Node ≥ 19 native,
|
|
5
|
+
* browser, Deno, Cloudflare Workers). Throws if the runtime does not expose
|
|
6
|
+
* SubtleCrypto (Node < 19 without --experimental-global-webcrypto).
|
|
7
|
+
*
|
|
8
|
+
* @module proof/sha256
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function subtle(): SubtleCrypto {
|
|
12
|
+
const s = globalThis.crypto?.subtle;
|
|
13
|
+
if (!s) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"proof/sha256: globalThis.crypto.subtle is unavailable. " +
|
|
16
|
+
"Require Node.js >= 19 or pass --experimental-global-webcrypto.",
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return s;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Ensure the returned Uint8Array is backed by a plain ArrayBuffer
|
|
24
|
+
* (not SharedArrayBuffer), as required by SubtleCrypto's BufferSource type.
|
|
25
|
+
* The explicit return type avoids Uint8Array<ArrayBufferLike> widening.
|
|
26
|
+
*/
|
|
27
|
+
function toBytes(input: string | Uint8Array): Uint8Array<ArrayBuffer> {
|
|
28
|
+
if (typeof input === "string") {
|
|
29
|
+
return new TextEncoder().encode(input);
|
|
30
|
+
}
|
|
31
|
+
// Always copy into a fresh ArrayBuffer to guarantee the concrete type.
|
|
32
|
+
const copy = new Uint8Array(input.length);
|
|
33
|
+
copy.set(input);
|
|
34
|
+
return copy;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function bufferToHex(buf: ArrayBuffer): string {
|
|
38
|
+
return Array.from(new Uint8Array(buf))
|
|
39
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
40
|
+
.join("");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* SHA-256 hex digest via Web Crypto.
|
|
45
|
+
*
|
|
46
|
+
* @param input - UTF-8 string or raw bytes.
|
|
47
|
+
* @returns Lowercase hex digest (64 chars).
|
|
48
|
+
* @throws If SubtleCrypto is unavailable.
|
|
49
|
+
*/
|
|
50
|
+
export async function sha256(input: string | Uint8Array): Promise<string> {
|
|
51
|
+
const buf = await subtle().digest("SHA-256", toBytes(input));
|
|
52
|
+
return bufferToHex(buf);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* HMAC-SHA-256 hex digest via Web Crypto.
|
|
57
|
+
*
|
|
58
|
+
* @param key - Raw key bytes (min 32 bytes recommended for HMAC-SHA-256).
|
|
59
|
+
* @param input - UTF-8 string or raw bytes to authenticate.
|
|
60
|
+
* @returns Lowercase hex MAC (64 chars).
|
|
61
|
+
* @throws If SubtleCrypto is unavailable or key import fails.
|
|
62
|
+
*/
|
|
63
|
+
export async function hmacSha256(
|
|
64
|
+
key: Uint8Array,
|
|
65
|
+
input: string | Uint8Array,
|
|
66
|
+
): Promise<string> {
|
|
67
|
+
const s = subtle();
|
|
68
|
+
// Copy key into fresh ArrayBuffer to satisfy SubtleCrypto's BufferSource constraint.
|
|
69
|
+
const keyBytes = new Uint8Array(key.length);
|
|
70
|
+
keyBytes.set(key);
|
|
71
|
+
const cryptoKey = await s.importKey(
|
|
72
|
+
"raw",
|
|
73
|
+
keyBytes,
|
|
74
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
75
|
+
false,
|
|
76
|
+
["sign"],
|
|
77
|
+
);
|
|
78
|
+
const buf = await s.sign("HMAC", cryptoKey, toBytes(input));
|
|
79
|
+
return bufferToHex(buf);
|
|
80
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proof module types — @vauban-org/agent-sdk v0.5.2 (sprint-521 Bloc 1).
|
|
3
|
+
*
|
|
4
|
+
* Mirrors src/proof/run-certificate.ts so cert.json fetched from
|
|
5
|
+
* /api/runs/:id/proof-certificate parses cleanly into these types.
|
|
6
|
+
*
|
|
7
|
+
* Intentionally kept free of server-side dependencies (no DbClient, no crypto).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export type CertState = "awaiting_anchor" | "anchored" | "verified_on_chain";
|
|
11
|
+
|
|
12
|
+
export type LogSeverity = "debug" | "info" | "warn" | "error";
|
|
13
|
+
|
|
14
|
+
export interface RunStep {
|
|
15
|
+
id: string;
|
|
16
|
+
run_id: string;
|
|
17
|
+
step_index: number;
|
|
18
|
+
parent_step_id?: string | null;
|
|
19
|
+
type: "retrieval" | "decision" | "execution" | "feedback" | "observation";
|
|
20
|
+
phase?: string | null;
|
|
21
|
+
status: "pending" | "done" | "error" | "skipped";
|
|
22
|
+
started_at: string;
|
|
23
|
+
finished_at?: string | null;
|
|
24
|
+
duration_ms?: number | null;
|
|
25
|
+
payload?: Record<string, unknown> | null;
|
|
26
|
+
leaf_hash_poseidon?: string | null;
|
|
27
|
+
mcp_call_hash?: string | null;
|
|
28
|
+
retrieval_proof_hash?: string | null;
|
|
29
|
+
otel_trace_id?: string | null;
|
|
30
|
+
otel_span_id?: string | null;
|
|
31
|
+
error_message?: string | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface RunProofCertificate {
|
|
35
|
+
run_id: string;
|
|
36
|
+
agent_id: string;
|
|
37
|
+
started_at: string;
|
|
38
|
+
finished_at: string;
|
|
39
|
+
/** Trigger event ID — null if not recorded in run steps. */
|
|
40
|
+
trigger_event_id: string | null;
|
|
41
|
+
/** Brain entry IDs from retrieval steps that had an MCP call hash. */
|
|
42
|
+
brain_context_refs: string[];
|
|
43
|
+
decision_chain: Array<{
|
|
44
|
+
step_id: string;
|
|
45
|
+
step_index: number;
|
|
46
|
+
type: string;
|
|
47
|
+
phase: string | null;
|
|
48
|
+
leaf_hash_poseidon: string;
|
|
49
|
+
started_at: string;
|
|
50
|
+
finished_at: string;
|
|
51
|
+
duration_ms: number | null;
|
|
52
|
+
}>;
|
|
53
|
+
merkle_root: string | null;
|
|
54
|
+
katana_tx: string | null;
|
|
55
|
+
anchor_block_number: number | null;
|
|
56
|
+
state: CertState;
|
|
57
|
+
issued_at: string;
|
|
58
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verifyProofCertificate — pure client-side verification of RunProofCertificate.
|
|
3
|
+
*
|
|
4
|
+
* Recomputes the Poseidon Merkle root from decision_chain leaf hashes and
|
|
5
|
+
* compares against cert.merkle_root. No network call, no server trust needed.
|
|
6
|
+
*
|
|
7
|
+
* sprint-521 Bloc 1.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { RunProofCertificate } from "./types.js";
|
|
11
|
+
import { computeMerkleRoot } from "@vauban-org/proof-core";
|
|
12
|
+
|
|
13
|
+
/** Valid CertState values for enum validation. */
|
|
14
|
+
const VALID_CERT_STATES: ReadonlySet<string> = new Set([
|
|
15
|
+
"awaiting_anchor",
|
|
16
|
+
"anchored",
|
|
17
|
+
"verified_on_chain",
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Minimum hex length for a leaf hash (excluding "0x" prefix).
|
|
22
|
+
*
|
|
23
|
+
* Poseidon felt252 values are ≤ 252 bits → at most 63 hex chars.
|
|
24
|
+
* A non-trivial leaf hash will be 62 or 63 hex chars.
|
|
25
|
+
* We accept anything ≥ 62 hex chars to accommodate both lengths.
|
|
26
|
+
*/
|
|
27
|
+
const MIN_FELT_HEX_LEN = 62;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Validate a hex felt252 leaf hash.
|
|
31
|
+
* Must start with "0x" and have at least 62 lowercase hex chars after the prefix.
|
|
32
|
+
*/
|
|
33
|
+
function isValidLeaf(leaf: string): boolean {
|
|
34
|
+
return (
|
|
35
|
+
typeof leaf === "string" &&
|
|
36
|
+
leaf.startsWith("0x") &&
|
|
37
|
+
/^[0-9a-f]+$/i.test(leaf.slice(2)) &&
|
|
38
|
+
leaf.length >= MIN_FELT_HEX_LEN + 2
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface VerifyResult {
|
|
43
|
+
valid: boolean;
|
|
44
|
+
reason?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Verify a RunProofCertificate by recomputing its Merkle root.
|
|
49
|
+
*
|
|
50
|
+
* Checks:
|
|
51
|
+
* 1. cert.state is a valid CertState enum value.
|
|
52
|
+
* 2. All leaf hashes in decision_chain have valid hex felt252 format.
|
|
53
|
+
* 3. If decision_chain is non-empty, recompute the Merkle root and compare
|
|
54
|
+
* against cert.merkle_root. Mismatch → merkle_mismatch.
|
|
55
|
+
* 4. Empty decision_chain + null merkle_root → valid (degenerate case).
|
|
56
|
+
*
|
|
57
|
+
* @param cert - RunProofCertificate to verify (typically fetched from /api/runs/:id/proof-certificate).
|
|
58
|
+
* @returns { valid: boolean; reason?: string }
|
|
59
|
+
*/
|
|
60
|
+
export function verifyProofCertificate(
|
|
61
|
+
cert: RunProofCertificate
|
|
62
|
+
): VerifyResult {
|
|
63
|
+
// ─── 1. State enum validation ─────────────────────────────────────────────
|
|
64
|
+
if (!VALID_CERT_STATES.has(cert.state)) {
|
|
65
|
+
return { valid: false, reason: "invalid_state" };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ─── 2. Degenerate case: empty decision_chain ─────────────────────────────
|
|
69
|
+
if (cert.decision_chain.length === 0) {
|
|
70
|
+
return { valid: true };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ─── 3. Leaf format validation ────────────────────────────────────────────
|
|
74
|
+
const leaves = cert.decision_chain.map((s) => s.leaf_hash_poseidon);
|
|
75
|
+
for (const leaf of leaves) {
|
|
76
|
+
if (!isValidLeaf(leaf)) {
|
|
77
|
+
return { valid: false, reason: "invalid_leaf_format" };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ─── 4. Merkle root recomputation ─────────────────────────────────────────
|
|
82
|
+
const recomputed = computeMerkleRoot(leaves);
|
|
83
|
+
|
|
84
|
+
if (cert.merkle_root === null || recomputed !== cert.merkle_root) {
|
|
85
|
+
return { valid: false, reason: "merkle_mismatch" };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return { valid: true };
|
|
89
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentCapabilityCard — multi-kind capability descriptor for CC LLM router agents.
|
|
3
|
+
*
|
|
4
|
+
* Sprint-580 / registry-multi-kind
|
|
5
|
+
*
|
|
6
|
+
* In-memory schema only. SQL persistence via migration
|
|
7
|
+
* `036_agent_capability_index.sql` (coordinator-applied).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// ─── Kinds ────────────────────────────────────────────────────────────────────
|
|
11
|
+
|
|
12
|
+
export const AGENT_KINDS = [
|
|
13
|
+
"ARCHITECT",
|
|
14
|
+
"BUILDER",
|
|
15
|
+
"SCRIBE",
|
|
16
|
+
"TESTER",
|
|
17
|
+
"SYNERGY",
|
|
18
|
+
"OODA",
|
|
19
|
+
"LLM_ROUTER",
|
|
20
|
+
"PLUGIN",
|
|
21
|
+
"MCP",
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
export type AgentKind = (typeof AGENT_KINDS)[number];
|
|
25
|
+
|
|
26
|
+
// ─── Tiers ────────────────────────────────────────────────────────────────────
|
|
27
|
+
|
|
28
|
+
export type CostTier = "low" | "medium" | "high";
|
|
29
|
+
export type LatencyTier = "low" | "medium" | "high";
|
|
30
|
+
|
|
31
|
+
// ─── Card ─────────────────────────────────────────────────────────────────────
|
|
32
|
+
|
|
33
|
+
export interface AgentCapabilityCard {
|
|
34
|
+
/** Stable agent identifier (matches AgentDescriptor.id or AGENT_IDS UUID). */
|
|
35
|
+
agentId: string;
|
|
36
|
+
/** Kind classifier for this capability entry. */
|
|
37
|
+
kind: AgentKind;
|
|
38
|
+
/** Free-form skill tags, lowercased. */
|
|
39
|
+
skills: readonly string[];
|
|
40
|
+
/** Relative cost to invoke this agent. */
|
|
41
|
+
costTier: CostTier;
|
|
42
|
+
/** Relative latency of this agent. */
|
|
43
|
+
latencyTier: LatencyTier;
|
|
44
|
+
/** pgvector similarity embedding — optional in in-memory mode. */
|
|
45
|
+
embeddingVector?: readonly number[];
|
|
46
|
+
/** Unix epoch ms when this card was registered. */
|
|
47
|
+
createdAt: number;
|
|
48
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentCard — A2A v1.2 (Linux Foundation, 150+ orgs).
|
|
3
|
+
*
|
|
4
|
+
* Sprint-563: B8 — AgentCard + A2A v1.2 + Signed Agent Cards (CH8 activation).
|
|
5
|
+
*
|
|
6
|
+
* Converts a Vauban AgentDescriptor into an A2A v1.2-compliant AgentCard.
|
|
7
|
+
* Signed AgentCards activate CH8: Trace.agentSignature is computed from
|
|
8
|
+
* the agent's identity key.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ─── A2A v1.2 Agent Card types ───────────────────────────────────────────────
|
|
12
|
+
|
|
13
|
+
export interface A2AAgentCapabilities {
|
|
14
|
+
streaming?: boolean;
|
|
15
|
+
pushNotifications?: boolean;
|
|
16
|
+
stateTransitionHistory?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface A2ASkill {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
inputSchema?: Record<string, unknown>;
|
|
25
|
+
outputSchema?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface A2AAgentCard {
|
|
29
|
+
/** Agent Card spec version. */
|
|
30
|
+
protocolVersion: "1.2";
|
|
31
|
+
/** Human-readable name. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** Natural language description. */
|
|
34
|
+
description: string;
|
|
35
|
+
/** Globally unique agent identifier. */
|
|
36
|
+
url: string;
|
|
37
|
+
/** Provider/org name. */
|
|
38
|
+
provider?: string;
|
|
39
|
+
/** Agent version (semver). */
|
|
40
|
+
version: string;
|
|
41
|
+
/** IANA media type for default input (default: application/json). */
|
|
42
|
+
defaultInputModes?: string[];
|
|
43
|
+
/** IANA media type for default output. */
|
|
44
|
+
defaultOutputModes?: string[];
|
|
45
|
+
/** Agent capabilities (streaming, push, state history). */
|
|
46
|
+
capabilities: A2AAgentCapabilities;
|
|
47
|
+
/** Exposed skills. */
|
|
48
|
+
skills: A2ASkill[];
|
|
49
|
+
/** Optional signature (CH8 activation). */
|
|
50
|
+
signature?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ─── Agent Card options ──────────────────────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
export interface AgentCardOptions {
|
|
56
|
+
/** Base URL for the agent (e.g. "https://agents.vauban.tech"). */
|
|
57
|
+
baseUrl: string;
|
|
58
|
+
/** Provider/organization name. */
|
|
59
|
+
provider?: string;
|
|
60
|
+
/** Capabilities override. */
|
|
61
|
+
capabilities?: Partial<A2AAgentCapabilities>;
|
|
62
|
+
/** Signing key for CH8 Signed Agent Cards. */
|
|
63
|
+
signingKey?: {
|
|
64
|
+
sign: (payload: string) => Promise<string>;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ─── Builder ─────────────────────────────────────────────────────────────────
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Convert a Vauban AgentDescriptor into an A2A v1.2 AgentCard.
|
|
72
|
+
*
|
|
73
|
+
* Usage:
|
|
74
|
+
* import { toAgentCard } from "@vauban-org/agent-sdk";
|
|
75
|
+
* const card = await toAgentCard(descriptor, skills, { baseUrl: "https://agents.vauban.tech" });
|
|
76
|
+
*/
|
|
77
|
+
export async function toAgentCard(
|
|
78
|
+
descriptor: {
|
|
79
|
+
agentId: string;
|
|
80
|
+
name: string;
|
|
81
|
+
description: string;
|
|
82
|
+
version: string;
|
|
83
|
+
capabilities?: string[];
|
|
84
|
+
},
|
|
85
|
+
skills: Array<{
|
|
86
|
+
name: string;
|
|
87
|
+
description: string;
|
|
88
|
+
inputSchema?: Record<string, unknown>;
|
|
89
|
+
outputSchema?: Record<string, unknown>;
|
|
90
|
+
tags?: string[];
|
|
91
|
+
}>,
|
|
92
|
+
opts: AgentCardOptions,
|
|
93
|
+
): Promise<A2AAgentCard> {
|
|
94
|
+
const card: A2AAgentCard = {
|
|
95
|
+
protocolVersion: "1.2",
|
|
96
|
+
name: descriptor.name,
|
|
97
|
+
description: descriptor.description,
|
|
98
|
+
url: `${opts.baseUrl}/agents/${descriptor.agentId}`,
|
|
99
|
+
provider: opts.provider ?? "vauban",
|
|
100
|
+
version: descriptor.version,
|
|
101
|
+
defaultInputModes: ["application/json"],
|
|
102
|
+
defaultOutputModes: ["application/json"],
|
|
103
|
+
capabilities: {
|
|
104
|
+
streaming: true,
|
|
105
|
+
pushNotifications: false,
|
|
106
|
+
stateTransitionHistory: true,
|
|
107
|
+
...opts.capabilities,
|
|
108
|
+
},
|
|
109
|
+
skills: skills.map((s) => ({
|
|
110
|
+
id: `skill:${s.name}`,
|
|
111
|
+
name: s.name,
|
|
112
|
+
description: s.description,
|
|
113
|
+
tags: s.tags,
|
|
114
|
+
inputSchema: s.inputSchema,
|
|
115
|
+
outputSchema: s.outputSchema,
|
|
116
|
+
})),
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// CH8: Sign the card if a signing key is provided
|
|
120
|
+
if (opts.signingKey) {
|
|
121
|
+
const payload = JSON.stringify({
|
|
122
|
+
name: card.name,
|
|
123
|
+
url: card.url,
|
|
124
|
+
version: card.version,
|
|
125
|
+
skills: card.skills.map((s) => s.id).sort(),
|
|
126
|
+
});
|
|
127
|
+
card.signature = await opts.signingKey.sign(payload);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return card;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Validate that an AgentCard has all required fields per A2A v1.2 spec.
|
|
135
|
+
*/
|
|
136
|
+
export function validateAgentCard(card: A2AAgentCard): {
|
|
137
|
+
valid: boolean;
|
|
138
|
+
errors: string[];
|
|
139
|
+
} {
|
|
140
|
+
const errors: string[] = [];
|
|
141
|
+
|
|
142
|
+
if (card.protocolVersion !== "1.2") {
|
|
143
|
+
errors.push("protocolVersion must be '1.2'");
|
|
144
|
+
}
|
|
145
|
+
if (!card.name || card.name.trim().length === 0) {
|
|
146
|
+
errors.push("name is required");
|
|
147
|
+
}
|
|
148
|
+
if (!card.description || card.description.trim().length === 0) {
|
|
149
|
+
errors.push("description is required");
|
|
150
|
+
}
|
|
151
|
+
if (!card.url || !card.url.startsWith("https://")) {
|
|
152
|
+
errors.push("url must be a valid HTTPS URL");
|
|
153
|
+
}
|
|
154
|
+
if (!card.version) {
|
|
155
|
+
errors.push("version is required");
|
|
156
|
+
}
|
|
157
|
+
if (!card.skills || card.skills.length === 0) {
|
|
158
|
+
errors.push("at least one skill is required");
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return { valid: errors.length === 0, errors };
|
|
162
|
+
}
|