@moxxy/cli 0.1.5 → 0.2.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
@@ -6,8 +6,8 @@ import fs36__default, { existsSync, promises, ReadStream, readFileSync, statSync
6
6
  import * as path3 from 'path';
7
7
  import path3__default, { basename } from 'path';
8
8
  import { z } from 'zod';
9
- import * as os3 from 'os';
10
- import os3__default, { homedir, userInfo } from 'os';
9
+ import * as os5 from 'os';
10
+ import os5__default, { homedir, userInfo } from 'os';
11
11
  import { createRequire as createRequire$1 } from 'module';
12
12
  import Url, { fileURLToPath, pathToFileURL } from 'url';
13
13
  import Stream, { Readable as Readable$1, PassThrough as PassThrough$2, Stream as Stream$1 } from 'stream';
@@ -17,7 +17,7 @@ import zlib from 'zlib';
17
17
  import { webcrypto, randomBytes, createHash, scryptSync, createCipheriv, createDecipheriv, randomUUID, createHmac, timingSafeEqual } from 'crypto';
18
18
  import 'zod/v3';
19
19
  import * as z4mini from 'zod/v4-mini';
20
- import * as z22 from 'zod/v4';
20
+ import * as z24 from 'zod/v4';
21
21
  import V3, { stdin, stdout, env, cwd } from 'process';
22
22
  import tty, { ReadStream as ReadStream$1 } from 'tty';
23
23
  import { once, EventEmitter } from 'events';
@@ -774,7 +774,7 @@ async function discoverPlugins(opts) {
774
774
  async function candidateRoots(cwd2) {
775
775
  const out = [];
776
776
  let cursor = path3.resolve(cwd2);
777
- for (let i2 = 0; i2 < 8; i2++) {
777
+ for (let i2 = 0; i2 < MAX_NODE_MODULES_WALK_DEPTH; i2++) {
778
778
  out.push(path3.join(cursor, "node_modules"));
779
779
  const parent = path3.dirname(cursor);
780
780
  if (parent === cursor)
@@ -833,8 +833,10 @@ async function readPluginManifest(packagePath, logger) {
833
833
  ...requirements ? { requirements } : {}
834
834
  };
835
835
  }
836
+ var MAX_NODE_MODULES_WALK_DEPTH;
836
837
  var init_discovery = __esm({
837
838
  "../core/dist/plugins/discovery.js"() {
839
+ MAX_NODE_MODULES_WALK_DEPTH = 8;
838
840
  }
839
841
  });
840
842
 
@@ -1030,6 +1032,8 @@ var init_host = __esm({
1030
1032
  this.opts.commands.unregister(cmdName);
1031
1033
  for (const transcriberName of record2.transcriberNames)
1032
1034
  this.opts.transcribers.unregister(transcriberName);
1035
+ for (const synthName of record2.synthesizerNames)
1036
+ this.opts.synthesizers.unregister(synthName);
1033
1037
  for (const embedderName of record2.embedderNames)
1034
1038
  this.opts.embedders.unregister(embedderName);
1035
1039
  for (const isolatorName of record2.isolatorNames)
@@ -1057,7 +1061,7 @@ var init_host = __esm({
1057
1061
  applyPlugin(plugin4, manifest) {
1058
1062
  const toolNames = (plugin4.tools ?? []).map((t2) => t2.name);
1059
1063
  const providerNames = (plugin4.providers ?? []).map((p3) => p3.name);
1060
- const modeNames = (plugin4.modes ?? []).map((l2) => l2.name);
1064
+ const modeNames = (plugin4.modes ?? []).map((m3) => m3.name);
1061
1065
  const compactorNames = (plugin4.compactors ?? []).map((c2) => c2.name);
1062
1066
  const cacheStrategyNames = (plugin4.cacheStrategies ?? []).map((c2) => c2.name);
1063
1067
  const viewRendererNames = (plugin4.viewRenderers ?? []).map((v3) => v3.name);
@@ -1066,6 +1070,7 @@ var init_host = __esm({
1066
1070
  const agentNames = (plugin4.agents ?? []).map((a2) => a2.name);
1067
1071
  const commandNames = (plugin4.commands ?? []).map((c2) => c2.name);
1068
1072
  const transcriberNames = (plugin4.transcribers ?? []).map((t2) => t2.name);
1073
+ const synthesizerNames = (plugin4.synthesizers ?? []).map((s2) => s2.name);
1069
1074
  const embedderNames = (plugin4.embedders ?? []).map((e3) => e3.name);
1070
1075
  const isolatorNames = (plugin4.isolators ?? []).map((i2) => i2.name);
1071
1076
  const workflowExecutorNames = (plugin4.workflowExecutors ?? []).map((w4) => w4.name);
@@ -1073,8 +1078,8 @@ var init_host = __esm({
1073
1078
  this.opts.tools.register(tool);
1074
1079
  for (const provider of plugin4.providers ?? [])
1075
1080
  this.opts.providers.register(provider);
1076
- for (const loop of plugin4.modes ?? [])
1077
- this.opts.modes.register(loop);
1081
+ for (const mode of plugin4.modes ?? [])
1082
+ this.opts.modes.register(mode);
1078
1083
  for (const compactor of plugin4.compactors ?? [])
1079
1084
  this.opts.compactors.register(compactor);
1080
1085
  for (const cacheStrategy of plugin4.cacheStrategies ?? [])
@@ -1091,6 +1096,8 @@ var init_host = __esm({
1091
1096
  this.opts.commands.register(cmd);
1092
1097
  for (const transcriber of plugin4.transcribers ?? [])
1093
1098
  this.opts.transcribers.register(transcriber);
1099
+ for (const synth of plugin4.synthesizers ?? [])
1100
+ this.opts.synthesizers.register(synth);
1094
1101
  for (const embedder of plugin4.embedders ?? [])
1095
1102
  this.opts.embedders.register(embedder);
1096
1103
  for (const isolator of plugin4.isolators ?? [])
@@ -1111,6 +1118,7 @@ var init_host = __esm({
1111
1118
  agentNames,
1112
1119
  commandNames,
1113
1120
  transcriberNames,
1121
+ synthesizerNames,
1114
1122
  embedderNames,
1115
1123
  isolatorNames,
1116
1124
  workflowExecutorNames
@@ -1225,7 +1233,7 @@ var ModeRegistry;
1225
1233
  var init_modes = __esm({
1226
1234
  "../core/dist/registries/modes.js"() {
1227
1235
  ModeRegistry = class {
1228
- strategies = /* @__PURE__ */ new Map();
1236
+ modes = /* @__PURE__ */ new Map();
1229
1237
  active = null;
1230
1238
  changeListeners = /* @__PURE__ */ new Set();
1231
1239
  /** Observe active-mode changes — used by the runner to broadcast
@@ -1236,54 +1244,54 @@ var init_modes = __esm({
1236
1244
  return () => this.changeListeners.delete(fn);
1237
1245
  }
1238
1246
  /**
1239
- * Register a strategy. Throws on duplicate — use `replace()` for
1247
+ * Register a mode. Throws on duplicate — use `replace()` for
1240
1248
  * overwrite. Auto-activates on first registration (modes need a default
1241
1249
  * for any session to work).
1242
1250
  */
1243
- register(strategy) {
1244
- if (this.strategies.has(strategy.name)) {
1245
- throw new Error(`Mode already registered: ${strategy.name}`);
1251
+ register(mode) {
1252
+ if (this.modes.has(mode.name)) {
1253
+ throw new Error(`Mode already registered: ${mode.name}`);
1246
1254
  }
1247
- this.strategies.set(strategy.name, strategy);
1255
+ this.modes.set(mode.name, mode);
1248
1256
  if (!this.active)
1249
- this.activate(strategy);
1257
+ this.activate(mode);
1250
1258
  }
1251
- replace(strategy) {
1252
- this.strategies.set(strategy.name, strategy);
1259
+ replace(mode) {
1260
+ this.modes.set(mode.name, mode);
1253
1261
  if (!this.active)
1254
- this.activate(strategy);
1262
+ this.activate(mode);
1255
1263
  }
1256
1264
  /**
1257
- * Remove a strategy. If it was active, the active slot is cleared —
1265
+ * Remove a mode. If it was active, the active slot is cleared —
1258
1266
  * callers must `setActive()` explicitly rather than silently picking
1259
- * some arbitrary "next" strategy.
1267
+ * some arbitrary "next" mode.
1260
1268
  */
1261
1269
  unregister(name) {
1262
- this.strategies.delete(name);
1270
+ this.modes.delete(name);
1263
1271
  if (this.active === name)
1264
1272
  this.active = null;
1265
1273
  }
1266
1274
  list() {
1267
- return [...this.strategies.values()];
1275
+ return [...this.modes.values()];
1268
1276
  }
1269
1277
  setActive(name) {
1270
- const strategy = this.strategies.get(name);
1271
- if (!strategy)
1278
+ const mode = this.modes.get(name);
1279
+ if (!mode)
1272
1280
  throw new Error(`Mode not registered: ${name}`);
1273
- this.activate(strategy);
1281
+ this.activate(mode);
1274
1282
  }
1275
1283
  getActive() {
1276
1284
  if (!this.active)
1277
1285
  throw new Error("No active mode registered.");
1278
- const s2 = this.strategies.get(this.active);
1279
- if (!s2)
1286
+ const mode = this.modes.get(this.active);
1287
+ if (!mode)
1280
1288
  throw new Error(`Active mode missing: ${this.active}`);
1281
- return s2;
1289
+ return mode;
1282
1290
  }
1283
- activate(strategy) {
1284
- if (this.active === strategy.name)
1291
+ activate(mode) {
1292
+ if (this.active === mode.name)
1285
1293
  return;
1286
- this.active = strategy.name;
1294
+ this.active = mode.name;
1287
1295
  for (const fn of this.changeListeners)
1288
1296
  fn();
1289
1297
  }
@@ -2060,9 +2068,17 @@ var init_tools2 = __esm({
2060
2068
  tools = /* @__PURE__ */ new Map();
2061
2069
  defaultLogger;
2062
2070
  defaultCwd;
2071
+ /**
2072
+ * Vault-backed secret resolver, when the host wires one. Surfaced to
2073
+ * every tool handler as `ctx.getSecret(name)` so plugins can read an
2074
+ * API key at call time without the value ever entering the model's
2075
+ * context or `process.env`.
2076
+ */
2077
+ secretResolver;
2063
2078
  constructor(opts) {
2064
2079
  this.defaultLogger = opts.logger;
2065
2080
  this.defaultCwd = opts.cwd;
2081
+ this.secretResolver = opts.secretResolver;
2066
2082
  }
2067
2083
  list() {
2068
2084
  return [...this.tools.values()];
@@ -2103,7 +2119,8 @@ var init_tools2 = __esm({
2103
2119
  signal,
2104
2120
  log: opts.log ?? emptyLog(),
2105
2121
  logger: opts.logger ?? this.defaultLogger,
2106
- ...opts.subagents ? { subagents: opts.subagents } : {}
2122
+ ...opts.subagents ? { subagents: opts.subagents } : {},
2123
+ ...this.secretResolver ? { getSecret: this.secretResolver } : {}
2107
2124
  };
2108
2125
  const result = await tool.handler(parsed, ctx);
2109
2126
  if (tool.outputSchema)
@@ -2214,22 +2231,30 @@ var init_commands = __esm({
2214
2231
  }
2215
2232
  });
2216
2233
 
2217
- // ../core/dist/registries/transcribers.js
2218
- var TranscriberRegistry;
2219
- var init_transcribers = __esm({
2220
- "../core/dist/registries/transcribers.js"() {
2221
- TranscriberRegistry = class {
2234
+ // ../core/dist/registries/active-backend-registry.js
2235
+ var ActiveBackendRegistry;
2236
+ var init_active_backend_registry = __esm({
2237
+ "../core/dist/registries/active-backend-registry.js"() {
2238
+ ActiveBackendRegistry = class {
2239
+ opts;
2222
2240
  defs = /* @__PURE__ */ new Map();
2223
2241
  instances = /* @__PURE__ */ new Map();
2224
2242
  active = null;
2243
+ constructor(opts) {
2244
+ this.opts = opts;
2245
+ }
2225
2246
  register(def, instance) {
2226
2247
  if (this.defs.has(def.name)) {
2227
- throw new Error(`Transcriber already registered: ${def.name}`);
2248
+ throw new Error(`${this.opts.noun} already registered: ${def.name}`);
2228
2249
  }
2229
2250
  this.defs.set(def.name, def);
2230
2251
  if (instance)
2231
2252
  this.instances.set(def.name, instance);
2253
+ if (this.opts.autoAdoptFirst && this.active === null)
2254
+ this.active = def.name;
2232
2255
  }
2256
+ /** Overwrite an existing def, dropping the cached instance so the next build
2257
+ * uses the new def. */
2233
2258
  replace(def, instance) {
2234
2259
  this.defs.set(def.name, def);
2235
2260
  this.instances.delete(def.name);
@@ -2249,34 +2274,104 @@ var init_transcribers = __esm({
2249
2274
  return this.defs.has(name);
2250
2275
  }
2251
2276
  setActive(name, config) {
2252
- const def = this.defs.get(name);
2253
- if (!def)
2254
- throw new Error(`Transcriber not registered: ${name}`);
2277
+ if (!this.defs.has(name))
2278
+ throw new Error(`${this.opts.noun} not registered: ${name}`);
2279
+ if (this.opts.buildOnRead) {
2280
+ if (config)
2281
+ this.instances.set(name, this.buildInstance(name, config));
2282
+ this.active = name;
2283
+ return this.instantiate(name);
2284
+ }
2255
2285
  let instance = this.instances.get(name);
2256
2286
  if (!instance) {
2257
- instance = def.createClient(config ?? {});
2287
+ instance = this.buildInstance(name, config);
2258
2288
  this.instances.set(name, instance);
2259
2289
  }
2260
2290
  this.active = name;
2261
2291
  return instance;
2262
2292
  }
2293
+ /** Deactivate the current backend (callers fall back to their default). */
2294
+ clearActive() {
2295
+ this.active = null;
2296
+ }
2263
2297
  getActive() {
2264
- if (!this.active)
2265
- throw new Error("No active transcriber. Call setActive(name) first.");
2298
+ if (!this.active) {
2299
+ throw new Error(`No active ${this.opts.noun.toLowerCase()}. Call setActive(name) first.`);
2300
+ }
2301
+ if (this.opts.buildOnRead)
2302
+ return this.instantiate(this.active);
2266
2303
  const inst = this.instances.get(this.active);
2267
2304
  if (!inst)
2268
- throw new Error(`Active transcriber has no instance: ${this.active}`);
2305
+ throw new Error(`Active ${this.opts.noun.toLowerCase()} has no instance: ${this.active}`);
2269
2306
  return inst;
2270
2307
  }
2271
- /** Active transcriber, or null when none is configured. Lets channels degrade gracefully. */
2308
+ /** Active backend, or null when none is configured. Lets call sites degrade
2309
+ * gracefully (keyword recall, the OS voice, "no transcriber configured"). */
2272
2310
  tryGetActive() {
2273
2311
  if (!this.active)
2274
2312
  return null;
2313
+ if (this.opts.buildOnRead) {
2314
+ try {
2315
+ return this.instantiate(this.active);
2316
+ } catch {
2317
+ return null;
2318
+ }
2319
+ }
2275
2320
  return this.instances.get(this.active) ?? null;
2276
2321
  }
2277
2322
  getActiveName() {
2278
2323
  return this.active;
2279
2324
  }
2325
+ /** Cached instance for `name`, building it from its def on first use. */
2326
+ instantiate(name) {
2327
+ let inst = this.instances.get(name);
2328
+ if (!inst) {
2329
+ inst = this.buildInstance(name);
2330
+ this.instances.set(name, inst);
2331
+ }
2332
+ return inst;
2333
+ }
2334
+ buildInstance(name, config) {
2335
+ const def = this.defs.get(name);
2336
+ if (!def)
2337
+ throw new Error(`${this.opts.noun} not registered: ${name}`);
2338
+ return this.opts.build(def, config ?? {});
2339
+ }
2340
+ };
2341
+ }
2342
+ });
2343
+
2344
+ // ../core/dist/registries/transcribers.js
2345
+ var TranscriberRegistry;
2346
+ var init_transcribers = __esm({
2347
+ "../core/dist/registries/transcribers.js"() {
2348
+ init_active_backend_registry();
2349
+ TranscriberRegistry = class extends ActiveBackendRegistry {
2350
+ constructor() {
2351
+ super({ noun: "Transcriber", build: (def, config) => def.createClient(config) });
2352
+ }
2353
+ };
2354
+ }
2355
+ });
2356
+
2357
+ // ../core/dist/registries/synthesizers.js
2358
+ var SynthesizerRegistry;
2359
+ var init_synthesizers = __esm({
2360
+ "../core/dist/registries/synthesizers.js"() {
2361
+ init_active_backend_registry();
2362
+ SynthesizerRegistry = class extends ActiveBackendRegistry {
2363
+ constructor(opts = {}) {
2364
+ const { secretResolver } = opts;
2365
+ super({
2366
+ noun: "Synthesizer",
2367
+ autoAdoptFirst: true,
2368
+ buildOnRead: true,
2369
+ build: (def, config) => def.create({
2370
+ config,
2371
+ ...secretResolver ? { getSecret: secretResolver } : {}
2372
+ })
2373
+ });
2374
+ }
2280
2375
  };
2281
2376
  }
2282
2377
  });
@@ -2285,64 +2380,10 @@ var init_transcribers = __esm({
2285
2380
  var EmbedderRegistry;
2286
2381
  var init_embedders = __esm({
2287
2382
  "../core/dist/registries/embedders.js"() {
2288
- EmbedderRegistry = class {
2289
- defs = /* @__PURE__ */ new Map();
2290
- instances = /* @__PURE__ */ new Map();
2291
- active = null;
2292
- register(def, instance) {
2293
- if (this.defs.has(def.name)) {
2294
- throw new Error(`Embedder already registered: ${def.name}`);
2295
- }
2296
- this.defs.set(def.name, def);
2297
- if (instance)
2298
- this.instances.set(def.name, instance);
2299
- }
2300
- replace(def, instance) {
2301
- this.defs.set(def.name, def);
2302
- this.instances.delete(def.name);
2303
- if (instance)
2304
- this.instances.set(def.name, instance);
2305
- }
2306
- unregister(name) {
2307
- this.defs.delete(name);
2308
- this.instances.delete(name);
2309
- if (this.active === name)
2310
- this.active = null;
2311
- }
2312
- list() {
2313
- return [...this.defs.values()];
2314
- }
2315
- has(name) {
2316
- return this.defs.has(name);
2317
- }
2318
- setActive(name, config) {
2319
- const def = this.defs.get(name);
2320
- if (!def)
2321
- throw new Error(`Embedder not registered: ${name}`);
2322
- let instance = this.instances.get(name);
2323
- if (!instance) {
2324
- instance = def.createClient(config ?? {});
2325
- this.instances.set(name, instance);
2326
- }
2327
- this.active = name;
2328
- return instance;
2329
- }
2330
- getActive() {
2331
- if (!this.active)
2332
- throw new Error("No active embedder. Call setActive(name) first.");
2333
- const inst = this.instances.get(this.active);
2334
- if (!inst)
2335
- throw new Error(`Active embedder has no instance: ${this.active}`);
2336
- return inst;
2337
- }
2338
- /** Active embedder, or null when none is configured. Lets memory degrade to keyword recall. */
2339
- tryGetActive() {
2340
- if (!this.active)
2341
- return null;
2342
- return this.instances.get(this.active) ?? null;
2343
- }
2344
- getActiveName() {
2345
- return this.active;
2383
+ init_active_backend_registry();
2384
+ EmbedderRegistry = class extends ActiveBackendRegistry {
2385
+ constructor() {
2386
+ super({ noun: "Embedder", build: (def, config) => def.createClient(config) });
2346
2387
  }
2347
2388
  };
2348
2389
  }
@@ -2517,8 +2558,12 @@ var init_requirements = __esm({
2517
2558
  const def = this.opts.transcribers.list().find((t2) => t2.name === name);
2518
2559
  return def ? { kind: kind3, name, active: this.opts.transcribers.getActiveName() === name } : null;
2519
2560
  }
2561
+ case "synthesizer": {
2562
+ const def = this.opts.synthesizers.list().find((s2) => s2.name === name);
2563
+ return def ? { kind: kind3, name, active: this.opts.synthesizers.getActiveName() === name } : null;
2564
+ }
2520
2565
  case "mode": {
2521
- const def = this.opts.modes.list().find((l2) => l2.name === name);
2566
+ const def = this.opts.modes.list().find((m3) => m3.name === name);
2522
2567
  return def ? { kind: kind3, name, active: activeModeName(this.opts.modes) === name } : null;
2523
2568
  }
2524
2569
  case "compactor": {
@@ -2772,6 +2817,7 @@ var init_session = __esm({
2772
2817
  init_agents();
2773
2818
  init_commands();
2774
2819
  init_transcribers();
2820
+ init_synthesizers();
2775
2821
  init_embedders();
2776
2822
  init_isolators();
2777
2823
  init_workflow_executors();
@@ -2796,6 +2842,7 @@ var init_session = __esm({
2796
2842
  agents;
2797
2843
  commands;
2798
2844
  transcribers;
2845
+ synthesizers;
2799
2846
  embedders;
2800
2847
  isolators;
2801
2848
  workflowExecutors;
@@ -2837,7 +2884,11 @@ var init_session = __esm({
2837
2884
  this.cwd = opts.cwd;
2838
2885
  this.logger = opts.logger ?? (opts.silent ? silentLogger : createLogger());
2839
2886
  this.log = opts.log ?? new EventLog();
2840
- this.tools = new ToolRegistryImpl({ logger: this.logger, cwd: this.cwd });
2887
+ this.tools = new ToolRegistryImpl({
2888
+ logger: this.logger,
2889
+ cwd: this.cwd,
2890
+ ...opts.secretResolver ? { secretResolver: opts.secretResolver } : {}
2891
+ });
2841
2892
  this.providers = new ProviderRegistry();
2842
2893
  this.modes = new ModeRegistry();
2843
2894
  this.compactors = new CompactorRegistry();
@@ -2851,6 +2902,9 @@ var init_session = __esm({
2851
2902
  this.agents = new AgentRegistry();
2852
2903
  this.commands = new CommandRegistry();
2853
2904
  this.transcribers = new TranscriberRegistry();
2905
+ this.synthesizers = new SynthesizerRegistry({
2906
+ ...opts.secretResolver ? { secretResolver: opts.secretResolver } : {}
2907
+ });
2854
2908
  this.embedders = new EmbedderRegistry();
2855
2909
  this.isolators = new IsolatorRegistry();
2856
2910
  this.workflowExecutors = new WorkflowExecutorRegistry();
@@ -2862,7 +2916,8 @@ var init_session = __esm({
2862
2916
  channels: this.channels,
2863
2917
  agents: this.agents,
2864
2918
  commands: this.commands,
2865
- transcribers: this.transcribers
2919
+ transcribers: this.transcribers,
2920
+ synthesizers: this.synthesizers
2866
2921
  });
2867
2922
  this.permissions = opts.permissionEngine ?? new PermissionEngine();
2868
2923
  this.resolver = wrapWithPolicy(opts.permissionResolver ?? autoAllowResolver, this.permissions, (name) => this.tools.get(name)?.permission);
@@ -2884,6 +2939,7 @@ var init_session = __esm({
2884
2939
  agents: this.agents,
2885
2940
  commands: this.commands,
2886
2941
  transcribers: this.transcribers,
2942
+ synthesizers: this.synthesizers,
2887
2943
  embedders: this.embedders,
2888
2944
  isolators: this.isolators,
2889
2945
  workflowExecutors: this.workflowExecutors,
@@ -3007,7 +3063,9 @@ var init_session = __esm({
3007
3063
  // For UI affordance gating (showing / hiding a mic button),
3008
3064
  // any registered transcriber means "voice is wired."
3009
3065
  hasTranscriber: this.transcribers.list().length > 0,
3010
- activeTranscriber: this.transcribers.getActiveName()
3066
+ activeTranscriber: this.transcribers.getActiveName(),
3067
+ hasSynthesizer: this.synthesizers.list().length > 0,
3068
+ activeSynthesizer: this.synthesizers.getActiveName()
3011
3069
  };
3012
3070
  }
3013
3071
  registerHookOptions(_hooks) {
@@ -3016,7 +3074,7 @@ var init_session = __esm({
3016
3074
  }
3017
3075
  });
3018
3076
  function preferencesPath() {
3019
- return path3.join(os3.homedir(), ".moxxy", "preferences.json");
3077
+ return path3.join(os5.homedir(), ".moxxy", "preferences.json");
3020
3078
  }
3021
3079
  async function loadPreferences() {
3022
3080
  try {
@@ -3046,7 +3104,7 @@ var init_preferences = __esm({
3046
3104
  }
3047
3105
  });
3048
3106
  function usageStatsPath() {
3049
- return path3.join(os3.homedir(), ".moxxy", "usage.json");
3107
+ return path3.join(os5.homedir(), ".moxxy", "usage.json");
3050
3108
  }
3051
3109
  function emptyStats() {
3052
3110
  return { version: 1, updatedAt: (/* @__PURE__ */ new Date()).toISOString(), models: {} };
@@ -3215,13 +3273,12 @@ __export(loader_exports, {
3215
3273
  discoverSkills: () => discoverSkills
3216
3274
  });
3217
3275
  async function discoverSkills(opts = {}) {
3218
- const home = os3.homedir();
3219
3276
  const sources = [];
3220
3277
  if (opts.builtinDir)
3221
3278
  sources.push({ dir: opts.builtinDir, scope: "builtin" });
3222
3279
  for (const dir of opts.pluginDirs ?? [])
3223
3280
  sources.push({ dir, scope: "plugin" });
3224
- const userDir = opts.userDir ?? path3.join(home, ".moxxy", "skills");
3281
+ const userDir = opts.userDir ?? defaultUserSkillsDir();
3225
3282
  sources.push({ dir: userDir, scope: "user" });
3226
3283
  if (opts.projectDir)
3227
3284
  sources.push({ dir: opts.projectDir, scope: "project" });
@@ -3277,7 +3334,7 @@ function deriveTriggers(name) {
3277
3334
  return [...out];
3278
3335
  }
3279
3336
  function defaultUserSkillsDir() {
3280
- return path3.join(os3.homedir(), ".moxxy", "skills");
3337
+ return path3.join(os5.homedir(), ".moxxy", "skills");
3281
3338
  }
3282
3339
  function defaultProjectSkillsDir(cwd2) {
3283
3340
  return path3.join(cwd2, ".moxxy", "skills");
@@ -3608,7 +3665,7 @@ var init_selectors = __esm({
3608
3665
  }
3609
3666
  });
3610
3667
  function defaultSessionsDir() {
3611
- return path3.join(os3.homedir(), ".moxxy", "sessions");
3668
+ return path3.join(os5.homedir(), ".moxxy", "sessions");
3612
3669
  }
3613
3670
  async function readIndex(dir = defaultSessionsDir()) {
3614
3671
  const byId = /* @__PURE__ */ new Map();
@@ -4204,7 +4261,7 @@ var require_jiti = __commonJS({
4204
4261
  function V4() {
4205
4262
  return 10 !== n3.getToken() ? (k3(3, [], [2, 5]), false) : (P3(false), 6 === n3.getToken() ? (I3(":"), T2(), U3() || k3(4, [], [2, 5])) : k3(5, [], [2, 5]), a3.pop(), true);
4206
4263
  }
4207
- function z55() {
4264
+ function z58() {
4208
4265
  l3(), T2();
4209
4266
  let e6 = false;
4210
4267
  for (; 2 !== n3.getToken() && 17 !== n3.getToken(); ) {
@@ -4231,14 +4288,14 @@ var require_jiti = __commonJS({
4231
4288
  case 3:
4232
4289
  return G3();
4233
4290
  case 1:
4234
- return z55();
4291
+ return z58();
4235
4292
  case 10:
4236
4293
  return P3(true);
4237
4294
  default:
4238
4295
  return J2();
4239
4296
  }
4240
4297
  }
4241
- return r2(T2, "scanNext"), r2(k3, "handleError"), r2(P3, "parseString"), r2(J2, "parseLiteral"), r2(V4, "parseProperty"), r2(z55, "parseObject"), r2(G3, "parseArray"), r2(U3, "parseValue"), T2(), 17 === n3.getToken() ? !!i4.allowEmptyContent || (k3(4, [], []), false) : U3() ? (17 !== n3.getToken() && k3(9, [], []), true) : (k3(4, [], []), false);
4298
+ return r2(T2, "scanNext"), r2(k3, "handleError"), r2(P3, "parseString"), r2(J2, "parseLiteral"), r2(V4, "parseProperty"), r2(z58, "parseObject"), r2(G3, "parseArray"), r2(U3, "parseValue"), T2(), 17 === n3.getToken() ? !!i4.allowEmptyContent || (k3(4, [], []), false) : U3() ? (17 !== n3.getToken() && k3(9, [], []), true) : (k3(4, [], []), false);
4242
4299
  }
4243
4300
  new Array(W3).fill(0).map((e5, t4) => "\n" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r\n" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\n" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r\n" + " ".repeat(t4)), (function(e5) {
4244
4301
  e5.DEFAULT = { allowTrailingComma: false };
@@ -4247,12 +4304,12 @@ var require_jiti = __commonJS({
4247
4304
  })(H3 || (H3 = {})), (function(e5) {
4248
4305
  e5[e5.OpenBraceToken = 1] = "OpenBraceToken", e5[e5.CloseBraceToken = 2] = "CloseBraceToken", e5[e5.OpenBracketToken = 3] = "OpenBracketToken", e5[e5.CloseBracketToken = 4] = "CloseBracketToken", e5[e5.CommaToken = 5] = "CommaToken", e5[e5.ColonToken = 6] = "ColonToken", e5[e5.NullKeyword = 7] = "NullKeyword", e5[e5.TrueKeyword = 8] = "TrueKeyword", e5[e5.FalseKeyword = 9] = "FalseKeyword", e5[e5.StringLiteral = 10] = "StringLiteral", e5[e5.NumericLiteral = 11] = "NumericLiteral", e5[e5.LineCommentTrivia = 12] = "LineCommentTrivia", e5[e5.BlockCommentTrivia = 13] = "BlockCommentTrivia", e5[e5.LineBreakTrivia = 14] = "LineBreakTrivia", e5[e5.Trivia = 15] = "Trivia", e5[e5.Unknown = 16] = "Unknown", e5[e5.EOF = 17] = "EOF";
4249
4306
  })(Y4 || (Y4 = {}));
4250
- const Q4 = Pe3;
4307
+ const Q3 = Pe3;
4251
4308
  var Z2;
4252
4309
  !(function(e5) {
4253
4310
  e5[e5.InvalidSymbol = 1] = "InvalidSymbol", e5[e5.InvalidNumberFormat = 2] = "InvalidNumberFormat", e5[e5.PropertyNameExpected = 3] = "PropertyNameExpected", e5[e5.ValueExpected = 4] = "ValueExpected", e5[e5.ColonExpected = 5] = "ColonExpected", e5[e5.CommaExpected = 6] = "CommaExpected", e5[e5.CloseBraceExpected = 7] = "CloseBraceExpected", e5[e5.CloseBracketExpected = 8] = "CloseBracketExpected", e5[e5.EndOfFileExpected = 9] = "EndOfFileExpected", e5[e5.InvalidCommentToken = 10] = "InvalidCommentToken", e5[e5.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e5[e5.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e5[e5.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e5[e5.InvalidUnicode = 14] = "InvalidUnicode", e5[e5.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e5[e5.InvalidCharacter = 16] = "InvalidCharacter";
4254
4311
  })(Z2 || (Z2 = {}));
4255
- const X3 = r2((e5, t4) => Q4(N2(t4, e5, "utf8")), "readJsonc"), te3 = /* @__PURE__ */ Symbol("implicitBaseUrl"), ie2 = "${configDir}", se2 = r2(() => {
4312
+ const X3 = r2((e5, t4) => Q3(N2(t4, e5, "utf8")), "readJsonc"), te3 = /* @__PURE__ */ Symbol("implicitBaseUrl"), ie2 = "${configDir}", se2 = r2(() => {
4256
4313
  const { findPnpApi: e5 } = l2;
4257
4314
  return e5 && e5(process.cwd());
4258
4315
  }, "getPnpApi"), re2 = r2((e5, t4, i4, n3) => {
@@ -4424,7 +4481,7 @@ var require_jiti = __commonJS({
4424
4481
  "node" === t4 && (t4 = "node10"), e5.moduleResolution = t4, ("node16" === t4 || "nodenext" === t4 || "bundler" === t4) && (null != e5.resolvePackageJsonExports || (e5.resolvePackageJsonExports = true), null != e5.resolvePackageJsonImports || (e5.resolvePackageJsonImports = true)), "bundler" === t4 && (null != e5.allowSyntheticDefaultImports || (e5.allowSyntheticDefaultImports = true), null != e5.resolveJsonModule || (e5.resolveJsonModule = true));
4425
4482
  }
4426
4483
  e5.jsx && (e5.jsx = e5.jsx.toLowerCase()), e5.moduleDetection && (e5.moduleDetection = e5.moduleDetection.toLowerCase()), e5.importsNotUsedAsValues && (e5.importsNotUsedAsValues = e5.importsNotUsedAsValues.toLowerCase()), e5.newLine && (e5.newLine = e5.newLine.toLowerCase()), e5.esModuleInterop && (null != e5.allowSyntheticDefaultImports || (e5.allowSyntheticDefaultImports = true)), e5.verbatimModuleSyntax && (null != e5.isolatedModules || (e5.isolatedModules = true), null != e5.preserveConstEnums || (e5.preserveConstEnums = true)), e5.isolatedModules && (null != e5.preserveConstEnums || (e5.preserveConstEnums = true)), e5.rewriteRelativeImportExtensions && (null != e5.allowImportingTsExtensions || (e5.allowImportingTsExtensions = true)), e5.lib && (e5.lib = e5.lib.map((e6) => e6.toLowerCase())), e5.checkJs && (null != e5.allowJs || (e5.allowJs = true));
4427
- }, "normalizeCompilerOptions"), ve3 = r2((e5, t4 = /* @__PURE__ */ new Map()) => {
4484
+ }, "normalizeCompilerOptions"), ve2 = r2((e5, t4 = /* @__PURE__ */ new Map()) => {
4428
4485
  const i4 = a2.resolve(e5), n3 = fe2(i4, t4), c3 = a2.dirname(i4), { compilerOptions: l3 } = n3;
4429
4486
  if (l3) {
4430
4487
  for (const e7 of ge3) {
@@ -4522,7 +4579,7 @@ var require_jiti = __commonJS({
4522
4579
  for (; ; ) {
4523
4580
  const e6 = j3(c3, t4, i4);
4524
4581
  if (!e6) return;
4525
- const l3 = a2.resolve(e6), y3 = ve3(l3, i4), E4 = { path: h3(l3), config: y3 };
4582
+ const l3 = a2.resolve(e6), y3 = ve2(l3, i4), E4 = { path: h3(l3), config: y3 };
4526
4583
  if (je2(E4)(n3)) return E4;
4527
4584
  const w5 = a2.dirname(e6), C4 = a2.dirname(w5);
4528
4585
  if (C4 === w5) return;
@@ -4536,7 +4593,7 @@ var require_jiti = __commonJS({
4536
4593
  if (!n3) {
4537
4594
  const n4 = Be2(e5, t4, i4);
4538
4595
  if (!n4) return null;
4539
- return { path: n4, config: ve3(n4, i4) };
4596
+ return { path: n4, config: ve2(n4, i4) };
4540
4597
  }
4541
4598
  return null != (a3 = Fe2(e5, t4, i4)) ? a3 : null;
4542
4599
  }, "getTsconfig"), qe2 = /\*/g, Ge2 = r2((e5, t4) => {
@@ -4683,9 +4740,9 @@ var require_jiti = __commonJS({
4683
4740
  return W3.call(e5, t4);
4684
4741
  }, Y4 = Array.isArray || function(e5) {
4685
4742
  return "[object Array]" === K4.call(e5);
4686
- }, Q4 = /* @__PURE__ */ Object.create(null);
4743
+ }, Q3 = /* @__PURE__ */ Object.create(null);
4687
4744
  function wordsRegexp(e5) {
4688
- return Q4[e5] || (Q4[e5] = new RegExp("^(?:" + e5.replace(/ /g, "|") + ")$"));
4745
+ return Q3[e5] || (Q3[e5] = new RegExp("^(?:" + e5.replace(/ /g, "|") + ")$"));
4689
4746
  }
4690
4747
  function codePointToString(e5) {
4691
4748
  return e5 <= 65535 ? String.fromCharCode(e5) : (e5 -= 65536, String.fromCharCode(55296 + (e5 >> 10), 56320 + (1023 & e5)));
@@ -5777,13 +5834,13 @@ var require_jiti = __commonJS({
5777
5834
  var t4 = this.startNode();
5778
5835
  return this.next(), t4.argument = this.parseMaybeUnary(null, true, false, e5), this.finishNode(t4, "AwaitExpression");
5779
5836
  };
5780
- var ve3 = acorn_Parser.prototype;
5781
- ve3.raise = function(e5, t4) {
5837
+ var ve2 = acorn_Parser.prototype;
5838
+ ve2.raise = function(e5, t4) {
5782
5839
  var i3 = getLineInfo(this.input, e5);
5783
5840
  t4 += " (" + i3.line + ":" + i3.column + ")", this.sourceFile && (t4 += " in " + this.sourceFile);
5784
5841
  var n3 = new SyntaxError(t4);
5785
5842
  throw n3.pos = e5, n3.loc = i3, n3.raisedAt = this.pos, n3;
5786
- }, ve3.raiseRecoverable = ve3.raise, ve3.curPosition = function() {
5843
+ }, ve2.raiseRecoverable = ve2.raise, ve2.curPosition = function() {
5787
5844
  if (this.options.locations) return new acorn_Position(this.curLine, this.pos - this.lineStart);
5788
5845
  };
5789
5846
  var ye3 = acorn_Parser.prototype, acorn_Scope = function(e5) {
@@ -7788,6 +7845,7 @@ __export(dist_exports, {
7788
7845
  SessionPersistence: () => SessionPersistence,
7789
7846
  SkillRegistryImpl: () => SkillRegistryImpl,
7790
7847
  SkillRouter: () => SkillRouter,
7848
+ SynthesizerRegistry: () => SynthesizerRegistry,
7791
7849
  ToolRegistryImpl: () => ToolRegistryImpl,
7792
7850
  TranscriberRegistry: () => TranscriberRegistry,
7793
7851
  TunnelProviderRegistry: () => TunnelProviderRegistry,
@@ -7862,6 +7920,7 @@ var init_dist = __esm({
7862
7920
  init_agents();
7863
7921
  init_commands();
7864
7922
  init_transcribers();
7923
+ init_synthesizers();
7865
7924
  init_embedders();
7866
7925
  init_isolators();
7867
7926
  init_requirements();
@@ -22620,25 +22679,25 @@ function kt(e3, t2, r2, o2, n2, a2) {
22620
22679
  m(e4);
22621
22680
  }
22622
22681
  function B2() {
22623
- return v3 = "closed", r2 ? L3() : z55((() => (Ge(t2) && (T2 = rt(t2), R4 = t2._state), T2 || "closed" === R4 ? c(void 0) : "erroring" === R4 || "errored" === R4 ? d(_2) : (T2 = true, l2.close()))), false, void 0), null;
22682
+ return v3 = "closed", r2 ? L3() : z58((() => (Ge(t2) && (T2 = rt(t2), R4 = t2._state), T2 || "closed" === R4 ? c(void 0) : "erroring" === R4 || "errored" === R4 ? d(_2) : (T2 = true, l2.close()))), false, void 0), null;
22624
22683
  }
22625
22684
  function A3(e4) {
22626
- return w4 || (v3 = "errored", s2 = e4, o2 ? L3(true, e4) : z55((() => l2.abort(e4)), true, e4)), null;
22685
+ return w4 || (v3 = "errored", s2 = e4, o2 ? L3(true, e4) : z58((() => l2.abort(e4)), true, e4)), null;
22627
22686
  }
22628
22687
  function j3(e4) {
22629
- return S2 || (R4 = "errored", _2 = e4, n2 ? L3(true, e4) : z55((() => i2.cancel(e4)), true, e4)), null;
22688
+ return S2 || (R4 = "errored", _2 = e4, n2 ? L3(true, e4) : z58((() => i2.cancel(e4)), true, e4)), null;
22630
22689
  }
22631
22690
  if (void 0 !== a2 && (k3 = () => {
22632
22691
  const e4 = void 0 !== a2.reason ? a2.reason : new Wt("Aborted", "AbortError"), t3 = [];
22633
- o2 || t3.push((() => "writable" === R4 ? l2.abort(e4) : c(void 0))), n2 || t3.push((() => "readable" === v3 ? i2.cancel(e4) : c(void 0))), z55((() => Promise.all(t3.map(((e5) => e5())))), true, e4);
22692
+ o2 || t3.push((() => "writable" === R4 ? l2.abort(e4) : c(void 0))), n2 || t3.push((() => "readable" === v3 ? i2.cancel(e4) : c(void 0))), z58((() => Promise.all(t3.map(((e5) => e5())))), true, e4);
22634
22693
  }, a2.aborted ? k3() : a2.addEventListener("abort", k3)), Vt(e3) && (v3 = e3._state, s2 = e3._storedError), Ge(t2) && (R4 = t2._state, _2 = t2._storedError, T2 = rt(t2)), Vt(e3) && Ge(t2) && (q3 = true, g2()), "errored" === v3) A3(s2);
22635
22694
  else if ("erroring" === R4 || "errored" === R4) j3(_2);
22636
22695
  else if ("closed" === v3) B2();
22637
22696
  else if (T2 || "closed" === R4) {
22638
22697
  const e4 = new TypeError("the destination writable stream closed before all data could be piped to it");
22639
- n2 ? L3(true, e4) : z55((() => i2.cancel(e4)), true, e4);
22698
+ n2 ? L3(true, e4) : z58((() => i2.cancel(e4)), true, e4);
22640
22699
  }
22641
- function z55(e4, t3, r3) {
22700
+ function z58(e4, t3, r3) {
22642
22701
  function o3() {
22643
22702
  return "writable" !== R4 || T2 ? n3() : h((function() {
22644
22703
  let e5;
@@ -22653,7 +22712,7 @@ function kt(e3, t2, r2, o2, n2, a2) {
22653
22712
  w4 || (w4 = true, q3 ? o3() : h(C3, o3));
22654
22713
  }
22655
22714
  function L3(e4, t3) {
22656
- z55(void 0, e4, t3);
22715
+ z58(void 0, e4, t3);
22657
22716
  }
22658
22717
  function F3(e4, t3) {
22659
22718
  return S2 = true, l2.releaseLock(), i2.releaseLock(), void 0 !== a2 && a2.removeEventListener("abort", k3), e4 ? W3(t3) : P3(void 0), null;
@@ -35469,26 +35528,26 @@ var init_types = __esm({
35469
35528
  SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
35470
35529
  RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
35471
35530
  JSONRPC_VERSION = "2.0";
35472
- AssertObjectSchema = z22.custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
35473
- ProgressTokenSchema = z22.union([z22.string(), z22.number().int()]);
35474
- CursorSchema = z22.string();
35475
- z22.looseObject({
35531
+ AssertObjectSchema = z24.custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
35532
+ ProgressTokenSchema = z24.union([z24.string(), z24.number().int()]);
35533
+ CursorSchema = z24.string();
35534
+ z24.looseObject({
35476
35535
  /**
35477
35536
  * Requested duration in milliseconds to retain task from creation.
35478
35537
  */
35479
- ttl: z22.number().optional(),
35538
+ ttl: z24.number().optional(),
35480
35539
  /**
35481
35540
  * Time in milliseconds to wait between task status requests.
35482
35541
  */
35483
- pollInterval: z22.number().optional()
35542
+ pollInterval: z24.number().optional()
35484
35543
  });
35485
- TaskMetadataSchema = z22.object({
35486
- ttl: z22.number().optional()
35544
+ TaskMetadataSchema = z24.object({
35545
+ ttl: z24.number().optional()
35487
35546
  });
35488
- RelatedTaskMetadataSchema = z22.object({
35489
- taskId: z22.string()
35547
+ RelatedTaskMetadataSchema = z24.object({
35548
+ taskId: z24.string()
35490
35549
  });
35491
- RequestMetaSchema = z22.looseObject({
35550
+ RequestMetaSchema = z24.looseObject({
35492
35551
  /**
35493
35552
  * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
35494
35553
  */
@@ -35498,7 +35557,7 @@ var init_types = __esm({
35498
35557
  */
35499
35558
  [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
35500
35559
  });
35501
- BaseRequestParamsSchema = z22.object({
35560
+ BaseRequestParamsSchema = z24.object({
35502
35561
  /**
35503
35562
  * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
35504
35563
  */
@@ -35516,42 +35575,42 @@ var init_types = __esm({
35516
35575
  task: TaskMetadataSchema.optional()
35517
35576
  });
35518
35577
  isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
35519
- RequestSchema = z22.object({
35520
- method: z22.string(),
35578
+ RequestSchema = z24.object({
35579
+ method: z24.string(),
35521
35580
  params: BaseRequestParamsSchema.loose().optional()
35522
35581
  });
35523
- NotificationsParamsSchema = z22.object({
35582
+ NotificationsParamsSchema = z24.object({
35524
35583
  /**
35525
35584
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
35526
35585
  * for notes on _meta usage.
35527
35586
  */
35528
35587
  _meta: RequestMetaSchema.optional()
35529
35588
  });
35530
- NotificationSchema = z22.object({
35531
- method: z22.string(),
35589
+ NotificationSchema = z24.object({
35590
+ method: z24.string(),
35532
35591
  params: NotificationsParamsSchema.loose().optional()
35533
35592
  });
35534
- ResultSchema = z22.looseObject({
35593
+ ResultSchema = z24.looseObject({
35535
35594
  /**
35536
35595
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
35537
35596
  * for notes on _meta usage.
35538
35597
  */
35539
35598
  _meta: RequestMetaSchema.optional()
35540
35599
  });
35541
- RequestIdSchema = z22.union([z22.string(), z22.number().int()]);
35542
- JSONRPCRequestSchema = z22.object({
35543
- jsonrpc: z22.literal(JSONRPC_VERSION),
35600
+ RequestIdSchema = z24.union([z24.string(), z24.number().int()]);
35601
+ JSONRPCRequestSchema = z24.object({
35602
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35544
35603
  id: RequestIdSchema,
35545
35604
  ...RequestSchema.shape
35546
35605
  }).strict();
35547
35606
  isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
35548
- JSONRPCNotificationSchema = z22.object({
35549
- jsonrpc: z22.literal(JSONRPC_VERSION),
35607
+ JSONRPCNotificationSchema = z24.object({
35608
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35550
35609
  ...NotificationSchema.shape
35551
35610
  }).strict();
35552
35611
  isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
35553
- JSONRPCResultResponseSchema = z22.object({
35554
- jsonrpc: z22.literal(JSONRPC_VERSION),
35612
+ JSONRPCResultResponseSchema = z24.object({
35613
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35555
35614
  id: RequestIdSchema,
35556
35615
  result: ResultSchema
35557
35616
  }).strict();
@@ -35566,32 +35625,32 @@ var init_types = __esm({
35566
35625
  ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
35567
35626
  ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
35568
35627
  })(ErrorCode || (ErrorCode = {}));
35569
- JSONRPCErrorResponseSchema = z22.object({
35570
- jsonrpc: z22.literal(JSONRPC_VERSION),
35628
+ JSONRPCErrorResponseSchema = z24.object({
35629
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35571
35630
  id: RequestIdSchema.optional(),
35572
- error: z22.object({
35631
+ error: z24.object({
35573
35632
  /**
35574
35633
  * The error type that occurred.
35575
35634
  */
35576
- code: z22.number().int(),
35635
+ code: z24.number().int(),
35577
35636
  /**
35578
35637
  * A short description of the error. The message SHOULD be limited to a concise single sentence.
35579
35638
  */
35580
- message: z22.string(),
35639
+ message: z24.string(),
35581
35640
  /**
35582
35641
  * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
35583
35642
  */
35584
- data: z22.unknown().optional()
35643
+ data: z24.unknown().optional()
35585
35644
  })
35586
35645
  }).strict();
35587
35646
  isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
35588
- JSONRPCMessageSchema = z22.union([
35647
+ JSONRPCMessageSchema = z24.union([
35589
35648
  JSONRPCRequestSchema,
35590
35649
  JSONRPCNotificationSchema,
35591
35650
  JSONRPCResultResponseSchema,
35592
35651
  JSONRPCErrorResponseSchema
35593
35652
  ]);
35594
- z22.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
35653
+ z24.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
35595
35654
  EmptyResultSchema = ResultSchema.strict();
35596
35655
  CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
35597
35656
  /**
@@ -35603,28 +35662,28 @@ var init_types = __esm({
35603
35662
  /**
35604
35663
  * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
35605
35664
  */
35606
- reason: z22.string().optional()
35665
+ reason: z24.string().optional()
35607
35666
  });
35608
35667
  CancelledNotificationSchema = NotificationSchema.extend({
35609
- method: z22.literal("notifications/cancelled"),
35668
+ method: z24.literal("notifications/cancelled"),
35610
35669
  params: CancelledNotificationParamsSchema
35611
35670
  });
35612
- IconSchema = z22.object({
35671
+ IconSchema = z24.object({
35613
35672
  /**
35614
35673
  * URL or data URI for the icon.
35615
35674
  */
35616
- src: z22.string(),
35675
+ src: z24.string(),
35617
35676
  /**
35618
35677
  * Optional MIME type for the icon.
35619
35678
  */
35620
- mimeType: z22.string().optional(),
35679
+ mimeType: z24.string().optional(),
35621
35680
  /**
35622
35681
  * Optional array of strings that specify sizes at which the icon can be used.
35623
35682
  * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
35624
35683
  *
35625
35684
  * If not provided, the client should assume that the icon can be used at any size.
35626
35685
  */
35627
- sizes: z22.array(z22.string()).optional(),
35686
+ sizes: z24.array(z24.string()).optional(),
35628
35687
  /**
35629
35688
  * Optional specifier for the theme this icon is designed for. `light` indicates
35630
35689
  * the icon is designed to be used with a light background, and `dark` indicates
@@ -35632,9 +35691,9 @@ var init_types = __esm({
35632
35691
  *
35633
35692
  * If not provided, the client should assume the icon can be used with any theme.
35634
35693
  */
35635
- theme: z22.enum(["light", "dark"]).optional()
35694
+ theme: z24.enum(["light", "dark"]).optional()
35636
35695
  });
35637
- IconsSchema = z22.object({
35696
+ IconsSchema = z24.object({
35638
35697
  /**
35639
35698
  * Optional set of sized icons that the client can display in a user interface.
35640
35699
  *
@@ -35646,11 +35705,11 @@ var init_types = __esm({
35646
35705
  * - `image/svg+xml` - SVG images (scalable but requires security precautions)
35647
35706
  * - `image/webp` - WebP images (modern, efficient format)
35648
35707
  */
35649
- icons: z22.array(IconSchema).optional()
35708
+ icons: z24.array(IconSchema).optional()
35650
35709
  });
35651
- BaseMetadataSchema = z22.object({
35710
+ BaseMetadataSchema = z24.object({
35652
35711
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
35653
- name: z22.string(),
35712
+ name: z24.string(),
35654
35713
  /**
35655
35714
  * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
35656
35715
  * even by those unfamiliar with domain-specific terminology.
@@ -35659,16 +35718,16 @@ var init_types = __esm({
35659
35718
  * where `annotations.title` should be given precedence over using `name`,
35660
35719
  * if present).
35661
35720
  */
35662
- title: z22.string().optional()
35721
+ title: z24.string().optional()
35663
35722
  });
35664
35723
  ImplementationSchema = BaseMetadataSchema.extend({
35665
35724
  ...BaseMetadataSchema.shape,
35666
35725
  ...IconsSchema.shape,
35667
- version: z22.string(),
35726
+ version: z24.string(),
35668
35727
  /**
35669
35728
  * An optional URL of the website for this implementation.
35670
35729
  */
35671
- websiteUrl: z22.string().optional(),
35730
+ websiteUrl: z24.string().optional(),
35672
35731
  /**
35673
35732
  * An optional human-readable description of what this implementation does.
35674
35733
  *
@@ -35676,23 +35735,23 @@ var init_types = __esm({
35676
35735
  * and capabilities. For example, a server might describe the types of resources
35677
35736
  * or tools it provides, while a client might describe its intended use case.
35678
35737
  */
35679
- description: z22.string().optional()
35738
+ description: z24.string().optional()
35680
35739
  });
35681
- FormElicitationCapabilitySchema = z22.intersection(z22.object({
35682
- applyDefaults: z22.boolean().optional()
35683
- }), z22.record(z22.string(), z22.unknown()));
35684
- ElicitationCapabilitySchema = z22.preprocess((value) => {
35740
+ FormElicitationCapabilitySchema = z24.intersection(z24.object({
35741
+ applyDefaults: z24.boolean().optional()
35742
+ }), z24.record(z24.string(), z24.unknown()));
35743
+ ElicitationCapabilitySchema = z24.preprocess((value) => {
35685
35744
  if (value && typeof value === "object" && !Array.isArray(value)) {
35686
35745
  if (Object.keys(value).length === 0) {
35687
35746
  return { form: {} };
35688
35747
  }
35689
35748
  }
35690
35749
  return value;
35691
- }, z22.intersection(z22.object({
35750
+ }, z24.intersection(z24.object({
35692
35751
  form: FormElicitationCapabilitySchema.optional(),
35693
35752
  url: AssertObjectSchema.optional()
35694
- }), z22.record(z22.string(), z22.unknown()).optional()));
35695
- ClientTasksCapabilitySchema = z22.looseObject({
35753
+ }), z24.record(z24.string(), z24.unknown()).optional()));
35754
+ ClientTasksCapabilitySchema = z24.looseObject({
35696
35755
  /**
35697
35756
  * Present if the client supports listing tasks.
35698
35757
  */
@@ -35704,22 +35763,22 @@ var init_types = __esm({
35704
35763
  /**
35705
35764
  * Capabilities for task creation on specific request types.
35706
35765
  */
35707
- requests: z22.looseObject({
35766
+ requests: z24.looseObject({
35708
35767
  /**
35709
35768
  * Task support for sampling requests.
35710
35769
  */
35711
- sampling: z22.looseObject({
35770
+ sampling: z24.looseObject({
35712
35771
  createMessage: AssertObjectSchema.optional()
35713
35772
  }).optional(),
35714
35773
  /**
35715
35774
  * Task support for elicitation requests.
35716
35775
  */
35717
- elicitation: z22.looseObject({
35776
+ elicitation: z24.looseObject({
35718
35777
  create: AssertObjectSchema.optional()
35719
35778
  }).optional()
35720
35779
  }).optional()
35721
35780
  });
35722
- ServerTasksCapabilitySchema = z22.looseObject({
35781
+ ServerTasksCapabilitySchema = z24.looseObject({
35723
35782
  /**
35724
35783
  * Present if the server supports listing tasks.
35725
35784
  */
@@ -35731,24 +35790,24 @@ var init_types = __esm({
35731
35790
  /**
35732
35791
  * Capabilities for task creation on specific request types.
35733
35792
  */
35734
- requests: z22.looseObject({
35793
+ requests: z24.looseObject({
35735
35794
  /**
35736
35795
  * Task support for tool requests.
35737
35796
  */
35738
- tools: z22.looseObject({
35797
+ tools: z24.looseObject({
35739
35798
  call: AssertObjectSchema.optional()
35740
35799
  }).optional()
35741
35800
  }).optional()
35742
35801
  });
35743
- ClientCapabilitiesSchema = z22.object({
35802
+ ClientCapabilitiesSchema = z24.object({
35744
35803
  /**
35745
35804
  * Experimental, non-standard capabilities that the client supports.
35746
35805
  */
35747
- experimental: z22.record(z22.string(), AssertObjectSchema).optional(),
35806
+ experimental: z24.record(z24.string(), AssertObjectSchema).optional(),
35748
35807
  /**
35749
35808
  * Present if the client supports sampling from an LLM.
35750
35809
  */
35751
- sampling: z22.object({
35810
+ sampling: z24.object({
35752
35811
  /**
35753
35812
  * Present if the client supports context inclusion via includeContext parameter.
35754
35813
  * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
@@ -35766,11 +35825,11 @@ var init_types = __esm({
35766
35825
  /**
35767
35826
  * Present if the client supports listing roots.
35768
35827
  */
35769
- roots: z22.object({
35828
+ roots: z24.object({
35770
35829
  /**
35771
35830
  * Whether the client supports issuing notifications for changes to the roots list.
35772
35831
  */
35773
- listChanged: z22.boolean().optional()
35832
+ listChanged: z24.boolean().optional()
35774
35833
  }).optional(),
35775
35834
  /**
35776
35835
  * Present if the client supports task creation.
@@ -35779,25 +35838,25 @@ var init_types = __esm({
35779
35838
  /**
35780
35839
  * Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
35781
35840
  */
35782
- extensions: z22.record(z22.string(), AssertObjectSchema).optional()
35841
+ extensions: z24.record(z24.string(), AssertObjectSchema).optional()
35783
35842
  });
35784
35843
  InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
35785
35844
  /**
35786
35845
  * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
35787
35846
  */
35788
- protocolVersion: z22.string(),
35847
+ protocolVersion: z24.string(),
35789
35848
  capabilities: ClientCapabilitiesSchema,
35790
35849
  clientInfo: ImplementationSchema
35791
35850
  });
35792
35851
  InitializeRequestSchema = RequestSchema.extend({
35793
- method: z22.literal("initialize"),
35852
+ method: z24.literal("initialize"),
35794
35853
  params: InitializeRequestParamsSchema
35795
35854
  });
35796
- ServerCapabilitiesSchema = z22.object({
35855
+ ServerCapabilitiesSchema = z24.object({
35797
35856
  /**
35798
35857
  * Experimental, non-standard capabilities that the server supports.
35799
35858
  */
35800
- experimental: z22.record(z22.string(), AssertObjectSchema).optional(),
35859
+ experimental: z24.record(z24.string(), AssertObjectSchema).optional(),
35801
35860
  /**
35802
35861
  * Present if the server supports sending log messages to the client.
35803
35862
  */
@@ -35809,33 +35868,33 @@ var init_types = __esm({
35809
35868
  /**
35810
35869
  * Present if the server offers any prompt templates.
35811
35870
  */
35812
- prompts: z22.object({
35871
+ prompts: z24.object({
35813
35872
  /**
35814
35873
  * Whether this server supports issuing notifications for changes to the prompt list.
35815
35874
  */
35816
- listChanged: z22.boolean().optional()
35875
+ listChanged: z24.boolean().optional()
35817
35876
  }).optional(),
35818
35877
  /**
35819
35878
  * Present if the server offers any resources to read.
35820
35879
  */
35821
- resources: z22.object({
35880
+ resources: z24.object({
35822
35881
  /**
35823
35882
  * Whether this server supports clients subscribing to resource updates.
35824
35883
  */
35825
- subscribe: z22.boolean().optional(),
35884
+ subscribe: z24.boolean().optional(),
35826
35885
  /**
35827
35886
  * Whether this server supports issuing notifications for changes to the resource list.
35828
35887
  */
35829
- listChanged: z22.boolean().optional()
35888
+ listChanged: z24.boolean().optional()
35830
35889
  }).optional(),
35831
35890
  /**
35832
35891
  * Present if the server offers any tools to call.
35833
35892
  */
35834
- tools: z22.object({
35893
+ tools: z24.object({
35835
35894
  /**
35836
35895
  * Whether this server supports issuing notifications for changes to the tool list.
35837
35896
  */
35838
- listChanged: z22.boolean().optional()
35897
+ listChanged: z24.boolean().optional()
35839
35898
  }).optional(),
35840
35899
  /**
35841
35900
  * Present if the server supports task creation.
@@ -35844,13 +35903,13 @@ var init_types = __esm({
35844
35903
  /**
35845
35904
  * Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
35846
35905
  */
35847
- extensions: z22.record(z22.string(), AssertObjectSchema).optional()
35906
+ extensions: z24.record(z24.string(), AssertObjectSchema).optional()
35848
35907
  });
35849
35908
  InitializeResultSchema = ResultSchema.extend({
35850
35909
  /**
35851
35910
  * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
35852
35911
  */
35853
- protocolVersion: z22.string(),
35912
+ protocolVersion: z24.string(),
35854
35913
  capabilities: ServerCapabilitiesSchema,
35855
35914
  serverInfo: ImplementationSchema,
35856
35915
  /**
@@ -35858,32 +35917,32 @@ var init_types = __esm({
35858
35917
  *
35859
35918
  * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
35860
35919
  */
35861
- instructions: z22.string().optional()
35920
+ instructions: z24.string().optional()
35862
35921
  });
35863
35922
  InitializedNotificationSchema = NotificationSchema.extend({
35864
- method: z22.literal("notifications/initialized"),
35923
+ method: z24.literal("notifications/initialized"),
35865
35924
  params: NotificationsParamsSchema.optional()
35866
35925
  });
35867
35926
  isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
35868
35927
  PingRequestSchema = RequestSchema.extend({
35869
- method: z22.literal("ping"),
35928
+ method: z24.literal("ping"),
35870
35929
  params: BaseRequestParamsSchema.optional()
35871
35930
  });
35872
- ProgressSchema = z22.object({
35931
+ ProgressSchema = z24.object({
35873
35932
  /**
35874
35933
  * The progress thus far. This should increase every time progress is made, even if the total is unknown.
35875
35934
  */
35876
- progress: z22.number(),
35935
+ progress: z24.number(),
35877
35936
  /**
35878
35937
  * Total number of items to process (or total progress required), if known.
35879
35938
  */
35880
- total: z22.optional(z22.number()),
35939
+ total: z24.optional(z24.number()),
35881
35940
  /**
35882
35941
  * An optional message describing the current progress.
35883
35942
  */
35884
- message: z22.optional(z22.string())
35943
+ message: z24.optional(z24.string())
35885
35944
  });
35886
- ProgressNotificationParamsSchema = z22.object({
35945
+ ProgressNotificationParamsSchema = z24.object({
35887
35946
  ...NotificationsParamsSchema.shape,
35888
35947
  ...ProgressSchema.shape,
35889
35948
  /**
@@ -35892,7 +35951,7 @@ var init_types = __esm({
35892
35951
  progressToken: ProgressTokenSchema
35893
35952
  });
35894
35953
  ProgressNotificationSchema = NotificationSchema.extend({
35895
- method: z22.literal("notifications/progress"),
35954
+ method: z24.literal("notifications/progress"),
35896
35955
  params: ProgressNotificationParamsSchema
35897
35956
  });
35898
35957
  PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -35912,86 +35971,86 @@ var init_types = __esm({
35912
35971
  */
35913
35972
  nextCursor: CursorSchema.optional()
35914
35973
  });
35915
- TaskStatusSchema = z22.enum(["working", "input_required", "completed", "failed", "cancelled"]);
35916
- TaskSchema = z22.object({
35917
- taskId: z22.string(),
35974
+ TaskStatusSchema = z24.enum(["working", "input_required", "completed", "failed", "cancelled"]);
35975
+ TaskSchema = z24.object({
35976
+ taskId: z24.string(),
35918
35977
  status: TaskStatusSchema,
35919
35978
  /**
35920
35979
  * Time in milliseconds to keep task results available after completion.
35921
35980
  * If null, the task has unlimited lifetime until manually cleaned up.
35922
35981
  */
35923
- ttl: z22.union([z22.number(), z22.null()]),
35982
+ ttl: z24.union([z24.number(), z24.null()]),
35924
35983
  /**
35925
35984
  * ISO 8601 timestamp when the task was created.
35926
35985
  */
35927
- createdAt: z22.string(),
35986
+ createdAt: z24.string(),
35928
35987
  /**
35929
35988
  * ISO 8601 timestamp when the task was last updated.
35930
35989
  */
35931
- lastUpdatedAt: z22.string(),
35932
- pollInterval: z22.optional(z22.number()),
35990
+ lastUpdatedAt: z24.string(),
35991
+ pollInterval: z24.optional(z24.number()),
35933
35992
  /**
35934
35993
  * Optional diagnostic message for failed tasks or other status information.
35935
35994
  */
35936
- statusMessage: z22.optional(z22.string())
35995
+ statusMessage: z24.optional(z24.string())
35937
35996
  });
35938
35997
  CreateTaskResultSchema = ResultSchema.extend({
35939
35998
  task: TaskSchema
35940
35999
  });
35941
36000
  TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
35942
36001
  TaskStatusNotificationSchema = NotificationSchema.extend({
35943
- method: z22.literal("notifications/tasks/status"),
36002
+ method: z24.literal("notifications/tasks/status"),
35944
36003
  params: TaskStatusNotificationParamsSchema
35945
36004
  });
35946
36005
  GetTaskRequestSchema = RequestSchema.extend({
35947
- method: z22.literal("tasks/get"),
36006
+ method: z24.literal("tasks/get"),
35948
36007
  params: BaseRequestParamsSchema.extend({
35949
- taskId: z22.string()
36008
+ taskId: z24.string()
35950
36009
  })
35951
36010
  });
35952
36011
  GetTaskResultSchema = ResultSchema.merge(TaskSchema);
35953
36012
  GetTaskPayloadRequestSchema = RequestSchema.extend({
35954
- method: z22.literal("tasks/result"),
36013
+ method: z24.literal("tasks/result"),
35955
36014
  params: BaseRequestParamsSchema.extend({
35956
- taskId: z22.string()
36015
+ taskId: z24.string()
35957
36016
  })
35958
36017
  });
35959
36018
  ResultSchema.loose();
35960
36019
  ListTasksRequestSchema = PaginatedRequestSchema.extend({
35961
- method: z22.literal("tasks/list")
36020
+ method: z24.literal("tasks/list")
35962
36021
  });
35963
36022
  ListTasksResultSchema = PaginatedResultSchema.extend({
35964
- tasks: z22.array(TaskSchema)
36023
+ tasks: z24.array(TaskSchema)
35965
36024
  });
35966
36025
  CancelTaskRequestSchema = RequestSchema.extend({
35967
- method: z22.literal("tasks/cancel"),
36026
+ method: z24.literal("tasks/cancel"),
35968
36027
  params: BaseRequestParamsSchema.extend({
35969
- taskId: z22.string()
36028
+ taskId: z24.string()
35970
36029
  })
35971
36030
  });
35972
36031
  CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
35973
- ResourceContentsSchema = z22.object({
36032
+ ResourceContentsSchema = z24.object({
35974
36033
  /**
35975
36034
  * The URI of this resource.
35976
36035
  */
35977
- uri: z22.string(),
36036
+ uri: z24.string(),
35978
36037
  /**
35979
36038
  * The MIME type of this resource, if known.
35980
36039
  */
35981
- mimeType: z22.optional(z22.string()),
36040
+ mimeType: z24.optional(z24.string()),
35982
36041
  /**
35983
36042
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
35984
36043
  * for notes on _meta usage.
35985
36044
  */
35986
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36045
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
35987
36046
  });
35988
36047
  TextResourceContentsSchema = ResourceContentsSchema.extend({
35989
36048
  /**
35990
36049
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
35991
36050
  */
35992
- text: z22.string()
36051
+ text: z24.string()
35993
36052
  });
35994
- Base64Schema = z22.string().refine((val) => {
36053
+ Base64Schema = z24.string().refine((val) => {
35995
36054
  try {
35996
36055
  atob(val);
35997
36056
  return true;
@@ -36005,44 +36064,44 @@ var init_types = __esm({
36005
36064
  */
36006
36065
  blob: Base64Schema
36007
36066
  });
36008
- RoleSchema = z22.enum(["user", "assistant"]);
36009
- AnnotationsSchema = z22.object({
36067
+ RoleSchema = z24.enum(["user", "assistant"]);
36068
+ AnnotationsSchema = z24.object({
36010
36069
  /**
36011
36070
  * Intended audience(s) for the resource.
36012
36071
  */
36013
- audience: z22.array(RoleSchema).optional(),
36072
+ audience: z24.array(RoleSchema).optional(),
36014
36073
  /**
36015
36074
  * Importance hint for the resource, from 0 (least) to 1 (most).
36016
36075
  */
36017
- priority: z22.number().min(0).max(1).optional(),
36076
+ priority: z24.number().min(0).max(1).optional(),
36018
36077
  /**
36019
36078
  * ISO 8601 timestamp for the most recent modification.
36020
36079
  */
36021
- lastModified: z22.iso.datetime({ offset: true }).optional()
36080
+ lastModified: z24.iso.datetime({ offset: true }).optional()
36022
36081
  });
36023
- ResourceSchema = z22.object({
36082
+ ResourceSchema = z24.object({
36024
36083
  ...BaseMetadataSchema.shape,
36025
36084
  ...IconsSchema.shape,
36026
36085
  /**
36027
36086
  * The URI of this resource.
36028
36087
  */
36029
- uri: z22.string(),
36088
+ uri: z24.string(),
36030
36089
  /**
36031
36090
  * A description of what this resource represents.
36032
36091
  *
36033
36092
  * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
36034
36093
  */
36035
- description: z22.optional(z22.string()),
36094
+ description: z24.optional(z24.string()),
36036
36095
  /**
36037
36096
  * The MIME type of this resource, if known.
36038
36097
  */
36039
- mimeType: z22.optional(z22.string()),
36098
+ mimeType: z24.optional(z24.string()),
36040
36099
  /**
36041
36100
  * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
36042
36101
  *
36043
36102
  * This can be used by Hosts to display file sizes and estimate context window usage.
36044
36103
  */
36045
- size: z22.optional(z22.number()),
36104
+ size: z24.optional(z24.number()),
36046
36105
  /**
36047
36106
  * Optional annotations for the client.
36048
36107
  */
@@ -36051,25 +36110,25 @@ var init_types = __esm({
36051
36110
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36052
36111
  * for notes on _meta usage.
36053
36112
  */
36054
- _meta: z22.optional(z22.looseObject({}))
36113
+ _meta: z24.optional(z24.looseObject({}))
36055
36114
  });
36056
- ResourceTemplateSchema = z22.object({
36115
+ ResourceTemplateSchema = z24.object({
36057
36116
  ...BaseMetadataSchema.shape,
36058
36117
  ...IconsSchema.shape,
36059
36118
  /**
36060
36119
  * A URI template (according to RFC 6570) that can be used to construct resource URIs.
36061
36120
  */
36062
- uriTemplate: z22.string(),
36121
+ uriTemplate: z24.string(),
36063
36122
  /**
36064
36123
  * A description of what this template is for.
36065
36124
  *
36066
36125
  * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
36067
36126
  */
36068
- description: z22.optional(z22.string()),
36127
+ description: z24.optional(z24.string()),
36069
36128
  /**
36070
36129
  * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
36071
36130
  */
36072
- mimeType: z22.optional(z22.string()),
36131
+ mimeType: z24.optional(z24.string()),
36073
36132
  /**
36074
36133
  * Optional annotations for the client.
36075
36134
  */
@@ -36078,19 +36137,19 @@ var init_types = __esm({
36078
36137
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36079
36138
  * for notes on _meta usage.
36080
36139
  */
36081
- _meta: z22.optional(z22.looseObject({}))
36140
+ _meta: z24.optional(z24.looseObject({}))
36082
36141
  });
36083
36142
  ListResourcesRequestSchema = PaginatedRequestSchema.extend({
36084
- method: z22.literal("resources/list")
36143
+ method: z24.literal("resources/list")
36085
36144
  });
36086
36145
  ListResourcesResultSchema = PaginatedResultSchema.extend({
36087
- resources: z22.array(ResourceSchema)
36146
+ resources: z24.array(ResourceSchema)
36088
36147
  });
36089
36148
  ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
36090
- method: z22.literal("resources/templates/list")
36149
+ method: z24.literal("resources/templates/list")
36091
36150
  });
36092
36151
  ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
36093
- resourceTemplates: z22.array(ResourceTemplateSchema)
36152
+ resourceTemplates: z24.array(ResourceTemplateSchema)
36094
36153
  });
36095
36154
  ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
36096
36155
  /**
@@ -36098,97 +36157,97 @@ var init_types = __esm({
36098
36157
  *
36099
36158
  * @format uri
36100
36159
  */
36101
- uri: z22.string()
36160
+ uri: z24.string()
36102
36161
  });
36103
36162
  ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
36104
36163
  ReadResourceRequestSchema = RequestSchema.extend({
36105
- method: z22.literal("resources/read"),
36164
+ method: z24.literal("resources/read"),
36106
36165
  params: ReadResourceRequestParamsSchema
36107
36166
  });
36108
36167
  ReadResourceResultSchema = ResultSchema.extend({
36109
- contents: z22.array(z22.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
36168
+ contents: z24.array(z24.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
36110
36169
  });
36111
36170
  ResourceListChangedNotificationSchema = NotificationSchema.extend({
36112
- method: z22.literal("notifications/resources/list_changed"),
36171
+ method: z24.literal("notifications/resources/list_changed"),
36113
36172
  params: NotificationsParamsSchema.optional()
36114
36173
  });
36115
36174
  SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
36116
36175
  SubscribeRequestSchema = RequestSchema.extend({
36117
- method: z22.literal("resources/subscribe"),
36176
+ method: z24.literal("resources/subscribe"),
36118
36177
  params: SubscribeRequestParamsSchema
36119
36178
  });
36120
36179
  UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
36121
36180
  UnsubscribeRequestSchema = RequestSchema.extend({
36122
- method: z22.literal("resources/unsubscribe"),
36181
+ method: z24.literal("resources/unsubscribe"),
36123
36182
  params: UnsubscribeRequestParamsSchema
36124
36183
  });
36125
36184
  ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
36126
36185
  /**
36127
36186
  * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
36128
36187
  */
36129
- uri: z22.string()
36188
+ uri: z24.string()
36130
36189
  });
36131
36190
  ResourceUpdatedNotificationSchema = NotificationSchema.extend({
36132
- method: z22.literal("notifications/resources/updated"),
36191
+ method: z24.literal("notifications/resources/updated"),
36133
36192
  params: ResourceUpdatedNotificationParamsSchema
36134
36193
  });
36135
- PromptArgumentSchema = z22.object({
36194
+ PromptArgumentSchema = z24.object({
36136
36195
  /**
36137
36196
  * The name of the argument.
36138
36197
  */
36139
- name: z22.string(),
36198
+ name: z24.string(),
36140
36199
  /**
36141
36200
  * A human-readable description of the argument.
36142
36201
  */
36143
- description: z22.optional(z22.string()),
36202
+ description: z24.optional(z24.string()),
36144
36203
  /**
36145
36204
  * Whether this argument must be provided.
36146
36205
  */
36147
- required: z22.optional(z22.boolean())
36206
+ required: z24.optional(z24.boolean())
36148
36207
  });
36149
- PromptSchema = z22.object({
36208
+ PromptSchema = z24.object({
36150
36209
  ...BaseMetadataSchema.shape,
36151
36210
  ...IconsSchema.shape,
36152
36211
  /**
36153
36212
  * An optional description of what this prompt provides
36154
36213
  */
36155
- description: z22.optional(z22.string()),
36214
+ description: z24.optional(z24.string()),
36156
36215
  /**
36157
36216
  * A list of arguments to use for templating the prompt.
36158
36217
  */
36159
- arguments: z22.optional(z22.array(PromptArgumentSchema)),
36218
+ arguments: z24.optional(z24.array(PromptArgumentSchema)),
36160
36219
  /**
36161
36220
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36162
36221
  * for notes on _meta usage.
36163
36222
  */
36164
- _meta: z22.optional(z22.looseObject({}))
36223
+ _meta: z24.optional(z24.looseObject({}))
36165
36224
  });
36166
36225
  ListPromptsRequestSchema = PaginatedRequestSchema.extend({
36167
- method: z22.literal("prompts/list")
36226
+ method: z24.literal("prompts/list")
36168
36227
  });
36169
36228
  ListPromptsResultSchema = PaginatedResultSchema.extend({
36170
- prompts: z22.array(PromptSchema)
36229
+ prompts: z24.array(PromptSchema)
36171
36230
  });
36172
36231
  GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
36173
36232
  /**
36174
36233
  * The name of the prompt or prompt template.
36175
36234
  */
36176
- name: z22.string(),
36235
+ name: z24.string(),
36177
36236
  /**
36178
36237
  * Arguments to use for templating the prompt.
36179
36238
  */
36180
- arguments: z22.record(z22.string(), z22.string()).optional()
36239
+ arguments: z24.record(z24.string(), z24.string()).optional()
36181
36240
  });
36182
36241
  GetPromptRequestSchema = RequestSchema.extend({
36183
- method: z22.literal("prompts/get"),
36242
+ method: z24.literal("prompts/get"),
36184
36243
  params: GetPromptRequestParamsSchema
36185
36244
  });
36186
- TextContentSchema = z22.object({
36187
- type: z22.literal("text"),
36245
+ TextContentSchema = z24.object({
36246
+ type: z24.literal("text"),
36188
36247
  /**
36189
36248
  * The text content of the message.
36190
36249
  */
36191
- text: z22.string(),
36250
+ text: z24.string(),
36192
36251
  /**
36193
36252
  * Optional annotations for the client.
36194
36253
  */
@@ -36197,10 +36256,10 @@ var init_types = __esm({
36197
36256
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36198
36257
  * for notes on _meta usage.
36199
36258
  */
36200
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36259
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36201
36260
  });
36202
- ImageContentSchema = z22.object({
36203
- type: z22.literal("image"),
36261
+ ImageContentSchema = z24.object({
36262
+ type: z24.literal("image"),
36204
36263
  /**
36205
36264
  * The base64-encoded image data.
36206
36265
  */
@@ -36208,7 +36267,7 @@ var init_types = __esm({
36208
36267
  /**
36209
36268
  * The MIME type of the image. Different providers may support different image types.
36210
36269
  */
36211
- mimeType: z22.string(),
36270
+ mimeType: z24.string(),
36212
36271
  /**
36213
36272
  * Optional annotations for the client.
36214
36273
  */
@@ -36217,10 +36276,10 @@ var init_types = __esm({
36217
36276
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36218
36277
  * for notes on _meta usage.
36219
36278
  */
36220
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36279
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36221
36280
  });
36222
- AudioContentSchema = z22.object({
36223
- type: z22.literal("audio"),
36281
+ AudioContentSchema = z24.object({
36282
+ type: z24.literal("audio"),
36224
36283
  /**
36225
36284
  * The base64-encoded audio data.
36226
36285
  */
@@ -36228,7 +36287,7 @@ var init_types = __esm({
36228
36287
  /**
36229
36288
  * The MIME type of the audio. Different providers may support different audio types.
36230
36289
  */
36231
- mimeType: z22.string(),
36290
+ mimeType: z24.string(),
36232
36291
  /**
36233
36292
  * Optional annotations for the client.
36234
36293
  */
@@ -36237,34 +36296,34 @@ var init_types = __esm({
36237
36296
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36238
36297
  * for notes on _meta usage.
36239
36298
  */
36240
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36299
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36241
36300
  });
36242
- ToolUseContentSchema = z22.object({
36243
- type: z22.literal("tool_use"),
36301
+ ToolUseContentSchema = z24.object({
36302
+ type: z24.literal("tool_use"),
36244
36303
  /**
36245
36304
  * The name of the tool to invoke.
36246
36305
  * Must match a tool name from the request's tools array.
36247
36306
  */
36248
- name: z22.string(),
36307
+ name: z24.string(),
36249
36308
  /**
36250
36309
  * Unique identifier for this tool call.
36251
36310
  * Used to correlate with ToolResultContent in subsequent messages.
36252
36311
  */
36253
- id: z22.string(),
36312
+ id: z24.string(),
36254
36313
  /**
36255
36314
  * Arguments to pass to the tool.
36256
36315
  * Must conform to the tool's inputSchema.
36257
36316
  */
36258
- input: z22.record(z22.string(), z22.unknown()),
36317
+ input: z24.record(z24.string(), z24.unknown()),
36259
36318
  /**
36260
36319
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36261
36320
  * for notes on _meta usage.
36262
36321
  */
36263
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36322
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36264
36323
  });
36265
- EmbeddedResourceSchema = z22.object({
36266
- type: z22.literal("resource"),
36267
- resource: z22.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
36324
+ EmbeddedResourceSchema = z24.object({
36325
+ type: z24.literal("resource"),
36326
+ resource: z24.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
36268
36327
  /**
36269
36328
  * Optional annotations for the client.
36270
36329
  */
@@ -36273,19 +36332,19 @@ var init_types = __esm({
36273
36332
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36274
36333
  * for notes on _meta usage.
36275
36334
  */
36276
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36335
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36277
36336
  });
36278
36337
  ResourceLinkSchema = ResourceSchema.extend({
36279
- type: z22.literal("resource_link")
36338
+ type: z24.literal("resource_link")
36280
36339
  });
36281
- ContentBlockSchema = z22.union([
36340
+ ContentBlockSchema = z24.union([
36282
36341
  TextContentSchema,
36283
36342
  ImageContentSchema,
36284
36343
  AudioContentSchema,
36285
36344
  ResourceLinkSchema,
36286
36345
  EmbeddedResourceSchema
36287
36346
  ]);
36288
- PromptMessageSchema = z22.object({
36347
+ PromptMessageSchema = z24.object({
36289
36348
  role: RoleSchema,
36290
36349
  content: ContentBlockSchema
36291
36350
  });
@@ -36293,24 +36352,24 @@ var init_types = __esm({
36293
36352
  /**
36294
36353
  * An optional description for the prompt.
36295
36354
  */
36296
- description: z22.string().optional(),
36297
- messages: z22.array(PromptMessageSchema)
36355
+ description: z24.string().optional(),
36356
+ messages: z24.array(PromptMessageSchema)
36298
36357
  });
36299
36358
  PromptListChangedNotificationSchema = NotificationSchema.extend({
36300
- method: z22.literal("notifications/prompts/list_changed"),
36359
+ method: z24.literal("notifications/prompts/list_changed"),
36301
36360
  params: NotificationsParamsSchema.optional()
36302
36361
  });
36303
- ToolAnnotationsSchema = z22.object({
36362
+ ToolAnnotationsSchema = z24.object({
36304
36363
  /**
36305
36364
  * A human-readable title for the tool.
36306
36365
  */
36307
- title: z22.string().optional(),
36366
+ title: z24.string().optional(),
36308
36367
  /**
36309
36368
  * If true, the tool does not modify its environment.
36310
36369
  *
36311
36370
  * Default: false
36312
36371
  */
36313
- readOnlyHint: z22.boolean().optional(),
36372
+ readOnlyHint: z24.boolean().optional(),
36314
36373
  /**
36315
36374
  * If true, the tool may perform destructive updates to its environment.
36316
36375
  * If false, the tool performs only additive updates.
@@ -36319,7 +36378,7 @@ var init_types = __esm({
36319
36378
  *
36320
36379
  * Default: true
36321
36380
  */
36322
- destructiveHint: z22.boolean().optional(),
36381
+ destructiveHint: z24.boolean().optional(),
36323
36382
  /**
36324
36383
  * If true, calling the tool repeatedly with the same arguments
36325
36384
  * will have no additional effect on the its environment.
@@ -36328,7 +36387,7 @@ var init_types = __esm({
36328
36387
  *
36329
36388
  * Default: false
36330
36389
  */
36331
- idempotentHint: z22.boolean().optional(),
36390
+ idempotentHint: z24.boolean().optional(),
36332
36391
  /**
36333
36392
  * If true, this tool may interact with an "open world" of external
36334
36393
  * entities. If false, the tool's domain of interaction is closed.
@@ -36337,9 +36396,9 @@ var init_types = __esm({
36337
36396
  *
36338
36397
  * Default: true
36339
36398
  */
36340
- openWorldHint: z22.boolean().optional()
36399
+ openWorldHint: z24.boolean().optional()
36341
36400
  });
36342
- ToolExecutionSchema = z22.object({
36401
+ ToolExecutionSchema = z24.object({
36343
36402
  /**
36344
36403
  * Indicates the tool's preference for task-augmented execution.
36345
36404
  * - "required": Clients MUST invoke the tool as a task
@@ -36348,34 +36407,34 @@ var init_types = __esm({
36348
36407
  *
36349
36408
  * If not present, defaults to "forbidden".
36350
36409
  */
36351
- taskSupport: z22.enum(["required", "optional", "forbidden"]).optional()
36410
+ taskSupport: z24.enum(["required", "optional", "forbidden"]).optional()
36352
36411
  });
36353
- ToolSchema = z22.object({
36412
+ ToolSchema = z24.object({
36354
36413
  ...BaseMetadataSchema.shape,
36355
36414
  ...IconsSchema.shape,
36356
36415
  /**
36357
36416
  * A human-readable description of the tool.
36358
36417
  */
36359
- description: z22.string().optional(),
36418
+ description: z24.string().optional(),
36360
36419
  /**
36361
36420
  * A JSON Schema 2020-12 object defining the expected parameters for the tool.
36362
36421
  * Must have type: 'object' at the root level per MCP spec.
36363
36422
  */
36364
- inputSchema: z22.object({
36365
- type: z22.literal("object"),
36366
- properties: z22.record(z22.string(), AssertObjectSchema).optional(),
36367
- required: z22.array(z22.string()).optional()
36368
- }).catchall(z22.unknown()),
36423
+ inputSchema: z24.object({
36424
+ type: z24.literal("object"),
36425
+ properties: z24.record(z24.string(), AssertObjectSchema).optional(),
36426
+ required: z24.array(z24.string()).optional()
36427
+ }).catchall(z24.unknown()),
36369
36428
  /**
36370
36429
  * An optional JSON Schema 2020-12 object defining the structure of the tool's output
36371
36430
  * returned in the structuredContent field of a CallToolResult.
36372
36431
  * Must have type: 'object' at the root level per MCP spec.
36373
36432
  */
36374
- outputSchema: z22.object({
36375
- type: z22.literal("object"),
36376
- properties: z22.record(z22.string(), AssertObjectSchema).optional(),
36377
- required: z22.array(z22.string()).optional()
36378
- }).catchall(z22.unknown()).optional(),
36433
+ outputSchema: z24.object({
36434
+ type: z24.literal("object"),
36435
+ properties: z24.record(z24.string(), AssertObjectSchema).optional(),
36436
+ required: z24.array(z24.string()).optional()
36437
+ }).catchall(z24.unknown()).optional(),
36379
36438
  /**
36380
36439
  * Optional additional tool information.
36381
36440
  */
@@ -36388,13 +36447,13 @@ var init_types = __esm({
36388
36447
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36389
36448
  * for notes on _meta usage.
36390
36449
  */
36391
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36450
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36392
36451
  });
36393
36452
  ListToolsRequestSchema = PaginatedRequestSchema.extend({
36394
- method: z22.literal("tools/list")
36453
+ method: z24.literal("tools/list")
36395
36454
  });
36396
36455
  ListToolsResultSchema = PaginatedResultSchema.extend({
36397
- tools: z22.array(ToolSchema)
36456
+ tools: z24.array(ToolSchema)
36398
36457
  });
36399
36458
  CallToolResultSchema = ResultSchema.extend({
36400
36459
  /**
@@ -36403,13 +36462,13 @@ var init_types = __esm({
36403
36462
  * If the Tool does not define an outputSchema, this field MUST be present in the result.
36404
36463
  * For backwards compatibility, this field is always present, but it may be empty.
36405
36464
  */
36406
- content: z22.array(ContentBlockSchema).default([]),
36465
+ content: z24.array(ContentBlockSchema).default([]),
36407
36466
  /**
36408
36467
  * An object containing structured tool output.
36409
36468
  *
36410
36469
  * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
36411
36470
  */
36412
- structuredContent: z22.record(z22.string(), z22.unknown()).optional(),
36471
+ structuredContent: z24.record(z24.string(), z24.unknown()).optional(),
36413
36472
  /**
36414
36473
  * Whether the tool call ended in an error.
36415
36474
  *
@@ -36424,30 +36483,30 @@ var init_types = __esm({
36424
36483
  * server does not support tool calls, or any other exceptional conditions,
36425
36484
  * should be reported as an MCP error response.
36426
36485
  */
36427
- isError: z22.boolean().optional()
36486
+ isError: z24.boolean().optional()
36428
36487
  });
36429
36488
  CallToolResultSchema.or(ResultSchema.extend({
36430
- toolResult: z22.unknown()
36489
+ toolResult: z24.unknown()
36431
36490
  }));
36432
36491
  CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36433
36492
  /**
36434
36493
  * The name of the tool to call.
36435
36494
  */
36436
- name: z22.string(),
36495
+ name: z24.string(),
36437
36496
  /**
36438
36497
  * Arguments to pass to the tool.
36439
36498
  */
36440
- arguments: z22.record(z22.string(), z22.unknown()).optional()
36499
+ arguments: z24.record(z24.string(), z24.unknown()).optional()
36441
36500
  });
36442
36501
  CallToolRequestSchema = RequestSchema.extend({
36443
- method: z22.literal("tools/call"),
36502
+ method: z24.literal("tools/call"),
36444
36503
  params: CallToolRequestParamsSchema
36445
36504
  });
36446
36505
  ToolListChangedNotificationSchema = NotificationSchema.extend({
36447
- method: z22.literal("notifications/tools/list_changed"),
36506
+ method: z24.literal("notifications/tools/list_changed"),
36448
36507
  params: NotificationsParamsSchema.optional()
36449
36508
  });
36450
- ListChangedOptionsBaseSchema = z22.object({
36509
+ ListChangedOptionsBaseSchema = z24.object({
36451
36510
  /**
36452
36511
  * If true, the list will be refreshed automatically when a list changed notification is received.
36453
36512
  * The callback will be called with the updated list.
@@ -36456,7 +36515,7 @@ var init_types = __esm({
36456
36515
  *
36457
36516
  * @default true
36458
36517
  */
36459
- autoRefresh: z22.boolean().default(true),
36518
+ autoRefresh: z24.boolean().default(true),
36460
36519
  /**
36461
36520
  * Debounce time in milliseconds for list changed notification processing.
36462
36521
  *
@@ -36465,9 +36524,9 @@ var init_types = __esm({
36465
36524
  *
36466
36525
  * @default 300
36467
36526
  */
36468
- debounceMs: z22.number().int().nonnegative().default(300)
36527
+ debounceMs: z24.number().int().nonnegative().default(300)
36469
36528
  });
36470
- LoggingLevelSchema = z22.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
36529
+ LoggingLevelSchema = z24.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
36471
36530
  SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
36472
36531
  /**
36473
36532
  * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
@@ -36475,7 +36534,7 @@ var init_types = __esm({
36475
36534
  level: LoggingLevelSchema
36476
36535
  });
36477
36536
  SetLevelRequestSchema = RequestSchema.extend({
36478
- method: z22.literal("logging/setLevel"),
36537
+ method: z24.literal("logging/setLevel"),
36479
36538
  params: SetLevelRequestParamsSchema
36480
36539
  });
36481
36540
  LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
@@ -36486,80 +36545,80 @@ var init_types = __esm({
36486
36545
  /**
36487
36546
  * An optional name of the logger issuing this message.
36488
36547
  */
36489
- logger: z22.string().optional(),
36548
+ logger: z24.string().optional(),
36490
36549
  /**
36491
36550
  * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
36492
36551
  */
36493
- data: z22.unknown()
36552
+ data: z24.unknown()
36494
36553
  });
36495
36554
  LoggingMessageNotificationSchema = NotificationSchema.extend({
36496
- method: z22.literal("notifications/message"),
36555
+ method: z24.literal("notifications/message"),
36497
36556
  params: LoggingMessageNotificationParamsSchema
36498
36557
  });
36499
- ModelHintSchema = z22.object({
36558
+ ModelHintSchema = z24.object({
36500
36559
  /**
36501
36560
  * A hint for a model name.
36502
36561
  */
36503
- name: z22.string().optional()
36562
+ name: z24.string().optional()
36504
36563
  });
36505
- ModelPreferencesSchema = z22.object({
36564
+ ModelPreferencesSchema = z24.object({
36506
36565
  /**
36507
36566
  * Optional hints to use for model selection.
36508
36567
  */
36509
- hints: z22.array(ModelHintSchema).optional(),
36568
+ hints: z24.array(ModelHintSchema).optional(),
36510
36569
  /**
36511
36570
  * How much to prioritize cost when selecting a model.
36512
36571
  */
36513
- costPriority: z22.number().min(0).max(1).optional(),
36572
+ costPriority: z24.number().min(0).max(1).optional(),
36514
36573
  /**
36515
36574
  * How much to prioritize sampling speed (latency) when selecting a model.
36516
36575
  */
36517
- speedPriority: z22.number().min(0).max(1).optional(),
36576
+ speedPriority: z24.number().min(0).max(1).optional(),
36518
36577
  /**
36519
36578
  * How much to prioritize intelligence and capabilities when selecting a model.
36520
36579
  */
36521
- intelligencePriority: z22.number().min(0).max(1).optional()
36580
+ intelligencePriority: z24.number().min(0).max(1).optional()
36522
36581
  });
36523
- ToolChoiceSchema = z22.object({
36582
+ ToolChoiceSchema = z24.object({
36524
36583
  /**
36525
36584
  * Controls when tools are used:
36526
36585
  * - "auto": Model decides whether to use tools (default)
36527
36586
  * - "required": Model MUST use at least one tool before completing
36528
36587
  * - "none": Model MUST NOT use any tools
36529
36588
  */
36530
- mode: z22.enum(["auto", "required", "none"]).optional()
36589
+ mode: z24.enum(["auto", "required", "none"]).optional()
36531
36590
  });
36532
- ToolResultContentSchema = z22.object({
36533
- type: z22.literal("tool_result"),
36534
- toolUseId: z22.string().describe("The unique identifier for the corresponding tool call."),
36535
- content: z22.array(ContentBlockSchema).default([]),
36536
- structuredContent: z22.object({}).loose().optional(),
36537
- isError: z22.boolean().optional(),
36591
+ ToolResultContentSchema = z24.object({
36592
+ type: z24.literal("tool_result"),
36593
+ toolUseId: z24.string().describe("The unique identifier for the corresponding tool call."),
36594
+ content: z24.array(ContentBlockSchema).default([]),
36595
+ structuredContent: z24.object({}).loose().optional(),
36596
+ isError: z24.boolean().optional(),
36538
36597
  /**
36539
36598
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36540
36599
  * for notes on _meta usage.
36541
36600
  */
36542
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36601
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36543
36602
  });
36544
- SamplingContentSchema = z22.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
36545
- SamplingMessageContentBlockSchema = z22.discriminatedUnion("type", [
36603
+ SamplingContentSchema = z24.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
36604
+ SamplingMessageContentBlockSchema = z24.discriminatedUnion("type", [
36546
36605
  TextContentSchema,
36547
36606
  ImageContentSchema,
36548
36607
  AudioContentSchema,
36549
36608
  ToolUseContentSchema,
36550
36609
  ToolResultContentSchema
36551
36610
  ]);
36552
- SamplingMessageSchema = z22.object({
36611
+ SamplingMessageSchema = z24.object({
36553
36612
  role: RoleSchema,
36554
- content: z22.union([SamplingMessageContentBlockSchema, z22.array(SamplingMessageContentBlockSchema)]),
36613
+ content: z24.union([SamplingMessageContentBlockSchema, z24.array(SamplingMessageContentBlockSchema)]),
36555
36614
  /**
36556
36615
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36557
36616
  * for notes on _meta usage.
36558
36617
  */
36559
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36618
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36560
36619
  });
36561
36620
  CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36562
- messages: z22.array(SamplingMessageSchema),
36621
+ messages: z24.array(SamplingMessageSchema),
36563
36622
  /**
36564
36623
  * The server's preferences for which model to select. The client MAY modify or omit this request.
36565
36624
  */
@@ -36567,7 +36626,7 @@ var init_types = __esm({
36567
36626
  /**
36568
36627
  * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
36569
36628
  */
36570
- systemPrompt: z22.string().optional(),
36629
+ systemPrompt: z24.string().optional(),
36571
36630
  /**
36572
36631
  * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
36573
36632
  * The client MAY ignore this request.
@@ -36575,15 +36634,15 @@ var init_types = __esm({
36575
36634
  * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
36576
36635
  * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
36577
36636
  */
36578
- includeContext: z22.enum(["none", "thisServer", "allServers"]).optional(),
36579
- temperature: z22.number().optional(),
36637
+ includeContext: z24.enum(["none", "thisServer", "allServers"]).optional(),
36638
+ temperature: z24.number().optional(),
36580
36639
  /**
36581
36640
  * The requested maximum number of tokens to sample (to prevent runaway completions).
36582
36641
  *
36583
36642
  * The client MAY choose to sample fewer tokens than the requested maximum.
36584
36643
  */
36585
- maxTokens: z22.number().int(),
36586
- stopSequences: z22.array(z22.string()).optional(),
36644
+ maxTokens: z24.number().int(),
36645
+ stopSequences: z24.array(z24.string()).optional(),
36587
36646
  /**
36588
36647
  * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
36589
36648
  */
@@ -36592,7 +36651,7 @@ var init_types = __esm({
36592
36651
  * Tools that the model may use during generation.
36593
36652
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
36594
36653
  */
36595
- tools: z22.array(ToolSchema).optional(),
36654
+ tools: z24.array(ToolSchema).optional(),
36596
36655
  /**
36597
36656
  * Controls how the model uses tools.
36598
36657
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
@@ -36601,14 +36660,14 @@ var init_types = __esm({
36601
36660
  toolChoice: ToolChoiceSchema.optional()
36602
36661
  });
36603
36662
  CreateMessageRequestSchema = RequestSchema.extend({
36604
- method: z22.literal("sampling/createMessage"),
36663
+ method: z24.literal("sampling/createMessage"),
36605
36664
  params: CreateMessageRequestParamsSchema
36606
36665
  });
36607
36666
  CreateMessageResultSchema = ResultSchema.extend({
36608
36667
  /**
36609
36668
  * The name of the model that generated the message.
36610
36669
  */
36611
- model: z22.string(),
36670
+ model: z24.string(),
36612
36671
  /**
36613
36672
  * The reason why sampling stopped, if known.
36614
36673
  *
@@ -36619,7 +36678,7 @@ var init_types = __esm({
36619
36678
  *
36620
36679
  * This field is an open string to allow for provider-specific stop reasons.
36621
36680
  */
36622
- stopReason: z22.optional(z22.enum(["endTurn", "stopSequence", "maxTokens"]).or(z22.string())),
36681
+ stopReason: z24.optional(z24.enum(["endTurn", "stopSequence", "maxTokens"]).or(z24.string())),
36623
36682
  role: RoleSchema,
36624
36683
  /**
36625
36684
  * Response content. Single content block (text, image, or audio).
@@ -36630,7 +36689,7 @@ var init_types = __esm({
36630
36689
  /**
36631
36690
  * The name of the model that generated the message.
36632
36691
  */
36633
- model: z22.string(),
36692
+ model: z24.string(),
36634
36693
  /**
36635
36694
  * The reason why sampling stopped, if known.
36636
36695
  *
@@ -36642,144 +36701,144 @@ var init_types = __esm({
36642
36701
  *
36643
36702
  * This field is an open string to allow for provider-specific stop reasons.
36644
36703
  */
36645
- stopReason: z22.optional(z22.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z22.string())),
36704
+ stopReason: z24.optional(z24.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z24.string())),
36646
36705
  role: RoleSchema,
36647
36706
  /**
36648
36707
  * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
36649
36708
  */
36650
- content: z22.union([SamplingMessageContentBlockSchema, z22.array(SamplingMessageContentBlockSchema)])
36651
- });
36652
- BooleanSchemaSchema = z22.object({
36653
- type: z22.literal("boolean"),
36654
- title: z22.string().optional(),
36655
- description: z22.string().optional(),
36656
- default: z22.boolean().optional()
36657
- });
36658
- StringSchemaSchema = z22.object({
36659
- type: z22.literal("string"),
36660
- title: z22.string().optional(),
36661
- description: z22.string().optional(),
36662
- minLength: z22.number().optional(),
36663
- maxLength: z22.number().optional(),
36664
- format: z22.enum(["email", "uri", "date", "date-time"]).optional(),
36665
- default: z22.string().optional()
36666
- });
36667
- NumberSchemaSchema = z22.object({
36668
- type: z22.enum(["number", "integer"]),
36669
- title: z22.string().optional(),
36670
- description: z22.string().optional(),
36671
- minimum: z22.number().optional(),
36672
- maximum: z22.number().optional(),
36673
- default: z22.number().optional()
36674
- });
36675
- UntitledSingleSelectEnumSchemaSchema = z22.object({
36676
- type: z22.literal("string"),
36677
- title: z22.string().optional(),
36678
- description: z22.string().optional(),
36679
- enum: z22.array(z22.string()),
36680
- default: z22.string().optional()
36681
- });
36682
- TitledSingleSelectEnumSchemaSchema = z22.object({
36683
- type: z22.literal("string"),
36684
- title: z22.string().optional(),
36685
- description: z22.string().optional(),
36686
- oneOf: z22.array(z22.object({
36687
- const: z22.string(),
36688
- title: z22.string()
36709
+ content: z24.union([SamplingMessageContentBlockSchema, z24.array(SamplingMessageContentBlockSchema)])
36710
+ });
36711
+ BooleanSchemaSchema = z24.object({
36712
+ type: z24.literal("boolean"),
36713
+ title: z24.string().optional(),
36714
+ description: z24.string().optional(),
36715
+ default: z24.boolean().optional()
36716
+ });
36717
+ StringSchemaSchema = z24.object({
36718
+ type: z24.literal("string"),
36719
+ title: z24.string().optional(),
36720
+ description: z24.string().optional(),
36721
+ minLength: z24.number().optional(),
36722
+ maxLength: z24.number().optional(),
36723
+ format: z24.enum(["email", "uri", "date", "date-time"]).optional(),
36724
+ default: z24.string().optional()
36725
+ });
36726
+ NumberSchemaSchema = z24.object({
36727
+ type: z24.enum(["number", "integer"]),
36728
+ title: z24.string().optional(),
36729
+ description: z24.string().optional(),
36730
+ minimum: z24.number().optional(),
36731
+ maximum: z24.number().optional(),
36732
+ default: z24.number().optional()
36733
+ });
36734
+ UntitledSingleSelectEnumSchemaSchema = z24.object({
36735
+ type: z24.literal("string"),
36736
+ title: z24.string().optional(),
36737
+ description: z24.string().optional(),
36738
+ enum: z24.array(z24.string()),
36739
+ default: z24.string().optional()
36740
+ });
36741
+ TitledSingleSelectEnumSchemaSchema = z24.object({
36742
+ type: z24.literal("string"),
36743
+ title: z24.string().optional(),
36744
+ description: z24.string().optional(),
36745
+ oneOf: z24.array(z24.object({
36746
+ const: z24.string(),
36747
+ title: z24.string()
36689
36748
  })),
36690
- default: z22.string().optional()
36691
- });
36692
- LegacyTitledEnumSchemaSchema = z22.object({
36693
- type: z22.literal("string"),
36694
- title: z22.string().optional(),
36695
- description: z22.string().optional(),
36696
- enum: z22.array(z22.string()),
36697
- enumNames: z22.array(z22.string()).optional(),
36698
- default: z22.string().optional()
36699
- });
36700
- SingleSelectEnumSchemaSchema = z22.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
36701
- UntitledMultiSelectEnumSchemaSchema = z22.object({
36702
- type: z22.literal("array"),
36703
- title: z22.string().optional(),
36704
- description: z22.string().optional(),
36705
- minItems: z22.number().optional(),
36706
- maxItems: z22.number().optional(),
36707
- items: z22.object({
36708
- type: z22.literal("string"),
36709
- enum: z22.array(z22.string())
36749
+ default: z24.string().optional()
36750
+ });
36751
+ LegacyTitledEnumSchemaSchema = z24.object({
36752
+ type: z24.literal("string"),
36753
+ title: z24.string().optional(),
36754
+ description: z24.string().optional(),
36755
+ enum: z24.array(z24.string()),
36756
+ enumNames: z24.array(z24.string()).optional(),
36757
+ default: z24.string().optional()
36758
+ });
36759
+ SingleSelectEnumSchemaSchema = z24.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
36760
+ UntitledMultiSelectEnumSchemaSchema = z24.object({
36761
+ type: z24.literal("array"),
36762
+ title: z24.string().optional(),
36763
+ description: z24.string().optional(),
36764
+ minItems: z24.number().optional(),
36765
+ maxItems: z24.number().optional(),
36766
+ items: z24.object({
36767
+ type: z24.literal("string"),
36768
+ enum: z24.array(z24.string())
36710
36769
  }),
36711
- default: z22.array(z22.string()).optional()
36712
- });
36713
- TitledMultiSelectEnumSchemaSchema = z22.object({
36714
- type: z22.literal("array"),
36715
- title: z22.string().optional(),
36716
- description: z22.string().optional(),
36717
- minItems: z22.number().optional(),
36718
- maxItems: z22.number().optional(),
36719
- items: z22.object({
36720
- anyOf: z22.array(z22.object({
36721
- const: z22.string(),
36722
- title: z22.string()
36770
+ default: z24.array(z24.string()).optional()
36771
+ });
36772
+ TitledMultiSelectEnumSchemaSchema = z24.object({
36773
+ type: z24.literal("array"),
36774
+ title: z24.string().optional(),
36775
+ description: z24.string().optional(),
36776
+ minItems: z24.number().optional(),
36777
+ maxItems: z24.number().optional(),
36778
+ items: z24.object({
36779
+ anyOf: z24.array(z24.object({
36780
+ const: z24.string(),
36781
+ title: z24.string()
36723
36782
  }))
36724
36783
  }),
36725
- default: z22.array(z22.string()).optional()
36784
+ default: z24.array(z24.string()).optional()
36726
36785
  });
36727
- MultiSelectEnumSchemaSchema = z22.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
36728
- EnumSchemaSchema = z22.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
36729
- PrimitiveSchemaDefinitionSchema = z22.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
36786
+ MultiSelectEnumSchemaSchema = z24.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
36787
+ EnumSchemaSchema = z24.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
36788
+ PrimitiveSchemaDefinitionSchema = z24.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
36730
36789
  ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36731
36790
  /**
36732
36791
  * The elicitation mode.
36733
36792
  *
36734
36793
  * Optional for backward compatibility. Clients MUST treat missing mode as "form".
36735
36794
  */
36736
- mode: z22.literal("form").optional(),
36795
+ mode: z24.literal("form").optional(),
36737
36796
  /**
36738
36797
  * The message to present to the user describing what information is being requested.
36739
36798
  */
36740
- message: z22.string(),
36799
+ message: z24.string(),
36741
36800
  /**
36742
36801
  * A restricted subset of JSON Schema.
36743
36802
  * Only top-level properties are allowed, without nesting.
36744
36803
  */
36745
- requestedSchema: z22.object({
36746
- type: z22.literal("object"),
36747
- properties: z22.record(z22.string(), PrimitiveSchemaDefinitionSchema),
36748
- required: z22.array(z22.string()).optional()
36804
+ requestedSchema: z24.object({
36805
+ type: z24.literal("object"),
36806
+ properties: z24.record(z24.string(), PrimitiveSchemaDefinitionSchema),
36807
+ required: z24.array(z24.string()).optional()
36749
36808
  })
36750
36809
  });
36751
36810
  ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36752
36811
  /**
36753
36812
  * The elicitation mode.
36754
36813
  */
36755
- mode: z22.literal("url"),
36814
+ mode: z24.literal("url"),
36756
36815
  /**
36757
36816
  * The message to present to the user explaining why the interaction is needed.
36758
36817
  */
36759
- message: z22.string(),
36818
+ message: z24.string(),
36760
36819
  /**
36761
36820
  * The ID of the elicitation, which must be unique within the context of the server.
36762
36821
  * The client MUST treat this ID as an opaque value.
36763
36822
  */
36764
- elicitationId: z22.string(),
36823
+ elicitationId: z24.string(),
36765
36824
  /**
36766
36825
  * The URL that the user should navigate to.
36767
36826
  */
36768
- url: z22.string().url()
36827
+ url: z24.string().url()
36769
36828
  });
36770
- ElicitRequestParamsSchema = z22.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
36829
+ ElicitRequestParamsSchema = z24.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
36771
36830
  ElicitRequestSchema = RequestSchema.extend({
36772
- method: z22.literal("elicitation/create"),
36831
+ method: z24.literal("elicitation/create"),
36773
36832
  params: ElicitRequestParamsSchema
36774
36833
  });
36775
36834
  ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
36776
36835
  /**
36777
36836
  * The ID of the elicitation that completed.
36778
36837
  */
36779
- elicitationId: z22.string()
36838
+ elicitationId: z24.string()
36780
36839
  });
36781
36840
  ElicitationCompleteNotificationSchema = NotificationSchema.extend({
36782
- method: z22.literal("notifications/elicitation/complete"),
36841
+ method: z24.literal("notifications/elicitation/complete"),
36783
36842
  params: ElicitationCompleteNotificationParamsSchema
36784
36843
  });
36785
36844
  ElicitResultSchema = ResultSchema.extend({
@@ -36789,98 +36848,98 @@ var init_types = __esm({
36789
36848
  * - "decline": User explicitly decline the action
36790
36849
  * - "cancel": User dismissed without making an explicit choice
36791
36850
  */
36792
- action: z22.enum(["accept", "decline", "cancel"]),
36851
+ action: z24.enum(["accept", "decline", "cancel"]),
36793
36852
  /**
36794
36853
  * The submitted form data, only present when action is "accept".
36795
36854
  * Contains values matching the requested schema.
36796
36855
  * Per MCP spec, content is "typically omitted" for decline/cancel actions.
36797
36856
  * We normalize null to undefined for leniency while maintaining type compatibility.
36798
36857
  */
36799
- content: z22.preprocess((val) => val === null ? void 0 : val, z22.record(z22.string(), z22.union([z22.string(), z22.number(), z22.boolean(), z22.array(z22.string())])).optional())
36858
+ content: z24.preprocess((val) => val === null ? void 0 : val, z24.record(z24.string(), z24.union([z24.string(), z24.number(), z24.boolean(), z24.array(z24.string())])).optional())
36800
36859
  });
36801
- ResourceTemplateReferenceSchema = z22.object({
36802
- type: z22.literal("ref/resource"),
36860
+ ResourceTemplateReferenceSchema = z24.object({
36861
+ type: z24.literal("ref/resource"),
36803
36862
  /**
36804
36863
  * The URI or URI template of the resource.
36805
36864
  */
36806
- uri: z22.string()
36865
+ uri: z24.string()
36807
36866
  });
36808
- PromptReferenceSchema = z22.object({
36809
- type: z22.literal("ref/prompt"),
36867
+ PromptReferenceSchema = z24.object({
36868
+ type: z24.literal("ref/prompt"),
36810
36869
  /**
36811
36870
  * The name of the prompt or prompt template
36812
36871
  */
36813
- name: z22.string()
36872
+ name: z24.string()
36814
36873
  });
36815
36874
  CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
36816
- ref: z22.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
36875
+ ref: z24.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
36817
36876
  /**
36818
36877
  * The argument's information
36819
36878
  */
36820
- argument: z22.object({
36879
+ argument: z24.object({
36821
36880
  /**
36822
36881
  * The name of the argument
36823
36882
  */
36824
- name: z22.string(),
36883
+ name: z24.string(),
36825
36884
  /**
36826
36885
  * The value of the argument to use for completion matching.
36827
36886
  */
36828
- value: z22.string()
36887
+ value: z24.string()
36829
36888
  }),
36830
- context: z22.object({
36889
+ context: z24.object({
36831
36890
  /**
36832
36891
  * Previously-resolved variables in a URI template or prompt.
36833
36892
  */
36834
- arguments: z22.record(z22.string(), z22.string()).optional()
36893
+ arguments: z24.record(z24.string(), z24.string()).optional()
36835
36894
  }).optional()
36836
36895
  });
36837
36896
  CompleteRequestSchema = RequestSchema.extend({
36838
- method: z22.literal("completion/complete"),
36897
+ method: z24.literal("completion/complete"),
36839
36898
  params: CompleteRequestParamsSchema
36840
36899
  });
36841
36900
  CompleteResultSchema = ResultSchema.extend({
36842
- completion: z22.looseObject({
36901
+ completion: z24.looseObject({
36843
36902
  /**
36844
36903
  * An array of completion values. Must not exceed 100 items.
36845
36904
  */
36846
- values: z22.array(z22.string()).max(100),
36905
+ values: z24.array(z24.string()).max(100),
36847
36906
  /**
36848
36907
  * The total number of completion options available. This can exceed the number of values actually sent in the response.
36849
36908
  */
36850
- total: z22.optional(z22.number().int()),
36909
+ total: z24.optional(z24.number().int()),
36851
36910
  /**
36852
36911
  * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
36853
36912
  */
36854
- hasMore: z22.optional(z22.boolean())
36913
+ hasMore: z24.optional(z24.boolean())
36855
36914
  })
36856
36915
  });
36857
- RootSchema = z22.object({
36916
+ RootSchema = z24.object({
36858
36917
  /**
36859
36918
  * The URI identifying the root. This *must* start with file:// for now.
36860
36919
  */
36861
- uri: z22.string().startsWith("file://"),
36920
+ uri: z24.string().startsWith("file://"),
36862
36921
  /**
36863
36922
  * An optional name for the root.
36864
36923
  */
36865
- name: z22.string().optional(),
36924
+ name: z24.string().optional(),
36866
36925
  /**
36867
36926
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36868
36927
  * for notes on _meta usage.
36869
36928
  */
36870
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36929
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36871
36930
  });
36872
36931
  ListRootsRequestSchema = RequestSchema.extend({
36873
- method: z22.literal("roots/list"),
36932
+ method: z24.literal("roots/list"),
36874
36933
  params: BaseRequestParamsSchema.optional()
36875
36934
  });
36876
36935
  ListRootsResultSchema = ResultSchema.extend({
36877
- roots: z22.array(RootSchema)
36936
+ roots: z24.array(RootSchema)
36878
36937
  });
36879
36938
  RootsListChangedNotificationSchema = NotificationSchema.extend({
36880
- method: z22.literal("notifications/roots/list_changed"),
36939
+ method: z24.literal("notifications/roots/list_changed"),
36881
36940
  params: NotificationsParamsSchema.optional()
36882
36941
  });
36883
- z22.union([
36942
+ z24.union([
36884
36943
  PingRequestSchema,
36885
36944
  InitializeRequestSchema,
36886
36945
  CompleteRequestSchema,
@@ -36899,14 +36958,14 @@ var init_types = __esm({
36899
36958
  ListTasksRequestSchema,
36900
36959
  CancelTaskRequestSchema
36901
36960
  ]);
36902
- z22.union([
36961
+ z24.union([
36903
36962
  CancelledNotificationSchema,
36904
36963
  ProgressNotificationSchema,
36905
36964
  InitializedNotificationSchema,
36906
36965
  RootsListChangedNotificationSchema,
36907
36966
  TaskStatusNotificationSchema
36908
36967
  ]);
36909
- z22.union([
36968
+ z24.union([
36910
36969
  EmptyResultSchema,
36911
36970
  CreateMessageResultSchema,
36912
36971
  CreateMessageResultWithToolsSchema,
@@ -36916,7 +36975,7 @@ var init_types = __esm({
36916
36975
  ListTasksResultSchema,
36917
36976
  CreateTaskResultSchema
36918
36977
  ]);
36919
- z22.union([
36978
+ z24.union([
36920
36979
  PingRequestSchema,
36921
36980
  CreateMessageRequestSchema,
36922
36981
  ElicitRequestSchema,
@@ -36926,7 +36985,7 @@ var init_types = __esm({
36926
36985
  ListTasksRequestSchema,
36927
36986
  CancelTaskRequestSchema
36928
36987
  ]);
36929
- z22.union([
36988
+ z24.union([
36930
36989
  CancelledNotificationSchema,
36931
36990
  ProgressNotificationSchema,
36932
36991
  LoggingMessageNotificationSchema,
@@ -36937,7 +36996,7 @@ var init_types = __esm({
36937
36996
  TaskStatusNotificationSchema,
36938
36997
  ElicitationCompleteNotificationSchema
36939
36998
  ]);
36940
- z22.union([
36999
+ z24.union([
36941
37000
  EmptyResultSchema,
36942
37001
  InitializeResultSchema,
36943
37002
  CompleteResultSchema,
@@ -47129,147 +47188,147 @@ var init_index_node = __esm({
47129
47188
  var SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OptionalSafeUrlSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema;
47130
47189
  var init_auth = __esm({
47131
47190
  "../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
47132
- SafeUrlSchema = z22.url().superRefine((val, ctx) => {
47191
+ SafeUrlSchema = z24.url().superRefine((val, ctx) => {
47133
47192
  if (!URL.canParse(val)) {
47134
47193
  ctx.addIssue({
47135
- code: z22.ZodIssueCode.custom,
47194
+ code: z24.ZodIssueCode.custom,
47136
47195
  message: "URL must be parseable",
47137
47196
  fatal: true
47138
47197
  });
47139
- return z22.NEVER;
47198
+ return z24.NEVER;
47140
47199
  }
47141
47200
  }).refine((url2) => {
47142
47201
  const u2 = new URL(url2);
47143
47202
  return u2.protocol !== "javascript:" && u2.protocol !== "data:" && u2.protocol !== "vbscript:";
47144
47203
  }, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
47145
- OAuthProtectedResourceMetadataSchema = z22.looseObject({
47146
- resource: z22.string().url(),
47147
- authorization_servers: z22.array(SafeUrlSchema).optional(),
47148
- jwks_uri: z22.string().url().optional(),
47149
- scopes_supported: z22.array(z22.string()).optional(),
47150
- bearer_methods_supported: z22.array(z22.string()).optional(),
47151
- resource_signing_alg_values_supported: z22.array(z22.string()).optional(),
47152
- resource_name: z22.string().optional(),
47153
- resource_documentation: z22.string().optional(),
47154
- resource_policy_uri: z22.string().url().optional(),
47155
- resource_tos_uri: z22.string().url().optional(),
47156
- tls_client_certificate_bound_access_tokens: z22.boolean().optional(),
47157
- authorization_details_types_supported: z22.array(z22.string()).optional(),
47158
- dpop_signing_alg_values_supported: z22.array(z22.string()).optional(),
47159
- dpop_bound_access_tokens_required: z22.boolean().optional()
47160
- });
47161
- OAuthMetadataSchema = z22.looseObject({
47162
- issuer: z22.string(),
47204
+ OAuthProtectedResourceMetadataSchema = z24.looseObject({
47205
+ resource: z24.string().url(),
47206
+ authorization_servers: z24.array(SafeUrlSchema).optional(),
47207
+ jwks_uri: z24.string().url().optional(),
47208
+ scopes_supported: z24.array(z24.string()).optional(),
47209
+ bearer_methods_supported: z24.array(z24.string()).optional(),
47210
+ resource_signing_alg_values_supported: z24.array(z24.string()).optional(),
47211
+ resource_name: z24.string().optional(),
47212
+ resource_documentation: z24.string().optional(),
47213
+ resource_policy_uri: z24.string().url().optional(),
47214
+ resource_tos_uri: z24.string().url().optional(),
47215
+ tls_client_certificate_bound_access_tokens: z24.boolean().optional(),
47216
+ authorization_details_types_supported: z24.array(z24.string()).optional(),
47217
+ dpop_signing_alg_values_supported: z24.array(z24.string()).optional(),
47218
+ dpop_bound_access_tokens_required: z24.boolean().optional()
47219
+ });
47220
+ OAuthMetadataSchema = z24.looseObject({
47221
+ issuer: z24.string(),
47163
47222
  authorization_endpoint: SafeUrlSchema,
47164
47223
  token_endpoint: SafeUrlSchema,
47165
47224
  registration_endpoint: SafeUrlSchema.optional(),
47166
- scopes_supported: z22.array(z22.string()).optional(),
47167
- response_types_supported: z22.array(z22.string()),
47168
- response_modes_supported: z22.array(z22.string()).optional(),
47169
- grant_types_supported: z22.array(z22.string()).optional(),
47170
- token_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47171
- token_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47225
+ scopes_supported: z24.array(z24.string()).optional(),
47226
+ response_types_supported: z24.array(z24.string()),
47227
+ response_modes_supported: z24.array(z24.string()).optional(),
47228
+ grant_types_supported: z24.array(z24.string()).optional(),
47229
+ token_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47230
+ token_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47172
47231
  service_documentation: SafeUrlSchema.optional(),
47173
47232
  revocation_endpoint: SafeUrlSchema.optional(),
47174
- revocation_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47175
- revocation_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47176
- introspection_endpoint: z22.string().optional(),
47177
- introspection_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47178
- introspection_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47179
- code_challenge_methods_supported: z22.array(z22.string()).optional(),
47180
- client_id_metadata_document_supported: z22.boolean().optional()
47181
- });
47182
- OpenIdProviderMetadataSchema = z22.looseObject({
47183
- issuer: z22.string(),
47233
+ revocation_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47234
+ revocation_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47235
+ introspection_endpoint: z24.string().optional(),
47236
+ introspection_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47237
+ introspection_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47238
+ code_challenge_methods_supported: z24.array(z24.string()).optional(),
47239
+ client_id_metadata_document_supported: z24.boolean().optional()
47240
+ });
47241
+ OpenIdProviderMetadataSchema = z24.looseObject({
47242
+ issuer: z24.string(),
47184
47243
  authorization_endpoint: SafeUrlSchema,
47185
47244
  token_endpoint: SafeUrlSchema,
47186
47245
  userinfo_endpoint: SafeUrlSchema.optional(),
47187
47246
  jwks_uri: SafeUrlSchema,
47188
47247
  registration_endpoint: SafeUrlSchema.optional(),
47189
- scopes_supported: z22.array(z22.string()).optional(),
47190
- response_types_supported: z22.array(z22.string()),
47191
- response_modes_supported: z22.array(z22.string()).optional(),
47192
- grant_types_supported: z22.array(z22.string()).optional(),
47193
- acr_values_supported: z22.array(z22.string()).optional(),
47194
- subject_types_supported: z22.array(z22.string()),
47195
- id_token_signing_alg_values_supported: z22.array(z22.string()),
47196
- id_token_encryption_alg_values_supported: z22.array(z22.string()).optional(),
47197
- id_token_encryption_enc_values_supported: z22.array(z22.string()).optional(),
47198
- userinfo_signing_alg_values_supported: z22.array(z22.string()).optional(),
47199
- userinfo_encryption_alg_values_supported: z22.array(z22.string()).optional(),
47200
- userinfo_encryption_enc_values_supported: z22.array(z22.string()).optional(),
47201
- request_object_signing_alg_values_supported: z22.array(z22.string()).optional(),
47202
- request_object_encryption_alg_values_supported: z22.array(z22.string()).optional(),
47203
- request_object_encryption_enc_values_supported: z22.array(z22.string()).optional(),
47204
- token_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47205
- token_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47206
- display_values_supported: z22.array(z22.string()).optional(),
47207
- claim_types_supported: z22.array(z22.string()).optional(),
47208
- claims_supported: z22.array(z22.string()).optional(),
47209
- service_documentation: z22.string().optional(),
47210
- claims_locales_supported: z22.array(z22.string()).optional(),
47211
- ui_locales_supported: z22.array(z22.string()).optional(),
47212
- claims_parameter_supported: z22.boolean().optional(),
47213
- request_parameter_supported: z22.boolean().optional(),
47214
- request_uri_parameter_supported: z22.boolean().optional(),
47215
- require_request_uri_registration: z22.boolean().optional(),
47248
+ scopes_supported: z24.array(z24.string()).optional(),
47249
+ response_types_supported: z24.array(z24.string()),
47250
+ response_modes_supported: z24.array(z24.string()).optional(),
47251
+ grant_types_supported: z24.array(z24.string()).optional(),
47252
+ acr_values_supported: z24.array(z24.string()).optional(),
47253
+ subject_types_supported: z24.array(z24.string()),
47254
+ id_token_signing_alg_values_supported: z24.array(z24.string()),
47255
+ id_token_encryption_alg_values_supported: z24.array(z24.string()).optional(),
47256
+ id_token_encryption_enc_values_supported: z24.array(z24.string()).optional(),
47257
+ userinfo_signing_alg_values_supported: z24.array(z24.string()).optional(),
47258
+ userinfo_encryption_alg_values_supported: z24.array(z24.string()).optional(),
47259
+ userinfo_encryption_enc_values_supported: z24.array(z24.string()).optional(),
47260
+ request_object_signing_alg_values_supported: z24.array(z24.string()).optional(),
47261
+ request_object_encryption_alg_values_supported: z24.array(z24.string()).optional(),
47262
+ request_object_encryption_enc_values_supported: z24.array(z24.string()).optional(),
47263
+ token_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47264
+ token_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47265
+ display_values_supported: z24.array(z24.string()).optional(),
47266
+ claim_types_supported: z24.array(z24.string()).optional(),
47267
+ claims_supported: z24.array(z24.string()).optional(),
47268
+ service_documentation: z24.string().optional(),
47269
+ claims_locales_supported: z24.array(z24.string()).optional(),
47270
+ ui_locales_supported: z24.array(z24.string()).optional(),
47271
+ claims_parameter_supported: z24.boolean().optional(),
47272
+ request_parameter_supported: z24.boolean().optional(),
47273
+ request_uri_parameter_supported: z24.boolean().optional(),
47274
+ require_request_uri_registration: z24.boolean().optional(),
47216
47275
  op_policy_uri: SafeUrlSchema.optional(),
47217
47276
  op_tos_uri: SafeUrlSchema.optional(),
47218
- client_id_metadata_document_supported: z22.boolean().optional()
47277
+ client_id_metadata_document_supported: z24.boolean().optional()
47219
47278
  });
47220
- OpenIdProviderDiscoveryMetadataSchema = z22.object({
47279
+ OpenIdProviderDiscoveryMetadataSchema = z24.object({
47221
47280
  ...OpenIdProviderMetadataSchema.shape,
47222
47281
  ...OAuthMetadataSchema.pick({
47223
47282
  code_challenge_methods_supported: true
47224
47283
  }).shape
47225
47284
  });
47226
- OAuthTokensSchema = z22.object({
47227
- access_token: z22.string(),
47228
- id_token: z22.string().optional(),
47285
+ OAuthTokensSchema = z24.object({
47286
+ access_token: z24.string(),
47287
+ id_token: z24.string().optional(),
47229
47288
  // Optional for OAuth 2.1, but necessary in OpenID Connect
47230
- token_type: z22.string(),
47231
- expires_in: z22.coerce.number().optional(),
47232
- scope: z22.string().optional(),
47233
- refresh_token: z22.string().optional()
47289
+ token_type: z24.string(),
47290
+ expires_in: z24.coerce.number().optional(),
47291
+ scope: z24.string().optional(),
47292
+ refresh_token: z24.string().optional()
47234
47293
  }).strip();
47235
- OAuthErrorResponseSchema = z22.object({
47236
- error: z22.string(),
47237
- error_description: z22.string().optional(),
47238
- error_uri: z22.string().optional()
47239
- });
47240
- OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z22.literal("").transform(() => void 0));
47241
- OAuthClientMetadataSchema = z22.object({
47242
- redirect_uris: z22.array(SafeUrlSchema),
47243
- token_endpoint_auth_method: z22.string().optional(),
47244
- grant_types: z22.array(z22.string()).optional(),
47245
- response_types: z22.array(z22.string()).optional(),
47246
- client_name: z22.string().optional(),
47294
+ OAuthErrorResponseSchema = z24.object({
47295
+ error: z24.string(),
47296
+ error_description: z24.string().optional(),
47297
+ error_uri: z24.string().optional()
47298
+ });
47299
+ OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z24.literal("").transform(() => void 0));
47300
+ OAuthClientMetadataSchema = z24.object({
47301
+ redirect_uris: z24.array(SafeUrlSchema),
47302
+ token_endpoint_auth_method: z24.string().optional(),
47303
+ grant_types: z24.array(z24.string()).optional(),
47304
+ response_types: z24.array(z24.string()).optional(),
47305
+ client_name: z24.string().optional(),
47247
47306
  client_uri: SafeUrlSchema.optional(),
47248
47307
  logo_uri: OptionalSafeUrlSchema,
47249
- scope: z22.string().optional(),
47250
- contacts: z22.array(z22.string()).optional(),
47308
+ scope: z24.string().optional(),
47309
+ contacts: z24.array(z24.string()).optional(),
47251
47310
  tos_uri: OptionalSafeUrlSchema,
47252
- policy_uri: z22.string().optional(),
47311
+ policy_uri: z24.string().optional(),
47253
47312
  jwks_uri: SafeUrlSchema.optional(),
47254
- jwks: z22.any().optional(),
47255
- software_id: z22.string().optional(),
47256
- software_version: z22.string().optional(),
47257
- software_statement: z22.string().optional()
47313
+ jwks: z24.any().optional(),
47314
+ software_id: z24.string().optional(),
47315
+ software_version: z24.string().optional(),
47316
+ software_statement: z24.string().optional()
47258
47317
  }).strip();
47259
- OAuthClientInformationSchema = z22.object({
47260
- client_id: z22.string(),
47261
- client_secret: z22.string().optional(),
47262
- client_id_issued_at: z22.number().optional(),
47263
- client_secret_expires_at: z22.number().optional()
47318
+ OAuthClientInformationSchema = z24.object({
47319
+ client_id: z24.string(),
47320
+ client_secret: z24.string().optional(),
47321
+ client_id_issued_at: z24.number().optional(),
47322
+ client_secret_expires_at: z24.number().optional()
47264
47323
  }).strip();
47265
47324
  OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
47266
- z22.object({
47267
- error: z22.string(),
47268
- error_description: z22.string().optional()
47325
+ z24.object({
47326
+ error: z24.string(),
47327
+ error_description: z24.string().optional()
47269
47328
  }).strip();
47270
- z22.object({
47271
- token: z22.string(),
47272
- token_type_hint: z22.string().optional()
47329
+ z24.object({
47330
+ token: z24.string(),
47331
+ token_type_hint: z24.string().optional()
47273
47332
  }).strip();
47274
47333
  }
47275
47334
  });
@@ -49404,10 +49463,10 @@ var require_react_production_min = __commonJS({
49404
49463
  var w4 = /* @__PURE__ */ Symbol.for("react.suspense");
49405
49464
  var x4 = /* @__PURE__ */ Symbol.for("react.memo");
49406
49465
  var y2 = /* @__PURE__ */ Symbol.for("react.lazy");
49407
- var z55 = Symbol.iterator;
49466
+ var z58 = Symbol.iterator;
49408
49467
  function A3(a2) {
49409
49468
  if (null === a2 || "object" !== typeof a2) return null;
49410
- a2 = z55 && a2[z55] || a2["@@iterator"];
49469
+ a2 = z58 && a2[z58] || a2["@@iterator"];
49411
49470
  return "function" === typeof a2 ? a2 : null;
49412
49471
  }
49413
49472
  var B2 = { isMounted: function() {
@@ -49474,7 +49533,7 @@ var require_react_production_min = __commonJS({
49474
49533
  });
49475
49534
  }
49476
49535
  var P3 = /\/+/g;
49477
- function Q4(a2, b3) {
49536
+ function Q3(a2, b3) {
49478
49537
  return "object" === typeof a2 && null !== a2 && null != a2.key ? escape4("" + a2.key) : b3.toString(36);
49479
49538
  }
49480
49539
  function R4(a2, b3, e3, d2, c2) {
@@ -49494,17 +49553,17 @@ var require_react_production_min = __commonJS({
49494
49553
  h3 = true;
49495
49554
  }
49496
49555
  }
49497
- if (h3) return h3 = a2, c2 = c2(h3), a2 = "" === d2 ? "." + Q4(h3, 0) : d2, I2(c2) ? (e3 = "", null != a2 && (e3 = a2.replace(P3, "$&/") + "/"), R4(c2, b3, e3, "", function(a3) {
49556
+ if (h3) return h3 = a2, c2 = c2(h3), a2 = "" === d2 ? "." + Q3(h3, 0) : d2, I2(c2) ? (e3 = "", null != a2 && (e3 = a2.replace(P3, "$&/") + "/"), R4(c2, b3, e3, "", function(a3) {
49498
49557
  return a3;
49499
49558
  })) : null != c2 && (O3(c2) && (c2 = N2(c2, e3 + (!c2.key || h3 && h3.key === c2.key ? "" : ("" + c2.key).replace(P3, "$&/") + "/") + a2)), b3.push(c2)), 1;
49500
49559
  h3 = 0;
49501
49560
  d2 = "" === d2 ? "." : d2 + ":";
49502
49561
  if (I2(a2)) for (var g2 = 0; g2 < a2.length; g2++) {
49503
49562
  k3 = a2[g2];
49504
- var f3 = d2 + Q4(k3, g2);
49563
+ var f3 = d2 + Q3(k3, g2);
49505
49564
  h3 += R4(k3, b3, e3, f3, c2);
49506
49565
  }
49507
- else if (f3 = A3(a2), "function" === typeof f3) for (a2 = f3.call(a2), g2 = 0; !(k3 = a2.next()).done; ) k3 = k3.value, f3 = d2 + Q4(k3, g2++), h3 += R4(k3, b3, e3, f3, c2);
49566
+ else if (f3 = A3(a2), "function" === typeof f3) for (a2 = f3.call(a2), g2 = 0; !(k3 = a2.next()).done; ) k3 = k3.value, f3 = d2 + Q3(k3, g2++), h3 += R4(k3, b3, e3, f3, c2);
49508
49567
  else if ("object" === k3) throw b3 = String(a2), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b3 ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b3) + "). If you meant to render a collection of children, use an array instead.");
49509
49568
  return h3;
49510
49569
  }
@@ -51827,7 +51886,7 @@ var init_base = __esm({
51827
51886
  if (isBrowser || !isWindows2) {
51828
51887
  return false;
51829
51888
  }
51830
- const parts = os3__default.release().split(".");
51889
+ const parts = os5__default.release().split(".");
51831
51890
  const major = Number(parts[0]);
51832
51891
  const build2 = Number(parts[2] ?? 0);
51833
51892
  if (major < 10) {
@@ -52214,7 +52273,7 @@ var init_yoga_wasm_base64_esm = __esm({
52214
52273
  h3.noExitRuntime || true;
52215
52274
  "object" != typeof WebAssembly && x4("no native wasm support detected");
52216
52275
  var fa, ha = false;
52217
- function z55(a2, b3, c2) {
52276
+ function z58(a2, b3, c2) {
52218
52277
  c2 = b3 + c2;
52219
52278
  for (var d2 = ""; !(b3 >= c2); ) {
52220
52279
  var e3 = a2[b3++];
@@ -52362,7 +52421,7 @@ var init_yoga_wasm_base64_esm = __esm({
52362
52421
  a2["delete"]();
52363
52422
  }
52364
52423
  }
52365
- var P3 = void 0, Q4 = {};
52424
+ var P3 = void 0, Q3 = {};
52366
52425
  function Ia(a2, b3) {
52367
52426
  for (void 0 === b3 && L3("ptr should not be undefined"); a2.R; ) b3 = a2.ba(b3), a2 = a2.R;
52368
52427
  return b3;
@@ -52395,7 +52454,7 @@ var init_yoga_wasm_base64_esm = __esm({
52395
52454
  var Qa = {};
52396
52455
  function Ra(a2, b3) {
52397
52456
  b3 = Ia(a2, b3);
52398
- return Q4[b3];
52457
+ return Q3[b3];
52399
52458
  }
52400
52459
  var Sa = void 0;
52401
52460
  function Ta(a2) {
@@ -52766,11 +52825,11 @@ var init_yoga_wasm_base64_esm = __esm({
52766
52825
  for (var Gb = Array(256), Hb = 0; 256 > Hb; ++Hb) Gb[Hb] = String.fromCharCode(Hb);
52767
52826
  Ga = Gb;
52768
52827
  h3.getInheritedInstanceCount = function() {
52769
- return Object.keys(Q4).length;
52828
+ return Object.keys(Q3).length;
52770
52829
  };
52771
52830
  h3.getLiveInheritedInstances = function() {
52772
52831
  var a2 = [], b3;
52773
- for (b3 in Q4) Q4.hasOwnProperty(b3) && a2.push(Q4[b3]);
52832
+ for (b3 in Q3) Q3.hasOwnProperty(b3) && a2.push(Q3[b3]);
52774
52833
  return a2;
52775
52834
  };
52776
52835
  h3.flushPendingDeletes = Ha;
@@ -52864,7 +52923,7 @@ var init_yoga_wasm_base64_esm = __esm({
52864
52923
  return b3;
52865
52924
  }, Jb = {
52866
52925
  l: function(a2, b3, c2, d2) {
52867
- x4("Assertion failed: " + (a2 ? z55(A3, a2) : "") + ", at: " + [b3 ? b3 ? z55(A3, b3) : "" : "unknown filename", c2, d2 ? d2 ? z55(A3, d2) : "" : "unknown function"]);
52926
+ x4("Assertion failed: " + (a2 ? z58(A3, a2) : "") + ", at: " + [b3 ? b3 ? z58(A3, b3) : "" : "unknown filename", c2, d2 ? d2 ? z58(A3, d2) : "" : "unknown function"]);
52868
52927
  },
52869
52928
  q: function(a2, b3, c2) {
52870
52929
  a2 = N2(a2);
@@ -52889,14 +52948,14 @@ var init_yoga_wasm_base64_esm = __esm({
52889
52948
  T2(this);
52890
52949
  l2 = n2.O;
52891
52950
  l2 = Ia(e3, l2);
52892
- Q4.hasOwnProperty(l2) ? L3("Tried to register registered instance: " + l2) : Q4[l2] = this;
52951
+ Q3.hasOwnProperty(l2) ? L3("Tried to register registered instance: " + l2) : Q3[l2] = this;
52893
52952
  };
52894
52953
  f3.__destruct = function() {
52895
52954
  this === f3 && L3("Pass correct 'this' to __destruct");
52896
52955
  Ma(this);
52897
52956
  var l2 = this.M.O;
52898
52957
  l2 = Ia(e3, l2);
52899
- Q4.hasOwnProperty(l2) ? delete Q4[l2] : L3("Tried to unregister unregistered instance: " + l2);
52958
+ Q3.hasOwnProperty(l2) ? delete Q3[l2] : L3("Tried to unregister unregistered instance: " + l2);
52900
52959
  };
52901
52960
  a2.prototype = Object.create(f3);
52902
52961
  for (var m3 in c2) a2.prototype[m3] = c2[m3];
@@ -53117,7 +53176,7 @@ var init_yoga_wasm_base64_esm = __esm({
53117
53176
  if (c2) for (var g2 = f3, k3 = 0; k3 <= e3; ++k3) {
53118
53177
  var m3 = f3 + k3;
53119
53178
  if (k3 == e3 || 0 == A3[m3]) {
53120
- g2 = g2 ? z55(A3, g2, m3 - g2) : "";
53179
+ g2 = g2 ? z58(A3, g2, m3 - g2) : "";
53121
53180
  if (void 0 === l2) var l2 = g2;
53122
53181
  else l2 += String.fromCharCode(0), l2 += g2;
53123
53182
  g2 = m3 + 1;
@@ -53314,7 +53373,7 @@ var init_yoga_wasm_base64_esm = __esm({
53314
53373
  b3 += 8;
53315
53374
  for (var m3 = 0; m3 < k3; m3++) {
53316
53375
  var l2 = A3[g2 + m3], n2 = Fb[a2];
53317
- 0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v3)(z55(n2, 0)), n2.length = 0) : n2.push(l2);
53376
+ 0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v3)(z58(n2, 0)), n2.length = 0) : n2.push(l2);
53318
53377
  }
53319
53378
  e3 += k3;
53320
53379
  }
@@ -53802,7 +53861,7 @@ var require_scheduler_production_min = __commonJS({
53802
53861
  var u2 = 1;
53803
53862
  var v3 = null;
53804
53863
  var y2 = 3;
53805
- var z55 = false;
53864
+ var z58 = false;
53806
53865
  var A3 = false;
53807
53866
  var B2 = false;
53808
53867
  var D3 = "function" === typeof setTimeout ? setTimeout : null;
@@ -53829,7 +53888,7 @@ var require_scheduler_production_min = __commonJS({
53829
53888
  function J2(a2, b3) {
53830
53889
  A3 = false;
53831
53890
  B2 && (B2 = false, E3(L3), L3 = -1);
53832
- z55 = true;
53891
+ z58 = true;
53833
53892
  var c2 = y2;
53834
53893
  try {
53835
53894
  G3(b3);
@@ -53853,21 +53912,21 @@ var require_scheduler_production_min = __commonJS({
53853
53912
  }
53854
53913
  return w4;
53855
53914
  } finally {
53856
- v3 = null, y2 = c2, z55 = false;
53915
+ v3 = null, y2 = c2, z58 = false;
53857
53916
  }
53858
53917
  }
53859
53918
  var N2 = false;
53860
53919
  var O3 = null;
53861
53920
  var L3 = -1;
53862
53921
  var P3 = 5;
53863
- var Q4 = -1;
53922
+ var Q3 = -1;
53864
53923
  function M2() {
53865
- return exports.unstable_now() - Q4 < P3 ? false : true;
53924
+ return exports.unstable_now() - Q3 < P3 ? false : true;
53866
53925
  }
53867
53926
  function R4() {
53868
53927
  if (null !== O3) {
53869
53928
  var a2 = exports.unstable_now();
53870
- Q4 = a2;
53929
+ Q3 = a2;
53871
53930
  var b3 = true;
53872
53931
  try {
53873
53932
  b3 = O3(true, a2);
@@ -53910,7 +53969,7 @@ var require_scheduler_production_min = __commonJS({
53910
53969
  a2.callback = null;
53911
53970
  };
53912
53971
  exports.unstable_continueExecution = function() {
53913
- A3 || z55 || (A3 = true, I2(J2));
53972
+ A3 || z58 || (A3 = true, I2(J2));
53914
53973
  };
53915
53974
  exports.unstable_forceFrameRate = function(a2) {
53916
53975
  0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P3 = 0 < a2 ? Math.floor(1e3 / a2) : 5;
@@ -53983,7 +54042,7 @@ var require_scheduler_production_min = __commonJS({
53983
54042
  }
53984
54043
  e3 = c2 + e3;
53985
54044
  a2 = { id: u2++, callback: b3, priorityLevel: a2, startTime: c2, expirationTime: e3, sortIndex: -1 };
53986
- c2 > d2 ? (a2.sortIndex = c2, f3(t2, a2), null === h3(r2) && a2 === h3(t2) && (B2 ? (E3(L3), L3 = -1) : B2 = true, K4(H3, c2 - d2))) : (a2.sortIndex = e3, f3(r2, a2), A3 || z55 || (A3 = true, I2(J2)));
54045
+ c2 > d2 ? (a2.sortIndex = c2, f3(t2, a2), null === h3(r2) && a2 === h3(t2) && (B2 ? (E3(L3), L3 = -1) : B2 = true, K4(H3, c2 - d2))) : (a2.sortIndex = e3, f3(r2, a2), A3 || z58 || (A3 = true, I2(J2)));
53987
54046
  return a2;
53988
54047
  };
53989
54048
  exports.unstable_shouldYield = M2;
@@ -54740,7 +54799,7 @@ var require_react_reconciler_production_min = __commonJS({
54740
54799
  gc[hc] = a2.current;
54741
54800
  a2.current = b3;
54742
54801
  }
54743
- var jc = {}, x4 = ic(jc), z55 = ic(false), kc = jc;
54802
+ var jc = {}, x4 = ic(jc), z58 = ic(false), kc = jc;
54744
54803
  function mc(a2, b3) {
54745
54804
  var c2 = a2.type.contextTypes;
54746
54805
  if (!c2) return jc;
@@ -54756,13 +54815,13 @@ var require_react_reconciler_production_min = __commonJS({
54756
54815
  return null !== a2 && void 0 !== a2;
54757
54816
  }
54758
54817
  function nc() {
54759
- q3(z55);
54818
+ q3(z58);
54760
54819
  q3(x4);
54761
54820
  }
54762
54821
  function oc(a2, b3, c2) {
54763
54822
  if (x4.current !== jc) throw Error(n2(168));
54764
54823
  v3(x4, b3);
54765
- v3(z55, c2);
54824
+ v3(z58, c2);
54766
54825
  }
54767
54826
  function pc(a2, b3, c2) {
54768
54827
  var d2 = a2.stateNode;
@@ -54776,14 +54835,14 @@ var require_react_reconciler_production_min = __commonJS({
54776
54835
  a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || jc;
54777
54836
  kc = x4.current;
54778
54837
  v3(x4, a2);
54779
- v3(z55, z55.current);
54838
+ v3(z58, z58.current);
54780
54839
  return true;
54781
54840
  }
54782
54841
  function rc(a2, b3, c2) {
54783
54842
  var d2 = a2.stateNode;
54784
54843
  if (!d2) throw Error(n2(169));
54785
- c2 ? (a2 = pc(a2, b3, kc), d2.__reactInternalMemoizedMergedChildContext = a2, q3(z55), q3(x4), v3(x4, a2)) : q3(z55);
54786
- v3(z55, c2);
54844
+ c2 ? (a2 = pc(a2, b3, kc), d2.__reactInternalMemoizedMergedChildContext = a2, q3(z58), q3(x4), v3(x4, a2)) : q3(z58);
54845
+ v3(z58, c2);
54787
54846
  }
54788
54847
  var tc = Math.clz32 ? Math.clz32 : sc, uc = Math.log, vc = Math.LN2;
54789
54848
  function sc(a2) {
@@ -55650,7 +55709,7 @@ var require_react_reconciler_production_min = __commonJS({
55650
55709
  b3 = Ga(c2, a2.type, b3);
55651
55710
  c2 !== b3 && (v3(pe2, a2), v3(oe2, b3));
55652
55711
  }
55653
- function ve3(a2) {
55712
+ function ve2(a2) {
55654
55713
  pe2.current === a2 && (q3(oe2), q3(pe2));
55655
55714
  }
55656
55715
  var I2 = ic(0);
@@ -56381,7 +56440,7 @@ var require_react_reconciler_production_min = __commonJS({
56381
56440
  g2.state = p3;
56382
56441
  ke2(b3, d2, g2, e3);
56383
56442
  k3 = b3.memoizedState;
56384
- h3 !== d2 || p3 !== k3 || z55.current || de2 ? ("function" === typeof m3 && (yf(b3, c2, m3, d2), k3 = b3.memoizedState), (h3 = de2 || Af(b3, c2, h3, d2, p3, k3, l2)) ? (r2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b3.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), b3.memoizedProps = d2, b3.memoizedState = k3), g2.props = d2, g2.state = k3, g2.context = l2, d2 = h3) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), d2 = false);
56443
+ h3 !== d2 || p3 !== k3 || z58.current || de2 ? ("function" === typeof m3 && (yf(b3, c2, m3, d2), k3 = b3.memoizedState), (h3 = de2 || Af(b3, c2, h3, d2, p3, k3, l2)) ? (r2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b3.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), b3.memoizedProps = d2, b3.memoizedState = k3), g2.props = d2, g2.state = k3, g2.context = l2, d2 = h3) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), d2 = false);
56385
56444
  } else {
56386
56445
  g2 = b3.stateNode;
56387
56446
  fe2(a2, b3);
@@ -56399,7 +56458,7 @@ var require_react_reconciler_production_min = __commonJS({
56399
56458
  g2.state = p3;
56400
56459
  ke2(b3, d2, g2, e3);
56401
56460
  var w4 = b3.memoizedState;
56402
- h3 !== r2 || p3 !== w4 || z55.current || de2 ? ("function" === typeof B2 && (yf(b3, c2, B2, d2), w4 = b3.memoizedState), (l2 = de2 || Af(b3, c2, l2, d2, p3, w4, k3) || false) ? (m3 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, w4, k3), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, w4, k3)), "function" === typeof g2.componentDidUpdate && (b3.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b3.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), b3.memoizedProps = d2, b3.memoizedState = w4), g2.props = d2, g2.state = w4, g2.context = k3, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), d2 = false);
56461
+ h3 !== r2 || p3 !== w4 || z58.current || de2 ? ("function" === typeof B2 && (yf(b3, c2, B2, d2), w4 = b3.memoizedState), (l2 = de2 || Af(b3, c2, l2, d2, p3, w4, k3) || false) ? (m3 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, w4, k3), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, w4, k3)), "function" === typeof g2.componentDidUpdate && (b3.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b3.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), b3.memoizedProps = d2, b3.memoizedState = w4), g2.props = d2, g2.state = w4, g2.context = k3, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), d2 = false);
56403
56462
  }
56404
56463
  return dg(a2, b3, c2, d2, f3, e3);
56405
56464
  }
@@ -56840,7 +56899,7 @@ var require_react_reconciler_production_min = __commonJS({
56840
56899
  null === d2 ? b3 || null === a2.tail ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null;
56841
56900
  }
56842
56901
  }
56843
- function Q4(a2) {
56902
+ function Q3(a2) {
56844
56903
  var b3 = null !== a2.alternate && a2.alternate.child === a2.child, c2 = 0, d2 = 0;
56845
56904
  if (b3) for (var e3 = a2.child; null !== e3; ) c2 |= e3.lanes | e3.childLanes, d2 |= e3.subtreeFlags & 14680064, d2 |= e3.flags & 14680064, e3.return = a2, e3 = e3.sibling;
56846
56905
  else for (e3 = a2.child; null !== e3; ) c2 |= e3.lanes | e3.childLanes, d2 |= e3.subtreeFlags, d2 |= e3.flags, e3.return = a2, e3 = e3.sibling;
@@ -56862,29 +56921,29 @@ var require_react_reconciler_production_min = __commonJS({
56862
56921
  case 12:
56863
56922
  case 9:
56864
56923
  case 14:
56865
- return Q4(b3), null;
56924
+ return Q3(b3), null;
56866
56925
  case 1:
56867
- return A3(b3.type) && nc(), Q4(b3), null;
56926
+ return A3(b3.type) && nc(), Q3(b3), null;
56868
56927
  case 3:
56869
56928
  c2 = b3.stateNode;
56870
56929
  te3();
56871
- q3(z55);
56930
+ q3(z58);
56872
56931
  q3(x4);
56873
56932
  ye3();
56874
56933
  c2.pendingContext && (c2.context = c2.pendingContext, c2.pendingContext = null);
56875
56934
  if (null === a2 || null === a2.child) yd(b3) ? tg(b3) : null === a2 || a2.memoizedState.isDehydrated && 0 === (b3.flags & 256) || (b3.flags |= 1024, null !== rd && (Cg(rd), rd = null));
56876
56935
  wg(a2, b3);
56877
- Q4(b3);
56936
+ Q3(b3);
56878
56937
  return null;
56879
56938
  case 5:
56880
- ve3(b3);
56939
+ ve2(b3);
56881
56940
  c2 = re2(qe2.current);
56882
56941
  var e3 = b3.type;
56883
56942
  if (null !== a2 && null != b3.stateNode) xg(a2, b3, e3, d2, c2), a2.ref !== b3.ref && (b3.flags |= 512, b3.flags |= 2097152);
56884
56943
  else {
56885
56944
  if (!d2) {
56886
56945
  if (null === b3.stateNode) throw Error(n2(166));
56887
- Q4(b3);
56946
+ Q3(b3);
56888
56947
  return null;
56889
56948
  }
56890
56949
  a2 = re2(oe2.current);
@@ -56901,7 +56960,7 @@ var require_react_reconciler_production_min = __commonJS({
56901
56960
  }
56902
56961
  null !== b3.ref && (b3.flags |= 512, b3.flags |= 2097152);
56903
56962
  }
56904
- Q4(b3);
56963
+ Q3(b3);
56905
56964
  return null;
56906
56965
  case 6:
56907
56966
  if (a2 && null != b3.stateNode) yg(a2, b3, a2.memoizedProps, d2);
@@ -56925,7 +56984,7 @@ var require_react_reconciler_production_min = __commonJS({
56925
56984
  d2 && tg(b3);
56926
56985
  } else b3.stateNode = Oa(d2, a2, c2, b3);
56927
56986
  }
56928
- Q4(b3);
56987
+ Q3(b3);
56929
56988
  return null;
56930
56989
  case 13:
56931
56990
  q3(I2);
@@ -56941,7 +57000,7 @@ var require_react_reconciler_production_min = __commonJS({
56941
57000
  if (!e3) throw Error(n2(317));
56942
57001
  Tb(e3, b3);
56943
57002
  } else Ad(), 0 === (b3.flags & 128) && (b3.memoizedState = null), b3.flags |= 4;
56944
- Q4(b3);
57003
+ Q3(b3);
56945
57004
  e3 = false;
56946
57005
  } else null !== rd && (Cg(rd), rd = null), e3 = true;
56947
57006
  if (!e3) return b3.flags & 65536 ? b3 : null;
@@ -56950,18 +57009,18 @@ var require_react_reconciler_production_min = __commonJS({
56950
57009
  c2 = null !== d2;
56951
57010
  c2 !== (null !== a2 && null !== a2.memoizedState) && c2 && (b3.child.flags |= 8192, 0 !== (b3.mode & 1) && (null === a2 || 0 !== (I2.current & 1) ? 0 === R4 && (R4 = 3) : ng()));
56952
57011
  null !== b3.updateQueue && (b3.flags |= 4);
56953
- Q4(b3);
57012
+ Q3(b3);
56954
57013
  return null;
56955
57014
  case 4:
56956
- return te3(), wg(a2, b3), null === a2 && Xa(b3.stateNode.containerInfo), Q4(b3), null;
57015
+ return te3(), wg(a2, b3), null === a2 && Xa(b3.stateNode.containerInfo), Q3(b3), null;
56957
57016
  case 10:
56958
- return Wd(b3.type._context), Q4(b3), null;
57017
+ return Wd(b3.type._context), Q3(b3), null;
56959
57018
  case 17:
56960
- return A3(b3.type) && nc(), Q4(b3), null;
57019
+ return A3(b3.type) && nc(), Q3(b3), null;
56961
57020
  case 19:
56962
57021
  q3(I2);
56963
57022
  e3 = b3.memoizedState;
56964
- if (null === e3) return Q4(b3), null;
57023
+ if (null === e3) return Q3(b3), null;
56965
57024
  d2 = 0 !== (b3.flags & 128);
56966
57025
  f3 = e3.rendering;
56967
57026
  if (null === f3) if (d2) Ag(e3, false);
@@ -56985,16 +57044,16 @@ var require_react_reconciler_production_min = __commonJS({
56985
57044
  }
56986
57045
  else {
56987
57046
  if (!d2) if (a2 = we3(f3), null !== a2) {
56988
- if (b3.flags |= 128, d2 = true, a2 = a2.updateQueue, null !== a2 && (b3.updateQueue = a2, b3.flags |= 4), Ag(e3, true), null === e3.tail && "hidden" === e3.tailMode && !f3.alternate && !F3) return Q4(b3), null;
57047
+ if (b3.flags |= 128, d2 = true, a2 = a2.updateQueue, null !== a2 && (b3.updateQueue = a2, b3.flags |= 4), Ag(e3, true), null === e3.tail && "hidden" === e3.tailMode && !f3.alternate && !F3) return Q3(b3), null;
56989
57048
  } else 2 * D3() - e3.renderingStartTime > Dg && 1073741824 !== c2 && (b3.flags |= 128, d2 = true, Ag(e3, false), b3.lanes = 4194304);
56990
57049
  e3.isBackwards ? (f3.sibling = b3.child, b3.child = f3) : (a2 = e3.last, null !== a2 ? a2.sibling = f3 : b3.child = f3, e3.last = f3);
56991
57050
  }
56992
57051
  if (null !== e3.tail) return b3 = e3.tail, e3.rendering = b3, e3.tail = b3.sibling, e3.renderingStartTime = D3(), b3.sibling = null, a2 = I2.current, v3(I2, d2 ? a2 & 1 | 2 : a2 & 1), b3;
56993
- Q4(b3);
57052
+ Q3(b3);
56994
57053
  return null;
56995
57054
  case 22:
56996
57055
  case 23:
56997
- return Eg(), c2 = null !== b3.memoizedState, null !== a2 && null !== a2.memoizedState !== c2 && (b3.flags |= 8192), c2 && 0 !== (b3.mode & 1) ? 0 !== ($f & 1073741824) && (Q4(b3), Ta && b3.subtreeFlags & 6 && (b3.flags |= 8192)) : Q4(b3), null;
57056
+ return Eg(), c2 = null !== b3.memoizedState, null !== a2 && null !== a2.memoizedState !== c2 && (b3.flags |= 8192), c2 && 0 !== (b3.mode & 1) ? 0 !== ($f & 1073741824) && (Q3(b3), Ta && b3.subtreeFlags & 6 && (b3.flags |= 8192)) : Q3(b3), null;
56998
57057
  case 24:
56999
57058
  return null;
57000
57059
  case 25:
@@ -57011,9 +57070,9 @@ var require_react_reconciler_production_min = __commonJS({
57011
57070
  case 1:
57012
57071
  return A3(b3.type) && nc(), a2 = b3.flags, a2 & 65536 ? (b3.flags = a2 & -65537 | 128, b3) : null;
57013
57072
  case 3:
57014
- return te3(), q3(z55), q3(x4), ye3(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
57073
+ return te3(), q3(z58), q3(x4), ye3(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
57015
57074
  case 5:
57016
- return ve3(b3), null;
57075
+ return ve2(b3), null;
57017
57076
  case 13:
57018
57077
  q3(I2);
57019
57078
  a2 = b3.memoizedState;
@@ -58066,12 +58125,12 @@ var require_react_reconciler_production_min = __commonJS({
58066
58125
  break;
58067
58126
  case 3:
58068
58127
  te3();
58069
- q3(z55);
58128
+ q3(z58);
58070
58129
  q3(x4);
58071
58130
  ye3();
58072
58131
  break;
58073
58132
  case 5:
58074
- ve3(d2);
58133
+ ve2(d2);
58075
58134
  break;
58076
58135
  case 4:
58077
58136
  te3();
@@ -58543,7 +58602,7 @@ var require_react_reconciler_production_min = __commonJS({
58543
58602
  }
58544
58603
  var ai;
58545
58604
  ai = function(a2, b3, c2) {
58546
- if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z55.current) G3 = true;
58605
+ if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z58.current) G3 = true;
58547
58606
  else {
58548
58607
  if (0 === (a2.lanes & c2) && 0 === (b3.flags & 128)) return G3 = false, sg(a2, b3, c2);
58549
58608
  G3 = 0 !== (a2.flags & 131072) ? true : false;
@@ -58652,7 +58711,7 @@ var require_react_reconciler_production_min = __commonJS({
58652
58711
  g2 = e3.value;
58653
58712
  Vd(b3, d2, g2);
58654
58713
  if (null !== f3) if (Vc(f3.value, g2)) {
58655
- if (f3.children === e3.children && !z55.current) {
58714
+ if (f3.children === e3.children && !z58.current) {
58656
58715
  b3 = Tf(a2, b3, c2);
58657
58716
  break a;
58658
58717
  }
@@ -79285,11 +79344,11 @@ var init_devtools = __esm({
79285
79344
  devtools_stub_default.connectToDevTools();
79286
79345
  }
79287
79346
  });
79288
- var import_react_reconciler, import_constants23, diff, cleanupYogaNode, reconciler_default;
79347
+ var import_react_reconciler, import_constants28, diff, cleanupYogaNode, reconciler_default;
79289
79348
  var init_reconciler = __esm({
79290
79349
  async "../../node_modules/.pnpm/ink@5.2.1_@types+react@18.3.28_react@18.3.1/node_modules/ink/build/reconciler.js"() {
79291
79350
  import_react_reconciler = __toESM(require_react_reconciler());
79292
- import_constants23 = __toESM(require_constants3());
79351
+ import_constants28 = __toESM(require_constants3());
79293
79352
  await init_src();
79294
79353
  await init_dom();
79295
79354
  await init_styles();
@@ -79439,7 +79498,7 @@ $ npm install --save-dev react-devtools-core
79439
79498
  scheduleTimeout: setTimeout,
79440
79499
  cancelTimeout: clearTimeout,
79441
79500
  noTimeout: -1,
79442
- getCurrentEventPriority: () => import_constants23.DefaultEventPriority,
79501
+ getCurrentEventPriority: () => import_constants28.DefaultEventPriority,
79443
79502
  beforeActiveInstanceBlur() {
79444
79503
  },
79445
79504
  afterActiveInstanceBlur() {
@@ -79892,7 +79951,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
79892
79951
  return min;
79893
79952
  }
79894
79953
  if (V3.platform === "win32") {
79895
- const osRelease = os3__default.release().split(".");
79954
+ const osRelease = os5__default.release().split(".");
79896
79955
  if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
79897
79956
  return Number(osRelease[2]) >= 14931 ? 3 : 2;
79898
79957
  }
@@ -83868,6 +83927,11 @@ var init_SlashCommands = __esm({
83868
83927
  aliases: ["loop"]
83869
83928
  },
83870
83929
  { name: "mcp", description: "Enable / disable / remove MCP servers" },
83930
+ {
83931
+ name: "goal",
83932
+ description: "Work autonomously until the objective is delivered (switches mode + auto-approves; Esc stops)",
83933
+ argumentHint: "<objective>"
83934
+ },
83871
83935
  {
83872
83936
  name: "yolo",
83873
83937
  description: "Toggle auto-approve mode \u2014 every tool call allowed without asking",
@@ -84698,12 +84762,14 @@ function isTableSeparator(line) {
84698
84762
  return false;
84699
84763
  return /^\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?$/.test(trimmed);
84700
84764
  }
84765
+ function stripOuterPipes(s2) {
84766
+ return s2.trim().replace(/^\|/, "").replace(/\|$/, "");
84767
+ }
84701
84768
  function parseTableCells(line) {
84702
- const trimmed = line.trim().replace(/^\|/, "").replace(/\|$/, "");
84703
- return trimmed.split("|").map((s2) => s2.trim());
84769
+ return stripOuterPipes(line).split("|").map((s2) => s2.trim());
84704
84770
  }
84705
84771
  function parseTableAligns(sep2) {
84706
- const cells = sep2.trim().replace(/^\|/, "").replace(/\|$/, "").split("|");
84772
+ const cells = stripOuterPipes(sep2).split("|");
84707
84773
  return cells.map((c2) => {
84708
84774
  const t2 = c2.trim();
84709
84775
  const left = t2.startsWith(":");
@@ -84747,7 +84813,7 @@ function tokenizeInline(input) {
84747
84813
  return out;
84748
84814
  }
84749
84815
  function stripInline(s2) {
84750
- return s2.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1");
84816
+ return s2.replace(/`([^`\n]+)`/g, "$1").replace(/\*\*([^*\n]+)\*\*/g, "$1").replace(/\*([^*\n]+)\*/g, "$1").replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, "$1");
84751
84817
  }
84752
84818
  var init_inline = __esm({
84753
84819
  "../chat-model/dist/markdown/inline.js"() {
@@ -85009,7 +85075,7 @@ function summarizeArgs(input) {
85009
85075
  if (input == null)
85010
85076
  return "";
85011
85077
  if (typeof input === "string")
85012
- return truncate3(oneLine(input), 60);
85078
+ return truncate3(oneLine(input), STRING_ARG_MAX);
85013
85079
  if (typeof input !== "object")
85014
85080
  return String(input);
85015
85081
  const entries = Object.entries(input);
@@ -85068,15 +85134,17 @@ function compactPreviewLine(call) {
85068
85134
  const input = call.request.input;
85069
85135
  const v3 = input?.[key];
85070
85136
  if (typeof v3 === "string")
85071
- return truncate3(oneLine(v3), 100);
85137
+ return truncate3(oneLine(v3), PREVIEW_LINE_MAX);
85072
85138
  }
85073
85139
  return summarizeArgs(call.request.input);
85074
85140
  }
85075
- var ARG_SUMMARY_MAX, VALUE_MAX, DotColors;
85141
+ var ARG_SUMMARY_MAX, VALUE_MAX, STRING_ARG_MAX, PREVIEW_LINE_MAX, DotColors;
85076
85142
  var init_format = __esm({
85077
85143
  "../chat-model/dist/format.js"() {
85078
85144
  ARG_SUMMARY_MAX = 90;
85079
85145
  VALUE_MAX = 28;
85146
+ STRING_ARG_MAX = 60;
85147
+ PREVIEW_LINE_MAX = 100;
85080
85148
  DotColors = {
85081
85149
  mcp: "cyan",
85082
85150
  skill: "magenta",
@@ -85088,6 +85156,54 @@ var init_format = __esm({
85088
85156
  });
85089
85157
 
85090
85158
  // ../chat-model/dist/pair-events.js
85159
+ function handleSubagentEvent(e3, subagents, root) {
85160
+ const payload = e3.payload ?? {};
85161
+ const childSessionId = String(payload.childSessionId ?? "");
85162
+ if (!childSessionId)
85163
+ return;
85164
+ if (e3.subtype === "subagent_started") {
85165
+ const block2 = {
85166
+ kind: "subagent",
85167
+ id: e3.id,
85168
+ childSessionId,
85169
+ label: String(payload.label ?? "agent"),
85170
+ startedAtMs: new Date(e3.ts).getTime(),
85171
+ completedAtMs: null,
85172
+ toolCallCount: 0,
85173
+ toolCalls: [],
85174
+ stopReason: null,
85175
+ finalPreview: null,
85176
+ error: null
85177
+ };
85178
+ subagents.set(childSessionId, block2);
85179
+ root.push(block2);
85180
+ return;
85181
+ }
85182
+ const block = subagents.get(childSessionId);
85183
+ if (!block)
85184
+ return;
85185
+ if (e3.subtype === "subagent_tool_call") {
85186
+ block.toolCallCount += 1;
85187
+ block.toolCalls.push({ name: String(payload.name ?? "tool"), input: payload.input });
85188
+ return;
85189
+ }
85190
+ if (e3.subtype === "subagent_completed") {
85191
+ block.completedAtMs = new Date(e3.ts).getTime();
85192
+ block.stopReason = String(payload.stopReason ?? "");
85193
+ const text = typeof payload.text === "string" ? payload.text : "";
85194
+ if (text)
85195
+ block.finalPreview = oneLine(text);
85196
+ if (typeof payload.error === "string")
85197
+ block.error = payload.error;
85198
+ return;
85199
+ }
85200
+ if (e3.subtype === "subagent_error" || e3.subtype === "subagent_abort") {
85201
+ block.completedAtMs = new Date(e3.ts).getTime();
85202
+ const reason = typeof payload.message === "string" && payload.message || typeof payload.reason === "string" && payload.reason || "aborted";
85203
+ block.error = reason;
85204
+ return;
85205
+ }
85206
+ }
85091
85207
  function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
85092
85208
  const root = [];
85093
85209
  const callTargets = /* @__PURE__ */ new Map();
@@ -85147,6 +85263,7 @@ function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
85147
85263
  markOrphansAtTurnBoundary();
85148
85264
  pendingLoadSkillCallId = null;
85149
85265
  continuationSkillEvent = null;
85266
+ suppressedCallIds.clear();
85150
85267
  root.push({ kind: "event", id: e3.id, event: e3 });
85151
85268
  continue;
85152
85269
  }
@@ -85232,57 +85349,14 @@ function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
85232
85349
  continuationSkillEvent = openScope.skillEvent;
85233
85350
  openScope.closed = true;
85234
85351
  openScope = null;
85352
+ } else {
85353
+ continuationSkillEvent = null;
85235
85354
  }
85236
85355
  root.push({ kind: "event", id: e3.id, event: e3 });
85237
85356
  continue;
85238
85357
  }
85239
85358
  if (e3.type === "plugin_event" && e3.pluginId === SUBAGENT_PLUGIN_ID2) {
85240
- const payload = e3.payload ?? {};
85241
- const childSessionId = String(payload.childSessionId ?? "");
85242
- if (!childSessionId)
85243
- continue;
85244
- if (e3.subtype === "subagent_started") {
85245
- const block2 = {
85246
- kind: "subagent",
85247
- id: e3.id,
85248
- childSessionId,
85249
- label: String(payload.label ?? "agent"),
85250
- startedAtMs: new Date(e3.ts).getTime(),
85251
- completedAtMs: null,
85252
- toolCallCount: 0,
85253
- toolCalls: [],
85254
- stopReason: null,
85255
- finalPreview: null,
85256
- error: null
85257
- };
85258
- subagents.set(childSessionId, block2);
85259
- root.push(block2);
85260
- continue;
85261
- }
85262
- const block = subagents.get(childSessionId);
85263
- if (!block)
85264
- continue;
85265
- if (e3.subtype === "subagent_tool_call") {
85266
- block.toolCallCount += 1;
85267
- block.toolCalls.push({ name: String(payload.name ?? "tool"), input: payload.input });
85268
- continue;
85269
- }
85270
- if (e3.subtype === "subagent_completed") {
85271
- block.completedAtMs = new Date(e3.ts).getTime();
85272
- block.stopReason = String(payload.stopReason ?? "");
85273
- const text = typeof payload.text === "string" ? payload.text : "";
85274
- if (text)
85275
- block.finalPreview = oneLine(text);
85276
- if (typeof payload.error === "string")
85277
- block.error = payload.error;
85278
- continue;
85279
- }
85280
- if (e3.subtype === "subagent_error" || e3.subtype === "subagent_abort") {
85281
- block.completedAtMs = new Date(e3.ts).getTime();
85282
- const reason = typeof payload.message === "string" && payload.message || typeof payload.reason === "string" && payload.reason || "aborted";
85283
- block.error = reason;
85284
- continue;
85285
- }
85359
+ handleSubagentEvent(e3, subagents, root);
85286
85360
  continue;
85287
85361
  }
85288
85362
  pushBlock({ kind: "event", id: e3.id, event: e3 });
@@ -86594,6 +86668,8 @@ function runSlash2(cmd, deps) {
86594
86668
  case "/mode":
86595
86669
  case "/loop":
86596
86670
  return openModePicker(deps, args);
86671
+ case "/goal":
86672
+ return startGoal(deps, args);
86597
86673
  case "/yolo":
86598
86674
  case "/auto-approve":
86599
86675
  deps.setYolo((y2) => {
@@ -86695,6 +86771,25 @@ function openMcpPicker(deps) {
86695
86771
  }
86696
86772
  })();
86697
86773
  }
86774
+ function startGoal(deps, arg) {
86775
+ const objective = arg.trim();
86776
+ const GOAL_MODE = "goal";
86777
+ if (!deps.session.modes.list().some((m3) => m3.name === GOAL_MODE)) {
86778
+ deps.setSystemNotice("goal mode is not available (mode-goal plugin not loaded)");
86779
+ return;
86780
+ }
86781
+ try {
86782
+ deps.session.modes.setActive(GOAL_MODE);
86783
+ void savePreferences({ mode: GOAL_MODE });
86784
+ } catch (err) {
86785
+ deps.setSystemNotice(`failed to switch to goal mode: ${err instanceof Error ? err.message : String(err)}`);
86786
+ return;
86787
+ }
86788
+ deps.setYolo(() => true);
86789
+ deps.setSystemNotice(objective ? "\u{1F3AF} goal mode \u2014 tools auto-approved; working until the objective is delivered. Press Esc to stop." : "\u{1F3AF} goal mode on \u2014 tools auto-approved. Send your objective as the next message (Esc stops).");
86790
+ if (objective)
86791
+ deps.submitPrompt(objective);
86792
+ }
86698
86793
  function openModePicker(deps, arg = "") {
86699
86794
  const modes = deps.session.modes.list();
86700
86795
  if (modes.length === 0) {
@@ -88168,7 +88263,18 @@ var init_SessionView = __esm({
88168
88263
  setPicker,
88169
88264
  queueRef: turn.queueRef,
88170
88265
  setQueueCount: turn.setQueueCount,
88171
- performSessionAction: performSessionAction2
88266
+ performSessionAction: performSessionAction2,
88267
+ // Start a turn directly (e.g. /goal kicking off autonomous work)
88268
+ // without clearing the just-set system notice. Objectives are plain
88269
+ // text, so no image-attachment resolution is needed.
88270
+ submitPrompt: (prompt) => {
88271
+ if (turn.busyRef.current) {
88272
+ turn.queueRef.current.push({ text: prompt, attachments: [] });
88273
+ turn.setQueueCount(turn.queueRef.current.length);
88274
+ return;
88275
+ }
88276
+ void turn.runTurnWith(prompt, []);
88277
+ }
88172
88278
  });
88173
88279
  return;
88174
88280
  }
@@ -89957,6 +90063,7 @@ var USER_CONFIG_NAMES = [
89957
90063
  "config.mjs",
89958
90064
  "config.cjs"
89959
90065
  ];
90066
+ var MAX_CONFIG_SEARCH_DEPTH = 12;
89960
90067
  async function loadConfig(opts) {
89961
90068
  const sources = [];
89962
90069
  const configs = [];
@@ -90041,7 +90148,7 @@ function extractDefault(mod) {
90041
90148
  }
90042
90149
  async function findUpward(startDir, names) {
90043
90150
  let cursor = path3.resolve(startDir);
90044
- for (let i2 = 0; i2 < 12; i2++) {
90151
+ for (let i2 = 0; i2 < MAX_CONFIG_SEARCH_DEPTH; i2++) {
90045
90152
  const found = await findFile(cursor, names);
90046
90153
  if (found)
90047
90154
  return found;
@@ -90066,6 +90173,7 @@ async function findFile(dir, names) {
90066
90173
  var scopeSchema = z$1.enum(["user", "project"]);
90067
90174
  var scopeSchemaOptional = scopeSchema.optional().default("project");
90068
90175
  var USER_YAML = () => moxxyPath("config.yaml");
90176
+ var MAX_CONFIG_SEARCH_DEPTH2 = 12;
90069
90177
  async function findScopePath(scope, cwd2) {
90070
90178
  if (scope === "user") {
90071
90179
  const yaml = USER_YAML();
@@ -90077,7 +90185,7 @@ async function findScopePath(scope, cwd2) {
90077
90185
  }
90078
90186
  }
90079
90187
  let cursor = path3.resolve(cwd2);
90080
- for (let i2 = 0; i2 < 12; i2++) {
90188
+ for (let i2 = 0; i2 < MAX_CONFIG_SEARCH_DEPTH2; i2++) {
90081
90189
  for (const name of ["moxxy.config.yaml", "moxxy.config.yml"]) {
90082
90190
  const candidate = path3.join(cursor, name);
90083
90191
  try {
@@ -90105,10 +90213,7 @@ async function readDoc(filePath) {
90105
90213
  function parseDotPath(p3) {
90106
90214
  if (!p3)
90107
90215
  return [];
90108
- return p3.split(".").map((seg) => {
90109
- const asNum = /^\d+$/.test(seg) ? Number(seg) : seg;
90110
- return asNum;
90111
- });
90216
+ return p3.split(".").map((seg) => /^\d+$/.test(seg) ? Number(seg) : seg);
90112
90217
  }
90113
90218
  function parseValue(raw) {
90114
90219
  try {
@@ -90777,11 +90882,13 @@ async function defaultPrompt() {
90777
90882
 
90778
90883
  // ../plugin-memory/dist/parse.js
90779
90884
  var FRONTMATTER_FENCE2 = "---";
90885
+ var OPENING_FENCE_LF = FRONTMATTER_FENCE2 + "\n";
90886
+ var OPENING_FENCE_CRLF = FRONTMATTER_FENCE2 + "\r\n";
90780
90887
  function parseMdFile(content) {
90781
- if (!content.startsWith(FRONTMATTER_FENCE2 + "\n") && !content.startsWith(FRONTMATTER_FENCE2 + "\r\n")) {
90888
+ if (!content.startsWith(OPENING_FENCE_LF) && !content.startsWith(OPENING_FENCE_CRLF)) {
90782
90889
  return { frontmatter: {}, body: content };
90783
90890
  }
90784
- const fenceLen = content.startsWith(FRONTMATTER_FENCE2 + "\r\n") ? 5 : 4;
90891
+ const fenceLen = content.startsWith(OPENING_FENCE_CRLF) ? OPENING_FENCE_CRLF.length : OPENING_FENCE_LF.length;
90785
90892
  const rest = content.slice(fenceLen);
90786
90893
  const m3 = /\r?\n---(?:\r?\n|$)/.exec(rest);
90787
90894
  if (!m3)
@@ -91056,7 +91163,7 @@ var EmbeddingIndex = class _EmbeddingIndex {
91056
91163
  }
91057
91164
  }
91058
91165
  /**
91059
- * For each `(name, body)` pair, return either the cached vector (if the body
91166
+ * For a `(name, body)` pair, return either the cached vector (if the body
91060
91167
  * hash matches) or `null` (miss). Callers re-embed the misses and call
91061
91168
  * `set()` with the fresh vectors.
91062
91169
  */
@@ -91202,12 +91309,10 @@ async function recallVector(all, query, limit2, embedder, index, mutex) {
91202
91309
  const corpus = all.map((e3) => entryForEmbedding(e3));
91203
91310
  if (embedder instanceof TfIdfEmbedder) {
91204
91311
  embedder.fit([...corpus, query]);
91205
- const vectors2 = await embedder.embed([...corpus, query]);
91206
- const queryVec2 = vectors2[vectors2.length - 1];
91207
- return rankCosine(all, vectors2.slice(0, all.length), queryVec2, limit2);
91312
+ return rankAllFresh(all, corpus, query, limit2, embedder);
91208
91313
  }
91209
91314
  if (index) {
91210
- const { vectors: vectors2, queryVec: queryVec2 } = await mutex.run(async () => {
91315
+ const { vectors, queryVec } = await mutex.run(async () => {
91211
91316
  await index.load();
91212
91317
  const cached = [];
91213
91318
  const misses = [];
@@ -91221,19 +91326,26 @@ async function recallVector(all, query, limit2, embedder, index, mutex) {
91221
91326
  const toEmbed = [...misses.map((m3) => m3.text), query];
91222
91327
  const fresh = await embedder.embed(toEmbed);
91223
91328
  const qVec = fresh[queryIdx];
91329
+ const freshByEntryIndex = /* @__PURE__ */ new Map();
91330
+ for (const [j3, m3] of misses.entries()) {
91331
+ freshByEntryIndex.set(m3.index, fresh[j3]);
91332
+ }
91224
91333
  const vecs = [];
91225
91334
  for (let i2 = 0; i2 < all.length; i2++) {
91226
- vecs.push(cached[i2] ?? fresh[misses.findIndex((m3) => m3.index === i2)]);
91335
+ vecs.push(cached[i2] ?? freshByEntryIndex.get(i2));
91227
91336
  }
91228
- for (const m3 of misses) {
91229
- index.set(all[m3.index].frontmatter.name, m3.text, fresh[misses.indexOf(m3)]);
91337
+ for (const [j3, m3] of misses.entries()) {
91338
+ index.set(all[m3.index].frontmatter.name, m3.text, fresh[j3]);
91230
91339
  }
91231
91340
  index.prune(all.map((e3) => e3.frontmatter.name));
91232
91341
  await index.flush();
91233
91342
  return { vectors: vecs, queryVec: qVec };
91234
91343
  });
91235
- return rankCosine(all, vectors2, queryVec2, limit2);
91344
+ return rankCosine(all, vectors, queryVec, limit2);
91236
91345
  }
91346
+ return rankAllFresh(all, corpus, query, limit2, embedder);
91347
+ }
91348
+ async function rankAllFresh(all, corpus, query, limit2, embedder) {
91237
91349
  const vectors = await embedder.embed([...corpus, query]);
91238
91350
  const queryVec = vectors[vectors.length - 1];
91239
91351
  return rankCosine(all, vectors.slice(0, all.length), queryVec, limit2);
@@ -91964,7 +92076,7 @@ async function registerBuiltinEmbedder(session, name, logger) {
91964
92076
  // src/setup/build-session.ts
91965
92077
  init_dist();
91966
92078
  async function buildSession(args) {
91967
- const userPolicyPath = args.config.permissions?.policyPath ?? path3.join(os3.homedir(), ".moxxy", "permissions.json");
92079
+ const userPolicyPath = args.config.permissions?.policyPath ?? path3.join(os5.homedir(), ".moxxy", "permissions.json");
91968
92080
  const permissionEngine = await PermissionEngine.load(userPolicyPath);
91969
92081
  let restoredEvents = [];
91970
92082
  if (args.resumeSessionId) {
@@ -91980,7 +92092,7 @@ async function buildSession(args) {
91980
92092
  });
91981
92093
  }
91982
92094
  }
91983
- const userPluginsDir2 = path3.join(os3.homedir(), ".moxxy", "plugins");
92095
+ const userPluginsDir2 = path3.join(os5.homedir(), ".moxxy", "plugins");
91984
92096
  return new Session({
91985
92097
  cwd: args.cwd,
91986
92098
  logger: args.logger,
@@ -91992,6 +92104,7 @@ async function buildSession(args) {
91992
92104
  // scan, so pluginHost.reload() (install_plugin, self-update) rediscovers
91993
92105
  // and preserves runtime-installed / scaffolded plugins.
91994
92106
  pluginDiscoveryPaths: [userPluginsDir2, path3.join(userPluginsDir2, "node_modules")],
92107
+ ...args.secretResolver ? { secretResolver: args.secretResolver } : {},
91995
92108
  ...args.resumeSessionId ? { sessionId: args.resumeSessionId } : {},
91996
92109
  // Seed restored events directly into the log so subscribers don't
91997
92110
  // re-fire side effects for historical events. New appends from this
@@ -104260,7 +104373,7 @@ function resolvePath(cwd2, target) {
104260
104373
  return path3.normalize(target);
104261
104374
  return path3.resolve(cwd2, target);
104262
104375
  }
104263
- var resolveSafe = resolvePath;
104376
+ var IGNORED_DIR_NAMES = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", ".turbo"]);
104264
104377
  function clampString(s2, max) {
104265
104378
  if (s2.length <= max)
104266
104379
  return s2;
@@ -104371,14 +104484,17 @@ var editTool = defineTool({
104371
104484
  }
104372
104485
  },
104373
104486
  async handler({ file_path, old_string, new_string, replace_all }, ctx) {
104374
- const resolved = resolveSafe(ctx.cwd, file_path);
104487
+ const resolved = resolvePath(ctx.cwd, file_path);
104375
104488
  if (ctx.signal.aborted) {
104376
104489
  throw new MoxxyError({ code: "ABORTED", message: `Edit aborted before start: ${resolved}` });
104377
104490
  }
104378
104491
  const original = await promises.readFile(resolved, "utf8");
104379
104492
  let updated;
104493
+ let replaceAllOccurrences = -1;
104380
104494
  if (replace_all) {
104381
- updated = original.split(old_string).join(new_string);
104495
+ const parts = original.split(old_string);
104496
+ updated = parts.join(new_string);
104497
+ replaceAllOccurrences = parts.length - 1;
104382
104498
  if (updated === original)
104383
104499
  throw new MoxxyError({ code: "TOOL_ERROR", message: `old_string not found in ${resolved}` });
104384
104500
  } else {
@@ -104395,7 +104511,7 @@ var editTool = defineTool({
104395
104511
  updated = original.slice(0, first) + new_string + original.slice(first + old_string.length);
104396
104512
  }
104397
104513
  await writeFileAtomic(resolved, updated);
104398
- const occurrences = replace_all ? original.split(old_string).length - 1 : 1;
104514
+ const occurrences = replace_all ? replaceAllOccurrences : 1;
104399
104515
  return `edited ${resolved}: ${occurrences} replacement${occurrences === 1 ? "" : "s"}`;
104400
104516
  }
104401
104517
  });
@@ -104421,7 +104537,7 @@ var globTool = defineTool({
104421
104537
  }
104422
104538
  },
104423
104539
  async handler({ pattern, cwd: cwd2, max }, ctx) {
104424
- const baseDir = resolveSafe(ctx.cwd, cwd2 ?? ".");
104540
+ const baseDir = resolvePath(ctx.cwd, cwd2 ?? ".");
104425
104541
  const matches = [];
104426
104542
  for await (const entry of fsGlob(baseDir, pattern, ctx.signal)) {
104427
104543
  matches.push(entry);
@@ -104459,7 +104575,7 @@ async function* walk(root, regex2, cursor, signal, visited) {
104459
104575
  for (const entry of entries) {
104460
104576
  if (signal.aborted)
104461
104577
  return;
104462
- if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === ".turbo")
104578
+ if (IGNORED_DIR_NAMES.has(entry.name))
104463
104579
  continue;
104464
104580
  const full = path3.join(cursor, entry.name);
104465
104581
  let isDir = entry.isDirectory();
@@ -104507,7 +104623,7 @@ var grepTool = defineTool({
104507
104623
  }
104508
104624
  },
104509
104625
  async handler({ pattern, cwd: cwd2, glob, caseInsensitive, maxMatches }, ctx) {
104510
- const baseDir = resolveSafe(ctx.cwd, cwd2 ?? ".");
104626
+ const baseDir = resolvePath(ctx.cwd, cwd2 ?? ".");
104511
104627
  let re2;
104512
104628
  try {
104513
104629
  re2 = new RegExp(pattern, caseInsensitive ? "i" : "");
@@ -104535,7 +104651,7 @@ async function walk2(root, cursor, re2, fileRe, matches, max, signal) {
104535
104651
  for (const entry of entries) {
104536
104652
  if (signal.aborted || matches.length >= max)
104537
104653
  return;
104538
- if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist" || entry.name === ".turbo")
104654
+ if (IGNORED_DIR_NAMES.has(entry.name))
104539
104655
  continue;
104540
104656
  const full = path3.join(cursor, entry.name);
104541
104657
  if (entry.isDirectory()) {
@@ -104564,7 +104680,7 @@ async function walk2(root, cursor, re2, fileRe, matches, max, signal) {
104564
104680
  }
104565
104681
  async function readHandler(input, ctx) {
104566
104682
  const { file_path, offset = 0, limit: limit2 = 2e3 } = input;
104567
- const resolved = resolveSafe(ctx.cwd, file_path);
104683
+ const resolved = resolvePath(ctx.cwd, file_path);
104568
104684
  const text = ctx.fs ? await ctx.fs.readFile(resolved, { encoding: "utf8" }) : (await promises.readFile(resolved)).toString("utf8");
104569
104685
  const lines = text.split("\n");
104570
104686
  const sliced = lines.slice(offset, offset + limit2);
@@ -104710,6 +104826,53 @@ function safeJson(v3, indent) {
104710
104826
  return String(v3);
104711
104827
  }
104712
104828
  }
104829
+ var MAX_SLEEP_MS = 3e5;
104830
+ function resolveSleepMs(input) {
104831
+ const requested = (input.seconds ?? 0) * 1e3 + (input.ms ?? 0);
104832
+ return Math.min(Math.round(requested), MAX_SLEEP_MS);
104833
+ }
104834
+ var sleepTool = defineTool({
104835
+ name: "Sleep",
104836
+ description: "Pause for a set duration before continuing. Use it to wait for an external/async process (a build, a deploy, a server warming up) before re-checking, instead of busy-looping. Give `seconds` and/or `ms` (they sum); capped at 5 minutes per call. Interruptible.",
104837
+ inputSchema: z$1.object({
104838
+ seconds: z$1.number().positive().optional().describe("Seconds to pause. Summed with `ms` when both are given."),
104839
+ ms: z$1.number().int().positive().optional().describe("Milliseconds to pause. Summed with `seconds` when both are given.")
104840
+ }).refine((v3) => v3.seconds !== void 0 || v3.ms !== void 0, {
104841
+ message: "Provide `seconds` and/or `ms`."
104842
+ }),
104843
+ // No side effects — safe to auto-allow without a permission prompt.
104844
+ permission: { action: "allow" },
104845
+ compact: {
104846
+ verb: "Sleeping",
104847
+ noun: { one: "pause", other: "pauses" }
104848
+ },
104849
+ isolation: {
104850
+ capabilities: {
104851
+ net: { mode: "none" },
104852
+ // Slightly above the cap so the isolator's own timeout never fires
104853
+ // before a max-length sleep resolves on its own.
104854
+ timeMs: MAX_SLEEP_MS + 1e3
104855
+ }
104856
+ },
104857
+ async handler(input, ctx) {
104858
+ const totalMs = resolveSleepMs(input);
104859
+ if (ctx.signal.aborted) {
104860
+ throw new MoxxyError({ code: "ABORTED", message: "Sleep aborted before start" });
104861
+ }
104862
+ await new Promise((resolve12, reject) => {
104863
+ const timer = setTimeout(() => {
104864
+ ctx.signal.removeEventListener("abort", onAbort);
104865
+ resolve12();
104866
+ }, totalMs);
104867
+ const onAbort = () => {
104868
+ clearTimeout(timer);
104869
+ reject(new MoxxyError({ code: "ABORTED", message: `Sleep interrupted after request for ${totalMs}ms` }));
104870
+ };
104871
+ ctx.signal.addEventListener("abort", onAbort, { once: true });
104872
+ });
104873
+ return `slept ${totalMs}ms`;
104874
+ }
104875
+ });
104713
104876
  var writeTool = defineTool({
104714
104877
  name: "Write",
104715
104878
  description: "Write a UTF-8 file to disk, creating parent directories as needed. Overwrites if exists.",
@@ -104731,7 +104894,7 @@ var writeTool = defineTool({
104731
104894
  }
104732
104895
  },
104733
104896
  async handler({ file_path, content }, ctx) {
104734
- const resolved = resolveSafe(ctx.cwd, file_path);
104897
+ const resolved = resolvePath(ctx.cwd, file_path);
104735
104898
  if (ctx.signal.aborted) {
104736
104899
  throw new MoxxyError({ code: "ABORTED", message: `Write aborted before start: ${resolved}` });
104737
104900
  }
@@ -104748,7 +104911,8 @@ var builtinTools = [
104748
104911
  bashTool,
104749
104912
  grepTool,
104750
104913
  globTool,
104751
- recallTool
104914
+ recallTool,
104915
+ sleepTool
104752
104916
  ];
104753
104917
  var builtinToolsPlugin = definePlugin({
104754
104918
  name: "@moxxy/tools-builtin",
@@ -106444,6 +106608,425 @@ var developerModePlugin = definePlugin({
106444
106608
  version: "0.0.0",
106445
106609
  modes: [developerMode]
106446
106610
  });
106611
+ var GOAL_MODE_NAME = "goal";
106612
+ var GOAL_PLUGIN_ID = asPluginId("@moxxy/mode-goal");
106613
+ var GOAL_COMPLETE_TOOL = "goal_complete";
106614
+ var GOAL_ABANDON_TOOL = "goal_abandon";
106615
+ var GOAL_MAX_ITERATIONS = 150;
106616
+ var GOAL_MAX_NOOP_ITERATIONS = 3;
106617
+ var GOAL_TOKEN_BUDGET = 4e6;
106618
+ var GOAL_SYSTEM_PROMPT = `You are operating in GOAL MODE. The user has given you a goal and you will work on it AUTONOMOUSLY, across as many steps as it takes, until it is genuinely done. You are running unattended \u2014 the user is not watching each step and your tool calls are auto-approved \u2014 so act like a careful senior engineer who has been handed the keys.
106619
+
106620
+ How goal mode ends \u2014 this is the most important rule:
106621
+ - The loop does NOT end when you stop talking. It ends ONLY when you call the \`${GOAL_COMPLETE_TOOL}\` tool. If you produce a message without tool calls, you will simply be prompted to continue.
106622
+ - When (and only when) the goal is FULLY achieved AND you have verified it, call \`${GOAL_COMPLETE_TOOL}\` with a short summary and concrete evidence (commands you ran and their results, files you changed, tests that passed).
106623
+ - If you become genuinely blocked \u2014 a missing credential, a destructive action you shouldn't take unattended, or a requirement too ambiguous to proceed on \u2014 call \`${GOAL_ABANDON_TOOL}\` with the reason and exactly what you need from the user. Do NOT spin on something you cannot resolve.
106624
+
106625
+ While working:
106626
+ - Break the goal into steps and just do them \u2014 don't stop to ask for confirmation on routine work; you have autonomy for this run.
106627
+ - Verify your work as you go (run the project's tests / build / linter when relevant) before declaring the goal complete.
106628
+ - Be careful with irreversible or destructive operations (deleting data, force-pushing, external side effects). When something is high-stakes and reversible-only-by-the-user, prefer to \`${GOAL_ABANDON_TOOL}\` and ask rather than guess.
106629
+ - Don't repeat the same failing action. If an approach isn't working, change it; if nothing works, abandon with a clear explanation.
106630
+ - Don't declare the goal complete prematurely. "I think this should work" is not done \u2014 verify first.`;
106631
+ var CONTINUE_NUDGE = `You stopped without calling \`${GOAL_COMPLETE_TOOL}\`. If the goal is fully achieved AND verified, call \`${GOAL_COMPLETE_TOOL}\` now. Otherwise, take the next concrete step toward it.`;
106632
+ var STALL_NUDGE = `You have produced no tool calls for several turns. Either take a concrete next action toward the goal, or call \`${GOAL_COMPLETE_TOOL}\` (if done) / \`${GOAL_ABANDON_TOOL}\` (if blocked). Do not reply with only text again.`;
106633
+ var goalCompleteTool = defineTool({
106634
+ name: GOAL_COMPLETE_TOOL,
106635
+ description: "Declare the goal FULLY ACHIEVED and end goal mode. Call this only after you have verified the work. Provide a short summary and concrete evidence (commands run + results, files changed, tests that passed). This is the only way to end a goal-mode run successfully.",
106636
+ inputSchema: z.object({
106637
+ summary: z.string().min(1).describe("One- or two-sentence summary of what was accomplished."),
106638
+ evidence: z.array(z.string()).optional().describe("Concrete proof the goal is met: commands run and their results, files changed, tests passed.")
106639
+ }),
106640
+ permission: { action: "allow" },
106641
+ handler: (input) => {
106642
+ const { summary, evidence } = input;
106643
+ return {
106644
+ acknowledged: true,
106645
+ summary,
106646
+ evidenceCount: evidence?.length ?? 0
106647
+ };
106648
+ }
106649
+ });
106650
+ var goalAbandonTool = defineTool({
106651
+ name: GOAL_ABANDON_TOOL,
106652
+ description: "Give up on the goal because you are genuinely blocked \u2014 a missing credential, a destructive action you should not take unattended, or a requirement too ambiguous to proceed. Provide the reason and exactly what you need from the user. This ends goal mode without claiming success.",
106653
+ inputSchema: z.object({
106654
+ reason: z.string().min(1).describe("Why you cannot proceed."),
106655
+ needsFromUser: z.string().optional().describe("What the user must provide or decide for the goal to continue.")
106656
+ }),
106657
+ permission: { action: "allow" },
106658
+ handler: (input) => {
106659
+ const { reason, needsFromUser } = input;
106660
+ return { acknowledged: true, reason, ...needsFromUser ? { needsFromUser } : {} };
106661
+ }
106662
+ });
106663
+ var goalTools = [goalCompleteTool, goalAbandonTool];
106664
+
106665
+ // ../mode-goal/dist/completion.js
106666
+ function detectGoalTerminal(log, batch) {
106667
+ const goalCalls = /* @__PURE__ */ new Map();
106668
+ for (const t2 of batch) {
106669
+ if (t2.name === GOAL_COMPLETE_TOOL || t2.name === GOAL_ABANDON_TOOL)
106670
+ goalCalls.set(t2.id, t2);
106671
+ }
106672
+ if (goalCalls.size === 0)
106673
+ return null;
106674
+ for (let i2 = log.length - 1; i2 >= 0; i2--) {
106675
+ const e3 = log[i2];
106676
+ if (!e3 || e3.type !== "tool_result" || !e3.ok)
106677
+ continue;
106678
+ const call = goalCalls.get(String(e3.callId));
106679
+ if (!call)
106680
+ continue;
106681
+ const input = call.input ?? {};
106682
+ if (call.name === GOAL_COMPLETE_TOOL) {
106683
+ return {
106684
+ kind: "complete",
106685
+ summary: typeof input.summary === "string" ? input.summary : "Goal completed.",
106686
+ evidence: Array.isArray(input.evidence) ? input.evidence : []
106687
+ };
106688
+ }
106689
+ return {
106690
+ kind: "abandon",
106691
+ reason: typeof input.reason === "string" ? input.reason : "Goal abandoned.",
106692
+ ...typeof input.needsFromUser === "string" ? { needsFromUser: input.needsFromUser } : {}
106693
+ };
106694
+ }
106695
+ return null;
106696
+ }
106697
+
106698
+ // ../mode-goal/dist/goal-loop.js
106699
+ async function* runGoalMode(ctx) {
106700
+ if (ctx.signal.aborted) {
106701
+ yield await ctx.emit({
106702
+ type: "abort",
106703
+ sessionId: ctx.sessionId,
106704
+ turnId: ctx.turnId,
106705
+ source: "system",
106706
+ reason: "aborted before goal mode start"
106707
+ });
106708
+ return;
106709
+ }
106710
+ const autoApprove = {
106711
+ name: "goal-auto-approve",
106712
+ check: async () => ({ mode: "allow", reason: "goal mode runs tools unattended (auto-approve)" })
106713
+ };
106714
+ const goalCtx = {
106715
+ ...ctx,
106716
+ systemPrompt: composeSystemPrompts2(ctx.systemPrompt, GOAL_SYSTEM_PROMPT),
106717
+ permissions: autoApprove
106718
+ };
106719
+ yield await ctx.emit({
106720
+ type: "plugin_event",
106721
+ sessionId: ctx.sessionId,
106722
+ turnId: ctx.turnId,
106723
+ source: "plugin",
106724
+ pluginId: GOAL_PLUGIN_ID,
106725
+ subtype: "goal_started",
106726
+ payload: { autoApprove: true, maxIterations: ctx.maxIterations ?? GOAL_MAX_ITERATIONS }
106727
+ });
106728
+ const detector = createStuckLoopDetector();
106729
+ const maxIterations = ctx.maxIterations ?? GOAL_MAX_ITERATIONS;
106730
+ let noop3 = 0;
106731
+ let totalTokens = 0;
106732
+ let reactiveCompactions = 0;
106733
+ const MAX_REACTIVE_COMPACTIONS = 2;
106734
+ for (let iteration = 1; iteration <= maxIterations; iteration++) {
106735
+ if (ctx.signal.aborted) {
106736
+ yield await ctx.emit({
106737
+ type: "abort",
106738
+ sessionId: ctx.sessionId,
106739
+ turnId: ctx.turnId,
106740
+ source: "system",
106741
+ reason: "signal aborted"
106742
+ });
106743
+ return;
106744
+ }
106745
+ yield await ctx.emit({
106746
+ type: "mode_iteration",
106747
+ sessionId: ctx.sessionId,
106748
+ turnId: ctx.turnId,
106749
+ source: "system",
106750
+ strategy: GOAL_MODE_NAME,
106751
+ iteration
106752
+ });
106753
+ await runCompactionIfNeeded(goalCtx);
106754
+ await runElisionIfNeeded(goalCtx);
106755
+ const nudge = noop3 === 0 ? void 0 : noop3 >= GOAL_MAX_NOOP_ITERATIONS - 1 ? STALL_NUDGE : CONTINUE_NUDGE;
106756
+ const baseSystem = buildSystemPromptWithSkills(goalCtx.systemPrompt, goalCtx.skills.list()) ?? "";
106757
+ const { messages, stablePrefixIndex } = projectMessages(goalCtx, {
106758
+ ...baseSystem ? { systemPrompt: baseSystem } : {},
106759
+ ...nudge ? { trailingUserText: nudge } : {}
106760
+ });
106761
+ yield await ctx.emit({
106762
+ type: "provider_request",
106763
+ sessionId: ctx.sessionId,
106764
+ turnId: ctx.turnId,
106765
+ source: "system",
106766
+ provider: goalCtx.provider.name,
106767
+ model: goalCtx.model
106768
+ });
106769
+ const { text, toolUses, stopReason, error: error2, usage } = await collectProviderStream(goalCtx, messages, { iteration, stablePrefixIndex });
106770
+ yield await ctx.emit({
106771
+ type: "provider_response",
106772
+ sessionId: ctx.sessionId,
106773
+ turnId: ctx.turnId,
106774
+ source: "system",
106775
+ provider: goalCtx.provider.name,
106776
+ model: goalCtx.model,
106777
+ ...usageEventFields(usage)
106778
+ });
106779
+ if (usage)
106780
+ totalTokens += (usage.inputTokens ?? 0) + (usage.outputTokens ?? 0);
106781
+ if (error2) {
106782
+ if (isContextOverflowError(error2.message) && reactiveCompactions < MAX_REACTIVE_COMPACTIONS) {
106783
+ reactiveCompactions += 1;
106784
+ const compacted = await runCompactionIfNeeded(goalCtx, { force: true });
106785
+ if (compacted) {
106786
+ yield await ctx.emit({
106787
+ type: "error",
106788
+ sessionId: ctx.sessionId,
106789
+ turnId: ctx.turnId,
106790
+ source: "system",
106791
+ kind: "retryable",
106792
+ message: "context window exceeded \u2014 compacted older turns, retrying"
106793
+ });
106794
+ continue;
106795
+ }
106796
+ }
106797
+ yield await ctx.emit({
106798
+ type: "error",
106799
+ sessionId: ctx.sessionId,
106800
+ turnId: ctx.turnId,
106801
+ source: "system",
106802
+ kind: error2.retryable ? "retryable" : "fatal",
106803
+ message: `goal: ${error2.message}`
106804
+ });
106805
+ if (!error2.retryable)
106806
+ return;
106807
+ continue;
106808
+ }
106809
+ reactiveCompactions = 0;
106810
+ if (totalTokens > GOAL_TOKEN_BUDGET) {
106811
+ yield await ctx.emit({
106812
+ type: "plugin_event",
106813
+ sessionId: ctx.sessionId,
106814
+ turnId: ctx.turnId,
106815
+ source: "plugin",
106816
+ pluginId: GOAL_PLUGIN_ID,
106817
+ subtype: "goal_budget_exhausted",
106818
+ payload: { totalTokens, budget: GOAL_TOKEN_BUDGET, iteration }
106819
+ });
106820
+ yield await ctx.emit({
106821
+ type: "assistant_message",
106822
+ sessionId: ctx.sessionId,
106823
+ turnId: ctx.turnId,
106824
+ source: "system",
106825
+ content: `Goal mode stopped: token budget exhausted (${totalTokens.toLocaleString()} > ${GOAL_TOKEN_BUDGET.toLocaleString()}) before the goal was completed. Send another message to continue from here.`,
106826
+ stopReason: "end_turn"
106827
+ });
106828
+ return;
106829
+ }
106830
+ const stuck = yield* emitRequestsAndDetectStuck2(ctx, toolUses, detector);
106831
+ if (stuck)
106832
+ return;
106833
+ if (text || stopReason === "end_turn" || toolUses.length === 0) {
106834
+ yield await ctx.emit({
106835
+ type: "assistant_message",
106836
+ sessionId: ctx.sessionId,
106837
+ turnId: ctx.turnId,
106838
+ source: "model",
106839
+ content: text,
106840
+ stopReason
106841
+ });
106842
+ }
106843
+ if (toolUses.length === 0) {
106844
+ noop3 += 1;
106845
+ if (noop3 >= GOAL_MAX_NOOP_ITERATIONS) {
106846
+ yield await ctx.emit({
106847
+ type: "plugin_event",
106848
+ sessionId: ctx.sessionId,
106849
+ turnId: ctx.turnId,
106850
+ source: "plugin",
106851
+ pluginId: GOAL_PLUGIN_ID,
106852
+ subtype: "goal_stalled",
106853
+ payload: { idleIterations: noop3, iteration }
106854
+ });
106855
+ yield await ctx.emit({
106856
+ type: "assistant_message",
106857
+ sessionId: ctx.sessionId,
106858
+ turnId: ctx.turnId,
106859
+ source: "system",
106860
+ content: "Goal mode stopped: the model went idle without calling `goal_complete`. It may believe the goal is done \u2014 review the work above, and send another message to continue if not.",
106861
+ stopReason: "end_turn"
106862
+ });
106863
+ return;
106864
+ }
106865
+ continue;
106866
+ }
106867
+ noop3 = 0;
106868
+ const exited = yield* executeToolUses2(goalCtx, toolUses, iteration);
106869
+ if (exited)
106870
+ return;
106871
+ const terminal = detectGoalTerminal(ctx.log.slice(), toolUses);
106872
+ if (terminal?.kind === "complete") {
106873
+ yield await ctx.emit({
106874
+ type: "plugin_event",
106875
+ sessionId: ctx.sessionId,
106876
+ turnId: ctx.turnId,
106877
+ source: "plugin",
106878
+ pluginId: GOAL_PLUGIN_ID,
106879
+ subtype: "goal_completed",
106880
+ payload: { summary: terminal.summary, evidenceCount: terminal.evidence.length, iterations: iteration }
106881
+ });
106882
+ const evidenceBlock = terminal.evidence.length > 0 ? `
106883
+
106884
+ ${terminal.evidence.map((e3) => `- ${e3}`).join("\n")}` : "";
106885
+ yield await ctx.emit({
106886
+ type: "assistant_message",
106887
+ sessionId: ctx.sessionId,
106888
+ turnId: ctx.turnId,
106889
+ source: "system",
106890
+ content: `\u2713 Goal complete \u2014 ${terminal.summary}${evidenceBlock}`,
106891
+ stopReason: "end_turn"
106892
+ });
106893
+ return;
106894
+ }
106895
+ if (terminal?.kind === "abandon") {
106896
+ yield await ctx.emit({
106897
+ type: "plugin_event",
106898
+ sessionId: ctx.sessionId,
106899
+ turnId: ctx.turnId,
106900
+ source: "plugin",
106901
+ pluginId: GOAL_PLUGIN_ID,
106902
+ subtype: "goal_abandoned",
106903
+ payload: { reason: terminal.reason, ...terminal.needsFromUser ? { needsFromUser: terminal.needsFromUser } : {}, iterations: iteration }
106904
+ });
106905
+ const needs = terminal.needsFromUser ? `
106906
+
106907
+ Needs from you: ${terminal.needsFromUser}` : "";
106908
+ yield await ctx.emit({
106909
+ type: "assistant_message",
106910
+ sessionId: ctx.sessionId,
106911
+ turnId: ctx.turnId,
106912
+ source: "system",
106913
+ content: `Goal abandoned \u2014 ${terminal.reason}${needs}`,
106914
+ stopReason: "end_turn"
106915
+ });
106916
+ return;
106917
+ }
106918
+ }
106919
+ yield await ctx.emit({
106920
+ type: "plugin_event",
106921
+ sessionId: ctx.sessionId,
106922
+ turnId: ctx.turnId,
106923
+ source: "plugin",
106924
+ pluginId: GOAL_PLUGIN_ID,
106925
+ subtype: "goal_max_iterations",
106926
+ payload: { maxIterations }
106927
+ });
106928
+ yield await ctx.emit({
106929
+ type: "error",
106930
+ sessionId: ctx.sessionId,
106931
+ turnId: ctx.turnId,
106932
+ source: "system",
106933
+ kind: "fatal",
106934
+ message: `goal mode reached the iteration cap (${maxIterations}) without calling goal_complete. Stopping to avoid an unbounded run; send another message to continue.`
106935
+ });
106936
+ }
106937
+ function composeSystemPrompts2(user, layer) {
106938
+ if (!user || user.trim() === "")
106939
+ return layer;
106940
+ return `${layer}
106941
+
106942
+ ---
106943
+
106944
+ ${user}`;
106945
+ }
106946
+ async function* emitRequestsAndDetectStuck2(ctx, toolUses, detector) {
106947
+ for (const t2 of toolUses) {
106948
+ yield await ctx.emit({
106949
+ type: "tool_call_requested",
106950
+ sessionId: ctx.sessionId,
106951
+ turnId: ctx.turnId,
106952
+ source: "model",
106953
+ callId: asToolCallId(t2.id),
106954
+ name: t2.name,
106955
+ input: t2.input
106956
+ });
106957
+ const sig = detector.record(t2.name, t2.input);
106958
+ if (sig.stuck) {
106959
+ const how = sig.kind === "near" ? "against the same target (only volatile args varied)" : "with identical input";
106960
+ yield await ctx.emit({
106961
+ type: "plugin_event",
106962
+ sessionId: ctx.sessionId,
106963
+ turnId: ctx.turnId,
106964
+ source: "plugin",
106965
+ pluginId: GOAL_PLUGIN_ID,
106966
+ subtype: "goal_stuck",
106967
+ payload: { tool: t2.name, count: sig.count, kind: sig.kind }
106968
+ });
106969
+ yield await ctx.emit({
106970
+ type: "error",
106971
+ sessionId: ctx.sessionId,
106972
+ turnId: ctx.turnId,
106973
+ source: "system",
106974
+ kind: "fatal",
106975
+ message: `goal mode aborted \u2014 stuck pattern: tool "${t2.name}" called ${sig.count} times ${how}. The model is looping on the same call; send another message to redirect it.`
106976
+ });
106977
+ return true;
106978
+ }
106979
+ }
106980
+ return false;
106981
+ }
106982
+ async function* executeToolUses2(ctx, toolUses, iteration) {
106983
+ const unresolved = new Set(toolUses.map((t2) => t2.id));
106984
+ for (const t2 of toolUses) {
106985
+ if (ctx.signal.aborted) {
106986
+ for (const orphanId of unresolved) {
106987
+ yield await ctx.emit({
106988
+ type: "tool_result",
106989
+ sessionId: ctx.sessionId,
106990
+ turnId: ctx.turnId,
106991
+ source: "tool",
106992
+ callId: asToolCallId(orphanId),
106993
+ ok: false,
106994
+ error: { kind: "aborted", message: "turn aborted before tool ran" }
106995
+ });
106996
+ }
106997
+ unresolved.clear();
106998
+ yield await ctx.emit({
106999
+ type: "abort",
107000
+ sessionId: ctx.sessionId,
107001
+ turnId: ctx.turnId,
107002
+ source: "system",
107003
+ reason: "signal aborted during tool execution"
107004
+ });
107005
+ return true;
107006
+ }
107007
+ try {
107008
+ yield* dispatchToolCall(ctx, t2, iteration);
107009
+ } finally {
107010
+ unresolved.delete(t2.id);
107011
+ }
107012
+ }
107013
+ return false;
107014
+ }
107015
+
107016
+ // ../mode-goal/dist/index.js
107017
+ var goalMode = defineMode({
107018
+ name: GOAL_MODE_NAME,
107019
+ description: "Autonomous goal loop: works across many turns until it calls goal_complete (tools auto-approved)",
107020
+ run: runGoalMode
107021
+ });
107022
+ var goalModePlugin = definePlugin({
107023
+ name: "@moxxy/mode-goal",
107024
+ version: "0.0.0",
107025
+ // The mode AND its control tools ship together: the loop watches for the
107026
+ // tools' results to terminate, so they're useless apart.
107027
+ modes: [goalMode],
107028
+ tools: goalTools
107029
+ });
106447
107030
  var DEEP_RESEARCH_MODE_NAME = "deep-research";
106448
107031
  var DEEP_RESEARCH_PLUGIN_ID = asPluginId("@moxxy/mode-deep-research");
106449
107032
  var QUERY_PLAN_SYSTEM_PROMPT = `You are scoping a deep-research task. Produce 2-5 PARALLEL GATHERING queries \u2014 one per independent angle of raw evidence the synthesis phase will need.
@@ -109103,7 +109686,7 @@ function C2(r2, t2) {
109103
109686
  for (const s2 of r2) if (s2 !== void 0 && C2(s2, t2)) return true;
109104
109687
  return false;
109105
109688
  }
109106
- function z19(r2, t2) {
109689
+ function z21(r2, t2) {
109107
109690
  if (r2 === t2) return;
109108
109691
  const s2 = r2.split(`
109109
109692
  `), e3 = t2.split(`
@@ -109243,7 +109826,7 @@ var m2 = class {
109243
109826
  if (t2 !== this._prevFrame) {
109244
109827
  if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
109245
109828
  else {
109246
- const s2 = z19(this._prevFrame, t2), e3 = L2(this.output);
109829
+ const s2 = z21(this._prevFrame, t2), e3 = L2(this.output);
109247
109830
  if (this.restoreCursor(), s2) {
109248
109831
  const i2 = Math.max(0, s2.numLinesAfter - e3), n2 = Math.max(0, s2.numLinesBefore - e3);
109249
109832
  let o2 = s2.lines.find((u2) => u2 >= i2);
@@ -109294,52 +109877,6 @@ var X2 = class extends m2 {
109294
109877
  });
109295
109878
  }
109296
109879
  };
109297
- var nt2 = class extends m2 {
109298
- options;
109299
- cursor = 0;
109300
- get _value() {
109301
- return this.options[this.cursor].value;
109302
- }
109303
- get _enabledOptions() {
109304
- return this.options.filter((t2) => t2.disabled !== true);
109305
- }
109306
- toggleAll() {
109307
- const t2 = this._enabledOptions, s2 = this.value !== void 0 && this.value.length === t2.length;
109308
- this.value = s2 ? [] : t2.map((e3) => e3.value);
109309
- }
109310
- toggleInvert() {
109311
- const t2 = this.value;
109312
- if (!t2) return;
109313
- const s2 = this._enabledOptions.filter((e3) => !t2.includes(e3.value));
109314
- this.value = s2.map((e3) => e3.value);
109315
- }
109316
- toggleValue() {
109317
- this.value === void 0 && (this.value = []);
109318
- const t2 = this.value.includes(this._value);
109319
- this.value = t2 ? this.value.filter((s2) => s2 !== this._value) : [...this.value, this._value];
109320
- }
109321
- constructor(t2) {
109322
- super(t2, false), this.options = t2.options, this.value = [...t2.initialValues ?? []];
109323
- const s2 = Math.max(this.options.findIndex(({ value: e3 }) => e3 === t2.cursorAt), 0);
109324
- this.cursor = this.options[s2].disabled ? f2(s2, 1, this.options) : s2, this.on("key", (e3) => {
109325
- e3 === "a" && this.toggleAll(), e3 === "i" && this.toggleInvert();
109326
- }), this.on("cursor", (e3) => {
109327
- switch (e3) {
109328
- case "left":
109329
- case "up":
109330
- this.cursor = f2(this.cursor, -1, this.options);
109331
- break;
109332
- case "down":
109333
- case "right":
109334
- this.cursor = f2(this.cursor, 1, this.options);
109335
- break;
109336
- case "space":
109337
- this.toggleValue();
109338
- break;
109339
- }
109340
- });
109341
- }
109342
- };
109343
109880
  var ot2 = class extends m2 {
109344
109881
  _mask = "\u2022";
109345
109882
  get cursor() {
@@ -109424,11 +109961,8 @@ var H2 = w3("\u25C7", "o");
109424
109961
  var lt2 = w3("\u250C", "T");
109425
109962
  var $2 = w3("\u2502", "|");
109426
109963
  var x3 = w3("\u2514", "\u2014");
109427
- var z20 = w3("\u25CF", ">");
109964
+ var z22 = w3("\u25CF", ">");
109428
109965
  var U2 = w3("\u25CB", " ");
109429
- var et3 = w3("\u25FB", "[\u2022]");
109430
- var K3 = w3("\u25FC", "[+]");
109431
- var Y3 = w3("\u25FB", "[ ]");
109432
109966
  var Et2 = w3("\u25AA", "\u2022");
109433
109967
  var st2 = w3("\u2500", "-");
109434
109968
  var ct2 = w3("\u256E", "+");
@@ -109514,9 +110048,9 @@ ${styleText("gray", $2)}` : ""}`;
109514
110048
  }
109515
110049
  default: {
109516
110050
  const l2 = r2 ? `${styleText("cyan", $2)} ` : "", d2 = r2 ? styleText("cyan", x3) : "";
109517
- return `${c2}${l2}${this.value ? `${styleText("green", z20)} ${i2}` : `${styleText("dim", U2)} ${styleText("dim", i2)}`}${t2.vertical ? r2 ? `
110051
+ return `${c2}${l2}${this.value ? `${styleText("green", z22)} ${i2}` : `${styleText("dim", U2)} ${styleText("dim", i2)}`}${t2.vertical ? r2 ? `
109518
110052
  ${styleText("cyan", $2)} ` : `
109519
- ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U2)} ${styleText("dim", s2)}` : `${styleText("green", z20)} ${s2}`}
110053
+ ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U2)} ${styleText("dim", s2)}` : `${styleText("green", z22)} ${s2}`}
109520
110054
  ${d2}
109521
110055
  `;
109522
110056
  }
@@ -109567,59 +110101,6 @@ ${styleText("gray", x3)} ` ;
109567
110101
 
109568
110102
  `);
109569
110103
  };
109570
- var Q3 = (t2, i2) => t2.split(`
109571
- `).map((s2) => i2(s2)).join(`
109572
- `);
109573
- var ve2 = (t2) => {
109574
- const i2 = (r2, u2) => {
109575
- const n2 = r2.label ?? String(r2.value);
109576
- return u2 === "disabled" ? `${styleText("gray", Y3)} ${Q3(n2, (a2) => styleText(["strikethrough", "gray"], a2))}${r2.hint ? ` ${styleText("dim", `(${r2.hint ?? "disabled"})`)}` : ""}` : u2 === "active" ? `${styleText("cyan", et3)} ${n2}${r2.hint ? ` ${styleText("dim", `(${r2.hint})`)}` : ""}` : u2 === "selected" ? `${styleText("green", K3)} ${Q3(n2, (a2) => styleText("dim", a2))}${r2.hint ? ` ${styleText("dim", `(${r2.hint})`)}` : ""}` : u2 === "cancelled" ? `${Q3(n2, (a2) => styleText(["strikethrough", "dim"], a2))}` : u2 === "active-selected" ? `${styleText("green", K3)} ${n2}${r2.hint ? ` ${styleText("dim", `(${r2.hint})`)}` : ""}` : u2 === "submitted" ? `${Q3(n2, (a2) => styleText("dim", a2))}` : `${styleText("dim", Y3)} ${Q3(n2, (a2) => styleText("dim", a2))}`;
109577
- }, s2 = t2.required ?? true;
109578
- return new nt2({ options: t2.options, signal: t2.signal, input: t2.input, output: t2.output, initialValues: t2.initialValues, required: s2, cursorAt: t2.cursorAt, validate(r2) {
109579
- if (s2 && (r2 === void 0 || r2.length === 0)) return `Please select at least one option.
109580
- ${styleText("reset", styleText("dim", `Press ${styleText(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
109581
- }, render() {
109582
- const r2 = t2.withGuide ?? h2.withGuide, u2 = W2(t2.output, t2.message, r2 ? `${yt2(this.state)} ` : "", `${P2(this.state)} `), n2 = `${r2 ? `${styleText("gray", $2)}
109583
- ` : ""}${u2}
109584
- `, a2 = this.value ?? [], c2 = (o2, l2) => {
109585
- if (o2.disabled) return i2(o2, "disabled");
109586
- const d2 = a2.includes(o2.value);
109587
- return l2 && d2 ? i2(o2, "active-selected") : d2 ? i2(o2, "selected") : i2(o2, l2 ? "active" : "inactive");
109588
- };
109589
- switch (this.state) {
109590
- case "submit": {
109591
- const o2 = this.options.filter(({ value: d2 }) => a2.includes(d2)).map((d2) => i2(d2, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), l2 = W2(t2.output, o2, r2 ? `${styleText("gray", $2)} ` : "");
109592
- return `${n2}${l2}`;
109593
- }
109594
- case "cancel": {
109595
- const o2 = this.options.filter(({ value: d2 }) => a2.includes(d2)).map((d2) => i2(d2, "cancelled")).join(styleText("dim", ", "));
109596
- if (o2.trim() === "") return `${n2}${styleText("gray", $2)}`;
109597
- const l2 = W2(t2.output, o2, r2 ? `${styleText("gray", $2)} ` : "");
109598
- return `${n2}${l2}${r2 ? `
109599
- ${styleText("gray", $2)}` : ""}`;
109600
- }
109601
- case "error": {
109602
- const o2 = r2 ? `${styleText("yellow", $2)} ` : "", l2 = this.error.split(`
109603
- `).map((p3, f3) => f3 === 0 ? `${r2 ? `${styleText("yellow", x3)} ` : ""}${styleText("yellow", p3)}` : ` ${p3}`).join(`
109604
- `), d2 = n2.split(`
109605
- `).length, g2 = l2.split(`
109606
- `).length + 1;
109607
- return `${n2}${o2}${F2({ output: t2.output, options: this.options, cursor: this.cursor, maxItems: t2.maxItems, columnPadding: o2.length, rowPadding: d2 + g2, style: c2 }).join(`
109608
- ${o2}`)}
109609
- ${l2}
109610
- `;
109611
- }
109612
- default: {
109613
- const o2 = r2 ? `${styleText("cyan", $2)} ` : "", l2 = n2.split(`
109614
- `).length, d2 = r2 ? 2 : 1;
109615
- return `${n2}${o2}${F2({ output: t2.output, options: this.options, cursor: this.cursor, maxItems: t2.maxItems, columnPadding: o2.length, rowPadding: l2 + d2, style: c2 }).join(`
109616
- ${o2}`)}
109617
- ${r2 ? styleText("cyan", x3) : ""}
109618
- `;
109619
- }
109620
- }
109621
- } }).prompt();
109622
- };
109623
110104
  var we2 = (t2) => styleText("dim", t2);
109624
110105
  var be2 = (t2, i2, s2) => {
109625
110106
  const r2 = { hard: true, trim: false }, u2 = wrapAnsi(t2, i2, r2).split(`
@@ -109734,7 +110215,7 @@ var xe2 = (t2) => {
109734
110215
  case "selected":
109735
110216
  return `${it3(u2, (n2) => styleText("dim", n2))}`;
109736
110217
  case "active":
109737
- return `${styleText("green", z20)} ${u2}${s2.hint ? ` ${styleText("dim", `(${s2.hint})`)}` : ""}`;
110218
+ return `${styleText("green", z22)} ${u2}${s2.hint ? ` ${styleText("dim", `(${s2.hint})`)}` : ""}`;
109738
110219
  case "cancelled":
109739
110220
  return `${it3(u2, (n2) => styleText(["strikethrough", "dim"], n2))}`;
109740
110221
  default:
@@ -111782,6 +112263,15 @@ async function installPluginPackage(opts) {
111782
112263
  }
111783
112264
  return { installed: opts.packageName, dir };
111784
112265
  }
112266
+ async function removePluginPackage(opts) {
112267
+ const dir = userPluginsDir();
112268
+ await ensurePackageJson(dir);
112269
+ const { exitCode, stderr } = await runNpm(["uninstall", "--prefix", dir, "--no-fund", "--no-audit", "--save", opts.packageName], opts.signal);
112270
+ if (exitCode !== 0) {
112271
+ throw new Error(`npm uninstall failed (exit ${exitCode}): ${truncate9(stderr, 400)}`);
112272
+ }
112273
+ return { removed: opts.packageName, dir };
112274
+ }
111785
112275
  function buildInstallPluginTool(deps) {
111786
112276
  return defineTool({
111787
112277
  name: "install_plugin",
@@ -111821,6 +112311,36 @@ function buildInstallPluginTool(deps) {
111821
112311
  }
111822
112312
  });
111823
112313
  }
112314
+ function buildUninstallPluginTool(deps) {
112315
+ return defineTool({
112316
+ name: "uninstall_plugin",
112317
+ description: "Uninstall an npm-installed moxxy plugin from the user plugin directory (~/.moxxy/plugins/) via `npm uninstall`, then hot-reload the plugin host so its tools / agents / providers / modes / channels disappear from the current session. Requires `npm` on PATH. Returns the diff of what got unregistered. Use this when the user asks to remove a plugin they installed. NOTE: this only removes npm packages \u2014 a scaffolded plugin authored under ~/.moxxy/plugins is removed by rolling back its self-update transaction instead.",
112318
+ inputSchema: z$1.object({
112319
+ packageName: z$1.string().min(1).refine((s2) => NPM_NAME_RE.test(s2), {
112320
+ message: "must be a valid npm package name (e.g. @moxxy/agent-researcher)"
112321
+ }).describe("npm package name to uninstall. Scoped (@org/pkg) or bare.")
112322
+ }),
112323
+ permission: { action: "prompt" },
112324
+ isolation: {
112325
+ capabilities: {
112326
+ subprocess: true,
112327
+ commands: ["npm"],
112328
+ fs: { read: ["$cwd/**"], write: [`${userPluginsDir()}/**`] }
112329
+ }
112330
+ },
112331
+ handler: async ({ packageName }, ctx) => {
112332
+ const before = deps.snapshot();
112333
+ const { removed } = await removePluginPackage({ packageName, signal: ctx.signal });
112334
+ await deps.reload();
112335
+ const after = deps.snapshot();
112336
+ return {
112337
+ removed,
112338
+ // before-minus-after == contributions the removed package had provided.
112339
+ unregistered: diffSnapshot2(after, before)
112340
+ };
112341
+ }
112342
+ });
112343
+ }
111824
112344
  async function ensurePackageJson(dir) {
111825
112345
  const pkgPath = path3.join(dir, "package.json");
111826
112346
  try {
@@ -111887,7 +112407,7 @@ function buildPluginsAdminPlugin(opts) {
111887
112407
  return definePlugin({
111888
112408
  name: "@moxxy/plugin-plugins-admin",
111889
112409
  version: "0.0.0",
111890
- tools: [buildInstallPluginTool(deps)]
112410
+ tools: [buildInstallPluginTool(deps), buildUninstallPluginTool(deps)]
111891
112411
  });
111892
112412
  }
111893
112413
  function buildProviderDef(entry) {
@@ -112639,7 +113159,7 @@ var screenshotTool = defineTool({
112639
113159
  const fmt2 = format ?? DEFAULT_FORMAT;
112640
113160
  const dim3 = maxDim ?? DEFAULT_MAX_DIM;
112641
113161
  const q3 = quality ?? DEFAULT_JPEG_QUALITY;
112642
- const captureTmp = path3.join(os3.tmpdir(), `moxxy-screencap-${process.pid}-${Date.now()}.png`);
113162
+ const captureTmp = path3.join(os5.tmpdir(), `moxxy-screencap-${process.pid}-${Date.now()}.png`);
112643
113163
  const captureArgs = ["-x", "-t", "png"];
112644
113164
  if (region) {
112645
113165
  captureArgs.push("-R", `${region.x},${region.y},${region.width},${region.height}`);
@@ -112657,7 +113177,7 @@ var screenshotTool = defineTool({
112657
113177
  });
112658
113178
  }
112659
113179
  const outExt = fmt2 === "jpeg" ? "jpg" : "png";
112660
- const outTmp = path3.join(os3.tmpdir(), `moxxy-screencap-${process.pid}-${Date.now()}-out.${outExt}`);
113180
+ const outTmp = path3.join(os5.tmpdir(), `moxxy-screencap-${process.pid}-${Date.now()}-out.${outExt}`);
112661
113181
  const sipsArgs = [
112662
113182
  "-Z",
112663
113183
  String(dim3),
@@ -116403,7 +116923,7 @@ function serializeWorkflow(wf) {
116403
116923
  return (0, import_yaml.stringify)(wf, { lineWidth: 0 });
116404
116924
  }
116405
116925
  function defaultUserWorkflowsDir() {
116406
- return path3.join(os3.homedir(), ".moxxy", "workflows");
116926
+ return path3.join(os5.homedir(), ".moxxy", "workflows");
116407
116927
  }
116408
116928
  function defaultProjectWorkflowsDir(cwd2) {
116409
116929
  return path3.join(cwd2, ".moxxy", "workflows");
@@ -117703,6 +118223,7 @@ function buildBuiltinsCore(args) {
117703
118223
  { name: "@moxxy/mode-plan-execute", plugin: planExecuteModePlugin },
117704
118224
  { name: "@moxxy/mode-bmad", plugin: bmadModePlugin },
117705
118225
  { name: "@moxxy/mode-developer", plugin: developerModePlugin },
118226
+ { name: "@moxxy/mode-goal", plugin: goalModePlugin },
117706
118227
  { name: "@moxxy/mode-deep-research", plugin: deepResearchModePlugin },
117707
118228
  { name: "@moxxy/compactor-summarize", plugin: summarizeCompactorPlugin },
117708
118229
  { name: "@moxxy/cache-strategy-stable-prefix", plugin: stablePrefixCacheStrategyPlugin },
@@ -117812,7 +118333,7 @@ function buildBuiltinsCore(args) {
117812
118333
  {
117813
118334
  name: "@moxxy/plugin-self-update",
117814
118335
  plugin: buildSelfUpdatePlugin({
117815
- moxxyDir: path3.join(os3.homedir(), ".moxxy"),
118336
+ moxxyDir: path3.join(os5.homedir(), ".moxxy"),
117816
118337
  reload: () => session.pluginHost.reload(),
117817
118338
  unload: (name) => session.pluginHost.unload(name),
117818
118339
  snapshot: () => ({
@@ -117844,12 +118365,69 @@ function buildBuiltinsCore(args) {
117844
118365
  // options.allowCoreUpdate = false to hide the self_update_core_* tools.
117845
118366
  // options.repoUrl overrides the git source (needed if @moxxy/core's
117846
118367
  // published package.json lacks a `repository` field).
118368
+ //
118369
+ // MOXXY_NO_CORE_UPDATE=1 hard-disables Tier-2 regardless of config —
118370
+ // the desktop sets this on the runner spawn because core patches
118371
+ // (git clone + build + dist overlay + restart) can't work inside a
118372
+ // read-only, packaged .app and would only confuse the model.
117847
118373
  coreUpdate: {
117848
- enabled: rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.allowCoreUpdate !== false,
118374
+ enabled: process.env.MOXXY_NO_CORE_UPDATE !== "1" && rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.allowCoreUpdate !== false,
117849
118375
  ...typeof rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.repoUrl === "string" ? { repoUrlOverride: rawConfig.plugins["@moxxy/plugin-self-update"].options.repoUrl } : {}
117850
118376
  }
117851
118377
  })
117852
118378
  },
118379
+ // Voice/TTS control — lets the agent switch which text-to-speech backend
118380
+ // read-aloud surfaces (the desktop's speaker button) use, without a
118381
+ // settings UI. `set_voice` activates a registered synthesizer by name, or
118382
+ // 'system' to deactivate (fall back to the OS voice). `list_voices` reports
118383
+ // what's available + which is active. A synthesizer authored via
118384
+ // self-update auto-activates on load, so this is for switching afterwards.
118385
+ {
118386
+ name: "@moxxy/voice-admin",
118387
+ plugin: (() => {
118388
+ const voiceNames = () => [
118389
+ "system",
118390
+ ...session.synthesizers.list().map((s2) => s2.name)
118391
+ ];
118392
+ return definePlugin({
118393
+ name: "@moxxy/voice-admin",
118394
+ version: "0.0.0",
118395
+ tools: [
118396
+ defineTool({
118397
+ name: "list_voices",
118398
+ description: 'List the text-to-speech (synthesizer) backends registered on this session and which one is active. "system" means the OS voice (no plugin synthesizer active).',
118399
+ inputSchema: z$1.object({}),
118400
+ permission: { action: "allow" },
118401
+ handler: () => ({
118402
+ active: session.synthesizers.getActiveName() ?? "system",
118403
+ available: voiceNames()
118404
+ })
118405
+ }),
118406
+ defineTool({
118407
+ name: "set_voice",
118408
+ description: 'Choose which text-to-speech backend read-aloud uses. Pass a registered synthesizer name (see list_voices) to activate it, or "system" to fall back to the OS voice. Use this to switch between an installed TTS plugin (e.g. ElevenLabs) and the built-in voice.',
118409
+ inputSchema: z$1.object({
118410
+ synthesizer: z$1.string().min(1).describe('Synthesizer name to activate, or "system" for the OS voice.')
118411
+ }),
118412
+ permission: { action: "allow" },
118413
+ handler: ({ synthesizer }) => {
118414
+ if (synthesizer === "system") {
118415
+ session.synthesizers.clearActive();
118416
+ return { active: "system" };
118417
+ }
118418
+ if (!session.synthesizers.has(synthesizer)) {
118419
+ throw new Error(
118420
+ `No synthesizer named "${synthesizer}". Available: ${voiceNames().join(", ")}.`
118421
+ );
118422
+ }
118423
+ session.synthesizers.setActive(synthesizer);
118424
+ return { active: synthesizer };
118425
+ }
118426
+ })
118427
+ ]
118428
+ });
118429
+ })()
118430
+ },
117853
118431
  // Provider admin tools (provider_add, provider_list, provider_remove,
117854
118432
  // provider_test). Persists OpenAI-compatible vendor registrations to
117855
118433
  // ~/.moxxy/providers.json; the plugin's onInit re-registers them on
@@ -118029,7 +118607,7 @@ async function registerPlugins(session, config, builtins, cwd2, logger, opts = {
118029
118607
  return { registered, skipped: session.pluginHost.listSkipped() };
118030
118608
  }
118031
118609
  const loader = createPluginLoader({ cwd: cwd2 });
118032
- const userPluginsDir2 = path3.join(os3.homedir(), ".moxxy", "plugins");
118610
+ const userPluginsDir2 = path3.join(os5.homedir(), ".moxxy", "plugins");
118033
118611
  const userPluginsNodeModules = path3.join(userPluginsDir2, "node_modules");
118034
118612
  try {
118035
118613
  const manifests = await discoverPlugins({
@@ -118371,7 +118949,12 @@ async function setupSessionWithConfig(opts) {
118371
118949
  config,
118372
118950
  resolver: opts.resolver,
118373
118951
  resumeSessionId: opts.resumeSessionId,
118374
- logger
118952
+ logger,
118953
+ // Surface vault secrets to tool handlers as `ctx.getSecret(name)`. The
118954
+ // value never enters the model's context or `process.env` — only the
118955
+ // handler that asks receives it. `vault.get` lazily opens the vault and
118956
+ // returns null for unknown names.
118957
+ secretResolver: (name) => vault.get(name)
118375
118958
  });
118376
118959
  const { plugin: memoryPlugin, store: memory } = buildMemoryPlugin({
118377
118960
  embedder: () => session.embedders.tryGetActive()
@@ -118902,7 +119485,7 @@ function runnerSocketPath() {
118902
119485
  return override;
118903
119486
  if (process.platform === "win32")
118904
119487
  return "\\\\.\\pipe\\moxxy-serve";
118905
- return path3__default.join(os3__default.homedir(), ".moxxy", "serve.sock");
119488
+ return path3__default.join(os5__default.homedir(), ".moxxy", "serve.sock");
118906
119489
  }
118907
119490
  function isRunnerUp(socketPath = runnerSocketPath()) {
118908
119491
  return new Promise((resolve12) => {
@@ -118940,6 +119523,8 @@ var RunnerMethod = {
118940
119523
  CommandRun: "command.run",
118941
119524
  /** client->server: transcribe audio using the runner's active transcriber. */
118942
119525
  Transcribe: "transcribe",
119526
+ /** client->server: synthesize text to audio using the runner's active synthesizer. */
119527
+ Synthesize: "synthesize",
118943
119528
  /** client->server: list every MCP server the runner knows about. */
118944
119529
  McpListServers: "mcp.listServers",
118945
119530
  /** client->server: enable an MCP server + attach its tools. */
@@ -119008,6 +119593,12 @@ var transcribeParamsSchema = z.object({
119008
119593
  language: z.string().optional(),
119009
119594
  prompt: z.string().optional()
119010
119595
  });
119596
+ var synthesizeParamsSchema = z.object({
119597
+ text: z.string(),
119598
+ voice: z.string().optional(),
119599
+ language: z.string().optional(),
119600
+ rate: z.number().optional()
119601
+ });
119011
119602
  var mcpEnableAndAttachParamsSchema = z.object({ name: z.string() });
119012
119603
  var mcpDetachParamsSchema = z.object({ name: z.string() });
119013
119604
  var workflowSetEnabledParamsSchema = z.object({
@@ -119078,8 +119669,9 @@ var RunnerServer = class {
119078
119669
  peer.handle(RunnerMethod.ModeSetActive, (raw) => this.handleModeSetActive(raw));
119079
119670
  peer.handle(RunnerMethod.ProviderSetActive, (raw) => this.handleProviderSetActive(raw));
119080
119671
  peer.handle(RunnerMethod.PermissionAddAllow, (raw) => this.handlePermissionAddAllow(raw));
119081
- peer.handle(RunnerMethod.CommandRun, (raw) => this.handleCommandRun(client, raw));
119672
+ peer.handle(RunnerMethod.CommandRun, (raw) => this.handleCommandRun(raw));
119082
119673
  peer.handle(RunnerMethod.Transcribe, (raw) => this.handleTranscribe(raw));
119674
+ peer.handle(RunnerMethod.Synthesize, (raw) => this.handleSynthesize(raw));
119083
119675
  peer.handle(RunnerMethod.McpListServers, () => this.handleMcpListServers());
119084
119676
  peer.handle(RunnerMethod.McpEnableAndAttach, (raw) => this.handleMcpEnableAndAttach(raw));
119085
119677
  peer.handle(RunnerMethod.McpDetach, (raw) => this.handleMcpDetach(raw));
@@ -119178,7 +119770,7 @@ var RunnerServer = class {
119178
119770
  await this.session.permissions.addAllow({ name, ...reason ? { reason } : {} });
119179
119771
  return {};
119180
119772
  }
119181
- async handleCommandRun(client, raw) {
119773
+ async handleCommandRun(raw) {
119182
119774
  const { name, args, channel } = commandRunParamsSchema.parse(raw);
119183
119775
  const cmd = this.session.commands.get(name);
119184
119776
  if (!cmd)
@@ -119204,9 +119796,9 @@ var RunnerServer = class {
119204
119796
  if (candidates.length === 0)
119205
119797
  throw new Error("no active transcriber on the runner");
119206
119798
  let lastErr = new Error("no active transcriber on the runner");
119207
- for (const def of candidates) {
119799
+ for (const name of candidates) {
119208
119800
  try {
119209
- const transcriber = this.session.transcribers.setActive(def.name);
119801
+ const transcriber = this.session.transcribers.setActive(name);
119210
119802
  const result = await transcriber.transcribe(audio, opts);
119211
119803
  this.broadcastInfo();
119212
119804
  return result;
@@ -119216,18 +119808,32 @@ var RunnerServer = class {
119216
119808
  }
119217
119809
  throw lastErr;
119218
119810
  }
119811
+ async handleSynthesize(raw) {
119812
+ const params = synthesizeParamsSchema.parse(raw);
119813
+ const synth = this.session.synthesizers.tryGetActive();
119814
+ if (!synth)
119815
+ throw new Error("no active synthesizer on the runner");
119816
+ const opts = {
119817
+ ...params.voice ? { voice: params.voice } : {},
119818
+ ...params.language ? { language: params.language } : {},
119819
+ ...typeof params.rate === "number" ? { rate: params.rate } : {}
119820
+ };
119821
+ const result = await synth.synthesize(params.text, opts);
119822
+ return {
119823
+ audio: Buffer.from(result.audio).toString("base64"),
119824
+ mimeType: result.mimeType
119825
+ };
119826
+ }
119219
119827
  /** Ordered candidate list for a transcribe call.
119220
119828
  * - First the active one (if any) — respects an explicit host /
119221
119829
  * user choice.
119222
119830
  * - Then every other registered transcriber. */
119223
119831
  transcribeCandidates() {
119224
119832
  const activeName = this.session.transcribers.getActiveName();
119225
- const all = this.session.transcribers.list();
119226
- if (!activeName)
119227
- return all.map((d2) => ({ name: d2.name }));
119228
- const head = all.find((d2) => d2.name === activeName);
119229
- const tail = all.filter((d2) => d2.name !== activeName);
119230
- return head ? [{ name: head.name }, ...tail.map((d2) => ({ name: d2.name }))] : tail.map((d2) => ({ name: d2.name }));
119833
+ const names = this.session.transcribers.list().map((d2) => d2.name);
119834
+ if (!activeName || !names.includes(activeName))
119835
+ return names;
119836
+ return [activeName, ...names.filter((n2) => n2 !== activeName)];
119231
119837
  }
119232
119838
  // --- MCP (delegates to session.mcpAdmin if the plugin is loaded) ----------
119233
119839
  async handleMcpListServers() {
@@ -119396,6 +120002,7 @@ var RemoteSession = class {
119396
120002
  skills;
119397
120003
  agents;
119398
120004
  transcribers;
120005
+ synthesizers;
119399
120006
  requirements;
119400
120007
  permissions;
119401
120008
  mcpAdmin;
@@ -119455,6 +120062,7 @@ var RemoteSession = class {
119455
120062
  this.skills = this.makeSkillsView();
119456
120063
  this.agents = { list: () => [] };
119457
120064
  this.transcribers = this.makeTranscribersView();
120065
+ this.synthesizers = this.makeSynthesizersView();
119458
120066
  this.requirements = { check: () => ({ ready: false, issues: [] }) };
119459
120067
  this.permissions = this.makePermissionsView();
119460
120068
  this.mcpAdmin = this.makeMcpAdminView();
@@ -119640,6 +120248,37 @@ var RemoteSession = class {
119640
120248
  }
119641
120249
  };
119642
120250
  }
120251
+ makeSynthesizersView() {
120252
+ const proxy = () => ({
120253
+ name: this.info?.activeSynthesizer ?? "runner",
120254
+ synthesize: async (text, opts) => {
120255
+ const res = await this.peer.request(RunnerMethod.Synthesize, {
120256
+ text,
120257
+ ...opts?.voice ? { voice: opts.voice } : {},
120258
+ ...opts?.language ? { language: opts.language } : {},
120259
+ ...typeof opts?.rate === "number" ? { rate: opts.rate } : {}
120260
+ });
120261
+ return {
120262
+ audio: new Uint8Array(Buffer.from(res.audio, "base64")),
120263
+ mimeType: res.mimeType
120264
+ };
120265
+ }
120266
+ });
120267
+ return {
120268
+ getActiveName: () => this.info?.activeSynthesizer ?? null,
120269
+ has: (name) => name === this.info?.activeSynthesizer,
120270
+ getActive: () => {
120271
+ if (!this.info?.activeSynthesizer) {
120272
+ throw new Error("no active synthesizer on the runner");
120273
+ }
120274
+ return proxy();
120275
+ },
120276
+ tryGetActive: () => this.info?.activeSynthesizer ? proxy() : null,
120277
+ setActive: () => {
120278
+ throw new Error("switch the active synthesizer on the runner, not the attached client");
120279
+ }
120280
+ };
120281
+ }
119643
120282
  makePermissionsView() {
119644
120283
  return {
119645
120284
  addAllow: async (rule) => {
@@ -119819,14 +120458,14 @@ async function unlinkSocket(socketPath) {
119819
120458
  } catch {
119820
120459
  }
119821
120460
  }
119822
- async function connectWithRetry(socketPath, attempts) {
120461
+ async function connectWithRetry(socketPath, retries) {
119823
120462
  let lastErr;
119824
- for (let i2 = 0; i2 <= attempts; i2++) {
120463
+ for (let i2 = 0; i2 <= retries; i2++) {
119825
120464
  try {
119826
120465
  return await connectUnixSocket(socketPath);
119827
120466
  } catch (err) {
119828
120467
  lastErr = err;
119829
- if (i2 < attempts)
120468
+ if (i2 < retries)
119830
120469
  await new Promise((r2) => setTimeout(r2, 100 * (i2 + 1)));
119831
120470
  }
119832
120471
  }
@@ -119897,8 +120536,8 @@ async function runSetupWizard(opts) {
119897
120536
  ge2(`${colors.bold("moxxy")}${version} ${colors.dim("\u2014 first-time setup")}`);
119898
120537
  Se2(
119899
120538
  [
119900
- `${colors.bold("1.")} Pick one or more LLM providers`,
119901
- `${colors.bold("2.")} Paste each API key (stored encrypted in the vault)`,
120539
+ `${colors.bold("1.")} Pick an LLM provider`,
120540
+ `${colors.bold("2.")} Paste your API key (stored encrypted in the vault)`,
119902
120541
  `${colors.bold("3.")} Choose a default model, mode, and memory embedder`,
119903
120542
  `${colors.bold("4.")} Review and write ${colors.bold("moxxy.config.yaml")} into the project`
119904
120543
  ].join("\n"),
@@ -119912,66 +120551,54 @@ async function runSetupWizard(opts) {
119912
120551
  me2("No selectable providers are registered. Install a provider plugin and try again.");
119913
120552
  process.exit(1);
119914
120553
  }
119915
- const chosenProvidersRaw = await ve2({
119916
- message: "Step 1 \u2014 Which provider(s) do you want to use?",
120554
+ const providerRaw = await xe2({
120555
+ message: "Step 1 \u2014 Which provider do you want to use?",
119917
120556
  options: providerOptions,
119918
- required: true,
119919
- initialValues: [providerOptions[0].value]
120557
+ initialValue: providerOptions[0].value
119920
120558
  });
119921
- const chosenProviders = guard(chosenProvidersRaw);
120559
+ const provider = guard(providerRaw);
119922
120560
  const apiKeys = {};
119923
- for (const providerId of chosenProviders) {
119924
- if (authKind(opts.authKinds, providerId) === "oauth") {
119925
- if (!opts.controller.loginOAuth) {
119926
- me2(
119927
- `Provider ${providerId} requires OAuth but the wizard has no loginOAuth handler wired up.`
119928
- );
119929
- process.exit(1);
119930
- }
119931
- await collectOAuth(providerId, opts.controller.loginOAuth);
119932
- } else {
119933
- apiKeys[providerId] = await collectKey(providerId, opts.controller);
120561
+ if (authKind(opts.authKinds, provider) === "oauth") {
120562
+ if (!opts.controller.loginOAuth) {
120563
+ me2(
120564
+ `Provider ${provider} requires OAuth but the wizard has no loginOAuth handler wired up.`
120565
+ );
120566
+ process.exit(1);
119934
120567
  }
120568
+ await collectOAuth(provider, opts.controller.loginOAuth);
120569
+ } else {
120570
+ apiKeys[provider] = await collectKey(provider, opts.controller);
119935
120571
  }
119936
- let primary = chosenProviders[0];
119937
- if (chosenProviders.length > 1) {
119938
- const primaryRaw = await xe2({
119939
- message: "Step 3 \u2014 Which provider should be primary?",
119940
- options: chosenProviders.map((id) => ({ value: id, label: id })),
119941
- initialValue: primary
119942
- });
119943
- primary = guard(primaryRaw);
119944
- }
119945
- const modelChoices = opts.models[primary] ?? [];
120572
+ const modelChoices = opts.models[provider] ?? [];
119946
120573
  let model = null;
119947
120574
  if (modelChoices.length > 0) {
119948
120575
  const modelRaw = await xe2({
119949
- message: `Step 4 \u2014 Default model for ${colors.bold(primary)}`,
120576
+ message: `Step 3 \u2014 Default model for ${colors.bold(provider)}`,
119950
120577
  options: toOptions(modelChoices),
119951
120578
  initialValue: modelChoices[0].id
119952
120579
  });
119953
120580
  model = guard(modelRaw);
119954
120581
  }
119955
120582
  const modeRaw = await xe2({
119956
- message: "Step 5 \u2014 Mode",
120583
+ message: "Step 4 \u2014 Mode",
119957
120584
  options: toOptions(opts.modes),
119958
120585
  initialValue: opts.modes[0]?.id ?? "tool-use"
119959
120586
  });
119960
120587
  const mode = guard(modeRaw);
119961
120588
  const embedderRaw = await xe2({
119962
- message: "Step 6 \u2014 Memory embedder",
120589
+ message: "Step 5 \u2014 Memory embedder",
119963
120590
  options: toOptions(opts.embedders),
119964
120591
  initialValue: opts.embedders[0]?.id ?? "tfidf"
119965
120592
  });
119966
120593
  const embedder = guard(embedderRaw);
119967
120594
  const securityRaw = await ue2({
119968
- message: "Step 7 \u2014 Enable plugin-security? " + colors.dim("(per-tool capability isolation; off by default)"),
120595
+ message: "Step 6 \u2014 Enable plugin-security? " + colors.dim("(per-tool capability isolation; off by default)"),
119969
120596
  initialValue: false
119970
120597
  });
119971
120598
  const securityEnabled = guard(securityRaw);
119972
120599
  const selections = {
119973
- providers: chosenProviders,
119974
- primary,
120600
+ providers: [provider],
120601
+ primary: provider,
119975
120602
  model,
119976
120603
  mode,
119977
120604
  embedder,
@@ -119988,10 +120615,9 @@ async function runSetupWizard(opts) {
119988
120615
  if (!confirmed) bail();
119989
120616
  const persist = ft2();
119990
120617
  persist.start("Writing config and storing keys");
119991
- for (const providerId of chosenProviders) {
119992
- if (authKind(opts.authKinds, providerId) === "oauth") continue;
119993
- const key = apiKeys[providerId];
119994
- if (key) await opts.controller.saveApiKey(providerId, key);
120618
+ if (authKind(opts.authKinds, provider) !== "oauth") {
120619
+ const key = apiKeys[provider];
120620
+ if (key) await opts.controller.saveApiKey(provider, key);
119995
120621
  }
119996
120622
  const configPath = await opts.controller.writeConfig(yaml);
119997
120623
  persist.stop(`Wrote ${colors.bold(configPath)}`);
@@ -120494,7 +121120,7 @@ var HELP2 = formatHelp({
120494
121120
  }
120495
121121
  ]
120496
121122
  });
120497
- var AUDIT_PATH = () => path3.join(os3.homedir(), ".moxxy", "skills", ".meta", "created.jsonl");
121123
+ var AUDIT_PATH = () => path3.join(os5.homedir(), ".moxxy", "skills", ".meta", "created.jsonl");
120498
121124
  async function runSkillsCommand(argv) {
120499
121125
  const sub = argv.positional[0] ?? "list";
120500
121126
  if (sub === "help" || helpRequested(argv)) {
@@ -120706,7 +121332,7 @@ async function runPluginNewCommand(argv) {
120706
121332
  }
120707
121333
  const here = hasBoolFlag(argv, "here");
120708
121334
  const force = hasBoolFlag(argv, "force");
120709
- const root = here ? path3.join(process.cwd(), name) : path3.join(os3.homedir(), ".moxxy", "plugins", name);
121335
+ const root = here ? path3.join(process.cwd(), name) : path3.join(os5.homedir(), ".moxxy", "plugins", name);
120710
121336
  try {
120711
121337
  const stat = await promises.stat(root);
120712
121338
  if (stat.isDirectory() && !force) {
@@ -121175,7 +121801,7 @@ var HELP5 = formatHelp({
121175
121801
  ]
121176
121802
  });
121177
121803
  function policyPath() {
121178
- return path3.join(os3.homedir(), ".moxxy", "permissions.json");
121804
+ return path3.join(os5.homedir(), ".moxxy", "permissions.json");
121179
121805
  }
121180
121806
  async function runPermsCommand(argv) {
121181
121807
  const sub = argv.positional[0];
@@ -122065,7 +122691,7 @@ async function stepAllowTools(tools) {
122065
122691
  `);
122066
122692
  return;
122067
122693
  }
122068
- const policyPath2 = path3.join(os3.homedir(), ".moxxy", "permissions.json");
122694
+ const policyPath2 = path3.join(os5.homedir(), ".moxxy", "permissions.json");
122069
122695
  const engine = await PermissionEngine.load(policyPath2);
122070
122696
  const before = engine.policySnapshot;
122071
122697
  const existingAllowNames = new Set(before.allow.map((r2) => r2.name));
@@ -122435,7 +123061,7 @@ async function runDoctorCommand(argv) {
122435
123061
  }
122436
123062
  checks.push(buildVoiceDoctorCheck(session, await checkVoiceCaptureAvailable()));
122437
123063
  checks.push(...buildPluginDoctorChecks(pluginRegistration));
122438
- const memDir = path3.join(os3.homedir(), ".moxxy", "memory");
123064
+ const memDir = path3.join(os5.homedir(), ".moxxy", "memory");
122439
123065
  const memRes = await tryCatch(async () => {
122440
123066
  await promises.mkdir(memDir, { recursive: true });
122441
123067
  await promises.access(memDir, promises.constants.W_OK);
@@ -122613,6 +123239,7 @@ function buildHelp(session) {
122613
123239
  {
122614
123240
  title: "FLAGS",
122615
123241
  rows: [
123242
+ ["--browser", "force the loopback/browser flow even without a TTY (opens the browser automatically)"],
122616
123243
  ["--no-browser", "force the headless device-code flow (auto when no TTY)"]
122617
123244
  ]
122618
123245
  }
@@ -122669,7 +123296,7 @@ Run \`moxxy init\` to store its key in the vault.
122669
123296
  return 2;
122670
123297
  }
122671
123298
  await vault.open();
122672
- const headless = hasBoolFlag(argv, "no-browser") || process.stdin.isTTY !== true;
123299
+ const headless = hasBoolFlag(argv, "no-browser") || !hasBoolFlag(argv, "browser") && process.stdin.isTTY !== true;
122673
123300
  const ctx = buildProviderAuthContext(vault, { headless });
122674
123301
  try {
122675
123302
  const result = await def.auth.login(ctx);
@@ -123702,7 +124329,7 @@ var HELP13 = formatHelp({
123702
124329
  ]
123703
124330
  });
123704
124331
  function moxxyDir() {
123705
- return path3.join(os3.homedir(), ".moxxy");
124332
+ return path3.join(os5.homedir(), ".moxxy");
123706
124333
  }
123707
124334
  async function runSelfUpdateCommand(argv) {
123708
124335
  const sub = argv.positional[0] ?? "status";
@@ -123954,7 +124581,7 @@ var COMMANDS = {
123954
124581
  };
123955
124582
  async function main() {
123956
124583
  const argv = parseArgv(process.argv.slice(2));
123957
- await finalizeStagedCoreUpdate(path3.join(os3.homedir(), ".moxxy")).catch(() => void 0);
124584
+ await finalizeStagedCoreUpdate(path3.join(os5.homedir(), ".moxxy")).catch(() => void 0);
123958
124585
  const handler = COMMANDS[argv.command];
123959
124586
  if (handler) return handler(argv);
123960
124587
  let isChannel = false;