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,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Introspection Tools - Standard tools for agents to inspect their workflow hierarchy
|
|
3
|
+
*
|
|
4
|
+
* These tools allow agents to understand their position in the workflow tree,
|
|
5
|
+
* access prior outputs, check cache status, and request dynamic workflow spawning.
|
|
6
|
+
*/
|
|
7
|
+
import { getExecutionContext } from '../core/context.js';
|
|
8
|
+
import { defaultCache } from '../cache/index.js';
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Tool Definitions (Anthropic Tool format)
|
|
11
|
+
// ============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Tool: inspect_current_node
|
|
14
|
+
* Returns information about the current workflow node
|
|
15
|
+
*/
|
|
16
|
+
export const inspectCurrentNodeTool = {
|
|
17
|
+
name: 'inspect_current_node',
|
|
18
|
+
description: 'Get information about the current workflow node including ID, name, status, and parent reference',
|
|
19
|
+
input_schema: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {},
|
|
22
|
+
required: [],
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Tool: read_ancestor_chain
|
|
27
|
+
* Returns all ancestor nodes from current position up to root
|
|
28
|
+
*/
|
|
29
|
+
export const readAncestorChainTool = {
|
|
30
|
+
name: 'read_ancestor_chain',
|
|
31
|
+
description: 'Get all ancestor nodes from current position up to the root workflow',
|
|
32
|
+
input_schema: {
|
|
33
|
+
type: 'object',
|
|
34
|
+
properties: {
|
|
35
|
+
maxDepth: {
|
|
36
|
+
type: 'number',
|
|
37
|
+
description: 'Maximum ancestors to return (default: all)',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
required: [],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Tool: list_siblings_children
|
|
45
|
+
* Returns sibling or child nodes relative to current position
|
|
46
|
+
*/
|
|
47
|
+
export const listSiblingsChildrenTool = {
|
|
48
|
+
name: 'list_siblings_children',
|
|
49
|
+
description: 'List sibling or child nodes relative to current position',
|
|
50
|
+
input_schema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
type: {
|
|
54
|
+
type: 'string',
|
|
55
|
+
enum: ['siblings', 'children'],
|
|
56
|
+
description: 'Type of nodes to list',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: ['type'],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Tool: inspect_prior_outputs
|
|
64
|
+
* Returns outputs from prior steps or prompt executions
|
|
65
|
+
*/
|
|
66
|
+
export const inspectPriorOutputsTool = {
|
|
67
|
+
name: 'inspect_prior_outputs',
|
|
68
|
+
description: 'Get outputs from prior steps or prompt executions',
|
|
69
|
+
input_schema: {
|
|
70
|
+
type: 'object',
|
|
71
|
+
properties: {
|
|
72
|
+
nodeId: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'Specific node ID to inspect (default: most recent)',
|
|
75
|
+
},
|
|
76
|
+
count: {
|
|
77
|
+
type: 'number',
|
|
78
|
+
description: 'Number of prior outputs to return (default: 1)',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
required: [],
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Tool: inspect_cache_status
|
|
86
|
+
* Checks if a prompt response is cached
|
|
87
|
+
*/
|
|
88
|
+
export const inspectCacheStatusTool = {
|
|
89
|
+
name: 'inspect_cache_status',
|
|
90
|
+
description: 'Check if a prompt response is cached',
|
|
91
|
+
input_schema: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
promptHash: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'Hash of the prompt to check',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ['promptHash'],
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Tool: request_spawn_workflow
|
|
104
|
+
* Requests to spawn a new child workflow dynamically
|
|
105
|
+
*/
|
|
106
|
+
export const requestSpawnWorkflowTool = {
|
|
107
|
+
name: 'request_spawn_workflow',
|
|
108
|
+
description: 'Request to spawn a new child workflow dynamically',
|
|
109
|
+
input_schema: {
|
|
110
|
+
type: 'object',
|
|
111
|
+
properties: {
|
|
112
|
+
name: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'Name for the new workflow',
|
|
115
|
+
},
|
|
116
|
+
description: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
description: 'Description of what the workflow should do',
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
required: ['name', 'description'],
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
// ============================================================================
|
|
125
|
+
// Tool Handlers
|
|
126
|
+
// ============================================================================
|
|
127
|
+
/**
|
|
128
|
+
* Calculate depth of a node in the tree
|
|
129
|
+
*/
|
|
130
|
+
function calculateDepth(node) {
|
|
131
|
+
let depth = 0;
|
|
132
|
+
let current = node.parent;
|
|
133
|
+
while (current) {
|
|
134
|
+
depth++;
|
|
135
|
+
current = current.parent;
|
|
136
|
+
}
|
|
137
|
+
return depth;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Handler for inspect_current_node
|
|
141
|
+
*/
|
|
142
|
+
export async function handleInspectCurrentNode() {
|
|
143
|
+
const ctx = getExecutionContext();
|
|
144
|
+
if (!ctx) {
|
|
145
|
+
throw new Error('Not in workflow context - cannot inspect current node');
|
|
146
|
+
}
|
|
147
|
+
const node = ctx.workflowNode;
|
|
148
|
+
const depth = calculateDepth(node);
|
|
149
|
+
return {
|
|
150
|
+
id: node.id,
|
|
151
|
+
name: node.name,
|
|
152
|
+
status: node.status,
|
|
153
|
+
parentId: node.parent?.id,
|
|
154
|
+
parentName: node.parent?.name,
|
|
155
|
+
childCount: node.children.length,
|
|
156
|
+
depth,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Handler for read_ancestor_chain
|
|
161
|
+
*/
|
|
162
|
+
export async function handleReadAncestorChain(input) {
|
|
163
|
+
const ctx = getExecutionContext();
|
|
164
|
+
if (!ctx) {
|
|
165
|
+
throw new Error('Not in workflow context - cannot read ancestor chain');
|
|
166
|
+
}
|
|
167
|
+
const ancestors = [];
|
|
168
|
+
let current = ctx.workflowNode.parent;
|
|
169
|
+
let depth = 1;
|
|
170
|
+
const maxDepth = input.maxDepth ?? Infinity;
|
|
171
|
+
while (current && depth <= maxDepth) {
|
|
172
|
+
ancestors.push({
|
|
173
|
+
id: current.id,
|
|
174
|
+
name: current.name,
|
|
175
|
+
status: current.status,
|
|
176
|
+
depth,
|
|
177
|
+
});
|
|
178
|
+
current = current.parent;
|
|
179
|
+
depth++;
|
|
180
|
+
}
|
|
181
|
+
return {
|
|
182
|
+
ancestors,
|
|
183
|
+
totalDepth: calculateDepth(ctx.workflowNode),
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Handler for list_siblings_children
|
|
188
|
+
*/
|
|
189
|
+
export async function handleListSiblingsChildren(input) {
|
|
190
|
+
const ctx = getExecutionContext();
|
|
191
|
+
if (!ctx) {
|
|
192
|
+
throw new Error('Not in workflow context - cannot list siblings/children');
|
|
193
|
+
}
|
|
194
|
+
const node = ctx.workflowNode;
|
|
195
|
+
let nodes;
|
|
196
|
+
if (input.type === 'children') {
|
|
197
|
+
nodes = node.children;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
// Get siblings (other children of parent, excluding self)
|
|
201
|
+
nodes = node.parent?.children.filter((n) => n.id !== node.id) ?? [];
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
type: input.type,
|
|
205
|
+
nodes: nodes.map((n) => ({
|
|
206
|
+
id: n.id,
|
|
207
|
+
name: n.name,
|
|
208
|
+
status: n.status,
|
|
209
|
+
})),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Handler for inspect_prior_outputs
|
|
214
|
+
*/
|
|
215
|
+
export async function handleInspectPriorOutputs(input) {
|
|
216
|
+
const ctx = getExecutionContext();
|
|
217
|
+
if (!ctx) {
|
|
218
|
+
throw new Error('Not in workflow context - cannot inspect prior outputs');
|
|
219
|
+
}
|
|
220
|
+
const count = input.count ?? 1;
|
|
221
|
+
const node = ctx.workflowNode;
|
|
222
|
+
// Get completed children nodes
|
|
223
|
+
const completedNodes = node.parent?.children
|
|
224
|
+
.filter((n) => n.status === 'completed' && n.id !== node.id)
|
|
225
|
+
.slice(-count) ?? [];
|
|
226
|
+
// If specific nodeId requested, filter to just that
|
|
227
|
+
if (input.nodeId) {
|
|
228
|
+
const specific = completedNodes.find((n) => n.id === input.nodeId);
|
|
229
|
+
if (!specific) {
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
return [
|
|
233
|
+
{
|
|
234
|
+
nodeId: specific.id,
|
|
235
|
+
nodeName: specific.name,
|
|
236
|
+
status: specific.status,
|
|
237
|
+
events: specific.events,
|
|
238
|
+
},
|
|
239
|
+
];
|
|
240
|
+
}
|
|
241
|
+
return completedNodes.map((n) => ({
|
|
242
|
+
nodeId: n.id,
|
|
243
|
+
nodeName: n.name,
|
|
244
|
+
status: n.status,
|
|
245
|
+
events: n.events,
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Handler for inspect_cache_status
|
|
250
|
+
*/
|
|
251
|
+
export async function handleInspectCacheStatus(input) {
|
|
252
|
+
const exists = defaultCache.has(input.promptHash);
|
|
253
|
+
return {
|
|
254
|
+
exists,
|
|
255
|
+
key: input.promptHash,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Handler for request_spawn_workflow
|
|
260
|
+
* Note: This creates a spawn request that must be handled by the workflow orchestrator
|
|
261
|
+
*/
|
|
262
|
+
export async function handleRequestSpawnWorkflow(input) {
|
|
263
|
+
const ctx = getExecutionContext();
|
|
264
|
+
if (!ctx) {
|
|
265
|
+
throw new Error('Not in workflow context - cannot request spawn');
|
|
266
|
+
}
|
|
267
|
+
// Create a spawn request ID
|
|
268
|
+
const requestId = `spawn-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
269
|
+
// Return the request - actual spawning is handled by the orchestrator
|
|
270
|
+
return {
|
|
271
|
+
name: input.name,
|
|
272
|
+
description: input.description,
|
|
273
|
+
requestId,
|
|
274
|
+
status: 'pending',
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
// ============================================================================
|
|
278
|
+
// Tool Bundle and Registration
|
|
279
|
+
// ============================================================================
|
|
280
|
+
/**
|
|
281
|
+
* All introspection tools bundled together
|
|
282
|
+
*/
|
|
283
|
+
export const INTROSPECTION_TOOLS = [
|
|
284
|
+
inspectCurrentNodeTool,
|
|
285
|
+
readAncestorChainTool,
|
|
286
|
+
listSiblingsChildrenTool,
|
|
287
|
+
inspectPriorOutputsTool,
|
|
288
|
+
inspectCacheStatusTool,
|
|
289
|
+
requestSpawnWorkflowTool,
|
|
290
|
+
];
|
|
291
|
+
/**
|
|
292
|
+
* Map of tool names to handlers
|
|
293
|
+
*/
|
|
294
|
+
export const INTROSPECTION_HANDLERS = {
|
|
295
|
+
inspect_current_node: handleInspectCurrentNode,
|
|
296
|
+
read_ancestor_chain: handleReadAncestorChain,
|
|
297
|
+
list_siblings_children: handleListSiblingsChildren,
|
|
298
|
+
inspect_prior_outputs: handleInspectPriorOutputs,
|
|
299
|
+
inspect_cache_status: handleInspectCacheStatus,
|
|
300
|
+
request_spawn_workflow: handleRequestSpawnWorkflow,
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Register all introspection tools with an MCP handler
|
|
304
|
+
* @param handler MCP handler to register tools with
|
|
305
|
+
*/
|
|
306
|
+
export function registerIntrospectionTools(handler) {
|
|
307
|
+
for (const [name, executor] of Object.entries(INTROSPECTION_HANDLERS)) {
|
|
308
|
+
handler.registerTool(name, executor);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Execute an introspection tool by name
|
|
313
|
+
* @param toolName Name of the tool to execute
|
|
314
|
+
* @param input Tool input
|
|
315
|
+
* @returns Tool result
|
|
316
|
+
*/
|
|
317
|
+
export async function executeIntrospectionTool(toolName, input) {
|
|
318
|
+
const handler = INTROSPECTION_HANDLERS[toolName];
|
|
319
|
+
if (!handler) {
|
|
320
|
+
throw new Error(`Unknown introspection tool: ${toolName}`);
|
|
321
|
+
}
|
|
322
|
+
return handler(input);
|
|
323
|
+
}
|
|
324
|
+
//# sourceMappingURL=introspection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"introspection.js","sourceRoot":"","sources":["../../src/tools/introspection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA8EjD,+EAA+E;AAC/E,2CAA2C;AAC3C,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAS;IAC1C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,kGAAkG;IACpG,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAS;IACzC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,sEAAsE;IACnF,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,4CAA4C;aAC1D;SACF;QACD,QAAQ,EAAE,EAAE;KACb;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAS;IAC5C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,0DAA0D;IACvE,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAA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E,0BAEH;IACrB,qBAAqB,EAAE,yBAEF;IACrB,oBAAoB,EAAE,wBAED;IACrB,sBAAsB,EAAE,0BAEH;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAE1C;IACC,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,sBAAsB,CAAC,EAAE,CAAC;QACtE,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,QAAgB,EAChB,KAAc;IAEd,MAAM,OAAO,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,+BAA+B,QAAQ,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent configuration and override types
|
|
3
|
+
* All properties map 1:1 to Anthropic SDK
|
|
4
|
+
*/
|
|
5
|
+
import type { Tool, MCPServer, Skill, AgentHooks } from './sdk-primitives.js';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for creating an Agent instance
|
|
8
|
+
* All Anthropic SDK properties pass through unchanged
|
|
9
|
+
*/
|
|
10
|
+
export interface AgentConfig {
|
|
11
|
+
/** Human-readable name for the agent */
|
|
12
|
+
name?: string;
|
|
13
|
+
/** System prompt for the agent */
|
|
14
|
+
system?: string;
|
|
15
|
+
/** Tools available to the agent */
|
|
16
|
+
tools?: Tool[];
|
|
17
|
+
/** MCP servers to connect */
|
|
18
|
+
mcps?: MCPServer[];
|
|
19
|
+
/** Skills to load */
|
|
20
|
+
skills?: Skill[];
|
|
21
|
+
/** Lifecycle hooks */
|
|
22
|
+
hooks?: AgentHooks;
|
|
23
|
+
/** Environment variables for agent execution */
|
|
24
|
+
env?: Record<string, string>;
|
|
25
|
+
/** Enable reflection capability for this agent */
|
|
26
|
+
enableReflection?: boolean;
|
|
27
|
+
/** Enable caching of prompt responses */
|
|
28
|
+
enableCache?: boolean;
|
|
29
|
+
/** Model to use (defaults to claude-sonnet-4-20250514) */
|
|
30
|
+
model?: string;
|
|
31
|
+
/** Maximum tokens for responses */
|
|
32
|
+
maxTokens?: number;
|
|
33
|
+
/** Temperature for response generation */
|
|
34
|
+
temperature?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Overrides that can be applied at the prompt level
|
|
38
|
+
* Takes precedence over AgentConfig values
|
|
39
|
+
*/
|
|
40
|
+
export interface PromptOverrides {
|
|
41
|
+
/** Override system prompt for this prompt */
|
|
42
|
+
system?: string;
|
|
43
|
+
/** Override tools for this prompt */
|
|
44
|
+
tools?: Tool[];
|
|
45
|
+
/** Override MCPs for this prompt */
|
|
46
|
+
mcps?: MCPServer[];
|
|
47
|
+
/** Override skills for this prompt */
|
|
48
|
+
skills?: Skill[];
|
|
49
|
+
/** Override hooks for this prompt */
|
|
50
|
+
hooks?: AgentHooks;
|
|
51
|
+
/** Override environment variables */
|
|
52
|
+
env?: Record<string, string>;
|
|
53
|
+
/** Override temperature */
|
|
54
|
+
temperature?: number;
|
|
55
|
+
/** Override max tokens */
|
|
56
|
+
maxTokens?: number;
|
|
57
|
+
/** Stop sequences to use */
|
|
58
|
+
stop?: string[];
|
|
59
|
+
/** Disable cache for this prompt */
|
|
60
|
+
disableCache?: boolean;
|
|
61
|
+
/** Enable reflection for this prompt */
|
|
62
|
+
enableReflection?: boolean;
|
|
63
|
+
/** Override model for this prompt */
|
|
64
|
+
model?: string;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/types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C,CAAC;IAE7B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,oCAAoC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ErrorMergeStrategy } from './error-strategy.js';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for @Step decorator
|
|
4
|
+
*/
|
|
5
|
+
export interface StepOptions {
|
|
6
|
+
/** Custom step name (defaults to method name) */
|
|
7
|
+
name?: string;
|
|
8
|
+
/** If true, capture state snapshot after step completion */
|
|
9
|
+
snapshotState?: boolean;
|
|
10
|
+
/** Track and emit step duration (default: true) */
|
|
11
|
+
trackTiming?: boolean;
|
|
12
|
+
/** If true, log message at step start */
|
|
13
|
+
logStart?: boolean;
|
|
14
|
+
/** If true, log message at step end */
|
|
15
|
+
logFinish?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Configuration options for @Task decorator
|
|
19
|
+
*
|
|
20
|
+
* @note The decorator uses lenient validation - non-Workflow returns are
|
|
21
|
+
* silently skipped. See the @Task decorator JSDoc for details.
|
|
22
|
+
*/
|
|
23
|
+
export interface TaskOptions {
|
|
24
|
+
/** Custom task name (defaults to method name) */
|
|
25
|
+
name?: string;
|
|
26
|
+
/** If true, run returned workflows concurrently */
|
|
27
|
+
concurrent?: boolean;
|
|
28
|
+
/** Strategy for merging errors from concurrent task execution */
|
|
29
|
+
errorMergeStrategy?: ErrorMergeStrategy;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=decorators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/types/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mDAAmD;IACnD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/types/decorators.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WorkflowError } from './error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Strategy for merging multiple errors from concurrent operations
|
|
4
|
+
*/
|
|
5
|
+
export interface ErrorMergeStrategy {
|
|
6
|
+
/** Enable error merging (default: false, first error wins) */
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
/** Maximum depth to merge errors */
|
|
9
|
+
maxMergeDepth?: number;
|
|
10
|
+
/** Custom function to combine multiple errors */
|
|
11
|
+
combine?(errors: WorkflowError[]): WorkflowError;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=error-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-strategy.d.ts","sourceRoot":"","sources":["../../src/types/error-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,OAAO,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-strategy.js","sourceRoot":"","sources":["../../src/types/error-strategy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LogEntry } from './logging.js';
|
|
2
|
+
import type { SerializedWorkflowState } from './snapshot.js';
|
|
3
|
+
/**
|
|
4
|
+
* Rich error object containing workflow context
|
|
5
|
+
*/
|
|
6
|
+
export interface WorkflowError {
|
|
7
|
+
/** Error message */
|
|
8
|
+
message: string;
|
|
9
|
+
/** Original thrown error */
|
|
10
|
+
original: unknown;
|
|
11
|
+
/** ID of workflow where error occurred */
|
|
12
|
+
workflowId: string;
|
|
13
|
+
/** Stack trace if available */
|
|
14
|
+
stack?: string;
|
|
15
|
+
/** State snapshot at time of error */
|
|
16
|
+
state: SerializedWorkflowState;
|
|
17
|
+
/** Logs from the failing workflow node */
|
|
18
|
+
logs: LogEntry[];
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,KAAK,EAAE,uBAAuB,CAAC;IAC/B,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/types/error.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { WorkflowNode } from './workflow.js';
|
|
2
|
+
import type { WorkflowError } from './error.js';
|
|
3
|
+
import type { TokenUsage } from './sdk-primitives.js';
|
|
4
|
+
/**
|
|
5
|
+
* Discriminated union of all workflow events
|
|
6
|
+
*/
|
|
7
|
+
export type WorkflowEvent = {
|
|
8
|
+
type: 'childAttached';
|
|
9
|
+
parentId: string;
|
|
10
|
+
child: WorkflowNode;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'childDetached';
|
|
13
|
+
parentId: string;
|
|
14
|
+
childId: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'stateSnapshot';
|
|
17
|
+
node: WorkflowNode;
|
|
18
|
+
} | {
|
|
19
|
+
type: 'stepStart';
|
|
20
|
+
node: WorkflowNode;
|
|
21
|
+
step: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'stepEnd';
|
|
24
|
+
node: WorkflowNode;
|
|
25
|
+
step: string;
|
|
26
|
+
duration: number;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'error';
|
|
29
|
+
node: WorkflowNode;
|
|
30
|
+
error: WorkflowError;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'taskStart';
|
|
33
|
+
node: WorkflowNode;
|
|
34
|
+
task: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: 'taskEnd';
|
|
37
|
+
node: WorkflowNode;
|
|
38
|
+
task: string;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'treeUpdated';
|
|
41
|
+
root: WorkflowNode;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'agentPromptStart';
|
|
44
|
+
agentId: string;
|
|
45
|
+
agentName: string;
|
|
46
|
+
promptId: string;
|
|
47
|
+
node: WorkflowNode;
|
|
48
|
+
} | {
|
|
49
|
+
type: 'agentPromptEnd';
|
|
50
|
+
agentId: string;
|
|
51
|
+
agentName: string;
|
|
52
|
+
promptId: string;
|
|
53
|
+
node: WorkflowNode;
|
|
54
|
+
duration: number;
|
|
55
|
+
tokenUsage?: TokenUsage;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'toolInvocation';
|
|
58
|
+
toolName: string;
|
|
59
|
+
input: unknown;
|
|
60
|
+
output: unknown;
|
|
61
|
+
duration: number;
|
|
62
|
+
node: WorkflowNode;
|
|
63
|
+
} | {
|
|
64
|
+
type: 'mcpEvent';
|
|
65
|
+
serverName: string;
|
|
66
|
+
event: string;
|
|
67
|
+
payload?: unknown;
|
|
68
|
+
node: WorkflowNode;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'reflectionStart';
|
|
71
|
+
level: 'workflow' | 'agent' | 'prompt';
|
|
72
|
+
node: WorkflowNode;
|
|
73
|
+
} | {
|
|
74
|
+
type: 'reflectionEnd';
|
|
75
|
+
level: 'workflow' | 'agent' | 'prompt';
|
|
76
|
+
success: boolean;
|
|
77
|
+
node: WorkflowNode;
|
|
78
|
+
} | {
|
|
79
|
+
type: 'cacheHit';
|
|
80
|
+
key: string;
|
|
81
|
+
node: WorkflowNode;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'cacheMiss';
|
|
84
|
+
key: string;
|
|
85
|
+
node: WorkflowNode;
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=events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-0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type { WorkflowStatus, WorkflowNode } from './workflow.js';
|
|
2
|
+
export type { LogLevel, LogEntry } from './logging.js';
|
|
3
|
+
export type { SerializedWorkflowState, StateFieldMetadata } from './snapshot.js';
|
|
4
|
+
export type { WorkflowError } from './error.js';
|
|
5
|
+
export type { WorkflowEvent } from './events.js';
|
|
6
|
+
export type { WorkflowObserver } from './observer.js';
|
|
7
|
+
export type { StepOptions, TaskOptions } from './decorators.js';
|
|
8
|
+
export type { ErrorMergeStrategy } from './error-strategy.js';
|
|
9
|
+
export type { Tool, ToolResult, MCPServer, Skill, HookHandler, PreToolUseContext, PostToolUseContext, SessionStartContext, SessionEndContext, AgentHooks, TokenUsage, } from './sdk-primitives.js';
|
|
10
|
+
export type { AgentConfig, PromptOverrides } from './agent.js';
|
|
11
|
+
export type { PromptConfig } from './prompt.js';
|
|
12
|
+
export type { WorkflowContext, WorkflowConfig, WorkflowResult, EventTreeHandle, EventNode, EventMetrics, AgentLike, PromptLike, } from './workflow-context.js';
|
|
13
|
+
export type { ReflectionAPI, ReflectionConfig, ReflectionContext, ReflectionResult, ReflectionEntry, } from './reflection.js';
|
|
14
|
+
export { DEFAULT_REFLECTION_CONFIG, createReflectionConfig, } from './reflection.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACjF,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,YAAY,EACV,IAAI,EACJ,UAAU,EACV,SAAS,EACT,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,UAAU,GACX,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG/D,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,YAAY,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,SAAS,EACT,YAAY,EACZ,SAAS,EACT,UAAU,GACX,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAmDA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
|