gm-skill 2.0.1625 → 2.0.1626

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1625",
3
+ "version": "2.0.1626",
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": {
@@ -2131,8 +2131,12 @@ function makeHostFunctions(instanceRef) {
2131
2131
  const modeMatch = evalBody.match(/^(capture|profile)[ \t]*\n([\s\S]*)$/);
2132
2132
  const debugSetup = `const __logs=[],__errs=[],__net=[];\n`
2133
2133
  + `try{page.on('console',m=>{try{__logs.push({type:m.type(),text:m.text()});}catch(_){}});`
2134
- + `page.on('pageerror',e=>{try{__errs.push(String(e&&e.message||e));}catch(_){}});`
2135
- + `page.on('requestfinished',r=>{try{const t=r.timing();__net.push({url:String(r.url()).slice(0,120),dur_ms:Math.round(t.responseEnd),ttfb_ms:Math.round(t.responseStart)});}catch(_){}});}catch(_){}\n`;
2134
+ + `page.on('pageerror',e=>{try{__errs.push({type:'pageerror',msg:String(e&&e.message||e)});}catch(_){}});`
2135
+ + `page.on('error',e=>{try{__errs.push({type:'uncaught',msg:String(e&&e.message||e),stack:String(e&&e.stack||'')});}catch(_){}});`
2136
+ + `page.on('requestfinished',r=>{try{const t=r.timing();__net.push({url:String(r.url()).slice(0,120),dur_ms:Math.round(t.responseEnd),ttfb_ms:Math.round(t.responseStart)});}catch(_){}});`
2137
+ + `page.on('requestfailed',r=>{try{const err=r.failure();__errs.push({type:'fetch',msg:String(err&&err.errorText||'request failed'),url:String(r.url()).slice(0,120)});}catch(_){}});`
2138
+ + `page.evaluateOnNewDocument(()=>{window.__gmErrors=[];window.onerror=(msg,src,line,col,err)=>{try{window.__gmErrors.push({type:'error',msg:String(msg),src:String(src).slice(0,80),line,col,stack:String(err&&err.stack||'')});}catch(_){};return false;};window.onunhandledrejection=(e)=>{try{window.__gmErrors.push({type:'unhandledRejection',msg:String(e.reason&&e.reason.message||e.reason),stack:String(e.reason&&e.reason.stack||'')});}catch(_){}};});`
2139
+ + `}catch(_){}\n`;
2136
2140
  const perfRead = `let __perf=null;try{__perf=await page.evaluate(()=>{const n=performance.getEntriesByType('navigation')[0];return n?{load_ms:Math.round(n.loadEventEnd||0),dcl_ms:Math.round(n.domContentLoadedEventEnd||0),resources:performance.getEntriesByType('resource').length,now:Math.round(performance.now())}:null;});}catch(_){}\n`;
2137
2141
  const blankProbe = startUrl ? '' : `try{const __u=page.url();if(__u==='about:blank'||__u===''){console.error('__GM_BLANK__');}}catch(_){}\n`;
2138
2142
  if (modeMatch && modeMatch[1] === 'profile') {
@@ -2142,18 +2146,22 @@ function makeHostFunctions(instanceRef) {
2142
2146
  + `let __profile=null,__profileError=null;\n`
2143
2147
  + `let __cdp=null;\n`
2144
2148
  + `try{__cdp=await page.context().newCDPSession(page);await __cdp.send('Profiler.enable');await __cdp.send('Profiler.setSamplingInterval',{interval:${intervalUs}});await __cdp.send('Profiler.start');}catch(e){__profileError=String(e&&e.message||e);__cdp=null;}\n`
2145
- + `const __result = await (async () => {\n${blankProbe}${gotoPrefix}${userScript}\n})();\n`
2149
+ + `const __result = await (async () => {\n${blankProbe}${gotoPrefix}try{${userScript}}catch(e){__errs.push({type:'exec',msg:String(e&&e.message||e),stack:String(e&&e.stack||'')});throw e;}\n})();\n`
2146
2150
  + `if(__cdp){try{const __r=await __cdp.send('Profiler.stop');__profile=__r&&__r.profile||null;}catch(e){__profileError=String(e&&e.message||e);}}\n`
2151
+ + `const __wmErrors=await page.evaluate(()=>window.__gmErrors||[]);\n`
2147
2152
  + perfRead
2148
2153
  + AGGREGATE_CPU_PROFILE_SRC + `\n`
2149
2154
  + `const __agg = __profile ? aggregateCpuProfile(__profile) : {timeframe:null,culprits:[]};\n`
2150
- + `return {result:__result,profile:__agg,profile_error:__profileError,debug:{console:__logs,pageErrors:__errs,network:__net.slice(0,30),performance:__perf}};`;
2155
+ + `const __allErrors=[...__errs,...__wmErrors];\n`
2156
+ + `return {result:__result,profile:__agg,profile_error:__profileError,debug:{console:__logs,pageErrors:__allErrors,network:__net.slice(0,30),performance:__perf}};`;
2151
2157
  } else if (modeMatch && modeMatch[1] === 'capture') {
2152
2158
  const userScript = modeMatch[2];
2153
2159
  evalBody = debugSetup
2154
- + `const __result = await (async () => {\n${blankProbe}${gotoPrefix}${userScript}\n})();\n`
2160
+ + `const __result = await (async () => {\n${blankProbe}${gotoPrefix}try{${userScript}}catch(e){__errs.push({type:'exec',msg:String(e&&e.message||e),stack:String(e&&e.stack||'')});throw e;}\n})();\n`
2161
+ + `const __wmErrors=await page.evaluate(()=>window.__gmErrors||[]);\n`
2155
2162
  + perfRead
2156
- + `return {result:__result,debug:{console:__logs,pageErrors:__errs,network:__net.slice(0,30),performance:__perf}};`;
2163
+ + `const __allErrors=[...__errs,...__wmErrors];\n`
2164
+ + `return {result:__result,debug:{console:__logs,pageErrors:__allErrors,network:__net.slice(0,30),performance:__perf}};`;
2157
2165
  } else if (startUrl) {
2158
2166
  evalBody = `${gotoPrefix}${evalBody}`;
2159
2167
  } else if (blankProbe) {
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1625",
3
+ "version": "2.0.1626",
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.1625",
3
+ "version": "2.0.1626",
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",
@@ -57,7 +57,9 @@
57
57
  "gm.json"
58
58
  ],
59
59
  "dependencies": {
60
- "gm-plugkit": "^2.0.1310"
60
+ "gm-plugkit": "^2.0.1310",
61
+ "gmsniff": "^1.0.0",
62
+ "ccsniff": "^1.1.0"
61
63
  },
62
64
  "engines": {
63
65
  "node": ">=16.0.0"