hyacinth-ai 0.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +205 -0
- package/commands.json +25 -0
- package/dist/agents/builtins.d.ts +8 -0
- package/dist/agents/builtins.js +50 -0
- package/dist/agents/config-loader.d.ts +15 -0
- package/dist/agents/config-loader.js +75 -0
- package/dist/agents/delegate-tool.d.ts +109 -0
- package/dist/agents/delegate-tool.js +407 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/registry.d.ts +2 -0
- package/dist/agents/registry.js +2 -0
- package/dist/bypass/agents/companion/index.d.ts +57 -0
- package/dist/bypass/agents/companion/index.js +487 -0
- package/dist/bypass/agents/orchestrator/index.d.ts +17 -0
- package/dist/bypass/agents/orchestrator/index.js +414 -0
- package/dist/bypass/agents/orchestrator.d.ts +16 -0
- package/dist/bypass/agents/orchestrator.js +377 -0
- package/dist/bypass/agents/world-engine/agent.d.ts +41 -0
- package/dist/bypass/agents/world-engine/agent.js +385 -0
- package/dist/bypass/agents/world-engine/index.d.ts +52 -0
- package/dist/bypass/agents/world-engine/index.js +198 -0
- package/dist/bypass/agents/world-engine/sim.d.ts +14 -0
- package/dist/bypass/agents/world-engine/sim.js +120 -0
- package/dist/bypass/agents/world-engine/store.d.ts +110 -0
- package/dist/bypass/agents/world-engine/store.js +519 -0
- package/dist/bypass/agents/world-engine/ticker.d.ts +37 -0
- package/dist/bypass/agents/world-engine/ticker.js +214 -0
- package/dist/bypass/agents/world-engine/tools.d.ts +6 -0
- package/dist/bypass/agents/world-engine/tools.js +380 -0
- package/dist/bypass/agents/world-engine/types.d.ts +202 -0
- package/dist/bypass/agents/world-engine/types.js +56 -0
- package/dist/bypass/agents/world-engine.d.ts +20 -0
- package/dist/bypass/agents/world-engine.js +63 -0
- package/dist/bypass/base.d.ts +48 -0
- package/dist/bypass/base.js +126 -0
- package/dist/bypass/index.d.ts +5 -0
- package/dist/bypass/index.js +6 -0
- package/dist/bypass/manager.d.ts +41 -0
- package/dist/bypass/manager.js +179 -0
- package/dist/bypass/types.d.ts +63 -0
- package/dist/bypass/types.js +14 -0
- package/dist/channels/auto-detect.d.ts +25 -0
- package/dist/channels/auto-detect.js +77 -0
- package/dist/channels/builtin/http-webhook.d.ts +25 -0
- package/dist/channels/builtin/http-webhook.js +287 -0
- package/dist/channels/builtin/tui-channel.d.ts +33 -0
- package/dist/channels/builtin/tui-channel.js +61 -0
- package/dist/channels/builtin/tui-ws-session.d.ts +16 -0
- package/dist/channels/builtin/tui-ws-session.js +90 -0
- package/dist/channels/builtin/webui-output-handler.d.ts +30 -0
- package/dist/channels/builtin/webui-output-handler.js +93 -0
- package/dist/channels/index.d.ts +5 -0
- package/dist/channels/index.js +3 -0
- package/dist/channels/interface.d.ts +148 -0
- package/dist/channels/interface.js +15 -0
- package/dist/channels/manager.d.ts +43 -0
- package/dist/channels/manager.js +156 -0
- package/dist/channels/message-queue.d.ts +36 -0
- package/dist/channels/message-queue.js +91 -0
- package/dist/channels/plugins/clawbot/clawbot-auth.d.ts +50 -0
- package/dist/channels/plugins/clawbot/clawbot-auth.js +235 -0
- package/dist/channels/plugins/clawbot/clawbot-channel.d.ts +76 -0
- package/dist/channels/plugins/clawbot/clawbot-channel.js +566 -0
- package/dist/channels/plugins/clawbot/clawbot-client.d.ts +180 -0
- package/dist/channels/plugins/clawbot/clawbot-client.js +312 -0
- package/dist/channels/plugins/clawbot/clawbot-config.d.ts +30 -0
- package/dist/channels/plugins/clawbot/clawbot-config.js +28 -0
- package/dist/channels/plugins/clawbot/clawbot-message-queue.d.ts +27 -0
- package/dist/channels/plugins/clawbot/clawbot-message-queue.js +114 -0
- package/dist/channels/plugins/clawbot/clawbot-session.d.ts +10 -0
- package/dist/channels/plugins/clawbot/clawbot-session.js +26 -0
- package/dist/channels/plugins/clawbot/index.d.ts +17 -0
- package/dist/channels/plugins/clawbot/index.js +58 -0
- package/dist/channels/plugins/feishu/feishu-channel.d.ts +57 -0
- package/dist/channels/plugins/feishu/feishu-channel.js +602 -0
- package/dist/channels/plugins/feishu/feishu-client.d.ts +23 -0
- package/dist/channels/plugins/feishu/feishu-client.js +86 -0
- package/dist/channels/plugins/feishu/feishu-config.d.ts +53 -0
- package/dist/channels/plugins/feishu/feishu-config.js +35 -0
- package/dist/channels/plugins/feishu/feishu-event.d.ts +102 -0
- package/dist/channels/plugins/feishu/feishu-event.js +257 -0
- package/dist/channels/plugins/feishu/feishu-log-suppressor.d.ts +7 -0
- package/dist/channels/plugins/feishu/feishu-log-suppressor.js +34 -0
- package/dist/channels/plugins/feishu/feishu-message-queue.d.ts +27 -0
- package/dist/channels/plugins/feishu/feishu-message-queue.js +112 -0
- package/dist/channels/plugins/feishu/feishu-send.d.ts +44 -0
- package/dist/channels/plugins/feishu/feishu-send.js +232 -0
- package/dist/channels/plugins/feishu/feishu-session.d.ts +44 -0
- package/dist/channels/plugins/feishu/feishu-session.js +84 -0
- package/dist/channels/plugins/feishu/feishu-streaming.d.ts +49 -0
- package/dist/channels/plugins/feishu/feishu-streaming.js +185 -0
- package/dist/channels/plugins/feishu/feishu-transport.d.ts +29 -0
- package/dist/channels/plugins/feishu/feishu-transport.js +99 -0
- package/dist/channels/plugins/feishu/index.d.ts +22 -0
- package/dist/channels/plugins/feishu/index.js +68 -0
- package/dist/cli/doctor.d.ts +20 -0
- package/dist/cli/doctor.js +317 -0
- package/dist/context/cache-strategy.d.ts +76 -0
- package/dist/context/cache-strategy.js +123 -0
- package/dist/context/composer.d.ts +77 -0
- package/dist/context/composer.js +318 -0
- package/dist/context/compressor.d.ts +218 -0
- package/dist/context/compressor.js +909 -0
- package/dist/context/index.d.ts +14 -0
- package/dist/context/index.js +8 -0
- package/dist/context/interface.d.ts +33 -0
- package/dist/context/interface.js +2 -0
- package/dist/context/manifest-defaults.d.ts +51 -0
- package/dist/context/manifest-defaults.js +133 -0
- package/dist/context/manifest-loader.d.ts +16 -0
- package/dist/context/manifest-loader.js +103 -0
- package/dist/context/manifest-types.d.ts +26 -0
- package/dist/context/manifest-types.js +2 -0
- package/dist/context/precision/analyzer.d.ts +31 -0
- package/dist/context/precision/analyzer.js +131 -0
- package/dist/context/precision/companion.d.ts +27 -0
- package/dist/context/precision/companion.js +144 -0
- package/dist/context/precision/default.d.ts +14 -0
- package/dist/context/precision/default.js +17 -0
- package/dist/context/precision/index.d.ts +9 -0
- package/dist/context/precision/index.js +7 -0
- package/dist/context/precision/keyword-pool.d.ts +27 -0
- package/dist/context/precision/keyword-pool.js +66 -0
- package/dist/context/precision/strategy.d.ts +18 -0
- package/dist/context/precision/strategy.js +51 -0
- package/dist/context/precision/summary-store.d.ts +18 -0
- package/dist/context/precision/summary-store.js +67 -0
- package/dist/context/precision/types.d.ts +23 -0
- package/dist/context/precision/types.js +2 -0
- package/dist/context/profiles.d.ts +45 -0
- package/dist/context/profiles.js +92 -0
- package/dist/context/prompt-builder.d.ts +76 -0
- package/dist/context/prompt-builder.js +133 -0
- package/dist/context/retriever.d.ts +44 -0
- package/dist/context/retriever.js +203 -0
- package/dist/context/router.d.ts +122 -0
- package/dist/context/router.js +291 -0
- package/dist/context/section-resolver.d.ts +38 -0
- package/dist/context/section-resolver.js +398 -0
- package/dist/context/tokenizer.d.ts +23 -0
- package/dist/context/tokenizer.js +78 -0
- package/dist/dependency/analyzer.d.ts +33 -0
- package/dist/dependency/analyzer.js +242 -0
- package/dist/dependency/data-flow-tracker.d.ts +12 -0
- package/dist/dependency/data-flow-tracker.js +97 -0
- package/dist/dependency/function-parser.d.ts +34 -0
- package/dist/dependency/function-parser.js +295 -0
- package/dist/dependency/index.d.ts +14 -0
- package/dist/dependency/index.js +20 -0
- package/dist/dependency/parser.d.ts +10 -0
- package/dist/dependency/parser.js +93 -0
- package/dist/dependency/types.d.ts +57 -0
- package/dist/dependency/types.js +2 -0
- package/dist/env/env-collector.d.ts +45 -0
- package/dist/env/env-collector.js +221 -0
- package/dist/env/index.d.ts +3 -0
- package/dist/env/index.js +2 -0
- package/dist/event-store.d.ts +27 -0
- package/dist/event-store.js +71 -0
- package/dist/evolution/git-manager.d.ts +46 -0
- package/dist/evolution/git-manager.js +276 -0
- package/dist/evolution/index.d.ts +3 -0
- package/dist/evolution/index.js +2 -0
- package/dist/flow/bootstrap-flow.d.ts +19 -0
- package/dist/flow/bootstrap-flow.js +72 -0
- package/dist/flow/flow-registry.d.ts +12 -0
- package/dist/flow/flow-registry.js +74 -0
- package/dist/flow/flow-tools.d.ts +8 -0
- package/dist/flow/flow-tools.js +106 -0
- package/dist/flow/index.d.ts +6 -0
- package/dist/flow/index.js +8 -0
- package/dist/flow/todo-flow.d.ts +25 -0
- package/dist/flow/todo-flow.js +107 -0
- package/dist/flow/types.d.ts +78 -0
- package/dist/flow/types.js +12 -0
- package/dist/flows/bootstrap.d.ts +18 -0
- package/dist/flows/bootstrap.js +119 -0
- package/dist/flows/index.d.ts +6 -0
- package/dist/flows/index.js +11 -0
- package/dist/flows/todo.d.ts +26 -0
- package/dist/flows/todo.js +174 -0
- package/dist/flows/tools.d.ts +8 -0
- package/dist/flows/tools.js +119 -0
- package/dist/flows/types.d.ts +27 -0
- package/dist/flows/types.js +10 -0
- package/dist/gateway/cli.d.ts +5 -0
- package/dist/gateway/cli.js +1027 -0
- package/dist/gateway/factory.d.ts +80 -0
- package/dist/gateway/factory.js +832 -0
- package/dist/gateway/guardian.d.ts +8 -0
- package/dist/gateway/guardian.js +30 -0
- package/dist/gateway/index.d.ts +3 -0
- package/dist/gateway/index.js +3 -0
- package/dist/gateway/server.d.ts +17 -0
- package/dist/gateway/server.js +96 -0
- package/dist/gateway/tui.d.ts +16 -0
- package/dist/gateway/tui.js +3273 -0
- package/dist/hot-reload/agent-watcher.d.ts +24 -0
- package/dist/hot-reload/agent-watcher.js +175 -0
- package/dist/hot-reload/bundle-watcher.d.ts +12 -0
- package/dist/hot-reload/bundle-watcher.js +35 -0
- package/dist/hot-reload/channel-watcher.d.ts +19 -0
- package/dist/hot-reload/channel-watcher.js +54 -0
- package/dist/hot-reload/command-watcher.d.ts +14 -0
- package/dist/hot-reload/command-watcher.js +54 -0
- package/dist/hot-reload/config-watcher.d.ts +20 -0
- package/dist/hot-reload/config-watcher.js +58 -0
- package/dist/hot-reload/index.d.ts +12 -0
- package/dist/hot-reload/index.js +12 -0
- package/dist/hot-reload/manager.d.ts +58 -0
- package/dist/hot-reload/manager.js +243 -0
- package/dist/hot-reload/manifest-watcher.d.ts +9 -0
- package/dist/hot-reload/manifest-watcher.js +42 -0
- package/dist/hot-reload/mcp-watcher.d.ts +18 -0
- package/dist/hot-reload/mcp-watcher.js +64 -0
- package/dist/hot-reload/model-catalog-watcher.d.ts +18 -0
- package/dist/hot-reload/model-catalog-watcher.js +62 -0
- package/dist/hot-reload/plugin-watcher.d.ts +20 -0
- package/dist/hot-reload/plugin-watcher.js +56 -0
- package/dist/hot-reload/prompt-watcher.d.ts +6 -0
- package/dist/hot-reload/prompt-watcher.js +38 -0
- package/dist/hot-reload/provider-watcher.d.ts +16 -0
- package/dist/hot-reload/provider-watcher.js +45 -0
- package/dist/hot-reload/skill-watcher.d.ts +19 -0
- package/dist/hot-reload/skill-watcher.js +82 -0
- package/dist/hot-reload/tool-watcher.d.ts +16 -0
- package/dist/hot-reload/tool-watcher.js +168 -0
- package/dist/hot-reload/workflow-watcher.d.ts +19 -0
- package/dist/hot-reload/workflow-watcher.js +84 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6 -0
- package/dist/knowledge/fts5-retriever.d.ts +30 -0
- package/dist/knowledge/fts5-retriever.js +223 -0
- package/dist/knowledge/index.d.ts +11 -0
- package/dist/knowledge/index.js +14 -0
- package/dist/knowledge/indexer.d.ts +41 -0
- package/dist/knowledge/indexer.js +186 -0
- package/dist/knowledge/query-preprocessor.d.ts +13 -0
- package/dist/knowledge/query-preprocessor.js +63 -0
- package/dist/knowledge/retriever.d.ts +45 -0
- package/dist/knowledge/retriever.js +9 -0
- package/dist/knowledge/store.d.ts +27 -0
- package/dist/knowledge/store.js +61 -0
- package/dist/knowledge/structured-store.d.ts +78 -0
- package/dist/knowledge/structured-store.js +280 -0
- package/dist/knowledge/structured-tools.d.ts +12 -0
- package/dist/knowledge/structured-tools.js +151 -0
- package/dist/knowledge/tools.d.ts +20 -0
- package/dist/knowledge/tools.js +238 -0
- package/dist/knowledge/watcher.d.ts +28 -0
- package/dist/knowledge/watcher.js +113 -0
- package/dist/lifecycle/index.d.ts +12 -0
- package/dist/lifecycle/index.js +14 -0
- package/dist/lifecycle/interface.d.ts +94 -0
- package/dist/lifecycle/interface.js +2 -0
- package/dist/lifecycle/local-model.d.ts +62 -0
- package/dist/lifecycle/local-model.js +331 -0
- package/dist/lifecycle/manager.d.ts +70 -0
- package/dist/lifecycle/manager.js +374 -0
- package/dist/lifecycle/supervisor.d.ts +89 -0
- package/dist/lifecycle/supervisor.js +277 -0
- package/dist/lifecycle-integration-test.d.ts +2 -0
- package/dist/lifecycle-integration-test.js +72 -0
- package/dist/local-model/download-manager.d.ts +59 -0
- package/dist/local-model/download-manager.js +517 -0
- package/dist/local-model/index.d.ts +109 -0
- package/dist/local-model/index.js +233 -0
- package/dist/local-model/llamacpp-provider.d.ts +95 -0
- package/dist/local-model/llamacpp-provider.js +379 -0
- package/dist/local-model/model-bridge.d.ts +48 -0
- package/dist/local-model/model-bridge.js +256 -0
- package/dist/local-model/model-registry.d.ts +47 -0
- package/dist/local-model/model-registry.js +188 -0
- package/dist/local-model/types.d.ts +49 -0
- package/dist/local-model/types.js +2 -0
- package/dist/logging/index.d.ts +3 -0
- package/dist/logging/index.js +3 -0
- package/dist/logging/logger.d.ts +56 -0
- package/dist/logging/logger.js +94 -0
- package/dist/machine/flows/bootstrap.d.ts +18 -0
- package/dist/machine/flows/bootstrap.js +119 -0
- package/dist/machine/flows/index.d.ts +6 -0
- package/dist/machine/flows/index.js +11 -0
- package/dist/machine/flows/spec.d.ts +17 -0
- package/dist/machine/flows/spec.js +176 -0
- package/dist/machine/flows/todo.d.ts +26 -0
- package/dist/machine/flows/todo.js +175 -0
- package/dist/machine/flows/tools.d.ts +8 -0
- package/dist/machine/flows/tools.js +119 -0
- package/dist/machine/flows/types.d.ts +33 -0
- package/dist/machine/flows/types.js +10 -0
- package/dist/machine/index.d.ts +8 -0
- package/dist/machine/index.js +9 -0
- package/dist/machine/registry.d.ts +34 -0
- package/dist/machine/registry.js +98 -0
- package/dist/machine/runner.d.ts +41 -0
- package/dist/machine/runner.js +177 -0
- package/dist/machine/types.d.ts +121 -0
- package/dist/machine/types.js +9 -0
- package/dist/mcp/bridge.d.ts +33 -0
- package/dist/mcp/bridge.js +99 -0
- package/dist/mcp/client.d.ts +37 -0
- package/dist/mcp/client.js +161 -0
- package/dist/mcp/config.d.ts +15 -0
- package/dist/mcp/config.js +85 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/install-manager.d.ts +31 -0
- package/dist/mcp/install-manager.js +158 -0
- package/dist/mcp/lifecycle.d.ts +41 -0
- package/dist/mcp/lifecycle.js +175 -0
- package/dist/mcp/process-transport.d.ts +21 -0
- package/dist/mcp/process-transport.js +59 -0
- package/dist/mcp/side-effect.d.ts +5 -0
- package/dist/mcp/side-effect.js +21 -0
- package/dist/mcp/system.d.ts +95 -0
- package/dist/mcp/system.js +279 -0
- package/dist/memory/companion-session.d.ts +22 -0
- package/dist/memory/companion-session.js +77 -0
- package/dist/memory/compression-boundary.d.ts +20 -0
- package/dist/memory/compression-boundary.js +40 -0
- package/dist/memory/conversation.d.ts +34 -0
- package/dist/memory/conversation.js +107 -0
- package/dist/memory/events.d.ts +42 -0
- package/dist/memory/events.js +56 -0
- package/dist/memory/index.d.ts +7 -0
- package/dist/memory/index.js +6 -0
- package/dist/memory/memory-store.d.ts +11 -0
- package/dist/memory/memory-store.js +51 -0
- package/dist/memory/session-allowlist.d.ts +11 -0
- package/dist/memory/session-allowlist.js +50 -0
- package/dist/memory/session.d.ts +48 -0
- package/dist/memory/session.js +275 -0
- package/dist/memory/stats.d.ts +23 -0
- package/dist/memory/stats.js +59 -0
- package/dist/memory/summary.d.ts +7 -0
- package/dist/memory/summary.js +23 -0
- package/dist/multimodal/index.d.ts +66 -0
- package/dist/multimodal/index.js +210 -0
- package/dist/orchestrator/index.d.ts +5 -0
- package/dist/orchestrator/index.js +4 -0
- package/dist/orchestrator/loop.d.ts +331 -0
- package/dist/orchestrator/loop.js +2443 -0
- package/dist/orchestrator/plan-store.d.ts +81 -0
- package/dist/orchestrator/plan-store.js +167 -0
- package/dist/orchestrator/planner.d.ts +20 -0
- package/dist/orchestrator/planner.js +34 -0
- package/dist/parser/index.d.ts +2 -0
- package/dist/parser/index.js +2 -0
- package/dist/parser/router.d.ts +30 -0
- package/dist/parser/router.js +61 -0
- package/dist/plugins/api.d.ts +39 -0
- package/dist/plugins/api.js +85 -0
- package/dist/plugins/define.d.ts +27 -0
- package/dist/plugins/define.js +32 -0
- package/dist/plugins/index.d.ts +9 -0
- package/dist/plugins/index.js +5 -0
- package/dist/plugins/loader.d.ts +39 -0
- package/dist/plugins/loader.js +128 -0
- package/dist/plugins/manager.d.ts +61 -0
- package/dist/plugins/manager.js +257 -0
- package/dist/plugins/types.d.ts +82 -0
- package/dist/plugins/types.js +2 -0
- package/dist/prompts/agents/code-reviewer.md +16 -0
- package/dist/prompts/agents/security-auditor.md +17 -0
- package/dist/prompts/agents/test-writer.md +15 -0
- package/dist/prompts/attention/attention.md +12 -0
- package/dist/prompts/environment/environment.md +18 -0
- package/dist/prompts/environment/feishu.md +107 -0
- package/dist/prompts/flows/bootstrap-confirm.md +14 -0
- package/dist/prompts/flows/bootstrap-identity.md +11 -0
- package/dist/prompts/flows/bootstrap-soul.md +19 -0
- package/dist/prompts/flows/bootstrap-user.md +11 -0
- package/dist/prompts/flows/spec-checklist.md +27 -0
- package/dist/prompts/flows/spec-define.md +64 -0
- package/dist/prompts/flows/spec-executing-checklist.md +15 -0
- package/dist/prompts/flows/spec-executing-tasks.md +15 -0
- package/dist/prompts/flows/spec-spec.md +51 -0
- package/dist/prompts/flows/spec-tasks.md +32 -0
- package/dist/prompts/flows/todo-execution.md +7 -0
- package/dist/prompts/flows/todo-planning.md +18 -0
- package/dist/prompts/framework/architecture.md +131 -0
- package/dist/prompts/identity/identity.md +2 -0
- package/dist/prompts/loader.d.ts +24 -0
- package/dist/prompts/loader.js +102 -0
- package/dist/prompts/loader.ts +119 -0
- package/dist/prompts/orchestration/summary.md +14 -0
- package/dist/prompts/persona/BOOTSTRAP.md +5 -0
- package/dist/prompts/persona/IDENTITY.md +16 -0
- package/dist/prompts/persona/PartnerMemory.md +5 -0
- package/dist/prompts/persona/PartnerSoul.md +7 -0
- package/dist/prompts/persona/SOUL.md +30 -0
- package/dist/prompts/persona/USER.md +16 -0
- package/dist/prompts/precise/analyze.md +23 -0
- package/dist/prompts/precise/persona.md +18 -0
- package/dist/prompts/safety/coding-standards.md +5 -0
- package/dist/prompts/safety/safety.md +4 -0
- package/dist/prompts/skills/code-review.md +4 -0
- package/dist/prompts/skills/debug.md +7 -0
- package/dist/prompts/skills/framework-reference.md +131 -0
- package/dist/prompts/skills/refactor.md +6 -0
- package/dist/prompts/summary.md +22 -0
- package/dist/prompts/tools/framework-capabilities.md +241 -0
- package/dist/prompts/tools/tool-rules.md +15 -0
- package/dist/provider/anthropic.d.ts +62 -0
- package/dist/provider/anthropic.js +361 -0
- package/dist/provider/catalog.d.ts +58 -0
- package/dist/provider/catalog.js +97 -0
- package/dist/provider/compatible.d.ts +89 -0
- package/dist/provider/compatible.js +328 -0
- package/dist/provider/config.d.ts +23 -0
- package/dist/provider/config.js +158 -0
- package/dist/provider/deepseek.d.ts +25 -0
- package/dist/provider/deepseek.js +37 -0
- package/dist/provider/fallback.d.ts +51 -0
- package/dist/provider/fallback.js +113 -0
- package/dist/provider/gemini.d.ts +27 -0
- package/dist/provider/gemini.js +170 -0
- package/dist/provider/index.d.ts +36 -0
- package/dist/provider/index.js +42 -0
- package/dist/provider/interface.d.ts +62 -0
- package/dist/provider/interface.js +2 -0
- package/dist/provider/local-config.d.ts +37 -0
- package/dist/provider/local-config.js +146 -0
- package/dist/provider/local.d.ts +45 -0
- package/dist/provider/local.js +248 -0
- package/dist/provider/manager.d.ts +67 -0
- package/dist/provider/manager.js +355 -0
- package/dist/provider/mimo.d.ts +19 -0
- package/dist/provider/mimo.js +30 -0
- package/dist/provider/minimax.d.ts +22 -0
- package/dist/provider/minimax.js +33 -0
- package/dist/provider/model-catalog-loader.d.ts +42 -0
- package/dist/provider/model-catalog-loader.js +89 -0
- package/dist/provider/model-channel-registry.d.ts +130 -0
- package/dist/provider/model-channel-registry.js +488 -0
- package/dist/provider/model-router.d.ts +60 -0
- package/dist/provider/model-router.js +87 -0
- package/dist/provider/openai.d.ts +54 -0
- package/dist/provider/openai.js +274 -0
- package/dist/provider/qwen.d.ts +19 -0
- package/dist/provider/qwen.js +30 -0
- package/dist/provider/resilient.d.ts +46 -0
- package/dist/provider/resilient.js +181 -0
- package/dist/provider/retry.d.ts +16 -0
- package/dist/provider/retry.js +78 -0
- package/dist/provider/router.d.ts +68 -0
- package/dist/provider/router.js +145 -0
- package/dist/provider/tool-args-recovery.d.ts +36 -0
- package/dist/provider/tool-args-recovery.js +91 -0
- package/dist/provider/user-id.d.ts +13 -0
- package/dist/provider/user-id.js +53 -0
- package/dist/provider/zhipu.d.ts +19 -0
- package/dist/provider/zhipu.js +32 -0
- package/dist/registry/agent.registry.d.ts +57 -0
- package/dist/registry/agent.registry.js +224 -0
- package/dist/registry/base.d.ts +54 -0
- package/dist/registry/base.js +99 -0
- package/dist/registry/channel.registry.d.ts +53 -0
- package/dist/registry/channel.registry.js +87 -0
- package/dist/registry/index.d.ts +9 -0
- package/dist/registry/index.js +10 -0
- package/dist/registry/mcp.registry.d.ts +2 -0
- package/dist/registry/mcp.registry.js +2 -0
- package/dist/registry/plugin.registry.d.ts +33 -0
- package/dist/registry/plugin.registry.js +66 -0
- package/dist/registry/provider.registry.d.ts +51 -0
- package/dist/registry/provider.registry.js +104 -0
- package/dist/registry/skill.registry.d.ts +33 -0
- package/dist/registry/skill.registry.js +95 -0
- package/dist/registry/tool.registry.d.ts +68 -0
- package/dist/registry/tool.registry.js +185 -0
- package/dist/repair/loop-guard.d.ts +98 -0
- package/dist/repair/loop-guard.js +217 -0
- package/dist/repair/scavenge.d.ts +19 -0
- package/dist/repair/scavenge.js +81 -0
- package/dist/repair/storm.d.ts +7 -0
- package/dist/repair/storm.js +7 -0
- package/dist/rollback/index.d.ts +5 -0
- package/dist/rollback/index.js +4 -0
- package/dist/rollback/rollback-tool.d.ts +13 -0
- package/dist/rollback/rollback-tool.js +167 -0
- package/dist/rollback/turn-recorder.d.ts +37 -0
- package/dist/rollback/turn-recorder.js +183 -0
- package/dist/rollback/turn-store.d.ts +29 -0
- package/dist/rollback/turn-store.js +114 -0
- package/dist/rollback/types.d.ts +51 -0
- package/dist/rollback/types.js +9 -0
- package/dist/runtime/config-center.d.ts +92 -0
- package/dist/runtime/config-center.js +467 -0
- package/dist/runtime/config-schema.d.ts +201 -0
- package/dist/runtime/config-schema.js +2 -0
- package/dist/runtime/defaults.d.ts +3 -0
- package/dist/runtime/defaults.js +146 -0
- package/dist/schedule/cron.d.ts +24 -0
- package/dist/schedule/cron.js +145 -0
- package/dist/schedule/index.d.ts +6 -0
- package/dist/schedule/index.js +4 -0
- package/dist/schedule/persistence.d.ts +33 -0
- package/dist/schedule/persistence.js +106 -0
- package/dist/schedule/scheduler.d.ts +85 -0
- package/dist/schedule/scheduler.js +630 -0
- package/dist/schedule/types.d.ts +185 -0
- package/dist/schedule/types.js +2 -0
- package/dist/setup/config.d.ts +189 -0
- package/dist/setup/config.js +253 -0
- package/dist/setup/index.d.ts +3 -0
- package/dist/setup/index.js +3 -0
- package/dist/setup/model-defaults.d.ts +13 -0
- package/dist/setup/model-defaults.js +87 -0
- package/dist/setup/persona-bootstrap.d.ts +42 -0
- package/dist/setup/persona-bootstrap.js +379 -0
- package/dist/setup/wizard.d.ts +32 -0
- package/dist/setup/wizard.js +384 -0
- package/dist/skills/index.d.ts +4 -0
- package/dist/skills/index.js +4 -0
- package/dist/skills/loader.d.ts +12 -0
- package/dist/skills/loader.js +83 -0
- package/dist/skills/registry.d.ts +2 -0
- package/dist/skills/registry.js +2 -0
- package/dist/skills/skill-tool.d.ts +20 -0
- package/dist/skills/skill-tool.js +49 -0
- package/dist/tools/archive.d.ts +17 -0
- package/dist/tools/archive.js +131 -0
- package/dist/tools/ask-user.d.ts +9 -0
- package/dist/tools/ask-user.js +62 -0
- package/dist/tools/background-registry.d.ts +45 -0
- package/dist/tools/background-registry.js +164 -0
- package/dist/tools/bash.d.ts +56 -0
- package/dist/tools/bash.js +391 -0
- package/dist/tools/bundle-registry.d.ts +42 -0
- package/dist/tools/bundle-registry.js +239 -0
- package/dist/tools/bundle-tools.d.ts +11 -0
- package/dist/tools/bundle-tools.js +168 -0
- package/dist/tools/channel-info.d.ts +5 -0
- package/dist/tools/channel-info.js +38 -0
- package/dist/tools/compression.d.ts +7 -0
- package/dist/tools/compression.js +21 -0
- package/dist/tools/config.d.ts +23 -0
- package/dist/tools/config.js +255 -0
- package/dist/tools/db-query.d.ts +12 -0
- package/dist/tools/db-query.js +107 -0
- package/dist/tools/diagnostics.d.ts +30 -0
- package/dist/tools/diagnostics.js +111 -0
- package/dist/tools/diff-channel.d.ts +9 -0
- package/dist/tools/diff-channel.js +17 -0
- package/dist/tools/diff-files.d.ts +17 -0
- package/dist/tools/diff-files.js +88 -0
- package/dist/tools/disk-usage.d.ts +34 -0
- package/dist/tools/disk-usage.js +258 -0
- package/dist/tools/edit.d.ts +30 -0
- package/dist/tools/edit.js +235 -0
- package/dist/tools/executor.d.ts +32 -0
- package/dist/tools/executor.js +66 -0
- package/dist/tools/file-tracker.d.ts +20 -0
- package/dist/tools/file-tracker.js +44 -0
- package/dist/tools/filtered-registry.d.ts +29 -0
- package/dist/tools/filtered-registry.js +50 -0
- package/dist/tools/flow.d.ts +10 -0
- package/dist/tools/flow.js +180 -0
- package/dist/tools/git-tool.d.ts +24 -0
- package/dist/tools/git-tool.js +113 -0
- package/dist/tools/glob.d.ts +29 -0
- package/dist/tools/glob.js +152 -0
- package/dist/tools/grep.d.ts +14 -0
- package/dist/tools/grep.js +325 -0
- package/dist/tools/http-request.d.ts +14 -0
- package/dist/tools/http-request.js +126 -0
- package/dist/tools/index.d.ts +43 -0
- package/dist/tools/index.js +76 -0
- package/dist/tools/injection-filter.d.ts +6 -0
- package/dist/tools/injection-filter.js +71 -0
- package/dist/tools/insert.d.ts +13 -0
- package/dist/tools/insert.js +61 -0
- package/dist/tools/interface.d.ts +30 -0
- package/dist/tools/interface.js +2 -0
- package/dist/tools/json-edit.d.ts +15 -0
- package/dist/tools/json-edit.js +122 -0
- package/dist/tools/multi-edit.d.ts +9 -0
- package/dist/tools/multi-edit.js +146 -0
- package/dist/tools/path-sandbox.d.ts +14 -0
- package/dist/tools/path-sandbox.js +60 -0
- package/dist/tools/process-tools.d.ts +15 -0
- package/dist/tools/process-tools.js +95 -0
- package/dist/tools/python-bridge/bridge.d.ts +24 -0
- package/dist/tools/python-bridge/bridge.js +39 -0
- package/dist/tools/python-bridge/executor.d.ts +6 -0
- package/dist/tools/python-bridge/executor.js +69 -0
- package/dist/tools/python-bridge/index.d.ts +5 -0
- package/dist/tools/python-bridge/index.js +4 -0
- package/dist/tools/python-bridge/parser.d.ts +21 -0
- package/dist/tools/python-bridge/parser.js +258 -0
- package/dist/tools/read.d.ts +16 -0
- package/dist/tools/read.js +276 -0
- package/dist/tools/registry.d.ts +2 -0
- package/dist/tools/registry.js +2 -0
- package/dist/tools/restart.d.ts +10 -0
- package/dist/tools/restart.js +46 -0
- package/dist/tools/result-buffer.d.ts +66 -0
- package/dist/tools/result-buffer.js +146 -0
- package/dist/tools/runtime-control.d.ts +163 -0
- package/dist/tools/runtime-control.js +1780 -0
- package/dist/tools/symbol-references.d.ts +5 -0
- package/dist/tools/symbol-references.js +331 -0
- package/dist/tools/system-info.d.ts +3 -0
- package/dist/tools/system-info.js +55 -0
- package/dist/tools/write.d.ts +18 -0
- package/dist/tools/write.js +118 -0
- package/dist/tools/xref/index.d.ts +25 -0
- package/dist/tools/xref/index.js +25 -0
- package/dist/tools/xref/manager.d.ts +85 -0
- package/dist/tools/xref/manager.js +948 -0
- package/dist/tools/xref/parser.d.ts +34 -0
- package/dist/tools/xref/parser.js +64 -0
- package/dist/tools/xref/regex-parser.d.ts +26 -0
- package/dist/tools/xref/regex-parser.js +446 -0
- package/dist/tools/xref/schema.d.ts +104 -0
- package/dist/tools/xref/schema.js +68 -0
- package/dist/tools/xref/ts-parser.d.ts +20 -0
- package/dist/tools/xref/ts-parser.js +403 -0
- package/dist/tools/xref/xref-build.d.ts +20 -0
- package/dist/tools/xref/xref-build.js +128 -0
- package/dist/tools/xref/xref-graph.d.ts +24 -0
- package/dist/tools/xref/xref-graph.js +88 -0
- package/dist/tools/xref/xref-query.d.ts +30 -0
- package/dist/tools/xref/xref-query.js +123 -0
- package/dist/types.d.ts +217 -0
- package/dist/types.js +2 -0
- package/dist/ui/assistant-message.d.ts +7 -0
- package/dist/ui/assistant-message.js +18 -0
- package/dist/ui/chat-log.d.ts +52 -0
- package/dist/ui/chat-log.js +246 -0
- package/dist/ui/command-registry.d.ts +73 -0
- package/dist/ui/command-registry.js +838 -0
- package/dist/ui/diff-component.d.ts +14 -0
- package/dist/ui/diff-component.js +42 -0
- package/dist/ui/hyperlink-markdown.d.ts +10 -0
- package/dist/ui/hyperlink-markdown.js +21 -0
- package/dist/ui/markdown-message.d.ts +10 -0
- package/dist/ui/markdown-message.js +16 -0
- package/dist/ui/osc8-hyperlinks.d.ts +4 -0
- package/dist/ui/osc8-hyperlinks.js +142 -0
- package/dist/ui/pi-tui-editor.d.ts +35 -0
- package/dist/ui/pi-tui-editor.js +79 -0
- package/dist/ui/slash-commands.d.ts +16 -0
- package/dist/ui/slash-commands.js +29 -0
- package/dist/ui/slash-panel.d.ts +54 -0
- package/dist/ui/slash-panel.js +199 -0
- package/dist/ui/theme.d.ts +120 -0
- package/dist/ui/theme.js +154 -0
- package/dist/ui/tool-display.d.ts +13 -0
- package/dist/ui/tool-display.js +85 -0
- package/dist/ui/tool-execution.d.ts +22 -0
- package/dist/ui/tool-execution.js +87 -0
- package/dist/ui/tui-formatters.d.ts +2 -0
- package/dist/ui/tui-formatters.js +145 -0
- package/dist/ui/user-message.d.ts +5 -0
- package/dist/ui/user-message.js +11 -0
- package/dist/update/check.d.ts +8 -0
- package/dist/update/check.js +28 -0
- package/dist/update/config.d.ts +6 -0
- package/dist/update/config.js +18 -0
- package/dist/update/download.d.ts +3 -0
- package/dist/update/download.js +27 -0
- package/dist/update/index.d.ts +6 -0
- package/dist/update/index.js +5 -0
- package/dist/update/install.d.ts +3 -0
- package/dist/update/install.js +33 -0
- package/dist/update/types.d.ts +16 -0
- package/dist/update/types.js +2 -0
- package/dist/utils/diff.d.ts +9 -0
- package/dist/utils/diff.js +45 -0
- package/dist/utils/misc.d.ts +12 -0
- package/dist/utils/misc.js +34 -0
- package/dist/world-engine/agent.d.ts +41 -0
- package/dist/world-engine/agent.js +385 -0
- package/dist/world-engine/index.d.ts +45 -0
- package/dist/world-engine/index.js +160 -0
- package/dist/world-engine/sim.d.ts +14 -0
- package/dist/world-engine/sim.js +120 -0
- package/dist/world-engine/store.d.ts +110 -0
- package/dist/world-engine/store.js +519 -0
- package/dist/world-engine/ticker.d.ts +37 -0
- package/dist/world-engine/ticker.js +214 -0
- package/dist/world-engine/tools.d.ts +6 -0
- package/dist/world-engine/tools.js +380 -0
- package/dist/world-engine/types.d.ts +202 -0
- package/dist/world-engine/types.js +56 -0
- package/docs/api.md +180 -0
- package/docs/architecture.md +206 -0
- package/docs/diagnostics/2026-06-08-config-prompt-guidance.md +67 -0
- package/docs/superpowers/plans/2026-06-08-global-bootstrap-mode.md +89 -0
- package/docs/superpowers/specs/2026-06-08-global-bootstrap-mode-design.md +174 -0
- package/docs/user-guide.md +226 -0
- package/package.json +63 -0
- package/plugins/example-greeter/index.js +55 -0
- package/plugins/example-greeter/plugin.json +8 -0
- package/pnpm-workspace.yaml +5 -0
- package/provider_arch.md +179 -0
- package/start-webui.sh +27 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/webui-channel-design.md +789 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// SpecFlow — 需求规格 → 执行 → 验证 Flow
|
|
3
|
+
// ============================================================
|
|
4
|
+
//
|
|
5
|
+
// 三阶段:
|
|
6
|
+
// 1. define — 一份提示词,同时写出 spec.md + tasks.md + checklist.md
|
|
7
|
+
// 2. executing_tasks — 逐条解析 tasks.md 的 - [ ],注入 → 标记 [x] → 推进
|
|
8
|
+
// 3. executing_checklist — 逐条解析 checklist.md 的 - [ ],注入 → 标记 [x] → 推进
|
|
9
|
+
//
|
|
10
|
+
// Guard 通过解析文件中的 [ ]/[x] 状态判断是否全部完成。
|
|
11
|
+
// ============================================================
|
|
12
|
+
import * as fs from 'node:fs';
|
|
13
|
+
import * as path from 'node:path';
|
|
14
|
+
import { MachineRunner } from '../runner.js';
|
|
15
|
+
import { loadPrompt } from '../../prompts/loader.js';
|
|
16
|
+
/** 解析 markdown 中的 - [ ] / - [x] 条目 */
|
|
17
|
+
function parseCheckItems(filePath) {
|
|
18
|
+
try {
|
|
19
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
20
|
+
const items = [];
|
|
21
|
+
for (const line of content.split('\n')) {
|
|
22
|
+
const trimmed = line.trim();
|
|
23
|
+
if (trimmed.startsWith('- [x]') || trimmed.startsWith('- [X]')) {
|
|
24
|
+
items.push({ line: trimmed, checked: true });
|
|
25
|
+
}
|
|
26
|
+
else if (trimmed.startsWith('- [ ]')) {
|
|
27
|
+
items.push({ line: trimmed, checked: false });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return items;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** 获取 spec 目录路径 */
|
|
37
|
+
function specDir(ctx) {
|
|
38
|
+
return ctx.specDir || path.join(process.cwd(), '.agent', 'specs', ctx.task || 'unknown');
|
|
39
|
+
}
|
|
40
|
+
/** 从 tasks/checklist 抽取条目列表(给 getInjection 用) */
|
|
41
|
+
function formatItemList(items) {
|
|
42
|
+
return items.map((it, i) => {
|
|
43
|
+
const marker = it.checked ? '[x]' : '[ ]';
|
|
44
|
+
return `${i + 1}. ${marker} ${it.line.replace(/^-\s*\[.\]\s*/, '')}`;
|
|
45
|
+
}).join('\n');
|
|
46
|
+
}
|
|
47
|
+
/** 找第一个未完成的条目 */
|
|
48
|
+
function firstUnchecked(items) {
|
|
49
|
+
const item = items.find(it => !it.checked);
|
|
50
|
+
return item ? item.line.replace(/^-\s*\[.\]\s*/, '') : '';
|
|
51
|
+
}
|
|
52
|
+
// ── MachineDef ──────────────────────────────────────────────
|
|
53
|
+
function createSpecMachineDef() {
|
|
54
|
+
return {
|
|
55
|
+
id: 'spec',
|
|
56
|
+
initial: 'define',
|
|
57
|
+
states: {
|
|
58
|
+
define: { label: '撰写文档' },
|
|
59
|
+
executing_tasks: { label: '执行任务' },
|
|
60
|
+
executing_checklist: { label: '验收检查' },
|
|
61
|
+
__completed__: { label: '已完成' },
|
|
62
|
+
},
|
|
63
|
+
transitions: [
|
|
64
|
+
// define → executing_tasks
|
|
65
|
+
{ from: 'define', to: 'executing_tasks', event: 'flow_complete' },
|
|
66
|
+
// executing_tasks → executing_tasks(还有未完成任务)
|
|
67
|
+
{
|
|
68
|
+
from: 'executing_tasks', to: 'executing_tasks', event: 'flow_complete',
|
|
69
|
+
guard: (ctx) => {
|
|
70
|
+
const items = parseCheckItems(path.join(specDir(ctx), 'tasks.md'));
|
|
71
|
+
return { ok: items.some(i => !i.checked), reason: 'All tasks completed — moving to checklist verification.' };
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
// executing_tasks → executing_checklist(全部完成)
|
|
75
|
+
{
|
|
76
|
+
from: 'executing_tasks', to: 'executing_checklist', event: 'flow_complete',
|
|
77
|
+
guard: (ctx) => {
|
|
78
|
+
const items = parseCheckItems(path.join(specDir(ctx), 'tasks.md'));
|
|
79
|
+
return { ok: items.length > 0 && items.every(i => i.checked) };
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
// executing_checklist → executing_checklist(还有未验证项)
|
|
83
|
+
{
|
|
84
|
+
from: 'executing_checklist', to: 'executing_checklist', event: 'flow_complete',
|
|
85
|
+
guard: (ctx) => {
|
|
86
|
+
const items = parseCheckItems(path.join(specDir(ctx), 'checklist.md'));
|
|
87
|
+
return { ok: items.some(i => !i.checked), reason: 'All checklist items verified — flow complete.' };
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
// executing_checklist → __completed__(全部验证通过)
|
|
91
|
+
{
|
|
92
|
+
from: 'executing_checklist', to: '__completed__', event: 'flow_complete',
|
|
93
|
+
guard: (ctx) => {
|
|
94
|
+
const items = parseCheckItems(path.join(specDir(ctx), 'checklist.md'));
|
|
95
|
+
return { ok: items.length > 0 && items.every(i => i.checked) };
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
terminalStates: ['__completed__'],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// ── SpecFlow ─────────────────────────────────────────────────
|
|
103
|
+
export class SpecFlow {
|
|
104
|
+
id = 'spec';
|
|
105
|
+
runner;
|
|
106
|
+
prompts = new Map();
|
|
107
|
+
constructor() {
|
|
108
|
+
this.runner = new MachineRunner(createSpecMachineDef());
|
|
109
|
+
}
|
|
110
|
+
// ── 生命周期 ──────────────────────────────────────────────
|
|
111
|
+
activate(context) {
|
|
112
|
+
const task = context?.task ?? '';
|
|
113
|
+
const dir = path.join(process.cwd(), '.agent', 'specs', task.replace(/[<>:"/\\|?*]/g, '-'));
|
|
114
|
+
this.runner.activate({ task, specDir: dir });
|
|
115
|
+
}
|
|
116
|
+
deactivate() {
|
|
117
|
+
this.runner.deactivate();
|
|
118
|
+
}
|
|
119
|
+
advance(event) {
|
|
120
|
+
return this.runner.advance(event);
|
|
121
|
+
}
|
|
122
|
+
getSnapshot() {
|
|
123
|
+
return this.runner.getSnapshot();
|
|
124
|
+
}
|
|
125
|
+
isComplete() {
|
|
126
|
+
return this.runner.isComplete();
|
|
127
|
+
}
|
|
128
|
+
// ── Zone 5 注入 ───────────────────────────────────────────
|
|
129
|
+
getInjection() {
|
|
130
|
+
const snap = this.runner.getSnapshot();
|
|
131
|
+
if (snap.status !== 'active')
|
|
132
|
+
return null;
|
|
133
|
+
const dir = specDir(snap.context);
|
|
134
|
+
const task = snap.context.task || '';
|
|
135
|
+
switch (snap.currentState) {
|
|
136
|
+
case 'define': {
|
|
137
|
+
const prompt = this.loadPrompt('spec-define')
|
|
138
|
+
.replace(/\{\{task\}\}/g, task)
|
|
139
|
+
.replace(/\{\{specDir\}\}/g, dir);
|
|
140
|
+
return `\n[Spec: 撰写文档]\n${prompt}`;
|
|
141
|
+
}
|
|
142
|
+
case 'executing_tasks': {
|
|
143
|
+
const items = parseCheckItems(path.join(dir, 'tasks.md'));
|
|
144
|
+
const current = firstUnchecked(items);
|
|
145
|
+
const list = formatItemList(items);
|
|
146
|
+
const prompt = this.loadPrompt('spec-executing-tasks')
|
|
147
|
+
.replace(/\{\{task\}\}/g, task)
|
|
148
|
+
.replace(/\{\{item_list\}\}/g, list)
|
|
149
|
+
.replace(/\{\{current_item\}\}/g, current || '(all done)');
|
|
150
|
+
const done = items.filter(i => i.checked).length;
|
|
151
|
+
return `\n[Spec: 执行任务 ${done}/${items.length}]\n${prompt}`;
|
|
152
|
+
}
|
|
153
|
+
case 'executing_checklist': {
|
|
154
|
+
const items = parseCheckItems(path.join(dir, 'checklist.md'));
|
|
155
|
+
const current = firstUnchecked(items);
|
|
156
|
+
const list = formatItemList(items);
|
|
157
|
+
const prompt = this.loadPrompt('spec-executing-checklist')
|
|
158
|
+
.replace(/\{\{task\}\}/g, task)
|
|
159
|
+
.replace(/\{\{item_list\}\}/g, list)
|
|
160
|
+
.replace(/\{\{current_item\}\}/g, current || '(all done)');
|
|
161
|
+
const done = items.filter(i => i.checked).length;
|
|
162
|
+
return `\n[Spec: 验收检查 ${done}/${items.length}]\n${prompt}`;
|
|
163
|
+
}
|
|
164
|
+
default:
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// ── 内部 ──────────────────────────────────────────────────
|
|
169
|
+
loadPrompt(file) {
|
|
170
|
+
if (!this.prompts.has(file)) {
|
|
171
|
+
this.prompts.set(file, loadPrompt(`flows/${file}`));
|
|
172
|
+
}
|
|
173
|
+
return this.prompts.get(file);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=spec.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MachineContext, MachineSnapshot, AdvanceResult } from '../types.js';
|
|
2
|
+
import { MachineRunner } from '../runner.js';
|
|
3
|
+
import type { FlowController } from './types.js';
|
|
4
|
+
interface TodoStep {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class TodoFlow implements FlowController {
|
|
9
|
+
readonly id = "todo";
|
|
10
|
+
readonly runner: MachineRunner;
|
|
11
|
+
private planningPrompt;
|
|
12
|
+
private executionPromptTemplate;
|
|
13
|
+
private stepCounter;
|
|
14
|
+
constructor();
|
|
15
|
+
activate(context?: MachineContext): void;
|
|
16
|
+
deactivate(): void;
|
|
17
|
+
advance(event: string): AdvanceResult;
|
|
18
|
+
getSnapshot(): MachineSnapshot;
|
|
19
|
+
isComplete(): boolean;
|
|
20
|
+
/** 向 TODO 计划添加一个执行步骤(仅在 planning 阶段有效) */
|
|
21
|
+
addItem(description: string): TodoStep;
|
|
22
|
+
/** Zone 5 注入文本 */
|
|
23
|
+
getInjection(): string | null;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=todo.d.ts.map
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// TodoFlow — 任务拆分与逐步执行 Flow
|
|
3
|
+
// ============================================================
|
|
4
|
+
//
|
|
5
|
+
// 基于 MachineDef 的两阶段动态 Flow:
|
|
6
|
+
// 1. Planning — 模型调用 flow_add 添加步骤(ctx 突变)
|
|
7
|
+
// → flow_complete(guard: steps.length > 0)进入执行阶段
|
|
8
|
+
// 2. Executing — 模型逐步完成每步
|
|
9
|
+
// → flow_complete(guard: hasMoreSteps)推进 stepIndex
|
|
10
|
+
// → flow_complete(guard: isLastStep)进入终端
|
|
11
|
+
//
|
|
12
|
+
// 关键设计:
|
|
13
|
+
// - flow_add 是 context 突变,不触发状态转移(绕过 guard)
|
|
14
|
+
// - flow_complete 是事件,触发 guard → 转移
|
|
15
|
+
// - Guard 失败时 reason 通过工具返回值反馈给模型
|
|
16
|
+
// ============================================================
|
|
17
|
+
import { MachineRunner } from '../runner.js';
|
|
18
|
+
import { loadPrompt } from '../../prompts/loader.js';
|
|
19
|
+
// ── MachineDef ──────────────────────────────────────────────
|
|
20
|
+
/**
|
|
21
|
+
* TODO 状态机定义。
|
|
22
|
+
*
|
|
23
|
+
* States: planning | executing | __completed__
|
|
24
|
+
* Initial: planning
|
|
25
|
+
* Terminal: __completed__
|
|
26
|
+
*
|
|
27
|
+
* 转移表(按优先级排列——先匹配的 guard 通过即执行):
|
|
28
|
+
* 1. planning + complete → executing (guard: steps.length > 0)
|
|
29
|
+
* 2. planning + complete → __completed__ (guard: steps.length === 0)
|
|
30
|
+
* 3. executing + complete → executing (guard: hasMoreSteps, onTransition: stepIndex++)
|
|
31
|
+
* 4. executing + complete → __completed__ (guard: isLastStep)
|
|
32
|
+
*/
|
|
33
|
+
function createTodoMachineDef() {
|
|
34
|
+
return {
|
|
35
|
+
id: 'todo',
|
|
36
|
+
initial: 'planning',
|
|
37
|
+
states: {
|
|
38
|
+
planning: { label: '规划中' },
|
|
39
|
+
executing: { label: '执行中' },
|
|
40
|
+
__completed__: { label: '已完成' },
|
|
41
|
+
},
|
|
42
|
+
transitions: [
|
|
43
|
+
// planning → executing:必须有步骤
|
|
44
|
+
{
|
|
45
|
+
from: 'planning',
|
|
46
|
+
to: 'executing',
|
|
47
|
+
event: 'flow_complete',
|
|
48
|
+
guard: (ctx) => {
|
|
49
|
+
const steps = ctx.steps ?? [];
|
|
50
|
+
if (steps.length === 0) {
|
|
51
|
+
return { ok: false, reason: 'No steps defined. Use flow_add to add steps before completing planning.' };
|
|
52
|
+
}
|
|
53
|
+
return { ok: true };
|
|
54
|
+
},
|
|
55
|
+
onTransition: (ctx) => {
|
|
56
|
+
// 重置 stepIndex 到第 0 步
|
|
57
|
+
ctx.stepIndex = 0;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
// planning → __completed__:没有步骤直接结束
|
|
61
|
+
{
|
|
62
|
+
from: 'planning',
|
|
63
|
+
to: '__completed__',
|
|
64
|
+
event: 'flow_complete',
|
|
65
|
+
guard: (ctx) => {
|
|
66
|
+
const steps = ctx.steps ?? [];
|
|
67
|
+
return { ok: steps.length === 0 };
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
// executing → executing:还有更多步骤(self-transition)
|
|
71
|
+
{
|
|
72
|
+
from: 'executing',
|
|
73
|
+
to: 'executing',
|
|
74
|
+
event: 'flow_complete',
|
|
75
|
+
guard: (ctx) => {
|
|
76
|
+
const steps = ctx.steps ?? [];
|
|
77
|
+
const idx = ctx.stepIndex ?? 0;
|
|
78
|
+
if (idx + 1 >= steps.length) {
|
|
79
|
+
return { ok: false, reason: 'This is the last step.' };
|
|
80
|
+
}
|
|
81
|
+
return { ok: true };
|
|
82
|
+
},
|
|
83
|
+
onTransition: (ctx) => {
|
|
84
|
+
ctx.stepIndex = (ctx.stepIndex ?? 0) + 1;
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
// executing → __completed__:最后一步完成
|
|
88
|
+
{
|
|
89
|
+
from: 'executing',
|
|
90
|
+
to: '__completed__',
|
|
91
|
+
event: 'flow_complete',
|
|
92
|
+
guard: (ctx) => {
|
|
93
|
+
const steps = ctx.steps ?? [];
|
|
94
|
+
const idx = ctx.stepIndex ?? 0;
|
|
95
|
+
return { ok: idx + 1 >= steps.length };
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
terminalStates: ['__completed__'],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// ── TodoFlow ─────────────────────────────────────────────────
|
|
103
|
+
export class TodoFlow {
|
|
104
|
+
id = 'todo';
|
|
105
|
+
runner;
|
|
106
|
+
planningPrompt;
|
|
107
|
+
executionPromptTemplate;
|
|
108
|
+
stepCounter = 0;
|
|
109
|
+
constructor() {
|
|
110
|
+
this.planningPrompt = loadPrompt('flows/todo-planning');
|
|
111
|
+
this.executionPromptTemplate = loadPrompt('flows/todo-execution');
|
|
112
|
+
this.runner = new MachineRunner(createTodoMachineDef());
|
|
113
|
+
}
|
|
114
|
+
// ── 生命周期 ──────────────────────────────────────────────
|
|
115
|
+
activate(context) {
|
|
116
|
+
this.stepCounter = 0;
|
|
117
|
+
this.runner.activate({
|
|
118
|
+
task: context?.task ?? '',
|
|
119
|
+
steps: [],
|
|
120
|
+
stepIndex: 0,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
deactivate() {
|
|
124
|
+
this.runner.deactivate();
|
|
125
|
+
}
|
|
126
|
+
advance(event) {
|
|
127
|
+
return this.runner.advance(event);
|
|
128
|
+
}
|
|
129
|
+
getSnapshot() {
|
|
130
|
+
return this.runner.getSnapshot();
|
|
131
|
+
}
|
|
132
|
+
isComplete() {
|
|
133
|
+
return this.runner.isComplete();
|
|
134
|
+
}
|
|
135
|
+
// ── 业务方法 ──────────────────────────────────────────────
|
|
136
|
+
/** 向 TODO 计划添加一个执行步骤(仅在 planning 阶段有效) */
|
|
137
|
+
addItem(description) {
|
|
138
|
+
const snap = this.runner.getSnapshot();
|
|
139
|
+
if (snap.currentState !== 'planning') {
|
|
140
|
+
throw new Error('Cannot add steps outside planning phase');
|
|
141
|
+
}
|
|
142
|
+
this.stepCounter++;
|
|
143
|
+
const step = {
|
|
144
|
+
id: `todo-step-${this.stepCounter}`,
|
|
145
|
+
label: description,
|
|
146
|
+
};
|
|
147
|
+
const steps = [...(snap.context.steps ?? []), step];
|
|
148
|
+
this.runner.updateContext({ steps });
|
|
149
|
+
return step;
|
|
150
|
+
}
|
|
151
|
+
/** Zone 5 注入文本 */
|
|
152
|
+
getInjection() {
|
|
153
|
+
const snap = this.runner.getSnapshot();
|
|
154
|
+
if (snap.status !== 'active')
|
|
155
|
+
return null;
|
|
156
|
+
if (snap.currentState === 'planning') {
|
|
157
|
+
return this.planningPrompt
|
|
158
|
+
.replace(/\{\{task\}\}/g, snap.context.task || '(no task provided)');
|
|
159
|
+
}
|
|
160
|
+
if (snap.currentState === 'executing') {
|
|
161
|
+
const steps = snap.context.steps ?? [];
|
|
162
|
+
const idx = snap.context.stepIndex ?? 0;
|
|
163
|
+
const step = steps[idx];
|
|
164
|
+
if (!step)
|
|
165
|
+
return null;
|
|
166
|
+
return this.executionPromptTemplate
|
|
167
|
+
.replace(/\{\{task\}\}/g, snap.context.task || '')
|
|
168
|
+
.replace(/\{\{current\}\}/g, String(idx + 1))
|
|
169
|
+
.replace(/\{\{total\}\}/g, String(steps.length))
|
|
170
|
+
.replace(/\{\{description\}\}/g, step.label);
|
|
171
|
+
}
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=todo.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Tool } from '../../tools/interface.js';
|
|
2
|
+
import type { MachineRegistry } from '../registry.js';
|
|
3
|
+
/** 判断给定工具名是否为 Flow 框架工具 */
|
|
4
|
+
export declare function isFlowTool(name: string): boolean;
|
|
5
|
+
export declare function createCompleteFlowStepTool(registry: MachineRegistry): Tool;
|
|
6
|
+
export declare function createActivateTodoTool(registry: MachineRegistry): Tool;
|
|
7
|
+
export declare function createAddTodoStepTool(registry: MachineRegistry): Tool;
|
|
8
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Flow Tools — 流程控制工具
|
|
3
|
+
// ============================================================
|
|
4
|
+
//
|
|
5
|
+
// complete_flow_step — 完成当前步骤,推进状态机(触发 guard 检查)
|
|
6
|
+
// activate_todo — 激活 TODO 模式,开始任务拆分
|
|
7
|
+
// add_todo_step — 向 TODO Flow 添加执行步骤(ctx 突变,非转移)
|
|
8
|
+
//
|
|
9
|
+
// Flow 工具不记入对话历史——状态由 Zone 5 注入体现。
|
|
10
|
+
// ============================================================
|
|
11
|
+
/** Flow 框架工具名称集合 — 这些工具不记入对话历史 */
|
|
12
|
+
const FLOW_TOOL_NAMES = new Set([
|
|
13
|
+
'complete_flow_step',
|
|
14
|
+
'activate_todo',
|
|
15
|
+
'add_todo_step',
|
|
16
|
+
]);
|
|
17
|
+
/** 判断给定工具名是否为 Flow 框架工具 */
|
|
18
|
+
export function isFlowTool(name) {
|
|
19
|
+
return FLOW_TOOL_NAMES.has(name);
|
|
20
|
+
}
|
|
21
|
+
// ── complete_flow_step ───────────────────────────────────────
|
|
22
|
+
export function createCompleteFlowStepTool(registry) {
|
|
23
|
+
return {
|
|
24
|
+
name: 'complete_flow_step',
|
|
25
|
+
description: 'Complete the current flow step and advance to the next one. Call this when you have finished the current step\'s task. In TODO planning phase, this finishes planning and starts execution. In execution phase or bootstrap, this advances to the next step. If this is the final step, the flow ends.',
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {},
|
|
29
|
+
required: [],
|
|
30
|
+
},
|
|
31
|
+
async execute(_args) {
|
|
32
|
+
const active = registry.getActive();
|
|
33
|
+
if (!active) {
|
|
34
|
+
return 'No active flow. Nothing to complete.';
|
|
35
|
+
}
|
|
36
|
+
const snap = active.getSnapshot();
|
|
37
|
+
const isTodoPlanning = active.id === 'todo' && snap.currentState === 'planning';
|
|
38
|
+
const steps = snap.context.steps ?? [];
|
|
39
|
+
const idx = snap.context.stepIndex ?? 0;
|
|
40
|
+
const currentStep = steps[idx];
|
|
41
|
+
const stepLabel = currentStep
|
|
42
|
+
? `"${currentStep.id}" (step ${idx + 1}/${steps.length})`
|
|
43
|
+
: isTodoPlanning
|
|
44
|
+
? 'planning phase'
|
|
45
|
+
: `step ${idx + 1}`;
|
|
46
|
+
if (isTodoPlanning) {
|
|
47
|
+
const stepCount = steps.length;
|
|
48
|
+
if (stepCount === 0) {
|
|
49
|
+
return 'Planning acknowledged. No steps defined — flow will end.';
|
|
50
|
+
}
|
|
51
|
+
return `Planning acknowledged. ${stepCount} steps defined, transitioning to execution.`;
|
|
52
|
+
}
|
|
53
|
+
return `Step ${stepLabel} acknowledged. Advancing...`;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// ── activate_todo ────────────────────────────────────────────
|
|
58
|
+
export function createActivateTodoTool(registry) {
|
|
59
|
+
return {
|
|
60
|
+
name: 'activate_todo',
|
|
61
|
+
description: 'Activate TODO mode to break down a complex task into ordered steps. After activation, use add_todo_step to add each step, then call complete_flow_step to start execution. The framework will guide you through one step at a time.',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
task: {
|
|
66
|
+
type: 'string',
|
|
67
|
+
description: 'A concise description of the overall task to be completed.',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
required: ['task'],
|
|
71
|
+
},
|
|
72
|
+
async execute(args) {
|
|
73
|
+
const task = args.task ?? '';
|
|
74
|
+
const todoFlow = registry.get('todo');
|
|
75
|
+
if (!todoFlow) {
|
|
76
|
+
return 'TODO flow is not registered. Cannot activate.';
|
|
77
|
+
}
|
|
78
|
+
// 激活 TODO Flow(带任务上下文),自动停用当前活跃 Flow
|
|
79
|
+
registry.activate('todo', { task });
|
|
80
|
+
return `TODO mode activated for task: "${task}". Break down the task into steps using add_todo_step, then call complete_flow_step to start execution.`;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// ── add_todo_step ────────────────────────────────────────────
|
|
85
|
+
export function createAddTodoStepTool(registry) {
|
|
86
|
+
return {
|
|
87
|
+
name: 'add_todo_step',
|
|
88
|
+
description: 'Add a step to the current TODO flow. Only works when TODO mode is active and in the planning phase. Each step should be a concrete, verifiable action.',
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
description: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
description: 'A clear, actionable description of this step. Include what constitutes success.',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: ['description'],
|
|
98
|
+
},
|
|
99
|
+
async execute(args) {
|
|
100
|
+
const active = registry.getActive();
|
|
101
|
+
if (!active || active.id !== 'todo') {
|
|
102
|
+
return 'TODO mode is not active. Use activate_todo first.';
|
|
103
|
+
}
|
|
104
|
+
const todoFlow = registry.get('todo');
|
|
105
|
+
if (!todoFlow) {
|
|
106
|
+
return 'TODO flow is not registered.';
|
|
107
|
+
}
|
|
108
|
+
const snap = todoFlow.getSnapshot();
|
|
109
|
+
if (snap.currentState !== 'planning') {
|
|
110
|
+
return 'Cannot add steps — TODO is already in execution phase.';
|
|
111
|
+
}
|
|
112
|
+
const description = args.description ?? '';
|
|
113
|
+
const step = todoFlow.addStep(description);
|
|
114
|
+
const allSteps = snap.context.steps ?? [];
|
|
115
|
+
return `Step #${allSteps.length + 1} added: "${step.prompt}". Total: ${allSteps.length + 1} steps. Add more steps or call complete_flow_step to start execution.`;
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MachineContext, MachineSnapshot, AdvanceResult } from '../types.js';
|
|
2
|
+
import type { MachineRunner } from '../runner.js';
|
|
3
|
+
/**
|
|
4
|
+
* FlowController — 所有 Flow 的统一接口。
|
|
5
|
+
*
|
|
6
|
+
* 每个 Flow 内部包装一个 MachineRunner 做状态管理,
|
|
7
|
+
* 对外提供 getInjection() 给 Zone 5 上下文注入。
|
|
8
|
+
*/
|
|
9
|
+
export interface FlowController {
|
|
10
|
+
/** Flow 唯一标识(与 MachineDef.id 一致) */
|
|
11
|
+
readonly id: string;
|
|
12
|
+
/** 内部状态机 */
|
|
13
|
+
readonly runner: MachineRunner;
|
|
14
|
+
/** 激活 Flow */
|
|
15
|
+
activate(context?: MachineContext): void;
|
|
16
|
+
/** 停用 Flow */
|
|
17
|
+
deactivate(): void;
|
|
18
|
+
/** 通过事件推进状态机(委托给 runner.advance) */
|
|
19
|
+
advance(event: string): AdvanceResult;
|
|
20
|
+
/** 结构化快照(委托给 runner.getSnapshot) */
|
|
21
|
+
getSnapshot(): MachineSnapshot;
|
|
22
|
+
/** Zone 5 注入文本(当前步骤的提示词) */
|
|
23
|
+
getInjection(): string | null;
|
|
24
|
+
/** 是否已完成 */
|
|
25
|
+
isComplete(): boolean;
|
|
26
|
+
/** 向 Flow 添加定义项(仅 definition 阶段有效,非转移操作)。
|
|
27
|
+
* TODO 模式加执行步骤,plan 模式加计划章节,spec 模式不需要。 */
|
|
28
|
+
addItem?(description: string): {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Flow Types — Flow 层类型定义
|
|
3
|
+
// ============================================================
|
|
4
|
+
//
|
|
5
|
+
// 扩展 machine 层的通用类型,添加 Flow 特有的概念:
|
|
6
|
+
// - getInjection() — Zone 5 注入文本
|
|
7
|
+
// - FlowController — 统一的 Flow 接口
|
|
8
|
+
// ============================================================
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { MachineContext, GuardResult, StateDef, TransitionDef, MachineDef, MachineStatus, MachineSnapshot, HistoryEntry, AdvanceResult, } from './types.js';
|
|
2
|
+
export { MachineRunner } from './runner.js';
|
|
3
|
+
export { MachineRegistry } from './registry.js';
|
|
4
|
+
export type { FlowController } from './flows/types.js';
|
|
5
|
+
export { TodoFlow } from './flows/todo.js';
|
|
6
|
+
export { BootstrapFlow } from './flows/bootstrap.js';
|
|
7
|
+
export { SpecFlow } from './flows/spec.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Machine — 桶导出
|
|
3
|
+
// ============================================================
|
|
4
|
+
export { MachineRunner } from './runner.js';
|
|
5
|
+
export { MachineRegistry } from './registry.js';
|
|
6
|
+
export { TodoFlow } from './flows/todo.js';
|
|
7
|
+
export { BootstrapFlow } from './flows/bootstrap.js';
|
|
8
|
+
export { SpecFlow } from './flows/spec.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { MachineContext } from './types.js';
|
|
2
|
+
import type { FlowController } from './flows/types.js';
|
|
3
|
+
export declare class MachineRegistry {
|
|
4
|
+
private flows;
|
|
5
|
+
private activeId;
|
|
6
|
+
/** 注册 Flow */
|
|
7
|
+
register(flow: FlowController): void;
|
|
8
|
+
/** 按 id 获取 Flow */
|
|
9
|
+
get(id: string): FlowController | undefined;
|
|
10
|
+
/** 获取当前活跃的 Flow */
|
|
11
|
+
getActive(): FlowController | undefined;
|
|
12
|
+
/** 激活指定 Flow(自动停用当前活跃 Flow) */
|
|
13
|
+
activate(id: string, context?: MachineContext): void;
|
|
14
|
+
/** 停用当前活跃 Flow */
|
|
15
|
+
deactivate(): void;
|
|
16
|
+
/**
|
|
17
|
+
* 步骤完成回调。
|
|
18
|
+
*
|
|
19
|
+
* 调用活跃 Flow 的 advance('flow_complete')。
|
|
20
|
+
* 如果转移结果 isTerminal,停用该 Flow。
|
|
21
|
+
*
|
|
22
|
+
* @deprecated 请使用 onAdvanceSucceeded — flow_complete 工具内部已调用 advance,
|
|
23
|
+
* orchestrator loop 只需检查结果后调用 onAdvanceSucceeded 做清理。
|
|
24
|
+
*/
|
|
25
|
+
onStepComplete(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* 标记一次成功的 advance 的后续处理。
|
|
28
|
+
*
|
|
29
|
+
* flow_complete 工具内部已调用 advance(),
|
|
30
|
+
* 这里只做 post-advance 清理(terminal → deactivate)。
|
|
31
|
+
*/
|
|
32
|
+
onAdvanceSucceeded(flowId: string, isTerminal: boolean): void;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=registry.d.ts.map
|