gm-skill 2.0.1167 → 2.0.1168

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.1167` — auto-bumped from the canonical `gm` repo. Every push to `AnEntrypoint/gm` (or any cascading sibling crate) republishes this package.
38
+ `2.0.1168` — 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
 
@@ -56,10 +56,11 @@ function turnTick(sess, verb, taskBase, phase) {
56
56
  if (phase) { t.phases.add(phase); t.lastPhase = phase; }
57
57
  }
58
58
 
59
- let __sessCache = { value: '', mtimeMs: 0, readAt: 0 };
59
+ let __sessCache = { value: '', mtimeMs: 0, readAt: 0, srcMtimeMs: 0 };
60
60
  function readCurrentSess() {
61
61
  const now = Date.now();
62
62
  if (now - __sessCache.readAt < 1000) return __sessCache.value;
63
+ let found = '';
63
64
  try {
64
65
  const p = path.join(process.cwd(), '.gm', 'exec-spool', '.session-current');
65
66
  const st = fs.statSync(p);
@@ -67,9 +68,24 @@ function readCurrentSess() {
67
68
  __sessCache.value = fs.readFileSync(p, 'utf8').trim();
68
69
  __sessCache.mtimeMs = st.mtimeMs;
69
70
  }
71
+ found = __sessCache.value;
70
72
  } catch (_) {}
73
+ if (!found) {
74
+ try {
75
+ const sp = path.join(process.cwd(), '.gm', 'turn-state.json');
76
+ const st = fs.statSync(sp);
77
+ if (st.mtimeMs !== __sessCache.srcMtimeMs) {
78
+ const obj = JSON.parse(fs.readFileSync(sp, 'utf8'));
79
+ if (obj && typeof obj.session_id === 'string') found = obj.session_id;
80
+ __sessCache.srcMtimeMs = st.mtimeMs;
81
+ } else if (__sessCache.value) {
82
+ found = __sessCache.value;
83
+ }
84
+ } catch (_) {}
85
+ }
71
86
  __sessCache.readAt = now;
72
- return __sessCache.value || process.env.CLAUDE_SESSION_ID || process.env.GM_SESSION_ID || '';
87
+ __sessCache.value = found || process.env.CLAUDE_SESSION_ID || process.env.GM_SESSION_ID || '';
88
+ return __sessCache.value;
73
89
  }
74
90
 
75
91
  function logEvent(sub, event, fields) {
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1167",
3
+ "version": "2.0.1168",
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.1167",
3
+ "version": "2.0.1168",
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.1167"
42
+ "gm-plugkit": "^2.0.1168"
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=16.0.0"