opencode-swarm 7.108.0 → 7.109.0

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.
@@ -203,6 +203,21 @@ export interface ReadEffectiveSpecOpts {
203
203
  * `.specify/` a non-competing source, matching both citations.
204
204
  */
205
205
  export declare function readEffectiveSpecSync(directory: string, opts?: ReadEffectiveSpecOpts): EffectiveSpec | null;
206
+ /**
207
+ * Write an SDD projection to `.swarm/spec.md`.
208
+ *
209
+ * **Overwrite enforcement (FR-004, TOCTOU-safe):**
210
+ * When `overwrite` is `false` (default), the write uses `O_EXCL` exclusive
211
+ * creation (`fs.writeFileSync(target, data, { flag: 'wx' })`). If the
212
+ * target already exists the kernel returns `EEXIST` and the function
213
+ * returns `written: false` with an `error` field — no archive, no replace.
214
+ * This closes the TOCTOU race at the write boundary: a native spec that
215
+ * appears between a pre-check and this call cannot be silently replaced.
216
+ *
217
+ * When `overwrite` is `true`, the existing archive-then-replace path runs.
218
+ *
219
+ * The `--dry-run` early-return remains untouched (before any write).
220
+ */
206
221
  export declare function writeProjectedSpecSync(directory: string, options?: {
207
222
  changeId?: string;
208
223
  dryRun?: boolean;
@@ -210,11 +225,17 @@ export declare function writeProjectedSpecSync(directory: string, options?: {
210
225
  source?: 'openspec' | 'speckit';
211
226
  /** Feature selector forwarded to buildSpeckitProjectionSync when source is speckit. */
212
227
  feature?: string;
228
+ /**
229
+ * When true, archive the existing spec and overwrite.
230
+ * When false (default), use O_EXCL (wx flag) — refuse if target exists.
231
+ */
232
+ overwrite?: boolean;
213
233
  }): {
214
234
  written: boolean;
215
235
  projection: EffectiveSpec | null;
216
236
  archivePath?: string;
217
237
  path: string;
238
+ error?: string;
218
239
  };
219
240
  /**
220
241
  * Validate Spec-Kit artifacts READ-ONLY (FR-007, task 2.3).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.108.0",
3
+ "version": "7.109.0",
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",