gm-skill 2.0.2086 → 2.0.2087

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/bin/bootstrap.js CHANGED
@@ -29,6 +29,8 @@ const {
29
29
  killSpoolWatcherInCwd,
30
30
  proactiveKillForNewInstall,
31
31
  ensureNextStepWiring,
32
+ resolveWindowsExe,
33
+ resolveNpmCliJs,
32
34
  } = shared;
33
35
 
34
36
  const NPM_PACKAGE = 'plugkit-wasm';
@@ -113,25 +115,6 @@ function ensureSkillMdCurrent(wrapperDir) {
113
115
  return { refreshed: allRefreshed };
114
116
  }
115
117
 
116
- function resolveWindowsExe(cmd) {
117
- if (process.platform !== 'win32') return cmd;
118
- try {
119
- const r = spawnSync('where', [cmd], {
120
- encoding: 'utf-8',
121
- stdio: ['ignore', 'pipe', 'ignore'],
122
- windowsHide: true,
123
- timeout: 800,
124
- });
125
- if (r.status !== 0) return cmd;
126
- const lines = (r.stdout || '').split(/\r?\n/).map(l => l.trim()).filter(Boolean);
127
- const exe = lines.find(l => /\.exe$/i.test(l));
128
- const shim = lines.find(l => /\.(cmd|bat)$/i.test(l));
129
- return exe || shim || cmd;
130
- } catch {
131
- return cmd;
132
- }
133
- }
134
-
135
118
  function probeBinaryVersion(binPath) {
136
119
  try {
137
120
  const { spawnSync } = require('child_process');
@@ -209,11 +192,14 @@ async function extractNpmPackageWasm(destPath, version) {
209
192
  log(`extracting npm package ${NPM_PACKAGE}@${version} to ${tempDir}`);
210
193
  obsEvent('bootstrap', 'npm.extract.start', { package: NPM_PACKAGE, version });
211
194
 
212
- const npxResolved = resolveWindowsExe('npx');
213
- const isCmdShim = process.platform === 'win32' && /\.(cmd|bat)$/i.test(npxResolved);
214
- const rawArgs = [NPM_PACKAGE + '@' + version, '--prefix', tempDir];
215
- const spawnCmd = isCmdShim && /\s/.test(npxResolved) ? `"${npxResolved}"` : npxResolved;
216
- const spawnArgs = isCmdShim ? rawArgs.map(a => /[\s"]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a) : rawArgs;
195
+ const npmResolved = resolveWindowsExe('npm');
196
+ const isCmdShim = process.platform === 'win32' && /\.(cmd|bat)$/i.test(npmResolved);
197
+ const npmCliJs = isCmdShim ? resolveNpmCliJs(npmResolved) : null;
198
+ const installArgs = ['install', '--no-audit', '--no-fund', '--no-save', '--prefix', tempDir, NPM_PACKAGE + '@' + version];
199
+
200
+ const spawnCmd = npmCliJs ? process.execPath : (isCmdShim && /\s/.test(npmResolved) ? `"${npmResolved}"` : npmResolved);
201
+ const rawArgs = npmCliJs ? [npmCliJs, ...installArgs] : installArgs;
202
+ const spawnArgs = (isCmdShim && !npmCliJs) ? rawArgs.map(a => /[\s"]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a) : rawArgs;
217
203
  const result = spawnSync(
218
204
  spawnCmd,
219
205
  spawnArgs,
@@ -222,13 +208,13 @@ async function extractNpmPackageWasm(destPath, version) {
222
208
  timeout: ATTEMPT_TIMEOUT_MS,
223
209
  encoding: 'utf8',
224
210
  windowsHide: true,
225
- ...(isCmdShim ? { shell: true } : {}),
211
+ ...((isCmdShim && !npmCliJs) ? { shell: true } : {}),
226
212
  }
227
213
  );
228
214
 
229
215
  if (result.error) throw result.error;
230
216
  if (result.status !== 0) {
231
- throw new Error(`npx extraction failed: ${result.stderr || result.stdout || 'unknown error'}`);
217
+ throw new Error(`npm install extraction failed: ${result.stderr || result.stdout || 'unknown error'}`);
232
218
  }
233
219
 
234
220
  const nodeModulesPath = path.join(tempDir, 'node_modules', NPM_PACKAGE, 'plugkit.wasm');
@@ -29,27 +29,10 @@ const {
29
29
  killSpoolWatcherInCwd,
30
30
  proactiveKillForNewInstall,
31
31
  ensureNextStepWiring: ensureNextStepWiringShared,
32
+ resolveWindowsExe,
33
+ resolveNpmCliJs,
32
34
  } = shared;
33
35
 
34
- function resolveWindowsExe(cmd) {
35
- if (process.platform !== 'win32') return cmd;
36
- try {
37
- const r = spawnSync('where', [cmd], {
38
- encoding: 'utf-8',
39
- stdio: ['ignore', 'pipe', 'ignore'],
40
- windowsHide: true,
41
- timeout: 800,
42
- });
43
- if (r.status !== 0) return cmd;
44
- const lines = (r.stdout || '').split(/\r?\n/).map(l => l.trim()).filter(Boolean);
45
- const exe = lines.find(l => /\.exe$/i.test(l));
46
- const shim = lines.find(l => /\.(cmd|bat)$/i.test(l));
47
- return exe || shim || cmd;
48
- } catch {
49
- return cmd;
50
- }
51
- }
52
-
53
36
  const NPM_PACKAGE = 'plugkit-wasm';
54
37
  const ATTEMPT_TIMEOUT_MS = 10 * 60 * 1000;
55
38
  const MAX_ATTEMPTS = 3;
@@ -248,11 +231,13 @@ async function extractNpmPackageWasm(destPath, version) {
248
231
  fs.writeFileSync(path.join(tempDir, 'package.json'), JSON.stringify({ name: 'plugkit-extract', version: '0.0.0', private: true }));
249
232
 
250
233
  const cmd = resolveWindowsExe('npm');
251
- const args = ['install', '--no-audit', '--no-fund', '--no-save', NPM_PACKAGE + '@' + version];
234
+ const installArgs = ['install', '--no-audit', '--no-fund', '--no-save', NPM_PACKAGE + '@' + version];
252
235
  const isCmdShim = process.platform === 'win32' && /\.(cmd|bat)$/i.test(cmd);
236
+ const npmCliJs = isCmdShim ? resolveNpmCliJs(cmd) : null;
253
237
 
254
- const spawnCmd = isCmdShim ? `"${cmd}"` : cmd;
255
- const spawnArgs = isCmdShim ? args.map(a => /[\s"]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a) : args;
238
+ const spawnCmd = npmCliJs ? process.execPath : (isCmdShim ? `"${cmd}"` : cmd);
239
+ const rawArgs = npmCliJs ? [npmCliJs, ...installArgs] : installArgs;
240
+ const spawnArgs = (isCmdShim && !npmCliJs) ? rawArgs.map(a => /[\s"]/.test(a) ? `"${a.replace(/"/g, '\\"')}"` : a) : rawArgs;
256
241
 
257
242
  const result = spawnSync(spawnCmd, spawnArgs, {
258
243
  cwd: tempDir,
@@ -260,7 +245,7 @@ async function extractNpmPackageWasm(destPath, version) {
260
245
  timeout: ATTEMPT_TIMEOUT_MS,
261
246
  encoding: 'utf8',
262
247
  windowsHide: true,
263
- ...(isCmdShim ? { shell: true } : {}),
248
+ ...((isCmdShim && !npmCliJs) ? { shell: true } : {}),
264
249
  });
265
250
 
266
251
  if (result.error) throw result.error;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.2086",
3
+ "version": "2.0.2087",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform wasm, verifies SHA256, and launches agentplug-runner (the native wasm host) as the spool watcher daemon.",
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.2086",
3
+ "version": "2.0.2087",
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.2086",
3
+ "version": "2.0.2087",
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",