@moxxy/cli 0.5.5 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { z as z$1, defineProvider, definePlugin, defineTool, MoxxyError, writeFileAtomic, asTurnId, defineMode, asPluginId, defineChannel, defineTunnelProvider, createMutex, defineWorkflowExecutor, toFriendlyError, estimateTextTokens, classifyHttpStatus, createStuckLoopDetector, runCompactionIfNeeded, runElisionIfNeeded, collectProviderStream, usageEventFields, isContextOverflowError, emitRequestsAndDetectStuck, executeToolUses, buildSystemPromptWithSkills, projectMessages, defineCompactor, defineCacheStrategy, denyByDefaultResolver, createAllowListResolver, zodToJsonSchema, runSingleShotTurn, bearerTokenMatches, estimateContextTokens, readRequestBody, moxxyPath, defineEmbedder, skillFrontmatterSchema, asSkillId, getInstallHint, moxxyHome, defineTranscriber, summarizeTokensByModel, migrateModeName, createDeferredPermissionResolver, classifyNetworkError, addModelTotals, ISOLATION_RANK, moxxyPackageSchema, defineCommand, createCallbackResolver, autoAllowResolver, asSessionId, asToolCallId, defineViewRenderer, DEFAULT_VIEW_TAGS, evaluateToolRule, summarizeSessionTokensFromEvents, asEventId } from '@moxxy/sdk';
4
4
  import * as fs37 from 'fs';
5
- import fs37__default, { existsSync, promises, ReadStream, readFileSync, statSync, readdirSync, mkdirSync, writeFileSync, unlinkSync, watch, createReadStream } from 'fs';
5
+ import fs37__default, { existsSync, promises, ReadStream, readFileSync, statSync, readdirSync, mkdirSync, writeFileSync, unlinkSync, renameSync, watch, createReadStream } from 'fs';
6
6
  import * as path3 from 'path';
7
7
  import path3__default, { basename } from 'path';
8
8
  import { z } from 'zod';
@@ -2140,8 +2140,8 @@ var init_tools2 = __esm({
2140
2140
  const parseResult = tool.inputSchema.safeParse(input);
2141
2141
  if (!parseResult.success) {
2142
2142
  const issues = parseResult.error.issues.map((iss) => {
2143
- const path58 = iss.path.length ? iss.path.join(".") : "(root)";
2144
- return `${path58}: ${iss.message}`;
2143
+ const path59 = iss.path.length ? iss.path.join(".") : "(root)";
2144
+ return `${path59}: ${iss.message}`;
2145
2145
  }).join("; ");
2146
2146
  throw new Error(`Invalid input for ${name}: ${issues}`);
2147
2147
  }
@@ -7338,11 +7338,11 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
7338
7338
  return e6;
7339
7339
  })(l3, t4);
7340
7340
  }
7341
- function fileURLToPath9(e5) {
7341
+ function fileURLToPath10(e5) {
7342
7342
  return "string" != typeof e5 || e5.startsWith("file://") ? normalizeSlash((0, Qe2.fileURLToPath)(e5)) : normalizeSlash(e5);
7343
7343
  }
7344
7344
  function pathToFileURL3(e5) {
7345
- return (0, Qe2.pathToFileURL)(fileURLToPath9(e5)).toString();
7345
+ return (0, Qe2.pathToFileURL)(fileURLToPath10(e5)).toString();
7346
7346
  }
7347
7347
  const Ut2 = /* @__PURE__ */ new Set(["node", "import"]), Mt3 = [".mjs", ".cjs", ".js", ".json"], jt3 = /* @__PURE__ */ new Set(["ERR_MODULE_NOT_FOUND", "ERR_UNSUPPORTED_DIR_IMPORT", "MODULE_NOT_FOUND", "ERR_PACKAGE_PATH_NOT_EXPORTED"]);
7348
7348
  function _tryModuleResolve(e5, t4, i3) {
@@ -7355,11 +7355,11 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
7355
7355
  function _resolve(e5, t4 = {}) {
7356
7356
  if ("string" != typeof e5) {
7357
7357
  if (!(e5 instanceof URL)) throw new TypeError("input must be a `string` or `URL`");
7358
- e5 = fileURLToPath9(e5);
7358
+ e5 = fileURLToPath10(e5);
7359
7359
  }
7360
7360
  if (/(?:node|data|http|https):/.test(e5)) return e5;
7361
7361
  if (st3.has(e5)) return "node:" + e5;
7362
- if (e5.startsWith("file://") && (e5 = fileURLToPath9(e5)), isAbsolute3(e5)) try {
7362
+ if (e5.startsWith("file://") && (e5 = fileURLToPath10(e5)), isAbsolute3(e5)) try {
7363
7363
  if ((0, $e2.statSync)(e5).isFile()) return pathToFileURL3(e5);
7364
7364
  } catch (e6) {
7365
7365
  if ("ENOENT" !== e6?.code) throw e6;
@@ -7389,7 +7389,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
7389
7389
  return _resolve(e5, t4);
7390
7390
  }
7391
7391
  function resolvePathSync(e5, t4) {
7392
- return fileURLToPath9(resolveSync(e5, t4));
7392
+ return fileURLToPath10(resolveSync(e5, t4));
7393
7393
  }
7394
7394
  const Ft2 = /(?:[\s;]|^)(?:import[\s\w*,{}]*from|import\s*["'*{]|export\b\s*(?:[*{]|default|class|type|function|const|var|let|async function)|import\.meta\b)/m, Bt2 = /\/\*.+?\*\/|\/\/.*(?=[nr])/g;
7395
7395
  function hasESMSyntax(e5, t4 = {}) {
@@ -7546,7 +7546,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
7546
7546
  }
7547
7547
  function tryNativeRequireResolve(e5, t4, i3, n3) {
7548
7548
  try {
7549
- return e5.nativeRequire.resolve(t4, { ...n3, paths: [pathe_M_eThtNZ_dirname(fileURLToPath9(i3)), ...n3?.paths || []] });
7549
+ return e5.nativeRequire.resolve(t4, { ...n3, paths: [pathe_M_eThtNZ_dirname(fileURLToPath10(i3)), ...n3?.paths || []] });
7550
7550
  } catch {
7551
7551
  }
7552
7552
  }
@@ -7736,7 +7736,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
7736
7736
  const i4 = {};
7737
7737
  return void 0 !== e6.cache && (i4.fsCache = e6.cache), void 0 !== e6.requireCache && (i4.moduleCache = e6.requireCache), { ...t5, ...i4, ...e6 };
7738
7738
  })(t4);
7739
- "string" == typeof e5 && e5.startsWith("file://") && (e5 = fileURLToPath9(e5));
7739
+ "string" == typeof e5 && e5.startsWith("file://") && (e5 = fileURLToPath10(e5));
7740
7740
  const c3 = a3.alias && Object.keys(a3.alias).length > 0 ? normalizeAliases(a3.alias || {}) : void 0;
7741
7741
  let l3;
7742
7742
  if (a3.tsconfigPaths) {
@@ -8054,17 +8054,17 @@ var require_visit = __commonJS({
8054
8054
  visit.BREAK = BREAK;
8055
8055
  visit.SKIP = SKIP;
8056
8056
  visit.REMOVE = REMOVE;
8057
- function visit_(key, node, visitor, path58) {
8058
- const ctrl = callVisitor(key, node, visitor, path58);
8057
+ function visit_(key, node, visitor, path59) {
8058
+ const ctrl = callVisitor(key, node, visitor, path59);
8059
8059
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
8060
- replaceNode(key, path58, ctrl);
8061
- return visit_(key, ctrl, visitor, path58);
8060
+ replaceNode(key, path59, ctrl);
8061
+ return visit_(key, ctrl, visitor, path59);
8062
8062
  }
8063
8063
  if (typeof ctrl !== "symbol") {
8064
8064
  if (identity.isCollection(node)) {
8065
- path58 = Object.freeze(path58.concat(node));
8065
+ path59 = Object.freeze(path59.concat(node));
8066
8066
  for (let i2 = 0; i2 < node.items.length; ++i2) {
8067
- const ci = visit_(i2, node.items[i2], visitor, path58);
8067
+ const ci = visit_(i2, node.items[i2], visitor, path59);
8068
8068
  if (typeof ci === "number")
8069
8069
  i2 = ci - 1;
8070
8070
  else if (ci === BREAK)
@@ -8075,13 +8075,13 @@ var require_visit = __commonJS({
8075
8075
  }
8076
8076
  }
8077
8077
  } else if (identity.isPair(node)) {
8078
- path58 = Object.freeze(path58.concat(node));
8079
- const ck = visit_("key", node.key, visitor, path58);
8078
+ path59 = Object.freeze(path59.concat(node));
8079
+ const ck = visit_("key", node.key, visitor, path59);
8080
8080
  if (ck === BREAK)
8081
8081
  return BREAK;
8082
8082
  else if (ck === REMOVE)
8083
8083
  node.key = null;
8084
- const cv = visit_("value", node.value, visitor, path58);
8084
+ const cv = visit_("value", node.value, visitor, path59);
8085
8085
  if (cv === BREAK)
8086
8086
  return BREAK;
8087
8087
  else if (cv === REMOVE)
@@ -8102,17 +8102,17 @@ var require_visit = __commonJS({
8102
8102
  visitAsync.BREAK = BREAK;
8103
8103
  visitAsync.SKIP = SKIP;
8104
8104
  visitAsync.REMOVE = REMOVE;
8105
- async function visitAsync_(key, node, visitor, path58) {
8106
- const ctrl = await callVisitor(key, node, visitor, path58);
8105
+ async function visitAsync_(key, node, visitor, path59) {
8106
+ const ctrl = await callVisitor(key, node, visitor, path59);
8107
8107
  if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
8108
- replaceNode(key, path58, ctrl);
8109
- return visitAsync_(key, ctrl, visitor, path58);
8108
+ replaceNode(key, path59, ctrl);
8109
+ return visitAsync_(key, ctrl, visitor, path59);
8110
8110
  }
8111
8111
  if (typeof ctrl !== "symbol") {
8112
8112
  if (identity.isCollection(node)) {
8113
- path58 = Object.freeze(path58.concat(node));
8113
+ path59 = Object.freeze(path59.concat(node));
8114
8114
  for (let i2 = 0; i2 < node.items.length; ++i2) {
8115
- const ci = await visitAsync_(i2, node.items[i2], visitor, path58);
8115
+ const ci = await visitAsync_(i2, node.items[i2], visitor, path59);
8116
8116
  if (typeof ci === "number")
8117
8117
  i2 = ci - 1;
8118
8118
  else if (ci === BREAK)
@@ -8123,13 +8123,13 @@ var require_visit = __commonJS({
8123
8123
  }
8124
8124
  }
8125
8125
  } else if (identity.isPair(node)) {
8126
- path58 = Object.freeze(path58.concat(node));
8127
- const ck = await visitAsync_("key", node.key, visitor, path58);
8126
+ path59 = Object.freeze(path59.concat(node));
8127
+ const ck = await visitAsync_("key", node.key, visitor, path59);
8128
8128
  if (ck === BREAK)
8129
8129
  return BREAK;
8130
8130
  else if (ck === REMOVE)
8131
8131
  node.key = null;
8132
- const cv = await visitAsync_("value", node.value, visitor, path58);
8132
+ const cv = await visitAsync_("value", node.value, visitor, path59);
8133
8133
  if (cv === BREAK)
8134
8134
  return BREAK;
8135
8135
  else if (cv === REMOVE)
@@ -8156,23 +8156,23 @@ var require_visit = __commonJS({
8156
8156
  }
8157
8157
  return visitor;
8158
8158
  }
8159
- function callVisitor(key, node, visitor, path58) {
8159
+ function callVisitor(key, node, visitor, path59) {
8160
8160
  if (typeof visitor === "function")
8161
- return visitor(key, node, path58);
8161
+ return visitor(key, node, path59);
8162
8162
  if (identity.isMap(node))
8163
- return visitor.Map?.(key, node, path58);
8163
+ return visitor.Map?.(key, node, path59);
8164
8164
  if (identity.isSeq(node))
8165
- return visitor.Seq?.(key, node, path58);
8165
+ return visitor.Seq?.(key, node, path59);
8166
8166
  if (identity.isPair(node))
8167
- return visitor.Pair?.(key, node, path58);
8167
+ return visitor.Pair?.(key, node, path59);
8168
8168
  if (identity.isScalar(node))
8169
- return visitor.Scalar?.(key, node, path58);
8169
+ return visitor.Scalar?.(key, node, path59);
8170
8170
  if (identity.isAlias(node))
8171
- return visitor.Alias?.(key, node, path58);
8171
+ return visitor.Alias?.(key, node, path59);
8172
8172
  return void 0;
8173
8173
  }
8174
- function replaceNode(key, path58, node) {
8175
- const parent = path58[path58.length - 1];
8174
+ function replaceNode(key, path59, node) {
8175
+ const parent = path59[path59.length - 1];
8176
8176
  if (identity.isCollection(parent)) {
8177
8177
  parent.items[key] = node;
8178
8178
  } else if (identity.isPair(parent)) {
@@ -8773,10 +8773,10 @@ var require_Collection = __commonJS({
8773
8773
  var createNode2 = require_createNode();
8774
8774
  var identity = require_identity();
8775
8775
  var Node = require_Node();
8776
- function collectionFromPath(schema, path58, value) {
8776
+ function collectionFromPath(schema, path59, value) {
8777
8777
  let v3 = value;
8778
- for (let i2 = path58.length - 1; i2 >= 0; --i2) {
8779
- const k3 = path58[i2];
8778
+ for (let i2 = path59.length - 1; i2 >= 0; --i2) {
8779
+ const k3 = path59[i2];
8780
8780
  if (typeof k3 === "number" && Number.isInteger(k3) && k3 >= 0) {
8781
8781
  const a2 = [];
8782
8782
  a2[k3] = v3;
@@ -8795,7 +8795,7 @@ var require_Collection = __commonJS({
8795
8795
  sourceObjects: /* @__PURE__ */ new Map()
8796
8796
  });
8797
8797
  }
8798
- var isEmptyPath = (path58) => path58 == null || typeof path58 === "object" && !!path58[Symbol.iterator]().next().done;
8798
+ var isEmptyPath = (path59) => path59 == null || typeof path59 === "object" && !!path59[Symbol.iterator]().next().done;
8799
8799
  var Collection = class extends Node.NodeBase {
8800
8800
  constructor(type, schema) {
8801
8801
  super(type);
@@ -8825,11 +8825,11 @@ var require_Collection = __commonJS({
8825
8825
  * be a Pair instance or a `{ key, value }` object, which may not have a key
8826
8826
  * that already exists in the map.
8827
8827
  */
8828
- addIn(path58, value) {
8829
- if (isEmptyPath(path58))
8828
+ addIn(path59, value) {
8829
+ if (isEmptyPath(path59))
8830
8830
  this.add(value);
8831
8831
  else {
8832
- const [key, ...rest] = path58;
8832
+ const [key, ...rest] = path59;
8833
8833
  const node = this.get(key, true);
8834
8834
  if (identity.isCollection(node))
8835
8835
  node.addIn(rest, value);
@@ -8843,8 +8843,8 @@ var require_Collection = __commonJS({
8843
8843
  * Removes a value from the collection.
8844
8844
  * @returns `true` if the item was found and removed.
8845
8845
  */
8846
- deleteIn(path58) {
8847
- const [key, ...rest] = path58;
8846
+ deleteIn(path59) {
8847
+ const [key, ...rest] = path59;
8848
8848
  if (rest.length === 0)
8849
8849
  return this.delete(key);
8850
8850
  const node = this.get(key, true);
@@ -8858,8 +8858,8 @@ var require_Collection = __commonJS({
8858
8858
  * scalar values from their surrounding node; to disable set `keepScalar` to
8859
8859
  * `true` (collections are always returned intact).
8860
8860
  */
8861
- getIn(path58, keepScalar) {
8862
- const [key, ...rest] = path58;
8861
+ getIn(path59, keepScalar) {
8862
+ const [key, ...rest] = path59;
8863
8863
  const node = this.get(key, true);
8864
8864
  if (rest.length === 0)
8865
8865
  return !keepScalar && identity.isScalar(node) ? node.value : node;
@@ -8877,8 +8877,8 @@ var require_Collection = __commonJS({
8877
8877
  /**
8878
8878
  * Checks if the collection includes a value with the key `key`.
8879
8879
  */
8880
- hasIn(path58) {
8881
- const [key, ...rest] = path58;
8880
+ hasIn(path59) {
8881
+ const [key, ...rest] = path59;
8882
8882
  if (rest.length === 0)
8883
8883
  return this.has(key);
8884
8884
  const node = this.get(key, true);
@@ -8888,8 +8888,8 @@ var require_Collection = __commonJS({
8888
8888
  * Sets a value in this collection. For `!!set`, `value` needs to be a
8889
8889
  * boolean to add/remove the item from the set.
8890
8890
  */
8891
- setIn(path58, value) {
8892
- const [key, ...rest] = path58;
8891
+ setIn(path59, value) {
8892
+ const [key, ...rest] = path59;
8893
8893
  if (rest.length === 0) {
8894
8894
  this.set(key, value);
8895
8895
  } else {
@@ -11369,9 +11369,9 @@ var require_Document = __commonJS({
11369
11369
  this.contents.add(value);
11370
11370
  }
11371
11371
  /** Adds a value to the document. */
11372
- addIn(path58, value) {
11372
+ addIn(path59, value) {
11373
11373
  if (assertCollection(this.contents))
11374
- this.contents.addIn(path58, value);
11374
+ this.contents.addIn(path59, value);
11375
11375
  }
11376
11376
  /**
11377
11377
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -11446,14 +11446,14 @@ var require_Document = __commonJS({
11446
11446
  * Removes a value from the document.
11447
11447
  * @returns `true` if the item was found and removed.
11448
11448
  */
11449
- deleteIn(path58) {
11450
- if (Collection.isEmptyPath(path58)) {
11449
+ deleteIn(path59) {
11450
+ if (Collection.isEmptyPath(path59)) {
11451
11451
  if (this.contents == null)
11452
11452
  return false;
11453
11453
  this.contents = null;
11454
11454
  return true;
11455
11455
  }
11456
- return assertCollection(this.contents) ? this.contents.deleteIn(path58) : false;
11456
+ return assertCollection(this.contents) ? this.contents.deleteIn(path59) : false;
11457
11457
  }
11458
11458
  /**
11459
11459
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -11468,10 +11468,10 @@ var require_Document = __commonJS({
11468
11468
  * scalar values from their surrounding node; to disable set `keepScalar` to
11469
11469
  * `true` (collections are always returned intact).
11470
11470
  */
11471
- getIn(path58, keepScalar) {
11472
- if (Collection.isEmptyPath(path58))
11471
+ getIn(path59, keepScalar) {
11472
+ if (Collection.isEmptyPath(path59))
11473
11473
  return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
11474
- return identity.isCollection(this.contents) ? this.contents.getIn(path58, keepScalar) : void 0;
11474
+ return identity.isCollection(this.contents) ? this.contents.getIn(path59, keepScalar) : void 0;
11475
11475
  }
11476
11476
  /**
11477
11477
  * Checks if the document includes a value with the key `key`.
@@ -11482,10 +11482,10 @@ var require_Document = __commonJS({
11482
11482
  /**
11483
11483
  * Checks if the document includes a value at `path`.
11484
11484
  */
11485
- hasIn(path58) {
11486
- if (Collection.isEmptyPath(path58))
11485
+ hasIn(path59) {
11486
+ if (Collection.isEmptyPath(path59))
11487
11487
  return this.contents !== void 0;
11488
- return identity.isCollection(this.contents) ? this.contents.hasIn(path58) : false;
11488
+ return identity.isCollection(this.contents) ? this.contents.hasIn(path59) : false;
11489
11489
  }
11490
11490
  /**
11491
11491
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -11502,13 +11502,13 @@ var require_Document = __commonJS({
11502
11502
  * Sets a value in this document. For `!!set`, `value` needs to be a
11503
11503
  * boolean to add/remove the item from the set.
11504
11504
  */
11505
- setIn(path58, value) {
11506
- if (Collection.isEmptyPath(path58)) {
11505
+ setIn(path59, value) {
11506
+ if (Collection.isEmptyPath(path59)) {
11507
11507
  this.contents = value;
11508
11508
  } else if (this.contents == null) {
11509
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path58), value);
11509
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path59), value);
11510
11510
  } else if (assertCollection(this.contents)) {
11511
- this.contents.setIn(path58, value);
11511
+ this.contents.setIn(path59, value);
11512
11512
  }
11513
11513
  }
11514
11514
  /**
@@ -13448,9 +13448,9 @@ var require_cst_visit = __commonJS({
13448
13448
  visit.BREAK = BREAK;
13449
13449
  visit.SKIP = SKIP;
13450
13450
  visit.REMOVE = REMOVE;
13451
- visit.itemAtPath = (cst, path58) => {
13451
+ visit.itemAtPath = (cst, path59) => {
13452
13452
  let item = cst;
13453
- for (const [field, index] of path58) {
13453
+ for (const [field, index] of path59) {
13454
13454
  const tok = item?.[field];
13455
13455
  if (tok && "items" in tok) {
13456
13456
  item = tok.items[index];
@@ -13459,23 +13459,23 @@ var require_cst_visit = __commonJS({
13459
13459
  }
13460
13460
  return item;
13461
13461
  };
13462
- visit.parentCollection = (cst, path58) => {
13463
- const parent = visit.itemAtPath(cst, path58.slice(0, -1));
13464
- const field = path58[path58.length - 1][0];
13462
+ visit.parentCollection = (cst, path59) => {
13463
+ const parent = visit.itemAtPath(cst, path59.slice(0, -1));
13464
+ const field = path59[path59.length - 1][0];
13465
13465
  const coll = parent?.[field];
13466
13466
  if (coll && "items" in coll)
13467
13467
  return coll;
13468
13468
  throw new Error("Parent collection not found");
13469
13469
  };
13470
- function _visit(path58, item, visitor) {
13471
- let ctrl = visitor(item, path58);
13470
+ function _visit(path59, item, visitor) {
13471
+ let ctrl = visitor(item, path59);
13472
13472
  if (typeof ctrl === "symbol")
13473
13473
  return ctrl;
13474
13474
  for (const field of ["key", "value"]) {
13475
13475
  const token = item[field];
13476
13476
  if (token && "items" in token) {
13477
13477
  for (let i2 = 0; i2 < token.items.length; ++i2) {
13478
- const ci = _visit(Object.freeze(path58.concat([[field, i2]])), token.items[i2], visitor);
13478
+ const ci = _visit(Object.freeze(path59.concat([[field, i2]])), token.items[i2], visitor);
13479
13479
  if (typeof ci === "number")
13480
13480
  i2 = ci - 1;
13481
13481
  else if (ci === BREAK)
@@ -13486,10 +13486,10 @@ var require_cst_visit = __commonJS({
13486
13486
  }
13487
13487
  }
13488
13488
  if (typeof ctrl === "function" && field === "key")
13489
- ctrl = ctrl(item, path58);
13489
+ ctrl = ctrl(item, path59);
13490
13490
  }
13491
13491
  }
13492
- return typeof ctrl === "function" ? ctrl(item, path58) : ctrl;
13492
+ return typeof ctrl === "function" ? ctrl(item, path59) : ctrl;
13493
13493
  }
13494
13494
  exports.visit = visit;
13495
13495
  }
@@ -16211,14 +16211,14 @@ var require_url_state_machine = __commonJS({
16211
16211
  return url2.replace(/\u0009|\u000A|\u000D/g, "");
16212
16212
  }
16213
16213
  function shortenPath(url2) {
16214
- const path58 = url2.path;
16215
- if (path58.length === 0) {
16214
+ const path59 = url2.path;
16215
+ if (path59.length === 0) {
16216
16216
  return;
16217
16217
  }
16218
- if (url2.scheme === "file" && path58.length === 1 && isNormalizedWindowsDriveLetter(path58[0])) {
16218
+ if (url2.scheme === "file" && path59.length === 1 && isNormalizedWindowsDriveLetter(path59[0])) {
16219
16219
  return;
16220
16220
  }
16221
- path58.pop();
16221
+ path59.pop();
16222
16222
  }
16223
16223
  function includesCredentials(url2) {
16224
16224
  return url2.username !== "" || url2.password !== "";
@@ -25441,14 +25441,14 @@ __export(fileFromPath_exports, {
25441
25441
  fileFromPathSync: () => fileFromPathSync,
25442
25442
  isFile: () => isFile
25443
25443
  });
25444
- function createFileFromPath(path58, { mtimeMs, size }, filenameOrOptions, options = {}) {
25444
+ function createFileFromPath(path59, { mtimeMs, size }, filenameOrOptions, options = {}) {
25445
25445
  let filename;
25446
25446
  if (isPlainObject_default2(filenameOrOptions)) {
25447
25447
  [options, filename] = [filenameOrOptions, void 0];
25448
25448
  } else {
25449
25449
  filename = filenameOrOptions;
25450
25450
  }
25451
- const file = new FileFromPath({ path: path58, size, lastModified: mtimeMs });
25451
+ const file = new FileFromPath({ path: path59, size, lastModified: mtimeMs });
25452
25452
  if (!filename) {
25453
25453
  filename = file.name;
25454
25454
  }
@@ -25457,13 +25457,13 @@ function createFileFromPath(path58, { mtimeMs, size }, filenameOrOptions, option
25457
25457
  lastModified: file.lastModified
25458
25458
  });
25459
25459
  }
25460
- function fileFromPathSync(path58, filenameOrOptions, options = {}) {
25461
- const stats = statSync(path58);
25462
- return createFileFromPath(path58, stats, filenameOrOptions, options);
25460
+ function fileFromPathSync(path59, filenameOrOptions, options = {}) {
25461
+ const stats = statSync(path59);
25462
+ return createFileFromPath(path59, stats, filenameOrOptions, options);
25463
25463
  }
25464
- async function fileFromPath2(path58, filenameOrOptions, options) {
25465
- const stats = await promises.stat(path58);
25466
- return createFileFromPath(path58, stats, filenameOrOptions, options);
25464
+ async function fileFromPath2(path59, filenameOrOptions, options) {
25465
+ const stats = await promises.stat(path59);
25466
+ return createFileFromPath(path59, stats, filenameOrOptions, options);
25467
25467
  }
25468
25468
  var import_node_domexception, __classPrivateFieldSet4, __classPrivateFieldGet5, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath;
25469
25469
  var init_fileFromPath = __esm({
@@ -29322,7 +29322,7 @@ var require_has_flag = __commonJS({
29322
29322
  // ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
29323
29323
  var require_supports_color = __commonJS({
29324
29324
  "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
29325
- var os20 = __require("os");
29325
+ var os21 = __require("os");
29326
29326
  var tty2 = __require("tty");
29327
29327
  var hasFlag2 = require_has_flag();
29328
29328
  var { env: env3 } = process;
@@ -29370,7 +29370,7 @@ var require_supports_color = __commonJS({
29370
29370
  return min;
29371
29371
  }
29372
29372
  if (process.platform === "win32") {
29373
- const osRelease = os20.release().split(".");
29373
+ const osRelease = os21.release().split(".");
29374
29374
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
29375
29375
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
29376
29376
  }
@@ -37434,8 +37434,8 @@ var init_esm = __esm({
37434
37434
  }
37435
37435
  });
37436
37436
  function getMethodLiteral(schema) {
37437
- const shape = getObjectShape(schema);
37438
- const methodSchema = shape?.method;
37437
+ const shape2 = getObjectShape(schema);
37438
+ const methodSchema = shape2?.method;
37439
37439
  if (!methodSchema) {
37440
37440
  throw new Error("Schema is missing a method literal");
37441
37441
  }
@@ -41595,8 +41595,8 @@ var require_utils2 = __commonJS({
41595
41595
  }
41596
41596
  return ind;
41597
41597
  }
41598
- function removeDotSegments(path58) {
41599
- let input = path58;
41598
+ function removeDotSegments(path59) {
41599
+ let input = path59;
41600
41600
  const output = [];
41601
41601
  let nextSlash = -1;
41602
41602
  let len = 0;
@@ -41847,8 +41847,8 @@ var require_schemes = __commonJS({
41847
41847
  wsComponent.secure = void 0;
41848
41848
  }
41849
41849
  if (wsComponent.resourceName) {
41850
- const [path58, query] = wsComponent.resourceName.split("?");
41851
- wsComponent.path = path58 && path58 !== "/" ? path58 : void 0;
41850
+ const [path59, query] = wsComponent.resourceName.split("?");
41851
+ wsComponent.path = path59 && path59 !== "/" ? path59 : void 0;
41852
41852
  wsComponent.query = query;
41853
41853
  wsComponent.resourceName = void 0;
41854
41854
  }
@@ -45605,8 +45605,8 @@ var init_client2 = __esm({
45605
45605
  * Override request handler registration to enforce client-side validation for elicitation.
45606
45606
  */
45607
45607
  setRequestHandler(requestSchema, handler) {
45608
- const shape = getObjectShape(requestSchema);
45609
- const methodSchema = shape?.method;
45608
+ const shape2 = getObjectShape(requestSchema);
45609
+ const methodSchema = shape2?.method;
45610
45610
  if (!methodSchema) {
45611
45611
  throw new Error("Schema is missing a method literal");
45612
45612
  }
@@ -46006,7 +46006,7 @@ var require_windows = __commonJS({
46006
46006
  module.exports = isexe;
46007
46007
  isexe.sync = sync;
46008
46008
  var fs43 = __require("fs");
46009
- function checkPathExt(path58, options) {
46009
+ function checkPathExt(path59, options) {
46010
46010
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
46011
46011
  if (!pathext) {
46012
46012
  return true;
@@ -46017,25 +46017,25 @@ var require_windows = __commonJS({
46017
46017
  }
46018
46018
  for (var i2 = 0; i2 < pathext.length; i2++) {
46019
46019
  var p3 = pathext[i2].toLowerCase();
46020
- if (p3 && path58.substr(-p3.length).toLowerCase() === p3) {
46020
+ if (p3 && path59.substr(-p3.length).toLowerCase() === p3) {
46021
46021
  return true;
46022
46022
  }
46023
46023
  }
46024
46024
  return false;
46025
46025
  }
46026
- function checkStat(stat, path58, options) {
46026
+ function checkStat(stat, path59, options) {
46027
46027
  if (!stat.isSymbolicLink() && !stat.isFile()) {
46028
46028
  return false;
46029
46029
  }
46030
- return checkPathExt(path58, options);
46030
+ return checkPathExt(path59, options);
46031
46031
  }
46032
- function isexe(path58, options, cb) {
46033
- fs43.stat(path58, function(er2, stat) {
46034
- cb(er2, er2 ? false : checkStat(stat, path58, options));
46032
+ function isexe(path59, options, cb) {
46033
+ fs43.stat(path59, function(er2, stat) {
46034
+ cb(er2, er2 ? false : checkStat(stat, path59, options));
46035
46035
  });
46036
46036
  }
46037
- function sync(path58, options) {
46038
- return checkStat(fs43.statSync(path58), path58, options);
46037
+ function sync(path59, options) {
46038
+ return checkStat(fs43.statSync(path59), path59, options);
46039
46039
  }
46040
46040
  }
46041
46041
  });
@@ -46046,13 +46046,13 @@ var require_mode = __commonJS({
46046
46046
  module.exports = isexe;
46047
46047
  isexe.sync = sync;
46048
46048
  var fs43 = __require("fs");
46049
- function isexe(path58, options, cb) {
46050
- fs43.stat(path58, function(er2, stat) {
46049
+ function isexe(path59, options, cb) {
46050
+ fs43.stat(path59, function(er2, stat) {
46051
46051
  cb(er2, er2 ? false : checkStat(stat, options));
46052
46052
  });
46053
46053
  }
46054
- function sync(path58, options) {
46055
- return checkStat(fs43.statSync(path58), options);
46054
+ function sync(path59, options) {
46055
+ return checkStat(fs43.statSync(path59), options);
46056
46056
  }
46057
46057
  function checkStat(stat, options) {
46058
46058
  return stat.isFile() && checkMode(stat, options);
@@ -46085,7 +46085,7 @@ var require_isexe = __commonJS({
46085
46085
  }
46086
46086
  module.exports = isexe;
46087
46087
  isexe.sync = sync;
46088
- function isexe(path58, options, cb) {
46088
+ function isexe(path59, options, cb) {
46089
46089
  if (typeof options === "function") {
46090
46090
  cb = options;
46091
46091
  options = {};
@@ -46095,7 +46095,7 @@ var require_isexe = __commonJS({
46095
46095
  throw new TypeError("callback not provided");
46096
46096
  }
46097
46097
  return new Promise(function(resolve12, reject) {
46098
- isexe(path58, options || {}, function(er2, is) {
46098
+ isexe(path59, options || {}, function(er2, is) {
46099
46099
  if (er2) {
46100
46100
  reject(er2);
46101
46101
  } else {
@@ -46104,7 +46104,7 @@ var require_isexe = __commonJS({
46104
46104
  });
46105
46105
  });
46106
46106
  }
46107
- core(path58, options || {}, function(er2, is) {
46107
+ core(path59, options || {}, function(er2, is) {
46108
46108
  if (er2) {
46109
46109
  if (er2.code === "EACCES" || options && options.ignoreErrors) {
46110
46110
  er2 = null;
@@ -46114,9 +46114,9 @@ var require_isexe = __commonJS({
46114
46114
  cb(er2, is);
46115
46115
  });
46116
46116
  }
46117
- function sync(path58, options) {
46117
+ function sync(path59, options) {
46118
46118
  try {
46119
- return core.sync(path58, options || {});
46119
+ return core.sync(path59, options || {});
46120
46120
  } catch (er2) {
46121
46121
  if (options && options.ignoreErrors || er2.code === "EACCES") {
46122
46122
  return false;
@@ -46132,7 +46132,7 @@ var require_isexe = __commonJS({
46132
46132
  var require_which = __commonJS({
46133
46133
  "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
46134
46134
  var isWindows3 = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
46135
- var path58 = __require("path");
46135
+ var path59 = __require("path");
46136
46136
  var COLON = isWindows3 ? ";" : ":";
46137
46137
  var isexe = require_isexe();
46138
46138
  var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -46170,7 +46170,7 @@ var require_which = __commonJS({
46170
46170
  return opt.all && found.length ? resolve12(found) : reject(getNotFoundError(cmd));
46171
46171
  const ppRaw = pathEnv[i2];
46172
46172
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
46173
- const pCmd = path58.join(pathPart, cmd);
46173
+ const pCmd = path59.join(pathPart, cmd);
46174
46174
  const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
46175
46175
  resolve12(subStep(p3, i2, 0));
46176
46176
  });
@@ -46197,7 +46197,7 @@ var require_which = __commonJS({
46197
46197
  for (let i2 = 0; i2 < pathEnv.length; i2++) {
46198
46198
  const ppRaw = pathEnv[i2];
46199
46199
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
46200
- const pCmd = path58.join(pathPart, cmd);
46200
+ const pCmd = path59.join(pathPart, cmd);
46201
46201
  const p3 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
46202
46202
  for (let j3 = 0; j3 < pathExt.length; j3++) {
46203
46203
  const cur = p3 + pathExt[j3];
@@ -46243,7 +46243,7 @@ var require_path_key = __commonJS({
46243
46243
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
46244
46244
  var require_resolveCommand = __commonJS({
46245
46245
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
46246
- var path58 = __require("path");
46246
+ var path59 = __require("path");
46247
46247
  var which = require_which();
46248
46248
  var getPathKey = require_path_key();
46249
46249
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -46261,7 +46261,7 @@ var require_resolveCommand = __commonJS({
46261
46261
  try {
46262
46262
  resolved = which.sync(parsed.command, {
46263
46263
  path: env3[getPathKey({ env: env3 })],
46264
- pathExt: withoutPathExt ? path58.delimiter : void 0
46264
+ pathExt: withoutPathExt ? path59.delimiter : void 0
46265
46265
  });
46266
46266
  } catch (e3) {
46267
46267
  } finally {
@@ -46270,7 +46270,7 @@ var require_resolveCommand = __commonJS({
46270
46270
  }
46271
46271
  }
46272
46272
  if (resolved) {
46273
- resolved = path58.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
46273
+ resolved = path59.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
46274
46274
  }
46275
46275
  return resolved;
46276
46276
  }
@@ -46321,8 +46321,8 @@ var require_shebang_command = __commonJS({
46321
46321
  if (!match) {
46322
46322
  return null;
46323
46323
  }
46324
- const [path58, argument] = match[0].replace(/#! ?/, "").split(" ");
46325
- const binary = path58.split("/").pop();
46324
+ const [path59, argument] = match[0].replace(/#! ?/, "").split(" ");
46325
+ const binary = path59.split("/").pop();
46326
46326
  if (binary === "env") {
46327
46327
  return argument;
46328
46328
  }
@@ -46355,7 +46355,7 @@ var require_readShebang = __commonJS({
46355
46355
  // ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
46356
46356
  var require_parse = __commonJS({
46357
46357
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
46358
- var path58 = __require("path");
46358
+ var path59 = __require("path");
46359
46359
  var resolveCommand = require_resolveCommand();
46360
46360
  var escape4 = require_escape();
46361
46361
  var readShebang = require_readShebang();
@@ -46380,7 +46380,7 @@ var require_parse = __commonJS({
46380
46380
  const needsShell = !isExecutableRegExp.test(commandFile);
46381
46381
  if (parsed.options.forceShell || needsShell) {
46382
46382
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
46383
- parsed.command = path58.normalize(parsed.command);
46383
+ parsed.command = path59.normalize(parsed.command);
46384
46384
  parsed.command = escape4.command(parsed.command);
46385
46385
  parsed.args = parsed.args.map((arg) => escape4.argument(arg, needsDoubleEscapeMetaChars));
46386
46386
  const shellCommand = [parsed.command].concat(parsed.args).join(" ");
@@ -46468,7 +46468,7 @@ var require_cross_spawn = __commonJS({
46468
46468
  var cp = __require("child_process");
46469
46469
  var parse2 = require_parse();
46470
46470
  var enoent = require_enoent();
46471
- function spawn16(command, args, options) {
46471
+ function spawn17(command, args, options) {
46472
46472
  const parsed = parse2(command, args, options);
46473
46473
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
46474
46474
  enoent.hookChildProcess(spawned, parsed);
@@ -46480,8 +46480,8 @@ var require_cross_spawn = __commonJS({
46480
46480
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
46481
46481
  return result;
46482
46482
  }
46483
- module.exports = spawn16;
46484
- module.exports.spawn = spawn16;
46483
+ module.exports = spawn17;
46484
+ module.exports.spawn = spawn17;
46485
46485
  module.exports.sync = spawnSync5;
46486
46486
  module.exports._parse = parse2;
46487
46487
  module.exports._enoent = enoent;
@@ -74168,10 +74168,10 @@ var require_react_reconciler_development = __commonJS({
74168
74168
  var setErrorHandler = null;
74169
74169
  var setSuspenseHandler = null;
74170
74170
  {
74171
- var copyWithDeleteImpl = function(obj, path58, index2) {
74172
- var key = path58[index2];
74171
+ var copyWithDeleteImpl = function(obj, path59, index2) {
74172
+ var key = path59[index2];
74173
74173
  var updated = isArray(obj) ? obj.slice() : assign({}, obj);
74174
- if (index2 + 1 === path58.length) {
74174
+ if (index2 + 1 === path59.length) {
74175
74175
  if (isArray(updated)) {
74176
74176
  updated.splice(key, 1);
74177
74177
  } else {
@@ -74179,11 +74179,11 @@ var require_react_reconciler_development = __commonJS({
74179
74179
  }
74180
74180
  return updated;
74181
74181
  }
74182
- updated[key] = copyWithDeleteImpl(obj[key], path58, index2 + 1);
74182
+ updated[key] = copyWithDeleteImpl(obj[key], path59, index2 + 1);
74183
74183
  return updated;
74184
74184
  };
74185
- var copyWithDelete = function(obj, path58) {
74186
- return copyWithDeleteImpl(obj, path58, 0);
74185
+ var copyWithDelete = function(obj, path59) {
74186
+ return copyWithDeleteImpl(obj, path59, 0);
74187
74187
  };
74188
74188
  var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
74189
74189
  var oldKey = oldPath[index2];
@@ -74221,17 +74221,17 @@ var require_react_reconciler_development = __commonJS({
74221
74221
  }
74222
74222
  return copyWithRenameImpl(obj, oldPath, newPath, 0);
74223
74223
  };
74224
- var copyWithSetImpl = function(obj, path58, index2, value) {
74225
- if (index2 >= path58.length) {
74224
+ var copyWithSetImpl = function(obj, path59, index2, value) {
74225
+ if (index2 >= path59.length) {
74226
74226
  return value;
74227
74227
  }
74228
- var key = path58[index2];
74228
+ var key = path59[index2];
74229
74229
  var updated = isArray(obj) ? obj.slice() : assign({}, obj);
74230
- updated[key] = copyWithSetImpl(obj[key], path58, index2 + 1, value);
74230
+ updated[key] = copyWithSetImpl(obj[key], path59, index2 + 1, value);
74231
74231
  return updated;
74232
74232
  };
74233
- var copyWithSet = function(obj, path58, value) {
74234
- return copyWithSetImpl(obj, path58, 0, value);
74233
+ var copyWithSet = function(obj, path59, value) {
74234
+ return copyWithSetImpl(obj, path59, 0, value);
74235
74235
  };
74236
74236
  var findHook = function(fiber, id) {
74237
74237
  var currentHook2 = fiber.memoizedState;
@@ -74241,10 +74241,10 @@ var require_react_reconciler_development = __commonJS({
74241
74241
  }
74242
74242
  return currentHook2;
74243
74243
  };
74244
- overrideHookState = function(fiber, id, path58, value) {
74244
+ overrideHookState = function(fiber, id, path59, value) {
74245
74245
  var hook = findHook(fiber, id);
74246
74246
  if (hook !== null) {
74247
- var newState = copyWithSet(hook.memoizedState, path58, value);
74247
+ var newState = copyWithSet(hook.memoizedState, path59, value);
74248
74248
  hook.memoizedState = newState;
74249
74249
  hook.baseState = newState;
74250
74250
  fiber.memoizedProps = assign({}, fiber.memoizedProps);
@@ -74254,10 +74254,10 @@ var require_react_reconciler_development = __commonJS({
74254
74254
  }
74255
74255
  }
74256
74256
  };
74257
- overrideHookStateDeletePath = function(fiber, id, path58) {
74257
+ overrideHookStateDeletePath = function(fiber, id, path59) {
74258
74258
  var hook = findHook(fiber, id);
74259
74259
  if (hook !== null) {
74260
- var newState = copyWithDelete(hook.memoizedState, path58);
74260
+ var newState = copyWithDelete(hook.memoizedState, path59);
74261
74261
  hook.memoizedState = newState;
74262
74262
  hook.baseState = newState;
74263
74263
  fiber.memoizedProps = assign({}, fiber.memoizedProps);
@@ -74280,8 +74280,8 @@ var require_react_reconciler_development = __commonJS({
74280
74280
  }
74281
74281
  }
74282
74282
  };
74283
- overrideProps = function(fiber, path58, value) {
74284
- fiber.pendingProps = copyWithSet(fiber.memoizedProps, path58, value);
74283
+ overrideProps = function(fiber, path59, value) {
74284
+ fiber.pendingProps = copyWithSet(fiber.memoizedProps, path59, value);
74285
74285
  if (fiber.alternate) {
74286
74286
  fiber.alternate.pendingProps = fiber.pendingProps;
74287
74287
  }
@@ -74290,8 +74290,8 @@ var require_react_reconciler_development = __commonJS({
74290
74290
  scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
74291
74291
  }
74292
74292
  };
74293
- overridePropsDeletePath = function(fiber, path58) {
74294
- fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path58);
74293
+ overridePropsDeletePath = function(fiber, path59) {
74294
+ fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path59);
74295
74295
  if (fiber.alternate) {
74296
74296
  fiber.alternate.pendingProps = fiber.pendingProps;
74297
74297
  }
@@ -81733,8 +81733,8 @@ var init_ErrorOverview = __esm({
81733
81733
  init_dist7();
81734
81734
  init_Box();
81735
81735
  init_Text();
81736
- cleanupPath = (path58) => {
81737
- return path58?.replace(`file://${cwd()}/`, "");
81736
+ cleanupPath = (path59) => {
81737
+ return path59?.replace(`file://${cwd()}/`, "");
81738
81738
  };
81739
81739
  stackUtils = new import_stack_utils.default({
81740
81740
  cwd: cwd(),
@@ -85772,7 +85772,7 @@ var init_StatusLine = __esm({
85772
85772
  init_theme();
85773
85773
  await init_Spinner();
85774
85774
  await init_ModeFooter();
85775
- StatusLine = ({ busyStartedAt, queueCount, modeName, modeBadge, provider, model, mcp, contextUsed, contextWindow }) => {
85775
+ StatusLine = ({ busyStartedAt, queueCount, modeName, modeBadge, provider, model, mcp, contextUsed, contextWindow, version, updateLatest }) => {
85776
85776
  const busy = busyStartedAt != null;
85777
85777
  const showQueue = (queueCount ?? 0) > 0;
85778
85778
  const showMcp = !!(mcp && mcp.enabled > 0);
@@ -85783,7 +85783,7 @@ var init_StatusLine = __esm({
85783
85783
  // with the busy marker / idle hint trailing it — so the user always
85784
85784
  // sees the mode even mid-run, when a plain footer would be hidden.
85785
85785
  (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(ModeBadgePill, { badge: modeBadge }), (0, import_jsx_runtime21.jsx)(Text, { children: " " }), busy ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime21.jsx)(Text, { color: Colors.chrome, dimColor: true, children: "Esc stops \xB7 shift+tab to change" })] })
85786
- ) : busy ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime21.jsx)(ModeFooter, { modeName }) }), (0, import_jsx_runtime21.jsxs)(Box_default, { children: [(0, import_jsx_runtime21.jsx)(ProviderBadge, { name: provider }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${model}` }), showMcp ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: "mcp " }), (0, import_jsx_runtime21.jsx)(Text, { children: `${mcp.connected}/${mcp.enabled}` })] }) : null, showCtx ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(ContextMeter, { used: contextUsed ?? 0, total: contextWindow })] }) : null] })] });
85786
+ ) : busy ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime21.jsx)(ModeFooter, { modeName }) }), (0, import_jsx_runtime21.jsxs)(Box_default, { children: [(0, import_jsx_runtime21.jsx)(ProviderBadge, { name: provider }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${model}` }), showMcp ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: "mcp " }), (0, import_jsx_runtime21.jsx)(Text, { children: `${mcp.connected}/${mcp.enabled}` })] }) : null, showCtx ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(ContextMeter, { used: contextUsed ?? 0, total: contextWindow })] }) : null, version ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), updateLatest ? (0, import_jsx_runtime21.jsx)(Text, { color: "yellow", children: `v${version} ${Glyphs.contextUp}${updateLatest}` }) : (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: `v${version}` })] }) : null] })] });
85787
85787
  };
85788
85788
  ProviderBadge = ({ name }) => (0, import_jsx_runtime21.jsx)(Text, { backgroundColor: Colors.chrome, color: "black", bold: true, children: ` ${name} ` });
85789
85789
  ModeBadgePill = ({ badge }) => (0, import_jsx_runtime21.jsx)(Text, { backgroundColor: badgeBackground(badge.tone), color: "black", bold: true, children: ` ${badge.label} ` });
@@ -88304,7 +88304,7 @@ var init_SessionView = __esm({
88304
88304
  await init_run_slash();
88305
88305
  await init_OverlayOrNotice();
88306
88306
  await init_InteractiveZone();
88307
- SessionView = ({ session, registerInteractiveResolver, model, initialPrompt }) => {
88307
+ SessionView = ({ session, registerInteractiveResolver, model, version, updateAvailable, initialPrompt }) => {
88308
88308
  const { exit } = use_app_default();
88309
88309
  const stream = useEventStream(session);
88310
88310
  const [systemNotice, setSystemNotice] = (0, import_react62.useState)(null);
@@ -88478,6 +88478,13 @@ var init_SessionView = __esm({
88478
88478
  firedInitial.current = true;
88479
88479
  void handleSubmit(initialPrompt);
88480
88480
  }, [initialPrompt]);
88481
+ const firedUpdateNotice = (0, import_react62.useRef)(false);
88482
+ (0, import_react62.useEffect)(() => {
88483
+ if (firedUpdateNotice.current || !updateAvailable || initialPrompt)
88484
+ return;
88485
+ firedUpdateNotice.current = true;
88486
+ setSystemNotice(`\u2728 moxxy ${updateAvailable.latest} available \u2014 run \`moxxy update\``);
88487
+ }, [updateAvailable, initialPrompt]);
88481
88488
  return (0, import_jsx_runtime34.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime34.jsx)(ChatView, { events: stream.events, streamingDelta: stream.streamingDelta, expandToolOutputs, compactTools, hideLive: overlay != null || picker != null || pendingPermission != null || pendingApproval != null }), (0, import_jsx_runtime34.jsx)(OverlayOrNotice, { overlay, systemNotice, session, events: stream.events, contextWindow, contextTokens: contextUsed, onClose: () => setOverlay(null) }), (0, import_jsx_runtime34.jsx)(InteractiveZone, { session, pendingPermission, pendingPermissionDepth: Math.max(0, permissions.pendingPermissions.length - 1), pendingApproval, picker, busy: turn.busy, voiceReady: voice.ready, voicePhase: voice.phase, yolo, slashCommands: slashSuggestions, queueMessages: turn.queueRef.current, priorityMessage: turn.priorityMessage, commandHotkeys, onCycleMode: cycleMode, externalInsert: voice.externalInsert, onPermissionDecide: (perm, decision) => {
88482
88489
  permissions.setPendingPermissions((prev) => prev.slice(1));
88483
88490
  if (decision.mode === "allow_always") {
@@ -88490,7 +88497,7 @@ var init_SessionView = __esm({
88490
88497
  const { resolve: resolve12 } = pendingApproval;
88491
88498
  permissions.setPendingApproval(null);
88492
88499
  resolve12(decision);
88493
- }, onPickerSelect: handlePickerSelect, onPickerCancel: () => setPicker(null), onSubmit: handleSubmit, onPasteText: images.handlePasteText }), (0, import_jsx_runtime34.jsx)(StatusLine, { busyStartedAt: turn.busy && !pendingPermission && !pendingApproval ? turn.busyStartedAt : null, queueCount: turn.queueCount, modeName, modeBadge, provider: providerName, model: activeModel2, mcp: mcpStatus, contextUsed, ...contextWindow ? { contextWindow } : {} })] });
88500
+ }, onPickerSelect: handlePickerSelect, onPickerCancel: () => setPicker(null), onSubmit: handleSubmit, onPasteText: images.handlePasteText }), (0, import_jsx_runtime34.jsx)(StatusLine, { busyStartedAt: turn.busy && !pendingPermission && !pendingApproval ? turn.busyStartedAt : null, queueCount: turn.queueCount, modeName, modeBadge, provider: providerName, model: activeModel2, mcp: mcpStatus, contextUsed, ...contextWindow ? { contextWindow } : {}, ...version ? { version } : {}, ...updateAvailable ? { updateLatest: updateAvailable.latest } : {} })] });
88494
88501
  };
88495
88502
  }
88496
88503
  });
@@ -88511,7 +88518,7 @@ var init_BootShell = __esm({
88511
88518
  await init_SessionView();
88512
88519
  await init_OverlayOrNotice();
88513
88520
  init_use_voice_input();
88514
- InteractiveSession = ({ session: eagerSession, bootstrap, registerInteractiveResolver, model, resumed }) => {
88521
+ InteractiveSession = ({ session: eagerSession, bootstrap, registerInteractiveResolver, model, version, updateAvailable, resumed }) => {
88515
88522
  const [session, setSession] = (0, import_react63.useState)(eagerSession ?? null);
88516
88523
  const [bootEvents, setBootEvents] = (0, import_react63.useState)([]);
88517
88524
  const [bootError, setBootError] = (0, import_react63.useState)(null);
@@ -88563,7 +88570,7 @@ var init_BootShell = __esm({
88563
88570
  if (!session || initialPrompt == null && !resumed) {
88564
88571
  return (0, import_jsx_runtime35.jsxs)(Box_default, { flexDirection: "column", children: [(0, import_jsx_runtime35.jsx)(BootScreen, { events: bootEvents, startedAt, ...bootError ? { error: bootError } : {} }), session ? (0, import_jsx_runtime35.jsx)(BootInputArea, { session, ready: bootError == null, bootError, onSubmit: (text) => setInitialPrompt(text) }) : (0, import_jsx_runtime35.jsx)(DisabledBootInput, { placeholder: bootError ? "Bootstrap failed \u2014 quit and run `moxxy init`" : "Initializing\u2026" })] });
88565
88572
  }
88566
- return (0, import_jsx_runtime35.jsx)(SessionView, { session, registerInteractiveResolver, ...initialPrompt ? { initialPrompt } : {}, ...model ? { model } : {} });
88573
+ return (0, import_jsx_runtime35.jsx)(SessionView, { session, registerInteractiveResolver, ...initialPrompt ? { initialPrompt } : {}, ...model ? { model } : {}, ...version ? { version } : {}, ...updateAvailable ? { updateAvailable } : {} });
88567
88574
  };
88568
88575
  BootInputArea = ({ session, ready, bootError, onSubmit }) => {
88569
88576
  const [systemNotice, setSystemNotice] = (0, import_react63.useState)(null);
@@ -92661,13 +92668,13 @@ var MultipartBody = class {
92661
92668
  }
92662
92669
  };
92663
92670
  var fileFromPathWarned = false;
92664
- async function fileFromPath3(path58, ...args) {
92671
+ async function fileFromPath3(path59, ...args) {
92665
92672
  const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
92666
92673
  if (!fileFromPathWarned) {
92667
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path58)}) instead`);
92674
+ console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path59)}) instead`);
92668
92675
  fileFromPathWarned = true;
92669
92676
  }
92670
- return await _fileFromPath(path58, ...args);
92677
+ return await _fileFromPath(path59, ...args);
92671
92678
  }
92672
92679
  var defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
92673
92680
  var defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
@@ -93390,29 +93397,29 @@ var APIClient = class {
93390
93397
  defaultIdempotencyKey() {
93391
93398
  return `stainless-node-retry-${uuid4()}`;
93392
93399
  }
93393
- get(path58, opts) {
93394
- return this.methodRequest("get", path58, opts);
93400
+ get(path59, opts) {
93401
+ return this.methodRequest("get", path59, opts);
93395
93402
  }
93396
- post(path58, opts) {
93397
- return this.methodRequest("post", path58, opts);
93403
+ post(path59, opts) {
93404
+ return this.methodRequest("post", path59, opts);
93398
93405
  }
93399
- patch(path58, opts) {
93400
- return this.methodRequest("patch", path58, opts);
93406
+ patch(path59, opts) {
93407
+ return this.methodRequest("patch", path59, opts);
93401
93408
  }
93402
- put(path58, opts) {
93403
- return this.methodRequest("put", path58, opts);
93409
+ put(path59, opts) {
93410
+ return this.methodRequest("put", path59, opts);
93404
93411
  }
93405
- delete(path58, opts) {
93406
- return this.methodRequest("delete", path58, opts);
93412
+ delete(path59, opts) {
93413
+ return this.methodRequest("delete", path59, opts);
93407
93414
  }
93408
- methodRequest(method, path58, opts) {
93415
+ methodRequest(method, path59, opts) {
93409
93416
  return this.request(Promise.resolve(opts).then(async (opts2) => {
93410
93417
  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;
93411
- return { method, path: path58, ...opts2, body };
93418
+ return { method, path: path59, ...opts2, body };
93412
93419
  }));
93413
93420
  }
93414
- getAPIList(path58, Page3, opts) {
93415
- return this.requestAPIList(Page3, { method: "get", path: path58, ...opts });
93421
+ getAPIList(path59, Page3, opts) {
93422
+ return this.requestAPIList(Page3, { method: "get", path: path59, ...opts });
93416
93423
  }
93417
93424
  calculateContentLength(body) {
93418
93425
  if (typeof body === "string") {
@@ -93431,10 +93438,10 @@ var APIClient = class {
93431
93438
  }
93432
93439
  buildRequest(inputOptions, { retryCount = 0 } = {}) {
93433
93440
  const options = { ...inputOptions };
93434
- const { method, path: path58, query, headers = {} } = options;
93441
+ const { method, path: path59, query, headers = {} } = options;
93435
93442
  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;
93436
93443
  const contentLength = this.calculateContentLength(body);
93437
- const url2 = this.buildURL(path58, query);
93444
+ const url2 = this.buildURL(path59, query);
93438
93445
  if ("timeout" in options)
93439
93446
  validatePositiveInteger("timeout", options.timeout);
93440
93447
  options.timeout = options.timeout ?? this.timeout;
@@ -93558,8 +93565,8 @@ var APIClient = class {
93558
93565
  const request = this.makeRequest(options, null);
93559
93566
  return new PagePromise(this, request, Page3);
93560
93567
  }
93561
- buildURL(path58, query) {
93562
- const url2 = isAbsoluteURL(path58) ? new URL(path58) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path58.startsWith("/") ? path58.slice(1) : path58));
93568
+ buildURL(path59, query) {
93569
+ const url2 = isAbsoluteURL(path59) ? new URL(path59) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path59.startsWith("/") ? path59.slice(1) : path59));
93563
93570
  const defaultQuery = this.defaultQuery();
93564
93571
  if (!isEmptyObj(defaultQuery)) {
93565
93572
  query = { ...defaultQuery, ...query };
@@ -96712,13 +96719,13 @@ var MultipartBody2 = class {
96712
96719
  }
96713
96720
  };
96714
96721
  var fileFromPathWarned2 = false;
96715
- async function fileFromPath5(path58, ...args) {
96722
+ async function fileFromPath5(path59, ...args) {
96716
96723
  const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports));
96717
96724
  if (!fileFromPathWarned2) {
96718
- console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path58)}) instead`);
96725
+ console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path59)}) instead`);
96719
96726
  fileFromPathWarned2 = true;
96720
96727
  }
96721
- return await _fileFromPath(path58, ...args);
96728
+ return await _fileFromPath(path59, ...args);
96722
96729
  }
96723
96730
  var defaultHttpAgent2 = new import_agentkeepalive2.default({ keepAlive: true, timeout: 5 * 60 * 1e3 });
96724
96731
  var defaultHttpsAgent2 = new import_agentkeepalive2.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 });
@@ -97496,29 +97503,29 @@ var APIClient2 = class {
97496
97503
  defaultIdempotencyKey() {
97497
97504
  return `stainless-node-retry-${uuid42()}`;
97498
97505
  }
97499
- get(path58, opts) {
97500
- return this.methodRequest("get", path58, opts);
97506
+ get(path59, opts) {
97507
+ return this.methodRequest("get", path59, opts);
97501
97508
  }
97502
- post(path58, opts) {
97503
- return this.methodRequest("post", path58, opts);
97509
+ post(path59, opts) {
97510
+ return this.methodRequest("post", path59, opts);
97504
97511
  }
97505
- patch(path58, opts) {
97506
- return this.methodRequest("patch", path58, opts);
97512
+ patch(path59, opts) {
97513
+ return this.methodRequest("patch", path59, opts);
97507
97514
  }
97508
- put(path58, opts) {
97509
- return this.methodRequest("put", path58, opts);
97515
+ put(path59, opts) {
97516
+ return this.methodRequest("put", path59, opts);
97510
97517
  }
97511
- delete(path58, opts) {
97512
- return this.methodRequest("delete", path58, opts);
97518
+ delete(path59, opts) {
97519
+ return this.methodRequest("delete", path59, opts);
97513
97520
  }
97514
- methodRequest(method, path58, opts) {
97521
+ methodRequest(method, path59, opts) {
97515
97522
  return this.request(Promise.resolve(opts).then(async (opts2) => {
97516
97523
  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;
97517
- return { method, path: path58, ...opts2, body };
97524
+ return { method, path: path59, ...opts2, body };
97518
97525
  }));
97519
97526
  }
97520
- getAPIList(path58, Page3, opts) {
97521
- return this.requestAPIList(Page3, { method: "get", path: path58, ...opts });
97527
+ getAPIList(path59, Page3, opts) {
97528
+ return this.requestAPIList(Page3, { method: "get", path: path59, ...opts });
97522
97529
  }
97523
97530
  calculateContentLength(body) {
97524
97531
  if (typeof body === "string") {
@@ -97537,10 +97544,10 @@ var APIClient2 = class {
97537
97544
  }
97538
97545
  buildRequest(inputOptions, { retryCount = 0 } = {}) {
97539
97546
  const options = { ...inputOptions };
97540
- const { method, path: path58, query, headers = {} } = options;
97547
+ const { method, path: path59, query, headers = {} } = options;
97541
97548
  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;
97542
97549
  const contentLength = this.calculateContentLength(body);
97543
- const url2 = this.buildURL(path58, query);
97550
+ const url2 = this.buildURL(path59, query);
97544
97551
  if ("timeout" in options)
97545
97552
  validatePositiveInteger2("timeout", options.timeout);
97546
97553
  options.timeout = options.timeout ?? this.timeout;
@@ -97656,8 +97663,8 @@ var APIClient2 = class {
97656
97663
  const request = this.makeRequest(options, null);
97657
97664
  return new PagePromise2(this, request, Page3);
97658
97665
  }
97659
- buildURL(path58, query) {
97660
- const url2 = isAbsoluteURL2(path58) ? new URL(path58) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path58.startsWith("/") ? path58.slice(1) : path58));
97666
+ buildURL(path59, query) {
97667
+ const url2 = isAbsoluteURL2(path59) ? new URL(path59) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path59.startsWith("/") ? path59.slice(1) : path59));
97661
97668
  const defaultQuery = this.defaultQuery();
97662
97669
  if (!isEmptyObj2(defaultQuery)) {
97663
97670
  query = { ...defaultQuery, ...query };
@@ -103037,11 +103044,11 @@ function buildAuthUrl(input) {
103037
103044
  }
103038
103045
  async function runAuthorizationCodeFlow(opts) {
103039
103046
  const port = opts.redirectPort ?? 8765;
103040
- const path58 = opts.redirectPath ?? "/callback";
103047
+ const path59 = opts.redirectPath ?? "/callback";
103041
103048
  const codeVerifier = generateCodeVerifier();
103042
103049
  const codeChallenge = computeCodeChallenge(codeVerifier);
103043
103050
  const state = generateState();
103044
- const redirectUri = `http://localhost:${port}${path58}`;
103051
+ const redirectUri = `http://localhost:${port}${path59}`;
103045
103052
  const authUrl = buildAuthUrl({
103046
103053
  authUrl: opts.authUrl,
103047
103054
  clientId: opts.clientId,
@@ -103053,7 +103060,7 @@ async function runAuthorizationCodeFlow(opts) {
103053
103060
  });
103054
103061
  const codePromise = waitForCallback({
103055
103062
  port,
103056
- path: path58,
103063
+ path: path59,
103057
103064
  expectedState: state,
103058
103065
  timeoutMs: opts.timeoutMs ?? 3e5,
103059
103066
  ...opts.signal ? { signal: opts.signal } : {}
@@ -103401,11 +103408,11 @@ function buildOauthAuthorizeTool(deps) {
103401
103408
  const { computeCodeChallenge: computeCodeChallenge2 } = await Promise.resolve().then(() => (init_pkce(), pkce_exports));
103402
103409
  const challenge = computeCodeChallenge2(verifier);
103403
103410
  const port = input.redirectPort ?? 8765;
103404
- const path58 = input.redirectPath ?? "/callback";
103411
+ const path59 = input.redirectPath ?? "/callback";
103405
103412
  const url2 = buildAuthUrl({
103406
103413
  authUrl: input.authUrl,
103407
103414
  clientId: input.clientId,
103408
- redirectUri: `http://localhost:${port}${path58}`,
103415
+ redirectUri: `http://localhost:${port}${path59}`,
103409
103416
  scopes: input.scopes,
103410
103417
  codeChallenge: challenge,
103411
103418
  state,
@@ -103547,7 +103554,7 @@ async function runOauthLogin(profile, ctx) {
103547
103554
  }
103548
103555
  async function runBrowserFlow(profile, ctx) {
103549
103556
  const port = profile.redirect?.port ?? 8765;
103550
- const path58 = profile.redirect?.path ?? "/callback";
103557
+ const path59 = profile.redirect?.path ?? "/callback";
103551
103558
  const serviceName = profile.displayName ?? profile.id;
103552
103559
  return runAuthorizationCodeFlow({
103553
103560
  authUrl: profile.authUrl,
@@ -103556,7 +103563,7 @@ async function runBrowserFlow(profile, ctx) {
103556
103563
  ...profile.clientSecret ? { clientSecret: profile.clientSecret } : {},
103557
103564
  scopes: profile.scopes,
103558
103565
  redirectPort: port,
103559
- redirectPath: path58,
103566
+ redirectPath: path59,
103560
103567
  ...profile.extraAuthParams ? { extraAuthParams: profile.extraAuthParams } : {},
103561
103568
  timeoutMs: DEFAULT_BROWSER_TIMEOUT_MS,
103562
103569
  ...ctx.signal ? { signal: ctx.signal } : {},
@@ -103568,7 +103575,7 @@ If your browser doesn't open automatically, paste this URL:
103568
103575
 
103569
103576
  ${url2}
103570
103577
 
103571
- Waiting for callback on http://localhost:${port}${path58} (5 min timeout)\u2026
103578
+ Waiting for callback on http://localhost:${port}${path59} (5 min timeout)\u2026
103572
103579
 
103573
103580
  `);
103574
103581
  }
@@ -109978,11 +109985,11 @@ function isAddrInUse(err) {
109978
109985
  async function freeTcpPort(port) {
109979
109986
  if (process.platform === "win32")
109980
109987
  return;
109981
- const { spawn: spawn16 } = await import('child_process');
109988
+ const { spawn: spawn17 } = await import('child_process');
109982
109989
  const pids = await new Promise((resolve12) => {
109983
109990
  let out = "";
109984
109991
  try {
109985
- const child = spawn16("lsof", ["-t", `-iTCP:${port}`, "-sTCP:LISTEN"], {
109992
+ const child = spawn17("lsof", ["-t", `-iTCP:${port}`, "-sTCP:LISTEN"], {
109986
109993
  stdio: ["ignore", "pipe", "ignore"]
109987
109994
  });
109988
109995
  child.stdout.on("data", (b3) => {
@@ -113434,7 +113441,7 @@ function readHeader(headers, name) {
113434
113441
  return v3[0] ?? null;
113435
113442
  return v3 ?? null;
113436
113443
  }
113437
- function readJsonPath(body, path58) {
113444
+ function readJsonPath(body, path59) {
113438
113445
  let parsed;
113439
113446
  try {
113440
113447
  parsed = JSON.parse(body.toString("utf8"));
@@ -113442,7 +113449,7 @@ function readJsonPath(body, path58) {
113442
113449
  return null;
113443
113450
  }
113444
113451
  let cur = parsed;
113445
- for (const seg of path58.split(".")) {
113452
+ for (const seg of path59.split(".")) {
113446
113453
  if (cur === null || cur === void 0 || typeof cur !== "object")
113447
113454
  return null;
113448
113455
  cur = cur[seg];
@@ -116094,8 +116101,8 @@ function findCycle(steps) {
116094
116101
  }
116095
116102
  function formatIssues(error2) {
116096
116103
  return error2.issues.map((iss) => {
116097
- const path58 = iss.path.join(".") || "(root)";
116098
- return `${path58}: ${iss.message}`;
116104
+ const path59 = iss.path.join(".") || "(root)";
116105
+ return `${path59}: ${iss.message}`;
116099
116106
  });
116100
116107
  }
116101
116108
  function validateWorkflow(raw) {
@@ -119682,11 +119689,11 @@ async function pidsListeningOnPort(port) {
119682
119689
  return await runLsof(["-t", `-iTCP:${port}`, "-sTCP:LISTEN"]);
119683
119690
  }
119684
119691
  async function runLsof(args) {
119685
- const { spawn: spawn16 } = await import('child_process');
119692
+ const { spawn: spawn17 } = await import('child_process');
119686
119693
  return await new Promise((resolve12) => {
119687
119694
  let out = "";
119688
119695
  try {
119689
- const child = spawn16("lsof", [...args], {
119696
+ const child = spawn17("lsof", [...args], {
119690
119697
  stdio: ["ignore", "pipe", "ignore"]
119691
119698
  });
119692
119699
  child.stdout.on("data", (b3) => {
@@ -119754,6 +119761,145 @@ function cliVersion() {
119754
119761
  }
119755
119762
  }
119756
119763
 
119764
+ // src/update/registry.ts
119765
+ var REGISTRY = "https://registry.npmjs.org";
119766
+ var DEFAULT_PKG = "@moxxy/cli";
119767
+ var DEFAULT_TIMEOUT_MS = 4e3;
119768
+ async function fetchLatest(pkg = DEFAULT_PKG, opts = {}) {
119769
+ const fetchImpl2 = opts.fetchImpl ?? fetch;
119770
+ const url2 = `${REGISTRY}/${pkg}/latest`;
119771
+ const controller = new AbortController();
119772
+ const timer = setTimeout(() => controller.abort(), opts.timeoutMs ?? DEFAULT_TIMEOUT_MS);
119773
+ try {
119774
+ const res = await fetchImpl2(url2, {
119775
+ signal: controller.signal,
119776
+ headers: { accept: "application/json" }
119777
+ });
119778
+ if (!res.ok) return null;
119779
+ const json = await res.json();
119780
+ return typeof json.version === "string" ? json.version : null;
119781
+ } catch {
119782
+ return null;
119783
+ } finally {
119784
+ clearTimeout(timer);
119785
+ }
119786
+ }
119787
+
119788
+ // src/update/check.ts
119789
+ var CACHE_TTL_MS = 12 * 60 * 60 * 1e3;
119790
+ var PKG = "@moxxy/cli";
119791
+ function defaultCacheFile() {
119792
+ return path3.join(os5.homedir(), ".moxxy", "update-check.json");
119793
+ }
119794
+ function compareSemver(a2, b3) {
119795
+ const parse2 = (s2) => (s2.split("-")[0] ?? "").split(".").map((n2) => Number.parseInt(n2, 10) || 0);
119796
+ const pa = parse2(a2);
119797
+ const pb = parse2(b3);
119798
+ for (let i2 = 0; i2 < 3; i2 += 1) {
119799
+ const d2 = (pa[i2] ?? 0) - (pb[i2] ?? 0);
119800
+ if (d2 !== 0) return d2 < 0 ? -1 : 1;
119801
+ }
119802
+ return 0;
119803
+ }
119804
+ function readCache(file) {
119805
+ try {
119806
+ const raw = JSON.parse(readFileSync(file, "utf8"));
119807
+ if (typeof raw.checkedAt === "number" && typeof raw.latest === "string") {
119808
+ return { checkedAt: raw.checkedAt, latest: raw.latest };
119809
+ }
119810
+ } catch {
119811
+ }
119812
+ return null;
119813
+ }
119814
+ function writeCache(file, value) {
119815
+ try {
119816
+ mkdirSync(path3.dirname(file), { recursive: true });
119817
+ const tmp = `${file}.tmp-${process.pid}`;
119818
+ writeFileSync(tmp, JSON.stringify(value, null, 2));
119819
+ renameSync(tmp, file);
119820
+ } catch {
119821
+ }
119822
+ }
119823
+ function shape(current, latest) {
119824
+ if (!current || !latest) return null;
119825
+ return { current, latest, updateAvailable: compareSemver(latest, current) > 0 };
119826
+ }
119827
+ function readCachedCheck(current, opts = {}) {
119828
+ const cache3 = readCache(opts.cacheFile ?? defaultCacheFile());
119829
+ return shape(current, cache3?.latest ?? null);
119830
+ }
119831
+ async function refreshCheck(current, opts = {}) {
119832
+ const latest = await fetchLatest(PKG, opts);
119833
+ if (latest) {
119834
+ writeCache(opts.cacheFile ?? defaultCacheFile(), {
119835
+ checkedAt: opts.now ?? Date.now(),
119836
+ latest
119837
+ });
119838
+ }
119839
+ return shape(current, latest);
119840
+ }
119841
+ async function checkForCliUpdate(current, opts = {}) {
119842
+ if (!current) return null;
119843
+ const now = opts.now ?? Date.now();
119844
+ const file = opts.cacheFile ?? defaultCacheFile();
119845
+ if (!opts.force) {
119846
+ const cache3 = readCache(file);
119847
+ if (cache3 && now - cache3.checkedAt < CACHE_TTL_MS) {
119848
+ return shape(current, cache3.latest);
119849
+ }
119850
+ }
119851
+ const refreshed = await refreshCheck(current, { ...opts, cacheFile: file, now });
119852
+ return refreshed ?? shape(current, readCache(file)?.latest ?? null);
119853
+ }
119854
+ var PKG2 = "@moxxy/cli";
119855
+ function detectInstall(opts = {}) {
119856
+ const fromUrl = opts.fromUrl ?? import.meta.url;
119857
+ const ua = opts.userAgent ?? process.env.npm_config_user_agent ?? "";
119858
+ let installPath = null;
119859
+ try {
119860
+ installPath = fileURLToPath(fromUrl);
119861
+ } catch {
119862
+ installPath = null;
119863
+ }
119864
+ const p3 = (installPath ?? "").replace(/\\/g, "/");
119865
+ if (p3.includes("/packages/cli/")) {
119866
+ return { manager: "workspace", global: false, pkg: PKG2, cmd: [], installPath };
119867
+ }
119868
+ const manager = inferManager(p3, ua);
119869
+ const global2 = looksGlobal(p3, (opts.cwd ?? process.cwd()).replace(/\\/g, "/"));
119870
+ return { manager, global: global2, pkg: PKG2, cmd: upgradeCmd(manager, global2), installPath };
119871
+ }
119872
+ function inferManager(p3, ua) {
119873
+ const head = ua.split("/")[0]?.toLowerCase();
119874
+ if (head === "pnpm" || head === "yarn" || head === "bun" || head === "npm") return head;
119875
+ if (/(^|\/)\.?pnpm(\/|-global|$)|\/library\/pnpm\//i.test(p3)) return "pnpm";
119876
+ if (/\/\.bun\//i.test(p3)) return "bun";
119877
+ if (/\/\.?yarn\//i.test(p3) || /\/\.config\/yarn\//i.test(p3)) return "yarn";
119878
+ return "npm";
119879
+ }
119880
+ function looksGlobal(p3, cwd2) {
119881
+ if (!p3) return true;
119882
+ if (p3.includes(`${cwd2}/node_modules/`)) return false;
119883
+ return true;
119884
+ }
119885
+ function upgradeCmd(manager, global2) {
119886
+ const target = `${PKG2}@latest`;
119887
+ switch (manager) {
119888
+ case "pnpm":
119889
+ return ["pnpm", "add", ...global2 ? ["-g"] : [], target];
119890
+ case "yarn":
119891
+ return global2 ? ["yarn", "global", "add", target] : ["yarn", "add", target];
119892
+ case "bun":
119893
+ return ["bun", "add", ...global2 ? ["-g"] : [], target];
119894
+ case "npm":
119895
+ default:
119896
+ return ["npm", "install", ...global2 ? ["-g"] : [], target];
119897
+ }
119898
+ }
119899
+ function formatCmd(cmd) {
119900
+ return cmd.join(" ");
119901
+ }
119902
+
119757
119903
  // src/validate-key.ts
119758
119904
  async function validateProviderKey(providerName, key, providers) {
119759
119905
  const def = providers.list().find((p3) => p3.name === providerName);
@@ -120135,6 +120281,13 @@ async function killStaleRunnerAt(socketPath) {
120135
120281
  } catch {
120136
120282
  }
120137
120283
  }
120284
+ function resolveUpdateNotice(version) {
120285
+ if (!version) return void 0;
120286
+ if (detectInstall().manager === "workspace") return void 0;
120287
+ void refreshCheck(version).catch(() => void 0);
120288
+ const cached = readCachedCheck(version);
120289
+ return cached?.updateAvailable ? { latest: cached.latest } : void 0;
120290
+ }
120138
120291
  async function runTuiWithBootstrap(argv, tuiOpts = {}) {
120139
120292
  const standalone = hasBoolFlag(argv, "standalone");
120140
120293
  const mode = chooseClientMode({ standalone, runnerUp: standalone ? false : await isRunnerUp() });
@@ -120171,6 +120324,7 @@ async function runAttachedTui(argv, tuiOpts) {
120171
120324
  const prefs = await loadPreferences();
120172
120325
  const effectiveModel = stringFlag(argv, "model") ?? prefs.model;
120173
120326
  const version = cliVersion();
120327
+ const updateNotice = resolveUpdateNotice(version);
120174
120328
  let shuttingDown = false;
120175
120329
  const shutdown = async () => {
120176
120330
  if (shuttingDown) return;
@@ -120190,6 +120344,7 @@ async function runAttachedTui(argv, tuiOpts) {
120190
120344
  },
120191
120345
  ...effectiveModel ? { model: effectiveModel } : {},
120192
120346
  ...version ? { version } : {},
120347
+ ...updateNotice ? { updateAvailable: updateNotice } : {},
120193
120348
  // Land directly in the (replayed) conversation rather than the splash.
120194
120349
  resumed: true
120195
120350
  })
@@ -120241,6 +120396,7 @@ async function runSelfHostedTui(argv, tuiOpts, standalone) {
120241
120396
  });
120242
120397
  const effectiveModel = stringFlag(argv, "model") ?? (await loadPreferences()).model;
120243
120398
  const version = cliVersion();
120399
+ const updateNotice = resolveUpdateNotice(version);
120244
120400
  let bootedSession = null;
120245
120401
  let runnerServer = null;
120246
120402
  let webHandle = null;
@@ -120299,6 +120455,7 @@ async function runSelfHostedTui(argv, tuiOpts, standalone) {
120299
120455
  },
120300
120456
  ...effectiveModel ? { model: effectiveModel } : {},
120301
120457
  ...version ? { version } : {},
120458
+ ...updateNotice ? { updateAvailable: updateNotice } : {},
120302
120459
  ...tuiOpts.resumeSessionId ? { resumed: true } : {}
120303
120460
  })
120304
120461
  );
@@ -123820,6 +123977,114 @@ async function runSelfUpdateCommand(argv) {
123820
123977
  ${HELP13}`);
123821
123978
  return 2;
123822
123979
  }
123980
+ var HELP14 = formatHelp({
123981
+ title: "moxxy update",
123982
+ tagline: "update the moxxy CLI to the latest published version",
123983
+ sections: [
123984
+ {
123985
+ title: "USAGE",
123986
+ rows: [
123987
+ ["moxxy update", "check npm + upgrade (asks before running)"],
123988
+ ["moxxy update --check", "report current vs latest, print the command, do nothing"],
123989
+ ["moxxy update --yes", "upgrade without the confirmation prompt"]
123990
+ ]
123991
+ },
123992
+ {
123993
+ title: "NOTES",
123994
+ notes: [
123995
+ "Detects npm / pnpm / yarn / bun (global or local) and runs the matching upgrade.",
123996
+ "From a source checkout, update with git instead \u2014 nothing is installed."
123997
+ ]
123998
+ }
123999
+ ]
124000
+ });
124001
+ async function runCommand(cmd) {
124002
+ const [bin, ...args] = cmd;
124003
+ if (!bin) return 1;
124004
+ return new Promise((resolve12) => {
124005
+ const proc = spawn(bin, args, {
124006
+ stdio: "inherit",
124007
+ // npm/pnpm/yarn/bun are `.cmd` shims on Windows — needs a shell to launch.
124008
+ shell: process.platform === "win32"
124009
+ });
124010
+ proc.on("error", () => resolve12(127));
124011
+ proc.on("exit", (code) => resolve12(code ?? 1));
124012
+ });
124013
+ }
124014
+ async function runUpdateCommand(argv, deps = {}) {
124015
+ if (helpRequested(argv) || argv.positional[0] === "help") {
124016
+ process.stdout.write(HELP14);
124017
+ return 0;
124018
+ }
124019
+ const out = deps.out ?? ((s2) => process.stdout.write(s2));
124020
+ const current = deps.current ?? cliVersion();
124021
+ const checkOnly = hasBoolFlag(argv, "check") || hasBoolFlag(argv, "dry-run");
124022
+ const check = deps.check ?? ((c2) => checkForCliUpdate(c2, { force: true }));
124023
+ const detect = deps.detect ?? (() => detectInstall());
124024
+ const run2 = deps.run ?? runCommand;
124025
+ out(colors.dim("Checking for updates\u2026\n"));
124026
+ const result = await check(current);
124027
+ if (!result) {
124028
+ const info2 = detect();
124029
+ out(colors.dim(`Could not reach the npm registry. Current version: ${current ?? "unknown"}.
124030
+ `));
124031
+ if (info2.manager !== "workspace") {
124032
+ out(colors.dim("To update manually:\n ") + colors.bold(formatCmd(info2.cmd)) + "\n");
124033
+ }
124034
+ return 0;
124035
+ }
124036
+ if (!result.updateAvailable) {
124037
+ out(colors.green("\u2713 ") + `You're on the latest moxxy (v${result.current}).
124038
+ `);
124039
+ return 0;
124040
+ }
124041
+ out(
124042
+ `Update available: ${colors.dim("v" + result.current)} \u2192 ${colors.bold(colors.green("v" + result.latest))}
124043
+ `
124044
+ );
124045
+ const info = detect();
124046
+ if (info.manager === "workspace") {
124047
+ out(
124048
+ colors.dim(
124049
+ "You're running moxxy from a source checkout \u2014 nothing to install.\nUpdate with: "
124050
+ ) + colors.bold("git pull") + colors.dim(" && pnpm install && pnpm build") + "\n"
124051
+ );
124052
+ return 0;
124053
+ }
124054
+ const cmdStr = formatCmd(info.cmd);
124055
+ out(colors.dim("Will run: ") + colors.bold(cmdStr) + "\n");
124056
+ if (checkOnly) return 0;
124057
+ const interactive = deps.interactive ?? Boolean(process.stdin.isTTY);
124058
+ let proceed = confirmedYes(argv);
124059
+ if (!proceed) {
124060
+ if (!interactive) {
124061
+ out(colors.dim("Re-run with --yes to apply, or run the command above yourself.\n"));
124062
+ return 0;
124063
+ }
124064
+ const ask = deps.promptConfirm ?? defaultConfirm;
124065
+ proceed = await ask(`Run \`${cmdStr}\` now?`);
124066
+ if (!proceed) {
124067
+ out(colors.dim("Skipped. Run the command above when you're ready.\n"));
124068
+ return 0;
124069
+ }
124070
+ }
124071
+ out(colors.dim(`
124072
+ $ ${cmdStr}
124073
+ `));
124074
+ const code = await run2(info.cmd);
124075
+ if (code === 0) {
124076
+ out("\n" + colors.green("\u2713 ") + `Updated to v${result.latest}. Restart moxxy to use it.
124077
+ `);
124078
+ return 0;
124079
+ }
124080
+ printError(`update command exited with code ${code}`);
124081
+ return code || 1;
124082
+ }
124083
+ async function defaultConfirm(message) {
124084
+ const answer = await ue2({ message });
124085
+ if (q2(answer)) return false;
124086
+ return answer === true;
124087
+ }
123823
124088
 
123824
124089
  // src/bin.ts
123825
124090
  await init_dist9();
@@ -123883,7 +124148,8 @@ var SECTIONS = [
123883
124148
  ["init", "interactive first-time setup (provider keys \u2192 vault)"],
123884
124149
  ["login <provider>", "OAuth sign-in for providers that don't use API keys"],
123885
124150
  ["login status|logout", "inspect / remove stored OAuth credentials"],
123886
- ["doctor [--check-keys]", "diagnose config, vault, providers, channels, memory"]
124151
+ ["doctor [--check-keys]", "diagnose config, vault, providers, channels, memory"],
124152
+ ["update [--check|--yes]", "upgrade the moxxy CLI to the latest published version"]
123887
124153
  ]
123888
124154
  },
123889
124155
  {
@@ -124001,6 +124267,7 @@ var COMMANDS = {
124001
124267
  mcp: runMcpCommand,
124002
124268
  schedule: runScheduleCommand,
124003
124269
  doctor: runDoctorCommand,
124270
+ update: runUpdateCommand,
124004
124271
  prompt: runPromptCommand,
124005
124272
  tui: runTuiCommand,
124006
124273
  resume: runResumeCommand,