gm-skill 2.0.1850 → 2.0.1852
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.
|
@@ -86,6 +86,8 @@ return {logs,errs,net,perf};
|
|
|
86
86
|
|
|
87
87
|
Profile to LOCATE (which call/resource is slow), then eliminate hypotheses by live measurement -- never a/b-test by restarting. The node side mirrors this: `exec_js` with `process.hrtime.bigint()`/`performance.now()` timing, `process.memoryUsage()`, and `stderr` stack capture is a genuine node profiler+debugger.
|
|
88
88
|
|
|
89
|
+
**Process of elimination via monkeypatching is the default diagnostic method, not a last resort.** When a bug's cause is ambiguous among several candidate functions/paths/handlers, wrap each candidate in the live page with an instrumented replacement -- `const orig=obj.method; obj.method=function(...a){console.log('HIT',...a); return orig.apply(this,a);}` -- and observe which fires, with what args, in what order, relative to the symptom. This isolates the guilty call site from real execution instead of guessing from source reading alone or restarting with one hypothesis at a time. Combine with `capture\n` so the injected `console.log` markers land in `debug.console` for free. Patch in the same `page.evaluate` that also reproduces the symptom, so cause and effect are witnessed in one dispatch, not two. Restore or accept the patch is thrown away with the session -- never leave a monkeypatch as the actual fix; once the culprit is isolated, fix it at the source and re-witness clean.
|
|
90
|
+
|
|
89
91
|
## Discipline
|
|
90
92
|
|
|
91
93
|
Never spawn Chromium yourself, `npm i puppeteer`, or shell `chrome.exe`; the verb owns the handle, and bypassing it orphans state plugkit cannot reap and breaks the next session's first read. Navigate by evaluating `location.href = '...'` through the spool; screenshot by dispatching the verb that returns one. A dispatch returning `ok:false` with a launch error is plugkit reporting the environment refused -- read `stderr`, dispatch `instruction`, do not loop the same body.
|
package/gm-plugkit/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1852",
|
|
4
4
|
"description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -746,6 +746,18 @@ function aggregateCpuProfile(profile, topN) {
|
|
|
746
746
|
|
|
747
747
|
const BROWSER_RUNNER_BIN = process.env.GM_BROWSER_RUNNER_BIN || 'playwriter';
|
|
748
748
|
|
|
749
|
+
function findCachedBunRunnerBin() {
|
|
750
|
+
try {
|
|
751
|
+
const cacheDir = path.join(os.homedir(), '.bun', 'install', 'cache');
|
|
752
|
+
const entries = fs.readdirSync(cacheDir).filter(n => n.startsWith(`${BROWSER_RUNNER_BIN}@`));
|
|
753
|
+
for (const name of entries) {
|
|
754
|
+
const binJs = path.join(cacheDir, name, 'bin.js');
|
|
755
|
+
if (fs.existsSync(binJs)) return binJs;
|
|
756
|
+
}
|
|
757
|
+
} catch (_) {}
|
|
758
|
+
return null;
|
|
759
|
+
}
|
|
760
|
+
|
|
749
761
|
function findBrowserRunner() {
|
|
750
762
|
const bunGlobalRoots = [
|
|
751
763
|
path.join(os.homedir(), '.bun', 'install', 'global', 'node_modules', BROWSER_RUNNER_BIN, 'bin.js'),
|
|
@@ -753,6 +765,8 @@ function findBrowserRunner() {
|
|
|
753
765
|
for (const binJs of bunGlobalRoots) {
|
|
754
766
|
if (fs.existsSync(binJs)) return { cmd: process.execPath, baseArgs: [binJs], shell: false };
|
|
755
767
|
}
|
|
768
|
+
const cachedBin = findCachedBunRunnerBin();
|
|
769
|
+
if (cachedBin) return { cmd: process.execPath, baseArgs: [cachedBin], shell: false };
|
|
756
770
|
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
|
|
757
771
|
const bunR = spawnSync(whichCmd, ['bun'], { encoding: 'utf-8', shell: true });
|
|
758
772
|
if (bunR.status === 0 && bunR.stdout.trim()) {
|
|
@@ -829,8 +843,7 @@ function isProfileLocked(profileDir) {
|
|
|
829
843
|
}
|
|
830
844
|
|
|
831
845
|
function sessionProfileSlug(claudeSessionId) {
|
|
832
|
-
|
|
833
|
-
return s || 'default';
|
|
846
|
+
return 'default';
|
|
834
847
|
}
|
|
835
848
|
|
|
836
849
|
function sessionProfileDir(cwd, claudeSessionId) {
|
|
@@ -866,6 +879,7 @@ function cleanDeadProfileFragments(cwd) {
|
|
|
866
879
|
}
|
|
867
880
|
continue;
|
|
868
881
|
}
|
|
882
|
+
if (name === 'browser-profile-default') continue;
|
|
869
883
|
try {
|
|
870
884
|
if (fs.existsSync(dir) && !isProfileLocked(dir)) {
|
|
871
885
|
fs.rmSync(dir, { recursive: true, force: true });
|
|
@@ -3807,7 +3821,7 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
3807
3821
|
}
|
|
3808
3822
|
}, 60_000);
|
|
3809
3823
|
|
|
3810
|
-
const BROWSER_IDLE_LIMIT_MS = parseInt(process.env.PLUGKIT_BROWSER_IDLE_LIMIT_MS, 10) ||
|
|
3824
|
+
const BROWSER_IDLE_LIMIT_MS = parseInt(process.env.PLUGKIT_BROWSER_IDLE_LIMIT_MS, 10) || 5 * 60 * 1000;
|
|
3811
3825
|
setInterval(() => {
|
|
3812
3826
|
try {
|
|
3813
3827
|
const portsFile = browserPortsFile(process.cwd());
|
package/gm.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1852",
|
|
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",
|