gm-cc 2.0.241 → 2.0.243
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.
|
|
7
|
+
"version": "2.0.243",
|
|
8
8
|
"metadata": {
|
|
9
9
|
"description": "State machine agent with hooks, skills, and automated git enforcement"
|
|
10
10
|
},
|
|
@@ -258,7 +258,8 @@ const run = () => {
|
|
|
258
258
|
return { globalArgs, rest };
|
|
259
259
|
}
|
|
260
260
|
const spawnAb = (bin, args, stdin) => {
|
|
261
|
-
const
|
|
261
|
+
const headed = args.includes('--headed');
|
|
262
|
+
const opts = { encoding: 'utf-8', timeout: 60000, windowsHide: !headed, ...(IS_WIN && { shell: true }), cwd: process.cwd(), ...(stdin !== undefined && { input: stdin }) };
|
|
262
263
|
const r = spawnSync(bin, args, opts);
|
|
263
264
|
if (!r.stdout && !r.stderr && r.error) return `[spawn error: ${r.error.message}]`;
|
|
264
265
|
const out = (r.stdout || '').trimEnd(), err = stripFooter(r.stderr || '').trimEnd();
|
|
@@ -283,17 +284,19 @@ const run = () => {
|
|
|
283
284
|
} else {
|
|
284
285
|
const hasClose = lines.some(l => { const w = (parseAbLine(l).rest[0]||'').toLowerCase(); return ['close','quit','exit'].includes(w); });
|
|
285
286
|
const batchGlobals = firstParsed.globalArgs;
|
|
286
|
-
const
|
|
287
|
+
const results = [];
|
|
288
|
+
for (const l of lines) {
|
|
287
289
|
const { globalArgs, rest } = parseAbLine(l);
|
|
288
290
|
const mergedGlobals = [...batchGlobals.filter(f => !globalArgs.includes(f)), ...globalArgs];
|
|
289
291
|
const w = (rest[0]||'').toLowerCase();
|
|
290
292
|
if (['open','goto','navigate'].includes(w)) sessions[sessionName] = { url: rest[1]||'?', ts: Date.now() };
|
|
291
293
|
if (['close','quit','exit'].includes(w)) delete sessions[sessionName];
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
const args = AB_CMDS.has(w) ? [...mergedGlobals, ...rest] : [...mergedGlobals, 'eval', '--stdin'];
|
|
295
|
+
const stdin = AB_CMDS.has(w) ? undefined : l.trim();
|
|
296
|
+
results.push(spawnAb(abBin, args, stdin));
|
|
297
|
+
}
|
|
295
298
|
writeAbSessions(sessions);
|
|
296
|
-
result =
|
|
299
|
+
result = results.filter(Boolean).join('\n');
|
|
297
300
|
if (!hasClose && openSessions.length > 0) result += `\n\n[tab] Browser session "${sessionName}" still open. Close when done:\n agent-browser:\n close`;
|
|
298
301
|
}
|
|
299
302
|
} else {
|
package/package.json
CHANGED