@methodts/runtime 0.1.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/dist/__fixtures__/executor-fixtures.d.ts +10 -0
- package/dist/__fixtures__/executor-fixtures.d.ts.map +1 -0
- package/dist/__fixtures__/executor-fixtures.js +36 -0
- package/dist/__fixtures__/executor-fixtures.js.map +1 -0
- package/dist/architecture.test.d.ts +2 -0
- package/dist/architecture.test.d.ts.map +1 -0
- package/dist/architecture.test.js +143 -0
- package/dist/architecture.test.js.map +1 -0
- package/dist/config/cost-governor-config.d.ts +40 -0
- package/dist/config/cost-governor-config.d.ts.map +1 -0
- package/dist/config/cost-governor-config.js +48 -0
- package/dist/config/cost-governor-config.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/sessions-config.d.ts +29 -0
- package/dist/config/sessions-config.d.ts.map +1 -0
- package/dist/config/sessions-config.js +37 -0
- package/dist/config/sessions-config.js.map +1 -0
- package/dist/config/strategies-config.d.ts +38 -0
- package/dist/config/strategies-config.d.ts.map +1 -0
- package/dist/config/strategies-config.js +41 -0
- package/dist/config/strategies-config.js.map +1 -0
- package/dist/cost-governor/backpressure-queue.d.ts +20 -0
- package/dist/cost-governor/backpressure-queue.d.ts.map +1 -0
- package/dist/cost-governor/backpressure-queue.js +78 -0
- package/dist/cost-governor/backpressure-queue.js.map +1 -0
- package/dist/cost-governor/backpressure-queue.test.d.ts +2 -0
- package/dist/cost-governor/backpressure-queue.test.d.ts.map +1 -0
- package/dist/cost-governor/backpressure-queue.test.js +48 -0
- package/dist/cost-governor/backpressure-queue.test.js.map +1 -0
- package/dist/cost-governor/cost-events.d.ts +65 -0
- package/dist/cost-governor/cost-events.d.ts.map +1 -0
- package/dist/cost-governor/cost-events.js +48 -0
- package/dist/cost-governor/cost-events.js.map +1 -0
- package/dist/cost-governor/cost-governor-app-id.test.d.ts +19 -0
- package/dist/cost-governor/cost-governor-app-id.test.d.ts.map +1 -0
- package/dist/cost-governor/cost-governor-app-id.test.js +201 -0
- package/dist/cost-governor/cost-governor-app-id.test.js.map +1 -0
- package/dist/cost-governor/cost-oracle-impl.d.ts +19 -0
- package/dist/cost-governor/cost-oracle-impl.d.ts.map +1 -0
- package/dist/cost-governor/cost-oracle-impl.js +52 -0
- package/dist/cost-governor/cost-oracle-impl.js.map +1 -0
- package/dist/cost-governor/estimator.d.ts +22 -0
- package/dist/cost-governor/estimator.d.ts.map +1 -0
- package/dist/cost-governor/estimator.js +119 -0
- package/dist/cost-governor/estimator.js.map +1 -0
- package/dist/cost-governor/estimator.test.d.ts +2 -0
- package/dist/cost-governor/estimator.test.d.ts.map +1 -0
- package/dist/cost-governor/estimator.test.js +141 -0
- package/dist/cost-governor/estimator.test.js.map +1 -0
- package/dist/cost-governor/index.d.ts +75 -0
- package/dist/cost-governor/index.d.ts.map +1 -0
- package/dist/cost-governor/index.js +120 -0
- package/dist/cost-governor/index.js.map +1 -0
- package/dist/cost-governor/observations-store.d.ts +49 -0
- package/dist/cost-governor/observations-store.d.ts.map +1 -0
- package/dist/cost-governor/observations-store.js +179 -0
- package/dist/cost-governor/observations-store.js.map +1 -0
- package/dist/cost-governor/observations-store.test.d.ts +2 -0
- package/dist/cost-governor/observations-store.test.d.ts.map +1 -0
- package/dist/cost-governor/observations-store.test.js +191 -0
- package/dist/cost-governor/observations-store.test.js.map +1 -0
- package/dist/cost-governor/percentile.d.ts +17 -0
- package/dist/cost-governor/percentile.d.ts.map +1 -0
- package/dist/cost-governor/percentile.js +33 -0
- package/dist/cost-governor/percentile.js.map +1 -0
- package/dist/cost-governor/percentile.test.d.ts +2 -0
- package/dist/cost-governor/percentile.test.d.ts.map +1 -0
- package/dist/cost-governor/percentile.test.js +46 -0
- package/dist/cost-governor/percentile.test.js.map +1 -0
- package/dist/cost-governor/rate-governor-impl.d.ts +73 -0
- package/dist/cost-governor/rate-governor-impl.d.ts.map +1 -0
- package/dist/cost-governor/rate-governor-impl.js +148 -0
- package/dist/cost-governor/rate-governor-impl.js.map +1 -0
- package/dist/cost-governor/signature-builder.d.ts +22 -0
- package/dist/cost-governor/signature-builder.d.ts.map +1 -0
- package/dist/cost-governor/signature-builder.js +43 -0
- package/dist/cost-governor/signature-builder.js.map +1 -0
- package/dist/cost-governor/signature-builder.test.d.ts +2 -0
- package/dist/cost-governor/signature-builder.test.d.ts.map +1 -0
- package/dist/cost-governor/signature-builder.test.js +58 -0
- package/dist/cost-governor/signature-builder.test.js.map +1 -0
- package/dist/cost-governor/token-bucket.d.ts +57 -0
- package/dist/cost-governor/token-bucket.d.ts.map +1 -0
- package/dist/cost-governor/token-bucket.js +109 -0
- package/dist/cost-governor/token-bucket.js.map +1 -0
- package/dist/cost-governor/token-bucket.test.d.ts +2 -0
- package/dist/cost-governor/token-bucket.test.d.ts.map +1 -0
- package/dist/cost-governor/token-bucket.test.js +67 -0
- package/dist/cost-governor/token-bucket.test.js.map +1 -0
- package/dist/dlq/cortex-dlq-observer.d.ts +22 -0
- package/dist/dlq/cortex-dlq-observer.d.ts.map +1 -0
- package/dist/dlq/cortex-dlq-observer.js +29 -0
- package/dist/dlq/cortex-dlq-observer.js.map +1 -0
- package/dist/dlq/dlq-observer.test.d.ts +8 -0
- package/dist/dlq/dlq-observer.test.d.ts.map +1 -0
- package/dist/dlq/dlq-observer.test.js +103 -0
- package/dist/dlq/dlq-observer.test.js.map +1 -0
- package/dist/dlq/index.d.ts +6 -0
- package/dist/dlq/index.d.ts.map +1 -0
- package/dist/dlq/index.js +6 -0
- package/dist/dlq/index.js.map +1 -0
- package/dist/event-bus/adapters.d.ts +50 -0
- package/dist/event-bus/adapters.d.ts.map +1 -0
- package/dist/event-bus/adapters.js +51 -0
- package/dist/event-bus/adapters.js.map +1 -0
- package/dist/event-bus/adapters.test.d.ts +5 -0
- package/dist/event-bus/adapters.test.d.ts.map +1 -0
- package/dist/event-bus/adapters.test.js +73 -0
- package/dist/event-bus/adapters.test.js.map +1 -0
- package/dist/event-bus/agent-event-adapter.d.ts +22 -0
- package/dist/event-bus/agent-event-adapter.d.ts.map +1 -0
- package/dist/event-bus/agent-event-adapter.js +49 -0
- package/dist/event-bus/agent-event-adapter.js.map +1 -0
- package/dist/event-bus/agent-event-adapter.test.d.ts +5 -0
- package/dist/event-bus/agent-event-adapter.test.d.ts.map +1 -0
- package/dist/event-bus/agent-event-adapter.test.js +170 -0
- package/dist/event-bus/agent-event-adapter.test.js.map +1 -0
- package/dist/event-bus/channel-sink.d.ts +71 -0
- package/dist/event-bus/channel-sink.d.ts.map +1 -0
- package/dist/event-bus/channel-sink.js +159 -0
- package/dist/event-bus/channel-sink.js.map +1 -0
- package/dist/event-bus/channel-sink.test.d.ts +5 -0
- package/dist/event-bus/channel-sink.test.d.ts.map +1 -0
- package/dist/event-bus/channel-sink.test.js +234 -0
- package/dist/event-bus/channel-sink.test.js.map +1 -0
- package/dist/event-bus/event-types.snapshot.test.d.ts +27 -0
- package/dist/event-bus/event-types.snapshot.test.d.ts.map +1 -0
- package/dist/event-bus/event-types.snapshot.test.js +165 -0
- package/dist/event-bus/event-types.snapshot.test.js.map +1 -0
- package/dist/event-bus/genesis-sink.d.ts +55 -0
- package/dist/event-bus/genesis-sink.d.ts.map +1 -0
- package/dist/event-bus/genesis-sink.js +141 -0
- package/dist/event-bus/genesis-sink.js.map +1 -0
- package/dist/event-bus/genesis-sink.test.d.ts +5 -0
- package/dist/event-bus/genesis-sink.test.d.ts.map +1 -0
- package/dist/event-bus/genesis-sink.test.js +160 -0
- package/dist/event-bus/genesis-sink.test.js.map +1 -0
- package/dist/event-bus/in-memory-event-bus.d.ts +60 -0
- package/dist/event-bus/in-memory-event-bus.d.ts.map +1 -0
- package/dist/event-bus/in-memory-event-bus.js +274 -0
- package/dist/event-bus/in-memory-event-bus.js.map +1 -0
- package/dist/event-bus/in-memory-event-bus.test.d.ts +5 -0
- package/dist/event-bus/in-memory-event-bus.test.d.ts.map +1 -0
- package/dist/event-bus/in-memory-event-bus.test.js +457 -0
- package/dist/event-bus/in-memory-event-bus.test.js.map +1 -0
- package/dist/event-bus/index.d.ts +22 -0
- package/dist/event-bus/index.d.ts.map +1 -0
- package/dist/event-bus/index.js +17 -0
- package/dist/event-bus/index.js.map +1 -0
- package/dist/event-bus/persistence-sink.d.ts +74 -0
- package/dist/event-bus/persistence-sink.d.ts.map +1 -0
- package/dist/event-bus/persistence-sink.js +193 -0
- package/dist/event-bus/persistence-sink.js.map +1 -0
- package/dist/event-bus/persistence-sink.test.d.ts +6 -0
- package/dist/event-bus/persistence-sink.test.d.ts.map +1 -0
- package/dist/event-bus/persistence-sink.test.js +319 -0
- package/dist/event-bus/persistence-sink.test.js.map +1 -0
- package/dist/event-bus/session-checkpoint-sink.d.ts +91 -0
- package/dist/event-bus/session-checkpoint-sink.d.ts.map +1 -0
- package/dist/event-bus/session-checkpoint-sink.js +107 -0
- package/dist/event-bus/session-checkpoint-sink.js.map +1 -0
- package/dist/event-bus/session-checkpoint-sink.test.d.ts +5 -0
- package/dist/event-bus/session-checkpoint-sink.test.d.ts.map +1 -0
- package/dist/event-bus/session-checkpoint-sink.test.js +215 -0
- package/dist/event-bus/session-checkpoint-sink.test.js.map +1 -0
- package/dist/event-bus/webhook-connector.d.ts +59 -0
- package/dist/event-bus/webhook-connector.d.ts.map +1 -0
- package/dist/event-bus/webhook-connector.js +191 -0
- package/dist/event-bus/webhook-connector.js.map +1 -0
- package/dist/event-bus/webhook-connector.test.d.ts +5 -0
- package/dist/event-bus/webhook-connector.test.d.ts.map +1 -0
- package/dist/event-bus/webhook-connector.test.js +214 -0
- package/dist/event-bus/webhook-connector.test.js.map +1 -0
- package/dist/executors/cortex-job-backed-executor.d.ts +137 -0
- package/dist/executors/cortex-job-backed-executor.d.ts.map +1 -0
- package/dist/executors/cortex-job-backed-executor.js +441 -0
- package/dist/executors/cortex-job-backed-executor.js.map +1 -0
- package/dist/executors/cortex-job-backed-executor.test.d.ts +13 -0
- package/dist/executors/cortex-job-backed-executor.test.d.ts.map +1 -0
- package/dist/executors/cortex-job-backed-executor.test.js +303 -0
- package/dist/executors/cortex-job-backed-executor.test.js.map +1 -0
- package/dist/executors/index.d.ts +9 -0
- package/dist/executors/index.d.ts.map +1 -0
- package/dist/executors/index.js +9 -0
- package/dist/executors/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/ports/checkpoint-sink.d.ts +69 -0
- package/dist/ports/checkpoint-sink.d.ts.map +1 -0
- package/dist/ports/checkpoint-sink.js +16 -0
- package/dist/ports/checkpoint-sink.js.map +1 -0
- package/dist/ports/checkpoint.d.ts +68 -0
- package/dist/ports/checkpoint.d.ts.map +1 -0
- package/dist/ports/checkpoint.js +14 -0
- package/dist/ports/checkpoint.js.map +1 -0
- package/dist/ports/continuation-envelope-cross-app.test.d.ts +10 -0
- package/dist/ports/continuation-envelope-cross-app.test.d.ts.map +1 -0
- package/dist/ports/continuation-envelope-cross-app.test.js +95 -0
- package/dist/ports/continuation-envelope-cross-app.test.js.map +1 -0
- package/dist/ports/continuation-envelope.d.ts +199 -0
- package/dist/ports/continuation-envelope.d.ts.map +1 -0
- package/dist/ports/continuation-envelope.js +69 -0
- package/dist/ports/continuation-envelope.js.map +1 -0
- package/dist/ports/conversation.d.ts +64 -0
- package/dist/ports/conversation.d.ts.map +1 -0
- package/dist/ports/conversation.js +19 -0
- package/dist/ports/conversation.js.map +1 -0
- package/dist/ports/cost-oracle.d.ts +26 -0
- package/dist/ports/cost-oracle.d.ts.map +1 -0
- package/dist/ports/cost-oracle.js +9 -0
- package/dist/ports/cost-oracle.js.map +1 -0
- package/dist/ports/cross-app-invoker.d.ts +198 -0
- package/dist/ports/cross-app-invoker.d.ts.map +1 -0
- package/dist/ports/cross-app-invoker.js +157 -0
- package/dist/ports/cross-app-invoker.js.map +1 -0
- package/dist/ports/dlq-observer.d.ts +40 -0
- package/dist/ports/dlq-observer.d.ts.map +1 -0
- package/dist/ports/dlq-observer.js +20 -0
- package/dist/ports/dlq-observer.js.map +1 -0
- package/dist/ports/event-bus.d.ts +169 -0
- package/dist/ports/event-bus.d.ts.map +1 -0
- package/dist/ports/event-bus.js +20 -0
- package/dist/ports/event-bus.js.map +1 -0
- package/dist/ports/event-reader.d.ts +21 -0
- package/dist/ports/event-reader.d.ts.map +1 -0
- package/dist/ports/event-reader.js +12 -0
- package/dist/ports/event-reader.js.map +1 -0
- package/dist/ports/event-rotator.d.ts +39 -0
- package/dist/ports/event-rotator.d.ts.map +1 -0
- package/dist/ports/event-rotator.js +15 -0
- package/dist/ports/event-rotator.js.map +1 -0
- package/dist/ports/file-system.d.ts +48 -0
- package/dist/ports/file-system.d.ts.map +1 -0
- package/dist/ports/file-system.js +10 -0
- package/dist/ports/file-system.js.map +1 -0
- package/dist/ports/historical-observations.d.ts +39 -0
- package/dist/ports/historical-observations.d.ts.map +1 -0
- package/dist/ports/historical-observations.js +12 -0
- package/dist/ports/historical-observations.js.map +1 -0
- package/dist/ports/in-memory-source.d.ts +46 -0
- package/dist/ports/in-memory-source.d.ts.map +1 -0
- package/dist/ports/in-memory-source.js +69 -0
- package/dist/ports/in-memory-source.js.map +1 -0
- package/dist/ports/index.d.ts +32 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +10 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/job-backed-executor.d.ts +139 -0
- package/dist/ports/job-backed-executor.d.ts.map +1 -0
- package/dist/ports/job-backed-executor.js +56 -0
- package/dist/ports/job-backed-executor.js.map +1 -0
- package/dist/ports/methodology-source.d.ts +95 -0
- package/dist/ports/methodology-source.d.ts.map +1 -0
- package/dist/ports/methodology-source.js +26 -0
- package/dist/ports/methodology-source.js.map +1 -0
- package/dist/ports/native-session-discovery.d.ts +20 -0
- package/dist/ports/native-session-discovery.d.ts.map +1 -0
- package/dist/ports/native-session-discovery.js +13 -0
- package/dist/ports/native-session-discovery.js.map +1 -0
- package/dist/ports/projection-store.d.ts +48 -0
- package/dist/ports/projection-store.d.ts.map +1 -0
- package/dist/ports/projection-store.js +17 -0
- package/dist/ports/projection-store.js.map +1 -0
- package/dist/ports/projection.d.ts +29 -0
- package/dist/ports/projection.d.ts.map +1 -0
- package/dist/ports/projection.js +13 -0
- package/dist/ports/projection.js.map +1 -0
- package/dist/ports/rate-governor.d.ts +17 -0
- package/dist/ports/rate-governor.d.ts.map +1 -0
- package/dist/ports/rate-governor.js +11 -0
- package/dist/ports/rate-governor.js.map +1 -0
- package/dist/ports/schedule-client.d.ts +29 -0
- package/dist/ports/schedule-client.d.ts.map +1 -0
- package/dist/ports/schedule-client.js +2 -0
- package/dist/ports/schedule-client.js.map +1 -0
- package/dist/ports/session-pool.d.ts +162 -0
- package/dist/ports/session-pool.d.ts.map +1 -0
- package/dist/ports/session-pool.js +21 -0
- package/dist/ports/session-pool.js.map +1 -0
- package/dist/ports/session-store-errors.d.ts +22 -0
- package/dist/ports/session-store-errors.d.ts.map +1 -0
- package/dist/ports/session-store-errors.js +29 -0
- package/dist/ports/session-store-errors.js.map +1 -0
- package/dist/ports/session-store-types.d.ts +132 -0
- package/dist/ports/session-store-types.d.ts.map +1 -0
- package/dist/ports/session-store-types.js +14 -0
- package/dist/ports/session-store-types.js.map +1 -0
- package/dist/ports/session-store.d.ts +69 -0
- package/dist/ports/session-store.d.ts.map +1 -0
- package/dist/ports/session-store.js +23 -0
- package/dist/ports/session-store.js.map +1 -0
- package/dist/ports/yaml-loader.d.ts +15 -0
- package/dist/ports/yaml-loader.d.ts.map +1 -0
- package/dist/ports/yaml-loader.js +13 -0
- package/dist/ports/yaml-loader.js.map +1 -0
- package/dist/scheduling/index.d.ts +6 -0
- package/dist/scheduling/index.d.ts.map +1 -0
- package/dist/scheduling/index.js +6 -0
- package/dist/scheduling/index.js.map +1 -0
- package/dist/scheduling/scheduled-pact.d.ts +97 -0
- package/dist/scheduling/scheduled-pact.d.ts.map +1 -0
- package/dist/scheduling/scheduled-pact.js +89 -0
- package/dist/scheduling/scheduled-pact.js.map +1 -0
- package/dist/sessions/__tests__/cognitive-modules.test.d.ts +10 -0
- package/dist/sessions/__tests__/cognitive-modules.test.d.ts.map +1 -0
- package/dist/sessions/__tests__/cognitive-modules.test.js +535 -0
- package/dist/sessions/__tests__/cognitive-modules.test.js.map +1 -0
- package/dist/sessions/__tests__/cognitive-provider.test.d.ts +13 -0
- package/dist/sessions/__tests__/cognitive-provider.test.d.ts.map +1 -0
- package/dist/sessions/__tests__/cognitive-provider.test.js +331 -0
- package/dist/sessions/__tests__/cognitive-provider.test.js.map +1 -0
- package/dist/sessions/__tests__/cognitive-sink.test.d.ts +19 -0
- package/dist/sessions/__tests__/cognitive-sink.test.d.ts.map +1 -0
- package/dist/sessions/__tests__/cognitive-sink.test.js +334 -0
- package/dist/sessions/__tests__/cognitive-sink.test.js.map +1 -0
- package/dist/sessions/__tests__/runtime-tools.test.d.ts +2 -0
- package/dist/sessions/__tests__/runtime-tools.test.d.ts.map +1 -0
- package/dist/sessions/__tests__/runtime-tools.test.js +83 -0
- package/dist/sessions/__tests__/runtime-tools.test.js.map +1 -0
- package/dist/sessions/auto-retro.d.ts +29 -0
- package/dist/sessions/auto-retro.d.ts.map +1 -0
- package/dist/sessions/auto-retro.js +181 -0
- package/dist/sessions/auto-retro.js.map +1 -0
- package/dist/sessions/auto-retro.test.d.ts +2 -0
- package/dist/sessions/auto-retro.test.d.ts.map +1 -0
- package/dist/sessions/auto-retro.test.js +361 -0
- package/dist/sessions/auto-retro.test.js.map +1 -0
- package/dist/sessions/channels.d.ts +55 -0
- package/dist/sessions/channels.d.ts.map +1 -0
- package/dist/sessions/channels.js +118 -0
- package/dist/sessions/channels.js.map +1 -0
- package/dist/sessions/channels.test.d.ts +2 -0
- package/dist/sessions/channels.test.d.ts.map +1 -0
- package/dist/sessions/channels.test.js +285 -0
- package/dist/sessions/channels.test.js.map +1 -0
- package/dist/sessions/cognitive-modules.d.ts +100 -0
- package/dist/sessions/cognitive-modules.d.ts.map +1 -0
- package/dist/sessions/cognitive-modules.js +458 -0
- package/dist/sessions/cognitive-modules.js.map +1 -0
- package/dist/sessions/cognitive-provider.d.ts +42 -0
- package/dist/sessions/cognitive-provider.d.ts.map +1 -0
- package/dist/sessions/cognitive-provider.js +208 -0
- package/dist/sessions/cognitive-provider.js.map +1 -0
- package/dist/sessions/cognitive-sink.d.ts +73 -0
- package/dist/sessions/cognitive-sink.d.ts.map +1 -0
- package/dist/sessions/cognitive-sink.js +154 -0
- package/dist/sessions/cognitive-sink.js.map +1 -0
- package/dist/sessions/diagnostics.d.ts +70 -0
- package/dist/sessions/diagnostics.d.ts.map +1 -0
- package/dist/sessions/diagnostics.js +129 -0
- package/dist/sessions/diagnostics.js.map +1 -0
- package/dist/sessions/diagnostics.test.d.ts +2 -0
- package/dist/sessions/diagnostics.test.d.ts.map +1 -0
- package/dist/sessions/diagnostics.test.js +135 -0
- package/dist/sessions/diagnostics.test.js.map +1 -0
- package/dist/sessions/index.d.ts +32 -0
- package/dist/sessions/index.d.ts.map +1 -0
- package/dist/sessions/index.js +33 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/sessions/pool.d.ts +218 -0
- package/dist/sessions/pool.d.ts.map +1 -0
- package/dist/sessions/pool.js +991 -0
- package/dist/sessions/pool.js.map +1 -0
- package/dist/sessions/pool.test.d.ts +2 -0
- package/dist/sessions/pool.test.d.ts.map +1 -0
- package/dist/sessions/pool.test.js +633 -0
- package/dist/sessions/pool.test.js.map +1 -0
- package/dist/sessions/print-session.d.ts +142 -0
- package/dist/sessions/print-session.d.ts.map +1 -0
- package/dist/sessions/print-session.js +325 -0
- package/dist/sessions/print-session.js.map +1 -0
- package/dist/sessions/print-session.test.d.ts +2 -0
- package/dist/sessions/print-session.test.d.ts.map +1 -0
- package/dist/sessions/print-session.test.js +418 -0
- package/dist/sessions/print-session.test.js.map +1 -0
- package/dist/sessions/runtime-tools.d.ts +22 -0
- package/dist/sessions/runtime-tools.d.ts.map +1 -0
- package/dist/sessions/runtime-tools.js +162 -0
- package/dist/sessions/runtime-tools.js.map +1 -0
- package/dist/sessions/scope-hook.d.ts +77 -0
- package/dist/sessions/scope-hook.d.ts.map +1 -0
- package/dist/sessions/scope-hook.js +323 -0
- package/dist/sessions/scope-hook.js.map +1 -0
- package/dist/sessions/scope-hook.test.d.ts +2 -0
- package/dist/sessions/scope-hook.test.d.ts.map +1 -0
- package/dist/sessions/scope-hook.test.js +249 -0
- package/dist/sessions/scope-hook.test.js.map +1 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.d.ts +16 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.d.ts.map +1 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.js +191 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.js.map +1 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.test.d.ts +5 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.test.d.ts.map +1 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.test.js +137 -0
- package/dist/sessions/session-store/checkpoint-sink-impl.test.js.map +1 -0
- package/dist/sessions/session-store/conformance.d.ts +59 -0
- package/dist/sessions/session-store/conformance.d.ts.map +1 -0
- package/dist/sessions/session-store/conformance.js +172 -0
- package/dist/sessions/session-store/conformance.js.map +1 -0
- package/dist/sessions/session-store/conformance.test.d.ts +7 -0
- package/dist/sessions/session-store/conformance.test.d.ts.map +1 -0
- package/dist/sessions/session-store/conformance.test.js +22 -0
- package/dist/sessions/session-store/conformance.test.js.map +1 -0
- package/dist/sessions/session-store/in-memory-session-store.d.ts +23 -0
- package/dist/sessions/session-store/in-memory-session-store.d.ts.map +1 -0
- package/dist/sessions/session-store/in-memory-session-store.js +197 -0
- package/dist/sessions/session-store/in-memory-session-store.js.map +1 -0
- package/dist/sessions/session-store/in-memory-session-store.test.d.ts +6 -0
- package/dist/sessions/session-store/in-memory-session-store.test.d.ts.map +1 -0
- package/dist/sessions/session-store/in-memory-session-store.test.js +183 -0
- package/dist/sessions/session-store/in-memory-session-store.test.js.map +1 -0
- package/dist/sessions/session-store/index.d.ts +20 -0
- package/dist/sessions/session-store/index.d.ts.map +1 -0
- package/dist/sessions/session-store/index.js +15 -0
- package/dist/sessions/session-store/index.js.map +1 -0
- package/dist/sessions/session-store/resume.d.ts +88 -0
- package/dist/sessions/session-store/resume.d.ts.map +1 -0
- package/dist/sessions/session-store/resume.js +96 -0
- package/dist/sessions/session-store/resume.js.map +1 -0
- package/dist/sessions/session-store/resume.test.d.ts +5 -0
- package/dist/sessions/session-store/resume.test.d.ts.map +1 -0
- package/dist/sessions/session-store/resume.test.js +119 -0
- package/dist/sessions/session-store/resume.test.js.map +1 -0
- package/dist/sessions/spawn-queue.d.ts +28 -0
- package/dist/sessions/spawn-queue.d.ts.map +1 -0
- package/dist/sessions/spawn-queue.js +63 -0
- package/dist/sessions/spawn-queue.js.map +1 -0
- package/dist/sessions/spawn-queue.test.d.ts +2 -0
- package/dist/sessions/spawn-queue.test.d.ts.map +1 -0
- package/dist/sessions/spawn-queue.test.js +65 -0
- package/dist/sessions/spawn-queue.test.js.map +1 -0
- package/dist/sessions/types.d.ts +16 -0
- package/dist/sessions/types.d.ts.map +1 -0
- package/dist/sessions/types.js +11 -0
- package/dist/sessions/types.js.map +1 -0
- package/dist/sessions/worktree-stale.test.d.ts +2 -0
- package/dist/sessions/worktree-stale.test.d.ts.map +1 -0
- package/dist/sessions/worktree-stale.test.js +468 -0
- package/dist/sessions/worktree-stale.test.js.map +1 -0
- package/dist/strategy/artifact-store.d.ts +12 -0
- package/dist/strategy/artifact-store.d.ts.map +1 -0
- package/dist/strategy/artifact-store.js +12 -0
- package/dist/strategy/artifact-store.js.map +1 -0
- package/dist/strategy/artifact-store.test.d.ts +2 -0
- package/dist/strategy/artifact-store.test.d.ts.map +1 -0
- package/dist/strategy/artifact-store.test.js +170 -0
- package/dist/strategy/artifact-store.test.js.map +1 -0
- package/dist/strategy/context-load-executor.d.ts +23 -0
- package/dist/strategy/context-load-executor.d.ts.map +1 -0
- package/dist/strategy/context-load-executor.js +87 -0
- package/dist/strategy/context-load-executor.js.map +1 -0
- package/dist/strategy/context-load-executor.test.d.ts +16 -0
- package/dist/strategy/context-load-executor.test.d.ts.map +1 -0
- package/dist/strategy/context-load-executor.test.js +158 -0
- package/dist/strategy/context-load-executor.test.js.map +1 -0
- package/dist/strategy/cortex-cross-app-invoker.stub.d.ts +65 -0
- package/dist/strategy/cortex-cross-app-invoker.stub.d.ts.map +1 -0
- package/dist/strategy/cortex-cross-app-invoker.stub.js +68 -0
- package/dist/strategy/cortex-cross-app-invoker.stub.js.map +1 -0
- package/dist/strategy/cross-app-node-executor.d.ts +54 -0
- package/dist/strategy/cross-app-node-executor.d.ts.map +1 -0
- package/dist/strategy/cross-app-node-executor.js +98 -0
- package/dist/strategy/cross-app-node-executor.js.map +1 -0
- package/dist/strategy/cross-app-node-executor.test.d.ts +13 -0
- package/dist/strategy/cross-app-node-executor.test.d.ts.map +1 -0
- package/dist/strategy/cross-app-node-executor.test.js +160 -0
- package/dist/strategy/cross-app-node-executor.test.js.map +1 -0
- package/dist/strategy/gates.d.ts +13 -0
- package/dist/strategy/gates.d.ts.map +1 -0
- package/dist/strategy/gates.js +13 -0
- package/dist/strategy/gates.js.map +1 -0
- package/dist/strategy/gates.test.d.ts +2 -0
- package/dist/strategy/gates.test.d.ts.map +1 -0
- package/dist/strategy/gates.test.js +299 -0
- package/dist/strategy/gates.test.js.map +1 -0
- package/dist/strategy/human-approval-resolver.d.ts +23 -0
- package/dist/strategy/human-approval-resolver.d.ts.map +1 -0
- package/dist/strategy/human-approval-resolver.js +94 -0
- package/dist/strategy/human-approval-resolver.js.map +1 -0
- package/dist/strategy/human-approval-resolver.test.d.ts +16 -0
- package/dist/strategy/human-approval-resolver.test.d.ts.map +1 -0
- package/dist/strategy/human-approval-resolver.test.js +200 -0
- package/dist/strategy/human-approval-resolver.test.js.map +1 -0
- package/dist/strategy/in-process-cross-app-invoker.d.ts +105 -0
- package/dist/strategy/in-process-cross-app-invoker.d.ts.map +1 -0
- package/dist/strategy/in-process-cross-app-invoker.js +206 -0
- package/dist/strategy/in-process-cross-app-invoker.js.map +1 -0
- package/dist/strategy/in-process-cross-app-invoker.test.d.ts +15 -0
- package/dist/strategy/in-process-cross-app-invoker.test.d.ts.map +1 -0
- package/dist/strategy/in-process-cross-app-invoker.test.js +190 -0
- package/dist/strategy/in-process-cross-app-invoker.test.js.map +1 -0
- package/dist/strategy/index.d.ts +29 -0
- package/dist/strategy/index.d.ts.map +1 -0
- package/dist/strategy/index.js +29 -0
- package/dist/strategy/index.js.map +1 -0
- package/dist/strategy/pacta-strategy.d.ts +97 -0
- package/dist/strategy/pacta-strategy.d.ts.map +1 -0
- package/dist/strategy/pacta-strategy.js +117 -0
- package/dist/strategy/pacta-strategy.js.map +1 -0
- package/dist/strategy/pacta-strategy.test.d.ts +2 -0
- package/dist/strategy/pacta-strategy.test.d.ts.map +1 -0
- package/dist/strategy/pacta-strategy.test.js +234 -0
- package/dist/strategy/pacta-strategy.test.js.map +1 -0
- package/dist/strategy/retro-generator.d.ts +18 -0
- package/dist/strategy/retro-generator.d.ts.map +1 -0
- package/dist/strategy/retro-generator.js +22 -0
- package/dist/strategy/retro-generator.js.map +1 -0
- package/dist/strategy/retro-writer.d.ts +25 -0
- package/dist/strategy/retro-writer.d.ts.map +1 -0
- package/dist/strategy/retro-writer.js +65 -0
- package/dist/strategy/retro-writer.js.map +1 -0
- package/dist/strategy/strategy-executor.d.ts +39 -0
- package/dist/strategy/strategy-executor.d.ts.map +1 -0
- package/dist/strategy/strategy-executor.js +253 -0
- package/dist/strategy/strategy-executor.js.map +1 -0
- package/dist/strategy/strategy-executor.test.d.ts +8 -0
- package/dist/strategy/strategy-executor.test.d.ts.map +1 -0
- package/dist/strategy/strategy-executor.test.js +1301 -0
- package/dist/strategy/strategy-executor.test.js.map +1 -0
- package/dist/strategy/strategy-parser.d.ts +30 -0
- package/dist/strategy/strategy-parser.d.ts.map +1 -0
- package/dist/strategy/strategy-parser.js +30 -0
- package/dist/strategy/strategy-parser.js.map +1 -0
- package/dist/strategy/sub-strategy-source.d.ts +27 -0
- package/dist/strategy/sub-strategy-source.d.ts.map +1 -0
- package/dist/strategy/sub-strategy-source.js +77 -0
- package/dist/strategy/sub-strategy-source.js.map +1 -0
- package/dist/strategy/types.d.ts +12 -0
- package/dist/strategy/types.d.ts.map +1 -0
- package/dist/strategy/types.js +9 -0
- package/dist/strategy/types.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Continuation envelope — PRD-067 cross-app extension tests.
|
|
4
|
+
*
|
|
5
|
+
* Gates:
|
|
6
|
+
* - G-ENVELOPE-BACKWARD-COMPAT: pre-PRD-067 envelopes (no crossApp field)
|
|
7
|
+
* round-trip byte-identically via JSON.
|
|
8
|
+
* - version literal stays 1 (additive extension — no version bump).
|
|
9
|
+
*/
|
|
10
|
+
import { describe, it } from 'node:test';
|
|
11
|
+
import assert from 'node:assert/strict';
|
|
12
|
+
import { parseContinuationEnvelope, } from './continuation-envelope.js';
|
|
13
|
+
function preCrossAppEnvelope() {
|
|
14
|
+
return {
|
|
15
|
+
version: 1,
|
|
16
|
+
sessionId: 'sess-xyz',
|
|
17
|
+
turnIndex: 3,
|
|
18
|
+
checkpointRef: { id: 'cp1', hash: 'h', sizeBytes: 100 },
|
|
19
|
+
budgetRef: {
|
|
20
|
+
reservationId: 'res1',
|
|
21
|
+
strategy: 'fresh-per-continuation',
|
|
22
|
+
remainingUsd: 1.0,
|
|
23
|
+
expiresAt: Date.now() + 60_000,
|
|
24
|
+
},
|
|
25
|
+
nextAction: { type: 'resume', reason: 'async_io' },
|
|
26
|
+
pactKey: 'pact-1',
|
|
27
|
+
tokenContext: {
|
|
28
|
+
userSub: 'user-1',
|
|
29
|
+
exchangeDepth: 1,
|
|
30
|
+
originatingRequestId: 'req-1',
|
|
31
|
+
},
|
|
32
|
+
emittedAt: Date.now(),
|
|
33
|
+
traceId: 'trace-1',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
describe('ContinuationEnvelope — PRD-067 extension', () => {
|
|
37
|
+
it('G-ENVELOPE-BACKWARD-COMPAT: pre-PRD-067 envelope round-trips byte-identical', () => {
|
|
38
|
+
const envelope = preCrossAppEnvelope();
|
|
39
|
+
const serialised = JSON.stringify(envelope);
|
|
40
|
+
const reparsed = JSON.parse(serialised);
|
|
41
|
+
assert.equal(reparsed.version, 1);
|
|
42
|
+
assert.equal('crossApp' in reparsed, false);
|
|
43
|
+
const reserialised = JSON.stringify(reparsed);
|
|
44
|
+
assert.equal(serialised, reserialised, 'serialisation must be byte-identical');
|
|
45
|
+
const parsed = parseContinuationEnvelope(JSON.parse(serialised));
|
|
46
|
+
assert.equal(parsed.version, 1);
|
|
47
|
+
});
|
|
48
|
+
it('accepts optional crossApp field without version bump', () => {
|
|
49
|
+
const crossApp = {
|
|
50
|
+
callerNodeId: 'commission',
|
|
51
|
+
targetAppId: 'feature-dev-agent',
|
|
52
|
+
operation: 'commission_fix',
|
|
53
|
+
originatingRequestId: 'req-1',
|
|
54
|
+
targetDecisionId: 'd-1',
|
|
55
|
+
phase: 'awaiting_callee',
|
|
56
|
+
};
|
|
57
|
+
const envelope = { ...preCrossAppEnvelope(), crossApp };
|
|
58
|
+
const serialised = JSON.stringify(envelope);
|
|
59
|
+
const parsed = parseContinuationEnvelope(JSON.parse(serialised));
|
|
60
|
+
assert.equal(parsed.version, 1, 'version stays 1 — additive extension');
|
|
61
|
+
assert.ok(parsed.crossApp);
|
|
62
|
+
assert.equal(parsed.crossApp.phase, 'awaiting_callee');
|
|
63
|
+
assert.equal(parsed.crossApp.targetAppId, 'feature-dev-agent');
|
|
64
|
+
});
|
|
65
|
+
it('supports completed + failed phases carrying callee output / failure reason', () => {
|
|
66
|
+
const base = preCrossAppEnvelope();
|
|
67
|
+
const completed = {
|
|
68
|
+
...base,
|
|
69
|
+
crossApp: {
|
|
70
|
+
callerNodeId: 'n',
|
|
71
|
+
targetAppId: 't',
|
|
72
|
+
operation: 'o',
|
|
73
|
+
originatingRequestId: 'req-1',
|
|
74
|
+
targetDecisionId: 'd',
|
|
75
|
+
phase: 'completed',
|
|
76
|
+
calleeOutput: { pr_url: 'x', effort: 'S' },
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
const failed = {
|
|
80
|
+
...base,
|
|
81
|
+
crossApp: {
|
|
82
|
+
callerNodeId: 'n',
|
|
83
|
+
targetAppId: 't',
|
|
84
|
+
operation: 'o',
|
|
85
|
+
originatingRequestId: 'req-1',
|
|
86
|
+
targetDecisionId: 'd',
|
|
87
|
+
phase: 'failed',
|
|
88
|
+
failureReason: 'target 5xx',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
assert.equal(JSON.parse(JSON.stringify(completed)).crossApp.phase, 'completed');
|
|
92
|
+
assert.equal(JSON.parse(JSON.stringify(failed)).crossApp.phase, 'failed');
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=continuation-envelope-cross-app.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-envelope-cross-app.test.js","sourceRoot":"","sources":["../../src/ports/continuation-envelope-cross-app.test.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,OAAO,EACL,yBAAyB,GAG1B,MAAM,4BAA4B,CAAC;AAEpC,SAAS,mBAAmB;IAC1B,OAAO;QACL,OAAO,EAAE,CAAC;QACV,SAAS,EAAE,UAAU;QACrB,SAAS,EAAE,CAAC;QACZ,aAAa,EAAE,EAAE,EAAE,EA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C;SACF,CAAC;QACF,MAAM,MAAM,GAAyB;YACnC,GAAG,IAAI;YACP,QAAQ,EAAE;gBACR,YAAY,EAAE,GAAG;gBACjB,WAAW,EAAE,GAAG;gBAChB,SAAS,EAAE,GAAG;gBACd,oBAAoB,EAAE,OAAO;gBAC7B,gBAAgB,EAAE,GAAG;gBACrB,KAAK,EAAE,QAAQ;gBACf,aAAa,EAAE,YAAY;aAC5B;SACF,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAChF,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ContinuationEnvelope v1 — the wire format for pact continuations (PRD-062 / S5 §2.1).
|
|
3
|
+
*
|
|
4
|
+
* Frozen: 2026-04-14 — see `.method/sessions/fcd-surface-job-backed-executor/decision.md`.
|
|
5
|
+
*
|
|
6
|
+
* Written to `ctx.jobs` as the job payload whenever a pact yields (suspends)
|
|
7
|
+
* between workers. The next worker pulls it, rehydrates via SessionStore,
|
|
8
|
+
* and invokes the pact with `nextAction` as the resumption signal.
|
|
9
|
+
*
|
|
10
|
+
* INVARIANT: `(sessionId, turnIndex)` is the idempotency key. At-least-once
|
|
11
|
+
* SQS delivery may invoke a handler with the same envelope twice; the
|
|
12
|
+
* runtime MUST detect duplicates via SessionStore's `lastAckedTurn` and
|
|
13
|
+
* ack-without-re-executing on replay.
|
|
14
|
+
*
|
|
15
|
+
* Breaking changes require `version: 2` + a dual-parse window. Gate
|
|
16
|
+
* `G-ENVELOPE-VERSION` enforces the literal `version: 1` in this file.
|
|
17
|
+
*/
|
|
18
|
+
/** Opaque reference to a checkpoint in SessionStore (S4). */
|
|
19
|
+
export interface CheckpointRef {
|
|
20
|
+
/** SessionStore-scoped id; opaque to Cortex. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Content hash for integrity check on load. */
|
|
23
|
+
hash: string;
|
|
24
|
+
/** Size hint (bytes) — lets workers reject oversized loads fast. */
|
|
25
|
+
sizeBytes: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Budget carry-over strategies (S5 §5).
|
|
29
|
+
*
|
|
30
|
+
* Wave 1 ships `fresh-per-continuation` only. `batched-held` and
|
|
31
|
+
* `predictive-prereserve` are gated on Cortex Open Question O1
|
|
32
|
+
* (`ctx.llm.reserve()/settle()` API). The executor throws
|
|
33
|
+
* `BudgetStrategyNotImplemented` at runtime when an unimplemented
|
|
34
|
+
* strategy is requested; unknown strategy values fall back defensively
|
|
35
|
+
* to `batched-held` per S5 §9.
|
|
36
|
+
*/
|
|
37
|
+
export type BudgetCarryStrategy = 'fresh-per-continuation' | 'batched-held' | 'predictive-prereserve';
|
|
38
|
+
/** Opaque reference to a budget reservation. */
|
|
39
|
+
export interface BudgetRef {
|
|
40
|
+
/** Reservation id returned by `ctx.llm` reservation call (S3). */
|
|
41
|
+
reservationId: string;
|
|
42
|
+
/** Strategy the envelope was issued under (see §5). */
|
|
43
|
+
strategy: BudgetCarryStrategy;
|
|
44
|
+
/**
|
|
45
|
+
* Budget remaining at envelope emission (USD). Advisory — authoritative
|
|
46
|
+
* value lives in ctx.llm.
|
|
47
|
+
*/
|
|
48
|
+
remainingUsd: number;
|
|
49
|
+
/**
|
|
50
|
+
* Absolute wall-clock deadline (UTC ms). After this, the continuation
|
|
51
|
+
* MUST refuse.
|
|
52
|
+
*/
|
|
53
|
+
expiresAt: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* What the resumption turn must perform (S5 §2.1).
|
|
57
|
+
*
|
|
58
|
+
* Scoped to the continuation envelope — this is NOT the same shape as
|
|
59
|
+
* `NextAction` in `./session-store-types.ts`, which is the S4 checkpoint
|
|
60
|
+
* resume hint. Consumers should import this type by its re-exported
|
|
61
|
+
* alias `ContinuationNextAction` from the `/ports` barrel to disambiguate.
|
|
62
|
+
*/
|
|
63
|
+
export type NextAction = {
|
|
64
|
+
type: 'resume';
|
|
65
|
+
reason: 'async_io' | 'scheduled' | 'checkpoint_yield';
|
|
66
|
+
} | {
|
|
67
|
+
type: 'retry';
|
|
68
|
+
attempt: number;
|
|
69
|
+
lastError: string;
|
|
70
|
+
} | {
|
|
71
|
+
type: 'gate_wait';
|
|
72
|
+
gateId: string;
|
|
73
|
+
waitingFor: string;
|
|
74
|
+
};
|
|
75
|
+
export interface TokenContext {
|
|
76
|
+
/** User the pact acts on behalf of (sub claim). */
|
|
77
|
+
userSub: string;
|
|
78
|
+
/** Exchange depth so far (RFC 8693). Cortex caps at 2. */
|
|
79
|
+
exchangeDepth: number;
|
|
80
|
+
/** Original request id for audit trail. */
|
|
81
|
+
originatingRequestId: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* PRD-067: cross-app continuation context.
|
|
85
|
+
*
|
|
86
|
+
* Present only when the continuation arose from or is awaiting a
|
|
87
|
+
* `cross-app-invoke` node. Absent for pure in-app pacts — envelopes
|
|
88
|
+
* serialised pre-PRD-067 round-trip byte-identically
|
|
89
|
+
* (G-ENVELOPE-BACKWARD-COMPAT).
|
|
90
|
+
*
|
|
91
|
+
* Surface freeze: 2026-04-15 — additive extension of S5 `version: 1` per
|
|
92
|
+
* S5 §9 ("Additional envelope fields — MUST keep version: 1 semantics
|
|
93
|
+
* compatible; add optional fields only.").
|
|
94
|
+
*/
|
|
95
|
+
export interface CrossAppContinuationContext {
|
|
96
|
+
/** Node id in the caller's DAG that triggered the cross-app call. */
|
|
97
|
+
readonly callerNodeId: string;
|
|
98
|
+
/** Target app id the caller dispatched to. */
|
|
99
|
+
readonly targetAppId: string;
|
|
100
|
+
/** Operation name on the target app. */
|
|
101
|
+
readonly operation: string;
|
|
102
|
+
/** Originating request id on the caller side — lets the resumption path
|
|
103
|
+
* correlate with the caller's audit entry. Matches
|
|
104
|
+
* `tokenContext.originatingRequestId` of the emitting envelope. */
|
|
105
|
+
readonly originatingRequestId: string;
|
|
106
|
+
/** Cortex PRD-080 decisionId returned on the outbound invoke — lookup key
|
|
107
|
+
* for audit correlation and (when async) callee-completion polling. */
|
|
108
|
+
readonly targetDecisionId: string;
|
|
109
|
+
/**
|
|
110
|
+
* Phase of the cross-app call (PRD-067 §6.3):
|
|
111
|
+
* - "awaiting_callee" — caller suspended, callee's pact is running in
|
|
112
|
+
* its own app's job queue; resumption happens when the caller's
|
|
113
|
+
* ctx.events subscription receives
|
|
114
|
+
* `method.cross_app.target_event.type=completed`.
|
|
115
|
+
* - "completed" — output merged into DAG bundle, envelope moves on.
|
|
116
|
+
* - "failed" — target returned error; strategy gate decides retry.
|
|
117
|
+
*/
|
|
118
|
+
readonly phase: 'awaiting_callee' | 'completed' | 'failed';
|
|
119
|
+
/** Populated only when `phase === 'completed'` — opaque JSON merged by
|
|
120
|
+
* the `output_merge` policy of the caller node. */
|
|
121
|
+
readonly calleeOutput?: Readonly<Record<string, unknown>>;
|
|
122
|
+
/** Populated only when `phase === 'failed'` — human-readable reason for
|
|
123
|
+
* the gate decision. */
|
|
124
|
+
readonly failureReason?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The canonical continuation envelope. Frozen wire schema at `version: 1`.
|
|
128
|
+
*
|
|
129
|
+
* Extension rule: additional OPTIONAL fields may be added without a
|
|
130
|
+
* version bump; any structural/required-field change requires `version: 2`
|
|
131
|
+
* + a dual-parse window. The literal `version: 1` MUST be preserved
|
|
132
|
+
* (G-ENVELOPE-VERSION).
|
|
133
|
+
*/
|
|
134
|
+
export interface ContinuationEnvelope {
|
|
135
|
+
/** Envelope schema version. Bump on breaking changes. */
|
|
136
|
+
version: 1;
|
|
137
|
+
/** Stable pact identifier — survives across all continuations. */
|
|
138
|
+
sessionId: string;
|
|
139
|
+
/** Monotonic turn counter. n-th continuation has turnIndex = n. */
|
|
140
|
+
turnIndex: number;
|
|
141
|
+
/** Pointer into SessionStore for the checkpoint the next worker must load. */
|
|
142
|
+
checkpointRef: CheckpointRef;
|
|
143
|
+
/** Pointer into the budget reservation the next worker inherits. */
|
|
144
|
+
budgetRef: BudgetRef;
|
|
145
|
+
/** What the next worker must do when it wakes. */
|
|
146
|
+
nextAction: NextAction;
|
|
147
|
+
/** Pact factory registration key — which pact to instantiate. */
|
|
148
|
+
pactKey: string;
|
|
149
|
+
/** Parent user token context for RFC 8693 re-exchange on resume. */
|
|
150
|
+
tokenContext: TokenContext;
|
|
151
|
+
/** Timestamp the previous worker emitted the envelope (UTC ms). */
|
|
152
|
+
emittedAt: number;
|
|
153
|
+
/** Opaque tracing id spanning the full pact lifecycle. */
|
|
154
|
+
traceId: string;
|
|
155
|
+
/**
|
|
156
|
+
* PRD-067: OPTIONAL cross-app continuation context.
|
|
157
|
+
*
|
|
158
|
+
* Present only when this continuation arose from or is awaiting a
|
|
159
|
+
* `cross-app-invoke` node. Absent for pure in-app pacts; an envelope
|
|
160
|
+
* serialised pre-PRD-067 round-trips byte-identically when this field is
|
|
161
|
+
* missing (G-ENVELOPE-BACKWARD-COMPAT).
|
|
162
|
+
*
|
|
163
|
+
* This is an ADDITIVE extension of S5 `version: 1` per S5 §9 and does not
|
|
164
|
+
* require a `version: 2` bump. See `CrossAppContinuationContext` above.
|
|
165
|
+
*/
|
|
166
|
+
readonly crossApp?: CrossAppContinuationContext;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Soft cap (bytes) on a serialised envelope, enforced by the executor at
|
|
170
|
+
* `yield()` time (S5 §10.2). Well under the 256 KB SQS cap; keeps
|
|
171
|
+
* envelopes small + cheap to transport.
|
|
172
|
+
*/
|
|
173
|
+
export declare const ENVELOPE_SIZE_SOFT_CAP_BYTES: number;
|
|
174
|
+
/**
|
|
175
|
+
* Error thrown when the executor encounters a continuation whose
|
|
176
|
+
* `version` is not `1`. The runtime MUST NOT attempt to parse forward.
|
|
177
|
+
*/
|
|
178
|
+
export declare class EnvelopeVersionError extends Error {
|
|
179
|
+
readonly observedVersion: unknown;
|
|
180
|
+
constructor(observedVersion: unknown);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Error thrown when a continuation arrives after its budget reservation
|
|
184
|
+
* has expired (`BudgetRef.expiresAt <= now`). Terminal — session is
|
|
185
|
+
* finalised and a DLQ event is emitted (S5 §5 expiry, §7 DLQ).
|
|
186
|
+
*/
|
|
187
|
+
export declare class BudgetExpiredError extends Error {
|
|
188
|
+
readonly expiresAt: number;
|
|
189
|
+
readonly now: number;
|
|
190
|
+
constructor(expiresAt: number, now: number);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Structural validation of a raw payload into a `ContinuationEnvelope`.
|
|
194
|
+
* Throws `EnvelopeVersionError` if `version !== 1`. Returns the same
|
|
195
|
+
* reference on success (no structural copy — callers should treat as
|
|
196
|
+
* immutable).
|
|
197
|
+
*/
|
|
198
|
+
export declare function parseContinuationEnvelope(payload: unknown): ContinuationEnvelope;
|
|
199
|
+
//# sourceMappingURL=continuation-envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-envelope.d.ts","sourceRoot":"","sources":["../../src/ports/continuation-envelope.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,6DAA6D;AAC7D,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAC3B,wBAAwB,GACxB,cAAc,GACd,uBAAu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ier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* ContinuationEnvelope v1 — the wire format for pact continuations (PRD-062 / S5 §2.1).
|
|
4
|
+
*
|
|
5
|
+
* Frozen: 2026-04-14 — see `.method/sessions/fcd-surface-job-backed-executor/decision.md`.
|
|
6
|
+
*
|
|
7
|
+
* Written to `ctx.jobs` as the job payload whenever a pact yields (suspends)
|
|
8
|
+
* between workers. The next worker pulls it, rehydrates via SessionStore,
|
|
9
|
+
* and invokes the pact with `nextAction` as the resumption signal.
|
|
10
|
+
*
|
|
11
|
+
* INVARIANT: `(sessionId, turnIndex)` is the idempotency key. At-least-once
|
|
12
|
+
* SQS delivery may invoke a handler with the same envelope twice; the
|
|
13
|
+
* runtime MUST detect duplicates via SessionStore's `lastAckedTurn` and
|
|
14
|
+
* ack-without-re-executing on replay.
|
|
15
|
+
*
|
|
16
|
+
* Breaking changes require `version: 2` + a dual-parse window. Gate
|
|
17
|
+
* `G-ENVELOPE-VERSION` enforces the literal `version: 1` in this file.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Soft cap (bytes) on a serialised envelope, enforced by the executor at
|
|
21
|
+
* `yield()` time (S5 §10.2). Well under the 256 KB SQS cap; keeps
|
|
22
|
+
* envelopes small + cheap to transport.
|
|
23
|
+
*/
|
|
24
|
+
export const ENVELOPE_SIZE_SOFT_CAP_BYTES = 32 * 1024;
|
|
25
|
+
/**
|
|
26
|
+
* Error thrown when the executor encounters a continuation whose
|
|
27
|
+
* `version` is not `1`. The runtime MUST NOT attempt to parse forward.
|
|
28
|
+
*/
|
|
29
|
+
export class EnvelopeVersionError extends Error {
|
|
30
|
+
observedVersion;
|
|
31
|
+
constructor(observedVersion) {
|
|
32
|
+
super(`ContinuationEnvelope.version ${String(observedVersion)} not supported — runtime speaks version: 1`);
|
|
33
|
+
this.name = 'EnvelopeVersionError';
|
|
34
|
+
this.observedVersion = observedVersion;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Error thrown when a continuation arrives after its budget reservation
|
|
39
|
+
* has expired (`BudgetRef.expiresAt <= now`). Terminal — session is
|
|
40
|
+
* finalised and a DLQ event is emitted (S5 §5 expiry, §7 DLQ).
|
|
41
|
+
*/
|
|
42
|
+
export class BudgetExpiredError extends Error {
|
|
43
|
+
expiresAt;
|
|
44
|
+
now;
|
|
45
|
+
constructor(expiresAt, now) {
|
|
46
|
+
super(`BudgetRef expired at ${new Date(expiresAt).toISOString()} (now ${new Date(now).toISOString()})`);
|
|
47
|
+
this.name = 'BudgetExpiredError';
|
|
48
|
+
this.expiresAt = expiresAt;
|
|
49
|
+
this.now = now;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Structural validation of a raw payload into a `ContinuationEnvelope`.
|
|
54
|
+
* Throws `EnvelopeVersionError` if `version !== 1`. Returns the same
|
|
55
|
+
* reference on success (no structural copy — callers should treat as
|
|
56
|
+
* immutable).
|
|
57
|
+
*/
|
|
58
|
+
export function parseContinuationEnvelope(payload) {
|
|
59
|
+
if (!payload || typeof payload !== 'object') {
|
|
60
|
+
throw new EnvelopeVersionError(undefined);
|
|
61
|
+
}
|
|
62
|
+
const maybe = payload;
|
|
63
|
+
if (maybe.version !== 1) {
|
|
64
|
+
throw new EnvelopeVersionError(maybe.version);
|
|
65
|
+
}
|
|
66
|
+
// Duck-typed: downstream consumers (the executor) validate shape by use.
|
|
67
|
+
return payload;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=continuation-envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-envelope.js","sourceRoot":"","sources":["../../src/ports/continuation-envelope.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;GAgBG;AAoKH;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,IAAI,CAAC;AAEtD;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,eAAe,CAAU;IAClC,YAAY,eAAwB;QAClC,KAAK,CACH,gCAAgC,MAAM,CAAC,eAAe,CAAC,4CAA4C,CACpG,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,SAAS,CAAS;IAClB,GAAG,CAAS;IACrB,YAAY,SAAiB,EAAE,GAAW;QACxC,KAAK,CAAC,wBAAwB,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACxG,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IACxD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,KAAK,GAAG,OAAgC,CAAC;IAC/C,IAAI,KAAK,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IACD,yEAAyE;IACzE,OAAO,OAA+B,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConversationPort — Human-agent conversation for Build Orchestrator gates.
|
|
3
|
+
*
|
|
4
|
+
* Provides the communication channel between the orchestrator agent and
|
|
5
|
+
* the human via the dashboard conversation panel. Supports rich cards,
|
|
6
|
+
* threading, per-gate action buttons, and on-demand skill invocation.
|
|
7
|
+
*
|
|
8
|
+
* @see PRD 047 — Build Orchestrator §Surfaces
|
|
9
|
+
*/
|
|
10
|
+
import type { ConversationMessage } from './checkpoint.js';
|
|
11
|
+
export interface ConversationPort {
|
|
12
|
+
/** Send a message from the orchestrator to the human (renders in chat panel). */
|
|
13
|
+
sendAgentMessage(buildId: string, message: AgentMessage): Promise<void>;
|
|
14
|
+
/** Send a system notification (phase transition, checkpoint, status). */
|
|
15
|
+
sendSystemMessage(buildId: string, message: string): Promise<void>;
|
|
16
|
+
/** Wait for the human to respond (blocks until message received via UI). */
|
|
17
|
+
waitForHumanMessage(buildId: string): Promise<HumanMessage>;
|
|
18
|
+
/** Wait for a gate decision (blocks until approve/reject via UI). */
|
|
19
|
+
waitForGateDecision(buildId: string, gate: GateType): Promise<GateDecision>;
|
|
20
|
+
/** Get full conversation history for a build. */
|
|
21
|
+
getHistory(buildId: string): Promise<ConversationMessage[]>;
|
|
22
|
+
/** Human requests an optional skill invocation mid-pipeline. */
|
|
23
|
+
requestSkillInvocation(buildId: string, skill: SkillRequest): Promise<void>;
|
|
24
|
+
/** Deliver a human message from the REST route (resolves waitForHumanMessage). */
|
|
25
|
+
receiveHumanMessage(buildId: string, message: HumanMessage): void;
|
|
26
|
+
/** Deliver a gate decision from the REST route (resolves waitForGateDecision). */
|
|
27
|
+
receiveGateDecision(buildId: string, decision: GateDecision): void;
|
|
28
|
+
}
|
|
29
|
+
export interface AgentMessage {
|
|
30
|
+
readonly type: "text" | "card" | "artifact";
|
|
31
|
+
readonly content: string;
|
|
32
|
+
readonly card?: StructuredCard;
|
|
33
|
+
readonly replyTo?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface HumanMessage {
|
|
36
|
+
readonly content: string;
|
|
37
|
+
readonly replyTo?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface GateDecision {
|
|
40
|
+
readonly gate: GateType;
|
|
41
|
+
readonly decision: "approve" | "reject" | "adjust";
|
|
42
|
+
readonly feedback?: string;
|
|
43
|
+
readonly adjustments?: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
export type GateType = "specify" | "design" | "plan" | "review" | "escalation";
|
|
46
|
+
/** Per-gate action sets rendered by the UI. */
|
|
47
|
+
export declare const GATE_ACTIONS: Record<GateType, readonly string[]>;
|
|
48
|
+
export type SkillRequest = {
|
|
49
|
+
type: "debate";
|
|
50
|
+
context: string;
|
|
51
|
+
} | {
|
|
52
|
+
type: "review";
|
|
53
|
+
commissionId?: string;
|
|
54
|
+
context: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: "surface";
|
|
57
|
+
domains: [string, string];
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
export interface StructuredCard {
|
|
61
|
+
readonly type: "feature-spec" | "prd-summary" | "commission-plan" | "review-findings" | "evidence-report" | "debate-decision";
|
|
62
|
+
readonly data: Record<string, unknown>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/ports/conversation.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAI3D,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,yEAAyE;IACzE,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,4EAA4E;IAC5E,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5D,qEAAqE;IACrE,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QA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,MAAM,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAMnD,CAAC;AAIX,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAIxE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;IAC9H,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* ConversationPort — Human-agent conversation for Build Orchestrator gates.
|
|
4
|
+
*
|
|
5
|
+
* Provides the communication channel between the orchestrator agent and
|
|
6
|
+
* the human via the dashboard conversation panel. Supports rich cards,
|
|
7
|
+
* threading, per-gate action buttons, and on-demand skill invocation.
|
|
8
|
+
*
|
|
9
|
+
* @see PRD 047 — Build Orchestrator §Surfaces
|
|
10
|
+
*/
|
|
11
|
+
/** Per-gate action sets rendered by the UI. */
|
|
12
|
+
export const GATE_ACTIONS = {
|
|
13
|
+
specify: ["Approve Spec"],
|
|
14
|
+
design: ["Approve Design"],
|
|
15
|
+
plan: ["Approve Plan"],
|
|
16
|
+
review: ["Approve", "Approve with Comments", "Request Changes"],
|
|
17
|
+
escalation: ["Retry with Direction", "Fix Manually", "Abort"],
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/ports/conversation.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;GAQG;AAkDH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAwC;IAC/D,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,MAAM,EAAE,CAAC,gBAAgB,CAAC;IAC1B,IAAI,EAAE,CAAC,cAAc,CAAC;IACtB,MAAM,EAAE,CAAC,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,CAAC;IAC/D,UAAU,EAAE,CAAC,sBAAsB,EAAE,cAAc,EAAE,OAAO,CAAC;CACrD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CostOracle — Port interface (PRD 051 S1).
|
|
3
|
+
*
|
|
4
|
+
* Consumed by strategies domain (dry-run) and MCP tool.
|
|
5
|
+
* Implemented by cost-governor domain.
|
|
6
|
+
*/
|
|
7
|
+
import type { InvocationSignature, CostBand } from '@methodts/types';
|
|
8
|
+
export interface NodeEstimate {
|
|
9
|
+
readonly nodeId: string;
|
|
10
|
+
readonly signature: InvocationSignature;
|
|
11
|
+
readonly cost: CostBand;
|
|
12
|
+
readonly durationMs: CostBand;
|
|
13
|
+
}
|
|
14
|
+
export interface StrategyEstimate {
|
|
15
|
+
readonly nodes: readonly NodeEstimate[];
|
|
16
|
+
readonly totalCost: CostBand;
|
|
17
|
+
readonly totalDurationMs: CostBand;
|
|
18
|
+
readonly unknownNodes: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface CostOracle {
|
|
21
|
+
/** Walk a DAG and estimate total cost/time via critical-path with parallelism-discount. */
|
|
22
|
+
estimateStrategy(nodeSignatures: ReadonlyMap<string, InvocationSignature>, dagEdges: ReadonlyMap<string, readonly string[]>): StrategyEstimate;
|
|
23
|
+
/** Record an actual outcome. Called after releaseSlot. */
|
|
24
|
+
record(sig: InvocationSignature, actualCostUsd: number, actualDurationMs: number, accountId: string): void;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=cost-oracle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-oracle.d.ts","sourceRoot":"","sources":["../../src/ports/cost-oracle.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIrE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAID,MAAM,WAAW,UAAU;IACzB,2FAA2F;IAC3F,gBAAgB,CACd,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,EACxD,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GAC/C,gBAAgB,CAAC;IAEpB,0DAA0D;IAC1D,MAAM,CACJ,GAAG,EAAE,mBAAmB,EACxB,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,MAAM,GAChB,IAAI,CAAC;CACT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-oracle.js","sourceRoot":"","sources":["../../src/ports/cost-oracle.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;GAKG"}
|