@cleocode/core 2026.4.6 → 2026.4.9
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/package.json +7 -7
- package/dist/cant/approval.d.ts +0 -110
- package/dist/cant/approval.d.ts.map +0 -1
- package/dist/cant/context-builder.d.ts +0 -79
- package/dist/cant/context-builder.d.ts.map +0 -1
- package/dist/cant/discretion.d.ts +0 -95
- package/dist/cant/discretion.d.ts.map +0 -1
- package/dist/cant/index.d.ts +0 -25
- package/dist/cant/index.d.ts.map +0 -1
- package/dist/cant/parallel-runner.d.ts +0 -38
- package/dist/cant/parallel-runner.d.ts.map +0 -1
- package/dist/cant/types.d.ts +0 -127
- package/dist/cant/types.d.ts.map +0 -1
- package/dist/cant/workflow-executor.d.ts +0 -105
- package/dist/cant/workflow-executor.d.ts.map +0 -1
- package/src/__tests__/audit-prune.test.d.ts.map +0 -1
- package/src/__tests__/audit-prune.test.js +0 -162
- package/src/__tests__/audit-prune.test.js.map +0 -1
- package/src/__tests__/caamp-skill-install.test.d.ts.map +0 -1
- package/src/__tests__/caamp-skill-install.test.js +0 -147
- package/src/__tests__/caamp-skill-install.test.js.map +0 -1
- package/src/__tests__/cli-parity.test.d.ts.map +0 -1
- package/src/__tests__/cli-parity.test.js +0 -209
- package/src/__tests__/cli-parity.test.js.map +0 -1
- package/src/__tests__/config.test.d.ts.map +0 -1
- package/src/__tests__/config.test.js +0 -144
- package/src/__tests__/config.test.js.map +0 -1
- package/src/__tests__/core-parity.test.d.ts.map +0 -1
- package/src/__tests__/core-parity.test.js +0 -645
- package/src/__tests__/core-parity.test.js.map +0 -1
- package/src/__tests__/error-catalog.test.d.ts.map +0 -1
- package/src/__tests__/error-catalog.test.js +0 -127
- package/src/__tests__/error-catalog.test.js.map +0 -1
- package/src/__tests__/golden-parity.test.d.ts.map +0 -1
- package/src/__tests__/golden-parity.test.js +0 -212
- package/src/__tests__/golden-parity.test.js.map +0 -1
- package/src/__tests__/hooks.test.d.ts.map +0 -1
- package/src/__tests__/hooks.test.js +0 -201
- package/src/__tests__/hooks.test.js.map +0 -1
- package/src/__tests__/human-output.test.d.ts.map +0 -1
- package/src/__tests__/human-output.test.js +0 -158
- package/src/__tests__/human-output.test.js.map +0 -1
- package/src/__tests__/index-api-compat.test.d.ts.map +0 -1
- package/src/__tests__/index-api-compat.test.js +0 -16
- package/src/__tests__/index-api-compat.test.js.map +0 -1
- package/src/__tests__/init-e2e.test.d.ts.map +0 -1
- package/src/__tests__/init-e2e.test.js +0 -221
- package/src/__tests__/init-e2e.test.js.map +0 -1
- package/src/__tests__/injection-chain.test.d.ts.map +0 -1
- package/src/__tests__/injection-chain.test.js +0 -234
- package/src/__tests__/injection-chain.test.js.map +0 -1
- package/src/__tests__/injection-mvi-tiers.test.d.ts.map +0 -1
- package/src/__tests__/injection-mvi-tiers.test.js +0 -116
- package/src/__tests__/injection-mvi-tiers.test.js.map +0 -1
- package/src/__tests__/injection-shared.test.d.ts.map +0 -1
- package/src/__tests__/injection-shared.test.js +0 -194
- package/src/__tests__/injection-shared.test.js.map +0 -1
- package/src/__tests__/lafs-conformance.test.d.ts.map +0 -1
- package/src/__tests__/lafs-conformance.test.js +0 -786
- package/src/__tests__/lafs-conformance.test.js.map +0 -1
- package/src/__tests__/logger.test.d.ts.map +0 -1
- package/src/__tests__/logger.test.js +0 -75
- package/src/__tests__/logger.test.js.map +0 -1
- package/src/__tests__/paths.test.d.ts.map +0 -1
- package/src/__tests__/paths.test.js +0 -327
- package/src/__tests__/paths.test.js.map +0 -1
- package/src/__tests__/project-info.test.d.ts.map +0 -1
- package/src/__tests__/project-info.test.js +0 -156
- package/src/__tests__/project-info.test.js.map +0 -1
- package/src/__tests__/rcsd-pipeline-e2e.test.d.ts.map +0 -1
- package/src/__tests__/rcsd-pipeline-e2e.test.js +0 -263
- package/src/__tests__/rcsd-pipeline-e2e.test.js.map +0 -1
- package/src/__tests__/remote.test.d.ts.map +0 -1
- package/src/__tests__/remote.test.js +0 -149
- package/src/__tests__/remote.test.js.map +0 -1
- package/src/__tests__/scaffold.test.d.ts.map +0 -1
- package/src/__tests__/scaffold.test.js +0 -474
- package/src/__tests__/scaffold.test.js.map +0 -1
- package/src/__tests__/schema-management.test.d.ts.map +0 -1
- package/src/__tests__/schema-management.test.js +0 -287
- package/src/__tests__/schema-management.test.js.map +0 -1
- package/src/__tests__/schema.test.d.ts.map +0 -1
- package/src/__tests__/schema.test.js +0 -51
- package/src/__tests__/schema.test.js.map +0 -1
- package/src/__tests__/sharing.test.d.ts.map +0 -1
- package/src/__tests__/sharing.test.js +0 -160
- package/src/__tests__/sharing.test.js.map +0 -1
- package/src/__tests__/snapshot.test.d.ts.map +0 -1
- package/src/__tests__/snapshot.test.js +0 -72
- package/src/__tests__/snapshot.test.js.map +0 -1
- package/src/__tests__/upgrade.test.d.ts.map +0 -1
- package/src/__tests__/upgrade.test.js +0 -321
- package/src/__tests__/upgrade.test.js.map +0 -1
- package/src/adapters/__tests__/discovery.test.d.ts.map +0 -1
- package/src/adapters/__tests__/discovery.test.js +0 -56
- package/src/adapters/__tests__/discovery.test.js.map +0 -1
- package/src/adapters/__tests__/manager.test.d.ts.map +0 -1
- package/src/adapters/__tests__/manager.test.js +0 -260
- package/src/adapters/__tests__/manager.test.js.map +0 -1
- package/src/agents/__tests__/agent-registry.test.d.ts.map +0 -1
- package/src/agents/__tests__/agent-registry.test.js +0 -262
- package/src/agents/__tests__/agent-registry.test.js.map +0 -1
- package/src/agents/__tests__/capacity.test.d.ts.map +0 -1
- package/src/agents/__tests__/capacity.test.js +0 -173
- package/src/agents/__tests__/capacity.test.js.map +0 -1
- package/src/agents/__tests__/execution-learning.test.d.ts.map +0 -1
- package/src/agents/__tests__/execution-learning.test.js +0 -533
- package/src/agents/__tests__/execution-learning.test.js.map +0 -1
- package/src/agents/__tests__/health-monitor.test.d.ts.map +0 -1
- package/src/agents/__tests__/health-monitor.test.js +0 -259
- package/src/agents/__tests__/health-monitor.test.js.map +0 -1
- package/src/agents/__tests__/registry.test.d.ts.map +0 -1
- package/src/agents/__tests__/registry.test.js +0 -373
- package/src/agents/__tests__/registry.test.js.map +0 -1
- package/src/agents/__tests__/retry.test.d.ts.map +0 -1
- package/src/agents/__tests__/retry.test.js +0 -225
- package/src/agents/__tests__/retry.test.js.map +0 -1
- package/src/cant/__tests__/cant-agent-parse.test.d.ts.map +0 -1
- package/src/cant/__tests__/cant-agent-parse.test.js +0 -77
- package/src/cant/__tests__/cant-agent-parse.test.js.map +0 -1
- package/src/cant/__tests__/cant-agent-parse.test.ts +0 -94
- package/src/cant/approval.ts +0 -218
- package/src/cant/context-builder.ts +0 -135
- package/src/cant/discretion.ts +0 -149
- package/src/cant/index.ts +0 -58
- package/src/cant/parallel-runner.ts +0 -205
- package/src/cant/types.ts +0 -158
- package/src/cant/workflow-executor.ts +0 -618
- package/src/compliance/__tests__/sync.test.d.ts.map +0 -1
- package/src/compliance/__tests__/sync.test.js +0 -119
- package/src/compliance/__tests__/sync.test.js.map +0 -1
- package/src/conduit/__tests__/local-credential-flow.test.d.ts.map +0 -1
- package/src/conduit/__tests__/local-credential-flow.test.js +0 -185
- package/src/conduit/__tests__/local-credential-flow.test.js.map +0 -1
- package/src/conduit/__tests__/local-transport.test.d.ts.map +0 -1
- package/src/conduit/__tests__/local-transport.test.js +0 -404
- package/src/conduit/__tests__/local-transport.test.js.map +0 -1
- package/src/conduit/__tests__/sse-transport.test.d.ts.map +0 -1
- package/src/conduit/__tests__/sse-transport.test.js +0 -291
- package/src/conduit/__tests__/sse-transport.test.js.map +0 -1
- package/src/hooks/__tests__/provider-hooks.test.d.ts.map +0 -1
- package/src/hooks/__tests__/provider-hooks.test.js +0 -33
- package/src/hooks/__tests__/provider-hooks.test.js.map +0 -1
- package/src/hooks/__tests__/registry.test.d.ts.map +0 -1
- package/src/hooks/__tests__/registry.test.js +0 -37
- package/src/hooks/__tests__/registry.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/error-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/error-hooks.test.js +0 -90
- package/src/hooks/handlers/__tests__/error-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/file-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/file-hooks.test.js +0 -128
- package/src/hooks/handlers/__tests__/file-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js +0 -503
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/session-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/session-hooks.test.js +0 -54
- package/src/hooks/handlers/__tests__/session-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/task-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/task-hooks.test.js +0 -77
- package/src/hooks/handlers/__tests__/task-hooks.test.js.map +0 -1
- package/src/intelligence/__tests__/adaptive-validation.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/adaptive-validation.test.js +0 -517
- package/src/intelligence/__tests__/adaptive-validation.test.js.map +0 -1
- package/src/intelligence/__tests__/impact.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/impact.test.js +0 -515
- package/src/intelligence/__tests__/impact.test.js.map +0 -1
- package/src/intelligence/__tests__/patterns.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/patterns.test.js +0 -370
- package/src/intelligence/__tests__/patterns.test.js.map +0 -1
- package/src/intelligence/__tests__/prediction.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/prediction.test.js +0 -314
- package/src/intelligence/__tests__/prediction.test.js.map +0 -1
- package/src/lib/__tests__/retry.test.d.ts.map +0 -1
- package/src/lib/__tests__/retry.test.js +0 -225
- package/src/lib/__tests__/retry.test.js.map +0 -1
- package/src/lifecycle/__tests__/chain-store.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/chain-store.test.js +0 -243
- package/src/lifecycle/__tests__/chain-store.test.js.map +0 -1
- package/src/lifecycle/__tests__/consolidate-rcasd.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/consolidate-rcasd.test.js +0 -210
- package/src/lifecycle/__tests__/consolidate-rcasd.test.js.map +0 -1
- package/src/lifecycle/__tests__/default-chain.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/default-chain.test.js +0 -74
- package/src/lifecycle/__tests__/default-chain.test.js.map +0 -1
- package/src/lifecycle/__tests__/frontmatter.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/frontmatter.test.js +0 -229
- package/src/lifecycle/__tests__/frontmatter.test.js.map +0 -1
- package/src/lifecycle/__tests__/lifecycle.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/lifecycle.test.js +0 -126
- package/src/lifecycle/__tests__/lifecycle.test.js.map +0 -1
- package/src/lifecycle/__tests__/pipeline.integration.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/pipeline.integration.test.js +0 -977
- package/src/lifecycle/__tests__/pipeline.integration.test.js.map +0 -1
- package/src/lifecycle/__tests__/rcasd-paths.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/rcasd-paths.test.js +0 -206
- package/src/lifecycle/__tests__/rcasd-paths.test.js.map +0 -1
- package/src/lifecycle/__tests__/resume-schema-contract.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/resume-schema-contract.test.js +0 -246
- package/src/lifecycle/__tests__/resume-schema-contract.test.js.map +0 -1
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.js +0 -95
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.js.map +0 -1
- package/src/lifecycle/__tests__/tessera-engine.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/tessera-engine.test.js +0 -392
- package/src/lifecycle/__tests__/tessera-engine.test.js.map +0 -1
- package/src/memory/__tests__/auto-extract.test.d.ts.map +0 -1
- package/src/memory/__tests__/auto-extract.test.js +0 -197
- package/src/memory/__tests__/auto-extract.test.js.map +0 -1
- package/src/memory/__tests__/brain-automation.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-automation.test.js +0 -730
- package/src/memory/__tests__/brain-automation.test.js.map +0 -1
- package/src/memory/__tests__/brain-embedding.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-embedding.test.js +0 -92
- package/src/memory/__tests__/brain-embedding.test.js.map +0 -1
- package/src/memory/__tests__/brain-links.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-links.test.js +0 -221
- package/src/memory/__tests__/brain-links.test.js.map +0 -1
- package/src/memory/__tests__/brain-migration.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-migration.test.js +0 -180
- package/src/memory/__tests__/brain-migration.test.js.map +0 -1
- package/src/memory/__tests__/brain-retrieval.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-retrieval.test.js +0 -701
- package/src/memory/__tests__/brain-retrieval.test.js.map +0 -1
- package/src/memory/__tests__/brain-search.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-search.test.js +0 -180
- package/src/memory/__tests__/brain-search.test.js.map +0 -1
- package/src/memory/__tests__/claude-mem-migration.test.d.ts.map +0 -1
- package/src/memory/__tests__/claude-mem-migration.test.js +0 -424
- package/src/memory/__tests__/claude-mem-migration.test.js.map +0 -1
- package/src/memory/__tests__/decisions.test.d.ts.map +0 -1
- package/src/memory/__tests__/decisions.test.js +0 -253
- package/src/memory/__tests__/decisions.test.js.map +0 -1
- package/src/memory/__tests__/engine-compat.test.d.ts.map +0 -1
- package/src/memory/__tests__/engine-compat.test.js +0 -331
- package/src/memory/__tests__/engine-compat.test.js.map +0 -1
- package/src/memory/__tests__/memory-bridge.test.d.ts.map +0 -1
- package/src/memory/__tests__/memory-bridge.test.js +0 -231
- package/src/memory/__tests__/memory-bridge.test.js.map +0 -1
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.d.ts.map +0 -1
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.js +0 -516
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.js.map +0 -1
- package/src/memory/__tests__/session-memory.test.d.ts.map +0 -1
- package/src/memory/__tests__/session-memory.test.js +0 -387
- package/src/memory/__tests__/session-memory.test.js.map +0 -1
- package/src/metrics/__tests__/model-provider-registry.test.d.ts.map +0 -1
- package/src/metrics/__tests__/model-provider-registry.test.js +0 -45
- package/src/metrics/__tests__/model-provider-registry.test.js.map +0 -1
- package/src/metrics/__tests__/provider-detection.test.d.ts.map +0 -1
- package/src/metrics/__tests__/provider-detection.test.js +0 -123
- package/src/metrics/__tests__/provider-detection.test.js.map +0 -1
- package/src/migration/__tests__/checksum.test.d.ts.map +0 -1
- package/src/migration/__tests__/checksum.test.js +0 -216
- package/src/migration/__tests__/checksum.test.js.map +0 -1
- package/src/migration/__tests__/logger.test.d.ts.map +0 -1
- package/src/migration/__tests__/logger.test.js +0 -256
- package/src/migration/__tests__/logger.test.js.map +0 -1
- package/src/migration/__tests__/migration-failure.integration.test.d.ts.map +0 -1
- package/src/migration/__tests__/migration-failure.integration.test.js +0 -515
- package/src/migration/__tests__/migration-failure.integration.test.js.map +0 -1
- package/src/migration/__tests__/migration.test.d.ts.map +0 -1
- package/src/migration/__tests__/migration.test.js +0 -82
- package/src/migration/__tests__/migration.test.js.map +0 -1
- package/src/migration/__tests__/state.test.d.ts.map +0 -1
- package/src/migration/__tests__/state.test.js +0 -330
- package/src/migration/__tests__/state.test.js.map +0 -1
- package/src/migration/__tests__/validate.test.d.ts.map +0 -1
- package/src/migration/__tests__/validate.test.js +0 -258
- package/src/migration/__tests__/validate.test.js.map +0 -1
- package/src/nexus/__tests__/deps.test.d.ts.map +0 -1
- package/src/nexus/__tests__/deps.test.js +0 -283
- package/src/nexus/__tests__/deps.test.js.map +0 -1
- package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +0 -1
- package/src/nexus/__tests__/nexus-e2e.test.js +0 -1220
- package/src/nexus/__tests__/nexus-e2e.test.js.map +0 -1
- package/src/nexus/__tests__/permissions.test.d.ts.map +0 -1
- package/src/nexus/__tests__/permissions.test.js +0 -119
- package/src/nexus/__tests__/permissions.test.js.map +0 -1
- package/src/nexus/__tests__/query.test.d.ts.map +0 -1
- package/src/nexus/__tests__/query.test.js +0 -168
- package/src/nexus/__tests__/query.test.js.map +0 -1
- package/src/nexus/__tests__/reconcile.test.d.ts.map +0 -1
- package/src/nexus/__tests__/reconcile.test.js +0 -135
- package/src/nexus/__tests__/reconcile.test.js.map +0 -1
- package/src/nexus/__tests__/registry.test.d.ts.map +0 -1
- package/src/nexus/__tests__/registry.test.js +0 -229
- package/src/nexus/__tests__/registry.test.js.map +0 -1
- package/src/nexus/__tests__/transfer.test.d.ts.map +0 -1
- package/src/nexus/__tests__/transfer.test.js +0 -372
- package/src/nexus/__tests__/transfer.test.js.map +0 -1
- package/src/observability/__tests__/index.test.d.ts.map +0 -1
- package/src/observability/__tests__/index.test.js +0 -288
- package/src/observability/__tests__/index.test.js.map +0 -1
- package/src/observability/__tests__/log-filter.test.d.ts.map +0 -1
- package/src/observability/__tests__/log-filter.test.js +0 -151
- package/src/observability/__tests__/log-filter.test.js.map +0 -1
- package/src/observability/__tests__/log-parser.test.d.ts.map +0 -1
- package/src/observability/__tests__/log-parser.test.js +0 -170
- package/src/observability/__tests__/log-parser.test.js.map +0 -1
- package/src/observability/__tests__/log-reader.test.d.ts.map +0 -1
- package/src/observability/__tests__/log-reader.test.js +0 -150
- package/src/observability/__tests__/log-reader.test.js.map +0 -1
- package/src/orchestration/__tests__/autonomous-spec.test.d.ts.map +0 -1
- package/src/orchestration/__tests__/autonomous-spec.test.js +0 -419
- package/src/orchestration/__tests__/autonomous-spec.test.js.map +0 -1
- package/src/orchestration/__tests__/orchestration.test.d.ts.map +0 -1
- package/src/orchestration/__tests__/orchestration.test.js +0 -205
- package/src/orchestration/__tests__/orchestration.test.js.map +0 -1
- package/src/orchestration/__tests__/protocol-validators.test.d.ts.map +0 -1
- package/src/orchestration/__tests__/protocol-validators.test.js +0 -602
- package/src/orchestration/__tests__/protocol-validators.test.js.map +0 -1
- package/src/phases/__tests__/deps.test.d.ts.map +0 -1
- package/src/phases/__tests__/deps.test.js +0 -210
- package/src/phases/__tests__/deps.test.js.map +0 -1
- package/src/phases/__tests__/phases.test.d.ts.map +0 -1
- package/src/phases/__tests__/phases.test.js +0 -215
- package/src/phases/__tests__/phases.test.js.map +0 -1
- package/src/release/__tests__/artifacts.test.d.ts.map +0 -1
- package/src/release/__tests__/artifacts.test.js +0 -65
- package/src/release/__tests__/artifacts.test.js.map +0 -1
- package/src/release/__tests__/cancel-release.test.d.ts.map +0 -1
- package/src/release/__tests__/cancel-release.test.js +0 -154
- package/src/release/__tests__/cancel-release.test.js.map +0 -1
- package/src/release/__tests__/changelog-writer.test.d.ts.map +0 -1
- package/src/release/__tests__/changelog-writer.test.js +0 -132
- package/src/release/__tests__/changelog-writer.test.js.map +0 -1
- package/src/release/__tests__/push-policy.test.d.ts.map +0 -1
- package/src/release/__tests__/push-policy.test.js +0 -142
- package/src/release/__tests__/push-policy.test.js.map +0 -1
- package/src/release/__tests__/release.test.d.ts.map +0 -1
- package/src/release/__tests__/release.test.js +0 -25
- package/src/release/__tests__/release.test.js.map +0 -1
- package/src/sequence/__tests__/allocate.test.d.ts.map +0 -1
- package/src/sequence/__tests__/allocate.test.js +0 -113
- package/src/sequence/__tests__/allocate.test.js.map +0 -1
- package/src/sessions/__tests__/briefing-blocked.test.d.ts.map +0 -1
- package/src/sessions/__tests__/briefing-blocked.test.js +0 -117
- package/src/sessions/__tests__/briefing-blocked.test.js.map +0 -1
- package/src/sessions/__tests__/briefing.test.d.ts.map +0 -1
- package/src/sessions/__tests__/briefing.test.js +0 -336
- package/src/sessions/__tests__/briefing.test.js.map +0 -1
- package/src/sessions/__tests__/handoff-integration.test.d.ts.map +0 -1
- package/src/sessions/__tests__/handoff-integration.test.js +0 -264
- package/src/sessions/__tests__/handoff-integration.test.js.map +0 -1
- package/src/sessions/__tests__/handoff.test.d.ts.map +0 -1
- package/src/sessions/__tests__/handoff.test.js +0 -435
- package/src/sessions/__tests__/handoff.test.js.map +0 -1
- package/src/sessions/__tests__/index.test.d.ts.map +0 -1
- package/src/sessions/__tests__/index.test.js +0 -82
- package/src/sessions/__tests__/index.test.js.map +0 -1
- package/src/sessions/__tests__/session-cleanup.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-cleanup.test.js +0 -201
- package/src/sessions/__tests__/session-cleanup.test.js.map +0 -1
- package/src/sessions/__tests__/session-edge-cases.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-edge-cases.test.js +0 -251
- package/src/sessions/__tests__/session-edge-cases.test.js.map +0 -1
- package/src/sessions/__tests__/session-find.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-find.test.js +0 -210
- package/src/sessions/__tests__/session-find.test.js.map +0 -1
- package/src/sessions/__tests__/session-grade.integration.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-grade.integration.test.js +0 -287
- package/src/sessions/__tests__/session-grade.integration.test.js.map +0 -1
- package/src/sessions/__tests__/session-grade.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-grade.test.js +0 -630
- package/src/sessions/__tests__/session-grade.test.js.map +0 -1
- package/src/sessions/__tests__/session-memory-bridge.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-memory-bridge.test.js +0 -52
- package/src/sessions/__tests__/session-memory-bridge.test.js.map +0 -1
- package/src/sessions/__tests__/sessions.test.d.ts.map +0 -1
- package/src/sessions/__tests__/sessions.test.js +0 -113
- package/src/sessions/__tests__/sessions.test.js.map +0 -1
- package/src/skills/__tests__/discovery.test.d.ts.map +0 -1
- package/src/skills/__tests__/discovery.test.js +0 -171
- package/src/skills/__tests__/discovery.test.js.map +0 -1
- package/src/skills/__tests__/dispatch.test.d.ts.map +0 -1
- package/src/skills/__tests__/dispatch.test.js +0 -99
- package/src/skills/__tests__/dispatch.test.js.map +0 -1
- package/src/skills/__tests__/dynamic-skill-generator.test.d.ts.map +0 -1
- package/src/skills/__tests__/dynamic-skill-generator.test.js +0 -77
- package/src/skills/__tests__/dynamic-skill-generator.test.js.map +0 -1
- package/src/skills/__tests__/manifests.test.d.ts.map +0 -1
- package/src/skills/__tests__/manifests.test.js +0 -121
- package/src/skills/__tests__/manifests.test.js.map +0 -1
- package/src/skills/__tests__/precedence.test.d.ts.map +0 -1
- package/src/skills/__tests__/precedence.test.js +0 -325
- package/src/skills/__tests__/precedence.test.js.map +0 -1
- package/src/skills/__tests__/routing-table.test.d.ts.map +0 -1
- package/src/skills/__tests__/routing-table.test.js +0 -91
- package/src/skills/__tests__/routing-table.test.js.map +0 -1
- package/src/skills/__tests__/skill-paths.test.d.ts.map +0 -1
- package/src/skills/__tests__/skill-paths.test.js +0 -71
- package/src/skills/__tests__/skill-paths.test.js.map +0 -1
- package/src/skills/__tests__/test-utility.test.d.ts.map +0 -1
- package/src/skills/__tests__/test-utility.test.js +0 -59
- package/src/skills/__tests__/test-utility.test.js.map +0 -1
- package/src/skills/__tests__/token.test.d.ts.map +0 -1
- package/src/skills/__tests__/token.test.js +0 -135
- package/src/skills/__tests__/token.test.js.map +0 -1
- package/src/skills/__tests__/validation.test.d.ts.map +0 -1
- package/src/skills/__tests__/validation.test.js +0 -108
- package/src/skills/__tests__/validation.test.js.map +0 -1
- package/src/skills/__tests__/version.test.d.ts.map +0 -1
- package/src/skills/__tests__/version.test.js +0 -71
- package/src/skills/__tests__/version.test.js.map +0 -1
- package/src/skills/injection/__tests__/subagent.test.d.ts.map +0 -1
- package/src/skills/injection/__tests__/subagent.test.js +0 -122
- package/src/skills/injection/__tests__/subagent.test.js.map +0 -1
- package/src/skills/orchestrator/__tests__/spawn-tier.test.d.ts.map +0 -1
- package/src/skills/orchestrator/__tests__/spawn-tier.test.js +0 -228
- package/src/skills/orchestrator/__tests__/spawn-tier.test.js.map +0 -1
- package/src/spawn/__tests__/adapter-registry.test.d.ts.map +0 -1
- package/src/spawn/__tests__/adapter-registry.test.js +0 -76
- package/src/spawn/__tests__/adapter-registry.test.js.map +0 -1
- package/src/stats/__tests__/stats.test.d.ts.map +0 -1
- package/src/stats/__tests__/stats.test.js +0 -374
- package/src/stats/__tests__/stats.test.js.map +0 -1
- package/src/sticky/__tests__/purge.test.d.ts.map +0 -1
- package/src/sticky/__tests__/purge.test.js +0 -64
- package/src/sticky/__tests__/purge.test.js.map +0 -1
- package/src/store/__tests__/atomic.test.d.ts.map +0 -1
- package/src/store/__tests__/atomic.test.js +0 -81
- package/src/store/__tests__/atomic.test.js.map +0 -1
- package/src/store/__tests__/backup.test.d.ts.map +0 -1
- package/src/store/__tests__/backup.test.js +0 -131
- package/src/store/__tests__/backup.test.js.map +0 -1
- package/src/store/__tests__/brain-accessor-pageindex.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-accessor-pageindex.test.js +0 -179
- package/src/store/__tests__/brain-accessor-pageindex.test.js.map +0 -1
- package/src/store/__tests__/brain-accessor.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-accessor.test.js +0 -398
- package/src/store/__tests__/brain-accessor.test.js.map +0 -1
- package/src/store/__tests__/brain-pageindex.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-pageindex.test.js +0 -137
- package/src/store/__tests__/brain-pageindex.test.js.map +0 -1
- package/src/store/__tests__/brain-schema.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-schema.test.js +0 -137
- package/src/store/__tests__/brain-schema.test.js.map +0 -1
- package/src/store/__tests__/brain-vec.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-vec.test.js +0 -100
- package/src/store/__tests__/brain-vec.test.js.map +0 -1
- package/src/store/__tests__/collision-detection.test.d.ts.map +0 -1
- package/src/store/__tests__/collision-detection.test.js +0 -165
- package/src/store/__tests__/collision-detection.test.js.map +0 -1
- package/src/store/__tests__/data-safety-central.test.d.ts.map +0 -1
- package/src/store/__tests__/data-safety-central.test.js +0 -408
- package/src/store/__tests__/data-safety-central.test.js.map +0 -1
- package/src/store/__tests__/db-helpers.test.d.ts.map +0 -1
- package/src/store/__tests__/db-helpers.test.js +0 -101
- package/src/store/__tests__/db-helpers.test.js.map +0 -1
- package/src/store/__tests__/e2e-safety-integration.test.d.ts.map +0 -1
- package/src/store/__tests__/e2e-safety-integration.test.js +0 -402
- package/src/store/__tests__/e2e-safety-integration.test.js.map +0 -1
- package/src/store/__tests__/git-checkpoint.test.d.ts.map +0 -1
- package/src/store/__tests__/git-checkpoint.test.js +0 -133
- package/src/store/__tests__/git-checkpoint.test.js.map +0 -1
- package/src/store/__tests__/idempotent-migration.test.d.ts.map +0 -1
- package/src/store/__tests__/idempotent-migration.test.js +0 -172
- package/src/store/__tests__/idempotent-migration.test.js.map +0 -1
- package/src/store/__tests__/import-logging.test.d.ts.map +0 -1
- package/src/store/__tests__/import-logging.test.js +0 -92
- package/src/store/__tests__/import-logging.test.js.map +0 -1
- package/src/store/__tests__/import-sort.test.d.ts.map +0 -1
- package/src/store/__tests__/import-sort.test.js +0 -109
- package/src/store/__tests__/import-sort.test.js.map +0 -1
- package/src/store/__tests__/json.test.d.ts.map +0 -1
- package/src/store/__tests__/json.test.js +0 -98
- package/src/store/__tests__/json.test.js.map +0 -1
- package/src/store/__tests__/lifecycle-schema-parity.test.d.ts.map +0 -1
- package/src/store/__tests__/lifecycle-schema-parity.test.js +0 -90
- package/src/store/__tests__/lifecycle-schema-parity.test.js.map +0 -1
- package/src/store/__tests__/migration-integration.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-integration.test.js +0 -238
- package/src/store/__tests__/migration-integration.test.js.map +0 -1
- package/src/store/__tests__/migration-retry.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-retry.test.js +0 -178
- package/src/store/__tests__/migration-retry.test.js.map +0 -1
- package/src/store/__tests__/migration-safety.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-safety.test.js +0 -756
- package/src/store/__tests__/migration-safety.test.js.map +0 -1
- package/src/store/__tests__/migration-sqlite.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-sqlite.test.js +0 -544
- package/src/store/__tests__/migration-sqlite.test.js.map +0 -1
- package/src/store/__tests__/performance-safety.test.d.ts.map +0 -1
- package/src/store/__tests__/performance-safety.test.js +0 -157
- package/src/store/__tests__/performance-safety.test.js.map +0 -1
- package/src/store/__tests__/project-detect.test.d.ts.map +0 -1
- package/src/store/__tests__/project-detect.test.js +0 -609
- package/src/store/__tests__/project-detect.test.js.map +0 -1
- package/src/store/__tests__/project-registry.test.d.ts.map +0 -1
- package/src/store/__tests__/project-registry.test.js +0 -28
- package/src/store/__tests__/project-registry.test.js.map +0 -1
- package/src/store/__tests__/provider.test.d.ts.map +0 -1
- package/src/store/__tests__/provider.test.js +0 -15
- package/src/store/__tests__/provider.test.js.map +0 -1
- package/src/store/__tests__/relations.test.d.ts.map +0 -1
- package/src/store/__tests__/relations.test.js +0 -318
- package/src/store/__tests__/relations.test.js.map +0 -1
- package/src/store/__tests__/safety-accessor.test.d.ts.map +0 -1
- package/src/store/__tests__/safety-accessor.test.js +0 -219
- package/src/store/__tests__/safety-accessor.test.js.map +0 -1
- package/src/store/__tests__/sequence-validation.test.d.ts.map +0 -1
- package/src/store/__tests__/sequence-validation.test.js +0 -94
- package/src/store/__tests__/sequence-validation.test.js.map +0 -1
- package/src/store/__tests__/session-store.test.d.ts.map +0 -1
- package/src/store/__tests__/session-store.test.js +0 -463
- package/src/store/__tests__/session-store.test.js.map +0 -1
- package/src/store/__tests__/sqlite-backup.test.d.ts.map +0 -1
- package/src/store/__tests__/sqlite-backup.test.js +0 -72
- package/src/store/__tests__/sqlite-backup.test.js.map +0 -1
- package/src/store/__tests__/sqlite.test.d.ts.map +0 -1
- package/src/store/__tests__/sqlite.test.js +0 -256
- package/src/store/__tests__/sqlite.test.js.map +0 -1
- package/src/store/__tests__/task-store.test.d.ts.map +0 -1
- package/src/store/__tests__/task-store.test.js +0 -514
- package/src/store/__tests__/task-store.test.js.map +0 -1
- package/src/store/__tests__/test-db-helper.d.ts.map +0 -1
- package/src/store/__tests__/test-db-helper.js +0 -110
- package/src/store/__tests__/test-db-helper.js.map +0 -1
- package/src/store/__tests__/write-verification.test.d.ts.map +0 -1
- package/src/store/__tests__/write-verification.test.js +0 -185
- package/src/store/__tests__/write-verification.test.js.map +0 -1
- package/src/system/__tests__/cleanup.test.d.ts.map +0 -1
- package/src/system/__tests__/cleanup.test.js +0 -87
- package/src/system/__tests__/cleanup.test.js.map +0 -1
- package/src/system/__tests__/health.test.d.ts.map +0 -1
- package/src/system/__tests__/health.test.js +0 -55
- package/src/system/__tests__/health.test.js.map +0 -1
- package/src/task-work/__tests__/start-deps.test.d.ts.map +0 -1
- package/src/task-work/__tests__/start-deps.test.js +0 -152
- package/src/task-work/__tests__/start-deps.test.js.map +0 -1
- package/src/tasks/__tests__/add.test.d.ts.map +0 -1
- package/src/tasks/__tests__/add.test.js +0 -226
- package/src/tasks/__tests__/add.test.js.map +0 -1
- package/src/tasks/__tests__/archive.test.d.ts.map +0 -1
- package/src/tasks/__tests__/archive.test.js +0 -196
- package/src/tasks/__tests__/archive.test.js.map +0 -1
- package/src/tasks/__tests__/assignee.test.d.ts.map +0 -1
- package/src/tasks/__tests__/assignee.test.js +0 -125
- package/src/tasks/__tests__/assignee.test.js.map +0 -1
- package/src/tasks/__tests__/atomicity.test.d.ts.map +0 -1
- package/src/tasks/__tests__/atomicity.test.js +0 -192
- package/src/tasks/__tests__/atomicity.test.js.map +0 -1
- package/src/tasks/__tests__/cancel-ops.test.d.ts.map +0 -1
- package/src/tasks/__tests__/cancel-ops.test.js +0 -115
- package/src/tasks/__tests__/cancel-ops.test.js.map +0 -1
- package/src/tasks/__tests__/complete-unblocks.test.d.ts.map +0 -1
- package/src/tasks/__tests__/complete-unblocks.test.js +0 -151
- package/src/tasks/__tests__/complete-unblocks.test.js.map +0 -1
- package/src/tasks/__tests__/complete.test.d.ts.map +0 -1
- package/src/tasks/__tests__/complete.test.js +0 -230
- package/src/tasks/__tests__/complete.test.js.map +0 -1
- package/src/tasks/__tests__/delete.test.d.ts.map +0 -1
- package/src/tasks/__tests__/delete.test.js +0 -183
- package/src/tasks/__tests__/delete.test.js.map +0 -1
- package/src/tasks/__tests__/dependency-check.test.d.ts.map +0 -1
- package/src/tasks/__tests__/dependency-check.test.js +0 -293
- package/src/tasks/__tests__/dependency-check.test.js.map +0 -1
- package/src/tasks/__tests__/deps-ready.test.d.ts.map +0 -1
- package/src/tasks/__tests__/deps-ready.test.js +0 -68
- package/src/tasks/__tests__/deps-ready.test.js.map +0 -1
- package/src/tasks/__tests__/epic-enforcement.test.d.ts.map +0 -1
- package/src/tasks/__tests__/epic-enforcement.test.js +0 -669
- package/src/tasks/__tests__/epic-enforcement.test.js.map +0 -1
- package/src/tasks/__tests__/find.test.d.ts.map +0 -1
- package/src/tasks/__tests__/find.test.js +0 -163
- package/src/tasks/__tests__/find.test.js.map +0 -1
- package/src/tasks/__tests__/graph-ops.test.d.ts.map +0 -1
- package/src/tasks/__tests__/graph-ops.test.js +0 -174
- package/src/tasks/__tests__/graph-ops.test.js.map +0 -1
- package/src/tasks/__tests__/hierarchy-policy.test.d.ts.map +0 -1
- package/src/tasks/__tests__/hierarchy-policy.test.js +0 -399
- package/src/tasks/__tests__/hierarchy-policy.test.js.map +0 -1
- package/src/tasks/__tests__/hierarchy.test.d.ts.map +0 -1
- package/src/tasks/__tests__/hierarchy.test.js +0 -302
- package/src/tasks/__tests__/hierarchy.test.js.map +0 -1
- package/src/tasks/__tests__/id-generator.test.d.ts.map +0 -1
- package/src/tasks/__tests__/id-generator.test.js +0 -59
- package/src/tasks/__tests__/id-generator.test.js.map +0 -1
- package/src/tasks/__tests__/labels.test.d.ts.map +0 -1
- package/src/tasks/__tests__/labels.test.js +0 -173
- package/src/tasks/__tests__/labels.test.js.map +0 -1
- package/src/tasks/__tests__/list.test.d.ts.map +0 -1
- package/src/tasks/__tests__/list.test.js +0 -272
- package/src/tasks/__tests__/list.test.js.map +0 -1
- package/src/tasks/__tests__/minimal-test.test.d.ts.map +0 -1
- package/src/tasks/__tests__/minimal-test.test.js +0 -25
- package/src/tasks/__tests__/minimal-test.test.js.map +0 -1
- package/src/tasks/__tests__/phase-tracking.test.d.ts.map +0 -1
- package/src/tasks/__tests__/phase-tracking.test.js +0 -209
- package/src/tasks/__tests__/phase-tracking.test.js.map +0 -1
- package/src/tasks/__tests__/pipeline-stage.test.d.ts.map +0 -1
- package/src/tasks/__tests__/pipeline-stage.test.js +0 -277
- package/src/tasks/__tests__/pipeline-stage.test.js.map +0 -1
- package/src/tasks/__tests__/plan-priority.test.d.ts.map +0 -1
- package/src/tasks/__tests__/plan-priority.test.js +0 -133
- package/src/tasks/__tests__/plan-priority.test.js.map +0 -1
- package/src/tasks/__tests__/priority-normalization.test.d.ts.map +0 -1
- package/src/tasks/__tests__/priority-normalization.test.js +0 -117
- package/src/tasks/__tests__/priority-normalization.test.js.map +0 -1
- package/src/tasks/__tests__/relates.test.d.ts.map +0 -1
- package/src/tasks/__tests__/relates.test.js +0 -84
- package/src/tasks/__tests__/relates.test.js.map +0 -1
- package/src/tasks/__tests__/show-deps.test.d.ts.map +0 -1
- package/src/tasks/__tests__/show-deps.test.js +0 -182
- package/src/tasks/__tests__/show-deps.test.js.map +0 -1
- package/src/tasks/__tests__/show.test.d.ts.map +0 -1
- package/src/tasks/__tests__/show.test.js +0 -126
- package/src/tasks/__tests__/show.test.js.map +0 -1
- package/src/tasks/__tests__/staleness.test.d.ts.map +0 -1
- package/src/tasks/__tests__/staleness.test.js +0 -154
- package/src/tasks/__tests__/staleness.test.js.map +0 -1
- package/src/tasks/__tests__/task-ops-depends.test.d.ts.map +0 -1
- package/src/tasks/__tests__/task-ops-depends.test.js +0 -118
- package/src/tasks/__tests__/task-ops-depends.test.js.map +0 -1
- package/src/tasks/__tests__/update.test.d.ts.map +0 -1
- package/src/tasks/__tests__/update.test.js +0 -320
- package/src/tasks/__tests__/update.test.js.map +0 -1
- package/src/validation/__tests__/chain-validation.test.d.ts.map +0 -1
- package/src/validation/__tests__/chain-validation.test.js +0 -204
- package/src/validation/__tests__/chain-validation.test.js.map +0 -1
- package/src/validation/__tests__/compliance.test.d.ts.map +0 -1
- package/src/validation/__tests__/compliance.test.js +0 -83
- package/src/validation/__tests__/compliance.test.js.map +0 -1
- package/src/validation/__tests__/docs-sync.test.d.ts.map +0 -1
- package/src/validation/__tests__/docs-sync.test.js +0 -243
- package/src/validation/__tests__/docs-sync.test.js.map +0 -1
- package/src/validation/__tests__/doctor-gitignore.test.d.ts.map +0 -1
- package/src/validation/__tests__/doctor-gitignore.test.js +0 -154
- package/src/validation/__tests__/doctor-gitignore.test.js.map +0 -1
- package/src/validation/__tests__/doctor-injection.test.d.ts.map +0 -1
- package/src/validation/__tests__/doctor-injection.test.js +0 -230
- package/src/validation/__tests__/doctor-injection.test.js.map +0 -1
- package/src/validation/__tests__/doctor.test.d.ts.map +0 -1
- package/src/validation/__tests__/doctor.test.js +0 -202
- package/src/validation/__tests__/doctor.test.js.map +0 -1
- package/src/validation/__tests__/engine.test.d.ts.map +0 -1
- package/src/validation/__tests__/engine.test.js +0 -346
- package/src/validation/__tests__/engine.test.js.map +0 -1
- package/src/validation/__tests__/manifest.test.d.ts.map +0 -1
- package/src/validation/__tests__/manifest.test.js +0 -244
- package/src/validation/__tests__/manifest.test.js.map +0 -1
- package/src/validation/__tests__/protocol-common.test.d.ts.map +0 -1
- package/src/validation/__tests__/protocol-common.test.js +0 -112
- package/src/validation/__tests__/protocol-common.test.js.map +0 -1
- package/src/validation/__tests__/verification.test.d.ts.map +0 -1
- package/src/validation/__tests__/verification.test.js +0 -277
- package/src/validation/__tests__/verification.test.js.map +0 -1
package/src/cant/discretion.ts
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Discretion evaluation for CANT workflow conditionals.
|
|
3
|
-
*
|
|
4
|
-
* Discretion conditions (`**prose text**`) are AI-evaluated logic gates
|
|
5
|
-
* in CANT workflows. The evaluation is pluggable: the default evaluator
|
|
6
|
-
* stubs `true` (real LLM integration is a separate task), while custom
|
|
7
|
-
* evaluators can be injected for testing, rule-based shortcuts, or
|
|
8
|
-
* alternative model backends.
|
|
9
|
-
*
|
|
10
|
-
* @see docs/specs/CANT-DSL-SPEC.md Section 7.3 (Discretion Evaluation)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import type { DiscretionContext } from './types.js';
|
|
14
|
-
|
|
15
|
-
// ---------------------------------------------------------------------------
|
|
16
|
-
// Evaluator Interface
|
|
17
|
-
// ---------------------------------------------------------------------------
|
|
18
|
-
|
|
19
|
-
/** Evaluates a discretion condition and returns a boolean judgment. */
|
|
20
|
-
export interface DiscretionEvaluator {
|
|
21
|
-
/**
|
|
22
|
-
* Evaluate whether a discretion condition is met.
|
|
23
|
-
*
|
|
24
|
-
* @param condition - The prose text between `**` delimiters.
|
|
25
|
-
* @param context - Execution context including session, variables, and prior results.
|
|
26
|
-
* @returns `true` if the condition is judged to be met.
|
|
27
|
-
*/
|
|
28
|
-
evaluate(condition: string, context: DiscretionContext): Promise<boolean>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
// Default Evaluator (Stub)
|
|
33
|
-
// ---------------------------------------------------------------------------
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Default discretion evaluator that always returns `true`.
|
|
37
|
-
*
|
|
38
|
-
* This is a stub implementation. The real LLM-backed evaluator will be
|
|
39
|
-
* implemented as a separate task. In production, this should be replaced
|
|
40
|
-
* with an evaluator that:
|
|
41
|
-
* - Calls the LLM API with the condition in a structured field
|
|
42
|
-
* - Uses structured prompting (tool use / JSON mode)
|
|
43
|
-
* - Returns a boolean judgment
|
|
44
|
-
*/
|
|
45
|
-
export class DefaultDiscretionEvaluator implements DiscretionEvaluator {
|
|
46
|
-
/** Always returns `true` (stub). */
|
|
47
|
-
async evaluate(_condition: string, _context: DiscretionContext): Promise<boolean> {
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ---------------------------------------------------------------------------
|
|
53
|
-
// Mock Evaluator (Testing)
|
|
54
|
-
// ---------------------------------------------------------------------------
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Mock discretion evaluator with configurable responses for testing.
|
|
58
|
-
*
|
|
59
|
-
* Responses can be set per condition text or as a blanket default.
|
|
60
|
-
*/
|
|
61
|
-
export class MockDiscretionEvaluator implements DiscretionEvaluator {
|
|
62
|
-
private responses: Map<string, boolean> = new Map();
|
|
63
|
-
private defaultResponse: boolean;
|
|
64
|
-
private evaluationLog: Array<{ condition: string; context: DiscretionContext; result: boolean }> =
|
|
65
|
-
[];
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Creates a mock evaluator.
|
|
69
|
-
*
|
|
70
|
-
* @param defaultResponse - The response for conditions without a specific mapping.
|
|
71
|
-
*/
|
|
72
|
-
constructor(defaultResponse = true) {
|
|
73
|
-
this.defaultResponse = defaultResponse;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** Set the response for a specific condition text. */
|
|
77
|
-
setResponse(condition: string, result: boolean): void {
|
|
78
|
-
this.responses.set(condition, result);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** Evaluate using the configured response map. */
|
|
82
|
-
async evaluate(condition: string, context: DiscretionContext): Promise<boolean> {
|
|
83
|
-
const result = this.responses.get(condition) ?? this.defaultResponse;
|
|
84
|
-
this.evaluationLog.push({ condition, context, result });
|
|
85
|
-
return result;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** Get the log of all evaluations performed. */
|
|
89
|
-
getLog(): ReadonlyArray<{ condition: string; context: DiscretionContext; result: boolean }> {
|
|
90
|
-
return this.evaluationLog;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/** Reset the evaluation log. */
|
|
94
|
-
clearLog(): void {
|
|
95
|
-
this.evaluationLog = [];
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// ---------------------------------------------------------------------------
|
|
100
|
-
// Rate-Limited Evaluator (Decorator)
|
|
101
|
-
// ---------------------------------------------------------------------------
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Wraps a discretion evaluator with rate limiting.
|
|
105
|
-
*
|
|
106
|
-
* Enforces a configurable maximum number of discretion evaluations per
|
|
107
|
-
* workflow execution. Default limit is 100 per the spec. This prevents
|
|
108
|
-
* runaway costs from loops containing discretion conditions.
|
|
109
|
-
*/
|
|
110
|
-
export class RateLimitedDiscretionEvaluator implements DiscretionEvaluator {
|
|
111
|
-
private evaluationCount = 0;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Creates a rate-limited evaluator wrapper.
|
|
115
|
-
*
|
|
116
|
-
* @param inner - The underlying evaluator to delegate to.
|
|
117
|
-
* @param maxEvaluations - Maximum evaluations allowed (default: 100).
|
|
118
|
-
*/
|
|
119
|
-
constructor(
|
|
120
|
-
private readonly inner: DiscretionEvaluator,
|
|
121
|
-
private readonly maxEvaluations: number = 100,
|
|
122
|
-
) {}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Evaluate with rate limiting.
|
|
126
|
-
*
|
|
127
|
-
* @throws {Error} If the evaluation count exceeds the configured maximum.
|
|
128
|
-
*/
|
|
129
|
-
async evaluate(condition: string, context: DiscretionContext): Promise<boolean> {
|
|
130
|
-
this.evaluationCount++;
|
|
131
|
-
if (this.evaluationCount > this.maxEvaluations) {
|
|
132
|
-
throw new Error(
|
|
133
|
-
`Discretion evaluation limit exceeded: ${this.evaluationCount} > ${this.maxEvaluations}. ` +
|
|
134
|
-
'This prevents runaway costs from loops containing discretion conditions.',
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return this.inner.evaluate(condition, context);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** Get the current evaluation count. */
|
|
141
|
-
getEvaluationCount(): number {
|
|
142
|
-
return this.evaluationCount;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/** Reset the evaluation counter (for reuse across workflow runs). */
|
|
146
|
-
resetCount(): void {
|
|
147
|
-
this.evaluationCount = 0;
|
|
148
|
-
}
|
|
149
|
-
}
|
package/src/cant/index.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CANT DSL runtime — TypeScript workflow executor.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the TypeScript side of the CANT hybrid runtime:
|
|
5
|
-
* - Workflow execution (sessions, parallel, conditionals, loops, try/catch)
|
|
6
|
-
* - Discretion evaluation (pluggable AI-judged conditions)
|
|
7
|
-
* - Approval gate management (token generation, validation, state machine)
|
|
8
|
-
* - Parallel arm execution (all/race/settle strategies)
|
|
9
|
-
* - Execution context and scope management
|
|
10
|
-
*
|
|
11
|
-
* Pipeline execution is handled by the Rust `cant-runtime` crate and
|
|
12
|
-
* bridged via napi-rs.
|
|
13
|
-
*
|
|
14
|
-
* @see docs/specs/CANT-DSL-SPEC.md Section 7 (Runtime) and Section 8 (Approval Tokens)
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// Approval gate management
|
|
18
|
-
export { ApprovalManager } from './approval.js';
|
|
19
|
-
|
|
20
|
-
// Execution context and scope
|
|
21
|
-
export {
|
|
22
|
-
createChildScope,
|
|
23
|
-
createScope,
|
|
24
|
-
flattenScope,
|
|
25
|
-
mergeStepOutput,
|
|
26
|
-
resolveTemplate,
|
|
27
|
-
resolveVariable,
|
|
28
|
-
setVariable,
|
|
29
|
-
} from './context-builder.js';
|
|
30
|
-
|
|
31
|
-
// Discretion evaluation
|
|
32
|
-
export type { DiscretionEvaluator } from './discretion.js';
|
|
33
|
-
export {
|
|
34
|
-
DefaultDiscretionEvaluator,
|
|
35
|
-
MockDiscretionEvaluator,
|
|
36
|
-
RateLimitedDiscretionEvaluator,
|
|
37
|
-
} from './discretion.js';
|
|
38
|
-
|
|
39
|
-
// Parallel execution
|
|
40
|
-
export type { ParallelArm, ParallelResult } from './parallel-runner.js';
|
|
41
|
-
export { executeParallel } from './parallel-runner.js';
|
|
42
|
-
|
|
43
|
-
// Runtime types
|
|
44
|
-
export type {
|
|
45
|
-
ApprovalToken,
|
|
46
|
-
ApprovalTokenStatus,
|
|
47
|
-
DiscretionContext,
|
|
48
|
-
ExecutionResult,
|
|
49
|
-
ExecutionScope,
|
|
50
|
-
JoinStrategy,
|
|
51
|
-
SettleResult,
|
|
52
|
-
StepResult,
|
|
53
|
-
TokenValidation,
|
|
54
|
-
} from './types.js';
|
|
55
|
-
|
|
56
|
-
// Workflow executor
|
|
57
|
-
export type { WorkflowExecutorConfig } from './workflow-executor.js';
|
|
58
|
-
export { WorkflowExecutor } from './workflow-executor.js';
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parallel arm execution for CANT workflow parallel blocks.
|
|
3
|
-
*
|
|
4
|
-
* Supports three join strategies:
|
|
5
|
-
* - `all` (default): Wait for ALL arms. Fail if any arm fails.
|
|
6
|
-
* - `race`: Return when the FIRST arm completes. Cancel remaining.
|
|
7
|
-
* - `settle`: Wait for ALL arms. Collect successes and failures.
|
|
8
|
-
*
|
|
9
|
-
* @see docs/specs/CANT-DSL-SPEC.md Section 7.5 (Parallel Execution)
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import type { JoinStrategy, SettleResult, StepResult } from './types.js';
|
|
13
|
-
|
|
14
|
-
/** A single parallel arm to execute. */
|
|
15
|
-
export interface ParallelArm {
|
|
16
|
-
/** The arm name (used for binding results to scope). */
|
|
17
|
-
name: string;
|
|
18
|
-
/** The async function that executes the arm's body. */
|
|
19
|
-
execute: () => Promise<unknown>;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** Result of a parallel block execution. */
|
|
23
|
-
export interface ParallelResult {
|
|
24
|
-
/** Whether the parallel block succeeded according to its join strategy. */
|
|
25
|
-
success: boolean;
|
|
26
|
-
/** Per-arm results mapped by arm name. */
|
|
27
|
-
results: Record<string, unknown>;
|
|
28
|
-
/** Step results for audit/logging. */
|
|
29
|
-
steps: StepResult[];
|
|
30
|
-
/** Settle-mode detailed breakdown (only for `settle` strategy). */
|
|
31
|
-
settleResult?: SettleResult;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Executes parallel arms according to the specified join strategy.
|
|
36
|
-
*
|
|
37
|
-
* @param arms - The arms to execute concurrently.
|
|
38
|
-
* @param strategy - The join strategy (default: 'all').
|
|
39
|
-
* @returns Parallel execution result.
|
|
40
|
-
*/
|
|
41
|
-
export async function executeParallel(
|
|
42
|
-
arms: ParallelArm[],
|
|
43
|
-
strategy: JoinStrategy = 'all',
|
|
44
|
-
): Promise<ParallelResult> {
|
|
45
|
-
switch (strategy) {
|
|
46
|
-
case 'race':
|
|
47
|
-
return executeRace(arms);
|
|
48
|
-
case 'settle':
|
|
49
|
-
return executeSettle(arms);
|
|
50
|
-
default: // 'all' or any other value
|
|
51
|
-
return executeAll(arms);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Execute all arms concurrently. Fail if any arm fails.
|
|
57
|
-
*/
|
|
58
|
-
async function executeAll(arms: ParallelArm[]): Promise<ParallelResult> {
|
|
59
|
-
const startTimes = new Map<string, number>();
|
|
60
|
-
const promises = arms.map(async (arm) => {
|
|
61
|
-
const start = Date.now();
|
|
62
|
-
startTimes.set(arm.name, start);
|
|
63
|
-
const result = await arm.execute();
|
|
64
|
-
return { name: arm.name, result, duration: Date.now() - start };
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
try {
|
|
68
|
-
const outcomes = await Promise.all(promises);
|
|
69
|
-
const results: Record<string, unknown> = {};
|
|
70
|
-
const steps: StepResult[] = [];
|
|
71
|
-
|
|
72
|
-
for (const outcome of outcomes) {
|
|
73
|
-
results[outcome.name] = outcome.result;
|
|
74
|
-
steps.push({
|
|
75
|
-
name: outcome.name,
|
|
76
|
-
type: 'parallel',
|
|
77
|
-
success: true,
|
|
78
|
-
output: outcome.result,
|
|
79
|
-
duration: outcome.duration,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return { success: true, results, steps };
|
|
84
|
-
} catch (err) {
|
|
85
|
-
const error = err instanceof Error ? err.message : String(err);
|
|
86
|
-
return {
|
|
87
|
-
success: false,
|
|
88
|
-
results: {},
|
|
89
|
-
steps: [
|
|
90
|
-
{
|
|
91
|
-
name: 'parallel:all',
|
|
92
|
-
type: 'parallel',
|
|
93
|
-
success: false,
|
|
94
|
-
error,
|
|
95
|
-
duration: 0,
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Execute all arms concurrently. Return on first completion.
|
|
104
|
-
*/
|
|
105
|
-
async function executeRace(arms: ParallelArm[]): Promise<ParallelResult> {
|
|
106
|
-
const promises = arms.map(async (arm) => {
|
|
107
|
-
const start = Date.now();
|
|
108
|
-
const result = await arm.execute();
|
|
109
|
-
return { name: arm.name, result, duration: Date.now() - start };
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
try {
|
|
113
|
-
const winner = await Promise.race(promises);
|
|
114
|
-
return {
|
|
115
|
-
success: true,
|
|
116
|
-
results: { [winner.name]: winner.result },
|
|
117
|
-
steps: [
|
|
118
|
-
{
|
|
119
|
-
name: winner.name,
|
|
120
|
-
type: 'parallel',
|
|
121
|
-
success: true,
|
|
122
|
-
output: winner.result,
|
|
123
|
-
duration: winner.duration,
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
};
|
|
127
|
-
} catch (err) {
|
|
128
|
-
const error = err instanceof Error ? err.message : String(err);
|
|
129
|
-
return {
|
|
130
|
-
success: false,
|
|
131
|
-
results: {},
|
|
132
|
-
steps: [
|
|
133
|
-
{
|
|
134
|
-
name: 'parallel:race',
|
|
135
|
-
type: 'parallel',
|
|
136
|
-
success: false,
|
|
137
|
-
error,
|
|
138
|
-
duration: 0,
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Execute all arms concurrently. Collect all successes and failures.
|
|
147
|
-
*/
|
|
148
|
-
async function executeSettle(arms: ParallelArm[]): Promise<ParallelResult> {
|
|
149
|
-
const promises = arms.map(async (arm) => {
|
|
150
|
-
const start = Date.now();
|
|
151
|
-
try {
|
|
152
|
-
const result = await arm.execute();
|
|
153
|
-
return {
|
|
154
|
-
name: arm.name,
|
|
155
|
-
status: 'fulfilled' as const,
|
|
156
|
-
result,
|
|
157
|
-
duration: Date.now() - start,
|
|
158
|
-
};
|
|
159
|
-
} catch (err) {
|
|
160
|
-
return {
|
|
161
|
-
name: arm.name,
|
|
162
|
-
status: 'rejected' as const,
|
|
163
|
-
error: err instanceof Error ? err.message : String(err),
|
|
164
|
-
duration: Date.now() - start,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
const outcomes = await Promise.all(promises);
|
|
170
|
-
|
|
171
|
-
const successes: SettleResult['successes'] = [];
|
|
172
|
-
const failures: SettleResult['failures'] = [];
|
|
173
|
-
const results: Record<string, unknown> = {};
|
|
174
|
-
const steps: StepResult[] = [];
|
|
175
|
-
|
|
176
|
-
for (const outcome of outcomes) {
|
|
177
|
-
if (outcome.status === 'fulfilled') {
|
|
178
|
-
successes.push({ name: outcome.name, result: outcome.result });
|
|
179
|
-
results[outcome.name] = outcome.result;
|
|
180
|
-
steps.push({
|
|
181
|
-
name: outcome.name,
|
|
182
|
-
type: 'parallel',
|
|
183
|
-
success: true,
|
|
184
|
-
output: outcome.result,
|
|
185
|
-
duration: outcome.duration,
|
|
186
|
-
});
|
|
187
|
-
} else {
|
|
188
|
-
failures.push({ name: outcome.name, error: outcome.error });
|
|
189
|
-
steps.push({
|
|
190
|
-
name: outcome.name,
|
|
191
|
-
type: 'parallel',
|
|
192
|
-
success: false,
|
|
193
|
-
error: outcome.error,
|
|
194
|
-
duration: outcome.duration,
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return {
|
|
200
|
-
success: failures.length === 0,
|
|
201
|
-
results,
|
|
202
|
-
steps,
|
|
203
|
-
settleResult: { successes, failures },
|
|
204
|
-
};
|
|
205
|
-
}
|
package/src/cant/types.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runtime types for the CANT DSL workflow executor.
|
|
3
|
-
*
|
|
4
|
-
* These types are used by the TypeScript workflow execution layer to
|
|
5
|
-
* represent execution results, step outcomes, discretion evaluation
|
|
6
|
-
* contexts, and approval tokens.
|
|
7
|
-
*
|
|
8
|
-
* @see docs/specs/CANT-DSL-SPEC.md Section 7 (Runtime) and Section 8 (Approval Tokens)
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
// Execution Results
|
|
13
|
-
// ---------------------------------------------------------------------------
|
|
14
|
-
|
|
15
|
-
/** The aggregate result of executing a CANT workflow. */
|
|
16
|
-
export interface ExecutionResult {
|
|
17
|
-
/** Whether the workflow completed without errors. */
|
|
18
|
-
success: boolean;
|
|
19
|
-
/** Output bindings from `output name = expr` statements. */
|
|
20
|
-
outputs: Record<string, unknown>;
|
|
21
|
-
/** Results for each executed step in order. */
|
|
22
|
-
steps: StepResult[];
|
|
23
|
-
/** Total wall-clock execution duration in milliseconds. */
|
|
24
|
-
duration: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** The result of a single workflow statement execution. */
|
|
28
|
-
export interface StepResult {
|
|
29
|
-
/** The step or statement name. */
|
|
30
|
-
name: string;
|
|
31
|
-
/** The type of statement that was executed. */
|
|
32
|
-
type:
|
|
33
|
-
| 'session'
|
|
34
|
-
| 'pipeline'
|
|
35
|
-
| 'parallel'
|
|
36
|
-
| 'conditional'
|
|
37
|
-
| 'loop'
|
|
38
|
-
| 'approval'
|
|
39
|
-
| 'binding'
|
|
40
|
-
| 'directive'
|
|
41
|
-
| 'output';
|
|
42
|
-
/** Whether this step completed successfully. */
|
|
43
|
-
success: boolean;
|
|
44
|
-
/** The output value produced by this step, if any. */
|
|
45
|
-
output?: unknown;
|
|
46
|
-
/** Error message if the step failed. */
|
|
47
|
-
error?: string;
|
|
48
|
-
/** Wall-clock execution duration in milliseconds. */
|
|
49
|
-
duration: number;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ---------------------------------------------------------------------------
|
|
53
|
-
// Discretion Evaluation
|
|
54
|
-
// ---------------------------------------------------------------------------
|
|
55
|
-
|
|
56
|
-
/** Context provided to a discretion evaluator for AI-judged conditions. */
|
|
57
|
-
export interface DiscretionContext {
|
|
58
|
-
/** The current session identifier. */
|
|
59
|
-
sessionId: string;
|
|
60
|
-
/** Task references currently in scope. */
|
|
61
|
-
taskRefs: string[];
|
|
62
|
-
/** The agent performing the evaluation. */
|
|
63
|
-
agentId: string;
|
|
64
|
-
/** All variables in the current workflow scope. */
|
|
65
|
-
variables: Record<string, unknown>;
|
|
66
|
-
/** The raw discretion condition text (between `**` delimiters). */
|
|
67
|
-
condition: string;
|
|
68
|
-
/** Output from preceding pipeline steps or session results. */
|
|
69
|
-
precedingResults: Record<string, unknown>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// ---------------------------------------------------------------------------
|
|
73
|
-
// Approval Tokens (Section 8 of CANT-DSL-SPEC.md)
|
|
74
|
-
// ---------------------------------------------------------------------------
|
|
75
|
-
|
|
76
|
-
/** Valid states for an approval token. */
|
|
77
|
-
export type ApprovalTokenStatus = 'pending' | 'approved' | 'rejected' | 'expired';
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* An approval token for human-in-the-loop workflow gates.
|
|
81
|
-
*
|
|
82
|
-
* Tokens are bound to a specific session and workflow. The `workflowHash`
|
|
83
|
-
* provides TOCTOU protection: if the workflow is modified between token
|
|
84
|
-
* creation and approval, the token is invalidated.
|
|
85
|
-
*
|
|
86
|
-
* Security invariants:
|
|
87
|
-
* - Token values MUST NOT appear in audit logs, summaries, or error messages.
|
|
88
|
-
* - `approvalTokensJson` is NEVER included in handoff/debrief serialization.
|
|
89
|
-
* - Status transitions use atomic CAS (pending -> approved|rejected|expired only).
|
|
90
|
-
*/
|
|
91
|
-
export interface ApprovalToken {
|
|
92
|
-
/** UUID v4 generated via CSPRNG (crypto.randomUUID). */
|
|
93
|
-
token: string;
|
|
94
|
-
/** The session that generated this token. Token is bound to this session. */
|
|
95
|
-
sessionId: string;
|
|
96
|
-
/** The workflow that contains the approval gate. */
|
|
97
|
-
workflowName: string;
|
|
98
|
-
/** The name label of the specific approval gate. */
|
|
99
|
-
gateName: string;
|
|
100
|
-
/**
|
|
101
|
-
* SHA-256 hash of the workflow definition text at the time the token was
|
|
102
|
-
* created. Used for TOCTOU protection.
|
|
103
|
-
*/
|
|
104
|
-
workflowHash: string;
|
|
105
|
-
/** The message displayed to the approver. */
|
|
106
|
-
message: string;
|
|
107
|
-
/** ISO 8601 timestamp of token creation. */
|
|
108
|
-
createdAt: string;
|
|
109
|
-
/** ISO 8601 timestamp of token expiration. REQUIRED. Default 24h. */
|
|
110
|
-
expiresAt: string;
|
|
111
|
-
/** Current token state. */
|
|
112
|
-
status: ApprovalTokenStatus;
|
|
113
|
-
/** Identifier of the actor who approved/rejected (informational). */
|
|
114
|
-
approvedBy?: string;
|
|
115
|
-
/** ISO 8601 timestamp of the approval/rejection action. */
|
|
116
|
-
approvedAt?: string;
|
|
117
|
-
/** ISO 8601 timestamp of when the token was consumed by the runtime. */
|
|
118
|
-
usedAt?: string;
|
|
119
|
-
/** Identifier of the agent/workflow that requested approval. */
|
|
120
|
-
requestedBy: string;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** Result of validating an approval token. */
|
|
124
|
-
export interface TokenValidation {
|
|
125
|
-
/** Whether the token is valid and can be consumed. */
|
|
126
|
-
valid: boolean;
|
|
127
|
-
/** If invalid, the reason for rejection. */
|
|
128
|
-
reason?: 'not_found' | 'wrong_session' | 'not_pending' | 'expired' | 'hash_mismatch';
|
|
129
|
-
/** The token object if found. */
|
|
130
|
-
token?: ApprovalToken;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// ---------------------------------------------------------------------------
|
|
134
|
-
// Parallel Execution
|
|
135
|
-
// ---------------------------------------------------------------------------
|
|
136
|
-
|
|
137
|
-
/** Join strategy for parallel block execution. */
|
|
138
|
-
export type JoinStrategy = 'all' | 'race' | 'settle';
|
|
139
|
-
|
|
140
|
-
/** Result of a parallel block execution with the settle strategy. */
|
|
141
|
-
export interface SettleResult {
|
|
142
|
-
/** Arms that completed successfully. */
|
|
143
|
-
successes: Array<{ name: string; result: unknown }>;
|
|
144
|
-
/** Arms that failed. */
|
|
145
|
-
failures: Array<{ name: string; error: string }>;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// ---------------------------------------------------------------------------
|
|
149
|
-
// Execution Scope
|
|
150
|
-
// ---------------------------------------------------------------------------
|
|
151
|
-
|
|
152
|
-
/** Variable scope for workflow execution. */
|
|
153
|
-
export interface ExecutionScope {
|
|
154
|
-
/** Variable bindings in the current scope. */
|
|
155
|
-
variables: Record<string, unknown>;
|
|
156
|
-
/** Parent scope for nested blocks (parallel arms, loops, etc.). */
|
|
157
|
-
parent?: ExecutionScope;
|
|
158
|
-
}
|