gm-copilot-cli 2.0.167 → 2.0.169
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/copilot-profile.md +1 -1
- package/hooks/pre-tool-use-hook.js +26 -20
- package/index.html +1 -1
- package/manifest.yml +1 -1
- package/package.json +1 -1
- package/tools.json +1 -1
package/copilot-profile.md
CHANGED
|
@@ -94,30 +94,36 @@ const run = () => {
|
|
|
94
94
|
}
|
|
95
95
|
return out;
|
|
96
96
|
};
|
|
97
|
+
const spawnDirect = (bin, args, input) => {
|
|
98
|
+
const opts = { encoding: 'utf-8', timeout: 30000 };
|
|
99
|
+
if (cwd) opts.cwd = cwd;
|
|
100
|
+
if (input !== undefined) opts.input = input;
|
|
101
|
+
const r = spawnSync(bin, args, opts);
|
|
102
|
+
const out = stripFooter((r.stdout || '') + (r.stderr || ''));
|
|
103
|
+
if (!out && r.error) return `[spawn error: ${r.error.message}]`;
|
|
104
|
+
if (!out && r.status !== 0) return `[exit ${r.status}]`;
|
|
105
|
+
return out;
|
|
106
|
+
};
|
|
97
107
|
try {
|
|
98
|
-
let
|
|
108
|
+
let result;
|
|
99
109
|
if (lang === 'bash' || lang === 'cmd') {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
result = runExec(['x', 'gm-exec', 'bash', ...(cwd ? [`--cwd=${cwd}`] : []), code]);
|
|
111
|
+
} else if (lang === 'python' || lang === 'py') {
|
|
112
|
+
result = spawnDirect('python3', ['-c', code]);
|
|
113
|
+
if (!result || result.startsWith('[spawn error:')) result = spawnDirect('python', ['-c', code]);
|
|
114
|
+
} else if (!lang || lang === 'nodejs' || lang === 'typescript' || lang === 'deno') {
|
|
115
|
+
const extMap = { typescript: 'ts', deno: 'ts' };
|
|
116
|
+
const ext = extMap[lang] || 'mjs';
|
|
117
|
+
const tmpFile = path.join(os.tmpdir(), `gm-exec-${Date.now()}.${ext}`);
|
|
118
|
+
const wrapped = `const __result = await (async () => {\n${code}\n})();\nif (__result !== undefined) { const t = typeof __result; if (t === 'object' || Array.isArray(__result)) { console.log(JSON.stringify(__result, null, 2)); } else { console.log(__result); } }`;
|
|
119
|
+
fs.writeFileSync(tmpFile, wrapped, 'utf-8');
|
|
120
|
+
result = spawnDirect('bun', ['run', tmpFile]);
|
|
121
|
+
try { fs.unlinkSync(tmpFile); } catch (e) {}
|
|
122
|
+
if (result) result = result.split(tmpFile).join('<script>');
|
|
103
123
|
} else {
|
|
104
|
-
|
|
105
|
-
if (isMultiLine) {
|
|
106
|
-
const extMap = { nodejs: 'mjs', typescript: 'ts', python: 'py', go: 'go', rust: 'rs', deno: 'ts' };
|
|
107
|
-
const ext = extMap[lang] || 'mjs';
|
|
108
|
-
const tmpFile = path.join(os.tmpdir(), `gm-exec-${Date.now()}.${ext}`);
|
|
109
|
-
fs.writeFileSync(tmpFile, code, 'utf-8');
|
|
110
|
-
args = ['x', 'gm-exec', 'exec', `--lang=${lang}`, `--file=${tmpFile}`];
|
|
111
|
-
if (cwd) args.push(`--cwd=${cwd}`);
|
|
112
|
-
const result = runExec(args);
|
|
113
|
-
try { fs.unlinkSync(tmpFile); } catch (e) {}
|
|
114
|
-
return { block: true, reason: result || '(no output)' };
|
|
115
|
-
}
|
|
116
|
-
args = ['x', 'gm-exec', 'exec', `--lang=${lang}`];
|
|
117
|
-
if (cwd) args.push(`--cwd=${cwd}`);
|
|
118
|
-
args.push(code);
|
|
124
|
+
result = runExec(['x', 'gm-exec', 'exec', `--lang=${lang}`, ...(cwd ? [`--cwd=${cwd}`] : []), code]);
|
|
119
125
|
}
|
|
120
|
-
return { block: true, reason:
|
|
126
|
+
return { block: true, reason: `[exec intercepted]\n${result || '(no output)'}` };
|
|
121
127
|
} catch (e) {
|
|
122
128
|
return { block: true, reason: (e.stdout || '') + (e.stderr || '') || e.message || '(exec failed)' };
|
|
123
129
|
}
|
package/index.html
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<script type="module">
|
|
19
19
|
import { createElement as h, applyDiff, Fragment } from "webjsx";
|
|
20
20
|
const PLATFORM_NAME="Copilot CLI",PLATFORM_TYPE="CLI Tool",PLATFORM_TYPE_COLOR="#3b82f6";
|
|
21
|
-
const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.
|
|
21
|
+
const DESCRIPTION="State machine agent with hooks, skills, and automated git enforcement",VERSION="2.0.169";
|
|
22
22
|
const GITHUB_URL="https://github.com/AnEntrypoint/gm-copilot-cli",BADGE_LABEL="copilot-cli";
|
|
23
23
|
const FEATURES=[{"title":"State Machine","desc":"Immutable PLAN→EXECUTE→EMIT→VERIFY→COMPLETE phases with full mutable tracking"},{"title":"Semantic Search","desc":"Natural language codebase exploration via codesearch skill — no grep needed"},{"title":"Hooks","desc":"Pre-tool, session-start, prompt-submit, and stop hooks for full lifecycle control"},{"title":"Agents","desc":"gm, codesearch, and websearch agents pre-configured and ready to use"},{"title":"MCP Integration","desc":"Model Context Protocol server support built in"},{"title":"Auto-Recovery","desc":"Supervisor hierarchy ensures the system never crashes"}],INSTALL_STEPS=[{"desc":"Install via GitHub CLI","cmd":"gh extension install AnEntrypoint/gm-copilot-cli"},{"desc":"Restart your terminal — activates automatically"}];
|
|
24
24
|
const CURRENT_PLATFORM="gm-copilot-cli";
|
package/manifest.yml
CHANGED
package/package.json
CHANGED