groundswell 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +188 -0
- package/README.md +99 -5
- package/dist/__tests__/adversarial/attachChild-performance.test.d.ts +16 -0
- package/dist/__tests__/adversarial/attachChild-performance.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/attachChild-performance.test.js +187 -0
- package/dist/__tests__/adversarial/attachChild-performance.test.js.map +1 -0
- package/dist/__tests__/adversarial/circular-reference.test.d.ts +13 -0
- package/dist/__tests__/adversarial/circular-reference.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/circular-reference.test.js +92 -0
- package/dist/__tests__/adversarial/circular-reference.test.js.map +1 -0
- package/dist/__tests__/adversarial/complex-circular-reference.test.d.ts +16 -0
- package/dist/__tests__/adversarial/complex-circular-reference.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/complex-circular-reference.test.js +127 -0
- package/dist/__tests__/adversarial/complex-circular-reference.test.js.map +1 -0
- package/dist/__tests__/adversarial/concurrent-task-failures.test.d.ts +21 -0
- package/dist/__tests__/adversarial/concurrent-task-failures.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/concurrent-task-failures.test.js +667 -0
- package/dist/__tests__/adversarial/concurrent-task-failures.test.js.map +1 -0
- package/dist/__tests__/adversarial/deep-analysis.test.d.ts +6 -0
- package/dist/__tests__/adversarial/deep-analysis.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/deep-analysis.test.js +877 -0
- package/dist/__tests__/adversarial/deep-analysis.test.js.map +1 -0
- package/dist/__tests__/adversarial/deep-hierarchy-stress.test.d.ts +13 -0
- package/dist/__tests__/adversarial/deep-hierarchy-stress.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/deep-hierarchy-stress.test.js +186 -0
- package/dist/__tests__/adversarial/deep-hierarchy-stress.test.js.map +1 -0
- package/dist/__tests__/adversarial/e2e-prd-validation.test.d.ts +6 -0
- package/dist/__tests__/adversarial/e2e-prd-validation.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/e2e-prd-validation.test.js +626 -0
- package/dist/__tests__/adversarial/e2e-prd-validation.test.js.map +1 -0
- package/dist/__tests__/adversarial/edge-case.test.d.ts +6 -0
- package/dist/__tests__/adversarial/edge-case.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/edge-case.test.js +857 -0
- package/dist/__tests__/adversarial/edge-case.test.js.map +1 -0
- package/dist/__tests__/adversarial/error-merge-strategy.test.d.ts +20 -0
- package/dist/__tests__/adversarial/error-merge-strategy.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/error-merge-strategy.test.js +907 -0
- package/dist/__tests__/adversarial/error-merge-strategy.test.js.map +1 -0
- package/dist/__tests__/adversarial/incremental-performance.test.d.ts +2 -0
- package/dist/__tests__/adversarial/incremental-performance.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/incremental-performance.test.js +113 -0
- package/dist/__tests__/adversarial/incremental-performance.test.js.map +1 -0
- package/dist/__tests__/adversarial/node-map-update-benchmarks.test.d.ts +22 -0
- package/dist/__tests__/adversarial/node-map-update-benchmarks.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/node-map-update-benchmarks.test.js +383 -0
- package/dist/__tests__/adversarial/node-map-update-benchmarks.test.js.map +1 -0
- package/dist/__tests__/adversarial/observer-propagation.test.d.ts +21 -0
- package/dist/__tests__/adversarial/observer-propagation.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/observer-propagation.test.js +404 -0
- package/dist/__tests__/adversarial/observer-propagation.test.js.map +1 -0
- package/dist/__tests__/adversarial/parent-validation.test.d.ts +13 -0
- package/dist/__tests__/adversarial/parent-validation.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/parent-validation.test.js +128 -0
- package/dist/__tests__/adversarial/parent-validation.test.js.map +1 -0
- package/dist/__tests__/adversarial/prd-12-2-compliance.test.d.ts +20 -0
- package/dist/__tests__/adversarial/prd-12-2-compliance.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/prd-12-2-compliance.test.js +482 -0
- package/dist/__tests__/adversarial/prd-12-2-compliance.test.js.map +1 -0
- package/dist/__tests__/adversarial/prd-compliance.test.d.ts +6 -0
- package/dist/__tests__/adversarial/prd-compliance.test.d.ts.map +1 -0
- package/dist/__tests__/adversarial/prd-compliance.test.js +886 -0
- package/dist/__tests__/adversarial/prd-compliance.test.js.map +1 -0
- package/dist/__tests__/compatibility/backward-compatibility.test.d.ts +22 -0
- package/dist/__tests__/compatibility/backward-compatibility.test.d.ts.map +1 -0
- package/dist/__tests__/compatibility/backward-compatibility.test.js +1843 -0
- package/dist/__tests__/compatibility/backward-compatibility.test.js.map +1 -0
- package/dist/__tests__/helpers/index.d.ts +10 -0
- package/dist/__tests__/helpers/index.d.ts.map +1 -0
- package/dist/__tests__/helpers/index.js +10 -0
- package/dist/__tests__/helpers/index.js.map +1 -0
- package/dist/__tests__/helpers/tree-verification.d.ts +90 -0
- package/dist/__tests__/helpers/tree-verification.d.ts.map +1 -0
- package/dist/__tests__/helpers/tree-verification.js +202 -0
- package/dist/__tests__/helpers/tree-verification.js.map +1 -0
- package/dist/__tests__/integration/agent-workflow.test.d.ts +2 -0
- package/dist/__tests__/integration/agent-workflow.test.d.ts.map +1 -0
- package/dist/__tests__/integration/agent-workflow.test.js +256 -0
- package/dist/__tests__/integration/agent-workflow.test.js.map +1 -0
- package/dist/__tests__/integration/bidirectional-consistency.test.d.ts +14 -0
- package/dist/__tests__/integration/bidirectional-consistency.test.d.ts.map +1 -0
- package/dist/__tests__/integration/bidirectional-consistency.test.js +668 -0
- package/dist/__tests__/integration/bidirectional-consistency.test.js.map +1 -0
- package/dist/__tests__/integration/observer-logging.test.d.ts +2 -0
- package/dist/__tests__/integration/observer-logging.test.d.ts.map +1 -0
- package/dist/__tests__/integration/observer-logging.test.js +517 -0
- package/dist/__tests__/integration/observer-logging.test.js.map +1 -0
- package/dist/__tests__/integration/tree-mirroring.test.d.ts +2 -0
- package/dist/__tests__/integration/tree-mirroring.test.d.ts.map +1 -0
- package/dist/__tests__/integration/tree-mirroring.test.js +117 -0
- package/dist/__tests__/integration/tree-mirroring.test.js.map +1 -0
- package/dist/__tests__/integration/workflow-reparenting.test.d.ts +12 -0
- package/dist/__tests__/integration/workflow-reparenting.test.d.ts.map +1 -0
- package/dist/__tests__/integration/workflow-reparenting.test.js +239 -0
- package/dist/__tests__/integration/workflow-reparenting.test.js.map +1 -0
- package/dist/__tests__/unit/agent.test.d.ts +2 -0
- package/dist/__tests__/unit/agent.test.d.ts.map +1 -0
- package/dist/__tests__/unit/agent.test.js +143 -0
- package/dist/__tests__/unit/agent.test.js.map +1 -0
- package/dist/__tests__/unit/cache-key.test.d.ts +5 -0
- package/dist/__tests__/unit/cache-key.test.d.ts.map +1 -0
- package/dist/__tests__/unit/cache-key.test.js +145 -0
- package/dist/__tests__/unit/cache-key.test.js.map +1 -0
- package/dist/__tests__/unit/cache.test.d.ts +5 -0
- package/dist/__tests__/unit/cache.test.d.ts.map +1 -0
- package/dist/__tests__/unit/cache.test.js +132 -0
- package/dist/__tests__/unit/cache.test.js.map +1 -0
- package/dist/__tests__/unit/context.test.d.ts +2 -0
- package/dist/__tests__/unit/context.test.d.ts.map +1 -0
- package/dist/__tests__/unit/context.test.js +220 -0
- package/dist/__tests__/unit/context.test.js.map +1 -0
- package/dist/__tests__/unit/decorators.test.d.ts +2 -0
- package/dist/__tests__/unit/decorators.test.d.ts.map +1 -0
- package/dist/__tests__/unit/decorators.test.js +162 -0
- package/dist/__tests__/unit/decorators.test.js.map +1 -0
- package/dist/__tests__/unit/introspection-tools.test.d.ts +5 -0
- package/dist/__tests__/unit/introspection-tools.test.d.ts.map +1 -0
- package/dist/__tests__/unit/introspection-tools.test.js +191 -0
- package/dist/__tests__/unit/introspection-tools.test.js.map +1 -0
- package/dist/__tests__/unit/logger.test.d.ts +2 -0
- package/dist/__tests__/unit/logger.test.d.ts.map +1 -0
- package/dist/__tests__/unit/logger.test.js +241 -0
- package/dist/__tests__/unit/logger.test.js.map +1 -0
- package/dist/__tests__/unit/observable.test.d.ts +2 -0
- package/dist/__tests__/unit/observable.test.d.ts.map +1 -0
- package/dist/__tests__/unit/observable.test.js +251 -0
- package/dist/__tests__/unit/observable.test.js.map +1 -0
- package/dist/__tests__/unit/prompt.test.d.ts +2 -0
- package/dist/__tests__/unit/prompt.test.d.ts.map +1 -0
- package/dist/__tests__/unit/prompt.test.js +113 -0
- package/dist/__tests__/unit/prompt.test.js.map +1 -0
- package/dist/__tests__/unit/reflection.test.d.ts +5 -0
- package/dist/__tests__/unit/reflection.test.d.ts.map +1 -0
- package/dist/__tests__/unit/reflection.test.js +160 -0
- package/dist/__tests__/unit/reflection.test.js.map +1 -0
- package/dist/__tests__/unit/tree-debugger-incremental.test.d.ts +2 -0
- package/dist/__tests__/unit/tree-debugger-incremental.test.d.ts.map +1 -0
- package/dist/__tests__/unit/tree-debugger-incremental.test.js +136 -0
- package/dist/__tests__/unit/tree-debugger-incremental.test.js.map +1 -0
- package/dist/__tests__/unit/tree-debugger.test.d.ts +2 -0
- package/dist/__tests__/unit/tree-debugger.test.d.ts.map +1 -0
- package/dist/__tests__/unit/tree-debugger.test.js +69 -0
- package/dist/__tests__/unit/tree-debugger.test.js.map +1 -0
- package/dist/__tests__/unit/utils/workflow-error-utils.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/workflow-error-utils.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/workflow-error-utils.test.js +154 -0
- package/dist/__tests__/unit/utils/workflow-error-utils.test.js.map +1 -0
- package/dist/__tests__/unit/workflow-detachChild.test.d.ts +2 -0
- package/dist/__tests__/unit/workflow-detachChild.test.d.ts.map +1 -0
- package/dist/__tests__/unit/workflow-detachChild.test.js +76 -0
- package/dist/__tests__/unit/workflow-detachChild.test.js.map +1 -0
- package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.d.ts +2 -0
- package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.d.ts.map +1 -0
- package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.js +122 -0
- package/dist/__tests__/unit/workflow-emitEvent-childDetached.test.js.map +1 -0
- package/dist/__tests__/unit/workflow-isDescendantOf.test.d.ts +2 -0
- package/dist/__tests__/unit/workflow-isDescendantOf.test.d.ts.map +1 -0
- package/dist/__tests__/unit/workflow-isDescendantOf.test.js +140 -0
- package/dist/__tests__/unit/workflow-isDescendantOf.test.js.map +1 -0
- package/dist/__tests__/unit/workflow.test.d.ts +2 -0
- package/dist/__tests__/unit/workflow.test.d.ts.map +1 -0
- package/dist/__tests__/unit/workflow.test.js +330 -0
- package/dist/__tests__/unit/workflow.test.js.map +1 -0
- package/dist/cache/cache-key.d.ts +66 -0
- package/dist/cache/cache-key.d.ts.map +1 -0
- package/dist/cache/cache-key.js +195 -0
- package/dist/cache/cache-key.js.map +1 -0
- package/dist/cache/cache.d.ts +104 -0
- package/dist/cache/cache.d.ts.map +1 -0
- package/dist/cache/cache.js +179 -0
- package/dist/cache/cache.js.map +1 -0
- package/{src/cache/index.ts → dist/cache/index.d.ts} +1 -1
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/core/agent.d.ts +112 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +426 -0
- package/dist/core/agent.js.map +1 -0
- package/{src/core/context.ts → dist/core/context.d.ts} +16 -67
- package/dist/core/context.d.ts.map +1 -0
- package/dist/core/context.js +80 -0
- package/dist/core/context.js.map +1 -0
- package/dist/core/event-tree.d.ts +72 -0
- package/dist/core/event-tree.d.ts.map +1 -0
- package/dist/core/event-tree.js +211 -0
- package/dist/core/event-tree.js.map +1 -0
- package/{src/core/factory.ts → dist/core/factory.d.ts} +6 -27
- package/dist/core/factory.d.ts.map +1 -0
- package/dist/core/factory.js +110 -0
- package/dist/core/factory.js.map +1 -0
- package/{src/core/index.ts → dist/core/index.d.ts} +2 -10
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +50 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +91 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/mcp-handler.d.ts +69 -0
- package/dist/core/mcp-handler.d.ts.map +1 -0
- package/dist/core/mcp-handler.js +143 -0
- package/dist/core/mcp-handler.js.map +1 -0
- package/dist/core/prompt.d.ts +80 -0
- package/dist/core/prompt.d.ts.map +1 -0
- package/dist/core/prompt.js +120 -0
- package/dist/core/prompt.js.map +1 -0
- package/dist/core/workflow-context.d.ts +57 -0
- package/dist/core/workflow-context.d.ts.map +1 -0
- package/dist/core/workflow-context.js +263 -0
- package/dist/core/workflow-context.js.map +1 -0
- package/dist/core/workflow.d.ts +241 -0
- package/dist/core/workflow.d.ts.map +1 -0
- package/dist/core/workflow.js +464 -0
- package/dist/core/workflow.js.map +1 -0
- package/dist/debugger/index.d.ts +2 -0
- package/dist/debugger/index.d.ts.map +1 -0
- package/{src/debugger/index.ts → dist/debugger/index.js} +1 -0
- package/dist/debugger/index.js.map +1 -0
- package/dist/debugger/tree-debugger.d.ts +71 -0
- package/dist/debugger/tree-debugger.d.ts.map +1 -0
- package/dist/debugger/tree-debugger.js +198 -0
- package/dist/debugger/tree-debugger.js.map +1 -0
- package/dist/decorators/index.d.ts +4 -0
- package/dist/decorators/index.d.ts.map +1 -0
- package/{src/decorators/index.ts → dist/decorators/index.js} +1 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/observed-state.d.ts +32 -0
- package/dist/decorators/observed-state.d.ts.map +1 -0
- package/dist/decorators/observed-state.js +79 -0
- package/dist/decorators/observed-state.js.map +1 -0
- package/dist/decorators/step.d.ts +15 -0
- package/dist/decorators/step.d.ts.map +1 -0
- package/dist/decorators/step.js +110 -0
- package/dist/decorators/step.js.map +1 -0
- package/dist/decorators/task.d.ts +50 -0
- package/dist/decorators/task.d.ts.map +1 -0
- package/dist/decorators/task.js +118 -0
- package/dist/decorators/task.js.map +1 -0
- package/dist/examples/index.d.ts +3 -0
- package/dist/examples/index.d.ts.map +1 -0
- package/{src/examples/index.ts → dist/examples/index.js} +1 -0
- package/dist/examples/index.js.map +1 -0
- package/dist/examples/tdd-orchestrator.d.ts +15 -0
- package/dist/examples/tdd-orchestrator.d.ts.map +1 -0
- package/dist/examples/tdd-orchestrator.js +121 -0
- package/dist/examples/tdd-orchestrator.js.map +1 -0
- package/dist/examples/test-cycle-workflow.d.ts +14 -0
- package/dist/examples/test-cycle-workflow.d.ts.map +1 -0
- package/dist/examples/test-cycle-workflow.js +116 -0
- package/dist/examples/test-cycle-workflow.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/reflection/index.d.ts +5 -0
- package/dist/reflection/index.d.ts.map +1 -0
- package/{src/reflection/index.ts → dist/reflection/index.js} +1 -1
- package/dist/reflection/index.js.map +1 -0
- package/dist/reflection/reflection.d.ts +84 -0
- package/dist/reflection/reflection.d.ts.map +1 -0
- package/dist/reflection/reflection.js +329 -0
- package/dist/reflection/reflection.js.map +1 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +11 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/introspection.d.ts +165 -0
- package/dist/tools/introspection.d.ts.map +1 -0
- package/dist/tools/introspection.js +324 -0
- package/dist/tools/introspection.js.map +1 -0
- package/dist/types/agent.d.ts +66 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +6 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/decorators.d.ts +31 -0
- package/dist/types/decorators.d.ts.map +1 -0
- package/dist/types/decorators.js +2 -0
- package/dist/types/decorators.js.map +1 -0
- package/dist/types/error-strategy.d.ts +13 -0
- package/dist/types/error-strategy.d.ts.map +1 -0
- package/dist/types/error-strategy.js +2 -0
- package/dist/types/error-strategy.js.map +1 -0
- package/dist/types/error.d.ts +20 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +2 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/events.d.ts +87 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +2 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/logging.d.ts +24 -0
- package/dist/types/logging.d.ts.map +1 -0
- package/dist/types/logging.js +2 -0
- package/dist/types/logging.js.map +1 -0
- package/dist/types/observer.d.ts +18 -0
- package/dist/types/observer.d.ts.map +1 -0
- package/dist/types/observer.js +2 -0
- package/dist/types/observer.js.map +1 -0
- package/dist/types/prompt.d.ts +31 -0
- package/dist/types/prompt.d.ts.map +1 -0
- package/dist/types/prompt.js +6 -0
- package/dist/types/prompt.js.map +1 -0
- package/dist/types/reflection.d.ts +96 -0
- package/dist/types/reflection.d.ts.map +1 -0
- package/dist/types/reflection.js +24 -0
- package/dist/types/reflection.js.map +1 -0
- package/dist/types/sdk-primitives.d.ts +118 -0
- package/dist/types/sdk-primitives.d.ts.map +1 -0
- package/dist/types/sdk-primitives.js +6 -0
- package/dist/types/sdk-primitives.js.map +1 -0
- package/{src/types/snapshot.ts → dist/types/snapshot.d.ts} +5 -5
- package/dist/types/snapshot.d.ts.map +1 -0
- package/dist/types/snapshot.js +2 -0
- package/dist/types/snapshot.js.map +1 -0
- package/dist/types/workflow-context.d.ts +139 -0
- package/dist/types/workflow-context.d.ts.map +1 -0
- package/dist/types/workflow-context.js +8 -0
- package/dist/types/workflow-context.js.map +1 -0
- package/dist/types/workflow.d.ts +30 -0
- package/dist/types/workflow.d.ts.map +1 -0
- package/dist/types/workflow.js +2 -0
- package/dist/types/workflow.js.map +1 -0
- package/dist/utils/id.d.ts +6 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +12 -0
- package/dist/utils/id.js.map +1 -0
- package/{src/utils/index.ts → dist/utils/index.d.ts} +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/observable.d.ts +54 -0
- package/dist/utils/observable.d.ts.map +1 -0
- package/dist/utils/observable.js +82 -0
- package/dist/utils/observable.js.map +1 -0
- package/dist/utils/workflow-error-utils.d.ts +22 -0
- package/dist/utils/workflow-error-utils.d.ts.map +1 -0
- package/dist/utils/workflow-error-utils.js +45 -0
- package/dist/utils/workflow-error-utils.js.map +1 -0
- package/package.json +7 -2
- package/.claude/settings.local.json +0 -9
- package/.claude/system_prompts/task-breakdown.md +0 -100
- package/PRPs/001-hierarchical-workflow-engine.md +0 -2438
- package/PRPs/PRDs/001-hierarchical-workflow-engine.md +0 -543
- package/PRPs/PRDs/002-agent-prompt.md +0 -390
- package/PRPs/PRDs/003-agent-prompt.md +0 -943
- package/PRPs/PRDs/004-agent-prompt.md +0 -1136
- package/PRPs/PRDs/tasks-001.json +0 -492
- package/PRPs/README.md +0 -83
- package/PRPs/templates/prp_base.md +0 -222
- package/docs/agent.md +0 -422
- package/docs/prompt.md +0 -419
- package/docs/workflow.md +0 -600
- package/examples/README.md +0 -244
- package/examples/examples/01-basic-workflow.ts +0 -100
- package/examples/examples/02-decorator-options.ts +0 -217
- package/examples/examples/03-parent-child.ts +0 -241
- package/examples/examples/04-observers-debugger.ts +0 -340
- package/examples/examples/05-error-handling.ts +0 -387
- package/examples/examples/06-concurrent-tasks.ts +0 -352
- package/examples/examples/07-agent-loops.ts +0 -432
- package/examples/examples/08-sdk-features.ts +0 -667
- package/examples/examples/09-reflection.ts +0 -573
- package/examples/examples/10-introspection.ts +0 -550
- package/examples/index.ts +0 -143
- package/examples/utils/helpers.ts +0 -57
- package/llms_full.txt +0 -5890
- package/plan/P1P2/PRP.md +0 -527
- package/plan/P1P2/research/LRU_CACHE_BEST_PRACTICES.md +0 -1929
- package/plan/P1P2/research/LRU_CACHE_CODE_PATTERNS.md +0 -857
- package/plan/P1P2/research/LRU_CACHE_INTEGRATION_GUIDE.md +0 -738
- package/plan/P1P2/research/LRU_CACHE_RESEARCH_INDEX.md +0 -424
- package/plan/P1P2/research/REFLECTION_INDEX.md +0 -291
- package/plan/P1P2/research/REFLECTION_RESEARCH_REPORT.md +0 -1342
- package/plan/P1P2/research/RESEARCH_SUMMARY.md +0 -342
- package/plan/P1P2/research/anthropic-sdk.md +0 -174
- package/plan/P1P2/research/async-local-storage.md +0 -200
- package/plan/P1P2/research/reflection-code-patterns.md +0 -1205
- package/plan/P1P2/research/reflection-decision-matrix.md +0 -421
- package/plan/P1P2/research/reflection-implementation-guide.md +0 -1341
- package/plan/P1P2/research/reflection-integration-guide.md +0 -834
- package/plan/P1P2/research/reflection-patterns.md +0 -1468
- package/plan/P1P2/research/reflection-quick-reference.md +0 -558
- package/plan/P1P2/research/zod-schema.md +0 -152
- package/plan/P3P4/PRP.md +0 -1388
- package/plan/P3P4/research/caching-lru.md +0 -116
- package/plan/P3P4/research/introspection-tools.md +0 -177
- package/plan/P3P4/research/reflection-patterns.md +0 -117
- package/plan/P4P5/PRP.md +0 -1136
- package/plan/P4P5/research/RESEARCH_SUMMARY.md +0 -151
- package/plan/architecture/external_deps.md +0 -358
- package/plan/architecture/system_context.md +0 -242
- package/plan/backlog.json +0 -867
- package/plan/research/INTROSPECTION_RESEARCH_SUMMARY.md +0 -378
- package/plan/research/README-INTROSPECTION.md +0 -352
- package/plan/research/agent-introspection-patterns.md +0 -1085
- package/plan/research/introspection-security-guide.md +0 -928
- package/plan/research/introspection-tool-examples.md +0 -875
- package/scripts/generate-llms-full.ts +0 -206
- package/src/__tests__/integration/agent-workflow.test.ts +0 -256
- package/src/__tests__/integration/tree-mirroring.test.ts +0 -114
- package/src/__tests__/unit/agent.test.ts +0 -169
- package/src/__tests__/unit/cache-key.test.ts +0 -182
- package/src/__tests__/unit/cache.test.ts +0 -172
- package/src/__tests__/unit/context.test.ts +0 -138
- package/src/__tests__/unit/decorators.test.ts +0 -100
- package/src/__tests__/unit/introspection-tools.test.ts +0 -277
- package/src/__tests__/unit/prompt.test.ts +0 -135
- package/src/__tests__/unit/reflection.test.ts +0 -210
- package/src/__tests__/unit/tree-debugger.test.ts +0 -85
- package/src/__tests__/unit/workflow.test.ts +0 -81
- package/src/cache/cache-key.ts +0 -244
- package/src/cache/cache.ts +0 -236
- package/src/core/agent.ts +0 -573
- package/src/core/event-tree.ts +0 -260
- package/src/core/logger.ts +0 -87
- package/src/core/mcp-handler.ts +0 -184
- package/src/core/prompt.ts +0 -150
- package/src/core/workflow-context.ts +0 -349
- package/src/core/workflow.ts +0 -302
- package/src/debugger/tree-debugger.ts +0 -210
- package/src/decorators/observed-state.ts +0 -95
- package/src/decorators/step.ts +0 -139
- package/src/decorators/task.ts +0 -96
- package/src/examples/tdd-orchestrator.ts +0 -65
- package/src/examples/test-cycle-workflow.ts +0 -64
- package/src/index.ts +0 -140
- package/src/reflection/reflection.ts +0 -407
- package/src/tools/index.ts +0 -36
- package/src/tools/introspection.ts +0 -464
- package/src/types/agent.ts +0 -90
- package/src/types/decorators.ts +0 -25
- package/src/types/error-strategy.ts +0 -13
- package/src/types/error.ts +0 -20
- package/src/types/events.ts +0 -74
- package/src/types/index.ts +0 -55
- package/src/types/logging.ts +0 -24
- package/src/types/observer.ts +0 -18
- package/src/types/prompt.ts +0 -40
- package/src/types/reflection.ts +0 -117
- package/src/types/sdk-primitives.ts +0 -128
- package/src/types/workflow-context.ts +0 -163
- package/src/types/workflow.ts +0 -37
- package/src/utils/id.ts +0 -11
- package/src/utils/observable.ts +0 -77
- package/tasks.json +0 -0
- package/tsconfig.json +0 -22
- package/vitest.config.ts +0 -16
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log severity levels
|
|
3
|
+
*/
|
|
4
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
5
|
+
/**
|
|
6
|
+
* A single log entry in the workflow
|
|
7
|
+
*/
|
|
8
|
+
export interface LogEntry {
|
|
9
|
+
/** Unique identifier for this log entry */
|
|
10
|
+
id: string;
|
|
11
|
+
/** ID of the workflow that created this log */
|
|
12
|
+
workflowId: string;
|
|
13
|
+
/** Unix timestamp in milliseconds */
|
|
14
|
+
timestamp: number;
|
|
15
|
+
/** Severity level */
|
|
16
|
+
level: LogLevel;
|
|
17
|
+
/** Log message */
|
|
18
|
+
message: string;
|
|
19
|
+
/** Optional structured data */
|
|
20
|
+
data?: unknown;
|
|
21
|
+
/** ID of parent log entry (for hierarchical logging) */
|
|
22
|
+
parentLogId?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=logging.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/types/logging.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,KAAK,EAAE,QAAQ,CAAC;IAChB,kBAAkB;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/types/logging.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LogEntry } from './logging.js';
|
|
2
|
+
import type { WorkflowEvent } from './events.js';
|
|
3
|
+
import type { WorkflowNode } from './workflow.js';
|
|
4
|
+
/**
|
|
5
|
+
* Observer interface for subscribing to workflow events
|
|
6
|
+
* Observers attach to the root workflow and receive all events
|
|
7
|
+
*/
|
|
8
|
+
export interface WorkflowObserver {
|
|
9
|
+
/** Called when a log entry is created */
|
|
10
|
+
onLog(entry: LogEntry): void;
|
|
11
|
+
/** Called when any workflow event occurs */
|
|
12
|
+
onEvent(event: WorkflowEvent): void;
|
|
13
|
+
/** Called when a node's state is updated */
|
|
14
|
+
onStateUpdated(node: WorkflowNode): void;
|
|
15
|
+
/** Called when the tree structure changes */
|
|
16
|
+
onTreeChanged(root: WorkflowNode): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=observer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../src/types/observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC7B,4CAA4C;IAC5C,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,4CAA4C;IAC5C,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IACzC,6CAA6C;IAC7C,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observer.js","sourceRoot":"","sources":["../../src/types/observer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt configuration types
|
|
3
|
+
* Prompts are immutable definitions of what to send to an agent
|
|
4
|
+
*/
|
|
5
|
+
import type { z } from 'zod';
|
|
6
|
+
import type { Tool, MCPServer, Skill, AgentHooks } from './sdk-primitives.js';
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for creating a Prompt instance
|
|
9
|
+
* @template T The expected response type (inferred from responseFormat)
|
|
10
|
+
*/
|
|
11
|
+
export interface PromptConfig<T> {
|
|
12
|
+
/** User message content */
|
|
13
|
+
user: string;
|
|
14
|
+
/** Structured data to inject into the prompt */
|
|
15
|
+
data?: Record<string, unknown>;
|
|
16
|
+
/** Zod schema defining the expected response format */
|
|
17
|
+
responseFormat: z.ZodType<T>;
|
|
18
|
+
/** Override system prompt (takes precedence over agent config) */
|
|
19
|
+
system?: string;
|
|
20
|
+
/** Override tools (takes precedence over agent config) */
|
|
21
|
+
tools?: Tool[];
|
|
22
|
+
/** Override MCPs (takes precedence over agent config) */
|
|
23
|
+
mcps?: MCPServer[];
|
|
24
|
+
/** Override skills (takes precedence over agent config) */
|
|
25
|
+
skills?: Skill[];
|
|
26
|
+
/** Override hooks (takes precedence over agent config) */
|
|
27
|
+
hooks?: AgentHooks;
|
|
28
|
+
/** Enable reflection specifically for this prompt */
|
|
29
|
+
enableReflection?: boolean;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B,uDAAuD;IACvD,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7B,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IAEf,yDAAyD;IACzD,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IAEnB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;IAEjB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/types/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reflection types - Interfaces for multi-level reflection and self-correction
|
|
3
|
+
*
|
|
4
|
+
* Reflection allows agents to analyze errors and retry with modified approaches.
|
|
5
|
+
* Supports workflow, agent, and prompt level reflection with configurable limits.
|
|
6
|
+
*/
|
|
7
|
+
import type { WorkflowNode } from './workflow.js';
|
|
8
|
+
/**
|
|
9
|
+
* Configuration for reflection behavior
|
|
10
|
+
*/
|
|
11
|
+
export interface ReflectionConfig {
|
|
12
|
+
/** Whether reflection is enabled */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
/** Maximum number of reflection attempts (default: 3) */
|
|
15
|
+
maxAttempts: number;
|
|
16
|
+
/** Delay between retry attempts in milliseconds (default: 0) */
|
|
17
|
+
retryDelayMs?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Context provided to the reflection process
|
|
21
|
+
*/
|
|
22
|
+
export interface ReflectionContext {
|
|
23
|
+
/** Level at which reflection is occurring */
|
|
24
|
+
level: 'workflow' | 'agent' | 'prompt';
|
|
25
|
+
/** The workflow node that failed */
|
|
26
|
+
failedNode: WorkflowNode;
|
|
27
|
+
/** The error that triggered reflection */
|
|
28
|
+
error: Error;
|
|
29
|
+
/** Current attempt number (1-indexed) */
|
|
30
|
+
attemptNumber: number;
|
|
31
|
+
/** History of previous reflection attempts */
|
|
32
|
+
previousAttempts: ReflectionEntry[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Result from a reflection analysis
|
|
36
|
+
*/
|
|
37
|
+
export interface ReflectionResult {
|
|
38
|
+
/** Whether to retry the operation */
|
|
39
|
+
shouldRetry: boolean;
|
|
40
|
+
/** Revised prompt data for retry */
|
|
41
|
+
revisedPromptData?: Record<string, unknown>;
|
|
42
|
+
/** Revised system prompt for retry */
|
|
43
|
+
revisedSystemPrompt?: string;
|
|
44
|
+
/** Explanation of the reflection decision */
|
|
45
|
+
reason: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Record of a single reflection attempt
|
|
49
|
+
*/
|
|
50
|
+
export interface ReflectionEntry {
|
|
51
|
+
/** Timestamp when reflection occurred */
|
|
52
|
+
timestamp: number;
|
|
53
|
+
/** Level at which reflection occurred */
|
|
54
|
+
level: 'workflow' | 'agent' | 'prompt';
|
|
55
|
+
/** Reason for the reflection */
|
|
56
|
+
reason: string;
|
|
57
|
+
/** Original error that triggered reflection */
|
|
58
|
+
error: Error;
|
|
59
|
+
/** Resolution action taken */
|
|
60
|
+
resolution: 'retry' | 'skip' | 'abort';
|
|
61
|
+
/** Whether the retry was successful */
|
|
62
|
+
success: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Full ReflectionAPI interface for workflow contexts
|
|
66
|
+
*/
|
|
67
|
+
export interface ReflectionAPI {
|
|
68
|
+
/**
|
|
69
|
+
* Check if reflection is enabled
|
|
70
|
+
*/
|
|
71
|
+
isEnabled(): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Trigger a reflection on the current context
|
|
74
|
+
* @param reason Optional reason for the reflection
|
|
75
|
+
*/
|
|
76
|
+
triggerReflection(reason?: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Get the history of reflection attempts
|
|
79
|
+
*/
|
|
80
|
+
getReflectionHistory(): ReflectionEntry[];
|
|
81
|
+
/**
|
|
82
|
+
* Perform reflection analysis on an error
|
|
83
|
+
* @param context The reflection context with error details
|
|
84
|
+
* @returns Result indicating whether to retry
|
|
85
|
+
*/
|
|
86
|
+
reflect(context: ReflectionContext): Promise<ReflectionResult>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Default reflection configuration
|
|
90
|
+
*/
|
|
91
|
+
export declare const DEFAULT_REFLECTION_CONFIG: ReflectionConfig;
|
|
92
|
+
/**
|
|
93
|
+
* Create a reflection config with defaults
|
|
94
|
+
*/
|
|
95
|
+
export declare function createReflectionConfig(partial?: Partial<ReflectionConfig>): ReflectionConfig;
|
|
96
|
+
//# sourceMappingURL=reflection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../../src/types/reflection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvC,oCAAoC;IACpC,UAAU,EAAE,YAAY,CAAC;IACzB,0CAA0C;IAC1C,KAAK,EAAE,KAAK,CAAC;IACb,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qCAAqC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;IACvC,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,+CAA+C;IAC/C,KAAK,EAAE,KAAK,CAAC;IACb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACvC,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;;OAGG;IACH,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,oBAAoB,IAAI,eAAe,EAAE,CAAC;IAE1C;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAChE;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,gBAIvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAClC,gBAAgB,CAKlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reflection types - Interfaces for multi-level reflection and self-correction
|
|
3
|
+
*
|
|
4
|
+
* Reflection allows agents to analyze errors and retry with modified approaches.
|
|
5
|
+
* Supports workflow, agent, and prompt level reflection with configurable limits.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Default reflection configuration
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_REFLECTION_CONFIG = {
|
|
11
|
+
enabled: false,
|
|
12
|
+
maxAttempts: 3,
|
|
13
|
+
retryDelayMs: 0,
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Create a reflection config with defaults
|
|
17
|
+
*/
|
|
18
|
+
export function createReflectionConfig(partial) {
|
|
19
|
+
return {
|
|
20
|
+
...DEFAULT_REFLECTION_CONFIG,
|
|
21
|
+
...partial,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=reflection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reflection.js","sourceRoot":"","sources":["../../src/types/reflection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4FH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAqB;IACzD,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAmC;IAEnC,OAAO;QACL,GAAG,yBAAyB;QAC5B,GAAG,OAAO;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK primitive types that mirror Anthropic SDK structures
|
|
3
|
+
* These types pass through unchanged to the SDK
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Tool definition for Anthropic SDK
|
|
7
|
+
* Maps directly to Anthropic.Tool
|
|
8
|
+
*/
|
|
9
|
+
export interface Tool {
|
|
10
|
+
/** Tool name (must be unique within an agent) */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Human-readable description of what the tool does */
|
|
13
|
+
description: string;
|
|
14
|
+
/** JSON Schema describing the tool's input parameters */
|
|
15
|
+
input_schema: {
|
|
16
|
+
type: 'object';
|
|
17
|
+
properties: Record<string, unknown>;
|
|
18
|
+
required?: string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Tool result returned from tool execution
|
|
23
|
+
*/
|
|
24
|
+
export interface ToolResult {
|
|
25
|
+
type: 'tool_result';
|
|
26
|
+
tool_use_id: string;
|
|
27
|
+
content: string | unknown;
|
|
28
|
+
is_error?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* MCP Server configuration
|
|
32
|
+
* Supports stdio and inprocess transports
|
|
33
|
+
*/
|
|
34
|
+
export interface MCPServer {
|
|
35
|
+
/** Server name for identification */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Server version (optional) */
|
|
38
|
+
version?: string;
|
|
39
|
+
/** Transport type */
|
|
40
|
+
transport: 'stdio' | 'inprocess';
|
|
41
|
+
/** Command to run for stdio transport */
|
|
42
|
+
command?: string;
|
|
43
|
+
/** Arguments for the command */
|
|
44
|
+
args?: string[];
|
|
45
|
+
/** Tools provided by this MCP server */
|
|
46
|
+
tools?: Tool[];
|
|
47
|
+
/** Environment variables for the MCP process */
|
|
48
|
+
env?: Record<string, string>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Skill definition
|
|
52
|
+
* Skills are loaded from directories containing SKILL.md
|
|
53
|
+
*/
|
|
54
|
+
export interface Skill {
|
|
55
|
+
/** Skill name for identification */
|
|
56
|
+
name: string;
|
|
57
|
+
/** Path to skill directory containing SKILL.md */
|
|
58
|
+
path: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Hook handler function type
|
|
62
|
+
*/
|
|
63
|
+
export type HookHandler<T = unknown> = (context: T) => Promise<void> | void;
|
|
64
|
+
/**
|
|
65
|
+
* Pre-tool use hook context
|
|
66
|
+
*/
|
|
67
|
+
export interface PreToolUseContext {
|
|
68
|
+
toolName: string;
|
|
69
|
+
toolInput: unknown;
|
|
70
|
+
agentId: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Post-tool use hook context
|
|
74
|
+
*/
|
|
75
|
+
export interface PostToolUseContext {
|
|
76
|
+
toolName: string;
|
|
77
|
+
toolInput: unknown;
|
|
78
|
+
toolOutput: unknown;
|
|
79
|
+
agentId: string;
|
|
80
|
+
duration: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Session start hook context
|
|
84
|
+
*/
|
|
85
|
+
export interface SessionStartContext {
|
|
86
|
+
agentId: string;
|
|
87
|
+
agentName?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Session end hook context
|
|
91
|
+
*/
|
|
92
|
+
export interface SessionEndContext {
|
|
93
|
+
agentId: string;
|
|
94
|
+
agentName?: string;
|
|
95
|
+
totalDuration: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Agent lifecycle hooks
|
|
99
|
+
* Maps to Anthropic SDK hook conventions
|
|
100
|
+
*/
|
|
101
|
+
export interface AgentHooks {
|
|
102
|
+
/** Called before each tool invocation */
|
|
103
|
+
preToolUse?: HookHandler<PreToolUseContext>[];
|
|
104
|
+
/** Called after each tool invocation */
|
|
105
|
+
postToolUse?: HookHandler<PostToolUseContext>[];
|
|
106
|
+
/** Called when agent session starts */
|
|
107
|
+
sessionStart?: HookHandler<SessionStartContext>[];
|
|
108
|
+
/** Called when agent session ends */
|
|
109
|
+
sessionEnd?: HookHandler<SessionEndContext>[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Token usage information from API response
|
|
113
|
+
*/
|
|
114
|
+
export interface TokenUsage {
|
|
115
|
+
input_tokens: number;
|
|
116
|
+
output_tokens: number;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=sdk-primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-primitives.d.ts","sourceRoot":"","sources":["../../src/types/sdk-primitives.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,SAAS,EAAE,OAAO,GAAG,WAAW,CAAC;IACjC,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,wCAAwC;IACxC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,UAAU,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAC9C,wCAAwC;IACxC,WAAW,CAAC,EAAE,WAAW,CAAC,kBAAkB,CAAC,EAAE,CAAC;IAChD,uCAAuC;IACvC,YAAY,CAAC,EAAE,WAAW,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAClD,qCAAqC;IACrC,UAAU,CAAC,EAAE,WAAW,CAAC,iBAAiB,CAAC,EAAE,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-primitives.js","sourceRoot":"","sources":["../../src/types/sdk-primitives.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Serialized workflow state as key-value pairs
|
|
3
3
|
*/
|
|
4
4
|
export type SerializedWorkflowState = Record<string, unknown>;
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* Metadata for observed state fields
|
|
8
7
|
*/
|
|
9
8
|
export interface StateFieldMetadata {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/** If true, field is not included in snapshots */
|
|
10
|
+
hidden?: boolean;
|
|
11
|
+
/** If true, value is shown as '***' in snapshots */
|
|
12
|
+
redact?: boolean;
|
|
14
13
|
}
|
|
14
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../src/types/snapshot.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/types/snapshot.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowContext - Interface for functional workflow execution
|
|
3
|
+
*
|
|
4
|
+
* Provides step(), spawnWorkflow(), and other methods for
|
|
5
|
+
* composing workflows in arbitrary JavaScript control flow.
|
|
6
|
+
*/
|
|
7
|
+
import type { WorkflowNode } from './workflow.js';
|
|
8
|
+
import type { ReflectionAPI } from './reflection.js';
|
|
9
|
+
export type { ReflectionAPI } from './reflection.js';
|
|
10
|
+
/**
|
|
11
|
+
* Handle for querying the event tree
|
|
12
|
+
*/
|
|
13
|
+
export interface EventTreeHandle {
|
|
14
|
+
/** Root node of the event tree */
|
|
15
|
+
readonly root: EventNode;
|
|
16
|
+
/**
|
|
17
|
+
* Get a node by ID
|
|
18
|
+
* @param id Node ID to find
|
|
19
|
+
*/
|
|
20
|
+
getNode(id: string): EventNode | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Get all children of a node
|
|
23
|
+
* @param id Parent node ID
|
|
24
|
+
*/
|
|
25
|
+
getChildren(id: string): EventNode[];
|
|
26
|
+
/**
|
|
27
|
+
* Get all ancestors of a node (from node up to root)
|
|
28
|
+
* @param id Node ID
|
|
29
|
+
*/
|
|
30
|
+
getAncestors(id: string): EventNode[];
|
|
31
|
+
/**
|
|
32
|
+
* Export tree as JSON
|
|
33
|
+
*/
|
|
34
|
+
toJSON(): EventNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Event node in the queryable tree
|
|
38
|
+
*/
|
|
39
|
+
export interface EventNode {
|
|
40
|
+
id: string;
|
|
41
|
+
type: string;
|
|
42
|
+
timestamp: number;
|
|
43
|
+
name?: string;
|
|
44
|
+
payload?: unknown;
|
|
45
|
+
metrics?: EventMetrics;
|
|
46
|
+
parentId?: string;
|
|
47
|
+
children: EventNode[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Metrics associated with an event node
|
|
51
|
+
*/
|
|
52
|
+
export interface EventMetrics {
|
|
53
|
+
duration?: number;
|
|
54
|
+
tokenUsage?: {
|
|
55
|
+
input: number;
|
|
56
|
+
output: number;
|
|
57
|
+
};
|
|
58
|
+
toolCalls?: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Agent interface for context revision (minimal to avoid circular deps)
|
|
62
|
+
*/
|
|
63
|
+
export interface AgentLike {
|
|
64
|
+
prompt<T>(prompt: PromptLike<T>): Promise<T>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Prompt interface for context revision (minimal to avoid circular deps)
|
|
68
|
+
*/
|
|
69
|
+
export interface PromptLike<T> {
|
|
70
|
+
id: string;
|
|
71
|
+
buildUserMessage(): string;
|
|
72
|
+
validateResponse(data: unknown): T;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* WorkflowContext - Available within functional workflow executor
|
|
76
|
+
*/
|
|
77
|
+
export interface WorkflowContext {
|
|
78
|
+
/** Unique ID of this workflow */
|
|
79
|
+
readonly workflowId: string;
|
|
80
|
+
/** Parent workflow ID if nested */
|
|
81
|
+
readonly parentWorkflowId?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Execute a named step
|
|
84
|
+
* Can be called anywhere in JavaScript control flow (loops, conditionals, etc.)
|
|
85
|
+
*
|
|
86
|
+
* @param name Step name for logging and debugging
|
|
87
|
+
* @param fn Step function to execute
|
|
88
|
+
* @returns Result of the step function
|
|
89
|
+
*/
|
|
90
|
+
step<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
91
|
+
/**
|
|
92
|
+
* Spawn a child workflow
|
|
93
|
+
* The child workflow is automatically attached to this workflow's tree
|
|
94
|
+
*
|
|
95
|
+
* @param workflow Workflow instance to spawn
|
|
96
|
+
* @returns Result of the child workflow
|
|
97
|
+
*/
|
|
98
|
+
spawnWorkflow<T>(workflow: {
|
|
99
|
+
run(): Promise<T>;
|
|
100
|
+
}): Promise<T>;
|
|
101
|
+
/**
|
|
102
|
+
* Replace the last prompt result with a new one (context revision)
|
|
103
|
+
* The previous prompt node is marked as 'revised' and the new result is attached as sibling
|
|
104
|
+
*
|
|
105
|
+
* @param newPrompt The new prompt to execute
|
|
106
|
+
* @param agent The agent to use for execution
|
|
107
|
+
* @returns Result of the new prompt
|
|
108
|
+
*/
|
|
109
|
+
replaceLastPromptResult<T>(newPrompt: PromptLike<T>, agent: AgentLike): Promise<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Access to the event tree for this workflow
|
|
112
|
+
*/
|
|
113
|
+
readonly eventTree: EventTreeHandle;
|
|
114
|
+
/**
|
|
115
|
+
* Reflection API for error handling and retry logic
|
|
116
|
+
*/
|
|
117
|
+
readonly reflection: ReflectionAPI;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Configuration for creating a functional workflow
|
|
121
|
+
*/
|
|
122
|
+
export interface WorkflowConfig {
|
|
123
|
+
/** Human-readable workflow name */
|
|
124
|
+
name?: string;
|
|
125
|
+
/** Enable reflection for this workflow */
|
|
126
|
+
enableReflection?: boolean;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Result from workflow execution
|
|
130
|
+
*/
|
|
131
|
+
export interface WorkflowResult<T = unknown> {
|
|
132
|
+
/** The result value */
|
|
133
|
+
data: T;
|
|
134
|
+
/** The workflow node */
|
|
135
|
+
node: WorkflowNode;
|
|
136
|
+
/** Total duration in milliseconds */
|
|
137
|
+
duration: number;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=workflow-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-context.d.ts","sourceRoot":"","sources":["../../src/types/workflow-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;IAE3C;;;OAGG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;IAErC;;;OAGG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;IAEtC;;OAEG;IACH,MAAM,IAAI,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,gBAAgB,IAAI,MAAM,CAAC;IAC3B,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B,mCAAmC;IACnC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAEnC;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE;QAAE,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE9D;;;;;;;OAOG;IACH,uBAAuB,CAAC,CAAC,EACvB,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EACxB,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,CAAC,CAAC,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC;IAER,wBAAwB;IACxB,IAAI,EAAE,YAAY,CAAC;IAEnB,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-context.js","sourceRoot":"","sources":["../../src/types/workflow-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow status representing the current execution state
|
|
3
|
+
*/
|
|
4
|
+
export type WorkflowStatus = 'idle' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
5
|
+
import type { LogEntry } from './logging.js';
|
|
6
|
+
import type { WorkflowEvent } from './events.js';
|
|
7
|
+
import type { SerializedWorkflowState } from './snapshot.js';
|
|
8
|
+
/**
|
|
9
|
+
* Represents a node in the workflow execution tree
|
|
10
|
+
* This is the data structure, not the Workflow class
|
|
11
|
+
*/
|
|
12
|
+
export interface WorkflowNode {
|
|
13
|
+
/** Unique identifier for this workflow instance */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Human-readable name */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Parent node reference (null for root) */
|
|
18
|
+
parent: WorkflowNode | null;
|
|
19
|
+
/** Child workflow nodes */
|
|
20
|
+
children: WorkflowNode[];
|
|
21
|
+
/** Current execution status */
|
|
22
|
+
status: WorkflowStatus;
|
|
23
|
+
/** Log entries for this node */
|
|
24
|
+
logs: LogEntry[];
|
|
25
|
+
/** Events emitted by this node */
|
|
26
|
+
events: WorkflowEvent[];
|
|
27
|
+
/** Optional serialized state snapshot */
|
|
28
|
+
stateSnapshot: SerializedWorkflowState | null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/types/workflow.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,CAAC;AAGhB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,mDAAmD;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,2BAA2B;IAC3B,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,+BAA+B;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,gCAAgC;IAChC,IAAI,EAAE,QAAQ,EAAE,CAAC;IACjB,kCAAkC;IAClC,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,yCAAyC;IACzC,aAAa,EAAE,uBAAuB,GAAG,IAAI,CAAC;CAC/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/types/workflow.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAMnC"}
|
package/dist/utils/id.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a unique identifier
|
|
3
|
+
* Uses crypto.randomUUID if available, falls back to timestamp + random
|
|
4
|
+
*/
|
|
5
|
+
export function generateId() {
|
|
6
|
+
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
7
|
+
return crypto.randomUUID();
|
|
8
|
+
}
|
|
9
|
+
// Fallback for environments without crypto.randomUUID
|
|
10
|
+
return `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 11)}`;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,UAAU;IACxB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IACD,sDAAsD;IACtD,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
|