opencode-swarm 6.31.1 → 6.31.3
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/cli/index.js +19 -17
- package/dist/index.js +20 -18
- package/dist/plan/manager.d.ts +3 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -16237,32 +16237,34 @@ async function loadPlan(directory) {
|
|
|
16237
16237
|
}
|
|
16238
16238
|
return null;
|
|
16239
16239
|
}
|
|
16240
|
-
async function savePlan(directory, plan) {
|
|
16240
|
+
async function savePlan(directory, plan, options) {
|
|
16241
16241
|
if (directory === null || directory === undefined || typeof directory !== "string" || directory.trim().length === 0) {
|
|
16242
16242
|
throw new Error(`Invalid directory: directory must be a non-empty string`);
|
|
16243
16243
|
}
|
|
16244
16244
|
const validated = PlanSchema.parse(plan);
|
|
16245
|
-
|
|
16246
|
-
|
|
16247
|
-
|
|
16248
|
-
|
|
16249
|
-
|
|
16250
|
-
for (const
|
|
16251
|
-
if (task.status === "completed")
|
|
16252
|
-
completedTaskIds.add(task.id);
|
|
16253
|
-
}
|
|
16254
|
-
}
|
|
16255
|
-
if (completedTaskIds.size > 0) {
|
|
16256
|
-
for (const phase of validated.phases) {
|
|
16245
|
+
if (options?.preserveCompletedStatuses !== false) {
|
|
16246
|
+
try {
|
|
16247
|
+
const currentPlan = await loadPlanJsonOnly(directory);
|
|
16248
|
+
if (currentPlan) {
|
|
16249
|
+
const completedTaskIds = new Set;
|
|
16250
|
+
for (const phase of currentPlan.phases) {
|
|
16257
16251
|
for (const task of phase.tasks) {
|
|
16258
|
-
if (
|
|
16259
|
-
task.
|
|
16252
|
+
if (task.status === "completed")
|
|
16253
|
+
completedTaskIds.add(task.id);
|
|
16254
|
+
}
|
|
16255
|
+
}
|
|
16256
|
+
if (completedTaskIds.size > 0) {
|
|
16257
|
+
for (const phase of validated.phases) {
|
|
16258
|
+
for (const task of phase.tasks) {
|
|
16259
|
+
if (completedTaskIds.has(task.id) && task.status !== "completed") {
|
|
16260
|
+
task.status = "completed";
|
|
16261
|
+
}
|
|
16260
16262
|
}
|
|
16261
16263
|
}
|
|
16262
16264
|
}
|
|
16263
16265
|
}
|
|
16264
|
-
}
|
|
16265
|
-
}
|
|
16266
|
+
} catch {}
|
|
16267
|
+
}
|
|
16266
16268
|
for (const phase of validated.phases) {
|
|
16267
16269
|
const tasks = phase.tasks;
|
|
16268
16270
|
if (tasks.length > 0 && tasks.every((t) => t.status === "completed")) {
|
package/dist/index.js
CHANGED
|
@@ -15790,32 +15790,34 @@ async function loadPlan(directory) {
|
|
|
15790
15790
|
}
|
|
15791
15791
|
return null;
|
|
15792
15792
|
}
|
|
15793
|
-
async function savePlan(directory, plan) {
|
|
15793
|
+
async function savePlan(directory, plan, options) {
|
|
15794
15794
|
if (directory === null || directory === undefined || typeof directory !== "string" || directory.trim().length === 0) {
|
|
15795
15795
|
throw new Error(`Invalid directory: directory must be a non-empty string`);
|
|
15796
15796
|
}
|
|
15797
15797
|
const validated = PlanSchema.parse(plan);
|
|
15798
|
-
|
|
15799
|
-
|
|
15800
|
-
|
|
15801
|
-
|
|
15802
|
-
|
|
15803
|
-
for (const
|
|
15804
|
-
if (task.status === "completed")
|
|
15805
|
-
completedTaskIds.add(task.id);
|
|
15806
|
-
}
|
|
15807
|
-
}
|
|
15808
|
-
if (completedTaskIds.size > 0) {
|
|
15809
|
-
for (const phase of validated.phases) {
|
|
15798
|
+
if (options?.preserveCompletedStatuses !== false) {
|
|
15799
|
+
try {
|
|
15800
|
+
const currentPlan = await loadPlanJsonOnly(directory);
|
|
15801
|
+
if (currentPlan) {
|
|
15802
|
+
const completedTaskIds = new Set;
|
|
15803
|
+
for (const phase of currentPlan.phases) {
|
|
15810
15804
|
for (const task of phase.tasks) {
|
|
15811
|
-
if (
|
|
15812
|
-
task.
|
|
15805
|
+
if (task.status === "completed")
|
|
15806
|
+
completedTaskIds.add(task.id);
|
|
15807
|
+
}
|
|
15808
|
+
}
|
|
15809
|
+
if (completedTaskIds.size > 0) {
|
|
15810
|
+
for (const phase of validated.phases) {
|
|
15811
|
+
for (const task of phase.tasks) {
|
|
15812
|
+
if (completedTaskIds.has(task.id) && task.status !== "completed") {
|
|
15813
|
+
task.status = "completed";
|
|
15814
|
+
}
|
|
15813
15815
|
}
|
|
15814
15816
|
}
|
|
15815
15817
|
}
|
|
15816
15818
|
}
|
|
15817
|
-
}
|
|
15818
|
-
}
|
|
15819
|
+
} catch {}
|
|
15820
|
+
}
|
|
15819
15821
|
for (const phase of validated.phases) {
|
|
15820
15822
|
const tasks = phase.tasks;
|
|
15821
15823
|
if (tasks.length > 0 && tasks.every((t) => t.status === "completed")) {
|
|
@@ -15901,7 +15903,7 @@ async function updateTaskStatus(directory, taskId, status) {
|
|
|
15901
15903
|
throw new Error(`Task not found: ${taskId}`);
|
|
15902
15904
|
}
|
|
15903
15905
|
const updatedPlan = { ...plan, phases: updatedPhases };
|
|
15904
|
-
await savePlan(directory, updatedPlan);
|
|
15906
|
+
await savePlan(directory, updatedPlan, { preserveCompletedStatuses: false });
|
|
15905
15907
|
return updatedPlan;
|
|
15906
15908
|
}
|
|
15907
15909
|
function derivePlanMarkdown(plan) {
|
package/dist/plan/manager.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ export declare function loadPlan(directory: string): Promise<Plan | null>;
|
|
|
23
23
|
* Validate against PlanSchema (throw on invalid), write to .swarm/plan.json via atomic temp+rename pattern,
|
|
24
24
|
* then derive and write .swarm/plan.md
|
|
25
25
|
*/
|
|
26
|
-
export declare function savePlan(directory: string, plan: Plan
|
|
26
|
+
export declare function savePlan(directory: string, plan: Plan, options?: {
|
|
27
|
+
preserveCompletedStatuses?: boolean;
|
|
28
|
+
}): Promise<void>;
|
|
27
29
|
/**
|
|
28
30
|
* Load plan → find task by ID → update status → save → return updated plan.
|
|
29
31
|
* Throw if plan not found or task not found.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.31.
|
|
3
|
+
"version": "6.31.3",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|