opencode-swarm 7.107.1 → 7.107.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.
@@ -2399,11 +2399,12 @@ async function savePlan(directory, plan, options) {
2399
2399
  throw error2;
2400
2400
  }
2401
2401
  }
2402
+ const projectedPlan = await replayFromLedger(directory) ?? validated;
2402
2403
  const SNAPSHOT_INTERVAL = 50;
2403
2404
  const latestSeq = await getLatestLedgerSeq(directory);
2404
2405
  if (latestSeq > 0 && latestSeq % SNAPSHOT_INTERVAL === 0) {
2405
- await takeSnapshotWithRetry(directory, validated, {
2406
- planHashAfter: hashAfter,
2406
+ await takeSnapshotWithRetry(directory, projectedPlan, {
2407
+ planHashAfter: computePlanHash(projectedPlan),
2407
2408
  source: "savePlan_manager"
2408
2409
  });
2409
2410
  }
@@ -2411,7 +2412,7 @@ async function savePlan(directory, plan, options) {
2411
2412
  const planPath = path5.join(swarmDir, "plan.json");
2412
2413
  const tempPath = path5.join(swarmDir, `plan.json.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`);
2413
2414
  try {
2414
- await bunWrite(tempPath, JSON.stringify(validated, null, 2));
2415
+ await bunWrite(tempPath, JSON.stringify(projectedPlan, null, 2));
2415
2416
  renameSync4(tempPath, planPath);
2416
2417
  } finally {
2417
2418
  try {
@@ -2423,15 +2424,15 @@ async function savePlan(directory, plan, options) {
2423
2424
  const inProgressMarker = JSON.stringify({
2424
2425
  source: "plan_manager",
2425
2426
  timestamp: new Date().toISOString(),
2426
- phases_count: validated.phases.length,
2427
- tasks_count: validated.phases.reduce((sum, p) => sum + p.tasks.length, 0),
2427
+ phases_count: projectedPlan.phases.length,
2428
+ tasks_count: projectedPlan.phases.reduce((sum, p) => sum + p.tasks.length, 0),
2428
2429
  in_progress: true
2429
2430
  });
2430
2431
  await bunWrite(markerPath, inProgressMarker);
2431
2432
  } catch {}
2432
2433
  try {
2433
- const contentHash = computePlanContentHash(validated);
2434
- const markdown = derivePlanMarkdown(validated);
2434
+ const contentHash = computePlanContentHash(projectedPlan);
2435
+ const markdown = derivePlanMarkdown(projectedPlan);
2435
2436
  const markdownWithHash = `<!-- PLAN_HASH: ${contentHash} -->
2436
2437
  ${markdown}`;
2437
2438
  const mdPath = path5.join(swarmDir, "plan.md");
@@ -2457,11 +2458,11 @@ ${markdown}`;
2457
2458
  }
2458
2459
  try {
2459
2460
  const markerPath = path5.join(swarmDir, ".plan-write-marker");
2460
- const tasksCount = validated.phases.reduce((sum, phase) => sum + phase.tasks.length, 0);
2461
+ const tasksCount = projectedPlan.phases.reduce((sum, phase) => sum + phase.tasks.length, 0);
2461
2462
  const marker = JSON.stringify({
2462
2463
  source: "plan_manager",
2463
2464
  timestamp: new Date().toISOString(),
2464
- phases_count: validated.phases.length,
2465
+ phases_count: projectedPlan.phases.length,
2465
2466
  tasks_count: tasksCount,
2466
2467
  in_progress: false
2467
2468
  });
@@ -12,7 +12,7 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-gt514nt1.js";
15
+ } from "./index-168p3bfr.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-7v734syt.js";
4
+ } from "./index-jr54w7pb.js";
5
5
  import {
6
6
  handleGuardrailLog
7
7
  } from "./index-w8dzxnx4.js";
@@ -80,9 +80,9 @@ import {
80
80
  handleWriteRetroCommand,
81
81
  normalizeSwarmCommandInput,
82
82
  resolveCommand
83
- } from "./index-gt514nt1.js";
83
+ } from "./index-168p3bfr.js";
84
84
  import"./index-esg1554h.js";
85
- import"./index-jjp5qrjv.js";
85
+ import"./index-f12bmedv.js";
86
86
  import"./index-8w4d325g.js";
87
87
  import"./index-fxtrk7y8.js";
88
88
  import"./index-09xpycan.js";
package/dist/cli/index.js CHANGED
@@ -7,9 +7,9 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-gt514nt1.js";
10
+ } from "./index-168p3bfr.js";
11
11
  import"./index-esg1554h.js";
12
- import"./index-jjp5qrjv.js";
12
+ import"./index-f12bmedv.js";
13
13
  import"./index-8w4d325g.js";
14
14
  import"./index-fxtrk7y8.js";
15
15
  import"./index-09xpycan.js";
@@ -1 +1,2 @@
1
- export declare function handleHandoffCommand(directory: string, _args: string[]): Promise<string>;
1
+ export declare function formatSessionScopedHandoffMarkdown(markdown: string, sessionID?: string): string;
2
+ export declare function handleHandoffCommand(directory: string, _args: string[], sessionID?: string): Promise<string>;
@@ -667,9 +667,9 @@ export declare const COMMAND_REGISTRY: {
667
667
  };
668
668
  readonly rollback: {
669
669
  readonly handler: (ctx: CommandContext) => Promise<string>;
670
- readonly description: "Restore swarm state to a checkpoint <phase>";
671
- readonly details: "Restores .swarm/ state by directly overwriting files from a checkpoint directory (checkpoints/phase-<N>). Writes rollback event to events.jsonl. Without phase argument, lists available checkpoints. Partial failures are reported but processing continues.";
672
- readonly args: "<phase-number>";
670
+ readonly description: "Restore swarm state or project files to a checkpoint";
671
+ readonly details: "Restores legacy .swarm/ phase checkpoints from checkpoints/phase-<N> when present. Otherwise restores named git checkpoints from .swarm/checkpoints.json by label or list number. Writes rollback event to events.jsonl. Without an argument, lists available checkpoints.";
672
+ readonly args: "<phase-number|label|list-number>";
673
673
  readonly category: "utility";
674
674
  readonly toolPolicy: "restricted";
675
675
  };
@@ -890,7 +890,7 @@ export declare const COMMAND_REGISTRY: {
890
890
  readonly checkpoint: {
891
891
  readonly handler: (ctx: CommandContext) => Promise<string>;
892
892
  readonly description: "Manage project checkpoints [save|restore|delete|list] <label>";
893
- readonly details: "save: creates named snapshot of current .swarm/ state. restore: soft-resets to checkpoint by overwriting current .swarm/ files. delete: removes named checkpoint. list: shows all checkpoints with timestamps. All subcommands require a label except list.";
893
+ readonly details: "save: creates named git checkpoint. restore: hard-resets tracked files to the checkpoint. delete: removes named checkpoint metadata. list: shows all checkpoints with timestamps. All subcommands require a label except list.";
894
894
  readonly args: "<save|restore|delete|list> <label>";
895
895
  readonly category: "utility";
896
896
  readonly clashesWithNativeCcCommand: "/checkpoint";
@@ -6,7 +6,6 @@ interface CopyState {
6
6
  interface BundledSkillFile {
7
7
  relativePath: string;
8
8
  }
9
- declare function getSyncCacheKey(projectDirectory: string, packageRoot: string): string;
10
9
  declare function collectBundledSkillFilesBoundedAsync(sourceDir: string, state: CopyState, relativeDir?: string): Promise<BundledSkillFile[]>;
11
10
  /**
12
11
  * Materialize missing built-in mode skills into the target project so architect
@@ -19,13 +18,12 @@ declare function collectBundledSkillFilesBoundedAsync(sourceDir: string, state:
19
18
  * load its SKILL.md without a manual `/swarm` command or session restart; the
20
19
  * command path calls it again as a backstop for pre-existing projects.
21
20
  *
22
- * This is intentionally missing-only and fail-open: custom project skills are
23
- * never overwritten, and any filesystem error leaves command execution fail-open.
21
+ * This is intentionally fail-open: bundled slugs are refreshed from the package
22
+ * source, and any filesystem error leaves command execution fail-open.
24
23
  */
25
24
  export declare function syncBundledProjectSkillsIfMissingAsync(projectDirectory: string, packageRoot: string, quiet?: boolean): Promise<void>;
26
25
  export declare const _test_exports: {
27
26
  collectBundledSkillFilesBoundedAsync: typeof collectBundledSkillFilesBoundedAsync;
28
- getSyncCacheKey: typeof getSyncCacheKey;
29
- resetBundledProjectSkillSyncCache: () => void;
27
+ resetBundledProjectSkillSyncCache: () => undefined;
30
28
  };
31
29
  export {};