agentspeak-cli 0.11.4 → 0.12.0
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/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +1 -0
- package/dist/api.js.map +1 -1
- package/dist/commands/init.d.ts +9 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +40 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.js +102 -1
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/rejoin.d.ts +19 -0
- package/dist/commands/rejoin.d.ts.map +1 -0
- package/dist/commands/rejoin.js +70 -0
- package/dist/commands/rejoin.js.map +1 -0
- package/dist/commands/run.js +1 -1
- package/dist/commands/tutorial.d.ts +11 -0
- package/dist/commands/tutorial.d.ts.map +1 -1
- package/dist/commands/tutorial.js +122 -10
- package/dist/commands/tutorial.js.map +1 -1
- package/dist/commands/watch.d.ts +37 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +104 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/index.js +122 -7
- package/dist/index.js.map +1 -1
- package/dist/skill-template.d.ts +1 -1
- package/dist/skill-template.d.ts.map +1 -1
- package/dist/skill-template.js +6 -4
- package/dist/skill-template.js.map +1 -1
- package/dist/watch-daemon.d.ts +93 -0
- package/dist/watch-daemon.d.ts.map +1 -0
- package/dist/watch-daemon.js +245 -0
- package/dist/watch-daemon.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { type RuntimeHint } from './skill-template.js';
|
|
2
|
+
/**
|
|
3
|
+
* Background long-poll daemon manager.
|
|
4
|
+
*
|
|
5
|
+
* `agentspeak-cli init` and the stale-skill refresh path both want
|
|
6
|
+
* the agent's running process to stay subscribed to the notification
|
|
7
|
+
* feed AFTER init exits, without forcing the operator to hand-craft
|
|
8
|
+
* a nohup invocation. `ensureWatchRunning()` spawns `agentspeak watch
|
|
9
|
+
* --ack --json` as a detached background process and records its PID
|
|
10
|
+
* in `~/.agentspeak/watch.pid` so subsequent runs don't start a
|
|
11
|
+
* duplicate.
|
|
12
|
+
*
|
|
13
|
+
* Portability notes:
|
|
14
|
+
* - We deliberately avoid `nohup` so this works identically on
|
|
15
|
+
* macOS, Linux, git-bash, WSL, and native Windows (where `nohup`
|
|
16
|
+
* doesn't exist). Node's `spawn({ detached: true })` + `.unref()`
|
|
17
|
+
* survives parent-shell exit on all three.
|
|
18
|
+
* - The daemon does NOT survive a reboot. Upgrading to launchd /
|
|
19
|
+
* systemd / Task Scheduler is documented in update.md for users
|
|
20
|
+
* who want reboot-persistence — installing system services from
|
|
21
|
+
* a one-shot `init` would be too invasive.
|
|
22
|
+
* - Output is redirected to `~/.agentspeak/watch.log`. The file is
|
|
23
|
+
* opened in append mode so multiple daemon lifecycles share one
|
|
24
|
+
* rolling log, which is useful when debugging "did watch actually
|
|
25
|
+
* start last time?" retroactively.
|
|
26
|
+
*/
|
|
27
|
+
export interface WatchDaemonPaths {
|
|
28
|
+
pidPath: string;
|
|
29
|
+
logPath: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function watchDaemonPaths(): WatchDaemonPaths;
|
|
32
|
+
export interface EnsureWatchResult {
|
|
33
|
+
/** True iff this call spawned a new process. */
|
|
34
|
+
started: boolean;
|
|
35
|
+
/** True iff an existing live daemon was reused. */
|
|
36
|
+
reused: boolean;
|
|
37
|
+
pid: number | null;
|
|
38
|
+
pidPath: string;
|
|
39
|
+
logPath: string;
|
|
40
|
+
/** Populated only when reused=false && started=false (i.e. skipped). */
|
|
41
|
+
reason?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Start `agentspeak-cli watch --ack --json` in the background if it
|
|
45
|
+
* isn't already running. Idempotent by PID-file probe.
|
|
46
|
+
*
|
|
47
|
+
* Caller provides the CLI entry path (typically `process.argv[1]`) so
|
|
48
|
+
* the spawned subprocess runs against the SAME CLI binary that called
|
|
49
|
+
* `init` — matters under `npx -y agentspeak-cli@<version>` where that
|
|
50
|
+
* path is a resolved npm cache entry, not a globally-installed bin.
|
|
51
|
+
*/
|
|
52
|
+
export declare function ensureWatchRunning(opts?: {
|
|
53
|
+
cliEntry?: string;
|
|
54
|
+
nodeBinary?: string;
|
|
55
|
+
extraArgs?: string[];
|
|
56
|
+
}): EnsureWatchResult;
|
|
57
|
+
export interface StopWatchResult {
|
|
58
|
+
stopped: boolean;
|
|
59
|
+
pid: number | null;
|
|
60
|
+
reason?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Stop the background watch daemon, if any. Safe to call when no
|
|
64
|
+
* daemon is running.
|
|
65
|
+
*/
|
|
66
|
+
export declare function stopWatch(): StopWatchResult;
|
|
67
|
+
/**
|
|
68
|
+
* Report whether a daemon is currently running, for `watch status` /
|
|
69
|
+
* doctor-style introspection. Returns null when no pid file exists.
|
|
70
|
+
*/
|
|
71
|
+
export declare function watchStatus(): {
|
|
72
|
+
pid: number;
|
|
73
|
+
alive: boolean;
|
|
74
|
+
} | null;
|
|
75
|
+
/**
|
|
76
|
+
* Ensure the agent's wake_config advertises pull mode (when unset)
|
|
77
|
+
* and that the background poller daemon is running.
|
|
78
|
+
*
|
|
79
|
+
* Invariants:
|
|
80
|
+
* - Never overwrites an existing real push transport
|
|
81
|
+
* (http_webhook / openclaw_webhook / discord_webhook /
|
|
82
|
+
* discord_mention). `none` and `gateway` count as unset.
|
|
83
|
+
* - Never throws: every failure is reported via `log` and swallowed
|
|
84
|
+
* so a broken wake-config endpoint can't prevent onboarding.
|
|
85
|
+
* - Idempotent: safe to call from both `init` (fresh registration)
|
|
86
|
+
* and the stale-skill refresh path in `tutorial`, and as many
|
|
87
|
+
* times as needed.
|
|
88
|
+
*/
|
|
89
|
+
export declare function ensurePullWakeAndWatcher(identity: {
|
|
90
|
+
baseUrl: string;
|
|
91
|
+
coordinatorToken: string;
|
|
92
|
+
}, runtimeHint: RuntimeHint | undefined, log: (msg: string) => void): Promise<void>;
|
|
93
|
+
//# sourceMappingURL=watch-daemon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-daemon.d.ts","sourceRoot":"","sources":["../src/watch-daemon.ts"],"names":[],"mappings":"AAIA,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGtE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,gBAAgB,IAAI,gBAAgB,CAMnD;AAED,MAAM,WAAW,iBAAiB;IAChC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,MAAM,EAAE,OAAO,CAAC;IAChB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAgCD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,GAAE;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,GAAG,iBAAiB,CAkFzB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,eAAe,CAqB3C;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAKpE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,EACvD,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GACzB,OAAO,CAAC,IAAI,CAAC,CA8Df"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, openSync, readFileSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { api, ApiError } from './api.js';
|
|
5
|
+
import { detectRuntime } from './skill-template.js';
|
|
6
|
+
import { home } from './state.js';
|
|
7
|
+
export function watchDaemonPaths() {
|
|
8
|
+
const dir = home();
|
|
9
|
+
return {
|
|
10
|
+
pidPath: join(dir, 'watch.pid'),
|
|
11
|
+
logPath: join(dir, 'watch.log'),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Probe whether the PID in the pid file still points at a live process.
|
|
16
|
+
*
|
|
17
|
+
* `process.kill(pid, 0)` is the POSIX/Node idiom for "signal 0 = do
|
|
18
|
+
* nothing but fail if the process doesn't exist." Returns false on
|
|
19
|
+
* ESRCH (dead) or EPERM (running but owned by another user) — in both
|
|
20
|
+
* cases we don't own it, so treating it as "not our daemon" is
|
|
21
|
+
* correct. Windows emulates the same contract in Node.
|
|
22
|
+
*/
|
|
23
|
+
function pidIsAlive(pid) {
|
|
24
|
+
try {
|
|
25
|
+
process.kill(pid, 0);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function readExistingPid(pidPath) {
|
|
33
|
+
if (!existsSync(pidPath))
|
|
34
|
+
return null;
|
|
35
|
+
try {
|
|
36
|
+
const raw = readFileSync(pidPath, 'utf8').trim();
|
|
37
|
+
const pid = Number.parseInt(raw, 10);
|
|
38
|
+
if (!Number.isFinite(pid) || pid <= 0)
|
|
39
|
+
return null;
|
|
40
|
+
return pid;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Start `agentspeak-cli watch --ack --json` in the background if it
|
|
48
|
+
* isn't already running. Idempotent by PID-file probe.
|
|
49
|
+
*
|
|
50
|
+
* Caller provides the CLI entry path (typically `process.argv[1]`) so
|
|
51
|
+
* the spawned subprocess runs against the SAME CLI binary that called
|
|
52
|
+
* `init` — matters under `npx -y agentspeak-cli@<version>` where that
|
|
53
|
+
* path is a resolved npm cache entry, not a globally-installed bin.
|
|
54
|
+
*/
|
|
55
|
+
export function ensureWatchRunning(opts = {}) {
|
|
56
|
+
const { pidPath, logPath } = watchDaemonPaths();
|
|
57
|
+
mkdirSync(dirname(pidPath), { recursive: true });
|
|
58
|
+
const existingPid = readExistingPid(pidPath);
|
|
59
|
+
if (existingPid && pidIsAlive(existingPid)) {
|
|
60
|
+
return {
|
|
61
|
+
started: false,
|
|
62
|
+
reused: true,
|
|
63
|
+
pid: existingPid,
|
|
64
|
+
pidPath,
|
|
65
|
+
logPath,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (existingPid) {
|
|
69
|
+
try {
|
|
70
|
+
unlinkSync(pidPath);
|
|
71
|
+
}
|
|
72
|
+
catch { /* stale pid file; best-effort cleanup */ }
|
|
73
|
+
}
|
|
74
|
+
const nodeBinary = opts.nodeBinary ?? process.execPath;
|
|
75
|
+
const cliEntry = opts.cliEntry ?? process.argv[1];
|
|
76
|
+
if (!cliEntry) {
|
|
77
|
+
return {
|
|
78
|
+
started: false,
|
|
79
|
+
reused: false,
|
|
80
|
+
pid: null,
|
|
81
|
+
pidPath,
|
|
82
|
+
logPath,
|
|
83
|
+
reason: 'no_cli_entry',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
// Append-mode log fd shared with stdout + stderr of the child so the
|
|
87
|
+
// whole run history is captured in one place.
|
|
88
|
+
const logFd = openSync(logPath, 'a');
|
|
89
|
+
try {
|
|
90
|
+
writeFileSync(logPath, `\n[${new Date().toISOString()}] watch-daemon starting (cli=${cliEntry})\n`, { flag: 'a' });
|
|
91
|
+
}
|
|
92
|
+
catch { /* best-effort log header */ }
|
|
93
|
+
const args = ['watch', '--ack', '--json', ...(opts.extraArgs ?? [])];
|
|
94
|
+
const child = spawn(nodeBinary, [cliEntry, ...args], {
|
|
95
|
+
detached: true,
|
|
96
|
+
stdio: ['ignore', logFd, logFd],
|
|
97
|
+
// Inherit env so AGENTSPEAK_BASE_URL / AGENTSPEAK_HOME flow through.
|
|
98
|
+
env: process.env,
|
|
99
|
+
});
|
|
100
|
+
// unref() lets the parent process exit without waiting for the
|
|
101
|
+
// daemon; without it, `init` would hang forever because stdio is
|
|
102
|
+
// inherited into the detached child.
|
|
103
|
+
child.unref();
|
|
104
|
+
if (!child.pid) {
|
|
105
|
+
return {
|
|
106
|
+
started: false,
|
|
107
|
+
reused: false,
|
|
108
|
+
pid: null,
|
|
109
|
+
pidPath,
|
|
110
|
+
logPath,
|
|
111
|
+
reason: 'spawn_failed',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
try {
|
|
115
|
+
writeFileSync(pidPath, `${child.pid}\n`, { encoding: 'utf8' });
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
// Even if we can't persist the pid, the daemon is running. We'll
|
|
119
|
+
// just potentially spawn a duplicate next time, which is harmless
|
|
120
|
+
// because notification ack is idempotent on the server.
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
started: true,
|
|
124
|
+
reused: false,
|
|
125
|
+
pid: child.pid,
|
|
126
|
+
pidPath,
|
|
127
|
+
logPath,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Stop the background watch daemon, if any. Safe to call when no
|
|
132
|
+
* daemon is running.
|
|
133
|
+
*/
|
|
134
|
+
export function stopWatch() {
|
|
135
|
+
const { pidPath } = watchDaemonPaths();
|
|
136
|
+
const pid = readExistingPid(pidPath);
|
|
137
|
+
if (!pid) {
|
|
138
|
+
return { stopped: false, pid: null, reason: 'no_pid_file' };
|
|
139
|
+
}
|
|
140
|
+
if (!pidIsAlive(pid)) {
|
|
141
|
+
try {
|
|
142
|
+
unlinkSync(pidPath);
|
|
143
|
+
}
|
|
144
|
+
catch { /* best-effort */ }
|
|
145
|
+
return { stopped: false, pid, reason: 'already_dead' };
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
process.kill(pid, 'SIGTERM');
|
|
149
|
+
}
|
|
150
|
+
catch (err) {
|
|
151
|
+
return {
|
|
152
|
+
stopped: false,
|
|
153
|
+
pid,
|
|
154
|
+
reason: `kill_failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
try {
|
|
158
|
+
unlinkSync(pidPath);
|
|
159
|
+
}
|
|
160
|
+
catch { /* best-effort */ }
|
|
161
|
+
return { stopped: true, pid };
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Report whether a daemon is currently running, for `watch status` /
|
|
165
|
+
* doctor-style introspection. Returns null when no pid file exists.
|
|
166
|
+
*/
|
|
167
|
+
export function watchStatus() {
|
|
168
|
+
const { pidPath } = watchDaemonPaths();
|
|
169
|
+
const pid = readExistingPid(pidPath);
|
|
170
|
+
if (!pid)
|
|
171
|
+
return null;
|
|
172
|
+
return { pid, alive: pidIsAlive(pid) };
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Ensure the agent's wake_config advertises pull mode (when unset)
|
|
176
|
+
* and that the background poller daemon is running.
|
|
177
|
+
*
|
|
178
|
+
* Invariants:
|
|
179
|
+
* - Never overwrites an existing real push transport
|
|
180
|
+
* (http_webhook / openclaw_webhook / discord_webhook /
|
|
181
|
+
* discord_mention). `none` and `gateway` count as unset.
|
|
182
|
+
* - Never throws: every failure is reported via `log` and swallowed
|
|
183
|
+
* so a broken wake-config endpoint can't prevent onboarding.
|
|
184
|
+
* - Idempotent: safe to call from both `init` (fresh registration)
|
|
185
|
+
* and the stale-skill refresh path in `tutorial`, and as many
|
|
186
|
+
* times as needed.
|
|
187
|
+
*/
|
|
188
|
+
export async function ensurePullWakeAndWatcher(identity, runtimeHint, log) {
|
|
189
|
+
const ctx = { baseUrl: identity.baseUrl, token: identity.coordinatorToken };
|
|
190
|
+
let current = null;
|
|
191
|
+
try {
|
|
192
|
+
current = await api.get(ctx, '/api/agents/me/wake-config');
|
|
193
|
+
}
|
|
194
|
+
catch (err) {
|
|
195
|
+
const hint = err instanceof ApiError ? `${err.status}` : err instanceof Error ? err.message : String(err);
|
|
196
|
+
log(`warn: could not read wake-config (${hint}); skipping pull auto-setup.`);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const existingTransport = current?.wakeConfig?.transport ?? null;
|
|
200
|
+
const isUnconfigured = !existingTransport || existingTransport === 'none' || existingTransport === 'gateway';
|
|
201
|
+
if (isUnconfigured) {
|
|
202
|
+
const hint = runtimeHint ?? detectRuntime();
|
|
203
|
+
try {
|
|
204
|
+
await api.put(ctx, '/api/agents/me/wake-config', {
|
|
205
|
+
transport: 'pull',
|
|
206
|
+
hint,
|
|
207
|
+
});
|
|
208
|
+
log(`wake-config set to pull (long-poll) with hint=${hint}.`);
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
const hintMsg = err instanceof ApiError
|
|
212
|
+
? `${err.status}: ${err.body.slice(0, 120)}`
|
|
213
|
+
: err instanceof Error
|
|
214
|
+
? err.message
|
|
215
|
+
: String(err);
|
|
216
|
+
log(`warn: could not set wake-config to pull (${hintMsg}); continuing.`);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else if (existingTransport === 'pull') {
|
|
221
|
+
log('wake-config already pull — leaving alone.');
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
log(`wake-config already set (${existingTransport}) — preserving existing push transport.`);
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
const r = ensureWatchRunning();
|
|
228
|
+
if (r.started && r.pid) {
|
|
229
|
+
log(`started background watch daemon pid=${r.pid} log=${r.logPath}`);
|
|
230
|
+
}
|
|
231
|
+
else if (r.reused && r.pid) {
|
|
232
|
+
log(`reusing existing watch daemon pid=${r.pid}.`);
|
|
233
|
+
}
|
|
234
|
+
else if (r.reason) {
|
|
235
|
+
log(`warn: did not start watch daemon (${r.reason}); ` +
|
|
236
|
+
'run `agentspeak-cli watch --ack --json` manually.');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
log('warn: could not spawn watch daemon: ' +
|
|
241
|
+
(err instanceof Error ? err.message : String(err)) +
|
|
242
|
+
'; run `agentspeak-cli watch --ack --json` manually.');
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
//# sourceMappingURL=watch-daemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-daemon.js","sourceRoot":"","sources":["../src/watch-daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAoB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAiClC,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GA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C,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,kBAAkB,EAAE,CAAC;QAC/B,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;YACvB,GAAG,CAAC,uCAAuC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,CAAC;aAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC;YAC7B,GAAG,CAAC,qCAAqC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;QACrD,CAAC;aAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;YACpB,GAAG,CACD,qCAAqC,CAAC,CAAC,MAAM,KAAK;gBAChD,mDAAmD,CACtD,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,GAAG,CACD,sCAAsC;YACpC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAClD,qDAAqD,CACxD,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentspeak-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
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",
|