groundswell 0.0.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +26 -9
- package/dist/cache/cache-key.d.ts +86 -0
- package/dist/cache/cache-key.d.ts.map +1 -0
- package/dist/cache/cache-key.js +204 -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 +203 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +833 -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 +127 -0
- package/dist/core/mcp-handler.d.ts.map +1 -0
- package/dist/core/mcp-handler.js +323 -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 +61 -0
- package/dist/core/workflow-context.d.ts.map +1 -0
- package/dist/core/workflow-context.js +358 -0
- package/dist/core/workflow-context.js.map +1 -0
- package/dist/core/workflow.d.ts +543 -0
- package/dist/core/workflow.d.ts.map +1 -0
- package/dist/core/workflow.js +986 -0
- package/dist/core/workflow.js.map +1 -0
- package/dist/debugger/event-replayer.d.ts +422 -0
- package/dist/debugger/event-replayer.d.ts.map +1 -0
- package/dist/debugger/event-replayer.js +639 -0
- package/dist/debugger/event-replayer.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 +240 -0
- package/dist/debugger/tree-debugger.d.ts.map +1 -0
- package/dist/debugger/tree-debugger.js +620 -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 +192 -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/harnesses/claude-code-harness.d.ts +391 -0
- package/dist/harnesses/claude-code-harness.d.ts.map +1 -0
- package/dist/harnesses/claude-code-harness.js +1076 -0
- package/dist/harnesses/claude-code-harness.js.map +1 -0
- package/dist/harnesses/harness-registry.d.ts +440 -0
- package/dist/harnesses/harness-registry.d.ts.map +1 -0
- package/dist/harnesses/harness-registry.js +543 -0
- package/dist/harnesses/harness-registry.js.map +1 -0
- package/dist/harnesses/index.d.ts +12 -0
- package/dist/harnesses/index.d.ts.map +1 -0
- package/dist/harnesses/index.js +11 -0
- package/dist/harnesses/index.js.map +1 -0
- package/dist/harnesses/pi-harness.d.ts +219 -0
- package/dist/harnesses/pi-harness.d.ts.map +1 -0
- package/dist/harnesses/pi-harness.js +676 -0
- package/dist/harnesses/pi-harness.js.map +1 -0
- package/dist/harnesses/pi-schema-converter.d.ts +24 -0
- package/dist/harnesses/pi-schema-converter.d.ts.map +1 -0
- package/dist/harnesses/pi-schema-converter.js +81 -0
- package/dist/harnesses/pi-schema-converter.js.map +1 -0
- package/dist/harnesses/register-defaults.d.ts +24 -0
- package/dist/harnesses/register-defaults.d.ts.map +1 -0
- package/dist/harnesses/register-defaults.js +40 -0
- package/dist/harnesses/register-defaults.js.map +1 -0
- package/dist/harnesses/session-store.d.ts +201 -0
- package/dist/harnesses/session-store.d.ts.map +1 -0
- package/dist/harnesses/session-store.js +254 -0
- package/dist/harnesses/session-store.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -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 +344 -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 +1317 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +423 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/decorators.d.ts +40 -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 +113 -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/harnesses.d.ts +474 -0
- package/dist/types/harnesses.d.ts.map +1 -0
- package/dist/types/harnesses.js +2 -0
- package/dist/types/harnesses.js.map +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -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/providers.d.ts +691 -0
- package/dist/types/providers.d.ts.map +1 -0
- package/dist/types/providers.js +14 -0
- package/dist/types/providers.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/restart.d.ts +132 -0
- package/dist/types/restart.d.ts.map +1 -0
- package/dist/types/restart.js +2 -0
- package/dist/types/restart.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/streaming.d.ts +194 -0
- package/dist/types/streaming.d.ts.map +1 -0
- package/dist/types/streaming.js +67 -0
- package/dist/types/streaming.js.map +1 -0
- package/dist/types/workflow-context.d.ts +275 -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/agent-validation.d.ts +88 -0
- package/dist/utils/agent-validation.d.ts.map +1 -0
- package/dist/utils/agent-validation.js +87 -0
- package/dist/utils/agent-validation.js.map +1 -0
- package/dist/utils/delay.d.ts +7 -0
- package/dist/utils/delay.d.ts.map +1 -0
- package/dist/utils/delay.js +9 -0
- package/dist/utils/delay.js.map +1 -0
- package/dist/utils/harness-config.d.ts +180 -0
- package/dist/utils/harness-config.d.ts.map +1 -0
- package/dist/utils/harness-config.js +311 -0
- package/dist/utils/harness-config.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/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +11 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/model-spec.d.ts +110 -0
- package/dist/utils/model-spec.d.ts.map +1 -0
- package/dist/utils/model-spec.js +149 -0
- package/dist/utils/model-spec.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/provider-config.d.ts +10 -0
- package/dist/utils/provider-config.d.ts.map +1 -0
- package/dist/utils/provider-config.js +10 -0
- package/dist/utils/provider-config.js.map +1 -0
- package/dist/utils/restart-analysis.d.ts +202 -0
- package/dist/utils/restart-analysis.d.ts.map +1 -0
- package/dist/utils/restart-analysis.js +426 -0
- package/dist/utils/restart-analysis.js.map +1 -0
- package/dist/utils/session-serialization.d.ts +118 -0
- package/dist/utils/session-serialization.d.ts.map +1 -0
- package/dist/utils/session-serialization.js +217 -0
- package/dist/utils/session-serialization.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 +34 -5
- package/.claude/commands/subtask-planning/prp-base-create.md +0 -120
- package/.claude/commands/subtask-planning/prp-base-execute.md +0 -65
- package/.claude/commands/task-breakdown.md +0 -94
- package/.claude/settings.local.json +0 -9
- package/.claude/system_prompts/task-breakdown.md +0 -101
- package/CHANGELOG.md +0 -188
- package/PRD.md +0 -543
- package/PRPs/001-hierarchical-workflow-engine.md +0 -2438
- 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 -258
- 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/examples/11-reparenting-workflows.ts +0 -269
- package/examples/index.ts +0 -147
- package/examples/utils/helpers.ts +0 -57
- package/package-lock.json +0 -2398
- package/plan/001_d3bb02af4886/TEST_RESULTS.md +0 -259
- package/plan/001_d3bb02af4886/backlog.json +0 -867
- package/plan/001_d3bb02af4886/bug_fix_tasks.json +0 -484
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S1/PRP.md +0 -488
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S2/PRP.md +0 -581
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M1T1S3/PRP.md +0 -687
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S1/PRP.md +0 -492
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/PRP.md +0 -932
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/concurrent_error_testing_patterns.md +0 -1109
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/vitest_concurrent_testing.md +0 -802
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T1S3/research/workflow_engine_test_references.md +0 -603
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S1/PRP.md +0 -564
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S3/PRP.md +0 -518
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T2S4/PRP.md +0 -1252
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/PRP.md +0 -364
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/CODEBASE_INVENTORY.md +0 -114
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/DECORATOR_DOCUMENTATION_PATTERNS.md +0 -205
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/PRD_LOCATION_ANALYSIS.md +0 -199
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M2T3S1/research/ULTRATHINK_PRP_PLAN.md +0 -134
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S1/PRP.md +0 -495
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S1/research/console_error_inventory.md +0 -435
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S2/PRP.md +0 -506
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T1S3/PRP.md +0 -612
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T2S2/PRP.md +0 -558
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T2S2/research/external_research.md +0 -788
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S2/PRP.md +0 -460
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T3S3/PRP.md +0 -454
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/PRP.md +0 -520
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/RECOMMENDATION.md +0 -417
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/research/external_workflow_engines_research.md +0 -760
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S1/research/security_implications_analysis.md +0 -245
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M3T4S2/PRP.md +0 -792
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S1/PRP.md +0 -535
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S1/TEST_EXECUTION_REPORT.md +0 -190
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/PRP.md +0 -654
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/TEST_FIX_REPORT.md +0 -227
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/KEY_FINDINGS.md +0 -345
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/QUICK_REFERENCE.md +0 -193
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T1S2/research/test_maintenance_research.md +0 -1323
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S1/BREAKING_CHANGES_AUDIT.md +0 -1011
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S1/PRP.md +0 -927
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/P1M4T3S2/PRP.md +0 -505
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/architecture/logger_child_signature_analysis.md +0 -401
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/child_implementation_research.md +0 -142
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/test_patterns_research.md +0 -112
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S3/vitest_patterns_research.md +0 -159
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/PRP.md +0 -549
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/VERIFICATION_REPORT.md +0 -368
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/edge_case_analysis.md +0 -172
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M1T1S4/usage_inventory.md +0 -175
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T1S2/PRP.md +0 -696
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T1S4/PRP.md +0 -860
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/PRP.md +0 -1066
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/01-testing-aggregated-errors.md +0 -1103
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/01_typescript_error_aggregation_patterns.md +0 -789
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/02-error-merge-strategy-testing-guide.md +0 -1098
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/02_aggregate_error_patterns.md +0 -1037
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/03-promise-allsettled-testing-patterns.md +0 -916
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/03_error_merging_strategies.md +0 -1045
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/04_github_stackoverflow_examples.md +0 -890
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/05_comprehensive_summary.md +0 -822
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/INDEX.md +0 -668
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/QUICK_REFERENCE.md +0 -706
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/README.md +0 -265
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S2/research/RESEARCH_REPORT.md +0 -655
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T2S4/research/vitest_testing_patterns.md +0 -1103
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M2T3S2/PRP.md +0 -426
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/PRP.md +0 -506
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/QUICK_REFERENCE.md +0 -114
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/RESEARCH_SUMMARY.md +0 -316
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S2/research/vitest_observer_error_logging_best_practices.md +0 -754
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T1S3/PRP.md +0 -612
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/PRP.md +0 -719
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/README.md +0 -215
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S1/analysis.md +0 -765
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T2S3/PRP.md +0 -718
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/DECISION.md +0 -149
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/PRP.md +0 -470
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/ULTRATHINK_PLAN.md +0 -332
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/codebase_workflow_name_analysis.md +0 -167
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/external_best_practices.md +0 -265
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T3S1/research/validation_patterns.md +0 -273
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T4S1/workflow_engine_ancestry_api_research.md +0 -760
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M3T4S3-PRP.md +0 -434
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S1/PRP.md +0 -717
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/PRP.md +0 -472
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/VALIDATION_REPORT.md +0 -125
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/P1M4T2S2/research/ULTRATHINK_PRP_PLAN.md +0 -301
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/error-logging-best-practices.md +0 -1170
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/research_typescript_partial_and_overloads.md +0 -940
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/vitest-quick-reference.md +0 -151
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/docs/vitest-research.md +0 -650
- package/plan/001_d3bb02af4886/bugfix/001_e8e04329daf3/prd_snapshot.md +0 -259
- package/plan/001_d3bb02af4886/bugfix/P1M1T1S1/PRP.md +0 -457
- package/plan/001_d3bb02af4886/bugfix/RESEARCH_SUMMARY.md +0 -346
- package/plan/001_d3bb02af4886/bugfix/architecture/codebase_structure.md +0 -311
- package/plan/001_d3bb02af4886/bugfix/architecture/concurrent_execution_best_practices.md +0 -1565
- package/plan/001_d3bb02af4886/bugfix/architecture/error_handling_patterns.md +0 -288
- package/plan/001_d3bb02af4886/bugfix/architecture/promise_all_analysis.md +0 -741
- package/plan/001_d3bb02af4886/docs/PRP/P1M1T1S4-functional-workflow-error-state-capture-test.md +0 -652
- package/plan/001_d3bb02af4886/docs/PRP/P1P2-PRP.md +0 -527
- package/plan/001_d3bb02af4886/docs/PRP/P3P4-PRP.md +0 -1388
- package/plan/001_d3bb02af4886/docs/PRP/P4P5-PRP.md +0 -1136
- package/plan/001_d3bb02af4886/docs/PRP/PRP.md +0 -527
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S1-PRP.md +0 -415
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S2-PRP.md +0 -378
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M1T2S4-PRP.md +0 -713
- package/plan/001_d3bb02af4886/docs/PRP/bugfix/P1M2T1S4-PRP.md +0 -370
- package/plan/001_d3bb02af4886/docs/PRP_P1M3T1S3.md +0 -499
- package/plan/001_d3bb02af4886/docs/TEST_RESULTS.md +0 -230
- package/plan/001_d3bb02af4886/docs/architecture/external_deps.md +0 -358
- package/plan/001_d3bb02af4886/docs/architecture/system_context.md +0 -242
- package/plan/001_d3bb02af4886/docs/bugfix/ANALYSIS_PRD_VS_IMPLEMENTATION.md +0 -1134
- package/plan/001_d3bb02af4886/docs/bugfix/GAP_ANALYSIS_SUMMARY.md +0 -179
- package/plan/001_d3bb02af4886/docs/bugfix/P1M4T2S1/PRP.md +0 -629
- package/plan/001_d3bb02af4886/docs/bugfix/P1M4T2S1/validation-report.md +0 -214
- package/plan/001_d3bb02af4886/docs/bugfix/PRP_P1M4T2S3.md +0 -629
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_PRP.md +0 -529
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_QUICK_REFERENCE.md +0 -142
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_README.md +0 -304
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_TEST_RESULTS.md +0 -558
- package/plan/001_d3bb02af4886/docs/bugfix/bugfix_VALIDATION_SUMMARY.md +0 -256
- package/plan/001_d3bb02af4886/docs/bugfix/system_context.md +0 -346
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/bug_analysis.md +0 -415
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/implementation_patterns.md +0 -489
- package/plan/001_d3bb02af4886/docs/bugfix-architecture/system_context.md +0 -218
- package/plan/001_d3bb02af4886/docs/bugfix_INITIATION_SUMMARY.md +0 -380
- package/plan/001_d3bb02af4886/docs/research/CYCLE_DETECTION_PATTERNS.md +0 -1923
- package/plan/001_d3bb02af4886/docs/research/CYCLE_DETECTION_QUICK_REF.md +0 -319
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/codebase-context.md +0 -115
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/cycle-detection-algorithms.md +0 -134
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/test-patterns.md +0 -153
- package/plan/001_d3bb02af4886/docs/research/P1M1T2S1/workflow-class.md +0 -132
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/DECORATOR_DOCUMENTATION_BEST_PRACTICES.md +0 -716
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/DECORATOR_DOCUMENTATION_QUICK_REF.md +0 -186
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/GROUNDSWELL_DECORATOR_EXAMPLES.md +0 -604
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/INDEX.md +0 -213
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/codebase_structure.md +0 -30
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/existing_test_pattern.md +0 -56
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/getRootObservers_implementation.md +0 -53
- package/plan/001_d3bb02af4886/docs/research/P1M2T1S4/test_conventions.md +0 -49
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/PRP.md +0 -958
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/QUICK_REFERENCE.md +0 -339
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/README.md +0 -305
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/SUMMARY.md +0 -433
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/bidirectional-tree-consistency-testing.md +0 -1574
- package/plan/001_d3bb02af4886/docs/research/P1M3T1S4/test-pattern-examples.md +0 -1014
- package/plan/001_d3bb02af4886/docs/research/P1P2/LRU_CACHE_BEST_PRACTICES.md +0 -1929
- package/plan/001_d3bb02af4886/docs/research/P1P2/LRU_CACHE_CODE_PATTERNS.md +0 -857
- package/plan/001_d3bb02af4886/docs/research/P1P2/LRU_CACHE_INTEGRATION_GUIDE.md +0 -738
- package/plan/001_d3bb02af4886/docs/research/P1P2/LRU_CACHE_RESEARCH_INDEX.md +0 -424
- package/plan/001_d3bb02af4886/docs/research/P1P2/REFLECTION_INDEX.md +0 -291
- package/plan/001_d3bb02af4886/docs/research/P1P2/REFLECTION_RESEARCH_REPORT.md +0 -1342
- package/plan/001_d3bb02af4886/docs/research/P1P2/RESEARCH_SUMMARY.md +0 -342
- package/plan/001_d3bb02af4886/docs/research/P1P2/anthropic-sdk.md +0 -174
- package/plan/001_d3bb02af4886/docs/research/P1P2/async-local-storage.md +0 -200
- package/plan/001_d3bb02af4886/docs/research/P1P2/reflection-code-patterns.md +0 -1205
- package/plan/001_d3bb02af4886/docs/research/P1P2/reflection-decision-matrix.md +0 -421
- package/plan/001_d3bb02af4886/docs/research/P1P2/reflection-implementation-guide.md +0 -1341
- package/plan/001_d3bb02af4886/docs/research/P1P2/reflection-integration-guide.md +0 -834
- package/plan/001_d3bb02af4886/docs/research/P1P2/reflection-patterns.md +0 -1468
- package/plan/001_d3bb02af4886/docs/research/P1P2/reflection-quick-reference.md +0 -558
- package/plan/001_d3bb02af4886/docs/research/P1P2/zod-schema.md +0 -152
- package/plan/001_d3bb02af4886/docs/research/P3P4/caching-lru.md +0 -116
- package/plan/001_d3bb02af4886/docs/research/P3P4/introspection-tools.md +0 -177
- package/plan/001_d3bb02af4886/docs/research/P3P4/reflection-patterns.md +0 -117
- package/plan/001_d3bb02af4886/docs/research/P4P5/RESEARCH_SUMMARY.md +0 -151
- package/plan/001_d3bb02af4886/docs/research/PROMISE_ALLSETTLED_QUICK_REF.md +0 -376
- package/plan/001_d3bb02af4886/docs/research/PROMISE_ALLSETTLED_RESEARCH.md +0 -1507
- package/plan/001_d3bb02af4886/docs/research/bugfix_typescript_patterns.md +0 -949
- package/plan/001_d3bb02af4886/docs/research/error-testing-research.md +0 -619
- package/plan/001_d3bb02af4886/docs/research/error_handling_patterns.md +0 -723
- package/plan/001_d3bb02af4886/docs/research/general/INTROSPECTION_RESEARCH_SUMMARY.md +0 -378
- package/plan/001_d3bb02af4886/docs/research/general/README-INTROSPECTION.md +0 -352
- package/plan/001_d3bb02af4886/docs/research/general/agent-introspection-patterns.md +0 -1085
- package/plan/001_d3bb02af4886/docs/research/general/introspection-security-guide.md +0 -984
- package/plan/001_d3bb02af4886/docs/research/general/introspection-tool-examples.md +0 -875
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/PRP_TEMPLATE.md +0 -460
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/QUICK_REFERENCE.md +0 -324
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/README.md +0 -175
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/RESEARCH_REPORT.md +0 -499
- package/plan/001_d3bb02af4886/docs/research/incremental-tree-map-updates/SUMMARY.md +0 -163
- package/plan/001_d3bb02af4886/prd_snapshot.md +0 -543
- package/plan/bugfix/BUG_FIX_SUMMARY.md +0 -961
- package/scripts/generate-llms-full.ts +0 -206
- package/src/__tests__/adversarial/attachChild-performance.test.ts +0 -216
- package/src/__tests__/adversarial/circular-reference.test.ts +0 -101
- package/src/__tests__/adversarial/complex-circular-reference.test.ts +0 -139
- package/src/__tests__/adversarial/concurrent-task-failures.test.ts +0 -571
- package/src/__tests__/adversarial/deep-analysis.test.ts +0 -729
- package/src/__tests__/adversarial/deep-hierarchy-stress.test.ts +0 -213
- package/src/__tests__/adversarial/e2e-prd-validation.test.ts +0 -448
- package/src/__tests__/adversarial/edge-case.test.ts +0 -703
- package/src/__tests__/adversarial/error-merge-strategy.test.ts +0 -760
- package/src/__tests__/adversarial/incremental-performance.test.ts +0 -140
- package/src/__tests__/adversarial/node-map-update-benchmarks.test.ts +0 -457
- package/src/__tests__/adversarial/observer-propagation.test.ts +0 -487
- package/src/__tests__/adversarial/parent-validation.test.ts +0 -143
- package/src/__tests__/adversarial/prd-12-2-compliance.test.ts +0 -611
- package/src/__tests__/adversarial/prd-compliance.test.ts +0 -731
- package/src/__tests__/compatibility/backward-compatibility.test.ts +0 -1572
- package/src/__tests__/helpers/index.ts +0 -18
- package/src/__tests__/helpers/tree-verification.ts +0 -257
- package/src/__tests__/integration/agent-workflow.test.ts +0 -256
- package/src/__tests__/integration/bidirectional-consistency.test.ts +0 -847
- package/src/__tests__/integration/observer-logging.test.ts +0 -643
- package/src/__tests__/integration/tree-mirroring.test.ts +0 -151
- package/src/__tests__/integration/workflow-reparenting.test.ts +0 -303
- 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 -217
- package/src/__tests__/unit/decorators.test.ts +0 -100
- package/src/__tests__/unit/introspection-tools.test.ts +0 -277
- package/src/__tests__/unit/logger.test.ts +0 -293
- package/src/__tests__/unit/observable.test.ts +0 -321
- package/src/__tests__/unit/prompt.test.ts +0 -135
- package/src/__tests__/unit/reflection.test.ts +0 -210
- package/src/__tests__/unit/tree-debugger-incremental.test.ts +0 -170
- package/src/__tests__/unit/tree-debugger.test.ts +0 -85
- package/src/__tests__/unit/utils/workflow-error-utils.test.ts +0 -209
- package/src/__tests__/unit/workflow-detachChild.test.ts +0 -100
- package/src/__tests__/unit/workflow-emitEvent-childDetached.test.ts +0 -153
- package/src/__tests__/unit/workflow-isDescendantOf.test.ts +0 -180
- package/src/__tests__/unit/workflow.test.ts +0 -357
- package/src/cache/cache-key.ts +0 -244
- package/src/cache/cache.ts +0 -236
- package/src/core/agent.ts +0 -593
- package/src/core/event-tree.ts +0 -260
- package/src/core/logger.ts +0 -112
- package/src/core/mcp-handler.ts +0 -184
- package/src/core/prompt.ts +0 -150
- package/src/core/workflow-context.ts +0 -351
- package/src/core/workflow.ts +0 -540
- package/src/debugger/tree-debugger.ts +0 -255
- package/src/decorators/observed-state.ts +0 -95
- package/src/decorators/step.ts +0 -139
- package/src/decorators/task.ts +0 -159
- package/src/examples/tdd-orchestrator.ts +0 -65
- package/src/examples/test-cycle-workflow.ts +0 -64
- package/src/index.ts +0 -142
- 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 -32
- package/src/types/error-strategy.ts +0 -13
- package/src/types/error.ts +0 -20
- package/src/types/events.ts +0 -75
- 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/index.ts +0 -4
- package/src/utils/observable.ts +0 -106
- package/src/utils/workflow-error-utils.ts +0 -56
- package/tsconfig.json +0 -22
- package/vitest.config.ts +0 -16
|
@@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;;QAErE,4CAA4C;;;;;;;;;;;;;;;;;mEA4E7C"}
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent configuration and override types
|
|
3
|
+
* All properties map 1:1 to Anthropic SDK
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
// ========================
|
|
7
|
+
// Error Code Constants
|
|
8
|
+
// ========================
|
|
9
|
+
/**
|
|
10
|
+
* Standard error codes for agent responses
|
|
11
|
+
*
|
|
12
|
+
* All error codes use SCREAMING_SNAKE_CASE convention.
|
|
13
|
+
*
|
|
14
|
+
* Per PRD 6.6: Use `INVALID_RESPONSE_FORMAT` for responses that
|
|
15
|
+
* don't conform to the AgentResponse schema. Validation failures
|
|
16
|
+
* should be treated as errors with this code.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link AgentErrorDetails} for error details structure
|
|
19
|
+
* @see {@link createErrorResponse} for factory function
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { AGENT_ERROR_CODES, createErrorResponse } from 'groundswell';
|
|
24
|
+
*
|
|
25
|
+
* const error = createErrorResponse(
|
|
26
|
+
* AGENT_ERROR_CODES.VALIDATION_FAILED,
|
|
27
|
+
* 'Invalid input',
|
|
28
|
+
* { field: 'email', value: 'not-an-email' }
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const AGENT_ERROR_CODES = {
|
|
33
|
+
/**
|
|
34
|
+
* Response not valid JSON or doesn't match AgentResponse schema
|
|
35
|
+
*
|
|
36
|
+
* Per PRD 6.6: Invalid responses must be treated as errors with this code.
|
|
37
|
+
* Use when response validation fails during parsing or schema checking.
|
|
38
|
+
*/
|
|
39
|
+
INVALID_RESPONSE_FORMAT: 'INVALID_RESPONSE_FORMAT',
|
|
40
|
+
/**
|
|
41
|
+
* Input validation failed
|
|
42
|
+
*
|
|
43
|
+
* Use when the provided inputs fail validation checks (e.g., wrong type,
|
|
44
|
+
* missing required fields, out-of-range values).
|
|
45
|
+
*/
|
|
46
|
+
VALIDATION_FAILED: 'VALIDATION_FAILED',
|
|
47
|
+
/**
|
|
48
|
+
* Agent execution failed
|
|
49
|
+
*
|
|
50
|
+
* Use when the agent execution fails for reasons unrelated to validation
|
|
51
|
+
* or API requests (e.g., compilation errors, runtime exceptions).
|
|
52
|
+
*/
|
|
53
|
+
EXECUTION_FAILED: 'EXECUTION_FAILED',
|
|
54
|
+
/**
|
|
55
|
+
* API request to LLM provider failed
|
|
56
|
+
*
|
|
57
|
+
* Use when the HTTP request to the LLM provider fails (e.g., network errors,
|
|
58
|
+
* timeout, rate limiting, provider-side errors).
|
|
59
|
+
*/
|
|
60
|
+
API_REQUEST_FAILED: 'API_REQUEST_FAILED',
|
|
61
|
+
/**
|
|
62
|
+
* Tool execution failed
|
|
63
|
+
*
|
|
64
|
+
* Use when a tool/function invocation fails during agent execution
|
|
65
|
+
* (e.g., tool not found, tool returned error, tool timeout).
|
|
66
|
+
*/
|
|
67
|
+
TOOL_EXECUTION_FAILED: 'TOOL_EXECUTION_FAILED',
|
|
68
|
+
/**
|
|
69
|
+
* Internal validation or system error
|
|
70
|
+
*
|
|
71
|
+
* Use when an internal validation fails or a system error occurs.
|
|
72
|
+
* This indicates a bug in the code (e.g., factory helper produced invalid response).
|
|
73
|
+
* Non-recoverable because retrying with the same inputs will produce the same error.
|
|
74
|
+
*
|
|
75
|
+
* Per PRD 6.6: Internal validation failures should return this error code.
|
|
76
|
+
*/
|
|
77
|
+
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
78
|
+
/**
|
|
79
|
+
* Invalid harness/provider configuration
|
|
80
|
+
*
|
|
81
|
+
* Use when a harness receives a configuration it cannot honour — e.g. a model
|
|
82
|
+
* provider it cannot run (ClaudeCodeHarness only runs anthropic/* per PRD §7.8).
|
|
83
|
+
* Non-recoverable: the caller must select a different harness or model, not retry.
|
|
84
|
+
*/
|
|
85
|
+
CONFIG_ERROR: 'CONFIG_ERROR',
|
|
86
|
+
};
|
|
87
|
+
// ========================
|
|
88
|
+
// Factory Functions
|
|
89
|
+
// ========================
|
|
90
|
+
/**
|
|
91
|
+
* Creates a success response with data and metadata.
|
|
92
|
+
*
|
|
93
|
+
* ## PRD 6.4 Compliance
|
|
94
|
+
*
|
|
95
|
+
* The returned response satisfies all PRD 6.4 requirements:
|
|
96
|
+
* - Strict JSON parseable by `JSON.parse()` (PRD 6.4.1)
|
|
97
|
+
* - No prose wrapping - pure JSON structure (PRD 6.4.2)
|
|
98
|
+
* - Consistent with AgentResponse interface (PRD 6.4.3)
|
|
99
|
+
* - Uses null instead of undefined (PRD 6.4.4)
|
|
100
|
+
*
|
|
101
|
+
* @template T - The type of the response data
|
|
102
|
+
* @param data - The response data to return
|
|
103
|
+
* @param metadata - Response metadata including agentId and timestamp
|
|
104
|
+
* @returns A success AgentResponse with status 'success', provided data, null error
|
|
105
|
+
*
|
|
106
|
+
* @example <caption>Basic success response (PRD 6.5)</caption>
|
|
107
|
+
* ```ts
|
|
108
|
+
* const response = createSuccessResponse(
|
|
109
|
+
* { result: 'Task completed', artifacts: ['file1.ts', 'file2.ts'] },
|
|
110
|
+
* { agentId: 'agent-abc123', timestamp: 1706140800000, duration: 1523 }
|
|
111
|
+
* );
|
|
112
|
+
*
|
|
113
|
+
* // Guaranteed to be valid JSON (PRD 6.4.1)
|
|
114
|
+
* const jsonString = JSON.stringify(response);
|
|
115
|
+
* const parsed = JSON.parse(jsonString); // Always valid
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @example <caption>Success response with execution metadata</caption>
|
|
119
|
+
* ```ts
|
|
120
|
+
* const response = createSuccessResponse(
|
|
121
|
+
* { items: [1, 2, 3] },
|
|
122
|
+
* {
|
|
123
|
+
* agentId: 'agent-123',
|
|
124
|
+
* timestamp: Date.now(),
|
|
125
|
+
* duration: 1523,
|
|
126
|
+
* requestId: 'req-abc123'
|
|
127
|
+
* }
|
|
128
|
+
* );
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export function createSuccessResponse(data, metadata) {
|
|
132
|
+
return {
|
|
133
|
+
status: 'success',
|
|
134
|
+
data,
|
|
135
|
+
error: null,
|
|
136
|
+
metadata,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Creates an error response with error details.
|
|
141
|
+
*
|
|
142
|
+
* ## PRD 6.4 Compliance
|
|
143
|
+
*
|
|
144
|
+
* Per PRD 6.4.5: Failed operations must still return valid JSON with
|
|
145
|
+
* status 'error' and populated error field. This function ensures all
|
|
146
|
+
* error responses conform to the AgentResponse schema.
|
|
147
|
+
*
|
|
148
|
+
* The error code should use SCREAMING_SNAKE_CASE convention and ideally
|
|
149
|
+
* be one of the standard codes from {@link AGENT_ERROR_CODES}.
|
|
150
|
+
*
|
|
151
|
+
* @param code - Machine-readable error code (SCREAMING_SNAKE_CASE)
|
|
152
|
+
* @param message - Human-readable error message
|
|
153
|
+
* @param details - Optional additional error context (use null instead of undefined per PRD 6.4.4)
|
|
154
|
+
* @param recoverable - Whether the error is recoverable (default: false)
|
|
155
|
+
* @returns An error AgentResponse with null data, populated error field
|
|
156
|
+
*
|
|
157
|
+
* @example <caption>Error response (PRD 6.5)</caption>
|
|
158
|
+
* ```ts
|
|
159
|
+
* const response = createErrorResponse(
|
|
160
|
+
* 'EXECUTION_FAILED',
|
|
161
|
+
* 'Failed to compile TypeScript files',
|
|
162
|
+
* {
|
|
163
|
+
* failedFiles: ['src/index.ts'],
|
|
164
|
+
* compilerErrors: ['TS2307: Cannot find module \\'foo\\'']
|
|
165
|
+
* },
|
|
166
|
+
* true
|
|
167
|
+
* );
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* @example <caption>Using standard error codes</caption>
|
|
171
|
+
* ```ts
|
|
172
|
+
* import { AGENT_ERROR_CODES, createErrorResponse } from 'groundswell';
|
|
173
|
+
*
|
|
174
|
+
* const response = createErrorResponse(
|
|
175
|
+
* AGENT_ERROR_CODES.VALIDATION_FAILED,
|
|
176
|
+
* 'Invalid input',
|
|
177
|
+
* { field: 'email', value: 'not-an-email' },
|
|
178
|
+
* false
|
|
179
|
+
* );
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
export function createErrorResponse(code, message, details, recoverable = false) {
|
|
183
|
+
return {
|
|
184
|
+
status: 'error',
|
|
185
|
+
data: null,
|
|
186
|
+
error: {
|
|
187
|
+
code,
|
|
188
|
+
message,
|
|
189
|
+
details: details ?? null,
|
|
190
|
+
recoverable,
|
|
191
|
+
},
|
|
192
|
+
metadata: {
|
|
193
|
+
agentId: 'unknown',
|
|
194
|
+
timestamp: Date.now(),
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Creates a partial response for streaming/incremental results.
|
|
200
|
+
*
|
|
201
|
+
* ## PRD 6.4 Compliance
|
|
202
|
+
*
|
|
203
|
+
* Per PRD 6.4.3: Consistent Structure - partial responses conform to
|
|
204
|
+
* the AgentResponse interface with status 'partial'.
|
|
205
|
+
*
|
|
206
|
+
* Partial responses are used for streaming or incremental results where
|
|
207
|
+
* the agent has not yet completed the full request. They contain intermediate
|
|
208
|
+
* progress data that may be updated in subsequent responses.
|
|
209
|
+
*
|
|
210
|
+
* @template T - The type of the partial response data
|
|
211
|
+
* @param data - The partial response data with progress information
|
|
212
|
+
* @returns A partial AgentResponse with status 'partial', data, null error
|
|
213
|
+
*
|
|
214
|
+
* @example <caption>Partial response (PRD 6.5)</caption>
|
|
215
|
+
* ```ts
|
|
216
|
+
* const response = createPartialResponse({
|
|
217
|
+
* completedSteps: 3,
|
|
218
|
+
* totalSteps: 5,
|
|
219
|
+
* intermediateResult: { progress: 'processing file2.ts' }
|
|
220
|
+
* });
|
|
221
|
+
*
|
|
222
|
+
* // Later, send another partial response with updated progress
|
|
223
|
+
* const updatedResponse = createPartialResponse({
|
|
224
|
+
* completedSteps: 4,
|
|
225
|
+
* totalSteps: 5,
|
|
226
|
+
* intermediateResult: { progress: 'processing file3.ts' }
|
|
227
|
+
* });
|
|
228
|
+
* ```
|
|
229
|
+
*
|
|
230
|
+
* @example <caption>Streaming data chunks</caption>
|
|
231
|
+
* ```ts
|
|
232
|
+
* const chunk = createPartialResponse({
|
|
233
|
+
* chunk: 'Hello',
|
|
234
|
+
* isComplete: false
|
|
235
|
+
* });
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
export function createPartialResponse(data) {
|
|
239
|
+
return {
|
|
240
|
+
status: 'partial',
|
|
241
|
+
data,
|
|
242
|
+
error: null,
|
|
243
|
+
metadata: {
|
|
244
|
+
agentId: 'unknown',
|
|
245
|
+
timestamp: Date.now(),
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
// ========================
|
|
250
|
+
// Type Guards
|
|
251
|
+
// ========================
|
|
252
|
+
/**
|
|
253
|
+
* Type guard for success responses.
|
|
254
|
+
* Narrows the type to SuccessResponse<T> where data is T (not null).
|
|
255
|
+
*
|
|
256
|
+
* @param response - The response to check
|
|
257
|
+
* @returns True if the response status is 'success'
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```ts
|
|
261
|
+
* if (isSuccess(response)) {
|
|
262
|
+
* console.log(response.data); // TypeScript knows data is T
|
|
263
|
+
* }
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
export function isSuccess(response) {
|
|
267
|
+
return response.status === 'success';
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Type guard for error responses.
|
|
271
|
+
* Narrows the type to ErrorResponse where error is AgentErrorDetails (not null).
|
|
272
|
+
*
|
|
273
|
+
* @param response - The response to check
|
|
274
|
+
* @returns True if the response status is 'error'
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* ```ts
|
|
278
|
+
* if (isError(response)) {
|
|
279
|
+
* console.log(response.error.code); // TypeScript knows error exists
|
|
280
|
+
* }
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
export function isError(response) {
|
|
284
|
+
return response.status === 'error';
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Type guard for partial responses.
|
|
288
|
+
* Narrows the type to PartialResponse<T>.
|
|
289
|
+
*
|
|
290
|
+
* @param response - The response to check
|
|
291
|
+
* @returns True if the response status is 'partial'
|
|
292
|
+
*
|
|
293
|
+
* @example
|
|
294
|
+
* ```ts
|
|
295
|
+
* if (isPartial(response)) {
|
|
296
|
+
* console.log('Partial result:', response.data);
|
|
297
|
+
* }
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
export function isPartial(response) {
|
|
301
|
+
return response.status === 'partial';
|
|
302
|
+
}
|
|
303
|
+
// ========================
|
|
304
|
+
// Zod Schema Definitions
|
|
305
|
+
// ========================
|
|
306
|
+
/**
|
|
307
|
+
* Zod schema for AgentResponseStatus enum
|
|
308
|
+
* Validates status values: 'success' | 'error' | 'partial'
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```ts
|
|
312
|
+
* AgentResponseStatusSchema.parse('success'); // ✓
|
|
313
|
+
* AgentResponseStatusSchema.parse('invalid'); // ✗ ZodError
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
export const AgentResponseStatusSchema = z.enum(['success', 'error', 'partial']);
|
|
317
|
+
/**
|
|
318
|
+
* Zod schema for AgentErrorDetails interface
|
|
319
|
+
* Validates error details with null-over-undefined handling
|
|
320
|
+
*
|
|
321
|
+
* Per PRD 6.4.4: Use null for absent values, not undefined
|
|
322
|
+
*/
|
|
323
|
+
export const AgentErrorDetailsSchema = z.object({
|
|
324
|
+
/** Machine-readable error code (SCREAMING_SNAKE_CASE) */
|
|
325
|
+
code: z.string(),
|
|
326
|
+
/** Human-readable error description */
|
|
327
|
+
message: z.string(),
|
|
328
|
+
/** Additional error context - null if no details (PRD 6.4.4) */
|
|
329
|
+
details: z.record(z.string(), z.unknown()).nullable(),
|
|
330
|
+
/** Whether the error is recoverable (can retry) */
|
|
331
|
+
recoverable: z.boolean(),
|
|
332
|
+
});
|
|
333
|
+
/**
|
|
334
|
+
* Zod schema for AgentResponseMetadata interface
|
|
335
|
+
* Validates response metadata including agent ID and timestamp
|
|
336
|
+
*/
|
|
337
|
+
export const AgentResponseMetadataSchema = z.object({
|
|
338
|
+
/** Agent identifier */
|
|
339
|
+
agentId: z.string(),
|
|
340
|
+
/** Unix timestamp in milliseconds */
|
|
341
|
+
timestamp: z.number(),
|
|
342
|
+
/** Execution duration in milliseconds (optional) */
|
|
343
|
+
duration: z.number().optional(),
|
|
344
|
+
/** Request correlation ID (optional) */
|
|
345
|
+
requestId: z.string().optional(),
|
|
346
|
+
/** Token usage from API (optional - passthrough for complex type) */
|
|
347
|
+
usage: z.unknown().optional(),
|
|
348
|
+
/** Number of tool invocations (optional) */
|
|
349
|
+
toolCalls: z.number().optional(),
|
|
350
|
+
});
|
|
351
|
+
/**
|
|
352
|
+
* Zod schema factory for AgentResponse<T> discriminated union
|
|
353
|
+
* Creates a schema that validates responses based on status discriminator
|
|
354
|
+
*
|
|
355
|
+
* @template T - The Zod schema for the data type
|
|
356
|
+
* @param dataSchema - Zod schema for the response data
|
|
357
|
+
* @returns A discriminated union schema for AgentResponse
|
|
358
|
+
*
|
|
359
|
+
* @example
|
|
360
|
+
* ```ts
|
|
361
|
+
* // Create schema for string responses
|
|
362
|
+
* const StringResponseSchema = AgentResponseSchema(z.object({ result: z.string() }));
|
|
363
|
+
*
|
|
364
|
+
* // Validate a success response
|
|
365
|
+
* const result = StringResponseSchema.safeParse({
|
|
366
|
+
* status: 'success',
|
|
367
|
+
* data: { result: 'hello' },
|
|
368
|
+
* error: null,
|
|
369
|
+
* metadata: { agentId: 'test', timestamp: Date.now() }
|
|
370
|
+
* });
|
|
371
|
+
* ```
|
|
372
|
+
*/
|
|
373
|
+
export function AgentResponseSchema(dataSchema) {
|
|
374
|
+
const successSchema = z.object({
|
|
375
|
+
status: z.literal('success'),
|
|
376
|
+
data: dataSchema,
|
|
377
|
+
error: z.null(), // PRD 6.4.4: null not undefined
|
|
378
|
+
metadata: AgentResponseMetadataSchema.optional(),
|
|
379
|
+
});
|
|
380
|
+
const errorSchema = z.object({
|
|
381
|
+
status: z.literal('error'),
|
|
382
|
+
data: z.null(), // PRD 6.4.4: null not undefined
|
|
383
|
+
error: AgentErrorDetailsSchema,
|
|
384
|
+
metadata: AgentResponseMetadataSchema.optional(),
|
|
385
|
+
});
|
|
386
|
+
const partialSchema = z.object({
|
|
387
|
+
status: z.literal('partial'),
|
|
388
|
+
data: dataSchema,
|
|
389
|
+
error: z.null(), // PRD 6.4.4: null not undefined
|
|
390
|
+
metadata: AgentResponseMetadataSchema.optional(),
|
|
391
|
+
});
|
|
392
|
+
return z.discriminatedUnion('status', [successSchema, errorSchema, partialSchema]).superRefine((data, ctx) => {
|
|
393
|
+
// Runtime validation: ensure consistency between status and data/error fields
|
|
394
|
+
if (data.status === 'success') {
|
|
395
|
+
if (data.error !== null) {
|
|
396
|
+
ctx.addIssue({
|
|
397
|
+
code: z.ZodIssueCode.custom,
|
|
398
|
+
message: "Invalid state: status='success' but error is non-null (must be null)",
|
|
399
|
+
path: ['error'],
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
else if (data.status === 'error') {
|
|
404
|
+
if (data.data !== null) {
|
|
405
|
+
ctx.addIssue({
|
|
406
|
+
code: z.ZodIssueCode.custom,
|
|
407
|
+
message: "Invalid state: status='error' but data is non-null (must be null)",
|
|
408
|
+
path: ['data'],
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else if (data.status === 'partial') {
|
|
413
|
+
if (data.error !== null) {
|
|
414
|
+
ctx.addIssue({
|
|
415
|
+
code: z.ZodIssueCode.custom,
|
|
416
|
+
message: "Invalid state: status='partial' but error is non-null (must be null)",
|
|
417
|
+
path: ['error'],
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
//# sourceMappingURL=agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/types/agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsjBxB,2BAA2B;AAC3B,uBAAuB;AACvB,2BAA2B;AAE3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B;;;;;OAKG;IACH,uBAAuB,EAAE,yBAAyB;IAElD;;;;;OAKG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;;;;OAKG;IACH,gBAAgB,EAAE,kBAAkB;IAEpC;;;;;OAKG;IACH,kBAAkB,EAAE,oBAAoB;IAExC;;;;;OAKG;IACH,qBAAqB,EAAE,uBAAuB;IAE9C;;;;;;;;OAQG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;OAMG;IACH,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX,2BAA2B;AAC3B,oBAAoB;AACpB,2BAA2B;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAO,EACP,QAA+B;IAE/B,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,IAAI;QACJ,KAAK,EAAE,IAAI;QACX,QAAQ;KACT,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAY,EACZ,OAAe,EACf,OAAiC,EACjC,cAAuB,KAAK;IAE5B,OAAO;QACL,MAAM,EAAE,OAAO;QACf,IAAI,EAAE,IAAI;QACV,KAAK,EAAE;YACL,IAAI;YACJ,OAAO;YACP,OAAO,EAAE,OAAO,IAAI,IAAI;YAC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,MAAM;oBAC3B,OAAO,EAAE,sEAAsE;oBAC/E,IAAI,EAAE,CAAC,OAAO,CAAC;iBAChB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ErrorMergeStrategy } from './error-strategy.js';
|
|
2
|
+
import type { ErrorCriterion } from './restart.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for @Step decorator
|
|
5
|
+
*/
|
|
6
|
+
export interface StepOptions {
|
|
7
|
+
/** Custom step name (defaults to method name) */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** If true, capture state snapshot after step completion */
|
|
10
|
+
snapshotState?: boolean;
|
|
11
|
+
/** Track and emit step duration (default: true, tracked unless explicitly set to false) */
|
|
12
|
+
trackTiming?: boolean;
|
|
13
|
+
/** If true, log message at step start */
|
|
14
|
+
logStart?: boolean;
|
|
15
|
+
/** If true, log message at step end */
|
|
16
|
+
logFinish?: boolean;
|
|
17
|
+
/** If true, step can be restarted on failure (default: false) */
|
|
18
|
+
restartable?: boolean;
|
|
19
|
+
/** Maximum number of retry attempts (default: 3) */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** Delay between retry attempts in milliseconds (default: 1000) */
|
|
22
|
+
retryDelayMs?: number;
|
|
23
|
+
/** Error criteria that trigger retry attempts (default: all errors if restartable) */
|
|
24
|
+
retryOn?: ErrorCriterion[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Configuration options for @Task decorator
|
|
28
|
+
*
|
|
29
|
+
* @note The decorator uses lenient validation - non-Workflow returns are
|
|
30
|
+
* silently skipped. See the @Task decorator JSDoc for details.
|
|
31
|
+
*/
|
|
32
|
+
export interface TaskOptions {
|
|
33
|
+
/** Custom task name (defaults to method name) */
|
|
34
|
+
name?: string;
|
|
35
|
+
/** If true, run returned workflows concurrently */
|
|
36
|
+
concurrent?: boolean;
|
|
37
|
+
/** Strategy for merging errors from concurrent task execution */
|
|
38
|
+
errorMergeStrategy?: ErrorMergeStrategy;
|
|
39
|
+
}
|
|
40
|
+
//# 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,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sFAAsF;IACtF,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;CAC5B;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,113 @@
|
|
|
1
|
+
import type { WorkflowNode } from './workflow.js';
|
|
2
|
+
import type { WorkflowError } from './error.js';
|
|
3
|
+
import type { TokenUsage } from './sdk-primitives.js';
|
|
4
|
+
import type { RestartAnalysis } from './restart.js';
|
|
5
|
+
import type { SerializedWorkflowState } from './snapshot.js';
|
|
6
|
+
import type { AgentResponse } from './agent.js';
|
|
7
|
+
import type { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Discriminated union of all workflow events
|
|
10
|
+
*/
|
|
11
|
+
export type WorkflowEvent = {
|
|
12
|
+
type: 'childAttached';
|
|
13
|
+
parentId: string;
|
|
14
|
+
child: WorkflowNode;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'childDetached';
|
|
17
|
+
parentId: string;
|
|
18
|
+
childId: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'stateSnapshot';
|
|
21
|
+
node: WorkflowNode;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'stepStart';
|
|
24
|
+
node: WorkflowNode;
|
|
25
|
+
step: string;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'stepRetry';
|
|
28
|
+
node: WorkflowNode;
|
|
29
|
+
stepName: string;
|
|
30
|
+
retryCount: number;
|
|
31
|
+
analysis: RestartAnalysis;
|
|
32
|
+
error: WorkflowError;
|
|
33
|
+
timestamp: number;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'stepRestarted';
|
|
36
|
+
node: WorkflowNode;
|
|
37
|
+
stepName: string;
|
|
38
|
+
retryCount: number;
|
|
39
|
+
restoredState: SerializedWorkflowState;
|
|
40
|
+
timestamp: number;
|
|
41
|
+
} | {
|
|
42
|
+
type: 'stepEnd';
|
|
43
|
+
node: WorkflowNode;
|
|
44
|
+
step: string;
|
|
45
|
+
duration: number;
|
|
46
|
+
} | {
|
|
47
|
+
type: 'error';
|
|
48
|
+
node: WorkflowNode;
|
|
49
|
+
error: WorkflowError;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'invalidResponse';
|
|
52
|
+
node: WorkflowNode;
|
|
53
|
+
response: AgentResponse<unknown>;
|
|
54
|
+
agentId: string;
|
|
55
|
+
errors: z.ZodError;
|
|
56
|
+
timestamp: number;
|
|
57
|
+
} | {
|
|
58
|
+
type: 'taskStart';
|
|
59
|
+
node: WorkflowNode;
|
|
60
|
+
task: string;
|
|
61
|
+
} | {
|
|
62
|
+
type: 'taskEnd';
|
|
63
|
+
node: WorkflowNode;
|
|
64
|
+
task: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: 'treeUpdated';
|
|
67
|
+
root: WorkflowNode;
|
|
68
|
+
} | {
|
|
69
|
+
type: 'agentPromptStart';
|
|
70
|
+
agentId: string;
|
|
71
|
+
agentName: string;
|
|
72
|
+
promptId: string;
|
|
73
|
+
node: WorkflowNode;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'agentPromptEnd';
|
|
76
|
+
agentId: string;
|
|
77
|
+
agentName: string;
|
|
78
|
+
promptId: string;
|
|
79
|
+
node: WorkflowNode;
|
|
80
|
+
duration: number;
|
|
81
|
+
tokenUsage?: TokenUsage;
|
|
82
|
+
} | {
|
|
83
|
+
type: 'toolInvocation';
|
|
84
|
+
toolName: string;
|
|
85
|
+
input: unknown;
|
|
86
|
+
output: unknown;
|
|
87
|
+
duration: number;
|
|
88
|
+
node: WorkflowNode;
|
|
89
|
+
} | {
|
|
90
|
+
type: 'mcpEvent';
|
|
91
|
+
serverName: string;
|
|
92
|
+
event: string;
|
|
93
|
+
payload?: unknown;
|
|
94
|
+
node: WorkflowNode;
|
|
95
|
+
} | {
|
|
96
|
+
type: 'reflectionStart';
|
|
97
|
+
level: 'workflow' | 'agent' | 'prompt';
|
|
98
|
+
node: WorkflowNode;
|
|
99
|
+
} | {
|
|
100
|
+
type: 'reflectionEnd';
|
|
101
|
+
level: 'workflow' | 'agent' | 'prompt';
|
|
102
|
+
success: boolean;
|
|
103
|
+
node: WorkflowNode;
|
|
104
|
+
} | {
|
|
105
|
+
type: 'cacheHit';
|
|
106
|
+
key: string;
|
|
107
|
+
node: WorkflowNode;
|
|
108
|
+
} | {
|
|
109
|
+
type: 'cacheMiss';
|
|
110
|
+
key: string;
|
|
111
|
+
node: WorkflowNode;
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,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