gm-skill 2.0.1847 → 2.0.1848

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/gm-plugkit/cli.js CHANGED
@@ -151,20 +151,6 @@ function statusServing(st, freshMs) {
151
151
  return Number.isFinite(st.ts) && (now - st.ts) < freshMs;
152
152
  }
153
153
 
154
- function sleepSync(ms) {
155
- Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
156
- }
157
-
158
- function waitForWatcherHeartbeat(dir, deadlineMs, freshMs) {
159
- const t0 = Date.now();
160
- while (Date.now() - t0 < deadlineMs) {
161
- const st = readStatus(dir);
162
- if (statusServing(st, freshMs)) return st;
163
- sleepSync(300);
164
- }
165
- return null;
166
- }
167
-
168
154
  function ensureSpoolDir() {
169
155
  try { fs.mkdirSync(spoolDir(), { recursive: true }); } catch (_) {}
170
156
  }
@@ -285,22 +271,21 @@ function writeCliError(phase, err) {
285
271
  process.exit(1);
286
272
  }
287
273
 
288
- const serving = waitForWatcherHeartbeat(spoolDir(), 30000, 12000);
289
- if (!serving) {
290
- const errMsg = `watcher spawned (pid=${daemon.pid}) but .status.json heartbeat not fresh within 30s`;
291
- writeCliError('watcher-heartbeat-timeout', new Error(errMsg));
292
- console.error('Daemon start failed:', errMsg);
293
- process.exit(1);
294
- }
295
-
296
- writeCliStatus({ phase: 'ready', version: bootstrapResult.version, daemon_pid: daemon.pid, watcher_pid: serving.pid, log: daemon.logPath });
274
+ // Fire-and-forget: the daemon child is already detached+unref'd by
275
+ // startSpoolDaemon(), so the CLI process itself has nothing left to do.
276
+ // Waiting here for a heartbeat confirmation (removed) used to block the
277
+ // calling shell for the full bootstrap+first-heartbeat duration -- up to
278
+ // 30s on a healthy boot, worse on a slow/degraded one -- holding up every
279
+ // caller even though the daemon spawn itself is near-instant. A caller
280
+ // that needs serving-confirmation reads .gm/exec-spool/.status.json
281
+ // directly (ts freshness) rather than blocking this call on it.
282
+ writeCliStatus({ phase: 'daemon-spawned', version: bootstrapResult.version, daemon_pid: daemon.pid, log: daemon.logPath });
297
283
 
298
284
  console.log(JSON.stringify({
299
285
  ok: true,
300
286
  binary: bootstrapResult.binaryPath,
301
287
  daemon,
302
- watcher_pid: serving.pid,
303
- message: 'plugkit ready, spool watcher serving'
288
+ message: 'plugkit daemon spawned, not yet confirmed serving -- check .gm/exec-spool/.status.json for heartbeat freshness'
304
289
  }));
305
290
  process.exit(0);
306
291
  })().catch((err) => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1847",
3
+ "version": "2.0.1848",
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": {
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1847",
3
+ "version": "2.0.1848",
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.1847",
3
+ "version": "2.0.1848",
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",
@@ -52,7 +52,7 @@ cat .gm/exec-spool/.status.json 2>/dev/null; echo ---; cat .gm/exec-spool/.turn-
52
52
  bun x gm-plugkit@latest spool
53
53
  ```
54
54
 
55
- (`npx -y gm-plugkit@latest spool` if no `bun`.) Atomic: daemonizes watcher, blocks until `.status.json` heartbeats fresh, returns only on serving (exit 0) or loud timeout. No `&`, no `sleep`, no re-`cat` -- returns, you write to `instruction/` directly. (Already-alive watcher returns at once.)
55
+ (`npx -y gm-plugkit@latest spool` if no `bun`.) Fire-and-forget: spawns the detached daemon and returns immediately (already-alive watcher also returns at once, unchanged) -- it does NOT wait for the watcher to confirm serving. No `&`, no `sleep`, no re-`cat`; write your first verb to `in/` right after it returns. A first-read "file does not exist" on that verb is normal (the just-spawned watcher hasn't noticed the file yet) -- re-Read next message, same as any dead-watcher-adjacent recheck. If you need to actively confirm serving before dispatching (rare), read `.gm/exec-spool/.status.json` yourself and check `ts` freshness.
56
56
 
57
57
  **Dispatch shape: Write request + Read response, SAME tool-call block.** Never proceed/narrate/begin work before reading the response and following its `instruction` field. First-read "file does not exist" mid-verb = normal, re-Read next message. Never poll with `sleep && ls` -- plugkit is synchronous; missing response = dead watcher (recheck `ts`) or slow verb, never "still processing."
58
58