@ai-setting/roy-agent-core 1.7.52 → 1.7.53
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/config/config-component.d.ts +346 -0
- package/dist/config/config-parser.d.ts +45 -0
- package/dist/config/env-key.d.ts +97 -0
- package/dist/config/env-source.d.ts +113 -0
- package/dist/config/file-source.d.ts +90 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/protocol-resolver.d.ts +94 -0
- package/dist/env/agent/agent-component.d.ts +646 -0
- package/dist/env/agent/agent-config-registration.d.ts +18 -0
- package/dist/env/agent/agent-registry.d.ts +500 -0
- package/dist/env/agent/index.d.ts +9 -0
- package/dist/env/agent/summary-agent.d.ts +44 -0
- package/dist/env/agent/types.d.ts +503 -0
- package/dist/env/commands/commands-component.d.ts +97 -0
- package/dist/env/commands/commands-config-registration.d.ts +19 -0
- package/dist/env/commands/index.d.ts +7 -0
- package/dist/env/commands/parser.d.ts +18 -0
- package/dist/env/commands/types.d.ts +133 -0
- package/dist/env/component.d.ts +186 -0
- package/dist/env/constants.d.ts +112 -0
- package/dist/env/context/env-context.d.ts +420 -0
- package/dist/env/context/env-event.d.ts +144 -0
- package/dist/env/context/index.d.ts +13 -0
- package/dist/env/debug/debug-component.d.ts +160 -0
- package/dist/env/debug/formatters/index.d.ts +8 -0
- package/dist/env/debug/formatters/repl-formatter.d.ts +80 -0
- package/dist/env/debug/formatters/trace-formatter.d.ts +43 -0
- package/dist/env/debug/formatters/tree-formatter.d.ts +72 -0
- package/dist/env/debug/index.d.ts +15 -0
- package/dist/env/debug/index.js +1 -1
- package/dist/env/debug/parser/regex-parser.d.ts +49 -0
- package/dist/env/debug/parser/span-builder.d.ts +79 -0
- package/dist/env/debug/reader/log-reader.d.ts +55 -0
- package/dist/env/debug/reader/span-db-reader.d.ts +70 -0
- package/dist/env/debug/types.d.ts +145 -0
- package/dist/env/environment.d.ts +185 -0
- package/dist/env/errors.d.ts +120 -0
- package/dist/env/event-source/bounty-cli-handler.d.ts +42 -0
- package/dist/env/event-source/bounty-im-handler.d.ts +232 -0
- package/dist/env/event-source/event-source-component.d.ts +177 -0
- package/dist/env/event-source/event-source-config-registration.d.ts +18 -0
- package/dist/env/event-source/event-source-handlers.d.ts +486 -0
- package/dist/env/event-source/event-store.d.ts +110 -0
- package/dist/env/event-source/idempotency-key.d.ts +19 -0
- package/dist/env/event-source/index.d.ts +15 -0
- package/dist/env/event-source/index.js +2 -2
- package/dist/env/event-source/timer-handler.d.ts +74 -0
- package/dist/env/event-source/types.d.ts +803 -0
- package/dist/env/hook/global-hook-manager.d.ts +73 -0
- package/dist/env/hook/hook-manager.d.ts +139 -0
- package/dist/env/hook/index.d.ts +9 -0
- package/dist/env/hook/types.d.ts +107 -0
- package/dist/env/index.d.ts +24 -0
- package/dist/env/index.js +4 -4
- package/dist/env/interface.d.ts +156 -0
- package/dist/env/lark-mention-utils.d.ts +59 -0
- package/dist/env/llm/adapter-ai-sdk.d.ts +10 -0
- package/dist/env/llm/adapter-pi-ai.d.ts +39 -0
- package/dist/env/llm/adapter.d.ts +80 -0
- package/dist/env/llm/factory.d.ts +13 -0
- package/dist/env/llm/hooks.d.ts +150 -0
- package/dist/env/llm/index.d.ts +16 -0
- package/dist/env/llm/invoke.d.ts +264 -0
- package/dist/env/llm/llm-cache.d.ts +38 -0
- package/dist/env/llm/llm.d.ts +238 -0
- package/dist/env/llm/opencode-session.d.ts +79 -0
- package/dist/env/llm/provider.d.ts +40 -0
- package/dist/env/llm/tool-args-parser.d.ts +77 -0
- package/dist/env/llm/tool-schema.d.ts +54 -0
- package/dist/env/llm/transform.d.ts +57 -0
- package/dist/env/llm/types.d.ts +818 -0
- package/dist/env/log-trace/decorator.d.ts +88 -0
- package/dist/env/log-trace/index.d.ts +14 -0
- package/dist/env/log-trace/log-trace-component.d.ts +268 -0
- package/dist/env/log-trace/log-trace-config-registration.d.ts +25 -0
- package/dist/env/log-trace/logger.d.ts +83 -0
- package/dist/env/log-trace/opentelemetry/cli-propagation.d.ts +105 -0
- package/dist/env/log-trace/opentelemetry/mod.d.ts +24 -0
- package/dist/env/log-trace/opentelemetry/propagation-env.d.ts +81 -0
- package/dist/env/log-trace/opentelemetry/propagation.d.ts +79 -0
- package/dist/env/log-trace/opentelemetry/tracer-provider.d.ts +157 -0
- package/dist/env/log-trace/span-storage.d.ts +37 -0
- package/dist/env/log-trace/trace-context.d.ts +28 -0
- package/dist/env/log-trace/types.d.ts +127 -0
- package/dist/env/mcp/command-resolver.d.ts +12 -0
- package/dist/env/mcp/config.d.ts +103 -0
- package/dist/env/mcp/index.d.ts +13 -0
- package/dist/env/mcp/loader.d.ts +78 -0
- package/dist/env/mcp/mcp-component.d.ts +54 -0
- package/dist/env/mcp/mcp-config-registration.d.ts +19 -0
- package/dist/env/mcp/npm-prefix/index.d.ts +17 -0
- package/dist/env/mcp/scanner.d.ts +38 -0
- package/dist/env/mcp/tool/adapter.d.ts +32 -0
- package/dist/env/mcp/tool/index.d.ts +4 -0
- package/dist/env/mcp/types.d.ts +131 -0
- package/dist/env/memory/built-in/index.d.ts +41 -0
- package/dist/env/memory/built-in/recall-memory.d.ts +29 -0
- package/dist/env/memory/built-in/record-memory.d.ts +44 -0
- package/dist/env/memory/index.d.ts +10 -0
- package/dist/env/memory/memory-component.d.ts +114 -0
- package/dist/env/memory/memory-config-registration.d.ts +18 -0
- package/dist/env/memory/memory-config.d.ts +18 -0
- package/dist/env/memory/plugin/index.d.ts +16 -0
- package/dist/env/memory/plugin/memory-agent.d.ts +126 -0
- package/dist/env/memory/plugin/memory-manager.d.ts +71 -0
- package/dist/env/memory/plugin/memory-plugin.d.ts +103 -0
- package/dist/env/memory/plugin/recall-memory.d.ts +16 -0
- package/dist/env/memory/plugin/types.d.ts +75 -0
- package/dist/env/memory/tools/memory-agent-tools.d.ts +109 -0
- package/dist/env/memory/types.d.ts +80 -0
- package/dist/env/paths.d.ts +46 -0
- package/dist/env/plugin/bounty-cli-notification-channel.d.ts +60 -0
- package/dist/env/plugin/event-bus-notification-channel.d.ts +50 -0
- package/dist/env/plugin/index.d.ts +13 -0
- package/dist/env/plugin/lark-cli-notification-channel.d.ts +61 -0
- package/dist/env/plugin/notification-channel.d.ts +143 -0
- package/dist/env/plugin/plugin-component.d.ts +232 -0
- package/dist/env/plugin/types.d.ts +146 -0
- package/dist/env/prompt/index.d.ts +7 -0
- package/dist/env/prompt/prompt-component.d.ts +194 -0
- package/dist/env/prompt/prompt-config-registration.d.ts +18 -0
- package/dist/env/prompt/prompt-store.d.ts +26 -0
- package/dist/env/prompt/prompts-index.d.ts +146 -0
- package/dist/env/prompt/renderer.d.ts +21 -0
- package/dist/env/prompt/types.d.ts +176 -0
- package/dist/env/session/hooks.d.ts +14 -0
- package/dist/env/session/index.d.ts +19 -0
- package/dist/env/session/search-query-parser.d.ts +41 -0
- package/dist/env/session/session-component.d.ts +464 -0
- package/dist/env/session/session-config-registration.d.ts +18 -0
- package/dist/env/session/session-id.d.ts +26 -0
- package/dist/env/session/session-message-converter.d.ts +142 -0
- package/dist/env/session/session-store.d.ts +188 -0
- package/dist/env/session/storage/index.d.ts +5 -0
- package/dist/env/session/storage/memory.d.ts +119 -0
- package/dist/env/session/storage/sqlite.d.ts +108 -0
- package/dist/env/session/types.d.ts +705 -0
- package/dist/env/session-tree-stopper.d.ts +79 -0
- package/dist/env/skill/config.d.ts +13 -0
- package/dist/env/skill/index.d.ts +6 -0
- package/dist/env/skill/parser.d.ts +9 -0
- package/dist/env/skill/scanner.d.ts +25 -0
- package/dist/env/skill/skill-component.d.ts +89 -0
- package/dist/env/skill/skill-config-registration.d.ts +18 -0
- package/dist/env/skill/tool/index.d.ts +1 -0
- package/dist/env/skill/tool/skill-tool.d.ts +15 -0
- package/dist/env/skill/types.d.ts +61 -0
- package/dist/env/task/backend/index.d.ts +24 -0
- package/dist/env/task/backend/index.js +704 -0
- package/dist/env/task/backend/roy-sidecar-task-port.d.ts +148 -0
- package/dist/env/task/backend/sqlite-task-port.d.ts +28 -0
- package/dist/env/task/backend/task-store-backend.d.ts +107 -0
- package/dist/env/task/backend/types.d.ts +293 -0
- package/dist/env/task/delegate/bg-task-id-storage.d.ts +9 -0
- package/dist/env/task/delegate/delegate-tool.d.ts +681 -0
- package/dist/env/task/delegate/index.d.ts +8 -0
- package/dist/env/task/delegate/process-registry.d.ts +58 -0
- package/dist/env/task/delegate/stop-tool.d.ts +12 -0
- package/dist/env/task/delegate/subagent-resolver.d.ts +25 -0
- package/dist/env/task/events/index.d.ts +7 -0
- package/dist/env/task/events/task-event-payloads.d.ts +101 -0
- package/dist/env/task/events/task-event-types.d.ts +23 -0
- package/dist/env/task/hooks/contexts.d.ts +191 -0
- package/dist/env/task/hooks/index.d.ts +7 -0
- package/dist/env/task/hooks/task-hook-points.d.ts +42 -0
- package/dist/env/task/index.d.ts +7 -0
- package/dist/env/task/plugins/auto-task-plugin.d.ts +38 -0
- package/dist/env/task/plugins/card-chat-routing.d.ts +135 -0
- package/dist/env/task/plugins/fake-user-message-helper.d.ts +90 -0
- package/dist/env/task/plugins/index.d.ts +8 -0
- package/dist/env/task/plugins/index.js +1 -1
- package/dist/env/task/plugins/lark-card-action-handler.d.ts +166 -0
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +651 -0
- package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +248 -0
- package/dist/env/task/plugins/max-iteration-reminder-plugin.d.ts +112 -0
- package/dist/env/task/plugins/per-task-group-chat-plugin.d.ts +561 -0
- package/dist/env/task/plugins/task-tag-plugin.d.ts +70 -0
- package/dist/env/task/plugins/workflow-extractor-agent.d.ts +43 -0
- package/dist/env/task/registry-hook-installer.d.ts +43 -0
- package/dist/env/task/storage/index.d.ts +5 -0
- package/dist/env/task/storage/migrations/001_add_project_path_context.d.ts +14 -0
- package/dist/env/task/storage/migrations/002_add_task_type.d.ts +14 -0
- package/dist/env/task/storage/migrations/003_add_process_description.d.ts +20 -0
- package/dist/env/task/storage/migrations/004_rename_action_to_milestone.d.ts +37 -0
- package/dist/env/task/storage/migrations/005_convert_blob_description_to_text.d.ts +51 -0
- package/dist/env/task/storage/sqlite-task-store.d.ts +241 -0
- package/dist/env/task/tag-service.d.ts +138 -0
- package/dist/env/task/task-child-context.d.ts +70 -0
- package/dist/env/task/task-component.d.ts +270 -0
- package/dist/env/task/task-config-registration.d.ts +19 -0
- package/dist/env/task/task-creation-registry.d.ts +181 -0
- package/dist/env/task/task-reuse-context.d.ts +52 -0
- package/dist/env/task/task-reuse-registry.d.ts +31 -0
- package/dist/env/task/tools/batch-archive-tool.d.ts +9 -0
- package/dist/env/task/tools/batch-delete-tool.d.ts +9 -0
- package/dist/env/task/tools/complete-tool.d.ts +12 -0
- package/dist/env/task/tools/create-tool.d.ts +6 -0
- package/dist/env/task/tools/delete-tool.d.ts +6 -0
- package/dist/env/task/tools/get-tool.d.ts +6 -0
- package/dist/env/task/tools/index.d.ts +13 -0
- package/dist/env/task/tools/list-tool.d.ts +6 -0
- package/dist/env/task/tools/operation/create-tool.d.ts +12 -0
- package/dist/env/task/tools/operation/delete-tool.d.ts +6 -0
- package/dist/env/task/tools/operation/get-tool.d.ts +6 -0
- package/dist/env/task/tools/operation/index.d.ts +8 -0
- package/dist/env/task/tools/operation/list-tool.d.ts +6 -0
- package/dist/env/task/tools/operation/operation-types.d.ts +225 -0
- package/dist/env/task/tools/operation/update-tool.d.ts +6 -0
- package/dist/env/task/tools/search-tool.d.ts +9 -0
- package/dist/env/task/tools/task-tree-tool.d.ts +65 -0
- package/dist/env/task/tools/task-types.d.ts +255 -0
- package/dist/env/task/tools/update-tool.d.ts +6 -0
- package/dist/env/task/types.d.ts +290 -0
- package/dist/env/tool/built-in/bash-effect.d.ts +36 -0
- package/dist/env/tool/built-in/bash.d.ts +16 -0
- package/dist/env/tool/built-in/echo.d.ts +7 -0
- package/dist/env/tool/built-in/edit-file.d.ts +6 -0
- package/dist/env/tool/built-in/glob.d.ts +6 -0
- package/dist/env/tool/built-in/grep.d.ts +6 -0
- package/dist/env/tool/built-in/index.d.ts +39 -0
- package/dist/env/tool/built-in/query-background-process-tool.d.ts +113 -0
- package/dist/env/tool/built-in/read-file.d.ts +5 -0
- package/dist/env/tool/built-in/understand-image.d.ts +59 -0
- package/dist/env/tool/built-in/write-file.d.ts +5 -0
- package/dist/env/tool/index.d.ts +16 -0
- package/dist/env/tool/registry.d.ts +61 -0
- package/dist/env/tool/tool-component.d.ts +242 -0
- package/dist/env/tool/tool-config-registration.d.ts +18 -0
- package/dist/env/tool/types.d.ts +274 -0
- package/dist/env/tool/validator.d.ts +14 -0
- package/dist/env/types.d.ts +184 -0
- package/dist/env/workflow/decorators/decorator-node.d.ts +76 -0
- package/dist/env/workflow/decorators/edge.d.ts +42 -0
- package/dist/env/workflow/decorators/index.d.ts +13 -0
- package/dist/env/workflow/decorators/node-as.d.ts +40 -0
- package/dist/env/workflow/decorators/workflow.d.ts +30 -0
- package/dist/env/workflow/engine/dag-manager.d.ts +176 -0
- package/dist/env/workflow/engine/engine.d.ts +375 -0
- package/dist/env/workflow/engine/event-bus.d.ts +54 -0
- package/dist/env/workflow/engine/executor.d.ts +122 -0
- package/dist/env/workflow/engine/index.d.ts +15 -0
- package/dist/env/workflow/engine/node-registry.d.ts +159 -0
- package/dist/env/workflow/engine/scheduler.d.ts +164 -0
- package/dist/env/workflow/extractor/workflow-converter.d.ts +55 -0
- package/dist/env/workflow/fixtures.d.ts +401 -0
- package/dist/env/workflow/hooks/index.d.ts +4 -0
- package/dist/env/workflow/hooks/workflow-hook-points.d.ts +161 -0
- package/dist/env/workflow/index.d.ts +30 -0
- package/dist/env/workflow/index.js +1 -1
- package/dist/env/workflow/metadata/keys.d.ts +6 -0
- package/dist/env/workflow/nodes/agent-component-adapter.d.ts +175 -0
- package/dist/env/workflow/nodes/agent-node.d.ts +206 -0
- package/dist/env/workflow/nodes/ask-user-node.d.ts +66 -0
- package/dist/env/workflow/nodes/condition-node.d.ts +39 -0
- package/dist/env/workflow/nodes/index.d.ts +8 -0
- package/dist/env/workflow/nodes/merge-node.d.ts +40 -0
- package/dist/env/workflow/nodes/python-call-node.d.ts +95 -0
- package/dist/env/workflow/nodes/skill-node.d.ts +29 -0
- package/dist/env/workflow/nodes/tool-node.d.ts +58 -0
- package/dist/env/workflow/nodes/workflow-node.d.ts +118 -0
- package/dist/env/workflow/plugins/index.d.ts +6 -0
- package/dist/env/workflow/plugins/lark-cli-workflow-notify-plugin.d.ts +107 -0
- package/dist/env/workflow/plugins/workflow-json-output-plugin.d.ts +166 -0
- package/dist/env/workflow/runtime/runtime-cancellation-scope.d.ts +121 -0
- package/dist/env/workflow/service/index.d.ts +9 -0
- package/dist/env/workflow/service/registry.d.ts +37 -0
- package/dist/env/workflow/service/workflow-service.d.ts +422 -0
- package/dist/env/workflow/storage/index.d.ts +11 -0
- package/dist/env/workflow/storage/mock-repositories.d.ts +106 -0
- package/dist/env/workflow/storage/safe-json.d.ts +62 -0
- package/dist/env/workflow/storage/sqlite.d.ts +57 -0
- package/dist/env/workflow/storage/tag-repo.d.ts +65 -0
- package/dist/env/workflow/storage/workflow-repo.d.ts +161 -0
- package/dist/env/workflow/tools/ask-user-tool.d.ts +35 -0
- package/dist/env/workflow/tools/index.d.ts +16 -0
- package/dist/env/workflow/tools/run-workflow.d.ts +130 -0
- package/dist/env/workflow/tools/submit-json-output-tool.d.ts +38 -0
- package/dist/env/workflow/tools/workflow-add-tool.d.ts +47 -0
- package/dist/env/workflow/tools/workflow-get-tool.d.ts +29 -0
- package/dist/env/workflow/tools/workflow-list-tool.d.ts +55 -0
- package/dist/env/workflow/tools/workflow-run-status-tool.d.ts +26 -0
- package/dist/env/workflow/tools/workflow-run-stop-tool.d.ts +29 -0
- package/dist/env/workflow/tools/workflow-search-tool.d.ts +33 -0
- package/dist/env/workflow/tools/workflow-tag-list-tool.d.ts +59 -0
- package/dist/env/workflow/tools/workflow-validate-tool.d.ts +60 -0
- package/dist/env/workflow/types/context.d.ts +17 -0
- package/dist/env/workflow/types/decorators-types.d.ts +182 -0
- package/dist/env/workflow/types/edge.d.ts +33 -0
- package/dist/env/workflow/types/event.d.ts +869 -0
- package/dist/env/workflow/types/index.d.ts +16 -0
- package/dist/env/workflow/types/run.d.ts +235 -0
- package/dist/env/workflow/types/workflow-error.d.ts +79 -0
- package/dist/env/workflow/types/workflow-hil.d.ts +57 -0
- package/dist/env/workflow/types/workflow-message.d.ts +193 -0
- package/dist/env/workflow/types/workflow-session.d.ts +17 -0
- package/dist/env/workflow/types/workflow.d.ts +654 -0
- package/dist/env/workflow/types_compat.d.ts +10 -0
- package/dist/env/workflow/utils/agent-session-metadata.d.ts +35 -0
- package/dist/env/workflow/utils/build-agent-node-output.d.ts +11 -0
- package/dist/env/workflow/utils/create-workflow.d.ts +35 -0
- package/dist/env/workflow/utils/dependency-prescan.d.ts +67 -0
- package/dist/env/workflow/utils/execution-state.d.ts +46 -0
- package/dist/env/workflow/utils/extract-agent-json-output.d.ts +6 -0
- package/dist/env/workflow/utils/index.d.ts +14 -0
- package/dist/env/workflow/utils/json-schema-to-zod.d.ts +23 -0
- package/dist/env/workflow/utils/node-id-utils.d.ts +20 -0
- package/dist/env/workflow/utils/node-output-contracts.d.ts +137 -0
- package/dist/env/workflow/utils/node-registry-helper.d.ts +36 -0
- package/dist/env/workflow/utils/output-schema-hint.d.ts +7 -0
- package/dist/env/workflow/utils/parse-agent-output-config.d.ts +9 -0
- package/dist/env/workflow/utils/recovery-validator.d.ts +30 -0
- package/dist/env/workflow/utils/sensitive-redact.d.ts +37 -0
- package/dist/env/workflow/utils/session-parser.d.ts +23 -0
- package/dist/env/workflow/utils/session-recovery.d.ts +122 -0
- package/dist/env/workflow/utils/template-contract-validator.d.ts +87 -0
- package/dist/env/workflow/utils/template-resolver.d.ts +285 -0
- package/dist/env/workflow/utils/validate-workflow-definition.d.ts +57 -0
- package/dist/env/workflow/utils/validation-rules.d.ts +103 -0
- package/dist/env/workflow/utils/workflow-message-metadata.d.ts +20 -0
- package/dist/env/workflow/utils/workflow-sanitize.d.ts +51 -0
- package/dist/env/workflow/workflow-component.d.ts +138 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-rcfewbzr.js → roy-agent-core-4sx6sdb2.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-ezgsem94.js → roy-agent-core-ph5qbqcx.js} +1 -1
- package/dist/util/process/process-tree-killer.d.ts +67 -0
- package/dist/utils/id.d.ts +11 -0
- package/dist/utils/loose-json.d.ts +30 -0
- package/dist/utils/media.d.ts +70 -0
- package/dist/utils/temp-file-manager/index.d.ts +99 -0
- package/package.json +4 -2
- /package/dist/shared/@ai-setting/{roy-agent-core-s214vmmd.js → roy-agent-core-4vpk40ss.js} +0 -0
- /package/dist/shared/@ai-setting/{roy-agent-core-pkpkctvf.js → roy-agent-core-hch2geta.js} +0 -0
- /package/dist/shared/@ai-setting/{roy-agent-core-0cfaqnz9.js → roy-agent-core-k25gv86p.js} +0 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Fixtures - Workflow Definitions for Integration Tests
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Simple single-node workflow for basic testing
|
|
6
|
+
*/
|
|
7
|
+
export declare const singleNodeWorkflow: {
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
description: string;
|
|
11
|
+
nodes: {
|
|
12
|
+
id: string;
|
|
13
|
+
type: string;
|
|
14
|
+
config: {
|
|
15
|
+
tool_name: string;
|
|
16
|
+
tool_args: {
|
|
17
|
+
message: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}[];
|
|
21
|
+
entry: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Sequential workflow with three steps
|
|
25
|
+
*/
|
|
26
|
+
export declare const sequentialWorkflow: {
|
|
27
|
+
name: string;
|
|
28
|
+
version: string;
|
|
29
|
+
description: string;
|
|
30
|
+
nodes: ({
|
|
31
|
+
id: string;
|
|
32
|
+
type: string;
|
|
33
|
+
config: {
|
|
34
|
+
tool_name: string;
|
|
35
|
+
tool_args: {
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
depends_on?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
config: {
|
|
44
|
+
tool_name: string;
|
|
45
|
+
tool_args: {
|
|
46
|
+
message: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
depends_on: string[];
|
|
50
|
+
})[];
|
|
51
|
+
entry: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Parallel workflow with two branches
|
|
55
|
+
*/
|
|
56
|
+
export declare const parallelWorkflow: {
|
|
57
|
+
name: string;
|
|
58
|
+
version: string;
|
|
59
|
+
description: string;
|
|
60
|
+
nodes: ({
|
|
61
|
+
id: string;
|
|
62
|
+
type: string;
|
|
63
|
+
config: {
|
|
64
|
+
tool_name: string;
|
|
65
|
+
tool_args: {
|
|
66
|
+
message: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
depends_on?: undefined;
|
|
70
|
+
} | {
|
|
71
|
+
id: string;
|
|
72
|
+
type: string;
|
|
73
|
+
config: {
|
|
74
|
+
tool_name: string;
|
|
75
|
+
tool_args: {
|
|
76
|
+
message: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
depends_on: string[];
|
|
80
|
+
})[];
|
|
81
|
+
entry: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Diamond workflow - classic DAG pattern
|
|
85
|
+
* start
|
|
86
|
+
* / \
|
|
87
|
+
* left right
|
|
88
|
+
* \ /
|
|
89
|
+
* merge
|
|
90
|
+
* |
|
|
91
|
+
* end
|
|
92
|
+
*/
|
|
93
|
+
export declare const diamondWorkflow: {
|
|
94
|
+
name: string;
|
|
95
|
+
version: string;
|
|
96
|
+
description: string;
|
|
97
|
+
nodes: ({
|
|
98
|
+
id: string;
|
|
99
|
+
type: string;
|
|
100
|
+
config: {
|
|
101
|
+
tool_name: string;
|
|
102
|
+
tool_args: {
|
|
103
|
+
message: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
depends_on?: undefined;
|
|
107
|
+
} | {
|
|
108
|
+
id: string;
|
|
109
|
+
type: string;
|
|
110
|
+
config: {
|
|
111
|
+
tool_name: string;
|
|
112
|
+
tool_args: {
|
|
113
|
+
message: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
depends_on: string[];
|
|
117
|
+
})[];
|
|
118
|
+
entry: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Workflow with conditional execution
|
|
122
|
+
*/
|
|
123
|
+
export declare const conditionalWorkflow: {
|
|
124
|
+
name: string;
|
|
125
|
+
version: string;
|
|
126
|
+
description: string;
|
|
127
|
+
nodes: ({
|
|
128
|
+
id: string;
|
|
129
|
+
type: string;
|
|
130
|
+
config: {
|
|
131
|
+
tool_name: string;
|
|
132
|
+
tool_args: {
|
|
133
|
+
message: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
depends_on?: undefined;
|
|
137
|
+
} | {
|
|
138
|
+
id: string;
|
|
139
|
+
type: string;
|
|
140
|
+
config: {
|
|
141
|
+
tool_name: string;
|
|
142
|
+
tool_args: {
|
|
143
|
+
message: string;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
depends_on: string[];
|
|
147
|
+
})[];
|
|
148
|
+
entry: string;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Complex multi-level workflow
|
|
152
|
+
*/
|
|
153
|
+
export declare const complexWorkflow: {
|
|
154
|
+
name: string;
|
|
155
|
+
version: string;
|
|
156
|
+
description: string;
|
|
157
|
+
nodes: ({
|
|
158
|
+
id: string;
|
|
159
|
+
type: string;
|
|
160
|
+
config: {
|
|
161
|
+
tool_name: string;
|
|
162
|
+
tool_args: {
|
|
163
|
+
message: string;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
depends_on?: undefined;
|
|
167
|
+
} | {
|
|
168
|
+
id: string;
|
|
169
|
+
type: string;
|
|
170
|
+
config: {
|
|
171
|
+
tool_name: string;
|
|
172
|
+
tool_args: {
|
|
173
|
+
message: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
depends_on: string[];
|
|
177
|
+
})[];
|
|
178
|
+
entry: string[];
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Workflow that should fail (tool error)
|
|
182
|
+
*/
|
|
183
|
+
export declare const failingWorkflow: {
|
|
184
|
+
name: string;
|
|
185
|
+
version: string;
|
|
186
|
+
description: string;
|
|
187
|
+
nodes: {
|
|
188
|
+
id: string;
|
|
189
|
+
type: string;
|
|
190
|
+
config: {
|
|
191
|
+
tool_name: string;
|
|
192
|
+
tool_args: {};
|
|
193
|
+
};
|
|
194
|
+
}[];
|
|
195
|
+
entry: string;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Workflow with timeout (long running)
|
|
199
|
+
*/
|
|
200
|
+
export declare const longRunningWorkflow: {
|
|
201
|
+
name: string;
|
|
202
|
+
version: string;
|
|
203
|
+
description: string;
|
|
204
|
+
nodes: {
|
|
205
|
+
id: string;
|
|
206
|
+
type: string;
|
|
207
|
+
config: {
|
|
208
|
+
tool_name: string;
|
|
209
|
+
tool_args: {
|
|
210
|
+
command: string;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
}[];
|
|
214
|
+
entry: string;
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* All test workflows collection
|
|
218
|
+
*/
|
|
219
|
+
export declare const testWorkflows: {
|
|
220
|
+
singleNode: {
|
|
221
|
+
name: string;
|
|
222
|
+
version: string;
|
|
223
|
+
description: string;
|
|
224
|
+
nodes: {
|
|
225
|
+
id: string;
|
|
226
|
+
type: string;
|
|
227
|
+
config: {
|
|
228
|
+
tool_name: string;
|
|
229
|
+
tool_args: {
|
|
230
|
+
message: string;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
}[];
|
|
234
|
+
entry: string;
|
|
235
|
+
};
|
|
236
|
+
sequential: {
|
|
237
|
+
name: string;
|
|
238
|
+
version: string;
|
|
239
|
+
description: string;
|
|
240
|
+
nodes: ({
|
|
241
|
+
id: string;
|
|
242
|
+
type: string;
|
|
243
|
+
config: {
|
|
244
|
+
tool_name: string;
|
|
245
|
+
tool_args: {
|
|
246
|
+
message: string;
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
depends_on?: undefined;
|
|
250
|
+
} | {
|
|
251
|
+
id: string;
|
|
252
|
+
type: string;
|
|
253
|
+
config: {
|
|
254
|
+
tool_name: string;
|
|
255
|
+
tool_args: {
|
|
256
|
+
message: string;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
depends_on: string[];
|
|
260
|
+
})[];
|
|
261
|
+
entry: string;
|
|
262
|
+
};
|
|
263
|
+
parallel: {
|
|
264
|
+
name: string;
|
|
265
|
+
version: string;
|
|
266
|
+
description: string;
|
|
267
|
+
nodes: ({
|
|
268
|
+
id: string;
|
|
269
|
+
type: string;
|
|
270
|
+
config: {
|
|
271
|
+
tool_name: string;
|
|
272
|
+
tool_args: {
|
|
273
|
+
message: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
depends_on?: undefined;
|
|
277
|
+
} | {
|
|
278
|
+
id: string;
|
|
279
|
+
type: string;
|
|
280
|
+
config: {
|
|
281
|
+
tool_name: string;
|
|
282
|
+
tool_args: {
|
|
283
|
+
message: string;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
depends_on: string[];
|
|
287
|
+
})[];
|
|
288
|
+
entry: string;
|
|
289
|
+
};
|
|
290
|
+
diamond: {
|
|
291
|
+
name: string;
|
|
292
|
+
version: string;
|
|
293
|
+
description: string;
|
|
294
|
+
nodes: ({
|
|
295
|
+
id: string;
|
|
296
|
+
type: string;
|
|
297
|
+
config: {
|
|
298
|
+
tool_name: string;
|
|
299
|
+
tool_args: {
|
|
300
|
+
message: string;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
depends_on?: undefined;
|
|
304
|
+
} | {
|
|
305
|
+
id: string;
|
|
306
|
+
type: string;
|
|
307
|
+
config: {
|
|
308
|
+
tool_name: string;
|
|
309
|
+
tool_args: {
|
|
310
|
+
message: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
depends_on: string[];
|
|
314
|
+
})[];
|
|
315
|
+
entry: string;
|
|
316
|
+
};
|
|
317
|
+
conditional: {
|
|
318
|
+
name: string;
|
|
319
|
+
version: string;
|
|
320
|
+
description: string;
|
|
321
|
+
nodes: ({
|
|
322
|
+
id: string;
|
|
323
|
+
type: string;
|
|
324
|
+
config: {
|
|
325
|
+
tool_name: string;
|
|
326
|
+
tool_args: {
|
|
327
|
+
message: string;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
depends_on?: undefined;
|
|
331
|
+
} | {
|
|
332
|
+
id: string;
|
|
333
|
+
type: string;
|
|
334
|
+
config: {
|
|
335
|
+
tool_name: string;
|
|
336
|
+
tool_args: {
|
|
337
|
+
message: string;
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
depends_on: string[];
|
|
341
|
+
})[];
|
|
342
|
+
entry: string;
|
|
343
|
+
};
|
|
344
|
+
complex: {
|
|
345
|
+
name: string;
|
|
346
|
+
version: string;
|
|
347
|
+
description: string;
|
|
348
|
+
nodes: ({
|
|
349
|
+
id: string;
|
|
350
|
+
type: string;
|
|
351
|
+
config: {
|
|
352
|
+
tool_name: string;
|
|
353
|
+
tool_args: {
|
|
354
|
+
message: string;
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
depends_on?: undefined;
|
|
358
|
+
} | {
|
|
359
|
+
id: string;
|
|
360
|
+
type: string;
|
|
361
|
+
config: {
|
|
362
|
+
tool_name: string;
|
|
363
|
+
tool_args: {
|
|
364
|
+
message: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
depends_on: string[];
|
|
368
|
+
})[];
|
|
369
|
+
entry: string[];
|
|
370
|
+
};
|
|
371
|
+
failing: {
|
|
372
|
+
name: string;
|
|
373
|
+
version: string;
|
|
374
|
+
description: string;
|
|
375
|
+
nodes: {
|
|
376
|
+
id: string;
|
|
377
|
+
type: string;
|
|
378
|
+
config: {
|
|
379
|
+
tool_name: string;
|
|
380
|
+
tool_args: {};
|
|
381
|
+
};
|
|
382
|
+
}[];
|
|
383
|
+
entry: string;
|
|
384
|
+
};
|
|
385
|
+
longRunning: {
|
|
386
|
+
name: string;
|
|
387
|
+
version: string;
|
|
388
|
+
description: string;
|
|
389
|
+
nodes: {
|
|
390
|
+
id: string;
|
|
391
|
+
type: string;
|
|
392
|
+
config: {
|
|
393
|
+
tool_name: string;
|
|
394
|
+
tool_args: {
|
|
395
|
+
command: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
}[];
|
|
399
|
+
entry: string;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Workflow hooks — barrel export
|
|
3
|
+
*/
|
|
4
|
+
export { WorkflowHookPoints, type WorkflowHookPoint, type WorkflowRunHookData, type WorkflowNodeHookData, emitWorkflowRunHook, emitWorkflowNodeHook, getRegisteredWorkflowHookPoints, } from "./workflow-hook-points";
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Workflow Hook Points — 工作流生命周期 Hook 点
|
|
3
|
+
*
|
|
4
|
+
* 定义 Workflow run engine 生命周期中可被插件观察的 Hook 点。
|
|
5
|
+
*
|
|
6
|
+
* 设计对齐 `TaskHookPoints`(`env/task/hooks/task-hook-points.ts`):
|
|
7
|
+
* - `const` 对象 + 字面量联合类型
|
|
8
|
+
* - 通过 `globalHookManager.execute(point, data, metadata)` 触发
|
|
9
|
+
* - Hook 内抛错由 HookManager 隔离(`safeExecute`),不影响 workflow 运行
|
|
10
|
+
*
|
|
11
|
+
* 命名约定沿用 repo 既有风格:`<component>:<phase>.<action>`
|
|
12
|
+
* (例:`task:after.update` / `tool:before.execute`)
|
|
13
|
+
*
|
|
14
|
+
* ── 为什么需要(背景)──────────────────────────────────────────────
|
|
15
|
+
* 在本次改动之前,workflow 包内**没有任何** lifecycle hook 点:
|
|
16
|
+
* - `globalHookManager` 在 workflow 包内只被 json-output 插件用于
|
|
17
|
+
* `agent:after.react`(那是 agent hook,不是 workflow 运行 hook)
|
|
18
|
+
* - `RunWorkflowLifecycleHooks`(tools/run-workflow.ts)是一组
|
|
19
|
+
* **依赖注入回调**(attach/detach/replaceWorkflowRun),服务于后台任务的
|
|
20
|
+
* 停止传播,不是通用的插件 Hook
|
|
21
|
+
*
|
|
22
|
+
* 因此外部插件(例如「把 workflow 进展同步到飞书群」的 notify 插件)无法观察
|
|
23
|
+
* workflow 的开始/结束与节点的开始/结束。本模块补上这四个 Hook 点,
|
|
24
|
+
* 并在 run engine 的真实生命周期位置触发。
|
|
25
|
+
*
|
|
26
|
+
* ── 触发位置(与既有 EventBus 事件一一对应,保证语义一致)────────────
|
|
27
|
+
* | Hook 点 | 触发位置 | 对应内部事件 |
|
|
28
|
+
* |--------------------------|------------------------------------------------------|----------------------|
|
|
29
|
+
* | `workflow:before.run` | `engine.runWithResume()` 起点 | `workflow.started` |
|
|
30
|
+
* | `workflow:after.run` | `engine.completeWorkflow()` / `failWorkflow()` / `stop()` | `workflow.completed` / `workflow.failed` / `workflow.stopped` |
|
|
31
|
+
* | `workflow:before.node` | `engine.validateAndExecute()` 起点 | `node.started` |
|
|
32
|
+
* | `workflow:after.node` | `engine.validateAndExecute()` 成功/失败分支 | `node.completed` / `node.failed` |
|
|
33
|
+
*
|
|
34
|
+
* ⚠️ node 级 hook 接在 **`engine.validateAndExecute()`** 而非 `executor.executeNode()`
|
|
35
|
+
* (独立 review P2-1 指出的文档与实现不符)。原因:validateAndExecute 是
|
|
36
|
+
* `startNode` 与 `resumeNode` 的**唯一汇聚点**,且此处持有 `sessionState`
|
|
37
|
+
* —— 才能拿到 `totalNodes` / `completedNodes` 填进 hook payload。
|
|
38
|
+
*
|
|
39
|
+
* 注意 `runWithResume` 同时服务于首次运行与 resume —— 每次进入 run loop 都会触发
|
|
40
|
+
* `before.run`,这样 pause→resume 时插件也能感知到「又跑起来了」。
|
|
41
|
+
*/
|
|
42
|
+
import type { RunStatus, NodeStatus } from "../types/run";
|
|
43
|
+
export declare const WorkflowHookPoints: {
|
|
44
|
+
/** 一次 run loop 开始(首次运行或 resume) */
|
|
45
|
+
readonly BEFORE_RUN: "workflow:before.run";
|
|
46
|
+
/**
|
|
47
|
+
* 一次 run 进入终态后触发。
|
|
48
|
+
*
|
|
49
|
+
* 与 `TaskHookPoints.AFTER_COMPLETE` 同理:比「每次状态变更」语义更精确,
|
|
50
|
+
* 仅在 run 结束时触发一次。终态包括 completed / failed / stopped。
|
|
51
|
+
* 具体终态看 `data.status`。
|
|
52
|
+
*/
|
|
53
|
+
readonly AFTER_RUN: "workflow:after.run";
|
|
54
|
+
/** 节点即将执行(已 publish node.started) */
|
|
55
|
+
readonly BEFORE_NODE: "workflow:before.node";
|
|
56
|
+
/**
|
|
57
|
+
* 节点执行结束(成功或失败都触发)。
|
|
58
|
+
* 成功/失败看 `data.status`,失败详情看 `data.error`。
|
|
59
|
+
*/
|
|
60
|
+
readonly AFTER_NODE: "workflow:after.node";
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Workflow Hook 点类型
|
|
64
|
+
*/
|
|
65
|
+
export type WorkflowHookPoint = typeof WorkflowHookPoints[keyof typeof WorkflowHookPoints];
|
|
66
|
+
/**
|
|
67
|
+
* run 级 Hook 的载荷
|
|
68
|
+
*
|
|
69
|
+
* 全部字段都是可序列化的标量/对象,便于插件直接渲染成通知卡片,
|
|
70
|
+
* 不需要再回查 engine 内部状态。
|
|
71
|
+
*/
|
|
72
|
+
export interface WorkflowRunHookData {
|
|
73
|
+
/** run 标识(== sessionId,见 Task #1837) */
|
|
74
|
+
runId: string;
|
|
75
|
+
/** workflow session id */
|
|
76
|
+
sessionId: string;
|
|
77
|
+
/** workflow 定义 id */
|
|
78
|
+
workflowId: string;
|
|
79
|
+
/** workflow 名称(人可读,用于卡片标题) */
|
|
80
|
+
workflowName: string;
|
|
81
|
+
/** 当前 run 状态 */
|
|
82
|
+
status: RunStatus;
|
|
83
|
+
/** 触发输入(before.run 时提供) */
|
|
84
|
+
input?: unknown;
|
|
85
|
+
/** 最终输出(after.run 且成功时提供) */
|
|
86
|
+
output?: unknown;
|
|
87
|
+
/** 失败原因(after.run 且 failed 时提供) */
|
|
88
|
+
error?: string;
|
|
89
|
+
/** 停止原因(after.run 且 stopped 时提供) */
|
|
90
|
+
stopReason?: string;
|
|
91
|
+
/** run 耗时(after.run 时提供) */
|
|
92
|
+
durationMs?: number;
|
|
93
|
+
/** DAG 中的节点总数 —— 供插件算进度百分比的分母 */
|
|
94
|
+
totalNodes?: number;
|
|
95
|
+
/** 已产出结果的节点数 —— 进度分子 */
|
|
96
|
+
completedNodes?: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* node 级 Hook 的载荷
|
|
100
|
+
*/
|
|
101
|
+
export interface WorkflowNodeHookData {
|
|
102
|
+
/** run 标识 */
|
|
103
|
+
runId: string;
|
|
104
|
+
/** workflow session id */
|
|
105
|
+
sessionId: string;
|
|
106
|
+
/** workflow 名称 */
|
|
107
|
+
workflowName: string;
|
|
108
|
+
/** 节点 id(DAG 内唯一) */
|
|
109
|
+
nodeId: string;
|
|
110
|
+
/** 节点类型(agent / tool / condition / ...) */
|
|
111
|
+
nodeType: string;
|
|
112
|
+
/** 节点状态 */
|
|
113
|
+
status: NodeStatus;
|
|
114
|
+
/** 节点输入 */
|
|
115
|
+
input?: unknown;
|
|
116
|
+
/** 节点输出(after.node 且成功时提供) */
|
|
117
|
+
output?: unknown;
|
|
118
|
+
/** 失败原因(after.node 且 failed 时提供) */
|
|
119
|
+
error?: string;
|
|
120
|
+
/** 该节点耗时 */
|
|
121
|
+
durationMs?: number;
|
|
122
|
+
/** DAG 中的节点总数 */
|
|
123
|
+
totalNodes?: number;
|
|
124
|
+
/** 已产出结果的节点数 */
|
|
125
|
+
completedNodes?: number;
|
|
126
|
+
/**
|
|
127
|
+
* 该节点绑定的 agent 子 session id(agent 类节点才有)。
|
|
128
|
+
* 便于插件在卡片里给出「点进去看这个子会话」的线索。
|
|
129
|
+
*/
|
|
130
|
+
agentSessionId?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 触发一个 workflow run 级 Hook。
|
|
134
|
+
*
|
|
135
|
+
* ⚠️ 传给 hook 的是什么(实测确认,别再踩):
|
|
136
|
+
* `globalHookManager.execute(point, data, metadata)` 会把 `data` 包进 `HookContext`
|
|
137
|
+
* 再交给 hook —— 即 **hook 收到的第 1 个参数是 `ctx`,载荷在 `ctx.data`**。
|
|
138
|
+
*
|
|
139
|
+
* (`TaskComponent.executeHook` 注释里的「直接传 data 而非包一层 ctx」指的是
|
|
140
|
+
* 不要把 data 再套一层自定义 ctx,而不是 hook 能直接收到 data。
|
|
141
|
+
* 第一版单测就是因为 hook 里读了 `ctx.status` 而不是 `ctx.data.status` 而误判
|
|
142
|
+
* 「after.run 没触发」,浪费了一轮排查。)
|
|
143
|
+
*
|
|
144
|
+
* 错误隔离:HookManager 内部 `safeExecute` 会吞掉 hook 抛出的异常并记日志,
|
|
145
|
+
* 因此插件故障不会中断 workflow 运行。
|
|
146
|
+
*/
|
|
147
|
+
export declare function emitWorkflowRunHook(hookPoint: WorkflowHookPoint, data: WorkflowRunHookData, metadata?: Record<string, unknown>): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* 触发一个 workflow node 级 Hook。语义同 {@link emitWorkflowRunHook}。
|
|
150
|
+
*/
|
|
151
|
+
export declare function emitWorkflowNodeHook(hookPoint: WorkflowHookPoint, data: WorkflowNodeHookData, metadata?: Record<string, unknown>): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* HookManager 挂链自检:返回当前已注册的 workflow hook 点(含注册数量)。
|
|
154
|
+
*
|
|
155
|
+
* 供插件/诊断命令确认「我的 hook 到底挂上没有」—— 在 notify 插件静默失效时
|
|
156
|
+
* 这是第一个要查的问题。
|
|
157
|
+
*/
|
|
158
|
+
export declare function getRegisteredWorkflowHookPoints(): Array<{
|
|
159
|
+
hookPoint: string;
|
|
160
|
+
count: number;
|
|
161
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Module
|
|
3
|
+
*
|
|
4
|
+
* 提供基于装饰器的 Workflow 定义和执行能力
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { Workflow, NodeAs, createWorkflowFromClass } from '@ai-setting/roy-agent-core';
|
|
9
|
+
*
|
|
10
|
+
* @Workflow({ name: 'my-workflow', entry: 'step1' })
|
|
11
|
+
* @WorkflowEdges([{ from: 'step1', to: 'step2' }])
|
|
12
|
+
* class MyWorkflow {
|
|
13
|
+
* @NodeAs({ nodeId: 'step1', nodeType: 'tool' })
|
|
14
|
+
* async step1() { return { result: 'done' }; }
|
|
15
|
+
*
|
|
16
|
+
* @NodeAs({ nodeId: 'step2', dependsOn: 'step1' })
|
|
17
|
+
* async step2() { return { result: 'processed' }; }
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* const workflow = createWorkflowFromClass(MyWorkflow);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export { Workflow } from './decorators/workflow';
|
|
24
|
+
export { NodeAs } from './decorators/node-as';
|
|
25
|
+
export { Edge, WorkflowEdges } from './decorators/edge';
|
|
26
|
+
export { DecoratorNode } from './decorators/decorator-node';
|
|
27
|
+
export { WorkflowConverter } from './extractor/workflow-converter';
|
|
28
|
+
export { createWorkflowFromClass } from './utils/create-workflow';
|
|
29
|
+
export { WorkflowComponent } from './workflow-component';
|
|
30
|
+
export * from './types/index';
|