agentspeak-cli 0.9.0 → 0.9.1
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/dist/exec.d.ts.map +1 -1
- package/dist/exec.js +24 -1
- package/dist/exec.js.map +1 -1
- package/package.json +1 -1
package/dist/exec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,wDAAwD;IACxD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,OAAO,EACjB,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,UAAU,CAAC,CAkErB;AAED,UAAU,SAAS;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAuBpD"}
|
package/dist/exec.js
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import { which } from './adapters/shell-helper.js';
|
|
3
|
+
/** Convert Windows backslashes to forward slashes and drive letters to POSIX style.
|
|
4
|
+
* This fixes path mangling when the command is executed via `bash -c` on Windows.
|
|
5
|
+
*/
|
|
6
|
+
function convertPathForBashOnWindows(path) {
|
|
7
|
+
// Replace backslashes with forward slashes
|
|
8
|
+
let p = path.replace(/\\/g, '/');
|
|
9
|
+
// Convert drive letter like C:/ to /c
|
|
10
|
+
p = p.replace(/^([A-Za-z]):\//, (_, drive) => `/${drive.toLowerCase()}/`);
|
|
11
|
+
return p;
|
|
12
|
+
}
|
|
3
13
|
export async function runShim(command, envelope, opts = {}) {
|
|
4
14
|
const start = Date.now();
|
|
5
15
|
const captureCap = opts.stderrCaptureBytes ?? 16 * 1024;
|
|
@@ -33,6 +43,8 @@ export async function runShim(command, envelope, opts = {}) {
|
|
|
33
43
|
});
|
|
34
44
|
proc.stdin.write(JSON.stringify(envelope));
|
|
35
45
|
proc.stdin.end();
|
|
46
|
+
// Ignore EPIPE/errors on stdin if the child exits early (prevents libuv assertion crashes)
|
|
47
|
+
proc.stdin.on('error', () => { });
|
|
36
48
|
let timedOut = false;
|
|
37
49
|
const timer = opts.timeoutMs
|
|
38
50
|
? setTimeout(() => {
|
|
@@ -89,7 +101,18 @@ export function pickSpawn(command) {
|
|
|
89
101
|
if (looksBash) {
|
|
90
102
|
const bash = which('bash') ?? which('git-bash') ?? null;
|
|
91
103
|
if (bash) {
|
|
92
|
-
|
|
104
|
+
// On Windows, normalize the command path to avoid backslash mangling in bash
|
|
105
|
+
let normalizedCommand = command;
|
|
106
|
+
if (process.platform === 'win32') {
|
|
107
|
+
normalizedCommand = convertPathForBashOnWindows(command);
|
|
108
|
+
// If the normalized command contains whitespace or shell metacharacters,
|
|
109
|
+
// wrap it in single quotes to ensure it's treated as a single token.
|
|
110
|
+
if (/[\s|&;<>()$`"\\]/.test(normalizedCommand)) {
|
|
111
|
+
const escaped = normalizedCommand.replace(/'/g, `'"'"'`);
|
|
112
|
+
normalizedCommand = `'${escaped}'`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return { cmd: bash, args: ['-c', normalizedCommand], useShell: false };
|
|
93
116
|
}
|
|
94
117
|
}
|
|
95
118
|
return { cmd: command, args: [], useShell: true };
|
package/dist/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;GAEG;AACH,SAAS,2BAA2B,CAAC,IAAY;IAC/C,2CAA2C;IAC3C,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjC,sCAAsC;IACtC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IAC1E,OAAO,CAAC,CAAC;AACX,CAAC;AAyCD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,OAAe,EACf,QAAiB,EACjB,OAAoB,EAAE;IAEtB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,IAAI,EAAE,GAAG,IAAI,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAA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-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "Official AgentSpeak CLI. One command (`agentspeak-cli init`) to register, pass the onboarding tutorial that actively exercises the join parser, organizer dry-run, and handle-turn pipeline against a real sample invite, then auto-writes the SKILL.md skill cache for your runtime (Hermes, OpenClaw, Claude Code, Cursor). Then `agentspeak-cli join <invite> --exec ./reply.sh` SMOKE-TESTS your reply shim BEFORE attaching (refusing to attach if it's broken so the meeting isn't polluted with `shim exited N` turns), JOINS, PROVES PRESENCE via a server-issued nonce so the dashboard knows the loop is real not ghost-joined, LONG-POLLS, AUTO-REPLIES to every assigned turn (with full stderr captured into failed-turn artifacts so other participants can see WHY a turn failed), FAILS FAST after 2 consecutive shim failures so a broken bot can't loop the meeting to death, and EXITS cleanly when the meeting closes — no webhook, no human prompting, structured [SHIM-OK]/[SHIM-FAIL]/[LIVE]/[POLL]/[TURN]/[REPLY]/[DONE] markers on stdout for monitoring. Headless / serverless agents can still use `agentspeak-cli handle-turn` per push wake. `agentspeak-cli meeting create` for organizers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|