opencode-swarm-plugin 0.57.6 → 0.58.4
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/bin/swarm.ts +350 -8
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/README.md +187 -0
- package/claude-plugin/agents/worker.md +1 -0
- package/claude-plugin/dist/index.js +214 -47
- package/claude-plugin/hooks/hooks.json +67 -0
- package/claude-plugin/skills/release/SKILL.md +101 -0
- package/claude-plugin/skills/swarm-cli/SKILL.md +82 -0
- package/dist/bin/swarm.js +682 -103
- package/dist/hive.d.ts.map +1 -1
- package/dist/hive.js +34 -8
- package/dist/index.js +198 -47
- package/dist/marketplace/index.js +214 -47
- package/dist/plugin.js +198 -47
- package/dist/query-tools.d.ts +4 -4
- package/dist/query-tools.d.ts.map +1 -1
- package/dist/rate-limiter.d.ts +2 -0
- package/dist/rate-limiter.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/storage.d.ts.map +1 -1
- package/dist/swarm-decompose.d.ts.map +1 -1
- package/dist/swarm-orchestrate.d.ts.map +1 -1
- package/dist/swarm-prompts.d.ts +1 -1
- package/dist/swarm-prompts.d.ts.map +1 -1
- package/dist/swarm-prompts.js +147 -39
- package/dist/tool-availability.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/swarm-prompts.js
CHANGED
|
@@ -17875,13 +17875,13 @@ Scripts run in the skill's directory with the project directory as an argument.`
|
|
|
17875
17875
|
}
|
|
17876
17876
|
const scriptPath = join3(skill.directory, "scripts", args.script);
|
|
17877
17877
|
const scriptArgs = args.args || [];
|
|
17878
|
+
const TIMEOUT_MS = 60000;
|
|
17879
|
+
const proc = Bun.spawn([scriptPath, skillsProjectDirectory, ...scriptArgs], {
|
|
17880
|
+
cwd: skill.directory,
|
|
17881
|
+
stdout: "pipe",
|
|
17882
|
+
stderr: "pipe"
|
|
17883
|
+
});
|
|
17878
17884
|
try {
|
|
17879
|
-
const TIMEOUT_MS = 60000;
|
|
17880
|
-
const proc = Bun.spawn([scriptPath, skillsProjectDirectory, ...scriptArgs], {
|
|
17881
|
-
cwd: skill.directory,
|
|
17882
|
-
stdout: "pipe",
|
|
17883
|
-
stderr: "pipe"
|
|
17884
|
-
});
|
|
17885
17885
|
const timeoutPromise = new Promise((resolve2) => {
|
|
17886
17886
|
setTimeout(() => resolve2({ timedOut: true }), TIMEOUT_MS);
|
|
17887
17887
|
});
|
|
@@ -17895,7 +17895,6 @@ Scripts run in the skill's directory with the project directory as an argument.`
|
|
|
17895
17895
|
})();
|
|
17896
17896
|
const result = await Promise.race([resultPromise, timeoutPromise]);
|
|
17897
17897
|
if (result.timedOut) {
|
|
17898
|
-
proc.kill();
|
|
17899
17898
|
return `Script timed out after ${TIMEOUT_MS / 1000} seconds.`;
|
|
17900
17899
|
}
|
|
17901
17900
|
const output = result.stdout + result.stderr;
|
|
@@ -17907,6 +17906,8 @@ ${output}`;
|
|
|
17907
17906
|
}
|
|
17908
17907
|
} catch (error45) {
|
|
17909
17908
|
return `Failed to execute script: ${error45 instanceof Error ? error45.message : String(error45)}`;
|
|
17909
|
+
} finally {
|
|
17910
|
+
proc.kill();
|
|
17910
17911
|
}
|
|
17911
17912
|
}
|
|
17912
17913
|
});
|
|
@@ -18809,9 +18810,11 @@ async function execSemanticMemory(args) {
|
|
|
18809
18810
|
stderr: "pipe"
|
|
18810
18811
|
});
|
|
18811
18812
|
try {
|
|
18813
|
+
const TIMEOUT_MS = 30000;
|
|
18814
|
+
const timeoutPromise = new Promise((_, reject) => setTimeout(() => reject(new Error("Process timed out after 30s")), TIMEOUT_MS));
|
|
18812
18815
|
const stdout = Buffer.from(await new Response(proc.stdout).arrayBuffer());
|
|
18813
18816
|
const stderr = Buffer.from(await new Response(proc.stderr).arrayBuffer());
|
|
18814
|
-
const exitCode = await proc.exited;
|
|
18817
|
+
const exitCode = await Promise.race([proc.exited, timeoutPromise]);
|
|
18815
18818
|
return { exitCode, stdout, stderr };
|
|
18816
18819
|
} finally {
|
|
18817
18820
|
proc.kill();
|
|
@@ -39785,13 +39788,17 @@ var toolCheckers = {
|
|
|
39785
39788
|
stderr: "pipe"
|
|
39786
39789
|
});
|
|
39787
39790
|
const timeout = setTimeout(() => proc.kill(), BUNX_TIMEOUT_MS);
|
|
39788
|
-
|
|
39789
|
-
|
|
39790
|
-
|
|
39791
|
-
|
|
39792
|
-
|
|
39793
|
-
|
|
39794
|
-
|
|
39791
|
+
try {
|
|
39792
|
+
const exitCode = await proc.exited;
|
|
39793
|
+
return {
|
|
39794
|
+
available: exitCode === 0,
|
|
39795
|
+
checkedAt: new Date().toISOString(),
|
|
39796
|
+
version: "bunx"
|
|
39797
|
+
};
|
|
39798
|
+
} finally {
|
|
39799
|
+
clearTimeout(timeout);
|
|
39800
|
+
proc.kill();
|
|
39801
|
+
}
|
|
39795
39802
|
} catch (e) {
|
|
39796
39803
|
return {
|
|
39797
39804
|
available: false,
|
|
@@ -39864,13 +39871,17 @@ var toolCheckers = {
|
|
|
39864
39871
|
stderr: "pipe"
|
|
39865
39872
|
});
|
|
39866
39873
|
const timeout = setTimeout(() => proc.kill(), BUNX_TIMEOUT_MS);
|
|
39867
|
-
|
|
39868
|
-
|
|
39869
|
-
|
|
39870
|
-
|
|
39871
|
-
|
|
39872
|
-
|
|
39873
|
-
|
|
39874
|
+
try {
|
|
39875
|
+
const exitCode = await proc.exited;
|
|
39876
|
+
return {
|
|
39877
|
+
available: exitCode === 0,
|
|
39878
|
+
checkedAt: new Date().toISOString(),
|
|
39879
|
+
version: "bunx-semantic-memory"
|
|
39880
|
+
};
|
|
39881
|
+
} finally {
|
|
39882
|
+
clearTimeout(timeout);
|
|
39883
|
+
proc.kill();
|
|
39884
|
+
}
|
|
39874
39885
|
} catch (e) {
|
|
39875
39886
|
return {
|
|
39876
39887
|
available: false,
|
|
@@ -40034,12 +40045,16 @@ async function runGitCommand(args) {
|
|
|
40034
40045
|
stdout: "pipe",
|
|
40035
40046
|
stderr: "pipe"
|
|
40036
40047
|
});
|
|
40037
|
-
|
|
40038
|
-
|
|
40039
|
-
|
|
40040
|
-
|
|
40041
|
-
|
|
40042
|
-
|
|
40048
|
+
try {
|
|
40049
|
+
const [stdout, stderr] = await Promise.all([
|
|
40050
|
+
new Response(proc.stdout).text(),
|
|
40051
|
+
new Response(proc.stderr).text()
|
|
40052
|
+
]);
|
|
40053
|
+
const exitCode = await proc.exited;
|
|
40054
|
+
return { exitCode, stdout, stderr };
|
|
40055
|
+
} finally {
|
|
40056
|
+
proc.kill();
|
|
40057
|
+
}
|
|
40043
40058
|
}
|
|
40044
40059
|
|
|
40045
40060
|
class HiveError extends Error {
|
|
@@ -40196,9 +40211,9 @@ var hive_create = tool({
|
|
|
40196
40211
|
}
|
|
40197
40212
|
});
|
|
40198
40213
|
var hive_create_epic = tool({
|
|
40199
|
-
description: "Create epic with subtasks
|
|
40214
|
+
description: "Create epic with subtasks atomically. REQUIRED: epic_title, subtasks (array with {title, files?}). Use after swarm_validate_decomposition confirms your decomposition is valid. Each subtask should list files it will modify to enable parallel work without conflicts.",
|
|
40200
40215
|
args: {
|
|
40201
|
-
epic_title: tool.schema.string().describe("Epic title"),
|
|
40216
|
+
epic_title: tool.schema.string().describe("Epic title (e.g., 'Implement user auth')"),
|
|
40202
40217
|
epic_description: tool.schema.string().optional().describe("Epic description"),
|
|
40203
40218
|
epic_id: tool.schema.string().optional().describe("Custom ID for the epic (e.g., 'phase-0')"),
|
|
40204
40219
|
subtasks: tool.schema.array(tool.schema.object({
|
|
@@ -40217,6 +40232,28 @@ var hive_create_epic = tool({
|
|
|
40217
40232
|
}).optional().describe("Recovery context from checkpoint compaction")
|
|
40218
40233
|
},
|
|
40219
40234
|
async execute(args, ctx) {
|
|
40235
|
+
const missing = [];
|
|
40236
|
+
if (!args.epic_title)
|
|
40237
|
+
missing.push("epic_title");
|
|
40238
|
+
if (!args.subtasks || args.subtasks.length === 0)
|
|
40239
|
+
missing.push("subtasks (array of subtask objects)");
|
|
40240
|
+
if (missing.length > 0) {
|
|
40241
|
+
return JSON.stringify({
|
|
40242
|
+
success: false,
|
|
40243
|
+
error: `Missing required parameters: ${missing.join(", ")}`,
|
|
40244
|
+
hint: "hive_create_epic creates an epic with subtasks atomically.",
|
|
40245
|
+
example: {
|
|
40246
|
+
epic_title: "Implement user authentication",
|
|
40247
|
+
epic_description: "Add login, logout, and session management",
|
|
40248
|
+
subtasks: [
|
|
40249
|
+
{ title: "Create auth service", files: ["src/auth/service.ts"] },
|
|
40250
|
+
{ title: "Add login endpoint", files: ["src/api/login.ts"] },
|
|
40251
|
+
{ title: "Add session middleware", files: ["src/middleware/session.ts"] }
|
|
40252
|
+
]
|
|
40253
|
+
},
|
|
40254
|
+
tip: "Each subtask should have a title and optionally files it will modify. This helps with file reservation and parallel execution."
|
|
40255
|
+
}, null, 2);
|
|
40256
|
+
}
|
|
40220
40257
|
const validated = EpicCreateArgsSchema.parse(args);
|
|
40221
40258
|
const projectKey = getHiveWorkingDirectory();
|
|
40222
40259
|
const adapter = await getHiveAdapter(projectKey);
|
|
@@ -42207,17 +42244,41 @@ var swarm_status = tool({
|
|
|
42207
42244
|
}
|
|
42208
42245
|
});
|
|
42209
42246
|
var swarm_progress = tool({
|
|
42210
|
-
description: "Report progress on a subtask to coordinator",
|
|
42247
|
+
description: "Report progress on a subtask to coordinator. REQUIRED: project_key, agent_name, bead_id, status. Call periodically (every 25% or when blocked) to keep coordinator informed. Use status='blocked' with message explaining the blocker if you're stuck.",
|
|
42211
42248
|
args: {
|
|
42212
|
-
project_key: tool.schema.string().describe("Project path"),
|
|
42213
|
-
agent_name: tool.schema.string().describe("Your
|
|
42214
|
-
bead_id: tool.schema.string().describe("
|
|
42249
|
+
project_key: tool.schema.string().describe("Project path (e.g., '/Users/name/project')"),
|
|
42250
|
+
agent_name: tool.schema.string().describe("Your agent name from swarmmail_init"),
|
|
42251
|
+
bead_id: tool.schema.string().describe("Task ID from your spawn prompt or hive cell"),
|
|
42215
42252
|
status: tool.schema.enum(["in_progress", "blocked", "completed", "failed"]).describe("Current status"),
|
|
42216
42253
|
message: tool.schema.string().optional().describe("Progress message or blockers"),
|
|
42217
42254
|
progress_percent: tool.schema.number().min(0).max(100).optional().describe("Completion percentage"),
|
|
42218
42255
|
files_touched: tool.schema.array(tool.schema.string()).optional().describe("Files modified so far")
|
|
42219
42256
|
},
|
|
42220
42257
|
async execute(args) {
|
|
42258
|
+
const missing = [];
|
|
42259
|
+
if (!args.bead_id)
|
|
42260
|
+
missing.push("bead_id");
|
|
42261
|
+
if (!args.project_key)
|
|
42262
|
+
missing.push("project_key");
|
|
42263
|
+
if (!args.agent_name)
|
|
42264
|
+
missing.push("agent_name");
|
|
42265
|
+
if (!args.status)
|
|
42266
|
+
missing.push("status");
|
|
42267
|
+
if (missing.length > 0) {
|
|
42268
|
+
return JSON.stringify({
|
|
42269
|
+
success: false,
|
|
42270
|
+
error: `Missing required parameters: ${missing.join(", ")}`,
|
|
42271
|
+
hint: "swarm_progress reports task progress to the coordinator.",
|
|
42272
|
+
example: {
|
|
42273
|
+
project_key: "/path/to/project",
|
|
42274
|
+
agent_name: "your-agent-name",
|
|
42275
|
+
bead_id: "your-task-id from spawn",
|
|
42276
|
+
status: "in_progress",
|
|
42277
|
+
progress_percent: 50,
|
|
42278
|
+
message: "Completed X, working on Y"
|
|
42279
|
+
}
|
|
42280
|
+
}, null, 2);
|
|
42281
|
+
}
|
|
42221
42282
|
const progress = {
|
|
42222
42283
|
bead_id: args.bead_id,
|
|
42223
42284
|
agent_name: args.agent_name,
|
|
@@ -42343,12 +42404,12 @@ ${args.files_affected.map((f) => `- \`${f}\``).join(`
|
|
|
42343
42404
|
}
|
|
42344
42405
|
});
|
|
42345
42406
|
var swarm_complete = tool({
|
|
42346
|
-
description: "Mark subtask complete with Verification Gate. Runs typecheck
|
|
42407
|
+
description: "Mark subtask complete with Verification Gate. REQUIRED: project_key, agent_name, bead_id (from your task assignment), summary, start_time (Date.now() from when you started). Before calling: 1) hivemind_store your learnings, 2) list files_touched for verification. Runs typecheck/tests before finalizing.",
|
|
42347
42408
|
args: {
|
|
42348
|
-
project_key: tool.schema.string().describe("Project path"),
|
|
42349
|
-
agent_name: tool.schema.string().describe("Your
|
|
42350
|
-
bead_id: tool.schema.string().describe("
|
|
42351
|
-
summary: tool.schema.string().describe("
|
|
42409
|
+
project_key: tool.schema.string().describe("Project path (e.g., '/Users/name/project')"),
|
|
42410
|
+
agent_name: tool.schema.string().describe("Your agent name from swarmmail_init"),
|
|
42411
|
+
bead_id: tool.schema.string().describe("Task ID from your spawn prompt or hive cell"),
|
|
42412
|
+
summary: tool.schema.string().describe("What you accomplished (1-3 sentences)"),
|
|
42352
42413
|
evaluation: tool.schema.string().optional().describe("Self-evaluation JSON (Evaluation schema)"),
|
|
42353
42414
|
files_touched: tool.schema.array(tool.schema.string()).optional().describe("Files modified - will be verified (typecheck, tests)"),
|
|
42354
42415
|
skip_verification: tool.schema.boolean().optional().describe("Skip ALL verification (typecheck, tests). Use sparingly! (default: false)"),
|
|
@@ -42359,6 +42420,33 @@ var swarm_complete = tool({
|
|
|
42359
42420
|
skip_review: tool.schema.boolean().optional().describe("Skip review gate check (default: false). Use only for tasks that don't require coordinator review.")
|
|
42360
42421
|
},
|
|
42361
42422
|
async execute(args, _ctx) {
|
|
42423
|
+
const missing = [];
|
|
42424
|
+
if (!args.bead_id)
|
|
42425
|
+
missing.push("bead_id");
|
|
42426
|
+
if (!args.project_key)
|
|
42427
|
+
missing.push("project_key");
|
|
42428
|
+
if (!args.agent_name)
|
|
42429
|
+
missing.push("agent_name");
|
|
42430
|
+
if (!args.summary)
|
|
42431
|
+
missing.push("summary");
|
|
42432
|
+
if (args.start_time === undefined)
|
|
42433
|
+
missing.push("start_time");
|
|
42434
|
+
if (missing.length > 0) {
|
|
42435
|
+
return JSON.stringify({
|
|
42436
|
+
success: false,
|
|
42437
|
+
error: `Missing required parameters: ${missing.join(", ")}`,
|
|
42438
|
+
hint: "swarm_complete marks a subtask as done. All parameters are required.",
|
|
42439
|
+
example: {
|
|
42440
|
+
project_key: "/path/to/project",
|
|
42441
|
+
agent_name: "your-agent-name",
|
|
42442
|
+
bead_id: "epic-id.subtask-num OR cell-id from hive",
|
|
42443
|
+
summary: "Brief description of what you completed",
|
|
42444
|
+
start_time: Date.now(),
|
|
42445
|
+
files_touched: ["src/file1.ts", "src/file2.ts"]
|
|
42446
|
+
},
|
|
42447
|
+
tip: "The bead_id comes from swarm_spawn_subtask or hive_create. Check your task assignment for the correct ID."
|
|
42448
|
+
}, null, 2);
|
|
42449
|
+
}
|
|
42362
42450
|
const epicId = args.bead_id.includes(".") ? args.bead_id.split(".")[0] : args.bead_id;
|
|
42363
42451
|
if (!args.skip_review) {
|
|
42364
42452
|
const reviewStatusResult = getReviewStatus(args.bead_id);
|
|
@@ -43746,6 +43834,26 @@ Before writing code:
|
|
|
43746
43834
|
Begin work on your subtask now.`;
|
|
43747
43835
|
var SUBTASK_PROMPT_V2 = `You are a swarm agent working on: **{subtask_title}**
|
|
43748
43836
|
|
|
43837
|
+
╔═══════════════════════════════════════════════════════════════════════════════╗
|
|
43838
|
+
║ ║
|
|
43839
|
+
║ \uD83D\uDED1 STOP - READ THIS FIRST - BEFORE ANY EDIT OR WRITE \uD83D\uDED1 ║
|
|
43840
|
+
║ ║
|
|
43841
|
+
║ You MUST do these 3 things BEFORE your first Edit/Write call: ║
|
|
43842
|
+
║ ║
|
|
43843
|
+
║ 1️⃣ hivemind_find(query="<your task keywords>", limit=5, expand=true) ║
|
|
43844
|
+
║ → Check if past agents already solved this ║
|
|
43845
|
+
║ → Find gotchas, patterns, warnings ║
|
|
43846
|
+
║ ║
|
|
43847
|
+
║ 2️⃣ skills_list() then skills_use(name="<relevant>") ║
|
|
43848
|
+
║ → testing-patterns, swarm-coordination, system-design ║
|
|
43849
|
+
║ ║
|
|
43850
|
+
║ 3️⃣ swarmmail_send(to=["coordinator"], ...) when blocked ║
|
|
43851
|
+
║ → Don't spin >5min - ASK FOR HELP ║
|
|
43852
|
+
║ ║
|
|
43853
|
+
║ SKIPPING THESE = wasted time repeating solved problems ║
|
|
43854
|
+
║ ║
|
|
43855
|
+
╚═══════════════════════════════════════════════════════════════════════════════╝
|
|
43856
|
+
|
|
43749
43857
|
## [IDENTITY]
|
|
43750
43858
|
Agent: (assigned at spawn)
|
|
43751
43859
|
Cell: {bead_id}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-availability.d.ts","sourceRoot":"","sources":["../src/tool-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,MAAM,MAAM,QAAQ,GAChB,iBAAiB,GACjB,MAAM,GACN,UAAU,GACV,MAAM,GACN,OAAO,GACP,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;
|
|
1
|
+
{"version":3,"file":"tool-availability.d.ts","sourceRoot":"","sources":["../src/tool-availability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAUH,MAAM,MAAM,QAAQ,GAChB,iBAAiB,GACjB,MAAM,GACN,UAAU,GACV,MAAM,GACN,OAAO,GACP,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AA6RD;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAWnE;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAGtE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,QAAQ,GACb,OAAO,CAAC,gBAAgB,CAAC,CAO3B;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAC5C,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAChC,CA0BA;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAQpD;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/D;AAED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACxB,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,CAAC,CASZ;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACvB,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CASxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,GAC5C,MAAM,CAWR"}
|
package/package.json
CHANGED