gm-skill 2.0.1147 → 2.0.1148

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/README.md CHANGED
@@ -35,7 +35,7 @@ An earlier generation fanned out fifteen per-platform downstream repos (gm-cc, g
35
35
 
36
36
  ## Version
37
37
 
38
- `2.0.1147` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
38
+ `2.0.1148` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
39
39
 
40
40
  ## Source of truth
41
41
 
package/gm-plugkit/cli.js CHANGED
@@ -1,18 +1,52 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- const { ensureReady, startSpoolDaemon, getBinaryPath, isReady } = require('./bootstrap');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { ensureReady, startSpoolDaemon } = require('./bootstrap');
5
7
 
6
8
  const usage = `gm-plugkit — Bootstrap and daemon-spawn for gm plugkit binary.
7
9
 
8
10
  Usage:
9
11
  bun x gm-plugkit@latest Bootstrap + start spool daemon
10
- bun x gm-plugkit@latest --daemon Same as default
11
- bun x gm-plugkit@latest --binary Print binary path only
12
- bun x gm-plugkit@latest --status JSON status check
13
- bun x gm-plugkit@latest --help Show this help
12
+ bun x gm-plugkit@latest spool Same as default (explicit)
13
+ bun x gm-plugkit@latest --daemon Same as default
14
+ bun x gm-plugkit@latest --binary Print binary path only
15
+ bun x gm-plugkit@latest --status JSON status check
16
+ bun x gm-plugkit@latest --help Show this help
14
17
  `;
15
18
 
19
+ function spoolDir() {
20
+ const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
21
+ return path.join(projectDir, '.gm', 'exec-spool');
22
+ }
23
+
24
+ function ensureSpoolDir() {
25
+ try { fs.mkdirSync(spoolDir(), { recursive: true }); } catch (_) {}
26
+ }
27
+
28
+ function writeCliStatus(spec) {
29
+ try {
30
+ ensureSpoolDir();
31
+ fs.writeFileSync(
32
+ path.join(spoolDir(), '.cli-status.json'),
33
+ JSON.stringify({ ts: new Date().toISOString(), pid: process.pid, ...spec }, null, 2)
34
+ );
35
+ } catch (_) {}
36
+ }
37
+
38
+ function writeCliError(phase, err) {
39
+ try {
40
+ ensureSpoolDir();
41
+ const msg = err && err.message ? err.message : String(err);
42
+ const stack = err && err.stack ? err.stack : null;
43
+ fs.writeFileSync(
44
+ path.join(spoolDir(), '.bootstrap-error.json'),
45
+ JSON.stringify({ ts: new Date().toISOString(), pid: process.pid, error_phase: phase, error_message: msg, stack }, null, 2)
46
+ );
47
+ } catch (_) {}
48
+ }
49
+
16
50
  (async () => {
17
51
  const args = process.argv.slice(2);
18
52
 
@@ -21,28 +55,54 @@ Usage:
21
55
  process.exit(0);
22
56
  }
23
57
 
58
+ ensureSpoolDir();
59
+ writeCliStatus({ phase: 'starting', args });
60
+
61
+ let bootstrapResult;
24
62
  try {
25
- const result = await ensureReady();
26
- if (!result.ok) {
27
- console.error('Bootstrap failed:', result.error);
28
- process.exit(1);
29
- }
30
-
31
- const daemon = startSpoolDaemon();
32
- if (!daemon.ok) {
33
- console.error('Daemon start failed:', daemon.error);
34
- process.exit(1);
35
- }
36
-
37
- console.log(JSON.stringify({
38
- ok: true,
39
- binary: result.binaryPath,
40
- daemon: daemon,
41
- message: 'plugkit ready, spool watcher running'
42
- }));
43
- process.exit(0);
63
+ bootstrapResult = await ensureReady();
64
+ } catch (err) {
65
+ writeCliError('ensure-ready', err);
66
+ console.error('Bootstrap failed:', err.message);
67
+ process.exit(1);
68
+ }
69
+
70
+ if (!bootstrapResult || !bootstrapResult.ok) {
71
+ const errMsg = (bootstrapResult && bootstrapResult.error) || 'ensureReady returned non-ok';
72
+ writeCliError('ensure-ready', new Error(errMsg));
73
+ console.error('Bootstrap failed:', errMsg);
74
+ process.exit(1);
75
+ }
76
+
77
+ writeCliStatus({ phase: 'bootstrapped', version: bootstrapResult.version, binary: bootstrapResult.binaryPath });
78
+
79
+ let daemon;
80
+ try {
81
+ daemon = startSpoolDaemon();
44
82
  } catch (err) {
45
- console.error('gm-plugkit failed:', err.message);
83
+ writeCliError('start-daemon', err);
84
+ console.error('Daemon start failed:', err.message);
46
85
  process.exit(1);
47
86
  }
48
- })();
87
+
88
+ if (!daemon || !daemon.ok) {
89
+ const errMsg = (daemon && daemon.error) || 'startSpoolDaemon returned non-ok';
90
+ writeCliError('start-daemon', new Error(errMsg));
91
+ console.error('Daemon start failed:', errMsg);
92
+ process.exit(1);
93
+ }
94
+
95
+ writeCliStatus({ phase: 'ready', version: bootstrapResult.version, daemon_pid: daemon.pid, log: daemon.logPath });
96
+
97
+ console.log(JSON.stringify({
98
+ ok: true,
99
+ binary: bootstrapResult.binaryPath,
100
+ daemon,
101
+ message: 'plugkit ready, spool watcher running'
102
+ }));
103
+ process.exit(0);
104
+ })().catch((err) => {
105
+ writeCliError('uncaught', err);
106
+ console.error('gm-plugkit failed:', err && err.message ? err.message : err);
107
+ process.exit(1);
108
+ });
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1147",
3
+ "version": "2.0.1148",
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.1147",
3
+ "version": "2.0.1148",
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",
@@ -39,7 +39,7 @@
39
39
  "gm.json"
40
40
  ],
41
41
  "dependencies": {
42
- "gm-plugkit": "^2.0.1147"
42
+ "gm-plugkit": "^2.0.1148"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=16.0.0"
@@ -18,7 +18,11 @@ bun x gm-plugkit@latest spool > /dev/null 2>&1 &
18
18
 
19
19
  If `bun` is not available, fall back to `npx -y gm-plugkit@latest spool > /dev/null 2>&1 &` or to the local wrapper if it's already installed: `node ~/.claude/gm-tools/plugkit-wasm-wrapper.js spool > /dev/null 2>&1 &`. The wrapper has a self-heal: if it detects a `LinkError` or missing wasm at instantiation, it re-runs bootstrap automatically and retries.
20
20
 
21
- Wait 2 seconds, verify `.status.json` is fresh. Then proceed.
21
+ Wait 2 seconds, then verify boot:
22
+
23
+ - Read `.gm/exec-spool/.cli-status.json` — the launcher writes its phase here (`starting` → `bootstrapped` → `ready`). Present with `phase: "ready"` = good.
24
+ - Read `.gm/exec-spool/.status.json` — the watcher writes its heartbeat here every 5s. Fresh `ts` (within 15s) = watcher alive.
25
+ - If neither file exists or `.cli-status.json` is stuck at an earlier phase, read `.gm/exec-spool/.bootstrap-error.json` — the launcher writes `{error_phase, error_message, stack}` on any failure even when stdout/stderr were redirected to `/dev/null`. Also read `.gm/exec-spool/.watcher.log` for the post-spawn trace. Surface the error to the user; do not retry blindly.
22
26
 
23
27
  ## Plugkit version updates
24
28