gm-qwen 2.0.797 → 2.0.799
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 +59 -3
- package/bin/plugkit.js +13 -3
- package/bin/plugkit.sha256 +6 -6
- package/bin/plugkit.version +1 -1
- package/bin/rtk.sha256 +6 -0
- package/bin/rtk.version +1 -0
- package/gm.json +2 -2
- package/package.json +1 -1
- package/skills/gm/SKILL.md +2 -0
- package/skills/planning/SKILL.md +2 -0
package/bin/bootstrap.js
CHANGED
|
@@ -32,6 +32,11 @@ function binaryName() {
|
|
|
32
32
|
return key.startsWith('win32') ? `plugkit-${key}.exe` : `plugkit-${key}`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
function rtkBinaryName() {
|
|
36
|
+
const key = platformKey();
|
|
37
|
+
return key.startsWith('win32') ? `rtk-${key}.exe` : `rtk-${key}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
function cacheRoot() {
|
|
36
41
|
const home = os.homedir();
|
|
37
42
|
if (process.env.PLUGKIT_CACHE_DIR) return process.env.PLUGKIT_CACHE_DIR;
|
|
@@ -58,8 +63,8 @@ function readVersionFile(wrapperDir) {
|
|
|
58
63
|
return fs.readFileSync(p, 'utf8').trim();
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
function readShaManifest(wrapperDir) {
|
|
62
|
-
const p = path.join(wrapperDir, 'plugkit.sha256');
|
|
66
|
+
function readShaManifest(wrapperDir, manifestName) {
|
|
67
|
+
const p = path.join(wrapperDir, manifestName || 'plugkit.sha256');
|
|
63
68
|
if (!fs.existsSync(p)) return null;
|
|
64
69
|
const out = {};
|
|
65
70
|
for (const line of fs.readFileSync(p, 'utf8').split(/\r?\n/)) {
|
|
@@ -275,12 +280,63 @@ async function bootstrap(opts) {
|
|
|
275
280
|
fs.writeFileSync(okSentinel, new Date().toISOString());
|
|
276
281
|
log(`installed ${finalPath}`);
|
|
277
282
|
pruneOldVersions(root, version);
|
|
283
|
+
// Best-effort rtk fetch: failures here never block plugkit usage
|
|
284
|
+
try { await bootstrapRtk(verDir, version, wrapperDir, opts.silent); }
|
|
285
|
+
catch (err) { log(`rtk fetch skipped: ${err.message}`); }
|
|
278
286
|
return finalPath;
|
|
279
287
|
} finally {
|
|
280
288
|
releaseLock(lockPath);
|
|
281
289
|
}
|
|
282
290
|
}
|
|
283
291
|
|
|
292
|
+
async function bootstrapRtk(verDir, version, wrapperDir, silent) {
|
|
293
|
+
const rtkName = rtkBinaryName();
|
|
294
|
+
const rtkPath = path.join(verDir, rtkName);
|
|
295
|
+
const rtkOk = path.join(verDir, '.rtk-ok');
|
|
296
|
+
if (fs.existsSync(rtkPath) && fs.existsSync(rtkOk)) {
|
|
297
|
+
if (!silent) log(`rtk cache hit: ${rtkPath}`);
|
|
298
|
+
return rtkPath;
|
|
299
|
+
}
|
|
300
|
+
const rtkSha = readShaManifest(wrapperDir, 'rtk.sha256');
|
|
301
|
+
const expected = rtkSha ? rtkSha[rtkName] : null;
|
|
302
|
+
const tmp = `${rtkPath}.partial`;
|
|
303
|
+
const url = `https://github.com/${RELEASE_REPO}/releases/download/v${version}/${rtkName}`;
|
|
304
|
+
await downloadWithRetry(url, tmp);
|
|
305
|
+
if (expected) {
|
|
306
|
+
const got = await sha256OfFile(tmp);
|
|
307
|
+
if (got !== expected) {
|
|
308
|
+
try { fs.unlinkSync(tmp); } catch (_) {}
|
|
309
|
+
throw new Error(`rtk sha256 mismatch: expected ${expected}, got ${got}`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
try { fs.renameSync(tmp, rtkPath); }
|
|
313
|
+
catch (err) {
|
|
314
|
+
if (err.code === 'EEXIST' || err.code === 'EPERM') {
|
|
315
|
+
try { fs.unlinkSync(rtkPath); } catch (_) {}
|
|
316
|
+
fs.renameSync(tmp, rtkPath);
|
|
317
|
+
} else throw err;
|
|
318
|
+
}
|
|
319
|
+
if (os.platform() !== 'win32') { try { fs.chmodSync(rtkPath, 0o755); } catch (_) {} }
|
|
320
|
+
fs.writeFileSync(rtkOk, new Date().toISOString());
|
|
321
|
+
log(`installed ${rtkPath}`);
|
|
322
|
+
return rtkPath;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function resolveCachedRtk(opts) {
|
|
326
|
+
opts = opts || {};
|
|
327
|
+
const wrapperDir = opts.wrapperDir || __dirname;
|
|
328
|
+
const version = opts.version || readVersionFile(wrapperDir);
|
|
329
|
+
const root = (() => {
|
|
330
|
+
try { const r = cacheRoot(); ensureDir(r); return r; }
|
|
331
|
+
catch (_) { const r = fallbackCacheRoot(); ensureDir(r); return r; }
|
|
332
|
+
})();
|
|
333
|
+
const verDir = path.join(root, `v${version}`);
|
|
334
|
+
const rtkPath = path.join(verDir, rtkBinaryName());
|
|
335
|
+
const rtkOk = path.join(verDir, '.rtk-ok');
|
|
336
|
+
if (fs.existsSync(rtkPath) && fs.existsSync(rtkOk)) return rtkPath;
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
|
|
284
340
|
function resolveCachedBinary(opts) {
|
|
285
341
|
opts = opts || {};
|
|
286
342
|
const wrapperDir = opts.wrapperDir || __dirname;
|
|
@@ -296,7 +352,7 @@ function resolveCachedBinary(opts) {
|
|
|
296
352
|
return null;
|
|
297
353
|
}
|
|
298
354
|
|
|
299
|
-
module.exports = { bootstrap, resolveCachedBinary, platformKey, binaryName, cacheRoot };
|
|
355
|
+
module.exports = { bootstrap, resolveCachedBinary, resolveCachedRtk, platformKey, binaryName, rtkBinaryName, cacheRoot };
|
|
300
356
|
|
|
301
357
|
if (require.main === module) {
|
|
302
358
|
bootstrap({ silent: false })
|
package/bin/plugkit.js
CHANGED
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
const { spawn, spawnSync } = require('child_process');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const fs = require('fs');
|
|
6
|
-
const { bootstrap, resolveCachedBinary } = require('./bootstrap');
|
|
6
|
+
const { bootstrap, resolveCachedBinary, resolveCachedRtk } = require('./bootstrap');
|
|
7
7
|
|
|
8
8
|
const dir = __dirname;
|
|
9
9
|
|
|
10
|
+
function envWithRtkOnPath() {
|
|
11
|
+
const rtkPath = resolveCachedRtk({ wrapperDir: dir });
|
|
12
|
+
if (!rtkPath) return process.env;
|
|
13
|
+
const rtkDir = path.dirname(rtkPath);
|
|
14
|
+
const sep = process.platform === 'win32' ? ';' : ':';
|
|
15
|
+
return { ...process.env, PATH: `${rtkDir}${sep}${process.env.PATH || ''}` };
|
|
16
|
+
}
|
|
17
|
+
|
|
10
18
|
async function resolveBinary() {
|
|
11
19
|
const cached = resolveCachedBinary({ wrapperDir: dir });
|
|
12
20
|
if (cached) return cached;
|
|
@@ -27,18 +35,20 @@ async function main() {
|
|
|
27
35
|
else process.exit(1);
|
|
28
36
|
}
|
|
29
37
|
|
|
38
|
+
const env = envWithRtkOnPath();
|
|
39
|
+
|
|
30
40
|
if (isHook && !process.stdin.isTTY) {
|
|
31
41
|
const chunks = [];
|
|
32
42
|
process.stdin.on('data', c => chunks.push(c));
|
|
33
43
|
process.stdin.on('end', () => {
|
|
34
|
-
const child = spawn(bin, args, { stdio: ['pipe', 'inherit', 'inherit'], windowsHide: true });
|
|
44
|
+
const child = spawn(bin, args, { stdio: ['pipe', 'inherit', 'inherit'], windowsHide: true, env });
|
|
35
45
|
child.stdin.end(Buffer.concat(chunks));
|
|
36
46
|
child.on('close', code => process.exit(code ?? 1));
|
|
37
47
|
child.on('error', () => process.exit(1));
|
|
38
48
|
});
|
|
39
49
|
process.stdin.on('error', () => process.exit(1));
|
|
40
50
|
} else {
|
|
41
|
-
const result = spawnSync(bin, args, { stdio: 'inherit', windowsHide: true });
|
|
51
|
+
const result = spawnSync(bin, args, { stdio: 'inherit', windowsHide: true, env });
|
|
42
52
|
process.exit(result.status ?? 1);
|
|
43
53
|
}
|
|
44
54
|
}
|
package/bin/plugkit.sha256
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
142fd0fd408b9eee594c407b7cb7ca028a56f5973d1f5a7ae0a23d53777c50e7 plugkit-win32-x64.exe
|
|
2
|
+
250fd4917801bd6e269dfb0b936bc42048738dbf6cf2d8e2121f959ac84d33e3 plugkit-win32-arm64.exe
|
|
3
|
+
566e01efb8663828fed8e66c03015011ea0f715e36be0cd407bd029c104ad369 plugkit-darwin-x64
|
|
4
|
+
a5c516bd6a1be23cc0dc8e7f5d8c16c5a80930fcc1040c56fd85a7063c550a86 plugkit-darwin-arm64
|
|
5
|
+
1a9697bfca3a07614da5080828c26268905a84e7fe09003d5fc738f18cbe10bd plugkit-linux-x64
|
|
6
|
+
c6a3bff26e9d039c1abba8ab2218d22b25195e8f5efd55023fd8bb5e8516d0e8 plugkit-linux-arm64
|
package/bin/plugkit.version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.259
|
package/bin/rtk.sha256
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
986bf1dac917fd8e6ee5b14b2686aff49e26341923b45d77187dc4e6bf993d6c rtk-win32-x64.exe
|
|
2
|
+
3bdb09ac8553288eb3a8df3a4514db906217f9dd29acfcb4cdc22d95ea08ec10 rtk-win32-arm64.exe
|
|
3
|
+
e89fdf402c28796b510587a8b0fe046438b5b24d49533d1a2339a48aecae35e9 rtk-darwin-x64
|
|
4
|
+
2b203fd380f5782b5489eb016e34e3dbf848272a7fadf36b39bce6cfd9a3005c rtk-darwin-arm64
|
|
5
|
+
0da9950b859c7a2693aaf6c169f05f9b8965508ba1f23f1547e63d5fa988749e rtk-linux-x64
|
|
6
|
+
690b82a0f1aecb0f8baef8653f9e8bcf4d5aa60217198edce2d7e5b40f4fa29f rtk-linux-arm64
|
package/bin/rtk.version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.38.0
|
package/gm.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.799",
|
|
4
4
|
"description": "State machine agent with hooks, skills, and automated git enforcement",
|
|
5
5
|
"author": "AnEntrypoint",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
-
"plugkitVersion": "0.1.
|
|
26
|
+
"plugkitVersion": "0.1.259"
|
|
27
27
|
}
|
package/package.json
CHANGED
package/skills/gm/SKILL.md
CHANGED
|
@@ -41,6 +41,8 @@ Multiple facts → parallel Agent calls in ONE message. End-of-turn: scan for un
|
|
|
41
41
|
|
|
42
42
|
## AUTONOMY — HARD RULE
|
|
43
43
|
|
|
44
|
+
**USER REQUEST = AUTHORIZATION — HARD RULE.** The user's first message asking for X *is* the approval to do X. Re-asking "want me to do X?", "should I proceed with X?", "which shape of X do you want?" after the user already said "do X" is forced closure dressed as deference — the user already authorized the work and waits while the agent stalls. The PRD is *how* the agent records the authorization, not a second permission gate; the agent writes it and proceeds. Surfacing tradeoffs is allowed *inside* the same chain (one sentence: "going with shape A because Y") so the user can interrupt — never as a stop-and-wait. The bar to legitimately ask before starting is the same bar that applies mid-chain: destructive-irreversible AND not covered by the request, OR genuinely ambiguous *intent* (not "which of two viable approaches"). Defaulting to the deeper / more thorough / cross-repo shape when the user said "deeply integrate" is the obvious read of the request — pick it and execute. Multi-repo scope, build cost, and CI duration are never grounds to re-confirm.
|
|
45
|
+
|
|
44
46
|
A written PRD is the user's authorization. Once it exists, EXECUTE owns the work to COMPLETE. Resolve every doubt that arises during execution by witnessed probe, by recall, or by re-reading the PRD — never by asking the user. Any question whose answer the agent could obtain itself is a question the agent owes itself, not the user.
|
|
45
47
|
|
|
46
48
|
**FINISH ALL REMAINING STEPS — HARD RULE**: when a request enumerates or implies multiple work items ("all", "any", "everything", "the rest", "remaining"), or after a covering family is constructed under MAXIMAL COVER, the agent finishes every witnessable item in the same turn. Stopping after one item to ask "which next?" is forbidden — the answer is *all of them*, in one chain, until `.gm/prd.yml` is empty and git is clean and pushed. Mid-chain "should I…", "want me to…", "which would you like…" prompts are forced closure; replace them with the next skill invocation.
|
package/skills/planning/SKILL.md
CHANGED
|
@@ -43,6 +43,8 @@ Runs until: .gm/prd.yml empty AND git clean AND all pushes confirmed AND CI gree
|
|
|
43
43
|
|
|
44
44
|
## AUTONOMY — HARD RULE
|
|
45
45
|
|
|
46
|
+
**USER REQUEST = AUTHORIZATION.** The user's message asking for X is the green light. PLAN's job is to translate that ask into a PRD and start — not to re-confirm. "Want me to do X?", "should I take shape A or B?", "this is multi-repo work, OK to proceed?" after the user said "do X" are all forced closure. When the user surfaces a tradeoff (deep vs light, single-file vs cross-repo), pick the read that matches the obvious meaning of the request — "deeply integrate" means deep, "all platforms" means all — declare the choice in one line ("going with A because Y") and execute. Multi-repo scope, build cost, CI duration, binary-size impact, and "this will take a while" are never grounds to re-confirm. The user already knows; that's why they asked.
|
|
47
|
+
|
|
46
48
|
PRD written → execute to COMPLETE without asking the user. Doubts that arise during execution are resolved by witnessed probe, by recall, or by re-reading the PRD — never by asking. Any question whose answer is reachable from the agent's tools belongs to the agent, not the user.
|
|
47
49
|
|
|
48
50
|
Asking is last-resort: destructive-irreversible without PRD coverage, OR user intent irrecoverable from PRD/memory/code/web. Channel: `exec:pause` (renames `prd.yml` → `prd.paused.yml`; question in header). In-conversation asking is last-resort beneath last-resort.
|