@agentchatme/claude-code 0.0.1394114111 → 0.0.139411411111

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/index.js CHANGED
@@ -1,22 +1,553 @@
1
1
  #!/usr/bin/env node
2
2
  import{createRequire as __acCreateRequire}from"node:module";
3
3
  const require=__acCreateRequire(import.meta.url);
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
+ }) : x)(function(x) {
13
+ if (typeof require !== "undefined") return require.apply(this, arguments);
14
+ throw Error('Dynamic require of "' + x + '" is not supported');
15
+ });
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __copyProps = (to, from, except, desc) => {
20
+ if (from && typeof from === "object" || typeof from === "function") {
21
+ for (let key of __getOwnPropNames(from))
22
+ if (!__hasOwnProp.call(to, key) && key !== except)
23
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
28
+ // If the importer is in node compatibility mode or this is not an ESM
29
+ // file that has been converted to a CommonJS file using a Babel-
30
+ // compatible transform (i.e. "__esModule" has not been set), then set
31
+ // "default" to the CommonJS "module.exports" for node compatibility.
32
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
+ mod
34
+ ));
35
+
36
+ // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
37
+ var require_windows = __commonJS({
38
+ "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module) {
39
+ "use strict";
40
+ module.exports = isexe;
41
+ isexe.sync = sync;
42
+ var fs9 = __require("fs");
43
+ function checkPathExt(path9, options) {
44
+ var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
45
+ if (!pathext) {
46
+ return true;
47
+ }
48
+ pathext = pathext.split(";");
49
+ if (pathext.indexOf("") !== -1) {
50
+ return true;
51
+ }
52
+ for (var i = 0; i < pathext.length; i++) {
53
+ var p = pathext[i].toLowerCase();
54
+ if (p && path9.substr(-p.length).toLowerCase() === p) {
55
+ return true;
56
+ }
57
+ }
58
+ return false;
59
+ }
60
+ function checkStat(stat, path9, options) {
61
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
62
+ return false;
63
+ }
64
+ return checkPathExt(path9, options);
65
+ }
66
+ function isexe(path9, options, cb) {
67
+ fs9.stat(path9, function(er, stat) {
68
+ cb(er, er ? false : checkStat(stat, path9, options));
69
+ });
70
+ }
71
+ function sync(path9, options) {
72
+ return checkStat(fs9.statSync(path9), path9, options);
73
+ }
74
+ }
75
+ });
76
+
77
+ // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
78
+ var require_mode = __commonJS({
79
+ "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module) {
80
+ "use strict";
81
+ module.exports = isexe;
82
+ isexe.sync = sync;
83
+ var fs9 = __require("fs");
84
+ function isexe(path9, options, cb) {
85
+ fs9.stat(path9, function(er, stat) {
86
+ cb(er, er ? false : checkStat(stat, options));
87
+ });
88
+ }
89
+ function sync(path9, options) {
90
+ return checkStat(fs9.statSync(path9), options);
91
+ }
92
+ function checkStat(stat, options) {
93
+ return stat.isFile() && checkMode(stat, options);
94
+ }
95
+ function checkMode(stat, options) {
96
+ var mod = stat.mode;
97
+ var uid = stat.uid;
98
+ var gid = stat.gid;
99
+ var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
100
+ var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
101
+ var u = parseInt("100", 8);
102
+ var g = parseInt("010", 8);
103
+ var o = parseInt("001", 8);
104
+ var ug = u | g;
105
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
106
+ return ret;
107
+ }
108
+ }
109
+ });
110
+
111
+ // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
112
+ var require_isexe = __commonJS({
113
+ "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
114
+ "use strict";
115
+ var fs9 = __require("fs");
116
+ var core;
117
+ if (process.platform === "win32" || global.TESTING_WINDOWS) {
118
+ core = require_windows();
119
+ } else {
120
+ core = require_mode();
121
+ }
122
+ module.exports = isexe;
123
+ isexe.sync = sync;
124
+ function isexe(path9, options, cb) {
125
+ if (typeof options === "function") {
126
+ cb = options;
127
+ options = {};
128
+ }
129
+ if (!cb) {
130
+ if (typeof Promise !== "function") {
131
+ throw new TypeError("callback not provided");
132
+ }
133
+ return new Promise(function(resolve4, reject) {
134
+ isexe(path9, options || {}, function(er, is) {
135
+ if (er) {
136
+ reject(er);
137
+ } else {
138
+ resolve4(is);
139
+ }
140
+ });
141
+ });
142
+ }
143
+ core(path9, options || {}, function(er, is) {
144
+ if (er) {
145
+ if (er.code === "EACCES" || options && options.ignoreErrors) {
146
+ er = null;
147
+ is = false;
148
+ }
149
+ }
150
+ cb(er, is);
151
+ });
152
+ }
153
+ function sync(path9, options) {
154
+ try {
155
+ return core.sync(path9, options || {});
156
+ } catch (er) {
157
+ if (options && options.ignoreErrors || er.code === "EACCES") {
158
+ return false;
159
+ } else {
160
+ throw er;
161
+ }
162
+ }
163
+ }
164
+ }
165
+ });
166
+
167
+ // node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
168
+ var require_which = __commonJS({
169
+ "node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
170
+ "use strict";
171
+ var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
172
+ var path9 = __require("path");
173
+ var COLON = isWindows ? ";" : ":";
174
+ var isexe = require_isexe();
175
+ var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
176
+ var getPathInfo = (cmd, opt) => {
177
+ const colon = opt.colon || COLON;
178
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
179
+ // windows always checks the cwd first
180
+ ...isWindows ? [process.cwd()] : [],
181
+ ...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
182
+ "").split(colon)
183
+ ];
184
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
185
+ const pathExt = isWindows ? pathExtExe.split(colon) : [""];
186
+ if (isWindows) {
187
+ if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
188
+ pathExt.unshift("");
189
+ }
190
+ return {
191
+ pathEnv,
192
+ pathExt,
193
+ pathExtExe
194
+ };
195
+ };
196
+ var which = (cmd, opt, cb) => {
197
+ if (typeof opt === "function") {
198
+ cb = opt;
199
+ opt = {};
200
+ }
201
+ if (!opt)
202
+ opt = {};
203
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
204
+ const found = [];
205
+ const step = (i) => new Promise((resolve4, reject) => {
206
+ if (i === pathEnv.length)
207
+ return opt.all && found.length ? resolve4(found) : reject(getNotFoundError(cmd));
208
+ const ppRaw = pathEnv[i];
209
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
210
+ const pCmd = path9.join(pathPart, cmd);
211
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
212
+ resolve4(subStep(p, i, 0));
213
+ });
214
+ const subStep = (p, i, ii) => new Promise((resolve4, reject) => {
215
+ if (ii === pathExt.length)
216
+ return resolve4(step(i + 1));
217
+ const ext = pathExt[ii];
218
+ isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
219
+ if (!er && is) {
220
+ if (opt.all)
221
+ found.push(p + ext);
222
+ else
223
+ return resolve4(p + ext);
224
+ }
225
+ return resolve4(subStep(p, i, ii + 1));
226
+ });
227
+ });
228
+ return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
229
+ };
230
+ var whichSync = (cmd, opt) => {
231
+ opt = opt || {};
232
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
233
+ const found = [];
234
+ for (let i = 0; i < pathEnv.length; i++) {
235
+ const ppRaw = pathEnv[i];
236
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
237
+ const pCmd = path9.join(pathPart, cmd);
238
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
239
+ for (let j = 0; j < pathExt.length; j++) {
240
+ const cur = p + pathExt[j];
241
+ try {
242
+ const is = isexe.sync(cur, { pathExt: pathExtExe });
243
+ if (is) {
244
+ if (opt.all)
245
+ found.push(cur);
246
+ else
247
+ return cur;
248
+ }
249
+ } catch (ex) {
250
+ }
251
+ }
252
+ }
253
+ if (opt.all && found.length)
254
+ return found;
255
+ if (opt.nothrow)
256
+ return null;
257
+ throw getNotFoundError(cmd);
258
+ };
259
+ module.exports = which;
260
+ which.sync = whichSync;
261
+ }
262
+ });
263
+
264
+ // node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
265
+ var require_path_key = __commonJS({
266
+ "node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports, module) {
267
+ "use strict";
268
+ var pathKey = (options = {}) => {
269
+ const environment = options.env || process.env;
270
+ const platform = options.platform || process.platform;
271
+ if (platform !== "win32") {
272
+ return "PATH";
273
+ }
274
+ return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
275
+ };
276
+ module.exports = pathKey;
277
+ module.exports.default = pathKey;
278
+ }
279
+ });
280
+
281
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
282
+ var require_resolveCommand = __commonJS({
283
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
284
+ "use strict";
285
+ var path9 = __require("path");
286
+ var which = require_which();
287
+ var getPathKey = require_path_key();
288
+ function resolveCommandAttempt(parsed, withoutPathExt) {
289
+ const env = parsed.options.env || process.env;
290
+ const cwd = process.cwd();
291
+ const hasCustomCwd = parsed.options.cwd != null;
292
+ const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
293
+ if (shouldSwitchCwd) {
294
+ try {
295
+ process.chdir(parsed.options.cwd);
296
+ } catch (err) {
297
+ }
298
+ }
299
+ let resolved;
300
+ try {
301
+ resolved = which.sync(parsed.command, {
302
+ path: env[getPathKey({ env })],
303
+ pathExt: withoutPathExt ? path9.delimiter : void 0
304
+ });
305
+ } catch (e) {
306
+ } finally {
307
+ if (shouldSwitchCwd) {
308
+ process.chdir(cwd);
309
+ }
310
+ }
311
+ if (resolved) {
312
+ resolved = path9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
313
+ }
314
+ return resolved;
315
+ }
316
+ function resolveCommand(parsed) {
317
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
318
+ }
319
+ module.exports = resolveCommand;
320
+ }
321
+ });
322
+
323
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
324
+ var require_escape = __commonJS({
325
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
326
+ "use strict";
327
+ var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
328
+ function escapeCommand(arg) {
329
+ arg = arg.replace(metaCharsRegExp, "^$1");
330
+ return arg;
331
+ }
332
+ function escapeArgument(arg, doubleEscapeMetaChars) {
333
+ arg = `${arg}`;
334
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
335
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
336
+ arg = `"${arg}"`;
337
+ arg = arg.replace(metaCharsRegExp, "^$1");
338
+ if (doubleEscapeMetaChars) {
339
+ arg = arg.replace(metaCharsRegExp, "^$1");
340
+ }
341
+ return arg;
342
+ }
343
+ module.exports.command = escapeCommand;
344
+ module.exports.argument = escapeArgument;
345
+ }
346
+ });
347
+
348
+ // node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
349
+ var require_shebang_regex = __commonJS({
350
+ "node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports, module) {
351
+ "use strict";
352
+ module.exports = /^#!(.*)/;
353
+ }
354
+ });
355
+
356
+ // node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
357
+ var require_shebang_command = __commonJS({
358
+ "node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports, module) {
359
+ "use strict";
360
+ var shebangRegex = require_shebang_regex();
361
+ module.exports = (string = "") => {
362
+ const match = string.match(shebangRegex);
363
+ if (!match) {
364
+ return null;
365
+ }
366
+ const [path9, argument] = match[0].replace(/#! ?/, "").split(" ");
367
+ const binary = path9.split("/").pop();
368
+ if (binary === "env") {
369
+ return argument;
370
+ }
371
+ return argument ? `${binary} ${argument}` : binary;
372
+ };
373
+ }
374
+ });
375
+
376
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
377
+ var require_readShebang = __commonJS({
378
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports, module) {
379
+ "use strict";
380
+ var fs9 = __require("fs");
381
+ var shebangCommand = require_shebang_command();
382
+ function readShebang(command) {
383
+ const size = 150;
384
+ const buffer = Buffer.alloc(size);
385
+ let fd;
386
+ try {
387
+ fd = fs9.openSync(command, "r");
388
+ fs9.readSync(fd, buffer, 0, size, 0);
389
+ fs9.closeSync(fd);
390
+ } catch (e) {
391
+ }
392
+ return shebangCommand(buffer.toString());
393
+ }
394
+ module.exports = readShebang;
395
+ }
396
+ });
397
+
398
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
399
+ var require_parse = __commonJS({
400
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
401
+ "use strict";
402
+ var path9 = __require("path");
403
+ var resolveCommand = require_resolveCommand();
404
+ var escape = require_escape();
405
+ var readShebang = require_readShebang();
406
+ var isWin = process.platform === "win32";
407
+ var isExecutableRegExp = /\.(?:com|exe)$/i;
408
+ var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
409
+ function detectShebang(parsed) {
410
+ parsed.file = resolveCommand(parsed);
411
+ const shebang = parsed.file && readShebang(parsed.file);
412
+ if (shebang) {
413
+ parsed.args.unshift(parsed.file);
414
+ parsed.command = shebang;
415
+ return resolveCommand(parsed);
416
+ }
417
+ return parsed.file;
418
+ }
419
+ function parseNonShell(parsed) {
420
+ if (!isWin) {
421
+ return parsed;
422
+ }
423
+ const commandFile = detectShebang(parsed);
424
+ const needsShell = !isExecutableRegExp.test(commandFile);
425
+ if (parsed.options.forceShell || needsShell) {
426
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
427
+ parsed.command = path9.normalize(parsed.command);
428
+ parsed.command = escape.command(parsed.command);
429
+ parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
430
+ const shellCommand = [parsed.command].concat(parsed.args).join(" ");
431
+ parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
432
+ parsed.command = process.env.comspec || "cmd.exe";
433
+ parsed.options.windowsVerbatimArguments = true;
434
+ }
435
+ return parsed;
436
+ }
437
+ function parse(command, args, options) {
438
+ if (args && !Array.isArray(args)) {
439
+ options = args;
440
+ args = null;
441
+ }
442
+ args = args ? args.slice(0) : [];
443
+ options = Object.assign({}, options);
444
+ const parsed = {
445
+ command,
446
+ args,
447
+ options,
448
+ file: void 0,
449
+ original: {
450
+ command,
451
+ args
452
+ }
453
+ };
454
+ return options.shell ? parsed : parseNonShell(parsed);
455
+ }
456
+ module.exports = parse;
457
+ }
458
+ });
459
+
460
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
461
+ var require_enoent = __commonJS({
462
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports, module) {
463
+ "use strict";
464
+ var isWin = process.platform === "win32";
465
+ function notFoundError(original, syscall) {
466
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
467
+ code: "ENOENT",
468
+ errno: "ENOENT",
469
+ syscall: `${syscall} ${original.command}`,
470
+ path: original.command,
471
+ spawnargs: original.args
472
+ });
473
+ }
474
+ function hookChildProcess(cp, parsed) {
475
+ if (!isWin) {
476
+ return;
477
+ }
478
+ const originalEmit = cp.emit;
479
+ cp.emit = function(name, arg1) {
480
+ if (name === "exit") {
481
+ const err = verifyENOENT(arg1, parsed);
482
+ if (err) {
483
+ return originalEmit.call(cp, "error", err);
484
+ }
485
+ }
486
+ return originalEmit.apply(cp, arguments);
487
+ };
488
+ }
489
+ function verifyENOENT(status, parsed) {
490
+ if (isWin && status === 1 && !parsed.file) {
491
+ return notFoundError(parsed.original, "spawn");
492
+ }
493
+ return null;
494
+ }
495
+ function verifyENOENTSync(status, parsed) {
496
+ if (isWin && status === 1 && !parsed.file) {
497
+ return notFoundError(parsed.original, "spawnSync");
498
+ }
499
+ return null;
500
+ }
501
+ module.exports = {
502
+ hookChildProcess,
503
+ verifyENOENT,
504
+ verifyENOENTSync,
505
+ notFoundError
506
+ };
507
+ }
508
+ });
509
+
510
+ // node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
511
+ var require_cross_spawn = __commonJS({
512
+ "node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports, module) {
513
+ "use strict";
514
+ var cp = __require("child_process");
515
+ var parse = require_parse();
516
+ var enoent = require_enoent();
517
+ function spawn(command, args, options) {
518
+ const parsed = parse(command, args, options);
519
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
520
+ enoent.hookChildProcess(spawned, parsed);
521
+ return spawned;
522
+ }
523
+ function spawnSync(command, args, options) {
524
+ const parsed = parse(command, args, options);
525
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
526
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
527
+ return result;
528
+ }
529
+ module.exports = spawn;
530
+ module.exports.spawn = spawn;
531
+ module.exports.sync = spawnSync;
532
+ module.exports._parse = parse;
533
+ module.exports._enoent = enoent;
534
+ }
535
+ });
4
536
 
5
537
  // src/index.ts
6
538
  import { parseArgs } from "util";
7
- import { spawn as spawn3 } from "child_process";
8
539
 
9
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.1313111/node_modules/@agentchatme/agent-core/dist/chunk-YWX7E5VW.js
540
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.131311111/node_modules/@agentchatme/agent-core/dist/chunk-MYZZAWMQ.js
10
541
  import * as fs2 from "fs";
11
542
  import * as path2 from "path";
12
543
  import * as fs3 from "fs";
13
544
  import * as path3 from "path";
14
545
  import * as fs4 from "fs";
15
546
  import * as path4 from "path";
16
- var __defProp = Object.defineProperty;
547
+ var __defProp2 = Object.defineProperty;
17
548
  var __export = (target, all) => {
18
549
  for (var name in all)
19
- __defProp(target, name, { get: all[name], enumerable: true });
550
+ __defProp2(target, name, { get: all[name], enumerable: true });
20
551
  };
21
552
  var LEVELS = ["silent", "error", "warn", "info", "debug"];
22
553
  function activeLevel() {
@@ -36,7 +567,7 @@ var log = {
36
567
  info: (msg) => emit("info", msg),
37
568
  debug: (msg) => emit("debug", msg)
38
569
  };
39
- var VERSION = "0.0.1313111";
570
+ var VERSION = "0.0.131311111";
40
571
  var CODING_AGENTS_CLIENT_IDENTITY = {
41
572
  name: "coding_agents",
42
573
  version: VERSION
@@ -4444,7 +4975,7 @@ function alwaysOnHealth(home) {
4444
4975
  return { wanted: state !== "off", healthy: state !== "down" };
4445
4976
  }
4446
4977
 
4447
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.1313111/node_modules/@agentchatme/agent-core/dist/index.js
4978
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.131311111/node_modules/@agentchatme/agent-core/dist/index.js
4448
4979
  import * as fs from "fs";
4449
4980
  import * as path from "path";
4450
4981
  import * as readline from "readline";
@@ -5785,11 +6316,11 @@ var HOUR2 = 60 * MIN2;
5785
6316
  var DAY2 = 24 * HOUR2;
5786
6317
  var MAX_ATTACHMENT_SIZE = 25 * 1024 * 1024;
5787
6318
 
5788
- // node_modules/.pnpm/@agentchatme+agent-core@0.0.1313111/node_modules/@agentchatme/agent-core/dist/index.js
6319
+ // node_modules/.pnpm/@agentchatme+agent-core@0.0.131311111/node_modules/@agentchatme/agent-core/dist/index.js
6320
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
5789
6321
  import * as fs22 from "fs";
5790
6322
  import * as os from "os";
5791
6323
  import * as path22 from "path";
5792
- import { spawnSync, spawn } from "child_process";
5793
6324
  var SESSION_TTL_MS = 48 * 60 * 60 * 1e3;
5794
6325
  var SessionStateSchema = external_exports.object({
5795
6326
  continuations: external_exports.number().int().min(0),
@@ -6087,16 +6618,20 @@ function formatAlwaysOnDown(copy) {
6087
6618
  function formatRegistrationOffer(copy, alwaysOn = "off") {
6088
6619
  const { invoke, label } = copy;
6089
6620
  return [
6090
- `This ${label} agent is on AgentChat but has no handle yet \u2014 no address other agents can reach it at.`,
6621
+ `AgentChat is installed for this ${label} agent, but it does not have an AgentChat account yet.`,
6091
6622
  "",
6092
6623
  "If the moment is right, offer it in ONE plain sentence and let them answer. Do not paste this block,",
6093
6624
  "do not list the commands, do not walk them through steps. You run the commands; they just talk to you.",
6094
6625
  "",
6095
- "All you need from them is an email and a handle they like (3\u201330 characters, lowercase letters, digits",
6096
- "and hyphens, starting with a letter). Ask first whether they already have an AgentChat account \u2014 from",
6097
- "another machine, or a Hermes or OpenClaw agent \u2014 so you sign that one in instead of creating a second.",
6098
- `Either way this ${label} agent ends up with its own handle, separate from any other coding agent here,`,
6099
- "which is what lets them message each other.",
6626
+ `Ask exactly: "Do you already have an AgentChat account for this ${label} agent, or should I create a new one?"`,
6627
+ "",
6628
+ 'For a new account, explain: "I need an email for verification and recovery and the @handle you want me',
6629
+ 'to use. AgentChat will email a 6-digit code to finish setup." The handle must be 3\u201330 characters:',
6630
+ "lowercase letters, digits, and hyphens, starting with a letter.",
6631
+ "",
6632
+ `An existing-account answer means an account that already belongs to this ${label} agent. Ask for that`,
6633
+ "account's API key. Never reuse another active coding agent's account; separately reachable agents need",
6634
+ "separate accounts.",
6100
6635
  "",
6101
6636
  "Commands \u2014 yours to run, not to show:",
6102
6637
  ` new account ${invoke} register --email <email> --handle <handle>`,
@@ -6127,22 +6662,26 @@ function renderUnregisteredBlock(copy) {
6127
6662
  const { invoke, label } = copy;
6128
6663
  return [
6129
6664
  ANCHOR_START,
6130
- "## AgentChat is installed \u2014 this agent has no handle yet",
6665
+ "## AgentChat is installed \u2014 this agent has no account yet",
6131
6666
  "",
6132
- `[AgentChat](https://agentchat.me) gives you, the ${label} agent, a persistent \`@handle\` other AI agents can DM. It is set up on this machine but no identity has been created, so you are not reachable yet.`,
6667
+ `[AgentChat](https://agentchat.me) gives you, the ${label} agent, a persistent \`@handle\` other AI agents can DM. AgentChat is installed for this ${label} agent, but it does not have an AgentChat account yet, so other agents cannot reach it.`,
6133
6668
  "",
6134
6669
  "**Offer this ONCE, early, and only if it fits the conversation.** Do not interrupt work in progress to raise it, and never raise it twice in one session.",
6135
6670
  "",
6136
- "FIRST ask whether they already have an AgentChat account \u2014 from another machine, or another coding agent \u2014 so you sign in instead of creating a duplicate.",
6671
+ `FIRST ask exactly: "Do you already have an AgentChat account for this ${label} agent, or should I create a new one?"`,
6137
6672
  "",
6138
- "New to AgentChat:",
6139
- " 1. Ask for their email and a desired handle (3\u201330 chars, lowercase letters/digits/hyphens, starts with a letter).",
6140
- ` 2. Run: ${invoke} register --email <email> --handle <handle>`,
6141
- ` 3. A 6-digit code arrives by email; ask for it, then run: ${invoke} register --code <code>`,
6673
+ "If they want a new account:",
6674
+ ' 1. Explain: "I need an email for verification and recovery and the @handle you want me to use. AgentChat will email a 6-digit code to finish setup."',
6675
+ " 2. Ask for the email and handle (3\u201330 chars, lowercase letters/digits/hyphens, starts with a letter).",
6676
+ ` 3. Run: ${invoke} register --email <email> --handle <handle>`,
6677
+ ` 4. Ask for the 6-digit code from the email, then run: ${invoke} register --code <code>`,
6142
6678
  "",
6143
- "Already have an agent elsewhere:",
6144
- ` \u2022 With its API key: ${invoke} login --api-key <ac_\u2026>`,
6679
+ `If they already have an account for this ${label} agent:`,
6680
+ ` \u2022 Ask for that account's API key, then run: ${invoke} login --api-key <ac_\u2026>`,
6145
6681
  ` \u2022 Key lost: ${invoke} recover --email <email>, then ${invoke} recover --code <code>`,
6682
+ " \u2022 Never reuse another active coding agent\u2019s account; separately reachable agents need separate accounts.",
6683
+ "",
6684
+ "**The commands are yours to run, not the user\u2019s.**",
6146
6685
  "",
6147
6686
  `**If they decline or say "later", run \`${invoke} register --not-now\` immediately.** That records the answer and removes this prompt \u2014 otherwise you will re-read it and ask again every session, which is exactly what it must not do.`,
6148
6687
  ANCHOR_END
@@ -7068,6 +7607,8 @@ function renderManual(copy, opts = {}) {
7068
7607
  ""
7069
7608
  ].join("\n");
7070
7609
  }
7610
+ var spawnCommand = import_cross_spawn.default;
7611
+ var spawnCommandSync = import_cross_spawn.default.sync;
7071
7612
  function serviceValue(name, value) {
7072
7613
  if (/[\0\r\n]/.test(value)) {
7073
7614
  throw new Error(`invalid control character in service ${name}`);
@@ -7096,7 +7637,7 @@ function plan(opts) {
7096
7637
  };
7097
7638
  }
7098
7639
  function run(cmd, args) {
7099
- const r = spawnSync(cmd, args, { encoding: "utf-8" });
7640
+ const r = spawnCommandSync(cmd, args, { encoding: "utf-8" });
7100
7641
  const out = [
7101
7642
  typeof r.stdout === "string" ? r.stdout : "",
7102
7643
  typeof r.stderr === "string" ? r.stderr : "",
@@ -7299,7 +7840,7 @@ function wslScriptContent(p) {
7299
7840
  function startDetached(cmd, args) {
7300
7841
  if (process.env["AGENTCHATD_SERVICE_NO_START"] === "1") return;
7301
7842
  try {
7302
- spawn(cmd, args, { detached: true, stdio: "ignore", windowsHide: true }).unref();
7843
+ spawnCommand(cmd, args, { detached: true, stdio: "ignore", windowsHide: true }).unref();
7303
7844
  } catch (err) {
7304
7845
  log.warn(`could not start the launcher now (it starts at next login): ${String(err)}`);
7305
7846
  }
@@ -7470,17 +8011,15 @@ function serviceEnv() {
7470
8011
  import * as fs6 from "fs";
7471
8012
  import * as os3 from "os";
7472
8013
  import * as path7 from "path";
7473
- import { spawnSync as spawnSync3 } from "child_process";
7474
8014
  import { fileURLToPath } from "url";
7475
8015
 
7476
8016
  // src/adapter.ts
7477
8017
  import * as fs5 from "fs";
7478
8018
  import * as path6 from "path";
7479
8019
  import * as crypto from "crypto";
7480
- import { spawn as spawn2, spawnSync as spawnSync2 } from "child_process";
7481
8020
 
7482
8021
  // src/version.ts
7483
- var VERSION3 = "0.0.1394114111";
8022
+ var VERSION3 = "0.0.139411411111";
7484
8023
 
7485
8024
  // src/runtime-version.ts
7486
8025
  var MIN_CLAUDE_CODE_VERSION = "2.1.219";
@@ -7502,7 +8041,7 @@ function semverAtLeast(actual, minimum) {
7502
8041
  var MAX_EVENT_TAIL_CHARS = 1024 * 1024;
7503
8042
  var AGENTCHAT_MCP_PACKAGE = "@agentchatme/mcp@0.1.1121411";
7504
8043
  function claudeIsLoggedIn(configDir) {
7505
- const status = spawnSync2("claude", ["auth", "status"], {
8044
+ const status = spawnCommandSync("claude", ["auth", "status"], {
7506
8045
  encoding: "utf-8",
7507
8046
  timeout: 1e4,
7508
8047
  env: { ...process.env, CLAUDE_CONFIG_DIR: configDir }
@@ -7510,7 +8049,7 @@ function claudeIsLoggedIn(configDir) {
7510
8049
  if (!status.error && status.status === 0) return true;
7511
8050
  if (fs5.existsSync(path6.join(configDir, ".credentials.json"))) return true;
7512
8051
  if (process.platform !== "darwin") return false;
7513
- const keychain = spawnSync2(
8052
+ const keychain = spawnCommandSync(
7514
8053
  "security",
7515
8054
  ["find-generic-password", "-s", "Claude Code-credentials"],
7516
8055
  { encoding: "utf-8", timeout: 5e3 }
@@ -7690,7 +8229,7 @@ ${result.stdout ?? ""}`.trim();
7690
8229
  return output || `exited ${result.status}`;
7691
8230
  }
7692
8231
  function inspectClaudeRuntime() {
7693
- const version = spawnSync3("claude", ["--version"], {
8232
+ const version = spawnCommandSync("claude", ["--version"], {
7694
8233
  encoding: "utf-8",
7695
8234
  timeout: 5e3,
7696
8235
  windowsHide: true,
@@ -7800,7 +8339,7 @@ function ensureMcp(bundle) {
7800
8339
  warning: `could not inspect Claude MCP configuration: ${current.detail}`
7801
8340
  };
7802
8341
  }
7803
- const added = spawnSync3(
8342
+ const added = spawnCommandSync(
7804
8343
  "claude",
7805
8344
  ["mcp", "add", "--scope", "user", "agentchat", "--", "node", bundle, "mcp-proxy"],
7806
8345
  {
@@ -7825,7 +8364,7 @@ function removeOwnedMcp() {
7825
8364
  if (current.state !== "ours") {
7826
8365
  return { removed: false };
7827
8366
  }
7828
- const result = spawnSync3(
8367
+ const result = spawnCommandSync(
7829
8368
  "claude",
7830
8369
  ["mcp", "remove", "--scope", "user", "agentchat"],
7831
8370
  {
@@ -7861,7 +8400,7 @@ function legacyPluginAtUserScope(value, inheritedScope) {
7861
8400
  );
7862
8401
  }
7863
8402
  function removeLegacyUserPlugin() {
7864
- const listed = spawnSync3("claude", ["plugin", "list", "--json"], {
8403
+ const listed = spawnCommandSync("claude", ["plugin", "list", "--json"], {
7865
8404
  encoding: "utf-8",
7866
8405
  timeout: 1e4,
7867
8406
  windowsHide: true,
@@ -7879,7 +8418,7 @@ function removeLegacyUserPlugin() {
7879
8418
  };
7880
8419
  }
7881
8420
  if (!legacyPluginAtUserScope(plugins)) return { removed: false };
7882
- const removed = spawnSync3(
8421
+ const removed = spawnCommandSync(
7883
8422
  "claude",
7884
8423
  ["plugin", "uninstall", LEGACY_PLUGIN_ID, "--scope", "user", "--yes"],
7885
8424
  {
@@ -8075,7 +8614,6 @@ function removeClaudeWiring(opts = {}) {
8075
8614
  // src/identity.ts
8076
8615
  import * as fs8 from "fs";
8077
8616
  import * as path8 from "path";
8078
- import { spawnSync as spawnSync4 } from "child_process";
8079
8617
 
8080
8618
  // src/always-on.ts
8081
8619
  import * as fs7 from "fs";
@@ -8131,7 +8669,7 @@ function concise(value) {
8131
8669
  return value.replace(/\s+/g, " ").trim().slice(0, 180);
8132
8670
  }
8133
8671
  function runtimeChecks() {
8134
- const npx = spawnSync4("npx", ["--version"], {
8672
+ const npx = spawnCommandSync("npx", ["--version"], {
8135
8673
  encoding: "utf-8",
8136
8674
  timeout: 5e3,
8137
8675
  windowsHide: true
@@ -8378,6 +8916,7 @@ async function main(argv = process.argv.slice(2)) {
8378
8916
  const home = identityHome();
8379
8917
  const handle = readCredentials(home)?.handle ?? null;
8380
8918
  let failed = false;
8919
+ let backgroundDelivery = "enabled";
8381
8920
  try {
8382
8921
  const result = installClaude(handle);
8383
8922
  const { actions, warnings } = result;
@@ -8391,6 +8930,7 @@ async function main(argv = process.argv.slice(2)) {
8391
8930
  if (alwaysOn.ok) actions.push("always-on service registered");
8392
8931
  else if (alwaysOn.detail === "switched off by the user") {
8393
8932
  actions.push("always-on remains off (user choice)");
8933
+ backgroundDelivery = "off-by-choice";
8394
8934
  } else {
8395
8935
  failed = true;
8396
8936
  warnings.push(
@@ -8399,9 +8939,21 @@ async function main(argv = process.argv.slice(2)) {
8399
8939
  }
8400
8940
  }
8401
8941
  if (warnings.length > 0) failed = true;
8402
- console.log(
8403
- !result.complete ? `${LABEL}: wiring incomplete` : failed ? `${LABEL}: direct wiring installed, but action is still required` : `${LABEL}: wired \u2713 (${actions.join(", ") || "no changes"})`
8404
- );
8942
+ if (result.complete && !failed) {
8943
+ console.log(
8944
+ [
8945
+ "AgentChat for Claude Code",
8946
+ "",
8947
+ " \u2713 Integration installed",
8948
+ backgroundDelivery === "enabled" ? " \u2713 Background delivery enabled" : " \u25CB Background delivery is off (your choice)",
8949
+ ...handle !== null ? [` \u2713 AgentChat account connected as @${handle}`] : []
8950
+ ].join("\n")
8951
+ );
8952
+ } else {
8953
+ console.log(
8954
+ !result.complete ? `${LABEL}: wiring incomplete` : `${LABEL}: direct wiring installed, but action is still required`
8955
+ );
8956
+ }
8405
8957
  for (const warning of warnings) console.log(` \u26A0 ${warning}`);
8406
8958
  } catch (err) {
8407
8959
  console.error(`${LABEL}: wiring failed \u2014 ${String(err)}`);
@@ -8412,14 +8964,13 @@ async function main(argv = process.argv.slice(2)) {
8412
8964
  console.log(
8413
8965
  [
8414
8966
  "",
8415
- `Last step \u2014 give ${LABEL} its @handle:`,
8416
- " Open a new Claude Code session and it will offer to set one up \u2014 or run:",
8417
- ` ${invocation()} register --email <email> --handle <handle>`
8967
+ "Next:",
8968
+ " 1. Open a new Claude Code session",
8969
+ ' 2. Ask Claude Code: "Set up your AgentChat account."'
8418
8970
  ].join("\n")
8419
8971
  );
8420
8972
  } else {
8421
- console.log(`
8422
- Signed in as @${handle}. Start a new Claude Code session to load the integration.`);
8973
+ console.log("\nNext: Open a new Claude Code session.");
8423
8974
  }
8424
8975
  return 0;
8425
8976
  }
@@ -8490,7 +9041,7 @@ async function runMcpProxy() {
8490
9041
  env["AGENTCHAT_CLIENT_NAME"] = "claude-code";
8491
9042
  env["AGENTCHAT_CLIENT_VERSION"] = VERSION3;
8492
9043
  return await new Promise((resolve4) => {
8493
- const child = spawn3("npx", ["-y", AGENTCHAT_MCP_PACKAGE], {
9044
+ const child = spawnCommand("npx", ["-y", AGENTCHAT_MCP_PACKAGE], {
8494
9045
  stdio: "inherit",
8495
9046
  env,
8496
9047
  windowsHide: true