gm-cc 2.0.190 → 2.0.193

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.
@@ -4,7 +4,7 @@
4
4
  "name": "AnEntrypoint"
5
5
  },
6
6
  "description": "State machine agent with hooks, skills, and automated git enforcement",
7
- "version": "2.0.190",
7
+ "version": "2.0.193",
8
8
  "metadata": {
9
9
  "description": "State machine agent with hooks, skills, and automated git enforcement"
10
10
  },
@@ -17,14 +17,16 @@ const allow = (additionalContext) => ({
17
17
  const deny = (reason) => isGemini
18
18
  ? { decision: 'deny', reason }
19
19
  : { hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'deny', permissionDecisionReason: reason } };
20
- const allowWithNoop = (context) => ({
21
- hookSpecificOutput: {
22
- hookEventName: 'PreToolUse',
23
- permissionDecision: 'allow',
24
- additionalContext: context,
25
- updatedInput: { command: 'echo ""' }
26
- }
27
- });
20
+ const allowWithNoop = (context) => {
21
+ const b64 = Buffer.from(context, 'utf-8').toString('base64');
22
+ return {
23
+ hookSpecificOutput: {
24
+ hookEventName: 'PreToolUse',
25
+ permissionDecision: 'allow',
26
+ updatedInput: { command: `bun -e "process.stdout.write(Buffer.from('${b64}','base64').toString())"` }
27
+ }
28
+ };
29
+ };
28
30
 
29
31
  const run = () => {
30
32
  try {
@@ -163,13 +165,8 @@ const run = () => {
163
165
  result = spawnDirect('python3', ['-c', safeCode]);
164
166
  if (!result || result.startsWith('[spawn error:')) result = spawnDirect('python', ['-c', safeCode]);
165
167
  } else if (!lang || ['nodejs', 'typescript', 'deno'].includes(lang)) {
166
- const ext = lang === 'typescript' || lang === 'deno' ? 'ts' : 'mjs';
167
- const tmp = path.join(os.tmpdir(), `gm-exec-${Date.now()}.${ext}`);
168
168
  const wrapped = `const __result = await (async () => {\n${safeCode}\n})();\nif (__result !== undefined) { if (typeof __result === 'object') { console.log(JSON.stringify(__result, null, 2)); } else { console.log(__result); } }`;
169
- fs.writeFileSync(tmp, wrapped, 'utf-8');
170
- result = spawnDirect('bun', ['run', tmp]);
171
- try { fs.unlinkSync(tmp); } catch (e) {}
172
- if (result) result = result.split(tmp).join('<script>');
169
+ result = runWithFile(lang || 'nodejs', wrapped);
173
170
  } else if (lang === 'agent-browser') {
174
171
  result = spawnDirect('agent-browser', ['eval', '--stdin'], safeCode);
175
172
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-cc",
3
- "version": "2.0.190",
3
+ "version": "2.0.193",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.190",
3
+ "version": "2.0.193",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",