gm-cc 2.0.194 → 2.0.196
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/.claude-plugin/marketplace.json +1 -1
- package/agents/gm.md +2 -0
- package/hooks/pre-tool-use-hook.js +18 -3
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/gm/SKILL.md +1 -1
|
@@ -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.
|
|
7
|
+
"version": "2.0.196",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "State machine agent with hooks, skills, and automated git enforcement"
|
|
10
10
|
},
|
package/agents/gm.md
CHANGED
|
@@ -16,6 +16,8 @@ All work coordination, planning, execution, and verification happens through the
|
|
|
16
16
|
|
|
17
17
|
All code execution uses `exec:<lang>` via the Bash tool — never direct `Bash(node ...)` or `Bash(npm ...)`.
|
|
18
18
|
|
|
19
|
+
To send stdin to a running background task: `exec:type` with task_id on line 1 and input on line 2.
|
|
20
|
+
|
|
19
21
|
Do not use `EnterPlanMode`. Do not run code directly via Bash. Invoke `gm` skill first.
|
|
20
22
|
|
|
21
23
|
Responses to the user must be two sentences maximum, only when the user needs to know something, and in plain conversational language — no file paths, filenames, symbols, or technical identifiers.
|
|
@@ -78,6 +78,11 @@ const run = () => {
|
|
|
78
78
|
|
|
79
79
|
if (tool_name === 'Bash') {
|
|
80
80
|
const command = (tool_input?.command || '').trim();
|
|
81
|
+
const stripFooter = (s) => s.replace(/\n\[Running tools\][\s\S]*$/, '').trimEnd();
|
|
82
|
+
if (/^exec:pm2list\s*$/.test(command)) {
|
|
83
|
+
const r = spawnSync('bun', ['x', 'gm-exec', 'pm2list'], { encoding: 'utf-8', timeout: 15000 });
|
|
84
|
+
return allowWithNoop(`exec:pm2list output:\n\n${stripFooter((r.stdout || '') + (r.stderr || ''))}`);
|
|
85
|
+
}
|
|
81
86
|
const execMatch = command.match(/^exec(?::(\S+))?\n([\s\S]+)$/);
|
|
82
87
|
if (execMatch) {
|
|
83
88
|
const rawLang = (execMatch[1] || '').toLowerCase();
|
|
@@ -92,10 +97,9 @@ const run = () => {
|
|
|
92
97
|
if (/^\s*(echo |ls |cd |mkdir |rm |cat |grep |find |export |source |#!)/.test(src)) return 'bash';
|
|
93
98
|
return 'nodejs';
|
|
94
99
|
};
|
|
95
|
-
const aliases = { js: 'nodejs', javascript: 'nodejs', ts: 'typescript', node: 'nodejs', py: 'python', sh: 'bash', shell: 'bash', zsh: 'bash', powershell: 'bash', ps1: 'bash', cmd: 'bash', browser: 'agent-browser', ab: 'agent-browser', codesearch: 'codesearch', search: 'search', status: 'status', sleep: 'sleep', close: 'close', runner: 'runner' };
|
|
100
|
+
const aliases = { js: 'nodejs', javascript: 'nodejs', ts: 'typescript', node: 'nodejs', py: 'python', sh: 'bash', shell: 'bash', zsh: 'bash', powershell: 'bash', ps1: 'bash', cmd: 'bash', browser: 'agent-browser', ab: 'agent-browser', codesearch: 'codesearch', search: 'search', status: 'status', sleep: 'sleep', close: 'close', runner: 'runner', type: 'type', pm2list: 'pm2list' };
|
|
96
101
|
const lang = aliases[rawLang] || rawLang || detectLang(code);
|
|
97
102
|
const IS_WIN = process.platform === 'win32';
|
|
98
|
-
const stripFooter = (s) => s.replace(/\n\[Running tools\][\s\S]*$/, '').trimEnd();
|
|
99
103
|
const langExts = { nodejs: 'mjs', typescript: 'ts', deno: 'ts', python: 'py', bash: IS_WIN ? 'ps1' : 'sh', go: 'go', rust: 'rs', c: 'c', cpp: 'cpp', java: 'java' };
|
|
100
104
|
const spawnDirect = (bin, args, stdin) => {
|
|
101
105
|
const opts = { encoding: 'utf-8', timeout: 60000, ...(cwd && { cwd }), ...(stdin !== undefined && { input: stdin }) };
|
|
@@ -151,6 +155,17 @@ const run = () => {
|
|
|
151
155
|
const r = spawnSync('bun', ['x', 'gm-exec', 'runner', sub], { encoding: 'utf-8', timeout: 15000 });
|
|
152
156
|
return allowWithNoop(`exec:runner output:\n\n${stripFooter((r.stdout || '') + (r.stderr || ''))}`);
|
|
153
157
|
}
|
|
158
|
+
if (lang === 'type') {
|
|
159
|
+
const lines = safeCode.split(/\r?\n/);
|
|
160
|
+
const taskId = lines[0].trim();
|
|
161
|
+
const input = lines.slice(1).join('\n').trim();
|
|
162
|
+
const r = spawnSync('bun', ['x', 'gm-exec', 'type', taskId, input], { encoding: 'utf-8', timeout: 15000 });
|
|
163
|
+
return allowWithNoop(`exec:type output:\n\n${stripFooter((r.stdout || '') + (r.stderr || ''))}`);
|
|
164
|
+
}
|
|
165
|
+
if (lang === 'pm2list') {
|
|
166
|
+
const r = spawnSync('bun', ['x', 'gm-exec', 'pm2list'], { encoding: 'utf-8', timeout: 15000 });
|
|
167
|
+
return allowWithNoop(`exec:pm2list output:\n\n${stripFooter((r.stdout || '') + (r.stderr || ''))}`);
|
|
168
|
+
}
|
|
154
169
|
try {
|
|
155
170
|
let result;
|
|
156
171
|
if (lang === 'bash') {
|
|
@@ -181,7 +196,7 @@ const run = () => {
|
|
|
181
196
|
if (!/^exec(\s|:)/.test(command) && !/^bun x gm-exec(@[^\s]*)?(\s|$)/.test(command) && !/^git /.test(command) && !/^bun x codebasesearch/.test(command) && !/(\bclaude\b)/.test(command) && !/^npm install .* \/config\/.gmweb/.test(command) && !/^bun install --cwd \/config\/.gmweb/.test(command)) {
|
|
182
197
|
let helpText = '';
|
|
183
198
|
try { helpText = '\n\n' + execSync('bun x gm-exec --help', { timeout: 10000 }).toString().trim(); } catch (e) {}
|
|
184
|
-
return deny(`Bash is restricted to exec:<lang> and git.\n\nexec:<lang> syntax (lang auto-detected if omitted):\n exec:nodejs / exec:python / exec:bash / exec:typescript\n exec:go / exec:rust / exec:java / exec:c / exec:cpp\n exec:agent-browser ← plain JS piped to browser eval (NO base64)\n exec ← auto-detects language\n\nTask management shortcuts (body = args):\n exec:status\n <task_id>\n\n exec:sleep\n <task_id> [seconds] [--next-output]\n\n exec:close\n <task_id>\n\n exec:runner\n start|stop|status\n\nCode search shortcut:\n exec:codesearch\n <natural language query>\n\nNEVER encode agent-browser code as base64 — pass plain JS directly.\n\nbun x gm-exec${helpText}\n\nAll other Bash commands are blocked.`);
|
|
199
|
+
return deny(`Bash is restricted to exec:<lang> and git.\n\nexec:<lang> syntax (lang auto-detected if omitted):\n exec:nodejs / exec:python / exec:bash / exec:typescript\n exec:go / exec:rust / exec:java / exec:c / exec:cpp\n exec:agent-browser ← plain JS piped to browser eval (NO base64)\n exec ← auto-detects language\n\nTask management shortcuts (body = args):\n exec:status\n <task_id>\n\n exec:sleep\n <task_id> [seconds] [--next-output]\n\n exec:type\n <task_id>\n <input to send to stdin>\n\n exec:close\n <task_id>\n\n exec:runner\n start|stop|status\n\nCode search shortcut:\n exec:codesearch\n <natural language query>\n\nNEVER encode agent-browser code as base64 — pass plain JS directly.\n\nbun x gm-exec${helpText}\n\nAll other Bash commands are blocked.`);
|
|
185
200
|
}
|
|
186
201
|
}
|
|
187
202
|
|
package/package.json
CHANGED
package/plugin.json
CHANGED
package/skills/gm/SKILL.md
CHANGED
|
@@ -73,7 +73,7 @@ exec:runner
|
|
|
73
73
|
start|stop|status
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
`exec:runner start` launches
|
|
76
|
+
`exec:runner start` launches the `gm-exec-runner` PM2 process. Each `exec:<lang>` call creates its own `gm-exec-task-{id}` PM2 process — all appear in `pm2 list`. Use `exec:runner status` to check the runner. Use `exec:pm2list` to see all processes including exec tasks.
|
|
77
77
|
|
|
78
78
|
## CODEBASE EXPLORATION
|
|
79
79
|
|