@ai-setting/roy-agent-cli 1.3.19 → 1.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -39
- package/dist/bin/roy +0 -0
- package/dist/bin/roy.js +0 -127298
- package/dist/cli/src/bin/roy.d.ts +0 -6
- package/dist/cli/src/bin/roy.js +0 -10
- package/dist/cli/src/cli.d.ts +0 -5
- package/dist/cli/src/cli.js +0 -96
- package/dist/cli/src/commands/act.d.ts +0 -44
- package/dist/cli/src/commands/act.js +0 -415
- package/dist/cli/src/commands/commands-add.d.ts +0 -17
- package/dist/cli/src/commands/commands-add.js +0 -90
- package/dist/cli/src/commands/commands-dirs.d.ts +0 -12
- package/dist/cli/src/commands/commands-dirs.js +0 -58
- package/dist/cli/src/commands/commands-info.d.ts +0 -12
- package/dist/cli/src/commands/commands-info.js +0 -76
- package/dist/cli/src/commands/commands-list.d.ts +0 -13
- package/dist/cli/src/commands/commands-list.js +0 -132
- package/dist/cli/src/commands/commands-remove.d.ts +0 -14
- package/dist/cli/src/commands/commands-remove.js +0 -136
- package/dist/cli/src/commands/commands.d.ts +0 -27
- package/dist/cli/src/commands/commands.js +0 -39
- package/dist/cli/src/commands/config/config-service.d.ts +0 -70
- package/dist/cli/src/commands/config/config-service.js +0 -233
- package/dist/cli/src/commands/config/deep-merge.d.ts +0 -22
- package/dist/cli/src/commands/config/deep-merge.js +0 -33
- package/dist/cli/src/commands/config/export.d.ts +0 -15
- package/dist/cli/src/commands/config/export.js +0 -83
- package/dist/cli/src/commands/config/import.d.ts +0 -16
- package/dist/cli/src/commands/config/import.js +0 -102
- package/dist/cli/src/commands/config/index.d.ts +0 -13
- package/dist/cli/src/commands/config/index.js +0 -29
- package/dist/cli/src/commands/config/list.d.ts +0 -18
- package/dist/cli/src/commands/config/list.js +0 -233
- package/dist/cli/src/commands/config/types.d.ts +0 -21
- package/dist/cli/src/commands/config/types.js +0 -49
- package/dist/cli/src/commands/debug/index.d.ts +0 -19
- package/dist/cli/src/commands/debug/index.js +0 -34
- package/dist/cli/src/commands/debug/log.d.ts +0 -29
- package/dist/cli/src/commands/debug/log.js +0 -102
- package/dist/cli/src/commands/debug/span.d.ts +0 -24
- package/dist/cli/src/commands/debug/span.js +0 -187
- package/dist/cli/src/commands/debug/trace.d.ts +0 -27
- package/dist/cli/src/commands/debug/trace.js +0 -111
- package/dist/cli/src/commands/eventsource/add.d.ts +0 -19
- package/dist/cli/src/commands/eventsource/add.js +0 -108
- package/dist/cli/src/commands/eventsource/index.d.ts +0 -20
- package/dist/cli/src/commands/eventsource/index.js +0 -35
- package/dist/cli/src/commands/eventsource/list.d.ts +0 -13
- package/dist/cli/src/commands/eventsource/list.js +0 -159
- package/dist/cli/src/commands/eventsource/remove.d.ts +0 -13
- package/dist/cli/src/commands/eventsource/remove.js +0 -74
- package/dist/cli/src/commands/eventsource/start.d.ts +0 -13
- package/dist/cli/src/commands/eventsource/start.js +0 -81
- package/dist/cli/src/commands/eventsource/status.d.ts +0 -13
- package/dist/cli/src/commands/eventsource/status.js +0 -149
- package/dist/cli/src/commands/eventsource/stop.d.ts +0 -13
- package/dist/cli/src/commands/eventsource/stop.js +0 -69
- package/dist/cli/src/commands/index.d.ts +0 -15
- package/dist/cli/src/commands/index.js +0 -14
- package/dist/cli/src/commands/input-handler.d.ts +0 -27
- package/dist/cli/src/commands/input-handler.js +0 -38
- package/dist/cli/src/commands/interactive.d.ts +0 -141
- package/dist/cli/src/commands/interactive.js +0 -854
- package/dist/cli/src/commands/lsp/check.d.ts +0 -9
- package/dist/cli/src/commands/lsp/check.js +0 -79
- package/dist/cli/src/commands/lsp/index.d.ts +0 -12
- package/dist/cli/src/commands/lsp/index.js +0 -26
- package/dist/cli/src/commands/lsp/install.d.ts +0 -9
- package/dist/cli/src/commands/lsp/install.js +0 -114
- package/dist/cli/src/commands/lsp/list.d.ts +0 -9
- package/dist/cli/src/commands/lsp/list.js +0 -53
- package/dist/cli/src/commands/mcp/index.d.ts +0 -11
- package/dist/cli/src/commands/mcp/index.js +0 -23
- package/dist/cli/src/commands/mcp/list.d.ts +0 -14
- package/dist/cli/src/commands/mcp/list.js +0 -100
- package/dist/cli/src/commands/mcp/reload.d.ts +0 -12
- package/dist/cli/src/commands/mcp/reload.js +0 -54
- package/dist/cli/src/commands/mcp/tools.d.ts +0 -15
- package/dist/cli/src/commands/mcp/tools.js +0 -101
- package/dist/cli/src/commands/memory/index.d.ts +0 -11
- package/dist/cli/src/commands/memory/index.js +0 -11
- package/dist/cli/src/commands/memory/memory.d.ts +0 -10
- package/dist/cli/src/commands/memory/memory.js +0 -21
- package/dist/cli/src/commands/memory/organize.d.ts +0 -48
- package/dist/cli/src/commands/memory/organize.js +0 -233
- package/dist/cli/src/commands/memory/recall.d.ts +0 -10
- package/dist/cli/src/commands/memory/recall.js +0 -69
- package/dist/cli/src/commands/memory/record.d.ts +0 -11
- package/dist/cli/src/commands/memory/record.js +0 -268
- package/dist/cli/src/commands/plugin.d.ts +0 -112
- package/dist/cli/src/commands/plugin.js +0 -186
- package/dist/cli/src/commands/sessions/active.d.ts +0 -14
- package/dist/cli/src/commands/sessions/active.js +0 -79
- package/dist/cli/src/commands/sessions/add-message.d.ts +0 -8
- package/dist/cli/src/commands/sessions/add-message.js +0 -78
- package/dist/cli/src/commands/sessions/checkpoints.d.ts +0 -8
- package/dist/cli/src/commands/sessions/checkpoints.js +0 -133
- package/dist/cli/src/commands/sessions/compact.d.ts +0 -16
- package/dist/cli/src/commands/sessions/compact.js +0 -240
- package/dist/cli/src/commands/sessions/delete.d.ts +0 -14
- package/dist/cli/src/commands/sessions/delete.js +0 -214
- package/dist/cli/src/commands/sessions/get.d.ts +0 -8
- package/dist/cli/src/commands/sessions/get.js +0 -129
- package/dist/cli/src/commands/sessions/grep.d.ts +0 -15
- package/dist/cli/src/commands/sessions/grep.js +0 -210
- package/dist/cli/src/commands/sessions/index.d.ts +0 -42
- package/dist/cli/src/commands/sessions/index.js +0 -93
- package/dist/cli/src/commands/sessions/list.d.ts +0 -21
- package/dist/cli/src/commands/sessions/list.js +0 -163
- package/dist/cli/src/commands/sessions/messages.d.ts +0 -8
- package/dist/cli/src/commands/sessions/messages.js +0 -228
- package/dist/cli/src/commands/sessions/mock.d.ts +0 -10
- package/dist/cli/src/commands/sessions/mock.js +0 -172
- package/dist/cli/src/commands/sessions/new.d.ts +0 -16
- package/dist/cli/src/commands/sessions/new.js +0 -66
- package/dist/cli/src/commands/sessions/rename.d.ts +0 -8
- package/dist/cli/src/commands/sessions/rename.js +0 -82
- package/dist/cli/src/commands/shared/event-handler.d.ts +0 -91
- package/dist/cli/src/commands/shared/event-handler.js +0 -167
- package/dist/cli/src/commands/shared/event-message-formatter.d.ts +0 -150
- package/dist/cli/src/commands/shared/event-message-formatter.js +0 -198
- package/dist/cli/src/commands/shared/index.d.ts +0 -10
- package/dist/cli/src/commands/shared/index.js +0 -8
- package/dist/cli/src/commands/shared/query-executor.d.ts +0 -81
- package/dist/cli/src/commands/shared/query-executor.js +0 -254
- package/dist/cli/src/commands/shared/session-manager.d.ts +0 -49
- package/dist/cli/src/commands/shared/session-manager.js +0 -93
- package/dist/cli/src/commands/skills/get.d.ts +0 -14
- package/dist/cli/src/commands/skills/get.js +0 -76
- package/dist/cli/src/commands/skills/index.d.ts +0 -18
- package/dist/cli/src/commands/skills/index.js +0 -36
- package/dist/cli/src/commands/skills/list.d.ts +0 -8
- package/dist/cli/src/commands/skills/list.js +0 -112
- package/dist/cli/src/commands/skills/reload.d.ts +0 -12
- package/dist/cli/src/commands/skills/reload.js +0 -46
- package/dist/cli/src/commands/skills/search.d.ts +0 -15
- package/dist/cli/src/commands/skills/search.js +0 -110
- package/dist/cli/src/commands/skills/show-config.d.ts +0 -12
- package/dist/cli/src/commands/skills/show-config.js +0 -74
- package/dist/cli/src/commands/tasks/complete.d.ts +0 -15
- package/dist/cli/src/commands/tasks/complete.js +0 -72
- package/dist/cli/src/commands/tasks/create.d.ts +0 -19
- package/dist/cli/src/commands/tasks/create.js +0 -93
- package/dist/cli/src/commands/tasks/delete.d.ts +0 -14
- package/dist/cli/src/commands/tasks/delete.js +0 -71
- package/dist/cli/src/commands/tasks/get.d.ts +0 -15
- package/dist/cli/src/commands/tasks/get.js +0 -98
- package/dist/cli/src/commands/tasks/index.d.ts +0 -20
- package/dist/cli/src/commands/tasks/index.js +0 -50
- package/dist/cli/src/commands/tasks/list.d.ts +0 -18
- package/dist/cli/src/commands/tasks/list.js +0 -116
- package/dist/cli/src/commands/tasks/operations.d.ts +0 -8
- package/dist/cli/src/commands/tasks/operations.js +0 -95
- package/dist/cli/src/commands/tasks/update.d.ts +0 -20
- package/dist/cli/src/commands/tasks/update.js +0 -93
- package/dist/cli/src/commands/tools/exec-tool.d.ts +0 -14
- package/dist/cli/src/commands/tools/exec-tool.js +0 -103
- package/dist/cli/src/commands/tools/get.d.ts +0 -14
- package/dist/cli/src/commands/tools/get.js +0 -97
- package/dist/cli/src/commands/tools/index.d.ts +0 -16
- package/dist/cli/src/commands/tools/index.js +0 -30
- package/dist/cli/src/commands/tools/list.d.ts +0 -14
- package/dist/cli/src/commands/tools/list.js +0 -92
- package/dist/cli/src/commands/tools/shared/index.d.ts +0 -7
- package/dist/cli/src/commands/tools/shared/index.js +0 -7
- package/dist/cli/src/commands/tools/shared/schema-helper.d.ts +0 -53
- package/dist/cli/src/commands/tools/shared/schema-helper.js +0 -74
- package/dist/cli/src/commands/workflow/commands/add.d.ts +0 -22
- package/dist/cli/src/commands/workflow/commands/add.js +0 -271
- package/dist/cli/src/commands/workflow/commands/get.d.ts +0 -20
- package/dist/cli/src/commands/workflow/commands/get.js +0 -169
- package/dist/cli/src/commands/workflow/commands/list.d.ts +0 -21
- package/dist/cli/src/commands/workflow/commands/list.js +0 -117
- package/dist/cli/src/commands/workflow/commands/nodes.d.ts +0 -34
- package/dist/cli/src/commands/workflow/commands/nodes.js +0 -465
- package/dist/cli/src/commands/workflow/commands/remove.d.ts +0 -16
- package/dist/cli/src/commands/workflow/commands/remove.js +0 -77
- package/dist/cli/src/commands/workflow/commands/run.d.ts +0 -32
- package/dist/cli/src/commands/workflow/commands/run.js +0 -335
- package/dist/cli/src/commands/workflow/commands/status.d.ts +0 -17
- package/dist/cli/src/commands/workflow/commands/status.js +0 -125
- package/dist/cli/src/commands/workflow/commands/stop.d.ts +0 -15
- package/dist/cli/src/commands/workflow/commands/stop.js +0 -70
- package/dist/cli/src/commands/workflow/commands/update.d.ts +0 -19
- package/dist/cli/src/commands/workflow/commands/update.js +0 -105
- package/dist/cli/src/commands/workflow/commands/validate.d.ts +0 -14
- package/dist/cli/src/commands/workflow/commands/validate.js +0 -118
- package/dist/cli/src/commands/workflow/index.d.ts +0 -28
- package/dist/cli/src/commands/workflow/index.js +0 -44
- package/dist/cli/src/commands/workflow/renderers.d.ts +0 -60
- package/dist/cli/src/commands/workflow/renderers.js +0 -320
- package/dist/cli/src/commands/workflow/validators/index.d.ts +0 -8
- package/dist/cli/src/commands/workflow/validators/index.js +0 -8
- package/dist/cli/src/commands/workflow/validators/node-validator-factory.d.ts +0 -13
- package/dist/cli/src/commands/workflow/validators/node-validator-factory.js +0 -35
- package/dist/cli/src/commands/workflow/validators/node-validator.d.ts +0 -37
- package/dist/cli/src/commands/workflow/validators/node-validator.js +0 -89
- package/dist/cli/src/commands/workflow/validators/nodes/agent-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/agent-node-validator.js +0 -50
- package/dist/cli/src/commands/workflow/validators/nodes/condition-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/condition-node-validator.js +0 -28
- package/dist/cli/src/commands/workflow/validators/nodes/decorator-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/decorator-node-validator.js +0 -38
- package/dist/cli/src/commands/workflow/validators/nodes/merge-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/merge-node-validator.js +0 -41
- package/dist/cli/src/commands/workflow/validators/nodes/skill-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/skill-node-validator.js +0 -27
- package/dist/cli/src/commands/workflow/validators/nodes/tool-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/tool-node-validator.js +0 -45
- package/dist/cli/src/commands/workflow/validators/nodes/workflow-node-validator.d.ts +0 -11
- package/dist/cli/src/commands/workflow/validators/nodes/workflow-node-validator.js +0 -27
- package/dist/cli/src/commands/workflow/validators/types.d.ts +0 -74
- package/dist/cli/src/commands/workflow/validators/types.js +0 -18
- package/dist/cli/src/commands/workflow/validators/workflow-validator.d.ts +0 -37
- package/dist/cli/src/commands/workflow/validators/workflow-validator.js +0 -284
- package/dist/cli/src/index.d.ts +0 -16
- package/dist/cli/src/index.js +0 -18
- package/dist/cli/src/plugin/apply.d.ts +0 -51
- package/dist/cli/src/plugin/apply.js +0 -85
- package/dist/cli/src/plugin/discover.d.ts +0 -29
- package/dist/cli/src/plugin/discover.js +0 -187
- package/dist/cli/src/plugin/index.d.ts +0 -16
- package/dist/cli/src/plugin/index.js +0 -18
- package/dist/cli/src/plugin/registry.d.ts +0 -109
- package/dist/cli/src/plugin/registry.js +0 -226
- package/dist/cli/src/plugin/types.d.ts +0 -145
- package/dist/cli/src/plugin/types.js +0 -7
- package/dist/cli/src/services/context-handler.service.d.ts +0 -72
- package/dist/cli/src/services/context-handler.service.js +0 -312
- package/dist/cli/src/services/environment.service.d.ts +0 -129
- package/dist/cli/src/services/environment.service.js +0 -544
- package/dist/cli/src/services/output.service.d.ts +0 -68
- package/dist/cli/src/services/output.service.js +0 -104
- package/dist/cli/src/services/quiet-mode.service.d.ts +0 -58
- package/dist/cli/src/services/quiet-mode.service.js +0 -74
- package/dist/cli/src/services/stream-output.service.d.ts +0 -116
- package/dist/cli/src/services/stream-output.service.js +0 -242
- package/dist/cli/src/util/which.d.ts +0 -13
- package/dist/cli/src/util/which.js +0 -50
- package/dist/coder-harness/src/index.d.ts +0 -32
- package/dist/coder-harness/src/index.js +0 -36
- package/dist/coder-harness/src/lsp/client.d.ts +0 -104
- package/dist/coder-harness/src/lsp/client.js +0 -490
- package/dist/coder-harness/src/lsp/client.test.d.ts +0 -5
- package/dist/coder-harness/src/lsp/client.test.js +0 -154
- package/dist/coder-harness/src/lsp/language-map.d.ts +0 -42
- package/dist/coder-harness/src/lsp/language-map.js +0 -105
- package/dist/coder-harness/src/lsp/language-map.test.d.ts +0 -5
- package/dist/coder-harness/src/lsp/language-map.test.js +0 -95
- package/dist/coder-harness/src/lsp/manager.d.ts +0 -166
- package/dist/coder-harness/src/lsp/manager.js +0 -457
- package/dist/coder-harness/src/lsp/manager.test.d.ts +0 -11
- package/dist/coder-harness/src/lsp/manager.test.js +0 -121
- package/dist/coder-harness/src/lsp/preload.integration.test.d.ts +0 -5
- package/dist/coder-harness/src/lsp/preload.integration.test.js +0 -125
- package/dist/coder-harness/src/lsp/server.d.ts +0 -72
- package/dist/coder-harness/src/lsp/server.js +0 -271
- package/dist/coder-harness/src/lsp/server.test.d.ts +0 -5
- package/dist/coder-harness/src/lsp/server.test.js +0 -78
- package/dist/coder-harness/src/lsp-deps/config.d.ts +0 -84
- package/dist/coder-harness/src/lsp-deps/config.js +0 -123
- package/dist/coder-harness/src/lsp-deps/index.d.ts +0 -10
- package/dist/coder-harness/src/lsp-deps/index.js +0 -8
- package/dist/coder-harness/src/lsp-deps/installer.d.ts +0 -101
- package/dist/coder-harness/src/lsp-deps/installer.js +0 -207
- package/dist/coder-harness/src/plugins/code-check-manager.d.ts +0 -43
- package/dist/coder-harness/src/plugins/code-check-manager.js +0 -238
- package/dist/coder-harness/src/plugins/code-check-manager.test.d.ts +0 -2
- package/dist/coder-harness/src/plugins/code-check-manager.test.js +0 -45
- package/dist/coder-harness/src/plugins/code-check-plugin.d.ts +0 -79
- package/dist/coder-harness/src/plugins/code-check-plugin.js +0 -181
- package/dist/coder-harness/src/plugins/code-check-plugin.test.d.ts +0 -2
- package/dist/coder-harness/src/plugins/code-check-plugin.test.js +0 -94
- package/dist/coder-harness/src/plugins/lsp-plugin.d.ts +0 -131
- package/dist/coder-harness/src/plugins/lsp-plugin.js +0 -253
- package/dist/coder-harness/src/plugins/lsp-plugin.test.d.ts +0 -9
- package/dist/coder-harness/src/plugins/lsp-plugin.test.js +0 -304
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.d.ts +0 -192
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.js +0 -294
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.test.d.ts +0 -5
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.test.js +0 -312
- package/dist/coder-harness/src/plugins/reminder-plugin.d.ts +0 -69
- package/dist/coder-harness/src/plugins/reminder-plugin.js +0 -92
- package/dist/coder-harness/src/plugins/reminder-plugin.test.d.ts +0 -5
- package/dist/coder-harness/src/plugins/reminder-plugin.test.js +0 -132
- package/dist/coder-harness/src/types/linter.d.ts +0 -263
- package/dist/coder-harness/src/types/linter.js +0 -18
- package/dist/coder-harness/src/util/glob.d.ts +0 -22
- package/dist/coder-harness/src/util/glob.js +0 -31
- package/dist/coder-harness/src/util/glob.test.d.ts +0 -5
- package/dist/coder-harness/src/util/glob.test.js +0 -63
- package/dist/coder-harness/src/util/which.d.ts +0 -13
- package/dist/coder-harness/src/util/which.js +0 -46
- package/dist/core/src/config/config-component.d.ts +0 -323
- package/dist/core/src/config/config-component.js +0 -686
- package/dist/core/src/config/config-component.test.d.ts +0 -2
- package/dist/core/src/config/config-component.test.js +0 -486
- package/dist/core/src/config/config-parser.d.ts +0 -46
- package/dist/core/src/config/config-parser.js +0 -173
- package/dist/core/src/config/config-parser.test.d.ts +0 -2
- package/dist/core/src/config/config-parser.test.js +0 -252
- package/dist/core/src/config/decentralized-config.test.d.ts +0 -2
- package/dist/core/src/config/decentralized-config.test.js +0 -602
- package/dist/core/src/config/env-key.d.ts +0 -93
- package/dist/core/src/config/env-key.js +0 -189
- package/dist/core/src/config/env-source.d.ts +0 -83
- package/dist/core/src/config/env-source.js +0 -240
- package/dist/core/src/config/env-source.test.d.ts +0 -2
- package/dist/core/src/config/env-source.test.js +0 -196
- package/dist/core/src/config/file-source.d.ts +0 -87
- package/dist/core/src/config/file-source.js +0 -349
- package/dist/core/src/config/file-source.test.d.ts +0 -2
- package/dist/core/src/config/file-source.test.js +0 -275
- package/dist/core/src/config/index.d.ts +0 -5
- package/dist/core/src/config/index.js +0 -5
- package/dist/core/src/config/protocol-resolver.d.ts +0 -95
- package/dist/core/src/config/protocol-resolver.js +0 -175
- package/dist/core/src/config/protocol-resolver.test.d.ts +0 -2
- package/dist/core/src/config/protocol-resolver.test.js +0 -167
- package/dist/core/src/env/agent/agent-component.abort.test.d.ts +0 -11
- package/dist/core/src/env/agent/agent-component.abort.test.js +0 -440
- package/dist/core/src/env/agent/agent-component.d.ts +0 -349
- package/dist/core/src/env/agent/agent-component.js +0 -1481
- package/dist/core/src/env/agent/agent-component.record-session.test.d.ts +0 -14
- package/dist/core/src/env/agent/agent-component.record-session.test.js +0 -280
- package/dist/core/src/env/agent/agent-component.test.d.ts +0 -7
- package/dist/core/src/env/agent/agent-component.test.js +0 -1169
- package/dist/core/src/env/agent/agent-component.tool-error.test.d.ts +0 -25
- package/dist/core/src/env/agent/agent-component.tool-error.test.js +0 -272
- package/dist/core/src/env/agent/agent-config-registration.d.ts +0 -19
- package/dist/core/src/env/agent/agent-config-registration.js +0 -41
- package/dist/core/src/env/agent/agent-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/agent/agent-config-registration.test.js +0 -193
- package/dist/core/src/env/agent/agent-reminder-plugin.integration.test.d.ts +0 -7
- package/dist/core/src/env/agent/agent-reminder-plugin.integration.test.js +0 -206
- package/dist/core/src/env/agent/index.d.ts +0 -10
- package/dist/core/src/env/agent/index.js +0 -9
- package/dist/core/src/env/agent/summary-agent.d.ts +0 -101
- package/dist/core/src/env/agent/summary-agent.js +0 -473
- package/dist/core/src/env/agent/summary-agent.parse-hint.test.d.ts +0 -12
- package/dist/core/src/env/agent/summary-agent.parse-hint.test.js +0 -267
- package/dist/core/src/env/agent/types.d.ts +0 -394
- package/dist/core/src/env/agent/types.js +0 -9
- package/dist/core/src/env/commands/commands-component.d.ts +0 -98
- package/dist/core/src/env/commands/commands-component.js +0 -517
- package/dist/core/src/env/commands/commands-component.test.d.ts +0 -2
- package/dist/core/src/env/commands/commands-component.test.js +0 -304
- package/dist/core/src/env/commands/commands-config-registration.d.ts +0 -20
- package/dist/core/src/env/commands/commands-config-registration.js +0 -33
- package/dist/core/src/env/commands/commands-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/commands/commands-config-registration.test.js +0 -164
- package/dist/core/src/env/commands/index.d.ts +0 -8
- package/dist/core/src/env/commands/index.js +0 -8
- package/dist/core/src/env/commands/parser.d.ts +0 -19
- package/dist/core/src/env/commands/parser.js +0 -97
- package/dist/core/src/env/commands/parser.test.d.ts +0 -2
- package/dist/core/src/env/commands/parser.test.js +0 -155
- package/dist/core/src/env/commands/types.d.ts +0 -134
- package/dist/core/src/env/commands/types.js +0 -7
- package/dist/core/src/env/commands-prompt-integration.test.d.ts +0 -2
- package/dist/core/src/env/commands-prompt-integration.test.js +0 -205
- package/dist/core/src/env/component-env.test.d.ts +0 -2
- package/dist/core/src/env/component-env.test.js +0 -101
- package/dist/core/src/env/component.d.ts +0 -187
- package/dist/core/src/env/component.js +0 -160
- package/dist/core/src/env/constants.d.ts +0 -99
- package/dist/core/src/env/constants.js +0 -107
- package/dist/core/src/env/constants.test.d.ts +0 -2
- package/dist/core/src/env/constants.test.js +0 -55
- package/dist/core/src/env/debug/debug-component.d.ts +0 -161
- package/dist/core/src/env/debug/debug-component.js +0 -441
- package/dist/core/src/env/debug/debug-component.test.d.ts +0 -2
- package/dist/core/src/env/debug/debug-component.test.js +0 -89
- package/dist/core/src/env/debug/formatters/index.d.ts +0 -9
- package/dist/core/src/env/debug/formatters/index.js +0 -9
- package/dist/core/src/env/debug/formatters/repl-formatter.d.ts +0 -81
- package/dist/core/src/env/debug/formatters/repl-formatter.js +0 -309
- package/dist/core/src/env/debug/formatters/repl-formatter.test.d.ts +0 -2
- package/dist/core/src/env/debug/formatters/repl-formatter.test.js +0 -119
- package/dist/core/src/env/debug/formatters/trace-formatter.d.ts +0 -44
- package/dist/core/src/env/debug/formatters/trace-formatter.js +0 -157
- package/dist/core/src/env/debug/formatters/trace-formatter.test.d.ts +0 -2
- package/dist/core/src/env/debug/formatters/trace-formatter.test.js +0 -102
- package/dist/core/src/env/debug/formatters/tree-formatter.d.ts +0 -73
- package/dist/core/src/env/debug/formatters/tree-formatter.js +0 -252
- package/dist/core/src/env/debug/formatters/tree-formatter.test.d.ts +0 -2
- package/dist/core/src/env/debug/formatters/tree-formatter.test.js +0 -91
- package/dist/core/src/env/debug/index.d.ts +0 -16
- package/dist/core/src/env/debug/index.js +0 -18
- package/dist/core/src/env/debug/parser/regex-parser.d.ts +0 -50
- package/dist/core/src/env/debug/parser/regex-parser.js +0 -167
- package/dist/core/src/env/debug/parser/regex-parser.test.d.ts +0 -2
- package/dist/core/src/env/debug/parser/regex-parser.test.js +0 -147
- package/dist/core/src/env/debug/parser/span-builder.d.ts +0 -80
- package/dist/core/src/env/debug/parser/span-builder.js +0 -321
- package/dist/core/src/env/debug/parser/span-builder.test.d.ts +0 -2
- package/dist/core/src/env/debug/parser/span-builder.test.js +0 -207
- package/dist/core/src/env/debug/reader/log-reader.d.ts +0 -56
- package/dist/core/src/env/debug/reader/log-reader.js +0 -163
- package/dist/core/src/env/debug/reader/log-reader.test.d.ts +0 -2
- package/dist/core/src/env/debug/reader/log-reader.test.js +0 -132
- package/dist/core/src/env/debug/reader/span-db-reader.d.ts +0 -71
- package/dist/core/src/env/debug/reader/span-db-reader.js +0 -167
- package/dist/core/src/env/debug/reader/span-db-reader.test.d.ts +0 -5
- package/dist/core/src/env/debug/reader/span-db-reader.test.js +0 -96
- package/dist/core/src/env/debug/types.d.ts +0 -146
- package/dist/core/src/env/debug/types.js +0 -7
- package/dist/core/src/env/debug/types.test.d.ts +0 -2
- package/dist/core/src/env/debug/types.test.js +0 -160
- package/dist/core/src/env/environment-init.test.d.ts +0 -2
- package/dist/core/src/env/environment-init.test.js +0 -142
- package/dist/core/src/env/environment-lifecycle.test.d.ts +0 -16
- package/dist/core/src/env/environment-lifecycle.test.js +0 -391
- package/dist/core/src/env/environment-service.test.d.ts +0 -7
- package/dist/core/src/env/environment-service.test.js +0 -265
- package/dist/core/src/env/environment.d.ts +0 -163
- package/dist/core/src/env/environment.handle-query.test.d.ts +0 -5
- package/dist/core/src/env/environment.handle-query.test.js +0 -74
- package/dist/core/src/env/environment.js +0 -607
- package/dist/core/src/env/environment.test.d.ts +0 -5
- package/dist/core/src/env/environment.test.js +0 -188
- package/dist/core/src/env/errors.d.ts +0 -96
- package/dist/core/src/env/errors.js +0 -123
- package/dist/core/src/env/errors.test.d.ts +0 -2
- package/dist/core/src/env/errors.test.js +0 -110
- package/dist/core/src/env/event-source/event-source-agent-handler.d.ts +0 -45
- package/dist/core/src/env/event-source/event-source-agent-handler.js +0 -80
- package/dist/core/src/env/event-source/event-source-agent-handler.test.d.ts +0 -2
- package/dist/core/src/env/event-source/event-source-agent-handler.test.js +0 -165
- package/dist/core/src/env/event-source/event-source-component.d.ts +0 -197
- package/dist/core/src/env/event-source/event-source-component.js +0 -1155
- package/dist/core/src/env/event-source/event-source-component.process-cleanup.test.d.ts +0 -9
- package/dist/core/src/env/event-source/event-source-component.process-cleanup.test.js +0 -207
- package/dist/core/src/env/event-source/event-source-component.stop.test.d.ts +0 -7
- package/dist/core/src/env/event-source/event-source-component.stop.test.js +0 -293
- package/dist/core/src/env/event-source/event-source-component.test.d.ts +0 -2
- package/dist/core/src/env/event-source/event-source-component.test.js +0 -1036
- package/dist/core/src/env/event-source/event-source-config-registration.d.ts +0 -19
- package/dist/core/src/env/event-source/event-source-config-registration.js +0 -32
- package/dist/core/src/env/event-source/event-source-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/event-source/event-source-config-registration.test.js +0 -208
- package/dist/core/src/env/event-source/event-source-integration.test.d.ts +0 -2
- package/dist/core/src/env/event-source/event-source-integration.test.js +0 -275
- package/dist/core/src/env/event-source/event-source-platform.test.d.ts +0 -12
- package/dist/core/src/env/event-source/event-source-platform.test.js +0 -536
- package/dist/core/src/env/event-source/types.d.ts +0 -213
- package/dist/core/src/env/event-source/types.js +0 -57
- package/dist/core/src/env/hook/global-hook-manager.d.ts +0 -74
- package/dist/core/src/env/hook/global-hook-manager.js +0 -126
- package/dist/core/src/env/hook/hook-manager.d.ts +0 -133
- package/dist/core/src/env/hook/hook-manager.js +0 -249
- package/dist/core/src/env/hook/hook-manager.test.d.ts +0 -2
- package/dist/core/src/env/hook/hook-manager.test.js +0 -275
- package/dist/core/src/env/hook/index.d.ts +0 -10
- package/dist/core/src/env/hook/index.js +0 -12
- package/dist/core/src/env/hook/types.d.ts +0 -104
- package/dist/core/src/env/hook/types.js +0 -33
- package/dist/core/src/env/index.d.ts +0 -23
- package/dist/core/src/env/index.js +0 -26
- package/dist/core/src/env/interface.d.ts +0 -156
- package/dist/core/src/env/interface.js +0 -19
- package/dist/core/src/env/llm/hooks.d.ts +0 -151
- package/dist/core/src/env/llm/hooks.js +0 -209
- package/dist/core/src/env/llm/hooks.test.d.ts +0 -2
- package/dist/core/src/env/llm/hooks.test.js +0 -233
- package/dist/core/src/env/llm/index.d.ts +0 -12
- package/dist/core/src/env/llm/index.js +0 -16
- package/dist/core/src/env/llm/invoke-threshold-check.test.d.ts +0 -11
- package/dist/core/src/env/llm/invoke-threshold-check.test.js +0 -76
- package/dist/core/src/env/llm/invoke-timeout.test.d.ts +0 -2
- package/dist/core/src/env/llm/invoke-timeout.test.js +0 -31
- package/dist/core/src/env/llm/invoke.d.ts +0 -118
- package/dist/core/src/env/llm/invoke.js +0 -755
- package/dist/core/src/env/llm/invoke.test.d.ts +0 -2
- package/dist/core/src/env/llm/invoke.test.js +0 -62
- package/dist/core/src/env/llm/llm-config.test.d.ts +0 -2
- package/dist/core/src/env/llm/llm-config.test.js +0 -453
- package/dist/core/src/env/llm/llm.d.ts +0 -164
- package/dist/core/src/env/llm/llm.js +0 -461
- package/dist/core/src/env/llm/llm.test.d.ts +0 -2
- package/dist/core/src/env/llm/llm.test.js +0 -197
- package/dist/core/src/env/llm/provider.d.ts +0 -41
- package/dist/core/src/env/llm/provider.js +0 -90
- package/dist/core/src/env/llm/provider.test.d.ts +0 -2
- package/dist/core/src/env/llm/provider.test.js +0 -152
- package/dist/core/src/env/llm/transform.d.ts +0 -58
- package/dist/core/src/env/llm/transform.js +0 -254
- package/dist/core/src/env/llm/transform.test.d.ts +0 -2
- package/dist/core/src/env/llm/transform.test.js +0 -215
- package/dist/core/src/env/llm/types.d.ts +0 -771
- package/dist/core/src/env/llm/types.js +0 -67
- package/dist/core/src/env/llm/types.test.d.ts +0 -2
- package/dist/core/src/env/llm/types.test.js +0 -520
- package/dist/core/src/env/log-trace/decorator-otel.test.d.ts +0 -7
- package/dist/core/src/env/log-trace/decorator-otel.test.js +0 -204
- package/dist/core/src/env/log-trace/decorator.d.ts +0 -47
- package/dist/core/src/env/log-trace/decorator.js +0 -190
- package/dist/core/src/env/log-trace/index.d.ts +0 -15
- package/dist/core/src/env/log-trace/index.js +0 -20
- package/dist/core/src/env/log-trace/log-trace-component.d.ts +0 -262
- package/dist/core/src/env/log-trace/log-trace-component.js +0 -405
- package/dist/core/src/env/log-trace/log-trace-component.test.d.ts +0 -7
- package/dist/core/src/env/log-trace/log-trace-component.test.js +0 -212
- package/dist/core/src/env/log-trace/log-trace-config-registration.d.ts +0 -20
- package/dist/core/src/env/log-trace/log-trace-config-registration.js +0 -40
- package/dist/core/src/env/log-trace/log-trace-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/log-trace/log-trace-config-registration.test.js +0 -295
- package/dist/core/src/env/log-trace/logger.d.ts +0 -84
- package/dist/core/src/env/log-trace/logger.js +0 -445
- package/dist/core/src/env/log-trace/logger.test.d.ts +0 -2
- package/dist/core/src/env/log-trace/logger.test.js +0 -118
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.d.ts +0 -106
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.js +0 -149
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.test.d.ts +0 -9
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.test.js +0 -122
- package/dist/core/src/env/log-trace/opentelemetry/integration.test.d.ts +0 -19
- package/dist/core/src/env/log-trace/opentelemetry/integration.test.js +0 -535
- package/dist/core/src/env/log-trace/opentelemetry/mod.d.ts +0 -25
- package/dist/core/src/env/log-trace/opentelemetry/mod.js +0 -25
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.d.ts +0 -82
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.js +0 -109
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.test.d.ts +0 -9
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.test.js +0 -143
- package/dist/core/src/env/log-trace/opentelemetry/propagation.d.ts +0 -80
- package/dist/core/src/env/log-trace/opentelemetry/propagation.js +0 -163
- package/dist/core/src/env/log-trace/opentelemetry/propagation.test.d.ts +0 -11
- package/dist/core/src/env/log-trace/opentelemetry/propagation.test.js +0 -197
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider-context.test.d.ts +0 -8
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider-context.test.js +0 -127
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.d.ts +0 -143
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.js +0 -451
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.test.d.ts +0 -11
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.test.js +0 -291
- package/dist/core/src/env/log-trace/span-storage.d.ts +0 -38
- package/dist/core/src/env/log-trace/span-storage.js +0 -185
- package/dist/core/src/env/log-trace/span-storage.test.d.ts +0 -5
- package/dist/core/src/env/log-trace/span-storage.test.js +0 -121
- package/dist/core/src/env/log-trace/trace-context.d.ts +0 -29
- package/dist/core/src/env/log-trace/trace-context.js +0 -133
- package/dist/core/src/env/log-trace/trace-context.test.d.ts +0 -2
- package/dist/core/src/env/log-trace/trace-context.test.js +0 -149
- package/dist/core/src/env/log-trace/types.d.ts +0 -128
- package/dist/core/src/env/log-trace/types.js +0 -21
- package/dist/core/src/env/log-trace/types.test.d.ts +0 -2
- package/dist/core/src/env/log-trace/types.test.js +0 -53
- package/dist/core/src/env/mcp/__integration__/mcp-component.integration.test.d.ts +0 -2
- package/dist/core/src/env/mcp/__integration__/mcp-component.integration.test.js +0 -322
- package/dist/core/src/env/mcp/config.d.ts +0 -104
- package/dist/core/src/env/mcp/config.js +0 -65
- package/dist/core/src/env/mcp/config.test.d.ts +0 -2
- package/dist/core/src/env/mcp/config.test.js +0 -56
- package/dist/core/src/env/mcp/index.d.ts +0 -12
- package/dist/core/src/env/mcp/index.js +0 -14
- package/dist/core/src/env/mcp/loader.d.ts +0 -67
- package/dist/core/src/env/mcp/loader.js +0 -163
- package/dist/core/src/env/mcp/loader.test.d.ts +0 -2
- package/dist/core/src/env/mcp/loader.test.js +0 -128
- package/dist/core/src/env/mcp/mcp-component.d.ts +0 -55
- package/dist/core/src/env/mcp/mcp-component.js +0 -296
- package/dist/core/src/env/mcp/mcp-component.test.d.ts +0 -2
- package/dist/core/src/env/mcp/mcp-component.test.js +0 -92
- package/dist/core/src/env/mcp/mcp-config-registration.d.ts +0 -20
- package/dist/core/src/env/mcp/mcp-config-registration.js +0 -45
- package/dist/core/src/env/mcp/mcp-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/mcp/mcp-config-registration.test.js +0 -258
- package/dist/core/src/env/mcp/scanner.d.ts +0 -39
- package/dist/core/src/env/mcp/scanner.js +0 -206
- package/dist/core/src/env/mcp/scanner.test.d.ts +0 -2
- package/dist/core/src/env/mcp/scanner.test.js +0 -115
- package/dist/core/src/env/mcp/tool/adapter.d.ts +0 -33
- package/dist/core/src/env/mcp/tool/adapter.js +0 -413
- package/dist/core/src/env/mcp/tool/adapter.test.d.ts +0 -2
- package/dist/core/src/env/mcp/tool/adapter.test.js +0 -436
- package/dist/core/src/env/mcp/tool/index.d.ts +0 -5
- package/dist/core/src/env/mcp/tool/index.js +0 -5
- package/dist/core/src/env/mcp/types.d.ts +0 -122
- package/dist/core/src/env/mcp/types.js +0 -33
- package/dist/core/src/env/mcp/types.test.d.ts +0 -2
- package/dist/core/src/env/mcp/types.test.js +0 -136
- package/dist/core/src/env/memory/built-in/index.d.ts +0 -42
- package/dist/core/src/env/memory/built-in/index.js +0 -24
- package/dist/core/src/env/memory/built-in/recall-memory.d.ts +0 -30
- package/dist/core/src/env/memory/built-in/recall-memory.js +0 -79
- package/dist/core/src/env/memory/built-in/record-memory.d.ts +0 -45
- package/dist/core/src/env/memory/built-in/record-memory.js +0 -111
- package/dist/core/src/env/memory/index.d.ts +0 -11
- package/dist/core/src/env/memory/index.js +0 -16
- package/dist/core/src/env/memory/memory-component.d.ts +0 -115
- package/dist/core/src/env/memory/memory-component.js +0 -406
- package/dist/core/src/env/memory/memory-component.test.d.ts +0 -5
- package/dist/core/src/env/memory/memory-component.test.js +0 -183
- package/dist/core/src/env/memory/memory-config-registration.d.ts +0 -19
- package/dist/core/src/env/memory/memory-config-registration.js +0 -43
- package/dist/core/src/env/memory/memory-config-registration.test.d.ts +0 -5
- package/dist/core/src/env/memory/memory-config-registration.test.js +0 -48
- package/dist/core/src/env/memory/memory-config.d.ts +0 -19
- package/dist/core/src/env/memory/memory-config.js +0 -41
- package/dist/core/src/env/memory/memory-file.test.d.ts +0 -7
- package/dist/core/src/env/memory/memory-file.test.js +0 -222
- package/dist/core/src/env/memory/plugin/index.d.ts +0 -17
- package/dist/core/src/env/memory/plugin/index.js +0 -17
- package/dist/core/src/env/memory/plugin/memory-agent.d.ts +0 -127
- package/dist/core/src/env/memory/plugin/memory-agent.js +0 -250
- package/dist/core/src/env/memory/plugin/memory-agent.test.d.ts +0 -11
- package/dist/core/src/env/memory/plugin/memory-agent.test.js +0 -207
- package/dist/core/src/env/memory/plugin/memory-manager.d.ts +0 -72
- package/dist/core/src/env/memory/plugin/memory-manager.js +0 -166
- package/dist/core/src/env/memory/plugin/memory-plugin-agent.test.d.ts +0 -7
- package/dist/core/src/env/memory/plugin/memory-plugin-agent.test.js +0 -114
- package/dist/core/src/env/memory/plugin/memory-plugin.d.ts +0 -104
- package/dist/core/src/env/memory/plugin/memory-plugin.js +0 -155
- package/dist/core/src/env/memory/plugin/plugin-simplified.test.d.ts +0 -13
- package/dist/core/src/env/memory/plugin/plugin-simplified.test.js +0 -44
- package/dist/core/src/env/memory/plugin/recall-memory.d.ts +0 -17
- package/dist/core/src/env/memory/plugin/recall-memory.js +0 -44
- package/dist/core/src/env/memory/plugin/recall-memory.test.d.ts +0 -7
- package/dist/core/src/env/memory/plugin/recall-memory.test.js +0 -86
- package/dist/core/src/env/memory/plugin/types.d.ts +0 -76
- package/dist/core/src/env/memory/plugin/types.js +0 -16
- package/dist/core/src/env/memory/tools/memory-agent-tools.d.ts +0 -110
- package/dist/core/src/env/memory/tools/memory-agent-tools.js +0 -157
- package/dist/core/src/env/memory/types.d.ts +0 -81
- package/dist/core/src/env/memory/types.js +0 -25
- package/dist/core/src/env/paths.d.ts +0 -47
- package/dist/core/src/env/paths.js +0 -91
- package/dist/core/src/env/prompt/index.d.ts +0 -8
- package/dist/core/src/env/prompt/index.js +0 -7
- package/dist/core/src/env/prompt/memory-prompts.test.d.ts +0 -7
- package/dist/core/src/env/prompt/memory-prompts.test.js +0 -78
- package/dist/core/src/env/prompt/prompt-component.d.ts +0 -163
- package/dist/core/src/env/prompt/prompt-component.js +0 -489
- package/dist/core/src/env/prompt/prompt-component.test.d.ts +0 -7
- package/dist/core/src/env/prompt/prompt-component.test.js +0 -397
- package/dist/core/src/env/prompt/prompt-config-registration.d.ts +0 -19
- package/dist/core/src/env/prompt/prompt-config-registration.js +0 -34
- package/dist/core/src/env/prompt/prompt-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/prompt/prompt-config-registration.test.js +0 -172
- package/dist/core/src/env/prompt/prompts-index.d.ts +0 -27
- package/dist/core/src/env/prompt/prompts-index.js +0 -498
- package/dist/core/src/env/prompt/renderer.d.ts +0 -22
- package/dist/core/src/env/prompt/renderer.js +0 -47
- package/dist/core/src/env/prompt/types.d.ts +0 -159
- package/dist/core/src/env/prompt/types.js +0 -48
- package/dist/core/src/env/session/hooks.d.ts +0 -15
- package/dist/core/src/env/session/hooks.js +0 -5
- package/dist/core/src/env/session/index.d.ts +0 -19
- package/dist/core/src/env/session/index.js +0 -13
- package/dist/core/src/env/session/search-query-parser.d.ts +0 -42
- package/dist/core/src/env/session/search-query-parser.js +0 -141
- package/dist/core/src/env/session/search-query-parser.test.d.ts +0 -14
- package/dist/core/src/env/session/search-query-parser.test.js +0 -332
- package/dist/core/src/env/session/session-checkpoint.test.d.ts +0 -7
- package/dist/core/src/env/session/session-checkpoint.test.js +0 -455
- package/dist/core/src/env/session/session-component.d.ts +0 -290
- package/dist/core/src/env/session/session-component.extract-recent-messages.test.d.ts +0 -7
- package/dist/core/src/env/session/session-component.extract-recent-messages.test.js +0 -166
- package/dist/core/src/env/session/session-component.js +0 -981
- package/dist/core/src/env/session/session-component.test.d.ts +0 -7
- package/dist/core/src/env/session/session-component.test.js +0 -107
- package/dist/core/src/env/session/session-config-registration.d.ts +0 -19
- package/dist/core/src/env/session/session-config-registration.js +0 -47
- package/dist/core/src/env/session/session-config-registration.test.d.ts +0 -5
- package/dist/core/src/env/session/session-config-registration.test.js +0 -115
- package/dist/core/src/env/session/session-message-converter.d.ts +0 -125
- package/dist/core/src/env/session/session-message-converter.js +0 -354
- package/dist/core/src/env/session/session-message-converter.test.d.ts +0 -8
- package/dist/core/src/env/session/session-message-converter.test.js +0 -623
- package/dist/core/src/env/session/session-message-e2e.test.d.ts +0 -8
- package/dist/core/src/env/session/session-message-e2e.test.js +0 -376
- package/dist/core/src/env/session/session-search.test.d.ts +0 -7
- package/dist/core/src/env/session/session-search.test.js +0 -338
- package/dist/core/src/env/session/session-store.d.ts +0 -103
- package/dist/core/src/env/session/session-store.js +0 -5
- package/dist/core/src/env/session/session-store.test.d.ts +0 -2
- package/dist/core/src/env/session/session-store.test.js +0 -291
- package/dist/core/src/env/session/storage/index.d.ts +0 -6
- package/dist/core/src/env/session/storage/index.js +0 -6
- package/dist/core/src/env/session/storage/memory.d.ts +0 -44
- package/dist/core/src/env/session/storage/memory.js +0 -404
- package/dist/core/src/env/session/storage/sqlite.d.ts +0 -64
- package/dist/core/src/env/session/storage/sqlite.js +0 -616
- package/dist/core/src/env/session/types.d.ts +0 -613
- package/dist/core/src/env/session/types.js +0 -32
- package/dist/core/src/env/skill/config.d.ts +0 -14
- package/dist/core/src/env/skill/config.js +0 -36
- package/dist/core/src/env/skill/index.d.ts +0 -7
- package/dist/core/src/env/skill/index.js +0 -7
- package/dist/core/src/env/skill/parser.d.ts +0 -10
- package/dist/core/src/env/skill/parser.js +0 -64
- package/dist/core/src/env/skill/parser.test.d.ts +0 -2
- package/dist/core/src/env/skill/parser.test.js +0 -92
- package/dist/core/src/env/skill/scanner.d.ts +0 -26
- package/dist/core/src/env/skill/scanner.js +0 -98
- package/dist/core/src/env/skill/scanner.test.d.ts +0 -2
- package/dist/core/src/env/skill/scanner.test.js +0 -166
- package/dist/core/src/env/skill/skill-component.d.ts +0 -90
- package/dist/core/src/env/skill/skill-component.js +0 -266
- package/dist/core/src/env/skill/skill-component.test.d.ts +0 -2
- package/dist/core/src/env/skill/skill-component.test.js +0 -187
- package/dist/core/src/env/skill/skill-config-registration.d.ts +0 -19
- package/dist/core/src/env/skill/skill-config-registration.js +0 -38
- package/dist/core/src/env/skill/skill-config-registration.test.d.ts +0 -5
- package/dist/core/src/env/skill/skill-config-registration.test.js +0 -44
- package/dist/core/src/env/skill/tool/index.d.ts +0 -2
- package/dist/core/src/env/skill/tool/index.js +0 -2
- package/dist/core/src/env/skill/tool/skill-tool.d.ts +0 -16
- package/dist/core/src/env/skill/tool/skill-tool.js +0 -64
- package/dist/core/src/env/skill/tool/skill-tool.test.d.ts +0 -2
- package/dist/core/src/env/skill/tool/skill-tool.test.js +0 -77
- package/dist/core/src/env/skill/types.d.ts +0 -62
- package/dist/core/src/env/skill/types.js +0 -8
- package/dist/core/src/env/task/delegate/delegate-tool.d.ts +0 -141
- package/dist/core/src/env/task/delegate/delegate-tool.js +0 -767
- package/dist/core/src/env/task/delegate/delegate-tool.test.d.ts +0 -7
- package/dist/core/src/env/task/delegate/delegate-tool.test.js +0 -386
- package/dist/core/src/env/task/delegate/index.d.ts +0 -9
- package/dist/core/src/env/task/delegate/index.js +0 -8
- package/dist/core/src/env/task/delegate/stop-tool.d.ts +0 -13
- package/dist/core/src/env/task/delegate/stop-tool.js +0 -108
- package/dist/core/src/env/task/delegate/stop-tool.test.d.ts +0 -7
- package/dist/core/src/env/task/delegate/stop-tool.test.js +0 -103
- package/dist/core/src/env/task/delegate/task-events.d.ts +0 -81
- package/dist/core/src/env/task/delegate/task-events.js +0 -67
- package/dist/core/src/env/task/delegate/task-events.test.d.ts +0 -5
- package/dist/core/src/env/task/delegate/task-events.test.js +0 -149
- package/dist/core/src/env/task/hooks/contexts.d.ts +0 -165
- package/dist/core/src/env/task/hooks/contexts.js +0 -5
- package/dist/core/src/env/task/hooks/contexts.test.d.ts +0 -5
- package/dist/core/src/env/task/hooks/contexts.test.js +0 -73
- package/dist/core/src/env/task/hooks/index.d.ts +0 -8
- package/dist/core/src/env/task/hooks/index.js +0 -8
- package/dist/core/src/env/task/hooks/task-hook-points.d.ts +0 -32
- package/dist/core/src/env/task/hooks/task-hook-points.js +0 -37
- package/dist/core/src/env/task/hooks/task-hook-points.test.d.ts +0 -5
- package/dist/core/src/env/task/hooks/task-hook-points.test.js +0 -28
- package/dist/core/src/env/task/index.d.ts +0 -7
- package/dist/core/src/env/task/index.js +0 -7
- package/dist/core/src/env/task/plugins/index.d.ts +0 -7
- package/dist/core/src/env/task/plugins/index.js +0 -7
- package/dist/core/src/env/task/plugins/task-plugin.d.ts +0 -67
- package/dist/core/src/env/task/plugins/task-plugin.js +0 -40
- package/dist/core/src/env/task/plugins/task-plugin.test.d.ts +0 -5
- package/dist/core/src/env/task/plugins/task-plugin.test.js +0 -60
- package/dist/core/src/env/task/plugins/task-tag-plugin.d.ts +0 -79
- package/dist/core/src/env/task/plugins/task-tag-plugin.js +0 -250
- package/dist/core/src/env/task/plugins/task-tag-plugin.test.d.ts +0 -9
- package/dist/core/src/env/task/plugins/task-tag-plugin.test.js +0 -310
- package/dist/core/src/env/task/plugins/task-workflow-extractor.integration.test.d.ts +0 -5
- package/dist/core/src/env/task/plugins/task-workflow-extractor.integration.test.js +0 -198
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.d.ts +0 -36
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.js +0 -197
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.test.d.ts +0 -8
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.test.js +0 -88
- package/dist/core/src/env/task/storage/index.d.ts +0 -6
- package/dist/core/src/env/task/storage/index.js +0 -6
- package/dist/core/src/env/task/storage/sqlite-task-store.d.ts +0 -127
- package/dist/core/src/env/task/storage/sqlite-task-store.js +0 -718
- package/dist/core/src/env/task/storage/sqlite-task-store.test.d.ts +0 -5
- package/dist/core/src/env/task/storage/sqlite-task-store.test.js +0 -235
- package/dist/core/src/env/task/storage/task-search.test.d.ts +0 -5
- package/dist/core/src/env/task/storage/task-search.test.js +0 -236
- package/dist/core/src/env/task/tag-service.d.ts +0 -139
- package/dist/core/src/env/task/tag-service.js +0 -123
- package/dist/core/src/env/task/tag-service.test.d.ts +0 -5
- package/dist/core/src/env/task/tag-service.test.js +0 -157
- package/dist/core/src/env/task/task-component.d.ts +0 -171
- package/dist/core/src/env/task/task-component.js +0 -519
- package/dist/core/src/env/task/task-component.test.d.ts +0 -5
- package/dist/core/src/env/task/task-component.test.js +0 -163
- package/dist/core/src/env/task/task-config-registration.d.ts +0 -20
- package/dist/core/src/env/task/task-config-registration.js +0 -32
- package/dist/core/src/env/task/task-config-registration.test.d.ts +0 -5
- package/dist/core/src/env/task/task-config-registration.test.js +0 -43
- package/dist/core/src/env/task/task-types.test.d.ts +0 -5
- package/dist/core/src/env/task/task-types.test.js +0 -117
- package/dist/core/src/env/task/tools/complete-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/complete-tool.js +0 -40
- package/dist/core/src/env/task/tools/create-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/create-tool.js +0 -45
- package/dist/core/src/env/task/tools/delete-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/delete-tool.js +0 -39
- package/dist/core/src/env/task/tools/get-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/get-tool.js +0 -57
- package/dist/core/src/env/task/tools/index.d.ts +0 -10
- package/dist/core/src/env/task/tools/index.js +0 -10
- package/dist/core/src/env/task/tools/list-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/list-tool.js +0 -36
- package/dist/core/src/env/task/tools/operation/create-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/operation/create-tool.js +0 -44
- package/dist/core/src/env/task/tools/operation/delete-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/operation/delete-tool.js +0 -39
- package/dist/core/src/env/task/tools/operation/get-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/operation/get-tool.js +0 -39
- package/dist/core/src/env/task/tools/operation/index.d.ts +0 -9
- package/dist/core/src/env/task/tools/operation/index.js +0 -9
- package/dist/core/src/env/task/tools/operation/list-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/operation/list-tool.js +0 -36
- package/dist/core/src/env/task/tools/operation/operation-tools.test.d.ts +0 -5
- package/dist/core/src/env/task/tools/operation/operation-tools.test.js +0 -159
- package/dist/core/src/env/task/tools/operation/operation-types.d.ts +0 -92
- package/dist/core/src/env/task/tools/operation/operation-types.js +0 -58
- package/dist/core/src/env/task/tools/operation/update-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/operation/update-tool.js +0 -42
- package/dist/core/src/env/task/tools/task-tools.test.d.ts +0 -5
- package/dist/core/src/env/task/tools/task-tools.test.js +0 -142
- package/dist/core/src/env/task/tools/task-types.d.ts +0 -114
- package/dist/core/src/env/task/tools/task-types.js +0 -53
- package/dist/core/src/env/task/tools/task-types.test.d.ts +0 -5
- package/dist/core/src/env/task/tools/task-types.test.js +0 -63
- package/dist/core/src/env/task/tools/update-tool.d.ts +0 -7
- package/dist/core/src/env/task/tools/update-tool.js +0 -64
- package/dist/core/src/env/task/types.d.ts +0 -129
- package/dist/core/src/env/task/types.js +0 -39
- package/dist/core/src/env/tool/built-in/bash.d.ts +0 -11
- package/dist/core/src/env/tool/built-in/bash.js +0 -182
- package/dist/core/src/env/tool/built-in/echo.d.ts +0 -8
- package/dist/core/src/env/tool/built-in/echo.js +0 -27
- package/dist/core/src/env/tool/built-in/edit-file.d.ts +0 -7
- package/dist/core/src/env/tool/built-in/edit-file.js +0 -86
- package/dist/core/src/env/tool/built-in/edit-file.test.d.ts +0 -2
- package/dist/core/src/env/tool/built-in/edit-file.test.js +0 -84
- package/dist/core/src/env/tool/built-in/glob.d.ts +0 -7
- package/dist/core/src/env/tool/built-in/glob.js +0 -60
- package/dist/core/src/env/tool/built-in/glob.test.d.ts +0 -2
- package/dist/core/src/env/tool/built-in/glob.test.js +0 -61
- package/dist/core/src/env/tool/built-in/grep.d.ts +0 -7
- package/dist/core/src/env/tool/built-in/grep.js +0 -96
- package/dist/core/src/env/tool/built-in/grep.test.d.ts +0 -2
- package/dist/core/src/env/tool/built-in/grep.test.js +0 -74
- package/dist/core/src/env/tool/built-in/index.d.ts +0 -28
- package/dist/core/src/env/tool/built-in/index.js +0 -41
- package/dist/core/src/env/tool/built-in/read-file.d.ts +0 -6
- package/dist/core/src/env/tool/built-in/read-file.js +0 -73
- package/dist/core/src/env/tool/built-in/read-file.test.d.ts +0 -2
- package/dist/core/src/env/tool/built-in/read-file.test.js +0 -63
- package/dist/core/src/env/tool/built-in/write-file.d.ts +0 -6
- package/dist/core/src/env/tool/built-in/write-file.js +0 -65
- package/dist/core/src/env/tool/built-in/write-file.test.d.ts +0 -2
- package/dist/core/src/env/tool/built-in/write-file.test.js +0 -74
- package/dist/core/src/env/tool/index.d.ts +0 -14
- package/dist/core/src/env/tool/index.js +0 -19
- package/dist/core/src/env/tool/registry.d.ts +0 -62
- package/dist/core/src/env/tool/registry.js +0 -137
- package/dist/core/src/env/tool/registry.test.d.ts +0 -2
- package/dist/core/src/env/tool/registry.test.js +0 -219
- package/dist/core/src/env/tool/tool-component.d.ts +0 -160
- package/dist/core/src/env/tool/tool-component.js +0 -411
- package/dist/core/src/env/tool/tool-component.test.d.ts +0 -2
- package/dist/core/src/env/tool/tool-component.test.js +0 -461
- package/dist/core/src/env/tool/tool-config-registration.d.ts +0 -19
- package/dist/core/src/env/tool/tool-config-registration.js +0 -41
- package/dist/core/src/env/tool/tool-config-registration.test.d.ts +0 -7
- package/dist/core/src/env/tool/tool-config-registration.test.js +0 -202
- package/dist/core/src/env/tool/types.d.ts +0 -226
- package/dist/core/src/env/tool/types.js +0 -2
- package/dist/core/src/env/tool/validator.d.ts +0 -15
- package/dist/core/src/env/tool/validator.js +0 -43
- package/dist/core/src/env/tool/validator.test.d.ts +0 -2
- package/dist/core/src/env/tool/validator.test.js +0 -102
- package/dist/core/src/env/types.d.ts +0 -154
- package/dist/core/src/env/types.js +0 -9
- package/dist/core/src/env/workflow/ask-user-tool-registration.test.d.ts +0 -13
- package/dist/core/src/env/workflow/ask-user-tool-registration.test.js +0 -185
- package/dist/core/src/env/workflow/complex-workflow.integration.test.d.ts +0 -14
- package/dist/core/src/env/workflow/complex-workflow.integration.test.js +0 -1588
- package/dist/core/src/env/workflow/decorators/decorator-node.d.ts +0 -77
- package/dist/core/src/env/workflow/decorators/decorator-node.js +0 -176
- package/dist/core/src/env/workflow/decorators/decorator.test.d.ts +0 -5
- package/dist/core/src/env/workflow/decorators/decorator.test.js +0 -212
- package/dist/core/src/env/workflow/decorators/edge.d.ts +0 -43
- package/dist/core/src/env/workflow/decorators/edge.js +0 -68
- package/dist/core/src/env/workflow/decorators/index.d.ts +0 -14
- package/dist/core/src/env/workflow/decorators/index.js +0 -15
- package/dist/core/src/env/workflow/decorators/node-as.d.ts +0 -41
- package/dist/core/src/env/workflow/decorators/node-as.js +0 -85
- package/dist/core/src/env/workflow/decorators/workflow.d.ts +0 -31
- package/dist/core/src/env/workflow/decorators/workflow.js +0 -49
- package/dist/core/src/env/workflow/engine/dag-manager.d.ts +0 -129
- package/dist/core/src/env/workflow/engine/dag-manager.js +0 -471
- package/dist/core/src/env/workflow/engine/dag-manager.test.d.ts +0 -2
- package/dist/core/src/env/workflow/engine/dag-manager.test.js +0 -488
- package/dist/core/src/env/workflow/engine/engine.d.ts +0 -218
- package/dist/core/src/env/workflow/engine/engine.js +0 -1122
- package/dist/core/src/env/workflow/engine/event-bus.d.ts +0 -55
- package/dist/core/src/env/workflow/engine/event-bus.js +0 -137
- package/dist/core/src/env/workflow/engine/event-bus.test.d.ts +0 -2
- package/dist/core/src/env/workflow/engine/event-bus.test.js +0 -274
- package/dist/core/src/env/workflow/engine/executor-agent-session.test.d.ts +0 -2
- package/dist/core/src/env/workflow/engine/executor-agent-session.test.js +0 -46
- package/dist/core/src/env/workflow/engine/executor.d.ts +0 -106
- package/dist/core/src/env/workflow/engine/executor.js +0 -458
- package/dist/core/src/env/workflow/engine/executor.test.d.ts +0 -11
- package/dist/core/src/env/workflow/engine/executor.test.js +0 -274
- package/dist/core/src/env/workflow/engine/index.d.ts +0 -16
- package/dist/core/src/env/workflow/engine/index.js +0 -10
- package/dist/core/src/env/workflow/engine/node-registry.d.ts +0 -160
- package/dist/core/src/env/workflow/engine/node-registry.js +0 -195
- package/dist/core/src/env/workflow/engine/node-registry.test.d.ts +0 -8
- package/dist/core/src/env/workflow/engine/node-registry.test.js +0 -439
- package/dist/core/src/env/workflow/engine/resume-removed.test.d.ts +0 -2
- package/dist/core/src/env/workflow/engine/resume-removed.test.js +0 -19
- package/dist/core/src/env/workflow/engine/scheduler.d.ts +0 -133
- package/dist/core/src/env/workflow/engine/scheduler.js +0 -253
- package/dist/core/src/env/workflow/engine/scheduler.test.d.ts +0 -2
- package/dist/core/src/env/workflow/engine/scheduler.test.js +0 -575
- package/dist/core/src/env/workflow/engine/workflow-engine.test.d.ts +0 -11
- package/dist/core/src/env/workflow/engine/workflow-engine.test.js +0 -640
- package/dist/core/src/env/workflow/extractor/workflow-converter.d.ts +0 -56
- package/dist/core/src/env/workflow/extractor/workflow-converter.js +0 -252
- package/dist/core/src/env/workflow/fixtures.d.ts +0 -402
- package/dist/core/src/env/workflow/fixtures.js +0 -369
- package/dist/core/src/env/workflow/index.d.ts +0 -31
- package/dist/core/src/env/workflow/index.js +0 -35
- package/dist/core/src/env/workflow/integration/run-resume-unified.test.d.ts +0 -2
- package/dist/core/src/env/workflow/integration/run-resume-unified.test.js +0 -161
- package/dist/core/src/env/workflow/integration/service-integration.test.d.ts +0 -8
- package/dist/core/src/env/workflow/integration/service-integration.test.js +0 -223
- package/dist/core/src/env/workflow/metadata/keys.d.ts +0 -7
- package/dist/core/src/env/workflow/metadata/keys.js +0 -10
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.d.ts +0 -163
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.js +0 -333
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.test.d.ts +0 -2
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.test.js +0 -257
- package/dist/core/src/env/workflow/nodes/agent-node.d.ts +0 -217
- package/dist/core/src/env/workflow/nodes/agent-node.js +0 -419
- package/dist/core/src/env/workflow/nodes/agent-node.test.d.ts +0 -13
- package/dist/core/src/env/workflow/nodes/agent-node.test.js +0 -296
- package/dist/core/src/env/workflow/nodes/ask-user-node.d.ts +0 -69
- package/dist/core/src/env/workflow/nodes/ask-user-node.js +0 -67
- package/dist/core/src/env/workflow/nodes/condition-node.d.ts +0 -48
- package/dist/core/src/env/workflow/nodes/condition-node.js +0 -185
- package/dist/core/src/env/workflow/nodes/index.d.ts +0 -7
- package/dist/core/src/env/workflow/nodes/index.js +0 -5
- package/dist/core/src/env/workflow/nodes/merge-node.d.ts +0 -41
- package/dist/core/src/env/workflow/nodes/merge-node.js +0 -126
- package/dist/core/src/env/workflow/nodes/skill-node.d.ts +0 -118
- package/dist/core/src/env/workflow/nodes/skill-node.js +0 -322
- package/dist/core/src/env/workflow/nodes/skill-node.test.d.ts +0 -2
- package/dist/core/src/env/workflow/nodes/skill-node.test.js +0 -189
- package/dist/core/src/env/workflow/nodes/tool-node.d.ts +0 -121
- package/dist/core/src/env/workflow/nodes/tool-node.js +0 -415
- package/dist/core/src/env/workflow/nodes/tool-node.test.d.ts +0 -2
- package/dist/core/src/env/workflow/nodes/tool-node.test.js +0 -181
- package/dist/core/src/env/workflow/nodes/workflow-llm-history.test.d.ts +0 -7
- package/dist/core/src/env/workflow/nodes/workflow-llm-history.test.js +0 -377
- package/dist/core/src/env/workflow/nodes/workflow-node.d.ts +0 -119
- package/dist/core/src/env/workflow/nodes/workflow-node.js +0 -215
- package/dist/core/src/env/workflow/nodes/workflow-node.test.d.ts +0 -2
- package/dist/core/src/env/workflow/nodes/workflow-node.test.js +0 -255
- package/dist/core/src/env/workflow/service/index.d.ts +0 -10
- package/dist/core/src/env/workflow/service/index.js +0 -8
- package/dist/core/src/env/workflow/service/registry.d.ts +0 -38
- package/dist/core/src/env/workflow/service/registry.js +0 -58
- package/dist/core/src/env/workflow/service/registry.test.d.ts +0 -5
- package/dist/core/src/env/workflow/service/registry.test.js +0 -90
- package/dist/core/src/env/workflow/service/workflow-service.d.ts +0 -162
- package/dist/core/src/env/workflow/service/workflow-service.js +0 -244
- package/dist/core/src/env/workflow/service/workflow-service.test.d.ts +0 -5
- package/dist/core/src/env/workflow/service/workflow-service.test.js +0 -228
- package/dist/core/src/env/workflow/storage/index.d.ts +0 -11
- package/dist/core/src/env/workflow/storage/index.js +0 -13
- package/dist/core/src/env/workflow/storage/mock-repositories.d.ts +0 -89
- package/dist/core/src/env/workflow/storage/mock-repositories.js +0 -286
- package/dist/core/src/env/workflow/storage/sqlite.d.ts +0 -56
- package/dist/core/src/env/workflow/storage/sqlite.js +0 -135
- package/dist/core/src/env/workflow/storage/sqlite.test.d.ts +0 -2
- package/dist/core/src/env/workflow/storage/sqlite.test.js +0 -152
- package/dist/core/src/env/workflow/storage/workflow-repo.d.ts +0 -108
- package/dist/core/src/env/workflow/storage/workflow-repo.js +0 -252
- package/dist/core/src/env/workflow/storage/workflow-repo.test.d.ts +0 -2
- package/dist/core/src/env/workflow/storage/workflow-repo.test.js +0 -447
- package/dist/core/src/env/workflow/tools/ask-user-tool.d.ts +0 -36
- package/dist/core/src/env/workflow/tools/ask-user-tool.js +0 -50
- package/dist/core/src/env/workflow/tools/index.d.ts +0 -8
- package/dist/core/src/env/workflow/tools/index.js +0 -10
- package/dist/core/src/env/workflow/tools/run-workflow.d.ts +0 -61
- package/dist/core/src/env/workflow/tools/run-workflow.js +0 -180
- package/dist/core/src/env/workflow/tools/run-workflow.test.d.ts +0 -5
- package/dist/core/src/env/workflow/tools/run-workflow.test.js +0 -235
- package/dist/core/src/env/workflow/types/context.d.ts +0 -18
- package/dist/core/src/env/workflow/types/context.js +0 -2
- package/dist/core/src/env/workflow/types/decorators-types.d.ts +0 -178
- package/dist/core/src/env/workflow/types/decorators-types.js +0 -9
- package/dist/core/src/env/workflow/types/event.d.ts +0 -864
- package/dist/core/src/env/workflow/types/event.js +0 -154
- package/dist/core/src/env/workflow/types/event.test.d.ts +0 -2
- package/dist/core/src/env/workflow/types/event.test.js +0 -484
- package/dist/core/src/env/workflow/types/index.d.ts +0 -14
- package/dist/core/src/env/workflow/types/index.js +0 -10
- package/dist/core/src/env/workflow/types/run.d.ts +0 -123
- package/dist/core/src/env/workflow/types/run.js +0 -23
- package/dist/core/src/env/workflow/types/run.test.d.ts +0 -2
- package/dist/core/src/env/workflow/types/run.test.js +0 -381
- package/dist/core/src/env/workflow/types/workflow-hil.d.ts +0 -58
- package/dist/core/src/env/workflow/types/workflow-hil.js +0 -76
- package/dist/core/src/env/workflow/types/workflow-message.d.ts +0 -139
- package/dist/core/src/env/workflow/types/workflow-message.js +0 -15
- package/dist/core/src/env/workflow/types/workflow-message.test.d.ts +0 -2
- package/dist/core/src/env/workflow/types/workflow-message.test.js +0 -87
- package/dist/core/src/env/workflow/types/workflow-session.d.ts +0 -18
- package/dist/core/src/env/workflow/types/workflow-session.js +0 -41
- package/dist/core/src/env/workflow/types/workflow-session.test.d.ts +0 -2
- package/dist/core/src/env/workflow/types/workflow-session.test.js +0 -80
- package/dist/core/src/env/workflow/types/workflow.d.ts +0 -387
- package/dist/core/src/env/workflow/types/workflow.js +0 -124
- package/dist/core/src/env/workflow/types/workflow.test.d.ts +0 -2
- package/dist/core/src/env/workflow/types/workflow.test.js +0 -455
- package/dist/core/src/env/workflow/types_compat.d.ts +0 -11
- package/dist/core/src/env/workflow/types_compat.js +0 -8
- package/dist/core/src/env/workflow/utils/create-workflow.d.ts +0 -36
- package/dist/core/src/env/workflow/utils/create-workflow.js +0 -36
- package/dist/core/src/env/workflow/utils/execution-state.d.ts +0 -47
- package/dist/core/src/env/workflow/utils/execution-state.js +0 -228
- package/dist/core/src/env/workflow/utils/index.d.ts +0 -9
- package/dist/core/src/env/workflow/utils/index.js +0 -9
- package/dist/core/src/env/workflow/utils/node-registry-helper.d.ts +0 -37
- package/dist/core/src/env/workflow/utils/node-registry-helper.js +0 -48
- package/dist/core/src/env/workflow/utils/recovery-validator.d.ts +0 -31
- package/dist/core/src/env/workflow/utils/recovery-validator.js +0 -325
- package/dist/core/src/env/workflow/utils/recovery-validator.test.d.ts +0 -2
- package/dist/core/src/env/workflow/utils/recovery-validator.test.js +0 -401
- package/dist/core/src/env/workflow/utils/session-parser.d.ts +0 -22
- package/dist/core/src/env/workflow/utils/session-parser.js +0 -72
- package/dist/core/src/env/workflow/utils/session-parser.test.d.ts +0 -2
- package/dist/core/src/env/workflow/utils/session-parser.test.js +0 -89
- package/dist/core/src/env/workflow/utils/session-recovery.d.ts +0 -62
- package/dist/core/src/env/workflow/utils/session-recovery.js +0 -138
- package/dist/core/src/env/workflow/utils/session-recovery.test.d.ts +0 -2
- package/dist/core/src/env/workflow/utils/session-recovery.test.js +0 -263
- package/dist/core/src/env/workflow/utils/template-resolver.d.ts +0 -161
- package/dist/core/src/env/workflow/utils/template-resolver.js +0 -359
- package/dist/core/src/env/workflow/utils/template-resolver.test.d.ts +0 -2
- package/dist/core/src/env/workflow/utils/template-resolver.test.js +0 -216
- package/dist/core/src/env/workflow/utils/validation-rules.d.ts +0 -104
- package/dist/core/src/env/workflow/utils/validation-rules.js +0 -44
- package/dist/core/src/env/workflow/workflow-component.d.ts +0 -135
- package/dist/core/src/env/workflow/workflow-component.js +0 -376
- package/dist/core/src/index.d.ts +0 -54
- package/dist/core/src/index.js +0 -66
- package/dist/core/src/utils/id.d.ts +0 -12
- package/dist/core/src/utils/id.js +0 -20
- package/dist/roy-agent-darwin-arm64/bin/roy.js +0 -127298
- package/dist/roy-agent-darwin-x64/bin/roy.js +0 -127298
- package/dist/roy-agent-linux-arm64/bin/roy.js +0 -127298
- package/dist/roy-agent-linux-x64/bin/roy.js +0 -127298
- package/dist/roy-agent-windows-x64/bin/roy.js +0 -127298
- package/src/bin/roy.ts +0 -12
- package/src/cli.ts +0 -101
- package/src/commands/act.ts +0 -480
- package/src/commands/commands-add.ts +0 -110
- package/src/commands/commands-dirs.ts +0 -70
- package/src/commands/commands-info.ts +0 -90
- package/src/commands/commands-list.ts +0 -161
- package/src/commands/commands-remove.ts +0 -147
- package/src/commands/commands.ts +0 -55
- package/src/commands/config/config-service.test.ts +0 -449
- package/src/commands/config/config-service.ts +0 -312
- package/src/commands/config/deep-merge.test.ts +0 -168
- package/src/commands/config/deep-merge.ts +0 -63
- package/src/commands/config/export.ts +0 -97
- package/src/commands/config/filter-history-e2e.test.ts +0 -141
- package/src/commands/config/import-preserve-refs.test.ts +0 -212
- package/src/commands/config/import.ts +0 -119
- package/src/commands/config/index.ts +0 -35
- package/src/commands/config/list.ts +0 -281
- package/src/commands/config/roy-config-e2e.test.ts +0 -297
- package/src/commands/config/types.ts +0 -54
- package/src/commands/debug/index.ts +0 -38
- package/src/commands/debug/log.test.ts +0 -233
- package/src/commands/debug/log.ts +0 -123
- package/src/commands/debug/span.test.ts +0 -297
- package/src/commands/debug/span.ts +0 -211
- package/src/commands/debug/trace.test.ts +0 -254
- package/src/commands/debug/trace.ts +0 -140
- package/src/commands/eventsource/add.ts +0 -133
- package/src/commands/eventsource/index.ts +0 -48
- package/src/commands/eventsource/list.ts +0 -194
- package/src/commands/eventsource/remove.ts +0 -95
- package/src/commands/eventsource/start.ts +0 -103
- package/src/commands/eventsource/status.ts +0 -185
- package/src/commands/eventsource/stop.ts +0 -89
- package/src/commands/index.ts +0 -22
- package/src/commands/input-handler.test.ts +0 -76
- package/src/commands/input-handler.ts +0 -43
- package/src/commands/interactive-esc.test.ts +0 -254
- package/src/commands/interactive.shutdown.test.ts +0 -122
- package/src/commands/interactive.test.ts +0 -221
- package/src/commands/interactive.ts +0 -1015
- package/src/commands/lsp/check.ts +0 -92
- package/src/commands/lsp/index.ts +0 -32
- package/src/commands/lsp/install.ts +0 -126
- package/src/commands/lsp/list.ts +0 -64
- package/src/commands/mcp/index.ts +0 -27
- package/src/commands/mcp/list.ts +0 -116
- package/src/commands/mcp/reload.ts +0 -70
- package/src/commands/mcp/tools.ts +0 -121
- package/src/commands/memory/extract-e2e.test.ts +0 -388
- package/src/commands/memory/index.ts +0 -11
- package/src/commands/memory/memory-simplified.test.ts +0 -58
- package/src/commands/memory/memory.ts +0 -25
- package/src/commands/memory/organize.ts +0 -300
- package/src/commands/memory/recall.test.ts +0 -120
- package/src/commands/memory/recall.ts +0 -88
- package/src/commands/memory/record-extract-handle-query.test.ts +0 -385
- package/src/commands/memory/record-prompt-component.test.ts +0 -343
- package/src/commands/memory/record.test.ts +0 -92
- package/src/commands/memory/record.ts +0 -332
- package/src/commands/plugin.test.ts +0 -292
- package/src/commands/plugin.ts +0 -267
- package/src/commands/sessions/active.ts +0 -96
- package/src/commands/sessions/add-message.ts +0 -96
- package/src/commands/sessions/checkpoints.ts +0 -154
- package/src/commands/sessions/compact.test.ts +0 -215
- package/src/commands/sessions/compact.ts +0 -269
- package/src/commands/sessions/delete.ts +0 -236
- package/src/commands/sessions/get.ts +0 -165
- package/src/commands/sessions/grep.ts +0 -233
- package/src/commands/sessions/index.ts +0 -95
- package/src/commands/sessions/list.ts +0 -210
- package/src/commands/sessions/messages.test.ts +0 -333
- package/src/commands/sessions/messages.ts +0 -248
- package/src/commands/sessions/mock.ts +0 -194
- package/src/commands/sessions/new.ts +0 -82
- package/src/commands/sessions/rename.ts +0 -98
- package/src/commands/shared/event-handler.ts +0 -213
- package/src/commands/shared/event-message-formatter.ts +0 -295
- package/src/commands/shared/index.ts +0 -11
- package/src/commands/shared/query-executor.test.ts +0 -434
- package/src/commands/shared/query-executor.ts +0 -324
- package/src/commands/shared/repl-engine.test.ts +0 -354
- package/src/commands/shared/session-manager.test.ts +0 -212
- package/src/commands/shared/session-manager.ts +0 -114
- package/src/commands/skills/get.ts +0 -90
- package/src/commands/skills/index.ts +0 -39
- package/src/commands/skills/list.ts +0 -129
- package/src/commands/skills/reload.ts +0 -59
- package/src/commands/skills/search.ts +0 -132
- package/src/commands/skills/show-config.ts +0 -93
- package/src/commands/tasks/complete.ts +0 -92
- package/src/commands/tasks/create.ts +0 -118
- package/src/commands/tasks/delete.ts +0 -86
- package/src/commands/tasks/get.ts +0 -116
- package/src/commands/tasks/index.ts +0 -53
- package/src/commands/tasks/list.ts +0 -140
- package/src/commands/tasks/operations.ts +0 -120
- package/src/commands/tasks/update.ts +0 -122
- package/src/commands/tools/exec-tool.ts +0 -128
- package/src/commands/tools/get.ts +0 -114
- package/src/commands/tools/index.ts +0 -35
- package/src/commands/tools/list.ts +0 -107
- package/src/commands/tools/shared/index.ts +0 -7
- package/src/commands/tools/shared/schema-helper.ts +0 -111
- package/src/commands/workflow/commands/add.ts +0 -315
- package/src/commands/workflow/commands/get.ts +0 -193
- package/src/commands/workflow/commands/list.ts +0 -137
- package/src/commands/workflow/commands/nodes.ts +0 -528
- package/src/commands/workflow/commands/remove.ts +0 -94
- package/src/commands/workflow/commands/run.ts +0 -398
- package/src/commands/workflow/commands/status.ts +0 -147
- package/src/commands/workflow/commands/stop.ts +0 -91
- package/src/commands/workflow/commands/update.ts +0 -130
- package/src/commands/workflow/commands/validate.ts +0 -139
- package/src/commands/workflow/commands/workflow-cli.test.ts +0 -196
- package/src/commands/workflow/index.ts +0 -65
- package/src/commands/workflow/renderers.ts +0 -358
- package/src/commands/workflow/validators/index.ts +0 -8
- package/src/commands/workflow/validators/node-validator-factory.ts +0 -40
- package/src/commands/workflow/validators/node-validator.ts +0 -125
- package/src/commands/workflow/validators/nodes/agent-node-validator.ts +0 -58
- package/src/commands/workflow/validators/nodes/condition-node-validator.ts +0 -34
- package/src/commands/workflow/validators/nodes/decorator-node-validator.ts +0 -45
- package/src/commands/workflow/validators/nodes/merge-node-validator.ts +0 -46
- package/src/commands/workflow/validators/nodes/skill-node-validator.ts +0 -33
- package/src/commands/workflow/validators/nodes/tool-node-validator.ts +0 -54
- package/src/commands/workflow/validators/nodes/workflow-node-validator.ts +0 -33
- package/src/commands/workflow/validators/types.ts +0 -78
- package/src/commands/workflow/validators/workflow-validator.test.ts +0 -273
- package/src/commands/workflow/validators/workflow-validator.ts +0 -320
- package/src/index.ts +0 -19
- package/src/plugin/apply.ts +0 -103
- package/src/plugin/discover.ts +0 -219
- package/src/plugin/index.ts +0 -45
- package/src/plugin/registry.ts +0 -272
- package/src/plugin/types.ts +0 -165
- package/src/services/context-handler.service.test.ts +0 -501
- package/src/services/context-handler.service.ts +0 -372
- package/src/services/environment.service.commands-prompt.test.ts +0 -167
- package/src/services/environment.service.ts +0 -656
- package/src/services/output.service.test.ts +0 -92
- package/src/services/output.service.ts +0 -122
- package/src/services/quiet-mode.service.test.ts +0 -114
- package/src/services/quiet-mode.service.ts +0 -81
- package/src/services/stream-output.service.test.ts +0 -214
- package/src/services/stream-output.service.ts +0 -323
- package/src/util/which.test.ts +0 -101
- package/src/util/which.ts +0 -55
|
@@ -1,1588 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Complex Multi-Node Workflow Integration Tests
|
|
3
|
-
*
|
|
4
|
-
* Tests for complex workflow patterns including:
|
|
5
|
-
* - Parallel execution branches
|
|
6
|
-
* - Diamond patterns (merge and fork)
|
|
7
|
-
* - Error handling and retry logic
|
|
8
|
-
* - Conditional execution
|
|
9
|
-
* - Template variable passing
|
|
10
|
-
* - Nested workflows
|
|
11
|
-
* - Complex dependency graphs
|
|
12
|
-
*/
|
|
13
|
-
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
14
|
-
import { z } from 'zod';
|
|
15
|
-
/**
|
|
16
|
-
* Synchronous Workflow Executor for Testing
|
|
17
|
-
*/
|
|
18
|
-
class SyncWorkflowExecutor {
|
|
19
|
-
trace;
|
|
20
|
-
nodeConfigs;
|
|
21
|
-
constructor() {
|
|
22
|
-
this.trace = {
|
|
23
|
-
nodes: new Map(),
|
|
24
|
-
executionOrder: [],
|
|
25
|
-
parallelBatches: [],
|
|
26
|
-
errors: [],
|
|
27
|
-
};
|
|
28
|
-
this.nodeConfigs = new Map();
|
|
29
|
-
}
|
|
30
|
-
setNodeConfig(nodeId, config) {
|
|
31
|
-
this.nodeConfigs.set(nodeId, config);
|
|
32
|
-
}
|
|
33
|
-
getTrace() {
|
|
34
|
-
return this.trace;
|
|
35
|
-
}
|
|
36
|
-
clearTrace() {
|
|
37
|
-
this.trace = {
|
|
38
|
-
nodes: new Map(),
|
|
39
|
-
executionOrder: [],
|
|
40
|
-
parallelBatches: [],
|
|
41
|
-
errors: [],
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
executeNode(nodeId, input, dependencies, nodeType) {
|
|
45
|
-
const config = this.nodeConfigs.get(nodeId) || {};
|
|
46
|
-
// Initialize trace entry
|
|
47
|
-
const traceEntry = {
|
|
48
|
-
nodeId,
|
|
49
|
-
status: 'pending',
|
|
50
|
-
input,
|
|
51
|
-
output: null,
|
|
52
|
-
retryCount: 0,
|
|
53
|
-
};
|
|
54
|
-
this.trace.nodes.set(nodeId, traceEntry);
|
|
55
|
-
// Execute node
|
|
56
|
-
traceEntry.status = 'running';
|
|
57
|
-
traceEntry.startTime = Date.now();
|
|
58
|
-
// Use provided nodeType or fall back to config.type
|
|
59
|
-
const effectiveNodeType = nodeType || config.type || 'unknown';
|
|
60
|
-
let output;
|
|
61
|
-
switch (effectiveNodeType) {
|
|
62
|
-
case 'tool':
|
|
63
|
-
output = this.executeToolNode(nodeId, config, input);
|
|
64
|
-
break;
|
|
65
|
-
case 'skill':
|
|
66
|
-
output = this.executeSkillNode(nodeId, config, input, dependencies);
|
|
67
|
-
break;
|
|
68
|
-
case 'agent':
|
|
69
|
-
output = this.executeAgentNode(nodeId, config, input, dependencies);
|
|
70
|
-
break;
|
|
71
|
-
case 'condition':
|
|
72
|
-
output = this.executeConditionNode(nodeId, config, input);
|
|
73
|
-
break;
|
|
74
|
-
case 'merge':
|
|
75
|
-
output = this.executeMergeNode(nodeId, config, dependencies);
|
|
76
|
-
break;
|
|
77
|
-
case 'nested':
|
|
78
|
-
case 'workflow':
|
|
79
|
-
output = this.executeNestedWorkflowNode(nodeId, config, input);
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
output = { result: `${nodeId}_result`, input };
|
|
83
|
-
}
|
|
84
|
-
traceEntry.output = output;
|
|
85
|
-
traceEntry.status = 'completed';
|
|
86
|
-
traceEntry.endTime = Date.now();
|
|
87
|
-
this.trace.executionOrder.push(nodeId);
|
|
88
|
-
return output;
|
|
89
|
-
}
|
|
90
|
-
executeToolNode(nodeId, config, input) {
|
|
91
|
-
const toolName = config.tool || 'default-tool';
|
|
92
|
-
if (toolName === 'echo') {
|
|
93
|
-
return { echo: input, message: config.message };
|
|
94
|
-
}
|
|
95
|
-
if (toolName === 'calculator') {
|
|
96
|
-
return { result: 42, operation: config.operation };
|
|
97
|
-
}
|
|
98
|
-
if (toolName === 'validator') {
|
|
99
|
-
return { valid: true, validated: input, source: config.source };
|
|
100
|
-
}
|
|
101
|
-
return { tool: toolName, result: `processed_by_${toolName}` };
|
|
102
|
-
}
|
|
103
|
-
executeSkillNode(nodeId, config, input, dependencies) {
|
|
104
|
-
const skillName = config.skill || 'default-skill';
|
|
105
|
-
return {
|
|
106
|
-
skill: skillName,
|
|
107
|
-
result: `skill_${skillName}_executed`,
|
|
108
|
-
inputsFromDeps: Object.fromEntries(dependencies),
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
executeAgentNode(nodeId, config, input, dependencies) {
|
|
112
|
-
const agentType = config.agent || 'general';
|
|
113
|
-
return {
|
|
114
|
-
agent: agentType,
|
|
115
|
-
reasoning: `Agent ${agentType} processed input`,
|
|
116
|
-
input,
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
executeConditionNode(nodeId, config, input) {
|
|
120
|
-
const condition = config.condition || 'true';
|
|
121
|
-
const result = this.evaluateCondition(condition, input);
|
|
122
|
-
return { conditionMet: result, evaluatedCondition: condition };
|
|
123
|
-
}
|
|
124
|
-
executeMergeNode(nodeId, config, dependencies) {
|
|
125
|
-
const mergedInputs = {};
|
|
126
|
-
for (const [depId, depOutput] of dependencies) {
|
|
127
|
-
mergedInputs[depId] = depOutput;
|
|
128
|
-
}
|
|
129
|
-
return {
|
|
130
|
-
merged: true,
|
|
131
|
-
inputs: mergedInputs,
|
|
132
|
-
mergeStrategy: config.strategy || 'collect',
|
|
133
|
-
valid: true,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
executeNestedWorkflowNode(nodeId, config, input) {
|
|
137
|
-
const workflowName = config.workflow || config.workflow_name || 'default-nested';
|
|
138
|
-
return {
|
|
139
|
-
nestedWorkflow: workflowName,
|
|
140
|
-
workflowName,
|
|
141
|
-
input,
|
|
142
|
-
result: `nested_${workflowName}_executed`,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
evaluateCondition(condition, context) {
|
|
146
|
-
// Handle template variable conditions
|
|
147
|
-
if (condition === '{{input.skip}}') {
|
|
148
|
-
return context?.skip !== false && !!context?.skip;
|
|
149
|
-
}
|
|
150
|
-
if (condition === '{{input.mode}}') {
|
|
151
|
-
return !!context?.mode;
|
|
152
|
-
}
|
|
153
|
-
if (condition === 'true')
|
|
154
|
-
return true;
|
|
155
|
-
if (condition.includes('valid'))
|
|
156
|
-
return true;
|
|
157
|
-
if (condition.includes('{{process.result}}'))
|
|
158
|
-
return true;
|
|
159
|
-
return condition !== 'false';
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
// ==================== Workflow Execution Engine ====================
|
|
163
|
-
function executeWorkflowSync(definition, input, executor) {
|
|
164
|
-
const exec = executor || new SyncWorkflowExecutor();
|
|
165
|
-
const results = new Map();
|
|
166
|
-
const nodeMap = new Map();
|
|
167
|
-
// Build node map and config
|
|
168
|
-
for (const node of definition.nodes) {
|
|
169
|
-
nodeMap.set(node.id, node);
|
|
170
|
-
exec.setNodeConfig(node.id, node.config);
|
|
171
|
-
}
|
|
172
|
-
// Topological sort for execution order
|
|
173
|
-
const order = topologicalSort(definition);
|
|
174
|
-
// Execute in order
|
|
175
|
-
const dependencies = new Map();
|
|
176
|
-
for (const nodeId of order) {
|
|
177
|
-
const node = nodeMap.get(nodeId);
|
|
178
|
-
// Get dependency outputs
|
|
179
|
-
const depOutputs = new Map();
|
|
180
|
-
for (const depId of node.depends_on || []) {
|
|
181
|
-
depOutputs.set(depId, dependencies.get(depId));
|
|
182
|
-
}
|
|
183
|
-
// Execute node with explicit node type
|
|
184
|
-
const output = exec.executeNode(nodeId, { ...input }, depOutputs, node.type);
|
|
185
|
-
dependencies.set(nodeId, output);
|
|
186
|
-
results.set(nodeId, output);
|
|
187
|
-
}
|
|
188
|
-
return results;
|
|
189
|
-
}
|
|
190
|
-
function topologicalSort(workflow) {
|
|
191
|
-
const nodeMap = new Map(workflow.nodes.map(n => [n.id, n]));
|
|
192
|
-
const visited = new Set();
|
|
193
|
-
const temp = new Set();
|
|
194
|
-
const order = [];
|
|
195
|
-
function visit(nodeId) {
|
|
196
|
-
if (temp.has(nodeId)) {
|
|
197
|
-
throw new Error(`Circular dependency detected: ${nodeId}`);
|
|
198
|
-
}
|
|
199
|
-
if (visited.has(nodeId))
|
|
200
|
-
return;
|
|
201
|
-
temp.add(nodeId);
|
|
202
|
-
const node = nodeMap.get(nodeId);
|
|
203
|
-
if (node) {
|
|
204
|
-
for (const depId of node.depends_on || []) {
|
|
205
|
-
visit(depId);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
temp.delete(nodeId);
|
|
209
|
-
visited.add(nodeId);
|
|
210
|
-
order.push(nodeId);
|
|
211
|
-
}
|
|
212
|
-
// Visit all nodes
|
|
213
|
-
for (const node of workflow.nodes) {
|
|
214
|
-
if (!visited.has(node.id)) {
|
|
215
|
-
visit(node.id);
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return order;
|
|
219
|
-
}
|
|
220
|
-
// ==================== Complex Workflow Definitions ====================
|
|
221
|
-
/**
|
|
222
|
-
* Complex Workflow: Data Processing Pipeline
|
|
223
|
-
*
|
|
224
|
-
* This workflow simulates a complex data processing pipeline with:
|
|
225
|
-
* - 12 nodes total
|
|
226
|
-
* - Parallel data fetching branches
|
|
227
|
-
* - Diamond merge pattern
|
|
228
|
-
* - Conditional processing
|
|
229
|
-
* - Error handling with retry
|
|
230
|
-
*/
|
|
231
|
-
const createDataProcessingWorkflow = () => ({
|
|
232
|
-
name: 'data-processing-pipeline',
|
|
233
|
-
version: '1.0',
|
|
234
|
-
description: 'Complex data processing pipeline with parallel branches',
|
|
235
|
-
config: {
|
|
236
|
-
parallel_limit: 3,
|
|
237
|
-
timeout: 300000,
|
|
238
|
-
},
|
|
239
|
-
nodes: [
|
|
240
|
-
// Entry node - Initialize pipeline
|
|
241
|
-
{
|
|
242
|
-
id: 'init',
|
|
243
|
-
type: 'tool',
|
|
244
|
-
name: 'Initialize Pipeline',
|
|
245
|
-
config: { tool: 'echo', message: 'Starting data pipeline' },
|
|
246
|
-
},
|
|
247
|
-
// Parallel fetch branch 1
|
|
248
|
-
{
|
|
249
|
-
id: 'fetch-users',
|
|
250
|
-
type: 'tool',
|
|
251
|
-
name: 'Fetch Users',
|
|
252
|
-
config: { tool: 'validator', source: 'users' },
|
|
253
|
-
depends_on: ['init'],
|
|
254
|
-
},
|
|
255
|
-
// Parallel fetch branch 2
|
|
256
|
-
{
|
|
257
|
-
id: 'fetch-products',
|
|
258
|
-
type: 'tool',
|
|
259
|
-
name: 'Fetch Products',
|
|
260
|
-
config: { tool: 'validator', source: 'products' },
|
|
261
|
-
depends_on: ['init'],
|
|
262
|
-
},
|
|
263
|
-
// Parallel fetch branch 3
|
|
264
|
-
{
|
|
265
|
-
id: 'fetch-orders',
|
|
266
|
-
type: 'tool',
|
|
267
|
-
name: 'Fetch Orders',
|
|
268
|
-
config: { tool: 'validator', source: 'orders' },
|
|
269
|
-
depends_on: ['init'],
|
|
270
|
-
},
|
|
271
|
-
// Diamond pattern - merge point
|
|
272
|
-
{
|
|
273
|
-
id: 'merge-data',
|
|
274
|
-
type: 'merge',
|
|
275
|
-
name: 'Merge All Data',
|
|
276
|
-
config: { strategy: 'collect' },
|
|
277
|
-
depends_on: ['fetch-users', 'fetch-products', 'fetch-orders'],
|
|
278
|
-
},
|
|
279
|
-
// Diamond pattern - fork to processing branches
|
|
280
|
-
{
|
|
281
|
-
id: 'validate-data',
|
|
282
|
-
type: 'condition',
|
|
283
|
-
name: 'Validate Merged Data',
|
|
284
|
-
config: { condition: '{{merge-data.valid}}' },
|
|
285
|
-
depends_on: ['merge-data'],
|
|
286
|
-
},
|
|
287
|
-
// Processing branch 1 - with retry
|
|
288
|
-
{
|
|
289
|
-
id: 'process-users',
|
|
290
|
-
type: 'tool',
|
|
291
|
-
name: 'Process Users',
|
|
292
|
-
config: { tool: 'calculator', operation: 'user-scoring' },
|
|
293
|
-
depends_on: ['validate-data'],
|
|
294
|
-
retry: { max_attempts: 3, backoff: 'exponential', initial_delay: 1000 },
|
|
295
|
-
},
|
|
296
|
-
// Processing branch 2
|
|
297
|
-
{
|
|
298
|
-
id: 'process-products',
|
|
299
|
-
type: 'tool',
|
|
300
|
-
name: 'Process Products',
|
|
301
|
-
config: { tool: 'calculator', operation: 'product-rating' },
|
|
302
|
-
depends_on: ['validate-data'],
|
|
303
|
-
},
|
|
304
|
-
// Diamond merge - final processing
|
|
305
|
-
{
|
|
306
|
-
id: 'finalize-results',
|
|
307
|
-
type: 'tool',
|
|
308
|
-
name: 'Finalize Results',
|
|
309
|
-
config: { tool: 'echo', message: 'Finalizing' },
|
|
310
|
-
depends_on: ['process-users', 'process-products'],
|
|
311
|
-
},
|
|
312
|
-
// Conditional node
|
|
313
|
-
{
|
|
314
|
-
id: 'generate-report',
|
|
315
|
-
type: 'condition',
|
|
316
|
-
name: 'Check Report Generation',
|
|
317
|
-
config: { condition: '{{input.generateReport}}' },
|
|
318
|
-
depends_on: ['finalize-results'],
|
|
319
|
-
},
|
|
320
|
-
// Nested workflow call
|
|
321
|
-
{
|
|
322
|
-
id: 'create-report',
|
|
323
|
-
type: 'nested',
|
|
324
|
-
name: 'Create Report',
|
|
325
|
-
config: { workflow: 'report-generation' },
|
|
326
|
-
depends_on: ['generate-report'],
|
|
327
|
-
},
|
|
328
|
-
// Final output node
|
|
329
|
-
{
|
|
330
|
-
id: 'output',
|
|
331
|
-
type: 'tool',
|
|
332
|
-
name: 'Output Results',
|
|
333
|
-
config: { tool: 'echo', message: 'Pipeline complete' },
|
|
334
|
-
depends_on: ['create-report'],
|
|
335
|
-
},
|
|
336
|
-
],
|
|
337
|
-
entry: 'init',
|
|
338
|
-
outputs: [
|
|
339
|
-
{ name: 'final_result', source: 'output', path: 'result' },
|
|
340
|
-
{ name: 'user_data', source: 'process-users', path: 'result' },
|
|
341
|
-
{ name: 'product_data', source: 'process-products', path: 'result' },
|
|
342
|
-
],
|
|
343
|
-
metadata: {
|
|
344
|
-
author: 'Roy Agent',
|
|
345
|
-
tags: ['data-processing', 'pipeline', 'complex'],
|
|
346
|
-
},
|
|
347
|
-
});
|
|
348
|
-
/**
|
|
349
|
-
* Complex Workflow: Parallel Processing with Error Handling
|
|
350
|
-
*
|
|
351
|
-
* Features:
|
|
352
|
-
* - Multiple parallel branches
|
|
353
|
-
* - Retry logic on failure-prone nodes
|
|
354
|
-
* - Error recovery paths
|
|
355
|
-
* - Timeout handling
|
|
356
|
-
*/
|
|
357
|
-
const createParallelProcessingWorkflow = () => ({
|
|
358
|
-
name: 'parallel-processing',
|
|
359
|
-
version: '1.0',
|
|
360
|
-
description: 'Parallel processing with error handling and retry',
|
|
361
|
-
nodes: [
|
|
362
|
-
{ id: 'entry', type: 'tool', config: { tool: 'echo' } },
|
|
363
|
-
// Parallel branch A
|
|
364
|
-
{ id: 'task-a1', type: 'tool', config: { tool: 'calculator' }, depends_on: ['entry'] },
|
|
365
|
-
{ id: 'task-a2', type: 'tool', config: { tool: 'calculator' }, depends_on: ['task-a1'] },
|
|
366
|
-
{ id: 'task-a3', type: 'tool', config: { tool: 'calculator' }, depends_on: ['task-a2'] },
|
|
367
|
-
// Parallel branch B
|
|
368
|
-
{ id: 'task-b1', type: 'tool', config: { tool: 'calculator' }, depends_on: ['entry'] },
|
|
369
|
-
{ id: 'task-b2', type: 'tool', config: { tool: 'calculator' }, depends_on: ['task-b1'] },
|
|
370
|
-
{
|
|
371
|
-
id: 'task-b3',
|
|
372
|
-
type: 'tool',
|
|
373
|
-
config: { tool: 'calculator' },
|
|
374
|
-
depends_on: ['task-b1'],
|
|
375
|
-
retry: { max_attempts: 2, backoff: 'fixed', initial_delay: 500 },
|
|
376
|
-
},
|
|
377
|
-
// Parallel branch C - with potential failure
|
|
378
|
-
{ id: 'task-c1', type: 'tool', config: { tool: 'calculator' }, depends_on: ['entry'] },
|
|
379
|
-
{
|
|
380
|
-
id: 'task-c2',
|
|
381
|
-
type: 'tool',
|
|
382
|
-
config: { tool: 'calculator' },
|
|
383
|
-
depends_on: ['task-c1'],
|
|
384
|
-
retry: { max_attempts: 3, backoff: 'exponential', initial_delay: 1000 },
|
|
385
|
-
},
|
|
386
|
-
// Merge all branches
|
|
387
|
-
{
|
|
388
|
-
id: 'merge-ab',
|
|
389
|
-
type: 'merge',
|
|
390
|
-
config: { strategy: 'collect' },
|
|
391
|
-
depends_on: ['task-a3', 'task-b2', 'task-c2'],
|
|
392
|
-
},
|
|
393
|
-
// Final processing
|
|
394
|
-
{ id: 'final', type: 'tool', config: { tool: 'echo' }, depends_on: ['merge-ab'] },
|
|
395
|
-
],
|
|
396
|
-
});
|
|
397
|
-
/**
|
|
398
|
-
* Complex Workflow: Nested Workflow Composition
|
|
399
|
-
*
|
|
400
|
-
* Features:
|
|
401
|
-
* - Nested workflow calls
|
|
402
|
-
* - Multiple levels of abstraction
|
|
403
|
-
* - Shared state passing
|
|
404
|
-
* - Complex dependency chains
|
|
405
|
-
*/
|
|
406
|
-
const createNestedWorkflow = () => ({
|
|
407
|
-
name: 'nested-workflow-composition',
|
|
408
|
-
version: '1.0',
|
|
409
|
-
nodes: [
|
|
410
|
-
{ id: 'start', type: 'tool', config: { tool: 'echo' }, depends_on: [] },
|
|
411
|
-
// First level nested
|
|
412
|
-
{ id: 'sub-workflow-1', type: 'workflow', config: { workflow_name: 'sub-workflow-a' }, depends_on: ['start'] },
|
|
413
|
-
{ id: 'sub-workflow-2', type: 'workflow', config: { workflow_name: 'sub-workflow-b' }, depends_on: ['start'] },
|
|
414
|
-
// Second level - parallel execution
|
|
415
|
-
{ id: 'level-2-a', type: 'tool', config: { tool: 'validator' }, depends_on: ['sub-workflow-1'] },
|
|
416
|
-
{ id: 'level-2-b', type: 'tool', config: { tool: 'validator' }, depends_on: ['sub-workflow-1'] },
|
|
417
|
-
{ id: 'level-2-c', type: 'tool', config: { tool: 'validator' }, depends_on: ['sub-workflow-2'] },
|
|
418
|
-
// Merge and continue
|
|
419
|
-
{ id: 'merge-2', type: 'merge', config: { strategy: 'collect' }, depends_on: ['level-2-a', 'level-2-b', 'level-2-c'] },
|
|
420
|
-
// Third level
|
|
421
|
-
{ id: 'level-3', type: 'tool', config: { tool: 'calculator' }, depends_on: ['merge-2'] },
|
|
422
|
-
// Final nested call
|
|
423
|
-
{ id: 'final-nested', type: 'workflow', config: { workflow_name: 'final-workflow' }, depends_on: ['level-3'] },
|
|
424
|
-
],
|
|
425
|
-
});
|
|
426
|
-
/**
|
|
427
|
-
* Complex Workflow: Conditional Execution Graph
|
|
428
|
-
*
|
|
429
|
-
* Features:
|
|
430
|
-
* - Multiple conditional branches
|
|
431
|
-
* - Skip logic
|
|
432
|
-
* - Dynamic paths based on runtime conditions
|
|
433
|
-
*/
|
|
434
|
-
const createConditionalWorkflow = () => ({
|
|
435
|
-
name: 'conditional-execution',
|
|
436
|
-
version: '1.0',
|
|
437
|
-
nodes: [
|
|
438
|
-
{ id: 'init', type: 'tool', config: { tool: 'echo' } },
|
|
439
|
-
// First condition
|
|
440
|
-
{
|
|
441
|
-
id: 'check-mode',
|
|
442
|
-
type: 'condition',
|
|
443
|
-
config: { condition: '{{input.mode}}' },
|
|
444
|
-
depends_on: ['init'],
|
|
445
|
-
},
|
|
446
|
-
// Mode A path
|
|
447
|
-
{ id: 'mode-a-1', type: 'tool', config: { tool: 'calculator' }, depends_on: ['check-mode'] },
|
|
448
|
-
{ id: 'mode-a-2', type: 'tool', config: { tool: 'calculator' }, depends_on: ['mode-a-1'] },
|
|
449
|
-
// Mode B path
|
|
450
|
-
{ id: 'mode-b-1', type: 'tool', config: { tool: 'validator' }, depends_on: ['check-mode'] },
|
|
451
|
-
{ id: 'mode-b-2', type: 'tool', config: { tool: 'validator' }, depends_on: ['mode-b-1'] },
|
|
452
|
-
// Merge after conditional paths
|
|
453
|
-
{ id: 'merge-cond', type: 'merge', config: { strategy: 'collect' }, depends_on: ['mode-a-2', 'mode-b-2'] },
|
|
454
|
-
// Final check
|
|
455
|
-
{
|
|
456
|
-
id: 'final-check',
|
|
457
|
-
type: 'condition',
|
|
458
|
-
config: { condition: '{{merge-cond.valid}}' },
|
|
459
|
-
depends_on: ['merge-cond'],
|
|
460
|
-
},
|
|
461
|
-
// Output
|
|
462
|
-
{ id: 'output', type: 'tool', config: { tool: 'echo' }, depends_on: ['final-check'] },
|
|
463
|
-
],
|
|
464
|
-
});
|
|
465
|
-
/**
|
|
466
|
-
* Complex Workflow: Diamond Pattern
|
|
467
|
-
*
|
|
468
|
-
* A -> B1 -> C -> D
|
|
469
|
-
* -> B2 ->
|
|
470
|
-
* -> B3 ->
|
|
471
|
-
*
|
|
472
|
-
* Classic diamond dependency pattern
|
|
473
|
-
*/
|
|
474
|
-
const createDiamondWorkflow = () => ({
|
|
475
|
-
name: 'diamond-pattern',
|
|
476
|
-
version: '1.0',
|
|
477
|
-
nodes: [
|
|
478
|
-
{ id: 'A', type: 'tool', config: { tool: 'echo' }, depends_on: [] },
|
|
479
|
-
{ id: 'B1', type: 'tool', config: { tool: 'calculator' }, depends_on: ['A'] },
|
|
480
|
-
{ id: 'B2', type: 'tool', config: { tool: 'calculator' }, depends_on: ['A'] },
|
|
481
|
-
{ id: 'B3', type: 'tool', config: { tool: 'calculator' }, depends_on: ['A'] },
|
|
482
|
-
{
|
|
483
|
-
id: 'C',
|
|
484
|
-
type: 'tool',
|
|
485
|
-
config: { tool: 'calculator' },
|
|
486
|
-
depends_on: ['B1', 'B2', 'B3'],
|
|
487
|
-
retry: { max_attempts: 2, backoff: 'exponential', initial_delay: 500 },
|
|
488
|
-
},
|
|
489
|
-
{ id: 'D', type: 'tool', config: { tool: 'echo' }, depends_on: ['C'] },
|
|
490
|
-
],
|
|
491
|
-
});
|
|
492
|
-
/**
|
|
493
|
-
* Complex Workflow: Multi-Node Type Orchestration
|
|
494
|
-
*
|
|
495
|
-
* Demonstrates chaining different node types:
|
|
496
|
-
* - ToolNode → AgentNode → SkillNode → WorkflowNode → ToolNode
|
|
497
|
-
* - Template variable passing between different node types
|
|
498
|
-
* - Real-world AI pipeline pattern
|
|
499
|
-
*/
|
|
500
|
-
const createMultiNodeTypeWorkflow = () => ({
|
|
501
|
-
name: 'multi-node-type-orchestration',
|
|
502
|
-
version: '1.0',
|
|
503
|
-
description: 'Orchestration across Tool, Agent, Skill, and Workflow nodes',
|
|
504
|
-
nodes: [
|
|
505
|
-
// ========== Step 1: Tool - Data Preparation ==========
|
|
506
|
-
{
|
|
507
|
-
id: 'prepare-data',
|
|
508
|
-
type: 'tool',
|
|
509
|
-
name: 'Prepare Input Data',
|
|
510
|
-
config: { tool: 'echo', message: 'Preparing initial data' },
|
|
511
|
-
depends_on: [],
|
|
512
|
-
},
|
|
513
|
-
// ========== Step 2: Agent - Analysis ==========
|
|
514
|
-
{
|
|
515
|
-
id: 'analyze-data',
|
|
516
|
-
type: 'agent',
|
|
517
|
-
name: 'AI Data Analyst',
|
|
518
|
-
config: {
|
|
519
|
-
agent_type: 'general',
|
|
520
|
-
prompt: 'Analyze the input data: {{prepare-data.output}}. Provide insights.',
|
|
521
|
-
},
|
|
522
|
-
depends_on: ['prepare-data'],
|
|
523
|
-
},
|
|
524
|
-
// ========== Step 3: Tool - Validate Analysis ==========
|
|
525
|
-
{
|
|
526
|
-
id: 'validate-analysis',
|
|
527
|
-
type: 'tool',
|
|
528
|
-
name: 'Validate Analysis Results',
|
|
529
|
-
config: { tool: 'validator', source: 'analysis' },
|
|
530
|
-
depends_on: ['analyze-data'],
|
|
531
|
-
},
|
|
532
|
-
// ========== Step 4: Agent - Decision Making ==========
|
|
533
|
-
{
|
|
534
|
-
id: 'make-decision',
|
|
535
|
-
type: 'agent',
|
|
536
|
-
name: 'Decision Agent',
|
|
537
|
-
config: {
|
|
538
|
-
agent_type: 'general',
|
|
539
|
-
prompt: 'Based on analysis: {{analyze-data.output}}, decide next steps.',
|
|
540
|
-
},
|
|
541
|
-
depends_on: ['validate-analysis'],
|
|
542
|
-
},
|
|
543
|
-
// ========== Step 5: Skill - Transform Data ==========
|
|
544
|
-
{
|
|
545
|
-
id: 'transform-data',
|
|
546
|
-
type: 'skill',
|
|
547
|
-
name: 'Data Transformation Skill',
|
|
548
|
-
config: {
|
|
549
|
-
skill: 'data-transform',
|
|
550
|
-
input: {
|
|
551
|
-
data: '{{analyze-data.output}}',
|
|
552
|
-
format: 'json',
|
|
553
|
-
},
|
|
554
|
-
},
|
|
555
|
-
depends_on: ['make-decision'],
|
|
556
|
-
},
|
|
557
|
-
// ========== Step 6: Nested Workflow ==========
|
|
558
|
-
{
|
|
559
|
-
id: 'process-workflow',
|
|
560
|
-
type: 'workflow',
|
|
561
|
-
name: 'Sub-Process Workflow',
|
|
562
|
-
config: {
|
|
563
|
-
workflow_name: 'data-processing-subflow',
|
|
564
|
-
input: {
|
|
565
|
-
source: '{{transform-data.output}}',
|
|
566
|
-
},
|
|
567
|
-
},
|
|
568
|
-
depends_on: ['transform-data'],
|
|
569
|
-
},
|
|
570
|
-
// ========== Step 7: Tool - Final Output ==========
|
|
571
|
-
{
|
|
572
|
-
id: 'format-output',
|
|
573
|
-
type: 'tool',
|
|
574
|
-
name: 'Format Final Output',
|
|
575
|
-
config: { tool: 'calculator', operation: 'format' },
|
|
576
|
-
depends_on: ['process-workflow'],
|
|
577
|
-
},
|
|
578
|
-
],
|
|
579
|
-
outputs: [
|
|
580
|
-
{ name: 'analysis_result', source: 'analyze-data', path: 'output' },
|
|
581
|
-
{ name: 'decision', source: 'make-decision', path: 'output' },
|
|
582
|
-
{ name: 'transformed_data', source: 'transform-data', path: 'output' },
|
|
583
|
-
{ name: 'final_result', source: 'format-output', path: 'result' },
|
|
584
|
-
],
|
|
585
|
-
metadata: {
|
|
586
|
-
author: 'Roy Agent',
|
|
587
|
-
tags: ['multi-node', 'orchestration', 'ai-pipeline'],
|
|
588
|
-
},
|
|
589
|
-
});
|
|
590
|
-
/**
|
|
591
|
-
* Complex Workflow: Tool-Skill-Agent Chain
|
|
592
|
-
*
|
|
593
|
-
* A realistic AI pipeline demonstrating:
|
|
594
|
-
* - Tool (data fetch)
|
|
595
|
-
* - Agent (reasoning)
|
|
596
|
-
* - Skill (processing)
|
|
597
|
-
* - Another Agent (verification)
|
|
598
|
-
* - Tool (output)
|
|
599
|
-
*/
|
|
600
|
-
const createToolSkillAgentChain = () => ({
|
|
601
|
-
name: 'tool-skill-agent-chain',
|
|
602
|
-
version: '1.0',
|
|
603
|
-
nodes: [
|
|
604
|
-
// Tool: Fetch raw data
|
|
605
|
-
{
|
|
606
|
-
id: 'fetch-raw-data',
|
|
607
|
-
type: 'tool',
|
|
608
|
-
name: 'Fetch Raw Data',
|
|
609
|
-
config: { tool: 'echo', message: 'Fetching data from source' },
|
|
610
|
-
depends_on: [],
|
|
611
|
-
},
|
|
612
|
-
// Agent: Initial understanding
|
|
613
|
-
{
|
|
614
|
-
id: 'understand-context',
|
|
615
|
-
type: 'agent',
|
|
616
|
-
name: 'Context Understanding Agent',
|
|
617
|
-
config: {
|
|
618
|
-
agent_type: 'general',
|
|
619
|
-
prompt: 'Understand the context of: {{fetch-raw-data.output}}',
|
|
620
|
-
},
|
|
621
|
-
depends_on: ['fetch-raw-data'],
|
|
622
|
-
},
|
|
623
|
-
// Skill: Process with skill
|
|
624
|
-
{
|
|
625
|
-
id: 'process-with-skill',
|
|
626
|
-
type: 'skill',
|
|
627
|
-
name: 'Processing Skill',
|
|
628
|
-
config: {
|
|
629
|
-
skill: 'text-processor',
|
|
630
|
-
input: {
|
|
631
|
-
text: '{{understand-context.output}}',
|
|
632
|
-
options: { lowercase: true },
|
|
633
|
-
},
|
|
634
|
-
},
|
|
635
|
-
depends_on: ['understand-context'],
|
|
636
|
-
},
|
|
637
|
-
// Agent: Deep reasoning
|
|
638
|
-
{
|
|
639
|
-
id: 'deep-reasoning',
|
|
640
|
-
type: 'agent',
|
|
641
|
-
name: 'Deep Reasoning Agent',
|
|
642
|
-
config: {
|
|
643
|
-
agent_type: 'general',
|
|
644
|
-
prompt: 'Perform deep reasoning on: {{process-with-skill.output}}',
|
|
645
|
-
},
|
|
646
|
-
depends_on: ['process-with-skill'],
|
|
647
|
-
},
|
|
648
|
-
// Skill: Another skill processing
|
|
649
|
-
{
|
|
650
|
-
id: 'enhance-result',
|
|
651
|
-
type: 'skill',
|
|
652
|
-
name: 'Enhancement Skill',
|
|
653
|
-
config: {
|
|
654
|
-
skill: 'enhancer',
|
|
655
|
-
input: {
|
|
656
|
-
data: '{{deep-reasoning.output}}',
|
|
657
|
-
},
|
|
658
|
-
},
|
|
659
|
-
depends_on: ['deep-reasoning'],
|
|
660
|
-
},
|
|
661
|
-
// Tool: Final validation
|
|
662
|
-
{
|
|
663
|
-
id: 'final-validate',
|
|
664
|
-
type: 'tool',
|
|
665
|
-
name: 'Final Validation',
|
|
666
|
-
config: { tool: 'validator', source: 'final' },
|
|
667
|
-
depends_on: ['enhance-result'],
|
|
668
|
-
},
|
|
669
|
-
],
|
|
670
|
-
});
|
|
671
|
-
/**
|
|
672
|
-
* Complex Workflow: Parallel Tool-Agent Branches
|
|
673
|
-
*
|
|
674
|
-
* Multiple parallel branches, each with Tool → Agent pattern
|
|
675
|
-
*/
|
|
676
|
-
const createParallelToolAgentWorkflow = () => ({
|
|
677
|
-
name: 'parallel-tool-agent-branches',
|
|
678
|
-
version: '1.0',
|
|
679
|
-
nodes: [
|
|
680
|
-
// Entry
|
|
681
|
-
{ id: 'start', type: 'tool', config: { tool: 'echo' }, depends_on: [] },
|
|
682
|
-
// Branch A: Tool → Agent
|
|
683
|
-
{ id: 'tool-a', type: 'tool', config: { tool: 'calculator' }, depends_on: ['start'] },
|
|
684
|
-
{
|
|
685
|
-
id: 'agent-a',
|
|
686
|
-
type: 'agent',
|
|
687
|
-
config: { agent_type: 'general', prompt: 'Process: {{tool-a.output}}' },
|
|
688
|
-
depends_on: ['tool-a'],
|
|
689
|
-
},
|
|
690
|
-
// Branch B: Tool → Agent
|
|
691
|
-
{ id: 'tool-b', type: 'tool', config: { tool: 'validator' }, depends_on: ['start'] },
|
|
692
|
-
{
|
|
693
|
-
id: 'agent-b',
|
|
694
|
-
type: 'agent',
|
|
695
|
-
config: { agent_type: 'general', prompt: 'Process: {{tool-b.output}}' },
|
|
696
|
-
depends_on: ['tool-b'],
|
|
697
|
-
},
|
|
698
|
-
// Branch C: Tool → Agent
|
|
699
|
-
{ id: 'tool-c', type: 'tool', config: { tool: 'echo' }, depends_on: ['start'] },
|
|
700
|
-
{
|
|
701
|
-
id: 'agent-c',
|
|
702
|
-
type: 'agent',
|
|
703
|
-
config: { agent_type: 'general', prompt: 'Process: {{tool-c.output}}' },
|
|
704
|
-
depends_on: ['tool-c'],
|
|
705
|
-
},
|
|
706
|
-
// Merge all agent outputs
|
|
707
|
-
{
|
|
708
|
-
id: 'merge-agents',
|
|
709
|
-
type: 'merge',
|
|
710
|
-
config: { strategy: 'collect' },
|
|
711
|
-
depends_on: ['agent-a', 'agent-b', 'agent-c'],
|
|
712
|
-
},
|
|
713
|
-
// Final aggregation agent
|
|
714
|
-
{
|
|
715
|
-
id: 'aggregate-results',
|
|
716
|
-
type: 'agent',
|
|
717
|
-
name: 'Aggregation Agent',
|
|
718
|
-
config: {
|
|
719
|
-
agent_type: 'general',
|
|
720
|
-
prompt: 'Aggregate and summarize results from all branches.',
|
|
721
|
-
},
|
|
722
|
-
depends_on: ['merge-agents'],
|
|
723
|
-
},
|
|
724
|
-
// Output tool
|
|
725
|
-
{ id: 'output', type: 'tool', config: { tool: 'echo' }, depends_on: ['aggregate-results'] },
|
|
726
|
-
],
|
|
727
|
-
});
|
|
728
|
-
/**
|
|
729
|
-
* Complex Workflow: Template Variable Passing
|
|
730
|
-
*
|
|
731
|
-
* Tests HIL (Human Input Language) template variable passing
|
|
732
|
-
*/
|
|
733
|
-
const createTemplateVariableWorkflow = () => ({
|
|
734
|
-
name: 'template-variables',
|
|
735
|
-
version: '1.0',
|
|
736
|
-
nodes: [
|
|
737
|
-
{
|
|
738
|
-
id: 'init',
|
|
739
|
-
type: 'tool',
|
|
740
|
-
config: { tool: 'echo', message: '{{input.greeting}}' },
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
id: 'process',
|
|
744
|
-
type: 'tool',
|
|
745
|
-
config: { tool: 'calculator', expression: '{{init.result}} + {{input.value}}' },
|
|
746
|
-
depends_on: ['init'],
|
|
747
|
-
},
|
|
748
|
-
{
|
|
749
|
-
id: 'validate',
|
|
750
|
-
type: 'condition',
|
|
751
|
-
config: { condition: '{{process.result}} > {{input.threshold}}' },
|
|
752
|
-
depends_on: ['process'],
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
id: 'output',
|
|
756
|
-
type: 'tool',
|
|
757
|
-
config: { tool: 'echo', message: 'Result: {{process.result}}, Valid: {{validate.conditionMet}}' },
|
|
758
|
-
depends_on: ['validate'],
|
|
759
|
-
},
|
|
760
|
-
],
|
|
761
|
-
});
|
|
762
|
-
/**
|
|
763
|
-
* Complex Workflow: Complex Dependency Graph
|
|
764
|
-
*
|
|
765
|
-
* Features:
|
|
766
|
-
* - Multiple entry points
|
|
767
|
-
* - Complex merge patterns
|
|
768
|
-
* - Cross-branch dependencies
|
|
769
|
-
*/
|
|
770
|
-
const createComplexDependencyWorkflow = () => ({
|
|
771
|
-
name: 'complex-dependency-graph',
|
|
772
|
-
version: '1.0',
|
|
773
|
-
nodes: [
|
|
774
|
-
// Two entry points
|
|
775
|
-
{ id: 'entry-1', type: 'tool', config: { tool: 'echo' }, depends_on: [] },
|
|
776
|
-
{ id: 'entry-2', type: 'tool', config: { tool: 'echo' }, depends_on: [] },
|
|
777
|
-
// Parallel branches from entry-1
|
|
778
|
-
{ id: 'branch-1a', type: 'tool', config: { tool: 'calculator' }, depends_on: ['entry-1'] },
|
|
779
|
-
{ id: 'branch-1b', type: 'tool', config: { tool: 'calculator' }, depends_on: ['entry-1'] },
|
|
780
|
-
// Parallel branches from entry-2
|
|
781
|
-
{ id: 'branch-2a', type: 'tool', config: { tool: 'validator' }, depends_on: ['entry-2'] },
|
|
782
|
-
{ id: 'branch-2b', type: 'tool', config: { tool: 'validator' }, depends_on: ['entry-2'] },
|
|
783
|
-
// Cross-branch dependency: branch-1a depends on branch-2a
|
|
784
|
-
{ id: 'cross-dep', type: 'tool', config: { tool: 'calculator' }, depends_on: ['branch-1a', 'branch-2a'] },
|
|
785
|
-
// Merge all
|
|
786
|
-
{ id: 'merge-1', type: 'merge', config: { strategy: 'collect' }, depends_on: ['branch-1b', 'branch-2b', 'cross-dep'] },
|
|
787
|
-
// Final processing
|
|
788
|
-
{ id: 'final', type: 'tool', config: { tool: 'echo' }, depends_on: ['merge-1'] },
|
|
789
|
-
],
|
|
790
|
-
});
|
|
791
|
-
// ==================== Test Suites ====================
|
|
792
|
-
describe('Complex Multi-Node Workflow Integration Tests', () => {
|
|
793
|
-
let executor;
|
|
794
|
-
beforeEach(() => {
|
|
795
|
-
executor = new SyncWorkflowExecutor();
|
|
796
|
-
});
|
|
797
|
-
afterEach(() => {
|
|
798
|
-
executor.clearTrace();
|
|
799
|
-
});
|
|
800
|
-
// ==================== Workflow Structure Tests ====================
|
|
801
|
-
describe('Data Processing Pipeline Workflow', () => {
|
|
802
|
-
const workflow = createDataProcessingWorkflow();
|
|
803
|
-
it('should have 12 nodes', () => {
|
|
804
|
-
expect(workflow.nodes).toHaveLength(12);
|
|
805
|
-
});
|
|
806
|
-
it('should have correct node IDs', () => {
|
|
807
|
-
const nodeIds = workflow.nodes.map(n => n.id);
|
|
808
|
-
expect(nodeIds).toContain('init');
|
|
809
|
-
expect(nodeIds).toContain('merge-data');
|
|
810
|
-
expect(nodeIds).toContain('finalize-results');
|
|
811
|
-
expect(nodeIds).toContain('output');
|
|
812
|
-
});
|
|
813
|
-
it('should have parallel branches from init', () => {
|
|
814
|
-
const fetchNodes = workflow.nodes.filter(n => n.depends_on && n.depends_on.includes('init'));
|
|
815
|
-
expect(fetchNodes.length).toBe(3); // fetch-users, fetch-products, fetch-orders
|
|
816
|
-
});
|
|
817
|
-
it('should have diamond pattern with merge-data', () => {
|
|
818
|
-
const mergeNode = workflow.nodes.find(n => n.id === 'merge-data');
|
|
819
|
-
expect(mergeNode.depends_on).toBeDefined();
|
|
820
|
-
expect(mergeNode.depends_on).toContain('fetch-users');
|
|
821
|
-
expect(mergeNode.depends_on).toContain('fetch-products');
|
|
822
|
-
expect(mergeNode.depends_on).toContain('fetch-orders');
|
|
823
|
-
});
|
|
824
|
-
it('should have nodes with retry configuration', () => {
|
|
825
|
-
const retryNode = workflow.nodes.find(n => n.id === 'process-users');
|
|
826
|
-
expect(retryNode.retry).toBeDefined();
|
|
827
|
-
expect(retryNode.retry?.max_attempts).toBe(3);
|
|
828
|
-
expect(retryNode.retry?.backoff).toBe('exponential');
|
|
829
|
-
});
|
|
830
|
-
it('should have nested workflow node', () => {
|
|
831
|
-
const nestedNode = workflow.nodes.find(n => n.id === 'create-report');
|
|
832
|
-
expect(nestedNode.type).toBe('nested');
|
|
833
|
-
expect(nestedNode.config.workflow).toBe('report-generation');
|
|
834
|
-
});
|
|
835
|
-
it('should have correct output definitions', () => {
|
|
836
|
-
expect(workflow.outputs).toHaveLength(3);
|
|
837
|
-
expect(workflow.outputs?.find(o => o.name === 'final_result')?.source).toBe('output');
|
|
838
|
-
});
|
|
839
|
-
it('should have metadata with tags', () => {
|
|
840
|
-
expect(workflow.metadata?.tags).toContain('data-processing');
|
|
841
|
-
expect(workflow.metadata?.author).toBe('Roy Agent');
|
|
842
|
-
});
|
|
843
|
-
it('should execute in correct topological order', () => {
|
|
844
|
-
const order = topologicalSort(workflow);
|
|
845
|
-
// init should come before fetch-*
|
|
846
|
-
expect(order.indexOf('init')).toBeLessThan(order.indexOf('fetch-users'));
|
|
847
|
-
expect(order.indexOf('init')).toBeLessThan(order.indexOf('fetch-products'));
|
|
848
|
-
expect(order.indexOf('init')).toBeLessThan(order.indexOf('fetch-orders'));
|
|
849
|
-
// merge-data should come after all fetches
|
|
850
|
-
expect(order.indexOf('merge-data')).toBeGreaterThan(order.indexOf('fetch-users'));
|
|
851
|
-
expect(order.indexOf('merge-data')).toBeGreaterThan(order.indexOf('fetch-products'));
|
|
852
|
-
expect(order.indexOf('merge-data')).toBeGreaterThan(order.indexOf('fetch-orders'));
|
|
853
|
-
});
|
|
854
|
-
it('should execute all nodes successfully', () => {
|
|
855
|
-
const results = executeWorkflowSync(workflow, { generateReport: true }, executor);
|
|
856
|
-
expect(results.size).toBe(12);
|
|
857
|
-
expect(results.has('init')).toBe(true);
|
|
858
|
-
expect(results.has('merge-data')).toBe(true);
|
|
859
|
-
expect(results.has('output')).toBe(true);
|
|
860
|
-
// Verify execution order in trace
|
|
861
|
-
const trace = executor.getTrace();
|
|
862
|
-
expect(trace.executionOrder.length).toBe(12);
|
|
863
|
-
expect(trace.executionOrder[0]).toBe('init');
|
|
864
|
-
expect(trace.executionOrder[11]).toBe('output');
|
|
865
|
-
});
|
|
866
|
-
});
|
|
867
|
-
describe('Parallel Processing Workflow', () => {
|
|
868
|
-
const workflow = createParallelProcessingWorkflow();
|
|
869
|
-
it('should have parallel branches from entry', () => {
|
|
870
|
-
const parallelNodes = workflow.nodes.filter(n => n.depends_on?.includes('entry'));
|
|
871
|
-
expect(parallelNodes.length).toBe(3); // task-a1, task-b1, task-c1
|
|
872
|
-
});
|
|
873
|
-
it('should have correct branch structures', () => {
|
|
874
|
-
// Branch A: entry -> a1 -> a2 -> a3
|
|
875
|
-
expect(workflow.nodes.find(n => n.id === 'task-a1')?.depends_on).toContain('entry');
|
|
876
|
-
expect(workflow.nodes.find(n => n.id === 'task-a2')?.depends_on).toContain('task-a1');
|
|
877
|
-
expect(workflow.nodes.find(n => n.id === 'task-a3')?.depends_on).toContain('task-a2');
|
|
878
|
-
// Branch B: entry -> b1 -> b2/b3
|
|
879
|
-
expect(workflow.nodes.find(n => n.id === 'task-b1')?.depends_on).toContain('entry');
|
|
880
|
-
expect(workflow.nodes.find(n => n.id === 'task-b2')?.depends_on).toContain('task-b1');
|
|
881
|
-
expect(workflow.nodes.find(n => n.id === 'task-b3')?.depends_on).toContain('task-b1');
|
|
882
|
-
// Branch C: entry -> c1 -> c2
|
|
883
|
-
expect(workflow.nodes.find(n => n.id === 'task-c1')?.depends_on).toContain('entry');
|
|
884
|
-
expect(workflow.nodes.find(n => n.id === 'task-c2')?.depends_on).toContain('task-c1');
|
|
885
|
-
});
|
|
886
|
-
it('should have retry configured on specific nodes', () => {
|
|
887
|
-
const retryNode = workflow.nodes.find(n => n.id === 'task-b3');
|
|
888
|
-
expect(retryNode.retry?.max_attempts).toBe(2);
|
|
889
|
-
expect(retryNode.retry?.backoff).toBe('fixed');
|
|
890
|
-
const retryNode2 = workflow.nodes.find(n => n.id === 'task-c2');
|
|
891
|
-
expect(retryNode2.retry?.max_attempts).toBe(3);
|
|
892
|
-
expect(retryNode2.retry?.backoff).toBe('exponential');
|
|
893
|
-
});
|
|
894
|
-
it('should merge at merge-ab node', () => {
|
|
895
|
-
const mergeNode = workflow.nodes.find(n => n.id === 'merge-ab');
|
|
896
|
-
expect(mergeNode.depends_on).toContain('task-a3');
|
|
897
|
-
expect(mergeNode.depends_on).toContain('task-b2');
|
|
898
|
-
expect(mergeNode.depends_on).toContain('task-c2');
|
|
899
|
-
});
|
|
900
|
-
it('should execute all nodes', () => {
|
|
901
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
902
|
-
// entry + 3 branches * 3 nodes each (minus b3 since b2 and b3 both depend on b1) + merge + final
|
|
903
|
-
// 1 + 3 + 3 + 3 + 1 + 1 = 12... wait, let me count again
|
|
904
|
-
// entry, task-a1, task-a2, task-a3, task-b1, task-b2, task-b3, task-c1, task-c2, merge-ab, final = 11 nodes
|
|
905
|
-
expect(results.size).toBe(11);
|
|
906
|
-
});
|
|
907
|
-
});
|
|
908
|
-
describe('Nested Workflow Composition', () => {
|
|
909
|
-
const workflow = createNestedWorkflow();
|
|
910
|
-
it('should have multiple workflow nodes', () => {
|
|
911
|
-
const workflowNodes = workflow.nodes.filter(n => n.type === 'workflow');
|
|
912
|
-
expect(workflowNodes.length).toBe(3);
|
|
913
|
-
});
|
|
914
|
-
it('should have hierarchical structure', () => {
|
|
915
|
-
const startNode = workflow.nodes.find(n => n.id === 'start');
|
|
916
|
-
expect(startNode.depends_on).toBeDefined();
|
|
917
|
-
expect(startNode.depends_on.length).toBe(0);
|
|
918
|
-
const subWorkflow1 = workflow.nodes.find(n => n.id === 'sub-workflow-1');
|
|
919
|
-
expect(subWorkflow1.depends_on).toBeDefined();
|
|
920
|
-
expect(subWorkflow1.depends_on).toContain('start');
|
|
921
|
-
});
|
|
922
|
-
it('should execute workflow nodes', () => {
|
|
923
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
924
|
-
expect(results.has('sub-workflow-1')).toBe(true);
|
|
925
|
-
expect(results.has('final-nested')).toBe(true);
|
|
926
|
-
const nestedResult = results.get('sub-workflow-1');
|
|
927
|
-
expect(nestedResult).toBeDefined();
|
|
928
|
-
expect(nestedResult.nestedWorkflow).toBe('sub-workflow-a');
|
|
929
|
-
});
|
|
930
|
-
});
|
|
931
|
-
describe('Multi-Node Type Orchestration', () => {
|
|
932
|
-
const workflow = createMultiNodeTypeWorkflow();
|
|
933
|
-
it('should have various node types', () => {
|
|
934
|
-
const toolNodes = workflow.nodes.filter(n => n.type === 'tool');
|
|
935
|
-
const agentNodes = workflow.nodes.filter(n => n.type === 'agent');
|
|
936
|
-
const skillNodes = workflow.nodes.filter(n => n.type === 'skill');
|
|
937
|
-
const workflowNodes = workflow.nodes.filter(n => n.type === 'workflow');
|
|
938
|
-
expect(toolNodes.length).toBeGreaterThan(0);
|
|
939
|
-
expect(agentNodes.length).toBeGreaterThan(0);
|
|
940
|
-
expect(skillNodes.length).toBeGreaterThan(0);
|
|
941
|
-
expect(workflowNodes.length).toBeGreaterThan(0);
|
|
942
|
-
});
|
|
943
|
-
it('should have correct dependency chain', () => {
|
|
944
|
-
const prepareData = workflow.nodes.find(n => n.id === 'prepare-data');
|
|
945
|
-
expect(prepareData.depends_on?.length).toBe(0);
|
|
946
|
-
const analyzeData = workflow.nodes.find(n => n.id === 'analyze-data');
|
|
947
|
-
expect(analyzeData.depends_on).toContain('prepare-data');
|
|
948
|
-
const makeDecision = workflow.nodes.find(n => n.id === 'make-decision');
|
|
949
|
-
expect(makeDecision.depends_on).toContain('validate-analysis');
|
|
950
|
-
});
|
|
951
|
-
it('should have agent nodes with prompts', () => {
|
|
952
|
-
const agentNodes = workflow.nodes.filter(n => n.type === 'agent');
|
|
953
|
-
for (const agentNode of agentNodes) {
|
|
954
|
-
expect(agentNode.config).toBeDefined();
|
|
955
|
-
expect(agentNode.config.prompt).toBeDefined();
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
it('should have skill nodes with skill names', () => {
|
|
959
|
-
const skillNodes = workflow.nodes.filter(n => n.type === 'skill');
|
|
960
|
-
for (const skillNode of skillNodes) {
|
|
961
|
-
expect(skillNode.config).toBeDefined();
|
|
962
|
-
expect(skillNode.config.skill).toBeDefined();
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
it('should execute all node types', () => {
|
|
966
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
967
|
-
// All 7 nodes should be executed
|
|
968
|
-
// prepare-data, analyze-data, validate-analysis, make-decision, transform-data, process-workflow, format-output
|
|
969
|
-
expect(results.size).toBe(7);
|
|
970
|
-
// Verify tool nodes executed
|
|
971
|
-
expect(results.has('prepare-data')).toBe(true);
|
|
972
|
-
expect(results.has('format-output')).toBe(true);
|
|
973
|
-
// Verify agent nodes executed
|
|
974
|
-
expect(results.has('analyze-data')).toBe(true);
|
|
975
|
-
expect(results.has('make-decision')).toBe(true);
|
|
976
|
-
// Verify skill nodes executed
|
|
977
|
-
expect(results.has('transform-data')).toBe(true);
|
|
978
|
-
// Verify workflow nodes executed
|
|
979
|
-
expect(results.has('process-workflow')).toBe(true);
|
|
980
|
-
});
|
|
981
|
-
});
|
|
982
|
-
describe('Tool-Skill-Agent Chain', () => {
|
|
983
|
-
const workflow = createToolSkillAgentChain();
|
|
984
|
-
it('should alternate between tool, agent, and skill nodes', () => {
|
|
985
|
-
const toolNodes = workflow.nodes.filter(n => n.type === 'tool');
|
|
986
|
-
const agentNodes = workflow.nodes.filter(n => n.type === 'agent');
|
|
987
|
-
const skillNodes = workflow.nodes.filter(n => n.type === 'skill');
|
|
988
|
-
expect(toolNodes.length).toBe(2); // fetch and validate
|
|
989
|
-
expect(agentNodes.length).toBe(2); // understand and reasoning
|
|
990
|
-
expect(skillNodes.length).toBe(2); // process and enhance
|
|
991
|
-
});
|
|
992
|
-
it('should maintain execution order', () => {
|
|
993
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
994
|
-
expect(results.size).toBe(6);
|
|
995
|
-
// Verify tool → agent → skill chain
|
|
996
|
-
const toolResult = results.get('fetch-raw-data');
|
|
997
|
-
const agentResult = results.get('understand-context');
|
|
998
|
-
const skillResult = results.get('process-with-skill');
|
|
999
|
-
expect(toolResult).toBeDefined();
|
|
1000
|
-
expect(agentResult).toBeDefined();
|
|
1001
|
-
expect(skillResult).toBeDefined();
|
|
1002
|
-
});
|
|
1003
|
-
});
|
|
1004
|
-
describe('Parallel Tool-Agent Branches', () => {
|
|
1005
|
-
const workflow = createParallelToolAgentWorkflow();
|
|
1006
|
-
it('should have parallel tool-agent pairs', () => {
|
|
1007
|
-
const toolNodes = workflow.nodes.filter(n => n.type === 'tool');
|
|
1008
|
-
const agentNodes = workflow.nodes.filter(n => n.type === 'agent');
|
|
1009
|
-
expect(toolNodes.length).toBeGreaterThan(3); // start + 3 branch tools + output
|
|
1010
|
-
expect(agentNodes.length).toBe(4); // 3 branch agents + 1 aggregator
|
|
1011
|
-
});
|
|
1012
|
-
it('should have merge node after parallel branches', () => {
|
|
1013
|
-
const mergeNode = workflow.nodes.find(n => n.id === 'merge-agents');
|
|
1014
|
-
expect(mergeNode.type).toBe('merge');
|
|
1015
|
-
expect(mergeNode.depends_on).toContain('agent-a');
|
|
1016
|
-
expect(mergeNode.depends_on).toContain('agent-b');
|
|
1017
|
-
expect(mergeNode.depends_on).toContain('agent-c');
|
|
1018
|
-
});
|
|
1019
|
-
it('should execute all parallel branches', () => {
|
|
1020
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1021
|
-
expect(results.has('tool-a')).toBe(true);
|
|
1022
|
-
expect(results.has('agent-a')).toBe(true);
|
|
1023
|
-
expect(results.has('tool-b')).toBe(true);
|
|
1024
|
-
expect(results.has('agent-b')).toBe(true);
|
|
1025
|
-
expect(results.has('merge-agents')).toBe(true);
|
|
1026
|
-
expect(results.has('aggregate-results')).toBe(true);
|
|
1027
|
-
});
|
|
1028
|
-
});
|
|
1029
|
-
describe('Diamond Pattern Workflow', () => {
|
|
1030
|
-
const workflow = createDiamondWorkflow();
|
|
1031
|
-
it('should have classic diamond structure', () => {
|
|
1032
|
-
// A is the starting point
|
|
1033
|
-
const aNode = workflow.nodes.find(n => n.id === 'A');
|
|
1034
|
-
expect(aNode.depends_on).toBeDefined();
|
|
1035
|
-
expect(aNode.depends_on.length).toBe(0);
|
|
1036
|
-
// B1, B2, B3 all depend on A
|
|
1037
|
-
const b1Node = workflow.nodes.find(n => n.id === 'B1');
|
|
1038
|
-
const b2Node = workflow.nodes.find(n => n.id === 'B2');
|
|
1039
|
-
const b3Node = workflow.nodes.find(n => n.id === 'B3');
|
|
1040
|
-
expect(b1Node.depends_on).toContain('A');
|
|
1041
|
-
expect(b2Node.depends_on).toContain('A');
|
|
1042
|
-
expect(b3Node.depends_on).toContain('A');
|
|
1043
|
-
// C depends on all B nodes
|
|
1044
|
-
const cNode = workflow.nodes.find(n => n.id === 'C');
|
|
1045
|
-
expect(cNode.depends_on).toBeDefined();
|
|
1046
|
-
expect(cNode.depends_on).toContain('B1');
|
|
1047
|
-
expect(cNode.depends_on).toContain('B2');
|
|
1048
|
-
expect(cNode.depends_on).toContain('B3');
|
|
1049
|
-
// D depends on C
|
|
1050
|
-
const dNode = workflow.nodes.find(n => n.id === 'D');
|
|
1051
|
-
expect(dNode.depends_on).toContain('C');
|
|
1052
|
-
});
|
|
1053
|
-
it('should have 6 nodes total', () => {
|
|
1054
|
-
expect(workflow.nodes).toHaveLength(6);
|
|
1055
|
-
});
|
|
1056
|
-
it('should execute diamond pattern correctly', () => {
|
|
1057
|
-
const results = executeWorkflowSync(workflow, { test: 'data' }, executor);
|
|
1058
|
-
// All nodes should be executed
|
|
1059
|
-
expect(results.has('A')).toBe(true);
|
|
1060
|
-
expect(results.has('B1')).toBe(true);
|
|
1061
|
-
expect(results.has('B2')).toBe(true);
|
|
1062
|
-
expect(results.has('B3')).toBe(true);
|
|
1063
|
-
expect(results.has('C')).toBe(true);
|
|
1064
|
-
expect(results.has('D')).toBe(true);
|
|
1065
|
-
});
|
|
1066
|
-
it('should merge results at C node', () => {
|
|
1067
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1068
|
-
const cResult = results.get('C');
|
|
1069
|
-
expect(cResult).toBeDefined();
|
|
1070
|
-
});
|
|
1071
|
-
});
|
|
1072
|
-
describe('Conditional Execution Workflow', () => {
|
|
1073
|
-
const workflow = createConditionalWorkflow();
|
|
1074
|
-
it('should have conditional branching', () => {
|
|
1075
|
-
const checkNode = workflow.nodes.find(n => n.id === 'check-mode');
|
|
1076
|
-
expect(checkNode.type).toBe('condition');
|
|
1077
|
-
const modeA1 = workflow.nodes.find(n => n.id === 'mode-a-1');
|
|
1078
|
-
const modeB1 = workflow.nodes.find(n => n.id === 'mode-b-1');
|
|
1079
|
-
expect(modeA1.depends_on).toContain('check-mode');
|
|
1080
|
-
expect(modeB1.depends_on).toContain('check-mode');
|
|
1081
|
-
});
|
|
1082
|
-
it('should merge conditional paths', () => {
|
|
1083
|
-
const mergeNode = workflow.nodes.find(n => n.id === 'merge-cond');
|
|
1084
|
-
expect(mergeNode.depends_on).toBeDefined();
|
|
1085
|
-
expect(mergeNode.depends_on).toContain('mode-a-2');
|
|
1086
|
-
expect(mergeNode.depends_on).toContain('mode-b-2');
|
|
1087
|
-
});
|
|
1088
|
-
it('should execute conditional nodes', () => {
|
|
1089
|
-
const results = executeWorkflowSync(workflow, { mode: 'A' }, executor);
|
|
1090
|
-
expect(results.has('check-mode')).toBe(true);
|
|
1091
|
-
const checkResult = results.get('check-mode');
|
|
1092
|
-
expect(checkResult).toBeDefined();
|
|
1093
|
-
expect(checkResult.conditionMet).toBe(true);
|
|
1094
|
-
});
|
|
1095
|
-
});
|
|
1096
|
-
describe('Template Variable Workflow', () => {
|
|
1097
|
-
const workflow = createTemplateVariableWorkflow();
|
|
1098
|
-
it('should have template variables in node configs', () => {
|
|
1099
|
-
const initNode = workflow.nodes.find(n => n.id === 'init');
|
|
1100
|
-
expect(initNode.config.message).toContain('{{input.greeting}}');
|
|
1101
|
-
const processNode = workflow.nodes.find(n => n.id === 'process');
|
|
1102
|
-
expect(processNode.config.expression).toContain('{{init.result}}');
|
|
1103
|
-
expect(processNode.config.expression).toContain('{{input.value}}');
|
|
1104
|
-
});
|
|
1105
|
-
it('should have condition with template variables', () => {
|
|
1106
|
-
const validateNode = workflow.nodes.find(n => n.id === 'validate');
|
|
1107
|
-
expect(validateNode.config.condition).toContain('{{process.result}}');
|
|
1108
|
-
expect(validateNode.config.condition).toContain('{{input.threshold}}');
|
|
1109
|
-
});
|
|
1110
|
-
});
|
|
1111
|
-
describe('Complex Dependency Graph Workflow', () => {
|
|
1112
|
-
const workflow = createComplexDependencyWorkflow();
|
|
1113
|
-
it('should have multiple entry points', () => {
|
|
1114
|
-
const entry1 = workflow.nodes.find(n => n.id === 'entry-1');
|
|
1115
|
-
const entry2 = workflow.nodes.find(n => n.id === 'entry-2');
|
|
1116
|
-
expect(entry1.depends_on).toBeDefined();
|
|
1117
|
-
expect(entry1.depends_on.length).toBe(0);
|
|
1118
|
-
expect(entry2.depends_on).toBeDefined();
|
|
1119
|
-
expect(entry2.depends_on.length).toBe(0);
|
|
1120
|
-
});
|
|
1121
|
-
it('should have cross-branch dependencies', () => {
|
|
1122
|
-
const crossDep = workflow.nodes.find(n => n.id === 'cross-dep');
|
|
1123
|
-
expect(crossDep.depends_on).toBeDefined();
|
|
1124
|
-
expect(crossDep.depends_on).toContain('branch-1a');
|
|
1125
|
-
expect(crossDep.depends_on).toContain('branch-2a');
|
|
1126
|
-
});
|
|
1127
|
-
it('should handle complex merge patterns', () => {
|
|
1128
|
-
const mergeNode = workflow.nodes.find(n => n.id === 'merge-1');
|
|
1129
|
-
expect(mergeNode.depends_on).toBeDefined();
|
|
1130
|
-
expect(mergeNode.depends_on).toHaveLength(3);
|
|
1131
|
-
});
|
|
1132
|
-
it('should execute complex workflow correctly', () => {
|
|
1133
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1134
|
-
// entry-1, entry-2, branch-1a, branch-1b, branch-2a, branch-2b, cross-dep, merge-1, final = 9 nodes
|
|
1135
|
-
expect(results.size).toBe(9);
|
|
1136
|
-
});
|
|
1137
|
-
});
|
|
1138
|
-
// ==================== Retry Logic Tests ====================
|
|
1139
|
-
describe('Retry Configuration', () => {
|
|
1140
|
-
it('should configure retry with exponential backoff', () => {
|
|
1141
|
-
const workflow = createDataProcessingWorkflow();
|
|
1142
|
-
const retryNode = workflow.nodes.find(n => n.id === 'process-users');
|
|
1143
|
-
expect(retryNode.retry).toBeDefined();
|
|
1144
|
-
expect(retryNode.retry?.max_attempts).toBe(3);
|
|
1145
|
-
expect(retryNode.retry?.backoff).toBe('exponential');
|
|
1146
|
-
expect(retryNode.retry?.initial_delay).toBe(1000);
|
|
1147
|
-
});
|
|
1148
|
-
it('should configure retry with fixed backoff', () => {
|
|
1149
|
-
const workflow = createParallelProcessingWorkflow();
|
|
1150
|
-
const retryNode = workflow.nodes.find(n => n.id === 'task-b3');
|
|
1151
|
-
expect(retryNode.retry).toBeDefined();
|
|
1152
|
-
expect(retryNode.retry?.backoff).toBe('fixed');
|
|
1153
|
-
expect(retryNode.retry?.initial_delay).toBe(500);
|
|
1154
|
-
});
|
|
1155
|
-
it('should have retry node in diamond workflow', () => {
|
|
1156
|
-
const workflow = createDiamondWorkflow();
|
|
1157
|
-
const retryNode = workflow.nodes.find(n => n.id === 'C');
|
|
1158
|
-
expect(retryNode.retry).toBeDefined();
|
|
1159
|
-
expect(retryNode.retry?.max_attempts).toBe(2);
|
|
1160
|
-
});
|
|
1161
|
-
});
|
|
1162
|
-
// ==================== Workflow Validation Tests ====================
|
|
1163
|
-
describe('Workflow Validation', () => {
|
|
1164
|
-
it('should validate workflow with all required fields', () => {
|
|
1165
|
-
const workflow = createDataProcessingWorkflow();
|
|
1166
|
-
// Should have name
|
|
1167
|
-
expect(workflow.name).toBeTruthy();
|
|
1168
|
-
// Should have at least one node
|
|
1169
|
-
expect(workflow.nodes.length).toBeGreaterThan(0);
|
|
1170
|
-
// All nodes should have id and type
|
|
1171
|
-
for (const node of workflow.nodes) {
|
|
1172
|
-
expect(node.id).toBeTruthy();
|
|
1173
|
-
expect(node.type).toBeTruthy();
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
it('should have valid dependency references', () => {
|
|
1177
|
-
const workflow = createDataProcessingWorkflow();
|
|
1178
|
-
const nodeIds = new Set(workflow.nodes.map(n => n.id));
|
|
1179
|
-
for (const node of workflow.nodes) {
|
|
1180
|
-
if (node.depends_on) {
|
|
1181
|
-
for (const depId of node.depends_on) {
|
|
1182
|
-
expect(nodeIds.has(depId)).toBe(true);
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
});
|
|
1187
|
-
it('should detect circular dependencies', () => {
|
|
1188
|
-
const circularWorkflow = {
|
|
1189
|
-
name: 'circular',
|
|
1190
|
-
nodes: [
|
|
1191
|
-
{ id: 'a', type: 'tool', config: {}, depends_on: ['c'] },
|
|
1192
|
-
{ id: 'b', type: 'tool', config: {}, depends_on: ['a'] },
|
|
1193
|
-
{ id: 'c', type: 'tool', config: {}, depends_on: ['b'] },
|
|
1194
|
-
],
|
|
1195
|
-
};
|
|
1196
|
-
expect(() => topologicalSort(circularWorkflow)).toThrow();
|
|
1197
|
-
});
|
|
1198
|
-
});
|
|
1199
|
-
// ==================== Schema Validation Tests ====================
|
|
1200
|
-
describe('Schema Validation', () => {
|
|
1201
|
-
it('should validate NodeDefinition schema', () => {
|
|
1202
|
-
const NodeDefinitionSchema = z.object({
|
|
1203
|
-
id: z.string().min(1),
|
|
1204
|
-
type: z.string().min(1),
|
|
1205
|
-
name: z.string().optional(),
|
|
1206
|
-
config: z.record(z.string(), z.unknown()).optional(),
|
|
1207
|
-
depends_on: z.array(z.string()).optional(),
|
|
1208
|
-
condition: z.string().optional(),
|
|
1209
|
-
retry: z.object({
|
|
1210
|
-
max_attempts: z.number().min(1),
|
|
1211
|
-
backoff: z.enum(['fixed', 'exponential']),
|
|
1212
|
-
initial_delay: z.number().min(0),
|
|
1213
|
-
}).optional(),
|
|
1214
|
-
timeout: z.number().optional(),
|
|
1215
|
-
});
|
|
1216
|
-
const validNode = {
|
|
1217
|
-
id: 'test-node',
|
|
1218
|
-
type: 'tool',
|
|
1219
|
-
name: 'Test Node',
|
|
1220
|
-
config: { tool: 'test' },
|
|
1221
|
-
depends_on: ['dep1'],
|
|
1222
|
-
retry: { max_attempts: 3, backoff: 'exponential', initial_delay: 1000 },
|
|
1223
|
-
};
|
|
1224
|
-
const result = NodeDefinitionSchema.safeParse(validNode);
|
|
1225
|
-
expect(result.success).toBe(true);
|
|
1226
|
-
});
|
|
1227
|
-
it('should reject invalid retry config', () => {
|
|
1228
|
-
const RetryConfigSchema = z.object({
|
|
1229
|
-
max_attempts: z.number().min(1),
|
|
1230
|
-
backoff: z.enum(['fixed', 'exponential']),
|
|
1231
|
-
initial_delay: z.number().min(0),
|
|
1232
|
-
});
|
|
1233
|
-
const invalidConfig = { max_attempts: 0, backoff: 'invalid', initial_delay: -100 };
|
|
1234
|
-
const result = RetryConfigSchema.safeParse(invalidConfig);
|
|
1235
|
-
expect(result.success).toBe(false);
|
|
1236
|
-
});
|
|
1237
|
-
it('should validate WorkflowDefinition schema', () => {
|
|
1238
|
-
const WorkflowDefinitionSchema = z.object({
|
|
1239
|
-
name: z.string().min(1),
|
|
1240
|
-
version: z.string().default('1.0'),
|
|
1241
|
-
description: z.string().optional(),
|
|
1242
|
-
nodes: z.array(z.object({
|
|
1243
|
-
id: z.string().min(1),
|
|
1244
|
-
type: z.string().min(1),
|
|
1245
|
-
})).min(1),
|
|
1246
|
-
entry: z.union([z.string(), z.array(z.string())]).default('__default_entry__'),
|
|
1247
|
-
});
|
|
1248
|
-
const validWorkflow = {
|
|
1249
|
-
name: 'test-workflow',
|
|
1250
|
-
nodes: [{ id: 'n1', type: 'tool' }],
|
|
1251
|
-
};
|
|
1252
|
-
const result = WorkflowDefinitionSchema.safeParse(validWorkflow);
|
|
1253
|
-
expect(result.success).toBe(true);
|
|
1254
|
-
expect(result.data?.version).toBe('1.0');
|
|
1255
|
-
});
|
|
1256
|
-
});
|
|
1257
|
-
});
|
|
1258
|
-
// ==================== Topological Sort Tests ====================
|
|
1259
|
-
describe('Topological Sort', () => {
|
|
1260
|
-
it('should sort nodes in dependency order', () => {
|
|
1261
|
-
const workflow = createDiamondWorkflow();
|
|
1262
|
-
const order = topologicalSort(workflow);
|
|
1263
|
-
// A should come before B1, B2, B3
|
|
1264
|
-
expect(order.indexOf('A')).toBeLessThan(order.indexOf('B1'));
|
|
1265
|
-
expect(order.indexOf('A')).toBeLessThan(order.indexOf('B2'));
|
|
1266
|
-
expect(order.indexOf('A')).toBeLessThan(order.indexOf('B3'));
|
|
1267
|
-
// B* should come before C
|
|
1268
|
-
expect(order.indexOf('B1')).toBeLessThan(order.indexOf('C'));
|
|
1269
|
-
expect(order.indexOf('B2')).toBeLessThan(order.indexOf('C'));
|
|
1270
|
-
expect(order.indexOf('B3')).toBeLessThan(order.indexOf('C'));
|
|
1271
|
-
// C should come before D
|
|
1272
|
-
expect(order.indexOf('C')).toBeLessThan(order.indexOf('D'));
|
|
1273
|
-
});
|
|
1274
|
-
it('should handle parallel branches', () => {
|
|
1275
|
-
const workflow = createParallelProcessingWorkflow();
|
|
1276
|
-
const order = topologicalSort(workflow);
|
|
1277
|
-
// Entry should be first
|
|
1278
|
-
expect(order[0]).toBe('entry');
|
|
1279
|
-
// All task-* should come after entry
|
|
1280
|
-
const taskNodes = order.filter(id => id.startsWith('task-'));
|
|
1281
|
-
expect(taskNodes.length).toBeGreaterThan(0);
|
|
1282
|
-
// Verify dependencies are maintained
|
|
1283
|
-
for (const node of workflow.nodes) {
|
|
1284
|
-
const nodeIndex = order.indexOf(node.id);
|
|
1285
|
-
for (const depId of node.depends_on || []) {
|
|
1286
|
-
expect(order.indexOf(depId)).toBeLessThan(nodeIndex);
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
});
|
|
1290
|
-
it('should throw on circular dependency', () => {
|
|
1291
|
-
const circularWorkflow = {
|
|
1292
|
-
name: 'circular',
|
|
1293
|
-
nodes: [
|
|
1294
|
-
{ id: 'a', type: 'tool', config: {}, depends_on: ['b'] },
|
|
1295
|
-
{ id: 'b', type: 'tool', config: {}, depends_on: ['a'] },
|
|
1296
|
-
],
|
|
1297
|
-
};
|
|
1298
|
-
expect(() => topologicalSort(circularWorkflow)).toThrow('Circular dependency detected');
|
|
1299
|
-
});
|
|
1300
|
-
});
|
|
1301
|
-
// ==================== Performance Tests ====================
|
|
1302
|
-
describe('Workflow Performance', () => {
|
|
1303
|
-
it('should handle large parallel execution', () => {
|
|
1304
|
-
const nodes = [
|
|
1305
|
-
{ id: 'start', type: 'tool', config: { tool: 'echo' } },
|
|
1306
|
-
];
|
|
1307
|
-
// Create 20 parallel nodes
|
|
1308
|
-
for (let i = 0; i < 20; i++) {
|
|
1309
|
-
nodes.push({
|
|
1310
|
-
id: `parallel-${i}`,
|
|
1311
|
-
type: 'tool',
|
|
1312
|
-
config: { tool: 'calculator' },
|
|
1313
|
-
depends_on: ['start'],
|
|
1314
|
-
});
|
|
1315
|
-
}
|
|
1316
|
-
// Merge all parallel results
|
|
1317
|
-
nodes.push({
|
|
1318
|
-
id: 'merge',
|
|
1319
|
-
type: 'merge',
|
|
1320
|
-
config: { strategy: 'collect' },
|
|
1321
|
-
depends_on: nodes.slice(1).map(n => n.id),
|
|
1322
|
-
});
|
|
1323
|
-
const workflow = {
|
|
1324
|
-
name: 'large-parallel',
|
|
1325
|
-
nodes,
|
|
1326
|
-
};
|
|
1327
|
-
const order = topologicalSort(workflow);
|
|
1328
|
-
expect(order.length).toBe(22); // 1 start + 20 parallel + 1 merge
|
|
1329
|
-
});
|
|
1330
|
-
it('should handle deep dependency chains', () => {
|
|
1331
|
-
const nodes = [];
|
|
1332
|
-
// Create 50-node deep chain
|
|
1333
|
-
for (let i = 0; i < 50; i++) {
|
|
1334
|
-
nodes.push({
|
|
1335
|
-
id: `node-${i}`,
|
|
1336
|
-
type: 'tool',
|
|
1337
|
-
config: { tool: 'echo' },
|
|
1338
|
-
depends_on: i > 0 ? [`node-${i - 1}`] : [],
|
|
1339
|
-
});
|
|
1340
|
-
}
|
|
1341
|
-
const workflow = {
|
|
1342
|
-
name: 'deep-chain',
|
|
1343
|
-
nodes,
|
|
1344
|
-
};
|
|
1345
|
-
const order = topologicalSort(workflow);
|
|
1346
|
-
// Should maintain order
|
|
1347
|
-
for (let i = 1; i < order.length; i++) {
|
|
1348
|
-
expect(order.indexOf(`node-${i - 1}`)).toBeLessThan(order.indexOf(`node-${i}`));
|
|
1349
|
-
}
|
|
1350
|
-
});
|
|
1351
|
-
it('should execute large workflow efficiently', () => {
|
|
1352
|
-
const nodes = [
|
|
1353
|
-
{ id: 'start', type: 'tool', config: { tool: 'echo' } },
|
|
1354
|
-
];
|
|
1355
|
-
for (let i = 0; i < 10; i++) {
|
|
1356
|
-
nodes.push({
|
|
1357
|
-
id: `node-${i}`,
|
|
1358
|
-
type: 'tool',
|
|
1359
|
-
config: { tool: 'calculator' },
|
|
1360
|
-
depends_on: i === 0 ? ['start'] : [`node-${i - 1}`],
|
|
1361
|
-
});
|
|
1362
|
-
}
|
|
1363
|
-
const workflow = {
|
|
1364
|
-
name: 'large-chain',
|
|
1365
|
-
nodes,
|
|
1366
|
-
};
|
|
1367
|
-
const executor = new SyncWorkflowExecutor();
|
|
1368
|
-
const start = Date.now();
|
|
1369
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1370
|
-
const duration = Date.now() - start;
|
|
1371
|
-
expect(results.size).toBe(11);
|
|
1372
|
-
expect(duration).toBeLessThan(100); // Should complete in under 100ms
|
|
1373
|
-
});
|
|
1374
|
-
});
|
|
1375
|
-
// ==================== Edge Cases ====================
|
|
1376
|
-
describe('Workflow Edge Cases', () => {
|
|
1377
|
-
it('should handle single node workflow', () => {
|
|
1378
|
-
const workflow = {
|
|
1379
|
-
name: 'single-node',
|
|
1380
|
-
nodes: [{ id: 'only', type: 'tool', config: {} }],
|
|
1381
|
-
};
|
|
1382
|
-
const order = topologicalSort(workflow);
|
|
1383
|
-
expect(order).toEqual(['only']);
|
|
1384
|
-
const executor = new SyncWorkflowExecutor();
|
|
1385
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1386
|
-
expect(results.size).toBe(1);
|
|
1387
|
-
expect(results.get('only')).toBeDefined();
|
|
1388
|
-
});
|
|
1389
|
-
it('should handle nodes with multiple dependencies', () => {
|
|
1390
|
-
const workflow = {
|
|
1391
|
-
name: 'multi-dep',
|
|
1392
|
-
nodes: [
|
|
1393
|
-
{ id: 'a', type: 'tool', config: {} },
|
|
1394
|
-
{ id: 'b', type: 'tool', config: {} },
|
|
1395
|
-
{ id: 'c', type: 'tool', config: {} },
|
|
1396
|
-
{ id: 'd', type: 'tool', config: {}, depends_on: ['a', 'b', 'c'] },
|
|
1397
|
-
],
|
|
1398
|
-
};
|
|
1399
|
-
const order = topologicalSort(workflow);
|
|
1400
|
-
const dIndex = order.indexOf('d');
|
|
1401
|
-
expect(order.indexOf('a')).toBeLessThan(dIndex);
|
|
1402
|
-
expect(order.indexOf('b')).toBeLessThan(dIndex);
|
|
1403
|
-
expect(order.indexOf('c')).toBeLessThan(dIndex);
|
|
1404
|
-
});
|
|
1405
|
-
it('should handle multiple entry points', () => {
|
|
1406
|
-
const workflow = {
|
|
1407
|
-
name: 'multi-entry',
|
|
1408
|
-
entry: ['a', 'b'],
|
|
1409
|
-
nodes: [
|
|
1410
|
-
{ id: 'a', type: 'tool', config: {} },
|
|
1411
|
-
{ id: 'b', type: 'tool', config: {} },
|
|
1412
|
-
{ id: 'c', type: 'tool', config: {}, depends_on: ['a', 'b'] },
|
|
1413
|
-
],
|
|
1414
|
-
};
|
|
1415
|
-
const order = topologicalSort(workflow);
|
|
1416
|
-
expect(order.includes('a')).toBe(true);
|
|
1417
|
-
expect(order.includes('b')).toBe(true);
|
|
1418
|
-
expect(order.indexOf('c')).toBeGreaterThan(order.indexOf('a'));
|
|
1419
|
-
expect(order.indexOf('c')).toBeGreaterThan(order.indexOf('b'));
|
|
1420
|
-
});
|
|
1421
|
-
it('should handle optional fields in nodes', () => {
|
|
1422
|
-
const minimalNode = {
|
|
1423
|
-
id: 'minimal',
|
|
1424
|
-
type: 'tool',
|
|
1425
|
-
};
|
|
1426
|
-
const NodeDefinitionSchema = z.object({
|
|
1427
|
-
id: z.string().min(1),
|
|
1428
|
-
type: z.string().min(1),
|
|
1429
|
-
name: z.string().optional(),
|
|
1430
|
-
config: z.record(z.string(), z.unknown()).optional(),
|
|
1431
|
-
depends_on: z.array(z.string()).optional(),
|
|
1432
|
-
});
|
|
1433
|
-
const result = NodeDefinitionSchema.safeParse(minimalNode);
|
|
1434
|
-
expect(result.success).toBe(true);
|
|
1435
|
-
});
|
|
1436
|
-
it('should handle empty depends_on array', () => {
|
|
1437
|
-
const workflow = {
|
|
1438
|
-
name: 'empty-deps',
|
|
1439
|
-
nodes: [
|
|
1440
|
-
{ id: 'a', type: 'tool', config: {}, depends_on: [] },
|
|
1441
|
-
{ id: 'b', type: 'tool', config: {}, depends_on: ['a'] },
|
|
1442
|
-
],
|
|
1443
|
-
};
|
|
1444
|
-
const order = topologicalSort(workflow);
|
|
1445
|
-
expect(order.indexOf('a')).toBeLessThan(order.indexOf('b'));
|
|
1446
|
-
});
|
|
1447
|
-
it('should handle nodes without config', () => {
|
|
1448
|
-
const workflow = {
|
|
1449
|
-
name: 'no-config',
|
|
1450
|
-
nodes: [
|
|
1451
|
-
{ id: 'a', type: 'tool' },
|
|
1452
|
-
{ id: 'b', type: 'tool', depends_on: ['a'] },
|
|
1453
|
-
],
|
|
1454
|
-
};
|
|
1455
|
-
const executor = new SyncWorkflowExecutor();
|
|
1456
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1457
|
-
expect(results.get('a')).toBeDefined();
|
|
1458
|
-
expect(results.get('b')).toBeDefined();
|
|
1459
|
-
});
|
|
1460
|
-
});
|
|
1461
|
-
// ==================== Execution Trace Tests ====================
|
|
1462
|
-
describe('Execution Trace', () => {
|
|
1463
|
-
it('should track execution order', () => {
|
|
1464
|
-
const workflow = createDiamondWorkflow();
|
|
1465
|
-
const executor = new SyncWorkflowExecutor();
|
|
1466
|
-
executeWorkflowSync(workflow, {}, executor);
|
|
1467
|
-
const trace = executor.getTrace();
|
|
1468
|
-
expect(trace.executionOrder).toEqual(['A', 'B1', 'B2', 'B3', 'C', 'D']);
|
|
1469
|
-
});
|
|
1470
|
-
it('should track node execution status', () => {
|
|
1471
|
-
const workflow = createDiamondWorkflow();
|
|
1472
|
-
const executor = new SyncWorkflowExecutor();
|
|
1473
|
-
executeWorkflowSync(workflow, {}, executor);
|
|
1474
|
-
const trace = executor.getTrace();
|
|
1475
|
-
for (const entry of trace.nodes.values()) {
|
|
1476
|
-
expect(entry.status).toBe('completed');
|
|
1477
|
-
expect(entry.startTime).toBeDefined();
|
|
1478
|
-
expect(entry.endTime).toBeDefined();
|
|
1479
|
-
expect(entry.endTime).toBeGreaterThanOrEqual(entry.startTime);
|
|
1480
|
-
}
|
|
1481
|
-
});
|
|
1482
|
-
it('should record input for each node', () => {
|
|
1483
|
-
const workflow = createDataProcessingWorkflow();
|
|
1484
|
-
const executor = new SyncWorkflowExecutor();
|
|
1485
|
-
const input = { generateReport: true, test: 'value' };
|
|
1486
|
-
executeWorkflowSync(workflow, input, executor);
|
|
1487
|
-
const trace = executor.getTrace();
|
|
1488
|
-
const initEntry = trace.nodes.get('init');
|
|
1489
|
-
expect(initEntry?.input).toEqual(input);
|
|
1490
|
-
});
|
|
1491
|
-
it('should record output for each node', () => {
|
|
1492
|
-
const workflow = createDiamondWorkflow();
|
|
1493
|
-
const executor = new SyncWorkflowExecutor();
|
|
1494
|
-
executeWorkflowSync(workflow, {}, executor);
|
|
1495
|
-
const trace = executor.getTrace();
|
|
1496
|
-
for (const [nodeId, entry] of trace.nodes) {
|
|
1497
|
-
expect(entry.output).toBeDefined();
|
|
1498
|
-
}
|
|
1499
|
-
});
|
|
1500
|
-
});
|
|
1501
|
-
// ==================== Merge Node Tests ====================
|
|
1502
|
-
describe('Merge Node Behavior', () => {
|
|
1503
|
-
it('should collect all dependency outputs', () => {
|
|
1504
|
-
const workflow = {
|
|
1505
|
-
name: 'merge-test',
|
|
1506
|
-
nodes: [
|
|
1507
|
-
{ id: 'a', type: 'tool', config: { tool: 'calculator' } },
|
|
1508
|
-
{ id: 'b', type: 'tool', config: { tool: 'calculator' } },
|
|
1509
|
-
{ id: 'c', type: 'tool', config: { tool: 'calculator' } },
|
|
1510
|
-
{
|
|
1511
|
-
id: 'merge',
|
|
1512
|
-
type: 'merge',
|
|
1513
|
-
config: { strategy: 'collect' },
|
|
1514
|
-
depends_on: ['a', 'b', 'c'],
|
|
1515
|
-
},
|
|
1516
|
-
],
|
|
1517
|
-
};
|
|
1518
|
-
const executor = new SyncWorkflowExecutor();
|
|
1519
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1520
|
-
const mergeResult = results.get('merge');
|
|
1521
|
-
expect(mergeResult).toBeDefined();
|
|
1522
|
-
expect(mergeResult.merged).toBe(true);
|
|
1523
|
-
expect(mergeResult.inputs).toBeDefined();
|
|
1524
|
-
expect(mergeResult.inputs.a).toBeDefined();
|
|
1525
|
-
expect(mergeResult.inputs.b).toBeDefined();
|
|
1526
|
-
expect(mergeResult.inputs.c).toBeDefined();
|
|
1527
|
-
});
|
|
1528
|
-
it('should handle merge with different strategies', () => {
|
|
1529
|
-
const mergeStrategies = ['collect', 'merge', 'concat', 'zip'];
|
|
1530
|
-
for (const strategy of mergeStrategies) {
|
|
1531
|
-
const workflow = {
|
|
1532
|
-
name: `merge-${strategy}`,
|
|
1533
|
-
nodes: [
|
|
1534
|
-
{ id: 'a', type: 'tool', config: { tool: 'calculator' } },
|
|
1535
|
-
{ id: 'b', type: 'tool', config: { tool: 'calculator' } },
|
|
1536
|
-
{
|
|
1537
|
-
id: 'merge',
|
|
1538
|
-
type: 'merge',
|
|
1539
|
-
config: { strategy },
|
|
1540
|
-
depends_on: ['a', 'b'],
|
|
1541
|
-
},
|
|
1542
|
-
],
|
|
1543
|
-
};
|
|
1544
|
-
const executor = new SyncWorkflowExecutor();
|
|
1545
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1546
|
-
const mergeResult = results.get('merge');
|
|
1547
|
-
expect(mergeResult).toBeDefined();
|
|
1548
|
-
expect(mergeResult.mergeStrategy).toBe(strategy);
|
|
1549
|
-
}
|
|
1550
|
-
});
|
|
1551
|
-
});
|
|
1552
|
-
// ==================== Condition Node Tests ====================
|
|
1553
|
-
describe('Condition Node Behavior', () => {
|
|
1554
|
-
it('should evaluate true condition', () => {
|
|
1555
|
-
const workflow = {
|
|
1556
|
-
name: 'condition-test',
|
|
1557
|
-
nodes: [
|
|
1558
|
-
{ id: 'check', type: 'condition', config: { condition: 'true' } },
|
|
1559
|
-
{ id: 'output', type: 'tool', config: { tool: 'echo' }, depends_on: ['check'] },
|
|
1560
|
-
],
|
|
1561
|
-
};
|
|
1562
|
-
const executor = new SyncWorkflowExecutor();
|
|
1563
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1564
|
-
const checkResult = results.get('check');
|
|
1565
|
-
expect(checkResult).toBeDefined();
|
|
1566
|
-
expect(checkResult.conditionMet).toBe(true);
|
|
1567
|
-
});
|
|
1568
|
-
it('should evaluate template condition', () => {
|
|
1569
|
-
const workflow = {
|
|
1570
|
-
name: 'condition-template',
|
|
1571
|
-
nodes: [
|
|
1572
|
-
{
|
|
1573
|
-
id: 'check',
|
|
1574
|
-
type: 'condition',
|
|
1575
|
-
config: { condition: '{{merge-data.valid}}' },
|
|
1576
|
-
},
|
|
1577
|
-
{ id: 'output', type: 'tool', config: { tool: 'echo' }, depends_on: ['check'] },
|
|
1578
|
-
],
|
|
1579
|
-
};
|
|
1580
|
-
const executor = new SyncWorkflowExecutor();
|
|
1581
|
-
const results = executeWorkflowSync(workflow, {}, executor);
|
|
1582
|
-
const checkResult = results.get('check');
|
|
1583
|
-
expect(checkResult).toBeDefined();
|
|
1584
|
-
expect(checkResult.conditionMet).toBe(true); // Template conditions default to true
|
|
1585
|
-
expect(checkResult.evaluatedCondition).toBe('{{merge-data.valid}}');
|
|
1586
|
-
});
|
|
1587
|
-
});
|
|
1588
|
-
//# sourceMappingURL=complex-workflow.integration.test.js.map
|