gm-cc 2.0.196 → 2.0.198

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.196",
7
+ "version": "2.0.198",
8
8
  "metadata": {
9
9
  "description": "State machine agent with hooks, skills, and automated git enforcement"
10
10
  },
@@ -18,12 +18,17 @@ const deny = (reason) => isGemini
18
18
  ? { decision: 'deny', reason }
19
19
  : { hookSpecificOutput: { hookEventName: 'PreToolUse', permissionDecision: 'deny', permissionDecisionReason: reason } };
20
20
  const allowWithNoop = (context) => {
21
- const b64 = Buffer.from(context, 'utf-8').toString('base64');
21
+ const tmp = path.join(os.tmpdir(), `gm-out-${Date.now()}.txt`);
22
+ fs.writeFileSync(tmp, context, 'utf-8');
23
+ const IS_WIN = process.platform === 'win32';
24
+ const cmd = IS_WIN
25
+ ? `powershell -NoProfile -NonInteractive -Command "Get-Content -Raw '${tmp}'; Remove-Item '${tmp}'"`
26
+ : `cat '${tmp}'; rm -f '${tmp}'`;
22
27
  return {
23
28
  hookSpecificOutput: {
24
29
  hookEventName: 'PreToolUse',
25
30
  permissionDecision: 'allow',
26
- updatedInput: { command: `bun -e "process.stdout.write(Buffer.from('${b64}','base64').toString())"` }
31
+ updatedInput: { command: cmd }
27
32
  }
28
33
  };
29
34
  };
@@ -83,6 +88,12 @@ const run = () => {
83
88
  const r = spawnSync('bun', ['x', 'gm-exec', 'pm2list'], { encoding: 'utf-8', timeout: 15000 });
84
89
  return allowWithNoop(`exec:pm2list output:\n\n${stripFooter((r.stdout || '') + (r.stderr || ''))}`);
85
90
  }
91
+ if (/^exec:pm2logs(\s|$)/.test(command)) {
92
+ const args = command.replace(/^exec:pm2logs\s*/, '').trim();
93
+ const pmArgs = args ? ['logs', '--nostream', '--lines', '50', args] : ['logs', '--nostream', '--lines', '50'];
94
+ const r = spawnSync('pm2', pmArgs, { encoding: 'utf-8', timeout: 15000 });
95
+ return allowWithNoop(`exec:pm2logs output:\n\n${stripFooter((r.stdout || '') + (r.stderr || '')) || '(no logs)'}`);
96
+ }
86
97
  const execMatch = command.match(/^exec(?::(\S+))?\n([\s\S]+)$/);
87
98
  if (execMatch) {
88
99
  const rawLang = (execMatch[1] || '').toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-cc",
3
- "version": "2.0.196",
3
+ "version": "2.0.198",
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.196",
3
+ "version": "2.0.198",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": {
6
6
  "name": "AnEntrypoint",