@ai-setting/roy-agent-cli 1.3.15 → 1.3.17
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/dist/bin/roy +0 -0
- package/dist/bin/roy.js +4 -3
- package/dist/cli/src/bin/roy.d.ts +6 -0
- package/dist/cli/src/bin/roy.js +10 -0
- package/dist/cli/src/cli.d.ts +5 -0
- package/dist/cli/src/cli.js +96 -0
- package/dist/cli/src/commands/act.d.ts +44 -0
- package/dist/cli/src/commands/act.js +415 -0
- package/dist/cli/src/commands/commands-add.d.ts +17 -0
- package/dist/cli/src/commands/commands-add.js +90 -0
- package/dist/cli/src/commands/commands-dirs.d.ts +12 -0
- package/dist/cli/src/commands/commands-dirs.js +58 -0
- package/dist/cli/src/commands/commands-info.d.ts +12 -0
- package/dist/cli/src/commands/commands-info.js +76 -0
- package/dist/cli/src/commands/commands-list.d.ts +13 -0
- package/dist/cli/src/commands/commands-list.js +132 -0
- package/dist/cli/src/commands/commands-remove.d.ts +14 -0
- package/dist/cli/src/commands/commands-remove.js +136 -0
- package/dist/cli/src/commands/commands.d.ts +27 -0
- package/dist/cli/src/commands/commands.js +39 -0
- package/dist/cli/src/commands/config/config-service.d.ts +70 -0
- package/dist/cli/src/commands/config/config-service.js +233 -0
- package/dist/cli/src/commands/config/deep-merge.d.ts +22 -0
- package/dist/cli/src/commands/config/deep-merge.js +33 -0
- package/dist/cli/src/commands/config/export.d.ts +15 -0
- package/dist/cli/src/commands/config/export.js +83 -0
- package/dist/cli/src/commands/config/import.d.ts +16 -0
- package/dist/cli/src/commands/config/import.js +102 -0
- package/dist/cli/src/commands/config/index.d.ts +13 -0
- package/dist/cli/src/commands/config/index.js +29 -0
- package/dist/cli/src/commands/config/list.d.ts +18 -0
- package/dist/cli/src/commands/config/list.js +233 -0
- package/dist/cli/src/commands/config/types.d.ts +21 -0
- package/dist/cli/src/commands/config/types.js +49 -0
- package/dist/cli/src/commands/debug/index.d.ts +19 -0
- package/dist/cli/src/commands/debug/index.js +34 -0
- package/dist/cli/src/commands/debug/log.d.ts +29 -0
- package/dist/cli/src/commands/debug/log.js +102 -0
- package/dist/cli/src/commands/debug/span.d.ts +24 -0
- package/dist/cli/src/commands/debug/span.js +187 -0
- package/dist/cli/src/commands/debug/trace.d.ts +27 -0
- package/dist/cli/src/commands/debug/trace.js +111 -0
- package/dist/cli/src/commands/eventsource/add.d.ts +19 -0
- package/dist/cli/src/commands/eventsource/add.js +108 -0
- package/dist/cli/src/commands/eventsource/index.d.ts +20 -0
- package/dist/cli/src/commands/eventsource/index.js +35 -0
- package/dist/cli/src/commands/eventsource/list.d.ts +13 -0
- package/dist/cli/src/commands/eventsource/list.js +159 -0
- package/dist/cli/src/commands/eventsource/remove.d.ts +13 -0
- package/dist/cli/src/commands/eventsource/remove.js +74 -0
- package/dist/cli/src/commands/eventsource/start.d.ts +13 -0
- package/dist/cli/src/commands/eventsource/start.js +81 -0
- package/dist/cli/src/commands/eventsource/status.d.ts +13 -0
- package/dist/cli/src/commands/eventsource/status.js +149 -0
- package/dist/cli/src/commands/eventsource/stop.d.ts +13 -0
- package/dist/cli/src/commands/eventsource/stop.js +69 -0
- package/dist/cli/src/commands/index.d.ts +15 -0
- package/dist/cli/src/commands/index.js +14 -0
- package/dist/cli/src/commands/input-handler.d.ts +27 -0
- package/dist/cli/src/commands/input-handler.js +38 -0
- package/dist/cli/src/commands/interactive.d.ts +141 -0
- package/dist/cli/src/commands/interactive.js +854 -0
- package/dist/cli/src/commands/lsp/check.d.ts +9 -0
- package/dist/cli/src/commands/lsp/check.js +79 -0
- package/dist/cli/src/commands/lsp/index.d.ts +12 -0
- package/dist/cli/src/commands/lsp/index.js +26 -0
- package/dist/cli/src/commands/lsp/install.d.ts +9 -0
- package/dist/cli/src/commands/lsp/install.js +114 -0
- package/dist/cli/src/commands/lsp/list.d.ts +9 -0
- package/dist/cli/src/commands/lsp/list.js +53 -0
- package/dist/cli/src/commands/mcp/index.d.ts +11 -0
- package/dist/cli/src/commands/mcp/index.js +23 -0
- package/dist/cli/src/commands/mcp/list.d.ts +14 -0
- package/dist/cli/src/commands/mcp/list.js +100 -0
- package/dist/cli/src/commands/mcp/reload.d.ts +12 -0
- package/dist/cli/src/commands/mcp/reload.js +54 -0
- package/dist/cli/src/commands/mcp/tools.d.ts +15 -0
- package/dist/cli/src/commands/mcp/tools.js +101 -0
- package/dist/cli/src/commands/memory/index.d.ts +11 -0
- package/dist/cli/src/commands/memory/index.js +11 -0
- package/dist/cli/src/commands/memory/memory.d.ts +10 -0
- package/dist/cli/src/commands/memory/memory.js +21 -0
- package/dist/cli/src/commands/memory/organize.d.ts +48 -0
- package/dist/cli/src/commands/memory/organize.js +233 -0
- package/dist/cli/src/commands/memory/recall.d.ts +10 -0
- package/dist/cli/src/commands/memory/recall.js +69 -0
- package/dist/cli/src/commands/memory/record.d.ts +11 -0
- package/dist/cli/src/commands/memory/record.js +268 -0
- package/dist/cli/src/commands/plugin.d.ts +112 -0
- package/dist/cli/src/commands/plugin.js +186 -0
- package/dist/cli/src/commands/sessions/active.d.ts +14 -0
- package/dist/cli/src/commands/sessions/active.js +79 -0
- package/dist/cli/src/commands/sessions/add-message.d.ts +8 -0
- package/dist/cli/src/commands/sessions/add-message.js +78 -0
- package/dist/cli/src/commands/sessions/checkpoints.d.ts +8 -0
- package/dist/cli/src/commands/sessions/checkpoints.js +133 -0
- package/dist/cli/src/commands/sessions/compact.d.ts +16 -0
- package/dist/cli/src/commands/sessions/compact.js +240 -0
- package/dist/cli/src/commands/sessions/delete.d.ts +14 -0
- package/dist/cli/src/commands/sessions/delete.js +214 -0
- package/dist/cli/src/commands/sessions/get.d.ts +8 -0
- package/dist/cli/src/commands/sessions/get.js +129 -0
- package/dist/cli/src/commands/sessions/grep.d.ts +15 -0
- package/dist/cli/src/commands/sessions/grep.js +210 -0
- package/dist/cli/src/commands/sessions/index.d.ts +42 -0
- package/dist/cli/src/commands/sessions/index.js +93 -0
- package/dist/cli/src/commands/sessions/list.d.ts +21 -0
- package/dist/cli/src/commands/sessions/list.js +163 -0
- package/dist/cli/src/commands/sessions/messages.d.ts +8 -0
- package/dist/cli/src/commands/sessions/messages.js +228 -0
- package/dist/cli/src/commands/sessions/mock.d.ts +10 -0
- package/dist/cli/src/commands/sessions/mock.js +172 -0
- package/dist/cli/src/commands/sessions/new.d.ts +16 -0
- package/dist/cli/src/commands/sessions/new.js +66 -0
- package/dist/cli/src/commands/sessions/rename.d.ts +8 -0
- package/dist/cli/src/commands/sessions/rename.js +82 -0
- package/dist/cli/src/commands/shared/event-handler.d.ts +91 -0
- package/dist/cli/src/commands/shared/event-handler.js +167 -0
- package/dist/cli/src/commands/shared/event-message-formatter.d.ts +150 -0
- package/dist/cli/src/commands/shared/event-message-formatter.js +198 -0
- package/dist/cli/src/commands/shared/index.d.ts +10 -0
- package/dist/cli/src/commands/shared/index.js +8 -0
- package/dist/cli/src/commands/shared/query-executor.d.ts +81 -0
- package/dist/cli/src/commands/shared/query-executor.js +254 -0
- package/dist/cli/src/commands/shared/session-manager.d.ts +49 -0
- package/dist/cli/src/commands/shared/session-manager.js +93 -0
- package/dist/cli/src/commands/skills/get.d.ts +14 -0
- package/dist/cli/src/commands/skills/get.js +76 -0
- package/dist/cli/src/commands/skills/index.d.ts +18 -0
- package/dist/cli/src/commands/skills/index.js +36 -0
- package/dist/cli/src/commands/skills/list.d.ts +8 -0
- package/dist/cli/src/commands/skills/list.js +112 -0
- package/dist/cli/src/commands/skills/reload.d.ts +12 -0
- package/dist/cli/src/commands/skills/reload.js +46 -0
- package/dist/cli/src/commands/skills/search.d.ts +15 -0
- package/dist/cli/src/commands/skills/search.js +110 -0
- package/dist/cli/src/commands/skills/show-config.d.ts +12 -0
- package/dist/cli/src/commands/skills/show-config.js +74 -0
- package/dist/cli/src/commands/tasks/complete.d.ts +15 -0
- package/dist/cli/src/commands/tasks/complete.js +72 -0
- package/dist/cli/src/commands/tasks/create.d.ts +19 -0
- package/dist/cli/src/commands/tasks/create.js +93 -0
- package/dist/cli/src/commands/tasks/delete.d.ts +14 -0
- package/dist/cli/src/commands/tasks/delete.js +71 -0
- package/dist/cli/src/commands/tasks/get.d.ts +15 -0
- package/dist/cli/src/commands/tasks/get.js +98 -0
- package/dist/cli/src/commands/tasks/index.d.ts +20 -0
- package/dist/cli/src/commands/tasks/index.js +50 -0
- package/dist/cli/src/commands/tasks/list.d.ts +18 -0
- package/dist/cli/src/commands/tasks/list.js +116 -0
- package/dist/cli/src/commands/tasks/operations.d.ts +8 -0
- package/dist/cli/src/commands/tasks/operations.js +95 -0
- package/dist/cli/src/commands/tasks/update.d.ts +20 -0
- package/dist/cli/src/commands/tasks/update.js +93 -0
- package/dist/cli/src/commands/tools/exec-tool.d.ts +14 -0
- package/dist/cli/src/commands/tools/exec-tool.js +103 -0
- package/dist/cli/src/commands/tools/get.d.ts +14 -0
- package/dist/cli/src/commands/tools/get.js +97 -0
- package/dist/cli/src/commands/tools/index.d.ts +16 -0
- package/dist/cli/src/commands/tools/index.js +30 -0
- package/dist/cli/src/commands/tools/list.d.ts +14 -0
- package/dist/cli/src/commands/tools/list.js +92 -0
- package/dist/cli/src/commands/tools/shared/index.d.ts +7 -0
- package/dist/cli/src/commands/tools/shared/index.js +7 -0
- package/dist/cli/src/commands/tools/shared/schema-helper.d.ts +53 -0
- package/dist/cli/src/commands/tools/shared/schema-helper.js +74 -0
- package/dist/cli/src/commands/workflow/commands/add.d.ts +22 -0
- package/dist/cli/src/commands/workflow/commands/add.js +271 -0
- package/dist/cli/src/commands/workflow/commands/get.d.ts +20 -0
- package/dist/cli/src/commands/workflow/commands/get.js +169 -0
- package/dist/cli/src/commands/workflow/commands/list.d.ts +21 -0
- package/dist/cli/src/commands/workflow/commands/list.js +117 -0
- package/dist/cli/src/commands/workflow/commands/nodes.d.ts +34 -0
- package/dist/cli/src/commands/workflow/commands/nodes.js +465 -0
- package/dist/cli/src/commands/workflow/commands/remove.d.ts +16 -0
- package/dist/cli/src/commands/workflow/commands/remove.js +77 -0
- package/dist/cli/src/commands/workflow/commands/run.d.ts +32 -0
- package/dist/cli/src/commands/workflow/commands/run.js +335 -0
- package/dist/cli/src/commands/workflow/commands/status.d.ts +17 -0
- package/dist/cli/src/commands/workflow/commands/status.js +125 -0
- package/dist/cli/src/commands/workflow/commands/stop.d.ts +15 -0
- package/dist/cli/src/commands/workflow/commands/stop.js +70 -0
- package/dist/cli/src/commands/workflow/commands/update.d.ts +19 -0
- package/dist/cli/src/commands/workflow/commands/update.js +105 -0
- package/dist/cli/src/commands/workflow/commands/validate.d.ts +14 -0
- package/dist/cli/src/commands/workflow/commands/validate.js +118 -0
- package/dist/cli/src/commands/workflow/index.d.ts +28 -0
- package/dist/cli/src/commands/workflow/index.js +44 -0
- package/dist/cli/src/commands/workflow/renderers.d.ts +60 -0
- package/dist/cli/src/commands/workflow/renderers.js +320 -0
- package/dist/cli/src/commands/workflow/validators/index.d.ts +8 -0
- package/dist/cli/src/commands/workflow/validators/index.js +8 -0
- package/dist/cli/src/commands/workflow/validators/node-validator-factory.d.ts +13 -0
- package/dist/cli/src/commands/workflow/validators/node-validator-factory.js +35 -0
- package/dist/cli/src/commands/workflow/validators/node-validator.d.ts +37 -0
- package/dist/cli/src/commands/workflow/validators/node-validator.js +89 -0
- package/dist/cli/src/commands/workflow/validators/nodes/agent-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/agent-node-validator.js +50 -0
- package/dist/cli/src/commands/workflow/validators/nodes/condition-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/condition-node-validator.js +28 -0
- package/dist/cli/src/commands/workflow/validators/nodes/decorator-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/decorator-node-validator.js +38 -0
- package/dist/cli/src/commands/workflow/validators/nodes/merge-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/merge-node-validator.js +41 -0
- package/dist/cli/src/commands/workflow/validators/nodes/skill-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/skill-node-validator.js +27 -0
- package/dist/cli/src/commands/workflow/validators/nodes/tool-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/tool-node-validator.js +45 -0
- package/dist/cli/src/commands/workflow/validators/nodes/workflow-node-validator.d.ts +11 -0
- package/dist/cli/src/commands/workflow/validators/nodes/workflow-node-validator.js +27 -0
- package/dist/cli/src/commands/workflow/validators/types.d.ts +74 -0
- package/dist/cli/src/commands/workflow/validators/types.js +18 -0
- package/dist/cli/src/commands/workflow/validators/workflow-validator.d.ts +37 -0
- package/dist/cli/src/commands/workflow/validators/workflow-validator.js +284 -0
- package/dist/cli/src/index.d.ts +16 -0
- package/dist/cli/src/index.js +18 -0
- package/dist/cli/src/plugin/apply.d.ts +51 -0
- package/dist/cli/src/plugin/apply.js +85 -0
- package/dist/cli/src/plugin/discover.d.ts +29 -0
- package/dist/cli/src/plugin/discover.js +187 -0
- package/dist/cli/src/plugin/index.d.ts +16 -0
- package/dist/cli/src/plugin/index.js +18 -0
- package/dist/cli/src/plugin/registry.d.ts +109 -0
- package/dist/cli/src/plugin/registry.js +226 -0
- package/dist/cli/src/plugin/types.d.ts +145 -0
- package/dist/cli/src/plugin/types.js +7 -0
- package/dist/cli/src/services/context-handler.service.d.ts +72 -0
- package/dist/cli/src/services/context-handler.service.js +312 -0
- package/dist/cli/src/services/environment.service.d.ts +129 -0
- package/dist/cli/src/services/environment.service.js +544 -0
- package/dist/cli/src/services/output.service.d.ts +68 -0
- package/dist/cli/src/services/output.service.js +104 -0
- package/dist/cli/src/services/quiet-mode.service.d.ts +58 -0
- package/dist/cli/src/services/quiet-mode.service.js +74 -0
- package/dist/cli/src/services/stream-output.service.d.ts +116 -0
- package/dist/cli/src/services/stream-output.service.js +242 -0
- package/dist/cli/src/util/which.d.ts +13 -0
- package/dist/cli/src/util/which.js +50 -0
- package/dist/coder-harness/src/index.d.ts +32 -0
- package/dist/coder-harness/src/index.js +36 -0
- package/dist/coder-harness/src/lsp/client.d.ts +104 -0
- package/dist/coder-harness/src/lsp/client.js +490 -0
- package/dist/coder-harness/src/lsp/client.test.d.ts +5 -0
- package/dist/coder-harness/src/lsp/client.test.js +154 -0
- package/dist/coder-harness/src/lsp/language-map.d.ts +42 -0
- package/dist/coder-harness/src/lsp/language-map.js +105 -0
- package/dist/coder-harness/src/lsp/language-map.test.d.ts +5 -0
- package/dist/coder-harness/src/lsp/language-map.test.js +95 -0
- package/dist/coder-harness/src/lsp/manager.d.ts +166 -0
- package/dist/coder-harness/src/lsp/manager.js +457 -0
- package/dist/coder-harness/src/lsp/manager.test.d.ts +11 -0
- package/dist/coder-harness/src/lsp/manager.test.js +121 -0
- package/dist/coder-harness/src/lsp/preload.integration.test.d.ts +5 -0
- package/dist/coder-harness/src/lsp/preload.integration.test.js +125 -0
- package/dist/coder-harness/src/lsp/server.d.ts +72 -0
- package/dist/coder-harness/src/lsp/server.js +271 -0
- package/dist/coder-harness/src/lsp/server.test.d.ts +5 -0
- package/dist/coder-harness/src/lsp/server.test.js +78 -0
- package/dist/coder-harness/src/lsp-deps/config.d.ts +84 -0
- package/dist/coder-harness/src/lsp-deps/config.js +123 -0
- package/dist/coder-harness/src/lsp-deps/index.d.ts +10 -0
- package/dist/coder-harness/src/lsp-deps/index.js +8 -0
- package/dist/coder-harness/src/lsp-deps/installer.d.ts +101 -0
- package/dist/coder-harness/src/lsp-deps/installer.js +207 -0
- package/dist/coder-harness/src/plugins/code-check-manager.d.ts +43 -0
- package/dist/coder-harness/src/plugins/code-check-manager.js +238 -0
- package/dist/coder-harness/src/plugins/code-check-manager.test.d.ts +2 -0
- package/dist/coder-harness/src/plugins/code-check-manager.test.js +45 -0
- package/dist/coder-harness/src/plugins/code-check-plugin.d.ts +79 -0
- package/dist/coder-harness/src/plugins/code-check-plugin.js +181 -0
- package/dist/coder-harness/src/plugins/code-check-plugin.test.d.ts +2 -0
- package/dist/coder-harness/src/plugins/code-check-plugin.test.js +94 -0
- package/dist/coder-harness/src/plugins/lsp-plugin.d.ts +131 -0
- package/dist/coder-harness/src/plugins/lsp-plugin.js +253 -0
- package/dist/coder-harness/src/plugins/lsp-plugin.test.d.ts +9 -0
- package/dist/coder-harness/src/plugins/lsp-plugin.test.js +304 -0
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.d.ts +192 -0
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.js +294 -0
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.test.d.ts +5 -0
- package/dist/coder-harness/src/plugins/plugin-hook-adapter.test.js +312 -0
- package/dist/coder-harness/src/plugins/reminder-plugin.d.ts +69 -0
- package/dist/coder-harness/src/plugins/reminder-plugin.js +92 -0
- package/dist/coder-harness/src/plugins/reminder-plugin.test.d.ts +5 -0
- package/dist/coder-harness/src/plugins/reminder-plugin.test.js +132 -0
- package/dist/coder-harness/src/types/linter.d.ts +263 -0
- package/dist/coder-harness/src/types/linter.js +18 -0
- package/dist/coder-harness/src/util/glob.d.ts +22 -0
- package/dist/coder-harness/src/util/glob.js +31 -0
- package/dist/coder-harness/src/util/glob.test.d.ts +5 -0
- package/dist/coder-harness/src/util/glob.test.js +63 -0
- package/dist/coder-harness/src/util/which.d.ts +13 -0
- package/dist/coder-harness/src/util/which.js +46 -0
- package/dist/core/src/config/config-component.d.ts +323 -0
- package/dist/core/src/config/config-component.js +686 -0
- package/dist/core/src/config/config-component.test.d.ts +2 -0
- package/dist/core/src/config/config-component.test.js +486 -0
- package/dist/core/src/config/config-parser.d.ts +46 -0
- package/dist/core/src/config/config-parser.js +173 -0
- package/dist/core/src/config/config-parser.test.d.ts +2 -0
- package/dist/core/src/config/config-parser.test.js +252 -0
- package/dist/core/src/config/decentralized-config.test.d.ts +2 -0
- package/dist/core/src/config/decentralized-config.test.js +602 -0
- package/dist/core/src/config/env-key.d.ts +93 -0
- package/dist/core/src/config/env-key.js +189 -0
- package/dist/core/src/config/env-source.d.ts +83 -0
- package/dist/core/src/config/env-source.js +240 -0
- package/dist/core/src/config/env-source.test.d.ts +2 -0
- package/dist/core/src/config/env-source.test.js +196 -0
- package/dist/core/src/config/file-source.d.ts +87 -0
- package/dist/core/src/config/file-source.js +349 -0
- package/dist/core/src/config/file-source.test.d.ts +2 -0
- package/dist/core/src/config/file-source.test.js +275 -0
- package/dist/core/src/config/index.d.ts +5 -0
- package/dist/core/src/config/index.js +5 -0
- package/dist/core/src/config/protocol-resolver.d.ts +95 -0
- package/dist/core/src/config/protocol-resolver.js +175 -0
- package/dist/core/src/config/protocol-resolver.test.d.ts +2 -0
- package/dist/core/src/config/protocol-resolver.test.js +167 -0
- package/dist/core/src/env/agent/agent-component.abort.test.d.ts +11 -0
- package/dist/core/src/env/agent/agent-component.abort.test.js +440 -0
- package/dist/core/src/env/agent/agent-component.d.ts +349 -0
- package/dist/core/src/env/agent/agent-component.js +1481 -0
- package/dist/core/src/env/agent/agent-component.record-session.test.d.ts +14 -0
- package/dist/core/src/env/agent/agent-component.record-session.test.js +280 -0
- package/dist/core/src/env/agent/agent-component.test.d.ts +7 -0
- package/dist/core/src/env/agent/agent-component.test.js +1169 -0
- package/dist/core/src/env/agent/agent-component.tool-error.test.d.ts +25 -0
- package/dist/core/src/env/agent/agent-component.tool-error.test.js +272 -0
- package/dist/core/src/env/agent/agent-config-registration.d.ts +19 -0
- package/dist/core/src/env/agent/agent-config-registration.js +41 -0
- package/dist/core/src/env/agent/agent-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/agent/agent-config-registration.test.js +193 -0
- package/dist/core/src/env/agent/agent-reminder-plugin.integration.test.d.ts +7 -0
- package/dist/core/src/env/agent/agent-reminder-plugin.integration.test.js +206 -0
- package/dist/core/src/env/agent/index.d.ts +10 -0
- package/dist/core/src/env/agent/index.js +9 -0
- package/dist/core/src/env/agent/summary-agent.d.ts +101 -0
- package/dist/core/src/env/agent/summary-agent.js +473 -0
- package/dist/core/src/env/agent/summary-agent.parse-hint.test.d.ts +12 -0
- package/dist/core/src/env/agent/summary-agent.parse-hint.test.js +267 -0
- package/dist/core/src/env/agent/types.d.ts +394 -0
- package/dist/core/src/env/agent/types.js +9 -0
- package/dist/core/src/env/commands/commands-component.d.ts +98 -0
- package/dist/core/src/env/commands/commands-component.js +517 -0
- package/dist/core/src/env/commands/commands-component.test.d.ts +2 -0
- package/dist/core/src/env/commands/commands-component.test.js +304 -0
- package/dist/core/src/env/commands/commands-config-registration.d.ts +20 -0
- package/dist/core/src/env/commands/commands-config-registration.js +33 -0
- package/dist/core/src/env/commands/commands-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/commands/commands-config-registration.test.js +164 -0
- package/dist/core/src/env/commands/index.d.ts +8 -0
- package/dist/core/src/env/commands/index.js +8 -0
- package/dist/core/src/env/commands/parser.d.ts +19 -0
- package/dist/core/src/env/commands/parser.js +97 -0
- package/dist/core/src/env/commands/parser.test.d.ts +2 -0
- package/dist/core/src/env/commands/parser.test.js +155 -0
- package/dist/core/src/env/commands/types.d.ts +134 -0
- package/dist/core/src/env/commands/types.js +7 -0
- package/dist/core/src/env/commands-prompt-integration.test.d.ts +2 -0
- package/dist/core/src/env/commands-prompt-integration.test.js +205 -0
- package/dist/core/src/env/component-env.test.d.ts +2 -0
- package/dist/core/src/env/component-env.test.js +101 -0
- package/dist/core/src/env/component.d.ts +187 -0
- package/dist/core/src/env/component.js +160 -0
- package/dist/core/src/env/constants.d.ts +99 -0
- package/dist/core/src/env/constants.js +107 -0
- package/dist/core/src/env/constants.test.d.ts +2 -0
- package/dist/core/src/env/constants.test.js +55 -0
- package/dist/core/src/env/debug/debug-component.d.ts +161 -0
- package/dist/core/src/env/debug/debug-component.js +441 -0
- package/dist/core/src/env/debug/debug-component.test.d.ts +2 -0
- package/dist/core/src/env/debug/debug-component.test.js +89 -0
- package/dist/core/src/env/debug/formatters/index.d.ts +9 -0
- package/dist/core/src/env/debug/formatters/index.js +9 -0
- package/dist/core/src/env/debug/formatters/repl-formatter.d.ts +81 -0
- package/dist/core/src/env/debug/formatters/repl-formatter.js +309 -0
- package/dist/core/src/env/debug/formatters/repl-formatter.test.d.ts +2 -0
- package/dist/core/src/env/debug/formatters/repl-formatter.test.js +119 -0
- package/dist/core/src/env/debug/formatters/trace-formatter.d.ts +44 -0
- package/dist/core/src/env/debug/formatters/trace-formatter.js +157 -0
- package/dist/core/src/env/debug/formatters/trace-formatter.test.d.ts +2 -0
- package/dist/core/src/env/debug/formatters/trace-formatter.test.js +102 -0
- package/dist/core/src/env/debug/formatters/tree-formatter.d.ts +73 -0
- package/dist/core/src/env/debug/formatters/tree-formatter.js +252 -0
- package/dist/core/src/env/debug/formatters/tree-formatter.test.d.ts +2 -0
- package/dist/core/src/env/debug/formatters/tree-formatter.test.js +91 -0
- package/dist/core/src/env/debug/index.d.ts +16 -0
- package/dist/core/src/env/debug/index.js +18 -0
- package/dist/core/src/env/debug/parser/regex-parser.d.ts +50 -0
- package/dist/core/src/env/debug/parser/regex-parser.js +167 -0
- package/dist/core/src/env/debug/parser/regex-parser.test.d.ts +2 -0
- package/dist/core/src/env/debug/parser/regex-parser.test.js +147 -0
- package/dist/core/src/env/debug/parser/span-builder.d.ts +80 -0
- package/dist/core/src/env/debug/parser/span-builder.js +321 -0
- package/dist/core/src/env/debug/parser/span-builder.test.d.ts +2 -0
- package/dist/core/src/env/debug/parser/span-builder.test.js +207 -0
- package/dist/core/src/env/debug/reader/log-reader.d.ts +56 -0
- package/dist/core/src/env/debug/reader/log-reader.js +163 -0
- package/dist/core/src/env/debug/reader/log-reader.test.d.ts +2 -0
- package/dist/core/src/env/debug/reader/log-reader.test.js +132 -0
- package/dist/core/src/env/debug/reader/span-db-reader.d.ts +71 -0
- package/dist/core/src/env/debug/reader/span-db-reader.js +167 -0
- package/dist/core/src/env/debug/reader/span-db-reader.test.d.ts +5 -0
- package/dist/core/src/env/debug/reader/span-db-reader.test.js +96 -0
- package/dist/core/src/env/debug/types.d.ts +146 -0
- package/dist/core/src/env/debug/types.js +7 -0
- package/dist/core/src/env/debug/types.test.d.ts +2 -0
- package/dist/core/src/env/debug/types.test.js +160 -0
- package/dist/core/src/env/environment-init.test.d.ts +2 -0
- package/dist/core/src/env/environment-init.test.js +142 -0
- package/dist/core/src/env/environment-lifecycle.test.d.ts +16 -0
- package/dist/core/src/env/environment-lifecycle.test.js +391 -0
- package/dist/core/src/env/environment-service.test.d.ts +7 -0
- package/dist/core/src/env/environment-service.test.js +265 -0
- package/dist/core/src/env/environment.d.ts +163 -0
- package/dist/core/src/env/environment.handle-query.test.d.ts +5 -0
- package/dist/core/src/env/environment.handle-query.test.js +74 -0
- package/dist/core/src/env/environment.js +607 -0
- package/dist/core/src/env/environment.test.d.ts +5 -0
- package/dist/core/src/env/environment.test.js +188 -0
- package/dist/core/src/env/errors.d.ts +96 -0
- package/dist/core/src/env/errors.js +123 -0
- package/dist/core/src/env/errors.test.d.ts +2 -0
- package/dist/core/src/env/errors.test.js +110 -0
- package/dist/core/src/env/event-source/event-source-agent-handler.d.ts +45 -0
- package/dist/core/src/env/event-source/event-source-agent-handler.js +80 -0
- package/dist/core/src/env/event-source/event-source-agent-handler.test.d.ts +2 -0
- package/dist/core/src/env/event-source/event-source-agent-handler.test.js +165 -0
- package/dist/core/src/env/event-source/event-source-component.d.ts +197 -0
- package/dist/core/src/env/event-source/event-source-component.js +1155 -0
- package/dist/core/src/env/event-source/event-source-component.process-cleanup.test.d.ts +9 -0
- package/dist/core/src/env/event-source/event-source-component.process-cleanup.test.js +207 -0
- package/dist/core/src/env/event-source/event-source-component.stop.test.d.ts +7 -0
- package/dist/core/src/env/event-source/event-source-component.stop.test.js +293 -0
- package/dist/core/src/env/event-source/event-source-component.test.d.ts +2 -0
- package/dist/core/src/env/event-source/event-source-component.test.js +1036 -0
- package/dist/core/src/env/event-source/event-source-config-registration.d.ts +19 -0
- package/dist/core/src/env/event-source/event-source-config-registration.js +32 -0
- package/dist/core/src/env/event-source/event-source-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/event-source/event-source-config-registration.test.js +208 -0
- package/dist/core/src/env/event-source/event-source-integration.test.d.ts +2 -0
- package/dist/core/src/env/event-source/event-source-integration.test.js +275 -0
- package/dist/core/src/env/event-source/event-source-platform.test.d.ts +12 -0
- package/dist/core/src/env/event-source/event-source-platform.test.js +536 -0
- package/dist/core/src/env/event-source/types.d.ts +213 -0
- package/dist/core/src/env/event-source/types.js +57 -0
- package/dist/core/src/env/hook/global-hook-manager.d.ts +74 -0
- package/dist/core/src/env/hook/global-hook-manager.js +126 -0
- package/dist/core/src/env/hook/hook-manager.d.ts +133 -0
- package/dist/core/src/env/hook/hook-manager.js +249 -0
- package/dist/core/src/env/hook/hook-manager.test.d.ts +2 -0
- package/dist/core/src/env/hook/hook-manager.test.js +275 -0
- package/dist/core/src/env/hook/index.d.ts +10 -0
- package/dist/core/src/env/hook/index.js +12 -0
- package/dist/core/src/env/hook/types.d.ts +104 -0
- package/dist/core/src/env/hook/types.js +33 -0
- package/dist/core/src/env/index.d.ts +23 -0
- package/dist/core/src/env/index.js +26 -0
- package/dist/core/src/env/interface.d.ts +156 -0
- package/dist/core/src/env/interface.js +19 -0
- package/dist/core/src/env/llm/hooks.d.ts +151 -0
- package/dist/core/src/env/llm/hooks.js +209 -0
- package/dist/core/src/env/llm/hooks.test.d.ts +2 -0
- package/dist/core/src/env/llm/hooks.test.js +233 -0
- package/dist/core/src/env/llm/index.d.ts +12 -0
- package/dist/core/src/env/llm/index.js +16 -0
- package/dist/core/src/env/llm/invoke-threshold-check.test.d.ts +11 -0
- package/dist/core/src/env/llm/invoke-threshold-check.test.js +76 -0
- package/dist/core/src/env/llm/invoke-timeout.test.d.ts +2 -0
- package/dist/core/src/env/llm/invoke-timeout.test.js +31 -0
- package/dist/core/src/env/llm/invoke.d.ts +118 -0
- package/dist/core/src/env/llm/invoke.js +755 -0
- package/dist/core/src/env/llm/invoke.test.d.ts +2 -0
- package/dist/core/src/env/llm/invoke.test.js +62 -0
- package/dist/core/src/env/llm/llm-config.test.d.ts +2 -0
- package/dist/core/src/env/llm/llm-config.test.js +453 -0
- package/dist/core/src/env/llm/llm.d.ts +164 -0
- package/dist/core/src/env/llm/llm.js +461 -0
- package/dist/core/src/env/llm/llm.test.d.ts +2 -0
- package/dist/core/src/env/llm/llm.test.js +197 -0
- package/dist/core/src/env/llm/provider.d.ts +41 -0
- package/dist/core/src/env/llm/provider.js +90 -0
- package/dist/core/src/env/llm/provider.test.d.ts +2 -0
- package/dist/core/src/env/llm/provider.test.js +152 -0
- package/dist/core/src/env/llm/transform.d.ts +58 -0
- package/dist/core/src/env/llm/transform.js +254 -0
- package/dist/core/src/env/llm/transform.test.d.ts +2 -0
- package/dist/core/src/env/llm/transform.test.js +215 -0
- package/dist/core/src/env/llm/types.d.ts +771 -0
- package/dist/core/src/env/llm/types.js +67 -0
- package/dist/core/src/env/llm/types.test.d.ts +2 -0
- package/dist/core/src/env/llm/types.test.js +520 -0
- package/dist/core/src/env/log-trace/decorator-otel.test.d.ts +7 -0
- package/dist/core/src/env/log-trace/decorator-otel.test.js +204 -0
- package/dist/core/src/env/log-trace/decorator.d.ts +47 -0
- package/dist/core/src/env/log-trace/decorator.js +190 -0
- package/dist/core/src/env/log-trace/index.d.ts +15 -0
- package/dist/core/src/env/log-trace/index.js +20 -0
- package/dist/core/src/env/log-trace/log-trace-component.d.ts +262 -0
- package/dist/core/src/env/log-trace/log-trace-component.js +405 -0
- package/dist/core/src/env/log-trace/log-trace-component.test.d.ts +7 -0
- package/dist/core/src/env/log-trace/log-trace-component.test.js +212 -0
- package/dist/core/src/env/log-trace/log-trace-config-registration.d.ts +20 -0
- package/dist/core/src/env/log-trace/log-trace-config-registration.js +40 -0
- package/dist/core/src/env/log-trace/log-trace-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/log-trace/log-trace-config-registration.test.js +295 -0
- package/dist/core/src/env/log-trace/logger.d.ts +84 -0
- package/dist/core/src/env/log-trace/logger.js +445 -0
- package/dist/core/src/env/log-trace/logger.test.d.ts +2 -0
- package/dist/core/src/env/log-trace/logger.test.js +118 -0
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.d.ts +106 -0
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.js +149 -0
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.test.d.ts +9 -0
- package/dist/core/src/env/log-trace/opentelemetry/cli-propagation.test.js +122 -0
- package/dist/core/src/env/log-trace/opentelemetry/integration.test.d.ts +19 -0
- package/dist/core/src/env/log-trace/opentelemetry/integration.test.js +535 -0
- package/dist/core/src/env/log-trace/opentelemetry/mod.d.ts +25 -0
- package/dist/core/src/env/log-trace/opentelemetry/mod.js +25 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.d.ts +82 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.js +109 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.test.d.ts +9 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation-env.test.js +143 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation.d.ts +80 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation.js +163 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation.test.d.ts +11 -0
- package/dist/core/src/env/log-trace/opentelemetry/propagation.test.js +197 -0
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider-context.test.d.ts +8 -0
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider-context.test.js +127 -0
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.d.ts +143 -0
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.js +451 -0
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.test.d.ts +11 -0
- package/dist/core/src/env/log-trace/opentelemetry/tracer-provider.test.js +291 -0
- package/dist/core/src/env/log-trace/span-storage.d.ts +38 -0
- package/dist/core/src/env/log-trace/span-storage.js +185 -0
- package/dist/core/src/env/log-trace/span-storage.test.d.ts +5 -0
- package/dist/core/src/env/log-trace/span-storage.test.js +121 -0
- package/dist/core/src/env/log-trace/trace-context.d.ts +29 -0
- package/dist/core/src/env/log-trace/trace-context.js +133 -0
- package/dist/core/src/env/log-trace/trace-context.test.d.ts +2 -0
- package/dist/core/src/env/log-trace/trace-context.test.js +149 -0
- package/dist/core/src/env/log-trace/types.d.ts +128 -0
- package/dist/core/src/env/log-trace/types.js +21 -0
- package/dist/core/src/env/log-trace/types.test.d.ts +2 -0
- package/dist/core/src/env/log-trace/types.test.js +53 -0
- package/dist/core/src/env/mcp/__integration__/mcp-component.integration.test.d.ts +2 -0
- package/dist/core/src/env/mcp/__integration__/mcp-component.integration.test.js +322 -0
- package/dist/core/src/env/mcp/config.d.ts +104 -0
- package/dist/core/src/env/mcp/config.js +65 -0
- package/dist/core/src/env/mcp/config.test.d.ts +2 -0
- package/dist/core/src/env/mcp/config.test.js +56 -0
- package/dist/core/src/env/mcp/index.d.ts +12 -0
- package/dist/core/src/env/mcp/index.js +14 -0
- package/dist/core/src/env/mcp/loader.d.ts +67 -0
- package/dist/core/src/env/mcp/loader.js +163 -0
- package/dist/core/src/env/mcp/loader.test.d.ts +2 -0
- package/dist/core/src/env/mcp/loader.test.js +128 -0
- package/dist/core/src/env/mcp/mcp-component.d.ts +55 -0
- package/dist/core/src/env/mcp/mcp-component.js +296 -0
- package/dist/core/src/env/mcp/mcp-component.test.d.ts +2 -0
- package/dist/core/src/env/mcp/mcp-component.test.js +92 -0
- package/dist/core/src/env/mcp/mcp-config-registration.d.ts +20 -0
- package/dist/core/src/env/mcp/mcp-config-registration.js +45 -0
- package/dist/core/src/env/mcp/mcp-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/mcp/mcp-config-registration.test.js +258 -0
- package/dist/core/src/env/mcp/scanner.d.ts +39 -0
- package/dist/core/src/env/mcp/scanner.js +206 -0
- package/dist/core/src/env/mcp/scanner.test.d.ts +2 -0
- package/dist/core/src/env/mcp/scanner.test.js +115 -0
- package/dist/core/src/env/mcp/tool/adapter.d.ts +33 -0
- package/dist/core/src/env/mcp/tool/adapter.js +413 -0
- package/dist/core/src/env/mcp/tool/adapter.test.d.ts +2 -0
- package/dist/core/src/env/mcp/tool/adapter.test.js +436 -0
- package/dist/core/src/env/mcp/tool/index.d.ts +5 -0
- package/dist/core/src/env/mcp/tool/index.js +5 -0
- package/dist/core/src/env/mcp/types.d.ts +122 -0
- package/dist/core/src/env/mcp/types.js +33 -0
- package/dist/core/src/env/mcp/types.test.d.ts +2 -0
- package/dist/core/src/env/mcp/types.test.js +136 -0
- package/dist/core/src/env/memory/built-in/index.d.ts +42 -0
- package/dist/core/src/env/memory/built-in/index.js +24 -0
- package/dist/core/src/env/memory/built-in/recall-memory.d.ts +30 -0
- package/dist/core/src/env/memory/built-in/recall-memory.js +79 -0
- package/dist/core/src/env/memory/built-in/record-memory.d.ts +45 -0
- package/dist/core/src/env/memory/built-in/record-memory.js +111 -0
- package/dist/core/src/env/memory/index.d.ts +11 -0
- package/dist/core/src/env/memory/index.js +16 -0
- package/dist/core/src/env/memory/memory-component.d.ts +115 -0
- package/dist/core/src/env/memory/memory-component.js +406 -0
- package/dist/core/src/env/memory/memory-component.test.d.ts +5 -0
- package/dist/core/src/env/memory/memory-component.test.js +183 -0
- package/dist/core/src/env/memory/memory-config-registration.d.ts +19 -0
- package/dist/core/src/env/memory/memory-config-registration.js +43 -0
- package/dist/core/src/env/memory/memory-config-registration.test.d.ts +5 -0
- package/dist/core/src/env/memory/memory-config-registration.test.js +48 -0
- package/dist/core/src/env/memory/memory-config.d.ts +19 -0
- package/dist/core/src/env/memory/memory-config.js +41 -0
- package/dist/core/src/env/memory/memory-file.test.d.ts +7 -0
- package/dist/core/src/env/memory/memory-file.test.js +222 -0
- package/dist/core/src/env/memory/plugin/index.d.ts +17 -0
- package/dist/core/src/env/memory/plugin/index.js +17 -0
- package/dist/core/src/env/memory/plugin/memory-agent.d.ts +127 -0
- package/dist/core/src/env/memory/plugin/memory-agent.js +250 -0
- package/dist/core/src/env/memory/plugin/memory-agent.test.d.ts +11 -0
- package/dist/core/src/env/memory/plugin/memory-agent.test.js +207 -0
- package/dist/core/src/env/memory/plugin/memory-manager.d.ts +72 -0
- package/dist/core/src/env/memory/plugin/memory-manager.js +166 -0
- package/dist/core/src/env/memory/plugin/memory-plugin-agent.test.d.ts +7 -0
- package/dist/core/src/env/memory/plugin/memory-plugin-agent.test.js +114 -0
- package/dist/core/src/env/memory/plugin/memory-plugin.d.ts +104 -0
- package/dist/core/src/env/memory/plugin/memory-plugin.js +155 -0
- package/dist/core/src/env/memory/plugin/plugin-simplified.test.d.ts +13 -0
- package/dist/core/src/env/memory/plugin/plugin-simplified.test.js +44 -0
- package/dist/core/src/env/memory/plugin/recall-memory.d.ts +17 -0
- package/dist/core/src/env/memory/plugin/recall-memory.js +44 -0
- package/dist/core/src/env/memory/plugin/recall-memory.test.d.ts +7 -0
- package/dist/core/src/env/memory/plugin/recall-memory.test.js +86 -0
- package/dist/core/src/env/memory/plugin/types.d.ts +76 -0
- package/dist/core/src/env/memory/plugin/types.js +16 -0
- package/dist/core/src/env/memory/tools/memory-agent-tools.d.ts +110 -0
- package/dist/core/src/env/memory/tools/memory-agent-tools.js +157 -0
- package/dist/core/src/env/memory/types.d.ts +81 -0
- package/dist/core/src/env/memory/types.js +25 -0
- package/dist/core/src/env/paths.d.ts +47 -0
- package/dist/core/src/env/paths.js +91 -0
- package/dist/core/src/env/prompt/index.d.ts +8 -0
- package/dist/core/src/env/prompt/index.js +7 -0
- package/dist/core/src/env/prompt/memory-prompts.test.d.ts +7 -0
- package/dist/core/src/env/prompt/memory-prompts.test.js +78 -0
- package/dist/core/src/env/prompt/prompt-component.d.ts +163 -0
- package/dist/core/src/env/prompt/prompt-component.js +489 -0
- package/dist/core/src/env/prompt/prompt-component.test.d.ts +7 -0
- package/dist/core/src/env/prompt/prompt-component.test.js +397 -0
- package/dist/core/src/env/prompt/prompt-config-registration.d.ts +19 -0
- package/dist/core/src/env/prompt/prompt-config-registration.js +34 -0
- package/dist/core/src/env/prompt/prompt-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/prompt/prompt-config-registration.test.js +172 -0
- package/dist/core/src/env/prompt/prompts-index.d.ts +27 -0
- package/dist/core/src/env/prompt/prompts-index.js +498 -0
- package/dist/core/src/env/prompt/renderer.d.ts +22 -0
- package/dist/core/src/env/prompt/renderer.js +47 -0
- package/dist/core/src/env/prompt/types.d.ts +159 -0
- package/dist/core/src/env/prompt/types.js +48 -0
- package/dist/core/src/env/session/hooks.d.ts +15 -0
- package/dist/core/src/env/session/hooks.js +5 -0
- package/dist/core/src/env/session/index.d.ts +19 -0
- package/dist/core/src/env/session/index.js +13 -0
- package/dist/core/src/env/session/search-query-parser.d.ts +42 -0
- package/dist/core/src/env/session/search-query-parser.js +141 -0
- package/dist/core/src/env/session/search-query-parser.test.d.ts +14 -0
- package/dist/core/src/env/session/search-query-parser.test.js +332 -0
- package/dist/core/src/env/session/session-checkpoint.test.d.ts +7 -0
- package/dist/core/src/env/session/session-checkpoint.test.js +455 -0
- package/dist/core/src/env/session/session-component.d.ts +290 -0
- package/dist/core/src/env/session/session-component.extract-recent-messages.test.d.ts +7 -0
- package/dist/core/src/env/session/session-component.extract-recent-messages.test.js +166 -0
- package/dist/core/src/env/session/session-component.js +981 -0
- package/dist/core/src/env/session/session-component.test.d.ts +7 -0
- package/dist/core/src/env/session/session-component.test.js +107 -0
- package/dist/core/src/env/session/session-config-registration.d.ts +19 -0
- package/dist/core/src/env/session/session-config-registration.js +47 -0
- package/dist/core/src/env/session/session-config-registration.test.d.ts +5 -0
- package/dist/core/src/env/session/session-config-registration.test.js +115 -0
- package/dist/core/src/env/session/session-message-converter.d.ts +125 -0
- package/dist/core/src/env/session/session-message-converter.js +354 -0
- package/dist/core/src/env/session/session-message-converter.test.d.ts +8 -0
- package/dist/core/src/env/session/session-message-converter.test.js +623 -0
- package/dist/core/src/env/session/session-message-e2e.test.d.ts +8 -0
- package/dist/core/src/env/session/session-message-e2e.test.js +376 -0
- package/dist/core/src/env/session/session-search.test.d.ts +7 -0
- package/dist/core/src/env/session/session-search.test.js +338 -0
- package/dist/core/src/env/session/session-store.d.ts +103 -0
- package/dist/core/src/env/session/session-store.js +5 -0
- package/dist/core/src/env/session/session-store.test.d.ts +2 -0
- package/dist/core/src/env/session/session-store.test.js +291 -0
- package/dist/core/src/env/session/storage/index.d.ts +6 -0
- package/dist/core/src/env/session/storage/index.js +6 -0
- package/dist/core/src/env/session/storage/memory.d.ts +44 -0
- package/dist/core/src/env/session/storage/memory.js +404 -0
- package/dist/core/src/env/session/storage/sqlite.d.ts +64 -0
- package/dist/core/src/env/session/storage/sqlite.js +616 -0
- package/dist/core/src/env/session/types.d.ts +613 -0
- package/dist/core/src/env/session/types.js +32 -0
- package/dist/core/src/env/skill/config.d.ts +14 -0
- package/dist/core/src/env/skill/config.js +36 -0
- package/dist/core/src/env/skill/index.d.ts +7 -0
- package/dist/core/src/env/skill/index.js +7 -0
- package/dist/core/src/env/skill/parser.d.ts +10 -0
- package/dist/core/src/env/skill/parser.js +64 -0
- package/dist/core/src/env/skill/parser.test.d.ts +2 -0
- package/dist/core/src/env/skill/parser.test.js +92 -0
- package/dist/core/src/env/skill/scanner.d.ts +26 -0
- package/dist/core/src/env/skill/scanner.js +98 -0
- package/dist/core/src/env/skill/scanner.test.d.ts +2 -0
- package/dist/core/src/env/skill/scanner.test.js +166 -0
- package/dist/core/src/env/skill/skill-component.d.ts +90 -0
- package/dist/core/src/env/skill/skill-component.js +266 -0
- package/dist/core/src/env/skill/skill-component.test.d.ts +2 -0
- package/dist/core/src/env/skill/skill-component.test.js +187 -0
- package/dist/core/src/env/skill/skill-config-registration.d.ts +19 -0
- package/dist/core/src/env/skill/skill-config-registration.js +38 -0
- package/dist/core/src/env/skill/skill-config-registration.test.d.ts +5 -0
- package/dist/core/src/env/skill/skill-config-registration.test.js +44 -0
- package/dist/core/src/env/skill/tool/index.d.ts +2 -0
- package/dist/core/src/env/skill/tool/index.js +2 -0
- package/dist/core/src/env/skill/tool/skill-tool.d.ts +16 -0
- package/dist/core/src/env/skill/tool/skill-tool.js +64 -0
- package/dist/core/src/env/skill/tool/skill-tool.test.d.ts +2 -0
- package/dist/core/src/env/skill/tool/skill-tool.test.js +77 -0
- package/dist/core/src/env/skill/types.d.ts +62 -0
- package/dist/core/src/env/skill/types.js +8 -0
- package/dist/core/src/env/task/delegate/delegate-tool.d.ts +141 -0
- package/dist/core/src/env/task/delegate/delegate-tool.js +767 -0
- package/dist/core/src/env/task/delegate/delegate-tool.test.d.ts +7 -0
- package/dist/core/src/env/task/delegate/delegate-tool.test.js +386 -0
- package/dist/core/src/env/task/delegate/index.d.ts +9 -0
- package/dist/core/src/env/task/delegate/index.js +8 -0
- package/dist/core/src/env/task/delegate/stop-tool.d.ts +13 -0
- package/dist/core/src/env/task/delegate/stop-tool.js +108 -0
- package/dist/core/src/env/task/delegate/stop-tool.test.d.ts +7 -0
- package/dist/core/src/env/task/delegate/stop-tool.test.js +103 -0
- package/dist/core/src/env/task/delegate/task-events.d.ts +81 -0
- package/dist/core/src/env/task/delegate/task-events.js +67 -0
- package/dist/core/src/env/task/delegate/task-events.test.d.ts +5 -0
- package/dist/core/src/env/task/delegate/task-events.test.js +149 -0
- package/dist/core/src/env/task/hooks/contexts.d.ts +165 -0
- package/dist/core/src/env/task/hooks/contexts.js +5 -0
- package/dist/core/src/env/task/hooks/contexts.test.d.ts +5 -0
- package/dist/core/src/env/task/hooks/contexts.test.js +73 -0
- package/dist/core/src/env/task/hooks/index.d.ts +8 -0
- package/dist/core/src/env/task/hooks/index.js +8 -0
- package/dist/core/src/env/task/hooks/task-hook-points.d.ts +32 -0
- package/dist/core/src/env/task/hooks/task-hook-points.js +37 -0
- package/dist/core/src/env/task/hooks/task-hook-points.test.d.ts +5 -0
- package/dist/core/src/env/task/hooks/task-hook-points.test.js +28 -0
- package/dist/core/src/env/task/index.d.ts +7 -0
- package/dist/core/src/env/task/index.js +7 -0
- package/dist/core/src/env/task/plugins/index.d.ts +7 -0
- package/dist/core/src/env/task/plugins/index.js +7 -0
- package/dist/core/src/env/task/plugins/task-plugin.d.ts +67 -0
- package/dist/core/src/env/task/plugins/task-plugin.js +40 -0
- package/dist/core/src/env/task/plugins/task-plugin.test.d.ts +5 -0
- package/dist/core/src/env/task/plugins/task-plugin.test.js +60 -0
- package/dist/core/src/env/task/plugins/task-tag-plugin.d.ts +79 -0
- package/dist/core/src/env/task/plugins/task-tag-plugin.js +250 -0
- package/dist/core/src/env/task/plugins/task-tag-plugin.test.d.ts +9 -0
- package/dist/core/src/env/task/plugins/task-tag-plugin.test.js +310 -0
- package/dist/core/src/env/task/plugins/task-workflow-extractor.integration.test.d.ts +5 -0
- package/dist/core/src/env/task/plugins/task-workflow-extractor.integration.test.js +198 -0
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.d.ts +36 -0
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.js +197 -0
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.test.d.ts +8 -0
- package/dist/core/src/env/task/plugins/workflow-extractor-agent.test.js +88 -0
- package/dist/core/src/env/task/storage/index.d.ts +6 -0
- package/dist/core/src/env/task/storage/index.js +6 -0
- package/dist/core/src/env/task/storage/sqlite-task-store.d.ts +127 -0
- package/dist/core/src/env/task/storage/sqlite-task-store.js +718 -0
- package/dist/core/src/env/task/storage/sqlite-task-store.test.d.ts +5 -0
- package/dist/core/src/env/task/storage/sqlite-task-store.test.js +235 -0
- package/dist/core/src/env/task/storage/task-search.test.d.ts +5 -0
- package/dist/core/src/env/task/storage/task-search.test.js +236 -0
- package/dist/core/src/env/task/tag-service.d.ts +139 -0
- package/dist/core/src/env/task/tag-service.js +123 -0
- package/dist/core/src/env/task/tag-service.test.d.ts +5 -0
- package/dist/core/src/env/task/tag-service.test.js +157 -0
- package/dist/core/src/env/task/task-component.d.ts +171 -0
- package/dist/core/src/env/task/task-component.js +519 -0
- package/dist/core/src/env/task/task-component.test.d.ts +5 -0
- package/dist/core/src/env/task/task-component.test.js +163 -0
- package/dist/core/src/env/task/task-config-registration.d.ts +20 -0
- package/dist/core/src/env/task/task-config-registration.js +32 -0
- package/dist/core/src/env/task/task-config-registration.test.d.ts +5 -0
- package/dist/core/src/env/task/task-config-registration.test.js +43 -0
- package/dist/core/src/env/task/task-types.test.d.ts +5 -0
- package/dist/core/src/env/task/task-types.test.js +117 -0
- package/dist/core/src/env/task/tools/complete-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/complete-tool.js +40 -0
- package/dist/core/src/env/task/tools/create-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/create-tool.js +45 -0
- package/dist/core/src/env/task/tools/delete-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/delete-tool.js +39 -0
- package/dist/core/src/env/task/tools/get-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/get-tool.js +57 -0
- package/dist/core/src/env/task/tools/index.d.ts +10 -0
- package/dist/core/src/env/task/tools/index.js +10 -0
- package/dist/core/src/env/task/tools/list-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/list-tool.js +36 -0
- package/dist/core/src/env/task/tools/operation/create-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/operation/create-tool.js +44 -0
- package/dist/core/src/env/task/tools/operation/delete-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/operation/delete-tool.js +39 -0
- package/dist/core/src/env/task/tools/operation/get-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/operation/get-tool.js +39 -0
- package/dist/core/src/env/task/tools/operation/index.d.ts +9 -0
- package/dist/core/src/env/task/tools/operation/index.js +9 -0
- package/dist/core/src/env/task/tools/operation/list-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/operation/list-tool.js +36 -0
- package/dist/core/src/env/task/tools/operation/operation-tools.test.d.ts +5 -0
- package/dist/core/src/env/task/tools/operation/operation-tools.test.js +159 -0
- package/dist/core/src/env/task/tools/operation/operation-types.d.ts +92 -0
- package/dist/core/src/env/task/tools/operation/operation-types.js +58 -0
- package/dist/core/src/env/task/tools/operation/update-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/operation/update-tool.js +42 -0
- package/dist/core/src/env/task/tools/task-tools.test.d.ts +5 -0
- package/dist/core/src/env/task/tools/task-tools.test.js +142 -0
- package/dist/core/src/env/task/tools/task-types.d.ts +114 -0
- package/dist/core/src/env/task/tools/task-types.js +53 -0
- package/dist/core/src/env/task/tools/task-types.test.d.ts +5 -0
- package/dist/core/src/env/task/tools/task-types.test.js +63 -0
- package/dist/core/src/env/task/tools/update-tool.d.ts +7 -0
- package/dist/core/src/env/task/tools/update-tool.js +64 -0
- package/dist/core/src/env/task/types.d.ts +129 -0
- package/dist/core/src/env/task/types.js +39 -0
- package/dist/core/src/env/tool/built-in/bash.d.ts +11 -0
- package/dist/core/src/env/tool/built-in/bash.js +182 -0
- package/dist/core/src/env/tool/built-in/echo.d.ts +8 -0
- package/dist/core/src/env/tool/built-in/echo.js +27 -0
- package/dist/core/src/env/tool/built-in/edit-file.d.ts +7 -0
- package/dist/core/src/env/tool/built-in/edit-file.js +86 -0
- package/dist/core/src/env/tool/built-in/edit-file.test.d.ts +2 -0
- package/dist/core/src/env/tool/built-in/edit-file.test.js +84 -0
- package/dist/core/src/env/tool/built-in/glob.d.ts +7 -0
- package/dist/core/src/env/tool/built-in/glob.js +60 -0
- package/dist/core/src/env/tool/built-in/glob.test.d.ts +2 -0
- package/dist/core/src/env/tool/built-in/glob.test.js +61 -0
- package/dist/core/src/env/tool/built-in/grep.d.ts +7 -0
- package/dist/core/src/env/tool/built-in/grep.js +96 -0
- package/dist/core/src/env/tool/built-in/grep.test.d.ts +2 -0
- package/dist/core/src/env/tool/built-in/grep.test.js +74 -0
- package/dist/core/src/env/tool/built-in/index.d.ts +28 -0
- package/dist/core/src/env/tool/built-in/index.js +41 -0
- package/dist/core/src/env/tool/built-in/read-file.d.ts +6 -0
- package/dist/core/src/env/tool/built-in/read-file.js +73 -0
- package/dist/core/src/env/tool/built-in/read-file.test.d.ts +2 -0
- package/dist/core/src/env/tool/built-in/read-file.test.js +63 -0
- package/dist/core/src/env/tool/built-in/write-file.d.ts +6 -0
- package/dist/core/src/env/tool/built-in/write-file.js +65 -0
- package/dist/core/src/env/tool/built-in/write-file.test.d.ts +2 -0
- package/dist/core/src/env/tool/built-in/write-file.test.js +74 -0
- package/dist/core/src/env/tool/index.d.ts +14 -0
- package/dist/core/src/env/tool/index.js +19 -0
- package/dist/core/src/env/tool/registry.d.ts +62 -0
- package/dist/core/src/env/tool/registry.js +137 -0
- package/dist/core/src/env/tool/registry.test.d.ts +2 -0
- package/dist/core/src/env/tool/registry.test.js +219 -0
- package/dist/core/src/env/tool/tool-component.d.ts +160 -0
- package/dist/core/src/env/tool/tool-component.js +411 -0
- package/dist/core/src/env/tool/tool-component.test.d.ts +2 -0
- package/dist/core/src/env/tool/tool-component.test.js +461 -0
- package/dist/core/src/env/tool/tool-config-registration.d.ts +19 -0
- package/dist/core/src/env/tool/tool-config-registration.js +41 -0
- package/dist/core/src/env/tool/tool-config-registration.test.d.ts +7 -0
- package/dist/core/src/env/tool/tool-config-registration.test.js +202 -0
- package/dist/core/src/env/tool/types.d.ts +226 -0
- package/dist/core/src/env/tool/types.js +2 -0
- package/dist/core/src/env/tool/validator.d.ts +15 -0
- package/dist/core/src/env/tool/validator.js +43 -0
- package/dist/core/src/env/tool/validator.test.d.ts +2 -0
- package/dist/core/src/env/tool/validator.test.js +102 -0
- package/dist/core/src/env/types.d.ts +154 -0
- package/dist/core/src/env/types.js +9 -0
- package/dist/core/src/env/workflow/ask-user-tool-registration.test.d.ts +13 -0
- package/dist/core/src/env/workflow/ask-user-tool-registration.test.js +185 -0
- package/dist/core/src/env/workflow/complex-workflow.integration.test.d.ts +14 -0
- package/dist/core/src/env/workflow/complex-workflow.integration.test.js +1588 -0
- package/dist/core/src/env/workflow/decorators/decorator-node.d.ts +77 -0
- package/dist/core/src/env/workflow/decorators/decorator-node.js +176 -0
- package/dist/core/src/env/workflow/decorators/decorator.test.d.ts +5 -0
- package/dist/core/src/env/workflow/decorators/decorator.test.js +212 -0
- package/dist/core/src/env/workflow/decorators/edge.d.ts +43 -0
- package/dist/core/src/env/workflow/decorators/edge.js +68 -0
- package/dist/core/src/env/workflow/decorators/index.d.ts +14 -0
- package/dist/core/src/env/workflow/decorators/index.js +15 -0
- package/dist/core/src/env/workflow/decorators/node-as.d.ts +41 -0
- package/dist/core/src/env/workflow/decorators/node-as.js +85 -0
- package/dist/core/src/env/workflow/decorators/workflow.d.ts +31 -0
- package/dist/core/src/env/workflow/decorators/workflow.js +49 -0
- package/dist/core/src/env/workflow/engine/dag-manager.d.ts +129 -0
- package/dist/core/src/env/workflow/engine/dag-manager.js +471 -0
- package/dist/core/src/env/workflow/engine/dag-manager.test.d.ts +2 -0
- package/dist/core/src/env/workflow/engine/dag-manager.test.js +488 -0
- package/dist/core/src/env/workflow/engine/engine.d.ts +218 -0
- package/dist/core/src/env/workflow/engine/engine.js +1122 -0
- package/dist/core/src/env/workflow/engine/event-bus.d.ts +55 -0
- package/dist/core/src/env/workflow/engine/event-bus.js +137 -0
- package/dist/core/src/env/workflow/engine/event-bus.test.d.ts +2 -0
- package/dist/core/src/env/workflow/engine/event-bus.test.js +274 -0
- package/dist/core/src/env/workflow/engine/executor-agent-session.test.d.ts +2 -0
- package/dist/core/src/env/workflow/engine/executor-agent-session.test.js +46 -0
- package/dist/core/src/env/workflow/engine/executor.d.ts +106 -0
- package/dist/core/src/env/workflow/engine/executor.js +458 -0
- package/dist/core/src/env/workflow/engine/executor.test.d.ts +11 -0
- package/dist/core/src/env/workflow/engine/executor.test.js +274 -0
- package/dist/core/src/env/workflow/engine/index.d.ts +16 -0
- package/dist/core/src/env/workflow/engine/index.js +10 -0
- package/dist/core/src/env/workflow/engine/node-registry.d.ts +160 -0
- package/dist/core/src/env/workflow/engine/node-registry.js +195 -0
- package/dist/core/src/env/workflow/engine/node-registry.test.d.ts +8 -0
- package/dist/core/src/env/workflow/engine/node-registry.test.js +439 -0
- package/dist/core/src/env/workflow/engine/resume-removed.test.d.ts +2 -0
- package/dist/core/src/env/workflow/engine/resume-removed.test.js +19 -0
- package/dist/core/src/env/workflow/engine/scheduler.d.ts +133 -0
- package/dist/core/src/env/workflow/engine/scheduler.js +253 -0
- package/dist/core/src/env/workflow/engine/scheduler.test.d.ts +2 -0
- package/dist/core/src/env/workflow/engine/scheduler.test.js +575 -0
- package/dist/core/src/env/workflow/engine/workflow-engine.test.d.ts +11 -0
- package/dist/core/src/env/workflow/engine/workflow-engine.test.js +640 -0
- package/dist/core/src/env/workflow/extractor/workflow-converter.d.ts +56 -0
- package/dist/core/src/env/workflow/extractor/workflow-converter.js +252 -0
- package/dist/core/src/env/workflow/fixtures.d.ts +402 -0
- package/dist/core/src/env/workflow/fixtures.js +369 -0
- package/dist/core/src/env/workflow/index.d.ts +31 -0
- package/dist/core/src/env/workflow/index.js +35 -0
- package/dist/core/src/env/workflow/integration/run-resume-unified.test.d.ts +2 -0
- package/dist/core/src/env/workflow/integration/run-resume-unified.test.js +161 -0
- package/dist/core/src/env/workflow/integration/service-integration.test.d.ts +8 -0
- package/dist/core/src/env/workflow/integration/service-integration.test.js +223 -0
- package/dist/core/src/env/workflow/metadata/keys.d.ts +7 -0
- package/dist/core/src/env/workflow/metadata/keys.js +10 -0
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.d.ts +163 -0
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.js +333 -0
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.test.d.ts +2 -0
- package/dist/core/src/env/workflow/nodes/agent-component-adapter.test.js +257 -0
- package/dist/core/src/env/workflow/nodes/agent-node.d.ts +217 -0
- package/dist/core/src/env/workflow/nodes/agent-node.js +419 -0
- package/dist/core/src/env/workflow/nodes/agent-node.test.d.ts +13 -0
- package/dist/core/src/env/workflow/nodes/agent-node.test.js +296 -0
- package/dist/core/src/env/workflow/nodes/ask-user-node.d.ts +69 -0
- package/dist/core/src/env/workflow/nodes/ask-user-node.js +67 -0
- package/dist/core/src/env/workflow/nodes/condition-node.d.ts +48 -0
- package/dist/core/src/env/workflow/nodes/condition-node.js +185 -0
- package/dist/core/src/env/workflow/nodes/index.d.ts +7 -0
- package/dist/core/src/env/workflow/nodes/index.js +5 -0
- package/dist/core/src/env/workflow/nodes/merge-node.d.ts +41 -0
- package/dist/core/src/env/workflow/nodes/merge-node.js +126 -0
- package/dist/core/src/env/workflow/nodes/skill-node.d.ts +118 -0
- package/dist/core/src/env/workflow/nodes/skill-node.js +322 -0
- package/dist/core/src/env/workflow/nodes/skill-node.test.d.ts +2 -0
- package/dist/core/src/env/workflow/nodes/skill-node.test.js +189 -0
- package/dist/core/src/env/workflow/nodes/tool-node.d.ts +121 -0
- package/dist/core/src/env/workflow/nodes/tool-node.js +415 -0
- package/dist/core/src/env/workflow/nodes/tool-node.test.d.ts +2 -0
- package/dist/core/src/env/workflow/nodes/tool-node.test.js +181 -0
- package/dist/core/src/env/workflow/nodes/workflow-llm-history.test.d.ts +7 -0
- package/dist/core/src/env/workflow/nodes/workflow-llm-history.test.js +377 -0
- package/dist/core/src/env/workflow/nodes/workflow-node.d.ts +119 -0
- package/dist/core/src/env/workflow/nodes/workflow-node.js +215 -0
- package/dist/core/src/env/workflow/nodes/workflow-node.test.d.ts +2 -0
- package/dist/core/src/env/workflow/nodes/workflow-node.test.js +255 -0
- package/dist/core/src/env/workflow/service/index.d.ts +10 -0
- package/dist/core/src/env/workflow/service/index.js +8 -0
- package/dist/core/src/env/workflow/service/registry.d.ts +38 -0
- package/dist/core/src/env/workflow/service/registry.js +58 -0
- package/dist/core/src/env/workflow/service/registry.test.d.ts +5 -0
- package/dist/core/src/env/workflow/service/registry.test.js +90 -0
- package/dist/core/src/env/workflow/service/workflow-service.d.ts +162 -0
- package/dist/core/src/env/workflow/service/workflow-service.js +244 -0
- package/dist/core/src/env/workflow/service/workflow-service.test.d.ts +5 -0
- package/dist/core/src/env/workflow/service/workflow-service.test.js +228 -0
- package/dist/core/src/env/workflow/storage/index.d.ts +11 -0
- package/dist/core/src/env/workflow/storage/index.js +13 -0
- package/dist/core/src/env/workflow/storage/mock-repositories.d.ts +89 -0
- package/dist/core/src/env/workflow/storage/mock-repositories.js +286 -0
- package/dist/core/src/env/workflow/storage/sqlite.d.ts +56 -0
- package/dist/core/src/env/workflow/storage/sqlite.js +135 -0
- package/dist/core/src/env/workflow/storage/sqlite.test.d.ts +2 -0
- package/dist/core/src/env/workflow/storage/sqlite.test.js +152 -0
- package/dist/core/src/env/workflow/storage/workflow-repo.d.ts +108 -0
- package/dist/core/src/env/workflow/storage/workflow-repo.js +252 -0
- package/dist/core/src/env/workflow/storage/workflow-repo.test.d.ts +2 -0
- package/dist/core/src/env/workflow/storage/workflow-repo.test.js +447 -0
- package/dist/core/src/env/workflow/tools/ask-user-tool.d.ts +36 -0
- package/dist/core/src/env/workflow/tools/ask-user-tool.js +50 -0
- package/dist/core/src/env/workflow/tools/index.d.ts +8 -0
- package/dist/core/src/env/workflow/tools/index.js +10 -0
- package/dist/core/src/env/workflow/tools/run-workflow.d.ts +61 -0
- package/dist/core/src/env/workflow/tools/run-workflow.js +180 -0
- package/dist/core/src/env/workflow/tools/run-workflow.test.d.ts +5 -0
- package/dist/core/src/env/workflow/tools/run-workflow.test.js +235 -0
- package/dist/core/src/env/workflow/types/context.d.ts +18 -0
- package/dist/core/src/env/workflow/types/context.js +2 -0
- package/dist/core/src/env/workflow/types/decorators-types.d.ts +178 -0
- package/dist/core/src/env/workflow/types/decorators-types.js +9 -0
- package/dist/core/src/env/workflow/types/event.d.ts +864 -0
- package/dist/core/src/env/workflow/types/event.js +154 -0
- package/dist/core/src/env/workflow/types/event.test.d.ts +2 -0
- package/dist/core/src/env/workflow/types/event.test.js +484 -0
- package/dist/core/src/env/workflow/types/index.d.ts +14 -0
- package/dist/core/src/env/workflow/types/index.js +10 -0
- package/dist/core/src/env/workflow/types/run.d.ts +123 -0
- package/dist/core/src/env/workflow/types/run.js +23 -0
- package/dist/core/src/env/workflow/types/run.test.d.ts +2 -0
- package/dist/core/src/env/workflow/types/run.test.js +381 -0
- package/dist/core/src/env/workflow/types/workflow-hil.d.ts +58 -0
- package/dist/core/src/env/workflow/types/workflow-hil.js +76 -0
- package/dist/core/src/env/workflow/types/workflow-message.d.ts +139 -0
- package/dist/core/src/env/workflow/types/workflow-message.js +15 -0
- package/dist/core/src/env/workflow/types/workflow-message.test.d.ts +2 -0
- package/dist/core/src/env/workflow/types/workflow-message.test.js +87 -0
- package/dist/core/src/env/workflow/types/workflow-session.d.ts +18 -0
- package/dist/core/src/env/workflow/types/workflow-session.js +41 -0
- package/dist/core/src/env/workflow/types/workflow-session.test.d.ts +2 -0
- package/dist/core/src/env/workflow/types/workflow-session.test.js +80 -0
- package/dist/core/src/env/workflow/types/workflow.d.ts +387 -0
- package/dist/core/src/env/workflow/types/workflow.js +124 -0
- package/dist/core/src/env/workflow/types/workflow.test.d.ts +2 -0
- package/dist/core/src/env/workflow/types/workflow.test.js +455 -0
- package/dist/core/src/env/workflow/types_compat.d.ts +11 -0
- package/dist/core/src/env/workflow/types_compat.js +8 -0
- package/dist/core/src/env/workflow/utils/create-workflow.d.ts +36 -0
- package/dist/core/src/env/workflow/utils/create-workflow.js +36 -0
- package/dist/core/src/env/workflow/utils/execution-state.d.ts +47 -0
- package/dist/core/src/env/workflow/utils/execution-state.js +228 -0
- package/dist/core/src/env/workflow/utils/index.d.ts +9 -0
- package/dist/core/src/env/workflow/utils/index.js +9 -0
- package/dist/core/src/env/workflow/utils/node-registry-helper.d.ts +37 -0
- package/dist/core/src/env/workflow/utils/node-registry-helper.js +48 -0
- package/dist/core/src/env/workflow/utils/recovery-validator.d.ts +31 -0
- package/dist/core/src/env/workflow/utils/recovery-validator.js +325 -0
- package/dist/core/src/env/workflow/utils/recovery-validator.test.d.ts +2 -0
- package/dist/core/src/env/workflow/utils/recovery-validator.test.js +401 -0
- package/dist/core/src/env/workflow/utils/session-parser.d.ts +22 -0
- package/dist/core/src/env/workflow/utils/session-parser.js +72 -0
- package/dist/core/src/env/workflow/utils/session-parser.test.d.ts +2 -0
- package/dist/core/src/env/workflow/utils/session-parser.test.js +89 -0
- package/dist/core/src/env/workflow/utils/session-recovery.d.ts +62 -0
- package/dist/core/src/env/workflow/utils/session-recovery.js +138 -0
- package/dist/core/src/env/workflow/utils/session-recovery.test.d.ts +2 -0
- package/dist/core/src/env/workflow/utils/session-recovery.test.js +263 -0
- package/dist/core/src/env/workflow/utils/template-resolver.d.ts +161 -0
- package/dist/core/src/env/workflow/utils/template-resolver.js +359 -0
- package/dist/core/src/env/workflow/utils/template-resolver.test.d.ts +2 -0
- package/dist/core/src/env/workflow/utils/template-resolver.test.js +216 -0
- package/dist/core/src/env/workflow/utils/validation-rules.d.ts +104 -0
- package/dist/core/src/env/workflow/utils/validation-rules.js +44 -0
- package/dist/core/src/env/workflow/workflow-component.d.ts +135 -0
- package/dist/core/src/env/workflow/workflow-component.js +376 -0
- package/dist/core/src/index.d.ts +54 -0
- package/dist/core/src/index.js +66 -0
- package/dist/core/src/utils/id.d.ts +12 -0
- package/dist/core/src/utils/id.js +20 -0
- package/dist/roy-agent-darwin-arm64/bin/roy.js +4 -3
- package/dist/roy-agent-darwin-x64/bin/roy.js +4 -3
- package/dist/roy-agent-linux-arm64/bin/roy.js +4 -3
- package/dist/roy-agent-linux-x64/bin/roy.js +4 -3
- package/dist/roy-agent-windows-x64/bin/roy.js +4 -3
- package/package.json +3 -2
|
@@ -0,0 +1,1588 @@
|
|
|
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
|