cawdex 1.35.83 → 1.35.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/swarm.d.ts +1 -0
- package/dist/swarm.js +18 -5
- package/dist/swarm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -83,7 +83,7 @@ import { status as sandboxStatus } from './sandbox.js';
|
|
|
83
83
|
// API key rotation pool (/keys)
|
|
84
84
|
import { listStatus as keyPoolStatus, setPool as syncKeyPool } from './key-rotation.js';
|
|
85
85
|
// Agentic swarm — fan-out concurrent agents on the same task (/swarm)
|
|
86
|
-
import { buildSwarmAgentTask, buildSwarmPlan, clampSwarmMaxAgents, decodeSwarmSentinel, encodeSwarmSentinel, formatSwarmResults, parseSwarmCommandArgs, resolveAgents, runSwarm, } from './swarm.js';
|
|
86
|
+
import { buildSwarmAgentTask, buildSwarmHandoffPrompt, buildSwarmPlan, clampSwarmMaxAgents, decodeSwarmSentinel, encodeSwarmSentinel, formatSwarmResults, parseSwarmCommandArgs, resolveAgents, runSwarm, } from './swarm.js';
|
|
87
87
|
// Voice / accessibility — built-in dictation (Whisper) + readout (ElevenLabs)
|
|
88
88
|
import { printVoiceStatus, isVoiceEnabled, getTtsConfig, getSttConfig, getAccessibilityConfig, speak, dictateOnce, } from './voice.js';
|
|
89
89
|
import { isFfmpegAvailable, audioCue, startRecording, probeMic, micProbeMessage } from './audio.js';
|
|
@@ -1038,7 +1038,8 @@ export function handleSlashCommand(input, config, messages, session, mode) {
|
|
|
1038
1038
|
// silent aliases for power users but are not listed here.
|
|
1039
1039
|
console.log(h('\n ── Orchestration ──'));
|
|
1040
1040
|
console.log(d(' ') + c('/orchestrate <task>') + d(' — decompose into parallel sub-agents'));
|
|
1041
|
-
console.log(d(' ') + c('/swarm <task>') + d(' —
|
|
1041
|
+
console.log(d(' ') + c('/swarm <task>') + d(' — ask setup questions, fan out role agents, then execute from their handoff'));
|
|
1042
|
+
console.log(d(' ') + c('/swarm --plan-only <task>') + d(' — run swarm analysis without auto-executing the handoff'));
|
|
1042
1043
|
console.log(d(' ') + c('/pr-loop') + d(' — autonomous PR review loop'));
|
|
1043
1044
|
console.log(d(' ') + c('/multi-plan <task>') + d(' — multi-agent planning'));
|
|
1044
1045
|
console.log(d(' ') + c('/multi-execute') + d(' — multi-agent execution'));
|
|
@@ -2286,13 +2287,15 @@ export function handleSlashCommand(input, config, messages, session, mode) {
|
|
|
2286
2287
|
return { handled: false, injectPrompt: orchPrompt };
|
|
2287
2288
|
// ── Agentic swarm ─────────────────────────────────
|
|
2288
2289
|
// Default: /swarm <natural task>. Cawdex infers roles, runs them
|
|
2289
|
-
// analysis-only, then
|
|
2290
|
+
// analysis-only, then feeds their synthesis back to the main agent
|
|
2291
|
+
// for execution. Use --plan-only for the older report-only path.
|
|
2290
2292
|
// Expert shortcut remains: /swarm <agent1,agent2> <task>.
|
|
2291
2293
|
case '/swarm': {
|
|
2292
2294
|
const parsed = parseSwarmCommandArgs(args);
|
|
2293
2295
|
if ('error' in parsed) {
|
|
2294
2296
|
console.log(chalk.yellow(` ${parsed.error}`));
|
|
2295
2297
|
console.log(chalk.dim(' Example: /swarm Build a working browser game with tests'));
|
|
2298
|
+
console.log(chalk.dim(' Plan only: /swarm --plan-only Build a working browser game with tests'));
|
|
2296
2299
|
console.log(chalk.dim(' Expert: /swarm code-architect,silent-failure-hunter audit the auth flow'));
|
|
2297
2300
|
return { handled: true };
|
|
2298
2301
|
}
|
|
@@ -5099,6 +5102,22 @@ async function main() {
|
|
|
5099
5102
|
// turns can reason about the consolidated output.
|
|
5100
5103
|
messages.push({ role: 'user', content: `[/swarm ${payload.mode === 'legacy' ? agents.map((a) => a.name).join(',') + ' ' : ''}${plan.task}]` });
|
|
5101
5104
|
messages.push({ role: 'assistant', content: output.slice(0, 8000) });
|
|
5105
|
+
if (payload.execute !== false) {
|
|
5106
|
+
const handoff = buildSwarmHandoffPrompt(plan, results);
|
|
5107
|
+
messages.push({
|
|
5108
|
+
role: 'user',
|
|
5109
|
+
content: 'Proceed with the swarm handoff. Execute the task using the worker findings as context; do not merely summarize them.\n\n' +
|
|
5110
|
+
handoff,
|
|
5111
|
+
});
|
|
5112
|
+
await saveWithSnapshot();
|
|
5113
|
+
const turnConfig = consumeTurnConfig();
|
|
5114
|
+
updateFooter(buildFooterSnapshot(turnConfig, mode.current, session, process.cwd()));
|
|
5115
|
+
await runQuery({ config: turnConfig, messages, cwd: process.cwd(), rl, sessionId: session.id, mode: mode.current });
|
|
5116
|
+
syncFooter();
|
|
5117
|
+
}
|
|
5118
|
+
else {
|
|
5119
|
+
console.log(chalk.dim(' plan-only: handoff saved in session context; no execution turn started.'));
|
|
5120
|
+
}
|
|
5102
5121
|
}
|
|
5103
5122
|
catch (e) {
|
|
5104
5123
|
console.log(chalk.red(` Swarm failed: ${e instanceof Error ? e.message : e}`));
|