gm-skill 2.0.2339 → 2.0.2340

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/install.js CHANGED
@@ -7,6 +7,7 @@ const os = require('os');
7
7
  const crypto = require('crypto');
8
8
  const https = require('https');
9
9
  const readline = require('readline');
10
+ const { execFileSync } = require('child_process');
10
11
 
11
12
  function out(msg) { process.stdout.write(msg + '\n'); }
12
13
  function err(msg) { process.stderr.write(msg + '\n'); }
@@ -220,6 +221,38 @@ function sha256Hex(buf) {
220
221
  return crypto.createHash('sha256').update(buf).digest('hex');
221
222
  }
222
223
 
224
+ // Some sandboxed/cloud environments scope-restrict the GitHub REST API
225
+ // (api.github.com) while leaving plain git protocol access unrestricted --
226
+ // `git ls-remote` talks git's own smart-HTTP protocol against github.com,
227
+ // never api.github.com, so it works in exactly that restricted case.
228
+ // The release ASSET download itself (github.com/.../releases/download/...)
229
+ // is also plain unauthenticated HTTPS, not an API call, so once the tag is
230
+ // known this way the rest of downloadAgentplugRunner needs no change.
231
+ function latestReleaseTagViaGitLsRemote(repo) {
232
+ const out = execFileSync('git', ['ls-remote', '--tags', '--refs', `https://github.com/${repo}.git`], {
233
+ encoding: 'utf8',
234
+ stdio: ['ignore', 'pipe', 'ignore'],
235
+ });
236
+ const tags = out.split('\n')
237
+ .map(line => line.match(/refs\/tags\/(.+)$/))
238
+ .filter(Boolean)
239
+ .map(m => m[1]);
240
+ if (tags.length === 0) return null;
241
+ // Release tags here are always `v<semver>`; sort numerically by the
242
+ // dotted version rather than lexically, so v0.1.9 does not sort after
243
+ // v0.1.10.
244
+ tags.sort((a, b) => {
245
+ const pa = a.replace(/^v/, '').split('.').map(Number);
246
+ const pb = b.replace(/^v/, '').split('.').map(Number);
247
+ for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
248
+ const d = (pa[i] || 0) - (pb[i] || 0);
249
+ if (d !== 0) return d;
250
+ }
251
+ return 0;
252
+ });
253
+ return tags[tags.length - 1];
254
+ }
255
+
223
256
  function gmToolsDir() {
224
257
  const home = homeDir();
225
258
  return path.join(home, '.gm-tools');
@@ -245,8 +278,20 @@ async function downloadAgentplugRunner({ silent } = {}) {
245
278
  }
246
279
 
247
280
  try {
248
- const releaseInfo = JSON.parse((await httpsGetBuffer('https://api.github.com/repos/AnEntrypoint/agentplug-bin/releases/latest')).toString('utf8'));
249
- const tag = releaseInfo && releaseInfo.tag_name;
281
+ let tag;
282
+ try {
283
+ const releaseInfo = JSON.parse((await httpsGetBuffer('https://api.github.com/repos/AnEntrypoint/agentplug-bin/releases/latest')).toString('utf8'));
284
+ tag = releaseInfo && releaseInfo.tag_name;
285
+ } catch (apiErr) {
286
+ if (!silent) err(`agentplug-runner: GitHub API tag lookup failed (${apiErr && apiErr.message || apiErr}) -- falling back to git ls-remote (works even when the REST API is scope-restricted, since it only needs plain git protocol access)`);
287
+ try {
288
+ tag = latestReleaseTagViaGitLsRemote('AnEntrypoint/agentplug-bin');
289
+ } catch (gitErr) {
290
+ if (!silent) err(`agentplug-runner: git ls-remote fallback also failed (${gitErr && gitErr.message || gitErr})`);
291
+ throw apiErr;
292
+ }
293
+ if (tag && !silent) out(`agentplug-runner: resolved latest tag ${tag} via git ls-remote`);
294
+ }
250
295
  if (!tag) { if (!silent) err('agentplug-runner: no releases published yet at AnEntrypoint/agentplug-bin, skipping'); return false; }
251
296
  const base = `https://github.com/AnEntrypoint/agentplug-bin/releases/download/${tag}`;
252
297
  const binUrl = `${base}/${assetName}`;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.2339",
3
+ "version": "2.0.2340",
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.2339",
3
+ "version": "2.0.2340",
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.2339",
3
+ "version": "2.0.2340",
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",