gm-skill 2.0.1333 → 2.0.1334

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1333",
3
+ "version": "2.0.1334",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -2577,8 +2577,26 @@ async function runSpoolWatcher(instance, spoolDir) {
2577
2577
  }
2578
2578
  }, 5000);
2579
2579
 
2580
+ let _sweepErrLogged = false;
2580
2581
  setInterval(() => {
2581
2582
  try {
2583
+ if (!fs.existsSync(outDir)) {
2584
+ try {
2585
+ fs.mkdirSync(outDir, { recursive: true });
2586
+ fs.mkdirSync(inDir, { recursive: true });
2587
+ console.log(`[retention] recreated missing spool dirs: ${outDir}, ${inDir}`);
2588
+ logEvent('plugkit', 'spool.dirs-recreated', { outDir, inDir, reason: 'sweep-found-missing' });
2589
+ _sweepErrLogged = false;
2590
+ return;
2591
+ } catch (mke) {
2592
+ if (!_sweepErrLogged) {
2593
+ console.error(`[retention] cannot recreate ${outDir}: ${mke.message}`);
2594
+ logEvent('plugkit', 'spool.dirs-recreate-failed', { outDir, error: mke.message });
2595
+ _sweepErrLogged = true;
2596
+ }
2597
+ return;
2598
+ }
2599
+ }
2582
2600
  const cutoff = Date.now() - 3600_000;
2583
2601
  let swept = 0;
2584
2602
  for (const entry of fs.readdirSync(outDir)) {
@@ -2592,9 +2610,13 @@ async function runSpoolWatcher(instance, spoolDir) {
2592
2610
  console.log(`[retention] swept ${swept} out/ files older than 1h`);
2593
2611
  logEvent('plugkit', 'sweep.retention', { swept });
2594
2612
  }
2613
+ _sweepErrLogged = false;
2595
2614
  } catch (e) {
2596
- console.error(`[retention] sweep error: ${e.message}`);
2597
- logEvent('plugkit', 'sweep.retention.error', { error: String(e.message || e) });
2615
+ if (!_sweepErrLogged) {
2616
+ console.error(`[retention] sweep error: ${e.message}`);
2617
+ logEvent('plugkit', 'sweep.retention.error', { error: String(e.message || e) });
2618
+ _sweepErrLogged = true;
2619
+ }
2598
2620
  }
2599
2621
  }, 60_000);
2600
2622
 
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1333",
3
+ "version": "2.0.1334",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1333",
3
+ "version": "2.0.1334",
4
4
  "description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -38,6 +38,8 @@ bun x gm-plugkit@latest spool > /dev/null 2>&1 &
38
38
 
39
39
  Never poll the spool dir with `sleep && ls` or `Start-Sleep && Test-Path` — plugkit is synchronous from your view; if the response is not there, the watcher is dead (re-check `.status.json` mtime) or the verb is slow (check `.gm/exec-spool/.watcher.log`), not "still processing."
40
40
 
41
+ When writing the spool input from PowerShell, pass `-Encoding utf8` (or use `[System.IO.File]::WriteAllText($path, $body)` which defaults to UTF-8 no-BOM). PowerShell 5.1's default `Out-File` / `Set-Content` write UTF-16 LE with BOM, which the watcher detects and re-decodes (`spool.body-encoding-recoded` event in gmsniff), but the deviation is a fingerprint of an instruction you missed. Use `bash -c "echo -n '...' > ..."` or `Write` tool instead when the body is structured JSON.
42
+
41
43
  First turn body must be `{"prompt":"<user request>"}` so orient_nouns and recall_hits derive from the request; subsequent turns in the same conversation may use empty body `{}`.
42
44
 
43
45
  **Batch writes, waits, and reads together.** Each agent turn costs cycles; the dispatch shape `Write request → wait → Read response` is one logical step, not three. Issue all three in a single message — the Write tool call and the Read tool call go in the same `<function_calls>` block. The Read may return "file does not exist" if plugkit is mid-verb; that's fine, retry with one more Read in the next message rather than spreading the cycle across three turns. Fan-out is the same shape — dispatching three independent verbs (`prd-add g1`, `prd-add g2`, `prd-add g3`) means three Write tool calls in one block, then three Read tool calls in one block. Serial dispatch when you could be parallel is wasted cycles. The only sequencing constraint is real data dependency: if verb B needs the response of verb A, those go in separate turns; otherwise batch.