@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,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventReader — cursor-based historical event replay port.
|
|
3
|
+
*
|
|
4
|
+
* Exposes historical event reading from the persistent event log for projection
|
|
5
|
+
* replay on startup. Implemented by PersistenceSink. Distinct from live event
|
|
6
|
+
* subscription (provided by EventBus) — this port is for catching up from disk.
|
|
7
|
+
*
|
|
8
|
+
* @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S3
|
|
9
|
+
*/
|
|
10
|
+
import type { RuntimeEvent } from './event-bus.js';
|
|
11
|
+
export interface EventReader {
|
|
12
|
+
/**
|
|
13
|
+
* Read events from the persistent log where sequence > sinceSeq.
|
|
14
|
+
* Returns events in append order. Corrupt JSONL lines are skipped gracefully.
|
|
15
|
+
*
|
|
16
|
+
* @param sinceSeq — exclusive lower bound (returns events with sequence > sinceSeq)
|
|
17
|
+
* @returns events in append order
|
|
18
|
+
*/
|
|
19
|
+
readEventsSince(sinceSeq: number): Promise<RuntimeEvent[]>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=event-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-reader.d.ts","sourceRoot":"","sources":["../../src/ports/event-reader.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC5D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EventReader — cursor-based historical event replay port.
|
|
4
|
+
*
|
|
5
|
+
* Exposes historical event reading from the persistent event log for projection
|
|
6
|
+
* replay on startup. Implemented by PersistenceSink. Distinct from live event
|
|
7
|
+
* subscription (provided by EventBus) — this port is for catching up from disk.
|
|
8
|
+
*
|
|
9
|
+
* @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S3
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=event-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-reader.js","sourceRoot":"","sources":["../../src/ports/event-reader.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EventRotator — archives events older than a cutoff window to keep the log bounded.
|
|
3
|
+
*
|
|
4
|
+
* Rotation compacts the main event log (`.method/events.jsonl`) by moving old
|
|
5
|
+
* events into gzipped daily archives (`.method/events.archive/YYYY-MM-DD.jsonl.gz`).
|
|
6
|
+
*
|
|
7
|
+
* Safety contract: rotation MUST NOT cross the cursor returned by safetyGuard —
|
|
8
|
+
* doing so would strand projection snapshots that haven't yet caught up, breaking
|
|
9
|
+
* their ability to recover on next restart.
|
|
10
|
+
*
|
|
11
|
+
* @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S-rotator
|
|
12
|
+
*/
|
|
13
|
+
export interface EventRotator {
|
|
14
|
+
/** Archive events older than the cutoff, after checking rotation is safe. */
|
|
15
|
+
rotate(options: RotateOptions): Promise<RotateResult>;
|
|
16
|
+
}
|
|
17
|
+
export interface RotateOptions {
|
|
18
|
+
/** Archive events older than this many days. */
|
|
19
|
+
readonly olderThanDays: number;
|
|
20
|
+
/**
|
|
21
|
+
* Safety guard — returns the lowest cursor below which rotation is safe.
|
|
22
|
+
* Returns null if rotation is unsafe at any cursor (e.g. no projections registered).
|
|
23
|
+
* Called by rotate() before any archive operation.
|
|
24
|
+
*/
|
|
25
|
+
readonly safetyGuard: () => number | null;
|
|
26
|
+
}
|
|
27
|
+
export interface RotateResult {
|
|
28
|
+
/** Number of events moved to the archive file. */
|
|
29
|
+
readonly archivedEvents: number;
|
|
30
|
+
/** Path to the written archive file, or null if no events were archived. */
|
|
31
|
+
readonly archivePath: string | null;
|
|
32
|
+
/** Size of the main log after rotation, in bytes. */
|
|
33
|
+
readonly newLogSize: number;
|
|
34
|
+
/** True if the safety guard blocked rotation (archivedEvents will be 0). */
|
|
35
|
+
readonly skipped: boolean;
|
|
36
|
+
/** Human-readable reason when `skipped` is true. */
|
|
37
|
+
readonly skipReason?: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=event-rotator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-rotator.d.ts","sourceRoot":"","sources":["../../src/ports/event-rotator.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,YAAY;IAC3B,6EAA6E;IAC7E,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CAC3C;AAED,MAAM,WAAW,YAAY;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* EventRotator — archives events older than a cutoff window to keep the log bounded.
|
|
4
|
+
*
|
|
5
|
+
* Rotation compacts the main event log (`.method/events.jsonl`) by moving old
|
|
6
|
+
* events into gzipped daily archives (`.method/events.archive/YYYY-MM-DD.jsonl.gz`).
|
|
7
|
+
*
|
|
8
|
+
* Safety contract: rotation MUST NOT cross the cursor returned by safetyGuard —
|
|
9
|
+
* doing so would strand projection snapshots that haven't yet caught up, breaking
|
|
10
|
+
* their ability to recover on next restart.
|
|
11
|
+
*
|
|
12
|
+
* @see .method/sessions/fcd-design-persistence-projections/prd.md §Surfaces S-rotator
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=event-rotator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-rotator.js","sourceRoot":"","sources":["../../src/ports/event-rotator.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FileSystemProvider — Port interface for filesystem operations.
|
|
3
|
+
*
|
|
4
|
+
* PRD-057 / S2 §5.3: Only the interface lives in runtime. The Node impl
|
|
5
|
+
* (`NodeFileSystemProvider`) stays in bridge because it binds directly to
|
|
6
|
+
* `node:fs` — an OS-transport dependency runtime cannot take.
|
|
7
|
+
*/
|
|
8
|
+
export interface DirEntry {
|
|
9
|
+
name: string;
|
|
10
|
+
isDirectory(): boolean;
|
|
11
|
+
isFile(): boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface FileStat {
|
|
14
|
+
mtimeMs: number;
|
|
15
|
+
mtime: Date;
|
|
16
|
+
size: number;
|
|
17
|
+
isFile(): boolean;
|
|
18
|
+
isDirectory(): boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface FileSystemProvider {
|
|
21
|
+
readFileSync(path: string, encoding: BufferEncoding): string;
|
|
22
|
+
writeFileSync(path: string, content: string, options?: {
|
|
23
|
+
encoding?: BufferEncoding;
|
|
24
|
+
mode?: number;
|
|
25
|
+
}): void;
|
|
26
|
+
existsSync(path: string): boolean;
|
|
27
|
+
readdirSync(path: string): string[];
|
|
28
|
+
readdirSync(path: string, options: {
|
|
29
|
+
withFileTypes: true;
|
|
30
|
+
}): DirEntry[];
|
|
31
|
+
statSync(path: string): FileStat;
|
|
32
|
+
unlinkSync(path: string): void;
|
|
33
|
+
mkdirSync(path: string, options?: {
|
|
34
|
+
recursive?: boolean;
|
|
35
|
+
}): void;
|
|
36
|
+
renameSync(oldPath: string, newPath: string): void;
|
|
37
|
+
realpathSync(path: string): string;
|
|
38
|
+
readFile(path: string, encoding: BufferEncoding): Promise<string>;
|
|
39
|
+
writeFile(path: string, content: string, encoding: BufferEncoding): Promise<void>;
|
|
40
|
+
appendFile(path: string, content: string, encoding: BufferEncoding): Promise<void>;
|
|
41
|
+
readdir(path: string): Promise<string[]>;
|
|
42
|
+
stat(path: string): Promise<FileStat>;
|
|
43
|
+
access(path: string): Promise<void>;
|
|
44
|
+
mkdir(path: string, options?: {
|
|
45
|
+
recursive?: boolean;
|
|
46
|
+
}): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=file-system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/ports/file-system.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAIH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,IAAI,OAAO,CAAC;IACvB,MAAM,IAAI,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,IAAI,OAAO,CAAC;IAClB,WAAW,IAAI,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAEjC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC;IAC7D,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3G,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAClC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,aAAa,EAAE,IAAI,CAAA;KAAE,GAAG,QAAQ,EAAE,CAAC;IACxE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACjC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAGnC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAClE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* FileSystemProvider — Port interface for filesystem operations.
|
|
4
|
+
*
|
|
5
|
+
* PRD-057 / S2 §5.3: Only the interface lives in runtime. The Node impl
|
|
6
|
+
* (`NodeFileSystemProvider`) stays in bridge because it binds directly to
|
|
7
|
+
* `node:fs` — an OS-transport dependency runtime cannot take.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=file-system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-system.js","sourceRoot":"","sources":["../../src/ports/file-system.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;GAMG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HistoricalObservations — Port interface (PRD 051 S5).
|
|
3
|
+
*
|
|
4
|
+
* Consumed by cost-governor domain (CostOracle reads history).
|
|
5
|
+
* Implemented by ObservationsStore in cost-governor domain.
|
|
6
|
+
*/
|
|
7
|
+
import type { InvocationSignature, ProviderClass, AccountId } from '@methodts/types';
|
|
8
|
+
export interface Observation {
|
|
9
|
+
readonly signature: InvocationSignature;
|
|
10
|
+
readonly costUsd: number;
|
|
11
|
+
readonly durationMs: number;
|
|
12
|
+
readonly tokensIn: number;
|
|
13
|
+
readonly tokensOut: number;
|
|
14
|
+
readonly tokensCacheRead: number;
|
|
15
|
+
readonly tokensCacheWrite: number;
|
|
16
|
+
readonly recordedAt: number;
|
|
17
|
+
readonly accountId: AccountId;
|
|
18
|
+
readonly providerClass: ProviderClass;
|
|
19
|
+
readonly hmac: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Opaque capability — only the composition root creates one and
|
|
23
|
+
* passes it to the RateGovernor. Prevents poisoning via hostile
|
|
24
|
+
* strategy authors.
|
|
25
|
+
*/
|
|
26
|
+
declare const __appendTokenBrand: unique symbol;
|
|
27
|
+
export type AppendToken = {
|
|
28
|
+
readonly [__appendTokenBrand]: true;
|
|
29
|
+
};
|
|
30
|
+
/** Create an AppendToken. Only call this in the composition root. */
|
|
31
|
+
export declare function createAppendToken(): AppendToken;
|
|
32
|
+
export interface HistoricalObservations {
|
|
33
|
+
/** Query observations matching a signature, newest first. */
|
|
34
|
+
query(sig: InvocationSignature, limit?: number): readonly Observation[];
|
|
35
|
+
/** Append an observation. Requires a capability token. */
|
|
36
|
+
append(obs: Omit<Observation, 'hmac'>, token: AppendToken): void;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=historical-observations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historical-observations.d.ts","sourceRoot":"","sources":["../../src/ports/historical-observations.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIrF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAID;;;;GAIG;AACH,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,MAAM,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAElE,qEAAqE;AACrE,wBAAgB,iBAAiB,IAAI,WAAW,CAE/C;AAID,MAAM,WAAW,sBAAsB;IACrC,6DAA6D;IAC7D,KAAK,CAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,CAAC;IAExE,0DAA0D;IAC1D,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAClE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* HistoricalObservations — Port interface (PRD 051 S5).
|
|
4
|
+
*
|
|
5
|
+
* Consumed by cost-governor domain (CostOracle reads history).
|
|
6
|
+
* Implemented by ObservationsStore in cost-governor domain.
|
|
7
|
+
*/
|
|
8
|
+
/** Create an AppendToken. Only call this in the composition root. */
|
|
9
|
+
export function createAppendToken() {
|
|
10
|
+
return Object.freeze({});
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=historical-observations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historical-observations.js","sourceRoot":"","sources":["../../src/ports/historical-observations.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;GAKG;AA8BH,qEAAqE;AACrE,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,MAAM,CAAC,EAAiB,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InMemorySource — Test MethodologySource for port substitutability proof.
|
|
3
|
+
*
|
|
4
|
+
* WS-1 success criterion 6: "a 20-line InMemorySource for tests proves
|
|
5
|
+
* the port interface is a real seam, not a port-shaped wrapper."
|
|
6
|
+
*
|
|
7
|
+
* PRD-057 / S2 §5.3: promoted from bridge to runtime.
|
|
8
|
+
* PRD-064 / S7: gains no-op lifecycle stubs + a controllable `onChange`
|
|
9
|
+
* trigger (`emitChange()`) so tests can simulate methodology-update
|
|
10
|
+
* fan-out without a real Cortex events port.
|
|
11
|
+
*
|
|
12
|
+
* Accepts catalog entries and typed values in the constructor.
|
|
13
|
+
* No I/O, no external dependencies — pure data container.
|
|
14
|
+
*/
|
|
15
|
+
import type { MethodologySource, MethodologyChange } from './methodology-source.js';
|
|
16
|
+
import type { CatalogMethodologyEntry } from '@methodts/methodts/stdlib';
|
|
17
|
+
import type { Method } from '@methodts/methodts';
|
|
18
|
+
import type { Methodology } from '@methodts/methodts';
|
|
19
|
+
export declare class InMemorySource implements MethodologySource {
|
|
20
|
+
private readonly catalog;
|
|
21
|
+
private readonly methods;
|
|
22
|
+
private readonly methodologies;
|
|
23
|
+
private readonly listeners;
|
|
24
|
+
constructor(catalog: CatalogMethodologyEntry[], methods?: Array<{
|
|
25
|
+
key: string;
|
|
26
|
+
method: Method<any>;
|
|
27
|
+
}>, methodologies?: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
methodology: Methodology<any>;
|
|
30
|
+
}>);
|
|
31
|
+
list(): CatalogMethodologyEntry[];
|
|
32
|
+
getMethod(methodologyId: string, methodId: string): Method<any> | undefined;
|
|
33
|
+
getMethodology(methodologyId: string): Methodology<any> | undefined;
|
|
34
|
+
init(): Promise<void>;
|
|
35
|
+
reload(_methodologyId?: string): Promise<void>;
|
|
36
|
+
onChange(listener: (c: MethodologyChange) => void): () => void;
|
|
37
|
+
close(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Test-only hook — fires `change` to every registered listener. Lets
|
|
40
|
+
* tests exercise `onChange`-dependent paths (e.g. routing-cache
|
|
41
|
+
* invalidation in `MethodologySessionStore`) without wiring a full
|
|
42
|
+
* Cortex events port.
|
|
43
|
+
*/
|
|
44
|
+
emitChange(change: MethodologyChange): void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=in-memory-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-source.d.ts","sourceRoot":"","sources":["../../src/ports/in-memory-source.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,cAAe,YAAW,iBAAiB;IAQpD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAN1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IAEnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgC;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6C;gBAGpD,OAAO,EAAE,uBAAuB,EAAE,EAEnD,OAAO,GAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;KAAE,CAAM,EAEzD,aAAa,GAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;KAAE,CAAM;IAM1E,IAAI,IAAI,uBAAuB,EAAE;IAEjC,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS;IAI3E,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS;IAM7D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrB,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI;IAOxD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAG5C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* InMemorySource — Test MethodologySource for port substitutability proof.
|
|
4
|
+
*
|
|
5
|
+
* WS-1 success criterion 6: "a 20-line InMemorySource for tests proves
|
|
6
|
+
* the port interface is a real seam, not a port-shaped wrapper."
|
|
7
|
+
*
|
|
8
|
+
* PRD-057 / S2 §5.3: promoted from bridge to runtime.
|
|
9
|
+
* PRD-064 / S7: gains no-op lifecycle stubs + a controllable `onChange`
|
|
10
|
+
* trigger (`emitChange()`) so tests can simulate methodology-update
|
|
11
|
+
* fan-out without a real Cortex events port.
|
|
12
|
+
*
|
|
13
|
+
* Accepts catalog entries and typed values in the constructor.
|
|
14
|
+
* No I/O, no external dependencies — pure data container.
|
|
15
|
+
*/
|
|
16
|
+
export class InMemorySource {
|
|
17
|
+
catalog;
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
methods;
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
methodologies;
|
|
22
|
+
listeners = new Set();
|
|
23
|
+
constructor(catalog,
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
methods = [],
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
methodologies = []) {
|
|
28
|
+
this.catalog = catalog;
|
|
29
|
+
this.methods = new Map(methods.map(m => [m.key, m.method]));
|
|
30
|
+
this.methodologies = new Map(methodologies.map(m => [m.id, m.methodology]));
|
|
31
|
+
}
|
|
32
|
+
list() { return this.catalog; }
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
getMethod(methodologyId, methodId) {
|
|
35
|
+
return this.methods.get(`${methodologyId}/${methodId}`);
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
getMethodology(methodologyId) {
|
|
39
|
+
return this.methodologies.get(methodologyId);
|
|
40
|
+
}
|
|
41
|
+
// ── PRD-064 / S7 lifecycle stubs ──────────────────────────────────
|
|
42
|
+
async init() {
|
|
43
|
+
/* no-op — data provided via constructor */
|
|
44
|
+
}
|
|
45
|
+
async reload(_methodologyId) {
|
|
46
|
+
/* no-op — data provided via constructor */
|
|
47
|
+
}
|
|
48
|
+
onChange(listener) {
|
|
49
|
+
this.listeners.add(listener);
|
|
50
|
+
return () => {
|
|
51
|
+
this.listeners.delete(listener);
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
async close() {
|
|
55
|
+
this.listeners.clear();
|
|
56
|
+
}
|
|
57
|
+
// ── Test helper ───────────────────────────────────────────────────
|
|
58
|
+
/**
|
|
59
|
+
* Test-only hook — fires `change` to every registered listener. Lets
|
|
60
|
+
* tests exercise `onChange`-dependent paths (e.g. routing-cache
|
|
61
|
+
* invalidation in `MethodologySessionStore`) without wiring a full
|
|
62
|
+
* Cortex events port.
|
|
63
|
+
*/
|
|
64
|
+
emitChange(change) {
|
|
65
|
+
for (const l of this.listeners)
|
|
66
|
+
l(change);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=in-memory-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"in-memory-source.js","sourceRoot":"","sources":["../../src/ports/in-memory-source.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;GAaG;AAUH,MAAM,OAAO,cAAc;IAQN;IAPnB,8DAA8D;IAC7C,OAAO,CAA2B;IACnD,8DAA8D;IAC7C,aAAa,CAAgC;IAC7C,SAAS,GAAG,IAAI,GAAG,EAAkC,CAAC;IAEvE,YACmB,OAAkC;IACnD,8DAA8D;IAC9D,UAAuD,EAAE;IACzD,8DAA8D;IAC9D,gBAAsE,EAAE;QAJvD,YAAO,GAAP,OAAO,CAA2B;QAMnD,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,KAAgC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,8DAA8D;IAC9D,SAAS,CAAC,aAAqB,EAAE,QAAgB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,aAAa,IAAI,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,8DAA8D;IAC9D,cAAc,CAAC,aAAqB;QAClC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,qEAAqE;IAErE,KAAK,CAAC,IAAI;QACR,2CAA2C;IAC7C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,cAAuB;QAClC,2CAA2C;IAC7C,CAAC;IAED,QAAQ,CAAC,QAAwC;QAC/C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,qEAAqE;IAErE;;;;;OAKG;IACH,UAAU,CAAC,MAAyB;QAClC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS;YAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type { FileSystemProvider, DirEntry, FileStat } from './file-system.js';
|
|
2
|
+
export type { YamlLoader } from './yaml-loader.js';
|
|
3
|
+
export type { NativeSessionDiscovery, NativeSessionInfo } from './native-session-discovery.js';
|
|
4
|
+
export type { MethodologySource, MethodologyChange } from './methodology-source.js';
|
|
5
|
+
export { InMemorySource } from './in-memory-source.js';
|
|
6
|
+
export type { EventBus, EventSink, EventConnector, EventFilter, EventSubscription, ConnectorHealth, RuntimeEvent, RuntimeEventInput, EventDomain, EventSeverity, StrategyGateAwaitingApprovalPayload, StrategyGateApprovalResponsePayload, } from './event-bus.js';
|
|
7
|
+
export type { SessionBudget, SessionChainInfo, SessionMode, IsolationMode, WorktreeAction, WorktreeInfo, SessionStatusInfo, SessionSnapshot, StreamEvent, PtySessionHandle, SessionProviderOptions, SessionProviderFactory, } from './session-pool.js';
|
|
8
|
+
export type { CostOracle, NodeEstimate, StrategyEstimate } from './cost-oracle.js';
|
|
9
|
+
export type { RuntimeRateGovernor } from './rate-governor.js';
|
|
10
|
+
export type { HistoricalObservations, Observation, AppendToken } from './historical-observations.js';
|
|
11
|
+
export { createAppendToken } from './historical-observations.js';
|
|
12
|
+
export type { CheckpointPort, PipelineCheckpoint, PipelineCheckpointSummary, Phase, FeatureSpec, TestableAssertion, ConversationMessage, } from './checkpoint.js';
|
|
13
|
+
export type { ConversationPort, AgentMessage, HumanMessage, GateDecision, GateType, SkillRequest, StructuredCard, } from './conversation.js';
|
|
14
|
+
export { GATE_ACTIONS } from './conversation.js';
|
|
15
|
+
export type { Projection } from './projection.js';
|
|
16
|
+
export type { ProjectionStore, StartResult } from './projection-store.js';
|
|
17
|
+
export type { EventReader } from './event-reader.js';
|
|
18
|
+
export type { EventRotator, RotateOptions, RotateResult } from './event-rotator.js';
|
|
19
|
+
export type { SessionStore } from './session-store.js';
|
|
20
|
+
export type { SessionStatus, PactRef, SessionSnapshot as PersistedSessionSnapshot, EventCursor, AgentStateBlob, BudgetReservation, NextAction, Checkpoint, CheckpointMeta, ResumeOptions, ResumeContext, } from './session-store-types.js';
|
|
21
|
+
export type { SessionStoreErrorCode, SessionStoreErrorOptions, } from './session-store-errors.js';
|
|
22
|
+
export { SessionStoreError, isSessionStoreError, } from './session-store-errors.js';
|
|
23
|
+
export type { CheckpointSink, CheckpointSinkOptions, CheckpointCapture, } from './checkpoint-sink.js';
|
|
24
|
+
export type { ContinuationEnvelope, CheckpointRef, BudgetRef, BudgetCarryStrategy, TokenContext, CrossAppContinuationContext, NextAction as ContinuationNextAction, } from './continuation-envelope.js';
|
|
25
|
+
export { EnvelopeVersionError, BudgetExpiredError, ENVELOPE_SIZE_SOFT_CAP_BYTES, parseContinuationEnvelope, } from './continuation-envelope.js';
|
|
26
|
+
export type { JobBackedExecutor, JobClient, JobHandlerCtx, PactFactory, PactStartInput, } from './job-backed-executor.js';
|
|
27
|
+
export { DuplicateAttachError, PactRegistrationError, BudgetStrategyNotImplemented, } from './job-backed-executor.js';
|
|
28
|
+
export type { DlqObserver, DlqRecord, } from './dlq-observer.js';
|
|
29
|
+
export type { ScheduleClient } from './schedule-client.js';
|
|
30
|
+
export type { CrossAppInvoker, CrossAppInvokeRequest, CrossAppInvokeResult, CrossAppInvokerCapabilities, DelegationCarry, } from './cross-app-invoker.js';
|
|
31
|
+
export { CrossAppNotConfiguredError, CrossAppTargetNotDeclaredError, CrossAppScopeMissingError, CrossAppDelegationDepthExceededError, CrossAppTargetError, CrossAppTargetUnknownError, NullCrossAppInvoker, CROSS_APP_DEFAULT_MAX_DELEGATION_DEPTH, assertCrossAppTargetsAllowed, } from './cross-app-invoker.js';
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/E,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAG/F,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,YAAY,EACV,QAAQ,EACR,SAAS,EACT,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAG3B,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnF,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,YAAY,EAAE,sBAAsB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,cAAc,GACf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC1E,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMpF,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,YAAY,EACV,aAAa,EACb,OAAO,EACP,eAAe,IAAI,wBAAwB,EAC3C,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAQ9B,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,2BAA2B,EAC3B,UAAU,IAAI,sBAAsB,GACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,WAAW,EACX,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,oCAAoC,EACpC,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// PRD-057 / S2 §3.1: @methodts/runtime/ports — unified public port surface.
|
|
3
|
+
export { InMemorySource } from './in-memory-source.js';
|
|
4
|
+
export { createAppendToken } from './historical-observations.js';
|
|
5
|
+
export { GATE_ACTIONS } from './conversation.js';
|
|
6
|
+
export { SessionStoreError, isSessionStoreError, } from './session-store-errors.js';
|
|
7
|
+
export { EnvelopeVersionError, BudgetExpiredError, ENVELOPE_SIZE_SOFT_CAP_BYTES, parseContinuationEnvelope, } from './continuation-envelope.js';
|
|
8
|
+
export { DuplicateAttachError, PactRegistrationError, BudgetStrategyNotImplemented, } from './job-backed-executor.js';
|
|
9
|
+
export { CrossAppNotConfiguredError, CrossAppTargetNotDeclaredError, CrossAppScopeMissingError, CrossAppDelegationDepthExceededError, CrossAppTargetError, CrossAppTargetUnknownError, NullCrossAppInvoker, CROSS_APP_DEFAULT_MAX_DELEGATION_DEPTH, assertCrossAppTargetsAllowed, } from './cross-app-invoker.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,4EAA4E;AAS5E,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAsCvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAqBjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8BjD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAsBnC,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAelC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,oCAAoC,EACpC,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,sCAAsC,EACtC,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JobBackedExecutor — drives a pact across worker boundaries via ctx.jobs.
|
|
3
|
+
*
|
|
4
|
+
* PRD-062 / S5 §2.2. Frozen: 2026-04-14.
|
|
5
|
+
*
|
|
6
|
+
* Owner: @methodts/runtime
|
|
7
|
+
* Producer: @methodts/runtime (impl: CortexJobBackedExecutor)
|
|
8
|
+
* Consumer: tenant app composition root (wires ctx.jobs into the executor)
|
|
9
|
+
*
|
|
10
|
+
* The tenant app never calls `enqueue`/`dispatch` directly — it registers
|
|
11
|
+
* the executor once (`attach(ctx.jobs)`) and the runtime internally emits
|
|
12
|
+
* continuations whenever a pact yields.
|
|
13
|
+
*/
|
|
14
|
+
import type { Pact } from '@methodts/pacta';
|
|
15
|
+
import type { ContinuationEnvelope, BudgetRef, NextAction } from './continuation-envelope.js';
|
|
16
|
+
export interface JobBackedExecutor {
|
|
17
|
+
/**
|
|
18
|
+
* Wire the executor into a tenant's ctx.jobs. Registers exactly ONE handler
|
|
19
|
+
* (`method.pact.continue`) that dispatches all pact continuations for the
|
|
20
|
+
* entire app. Safe to call in app boot or test harnesses.
|
|
21
|
+
*
|
|
22
|
+
* Must be called before `start()`. Throws `DuplicateAttachError` if called
|
|
23
|
+
* twice with different `JobClient` instances.
|
|
24
|
+
*/
|
|
25
|
+
attach(jobs: JobClient): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Register a pact factory under a stable key. Continuations reference pacts
|
|
28
|
+
* by key so the envelope stays small and forward-compatible across deploys.
|
|
29
|
+
*
|
|
30
|
+
* A factory returns a `Pact` given the rehydrated input context.
|
|
31
|
+
*/
|
|
32
|
+
registerPact(key: string, factory: PactFactory): void;
|
|
33
|
+
/**
|
|
34
|
+
* Start a new pact as a job-backed execution. Returns the sessionId —
|
|
35
|
+
* results arrive via the tenant's `events` channel, not as a return value.
|
|
36
|
+
*
|
|
37
|
+
* The first turn runs inline (attempt to complete synchronously); if the
|
|
38
|
+
* pact yields, subsequent turns run in jobs.
|
|
39
|
+
*/
|
|
40
|
+
start(input: PactStartInput): Promise<{
|
|
41
|
+
sessionId: string;
|
|
42
|
+
traceId: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Emit a continuation envelope. Called internally when a pact yields.
|
|
46
|
+
* Surface is exposed on the port so alternative executors (testkit) can
|
|
47
|
+
* observe + assert on envelope emission.
|
|
48
|
+
*/
|
|
49
|
+
yield(envelope: ContinuationEnvelope): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Graceful shutdown: stop accepting new pacts, drain in-flight continuations
|
|
52
|
+
* up to `timeoutMs`, unack anything still running so SQS re-delivers.
|
|
53
|
+
*/
|
|
54
|
+
stop(timeoutMs: number): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
export interface PactStartInput {
|
|
57
|
+
pactKey: string;
|
|
58
|
+
initialPrompt: string;
|
|
59
|
+
userSub: string;
|
|
60
|
+
originatingRequestId: string;
|
|
61
|
+
/** Hard wall-clock cap across ALL continuations. Default 24h. */
|
|
62
|
+
maxLifetimeMs?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Budget strategy for this invocation. Defaults to `'fresh-per-continuation'`
|
|
65
|
+
* in Wave 1 (S5 §5). Other strategies throw `BudgetStrategyNotImplemented`
|
|
66
|
+
* until Cortex O1 (`ctx.llm.reserve()/settle()`) lands.
|
|
67
|
+
*/
|
|
68
|
+
budgetStrategy?: 'fresh-per-continuation' | 'batched-held' | 'predictive-prereserve';
|
|
69
|
+
/** Per-turn budget cap (USD) for `fresh-per-continuation`. Default 2.0. */
|
|
70
|
+
perTurnBudgetUsd?: number;
|
|
71
|
+
/** Absolute deadline for the whole pact (UTC ms). Default `now + 24h`. */
|
|
72
|
+
expiresAt?: number;
|
|
73
|
+
/** Optional initial context passed to the factory. */
|
|
74
|
+
initialContext?: Record<string, unknown>;
|
|
75
|
+
/** RFC 8693 exchange depth so far. Default 0. */
|
|
76
|
+
exchangeDepth?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Factory signature. Called on every turn — the executor rehydrates
|
|
80
|
+
* checkpoint + budget + nextAction, then invokes the factory to produce
|
|
81
|
+
* a `Pact` that will execute this turn.
|
|
82
|
+
*/
|
|
83
|
+
export type PactFactory = (rehydrated: {
|
|
84
|
+
/** Opaque — SessionStore deserializes. First turn sees `null`. */
|
|
85
|
+
checkpoint: unknown;
|
|
86
|
+
budget: BudgetRef;
|
|
87
|
+
nextAction: NextAction;
|
|
88
|
+
initialContext: Record<string, unknown>;
|
|
89
|
+
}) => Pact;
|
|
90
|
+
/**
|
|
91
|
+
* Minimal slice of ctx.jobs the runtime consumes. Cortex's JobClient is
|
|
92
|
+
* structurally compatible. A test-only LocalJobClient implements the same
|
|
93
|
+
* surface for `npm run bridge:test`.
|
|
94
|
+
*/
|
|
95
|
+
export interface JobClient {
|
|
96
|
+
enqueue(jobType: string, payload: unknown): Promise<{
|
|
97
|
+
jobId: string;
|
|
98
|
+
}>;
|
|
99
|
+
handle(jobType: string, handler: (payload: unknown, ctx: JobHandlerCtx) => Promise<void>): void;
|
|
100
|
+
}
|
|
101
|
+
export interface JobHandlerCtx {
|
|
102
|
+
/** Attempt number (0 = first delivery, 1-4 = retries per PRD-071). */
|
|
103
|
+
attempt: number;
|
|
104
|
+
/**
|
|
105
|
+
* Called by runtime when the continuation is effectively DLQ'd (attempt=4
|
|
106
|
+
* failed). Signals Cortex that the job should be moved to the DLQ rather
|
|
107
|
+
* than retried further.
|
|
108
|
+
*/
|
|
109
|
+
signalDeadLetter: (error: string) => Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Thrown when `attach()` is called twice on the same executor with
|
|
113
|
+
* structurally different `JobClient` instances. Re-attaching with the
|
|
114
|
+
* same instance is a no-op (idempotent, S5 §3).
|
|
115
|
+
*/
|
|
116
|
+
export declare class DuplicateAttachError extends Error {
|
|
117
|
+
constructor();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Thrown when `registerPact` is called twice with the same key, or when
|
|
121
|
+
* `start`/dispatch references a pactKey that was never registered.
|
|
122
|
+
*/
|
|
123
|
+
export declare class PactRegistrationError extends Error {
|
|
124
|
+
readonly pactKey: string;
|
|
125
|
+
constructor(pactKey: string, reason: 'duplicate' | 'missing');
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Thrown when the envelope requests a budget strategy that isn't
|
|
129
|
+
* implemented in this wave (S5 §5).
|
|
130
|
+
*
|
|
131
|
+
* Wave 1 supports `'fresh-per-continuation'` only. `'batched-held'` and
|
|
132
|
+
* `'predictive-prereserve'` are gated on Cortex Open Question O1
|
|
133
|
+
* (`ctx.llm.reserve()/settle()` API).
|
|
134
|
+
*/
|
|
135
|
+
export declare class BudgetStrategyNotImplemented extends Error {
|
|
136
|
+
readonly strategy: string;
|
|
137
|
+
constructor(strategy: string, reason?: string);
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=job-backed-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-backed-executor.d.ts","sourceRoot":"","sources":["../../src/ports/job-backed-executor.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,UAAU,EACX,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAEtD;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAE9E;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErD;;;OAGG;IACH,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,wBAAwB,GAAG,cAAc,GAAG,uBAAuB,CAAC;IACrF,2EAA2E;IAC3E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0EAA0E;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE;IACrC,kEAAkE;IAClE,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC,KAAK,IAAI,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,MAAM,CACJ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/D,IAAI,CAAC;CACT;AAED,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C;AAED;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBACb,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS;CAS7D;AAED;;;;;;;GAOG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBACd,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAE,MAA+B;CAKtE"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* JobBackedExecutor — drives a pact across worker boundaries via ctx.jobs.
|
|
4
|
+
*
|
|
5
|
+
* PRD-062 / S5 §2.2. Frozen: 2026-04-14.
|
|
6
|
+
*
|
|
7
|
+
* Owner: @methodts/runtime
|
|
8
|
+
* Producer: @methodts/runtime (impl: CortexJobBackedExecutor)
|
|
9
|
+
* Consumer: tenant app composition root (wires ctx.jobs into the executor)
|
|
10
|
+
*
|
|
11
|
+
* The tenant app never calls `enqueue`/`dispatch` directly — it registers
|
|
12
|
+
* the executor once (`attach(ctx.jobs)`) and the runtime internally emits
|
|
13
|
+
* continuations whenever a pact yields.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Thrown when `attach()` is called twice on the same executor with
|
|
17
|
+
* structurally different `JobClient` instances. Re-attaching with the
|
|
18
|
+
* same instance is a no-op (idempotent, S5 §3).
|
|
19
|
+
*/
|
|
20
|
+
export class DuplicateAttachError extends Error {
|
|
21
|
+
constructor() {
|
|
22
|
+
super('JobBackedExecutor.attach called twice with a different JobClient');
|
|
23
|
+
this.name = 'DuplicateAttachError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Thrown when `registerPact` is called twice with the same key, or when
|
|
28
|
+
* `start`/dispatch references a pactKey that was never registered.
|
|
29
|
+
*/
|
|
30
|
+
export class PactRegistrationError extends Error {
|
|
31
|
+
pactKey;
|
|
32
|
+
constructor(pactKey, reason) {
|
|
33
|
+
super(reason === 'duplicate'
|
|
34
|
+
? `Pact '${pactKey}' already registered`
|
|
35
|
+
: `Pact '${pactKey}' not registered — call runtime.registerPact first`);
|
|
36
|
+
this.name = 'PactRegistrationError';
|
|
37
|
+
this.pactKey = pactKey;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Thrown when the envelope requests a budget strategy that isn't
|
|
42
|
+
* implemented in this wave (S5 §5).
|
|
43
|
+
*
|
|
44
|
+
* Wave 1 supports `'fresh-per-continuation'` only. `'batched-held'` and
|
|
45
|
+
* `'predictive-prereserve'` are gated on Cortex Open Question O1
|
|
46
|
+
* (`ctx.llm.reserve()/settle()` API).
|
|
47
|
+
*/
|
|
48
|
+
export class BudgetStrategyNotImplemented extends Error {
|
|
49
|
+
strategy;
|
|
50
|
+
constructor(strategy, reason = 'blocked on Cortex O1') {
|
|
51
|
+
super(`Budget strategy '${strategy}' not implemented in Wave 1 — ${reason}`);
|
|
52
|
+
this.name = 'BudgetStrategyNotImplemented';
|
|
53
|
+
this.strategy = strategy;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=job-backed-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"job-backed-executor.js","sourceRoot":"","sources":["../../src/ports/job-backed-executor.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;GAYG;AA+GH;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,kEAAkE,CAAC,CAAC;QAC1E,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IACrC,OAAO,CAAS;IACzB,YAAY,OAAe,EAAE,MAA+B;QAC1D,KAAK,CACH,MAAM,KAAK,WAAW;YACpB,CAAC,CAAC,SAAS,OAAO,sBAAsB;YACxC,CAAC,CAAC,SAAS,OAAO,oDAAoD,CACzE,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAC5C,QAAQ,CAAS;IAC1B,YAAY,QAAgB,EAAE,SAAiB,sBAAsB;QACnE,KAAK,CAAC,oBAAoB,QAAQ,iCAAiC,MAAM,EAAE,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;QAC3C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|