@oni.bot/core 1.0.0 → 1.0.2
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/CHANGELOG.md +20 -0
- package/SECURITY.md +2 -2
- package/dist/agents/context.d.ts +0 -2
- package/dist/agents/context.d.ts.map +1 -1
- package/dist/agents/context.js +1 -3
- package/dist/agents/context.js.map +1 -1
- package/dist/agents/define-agent.d.ts.map +1 -1
- package/dist/agents/define-agent.js +92 -39
- package/dist/agents/define-agent.js.map +1 -1
- package/dist/agents/functional-agent.d.ts.map +1 -1
- package/dist/agents/functional-agent.js +0 -7
- package/dist/agents/functional-agent.js.map +1 -1
- package/dist/agents/types.d.ts +0 -2
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/checkpointers/postgres.js +4 -4
- package/dist/checkpointers/postgres.js.map +1 -1
- package/dist/checkpointers/sqlite.js +4 -4
- package/dist/checkpointers/sqlite.js.map +1 -1
- package/dist/cli/router.js +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +23 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/context.d.ts +20 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/coordination/request-reply.d.ts +1 -0
- package/dist/coordination/request-reply.d.ts.map +1 -1
- package/dist/coordination/request-reply.js +13 -1
- package/dist/coordination/request-reply.js.map +1 -1
- package/dist/graph.d.ts.map +1 -1
- package/dist/graph.js +17 -2
- package/dist/graph.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/client.js +1 -1
- package/dist/pregel.d.ts +2 -0
- package/dist/pregel.d.ts.map +1 -1
- package/dist/pregel.js +415 -341
- package/dist/pregel.js.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +28 -5
- package/dist/store/index.js.map +1 -1
- package/dist/streaming.d.ts +5 -2
- package/dist/streaming.d.ts.map +1 -1
- package/dist/streaming.js +9 -8
- package/dist/streaming.js.map +1 -1
- package/dist/swarm/graph.d.ts +1 -0
- package/dist/swarm/graph.d.ts.map +1 -1
- package/dist/swarm/graph.js +162 -40
- package/dist/swarm/graph.js.map +1 -1
- package/dist/swarm/pool.d.ts.map +1 -1
- package/dist/swarm/pool.js +12 -4
- package/dist/swarm/pool.js.map +1 -1
- package/dist/tools/define.d.ts.map +1 -1
- package/dist/tools/define.js +1 -0
- package/dist/tools/define.js.map +1 -1
- package/dist/tools/types.d.ts +2 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/oni-code/agent-registry.d.ts +0 -73
- package/dist/oni-code/agent-registry.d.ts.map +0 -1
- package/dist/oni-code/agent-registry.js +0 -151
- package/dist/oni-code/agent-registry.js.map +0 -1
- package/dist/oni-code/bin.d.ts +0 -18
- package/dist/oni-code/bin.d.ts.map +0 -1
- package/dist/oni-code/bin.js +0 -78
- package/dist/oni-code/bin.js.map +0 -1
- package/dist/oni-code/change-tracking.d.ts +0 -28
- package/dist/oni-code/change-tracking.d.ts.map +0 -1
- package/dist/oni-code/change-tracking.js +0 -77
- package/dist/oni-code/change-tracking.js.map +0 -1
- package/dist/oni-code/cli.d.ts +0 -6
- package/dist/oni-code/cli.d.ts.map +0 -1
- package/dist/oni-code/cli.js +0 -30
- package/dist/oni-code/cli.js.map +0 -1
- package/dist/oni-code/conductor.d.ts +0 -203
- package/dist/oni-code/conductor.d.ts.map +0 -1
- package/dist/oni-code/conductor.js +0 -1547
- package/dist/oni-code/conductor.js.map +0 -1
- package/dist/oni-code/config.d.ts +0 -130
- package/dist/oni-code/config.d.ts.map +0 -1
- package/dist/oni-code/config.js +0 -264
- package/dist/oni-code/config.js.map +0 -1
- package/dist/oni-code/context-files.d.ts +0 -22
- package/dist/oni-code/context-files.d.ts.map +0 -1
- package/dist/oni-code/context-files.js +0 -156
- package/dist/oni-code/context-files.js.map +0 -1
- package/dist/oni-code/cron/humanize.d.ts +0 -26
- package/dist/oni-code/cron/humanize.d.ts.map +0 -1
- package/dist/oni-code/cron/humanize.js +0 -83
- package/dist/oni-code/cron/humanize.js.map +0 -1
- package/dist/oni-code/cron/index.d.ts +0 -10
- package/dist/oni-code/cron/index.d.ts.map +0 -1
- package/dist/oni-code/cron/index.js +0 -7
- package/dist/oni-code/cron/index.js.map +0 -1
- package/dist/oni-code/cron/matcher.d.ts +0 -29
- package/dist/oni-code/cron/matcher.d.ts.map +0 -1
- package/dist/oni-code/cron/matcher.js +0 -73
- package/dist/oni-code/cron/matcher.js.map +0 -1
- package/dist/oni-code/cron/parser.d.ts +0 -27
- package/dist/oni-code/cron/parser.d.ts.map +0 -1
- package/dist/oni-code/cron/parser.js +0 -149
- package/dist/oni-code/cron/parser.js.map +0 -1
- package/dist/oni-code/cron/persistence.d.ts +0 -21
- package/dist/oni-code/cron/persistence.d.ts.map +0 -1
- package/dist/oni-code/cron/persistence.js +0 -58
- package/dist/oni-code/cron/persistence.js.map +0 -1
- package/dist/oni-code/cron/scheduler.d.ts +0 -64
- package/dist/oni-code/cron/scheduler.d.ts.map +0 -1
- package/dist/oni-code/cron/scheduler.js +0 -188
- package/dist/oni-code/cron/scheduler.js.map +0 -1
- package/dist/oni-code/cron/store.d.ts +0 -46
- package/dist/oni-code/cron/store.d.ts.map +0 -1
- package/dist/oni-code/cron/store.js +0 -68
- package/dist/oni-code/cron/store.js.map +0 -1
- package/dist/oni-code/env.d.ts +0 -17
- package/dist/oni-code/env.d.ts.map +0 -1
- package/dist/oni-code/env.js +0 -51
- package/dist/oni-code/env.js.map +0 -1
- package/dist/oni-code/file-reader.d.ts +0 -28
- package/dist/oni-code/file-reader.d.ts.map +0 -1
- package/dist/oni-code/file-reader.js +0 -368
- package/dist/oni-code/file-reader.js.map +0 -1
- package/dist/oni-code/file-watcher.d.ts +0 -66
- package/dist/oni-code/file-watcher.d.ts.map +0 -1
- package/dist/oni-code/file-watcher.js +0 -167
- package/dist/oni-code/file-watcher.js.map +0 -1
- package/dist/oni-code/loop-detector.d.ts +0 -64
- package/dist/oni-code/loop-detector.d.ts.map +0 -1
- package/dist/oni-code/loop-detector.js +0 -163
- package/dist/oni-code/loop-detector.js.map +0 -1
- package/dist/oni-code/permissions.d.ts +0 -43
- package/dist/oni-code/permissions.d.ts.map +0 -1
- package/dist/oni-code/permissions.js +0 -98
- package/dist/oni-code/permissions.js.map +0 -1
- package/dist/oni-code/planner.d.ts +0 -26
- package/dist/oni-code/planner.d.ts.map +0 -1
- package/dist/oni-code/planner.js +0 -86
- package/dist/oni-code/planner.js.map +0 -1
- package/dist/oni-code/plugin-loader.d.ts +0 -103
- package/dist/oni-code/plugin-loader.d.ts.map +0 -1
- package/dist/oni-code/plugin-loader.js +0 -171
- package/dist/oni-code/plugin-loader.js.map +0 -1
- package/dist/oni-code/process-tree.d.ts +0 -44
- package/dist/oni-code/process-tree.d.ts.map +0 -1
- package/dist/oni-code/process-tree.js +0 -107
- package/dist/oni-code/process-tree.js.map +0 -1
- package/dist/oni-code/progress-tracker.d.ts +0 -40
- package/dist/oni-code/progress-tracker.d.ts.map +0 -1
- package/dist/oni-code/progress-tracker.js +0 -375
- package/dist/oni-code/progress-tracker.js.map +0 -1
- package/dist/oni-code/scheduler.d.ts +0 -56
- package/dist/oni-code/scheduler.d.ts.map +0 -1
- package/dist/oni-code/scheduler.js +0 -105
- package/dist/oni-code/scheduler.js.map +0 -1
- package/dist/oni-code/session-fork.d.ts +0 -146
- package/dist/oni-code/session-fork.d.ts.map +0 -1
- package/dist/oni-code/session-fork.js +0 -238
- package/dist/oni-code/session-fork.js.map +0 -1
- package/dist/oni-code/session-stats.d.ts +0 -72
- package/dist/oni-code/session-stats.d.ts.map +0 -1
- package/dist/oni-code/session-stats.js +0 -141
- package/dist/oni-code/session-stats.js.map +0 -1
- package/dist/oni-code/session-title.d.ts +0 -25
- package/dist/oni-code/session-title.d.ts.map +0 -1
- package/dist/oni-code/session-title.js +0 -67
- package/dist/oni-code/session-title.js.map +0 -1
- package/dist/oni-code/shell-parser.d.ts +0 -112
- package/dist/oni-code/shell-parser.d.ts.map +0 -1
- package/dist/oni-code/shell-parser.js +0 -657
- package/dist/oni-code/shell-parser.js.map +0 -1
- package/dist/oni-code/summarizer.d.ts +0 -27
- package/dist/oni-code/summarizer.d.ts.map +0 -1
- package/dist/oni-code/summarizer.js +0 -70
- package/dist/oni-code/summarizer.js.map +0 -1
- package/dist/oni-code/swarm-checkpoint.d.ts +0 -52
- package/dist/oni-code/swarm-checkpoint.d.ts.map +0 -1
- package/dist/oni-code/swarm-checkpoint.js +0 -71
- package/dist/oni-code/swarm-checkpoint.js.map +0 -1
- package/dist/oni-code/swarm-runner.d.ts +0 -173
- package/dist/oni-code/swarm-runner.d.ts.map +0 -1
- package/dist/oni-code/swarm-runner.js +0 -873
- package/dist/oni-code/swarm-runner.js.map +0 -1
- package/dist/oni-code/system-prompt.d.ts +0 -13
- package/dist/oni-code/system-prompt.d.ts.map +0 -1
- package/dist/oni-code/system-prompt.js +0 -64
- package/dist/oni-code/system-prompt.js.map +0 -1
- package/dist/oni-code/task-evaluator.d.ts +0 -73
- package/dist/oni-code/task-evaluator.d.ts.map +0 -1
- package/dist/oni-code/task-evaluator.js +0 -172
- package/dist/oni-code/task-evaluator.js.map +0 -1
- package/dist/oni-code/tools/batch.d.ts +0 -12
- package/dist/oni-code/tools/batch.d.ts.map +0 -1
- package/dist/oni-code/tools/batch.js +0 -116
- package/dist/oni-code/tools/batch.js.map +0 -1
- package/dist/oni-code/tools/coding.d.ts +0 -10
- package/dist/oni-code/tools/coding.d.ts.map +0 -1
- package/dist/oni-code/tools/coding.js +0 -557
- package/dist/oni-code/tools/coding.js.map +0 -1
- package/dist/oni-code/tools/cron.d.ts +0 -4
- package/dist/oni-code/tools/cron.d.ts.map +0 -1
- package/dist/oni-code/tools/cron.js +0 -120
- package/dist/oni-code/tools/cron.js.map +0 -1
- package/dist/oni-code/tools/custom.d.ts +0 -43
- package/dist/oni-code/tools/custom.d.ts.map +0 -1
- package/dist/oni-code/tools/custom.js +0 -115
- package/dist/oni-code/tools/custom.js.map +0 -1
- package/dist/oni-code/tools/patch.d.ts +0 -58
- package/dist/oni-code/tools/patch.d.ts.map +0 -1
- package/dist/oni-code/tools/patch.js +0 -247
- package/dist/oni-code/tools/patch.js.map +0 -1
- package/dist/oni-code/tools/plan.d.ts +0 -17
- package/dist/oni-code/tools/plan.d.ts.map +0 -1
- package/dist/oni-code/tools/plan.js +0 -48
- package/dist/oni-code/tools/plan.js.map +0 -1
- package/dist/oni-code/tools/question.d.ts +0 -17
- package/dist/oni-code/tools/question.d.ts.map +0 -1
- package/dist/oni-code/tools/question.js +0 -46
- package/dist/oni-code/tools/question.js.map +0 -1
- package/dist/oni-code/tools/skill.d.ts +0 -36
- package/dist/oni-code/tools/skill.d.ts.map +0 -1
- package/dist/oni-code/tools/skill.js +0 -132
- package/dist/oni-code/tools/skill.js.map +0 -1
- package/dist/oni-code/tools/spawn-agents.d.ts +0 -37
- package/dist/oni-code/tools/spawn-agents.d.ts.map +0 -1
- package/dist/oni-code/tools/spawn-agents.js +0 -91
- package/dist/oni-code/tools/spawn-agents.js.map +0 -1
- package/dist/oni-code/tools/spawn-swarm.d.ts +0 -70
- package/dist/oni-code/tools/spawn-swarm.d.ts.map +0 -1
- package/dist/oni-code/tools/spawn-swarm.js +0 -129
- package/dist/oni-code/tools/spawn-swarm.js.map +0 -1
- package/dist/oni-code/tools/web.d.ts +0 -11
- package/dist/oni-code/tools/web.d.ts.map +0 -1
- package/dist/oni-code/tools/web.js +0 -375
- package/dist/oni-code/tools/web.js.map +0 -1
- package/dist/oni-code/topology-agent-builder.d.ts +0 -22
- package/dist/oni-code/topology-agent-builder.d.ts.map +0 -1
- package/dist/oni-code/topology-agent-builder.js +0 -220
- package/dist/oni-code/topology-agent-builder.js.map +0 -1
- package/dist/oni-code/topology-selector.d.ts +0 -85
- package/dist/oni-code/topology-selector.d.ts.map +0 -1
- package/dist/oni-code/topology-selector.js +0 -338
- package/dist/oni-code/topology-selector.js.map +0 -1
- package/dist/oni-code/ui/App.d.ts +0 -10
- package/dist/oni-code/ui/App.d.ts.map +0 -1
- package/dist/oni-code/ui/App.js +0 -395
- package/dist/oni-code/ui/App.js.map +0 -1
- package/dist/oni-code/ui/FooterPanel.d.ts +0 -16
- package/dist/oni-code/ui/FooterPanel.d.ts.map +0 -1
- package/dist/oni-code/ui/FooterPanel.js +0 -56
- package/dist/oni-code/ui/FooterPanel.js.map +0 -1
- package/dist/oni-code/ui/Header.d.ts +0 -21
- package/dist/oni-code/ui/Header.d.ts.map +0 -1
- package/dist/oni-code/ui/Header.js +0 -105
- package/dist/oni-code/ui/Header.js.map +0 -1
- package/dist/oni-code/ui/InputArea.d.ts +0 -11
- package/dist/oni-code/ui/InputArea.d.ts.map +0 -1
- package/dist/oni-code/ui/InputArea.js +0 -82
- package/dist/oni-code/ui/InputArea.js.map +0 -1
- package/dist/oni-code/ui/MessageBlock.d.ts +0 -11
- package/dist/oni-code/ui/MessageBlock.d.ts.map +0 -1
- package/dist/oni-code/ui/MessageBlock.js +0 -103
- package/dist/oni-code/ui/MessageBlock.js.map +0 -1
- package/dist/oni-code/ui/OutputPane.d.ts +0 -12
- package/dist/oni-code/ui/OutputPane.d.ts.map +0 -1
- package/dist/oni-code/ui/OutputPane.js +0 -8
- package/dist/oni-code/ui/OutputPane.js.map +0 -1
- package/dist/oni-code/ui/PermissionPrompt.d.ts +0 -11
- package/dist/oni-code/ui/PermissionPrompt.d.ts.map +0 -1
- package/dist/oni-code/ui/PermissionPrompt.js +0 -48
- package/dist/oni-code/ui/PermissionPrompt.js.map +0 -1
- package/dist/oni-code/ui/QuestionPrompt.d.ts +0 -8
- package/dist/oni-code/ui/QuestionPrompt.d.ts.map +0 -1
- package/dist/oni-code/ui/QuestionPrompt.js +0 -9
- package/dist/oni-code/ui/QuestionPrompt.js.map +0 -1
- package/dist/oni-code/ui/StatusLine.d.ts +0 -14
- package/dist/oni-code/ui/StatusLine.d.ts.map +0 -1
- package/dist/oni-code/ui/StatusLine.js +0 -23
- package/dist/oni-code/ui/StatusLine.js.map +0 -1
- package/dist/oni-code/ui/SwarmPanel.d.ts +0 -9
- package/dist/oni-code/ui/SwarmPanel.d.ts.map +0 -1
- package/dist/oni-code/ui/SwarmPanel.js +0 -52
- package/dist/oni-code/ui/SwarmPanel.js.map +0 -1
- package/dist/oni-code/ui/ToolCallBlock.d.ts +0 -10
- package/dist/oni-code/ui/ToolCallBlock.d.ts.map +0 -1
- package/dist/oni-code/ui/ToolCallBlock.js +0 -21
- package/dist/oni-code/ui/ToolCallBlock.js.map +0 -1
- package/dist/oni-code/ui/Toolbar.d.ts +0 -8
- package/dist/oni-code/ui/Toolbar.d.ts.map +0 -1
- package/dist/oni-code/ui/Toolbar.js +0 -11
- package/dist/oni-code/ui/Toolbar.js.map +0 -1
- package/dist/oni-code/ui/WelcomeBanner.d.ts +0 -12
- package/dist/oni-code/ui/WelcomeBanner.d.ts.map +0 -1
- package/dist/oni-code/ui/WelcomeBanner.js +0 -24
- package/dist/oni-code/ui/WelcomeBanner.js.map +0 -1
- package/dist/oni-code/ui/activity.d.ts +0 -15
- package/dist/oni-code/ui/activity.d.ts.map +0 -1
- package/dist/oni-code/ui/activity.js +0 -252
- package/dist/oni-code/ui/activity.js.map +0 -1
- package/dist/oni-code/ui/banner.d.ts +0 -16
- package/dist/oni-code/ui/banner.d.ts.map +0 -1
- package/dist/oni-code/ui/banner.js +0 -132
- package/dist/oni-code/ui/banner.js.map +0 -1
- package/dist/oni-code/ui/command-menu.d.ts +0 -7
- package/dist/oni-code/ui/command-menu.d.ts.map +0 -1
- package/dist/oni-code/ui/command-menu.js +0 -20
- package/dist/oni-code/ui/command-menu.js.map +0 -1
- package/dist/oni-code/ui/diff.d.ts +0 -17
- package/dist/oni-code/ui/diff.d.ts.map +0 -1
- package/dist/oni-code/ui/diff.js +0 -37
- package/dist/oni-code/ui/diff.js.map +0 -1
- package/dist/oni-code/ui/format.d.ts +0 -41
- package/dist/oni-code/ui/format.d.ts.map +0 -1
- package/dist/oni-code/ui/format.js +0 -223
- package/dist/oni-code/ui/format.js.map +0 -1
- package/dist/oni-code/ui/input.d.ts +0 -28
- package/dist/oni-code/ui/input.d.ts.map +0 -1
- package/dist/oni-code/ui/input.js +0 -216
- package/dist/oni-code/ui/input.js.map +0 -1
- package/dist/oni-code/ui/insights.d.ts +0 -39
- package/dist/oni-code/ui/insights.d.ts.map +0 -1
- package/dist/oni-code/ui/insights.js +0 -193
- package/dist/oni-code/ui/insights.js.map +0 -1
- package/dist/oni-code/ui/markdown.d.ts +0 -9
- package/dist/oni-code/ui/markdown.d.ts.map +0 -1
- package/dist/oni-code/ui/markdown.js +0 -44
- package/dist/oni-code/ui/markdown.js.map +0 -1
- package/dist/oni-code/ui/panels.d.ts +0 -39
- package/dist/oni-code/ui/panels.d.ts.map +0 -1
- package/dist/oni-code/ui/panels.js +0 -209
- package/dist/oni-code/ui/panels.js.map +0 -1
- package/dist/oni-code/ui/paste.d.ts +0 -17
- package/dist/oni-code/ui/paste.d.ts.map +0 -1
- package/dist/oni-code/ui/paste.js +0 -45
- package/dist/oni-code/ui/paste.js.map +0 -1
- package/dist/oni-code/ui/raw-spinner.d.ts +0 -37
- package/dist/oni-code/ui/raw-spinner.d.ts.map +0 -1
- package/dist/oni-code/ui/raw-spinner.js +0 -121
- package/dist/oni-code/ui/raw-spinner.js.map +0 -1
- package/dist/oni-code/ui/session.d.ts +0 -44
- package/dist/oni-code/ui/session.d.ts.map +0 -1
- package/dist/oni-code/ui/session.js +0 -93
- package/dist/oni-code/ui/session.js.map +0 -1
- package/dist/oni-code/ui/spinner.d.ts +0 -7
- package/dist/oni-code/ui/spinner.d.ts.map +0 -1
- package/dist/oni-code/ui/spinner.js +0 -20
- package/dist/oni-code/ui/spinner.js.map +0 -1
- package/dist/oni-code/ui/swarm-activity.d.ts +0 -50
- package/dist/oni-code/ui/swarm-activity.d.ts.map +0 -1
- package/dist/oni-code/ui/swarm-activity.js +0 -233
- package/dist/oni-code/ui/swarm-activity.js.map +0 -1
- package/dist/oni-code/ui/terminal-size.d.ts +0 -18
- package/dist/oni-code/ui/terminal-size.d.ts.map +0 -1
- package/dist/oni-code/ui/terminal-size.js +0 -45
- package/dist/oni-code/ui/terminal-size.js.map +0 -1
- package/dist/oni-code/ui/theme.d.ts +0 -82
- package/dist/oni-code/ui/theme.d.ts.map +0 -1
- package/dist/oni-code/ui/theme.js +0 -101
- package/dist/oni-code/ui/theme.js.map +0 -1
- package/dist/oni-code/ui/tool-utils.d.ts +0 -10
- package/dist/oni-code/ui/tool-utils.d.ts.map +0 -1
- package/dist/oni-code/ui/tool-utils.js +0 -82
- package/dist/oni-code/ui/tool-utils.js.map +0 -1
- package/dist/oni-code/ui/useTerminalSize.d.ts +0 -3
- package/dist/oni-code/ui/useTerminalSize.d.ts.map +0 -1
- package/dist/oni-code/ui/useTerminalSize.js +0 -16
- package/dist/oni-code/ui/useTerminalSize.js.map +0 -1
- package/dist/oni-code/workspace/change-tracker.d.ts +0 -18
- package/dist/oni-code/workspace/change-tracker.d.ts.map +0 -1
- package/dist/oni-code/workspace/change-tracker.js +0 -67
- package/dist/oni-code/workspace/change-tracker.js.map +0 -1
- package/dist/oni-code/workspace/conflict-detector.d.ts +0 -12
- package/dist/oni-code/workspace/conflict-detector.d.ts.map +0 -1
- package/dist/oni-code/workspace/conflict-detector.js +0 -24
- package/dist/oni-code/workspace/conflict-detector.js.map +0 -1
- package/dist/oni-code/workspace/file-snapshots.d.ts +0 -39
- package/dist/oni-code/workspace/file-snapshots.d.ts.map +0 -1
- package/dist/oni-code/workspace/file-snapshots.js +0 -77
- package/dist/oni-code/workspace/file-snapshots.js.map +0 -1
- package/dist/oni-code/workspace/index.d.ts +0 -5
- package/dist/oni-code/workspace/index.d.ts.map +0 -1
- package/dist/oni-code/workspace/index.js +0 -5
- package/dist/oni-code/workspace/index.js.map +0 -1
- package/dist/oni-code/workspace/project-map.d.ts +0 -14
- package/dist/oni-code/workspace/project-map.d.ts.map +0 -1
- package/dist/oni-code/workspace/project-map.js +0 -91
- package/dist/oni-code/workspace/project-map.js.map +0 -1
- package/dist/sentinel/config/index.d.ts +0 -2
- package/dist/sentinel/config/index.d.ts.map +0 -1
- package/dist/sentinel/config/index.js +0 -2
- package/dist/sentinel/config/index.js.map +0 -1
- package/dist/sentinel/config/schema.d.ts +0 -4
- package/dist/sentinel/config/schema.d.ts.map +0 -1
- package/dist/sentinel/config/schema.js +0 -42
- package/dist/sentinel/config/schema.js.map +0 -1
- package/dist/sentinel/debate/index.d.ts +0 -6
- package/dist/sentinel/debate/index.d.ts.map +0 -1
- package/dist/sentinel/debate/index.js +0 -64
- package/dist/sentinel/debate/index.js.map +0 -1
- package/dist/sentinel/debate/prompts.d.ts +0 -4
- package/dist/sentinel/debate/prompts.d.ts.map +0 -1
- package/dist/sentinel/debate/prompts.js +0 -13
- package/dist/sentinel/debate/prompts.js.map +0 -1
- package/dist/sentinel/fix/index.d.ts +0 -6
- package/dist/sentinel/fix/index.d.ts.map +0 -1
- package/dist/sentinel/fix/index.js +0 -27
- package/dist/sentinel/fix/index.js.map +0 -1
- package/dist/sentinel/fix/strategies.d.ts +0 -9
- package/dist/sentinel/fix/strategies.d.ts.map +0 -1
- package/dist/sentinel/fix/strategies.js +0 -40
- package/dist/sentinel/fix/strategies.js.map +0 -1
- package/dist/sentinel/index.d.ts +0 -14
- package/dist/sentinel/index.d.ts.map +0 -1
- package/dist/sentinel/index.js +0 -22
- package/dist/sentinel/index.js.map +0 -1
- package/dist/sentinel/integrations/cli.d.ts +0 -10
- package/dist/sentinel/integrations/cli.d.ts.map +0 -1
- package/dist/sentinel/integrations/cli.js +0 -24
- package/dist/sentinel/integrations/cli.js.map +0 -1
- package/dist/sentinel/integrations/index.d.ts +0 -2
- package/dist/sentinel/integrations/index.d.ts.map +0 -1
- package/dist/sentinel/integrations/index.js +0 -2
- package/dist/sentinel/integrations/index.js.map +0 -1
- package/dist/sentinel/memory/index.d.ts +0 -16
- package/dist/sentinel/memory/index.d.ts.map +0 -1
- package/dist/sentinel/memory/index.js +0 -60
- package/dist/sentinel/memory/index.js.map +0 -1
- package/dist/sentinel/report/console.d.ts +0 -3
- package/dist/sentinel/report/console.d.ts.map +0 -1
- package/dist/sentinel/report/console.js +0 -27
- package/dist/sentinel/report/console.js.map +0 -1
- package/dist/sentinel/report/github.d.ts +0 -3
- package/dist/sentinel/report/github.d.ts.map +0 -1
- package/dist/sentinel/report/github.js +0 -36
- package/dist/sentinel/report/github.js.map +0 -1
- package/dist/sentinel/report/index.d.ts +0 -6
- package/dist/sentinel/report/index.d.ts.map +0 -1
- package/dist/sentinel/report/index.js +0 -15
- package/dist/sentinel/report/index.js.map +0 -1
- package/dist/sentinel/report/sarif.d.ts +0 -3
- package/dist/sentinel/report/sarif.d.ts.map +0 -1
- package/dist/sentinel/report/sarif.js +0 -29
- package/dist/sentinel/report/sarif.js.map +0 -1
- package/dist/sentinel/sentinel.d.ts +0 -17
- package/dist/sentinel/sentinel.d.ts.map +0 -1
- package/dist/sentinel/sentinel.js +0 -111
- package/dist/sentinel/sentinel.js.map +0 -1
- package/dist/sentinel/swarm/agents.d.ts +0 -6
- package/dist/sentinel/swarm/agents.d.ts.map +0 -1
- package/dist/sentinel/swarm/agents.js +0 -36
- package/dist/sentinel/swarm/agents.js.map +0 -1
- package/dist/sentinel/swarm/index.d.ts +0 -8
- package/dist/sentinel/swarm/index.d.ts.map +0 -1
- package/dist/sentinel/swarm/index.js +0 -74
- package/dist/sentinel/swarm/index.js.map +0 -1
- package/dist/sentinel/swarm/prompts.d.ts +0 -2
- package/dist/sentinel/swarm/prompts.d.ts.map +0 -1
- package/dist/sentinel/swarm/prompts.js +0 -24
- package/dist/sentinel/swarm/prompts.js.map +0 -1
- package/dist/sentinel/swarm/topology.d.ts +0 -10
- package/dist/sentinel/swarm/topology.d.ts.map +0 -1
- package/dist/sentinel/swarm/topology.js +0 -38
- package/dist/sentinel/swarm/topology.js.map +0 -1
- package/dist/sentinel/triage/analyzers/complexity-analyzer.d.ts +0 -7
- package/dist/sentinel/triage/analyzers/complexity-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/complexity-analyzer.js +0 -94
- package/dist/sentinel/triage/analyzers/complexity-analyzer.js.map +0 -1
- package/dist/sentinel/triage/analyzers/custom-analyzer.d.ts +0 -19
- package/dist/sentinel/triage/analyzers/custom-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/custom-analyzer.js +0 -268
- package/dist/sentinel/triage/analyzers/custom-analyzer.js.map +0 -1
- package/dist/sentinel/triage/analyzers/dependency-analyzer.d.ts +0 -26
- package/dist/sentinel/triage/analyzers/dependency-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/dependency-analyzer.js +0 -220
- package/dist/sentinel/triage/analyzers/dependency-analyzer.js.map +0 -1
- package/dist/sentinel/triage/analyzers/diff-analyzer.d.ts +0 -12
- package/dist/sentinel/triage/analyzers/diff-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/diff-analyzer.js +0 -19
- package/dist/sentinel/triage/analyzers/diff-analyzer.js.map +0 -1
- package/dist/sentinel/triage/analyzers/index.d.ts +0 -14
- package/dist/sentinel/triage/analyzers/index.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/index.js +0 -25
- package/dist/sentinel/triage/analyzers/index.js.map +0 -1
- package/dist/sentinel/triage/analyzers/pattern-analyzer.d.ts +0 -7
- package/dist/sentinel/triage/analyzers/pattern-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/pattern-analyzer.js +0 -180
- package/dist/sentinel/triage/analyzers/pattern-analyzer.js.map +0 -1
- package/dist/sentinel/triage/analyzers/security-analyzer.d.ts +0 -7
- package/dist/sentinel/triage/analyzers/security-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/security-analyzer.js +0 -96
- package/dist/sentinel/triage/analyzers/security-analyzer.js.map +0 -1
- package/dist/sentinel/triage/analyzers/ts-parser.d.ts +0 -71
- package/dist/sentinel/triage/analyzers/ts-parser.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/ts-parser.js +0 -323
- package/dist/sentinel/triage/analyzers/ts-parser.js.map +0 -1
- package/dist/sentinel/triage/analyzers/typescript-analyzer.d.ts +0 -7
- package/dist/sentinel/triage/analyzers/typescript-analyzer.d.ts.map +0 -1
- package/dist/sentinel/triage/analyzers/typescript-analyzer.js +0 -68
- package/dist/sentinel/triage/analyzers/typescript-analyzer.js.map +0 -1
- package/dist/sentinel/triage/index.d.ts +0 -10
- package/dist/sentinel/triage/index.d.ts.map +0 -1
- package/dist/sentinel/triage/index.js +0 -39
- package/dist/sentinel/triage/index.js.map +0 -1
- package/dist/sentinel/triage/scorer.d.ts +0 -9
- package/dist/sentinel/triage/scorer.d.ts.map +0 -1
- package/dist/sentinel/triage/scorer.js +0 -28
- package/dist/sentinel/triage/scorer.js.map +0 -1
- package/dist/sentinel/types.d.ts +0 -125
- package/dist/sentinel/types.d.ts.map +0 -1
- package/dist/sentinel/types.js +0 -6
- package/dist/sentinel/types.js.map +0 -1
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Topology-Aware Agent Prompt Builder
|
|
3
|
-
*
|
|
4
|
-
* Generates topology-specific agent definitions for auto-dispatch.
|
|
5
|
-
* Each topology produces agents with distinct roles and prompts that
|
|
6
|
-
* match the topology's semantics (debate → opposing positions,
|
|
7
|
-
* pipeline → sequential stages, etc.).
|
|
8
|
-
*/
|
|
9
|
-
// ── Pipeline Stage Labels ────────────────────────────────────
|
|
10
|
-
const PIPELINE_STAGES = [
|
|
11
|
-
{ role: "Stage 1: Analyze", directive: "Analyze the task requirements. Examine the codebase, identify what needs to change, and produce a clear plan. Pass your analysis to the next stage." },
|
|
12
|
-
{ role: "Stage 2: Implement", directive: "Implement the changes based on the analysis from Stage 1. Write the actual code modifications. Pass your implementation to the next stage for verification." },
|
|
13
|
-
{ role: "Stage 3: Verify", directive: "Review and verify the implementation from Stage 2. Check for correctness, edge cases, test coverage, and potential issues. Produce a final summary." },
|
|
14
|
-
{ role: "Stage 4: Polish", directive: "Polish the output from previous stages. Clean up code style, add documentation, and ensure consistency across all changes." },
|
|
15
|
-
{ role: "Stage 5: Integrate", directive: "Integrate all changes from previous stages. Ensure everything works together and resolve any conflicts." },
|
|
16
|
-
];
|
|
17
|
-
// ── Debate Perspective Labels ────────────────────────────────
|
|
18
|
-
const DEBATE_PERSPECTIVES = [
|
|
19
|
-
{ role: "Advocate", directive: "Argue FOR the proposed approach. Present the strongest case: benefits, advantages, and reasons this approach is correct. Acknowledge weaknesses only if they can be mitigated." },
|
|
20
|
-
{ role: "Skeptic", directive: "Argue AGAINST the proposed approach or present an alternative. Challenge assumptions, identify risks, edge cases, and potential failures. Propose a different approach if appropriate." },
|
|
21
|
-
{ role: "Synthesizer", directive: "Evaluate both the advocate's and skeptic's arguments. Identify the strongest points from each side. Produce a balanced recommendation that incorporates the best elements." },
|
|
22
|
-
{ role: "Pragmatist", directive: "Focus on practical implementation concerns. Evaluate approaches by effort, maintainability, team impact, and real-world constraints rather than theoretical merit." },
|
|
23
|
-
{ role: "Innovator", directive: "Propose a creative alternative that neither the advocate nor skeptic considered. Think outside the conventional approaches." },
|
|
24
|
-
];
|
|
25
|
-
// ── Builder Functions Per Topology ───────────────────────────
|
|
26
|
-
function buildFanOut(task, count) {
|
|
27
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
28
|
-
id: `fanout-worker-${i}`,
|
|
29
|
-
role: `Worker Stream ${i + 1}`,
|
|
30
|
-
systemPrompt: `You are an independent worker agent (stream ${i + 1} of ${count}) in a fan-out topology.
|
|
31
|
-
|
|
32
|
-
Your task: ${task}
|
|
33
|
-
|
|
34
|
-
You own your portion of this work independently. Focus on your assigned subset without duplicating work done by other streams. Work thoroughly and produce complete results for your portion.`,
|
|
35
|
-
}));
|
|
36
|
-
}
|
|
37
|
-
function buildPipeline(task, count) {
|
|
38
|
-
return Array.from({ length: count }, (_, i) => {
|
|
39
|
-
const stage = PIPELINE_STAGES[i] ?? {
|
|
40
|
-
role: `Stage ${i + 1}: Process`,
|
|
41
|
-
directive: `Process your stage of the pipeline. Build on the output from the previous stage and pass your results to the next stage.`,
|
|
42
|
-
};
|
|
43
|
-
return {
|
|
44
|
-
id: `pipeline-stage-${i}`,
|
|
45
|
-
role: stage.role,
|
|
46
|
-
systemPrompt: `You are ${stage.role} in a ${count}-stage pipeline.
|
|
47
|
-
|
|
48
|
-
Your task: ${task}
|
|
49
|
-
|
|
50
|
-
${stage.directive}
|
|
51
|
-
|
|
52
|
-
You are stage ${i + 1} of ${count}.${i > 0 ? " You will receive input from the previous stage — build on it, don't start from scratch." : " You are the first stage — start fresh with the original task."}${i < count - 1 ? " Your output will feed into the next stage." : " You are the final stage — produce the definitive result."}`,
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function buildDebate(task, count) {
|
|
57
|
-
return Array.from({ length: count }, (_, i) => {
|
|
58
|
-
const perspective = DEBATE_PERSPECTIVES[i] ?? {
|
|
59
|
-
role: `Perspective ${i + 1}`,
|
|
60
|
-
directive: `Offer a unique perspective different from all others. Bring a distinct viewpoint to the discussion.`,
|
|
61
|
-
};
|
|
62
|
-
return {
|
|
63
|
-
id: `debate-${perspective.role.toLowerCase().replace(/\s+/g, "-")}`,
|
|
64
|
-
role: perspective.role,
|
|
65
|
-
systemPrompt: `You are the ${perspective.role} in a ${count}-perspective debate.
|
|
66
|
-
|
|
67
|
-
The question: ${task}
|
|
68
|
-
|
|
69
|
-
${perspective.directive}
|
|
70
|
-
|
|
71
|
-
Present a well-reasoned, specific argument. Use concrete examples and evidence from the codebase or domain knowledge. Do not hedge or present both sides — commit to your assigned perspective.`,
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function buildMapReduce(task, count) {
|
|
76
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
77
|
-
id: `mapper-${i}`,
|
|
78
|
-
role: `Mapper ${i + 1}`,
|
|
79
|
-
systemPrompt: `You are Mapper ${i + 1} of ${count} in a map-reduce topology.
|
|
80
|
-
|
|
81
|
-
Your task: ${task}
|
|
82
|
-
|
|
83
|
-
Process your assigned portion of the input independently. Produce structured, consistent output that can be combined with outputs from the other ${count - 1} mappers. Focus on thoroughness over brevity — the reducer will synthesize everything.`,
|
|
84
|
-
}));
|
|
85
|
-
}
|
|
86
|
-
function buildHierarchical(task, count) {
|
|
87
|
-
const agents = [
|
|
88
|
-
{
|
|
89
|
-
id: "supervisor",
|
|
90
|
-
role: "Supervisor",
|
|
91
|
-
systemPrompt: `You are the Supervisor coordinating ${count - 1} specialist worker agents.
|
|
92
|
-
|
|
93
|
-
The task: ${task}
|
|
94
|
-
|
|
95
|
-
Your job: decompose the task into subtasks, assign them to your workers, review their outputs, and produce the final integrated result. You are the decision-maker — resolve conflicts between workers and ensure quality.`,
|
|
96
|
-
},
|
|
97
|
-
];
|
|
98
|
-
for (let i = 1; i < count; i++) {
|
|
99
|
-
agents.push({
|
|
100
|
-
id: `specialist-${i}`,
|
|
101
|
-
role: `Specialist Agent ${i}`,
|
|
102
|
-
systemPrompt: `You are Specialist Agent ${i} of ${count - 1} workers reporting to a Supervisor.
|
|
103
|
-
|
|
104
|
-
The overall task: ${task}
|
|
105
|
-
|
|
106
|
-
Execute the specific subtask assigned to you by the Supervisor. Focus on your assigned work, be thorough, and report your results clearly. The Supervisor will integrate your output with work from the other specialists.`,
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return agents;
|
|
110
|
-
}
|
|
111
|
-
function buildRace(task, count) {
|
|
112
|
-
const strategies = [
|
|
113
|
-
"Take the most direct, straightforward approach — prioritize speed and simplicity.",
|
|
114
|
-
"Take a thorough, methodical approach — prioritize correctness and completeness over speed.",
|
|
115
|
-
"Take a creative, unconventional approach — try a different strategy than the obvious one.",
|
|
116
|
-
"Take a cautious, defensive approach — handle edge cases and error conditions first.",
|
|
117
|
-
"Take an iterative approach — start with the minimal viable solution and refine.",
|
|
118
|
-
];
|
|
119
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
120
|
-
id: `racer-${i}`,
|
|
121
|
-
role: `Racer ${i + 1} (${["Direct", "Thorough", "Creative", "Defensive", "Iterative"][i] ?? `Strategy ${i + 1}`})`,
|
|
122
|
-
systemPrompt: `You are Racer ${i + 1} of ${count} in a race topology. The first complete solution wins.
|
|
123
|
-
|
|
124
|
-
Your task: ${task}
|
|
125
|
-
|
|
126
|
-
Your strategy: ${strategies[i] ?? `Use your own independent approach (strategy ${i + 1}).`}
|
|
127
|
-
|
|
128
|
-
Work independently. Do not assume what other racers are doing. Produce a complete, working solution as quickly as possible.`,
|
|
129
|
-
}));
|
|
130
|
-
}
|
|
131
|
-
function buildPool(task, count) {
|
|
132
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
133
|
-
id: `pool-worker-${i}`,
|
|
134
|
-
role: `Pool Worker ${i + 1}`,
|
|
135
|
-
systemPrompt: `You are Pool Worker ${i + 1} of ${count} in a shared work pool.
|
|
136
|
-
|
|
137
|
-
Your task: ${task}
|
|
138
|
-
|
|
139
|
-
Pick up and complete work items from the shared queue. You are interchangeable with the other workers — any of you can handle any work item. Focus on completing your assigned items efficiently.`,
|
|
140
|
-
}));
|
|
141
|
-
}
|
|
142
|
-
function buildPeerNetwork(task, count) {
|
|
143
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
144
|
-
id: `peer-${i}`,
|
|
145
|
-
role: `Peer ${i + 1}`,
|
|
146
|
-
systemPrompt: `You are Peer ${i + 1} of ${count} in a collaborative peer network.
|
|
147
|
-
|
|
148
|
-
Your task: ${task}
|
|
149
|
-
|
|
150
|
-
Collaborate with your peers — share discoveries, coordinate on overlapping concerns, and build on each other's work. There is no supervisor; you are all equals working toward the same goal. Communicate findings that might affect other peers' work.`,
|
|
151
|
-
}));
|
|
152
|
-
}
|
|
153
|
-
function buildDag(task, count) {
|
|
154
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
155
|
-
id: `dag-node-${i}`,
|
|
156
|
-
role: `Task Node ${i + 1}`,
|
|
157
|
-
systemPrompt: `You are Task Node ${i + 1} of ${count} in a dependency-ordered DAG (directed acyclic graph).
|
|
158
|
-
|
|
159
|
-
Your task: ${task}
|
|
160
|
-
|
|
161
|
-
Complete your assigned subtask. You may depend on outputs from upstream nodes and your output may be required by downstream nodes. Produce clear, structured results that downstream nodes can consume.`,
|
|
162
|
-
}));
|
|
163
|
-
}
|
|
164
|
-
function buildHierarchicalMesh(task, count) {
|
|
165
|
-
const agents = [
|
|
166
|
-
{
|
|
167
|
-
id: "mesh-coordinator",
|
|
168
|
-
role: "Mesh Coordinator",
|
|
169
|
-
systemPrompt: `You are the Coordinator of a ${count - 1}-agent mesh network.
|
|
170
|
-
|
|
171
|
-
The task: ${task}
|
|
172
|
-
|
|
173
|
-
Your job: oversee the mesh workers, resolve conflicts between their outputs, and produce the final integrated result. The mesh workers communicate with each other directly — you provide oversight and final decision-making.`,
|
|
174
|
-
},
|
|
175
|
-
];
|
|
176
|
-
for (let i = 1; i < count; i++) {
|
|
177
|
-
agents.push({
|
|
178
|
-
id: `mesh-worker-${i}`,
|
|
179
|
-
role: `Mesh Worker ${i}`,
|
|
180
|
-
systemPrompt: `You are Mesh Worker ${i} of ${count - 1} in a hierarchical mesh network with a coordinator.
|
|
181
|
-
|
|
182
|
-
The task: ${task}
|
|
183
|
-
|
|
184
|
-
Collaborate with other mesh workers directly — share findings and coordinate on overlapping concerns. The coordinator will integrate final results. Focus on your portion of the work while staying aware of what others are doing.`,
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
return agents;
|
|
188
|
-
}
|
|
189
|
-
function buildGeneric(task, count) {
|
|
190
|
-
return Array.from({ length: count }, (_, i) => ({
|
|
191
|
-
id: `agent-${i}`,
|
|
192
|
-
role: `Agent ${i + 1}`,
|
|
193
|
-
systemPrompt: `You are agent ${i + 1} of ${count} working on: ${task}`,
|
|
194
|
-
}));
|
|
195
|
-
}
|
|
196
|
-
// ── Main Builder ─────────────────────────────────────────────
|
|
197
|
-
const TOPOLOGY_BUILDERS = {
|
|
198
|
-
fanOut: buildFanOut,
|
|
199
|
-
pipeline: buildPipeline,
|
|
200
|
-
debate: buildDebate,
|
|
201
|
-
mapReduce: buildMapReduce,
|
|
202
|
-
hierarchical: buildHierarchical,
|
|
203
|
-
race: buildRace,
|
|
204
|
-
pool: buildPool,
|
|
205
|
-
peerNetwork: buildPeerNetwork,
|
|
206
|
-
dag: buildDag,
|
|
207
|
-
hierarchicalMesh: buildHierarchicalMesh,
|
|
208
|
-
};
|
|
209
|
-
/**
|
|
210
|
-
* Build topology-specific agent definitions for auto-dispatch.
|
|
211
|
-
*
|
|
212
|
-
* Each topology produces agents with distinct roles and system prompts
|
|
213
|
-
* that match the topology's semantics. This replaces the generic
|
|
214
|
-
* "agent N of M" pattern that previously discarded topology information.
|
|
215
|
-
*/
|
|
216
|
-
export function buildAutoDispatchAgents(topology, task, agentCount) {
|
|
217
|
-
const builder = TOPOLOGY_BUILDERS[topology] ?? buildGeneric;
|
|
218
|
-
return builder(task, agentCount);
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=topology-agent-builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"topology-agent-builder.js","sourceRoot":"","sources":["../../src/oni-code/topology-agent-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,gEAAgE;AAEhE,MAAM,eAAe,GAAG;IACtB,EAAE,IAAI,EAAE,kBAAkB,EAAE,SAAS,EAAE,qJAAqJ,EAAE;IAC9L,EAAE,IAAI,EAAE,oBAAoB,EAAE,SAAS,EAAE,6JAA6J,EAAE;IACxM,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,qJAAqJ,EAAE;IAC7L,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,4HAA4H,EAAE;IACpK,EAAE,IAAI,EAAE,oBAAoB,EA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,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC;IAC5D,OAAO,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Topology Selector — automatic swarm topology recommendation.
|
|
3
|
-
*
|
|
4
|
-
* Analyzes task characteristics (text patterns, file counts, structure)
|
|
5
|
-
* to recommend the best swarm topology. Pure functions, no side effects.
|
|
6
|
-
*
|
|
7
|
-
* Used by:
|
|
8
|
-
* - Conductor: for invisible auto-dispatch (P1 #5)
|
|
9
|
-
* - spawn_swarm tool: as a fallback when topology is "auto"
|
|
10
|
-
* - System prompt: to guide the LLM's topology choice
|
|
11
|
-
*
|
|
12
|
-
* Swarm-aware by definition — this IS the swarm selection logic.
|
|
13
|
-
*/
|
|
14
|
-
export declare const TOPOLOGY_DESCRIPTIONS: Record<string, string>;
|
|
15
|
-
export type Topology = keyof typeof TOPOLOGY_DESCRIPTIONS;
|
|
16
|
-
export interface TaskSignals {
|
|
17
|
-
/** The task description text */
|
|
18
|
-
task: string;
|
|
19
|
-
/** Number of files explicitly mentioned or targeted */
|
|
20
|
-
fileCount?: number;
|
|
21
|
-
/** File paths mentioned in the task */
|
|
22
|
-
filePaths?: string[];
|
|
23
|
-
/** Whether the task involves sequential stages */
|
|
24
|
-
isSequential?: boolean;
|
|
25
|
-
/** Whether the task involves design/architecture decisions */
|
|
26
|
-
isDesignDecision?: boolean;
|
|
27
|
-
/** Number of agents the caller wants (hint, not binding) */
|
|
28
|
-
agentCountHint?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface TopologyRecommendation {
|
|
31
|
-
/** Recommended topology */
|
|
32
|
-
topology: Topology;
|
|
33
|
-
/** Confidence: 0-1 (1 = strong match, <0.4 = weak/fallback) */
|
|
34
|
-
confidence: number;
|
|
35
|
-
/** Short explanation for why this topology was chosen */
|
|
36
|
-
reason: string;
|
|
37
|
-
/** Suggested agent count (minimum viable) */
|
|
38
|
-
suggestedAgentCount: number;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Score each topology against the task signals.
|
|
42
|
-
* Returns all topologies sorted by score (highest first).
|
|
43
|
-
*/
|
|
44
|
-
export declare function scoreTopologies(signals: TaskSignals): Array<{
|
|
45
|
-
topology: Topology;
|
|
46
|
-
score: number;
|
|
47
|
-
reason: string;
|
|
48
|
-
agentCount: number;
|
|
49
|
-
}>;
|
|
50
|
-
/**
|
|
51
|
-
* Select the best topology for a given task.
|
|
52
|
-
*
|
|
53
|
-
* Returns a recommendation with confidence level.
|
|
54
|
-
* If no topology is a strong match (confidence < threshold),
|
|
55
|
-
* falls back to fanOut (safest general-purpose topology).
|
|
56
|
-
*/
|
|
57
|
-
export declare function selectTopology(signals: TaskSignals, options?: {
|
|
58
|
-
/** Minimum confidence to recommend (default: 0.3) */
|
|
59
|
-
minConfidence?: number;
|
|
60
|
-
/** Fallback topology when confidence is below threshold */
|
|
61
|
-
fallback?: Topology;
|
|
62
|
-
}): TopologyRecommendation;
|
|
63
|
-
/**
|
|
64
|
-
* Quick check: should this task use a swarm at all?
|
|
65
|
-
*
|
|
66
|
-
* Returns false for tasks that are clearly single-agent
|
|
67
|
-
* (simple questions, single-file edits, quick lookups).
|
|
68
|
-
*/
|
|
69
|
-
export declare function shouldUseSwarm(task: string): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* Extract task signals from a task description string.
|
|
72
|
-
*
|
|
73
|
-
* Parses file paths, counts, and structural hints from natural language.
|
|
74
|
-
*/
|
|
75
|
-
export declare function extractSignals(task: string): TaskSignals;
|
|
76
|
-
/**
|
|
77
|
-
* Full auto-selection pipeline: task string → topology recommendation.
|
|
78
|
-
*
|
|
79
|
-
* Combines signal extraction, swarm-worthiness check, and topology selection.
|
|
80
|
-
*/
|
|
81
|
-
export declare function autoSelectTopology(task: string, options?: {
|
|
82
|
-
minConfidence?: number;
|
|
83
|
-
fallback?: Topology;
|
|
84
|
-
}): TopologyRecommendation | null;
|
|
85
|
-
//# sourceMappingURL=topology-selector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"topology-selector.d.ts","sourceRoot":"","sources":["../../src/oni-code/topology-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAexD,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAI1D,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,kDAAkD;IAClD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAoJD;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,GACnB,KAAK,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CA+ClF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE;IACR,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,GACA,sBAAsB,CA4BxB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CA2DpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAmCxD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,GACA,sBAAsB,GAAG,IAAI,CAQ/B"}
|
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Topology Selector — automatic swarm topology recommendation.
|
|
3
|
-
*
|
|
4
|
-
* Analyzes task characteristics (text patterns, file counts, structure)
|
|
5
|
-
* to recommend the best swarm topology. Pure functions, no side effects.
|
|
6
|
-
*
|
|
7
|
-
* Used by:
|
|
8
|
-
* - Conductor: for invisible auto-dispatch (P1 #5)
|
|
9
|
-
* - spawn_swarm tool: as a fallback when topology is "auto"
|
|
10
|
-
* - System prompt: to guide the LLM's topology choice
|
|
11
|
-
*
|
|
12
|
-
* Swarm-aware by definition — this IS the swarm selection logic.
|
|
13
|
-
*/
|
|
14
|
-
// ── Topology Definitions (canonical source) ─────────────────
|
|
15
|
-
export const TOPOLOGY_DESCRIPTIONS = {
|
|
16
|
-
debate: "Multi-round debate with judge — for architecture decisions, trade-off analysis, code review with multiple perspectives",
|
|
17
|
-
fanOut: "Parallel independent agents with synthesis — for parallel independent work that gets combined",
|
|
18
|
-
pipeline: "Sequential multi-stage — for sequential work where each stage feeds the next",
|
|
19
|
-
mapReduce: "Analyze many inputs then synthesize — for analyzing many files or inputs and producing a combined conclusion",
|
|
20
|
-
hierarchical: "Manager delegates to specialists — for complex tasks needing a manager who delegates to specialist agents",
|
|
21
|
-
// peerNetwork and hierarchicalMesh omitted — they require manual handoff/team
|
|
22
|
-
// configuration that DefaultSwarmRunner cannot auto-generate. The framework
|
|
23
|
-
// factories (SwarmGraph.peerNetwork, SwarmGraph.hierarchicalMesh) still exist
|
|
24
|
-
// for advanced users building custom swarms directly.
|
|
25
|
-
};
|
|
26
|
-
const PATTERNS = [
|
|
27
|
-
// ── Fan-Out: parallel independent work ──────────────────
|
|
28
|
-
{
|
|
29
|
-
topology: "fanOut",
|
|
30
|
-
textPatterns: [
|
|
31
|
-
/\b(?:refactor|update|modify|edit|change|fix)\b.*\b(?:files?|modules?|components?|handlers?|services?|endpoints?|models?|adapters?)\b/i,
|
|
32
|
-
/\beach\s+(?:file|module|component|service|handler|endpoint|model)\b/i,
|
|
33
|
-
/\bin\s+parallel\b/i,
|
|
34
|
-
/\ball\s+(?:\d+\s+)?(?:files?|modules?|handlers?|services?|endpoints?|models?|adapters?|components?)\b/i,
|
|
35
|
-
/\bmulti(?:ple)?[\s-]?file/i,
|
|
36
|
-
/\bacross\s+(?:all|multiple|several|the\s+entire)\b/i,
|
|
37
|
-
/\b(?:3|4|5|6|7|8|9|\d{2,})\s+(?:\w+\s+)?(?:files?|modules?|handlers?|services?|models?|adapters?|components?|endpoints?)\b/i,
|
|
38
|
-
],
|
|
39
|
-
textWeight: 1.0,
|
|
40
|
-
structuralCheck: (s) => {
|
|
41
|
-
// Strong signal if 3+ files targeted
|
|
42
|
-
if (s.fileCount !== undefined && s.fileCount >= 3)
|
|
43
|
-
return 0.8;
|
|
44
|
-
if (s.filePaths && s.filePaths.length >= 3)
|
|
45
|
-
return 0.8;
|
|
46
|
-
return 0;
|
|
47
|
-
},
|
|
48
|
-
baseAgentCount: 3,
|
|
49
|
-
reasonTemplate: "Parallel independent work on multiple targets",
|
|
50
|
-
},
|
|
51
|
-
// ── Pipeline: sequential stages ─────────────────────────
|
|
52
|
-
{
|
|
53
|
-
topology: "pipeline",
|
|
54
|
-
textPatterns: [
|
|
55
|
-
/\bthen\b.*\bthen\b/i,
|
|
56
|
-
/\bstep\s+\d+\b.*\bstep\s+\d+\b/i,
|
|
57
|
-
/\bfirst\b.*\bthen\b.*\bfinally\b/i,
|
|
58
|
-
/\bbuild\b.*\btest\b/i,
|
|
59
|
-
/\banalyze\b.*\bimplement\b/i,
|
|
60
|
-
/\bplan\b.*\bexecute\b/i,
|
|
61
|
-
/\bextract\b.*\btransform\b/i,
|
|
62
|
-
/\bparse\b.*\bvalidate\b.*\bgenerate\b/i,
|
|
63
|
-
/\bmigrat(?:e|ion)\b/i,
|
|
64
|
-
],
|
|
65
|
-
textWeight: 1.0,
|
|
66
|
-
structuralCheck: (s) => {
|
|
67
|
-
if (s.isSequential)
|
|
68
|
-
return 0.9;
|
|
69
|
-
return 0;
|
|
70
|
-
},
|
|
71
|
-
baseAgentCount: 3,
|
|
72
|
-
reasonTemplate: "Sequential multi-stage workflow",
|
|
73
|
-
},
|
|
74
|
-
// ── Debate: design decisions, trade-offs ────────────────
|
|
75
|
-
{
|
|
76
|
-
topology: "debate",
|
|
77
|
-
textPatterns: [
|
|
78
|
-
/\bdesign\b.*\b(?:api|interface|architecture|system)\b/i,
|
|
79
|
-
/\btrade[\s-]?off/i,
|
|
80
|
-
/\bpros?\s+(?:and|&|vs)\s+cons?\b/i,
|
|
81
|
-
/\bcompare\b.*\bapproach/i,
|
|
82
|
-
/\bwhich\s+(?:approach|strategy|pattern|method)\b/i,
|
|
83
|
-
/\bbest\s+(?:approach|way|strategy|pattern)\b/i,
|
|
84
|
-
/\barchitectur(?:e|al)\s+(?:decision|review|choice)\b/i,
|
|
85
|
-
/\breview\b.*\b(?:code|design|approach)/i,
|
|
86
|
-
/\bevaluat(?:e|ion)\b.*\b(?:option|alternative|approach)/i,
|
|
87
|
-
/\bshould\s+(?:we|I)\s+use\b/i,
|
|
88
|
-
/\b(?:REST|GraphQL|SQL|NoSQL|MongoDB|Postgres|Redis)\b.*\b(?:or|vs\.?|versus)\b/i,
|
|
89
|
-
],
|
|
90
|
-
textWeight: 1.0,
|
|
91
|
-
structuralCheck: (s) => {
|
|
92
|
-
if (s.isDesignDecision)
|
|
93
|
-
return 0.9;
|
|
94
|
-
return 0;
|
|
95
|
-
},
|
|
96
|
-
baseAgentCount: 3,
|
|
97
|
-
reasonTemplate: "Multiple perspectives for decision-making",
|
|
98
|
-
},
|
|
99
|
-
// ── MapReduce: analyze many inputs → synthesize ─────────
|
|
100
|
-
{
|
|
101
|
-
topology: "mapReduce",
|
|
102
|
-
textPatterns: [
|
|
103
|
-
/\banalyze\b.*\ball\b/i,
|
|
104
|
-
/\baudit\b/i,
|
|
105
|
-
/\bsummariz(?:e|ation)\b.*\b(?:all|every|each)\b/i,
|
|
106
|
-
/\bfind\b.*\bevery\b/i,
|
|
107
|
-
/\bscan\b.*\b(?:entire|whole|all)\b/i,
|
|
108
|
-
/\binventory\b/i,
|
|
109
|
-
/\bcatalog(?:ue)?\b/i,
|
|
110
|
-
/\bsurvey\b.*\bcodebase\b/i,
|
|
111
|
-
/\bcollect\b.*\b(?:all|every)\b/i,
|
|
112
|
-
/\banalyze\b.*\bsummariz/i,
|
|
113
|
-
/\bfind\b.*\b(?:all|every)\b.*\b(?:across|modules?|remove)\b/i,
|
|
114
|
-
],
|
|
115
|
-
textWeight: 1.2,
|
|
116
|
-
structuralCheck: (s) => {
|
|
117
|
-
// Strong signal if many files to analyze
|
|
118
|
-
if (s.fileCount !== undefined && s.fileCount >= 5)
|
|
119
|
-
return 0.7;
|
|
120
|
-
if (s.filePaths && s.filePaths.length >= 5)
|
|
121
|
-
return 0.7;
|
|
122
|
-
return 0;
|
|
123
|
-
},
|
|
124
|
-
baseAgentCount: 4,
|
|
125
|
-
reasonTemplate: "Analyze many inputs and synthesize results",
|
|
126
|
-
},
|
|
127
|
-
// ── Hierarchical: complex tasks with delegation ─────────
|
|
128
|
-
{
|
|
129
|
-
topology: "hierarchical",
|
|
130
|
-
textPatterns: [
|
|
131
|
-
/\bdelegate\b/i,
|
|
132
|
-
/\bcoordinat(?:e|or|ion)\b/i,
|
|
133
|
-
/\bmanag(?:e|er)\b.*\b(?:team|agents?|workers?)\b/i,
|
|
134
|
-
/\bcomplex\b.*\b(?:project|task|system)\b/i,
|
|
135
|
-
/\bmulti[\s-]?(?:module|service|package)\b/i,
|
|
136
|
-
/\b(?:build(?:ing)?|implement(?:ing)?|creat(?:e|ing))\b.*\bfull[\s-]?(?:stack|system|platform)\b/i,
|
|
137
|
-
/\bfull[\s-]?(?:stack|system|platform)\b.*\b(?:build(?:ing)?|implement(?:ing)?|creat(?:e|ing))\b/i,
|
|
138
|
-
/\borchestrat(?:e|ion)\b/i,
|
|
139
|
-
/\b(?:build|implement|create)\b.*\b(?:api|database|frontend|backend)\b.*\b(?:api|database|frontend|backend)\b/i,
|
|
140
|
-
/\b(?:module|service|feature)\b.*\bwith\b.*\b(?:api|database|frontend|backend|auth)\b.*\band\b/i,
|
|
141
|
-
/\b(?:build|implement|create)\b.*\b(?:api|database|frontend|backend|auth|billing)\b.*\band\b.*\b(?:api|database|frontend|backend|component)/i,
|
|
142
|
-
],
|
|
143
|
-
textWeight: 1.0,
|
|
144
|
-
structuralCheck: (s) => {
|
|
145
|
-
if (s.agentCountHint !== undefined && s.agentCountHint >= 5)
|
|
146
|
-
return 0.6;
|
|
147
|
-
return 0;
|
|
148
|
-
},
|
|
149
|
-
baseAgentCount: 4,
|
|
150
|
-
reasonTemplate: "Manager delegates to specialist agents",
|
|
151
|
-
},
|
|
152
|
-
// peerNetwork omitted — SwarmRunner does not support auto-generating
|
|
153
|
-
// peer handoff config. Users can still request it explicitly via spawn_swarm.
|
|
154
|
-
];
|
|
155
|
-
// ── Core Selection Logic ─────────────────────────────────────
|
|
156
|
-
/**
|
|
157
|
-
* Score each topology against the task signals.
|
|
158
|
-
* Returns all topologies sorted by score (highest first).
|
|
159
|
-
*/
|
|
160
|
-
export function scoreTopologies(signals) {
|
|
161
|
-
const scored = PATTERNS.map((pattern) => {
|
|
162
|
-
let score = 0;
|
|
163
|
-
// Text pattern matching
|
|
164
|
-
const matchCount = pattern.textPatterns.filter((re) => re.test(signals.task)).length;
|
|
165
|
-
if (matchCount > 0) {
|
|
166
|
-
// Diminishing returns: first match is worth most
|
|
167
|
-
score += Math.min(matchCount * 0.3, 1.0) * pattern.textWeight;
|
|
168
|
-
}
|
|
169
|
-
// Structural signals
|
|
170
|
-
if (pattern.structuralCheck) {
|
|
171
|
-
score += pattern.structuralCheck(signals);
|
|
172
|
-
}
|
|
173
|
-
// Bonus for file count alignment
|
|
174
|
-
if (signals.fileCount !== undefined) {
|
|
175
|
-
if (pattern.topology === "fanOut" && signals.fileCount >= 3) {
|
|
176
|
-
score += 0.2;
|
|
177
|
-
}
|
|
178
|
-
if (pattern.topology === "mapReduce" && signals.fileCount >= 5) {
|
|
179
|
-
score += 0.2;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
// Agent count hint alignment
|
|
183
|
-
if (signals.agentCountHint !== undefined) {
|
|
184
|
-
if (pattern.topology === "debate" && signals.agentCountHint >= 2 && signals.agentCountHint <= 4) {
|
|
185
|
-
score += 0.1;
|
|
186
|
-
}
|
|
187
|
-
if (pattern.topology === "fanOut" && signals.agentCountHint >= 3) {
|
|
188
|
-
score += 0.1;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
const agentCount = signals.agentCountHint ?? pattern.baseAgentCount;
|
|
192
|
-
return {
|
|
193
|
-
topology: pattern.topology,
|
|
194
|
-
score,
|
|
195
|
-
reason: pattern.reasonTemplate,
|
|
196
|
-
agentCount,
|
|
197
|
-
};
|
|
198
|
-
});
|
|
199
|
-
return scored.sort((a, b) => b.score - a.score);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Select the best topology for a given task.
|
|
203
|
-
*
|
|
204
|
-
* Returns a recommendation with confidence level.
|
|
205
|
-
* If no topology is a strong match (confidence < threshold),
|
|
206
|
-
* falls back to fanOut (safest general-purpose topology).
|
|
207
|
-
*/
|
|
208
|
-
export function selectTopology(signals, options) {
|
|
209
|
-
const minConfidence = options?.minConfidence ?? 0.3;
|
|
210
|
-
const fallback = options?.fallback ?? "fanOut";
|
|
211
|
-
const scored = scoreTopologies(signals);
|
|
212
|
-
const best = scored[0];
|
|
213
|
-
// Normalize score to confidence (0-1)
|
|
214
|
-
// Max possible score is ~2.0 (text + structural + bonus)
|
|
215
|
-
// Round to 4 decimals to avoid IEEE 754 boundary issues (e.g. 0.6/1.5 → 0.39999... instead of 0.4)
|
|
216
|
-
const confidence = Math.round(Math.min(best.score / 1.5, 1.0) * 10000) / 10000;
|
|
217
|
-
if (confidence >= minConfidence && best.score > 0) {
|
|
218
|
-
return {
|
|
219
|
-
topology: best.topology,
|
|
220
|
-
confidence,
|
|
221
|
-
reason: best.reason,
|
|
222
|
-
suggestedAgentCount: best.agentCount,
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
// Below threshold — use fallback
|
|
226
|
-
return {
|
|
227
|
-
topology: fallback,
|
|
228
|
-
confidence,
|
|
229
|
-
reason: `No strong topology match — defaulting to ${fallback}`,
|
|
230
|
-
suggestedAgentCount: signals.agentCountHint ?? 3,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Quick check: should this task use a swarm at all?
|
|
235
|
-
*
|
|
236
|
-
* Returns false for tasks that are clearly single-agent
|
|
237
|
-
* (simple questions, single-file edits, quick lookups).
|
|
238
|
-
*/
|
|
239
|
-
export function shouldUseSwarm(task) {
|
|
240
|
-
const lower = task.toLowerCase();
|
|
241
|
-
// Single-file operations — no swarm needed
|
|
242
|
-
if (/^(?:fix|edit|update|change|modify)\s+(?:the\s+)?(?:a\s+)?(?:bug|error|typo|issue)\s+in\s+\S+$/i.test(task)) {
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
// Simple questions — no swarm (unless they contain design/comparison keywords)
|
|
246
|
-
if (/^(?:what|how|why|where|when|who|explain|describe|show|should)\b/i.test(task) &&
|
|
247
|
-
task.length < 100 &&
|
|
248
|
-
!/\b(?:all|every|each|multiple|several|across)\b/i.test(task) &&
|
|
249
|
-
!/\b(?:compare|vs\.?|versus|trade[\s-]?off|design|evaluate)\b/i.test(task) &&
|
|
250
|
-
!/\buse\b.*\bor\b/i.test(task)) {
|
|
251
|
-
return false;
|
|
252
|
-
}
|
|
253
|
-
// Very short tasks — probably simple (exempt pipeline/debate/complex keywords)
|
|
254
|
-
if (task.length < 30 && !/\b(?:refactor|migrate|audit|analyze|review|design|compare|evaluate|debate|then|step\s+\d)\b/i.test(task)) {
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
// Multi-target indicators → swarm-worthy
|
|
258
|
-
if (/\b(?:all|every|each|multiple|several|across|parallel)\b/i.test(lower)) {
|
|
259
|
-
return true;
|
|
260
|
-
}
|
|
261
|
-
// Complex task indicators → swarm-worthy
|
|
262
|
-
if (/\b(?:refactor|migrate|audit|analyze|review|redesign|overhaul|design|compare|evaluate|debate)\b/i.test(lower)) {
|
|
263
|
-
return true;
|
|
264
|
-
}
|
|
265
|
-
// Build/implement/create are swarm-worthy when describing a full system or multi-component work
|
|
266
|
-
if (/\b(?:build(?:ing)?|implement(?:ing)?|creat(?:e|ing))\b/i.test(lower) && /\b(?:full[\s-]?stack|system|platform|entire|multiple|multi[\s-])/i.test(lower)) {
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
// Multi-component implementation: "implement X with API, database, and frontend"
|
|
270
|
-
if (/\b(?:build(?:ing)?|implement(?:ing)?|creat(?:e|ing))\b/i.test(lower) && /\b(?:api|database|frontend|backend|auth|billing|payment)\b/i.test(lower) && /\band\b/i.test(lower)) {
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
// Comparison/decision questions → swarm-worthy (debate topology)
|
|
274
|
-
if (/\bshould\s+(?:we|I)\s+use\b/i.test(lower) && /\bor\b/i.test(lower)) {
|
|
275
|
-
return true;
|
|
276
|
-
}
|
|
277
|
-
// Sequential/pipeline indicators → swarm-worthy
|
|
278
|
-
if (/\bthen\b/i.test(lower) || /\bstep\s+\d/i.test(lower)) {
|
|
279
|
-
return true;
|
|
280
|
-
}
|
|
281
|
-
// Multiple files mentioned → swarm-worthy
|
|
282
|
-
const fileRefs = lower.match(/\b\S+\.\w{1,4}\b/g);
|
|
283
|
-
if (fileRefs && fileRefs.length >= 3) {
|
|
284
|
-
return true;
|
|
285
|
-
}
|
|
286
|
-
// Default: don't use swarm for ambiguous cases
|
|
287
|
-
return false;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Extract task signals from a task description string.
|
|
291
|
-
*
|
|
292
|
-
* Parses file paths, counts, and structural hints from natural language.
|
|
293
|
-
*/
|
|
294
|
-
export function extractSignals(task) {
|
|
295
|
-
const signals = { task };
|
|
296
|
-
// Extract file paths (foo.ts, src/bar.js, etc.)
|
|
297
|
-
const filePattern = /(?:^|\s)((?:[\w./\\-]+\/)?[\w.-]+\.(?:ts|js|tsx|jsx|py|go|rs|java|rb|css|html|json|yaml|yml|md|toml|sql|sh|bash))\b/gi;
|
|
298
|
-
const files = [];
|
|
299
|
-
let match;
|
|
300
|
-
while ((match = filePattern.exec(task)) !== null) {
|
|
301
|
-
files.push(match[1]);
|
|
302
|
-
}
|
|
303
|
-
if (files.length > 0) {
|
|
304
|
-
signals.filePaths = files;
|
|
305
|
-
signals.fileCount = files.length;
|
|
306
|
-
}
|
|
307
|
-
// Detect file/target count from natural language ("10 files", "5 API handlers", "8 database models")
|
|
308
|
-
const countMatch = task.match(/\b(\d+)\s+(?:\w+\s+)?(?:files?|modules?|handlers?|services?|endpoints?|models?|adapters?|components?)\b/i);
|
|
309
|
-
if (countMatch) {
|
|
310
|
-
const count = parseInt(countMatch[1], 10);
|
|
311
|
-
if (count > (signals.fileCount ?? 0)) {
|
|
312
|
-
signals.fileCount = count;
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
// Detect sequential structure
|
|
316
|
-
if (/\bthen\b/i.test(task) || /\bstep\s+\d/i.test(task) || /\bfirst\b.*\bthen\b/i.test(task)) {
|
|
317
|
-
signals.isSequential = true;
|
|
318
|
-
}
|
|
319
|
-
// Detect design decisions
|
|
320
|
-
if (/\b(?:design|architect|decide|choose|compare|evaluate|trade[\s-]?off|pros?\s+(?:and|&|vs)\s+cons?)\b/i.test(task)) {
|
|
321
|
-
signals.isDesignDecision = true;
|
|
322
|
-
}
|
|
323
|
-
return signals;
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Full auto-selection pipeline: task string → topology recommendation.
|
|
327
|
-
*
|
|
328
|
-
* Combines signal extraction, swarm-worthiness check, and topology selection.
|
|
329
|
-
*/
|
|
330
|
-
export function autoSelectTopology(task, options) {
|
|
331
|
-
// First check if this even warrants a swarm
|
|
332
|
-
if (!shouldUseSwarm(task)) {
|
|
333
|
-
return null;
|
|
334
|
-
}
|
|
335
|
-
const signals = extractSignals(task);
|
|
336
|
-
return selectTopology(signals, options);
|
|
337
|
-
}
|
|
338
|
-
//# sourceMappingURL=topology-selector.js.map
|