@moxxy/cli 0.28.0 → 0.28.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.
Files changed (2) hide show
  1. package/dist/bin.js +1152 -517
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -20,13 +20,13 @@ import { EventEmitter } from 'events';
20
20
  import { Buffer as Buffer$1 } from 'buffer';
21
21
  import { isFileDiffDisplay as isFileDiffDisplay$1 } from '@moxxy/sdk/tool-display';
22
22
  import { readFile, mkdir, open, rm, stat, rename, realpath, unlink, writeFile, access, constants as constants$2, readdir } from 'fs/promises';
23
+ import http, { createServer } from 'http';
23
24
  import 'zod/v3';
24
25
  import * as z4mini from 'zod/v4-mini';
25
26
  import * as z52 from 'zod/v4';
26
27
  import { promisify, deprecate, inspect, styleText, stripVTControlCharacters } from 'util';
27
28
  import * as b2 from 'readline';
28
29
  import b2__default, { createInterface } from 'readline';
29
- import http, { createServer } from 'http';
30
30
  import net2, { connect, createConnection } from 'net';
31
31
  import { Worker } from 'worker_threads';
32
32
  import https from 'https';
@@ -1309,7 +1309,7 @@ function toposortPluginManifests(manifests) {
1309
1309
  const order = [];
1310
1310
  const visited = /* @__PURE__ */ new Set();
1311
1311
  const onStack = /* @__PURE__ */ new Set();
1312
- const path61 = [];
1312
+ const path63 = [];
1313
1313
  const visitRoot = (root) => {
1314
1314
  if (visited.has(root))
1315
1315
  return;
@@ -1318,7 +1318,7 @@ function toposortPluginManifests(manifests) {
1318
1318
  return;
1319
1319
  const stack = [{ name: root, deps: pluginDeps(rootManifest.requirements), next: 0 }];
1320
1320
  onStack.add(root);
1321
- path61.push(root);
1321
+ path63.push(root);
1322
1322
  while (stack.length > 0) {
1323
1323
  const frame = stack[stack.length - 1];
1324
1324
  if (!frame)
@@ -1330,20 +1330,20 @@ function toposortPluginManifests(manifests) {
1330
1330
  if (visited.has(dep))
1331
1331
  continue;
1332
1332
  if (onStack.has(dep)) {
1333
- const startIdx = path61.indexOf(dep);
1334
- throw new PluginCycleError(path61.slice(startIdx).concat(dep));
1333
+ const startIdx = path63.indexOf(dep);
1334
+ throw new PluginCycleError(path63.slice(startIdx).concat(dep));
1335
1335
  }
1336
1336
  const depManifest = byPackage.get(dep);
1337
1337
  if (!depManifest)
1338
1338
  continue;
1339
1339
  onStack.add(dep);
1340
- path61.push(dep);
1340
+ path63.push(dep);
1341
1341
  stack.push({ name: dep, deps: pluginDeps(depManifest.requirements), next: 0 });
1342
1342
  continue;
1343
1343
  }
1344
1344
  const done = stack.pop();
1345
1345
  onStack.delete(done.name);
1346
- path61.pop();
1346
+ path63.pop();
1347
1347
  visited.add(done.name);
1348
1348
  const manifest = byPackage.get(done.name);
1349
1349
  if (manifest)
@@ -3048,8 +3048,8 @@ var init_skills = __esm({
3048
3048
  });
3049
3049
  function formatZodIssues(error2) {
3050
3050
  return error2.issues.map((iss) => {
3051
- const path61 = iss.path.length ? iss.path.join(".") : "(root)";
3052
- return `${path61}: ${iss.message}`;
3051
+ const path63 = iss.path.length ? iss.path.join(".") : "(root)";
3052
+ return `${path63}: ${iss.message}`;
3053
3053
  }).join("; ");
3054
3054
  }
3055
3055
  function emptyLog() {
@@ -10210,17 +10210,17 @@ var require_visit = __commonJS({
10210
10210
  visit.BREAK = BREAK;
10211
10211
  visit.SKIP = SKIP;
10212
10212
  visit.REMOVE = REMOVE;
10213
- function visit_(key, node, visitor, path61) {
10214
- const ctrl = callVisitor(key, node, visitor, path61);
10213
+ function visit_(key, node, visitor, path63) {
10214
+ const ctrl = callVisitor(key, node, visitor, path63);
10215
10215
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
10216
- replaceNode(key, path61, ctrl);
10217
- return visit_(key, ctrl, visitor, path61);
10216
+ replaceNode(key, path63, ctrl);
10217
+ return visit_(key, ctrl, visitor, path63);
10218
10218
  }
10219
10219
  if (typeof ctrl !== "symbol") {
10220
10220
  if (identity.isCollection(node)) {
10221
- path61 = Object.freeze(path61.concat(node));
10221
+ path63 = Object.freeze(path63.concat(node));
10222
10222
  for (let i2 = 0; i2 < node.items.length; ++i2) {
10223
- const ci = visit_(i2, node.items[i2], visitor, path61);
10223
+ const ci = visit_(i2, node.items[i2], visitor, path63);
10224
10224
  if (typeof ci === "number")
10225
10225
  i2 = ci - 1;
10226
10226
  else if (ci === BREAK)
@@ -10231,13 +10231,13 @@ var require_visit = __commonJS({
10231
10231
  }
10232
10232
  }
10233
10233
  } else if (identity.isPair(node)) {
10234
- path61 = Object.freeze(path61.concat(node));
10235
- const ck = visit_("key", node.key, visitor, path61);
10234
+ path63 = Object.freeze(path63.concat(node));
10235
+ const ck = visit_("key", node.key, visitor, path63);
10236
10236
  if (ck === BREAK)
10237
10237
  return BREAK;
10238
10238
  else if (ck === REMOVE)
10239
10239
  node.key = null;
10240
- const cv = visit_("value", node.value, visitor, path61);
10240
+ const cv = visit_("value", node.value, visitor, path63);
10241
10241
  if (cv === BREAK)
10242
10242
  return BREAK;
10243
10243
  else if (cv === REMOVE)
@@ -10258,17 +10258,17 @@ var require_visit = __commonJS({
10258
10258
  visitAsync.BREAK = BREAK;
10259
10259
  visitAsync.SKIP = SKIP;
10260
10260
  visitAsync.REMOVE = REMOVE;
10261
- async function visitAsync_(key, node, visitor, path61) {
10262
- const ctrl = await callVisitor(key, node, visitor, path61);
10261
+ async function visitAsync_(key, node, visitor, path63) {
10262
+ const ctrl = await callVisitor(key, node, visitor, path63);
10263
10263
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
10264
- replaceNode(key, path61, ctrl);
10265
- return visitAsync_(key, ctrl, visitor, path61);
10264
+ replaceNode(key, path63, ctrl);
10265
+ return visitAsync_(key, ctrl, visitor, path63);
10266
10266
  }
10267
10267
  if (typeof ctrl !== "symbol") {
10268
10268
  if (identity.isCollection(node)) {
10269
- path61 = Object.freeze(path61.concat(node));
10269
+ path63 = Object.freeze(path63.concat(node));
10270
10270
  for (let i2 = 0; i2 < node.items.length; ++i2) {
10271
- const ci = await visitAsync_(i2, node.items[i2], visitor, path61);
10271
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path63);
10272
10272
  if (typeof ci === "number")
10273
10273
  i2 = ci - 1;
10274
10274
  else if (ci === BREAK)
@@ -10279,13 +10279,13 @@ var require_visit = __commonJS({
10279
10279
  }
10280
10280
  }
10281
10281
  } else if (identity.isPair(node)) {
10282
- path61 = Object.freeze(path61.concat(node));
10283
- const ck = await visitAsync_("key", node.key, visitor, path61);
10282
+ path63 = Object.freeze(path63.concat(node));
10283
+ const ck = await visitAsync_("key", node.key, visitor, path63);
10284
10284
  if (ck === BREAK)
10285
10285
  return BREAK;
10286
10286
  else if (ck === REMOVE)
10287
10287
  node.key = null;
10288
- const cv = await visitAsync_("value", node.value, visitor, path61);
10288
+ const cv = await visitAsync_("value", node.value, visitor, path63);
10289
10289
  if (cv === BREAK)
10290
10290
  return BREAK;
10291
10291
  else if (cv === REMOVE)
@@ -10312,23 +10312,23 @@ var require_visit = __commonJS({
10312
10312
  }
10313
10313
  return visitor;
10314
10314
  }
10315
- function callVisitor(key, node, visitor, path61) {
10315
+ function callVisitor(key, node, visitor, path63) {
10316
10316
  if (typeof visitor === "function")
10317
- return visitor(key, node, path61);
10317
+ return visitor(key, node, path63);
10318
10318
  if (identity.isMap(node))
10319
- return visitor.Map?.(key, node, path61);
10319
+ return visitor.Map?.(key, node, path63);
10320
10320
  if (identity.isSeq(node))
10321
- return visitor.Seq?.(key, node, path61);
10321
+ return visitor.Seq?.(key, node, path63);
10322
10322
  if (identity.isPair(node))
10323
- return visitor.Pair?.(key, node, path61);
10323
+ return visitor.Pair?.(key, node, path63);
10324
10324
  if (identity.isScalar(node))
10325
- return visitor.Scalar?.(key, node, path61);
10325
+ return visitor.Scalar?.(key, node, path63);
10326
10326
  if (identity.isAlias(node))
10327
- return visitor.Alias?.(key, node, path61);
10327
+ return visitor.Alias?.(key, node, path63);
10328
10328
  return void 0;
10329
10329
  }
10330
- function replaceNode(key, path61, node) {
10331
- const parent = path61[path61.length - 1];
10330
+ function replaceNode(key, path63, node) {
10331
+ const parent = path63[path63.length - 1];
10332
10332
  if (identity.isCollection(parent)) {
10333
10333
  parent.items[key] = node;
10334
10334
  } else if (identity.isPair(parent)) {
@@ -10929,10 +10929,10 @@ var require_Collection = __commonJS({
10929
10929
  var createNode2 = require_createNode();
10930
10930
  var identity = require_identity();
10931
10931
  var Node = require_Node();
10932
- function collectionFromPath(schema, path61, value) {
10932
+ function collectionFromPath(schema, path63, value) {
10933
10933
  let v3 = value;
10934
- for (let i2 = path61.length - 1; i2 >= 0; --i2) {
10935
- const k3 = path61[i2];
10934
+ for (let i2 = path63.length - 1; i2 >= 0; --i2) {
10935
+ const k3 = path63[i2];
10936
10936
  if (typeof k3 === "number" && Number.isInteger(k3) && k3 >= 0) {
10937
10937
  const a2 = [];
10938
10938
  a2[k3] = v3;
@@ -10951,7 +10951,7 @@ var require_Collection = __commonJS({
10951
10951
  sourceObjects: /* @__PURE__ */ new Map()
10952
10952
  });
10953
10953
  }
10954
- var isEmptyPath = (path61) => path61 == null || typeof path61 === "object" && !!path61[Symbol.iterator]().next().done;
10954
+ var isEmptyPath = (path63) => path63 == null || typeof path63 === "object" && !!path63[Symbol.iterator]().next().done;
10955
10955
  var Collection = class extends Node.NodeBase {
10956
10956
  constructor(type, schema) {
10957
10957
  super(type);
@@ -10981,11 +10981,11 @@ var require_Collection = __commonJS({
10981
10981
  * be a Pair instance or a `{ key, value }` object, which may not have a key
10982
10982
  * that already exists in the map.
10983
10983
  */
10984
- addIn(path61, value) {
10985
- if (isEmptyPath(path61))
10984
+ addIn(path63, value) {
10985
+ if (isEmptyPath(path63))
10986
10986
  this.add(value);
10987
10987
  else {
10988
- const [key, ...rest] = path61;
10988
+ const [key, ...rest] = path63;
10989
10989
  const node = this.get(key, true);
10990
10990
  if (identity.isCollection(node))
10991
10991
  node.addIn(rest, value);
@@ -10999,8 +10999,8 @@ var require_Collection = __commonJS({
10999
10999
  * Removes a value from the collection.
11000
11000
  * @returns `true` if the item was found and removed.
11001
11001
  */
11002
- deleteIn(path61) {
11003
- const [key, ...rest] = path61;
11002
+ deleteIn(path63) {
11003
+ const [key, ...rest] = path63;
11004
11004
  if (rest.length === 0)
11005
11005
  return this.delete(key);
11006
11006
  const node = this.get(key, true);
@@ -11014,8 +11014,8 @@ var require_Collection = __commonJS({
11014
11014
  * scalar values from their surrounding node; to disable set `keepScalar` to
11015
11015
  * `true` (collections are always returned intact).
11016
11016
  */
11017
- getIn(path61, keepScalar) {
11018
- const [key, ...rest] = path61;
11017
+ getIn(path63, keepScalar) {
11018
+ const [key, ...rest] = path63;
11019
11019
  const node = this.get(key, true);
11020
11020
  if (rest.length === 0)
11021
11021
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -11033,8 +11033,8 @@ var require_Collection = __commonJS({
11033
11033
  /**
11034
11034
  * Checks if the collection includes a value with the key `key`.
11035
11035
  */
11036
- hasIn(path61) {
11037
- const [key, ...rest] = path61;
11036
+ hasIn(path63) {
11037
+ const [key, ...rest] = path63;
11038
11038
  if (rest.length === 0)
11039
11039
  return this.has(key);
11040
11040
  const node = this.get(key, true);
@@ -11044,8 +11044,8 @@ var require_Collection = __commonJS({
11044
11044
  * Sets a value in this collection. For `!!set`, `value` needs to be a
11045
11045
  * boolean to add/remove the item from the set.
11046
11046
  */
11047
- setIn(path61, value) {
11048
- const [key, ...rest] = path61;
11047
+ setIn(path63, value) {
11048
+ const [key, ...rest] = path63;
11049
11049
  if (rest.length === 0) {
11050
11050
  this.set(key, value);
11051
11051
  } else {
@@ -13525,9 +13525,9 @@ var require_Document = __commonJS({
13525
13525
  this.contents.add(value);
13526
13526
  }
13527
13527
  /** Adds a value to the document. */
13528
- addIn(path61, value) {
13528
+ addIn(path63, value) {
13529
13529
  if (assertCollection(this.contents))
13530
- this.contents.addIn(path61, value);
13530
+ this.contents.addIn(path63, value);
13531
13531
  }
13532
13532
  /**
13533
13533
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -13602,14 +13602,14 @@ var require_Document = __commonJS({
13602
13602
  * Removes a value from the document.
13603
13603
  * @returns `true` if the item was found and removed.
13604
13604
  */
13605
- deleteIn(path61) {
13606
- if (Collection.isEmptyPath(path61)) {
13605
+ deleteIn(path63) {
13606
+ if (Collection.isEmptyPath(path63)) {
13607
13607
  if (this.contents == null)
13608
13608
  return false;
13609
13609
  this.contents = null;
13610
13610
  return true;
13611
13611
  }
13612
- return assertCollection(this.contents) ? this.contents.deleteIn(path61) : false;
13612
+ return assertCollection(this.contents) ? this.contents.deleteIn(path63) : false;
13613
13613
  }
13614
13614
  /**
13615
13615
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -13624,10 +13624,10 @@ var require_Document = __commonJS({
13624
13624
  * scalar values from their surrounding node; to disable set `keepScalar` to
13625
13625
  * `true` (collections are always returned intact).
13626
13626
  */
13627
- getIn(path61, keepScalar) {
13628
- if (Collection.isEmptyPath(path61))
13627
+ getIn(path63, keepScalar) {
13628
+ if (Collection.isEmptyPath(path63))
13629
13629
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
13630
- return identity.isCollection(this.contents) ? this.contents.getIn(path61, keepScalar) : void 0;
13630
+ return identity.isCollection(this.contents) ? this.contents.getIn(path63, keepScalar) : void 0;
13631
13631
  }
13632
13632
  /**
13633
13633
  * Checks if the document includes a value with the key `key`.
@@ -13638,10 +13638,10 @@ var require_Document = __commonJS({
13638
13638
  /**
13639
13639
  * Checks if the document includes a value at `path`.
13640
13640
  */
13641
- hasIn(path61) {
13642
- if (Collection.isEmptyPath(path61))
13641
+ hasIn(path63) {
13642
+ if (Collection.isEmptyPath(path63))
13643
13643
  return this.contents !== void 0;
13644
- return identity.isCollection(this.contents) ? this.contents.hasIn(path61) : false;
13644
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path63) : false;
13645
13645
  }
13646
13646
  /**
13647
13647
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -13658,13 +13658,13 @@ var require_Document = __commonJS({
13658
13658
  * Sets a value in this document. For `!!set`, `value` needs to be a
13659
13659
  * boolean to add/remove the item from the set.
13660
13660
  */
13661
- setIn(path61, value) {
13662
- if (Collection.isEmptyPath(path61)) {
13661
+ setIn(path63, value) {
13662
+ if (Collection.isEmptyPath(path63)) {
13663
13663
  this.contents = value;
13664
13664
  } else if (this.contents == null) {
13665
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path61), value);
13665
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path63), value);
13666
13666
  } else if (assertCollection(this.contents)) {
13667
- this.contents.setIn(path61, value);
13667
+ this.contents.setIn(path63, value);
13668
13668
  }
13669
13669
  }
13670
13670
  /**
@@ -15604,9 +15604,9 @@ var require_cst_visit = __commonJS({
15604
15604
  visit.BREAK = BREAK;
15605
15605
  visit.SKIP = SKIP;
15606
15606
  visit.REMOVE = REMOVE;
15607
- visit.itemAtPath = (cst, path61) => {
15607
+ visit.itemAtPath = (cst, path63) => {
15608
15608
  let item = cst;
15609
- for (const [field, index] of path61) {
15609
+ for (const [field, index] of path63) {
15610
15610
  const tok = item?.[field];
15611
15611
  if (tok && "items" in tok) {
15612
15612
  item = tok.items[index];
@@ -15615,23 +15615,23 @@ var require_cst_visit = __commonJS({
15615
15615
  }
15616
15616
  return item;
15617
15617
  };
15618
- visit.parentCollection = (cst, path61) => {
15619
- const parent = visit.itemAtPath(cst, path61.slice(0, -1));
15620
- const field = path61[path61.length - 1][0];
15618
+ visit.parentCollection = (cst, path63) => {
15619
+ const parent = visit.itemAtPath(cst, path63.slice(0, -1));
15620
+ const field = path63[path63.length - 1][0];
15621
15621
  const coll = parent?.[field];
15622
15622
  if (coll && "items" in coll)
15623
15623
  return coll;
15624
15624
  throw new Error("Parent collection not found");
15625
15625
  };
15626
- function _visit(path61, item, visitor) {
15627
- let ctrl = visitor(item, path61);
15626
+ function _visit(path63, item, visitor) {
15627
+ let ctrl = visitor(item, path63);
15628
15628
  if (typeof ctrl === "symbol")
15629
15629
  return ctrl;
15630
15630
  for (const field of ["key", "value"]) {
15631
15631
  const token = item[field];
15632
15632
  if (token && "items" in token) {
15633
15633
  for (let i2 = 0; i2 < token.items.length; ++i2) {
15634
- const ci = _visit(Object.freeze(path61.concat([[field, i2]])), token.items[i2], visitor);
15634
+ const ci = _visit(Object.freeze(path63.concat([[field, i2]])), token.items[i2], visitor);
15635
15635
  if (typeof ci === "number")
15636
15636
  i2 = ci - 1;
15637
15637
  else if (ci === BREAK)
@@ -15642,10 +15642,10 @@ var require_cst_visit = __commonJS({
15642
15642
  }
15643
15643
  }
15644
15644
  if (typeof ctrl === "function" && field === "key")
15645
- ctrl = ctrl(item, path61);
15645
+ ctrl = ctrl(item, path63);
15646
15646
  }
15647
15647
  }
15648
- return typeof ctrl === "function" ? ctrl(item, path61) : ctrl;
15648
+ return typeof ctrl === "function" ? ctrl(item, path63) : ctrl;
15649
15649
  }
15650
15650
  exports.visit = visit;
15651
15651
  }
@@ -17967,10 +17967,10 @@ async function removeProviderItem(providerName2, opts = {}) {
17967
17967
  const configPath = opts.configPath ?? defaultUserConfigPath();
17968
17968
  return configMutex.run(async () => {
17969
17969
  const doc = await readUserConfigDoc(configPath);
17970
- const path61 = ["plugins", "provider", "items", providerName2];
17971
- if (!doc.hasIn(path61))
17970
+ const path63 = ["plugins", "provider", "items", providerName2];
17971
+ if (!doc.hasIn(path63))
17972
17972
  return false;
17973
- doc.deleteIn(path61);
17973
+ doc.deleteIn(path63);
17974
17974
  await writeUserConfigDoc(configPath, doc);
17975
17975
  return true;
17976
17976
  });
@@ -18056,17 +18056,17 @@ async function readPackagesMap(configPath) {
18056
18056
  }
18057
18057
  return out;
18058
18058
  }
18059
- function readRawEntry(doc, path61) {
18060
- const node = doc.getIn(path61, false);
18059
+ function readRawEntry(doc, path63) {
18060
+ const node = doc.getIn(path63, false);
18061
18061
  if (!(0, import_yaml.isMap)(node))
18062
18062
  return {};
18063
18063
  const raw = node.toJSON();
18064
18064
  return typeof raw === "object" && raw !== null && !Array.isArray(raw) ? raw : {};
18065
18065
  }
18066
- function pruneEmpty(doc, path61) {
18067
- const node = doc.getIn(path61);
18066
+ function pruneEmpty(doc, path63) {
18067
+ const node = doc.getIn(path63);
18068
18068
  if ((0, import_yaml.isMap)(node) && node.items.length === 0)
18069
- doc.deleteIn(path61);
18069
+ doc.deleteIn(path63);
18070
18070
  }
18071
18071
  function isNotFound(err) {
18072
18072
  return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
@@ -18237,9 +18237,9 @@ function setupFieldVaultKey(packageName, field) {
18237
18237
  return `${pkg}_${field.key}`.replace(/([a-z])([A-Z])/g, "$1_$2").toUpperCase();
18238
18238
  }
18239
18239
  async function applySetupValues(opts) {
18240
- const writeConfig = opts.writeConfig ?? (async (path61, value) => {
18240
+ const writeConfig = opts.writeConfig ?? (async (path63, value) => {
18241
18241
  const { setConfigValue: setConfigValue2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports2));
18242
- await setConfigValue2({ scope: "user", cwd: opts.cwd, path: path61, value });
18242
+ await setConfigValue2({ scope: "user", cwd: opts.cwd, path: path63, value });
18243
18243
  });
18244
18244
  const missing = [];
18245
18245
  for (const field of opts.setup.fields) {
@@ -23977,14 +23977,14 @@ var require_url_state_machine = __commonJS({
23977
23977
  return url2.replace(/\u0009|\u000A|\u000D/g, "");
23978
23978
  }
23979
23979
  function shortenPath(url2) {
23980
- const path61 = url2.path;
23981
- if (path61.length === 0) {
23980
+ const path63 = url2.path;
23981
+ if (path63.length === 0) {
23982
23982
  return;
23983
23983
  }
23984
- if (url2.scheme === "file" && path61.length === 1 && isNormalizedWindowsDriveLetter(path61[0])) {
23984
+ if (url2.scheme === "file" && path63.length === 1 && isNormalizedWindowsDriveLetter(path63[0])) {
23985
23985
  return;
23986
23986
  }
23987
- path61.pop();
23987
+ path63.pop();
23988
23988
  }
23989
23989
  function includesCredentials(url2) {
23990
23990
  return url2.username !== "" || url2.password !== "";
@@ -25014,7 +25014,7 @@ var require_public_api2 = __commonJS({
25014
25014
  var require_safer = __commonJS({
25015
25015
  "../../node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js"(exports, module) {
25016
25016
  var buffer = __require("buffer");
25017
- var Buffer6 = buffer.Buffer;
25017
+ var Buffer8 = buffer.Buffer;
25018
25018
  var safer = {};
25019
25019
  var key;
25020
25020
  for (key in buffer) {
@@ -25023,12 +25023,12 @@ var require_safer = __commonJS({
25023
25023
  safer[key] = buffer[key];
25024
25024
  }
25025
25025
  var Safer = safer.Buffer = {};
25026
- for (key in Buffer6) {
25027
- if (!Buffer6.hasOwnProperty(key)) continue;
25026
+ for (key in Buffer8) {
25027
+ if (!Buffer8.hasOwnProperty(key)) continue;
25028
25028
  if (key === "allocUnsafe" || key === "allocUnsafeSlow") continue;
25029
- Safer[key] = Buffer6[key];
25029
+ Safer[key] = Buffer8[key];
25030
25030
  }
25031
- safer.Buffer.prototype = Buffer6.prototype;
25031
+ safer.Buffer.prototype = Buffer8.prototype;
25032
25032
  if (!Safer.from || Safer.from === Uint8Array.from) {
25033
25033
  Safer.from = function(value, encodingOrOffset, length) {
25034
25034
  if (typeof value === "number") {
@@ -25037,7 +25037,7 @@ var require_safer = __commonJS({
25037
25037
  if (value && typeof value.length === "undefined") {
25038
25038
  throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
25039
25039
  }
25040
- return Buffer6(value, encodingOrOffset, length);
25040
+ return Buffer8(value, encodingOrOffset, length);
25041
25041
  };
25042
25042
  }
25043
25043
  if (!Safer.alloc) {
@@ -25048,7 +25048,7 @@ var require_safer = __commonJS({
25048
25048
  if (size < 0 || size >= 2 * (1 << 30)) {
25049
25049
  throw new RangeError('The value "' + size + '" is invalid for option "size"');
25050
25050
  }
25051
- var buf = Buffer6(size);
25051
+ var buf = Buffer8(size);
25052
25052
  if (!fill || fill.length === 0) {
25053
25053
  buf.fill(0);
25054
25054
  } else if (typeof encoding === "string") {
@@ -25123,7 +25123,7 @@ var require_bom_handling = __commonJS({
25123
25123
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.js
25124
25124
  var require_internal = __commonJS({
25125
25125
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/internal.js"(exports, module) {
25126
- var Buffer6 = require_safer().Buffer;
25126
+ var Buffer8 = require_safer().Buffer;
25127
25127
  module.exports = {
25128
25128
  // Encodings
25129
25129
  utf8: { type: "_internal", bomAware: true },
@@ -25145,7 +25145,7 @@ var require_internal = __commonJS({
25145
25145
  else if (this.enc === "cesu8") {
25146
25146
  this.enc = "utf8";
25147
25147
  this.encoder = InternalEncoderCesu8;
25148
- if (Buffer6.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
25148
+ if (Buffer8.from("eda0bdedb2a9", "hex").toString() !== "\u{1F4A9}") {
25149
25149
  this.decoder = InternalDecoderCesu8;
25150
25150
  this.defaultCharUnicode = iconv.defaultCharUnicode;
25151
25151
  }
@@ -25161,8 +25161,8 @@ var require_internal = __commonJS({
25161
25161
  this.decoder = new StringDecoder2(codec.enc);
25162
25162
  }
25163
25163
  InternalDecoder.prototype.write = function(buf) {
25164
- if (!Buffer6.isBuffer(buf)) {
25165
- buf = Buffer6.from(buf);
25164
+ if (!Buffer8.isBuffer(buf)) {
25165
+ buf = Buffer8.from(buf);
25166
25166
  }
25167
25167
  return this.decoder.write(buf);
25168
25168
  };
@@ -25173,7 +25173,7 @@ var require_internal = __commonJS({
25173
25173
  this.enc = codec.enc;
25174
25174
  }
25175
25175
  InternalEncoder.prototype.write = function(str2) {
25176
- return Buffer6.from(str2, this.enc);
25176
+ return Buffer8.from(str2, this.enc);
25177
25177
  };
25178
25178
  InternalEncoder.prototype.end = function() {
25179
25179
  };
@@ -25185,15 +25185,15 @@ var require_internal = __commonJS({
25185
25185
  var completeQuads = str2.length - str2.length % 4;
25186
25186
  this.prevStr = str2.slice(completeQuads);
25187
25187
  str2 = str2.slice(0, completeQuads);
25188
- return Buffer6.from(str2, "base64");
25188
+ return Buffer8.from(str2, "base64");
25189
25189
  };
25190
25190
  InternalEncoderBase64.prototype.end = function() {
25191
- return Buffer6.from(this.prevStr, "base64");
25191
+ return Buffer8.from(this.prevStr, "base64");
25192
25192
  };
25193
25193
  function InternalEncoderCesu8(options, codec) {
25194
25194
  }
25195
25195
  InternalEncoderCesu8.prototype.write = function(str2) {
25196
- var buf = Buffer6.alloc(str2.length * 3), bufIdx = 0;
25196
+ var buf = Buffer8.alloc(str2.length * 3), bufIdx = 0;
25197
25197
  for (var i2 = 0; i2 < str2.length; i2++) {
25198
25198
  var charCode = str2.charCodeAt(i2);
25199
25199
  if (charCode < 128)
@@ -25274,7 +25274,7 @@ var require_internal = __commonJS({
25274
25274
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.js
25275
25275
  var require_utf32 = __commonJS({
25276
25276
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf32.js"(exports) {
25277
- var Buffer6 = require_safer().Buffer;
25277
+ var Buffer8 = require_safer().Buffer;
25278
25278
  exports._utf32 = Utf32Codec;
25279
25279
  function Utf32Codec(codecOptions, iconv) {
25280
25280
  this.iconv = iconv;
@@ -25292,8 +25292,8 @@ var require_utf32 = __commonJS({
25292
25292
  this.highSurrogate = 0;
25293
25293
  }
25294
25294
  Utf32Encoder.prototype.write = function(str2) {
25295
- var src = Buffer6.from(str2, "ucs2");
25296
- var dst = Buffer6.alloc(src.length * 2);
25295
+ var src = Buffer8.from(str2, "ucs2");
25296
+ var dst = Buffer8.alloc(src.length * 2);
25297
25297
  var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
25298
25298
  var offset = 0;
25299
25299
  for (var i2 = 0; i2 < src.length; i2 += 2) {
@@ -25327,7 +25327,7 @@ var require_utf32 = __commonJS({
25327
25327
  Utf32Encoder.prototype.end = function() {
25328
25328
  if (!this.highSurrogate)
25329
25329
  return;
25330
- var buf = Buffer6.alloc(4);
25330
+ var buf = Buffer8.alloc(4);
25331
25331
  if (this.isLE)
25332
25332
  buf.writeUInt32LE(this.highSurrogate, 0);
25333
25333
  else
@@ -25345,7 +25345,7 @@ var require_utf32 = __commonJS({
25345
25345
  return "";
25346
25346
  var i2 = 0;
25347
25347
  var codepoint = 0;
25348
- var dst = Buffer6.alloc(src.length + 4);
25348
+ var dst = Buffer8.alloc(src.length + 4);
25349
25349
  var offset = 0;
25350
25350
  var isLE2 = this.isLE;
25351
25351
  var overflow = this.overflow;
@@ -25492,7 +25492,7 @@ var require_utf32 = __commonJS({
25492
25492
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.js
25493
25493
  var require_utf16 = __commonJS({
25494
25494
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf16.js"(exports) {
25495
- var Buffer6 = require_safer().Buffer;
25495
+ var Buffer8 = require_safer().Buffer;
25496
25496
  exports.utf16be = Utf16BECodec;
25497
25497
  function Utf16BECodec() {
25498
25498
  }
@@ -25502,7 +25502,7 @@ var require_utf16 = __commonJS({
25502
25502
  function Utf16BEEncoder() {
25503
25503
  }
25504
25504
  Utf16BEEncoder.prototype.write = function(str2) {
25505
- var buf = Buffer6.from(str2, "ucs2");
25505
+ var buf = Buffer8.from(str2, "ucs2");
25506
25506
  for (var i2 = 0; i2 < buf.length; i2 += 2) {
25507
25507
  var tmp = buf[i2];
25508
25508
  buf[i2] = buf[i2 + 1];
@@ -25518,7 +25518,7 @@ var require_utf16 = __commonJS({
25518
25518
  Utf16BEDecoder.prototype.write = function(buf) {
25519
25519
  if (buf.length == 0)
25520
25520
  return "";
25521
- var buf2 = Buffer6.alloc(buf.length + 1), i2 = 0, j3 = 0;
25521
+ var buf2 = Buffer8.alloc(buf.length + 1), i2 = 0, j3 = 0;
25522
25522
  if (this.overflowByte !== -1) {
25523
25523
  buf2[0] = buf[0];
25524
25524
  buf2[1] = this.overflowByte;
@@ -25625,7 +25625,7 @@ var require_utf16 = __commonJS({
25625
25625
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.js
25626
25626
  var require_utf7 = __commonJS({
25627
25627
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/utf7.js"(exports) {
25628
- var Buffer6 = require_safer().Buffer;
25628
+ var Buffer8 = require_safer().Buffer;
25629
25629
  exports.utf7 = Utf7Codec;
25630
25630
  exports.unicode11utf7 = "utf7";
25631
25631
  function Utf7Codec(codecOptions, iconv) {
@@ -25639,7 +25639,7 @@ var require_utf7 = __commonJS({
25639
25639
  this.iconv = codec.iconv;
25640
25640
  }
25641
25641
  Utf7Encoder.prototype.write = function(str2) {
25642
- return Buffer6.from(str2.replace(nonDirectChars, function(chunk) {
25642
+ return Buffer8.from(str2.replace(nonDirectChars, function(chunk) {
25643
25643
  return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
25644
25644
  }.bind(this)));
25645
25645
  };
@@ -25673,7 +25673,7 @@ var require_utf7 = __commonJS({
25673
25673
  res += "+";
25674
25674
  } else {
25675
25675
  var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i3), "ascii");
25676
- res += this.iconv.decode(Buffer6.from(b64str, "base64"), "utf16-be");
25676
+ res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
25677
25677
  }
25678
25678
  if (buf[i3] != minusChar)
25679
25679
  i3--;
@@ -25690,7 +25690,7 @@ var require_utf7 = __commonJS({
25690
25690
  var canBeDecoded = b64str.length - b64str.length % 8;
25691
25691
  base64Accum = b64str.slice(canBeDecoded);
25692
25692
  b64str = b64str.slice(0, canBeDecoded);
25693
- res += this.iconv.decode(Buffer6.from(b64str, "base64"), "utf16-be");
25693
+ res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
25694
25694
  }
25695
25695
  this.inBase64 = inBase64;
25696
25696
  this.base64Accum = base64Accum;
@@ -25699,7 +25699,7 @@ var require_utf7 = __commonJS({
25699
25699
  Utf7Decoder.prototype.end = function() {
25700
25700
  var res = "";
25701
25701
  if (this.inBase64 && this.base64Accum.length > 0)
25702
- res = this.iconv.decode(Buffer6.from(this.base64Accum, "base64"), "utf16-be");
25702
+ res = this.iconv.decode(Buffer8.from(this.base64Accum, "base64"), "utf16-be");
25703
25703
  this.inBase64 = false;
25704
25704
  this.base64Accum = "";
25705
25705
  return res;
@@ -25714,11 +25714,11 @@ var require_utf7 = __commonJS({
25714
25714
  function Utf7IMAPEncoder(options, codec) {
25715
25715
  this.iconv = codec.iconv;
25716
25716
  this.inBase64 = false;
25717
- this.base64Accum = Buffer6.alloc(6);
25717
+ this.base64Accum = Buffer8.alloc(6);
25718
25718
  this.base64AccumIdx = 0;
25719
25719
  }
25720
25720
  Utf7IMAPEncoder.prototype.write = function(str2) {
25721
- var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer6.alloc(str2.length * 5 + 10), bufIdx = 0;
25721
+ var inBase64 = this.inBase64, base64Accum = this.base64Accum, base64AccumIdx = this.base64AccumIdx, buf = Buffer8.alloc(str2.length * 5 + 10), bufIdx = 0;
25722
25722
  for (var i3 = 0; i3 < str2.length; i3++) {
25723
25723
  var uChar = str2.charCodeAt(i3);
25724
25724
  if (32 <= uChar && uChar <= 126) {
@@ -25755,7 +25755,7 @@ var require_utf7 = __commonJS({
25755
25755
  return buf.slice(0, bufIdx);
25756
25756
  };
25757
25757
  Utf7IMAPEncoder.prototype.end = function() {
25758
- var buf = Buffer6.alloc(10), bufIdx = 0;
25758
+ var buf = Buffer8.alloc(10), bufIdx = 0;
25759
25759
  if (this.inBase64) {
25760
25760
  if (this.base64AccumIdx > 0) {
25761
25761
  bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), bufIdx);
@@ -25788,7 +25788,7 @@ var require_utf7 = __commonJS({
25788
25788
  res += "&";
25789
25789
  } else {
25790
25790
  var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i3), "ascii").replace(/,/g, "/");
25791
- res += this.iconv.decode(Buffer6.from(b64str, "base64"), "utf16-be");
25791
+ res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
25792
25792
  }
25793
25793
  if (buf[i3] != minusChar)
25794
25794
  i3--;
@@ -25805,7 +25805,7 @@ var require_utf7 = __commonJS({
25805
25805
  var canBeDecoded = b64str.length - b64str.length % 8;
25806
25806
  base64Accum = b64str.slice(canBeDecoded);
25807
25807
  b64str = b64str.slice(0, canBeDecoded);
25808
- res += this.iconv.decode(Buffer6.from(b64str, "base64"), "utf16-be");
25808
+ res += this.iconv.decode(Buffer8.from(b64str, "base64"), "utf16-be");
25809
25809
  }
25810
25810
  this.inBase64 = inBase64;
25811
25811
  this.base64Accum = base64Accum;
@@ -25814,7 +25814,7 @@ var require_utf7 = __commonJS({
25814
25814
  Utf7IMAPDecoder.prototype.end = function() {
25815
25815
  var res = "";
25816
25816
  if (this.inBase64 && this.base64Accum.length > 0)
25817
- res = this.iconv.decode(Buffer6.from(this.base64Accum, "base64"), "utf16-be");
25817
+ res = this.iconv.decode(Buffer8.from(this.base64Accum, "base64"), "utf16-be");
25818
25818
  this.inBase64 = false;
25819
25819
  this.base64Accum = "";
25820
25820
  return res;
@@ -25825,7 +25825,7 @@ var require_utf7 = __commonJS({
25825
25825
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.js
25826
25826
  var require_sbcs_codec = __commonJS({
25827
25827
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/sbcs-codec.js"(exports) {
25828
- var Buffer6 = require_safer().Buffer;
25828
+ var Buffer8 = require_safer().Buffer;
25829
25829
  exports._sbcs = SBCSCodec;
25830
25830
  function SBCSCodec(codecOptions, iconv) {
25831
25831
  if (!codecOptions)
@@ -25838,8 +25838,8 @@ var require_sbcs_codec = __commonJS({
25838
25838
  asciiString += String.fromCharCode(i2);
25839
25839
  codecOptions.chars = asciiString + codecOptions.chars;
25840
25840
  }
25841
- this.decodeBuf = Buffer6.from(codecOptions.chars, "ucs2");
25842
- var encodeBuf = Buffer6.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
25841
+ this.decodeBuf = Buffer8.from(codecOptions.chars, "ucs2");
25842
+ var encodeBuf = Buffer8.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
25843
25843
  for (var i2 = 0; i2 < codecOptions.chars.length; i2++)
25844
25844
  encodeBuf[codecOptions.chars.charCodeAt(i2)] = i2;
25845
25845
  this.encodeBuf = encodeBuf;
@@ -25850,7 +25850,7 @@ var require_sbcs_codec = __commonJS({
25850
25850
  this.encodeBuf = codec.encodeBuf;
25851
25851
  }
25852
25852
  SBCSEncoder.prototype.write = function(str2) {
25853
- var buf = Buffer6.alloc(str2.length);
25853
+ var buf = Buffer8.alloc(str2.length);
25854
25854
  for (var i2 = 0; i2 < str2.length; i2++)
25855
25855
  buf[i2] = this.encodeBuf[str2.charCodeAt(i2)];
25856
25856
  return buf;
@@ -25862,7 +25862,7 @@ var require_sbcs_codec = __commonJS({
25862
25862
  }
25863
25863
  SBCSDecoder.prototype.write = function(buf) {
25864
25864
  var decodeBuf = this.decodeBuf;
25865
- var newBuf = Buffer6.alloc(buf.length * 2);
25865
+ var newBuf = Buffer8.alloc(buf.length * 2);
25866
25866
  var idx1 = 0, idx2 = 0;
25867
25867
  for (var i2 = 0; i2 < buf.length; i2++) {
25868
25868
  idx1 = buf[i2] * 2;
@@ -26486,7 +26486,7 @@ var require_sbcs_data_generated = __commonJS({
26486
26486
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.js
26487
26487
  var require_dbcs_codec = __commonJS({
26488
26488
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/encodings/dbcs-codec.js"(exports) {
26489
- var Buffer6 = require_safer().Buffer;
26489
+ var Buffer8 = require_safer().Buffer;
26490
26490
  exports._dbcs = DBCSCodec;
26491
26491
  var UNASSIGNED = -1;
26492
26492
  var GB18030_CODE = -2;
@@ -26698,7 +26698,7 @@ var require_dbcs_codec = __commonJS({
26698
26698
  this.gb18030 = codec.gb18030;
26699
26699
  }
26700
26700
  DBCSEncoder.prototype.write = function(str2) {
26701
- var newBuf = Buffer6.alloc(str2.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i3 = 0, j3 = 0;
26701
+ var newBuf = Buffer8.alloc(str2.length * (this.gb18030 ? 4 : 3)), leadSurrogate = this.leadSurrogate, seqObj = this.seqObj, nextChar = -1, i3 = 0, j3 = 0;
26702
26702
  while (true) {
26703
26703
  if (nextChar === -1) {
26704
26704
  if (i3 == str2.length) break;
@@ -26793,7 +26793,7 @@ var require_dbcs_codec = __commonJS({
26793
26793
  DBCSEncoder.prototype.end = function() {
26794
26794
  if (this.leadSurrogate === -1 && this.seqObj === void 0)
26795
26795
  return;
26796
- var newBuf = Buffer6.alloc(10), j3 = 0;
26796
+ var newBuf = Buffer8.alloc(10), j3 = 0;
26797
26797
  if (this.seqObj) {
26798
26798
  var dbcsCode = this.seqObj[DEF_CHAR];
26799
26799
  if (dbcsCode !== void 0) {
@@ -26822,7 +26822,7 @@ var require_dbcs_codec = __commonJS({
26822
26822
  this.gb18030 = codec.gb18030;
26823
26823
  }
26824
26824
  DBCSDecoder.prototype.write = function(buf) {
26825
- var newBuf = Buffer6.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
26825
+ var newBuf = Buffer8.alloc(buf.length * 2), nodeIdx = this.nodeIdx, prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, seqStart = -this.prevBytes.length, uCode;
26826
26826
  for (var i3 = 0, j3 = 0; i3 < buf.length; i3++) {
26827
26827
  var curByte = i3 >= 0 ? buf[i3] : prevBytes[i3 + prevOffset];
26828
26828
  var uCode = this.decodeTables[nodeIdx][curByte];
@@ -28419,7 +28419,7 @@ var require_encodings = __commonJS({
28419
28419
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.js
28420
28420
  var require_streams = __commonJS({
28421
28421
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/streams.js"(exports, module) {
28422
- var Buffer6 = require_safer().Buffer;
28422
+ var Buffer8 = require_safer().Buffer;
28423
28423
  module.exports = function(stream_module) {
28424
28424
  var Transform2 = stream_module.Transform;
28425
28425
  function IconvLiteEncoderStream(conv, options) {
@@ -28458,7 +28458,7 @@ var require_streams = __commonJS({
28458
28458
  chunks.push(chunk);
28459
28459
  });
28460
28460
  this.on("end", function() {
28461
- cb(null, Buffer6.concat(chunks));
28461
+ cb(null, Buffer8.concat(chunks));
28462
28462
  });
28463
28463
  return this;
28464
28464
  };
@@ -28472,7 +28472,7 @@ var require_streams = __commonJS({
28472
28472
  constructor: { value: IconvLiteDecoderStream }
28473
28473
  });
28474
28474
  IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
28475
- if (!Buffer6.isBuffer(chunk) && !(chunk instanceof Uint8Array))
28475
+ if (!Buffer8.isBuffer(chunk) && !(chunk instanceof Uint8Array))
28476
28476
  return done(new Error("Iconv decoding stream needs buffers as its input."));
28477
28477
  try {
28478
28478
  var res = this.conv.write(chunk);
@@ -28513,7 +28513,7 @@ var require_streams = __commonJS({
28513
28513
  // ../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js
28514
28514
  var require_lib2 = __commonJS({
28515
28515
  "../../node_modules/.pnpm/iconv-lite@0.6.3/node_modules/iconv-lite/lib/index.js"(exports, module) {
28516
- var Buffer6 = require_safer().Buffer;
28516
+ var Buffer8 = require_safer().Buffer;
28517
28517
  var bomHandling = require_bom_handling();
28518
28518
  var iconv = module.exports;
28519
28519
  iconv.encodings = null;
@@ -28524,7 +28524,7 @@ var require_lib2 = __commonJS({
28524
28524
  var encoder = iconv.getEncoder(encoding, options);
28525
28525
  var res = encoder.write(str2);
28526
28526
  var trail = encoder.end();
28527
- return trail && trail.length > 0 ? Buffer6.concat([res, trail]) : res;
28527
+ return trail && trail.length > 0 ? Buffer8.concat([res, trail]) : res;
28528
28528
  };
28529
28529
  iconv.decode = function decode2(buf, encoding, options) {
28530
28530
  if (typeof buf === "string") {
@@ -28532,7 +28532,7 @@ var require_lib2 = __commonJS({
28532
28532
  console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
28533
28533
  iconv.skipDecodeWarning = true;
28534
28534
  }
28535
- buf = Buffer6.from("" + (buf || ""), "binary");
28535
+ buf = Buffer8.from("" + (buf || ""), "binary");
28536
28536
  }
28537
28537
  var decoder2 = iconv.getDecoder(encoding, options);
28538
28538
  var res = decoder2.write(buf);
@@ -31976,14 +31976,14 @@ __export(fileFromPath_exports, {
31976
31976
  fileFromPathSync: () => fileFromPathSync,
31977
31977
  isFile: () => isFile
31978
31978
  });
31979
- function createFileFromPath(path61, { mtimeMs, size }, filenameOrOptions, options = {}) {
31979
+ function createFileFromPath(path63, { mtimeMs, size }, filenameOrOptions, options = {}) {
31980
31980
  let filename;
31981
31981
  if (isPlainObject_default2(filenameOrOptions)) {
31982
31982
  [options, filename] = [filenameOrOptions, void 0];
31983
31983
  } else {
31984
31984
  filename = filenameOrOptions;
31985
31985
  }
31986
- const file = new FileFromPath({ path: path61, size, lastModified: mtimeMs });
31986
+ const file = new FileFromPath({ path: path63, size, lastModified: mtimeMs });
31987
31987
  if (!filename) {
31988
31988
  filename = file.name;
31989
31989
  }
@@ -31992,13 +31992,13 @@ function createFileFromPath(path61, { mtimeMs, size }, filenameOrOptions, option
31992
31992
  lastModified: file.lastModified
31993
31993
  });
31994
31994
  }
31995
- function fileFromPathSync(path61, filenameOrOptions, options = {}) {
31996
- const stats = statSync(path61);
31997
- return createFileFromPath(path61, stats, filenameOrOptions, options);
31995
+ function fileFromPathSync(path63, filenameOrOptions, options = {}) {
31996
+ const stats = statSync(path63);
31997
+ return createFileFromPath(path63, stats, filenameOrOptions, options);
31998
31998
  }
31999
- async function fileFromPath2(path61, filenameOrOptions, options) {
32000
- const stats = await promises.stat(path61);
32001
- return createFileFromPath(path61, stats, filenameOrOptions, options);
31999
+ async function fileFromPath2(path63, filenameOrOptions, options) {
32000
+ const stats = await promises.stat(path63);
32001
+ return createFileFromPath(path63, stats, filenameOrOptions, options);
32002
32002
  }
32003
32003
  var import_node_domexception, __classPrivateFieldSet4, __classPrivateFieldGet5, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath;
32004
32004
  var init_fileFromPath = __esm({
@@ -33393,11 +33393,11 @@ var require_react_development = __commonJS({
33393
33393
  var dispatcher = resolveDispatcher();
33394
33394
  return dispatcher.useReducer(reducer2, initialArg, init3);
33395
33395
  }
33396
- function useRef10(initialValue) {
33396
+ function useRef11(initialValue) {
33397
33397
  var dispatcher = resolveDispatcher();
33398
33398
  return dispatcher.useRef(initialValue);
33399
33399
  }
33400
- function useEffect18(create2, deps) {
33400
+ function useEffect19(create2, deps) {
33401
33401
  var dispatcher = resolveDispatcher();
33402
33402
  return dispatcher.useEffect(create2, deps);
33403
33403
  }
@@ -34180,14 +34180,14 @@ var require_react_development = __commonJS({
34180
34180
  exports.useContext = useContext7;
34181
34181
  exports.useDebugValue = useDebugValue;
34182
34182
  exports.useDeferredValue = useDeferredValue;
34183
- exports.useEffect = useEffect18;
34183
+ exports.useEffect = useEffect19;
34184
34184
  exports.useId = useId;
34185
34185
  exports.useImperativeHandle = useImperativeHandle;
34186
34186
  exports.useInsertionEffect = useInsertionEffect;
34187
34187
  exports.useLayoutEffect = useLayoutEffect2;
34188
34188
  exports.useMemo = useMemo9;
34189
34189
  exports.useReducer = useReducer2;
34190
- exports.useRef = useRef10;
34190
+ exports.useRef = useRef11;
34191
34191
  exports.useState = useState18;
34192
34192
  exports.useSyncExternalStore = useSyncExternalStore;
34193
34193
  exports.useTransition = useTransition;
@@ -56733,10 +56733,10 @@ var require_react_reconciler_development = __commonJS({
56733
56733
  var setErrorHandler = null;
56734
56734
  var setSuspenseHandler = null;
56735
56735
  {
56736
- var copyWithDeleteImpl = function(obj, path61, index2) {
56737
- var key = path61[index2];
56736
+ var copyWithDeleteImpl = function(obj, path63, index2) {
56737
+ var key = path63[index2];
56738
56738
  var updated = isArray(obj) ? obj.slice() : assign({}, obj);
56739
- if (index2 + 1 === path61.length) {
56739
+ if (index2 + 1 === path63.length) {
56740
56740
  if (isArray(updated)) {
56741
56741
  updated.splice(key, 1);
56742
56742
  } else {
@@ -56744,11 +56744,11 @@ var require_react_reconciler_development = __commonJS({
56744
56744
  }
56745
56745
  return updated;
56746
56746
  }
56747
- updated[key] = copyWithDeleteImpl(obj[key], path61, index2 + 1);
56747
+ updated[key] = copyWithDeleteImpl(obj[key], path63, index2 + 1);
56748
56748
  return updated;
56749
56749
  };
56750
- var copyWithDelete = function(obj, path61) {
56751
- return copyWithDeleteImpl(obj, path61, 0);
56750
+ var copyWithDelete = function(obj, path63) {
56751
+ return copyWithDeleteImpl(obj, path63, 0);
56752
56752
  };
56753
56753
  var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
56754
56754
  var oldKey = oldPath[index2];
@@ -56786,17 +56786,17 @@ var require_react_reconciler_development = __commonJS({
56786
56786
  }
56787
56787
  return copyWithRenameImpl(obj, oldPath, newPath, 0);
56788
56788
  };
56789
- var copyWithSetImpl = function(obj, path61, index2, value) {
56790
- if (index2 >= path61.length) {
56789
+ var copyWithSetImpl = function(obj, path63, index2, value) {
56790
+ if (index2 >= path63.length) {
56791
56791
  return value;
56792
56792
  }
56793
- var key = path61[index2];
56793
+ var key = path63[index2];
56794
56794
  var updated = isArray(obj) ? obj.slice() : assign({}, obj);
56795
- updated[key] = copyWithSetImpl(obj[key], path61, index2 + 1, value);
56795
+ updated[key] = copyWithSetImpl(obj[key], path63, index2 + 1, value);
56796
56796
  return updated;
56797
56797
  };
56798
- var copyWithSet = function(obj, path61, value) {
56799
- return copyWithSetImpl(obj, path61, 0, value);
56798
+ var copyWithSet = function(obj, path63, value) {
56799
+ return copyWithSetImpl(obj, path63, 0, value);
56800
56800
  };
56801
56801
  var findHook = function(fiber, id) {
56802
56802
  var currentHook2 = fiber.memoizedState;
@@ -56806,10 +56806,10 @@ var require_react_reconciler_development = __commonJS({
56806
56806
  }
56807
56807
  return currentHook2;
56808
56808
  };
56809
- overrideHookState = function(fiber, id, path61, value) {
56809
+ overrideHookState = function(fiber, id, path63, value) {
56810
56810
  var hook = findHook(fiber, id);
56811
56811
  if (hook !== null) {
56812
- var newState = copyWithSet(hook.memoizedState, path61, value);
56812
+ var newState = copyWithSet(hook.memoizedState, path63, value);
56813
56813
  hook.memoizedState = newState;
56814
56814
  hook.baseState = newState;
56815
56815
  fiber.memoizedProps = assign({}, fiber.memoizedProps);
@@ -56819,10 +56819,10 @@ var require_react_reconciler_development = __commonJS({
56819
56819
  }
56820
56820
  }
56821
56821
  };
56822
- overrideHookStateDeletePath = function(fiber, id, path61) {
56822
+ overrideHookStateDeletePath = function(fiber, id, path63) {
56823
56823
  var hook = findHook(fiber, id);
56824
56824
  if (hook !== null) {
56825
- var newState = copyWithDelete(hook.memoizedState, path61);
56825
+ var newState = copyWithDelete(hook.memoizedState, path63);
56826
56826
  hook.memoizedState = newState;
56827
56827
  hook.baseState = newState;
56828
56828
  fiber.memoizedProps = assign({}, fiber.memoizedProps);
@@ -56845,8 +56845,8 @@ var require_react_reconciler_development = __commonJS({
56845
56845
  }
56846
56846
  }
56847
56847
  };
56848
- overrideProps = function(fiber, path61, value) {
56849
- fiber.pendingProps = copyWithSet(fiber.memoizedProps, path61, value);
56848
+ overrideProps = function(fiber, path63, value) {
56849
+ fiber.pendingProps = copyWithSet(fiber.memoizedProps, path63, value);
56850
56850
  if (fiber.alternate) {
56851
56851
  fiber.alternate.pendingProps = fiber.pendingProps;
56852
56852
  }
@@ -56855,8 +56855,8 @@ var require_react_reconciler_development = __commonJS({
56855
56855
  scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
56856
56856
  }
56857
56857
  };
56858
- overridePropsDeletePath = function(fiber, path61) {
56859
- fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path61);
56858
+ overridePropsDeletePath = function(fiber, path63) {
56859
+ fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path63);
56860
56860
  if (fiber.alternate) {
56861
56861
  fiber.alternate.pendingProps = fiber.pendingProps;
56862
56862
  }
@@ -60679,8 +60679,8 @@ var init_ErrorOverview = __esm({
60679
60679
  init_dist6();
60680
60680
  init_Box();
60681
60681
  init_Text();
60682
- cleanupPath = (path61) => {
60683
- return path61?.replace(`file://${cwd()}/`, "");
60682
+ cleanupPath = (path63) => {
60683
+ return path63?.replace(`file://${cwd()}/`, "");
60684
60684
  };
60685
60685
  stackUtils = new import_stack_utils.default({
60686
60686
  cwd: cwd(),
@@ -62953,6 +62953,12 @@ var init_SlashCommands = __esm({
62953
62953
  description: "Run a team of agents on a goal \u2014 architect proposes a roster (you approve), then they build in parallel",
62954
62954
  argumentHint: "<goal>"
62955
62955
  },
62956
+ {
62957
+ name: "speak",
62958
+ description: "Read replies aloud via the active TTS voice \u2014 bare speaks the last reply, on/off auto-speaks, stop halts",
62959
+ argumentHint: "[on|off|stop]",
62960
+ aliases: ["say"]
62961
+ },
62956
62962
  {
62957
62963
  name: "yolo",
62958
62964
  description: "Toggle auto-approve mode \u2014 every tool call allowed without asking",
@@ -66046,6 +66052,12 @@ function useTurnRunner(opts) {
66046
66052
  })) {
66047
66053
  void _event;
66048
66054
  }
66055
+ if (!controller.signal.aborted) {
66056
+ try {
66057
+ opts.onTurnComplete?.();
66058
+ } catch {
66059
+ }
66060
+ }
66049
66061
  } catch (err) {
66050
66062
  } finally {
66051
66063
  turnControllerRef.current = null;
@@ -66537,6 +66549,581 @@ var init_use_voice_input = __esm({
66537
66549
  }
66538
66550
  });
66539
66551
 
66552
+ // ../channel-kit/dist/frame-pump.js
66553
+ var init_frame_pump = __esm({
66554
+ "../channel-kit/dist/frame-pump.js"() {
66555
+ }
66556
+ });
66557
+
66558
+ // ../channel-kit/dist/turn.js
66559
+ var init_turn = __esm({
66560
+ "../channel-kit/dist/turn.js"() {
66561
+ }
66562
+ });
66563
+
66564
+ // ../channel-kit/dist/plain-turn-renderer.js
66565
+ var init_plain_turn_renderer = __esm({
66566
+ "../channel-kit/dist/plain-turn-renderer.js"() {
66567
+ }
66568
+ });
66569
+
66570
+ // ../channel-kit/dist/pairing/host-code.js
66571
+ var init_host_code = __esm({
66572
+ "../channel-kit/dist/pairing/host-code.js"() {
66573
+ }
66574
+ });
66575
+
66576
+ // ../channel-kit/dist/pairing/tofu.js
66577
+ var init_tofu = __esm({
66578
+ "../channel-kit/dist/pairing/tofu.js"() {
66579
+ }
66580
+ });
66581
+
66582
+ // ../channel-kit/dist/secrets.js
66583
+ var init_secrets = __esm({
66584
+ "../channel-kit/dist/secrets.js"() {
66585
+ }
66586
+ });
66587
+ var init_permission = __esm({
66588
+ "../channel-kit/dist/permission.js"() {
66589
+ }
66590
+ });
66591
+ var init_http_server = __esm({
66592
+ "../channel-kit/dist/ingest/http-server.js"() {
66593
+ }
66594
+ });
66595
+
66596
+ // ../channel-kit/dist/ingest/dedupe.js
66597
+ var init_dedupe = __esm({
66598
+ "../channel-kit/dist/ingest/dedupe.js"() {
66599
+ }
66600
+ });
66601
+ function toSpeech(markdown) {
66602
+ let t2 = markdown ?? "";
66603
+ t2 = t2.replace(/```[\s\S]*?```/g, " (code omitted) ");
66604
+ t2 = t2.replace(/```[\s\S]*$/g, " (code omitted) ");
66605
+ t2 = t2.replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1");
66606
+ t2 = t2.replace(/\[([^\]]+)\]\([^)]*\)/g, "$1");
66607
+ t2 = t2.replace(/`([^`]+)`/g, "$1");
66608
+ t2 = t2.replace(/(\*\*|__|~~|\*|_)/g, "");
66609
+ t2 = t2.replace(/^\s{0,3}#{1,6}\s*/gm, "");
66610
+ t2 = t2.replace(/^\s{0,3}>\s?/gm, "");
66611
+ t2 = t2.replace(/^\s{0,3}[-*+]\s+/gm, "");
66612
+ t2 = t2.replace(/[ \t]+/g, " ");
66613
+ t2 = t2.replace(/\n{3,}/g, "\n\n");
66614
+ return t2.trim();
66615
+ }
66616
+ function truncateForSpeech(text, max) {
66617
+ if (text.length <= max)
66618
+ return text;
66619
+ const slice = text.slice(0, max);
66620
+ const sentence = Math.max(slice.lastIndexOf(". "), slice.lastIndexOf("! "), slice.lastIndexOf("? "), slice.lastIndexOf("\n"));
66621
+ const cut = sentence > max * 0.5 ? sentence + 1 : slice.lastIndexOf(" ");
66622
+ const head = (cut > 0 ? slice.slice(0, cut) : slice).trim();
66623
+ return `${head}\u2026`;
66624
+ }
66625
+ async function synthesizeReply(session, text, opts = {}) {
66626
+ let synth;
66627
+ try {
66628
+ synth = session.synthesizers.tryGetActive();
66629
+ } catch (err) {
66630
+ return { ok: false, reason: "failed", error: err instanceof Error ? err.message : String(err) };
66631
+ }
66632
+ if (!synth)
66633
+ return { ok: false, reason: "no-synthesizer" };
66634
+ const speech = truncateForSpeech(toSpeech(text), opts.maxChars ?? DEFAULT_MAX_SPEECH_CHARS);
66635
+ if (!speech)
66636
+ return { ok: false, reason: "empty" };
66637
+ const synthOpts = {};
66638
+ if (opts.voice !== void 0)
66639
+ synthOpts.voice = opts.voice;
66640
+ if (opts.language !== void 0)
66641
+ synthOpts.language = opts.language;
66642
+ if (opts.rate !== void 0)
66643
+ synthOpts.rate = opts.rate;
66644
+ if (opts.signal !== void 0)
66645
+ synthOpts.signal = opts.signal;
66646
+ try {
66647
+ const result = await synth.synthesize(speech, synthOpts);
66648
+ if (!result?.audio || result.audio.byteLength === 0) {
66649
+ return { ok: false, reason: "failed", error: "synthesizer returned no audio" };
66650
+ }
66651
+ return { ok: true, audio: result.audio, mimeType: result.mimeType };
66652
+ } catch (err) {
66653
+ return { ok: false, reason: "failed", error: err instanceof Error ? err.message : String(err) };
66654
+ }
66655
+ }
66656
+ var DEFAULT_MAX_SPEECH_CHARS;
66657
+ var init_voice_reply = __esm({
66658
+ "../channel-kit/dist/voice-reply.js"() {
66659
+ DEFAULT_MAX_SPEECH_CHARS = 1200;
66660
+ }
66661
+ });
66662
+
66663
+ // ../channel-kit/dist/index.js
66664
+ var init_dist8 = __esm({
66665
+ "../channel-kit/dist/index.js"() {
66666
+ init_frame_pump();
66667
+ init_turn();
66668
+ init_plain_turn_renderer();
66669
+ init_host_code();
66670
+ init_tofu();
66671
+ init_secrets();
66672
+ init_permission();
66673
+ init_http_server();
66674
+ init_dedupe();
66675
+ init_voice_reply();
66676
+ }
66677
+ });
66678
+ function isWavMime(mimeType) {
66679
+ return /wav/i.test(mimeType);
66680
+ }
66681
+ function isOggOpusWebmMime(mimeType) {
66682
+ return /(opus|ogg|webm)/i.test(mimeType);
66683
+ }
66684
+ function playerCandidates(platform2) {
66685
+ switch (platform2) {
66686
+ case "darwin":
66687
+ return [AFPLAY, FFPLAY];
66688
+ case "linux":
66689
+ return [PAPLAY, APLAY, FFPLAY];
66690
+ case "win32":
66691
+ return [POWERSHELL, FFPLAY];
66692
+ default:
66693
+ return [FFPLAY];
66694
+ }
66695
+ }
66696
+ function probeArgsFor(command) {
66697
+ for (const platform2 of ["darwin", "linux", "win32"]) {
66698
+ const found = playerCandidates(platform2).find((c2) => c2.command === command);
66699
+ if (found)
66700
+ return found.probeArgs;
66701
+ }
66702
+ return ["-version"];
66703
+ }
66704
+ async function selectAudioPlayer(platform2, mimeType, isAvailable) {
66705
+ const supporting = playerCandidates(platform2).filter((c2) => c2.supports(mimeType));
66706
+ for (const candidate of supporting) {
66707
+ if (await isAvailable(candidate.command)) {
66708
+ return { ok: true, command: candidate.command, buildArgs: candidate.buildArgs };
66709
+ }
66710
+ }
66711
+ return { ok: false, reason: "no-player" };
66712
+ }
66713
+ function cachedProbe(command, spawnImpl) {
66714
+ const cached = probeCache.get(command);
66715
+ if (cached)
66716
+ return cached;
66717
+ const probe = probePlayerPresent(command, probeArgsFor(command), spawnImpl ?? spawn);
66718
+ probeCache.set(command, probe);
66719
+ return probe;
66720
+ }
66721
+ function probePlayerPresent(command, probeArgs, spawnImpl, timeoutMs2 = 1500) {
66722
+ return new Promise((resolve18) => {
66723
+ let settled = false;
66724
+ const done = (v3) => {
66725
+ if (settled)
66726
+ return;
66727
+ settled = true;
66728
+ clearTimeout(timer);
66729
+ resolve18(v3);
66730
+ };
66731
+ let child;
66732
+ try {
66733
+ child = spawnImpl(command, [...probeArgs], { stdio: ["ignore", "ignore", "ignore"] });
66734
+ } catch {
66735
+ resolve18(false);
66736
+ return;
66737
+ }
66738
+ const timer = setTimeout(() => {
66739
+ try {
66740
+ if (!child.killed)
66741
+ child.kill("SIGKILL");
66742
+ } catch {
66743
+ }
66744
+ done(false);
66745
+ }, timeoutMs2);
66746
+ timer.unref?.();
66747
+ child.once("spawn", () => {
66748
+ try {
66749
+ if (!child.killed)
66750
+ child.kill("SIGKILL");
66751
+ } catch {
66752
+ }
66753
+ done(true);
66754
+ });
66755
+ child.once("error", () => done(false));
66756
+ child.once("close", () => done(true));
66757
+ });
66758
+ }
66759
+ async function checkAudioPlaybackAvailable(opts = {}) {
66760
+ const platform2 = opts.platform ?? process.platform;
66761
+ const isAvailable = opts.isAvailable ?? ((command) => cachedProbe(command, opts.spawnImpl));
66762
+ for (const candidate of playerCandidates(platform2)) {
66763
+ if (await isAvailable(candidate.command)) {
66764
+ return { available: true, player: candidate.command, platform: platform2 };
66765
+ }
66766
+ }
66767
+ return { available: false, player: null, platform: platform2 };
66768
+ }
66769
+ async function playAudio(audio, opts) {
66770
+ const platform2 = opts.platform ?? process.platform;
66771
+ const spawnImpl = opts.spawnImpl ?? spawn;
66772
+ const isAvailable = opts.isAvailable ?? ((command) => cachedProbe(command, opts.spawnImpl));
66773
+ if (opts.signal?.aborted)
66774
+ return { ok: false, reason: "aborted" };
66775
+ const selection = await selectAudioPlayer(platform2, opts.mimeType, isAvailable);
66776
+ if (!selection.ok)
66777
+ return { ok: false, reason: selection.reason };
66778
+ let file;
66779
+ try {
66780
+ file = await writeTempAudio(audio, opts.mimeType, opts.tmpDir);
66781
+ } catch (err) {
66782
+ return { ok: false, reason: "failed", error: errMessage(err) };
66783
+ }
66784
+ try {
66785
+ return await spawnPlayer(selection.command, selection.buildArgs(file), spawnImpl, opts.signal, opts.timeoutMs ?? DEFAULT_PLAYBACK_TIMEOUT_MS);
66786
+ } finally {
66787
+ void rm(file, { force: true }).catch(() => void 0);
66788
+ }
66789
+ }
66790
+ function spawnPlayer(command, args, spawnImpl, signal, timeoutMs2) {
66791
+ return new Promise((resolve18) => {
66792
+ let child;
66793
+ try {
66794
+ child = spawnImpl(command, args, { stdio: ["ignore", "ignore", "ignore"] });
66795
+ } catch (err) {
66796
+ resolve18({ ok: false, reason: "failed", error: errMessage(err) });
66797
+ return;
66798
+ }
66799
+ let settled = false;
66800
+ let aborted = false;
66801
+ const onAbort = () => {
66802
+ aborted = true;
66803
+ try {
66804
+ if (!child.killed)
66805
+ child.kill("SIGKILL");
66806
+ } catch {
66807
+ }
66808
+ };
66809
+ const done = (result) => {
66810
+ if (settled)
66811
+ return;
66812
+ settled = true;
66813
+ clearTimeout(timer);
66814
+ signal?.removeEventListener("abort", onAbort);
66815
+ resolve18(result);
66816
+ };
66817
+ const timer = setTimeout(() => {
66818
+ try {
66819
+ if (!child.killed)
66820
+ child.kill("SIGKILL");
66821
+ } catch {
66822
+ }
66823
+ done({ ok: false, reason: "failed", error: "audio playback timed out" });
66824
+ }, timeoutMs2);
66825
+ timer.unref?.();
66826
+ if (signal) {
66827
+ if (signal.aborted)
66828
+ onAbort();
66829
+ else
66830
+ signal.addEventListener("abort", onAbort, { once: true });
66831
+ }
66832
+ child.once("error", (err) => done({ ok: false, reason: "failed", error: errMessage(err) }));
66833
+ child.once("close", (code) => {
66834
+ if (aborted)
66835
+ return done({ ok: false, reason: "aborted" });
66836
+ if (code === 0)
66837
+ return done({ ok: true, player: command });
66838
+ return done({
66839
+ ok: false,
66840
+ reason: "failed",
66841
+ error: `${command} exited with code ${code ?? "null"}`
66842
+ });
66843
+ });
66844
+ });
66845
+ }
66846
+ async function writeTempAudio(audio, mimeType, tmpDir) {
66847
+ const dir = tmpDir ?? os2__default.tmpdir();
66848
+ const suffix = Math.random().toString(36).slice(2, 10);
66849
+ const file = path3__default.join(dir, `moxxy-speak-${process.pid}-${Date.now()}-${suffix}.${extForMime(mimeType)}`);
66850
+ await writeFile(file, Buffer$1.from(audio));
66851
+ return file;
66852
+ }
66853
+ function extForMime(mimeType) {
66854
+ const m3 = (mimeType || "").toLowerCase();
66855
+ if (m3.includes("wav"))
66856
+ return "wav";
66857
+ if (m3.includes("opus") || m3.includes("ogg"))
66858
+ return "ogg";
66859
+ if (m3.includes("mpeg") || m3.includes("mp3"))
66860
+ return "mp3";
66861
+ if (m3.includes("webm"))
66862
+ return "webm";
66863
+ if (m3.includes("aac") || m3.includes("m4a") || m3.includes("mp4"))
66864
+ return "m4a";
66865
+ if (m3.includes("flac"))
66866
+ return "flac";
66867
+ if (m3.includes("aiff"))
66868
+ return "aiff";
66869
+ return "audio";
66870
+ }
66871
+ function errMessage(err) {
66872
+ return err instanceof Error ? err.message : String(err);
66873
+ }
66874
+ var AFPLAY, FFPLAY, PAPLAY, APLAY, POWERSHELL, probeCache, DEFAULT_PLAYBACK_TIMEOUT_MS;
66875
+ var init_audio_play = __esm({
66876
+ "../plugin-cli/dist/audio-play.js"() {
66877
+ AFPLAY = {
66878
+ command: "afplay",
66879
+ probeArgs: ["-h"],
66880
+ buildArgs: (file) => [file],
66881
+ // CoreAudio decodes WAV/MP3/M4A/AAC/AIFF but not OGG/Opus/WebM.
66882
+ supports: (mimeType) => !isOggOpusWebmMime(mimeType)
66883
+ };
66884
+ FFPLAY = {
66885
+ command: "ffplay",
66886
+ probeArgs: ["-version"],
66887
+ buildArgs: (file) => ["-nodisp", "-autoexit", "-loglevel", "quiet", file],
66888
+ supports: () => true
66889
+ };
66890
+ PAPLAY = {
66891
+ command: "paplay",
66892
+ probeArgs: ["--version"],
66893
+ buildArgs: (file) => [file],
66894
+ supports: () => true
66895
+ };
66896
+ APLAY = {
66897
+ command: "aplay",
66898
+ probeArgs: ["--version"],
66899
+ buildArgs: (file) => ["-q", file],
66900
+ supports: (mimeType) => isWavMime(mimeType)
66901
+ };
66902
+ POWERSHELL = {
66903
+ command: "powershell",
66904
+ probeArgs: ["-NoProfile", "-Command", "exit"],
66905
+ // Media.SoundPlayer.PlaySync blocks until the WAV finishes, then exits — so a
66906
+ // SIGKILL on abort stops playback. Temp filenames never contain a quote.
66907
+ buildArgs: (file) => [
66908
+ "-NoProfile",
66909
+ "-Command",
66910
+ `$p = New-Object Media.SoundPlayer '${file}'; $p.PlaySync();`
66911
+ ],
66912
+ supports: (mimeType) => isWavMime(mimeType)
66913
+ };
66914
+ probeCache = /* @__PURE__ */ new Map();
66915
+ DEFAULT_PLAYBACK_TIMEOUT_MS = 5 * 6e4;
66916
+ }
66917
+ });
66918
+
66919
+ // ../plugin-cli/dist/session/read-aloud.js
66920
+ function resolveSpeakCommand(input) {
66921
+ const arg = input.arg.trim().toLowerCase();
66922
+ const hint = input.hasSynthesizer ? "" : `
66923
+
66924
+ ${READ_ALOUD_NO_SYNTH_HINT}`;
66925
+ if (arg === "") {
66926
+ if (!input.hasSynthesizer)
66927
+ return { action: "notice", reply: NO_SYNTH_NOTICE };
66928
+ return { action: "speak-last" };
66929
+ }
66930
+ if (arg === "stop")
66931
+ return { action: "stop" };
66932
+ if (arg === "off")
66933
+ return { action: "auto-off", reply: "\u{1F507} read-aloud OFF." };
66934
+ if (arg === "on") {
66935
+ return {
66936
+ action: "auto-on",
66937
+ reply: `\u{1F50A} read-aloud ON \u2014 I'll speak each final reply aloud.${hint}`
66938
+ };
66939
+ }
66940
+ if (arg === "status") {
66941
+ const state = input.autoSpeak ? "ON" : "OFF";
66942
+ const note = input.autoSpeak ? hint : "";
66943
+ return { action: "notice", reply: `read-aloud auto-speak is ${state}.${note}` };
66944
+ }
66945
+ return {
66946
+ action: "notice",
66947
+ reply: `read-aloud: unknown option "${input.arg.trim()}". Usage: /speak [on|off|stop|status]`
66948
+ };
66949
+ }
66950
+ function lastAssistantReply(session) {
66951
+ const messages = session.ofType("assistant_message");
66952
+ for (let i2 = messages.length - 1; i2 >= 0; i2--) {
66953
+ const m3 = messages[i2];
66954
+ if (m3.stopReason === "end_turn" && m3.content.trim().length > 0) {
66955
+ return { content: m3.content, seq: m3.seq };
66956
+ }
66957
+ }
66958
+ return null;
66959
+ }
66960
+ function createReadAloud(deps) {
66961
+ const synthesize = deps.synthesize ?? synthesizeReply;
66962
+ const play = deps.play ?? playAudio;
66963
+ const notice = deps.setSystemNotice;
66964
+ let autoSpeak = false;
66965
+ let current = null;
66966
+ let lastSpokenSeq = null;
66967
+ const abortCurrent = () => {
66968
+ if (current) {
66969
+ current.abort();
66970
+ current = null;
66971
+ }
66972
+ };
66973
+ const start = (text) => {
66974
+ abortCurrent();
66975
+ const controller = new AbortController();
66976
+ current = controller;
66977
+ notice("\u{1F50A} speaking\u2026");
66978
+ void runSpeak(text, controller).finally(() => {
66979
+ if (current === controller)
66980
+ current = null;
66981
+ });
66982
+ };
66983
+ const runSpeak = async (text, controller) => {
66984
+ const isCurrent = () => current === controller;
66985
+ const signal = controller.signal;
66986
+ const synth = await synthesize(deps.session, text, { signal });
66987
+ if (!synth.ok) {
66988
+ if (signal.aborted)
66989
+ return;
66990
+ if (synth.reason === "no-synthesizer")
66991
+ return void notice(NO_SYNTH_NOTICE);
66992
+ if (synth.reason === "empty")
66993
+ return void notice("read-aloud: nothing to speak in that reply.");
66994
+ return void notice(`read-aloud: synthesis failed${synth.error ? ` \u2014 ${synth.error}` : ""}.`);
66995
+ }
66996
+ const result = await play(synth.audio, {
66997
+ mimeType: synth.mimeType,
66998
+ signal,
66999
+ ...deps.platform ? { platform: deps.platform } : {}
67000
+ });
67001
+ if (result.ok) {
67002
+ if (isCurrent())
67003
+ notice(null);
67004
+ return;
67005
+ }
67006
+ switch (result.reason) {
67007
+ case "aborted":
67008
+ return;
67009
+ // user stopped or a newer /speak superseded — stay quiet
67010
+ case "no-player":
67011
+ return void notice(noPlayerNotice(deps.platform ?? process.platform));
67012
+ default:
67013
+ return void notice(`read-aloud: playback failed${result.error ? ` \u2014 ${result.error}` : ""}.`);
67014
+ }
67015
+ };
67016
+ const speakLast = () => {
67017
+ const reply = lastAssistantReply(deps.session.log);
67018
+ if (!reply) {
67019
+ notice("read-aloud: no assistant reply to speak yet.");
67020
+ return;
67021
+ }
67022
+ lastSpokenSeq = reply.seq;
67023
+ start(reply.content);
67024
+ };
67025
+ return {
67026
+ get autoSpeak() {
67027
+ return autoSpeak;
67028
+ },
67029
+ handleCommand(arg) {
67030
+ const hasSynthesizer = safeHasSynthesizer(deps.session);
67031
+ const decision = resolveSpeakCommand({ arg, autoSpeak, hasSynthesizer });
67032
+ switch (decision.action) {
67033
+ case "speak-last":
67034
+ speakLast();
67035
+ return;
67036
+ case "auto-on":
67037
+ autoSpeak = true;
67038
+ notice(decision.reply);
67039
+ return;
67040
+ case "auto-off":
67041
+ autoSpeak = false;
67042
+ abortCurrent();
67043
+ notice(decision.reply);
67044
+ return;
67045
+ case "stop":
67046
+ if (current) {
67047
+ abortCurrent();
67048
+ notice("read-aloud: stopped.");
67049
+ } else {
67050
+ notice("read-aloud: nothing is playing.");
67051
+ }
67052
+ return;
67053
+ case "notice":
67054
+ notice(decision.reply);
67055
+ return;
67056
+ }
67057
+ },
67058
+ onTurnComplete() {
67059
+ if (!autoSpeak)
67060
+ return;
67061
+ const reply = lastAssistantReply(deps.session.log);
67062
+ if (!reply || reply.seq === lastSpokenSeq)
67063
+ return;
67064
+ lastSpokenSeq = reply.seq;
67065
+ start(reply.content);
67066
+ },
67067
+ stop() {
67068
+ abortCurrent();
67069
+ },
67070
+ dispose() {
67071
+ abortCurrent();
67072
+ }
67073
+ };
67074
+ }
67075
+ function safeHasSynthesizer(session) {
67076
+ try {
67077
+ return session.synthesizers.tryGetActive() != null;
67078
+ } catch {
67079
+ return false;
67080
+ }
67081
+ }
67082
+ function noPlayerNotice(platform2) {
67083
+ switch (platform2) {
67084
+ case "darwin":
67085
+ return "read-aloud: no audio player found (`afplay` ships with macOS \u2014 is it on PATH?).";
67086
+ case "linux":
67087
+ return "read-aloud: no audio player found. Install one of: paplay (pulseaudio-utils), aplay (alsa-utils), or ffplay (ffmpeg).";
67088
+ case "win32":
67089
+ return "read-aloud: no audio player available for this format on Windows (WAV plays via PowerShell; install ffmpeg for other formats).";
67090
+ default:
67091
+ return "read-aloud: no audio player found \u2014 install ffmpeg (ffplay).";
67092
+ }
67093
+ }
67094
+ var READ_ALOUD_NO_SYNTH_HINT, NO_SYNTH_NOTICE;
67095
+ var init_read_aloud = __esm({
67096
+ "../plugin-cli/dist/session/read-aloud.js"() {
67097
+ init_dist8();
67098
+ init_audio_play();
67099
+ READ_ALOUD_NO_SYNTH_HINT = "Install a text-to-speech backend:\n moxxy plugins install tts-local (offline)\n moxxy plugins install tts-openai";
67100
+ NO_SYNTH_NOTICE = `read-aloud: no active text-to-speech backend.
67101
+ ${READ_ALOUD_NO_SYNTH_HINT}`;
67102
+ }
67103
+ });
67104
+
67105
+ // ../plugin-cli/dist/session/use-read-aloud.js
67106
+ function useReadAloud(opts) {
67107
+ const { session, setSystemNotice } = opts;
67108
+ const ref = (0, import_react52.useRef)(null);
67109
+ if (ref.current === null) {
67110
+ ref.current = createReadAloud({ session, setSystemNotice });
67111
+ }
67112
+ (0, import_react52.useEffect)(() => {
67113
+ return () => {
67114
+ ref.current?.dispose();
67115
+ };
67116
+ }, []);
67117
+ return ref.current;
67118
+ }
67119
+ var import_react52;
67120
+ var init_use_read_aloud = __esm({
67121
+ "../plugin-cli/dist/session/use-read-aloud.js"() {
67122
+ import_react52 = __toESM(require_react());
67123
+ init_read_aloud();
67124
+ }
67125
+ });
67126
+
66540
67127
  // ../plugin-cli/dist/session/settings-descriptors.js
66541
67128
  function reasoningLabel(cfg) {
66542
67129
  const r2 = cfg.context?.reasoning;
@@ -72823,8 +73410,8 @@ var require_utils2 = __commonJS({
72823
73410
  }
72824
73411
  return ind;
72825
73412
  }
72826
- function removeDotSegments(path61) {
72827
- let input = path61;
73413
+ function removeDotSegments(path63) {
73414
+ let input = path63;
72828
73415
  const output = [];
72829
73416
  let nextSlash = -1;
72830
73417
  let len = 0;
@@ -73075,8 +73662,8 @@ var require_schemes = __commonJS({
73075
73662
  wsComponent.secure = void 0;
73076
73663
  }
73077
73664
  if (wsComponent.resourceName) {
73078
- const [path61, query] = wsComponent.resourceName.split("?");
73079
- wsComponent.path = path61 && path61 !== "/" ? path61 : void 0;
73665
+ const [path63, query] = wsComponent.resourceName.split("?");
73666
+ wsComponent.path = path63 && path63 !== "/" ? path63 : void 0;
73080
73667
  wsComponent.query = query;
73081
73668
  wsComponent.resourceName = void 0;
73082
73669
  }
@@ -77234,7 +77821,7 @@ var require_windows = __commonJS({
77234
77821
  module.exports = isexe;
77235
77822
  isexe.sync = sync;
77236
77823
  var fs48 = __require("fs");
77237
- function checkPathExt(path61, options) {
77824
+ function checkPathExt(path63, options) {
77238
77825
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
77239
77826
  if (!pathext) {
77240
77827
  return true;
@@ -77245,25 +77832,25 @@ var require_windows = __commonJS({
77245
77832
  }
77246
77833
  for (var i2 = 0; i2 < pathext.length; i2++) {
77247
77834
  var p3 = pathext[i2].toLowerCase();
77248
- if (p3 && path61.substr(-p3.length).toLowerCase() === p3) {
77835
+ if (p3 && path63.substr(-p3.length).toLowerCase() === p3) {
77249
77836
  return true;
77250
77837
  }
77251
77838
  }
77252
77839
  return false;
77253
77840
  }
77254
- function checkStat(stat3, path61, options) {
77841
+ function checkStat(stat3, path63, options) {
77255
77842
  if (!stat3.isSymbolicLink() && !stat3.isFile()) {
77256
77843
  return false;
77257
77844
  }
77258
- return checkPathExt(path61, options);
77845
+ return checkPathExt(path63, options);
77259
77846
  }
77260
- function isexe(path61, options, cb) {
77261
- fs48.stat(path61, function(er2, stat3) {
77262
- cb(er2, er2 ? false : checkStat(stat3, path61, options));
77847
+ function isexe(path63, options, cb) {
77848
+ fs48.stat(path63, function(er2, stat3) {
77849
+ cb(er2, er2 ? false : checkStat(stat3, path63, options));
77263
77850
  });
77264
77851
  }
77265
- function sync(path61, options) {
77266
- return checkStat(fs48.statSync(path61), path61, options);
77852
+ function sync(path63, options) {
77853
+ return checkStat(fs48.statSync(path63), path63, options);
77267
77854
  }
77268
77855
  }
77269
77856
  });
@@ -77274,13 +77861,13 @@ var require_mode = __commonJS({
77274
77861
  module.exports = isexe;
77275
77862
  isexe.sync = sync;
77276
77863
  var fs48 = __require("fs");
77277
- function isexe(path61, options, cb) {
77278
- fs48.stat(path61, function(er2, stat3) {
77864
+ function isexe(path63, options, cb) {
77865
+ fs48.stat(path63, function(er2, stat3) {
77279
77866
  cb(er2, er2 ? false : checkStat(stat3, options));
77280
77867
  });
77281
77868
  }
77282
- function sync(path61, options) {
77283
- return checkStat(fs48.statSync(path61), options);
77869
+ function sync(path63, options) {
77870
+ return checkStat(fs48.statSync(path63), options);
77284
77871
  }
77285
77872
  function checkStat(stat3, options) {
77286
77873
  return stat3.isFile() && checkMode(stat3, options);
@@ -77313,7 +77900,7 @@ var require_isexe = __commonJS({
77313
77900
  }
77314
77901
  module.exports = isexe;
77315
77902
  isexe.sync = sync;
77316
- function isexe(path61, options, cb) {
77903
+ function isexe(path63, options, cb) {
77317
77904
  if (typeof options === "function") {
77318
77905
  cb = options;
77319
77906
  options = {};
@@ -77323,7 +77910,7 @@ var require_isexe = __commonJS({
77323
77910
  throw new TypeError("callback not provided");
77324
77911
  }
77325
77912
  return new Promise(function(resolve18, reject) {
77326
- isexe(path61, options || {}, function(er2, is) {
77913
+ isexe(path63, options || {}, function(er2, is) {
77327
77914
  if (er2) {
77328
77915
  reject(er2);
77329
77916
  } else {
@@ -77332,7 +77919,7 @@ var require_isexe = __commonJS({
77332
77919
  });
77333
77920
  });
77334
77921
  }
77335
- core(path61, options || {}, function(er2, is) {
77922
+ core(path63, options || {}, function(er2, is) {
77336
77923
  if (er2) {
77337
77924
  if (er2.code === "EACCES" || options && options.ignoreErrors) {
77338
77925
  er2 = null;
@@ -77342,9 +77929,9 @@ var require_isexe = __commonJS({
77342
77929
  cb(er2, is);
77343
77930
  });
77344
77931
  }
77345
- function sync(path61, options) {
77932
+ function sync(path63, options) {
77346
77933
  try {
77347
- return core.sync(path61, options || {});
77934
+ return core.sync(path63, options || {});
77348
77935
  } catch (er2) {
77349
77936
  if (options && options.ignoreErrors || er2.code === "EACCES") {
77350
77937
  return false;
@@ -77360,7 +77947,7 @@ var require_isexe = __commonJS({
77360
77947
  var require_which = __commonJS({
77361
77948
  "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
77362
77949
  var isWindows3 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
77363
- var path61 = __require("path");
77950
+ var path63 = __require("path");
77364
77951
  var COLON = isWindows3 ? ";" : ":";
77365
77952
  var isexe = require_isexe();
77366
77953
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -77398,7 +77985,7 @@ var require_which = __commonJS({
77398
77985
  return opt.all && found.length ? resolve18(found) : reject(getNotFoundError(cmd));
77399
77986
  const ppRaw = pathEnv[i2];
77400
77987
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
77401
- const pCmd = path61.join(pathPart, cmd);
77988
+ const pCmd = path63.join(pathPart, cmd);
77402
77989
  const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
77403
77990
  resolve18(subStep(p3, i2, 0));
77404
77991
  });
@@ -77425,7 +78012,7 @@ var require_which = __commonJS({
77425
78012
  for (let i2 = 0; i2 < pathEnv.length; i2++) {
77426
78013
  const ppRaw = pathEnv[i2];
77427
78014
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
77428
- const pCmd = path61.join(pathPart, cmd);
78015
+ const pCmd = path63.join(pathPart, cmd);
77429
78016
  const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
77430
78017
  for (let j3 = 0; j3 < pathExt.length; j3++) {
77431
78018
  const cur = p3 + pathExt[j3];
@@ -77471,7 +78058,7 @@ var require_path_key = __commonJS({
77471
78058
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
77472
78059
  var require_resolveCommand = __commonJS({
77473
78060
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
77474
- var path61 = __require("path");
78061
+ var path63 = __require("path");
77475
78062
  var which = require_which();
77476
78063
  var getPathKey = require_path_key();
77477
78064
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -77489,7 +78076,7 @@ var require_resolveCommand = __commonJS({
77489
78076
  try {
77490
78077
  resolved = which.sync(parsed.command, {
77491
78078
  path: env3[getPathKey({ env: env3 })],
77492
- pathExt: withoutPathExt ? path61.delimiter : void 0
78079
+ pathExt: withoutPathExt ? path63.delimiter : void 0
77493
78080
  });
77494
78081
  } catch (e3) {
77495
78082
  } finally {
@@ -77498,7 +78085,7 @@ var require_resolveCommand = __commonJS({
77498
78085
  }
77499
78086
  }
77500
78087
  if (resolved) {
77501
- resolved = path61.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
78088
+ resolved = path63.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
77502
78089
  }
77503
78090
  return resolved;
77504
78091
  }
@@ -77549,8 +78136,8 @@ var require_shebang_command = __commonJS({
77549
78136
  if (!match) {
77550
78137
  return null;
77551
78138
  }
77552
- const [path61, argument] = match[0].replace(/#! ?/, "").split(" ");
77553
- const binary = path61.split("/").pop();
78139
+ const [path63, argument] = match[0].replace(/#! ?/, "").split(" ");
78140
+ const binary = path63.split("/").pop();
77554
78141
  if (binary === "env") {
77555
78142
  return argument;
77556
78143
  }
@@ -77583,7 +78170,7 @@ var require_readShebang = __commonJS({
77583
78170
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
77584
78171
  var require_parse = __commonJS({
77585
78172
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
77586
- var path61 = __require("path");
78173
+ var path63 = __require("path");
77587
78174
  var resolveCommand = require_resolveCommand();
77588
78175
  var escape3 = require_escape();
77589
78176
  var readShebang = require_readShebang();
@@ -77608,7 +78195,7 @@ var require_parse = __commonJS({
77608
78195
  const needsShell = !isExecutableRegExp.test(commandFile);
77609
78196
  if (parsed.options.forceShell || needsShell) {
77610
78197
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
77611
- parsed.command = path61.normalize(parsed.command);
78198
+ parsed.command = path63.normalize(parsed.command);
77612
78199
  parsed.command = escape3.command(parsed.command);
77613
78200
  parsed.args = parsed.args.map((arg) => escape3.argument(arg, needsDoubleEscapeMetaChars));
77614
78201
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -77696,7 +78283,7 @@ var require_cross_spawn = __commonJS({
77696
78283
  var cp = __require("child_process");
77697
78284
  var parse = require_parse();
77698
78285
  var enoent = require_enoent();
77699
- function spawn14(command, args, options) {
78286
+ function spawn16(command, args, options) {
77700
78287
  const parsed = parse(command, args, options);
77701
78288
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
77702
78289
  enoent.hookChildProcess(spawned, parsed);
@@ -77708,8 +78295,8 @@ var require_cross_spawn = __commonJS({
77708
78295
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
77709
78296
  return result;
77710
78297
  }
77711
- module.exports = spawn14;
77712
- module.exports.spawn = spawn14;
78298
+ module.exports = spawn16;
78299
+ module.exports.spawn = spawn16;
77713
78300
  module.exports.sync = spawnSync6;
77714
78301
  module.exports._parse = parse;
77715
78302
  module.exports._enoent = enoent;
@@ -78085,7 +78672,7 @@ function isEventPrefix(chunk, i2, firstCharCode) {
78085
78672
  return firstCharCode === 101 && chunk.charCodeAt(i2 + 1) === 118 && chunk.charCodeAt(i2 + 2) === 101 && chunk.charCodeAt(i2 + 3) === 110 && chunk.charCodeAt(i2 + 4) === 116 && chunk.charCodeAt(i2 + 5) === 58;
78086
78673
  }
78087
78674
  var ParseError, LF, CR, SPACE;
78088
- var init_dist8 = __esm({
78675
+ var init_dist9 = __esm({
78089
78676
  "../../node_modules/.pnpm/eventsource-parser@3.0.8/node_modules/eventsource-parser/dist/index.js"() {
78090
78677
  ParseError = class extends Error {
78091
78678
  constructor(message, options) {
@@ -78121,9 +78708,9 @@ function getBaseURL() {
78121
78708
  return doc && typeof doc == "object" && "baseURI" in doc && typeof doc.baseURI == "string" ? doc.baseURI : void 0;
78122
78709
  }
78123
78710
  var ErrorEvent, __typeError, __accessCheck, __privateGet, __privateAdd, __privateSet, __privateMethod, _readyState, _url, _redirectUrl, _withCredentials, _fetch, _reconnectInterval, _reconnectTimer, _lastEventId, _controller, _parser, _onError, _onMessage, _onOpen, _EventSource_instances, connect_fn, _onFetchResponse, _onFetchError, getRequestOptions_fn, _onEvent, _onRetryChange, failConnection_fn, scheduleReconnect_fn, _reconnect, EventSource;
78124
- var init_dist9 = __esm({
78711
+ var init_dist10 = __esm({
78125
78712
  "../../node_modules/.pnpm/eventsource@3.0.7/node_modules/eventsource/dist/index.js"() {
78126
- init_dist8();
78713
+ init_dist9();
78127
78714
  ErrorEvent = class extends Event {
78128
78715
  /**
78129
78716
  * Constructs a new `ErrorEvent` instance. This is typically not called directly,
@@ -79287,7 +79874,7 @@ __export(sse_exports, {
79287
79874
  var SseError, SSEClientTransport;
79288
79875
  var init_sse = __esm({
79289
79876
  "../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js"() {
79290
- init_dist9();
79877
+ init_dist10();
79291
79878
  init_transport();
79292
79879
  init_types3();
79293
79880
  init_auth2();
@@ -79487,7 +80074,7 @@ var init_sse = __esm({
79487
80074
  var EventSourceParserStream;
79488
80075
  var init_stream = __esm({
79489
80076
  "../../node_modules/.pnpm/eventsource-parser@3.0.8/node_modules/eventsource-parser/dist/stream.js"() {
79490
- init_dist8();
80077
+ init_dist9();
79491
80078
  EventSourceParserStream = class extends TransformStream {
79492
80079
  constructor({ onError: onError2, onRetry, onComment } = {}) {
79493
80080
  let parser;
@@ -80256,7 +80843,7 @@ async function resolveRecord(rec, resolver) {
80256
80843
  }
80257
80844
  return changed ? out : rec;
80258
80845
  }
80259
- var init_secrets = __esm({
80846
+ var init_secrets2 = __esm({
80260
80847
  "../plugin-mcp/dist/admin/secrets.js"() {
80261
80848
  }
80262
80849
  });
@@ -80390,7 +80977,7 @@ var init_runtime = __esm({
80390
80977
  init_timeout();
80391
80978
  init_wrap();
80392
80979
  init_config_io();
80393
- init_secrets();
80980
+ init_secrets2();
80394
80981
  }
80395
80982
  });
80396
80983
  function createMcpUsageSkillWriter(opts) {
@@ -80717,7 +81304,7 @@ var init_test = __esm({
80717
81304
  init_timeout();
80718
81305
  init_wrap();
80719
81306
  init_schema2();
80720
- init_secrets();
81307
+ init_secrets2();
80721
81308
  }
80722
81309
  });
80723
81310
  function buildMcpAdminPluginWithApi(opts = { toolRegistry: null }) {
@@ -80851,7 +81438,7 @@ var init_admin = __esm({
80851
81438
  init_remove();
80852
81439
  init_test();
80853
81440
  init_config_io();
80854
- init_secrets();
81441
+ init_secrets2();
80855
81442
  mcpAdminPlugin = (() => {
80856
81443
  let resolvedTools = null;
80857
81444
  let resolvedSkills = null;
@@ -80931,7 +81518,7 @@ async function createMcpPlugin(opts) {
80931
81518
  }
80932
81519
  });
80933
81520
  }
80934
- var init_dist10 = __esm({
81521
+ var init_dist11 = __esm({
80935
81522
  "../plugin-mcp/dist/index.js"() {
80936
81523
  init_client3();
80937
81524
  init_timeout();
@@ -81028,6 +81615,15 @@ function runSlash(cmd, deps) {
81028
81615
  deps.setSystemNotice(null);
81029
81616
  deps.setOverlay({ kind: "channels" });
81030
81617
  return;
81618
+ case "speak":
81619
+ case "say":
81620
+ if (!deps.runSpeak) {
81621
+ deps.setSystemNotice("read-aloud is not available on this session");
81622
+ return;
81623
+ }
81624
+ deps.setSystemNotice(null);
81625
+ deps.runSpeak(args);
81626
+ return;
81031
81627
  case "goal":
81032
81628
  return startGoal(deps, args);
81033
81629
  case "collab":
@@ -81197,7 +81793,7 @@ function openSettingsPicker(deps) {
81197
81793
  function openMcpPicker(deps) {
81198
81794
  void (async () => {
81199
81795
  try {
81200
- const { readMcpConfig: readMcpConfig2 } = await Promise.resolve().then(() => (init_dist10(), dist_exports3));
81796
+ const { readMcpConfig: readMcpConfig2 } = await Promise.resolve().then(() => (init_dist11(), dist_exports3));
81201
81797
  const cfg = await readMcpConfig2();
81202
81798
  if (cfg.servers.length === 0) {
81203
81799
  deps.setSystemNotice("no MCP servers registered \u2014 add one in chat via mcp_add_server");
@@ -81756,7 +82352,7 @@ function handlePluginAction(id, deps) {
81756
82352
  function handleMcpServerSelected(id, deps) {
81757
82353
  void (async () => {
81758
82354
  try {
81759
- const { readMcpConfig: readMcpConfig2 } = await Promise.resolve().then(() => (init_dist10(), dist_exports3));
82355
+ const { readMcpConfig: readMcpConfig2 } = await Promise.resolve().then(() => (init_dist11(), dist_exports3));
81760
82356
  const cfg = await readMcpConfig2();
81761
82357
  const server = cfg.servers.find((s2) => s2.name === id);
81762
82358
  const isDisabled = server?.disabled ?? false;
@@ -81787,7 +82383,7 @@ function handleMcpAction(serverName, id, deps) {
81787
82383
  }
81788
82384
  void (async () => {
81789
82385
  try {
81790
- const { readMcpConfig: readMcpConfig2, setServerDisabled: setServerDisabled2, removeServerFromConfig: removeServerFromConfig2 } = await Promise.resolve().then(() => (init_dist10(), dist_exports3));
82386
+ const { readMcpConfig: readMcpConfig2, setServerDisabled: setServerDisabled2, removeServerFromConfig: removeServerFromConfig2 } = await Promise.resolve().then(() => (init_dist11(), dist_exports3));
81791
82387
  if (id === "remove") {
81792
82388
  const ok = await removeServerFromConfig2(serverName);
81793
82389
  const api = deps.session.mcpAdmin;
@@ -81954,9 +82550,9 @@ var init_Modal = __esm({
81954
82550
 
81955
82551
  // ../plugin-cli/dist/components/useScrollableList.js
81956
82552
  function useScrollableList({ total, windowSize = 15, onClose, onSelect, isActive = true }) {
81957
- const [cursor, setCursor] = (0, import_react53.useState)(0);
81958
- const [offset, setOffset] = (0, import_react53.useState)(0);
81959
- (0, import_react53.useEffect)(() => {
82553
+ const [cursor, setCursor] = (0, import_react54.useState)(0);
82554
+ const [offset, setOffset] = (0, import_react54.useState)(0);
82555
+ (0, import_react54.useEffect)(() => {
81960
82556
  if (cursor >= total)
81961
82557
  setCursor(Math.max(0, total - 1));
81962
82558
  if (offset > Math.max(0, total - windowSize)) {
@@ -82004,10 +82600,10 @@ function useScrollableList({ total, windowSize = 15, onClose, onSelect, isActive
82004
82600
  canScrollDown: offset + windowSize < total
82005
82601
  };
82006
82602
  }
82007
- var import_react53;
82603
+ var import_react54;
82008
82604
  var init_useScrollableList = __esm({
82009
82605
  async "../plugin-cli/dist/components/useScrollableList.js"() {
82010
- import_react53 = __toESM(require_react());
82606
+ import_react54 = __toESM(require_react());
82011
82607
  await init_build2();
82012
82608
  }
82013
82609
  });
@@ -82051,11 +82647,11 @@ function orderByScope(skills) {
82051
82647
  }
82052
82648
  return out;
82053
82649
  }
82054
- var import_jsx_runtime26, import_react54, NAME_COL, SCOPE_COL, USED_COL, WINDOW, ORDER, SkillsPanel;
82650
+ var import_jsx_runtime26, import_react55, NAME_COL, SCOPE_COL, USED_COL, WINDOW, ORDER, SkillsPanel;
82055
82651
  var init_SkillsPanel = __esm({
82056
82652
  async "../plugin-cli/dist/components/SkillsPanel.js"() {
82057
82653
  import_jsx_runtime26 = __toESM(require_jsx_runtime());
82058
- import_react54 = __toESM(require_react());
82654
+ import_react55 = __toESM(require_react());
82059
82655
  await init_build2();
82060
82656
  init_dist7();
82061
82657
  await init_Modal();
@@ -82067,9 +82663,9 @@ var init_SkillsPanel = __esm({
82067
82663
  ORDER = ["user", "project", "builtin", "plugin"];
82068
82664
  SkillsPanel = ({ skills, mcpServers, usage, onClose }) => {
82069
82665
  const hasMcp = !!mcpServers && mcpServers.length > 0;
82070
- const [activeTab, setActiveTab] = import_react54.default.useState("skills");
82071
- const skillRows = import_react54.default.useMemo(() => buildSkillRows(skills, usage), [skills, usage]);
82072
- const mcpRows = import_react54.default.useMemo(() => {
82666
+ const [activeTab, setActiveTab] = import_react55.default.useState("skills");
82667
+ const skillRows = import_react55.default.useMemo(() => buildSkillRows(skills, usage), [skills, usage]);
82668
+ const mcpRows = import_react55.default.useMemo(() => {
82073
82669
  if (!hasMcp)
82074
82670
  return [];
82075
82671
  return mcpServers.map((srv) => ({
@@ -82113,11 +82709,11 @@ function matchesTab(tool, tab2) {
82113
82709
  return action === "prompt";
82114
82710
  return action === "deny";
82115
82711
  }
82116
- var import_jsx_runtime27, import_react55, NAME_COL2, BADGE_COL, WINDOW2, ToolsPanel, ToolRow, PermissionBadge;
82712
+ var import_jsx_runtime27, import_react56, NAME_COL2, BADGE_COL, WINDOW2, ToolsPanel, ToolRow, PermissionBadge;
82117
82713
  var init_ToolsPanel = __esm({
82118
82714
  async "../plugin-cli/dist/components/ToolsPanel.js"() {
82119
82715
  import_jsx_runtime27 = __toESM(require_jsx_runtime());
82120
- import_react55 = __toESM(require_react());
82716
+ import_react56 = __toESM(require_react());
82121
82717
  await init_build2();
82122
82718
  init_dist7();
82123
82719
  init_theme();
@@ -82127,8 +82723,8 @@ var init_ToolsPanel = __esm({
82127
82723
  BADGE_COL = 9;
82128
82724
  WINDOW2 = 15;
82129
82725
  ToolsPanel = ({ tools, onClose }) => {
82130
- const sorted = import_react55.default.useMemo(() => [...tools].sort((a2, b3) => a2.name.localeCompare(b3.name)), [tools]);
82131
- const counts = import_react55.default.useMemo(() => {
82726
+ const sorted = import_react56.default.useMemo(() => [...tools].sort((a2, b3) => a2.name.localeCompare(b3.name)), [tools]);
82727
+ const counts = import_react56.default.useMemo(() => {
82132
82728
  let auto3 = 0;
82133
82729
  let prompt = 0;
82134
82730
  let deny = 0;
@@ -82143,8 +82739,8 @@ var init_ToolsPanel = __esm({
82143
82739
  }
82144
82740
  return { auto: auto3, prompt, deny };
82145
82741
  }, [sorted]);
82146
- const [activeTab, setActiveTab] = import_react55.default.useState("all");
82147
- const filtered = import_react55.default.useMemo(() => sorted.filter((t2) => matchesTab(t2, activeTab)), [sorted, activeTab]);
82742
+ const [activeTab, setActiveTab] = import_react56.default.useState("all");
82743
+ const filtered = import_react56.default.useMemo(() => sorted.filter((t2) => matchesTab(t2, activeTab)), [sorted, activeTab]);
82148
82744
  const scroll = useScrollableList({
82149
82745
  total: filtered.length,
82150
82746
  windowSize: WINDOW2
@@ -82304,11 +82900,11 @@ function oneLine2(s2) {
82304
82900
  function truncate5(s2, n2) {
82305
82901
  return s2.length <= n2 ? s2 : s2.slice(0, n2 - 1) + "\u2026";
82306
82902
  }
82307
- var import_jsx_runtime28, import_react56, SUBAGENT_PLUGIN_ID3, WINDOW3, AgentsPanel, KindsList, AgentSummary;
82903
+ var import_jsx_runtime28, import_react57, SUBAGENT_PLUGIN_ID3, WINDOW3, AgentsPanel, KindsList, AgentSummary;
82308
82904
  var init_AgentsPanel = __esm({
82309
82905
  async "../plugin-cli/dist/components/AgentsPanel.js"() {
82310
82906
  import_jsx_runtime28 = __toESM(require_jsx_runtime());
82311
- import_react56 = __toESM(require_react());
82907
+ import_react57 = __toESM(require_react());
82312
82908
  await init_build2();
82313
82909
  init_dist7();
82314
82910
  init_theme();
@@ -82318,8 +82914,8 @@ var init_AgentsPanel = __esm({
82318
82914
  SUBAGENT_PLUGIN_ID3 = "@moxxy/subagents";
82319
82915
  WINDOW3 = 16;
82320
82916
  AgentsPanel = ({ events, availableKinds = [], onClose }) => {
82321
- const agents = import_react56.default.useMemo(() => collectAgents(events), [events]);
82322
- const rows = import_react56.default.useMemo(() => {
82917
+ const agents = import_react57.default.useMemo(() => collectAgents(events), [events]);
82918
+ const rows = import_react57.default.useMemo(() => {
82323
82919
  const out = [];
82324
82920
  for (const agent of agents) {
82325
82921
  for (const row of agent.activity)
@@ -82328,7 +82924,7 @@ var init_AgentsPanel = __esm({
82328
82924
  out.sort((a2, b3) => a2.row.atMs - b3.row.atMs);
82329
82925
  return out;
82330
82926
  }, [agents]);
82331
- const [activeTab, setActiveTab] = import_react56.default.useState(agents.length > 0 ? "active" : "available");
82927
+ const [activeTab, setActiveTab] = import_react57.default.useState(agents.length > 0 ? "active" : "available");
82332
82928
  const scroll = useScrollableList({
82333
82929
  total: rows.length,
82334
82930
  windowSize: WINDOW3,
@@ -82427,11 +83023,11 @@ function sparkline(series, maxCols = 48) {
82427
83023
  const max = peak(tail, 1);
82428
83024
  return tail.map((v3) => SPARKS[Math.min(SPARKS.length - 1, Math.round(v3 / max * (SPARKS.length - 1)))]).join("");
82429
83025
  }
82430
- var import_jsx_runtime29, import_react57, BAR_WIDTH, LABEL_COL, SPARKS, Bar, CompRow, MetricRow, MODEL_COL, ModelRow, UsagePanel;
83026
+ var import_jsx_runtime29, import_react58, BAR_WIDTH, LABEL_COL, SPARKS, Bar, CompRow, MetricRow, MODEL_COL, ModelRow, UsagePanel;
82431
83027
  var init_UsagePanel = __esm({
82432
83028
  async "../plugin-cli/dist/components/UsagePanel.js"() {
82433
83029
  import_jsx_runtime29 = __toESM(require_jsx_runtime());
82434
- import_react57 = __toESM(require_react());
83030
+ import_react58 = __toESM(require_react());
82435
83031
  await init_build2();
82436
83032
  init_dist();
82437
83033
  init_theme();
@@ -82451,10 +83047,10 @@ var init_UsagePanel = __esm({
82451
83047
  return (0, import_jsx_runtime29.jsxs)(Box_default, { children: [(0, import_jsx_runtime29.jsx)(Box_default, { width: MODEL_COL, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: dim, children: label3 }) }), (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: `${String(calls).padStart(4)} calls ${fmt(prompt).padStart(7)} prompt ${fmt(output).padStart(6)} out` })] });
82452
83048
  };
82453
83049
  UsagePanel = ({ events, contextWindow, contextTokens, onClose }) => {
82454
- const s2 = import_react57.default.useMemo(() => summarizeSessionTokensFromEvents(events), [events]);
82455
- const series = import_react57.default.useMemo(() => perCallPrompt(events), [events]);
82456
- const [lifetime, setLifetime] = import_react57.default.useState(null);
82457
- import_react57.default.useEffect(() => {
83050
+ const s2 = import_react58.default.useMemo(() => summarizeSessionTokensFromEvents(events), [events]);
83051
+ const series = import_react58.default.useMemo(() => perCallPrompt(events), [events]);
83052
+ const [lifetime, setLifetime] = import_react58.default.useState(null);
83053
+ import_react58.default.useEffect(() => {
82458
83054
  let alive = true;
82459
83055
  void loadUsageStats().then((f3) => {
82460
83056
  if (alive)
@@ -82464,16 +83060,16 @@ var init_UsagePanel = __esm({
82464
83060
  alive = false;
82465
83061
  };
82466
83062
  }, []);
82467
- const liveByModel = import_react57.default.useMemo(() => summarizeTokensByModel(events), [events]);
82468
- const lifeRows = import_react57.default.useMemo(() => modelBreakdownRows(lifetime, liveByModel), [lifetime, liveByModel]);
83063
+ const liveByModel = import_react58.default.useMemo(() => summarizeTokensByModel(events), [events]);
83064
+ const lifeRows = import_react58.default.useMemo(() => modelBreakdownRows(lifetime, liveByModel), [lifetime, liveByModel]);
82469
83065
  const hasModels = lifeRows.length > 0;
82470
- const lifeTotal = import_react57.default.useMemo(() => lifeRows.reduce((acc, r2) => ({
83066
+ const lifeTotal = import_react58.default.useMemo(() => lifeRows.reduce((acc, r2) => ({
82471
83067
  calls: acc.calls + r2.calls,
82472
83068
  prompt: acc.prompt + r2.prompt,
82473
83069
  output: acc.output + r2.output
82474
83070
  }), { calls: 0, prompt: 0, output: 0 }), [lifeRows]);
82475
83071
  const hasSession = s2.calls > 0;
82476
- const [activeTab, setActiveTab] = import_react57.default.useState(hasSession ? "session" : "lifetime");
83072
+ const [activeTab, setActiveTab] = import_react58.default.useState(hasSession ? "session" : "lifetime");
82477
83073
  if (!hasSession && !hasModels) {
82478
83074
  const loading = lifetime === null;
82479
83075
  return (0, import_jsx_runtime29.jsx)(Modal, { title: "Usage", subtitle: loading ? "loading\u2026" : "no usage recorded yet", ...onClose ? { onClose } : {}, children: (0, import_jsx_runtime29.jsx)(Text, { dimColor: true, children: loading ? "(reading saved usage\u2026)" : "(no token usage yet \u2014 run a turn, then reopen /usage)" }) });
@@ -82501,11 +83097,11 @@ var init_UsagePanel = __esm({
82501
83097
  function stepMark(status) {
82502
83098
  return status === "completed" ? "\u2713" : status === "skipped" ? "\u2013" : status === "failed" ? "\u2717" : "\xB7";
82503
83099
  }
82504
- var import_jsx_runtime30, import_react58, NAME_COL3, SCOPE_COL2, TRIG_COL, WINDOW4, WorkflowsPanel;
83100
+ var import_jsx_runtime30, import_react59, NAME_COL3, SCOPE_COL2, TRIG_COL, WINDOW4, WorkflowsPanel;
82505
83101
  var init_WorkflowsPanel = __esm({
82506
83102
  async "../plugin-cli/dist/components/WorkflowsPanel.js"() {
82507
83103
  import_jsx_runtime30 = __toESM(require_jsx_runtime());
82508
- import_react58 = __toESM(require_react());
83104
+ import_react59 = __toESM(require_react());
82509
83105
  await init_build2();
82510
83106
  init_dist7();
82511
83107
  init_theme();
@@ -82516,13 +83112,13 @@ var init_WorkflowsPanel = __esm({
82516
83112
  TRIG_COL = 20;
82517
83113
  WINDOW4 = 12;
82518
83114
  WorkflowsPanel = ({ view, onClose }) => {
82519
- const [rows, setRows] = import_react58.default.useState([]);
82520
- const [loading, setLoading] = import_react58.default.useState(true);
82521
- const [busy2, setBusy] = import_react58.default.useState(false);
82522
- const [status, setStatus] = import_react58.default.useState(null);
82523
- const [pending, setPending] = import_react58.default.useState(null);
82524
- const [reply, setReply] = import_react58.default.useState("");
82525
- const reload = import_react58.default.useCallback(async () => {
83115
+ const [rows, setRows] = import_react59.default.useState([]);
83116
+ const [loading, setLoading] = import_react59.default.useState(true);
83117
+ const [busy2, setBusy] = import_react59.default.useState(false);
83118
+ const [status, setStatus] = import_react59.default.useState(null);
83119
+ const [pending, setPending] = import_react59.default.useState(null);
83120
+ const [reply, setReply] = import_react59.default.useState("");
83121
+ const reload = import_react59.default.useCallback(async () => {
82526
83122
  if (!view) {
82527
83123
  setLoading(false);
82528
83124
  return;
@@ -82536,11 +83132,11 @@ var init_WorkflowsPanel = __esm({
82536
83132
  setLoading(false);
82537
83133
  }
82538
83134
  }, [view]);
82539
- import_react58.default.useEffect(() => {
83135
+ import_react59.default.useEffect(() => {
82540
83136
  void reload();
82541
83137
  }, [reload]);
82542
83138
  const active2 = !busy2 && !pending && !!view && rows.length > 0;
82543
- const run2 = import_react58.default.useCallback(async (wf) => {
83139
+ const run2 = import_react59.default.useCallback(async (wf) => {
82544
83140
  if (!view || busy2)
82545
83141
  return;
82546
83142
  if (!wf.enabled) {
@@ -82571,7 +83167,7 @@ var init_WorkflowsPanel = __esm({
82571
83167
  void reload();
82572
83168
  }
82573
83169
  }, [view, busy2, reload]);
82574
- const submitReply = import_react58.default.useCallback(async (pendingRun, text) => {
83170
+ const submitReply = import_react59.default.useCallback(async (pendingRun, text) => {
82575
83171
  if (!view?.resume) {
82576
83172
  setStatus("resume not supported by this session");
82577
83173
  return;
@@ -82690,11 +83286,11 @@ function formatUptime(startedAt) {
82690
83286
  function errMsg(err) {
82691
83287
  return err instanceof Error ? err.message : String(err);
82692
83288
  }
82693
- var import_jsx_runtime31, import_react59, WINDOW5, STATUS_POLL_MS, START_TIMEOUT_MS, STOP_GRACE_MS, ACTION_POLL_MS, ChannelsPanel, ConfigForm;
83289
+ var import_jsx_runtime31, import_react60, WINDOW5, STATUS_POLL_MS, START_TIMEOUT_MS, STOP_GRACE_MS, ACTION_POLL_MS, ChannelsPanel, ConfigForm;
82694
83290
  var init_ChannelsPanel = __esm({
82695
83291
  async "../plugin-cli/dist/components/ChannelsPanel.js"() {
82696
83292
  import_jsx_runtime31 = __toESM(require_jsx_runtime());
82697
- import_react59 = __toESM(require_react());
83293
+ import_react60 = __toESM(require_react());
82698
83294
  await init_build2();
82699
83295
  init_theme();
82700
83296
  await init_Modal();
@@ -82705,29 +83301,29 @@ var init_ChannelsPanel = __esm({
82705
83301
  STOP_GRACE_MS = 4e3;
82706
83302
  ACTION_POLL_MS = 350;
82707
83303
  ChannelsPanel = ({ channels, vault, onClose }) => {
82708
- const rows = import_react59.default.useMemo(() => channels.filter((c2) => c2.config).sort((a2, b3) => a2.name.localeCompare(b3.name)), [channels]);
82709
- const [statuses, setStatuses] = import_react59.default.useState({});
82710
- const [configured, setConfigured] = import_react59.default.useState({});
82711
- const [status, setStatus] = import_react59.default.useState(null);
82712
- const [busy2, setBusy] = import_react59.default.useState(false);
82713
- const [editing, setEditing] = import_react59.default.useState(null);
82714
- const [fieldIdx, setFieldIdx] = import_react59.default.useState(0);
82715
- const [buffer, setBuffer] = import_react59.default.useState("");
82716
- const [savedKeys, setSavedKeys] = import_react59.default.useState({});
82717
- const pollRef = import_react59.default.useRef(null);
83304
+ const rows = import_react60.default.useMemo(() => channels.filter((c2) => c2.config).sort((a2, b3) => a2.name.localeCompare(b3.name)), [channels]);
83305
+ const [statuses, setStatuses] = import_react60.default.useState({});
83306
+ const [configured, setConfigured] = import_react60.default.useState({});
83307
+ const [status, setStatus] = import_react60.default.useState(null);
83308
+ const [busy2, setBusy] = import_react60.default.useState(false);
83309
+ const [editing, setEditing] = import_react60.default.useState(null);
83310
+ const [fieldIdx, setFieldIdx] = import_react60.default.useState(0);
83311
+ const [buffer, setBuffer] = import_react60.default.useState("");
83312
+ const [savedKeys, setSavedKeys] = import_react60.default.useState({});
83313
+ const pollRef = import_react60.default.useRef(null);
82718
83314
  const clearPoll = () => {
82719
83315
  if (pollRef.current) {
82720
83316
  clearInterval(pollRef.current);
82721
83317
  pollRef.current = null;
82722
83318
  }
82723
83319
  };
82724
- const refreshStatuses = import_react59.default.useCallback(() => {
83320
+ const refreshStatuses = import_react60.default.useCallback(() => {
82725
83321
  const next = {};
82726
83322
  for (const c2 of rows)
82727
83323
  next[c2.name] = liveChannelStatus(c2.name);
82728
83324
  setStatuses(next);
82729
83325
  }, [rows]);
82730
- const refreshConfigured = import_react59.default.useCallback(async () => {
83326
+ const refreshConfigured = import_react60.default.useCallback(async () => {
82731
83327
  if (!vault) {
82732
83328
  setConfigured({});
82733
83329
  return;
@@ -82746,7 +83342,7 @@ var init_ChannelsPanel = __esm({
82746
83342
  }
82747
83343
  setConfigured(next);
82748
83344
  }, [rows, vault]);
82749
- import_react59.default.useEffect(() => {
83345
+ import_react60.default.useEffect(() => {
82750
83346
  refreshStatuses();
82751
83347
  void refreshConfigured();
82752
83348
  const t2 = setInterval(refreshStatuses, STATUS_POLL_MS);
@@ -82755,7 +83351,7 @@ var init_ChannelsPanel = __esm({
82755
83351
  clearPoll();
82756
83352
  };
82757
83353
  }, [refreshStatuses, refreshConfigured]);
82758
- const startChannel2 = import_react59.default.useCallback((c2) => {
83354
+ const startChannel2 = import_react60.default.useCallback((c2) => {
82759
83355
  if (busy2)
82760
83356
  return;
82761
83357
  if (statuses[c2.name]) {
@@ -82792,7 +83388,7 @@ var init_ChannelsPanel = __esm({
82792
83388
  }
82793
83389
  }, ACTION_POLL_MS);
82794
83390
  }, [busy2, statuses, configured, vault, refreshStatuses]);
82795
- const stopChannel = import_react59.default.useCallback((c2) => {
83391
+ const stopChannel = import_react60.default.useCallback((c2) => {
82796
83392
  if (busy2)
82797
83393
  return;
82798
83394
  const before = statuses[c2.name];
@@ -82826,7 +83422,7 @@ var init_ChannelsPanel = __esm({
82826
83422
  }
82827
83423
  }, ACTION_POLL_MS);
82828
83424
  }, [busy2, statuses, refreshStatuses]);
82829
- const openConfig = import_react59.default.useCallback((c2) => {
83425
+ const openConfig = import_react60.default.useCallback((c2) => {
82830
83426
  if (!vault) {
82831
83427
  setStatus(`configuring needs a local vault \u2014 set secrets via the desktop panel or \`moxxy ${c2.name} setup\`.`);
82832
83428
  return;
@@ -82842,7 +83438,7 @@ var init_ChannelsPanel = __esm({
82842
83438
  setStatus(null);
82843
83439
  })();
82844
83440
  }, [vault]);
82845
- const saveField = import_react59.default.useCallback((c2, field, value) => {
83441
+ const saveField = import_react60.default.useCallback((c2, field, value) => {
82846
83442
  if (!vault)
82847
83443
  return;
82848
83444
  const v3 = value.trim();
@@ -82969,11 +83565,11 @@ function classifyVoiceNotice(notice) {
82969
83565
  }
82970
83566
  return { label: " \u2717 VOICE ", accent: Colors.danger, textColor: "black", body };
82971
83567
  }
82972
- var import_jsx_runtime32, import_react60, OverlayOrNotice, SystemNotice;
83568
+ var import_jsx_runtime32, import_react61, OverlayOrNotice, SystemNotice;
82973
83569
  var init_OverlayOrNotice = __esm({
82974
83570
  async "../plugin-cli/dist/session/OverlayOrNotice.js"() {
82975
83571
  import_jsx_runtime32 = __toESM(require_jsx_runtime());
82976
- import_react60 = __toESM(require_react());
83572
+ import_react61 = __toESM(require_react());
82977
83573
  await init_build2();
82978
83574
  init_dist();
82979
83575
  await init_SkillsPanel();
@@ -82985,8 +83581,8 @@ var init_OverlayOrNotice = __esm({
82985
83581
  init_theme();
82986
83582
  await init_helpers();
82987
83583
  OverlayOrNotice = ({ overlay, systemNotice, session, events, contextWindow, contextTokens, getVault, getChannels, onClose }) => {
82988
- const [skillUsage, setSkillUsage] = import_react60.default.useState({});
82989
- import_react60.default.useEffect(() => {
83584
+ const [skillUsage, setSkillUsage] = import_react61.default.useState({});
83585
+ import_react61.default.useEffect(() => {
82990
83586
  if (overlay?.kind !== "skills")
82991
83587
  return;
82992
83588
  let cancelled = false;
@@ -83118,11 +83714,11 @@ function renderDiffLines(bodyLines) {
83118
83714
  }
83119
83715
  return out;
83120
83716
  }
83121
- var import_jsx_runtime34, import_react62, MAX_BODY_LINES, ApprovalDialog;
83717
+ var import_jsx_runtime34, import_react63, MAX_BODY_LINES, ApprovalDialog;
83122
83718
  var init_ApprovalDialog = __esm({
83123
83719
  async "../plugin-cli/dist/components/ApprovalDialog.js"() {
83124
83720
  import_jsx_runtime34 = __toESM(require_jsx_runtime());
83125
- import_react62 = __toESM(require_react());
83721
+ import_react63 = __toESM(require_react());
83126
83722
  await init_build2();
83127
83723
  init_theme();
83128
83724
  await init_Modal();
@@ -83136,9 +83732,9 @@ var init_ApprovalDialog = __esm({
83136
83732
  }
83137
83733
  return 0;
83138
83734
  })();
83139
- const [cursor, setCursor] = (0, import_react62.useState)(initialCursor);
83140
- const [textEntry, setTextEntry] = (0, import_react62.useState)(null);
83141
- const [scrollOffset, setScrollOffset] = (0, import_react62.useState)(0);
83735
+ const [cursor, setCursor] = (0, import_react63.useState)(initialCursor);
83736
+ const [textEntry, setTextEntry] = (0, import_react63.useState)(null);
83737
+ const [scrollOffset, setScrollOffset] = (0, import_react63.useState)(0);
83142
83738
  const rawLines = request.body.split("\n");
83143
83739
  const diffMode = isDiffBody(request.body);
83144
83740
  const rendered = diffMode ? renderDiffLines(rawLines) : rawLines.map((text) => ({ text }));
@@ -83373,20 +83969,20 @@ var init_provider_connect_flow = __esm({
83373
83969
  });
83374
83970
 
83375
83971
  // ../plugin-cli/dist/components/ProviderConnectDialog.js
83376
- var import_jsx_runtime35, import_react63, ProviderConnectDialog;
83972
+ var import_jsx_runtime35, import_react64, ProviderConnectDialog;
83377
83973
  var init_ProviderConnectDialog = __esm({
83378
83974
  async "../plugin-cli/dist/components/ProviderConnectDialog.js"() {
83379
83975
  import_jsx_runtime35 = __toESM(require_jsx_runtime());
83380
- import_react63 = __toESM(require_react());
83976
+ import_react64 = __toESM(require_react());
83381
83977
  await init_build2();
83382
83978
  init_theme();
83383
83979
  await init_Modal();
83384
83980
  init_provider_connect_flow();
83385
83981
  ProviderConnectDialog = ({ providerId, setup, onSuccess, onCancel }) => {
83386
- const [phase, setPhase] = import_react63.default.useState({ kind: "installing" });
83387
- const [buffer, setBuffer] = import_react63.default.useState("");
83388
- const flowRef = import_react63.default.useRef(null);
83389
- import_react63.default.useEffect(() => {
83982
+ const [phase, setPhase] = import_react64.default.useState({ kind: "installing" });
83983
+ const [buffer, setBuffer] = import_react64.default.useState("");
83984
+ const flowRef = import_react64.default.useRef(null);
83985
+ import_react64.default.useEffect(() => {
83390
83986
  const flow = createConnectFlow({
83391
83987
  setup,
83392
83988
  providerId,
@@ -83501,24 +84097,24 @@ var init_plugin_setup_flow = __esm({
83501
84097
  });
83502
84098
 
83503
84099
  // ../plugin-cli/dist/components/PluginSetupDialog.js
83504
- var import_jsx_runtime36, import_react64, PluginSetupDialog;
84100
+ var import_jsx_runtime36, import_react65, PluginSetupDialog;
83505
84101
  var init_PluginSetupDialog = __esm({
83506
84102
  async "../plugin-cli/dist/components/PluginSetupDialog.js"() {
83507
84103
  import_jsx_runtime36 = __toESM(require_jsx_runtime());
83508
- import_react64 = __toESM(require_react());
84104
+ import_react65 = __toESM(require_react());
83509
84105
  await init_build2();
83510
84106
  init_theme();
83511
84107
  await init_Modal();
83512
84108
  init_plugin_setup_flow();
83513
84109
  PluginSetupDialog = ({ packageName, spec, onFinish }) => {
83514
- const flowRef = import_react64.default.useRef(null);
84110
+ const flowRef = import_react65.default.useRef(null);
83515
84111
  if (flowRef.current === null) {
83516
84112
  flowRef.current = createPluginSetupFlow(spec, onFinish);
83517
84113
  }
83518
84114
  const flow = flowRef.current;
83519
- const [, bump] = import_react64.default.useReducer((n2) => n2 + 1, 0);
83520
- const [buffer, setBuffer] = import_react64.default.useState("");
83521
- const [selectIndex, setSelectIndex] = import_react64.default.useState(0);
84115
+ const [, bump] = import_react65.default.useReducer((n2) => n2 + 1, 0);
84116
+ const [buffer, setBuffer] = import_react65.default.useState("");
84117
+ const [selectIndex, setSelectIndex] = import_react65.default.useState(0);
83522
84118
  const field = flow.current();
83523
84119
  const state = flow.state();
83524
84120
  use_input_default((input, key) => {
@@ -83591,17 +84187,17 @@ function buildHints(searchable, hasTabs) {
83591
84187
  parts.push("Esc close");
83592
84188
  return parts.join(" \xB7 ");
83593
84189
  }
83594
- var import_jsx_runtime37, import_react65, ListPicker, SearchBar;
84190
+ var import_jsx_runtime37, import_react66, ListPicker, SearchBar;
83595
84191
  var init_ListPicker = __esm({
83596
84192
  async "../plugin-cli/dist/components/ListPicker.js"() {
83597
84193
  import_jsx_runtime37 = __toESM(require_jsx_runtime());
83598
- import_react65 = __toESM(require_react());
84194
+ import_react66 = __toESM(require_react());
83599
84195
  await init_build2();
83600
84196
  init_theme();
83601
84197
  await init_Modal();
83602
84198
  ListPicker = ({ title, options, tabs, initialTabId, searchable, searchPlaceholder, onSelect, onCancel }) => {
83603
84199
  const hasTabs = !!(tabs && tabs.length > 0);
83604
- const defaultTabId = (0, import_react65.useMemo)(() => {
84200
+ const defaultTabId = (0, import_react66.useMemo)(() => {
83605
84201
  if (!hasTabs)
83606
84202
  return void 0;
83607
84203
  if (initialTabId && tabs.some((t2) => t2.id === initialTabId))
@@ -83609,13 +84205,13 @@ var init_ListPicker = __esm({
83609
84205
  const tabWithCurrent = tabs.find((t2) => t2.options.some((o2) => o2.current));
83610
84206
  return (tabWithCurrent ?? tabs[0]).id;
83611
84207
  }, [hasTabs, initialTabId, tabs]);
83612
- const [activeTabId, setActiveTabId] = (0, import_react65.useState)(defaultTabId);
83613
- const [query, setQuery] = (0, import_react65.useState)("");
83614
- const [cursor, setCursor] = (0, import_react65.useState)(0);
83615
- const [noSelectNotice, setNoSelectNotice] = (0, import_react65.useState)(false);
83616
- const activeTab = (0, import_react65.useMemo)(() => hasTabs ? tabs.find((t2) => t2.id === activeTabId) ?? tabs[0] : null, [hasTabs, tabs, activeTabId]);
84208
+ const [activeTabId, setActiveTabId] = (0, import_react66.useState)(defaultTabId);
84209
+ const [query, setQuery] = (0, import_react66.useState)("");
84210
+ const [cursor, setCursor] = (0, import_react66.useState)(0);
84211
+ const [noSelectNotice, setNoSelectNotice] = (0, import_react66.useState)(false);
84212
+ const activeTab = (0, import_react66.useMemo)(() => hasTabs ? tabs.find((t2) => t2.id === activeTabId) ?? tabs[0] : null, [hasTabs, tabs, activeTabId]);
83617
84213
  const sourceOptions = activeTab ? activeTab.options : options ?? [];
83618
- const filtered = (0, import_react65.useMemo)(() => {
84214
+ const filtered = (0, import_react66.useMemo)(() => {
83619
84215
  if (!searchable || !query.trim())
83620
84216
  return sourceOptions;
83621
84217
  const q4 = query.trim().toLowerCase();
@@ -83629,19 +84225,19 @@ var init_ListPicker = __esm({
83629
84225
  return false;
83630
84226
  });
83631
84227
  }, [searchable, query, sourceOptions]);
83632
- (0, import_react65.useEffect)(() => {
84228
+ (0, import_react66.useEffect)(() => {
83633
84229
  setQuery("");
83634
84230
  setCursor(0);
83635
84231
  }, [activeTabId]);
83636
- (0, import_react65.useEffect)(() => {
84232
+ (0, import_react66.useEffect)(() => {
83637
84233
  if (cursor >= filtered.length)
83638
84234
  setCursor(Math.max(0, filtered.length - 1));
83639
84235
  }, [filtered.length, cursor]);
83640
- (0, import_react65.useEffect)(() => {
84236
+ (0, import_react66.useEffect)(() => {
83641
84237
  if (noSelectNotice)
83642
84238
  setNoSelectNotice(false);
83643
84239
  }, [query, filtered.length]);
83644
- (0, import_react65.useEffect)(() => {
84240
+ (0, import_react66.useEffect)(() => {
83645
84241
  if (query)
83646
84242
  return;
83647
84243
  const idx = filtered.findIndex((o2) => o2.current);
@@ -83708,7 +84304,7 @@ var init_ListPicker = __esm({
83708
84304
  const prevGroup = i2 > 0 ? filtered[i2 - 1].group : void 0;
83709
84305
  const showHeader = !hasTabs && opt.group != null && opt.group !== prevGroup;
83710
84306
  const focused = i2 === cursor;
83711
- return (0, import_jsx_runtime37.jsxs)(import_react65.default.Fragment, { children: [showHeader ? (0, import_jsx_runtime37.jsx)(Box_default, { marginTop: idx === 0 ? 0 : 1, children: (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: opt.group }) }) : null, (0, import_jsx_runtime37.jsxs)(Box_default, { children: [(0, import_jsx_runtime37.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime37.jsx)(Text, { ...focused ? { bold: true } : {}, children: opt.label }), opt.current ? (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: " (current)" }) : null, opt.badge ? (0, import_jsx_runtime37.jsx)(Text, { color: opt.badgeColor === "red" ? Colors.danger : opt.badgeColor ?? Colors.danger, children: ` [${opt.badge}]` }) : null, opt.description ? (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: ` \u2014 ${opt.description}` }) : null] })] }, opt.id);
84307
+ return (0, import_jsx_runtime37.jsxs)(import_react66.default.Fragment, { children: [showHeader ? (0, import_jsx_runtime37.jsx)(Box_default, { marginTop: idx === 0 ? 0 : 1, children: (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: opt.group }) }) : null, (0, import_jsx_runtime37.jsxs)(Box_default, { children: [(0, import_jsx_runtime37.jsx)(Text, { ...focused ? {} : { dimColor: true }, children: focused ? "\u203A " : " " }), (0, import_jsx_runtime37.jsx)(Text, { ...focused ? { bold: true } : {}, children: opt.label }), opt.current ? (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: " (current)" }) : null, opt.badge ? (0, import_jsx_runtime37.jsx)(Text, { color: opt.badgeColor === "red" ? Colors.danger : opt.badgeColor ?? Colors.danger, children: ` [${opt.badge}]` }) : null, opt.description ? (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: ` \u2014 ${opt.description}` }) : null] })] }, opt.id);
83712
84308
  }), moreBelow > 0 ? (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: ` \u2193 ${moreBelow} more` }) : null] })] });
83713
84309
  };
83714
84310
  SearchBar = ({ query, placeholder }) => (0, import_jsx_runtime37.jsxs)(Box_default, { marginBottom: 1, children: [(0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: "/ " }), query ? (0, import_jsx_runtime37.jsx)(Text, { children: query }) : (0, import_jsx_runtime37.jsx)(Text, { dimColor: true, children: placeholder }), (0, import_jsx_runtime37.jsx)(Text, { children: "\u258C" })] });
@@ -83788,11 +84384,11 @@ var init_InteractiveZone = __esm({
83788
84384
  };
83789
84385
  }
83790
84386
  });
83791
- var import_jsx_runtime40, import_react68, SessionView;
84387
+ var import_jsx_runtime40, import_react69, SessionView;
83792
84388
  var init_SessionView = __esm({
83793
84389
  async "../plugin-cli/dist/session/SessionView.js"() {
83794
84390
  import_jsx_runtime40 = __toESM(require_jsx_runtime());
83795
- import_react68 = __toESM(require_react());
84391
+ import_react69 = __toESM(require_react());
83796
84392
  await init_build2();
83797
84393
  await init_build2();
83798
84394
  init_dist2();
@@ -83807,6 +84403,7 @@ var init_SessionView = __esm({
83807
84403
  init_use_permission_queue();
83808
84404
  await init_use_global_hotkeys();
83809
84405
  init_use_voice_input();
84406
+ init_use_read_aloud();
83810
84407
  await init_picker_handlers();
83811
84408
  await init_run_slash();
83812
84409
  await init_OverlayOrNotice();
@@ -83814,23 +84411,27 @@ var init_SessionView = __esm({
83814
84411
  SessionView = ({ session, registerInteractiveResolver, getVault, getChannels, model, version, updateAvailable, initialPrompt, initialNotice, canSwitchSession, onSwitchSession }) => {
83815
84412
  const { exit } = use_app_default();
83816
84413
  const stream = useEventStream(session);
83817
- const [systemNotice, setSystemNotice] = (0, import_react68.useState)(initialNotice ?? null);
83818
- const [overlay, setOverlay] = (0, import_react68.useState)(null);
83819
- const [expandToolOutputs, setExpandToolOutputs] = (0, import_react68.useState)(false);
83820
- const [yolo, setYolo] = (0, import_react68.useState)(false);
84414
+ const [systemNotice, setSystemNotice] = (0, import_react69.useState)(initialNotice ?? null);
84415
+ const [overlay, setOverlay] = (0, import_react69.useState)(null);
84416
+ const [expandToolOutputs, setExpandToolOutputs] = (0, import_react69.useState)(false);
84417
+ const [yolo, setYolo] = (0, import_react69.useState)(false);
83821
84418
  const { mcpStatus, refreshMcpStatus } = useMcpStatus(session);
83822
- const [activeModelOverride, setActiveModelOverride] = (0, import_react68.useState)(null);
83823
- const [picker, setPicker] = (0, import_react68.useState)(null);
84419
+ const [activeModelOverride, setActiveModelOverride] = (0, import_react69.useState)(null);
84420
+ const [picker, setPicker] = (0, import_react69.useState)(null);
83824
84421
  const permissions = usePermissionQueue(session, registerInteractiveResolver);
83825
84422
  const images = useImageAttachments((msg) => setSystemNotice(msg));
83826
84423
  const voice = useVoiceInput({ session, setSystemNotice });
83827
- (0, import_react68.useEffect)(() => {
84424
+ const readAloud = useReadAloud({ session, setSystemNotice });
84425
+ (0, import_react69.useEffect)(() => {
83828
84426
  permissions.yoloRef.current = yolo;
83829
84427
  }, [yolo, permissions.yoloRef]);
83830
84428
  const turn = useTurnRunner({
83831
84429
  session,
83832
84430
  resolveModel: () => activeModelOverride ?? model,
83833
- stream
84431
+ stream,
84432
+ // Auto-speak seam: when read-aloud is armed, speak the final reply once the
84433
+ // turn completes. Reads the reply from session.log; never blocks input.
84434
+ onTurnComplete: () => readAloud.onTurnComplete()
83834
84435
  });
83835
84436
  const pendingPermission = permissions.pendingPermission;
83836
84437
  const pendingApproval = permissions.pendingApproval;
@@ -83860,7 +84461,7 @@ var init_SessionView = __esm({
83860
84461
  },
83861
84462
  r: voice.toggleVoiceInput
83862
84463
  };
83863
- const compactTools = (0, import_react68.useMemo)(() => {
84464
+ const compactTools = (0, import_react69.useMemo)(() => {
83864
84465
  const m3 = /* @__PURE__ */ new Map();
83865
84466
  for (const tool of session.tools.list()) {
83866
84467
  if (tool.compact)
@@ -83874,7 +84475,7 @@ var init_SessionView = __esm({
83874
84475
  const contextUsed = estimateContextTokens(session.log);
83875
84476
  const modeName = getModeName(session);
83876
84477
  const modeBadge = getModeBadge(session);
83877
- const cycleMode = import_react68.default.useCallback(() => {
84478
+ const cycleMode = import_react69.default.useCallback(() => {
83878
84479
  const modes = session.modes.list().filter(isSelectableMode);
83879
84480
  if (modes.length === 0)
83880
84481
  return;
@@ -83893,12 +84494,12 @@ var init_SessionView = __esm({
83893
84494
  } catch {
83894
84495
  }
83895
84496
  }, [session]);
83896
- const slashSuggestions = import_react68.default.useMemo(() => buildSlashSuggestions(session), [session]);
83897
- const installInFlightRef = import_react68.default.useRef(false);
83898
- const [providerConnect, setProviderConnect] = import_react68.default.useState(null);
83899
- const [pluginSetup, setPluginSetup] = import_react68.default.useState(null);
83900
- const rerunSlashRef = import_react68.default.useRef(() => void 0);
83901
- const handlePickerSelect = import_react68.default.useMemo(() => makePickerHandler({
84497
+ const slashSuggestions = import_react69.default.useMemo(() => buildSlashSuggestions(session), [session]);
84498
+ const installInFlightRef = import_react69.default.useRef(false);
84499
+ const [providerConnect, setProviderConnect] = import_react69.default.useState(null);
84500
+ const [pluginSetup, setPluginSetup] = import_react69.default.useState(null);
84501
+ const rerunSlashRef = import_react69.default.useRef(() => void 0);
84502
+ const handlePickerSelect = import_react69.default.useMemo(() => makePickerHandler({
83902
84503
  session,
83903
84504
  providerName: providerName2,
83904
84505
  setPicker,
@@ -83913,9 +84514,11 @@ var init_SessionView = __esm({
83913
84514
  }), [session, providerName2, refreshMcpStatus, onSwitchSession]);
83914
84515
  const performSessionAction = (action, notice) => {
83915
84516
  if (action === "exit") {
84517
+ readAloud.stop();
83916
84518
  exit();
83917
84519
  return;
83918
84520
  }
84521
+ readAloud.stop();
83919
84522
  clearTerminalScreen();
83920
84523
  stream.setEvents([]);
83921
84524
  stream.cancelStreamFlush();
@@ -83974,6 +84577,7 @@ var init_SessionView = __esm({
83974
84577
  queueRef: turn.queueRef,
83975
84578
  setQueueCount: turn.setQueueCount,
83976
84579
  performSessionAction,
84580
+ runSpeak: (arg) => readAloud.handleCommand(arg),
83977
84581
  canSwitchSession: canSwitchSession ?? false,
83978
84582
  // `/collab` re-points the TUI onto the dedicated coordinator via the same
83979
84583
  // in-place switch machinery `/sessions` uses (so it needs the host's
@@ -84013,8 +84617,8 @@ var init_SessionView = __esm({
84013
84617
  rerunSlashRef.current = (line) => {
84014
84618
  void handleSubmit(line);
84015
84619
  };
84016
- const firedInitial = (0, import_react68.useRef)(false);
84017
- (0, import_react68.useEffect)(() => {
84620
+ const firedInitial = (0, import_react69.useRef)(false);
84621
+ (0, import_react69.useEffect)(() => {
84018
84622
  if (firedInitial.current)
84019
84623
  return;
84020
84624
  if (!initialPrompt)
@@ -84022,8 +84626,8 @@ var init_SessionView = __esm({
84022
84626
  firedInitial.current = true;
84023
84627
  void handleSubmit(initialPrompt);
84024
84628
  }, [initialPrompt]);
84025
- const firedUpdateNotice = (0, import_react68.useRef)(false);
84026
- (0, import_react68.useEffect)(() => {
84629
+ const firedUpdateNotice = (0, import_react69.useRef)(false);
84630
+ (0, import_react69.useEffect)(() => {
84027
84631
  if (firedUpdateNotice.current || !updateAvailable || initialPrompt)
84028
84632
  return;
84029
84633
  firedUpdateNotice.current = true;
@@ -84094,11 +84698,11 @@ var init_SessionView = __esm({
84094
84698
  function buildBootPlaceholder(voiceReady) {
84095
84699
  return voiceReady ? "type a prompt to begin \xB7 / for commands \xB7 Ctrl+R voice" : "type a prompt to begin \xB7 / for commands";
84096
84700
  }
84097
- var import_jsx_runtime41, import_react69, InteractiveSession, BootInputArea, DisabledBootInput;
84701
+ var import_jsx_runtime41, import_react70, InteractiveSession, BootInputArea, DisabledBootInput;
84098
84702
  var init_BootShell = __esm({
84099
84703
  async "../plugin-cli/dist/session/BootShell.js"() {
84100
84704
  import_jsx_runtime41 = __toESM(require_jsx_runtime());
84101
- import_react69 = __toESM(require_react());
84705
+ import_react70 = __toESM(require_react());
84102
84706
  await init_build2();
84103
84707
  await init_BootScreen();
84104
84708
  await init_InputBox();
@@ -84108,15 +84712,15 @@ var init_BootShell = __esm({
84108
84712
  init_use_voice_input();
84109
84713
  await init_helpers();
84110
84714
  InteractiveSession = ({ session: eagerSession, bootstrap, registerInteractiveResolver, getVault, getChannels, model, version, updateAvailable, resumed, switchSession }) => {
84111
- const [session, setSession] = (0, import_react69.useState)(eagerSession ?? null);
84112
- const [bootEvents, setBootEvents] = (0, import_react69.useState)([]);
84113
- const [bootError, setBootError] = (0, import_react69.useState)(null);
84114
- const [initialPrompt, setInitialPrompt] = (0, import_react69.useState)(null);
84115
- const [landedViaSwitch, setLandedViaSwitch] = (0, import_react69.useState)(false);
84116
- const switchingRef = (0, import_react69.useRef)(false);
84117
- const [switchNotice, setSwitchNotice] = (0, import_react69.useState)(null);
84118
- const startedAt = import_react69.default.useMemo(() => Date.now(), []);
84119
- const handleSwitchSession = (0, import_react69.useCallback)(async (target) => {
84715
+ const [session, setSession] = (0, import_react70.useState)(eagerSession ?? null);
84716
+ const [bootEvents, setBootEvents] = (0, import_react70.useState)([]);
84717
+ const [bootError, setBootError] = (0, import_react70.useState)(null);
84718
+ const [initialPrompt, setInitialPrompt] = (0, import_react70.useState)(null);
84719
+ const [landedViaSwitch, setLandedViaSwitch] = (0, import_react70.useState)(false);
84720
+ const switchingRef = (0, import_react70.useRef)(false);
84721
+ const [switchNotice, setSwitchNotice] = (0, import_react70.useState)(null);
84722
+ const startedAt = import_react70.default.useMemo(() => Date.now(), []);
84723
+ const handleSwitchSession = (0, import_react70.useCallback)(async (target) => {
84120
84724
  if (!switchSession)
84121
84725
  throw new Error("switching sessions is not available");
84122
84726
  if (switchingRef.current)
@@ -84133,7 +84737,7 @@ var init_BootShell = __esm({
84133
84737
  switchingRef.current = false;
84134
84738
  }
84135
84739
  }, [switchSession]);
84136
- (0, import_react69.useEffect)(() => {
84740
+ (0, import_react70.useEffect)(() => {
84137
84741
  if (eagerSession || !bootstrap)
84138
84742
  return;
84139
84743
  let cancelled = false;
@@ -84187,7 +84791,7 @@ var init_BootShell = __esm({
84187
84791
  );
84188
84792
  };
84189
84793
  BootInputArea = ({ session, ready, bootError, onSubmit }) => {
84190
- const [systemNotice, setSystemNotice] = (0, import_react69.useState)(null);
84794
+ const [systemNotice, setSystemNotice] = (0, import_react70.useState)(null);
84191
84795
  const voice = useVoiceInput({ session, setSystemNotice });
84192
84796
  const commandHotkeys = ready ? { r: voice.toggleVoiceInput } : {};
84193
84797
  return (0, import_jsx_runtime41.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime41.jsx)(Box_default, { marginTop: 2, children: (0, import_jsx_runtime41.jsx)(InputBox, { disabled: !ready, voicePhase: voice.phase, externalInsert: voice.externalInsert, commandHotkeys, placeholder: ready ? buildBootPlaceholder(voice.ready) : bootError ? "Bootstrap failed \u2014 quit and run `moxxy init`" : "Initializing\u2026", onSubmit: (text) => {
@@ -84210,10 +84814,10 @@ var init_InteractiveSession = __esm({
84210
84814
  });
84211
84815
 
84212
84816
  // ../plugin-cli/dist/TuiChannel.js
84213
- var import_react70, TuiChannel;
84817
+ var import_react71, TuiChannel;
84214
84818
  var init_TuiChannel = __esm({
84215
84819
  async "../plugin-cli/dist/TuiChannel.js"() {
84216
- import_react70 = __toESM(require_react());
84820
+ import_react71 = __toESM(require_react());
84217
84821
  await init_build2();
84218
84822
  init_resolver();
84219
84823
  await init_InteractiveSession();
@@ -84240,7 +84844,7 @@ var init_TuiChannel = __esm({
84240
84844
  const registerInteractiveResolver = (handler) => {
84241
84845
  this.promptHandler = handler;
84242
84846
  };
84243
- this.inkInstance = render_default(import_react70.default.createElement(InteractiveSession, {
84847
+ this.inkInstance = render_default(import_react71.default.createElement(InteractiveSession, {
84244
84848
  ...opts.session ? { session: opts.session } : {},
84245
84849
  ...opts.bootstrap ? { bootstrap: opts.bootstrap } : {},
84246
84850
  registerInteractiveResolver,
@@ -84260,7 +84864,7 @@ var init_TuiChannel = __esm({
84260
84864
  });
84261
84865
 
84262
84866
  // ../plugin-cli/dist/components/PermissionEditor.js
84263
- function errMessage(err) {
84867
+ function errMessage2(err) {
84264
84868
  return err instanceof Error ? err.message : String(err);
84265
84869
  }
84266
84870
  async function flipRule(ops) {
@@ -84289,22 +84893,22 @@ function toRows(engine) {
84289
84893
  out.push({ kind: "allow", name: r2.name, reason: r2.reason });
84290
84894
  return out;
84291
84895
  }
84292
- var import_jsx_runtime42, import_react71, PermissionEditor;
84896
+ var import_jsx_runtime42, import_react72, PermissionEditor;
84293
84897
  var init_PermissionEditor = __esm({
84294
84898
  async "../plugin-cli/dist/components/PermissionEditor.js"() {
84295
84899
  import_jsx_runtime42 = __toESM(require_jsx_runtime());
84296
- import_react71 = __toESM(require_react());
84900
+ import_react72 = __toESM(require_react());
84297
84901
  await init_build2();
84298
84902
  init_dist();
84299
84903
  PermissionEditor = ({ policyPath: policyPath2 }) => {
84300
84904
  const { exit } = use_app_default();
84301
- const [engine, setEngine] = (0, import_react71.useState)(null);
84302
- const [rows, setRows] = (0, import_react71.useState)([]);
84303
- const [cursor, setCursor] = (0, import_react71.useState)(0);
84304
- const [dirty, setDirty] = (0, import_react71.useState)(false);
84305
- const [mode, setMode] = (0, import_react71.useState)({ kind: "list" });
84306
- const [status, setStatus] = (0, import_react71.useState)("");
84307
- (0, import_react71.useEffect)(() => {
84905
+ const [engine, setEngine] = (0, import_react72.useState)(null);
84906
+ const [rows, setRows] = (0, import_react72.useState)([]);
84907
+ const [cursor, setCursor] = (0, import_react72.useState)(0);
84908
+ const [dirty, setDirty] = (0, import_react72.useState)(false);
84909
+ const [mode, setMode] = (0, import_react72.useState)({ kind: "list" });
84910
+ const [status, setStatus] = (0, import_react72.useState)("");
84911
+ (0, import_react72.useEffect)(() => {
84308
84912
  let cancelled = false;
84309
84913
  (async () => {
84310
84914
  const e3 = await PermissionEngine.load(policyPath2);
@@ -84347,7 +84951,7 @@ var init_PermissionEditor = __esm({
84347
84951
  setMode({ kind: "message", text: `added ${bucket}: ${name}` });
84348
84952
  setStatus("saved");
84349
84953
  }).catch((err) => {
84350
- setMode({ kind: "message", text: `FAILED to add ${bucket}: ${errMessage(err)}` });
84954
+ setMode({ kind: "message", text: `FAILED to add ${bucket}: ${errMessage2(err)}` });
84351
84955
  setStatus("save failed");
84352
84956
  });
84353
84957
  return;
@@ -84374,7 +84978,7 @@ var init_PermissionEditor = __esm({
84374
84978
  setMode({ kind: "message", text: `removed: ${removedName}` });
84375
84979
  setStatus("saved");
84376
84980
  }).catch((err) => {
84377
- setMode({ kind: "message", text: `FAILED to remove ${removedName}: ${errMessage(err)}` });
84981
+ setMode({ kind: "message", text: `FAILED to remove ${removedName}: ${errMessage2(err)}` });
84378
84982
  setStatus("save failed");
84379
84983
  });
84380
84984
  return;
@@ -84422,7 +85026,7 @@ var init_PermissionEditor = __esm({
84422
85026
  setDirty(true);
84423
85027
  setStatus(`flipped ${row.name} \u2192 ${targetKind}`);
84424
85028
  } else {
84425
- setStatus(`flip FAILED for ${row.name}: ${errMessage(result.error)}`);
85029
+ setStatus(`flip FAILED for ${row.name}: ${errMessage2(result.error)}`);
84426
85030
  }
84427
85031
  });
84428
85032
  return;
@@ -84440,17 +85044,17 @@ var init_PermissionEditor = __esm({
84440
85044
  });
84441
85045
 
84442
85046
  // ../plugin-cli/dist/components/Logo.js
84443
- var import_jsx_runtime43, import_react72, Logo;
85047
+ var import_jsx_runtime43, import_react73, Logo;
84444
85048
  var init_Logo = __esm({
84445
85049
  async "../plugin-cli/dist/components/Logo.js"() {
84446
85050
  import_jsx_runtime43 = __toESM(require_jsx_runtime());
84447
- import_react72 = __toESM(require_react());
85051
+ import_react73 = __toESM(require_react());
84448
85052
  await init_build2();
84449
85053
  init_logo_data();
84450
85054
  await init_LogoLine();
84451
85055
  Logo = ({ subtitle }) => {
84452
85056
  const width = process.stdout.columns ?? 80;
84453
- const slogan = (0, import_react72.useMemo)(() => pickSlogan(), []);
85057
+ const slogan = (0, import_react73.useMemo)(() => pickSlogan(), []);
84454
85058
  const { lines } = selectLogo(width);
84455
85059
  return (0, import_jsx_runtime43.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [lines.map((line, i2) => (0, import_jsx_runtime43.jsx)(LogoLine, { text: line }, i2)), (0, import_jsx_runtime43.jsx)(Box_default, { marginTop: 1, children: (0, import_jsx_runtime43.jsx)(Text, { dimColor: true, italic: true, children: slogan }) }), subtitle ? (0, import_jsx_runtime43.jsx)(Box_default, { children: (0, import_jsx_runtime43.jsxs)(Text, { dimColor: true, children: [" ", subtitle] }) }) : null] });
84456
85060
  };
@@ -84518,18 +85122,21 @@ __export(dist_exports4, {
84518
85122
  WORDMARK_LINES: () => WORDMARK_LINES,
84519
85123
  WORDMARK_MIN_WIDTH: () => WORDMARK_MIN_WIDTH,
84520
85124
  WORDMARK_WIDTH: () => WORDMARK_WIDTH,
85125
+ checkAudioPlaybackAvailable: () => checkAudioPlaybackAvailable,
84521
85126
  checkVoiceCaptureAvailable: () => checkVoiceCaptureAvailable,
84522
85127
  cliPlugin: () => cliPlugin,
84523
85128
  createInteractivePermissionResolver: () => createInteractivePermissionResolver,
84524
85129
  default: () => dist_default4,
84525
85130
  pickSlogan: () => pickSlogan,
85131
+ playAudio: () => playAudio,
84526
85132
  renderYaml: () => renderYaml,
85133
+ selectAudioPlayer: () => selectAudioPlayer,
84527
85134
  selectLogo: () => selectLogo,
84528
85135
  tuiChannelDef: () => tuiChannelDef,
84529
85136
  unavailableVoiceCaptureCheck: () => unavailableVoiceCaptureCheck
84530
85137
  });
84531
85138
  var tuiChannelDef, cliPlugin, dist_default4;
84532
- var init_dist11 = __esm({
85139
+ var init_dist12 = __esm({
84533
85140
  async "../plugin-cli/dist/index.js"() {
84534
85141
  await init_TuiChannel();
84535
85142
  await init_InteractiveSession();
@@ -84543,6 +85150,7 @@ var init_dist11 = __esm({
84543
85150
  init_logo_data();
84544
85151
  init_setup_yaml();
84545
85152
  init_voice_input();
85153
+ init_audio_play();
84546
85154
  tuiChannelDef = defineChannel({
84547
85155
  name: "tui",
84548
85156
  description: "Interactive terminal UI via Ink. Default `moxxy` command.",
@@ -86102,10 +86710,10 @@ var require_segments = __commonJS({
86102
86710
  const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled());
86103
86711
  const nodes = buildNodes(segs);
86104
86712
  const graph = buildGraph(nodes, version);
86105
- const path61 = dijkstra.find_path(graph.map, "start", "end");
86713
+ const path63 = dijkstra.find_path(graph.map, "start", "end");
86106
86714
  const optimizedSegs = [];
86107
- for (let i2 = 1; i2 < path61.length - 1; i2++) {
86108
- optimizedSegs.push(graph.table[path61[i2]].node);
86715
+ for (let i2 = 1; i2 < path63.length - 1; i2++) {
86716
+ optimizedSegs.push(graph.table[path63[i2]].node);
86109
86717
  }
86110
86718
  return exports.fromArray(mergeSegments(optimizedSegs));
86111
86719
  };
@@ -88557,7 +89165,7 @@ var require_png2 = __commonJS({
88557
89165
  });
88558
89166
  png.pack();
88559
89167
  };
88560
- exports.renderToFile = function renderToFile(path61, qrData, options, cb) {
89168
+ exports.renderToFile = function renderToFile(path63, qrData, options, cb) {
88561
89169
  if (typeof cb === "undefined") {
88562
89170
  cb = options;
88563
89171
  options = void 0;
@@ -88568,7 +89176,7 @@ var require_png2 = __commonJS({
88568
89176
  called = true;
88569
89177
  cb.apply(null, args);
88570
89178
  };
88571
- const stream = fs48.createWriteStream(path61);
89179
+ const stream = fs48.createWriteStream(path63);
88572
89180
  stream.on("error", done);
88573
89181
  stream.on("close", done);
88574
89182
  exports.renderToFileStream(stream, qrData, options);
@@ -88630,14 +89238,14 @@ var require_utf8 = __commonJS({
88630
89238
  }
88631
89239
  return output;
88632
89240
  };
88633
- exports.renderToFile = function renderToFile(path61, qrData, options, cb) {
89241
+ exports.renderToFile = function renderToFile(path63, qrData, options, cb) {
88634
89242
  if (typeof cb === "undefined") {
88635
89243
  cb = options;
88636
89244
  options = void 0;
88637
89245
  }
88638
89246
  const fs48 = __require("fs");
88639
89247
  const utf82 = exports.render(qrData, options);
88640
- fs48.writeFile(path61, utf82, cb);
89248
+ fs48.writeFile(path63, utf82, cb);
88641
89249
  };
88642
89250
  }
88643
89251
  });
@@ -88758,7 +89366,7 @@ var require_svg_tag = __commonJS({
88758
89366
  return str2;
88759
89367
  }
88760
89368
  function qrToPath(data, size, margin) {
88761
- let path61 = "";
89369
+ let path63 = "";
88762
89370
  let moveBy = 0;
88763
89371
  let newRow = false;
88764
89372
  let lineLength = 0;
@@ -88769,19 +89377,19 @@ var require_svg_tag = __commonJS({
88769
89377
  if (data[i2]) {
88770
89378
  lineLength++;
88771
89379
  if (!(i2 > 0 && col > 0 && data[i2 - 1])) {
88772
- path61 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
89380
+ path63 += newRow ? svgCmd("M", col + margin, 0.5 + row + margin) : svgCmd("m", moveBy, 0);
88773
89381
  moveBy = 0;
88774
89382
  newRow = false;
88775
89383
  }
88776
89384
  if (!(col + 1 < size && data[i2 + 1])) {
88777
- path61 += svgCmd("h", lineLength);
89385
+ path63 += svgCmd("h", lineLength);
88778
89386
  lineLength = 0;
88779
89387
  }
88780
89388
  } else {
88781
89389
  moveBy++;
88782
89390
  }
88783
89391
  }
88784
- return path61;
89392
+ return path63;
88785
89393
  }
88786
89394
  exports.render = function render2(qrData, options, cb) {
88787
89395
  const opts = Utils.getOptions(options);
@@ -88789,10 +89397,10 @@ var require_svg_tag = __commonJS({
88789
89397
  const data = qrData.modules.data;
88790
89398
  const qrcodesize = size + opts.margin * 2;
88791
89399
  const bg = !opts.color.light.a ? "" : "<path " + getColorAttrib(opts.color.light, "fill") + ' d="M0 0h' + qrcodesize + "v" + qrcodesize + 'H0z"/>';
88792
- const path61 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
89400
+ const path63 = "<path " + getColorAttrib(opts.color.dark, "stroke") + ' d="' + qrToPath(data, size, opts.margin) + '"/>';
88793
89401
  const viewBox = 'viewBox="0 0 ' + qrcodesize + " " + qrcodesize + '"';
88794
89402
  const width = !opts.width ? "" : 'width="' + opts.width + '" height="' + opts.width + '" ';
88795
- const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path61 + "</svg>\n";
89403
+ const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path63 + "</svg>\n";
88796
89404
  if (typeof cb === "function") {
88797
89405
  cb(null, svgTag);
88798
89406
  }
@@ -88806,7 +89414,7 @@ var require_svg = __commonJS({
88806
89414
  "../../node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg.js"(exports) {
88807
89415
  var svgTagRenderer = require_svg_tag();
88808
89416
  exports.render = svgTagRenderer.render;
88809
- exports.renderToFile = function renderToFile(path61, qrData, options, cb) {
89417
+ exports.renderToFile = function renderToFile(path63, qrData, options, cb) {
88810
89418
  if (typeof cb === "undefined") {
88811
89419
  cb = options;
88812
89420
  options = void 0;
@@ -88814,7 +89422,7 @@ var require_svg = __commonJS({
88814
89422
  const fs48 = __require("fs");
88815
89423
  const svgTag = exports.render(qrData, options);
88816
89424
  const xmlStr = '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' + svgTag;
88817
- fs48.writeFile(path61, xmlStr, cb);
89425
+ fs48.writeFile(path63, xmlStr, cb);
88818
89426
  };
88819
89427
  }
88820
89428
  });
@@ -88972,8 +89580,8 @@ var require_server = __commonJS({
88972
89580
  cb
88973
89581
  };
88974
89582
  }
88975
- function getTypeFromFilename(path61) {
88976
- return path61.slice((path61.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
89583
+ function getTypeFromFilename(path63) {
89584
+ return path63.slice((path63.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase();
88977
89585
  }
88978
89586
  function getRendererFromType(type) {
88979
89587
  switch (type) {
@@ -89037,17 +89645,17 @@ var require_server = __commonJS({
89037
89645
  const renderer2 = getRendererFromType(params.opts.type);
89038
89646
  return render2(renderer2.renderToBuffer, text, params);
89039
89647
  };
89040
- exports.toFile = function toFile3(path61, text, opts, cb) {
89041
- if (typeof path61 !== "string" || !(typeof text === "string" || typeof text === "object")) {
89648
+ exports.toFile = function toFile3(path63, text, opts, cb) {
89649
+ if (typeof path63 !== "string" || !(typeof text === "string" || typeof text === "object")) {
89042
89650
  throw new Error("Invalid argument");
89043
89651
  }
89044
89652
  if (arguments.length < 3 && !canPromise()) {
89045
89653
  throw new Error("Too few arguments provided");
89046
89654
  }
89047
89655
  const params = checkParams(text, opts, cb);
89048
- const type = params.opts.type || getTypeFromFilename(path61);
89656
+ const type = params.opts.type || getTypeFromFilename(path63);
89049
89657
  const renderer2 = getRendererFromType(type);
89050
- const renderToFile = renderer2.renderToFile.bind(null, path61);
89658
+ const renderToFile = renderer2.renderToFile.bind(null, path63);
89051
89659
  return render2(renderToFile, text, params);
89052
89660
  };
89053
89661
  exports.toFileStream = function toFileStream(stream, text, opts) {
@@ -89095,7 +89703,7 @@ var init_utils = __esm({
89095
89703
 
89096
89704
  // ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
89097
89705
  var ANSI_RE, CONTROL_RE, CJKT_WIDE_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default5;
89098
- var init_dist12 = __esm({
89706
+ var init_dist13 = __esm({
89099
89707
  "../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js"() {
89100
89708
  init_utils();
89101
89709
  ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
@@ -89199,9 +89807,9 @@ var init_dist12 = __esm({
89199
89807
 
89200
89808
  // ../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
89201
89809
  var NO_TRUNCATION2, fastStringWidth, dist_default6;
89202
- var init_dist13 = __esm({
89810
+ var init_dist14 = __esm({
89203
89811
  "../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js"() {
89204
- init_dist12();
89812
+ init_dist13();
89205
89813
  NO_TRUNCATION2 = {
89206
89814
  limit: Infinity,
89207
89815
  ellipsis: "",
@@ -89221,7 +89829,7 @@ function wrapAnsi3(string3, columns, options) {
89221
89829
  var ESC2, CSI, END_CODE2, ANSI_ESCAPE_BELL2, ANSI_CSI2, ANSI_OSC2, ANSI_SGR_TERMINATOR2, ANSI_ESCAPE_LINK2, GROUP_REGEX, getClosingCode, wrapAnsiCode2, wrapAnsiHyperlink2, wrapWord2, stringVisibleTrimSpacesRight2, exec2, CRLF_OR_LF;
89222
89830
  var init_main = __esm({
89223
89831
  "../../node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js"() {
89224
- init_dist13();
89832
+ init_dist14();
89225
89833
  ESC2 = "\x1B";
89226
89834
  CSI = "\x9B";
89227
89835
  END_CODE2 = 39;
@@ -89614,7 +90222,7 @@ function st2(r2, t2, s2, e3) {
89614
90222
  return r2 === "year" ? { min: i2?.year ?? 1, max: n2?.year ?? 9999 } : r2 === "month" ? { min: i2 && t2.year === i2.year ? i2.month : 1, max: n2 && t2.year === n2.year ? n2.month : 12 } : { min: i2 && t2.year === i2.year && t2.month === i2.month ? i2.day : 1, max: n2 && t2.year === n2.year && t2.month === n2.month ? n2.day : U2(t2.year, t2.month) };
89615
90223
  }
89616
90224
  var import_sisteransi, G2, K2, h2, Y2, k2, A2, L2, m2, Q2, X2, Z2, et2, it2, rt2, nt2, ot2, ut2, at2, ht2;
89617
- var init_dist14 = __esm({
90225
+ var init_dist15 = __esm({
89618
90226
  "../../node_modules/.pnpm/@clack+core@1.3.1/node_modules/@clack/core/dist/index.mjs"() {
89619
90227
  init_main();
89620
90228
  import_sisteransi = __toESM(require_src());
@@ -90347,12 +90955,12 @@ function _e2({ style: t2 = "heavy", max: i2 = 100, size: s2 = 40, ...r2 } = {})
90347
90955
  return { start: g2, stop: u2.stop, cancel: u2.cancel, error: u2.error, clear: u2.clear, advance: p3, isCancelled: u2.isCancelled, message: (f3) => p3(0, f3) };
90348
90956
  }
90349
90957
  var import_sisteransi2, tt3, ot3, It2, w3, Tt2, at3, ut3, H3, lt2, $3, x3, _t2, xt2, z65, U3, et3, K3, Y3, Et2, st3, ct2, Gt2, $t2, dt2, Mt2, ht3, pt2, mt2, gt2, P3, yt2, Ot2, F3, At2, ie2, re2, ne2, oe2, ae2, ue2, le2, de2, he2, pe2, R3, me2, ge2, ye2, fe2, Q3, ve2, we2, be2, Se2, Ce2, Ie2, Te2, ft2, jt2, it3, xe2, Ee2, Nt2, q3, Ge2, Me2, Oe2, Pe2;
90350
- var init_dist15 = __esm({
90958
+ var init_dist16 = __esm({
90351
90959
  "../../node_modules/.pnpm/@clack+prompts@1.4.0/node_modules/@clack/prompts/dist/index.mjs"() {
90352
- init_dist14();
90353
- init_dist14();
90960
+ init_dist15();
90961
+ init_dist15();
90354
90962
  init_main();
90355
- init_dist13();
90963
+ init_dist14();
90356
90964
  import_sisteransi2 = __toESM(require_src());
90357
90965
  tt3 = ee2();
90358
90966
  ot3 = () => process.env.CI === "true";
@@ -95514,11 +96122,11 @@ function parseBody(body) {
95514
96122
  return { ok: false, value: null };
95515
96123
  }
95516
96124
  }
95517
- function readJsonPath(parsed, path61) {
96125
+ function readJsonPath(parsed, path63) {
95518
96126
  if (!parsed.ok)
95519
96127
  return null;
95520
96128
  let cur = parsed.value;
95521
- for (const seg of path61.split(".")) {
96129
+ for (const seg of path63.split(".")) {
95522
96130
  if (cur === null || cur === void 0 || typeof cur !== "object")
95523
96131
  return null;
95524
96132
  cur = cur[seg];
@@ -99612,10 +100220,10 @@ async function connectResponder(transport, identity) {
99612
100220
  function defaultIdentityPath() {
99613
100221
  return moxxyPath("proxy-identity.key");
99614
100222
  }
99615
- async function loadOrCreateIdentity(path61 = defaultIdentityPath()) {
100223
+ async function loadOrCreateIdentity(path63 = defaultIdentityPath()) {
99616
100224
  let hex = null;
99617
100225
  try {
99618
- hex = (await readFile(path61, "utf8")).trim();
100226
+ hex = (await readFile(path63, "utf8")).trim();
99619
100227
  } catch (err) {
99620
100228
  if (err.code !== "ENOENT")
99621
100229
  throw err;
@@ -99630,7 +100238,7 @@ async function loadOrCreateIdentity(path61 = defaultIdentityPath()) {
99630
100238
  }
99631
100239
  }
99632
100240
  const identity = generateIdentity();
99633
- await writeFileAtomic(path61, bytesToHex(identity.secretKey), { mode: 384 });
100241
+ await writeFileAtomic(path63, bytesToHex(identity.secretKey), { mode: 384 });
99634
100242
  return identity;
99635
100243
  }
99636
100244
 
@@ -103017,11 +103625,11 @@ function buildAuthUrl(input) {
103017
103625
  }
103018
103626
  async function runAuthorizationCodeFlow(opts) {
103019
103627
  const port = opts.redirectPort ?? 8765;
103020
- const path61 = opts.redirectPath ?? "/callback";
103628
+ const path63 = opts.redirectPath ?? "/callback";
103021
103629
  const codeVerifier = generateCodeVerifier();
103022
103630
  const codeChallenge = computeCodeChallenge(codeVerifier);
103023
103631
  const state = generateState();
103024
- const redirectUri = `http://localhost:${port}${path61}`;
103632
+ const redirectUri = `http://localhost:${port}${path63}`;
103025
103633
  const authUrl = buildAuthUrl({
103026
103634
  authUrl: opts.authUrl,
103027
103635
  clientId: opts.clientId,
@@ -103033,7 +103641,7 @@ async function runAuthorizationCodeFlow(opts) {
103033
103641
  });
103034
103642
  const codePromise = waitForCallback({
103035
103643
  port,
103036
- path: path61,
103644
+ path: path63,
103037
103645
  expectedState: state,
103038
103646
  timeoutMs: opts.timeoutMs ?? 3e5,
103039
103647
  ...opts.signal ? { signal: opts.signal } : {}
@@ -103547,11 +104155,11 @@ function buildOauthAuthorizeTool(deps) {
103547
104155
  const { computeCodeChallenge: computeCodeChallenge2 } = await Promise.resolve().then(() => (init_pkce(), pkce_exports));
103548
104156
  const challenge = computeCodeChallenge2(verifier);
103549
104157
  const port = input.redirectPort ?? 8765;
103550
- const path61 = input.redirectPath ?? "/callback";
104158
+ const path63 = input.redirectPath ?? "/callback";
103551
104159
  const url2 = buildAuthUrl({
103552
104160
  authUrl: input.authUrl,
103553
104161
  clientId: input.clientId,
103554
- redirectUri: `http://localhost:${port}${path61}`,
104162
+ redirectUri: `http://localhost:${port}${path63}`,
103555
104163
  scopes: input.scopes,
103556
104164
  codeChallenge: challenge,
103557
104165
  state,
@@ -103715,7 +104323,7 @@ async function runOauthLogin(profile, ctx) {
103715
104323
  }
103716
104324
  async function runBrowserFlow(profile, ctx) {
103717
104325
  const port = profile.redirect?.port ?? 8765;
103718
- const path61 = profile.redirect?.path ?? "/callback";
104326
+ const path63 = profile.redirect?.path ?? "/callback";
103719
104327
  const serviceName = profile.displayName ?? profile.id;
103720
104328
  return runAuthorizationCodeFlow({
103721
104329
  authUrl: profile.authUrl,
@@ -103724,7 +104332,7 @@ async function runBrowserFlow(profile, ctx) {
103724
104332
  ...profile.clientSecret ? { clientSecret: profile.clientSecret } : {},
103725
104333
  scopes: profile.scopes,
103726
104334
  redirectPort: port,
103727
- redirectPath: path61,
104335
+ redirectPath: path63,
103728
104336
  ...profile.extraAuthParams ? { extraAuthParams: profile.extraAuthParams } : {},
103729
104337
  timeoutMs: DEFAULT_BROWSER_TIMEOUT_MS,
103730
104338
  ...ctx.signal ? { signal: ctx.signal } : {},
@@ -103736,7 +104344,7 @@ If your browser doesn't open automatically, paste this URL:
103736
104344
 
103737
104345
  ${url2}
103738
104346
 
103739
- Waiting for callback on http://localhost:${port}${path61} (5 min timeout)\u2026
104347
+ Waiting for callback on http://localhost:${port}${path63} (5 min timeout)\u2026
103740
104348
 
103741
104349
  `);
103742
104350
  }
@@ -106262,13 +106870,13 @@ var MultipartBody = class {
106262
106870
  }
106263
106871
  };
106264
106872
  var fileFromPathWarned = false;
106265
- async function fileFromPath3(path61, ...args) {
106873
+ async function fileFromPath3(path63, ...args) {
106266
106874
  const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
106267
106875
  if (!fileFromPathWarned) {
106268
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path61)}) instead`);
106876
+ console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path63)}) instead`);
106269
106877
  fileFromPathWarned = true;
106270
106878
  }
106271
- return await _fileFromPath(path61, ...args);
106879
+ return await _fileFromPath(path63, ...args);
106272
106880
  }
106273
106881
  var defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
106274
106882
  var defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
@@ -106991,29 +107599,29 @@ var APIClient = class {
106991
107599
  defaultIdempotencyKey() {
106992
107600
  return `stainless-node-retry-${uuid4()}`;
106993
107601
  }
106994
- get(path61, opts) {
106995
- return this.methodRequest("get", path61, opts);
107602
+ get(path63, opts) {
107603
+ return this.methodRequest("get", path63, opts);
106996
107604
  }
106997
- post(path61, opts) {
106998
- return this.methodRequest("post", path61, opts);
107605
+ post(path63, opts) {
107606
+ return this.methodRequest("post", path63, opts);
106999
107607
  }
107000
- patch(path61, opts) {
107001
- return this.methodRequest("patch", path61, opts);
107608
+ patch(path63, opts) {
107609
+ return this.methodRequest("patch", path63, opts);
107002
107610
  }
107003
- put(path61, opts) {
107004
- return this.methodRequest("put", path61, opts);
107611
+ put(path63, opts) {
107612
+ return this.methodRequest("put", path63, opts);
107005
107613
  }
107006
- delete(path61, opts) {
107007
- return this.methodRequest("delete", path61, opts);
107614
+ delete(path63, opts) {
107615
+ return this.methodRequest("delete", path63, opts);
107008
107616
  }
107009
- methodRequest(method, path61, opts) {
107617
+ methodRequest(method, path63, opts) {
107010
107618
  return this.request(Promise.resolve(opts).then(async (opts2) => {
107011
107619
  const body = opts2 && isBlobLike(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body;
107012
- return { method, path: path61, ...opts2, body };
107620
+ return { method, path: path63, ...opts2, body };
107013
107621
  }));
107014
107622
  }
107015
- getAPIList(path61, Page3, opts) {
107016
- return this.requestAPIList(Page3, { method: "get", path: path61, ...opts });
107623
+ getAPIList(path63, Page3, opts) {
107624
+ return this.requestAPIList(Page3, { method: "get", path: path63, ...opts });
107017
107625
  }
107018
107626
  calculateContentLength(body) {
107019
107627
  if (typeof body === "string") {
@@ -107032,10 +107640,10 @@ var APIClient = class {
107032
107640
  }
107033
107641
  buildRequest(inputOptions, { retryCount = 0 } = {}) {
107034
107642
  const options = { ...inputOptions };
107035
- const { method, path: path61, query, headers = {} } = options;
107643
+ const { method, path: path63, query, headers = {} } = options;
107036
107644
  const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null;
107037
107645
  const contentLength = this.calculateContentLength(body);
107038
- const url2 = this.buildURL(path61, query);
107646
+ const url2 = this.buildURL(path63, query);
107039
107647
  if ("timeout" in options)
107040
107648
  validatePositiveInteger("timeout", options.timeout);
107041
107649
  options.timeout = options.timeout ?? this.timeout;
@@ -107147,10 +107755,10 @@ var APIClient = class {
107147
107755
  }
107148
107756
  const errText = await response.text().catch((e3) => castToError(e3).message);
107149
107757
  const errJSON = safeJSON(errText);
107150
- const errMessage2 = errJSON ? void 0 : errText;
107758
+ const errMessage3 = errJSON ? void 0 : errText;
107151
107759
  const retryMessage = retriesRemaining ? `(error; no more retries left)` : `(error; not retryable)`;
107152
- debug(`response (error; ${retryMessage})`, response.status, url2, responseHeaders, errMessage2);
107153
- const err = this.makeStatusError(response.status, errJSON, errMessage2, responseHeaders);
107760
+ debug(`response (error; ${retryMessage})`, response.status, url2, responseHeaders, errMessage3);
107761
+ const err = this.makeStatusError(response.status, errJSON, errMessage3, responseHeaders);
107154
107762
  throw err;
107155
107763
  }
107156
107764
  return { response, options, controller };
@@ -107159,8 +107767,8 @@ var APIClient = class {
107159
107767
  const request = this.makeRequest(options, null);
107160
107768
  return new PagePromise(this, request, Page3);
107161
107769
  }
107162
- buildURL(path61, query) {
107163
- const url2 = isAbsoluteURL(path61) ? new URL(path61) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path61.startsWith("/") ? path61.slice(1) : path61));
107770
+ buildURL(path63, query) {
107771
+ const url2 = isAbsoluteURL(path63) ? new URL(path63) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path63.startsWith("/") ? path63.slice(1) : path63));
107164
107772
  const defaultQuery = this.defaultQuery();
107165
107773
  if (!isEmptyObj(defaultQuery)) {
107166
107774
  query = { ...defaultQuery, ...query };
@@ -113459,7 +114067,7 @@ function isMoxxyCommandLine(command) {
113459
114067
  }
113460
114068
  var RECOVERY_SUBCOMMAND_TIMEOUT_MS = 5e3;
113461
114069
  function spawnText(command, args, timeoutMs2 = RECOVERY_SUBCOMMAND_TIMEOUT_MS) {
113462
- return import('child_process').then(({ spawn: spawn14 }) => new Promise((resolve18) => {
114070
+ return import('child_process').then(({ spawn: spawn16 }) => new Promise((resolve18) => {
113463
114071
  let out = "";
113464
114072
  let settled = false;
113465
114073
  let timer;
@@ -113473,7 +114081,7 @@ function spawnText(command, args, timeoutMs2 = RECOVERY_SUBCOMMAND_TIMEOUT_MS) {
113473
114081
  };
113474
114082
  let child;
113475
114083
  try {
113476
- child = spawn14(command, [...args], { stdio: ["ignore", "pipe", "ignore"] });
114084
+ child = spawn16(command, [...args], { stdio: ["ignore", "pipe", "ignore"] });
113477
114085
  } catch {
113478
114086
  done("");
113479
114087
  return;
@@ -113680,8 +114288,8 @@ var CollabHubClient = class _CollabHubClient {
113680
114288
  peerFiles(agentId) {
113681
114289
  return this.peer.request(CollabHubMethod.PeerFiles, { agentId });
113682
114290
  }
113683
- peerRead(agentId, path61) {
113684
- return this.peer.request(CollabHubMethod.PeerRead, { agentId, path: path61 });
114291
+ peerRead(agentId, path63) {
114292
+ return this.peer.request(CollabHubMethod.PeerRead, { agentId, path: path63 });
113685
114293
  }
113686
114294
  peerDiff(agentId) {
113687
114295
  return this.peer.request(CollabHubMethod.PeerDiff, { agentId });
@@ -113991,11 +114599,11 @@ var collabPeerRead = defineTool({
113991
114599
  inputSchema: z.object({ agentId: z.string(), path: z.string() }),
113992
114600
  permission: { action: "allow" },
113993
114601
  isolation: HUB_RPC_PEER_ISOLATION,
113994
- handler: async ({ agentId, path: path61 }) => {
114602
+ handler: async ({ agentId, path: path63 }) => {
113995
114603
  const c2 = await getProcessHubClient();
113996
114604
  if (!c2)
113997
114605
  return NOT_IN_COLLAB;
113998
- return c2.peerRead(agentId, path61);
114606
+ return c2.peerRead(agentId, path63);
113999
114607
  }
114000
114608
  });
114001
114609
  var collabPeerDiff = defineTool({
@@ -115060,8 +115668,8 @@ async function addWorktree(args) {
115060
115668
  if (r2.code !== 0)
115061
115669
  throw new Error(`git worktree add failed: ${r2.stderr.trim() || r2.stdout.trim()}`);
115062
115670
  }
115063
- async function removeWorktree(repoCwd, path61) {
115064
- await git(repoCwd, ["worktree", "remove", "--force", path61]);
115671
+ async function removeWorktree(repoCwd, path63) {
115672
+ await git(repoCwd, ["worktree", "remove", "--force", path63]);
115065
115673
  await git(repoCwd, ["worktree", "prune"]);
115066
115674
  }
115067
115675
  async function commitAll(worktreeCwd, message) {
@@ -115082,9 +115690,9 @@ async function changedFiles(worktreeCwd) {
115082
115690
  if (!rec)
115083
115691
  continue;
115084
115692
  const status = rec.slice(0, 2).trim();
115085
- const path61 = rec.slice(3);
115086
- if (path61)
115087
- out.push({ status, path: path61 });
115693
+ const path63 = rec.slice(3);
115694
+ if (path63)
115695
+ out.push({ status, path: path63 });
115088
115696
  if (status.startsWith("R") || status.startsWith("C"))
115089
115697
  i2++;
115090
115698
  }
@@ -115178,9 +115786,9 @@ function peerReaderFor(worktrees, baseSha) {
115178
115786
  async files(agentId) {
115179
115787
  return changedFiles(dirFor(agentId));
115180
115788
  },
115181
- async read(agentId, path61) {
115789
+ async read(agentId, path63) {
115182
115790
  const dir = dirFor(agentId);
115183
- return readFile(await resolveWithinReal(dir, path61), "utf8");
115791
+ return readFile(await resolveWithinReal(dir, path63), "utf8");
115184
115792
  },
115185
115793
  async diff(agentId) {
115186
115794
  return diffVsBase(dirFor(agentId), baseSha);
@@ -115192,8 +115800,8 @@ function cwdPeerReader(cwd2) {
115192
115800
  async files() {
115193
115801
  return await isGitRepo(cwd2) ? changedFiles(cwd2) : [];
115194
115802
  },
115195
- async read(_agentId, path61) {
115196
- return readFile(await resolveWithinReal(cwd2, path61), "utf8");
115803
+ async read(_agentId, path63) {
115804
+ return readFile(await resolveWithinReal(cwd2, path63), "utf8");
115197
115805
  },
115198
115806
  async diff() {
115199
115807
  return "";
@@ -115411,8 +116019,8 @@ function readActiveCollab() {
115411
116019
  return info;
115412
116020
  }
115413
116021
  function tryAcquireCollabLock(args) {
115414
- const path61 = collabLockPath();
115415
- mkdirSync(dirname(path61), { recursive: true });
116022
+ const path63 = collabLockPath();
116023
+ mkdirSync(dirname(path63), { recursive: true });
115416
116024
  const info = {
115417
116025
  pid: process.pid,
115418
116026
  sessionId: args.sessionId,
@@ -115423,7 +116031,7 @@ function tryAcquireCollabLock(args) {
115423
116031
  const payload = JSON.stringify(info);
115424
116032
  for (let attempt = 0; attempt < 5; attempt++) {
115425
116033
  try {
115426
- const fd = openSync(path61, "wx");
116034
+ const fd = openSync(path63, "wx");
115427
116035
  try {
115428
116036
  writeFileSync(fd, payload);
115429
116037
  } finally {
@@ -115438,7 +116046,7 @@ function tryAcquireCollabLock(args) {
115438
116046
  return { ok: false, holder: existing };
115439
116047
  }
115440
116048
  try {
115441
- unlinkSync(path61);
116049
+ unlinkSync(path63);
115442
116050
  } catch {
115443
116051
  }
115444
116052
  }
@@ -115791,11 +116399,11 @@ function lastUserPromptText(ctx) {
115791
116399
  }
115792
116400
  return void 0;
115793
116401
  }
115794
- function readRoster(path61, maxAgents) {
115795
- if (!existsSync(path61))
116402
+ function readRoster(path63, maxAgents) {
116403
+ if (!existsSync(path63))
115796
116404
  return [];
115797
116405
  try {
115798
- const raw = JSON.parse(readFileSync(path61, "utf8"));
116406
+ const raw = JSON.parse(readFileSync(path63, "utf8"));
115799
116407
  if (!Array.isArray(raw))
115800
116408
  return [];
115801
116409
  const seen = /* @__PURE__ */ new Set();
@@ -116277,11 +116885,11 @@ var collabArchitectMode = defineMode({
116277
116885
  run: (ctx) => runCollabAgentLoop(ctx, { systemPrompt: COLLAB_ARCHITECT_PROMPT })
116278
116886
  });
116279
116887
  function peerSystemPrompt(env3) {
116280
- const path61 = env3[COLLAB_ENV.CharterFile]?.trim();
116281
- if (!path61)
116888
+ const path63 = env3[COLLAB_ENV.CharterFile]?.trim();
116889
+ if (!path63)
116282
116890
  return COLLAB_PEER_PROMPT;
116283
116891
  try {
116284
- return peerPromptWithCharter(readFileSync(path61, "utf8"));
116892
+ return peerPromptWithCharter(readFileSync(path63, "utf8"));
116285
116893
  } catch {
116286
116894
  return COLLAB_PEER_PROMPT;
116287
116895
  }
@@ -116550,7 +117158,7 @@ var stablePrefixCacheStrategyPlugin = definePlugin({
116550
117158
  });
116551
117159
 
116552
117160
  // src/setup/builtin-entries.ts
116553
- await init_dist11();
117161
+ await init_dist12();
116554
117162
 
116555
117163
  // ../ipc-server-ws/dist/ws-transport.js
116556
117164
  init_wrapper();
@@ -116957,6 +117565,7 @@ var ipcInputSchemas = {
116957
117565
  "provider.login.answer": z.object({ loginId, value: z.string().max(8192) }),
116958
117566
  "provider.login.cancel": z.object({ loginId }),
116959
117567
  "session.transcribe": z.object({
117568
+ workspaceId: optionalWorkspace,
116960
117569
  audioBase64: base64,
116961
117570
  mimeType: z.string().max(128).optional()
116962
117571
  }),
@@ -118235,8 +118844,8 @@ function buildConnectUrl(opts) {
118235
118844
  if (opts.tunnelUrl) {
118236
118845
  const u2 = new URL(opts.tunnelUrl);
118237
118846
  const scheme = u2.protocol === "https:" ? "wss" : "ws";
118238
- const path61 = u2.pathname === "/" ? "/" : `${u2.pathname.replace(/\/$/, "")}/`;
118239
- return `${scheme}://${u2.host}${path61}?t=${t2}${fp}`;
118847
+ const path63 = u2.pathname === "/" ? "/" : `${u2.pathname.replace(/\/$/, "")}/`;
118848
+ return `${scheme}://${u2.host}${path63}?t=${t2}${fp}`;
118240
118849
  }
118241
118850
  return `ws://${opts.localHost}:${opts.port}/?t=${t2}${fp}`;
118242
118851
  }
@@ -118787,6 +119396,12 @@ function pickExpoOptions(opts) {
118787
119396
  var mobileChannelDef = defineChannel({
118788
119397
  name: "mobile",
118789
119398
  description: "WebSocket bridge for the moxxy mobile app (Expo) \u2014 serves the IPC contract backed by this session.",
119399
+ // Unlike telegram/slack, mobile is NOT dedicated — it self-hosts the runner's
119400
+ // single session. But `moxxy mobile` still owns that session, so stamp its
119401
+ // origin explicitly: otherwise the runner's env-heuristic persistence records
119402
+ // the empty pre-first-prompt session as `tui`, dropping it from the mobile
119403
+ // list until the first prompt. The CLI honors this for the launched channel.
119404
+ sessionSource: "mobile",
118790
119405
  create: (deps) => new MobileChannel({
118791
119406
  port: asNumber(deps.options?.port),
118792
119407
  bindHost: asString2(deps.options?.bindHost),
@@ -119674,8 +120289,8 @@ function formatIssues(error2, raw) {
119674
120289
  const field = rest.join(".");
119675
120290
  return field ? `${where}: ${field} ${msg}` : `${where} ${msg}`;
119676
120291
  }
119677
- const path61 = iss.path.join(".");
119678
- return path61 ? `${path61} ${msg}` : `workflow ${msg}`;
120292
+ const path63 = iss.path.join(".");
120293
+ return path63 ? `${path63} ${msg}` : `workflow ${msg}`;
119679
120294
  });
119680
120295
  }
119681
120296
  function validateWorkflow(raw) {
@@ -123250,13 +123865,13 @@ var MultipartBody2 = class {
123250
123865
  }
123251
123866
  };
123252
123867
  var fileFromPathWarned2 = false;
123253
- async function fileFromPath5(path61, ...args) {
123868
+ async function fileFromPath5(path63, ...args) {
123254
123869
  const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
123255
123870
  if (!fileFromPathWarned2) {
123256
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path61)}) instead`);
123871
+ console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path63)}) instead`);
123257
123872
  fileFromPathWarned2 = true;
123258
123873
  }
123259
- return await _fileFromPath(path61, ...args);
123874
+ return await _fileFromPath(path63, ...args);
123260
123875
  }
123261
123876
  var defaultHttpAgent2 = new import_agentkeepalive2.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
123262
123877
  var defaultHttpsAgent2 = new import_agentkeepalive2.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
@@ -124034,29 +124649,29 @@ var APIClient2 = class {
124034
124649
  defaultIdempotencyKey() {
124035
124650
  return `stainless-node-retry-${uuid42()}`;
124036
124651
  }
124037
- get(path61, opts) {
124038
- return this.methodRequest("get", path61, opts);
124652
+ get(path63, opts) {
124653
+ return this.methodRequest("get", path63, opts);
124039
124654
  }
124040
- post(path61, opts) {
124041
- return this.methodRequest("post", path61, opts);
124655
+ post(path63, opts) {
124656
+ return this.methodRequest("post", path63, opts);
124042
124657
  }
124043
- patch(path61, opts) {
124044
- return this.methodRequest("patch", path61, opts);
124658
+ patch(path63, opts) {
124659
+ return this.methodRequest("patch", path63, opts);
124045
124660
  }
124046
- put(path61, opts) {
124047
- return this.methodRequest("put", path61, opts);
124661
+ put(path63, opts) {
124662
+ return this.methodRequest("put", path63, opts);
124048
124663
  }
124049
- delete(path61, opts) {
124050
- return this.methodRequest("delete", path61, opts);
124664
+ delete(path63, opts) {
124665
+ return this.methodRequest("delete", path63, opts);
124051
124666
  }
124052
- methodRequest(method, path61, opts) {
124667
+ methodRequest(method, path63, opts) {
124053
124668
  return this.request(Promise.resolve(opts).then(async (opts2) => {
124054
124669
  const body = opts2 && isBlobLike2(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body;
124055
- return { method, path: path61, ...opts2, body };
124670
+ return { method, path: path63, ...opts2, body };
124056
124671
  }));
124057
124672
  }
124058
- getAPIList(path61, Page3, opts) {
124059
- return this.requestAPIList(Page3, { method: "get", path: path61, ...opts });
124673
+ getAPIList(path63, Page3, opts) {
124674
+ return this.requestAPIList(Page3, { method: "get", path: path63, ...opts });
124060
124675
  }
124061
124676
  calculateContentLength(body) {
124062
124677
  if (typeof body === "string") {
@@ -124075,10 +124690,10 @@ var APIClient2 = class {
124075
124690
  }
124076
124691
  buildRequest(inputOptions, { retryCount = 0 } = {}) {
124077
124692
  const options = { ...inputOptions };
124078
- const { method, path: path61, query, headers = {} } = options;
124693
+ const { method, path: path63, query, headers = {} } = options;
124079
124694
  const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody2(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null;
124080
124695
  const contentLength = this.calculateContentLength(body);
124081
- const url2 = this.buildURL(path61, query);
124696
+ const url2 = this.buildURL(path63, query);
124082
124697
  if ("timeout" in options)
124083
124698
  validatePositiveInteger2("timeout", options.timeout);
124084
124699
  options.timeout = options.timeout ?? this.timeout;
@@ -124182,10 +124797,10 @@ var APIClient2 = class {
124182
124797
  }
124183
124798
  const errText = await response.text().catch((e3) => castToError2(e3).message);
124184
124799
  const errJSON = safeJSON2(errText);
124185
- const errMessage2 = errJSON ? void 0 : errText;
124800
+ const errMessage3 = errJSON ? void 0 : errText;
124186
124801
  const retryMessage = retriesRemaining ? `(error; no more retries left)` : `(error; not retryable)`;
124187
- debug2(`response (error; ${retryMessage})`, response.status, url2, responseHeaders, errMessage2);
124188
- const err = this.makeStatusError(response.status, errJSON, errMessage2, responseHeaders);
124802
+ debug2(`response (error; ${retryMessage})`, response.status, url2, responseHeaders, errMessage3);
124803
+ const err = this.makeStatusError(response.status, errJSON, errMessage3, responseHeaders);
124189
124804
  throw err;
124190
124805
  }
124191
124806
  return { response, options, controller };
@@ -124194,8 +124809,8 @@ var APIClient2 = class {
124194
124809
  const request = this.makeRequest(options, null);
124195
124810
  return new PagePromise2(this, request, Page3);
124196
124811
  }
124197
- buildURL(path61, query) {
124198
- const url2 = isAbsoluteURL2(path61) ? new URL(path61) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path61.startsWith("/") ? path61.slice(1) : path61));
124812
+ buildURL(path63, query) {
124813
+ const url2 = isAbsoluteURL2(path63) ? new URL(path63) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path63.startsWith("/") ? path63.slice(1) : path63));
124199
124814
  const defaultQuery = this.defaultQuery();
124200
124815
  if (!isEmptyObj2(defaultQuery)) {
124201
124816
  query = { ...defaultQuery, ...query };
@@ -130361,7 +130976,7 @@ async function validateProviderKey(providerName2, key, providers) {
130361
130976
  }
130362
130977
 
130363
130978
  // src/wizard/auth-context.ts
130364
- init_dist15();
130979
+ init_dist16();
130365
130980
  function buildProviderAuthContext(vault, opts) {
130366
130981
  const prompt = opts.promptMode === "stdin" ? makeStdinLinePrompt(opts.stdin ?? process.stdin) : opts.headless ? void 0 : clackPrompt;
130367
130982
  return {
@@ -130938,10 +131553,10 @@ async function readStdinIfPiped() {
130938
131553
  }
130939
131554
 
130940
131555
  // src/commands/run-tui.ts
130941
- await init_dist11();
131556
+ await init_dist12();
130942
131557
  init_dist2();
130943
131558
  await init_build2();
130944
- var import_react73 = __toESM(require_react());
131559
+ var import_react74 = __toESM(require_react());
130945
131560
  var REMOTE_CHANNELS = /* @__PURE__ */ new Set(["telegram"]);
130946
131561
  async function coAttachWebSurface(opts) {
130947
131562
  const { primary, session, vault, config } = opts;
@@ -131148,8 +131763,8 @@ function formatCmd(cmd) {
131148
131763
  }
131149
131764
 
131150
131765
  // src/wizard/run-setup-wizard.ts
131151
- init_dist15();
131152
- await init_dist11();
131766
+ init_dist16();
131767
+ await init_dist12();
131153
131768
  function authKind(authKinds, providerId) {
131154
131769
  return authKinds?.[providerId] ?? "apiKey";
131155
131770
  }
@@ -131369,7 +131984,7 @@ async function collectKey(providerId, controller) {
131369
131984
  }
131370
131985
 
131371
131986
  // src/wizard/plugin-setup-steps.ts
131372
- init_dist15();
131987
+ init_dist16();
131373
131988
  init_dist2();
131374
131989
  init_dist3();
131375
131990
  async function runPluginSetupSteps(opts) {
@@ -131441,7 +132056,7 @@ init_dist3();
131441
132056
  init_dist2();
131442
132057
 
131443
132058
  // src/logo.ts
131444
- await init_dist11();
132059
+ await init_dist12();
131445
132060
  var fade = (s2) => colors.dim(colors.gray(s2));
131446
132061
  function renderLogo(width = process.stdout.columns ?? 80, opts = {}) {
131447
132062
  const { center = false } = opts;
@@ -131452,7 +132067,7 @@ function renderLogo(width = process.stdout.columns ?? 80, opts = {}) {
131452
132067
  }
131453
132068
 
131454
132069
  // src/commands/init.ts
131455
- init_dist15();
132070
+ init_dist16();
131456
132071
  async function runInitCommand(argv) {
131457
132072
  const interactive = Boolean(process.stdin.isTTY);
131458
132073
  const { session, vault, persistence } = await bootSessionWithConfig(argv, {
@@ -131783,7 +132398,7 @@ async function runAttachedTui(argv, tuiOpts) {
131783
132398
  await remote.close().catch(() => void 0);
131784
132399
  };
131785
132400
  const instance = render_default(
131786
- import_react73.default.createElement(InteractiveSession, {
132401
+ import_react74.default.createElement(InteractiveSession, {
131787
132402
  session: remote,
131788
132403
  registerInteractiveResolver: (handler) => {
131789
132404
  promptHandler = handler;
@@ -131985,7 +132600,7 @@ async function runSelfHostedTui(argv, tuiOpts, standalone) {
131985
132600
  }
131986
132601
  };
131987
132602
  const { waitUntilExit } = render_default(
131988
- import_react73.default.createElement(InteractiveSession, {
132603
+ import_react74.default.createElement(InteractiveSession, {
131989
132604
  bootstrap: async (progress) => bootSession2(
131990
132605
  tuiOpts.resumeSessionId ? { resumeSessionId: tuiOpts.resumeSessionId } : {},
131991
132606
  progress
@@ -132623,7 +133238,7 @@ Re-run with --yes to accept its capability surface, or enable it later with \`mo
132623
133238
  );
132624
133239
  return 0;
132625
133240
  }
132626
- const { confirm, isCancel } = await Promise.resolve().then(() => (init_dist15(), dist_exports5));
133241
+ const { confirm, isCancel } = await Promise.resolve().then(() => (init_dist16(), dist_exports5));
132627
133242
  const keep = await confirm({
132628
133243
  message: `${packageName} is third-party code. Keep it enabled with this capability surface?`,
132629
133244
  initialValue: false
@@ -132829,6 +133444,9 @@ async function startRegisteredChannel(name, argv, dedicated = {}) {
132829
133444
  return runSelfHostedChannel(name, argv, mode === "standalone", isDedicated);
132830
133445
  }
132831
133446
  function applyDedicatedRunnerEnv(name, argv, opts) {
133447
+ if (!process.env.MOXXY_SESSION_SOURCE && opts.sessionSource) {
133448
+ process.env.MOXXY_SESSION_SOURCE = opts.sessionSource;
133449
+ }
132832
133450
  const dedicated = opts.dedicatedRunner === true || hasBoolFlag(argv, "dedicated") || process.env.MOXXY_DEDICATED_RUNNER === "1";
132833
133451
  if (!dedicated) return false;
132834
133452
  if (!process.env.MOXXY_RUNNER_SOCKET) {
@@ -132840,9 +133458,6 @@ function applyDedicatedRunnerEnv(name, argv, opts) {
132840
133458
  if (!process.env.MOXXY_SESSION_ID) {
132841
133459
  process.env.MOXXY_SESSION_ID = `moxxy-channel-${name}`;
132842
133460
  }
132843
- if (!process.env.MOXXY_SESSION_SOURCE && opts.sessionSource) {
132844
- process.env.MOXXY_SESSION_SOURCE = opts.sessionSource;
132845
- }
132846
133461
  return true;
132847
133462
  }
132848
133463
  async function runAttachedChannel(name, argv) {
@@ -133068,6 +133683,7 @@ async function runChannelsCommand(argv) {
133068
133683
  if (name === "status") return runStatus(argv.positional[1]);
133069
133684
  if (name === "start") return runStart(argv);
133070
133685
  if (name === "stop") return runStop(argv);
133686
+ if (name === "rotate-token") return runRotateToken(argv);
133071
133687
  const outcome = await probeSession(
133072
133688
  argvToSetupOptions(argv, {
133073
133689
  skipKeyPrompt: true,
@@ -133286,6 +133902,24 @@ async function runStop(argv) {
133286
133902
  `);
133287
133903
  return 0;
133288
133904
  }
133905
+ async function runRotateToken(argv) {
133906
+ const channelName = argv.positional[1];
133907
+ if (!channelName) {
133908
+ printError("usage: moxxy channels rotate-token <name>");
133909
+ return 2;
133910
+ }
133911
+ const fileName = `${channelName}-token`;
133912
+ rotateChannelToken({ fileName });
133913
+ const file = path3__default.join(moxxyHome(), fileName);
133914
+ process.stdout.write(
133915
+ `${colors.bold(channelName)} ${colors.dim("pairing token rotated")}
133916
+ ${colors.dim(`new secret written to ${file}`)}
133917
+ ${colors.dim("The old token no longer authenticates \u2014 every paired client must re-pair.")}
133918
+ ${colors.dim(`Restart the channel (\`moxxy channels stop/start ${channelName}\`) for the new token to take effect.`)}
133919
+ `
133920
+ );
133921
+ return 0;
133922
+ }
133289
133923
  var START_TIMEOUT_MS2 = 15e3;
133290
133924
  var STOP_GRACE_MS2 = 4e3;
133291
133925
  var POLL_MS2 = 300;
@@ -133349,7 +133983,7 @@ function formatSubcommandHelp(channelName, subName, sub) {
133349
133983
  }
133350
133984
 
133351
133985
  // src/commands/onboard.ts
133352
- init_dist15();
133986
+ init_dist16();
133353
133987
  init_dist2();
133354
133988
  init_dist3();
133355
133989
  function servicePlatform() {
@@ -133357,11 +133991,11 @@ function servicePlatform() {
133357
133991
  if (process.platform === "linux") return "linux";
133358
133992
  return "unsupported";
133359
133993
  }
133360
- function moxxyHome3() {
133994
+ function moxxyHome4() {
133361
133995
  return process.env.MOXXY_HOME ?? path3__default.join(homedir(), ".moxxy");
133362
133996
  }
133363
133997
  function serviceLogPath(spec) {
133364
- return path3__default.join(moxxyHome3(), "services", `${spec.id}.log`);
133998
+ return path3__default.join(moxxyHome4(), "services", `${spec.id}.log`);
133365
133999
  }
133366
134000
  function nodeBin() {
133367
134001
  return process.execPath;
@@ -134474,7 +135108,7 @@ async function runPermsCommand(argv) {
134474
135108
  const [{ render: render2 }, React57, { PermissionEditor: PermissionEditor2 }] = await Promise.all([
134475
135109
  init_build2().then(() => build_exports),
134476
135110
  Promise.resolve().then(() => __toESM(require_react())),
134477
- init_dist11().then(() => dist_exports4)
135111
+ init_dist12().then(() => dist_exports4)
134478
135112
  ]);
134479
135113
  const { waitUntilExit } = render2(
134480
135114
  React57.createElement(PermissionEditor2, { policyPath: policyPath() })
@@ -136303,7 +136937,7 @@ function formatRelative(d2) {
136303
136937
  }
136304
136938
 
136305
136939
  // src/commands/mcp.ts
136306
- init_dist10();
136940
+ init_dist11();
136307
136941
  var HELP10 = formatHelp({
136308
136942
  title: "moxxy mcp",
136309
136943
  tagline: "manage Model Context Protocol servers",
@@ -136841,7 +137475,7 @@ async function runScheduleCommand(argv) {
136841
137475
  }
136842
137476
 
136843
137477
  // src/commands/doctor.ts
136844
- await init_dist11();
137478
+ await init_dist12();
136845
137479
  var CODEX_TRANSCRIBER_NAME2 = "openai-codex-transcribe";
136846
137480
  var CODEX_PROVIDER_NAME = "openai-codex";
136847
137481
  var CODEX_AUTH_RUNTIME = "auth:provider:openai-codex";
@@ -137401,7 +138035,7 @@ async function runLoginLogout(providerName2, session, vault) {
137401
138035
  init_dist();
137402
138036
 
137403
138037
  // src/commands/sessions.ts
137404
- init_dist15();
138038
+ init_dist16();
137405
138039
  init_dist();
137406
138040
  var HELP12 = formatHelp({
137407
138041
  title: "moxxy sessions",
@@ -138234,7 +138868,7 @@ ${HELP15}`);
138234
138868
  }
138235
138869
 
138236
138870
  // src/commands/update.ts
138237
- init_dist15();
138871
+ init_dist16();
138238
138872
  var HELP16 = formatHelp({
138239
138873
  title: "moxxy update",
138240
138874
  tagline: "update the moxxy CLI to the latest published version",
@@ -138345,7 +138979,7 @@ async function defaultConfirm(message) {
138345
138979
  }
138346
138980
 
138347
138981
  // src/bin.ts
138348
- await init_dist11();
138982
+ await init_dist12();
138349
138983
  function formatErrorForCli(err, opts = {}) {
138350
138984
  if (err && err.name === "VaultPassphraseError") {
138351
138985
  return colors.red(err.message);
@@ -138454,6 +139088,7 @@ var SECTIONS = [
138454
139088
  ["channels", "list registered channels + their subcommands"],
138455
139089
  ["channels start|stop <name>", "run a channel detached on its own runner (or stop it)"],
138456
139090
  ["channels status [name]", "list the detached channels currently running"],
139091
+ ["channels rotate-token <name>", "rotate a channel's persisted pairing secret (clients re-pair)"],
138457
139092
  ["channels <name>", "start a channel by name in the foreground (same as `moxxy <name>`)"],
138458
139093
  ["channels <name> <sub>", "invoke a channel-defined subcommand"],
138459
139094
  ["serve [--except <list>]", "run every channel + background daemon in ONE process"]