@moxxy/cli 0.1.6 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -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';
@@ -1032,6 +1032,8 @@ var init_host = __esm({
1032
1032
  this.opts.commands.unregister(cmdName);
1033
1033
  for (const transcriberName of record2.transcriberNames)
1034
1034
  this.opts.transcribers.unregister(transcriberName);
1035
+ for (const synthName of record2.synthesizerNames)
1036
+ this.opts.synthesizers.unregister(synthName);
1035
1037
  for (const embedderName of record2.embedderNames)
1036
1038
  this.opts.embedders.unregister(embedderName);
1037
1039
  for (const isolatorName of record2.isolatorNames)
@@ -1068,6 +1070,7 @@ var init_host = __esm({
1068
1070
  const agentNames = (plugin4.agents ?? []).map((a2) => a2.name);
1069
1071
  const commandNames = (plugin4.commands ?? []).map((c2) => c2.name);
1070
1072
  const transcriberNames = (plugin4.transcribers ?? []).map((t2) => t2.name);
1073
+ const synthesizerNames = (plugin4.synthesizers ?? []).map((s2) => s2.name);
1071
1074
  const embedderNames = (plugin4.embedders ?? []).map((e3) => e3.name);
1072
1075
  const isolatorNames = (plugin4.isolators ?? []).map((i2) => i2.name);
1073
1076
  const workflowExecutorNames = (plugin4.workflowExecutors ?? []).map((w4) => w4.name);
@@ -1093,6 +1096,8 @@ var init_host = __esm({
1093
1096
  this.opts.commands.register(cmd);
1094
1097
  for (const transcriber of plugin4.transcribers ?? [])
1095
1098
  this.opts.transcribers.register(transcriber);
1099
+ for (const synth of plugin4.synthesizers ?? [])
1100
+ this.opts.synthesizers.register(synth);
1096
1101
  for (const embedder of plugin4.embedders ?? [])
1097
1102
  this.opts.embedders.register(embedder);
1098
1103
  for (const isolator of plugin4.isolators ?? [])
@@ -1113,6 +1118,7 @@ var init_host = __esm({
1113
1118
  agentNames,
1114
1119
  commandNames,
1115
1120
  transcriberNames,
1121
+ synthesizerNames,
1116
1122
  embedderNames,
1117
1123
  isolatorNames,
1118
1124
  workflowExecutorNames
@@ -2062,9 +2068,17 @@ var init_tools2 = __esm({
2062
2068
  tools = /* @__PURE__ */ new Map();
2063
2069
  defaultLogger;
2064
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;
2065
2078
  constructor(opts) {
2066
2079
  this.defaultLogger = opts.logger;
2067
2080
  this.defaultCwd = opts.cwd;
2081
+ this.secretResolver = opts.secretResolver;
2068
2082
  }
2069
2083
  list() {
2070
2084
  return [...this.tools.values()];
@@ -2105,7 +2119,8 @@ var init_tools2 = __esm({
2105
2119
  signal,
2106
2120
  log: opts.log ?? emptyLog(),
2107
2121
  logger: opts.logger ?? this.defaultLogger,
2108
- ...opts.subagents ? { subagents: opts.subagents } : {}
2122
+ ...opts.subagents ? { subagents: opts.subagents } : {},
2123
+ ...this.secretResolver ? { getSecret: this.secretResolver } : {}
2109
2124
  };
2110
2125
  const result = await tool.handler(parsed, ctx);
2111
2126
  if (tool.outputSchema)
@@ -2216,22 +2231,30 @@ var init_commands = __esm({
2216
2231
  }
2217
2232
  });
2218
2233
 
2219
- // ../core/dist/registries/transcribers.js
2220
- var TranscriberRegistry;
2221
- var init_transcribers = __esm({
2222
- "../core/dist/registries/transcribers.js"() {
2223
- 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;
2224
2240
  defs = /* @__PURE__ */ new Map();
2225
2241
  instances = /* @__PURE__ */ new Map();
2226
2242
  active = null;
2243
+ constructor(opts) {
2244
+ this.opts = opts;
2245
+ }
2227
2246
  register(def, instance) {
2228
2247
  if (this.defs.has(def.name)) {
2229
- throw new Error(`Transcriber already registered: ${def.name}`);
2248
+ throw new Error(`${this.opts.noun} already registered: ${def.name}`);
2230
2249
  }
2231
2250
  this.defs.set(def.name, def);
2232
2251
  if (instance)
2233
2252
  this.instances.set(def.name, instance);
2253
+ if (this.opts.autoAdoptFirst && this.active === null)
2254
+ this.active = def.name;
2234
2255
  }
2256
+ /** Overwrite an existing def, dropping the cached instance so the next build
2257
+ * uses the new def. */
2235
2258
  replace(def, instance) {
2236
2259
  this.defs.set(def.name, def);
2237
2260
  this.instances.delete(def.name);
@@ -2251,34 +2274,104 @@ var init_transcribers = __esm({
2251
2274
  return this.defs.has(name);
2252
2275
  }
2253
2276
  setActive(name, config) {
2254
- const def = this.defs.get(name);
2255
- if (!def)
2256
- 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
+ }
2257
2285
  let instance = this.instances.get(name);
2258
2286
  if (!instance) {
2259
- instance = def.createClient(config ?? {});
2287
+ instance = this.buildInstance(name, config);
2260
2288
  this.instances.set(name, instance);
2261
2289
  }
2262
2290
  this.active = name;
2263
2291
  return instance;
2264
2292
  }
2293
+ /** Deactivate the current backend (callers fall back to their default). */
2294
+ clearActive() {
2295
+ this.active = null;
2296
+ }
2265
2297
  getActive() {
2266
- if (!this.active)
2267
- 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);
2268
2303
  const inst = this.instances.get(this.active);
2269
2304
  if (!inst)
2270
- throw new Error(`Active transcriber has no instance: ${this.active}`);
2305
+ throw new Error(`Active ${this.opts.noun.toLowerCase()} has no instance: ${this.active}`);
2271
2306
  return inst;
2272
2307
  }
2273
- /** 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"). */
2274
2310
  tryGetActive() {
2275
2311
  if (!this.active)
2276
2312
  return null;
2313
+ if (this.opts.buildOnRead) {
2314
+ try {
2315
+ return this.instantiate(this.active);
2316
+ } catch {
2317
+ return null;
2318
+ }
2319
+ }
2277
2320
  return this.instances.get(this.active) ?? null;
2278
2321
  }
2279
2322
  getActiveName() {
2280
2323
  return this.active;
2281
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
+ }
2282
2375
  };
2283
2376
  }
2284
2377
  });
@@ -2287,64 +2380,10 @@ var init_transcribers = __esm({
2287
2380
  var EmbedderRegistry;
2288
2381
  var init_embedders = __esm({
2289
2382
  "../core/dist/registries/embedders.js"() {
2290
- EmbedderRegistry = class {
2291
- defs = /* @__PURE__ */ new Map();
2292
- instances = /* @__PURE__ */ new Map();
2293
- active = null;
2294
- register(def, instance) {
2295
- if (this.defs.has(def.name)) {
2296
- throw new Error(`Embedder already registered: ${def.name}`);
2297
- }
2298
- this.defs.set(def.name, def);
2299
- if (instance)
2300
- this.instances.set(def.name, instance);
2301
- }
2302
- replace(def, instance) {
2303
- this.defs.set(def.name, def);
2304
- this.instances.delete(def.name);
2305
- if (instance)
2306
- this.instances.set(def.name, instance);
2307
- }
2308
- unregister(name) {
2309
- this.defs.delete(name);
2310
- this.instances.delete(name);
2311
- if (this.active === name)
2312
- this.active = null;
2313
- }
2314
- list() {
2315
- return [...this.defs.values()];
2316
- }
2317
- has(name) {
2318
- return this.defs.has(name);
2319
- }
2320
- setActive(name, config) {
2321
- const def = this.defs.get(name);
2322
- if (!def)
2323
- throw new Error(`Embedder not registered: ${name}`);
2324
- let instance = this.instances.get(name);
2325
- if (!instance) {
2326
- instance = def.createClient(config ?? {});
2327
- this.instances.set(name, instance);
2328
- }
2329
- this.active = name;
2330
- return instance;
2331
- }
2332
- getActive() {
2333
- if (!this.active)
2334
- throw new Error("No active embedder. Call setActive(name) first.");
2335
- const inst = this.instances.get(this.active);
2336
- if (!inst)
2337
- throw new Error(`Active embedder has no instance: ${this.active}`);
2338
- return inst;
2339
- }
2340
- /** Active embedder, or null when none is configured. Lets memory degrade to keyword recall. */
2341
- tryGetActive() {
2342
- if (!this.active)
2343
- return null;
2344
- return this.instances.get(this.active) ?? null;
2345
- }
2346
- getActiveName() {
2347
- 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) });
2348
2387
  }
2349
2388
  };
2350
2389
  }
@@ -2519,6 +2558,10 @@ var init_requirements = __esm({
2519
2558
  const def = this.opts.transcribers.list().find((t2) => t2.name === name);
2520
2559
  return def ? { kind: kind3, name, active: this.opts.transcribers.getActiveName() === name } : null;
2521
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
+ }
2522
2565
  case "mode": {
2523
2566
  const def = this.opts.modes.list().find((m3) => m3.name === name);
2524
2567
  return def ? { kind: kind3, name, active: activeModeName(this.opts.modes) === name } : null;
@@ -2774,6 +2817,7 @@ var init_session = __esm({
2774
2817
  init_agents();
2775
2818
  init_commands();
2776
2819
  init_transcribers();
2820
+ init_synthesizers();
2777
2821
  init_embedders();
2778
2822
  init_isolators();
2779
2823
  init_workflow_executors();
@@ -2798,6 +2842,7 @@ var init_session = __esm({
2798
2842
  agents;
2799
2843
  commands;
2800
2844
  transcribers;
2845
+ synthesizers;
2801
2846
  embedders;
2802
2847
  isolators;
2803
2848
  workflowExecutors;
@@ -2839,7 +2884,11 @@ var init_session = __esm({
2839
2884
  this.cwd = opts.cwd;
2840
2885
  this.logger = opts.logger ?? (opts.silent ? silentLogger : createLogger());
2841
2886
  this.log = opts.log ?? new EventLog();
2842
- 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
+ });
2843
2892
  this.providers = new ProviderRegistry();
2844
2893
  this.modes = new ModeRegistry();
2845
2894
  this.compactors = new CompactorRegistry();
@@ -2853,6 +2902,9 @@ var init_session = __esm({
2853
2902
  this.agents = new AgentRegistry();
2854
2903
  this.commands = new CommandRegistry();
2855
2904
  this.transcribers = new TranscriberRegistry();
2905
+ this.synthesizers = new SynthesizerRegistry({
2906
+ ...opts.secretResolver ? { secretResolver: opts.secretResolver } : {}
2907
+ });
2856
2908
  this.embedders = new EmbedderRegistry();
2857
2909
  this.isolators = new IsolatorRegistry();
2858
2910
  this.workflowExecutors = new WorkflowExecutorRegistry();
@@ -2864,7 +2916,8 @@ var init_session = __esm({
2864
2916
  channels: this.channels,
2865
2917
  agents: this.agents,
2866
2918
  commands: this.commands,
2867
- transcribers: this.transcribers
2919
+ transcribers: this.transcribers,
2920
+ synthesizers: this.synthesizers
2868
2921
  });
2869
2922
  this.permissions = opts.permissionEngine ?? new PermissionEngine();
2870
2923
  this.resolver = wrapWithPolicy(opts.permissionResolver ?? autoAllowResolver, this.permissions, (name) => this.tools.get(name)?.permission);
@@ -2886,6 +2939,7 @@ var init_session = __esm({
2886
2939
  agents: this.agents,
2887
2940
  commands: this.commands,
2888
2941
  transcribers: this.transcribers,
2942
+ synthesizers: this.synthesizers,
2889
2943
  embedders: this.embedders,
2890
2944
  isolators: this.isolators,
2891
2945
  workflowExecutors: this.workflowExecutors,
@@ -2964,8 +3018,11 @@ var init_session = __esm({
2964
3018
  */
2965
3019
  getInfo() {
2966
3020
  let activeMode = null;
3021
+ let activeModeBadge = null;
2967
3022
  try {
2968
- activeMode = this.modes.getActive().name;
3023
+ const mode = this.modes.getActive();
3024
+ activeMode = mode.name;
3025
+ activeModeBadge = mode.badge ? { label: mode.badge.label, ...mode.badge.tone ? { tone: mode.badge.tone } : {} } : null;
2969
3026
  } catch {
2970
3027
  }
2971
3028
  const active = this.providers.getActiveName();
@@ -2987,6 +3044,7 @@ var init_session = __esm({
2987
3044
  supportsLiveModelDiscovery: p3.supportsLiveModelDiscovery === true
2988
3045
  })),
2989
3046
  activeMode,
3047
+ activeModeBadge,
2990
3048
  modes: this.modes.list().map((m3) => m3.name),
2991
3049
  tools: this.tools.list().map((t2) => ({
2992
3050
  name: t2.name,
@@ -3009,7 +3067,9 @@ var init_session = __esm({
3009
3067
  // For UI affordance gating (showing / hiding a mic button),
3010
3068
  // any registered transcriber means "voice is wired."
3011
3069
  hasTranscriber: this.transcribers.list().length > 0,
3012
- activeTranscriber: this.transcribers.getActiveName()
3070
+ activeTranscriber: this.transcribers.getActiveName(),
3071
+ hasSynthesizer: this.synthesizers.list().length > 0,
3072
+ activeSynthesizer: this.synthesizers.getActiveName()
3013
3073
  };
3014
3074
  }
3015
3075
  registerHookOptions(_hooks) {
@@ -4205,7 +4265,7 @@ var require_jiti = __commonJS({
4205
4265
  function V4() {
4206
4266
  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);
4207
4267
  }
4208
- function z55() {
4268
+ function z58() {
4209
4269
  l3(), T2();
4210
4270
  let e6 = false;
4211
4271
  for (; 2 !== n3.getToken() && 17 !== n3.getToken(); ) {
@@ -4232,14 +4292,14 @@ var require_jiti = __commonJS({
4232
4292
  case 3:
4233
4293
  return G3();
4234
4294
  case 1:
4235
- return z55();
4295
+ return z58();
4236
4296
  case 10:
4237
4297
  return P3(true);
4238
4298
  default:
4239
4299
  return J2();
4240
4300
  }
4241
4301
  }
4242
- 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);
4302
+ 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);
4243
4303
  }
4244
4304
  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) {
4245
4305
  e5.DEFAULT = { allowTrailingComma: false };
@@ -4248,12 +4308,12 @@ var require_jiti = __commonJS({
4248
4308
  })(H3 || (H3 = {})), (function(e5) {
4249
4309
  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";
4250
4310
  })(Y4 || (Y4 = {}));
4251
- const Q4 = Pe3;
4311
+ const Q3 = Pe3;
4252
4312
  var Z2;
4253
4313
  !(function(e5) {
4254
4314
  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";
4255
4315
  })(Z2 || (Z2 = {}));
4256
- const X3 = r2((e5, t4) => Q4(N2(t4, e5, "utf8")), "readJsonc"), te3 = /* @__PURE__ */ Symbol("implicitBaseUrl"), ie2 = "${configDir}", se2 = r2(() => {
4316
+ const X3 = r2((e5, t4) => Q3(N2(t4, e5, "utf8")), "readJsonc"), te3 = /* @__PURE__ */ Symbol("implicitBaseUrl"), ie2 = "${configDir}", se2 = r2(() => {
4257
4317
  const { findPnpApi: e5 } = l2;
4258
4318
  return e5 && e5(process.cwd());
4259
4319
  }, "getPnpApi"), re2 = r2((e5, t4, i4, n3) => {
@@ -4425,7 +4485,7 @@ var require_jiti = __commonJS({
4425
4485
  "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));
4426
4486
  }
4427
4487
  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));
4428
- }, "normalizeCompilerOptions"), ve3 = r2((e5, t4 = /* @__PURE__ */ new Map()) => {
4488
+ }, "normalizeCompilerOptions"), ve2 = r2((e5, t4 = /* @__PURE__ */ new Map()) => {
4429
4489
  const i4 = a2.resolve(e5), n3 = fe2(i4, t4), c3 = a2.dirname(i4), { compilerOptions: l3 } = n3;
4430
4490
  if (l3) {
4431
4491
  for (const e7 of ge3) {
@@ -4523,7 +4583,7 @@ var require_jiti = __commonJS({
4523
4583
  for (; ; ) {
4524
4584
  const e6 = j3(c3, t4, i4);
4525
4585
  if (!e6) return;
4526
- const l3 = a2.resolve(e6), y3 = ve3(l3, i4), E4 = { path: h3(l3), config: y3 };
4586
+ const l3 = a2.resolve(e6), y3 = ve2(l3, i4), E4 = { path: h3(l3), config: y3 };
4527
4587
  if (je2(E4)(n3)) return E4;
4528
4588
  const w5 = a2.dirname(e6), C4 = a2.dirname(w5);
4529
4589
  if (C4 === w5) return;
@@ -4537,7 +4597,7 @@ var require_jiti = __commonJS({
4537
4597
  if (!n3) {
4538
4598
  const n4 = Be2(e5, t4, i4);
4539
4599
  if (!n4) return null;
4540
- return { path: n4, config: ve3(n4, i4) };
4600
+ return { path: n4, config: ve2(n4, i4) };
4541
4601
  }
4542
4602
  return null != (a3 = Fe2(e5, t4, i4)) ? a3 : null;
4543
4603
  }, "getTsconfig"), qe2 = /\*/g, Ge2 = r2((e5, t4) => {
@@ -4684,9 +4744,9 @@ var require_jiti = __commonJS({
4684
4744
  return W3.call(e5, t4);
4685
4745
  }, Y4 = Array.isArray || function(e5) {
4686
4746
  return "[object Array]" === K4.call(e5);
4687
- }, Q4 = /* @__PURE__ */ Object.create(null);
4747
+ }, Q3 = /* @__PURE__ */ Object.create(null);
4688
4748
  function wordsRegexp(e5) {
4689
- return Q4[e5] || (Q4[e5] = new RegExp("^(?:" + e5.replace(/ /g, "|") + ")$"));
4749
+ return Q3[e5] || (Q3[e5] = new RegExp("^(?:" + e5.replace(/ /g, "|") + ")$"));
4690
4750
  }
4691
4751
  function codePointToString(e5) {
4692
4752
  return e5 <= 65535 ? String.fromCharCode(e5) : (e5 -= 65536, String.fromCharCode(55296 + (e5 >> 10), 56320 + (1023 & e5)));
@@ -5778,13 +5838,13 @@ var require_jiti = __commonJS({
5778
5838
  var t4 = this.startNode();
5779
5839
  return this.next(), t4.argument = this.parseMaybeUnary(null, true, false, e5), this.finishNode(t4, "AwaitExpression");
5780
5840
  };
5781
- var ve3 = acorn_Parser.prototype;
5782
- ve3.raise = function(e5, t4) {
5841
+ var ve2 = acorn_Parser.prototype;
5842
+ ve2.raise = function(e5, t4) {
5783
5843
  var i3 = getLineInfo(this.input, e5);
5784
5844
  t4 += " (" + i3.line + ":" + i3.column + ")", this.sourceFile && (t4 += " in " + this.sourceFile);
5785
5845
  var n3 = new SyntaxError(t4);
5786
5846
  throw n3.pos = e5, n3.loc = i3, n3.raisedAt = this.pos, n3;
5787
- }, ve3.raiseRecoverable = ve3.raise, ve3.curPosition = function() {
5847
+ }, ve2.raiseRecoverable = ve2.raise, ve2.curPosition = function() {
5788
5848
  if (this.options.locations) return new acorn_Position(this.curLine, this.pos - this.lineStart);
5789
5849
  };
5790
5850
  var ye3 = acorn_Parser.prototype, acorn_Scope = function(e5) {
@@ -7789,6 +7849,7 @@ __export(dist_exports, {
7789
7849
  SessionPersistence: () => SessionPersistence,
7790
7850
  SkillRegistryImpl: () => SkillRegistryImpl,
7791
7851
  SkillRouter: () => SkillRouter,
7852
+ SynthesizerRegistry: () => SynthesizerRegistry,
7792
7853
  ToolRegistryImpl: () => ToolRegistryImpl,
7793
7854
  TranscriberRegistry: () => TranscriberRegistry,
7794
7855
  TunnelProviderRegistry: () => TunnelProviderRegistry,
@@ -7863,6 +7924,7 @@ var init_dist = __esm({
7863
7924
  init_agents();
7864
7925
  init_commands();
7865
7926
  init_transcribers();
7927
+ init_synthesizers();
7866
7928
  init_embedders();
7867
7929
  init_isolators();
7868
7930
  init_requirements();
@@ -22621,25 +22683,25 @@ function kt(e3, t2, r2, o2, n2, a2) {
22621
22683
  m(e4);
22622
22684
  }
22623
22685
  function B2() {
22624
- 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;
22686
+ 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;
22625
22687
  }
22626
22688
  function A3(e4) {
22627
- return w4 || (v3 = "errored", s2 = e4, o2 ? L3(true, e4) : z55((() => l2.abort(e4)), true, e4)), null;
22689
+ return w4 || (v3 = "errored", s2 = e4, o2 ? L3(true, e4) : z58((() => l2.abort(e4)), true, e4)), null;
22628
22690
  }
22629
22691
  function j3(e4) {
22630
- return S2 || (R4 = "errored", _2 = e4, n2 ? L3(true, e4) : z55((() => i2.cancel(e4)), true, e4)), null;
22692
+ return S2 || (R4 = "errored", _2 = e4, n2 ? L3(true, e4) : z58((() => i2.cancel(e4)), true, e4)), null;
22631
22693
  }
22632
22694
  if (void 0 !== a2 && (k3 = () => {
22633
22695
  const e4 = void 0 !== a2.reason ? a2.reason : new Wt("Aborted", "AbortError"), t3 = [];
22634
- 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);
22696
+ 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);
22635
22697
  }, 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);
22636
22698
  else if ("erroring" === R4 || "errored" === R4) j3(_2);
22637
22699
  else if ("closed" === v3) B2();
22638
22700
  else if (T2 || "closed" === R4) {
22639
22701
  const e4 = new TypeError("the destination writable stream closed before all data could be piped to it");
22640
- n2 ? L3(true, e4) : z55((() => i2.cancel(e4)), true, e4);
22702
+ n2 ? L3(true, e4) : z58((() => i2.cancel(e4)), true, e4);
22641
22703
  }
22642
- function z55(e4, t3, r3) {
22704
+ function z58(e4, t3, r3) {
22643
22705
  function o3() {
22644
22706
  return "writable" !== R4 || T2 ? n3() : h((function() {
22645
22707
  let e5;
@@ -22654,7 +22716,7 @@ function kt(e3, t2, r2, o2, n2, a2) {
22654
22716
  w4 || (w4 = true, q3 ? o3() : h(C3, o3));
22655
22717
  }
22656
22718
  function L3(e4, t3) {
22657
- z55(void 0, e4, t3);
22719
+ z58(void 0, e4, t3);
22658
22720
  }
22659
22721
  function F3(e4, t3) {
22660
22722
  return S2 = true, l2.releaseLock(), i2.releaseLock(), void 0 !== a2 && a2.removeEventListener("abort", k3), e4 ? W3(t3) : P3(void 0), null;
@@ -35470,26 +35532,26 @@ var init_types = __esm({
35470
35532
  SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
35471
35533
  RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
35472
35534
  JSONRPC_VERSION = "2.0";
35473
- AssertObjectSchema = z22.custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
35474
- ProgressTokenSchema = z22.union([z22.string(), z22.number().int()]);
35475
- CursorSchema = z22.string();
35476
- z22.looseObject({
35535
+ AssertObjectSchema = z24.custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
35536
+ ProgressTokenSchema = z24.union([z24.string(), z24.number().int()]);
35537
+ CursorSchema = z24.string();
35538
+ z24.looseObject({
35477
35539
  /**
35478
35540
  * Requested duration in milliseconds to retain task from creation.
35479
35541
  */
35480
- ttl: z22.number().optional(),
35542
+ ttl: z24.number().optional(),
35481
35543
  /**
35482
35544
  * Time in milliseconds to wait between task status requests.
35483
35545
  */
35484
- pollInterval: z22.number().optional()
35546
+ pollInterval: z24.number().optional()
35485
35547
  });
35486
- TaskMetadataSchema = z22.object({
35487
- ttl: z22.number().optional()
35548
+ TaskMetadataSchema = z24.object({
35549
+ ttl: z24.number().optional()
35488
35550
  });
35489
- RelatedTaskMetadataSchema = z22.object({
35490
- taskId: z22.string()
35551
+ RelatedTaskMetadataSchema = z24.object({
35552
+ taskId: z24.string()
35491
35553
  });
35492
- RequestMetaSchema = z22.looseObject({
35554
+ RequestMetaSchema = z24.looseObject({
35493
35555
  /**
35494
35556
  * 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.
35495
35557
  */
@@ -35499,7 +35561,7 @@ var init_types = __esm({
35499
35561
  */
35500
35562
  [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
35501
35563
  });
35502
- BaseRequestParamsSchema = z22.object({
35564
+ BaseRequestParamsSchema = z24.object({
35503
35565
  /**
35504
35566
  * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
35505
35567
  */
@@ -35517,42 +35579,42 @@ var init_types = __esm({
35517
35579
  task: TaskMetadataSchema.optional()
35518
35580
  });
35519
35581
  isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
35520
- RequestSchema = z22.object({
35521
- method: z22.string(),
35582
+ RequestSchema = z24.object({
35583
+ method: z24.string(),
35522
35584
  params: BaseRequestParamsSchema.loose().optional()
35523
35585
  });
35524
- NotificationsParamsSchema = z22.object({
35586
+ NotificationsParamsSchema = z24.object({
35525
35587
  /**
35526
35588
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
35527
35589
  * for notes on _meta usage.
35528
35590
  */
35529
35591
  _meta: RequestMetaSchema.optional()
35530
35592
  });
35531
- NotificationSchema = z22.object({
35532
- method: z22.string(),
35593
+ NotificationSchema = z24.object({
35594
+ method: z24.string(),
35533
35595
  params: NotificationsParamsSchema.loose().optional()
35534
35596
  });
35535
- ResultSchema = z22.looseObject({
35597
+ ResultSchema = z24.looseObject({
35536
35598
  /**
35537
35599
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
35538
35600
  * for notes on _meta usage.
35539
35601
  */
35540
35602
  _meta: RequestMetaSchema.optional()
35541
35603
  });
35542
- RequestIdSchema = z22.union([z22.string(), z22.number().int()]);
35543
- JSONRPCRequestSchema = z22.object({
35544
- jsonrpc: z22.literal(JSONRPC_VERSION),
35604
+ RequestIdSchema = z24.union([z24.string(), z24.number().int()]);
35605
+ JSONRPCRequestSchema = z24.object({
35606
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35545
35607
  id: RequestIdSchema,
35546
35608
  ...RequestSchema.shape
35547
35609
  }).strict();
35548
35610
  isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
35549
- JSONRPCNotificationSchema = z22.object({
35550
- jsonrpc: z22.literal(JSONRPC_VERSION),
35611
+ JSONRPCNotificationSchema = z24.object({
35612
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35551
35613
  ...NotificationSchema.shape
35552
35614
  }).strict();
35553
35615
  isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
35554
- JSONRPCResultResponseSchema = z22.object({
35555
- jsonrpc: z22.literal(JSONRPC_VERSION),
35616
+ JSONRPCResultResponseSchema = z24.object({
35617
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35556
35618
  id: RequestIdSchema,
35557
35619
  result: ResultSchema
35558
35620
  }).strict();
@@ -35567,32 +35629,32 @@ var init_types = __esm({
35567
35629
  ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
35568
35630
  ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
35569
35631
  })(ErrorCode || (ErrorCode = {}));
35570
- JSONRPCErrorResponseSchema = z22.object({
35571
- jsonrpc: z22.literal(JSONRPC_VERSION),
35632
+ JSONRPCErrorResponseSchema = z24.object({
35633
+ jsonrpc: z24.literal(JSONRPC_VERSION),
35572
35634
  id: RequestIdSchema.optional(),
35573
- error: z22.object({
35635
+ error: z24.object({
35574
35636
  /**
35575
35637
  * The error type that occurred.
35576
35638
  */
35577
- code: z22.number().int(),
35639
+ code: z24.number().int(),
35578
35640
  /**
35579
35641
  * A short description of the error. The message SHOULD be limited to a concise single sentence.
35580
35642
  */
35581
- message: z22.string(),
35643
+ message: z24.string(),
35582
35644
  /**
35583
35645
  * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
35584
35646
  */
35585
- data: z22.unknown().optional()
35647
+ data: z24.unknown().optional()
35586
35648
  })
35587
35649
  }).strict();
35588
35650
  isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
35589
- JSONRPCMessageSchema = z22.union([
35651
+ JSONRPCMessageSchema = z24.union([
35590
35652
  JSONRPCRequestSchema,
35591
35653
  JSONRPCNotificationSchema,
35592
35654
  JSONRPCResultResponseSchema,
35593
35655
  JSONRPCErrorResponseSchema
35594
35656
  ]);
35595
- z22.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
35657
+ z24.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
35596
35658
  EmptyResultSchema = ResultSchema.strict();
35597
35659
  CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
35598
35660
  /**
@@ -35604,28 +35666,28 @@ var init_types = __esm({
35604
35666
  /**
35605
35667
  * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
35606
35668
  */
35607
- reason: z22.string().optional()
35669
+ reason: z24.string().optional()
35608
35670
  });
35609
35671
  CancelledNotificationSchema = NotificationSchema.extend({
35610
- method: z22.literal("notifications/cancelled"),
35672
+ method: z24.literal("notifications/cancelled"),
35611
35673
  params: CancelledNotificationParamsSchema
35612
35674
  });
35613
- IconSchema = z22.object({
35675
+ IconSchema = z24.object({
35614
35676
  /**
35615
35677
  * URL or data URI for the icon.
35616
35678
  */
35617
- src: z22.string(),
35679
+ src: z24.string(),
35618
35680
  /**
35619
35681
  * Optional MIME type for the icon.
35620
35682
  */
35621
- mimeType: z22.string().optional(),
35683
+ mimeType: z24.string().optional(),
35622
35684
  /**
35623
35685
  * Optional array of strings that specify sizes at which the icon can be used.
35624
35686
  * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
35625
35687
  *
35626
35688
  * If not provided, the client should assume that the icon can be used at any size.
35627
35689
  */
35628
- sizes: z22.array(z22.string()).optional(),
35690
+ sizes: z24.array(z24.string()).optional(),
35629
35691
  /**
35630
35692
  * Optional specifier for the theme this icon is designed for. `light` indicates
35631
35693
  * the icon is designed to be used with a light background, and `dark` indicates
@@ -35633,9 +35695,9 @@ var init_types = __esm({
35633
35695
  *
35634
35696
  * If not provided, the client should assume the icon can be used with any theme.
35635
35697
  */
35636
- theme: z22.enum(["light", "dark"]).optional()
35698
+ theme: z24.enum(["light", "dark"]).optional()
35637
35699
  });
35638
- IconsSchema = z22.object({
35700
+ IconsSchema = z24.object({
35639
35701
  /**
35640
35702
  * Optional set of sized icons that the client can display in a user interface.
35641
35703
  *
@@ -35647,11 +35709,11 @@ var init_types = __esm({
35647
35709
  * - `image/svg+xml` - SVG images (scalable but requires security precautions)
35648
35710
  * - `image/webp` - WebP images (modern, efficient format)
35649
35711
  */
35650
- icons: z22.array(IconSchema).optional()
35712
+ icons: z24.array(IconSchema).optional()
35651
35713
  });
35652
- BaseMetadataSchema = z22.object({
35714
+ BaseMetadataSchema = z24.object({
35653
35715
  /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
35654
- name: z22.string(),
35716
+ name: z24.string(),
35655
35717
  /**
35656
35718
  * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
35657
35719
  * even by those unfamiliar with domain-specific terminology.
@@ -35660,16 +35722,16 @@ var init_types = __esm({
35660
35722
  * where `annotations.title` should be given precedence over using `name`,
35661
35723
  * if present).
35662
35724
  */
35663
- title: z22.string().optional()
35725
+ title: z24.string().optional()
35664
35726
  });
35665
35727
  ImplementationSchema = BaseMetadataSchema.extend({
35666
35728
  ...BaseMetadataSchema.shape,
35667
35729
  ...IconsSchema.shape,
35668
- version: z22.string(),
35730
+ version: z24.string(),
35669
35731
  /**
35670
35732
  * An optional URL of the website for this implementation.
35671
35733
  */
35672
- websiteUrl: z22.string().optional(),
35734
+ websiteUrl: z24.string().optional(),
35673
35735
  /**
35674
35736
  * An optional human-readable description of what this implementation does.
35675
35737
  *
@@ -35677,23 +35739,23 @@ var init_types = __esm({
35677
35739
  * and capabilities. For example, a server might describe the types of resources
35678
35740
  * or tools it provides, while a client might describe its intended use case.
35679
35741
  */
35680
- description: z22.string().optional()
35742
+ description: z24.string().optional()
35681
35743
  });
35682
- FormElicitationCapabilitySchema = z22.intersection(z22.object({
35683
- applyDefaults: z22.boolean().optional()
35684
- }), z22.record(z22.string(), z22.unknown()));
35685
- ElicitationCapabilitySchema = z22.preprocess((value) => {
35744
+ FormElicitationCapabilitySchema = z24.intersection(z24.object({
35745
+ applyDefaults: z24.boolean().optional()
35746
+ }), z24.record(z24.string(), z24.unknown()));
35747
+ ElicitationCapabilitySchema = z24.preprocess((value) => {
35686
35748
  if (value && typeof value === "object" && !Array.isArray(value)) {
35687
35749
  if (Object.keys(value).length === 0) {
35688
35750
  return { form: {} };
35689
35751
  }
35690
35752
  }
35691
35753
  return value;
35692
- }, z22.intersection(z22.object({
35754
+ }, z24.intersection(z24.object({
35693
35755
  form: FormElicitationCapabilitySchema.optional(),
35694
35756
  url: AssertObjectSchema.optional()
35695
- }), z22.record(z22.string(), z22.unknown()).optional()));
35696
- ClientTasksCapabilitySchema = z22.looseObject({
35757
+ }), z24.record(z24.string(), z24.unknown()).optional()));
35758
+ ClientTasksCapabilitySchema = z24.looseObject({
35697
35759
  /**
35698
35760
  * Present if the client supports listing tasks.
35699
35761
  */
@@ -35705,22 +35767,22 @@ var init_types = __esm({
35705
35767
  /**
35706
35768
  * Capabilities for task creation on specific request types.
35707
35769
  */
35708
- requests: z22.looseObject({
35770
+ requests: z24.looseObject({
35709
35771
  /**
35710
35772
  * Task support for sampling requests.
35711
35773
  */
35712
- sampling: z22.looseObject({
35774
+ sampling: z24.looseObject({
35713
35775
  createMessage: AssertObjectSchema.optional()
35714
35776
  }).optional(),
35715
35777
  /**
35716
35778
  * Task support for elicitation requests.
35717
35779
  */
35718
- elicitation: z22.looseObject({
35780
+ elicitation: z24.looseObject({
35719
35781
  create: AssertObjectSchema.optional()
35720
35782
  }).optional()
35721
35783
  }).optional()
35722
35784
  });
35723
- ServerTasksCapabilitySchema = z22.looseObject({
35785
+ ServerTasksCapabilitySchema = z24.looseObject({
35724
35786
  /**
35725
35787
  * Present if the server supports listing tasks.
35726
35788
  */
@@ -35732,24 +35794,24 @@ var init_types = __esm({
35732
35794
  /**
35733
35795
  * Capabilities for task creation on specific request types.
35734
35796
  */
35735
- requests: z22.looseObject({
35797
+ requests: z24.looseObject({
35736
35798
  /**
35737
35799
  * Task support for tool requests.
35738
35800
  */
35739
- tools: z22.looseObject({
35801
+ tools: z24.looseObject({
35740
35802
  call: AssertObjectSchema.optional()
35741
35803
  }).optional()
35742
35804
  }).optional()
35743
35805
  });
35744
- ClientCapabilitiesSchema = z22.object({
35806
+ ClientCapabilitiesSchema = z24.object({
35745
35807
  /**
35746
35808
  * Experimental, non-standard capabilities that the client supports.
35747
35809
  */
35748
- experimental: z22.record(z22.string(), AssertObjectSchema).optional(),
35810
+ experimental: z24.record(z24.string(), AssertObjectSchema).optional(),
35749
35811
  /**
35750
35812
  * Present if the client supports sampling from an LLM.
35751
35813
  */
35752
- sampling: z22.object({
35814
+ sampling: z24.object({
35753
35815
  /**
35754
35816
  * Present if the client supports context inclusion via includeContext parameter.
35755
35817
  * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
@@ -35767,11 +35829,11 @@ var init_types = __esm({
35767
35829
  /**
35768
35830
  * Present if the client supports listing roots.
35769
35831
  */
35770
- roots: z22.object({
35832
+ roots: z24.object({
35771
35833
  /**
35772
35834
  * Whether the client supports issuing notifications for changes to the roots list.
35773
35835
  */
35774
- listChanged: z22.boolean().optional()
35836
+ listChanged: z24.boolean().optional()
35775
35837
  }).optional(),
35776
35838
  /**
35777
35839
  * Present if the client supports task creation.
@@ -35780,25 +35842,25 @@ var init_types = __esm({
35780
35842
  /**
35781
35843
  * Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
35782
35844
  */
35783
- extensions: z22.record(z22.string(), AssertObjectSchema).optional()
35845
+ extensions: z24.record(z24.string(), AssertObjectSchema).optional()
35784
35846
  });
35785
35847
  InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
35786
35848
  /**
35787
35849
  * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
35788
35850
  */
35789
- protocolVersion: z22.string(),
35851
+ protocolVersion: z24.string(),
35790
35852
  capabilities: ClientCapabilitiesSchema,
35791
35853
  clientInfo: ImplementationSchema
35792
35854
  });
35793
35855
  InitializeRequestSchema = RequestSchema.extend({
35794
- method: z22.literal("initialize"),
35856
+ method: z24.literal("initialize"),
35795
35857
  params: InitializeRequestParamsSchema
35796
35858
  });
35797
- ServerCapabilitiesSchema = z22.object({
35859
+ ServerCapabilitiesSchema = z24.object({
35798
35860
  /**
35799
35861
  * Experimental, non-standard capabilities that the server supports.
35800
35862
  */
35801
- experimental: z22.record(z22.string(), AssertObjectSchema).optional(),
35863
+ experimental: z24.record(z24.string(), AssertObjectSchema).optional(),
35802
35864
  /**
35803
35865
  * Present if the server supports sending log messages to the client.
35804
35866
  */
@@ -35810,33 +35872,33 @@ var init_types = __esm({
35810
35872
  /**
35811
35873
  * Present if the server offers any prompt templates.
35812
35874
  */
35813
- prompts: z22.object({
35875
+ prompts: z24.object({
35814
35876
  /**
35815
35877
  * Whether this server supports issuing notifications for changes to the prompt list.
35816
35878
  */
35817
- listChanged: z22.boolean().optional()
35879
+ listChanged: z24.boolean().optional()
35818
35880
  }).optional(),
35819
35881
  /**
35820
35882
  * Present if the server offers any resources to read.
35821
35883
  */
35822
- resources: z22.object({
35884
+ resources: z24.object({
35823
35885
  /**
35824
35886
  * Whether this server supports clients subscribing to resource updates.
35825
35887
  */
35826
- subscribe: z22.boolean().optional(),
35888
+ subscribe: z24.boolean().optional(),
35827
35889
  /**
35828
35890
  * Whether this server supports issuing notifications for changes to the resource list.
35829
35891
  */
35830
- listChanged: z22.boolean().optional()
35892
+ listChanged: z24.boolean().optional()
35831
35893
  }).optional(),
35832
35894
  /**
35833
35895
  * Present if the server offers any tools to call.
35834
35896
  */
35835
- tools: z22.object({
35897
+ tools: z24.object({
35836
35898
  /**
35837
35899
  * Whether this server supports issuing notifications for changes to the tool list.
35838
35900
  */
35839
- listChanged: z22.boolean().optional()
35901
+ listChanged: z24.boolean().optional()
35840
35902
  }).optional(),
35841
35903
  /**
35842
35904
  * Present if the server supports task creation.
@@ -35845,13 +35907,13 @@ var init_types = __esm({
35845
35907
  /**
35846
35908
  * Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
35847
35909
  */
35848
- extensions: z22.record(z22.string(), AssertObjectSchema).optional()
35910
+ extensions: z24.record(z24.string(), AssertObjectSchema).optional()
35849
35911
  });
35850
35912
  InitializeResultSchema = ResultSchema.extend({
35851
35913
  /**
35852
35914
  * 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.
35853
35915
  */
35854
- protocolVersion: z22.string(),
35916
+ protocolVersion: z24.string(),
35855
35917
  capabilities: ServerCapabilitiesSchema,
35856
35918
  serverInfo: ImplementationSchema,
35857
35919
  /**
@@ -35859,32 +35921,32 @@ var init_types = __esm({
35859
35921
  *
35860
35922
  * 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.
35861
35923
  */
35862
- instructions: z22.string().optional()
35924
+ instructions: z24.string().optional()
35863
35925
  });
35864
35926
  InitializedNotificationSchema = NotificationSchema.extend({
35865
- method: z22.literal("notifications/initialized"),
35927
+ method: z24.literal("notifications/initialized"),
35866
35928
  params: NotificationsParamsSchema.optional()
35867
35929
  });
35868
35930
  isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
35869
35931
  PingRequestSchema = RequestSchema.extend({
35870
- method: z22.literal("ping"),
35932
+ method: z24.literal("ping"),
35871
35933
  params: BaseRequestParamsSchema.optional()
35872
35934
  });
35873
- ProgressSchema = z22.object({
35935
+ ProgressSchema = z24.object({
35874
35936
  /**
35875
35937
  * The progress thus far. This should increase every time progress is made, even if the total is unknown.
35876
35938
  */
35877
- progress: z22.number(),
35939
+ progress: z24.number(),
35878
35940
  /**
35879
35941
  * Total number of items to process (or total progress required), if known.
35880
35942
  */
35881
- total: z22.optional(z22.number()),
35943
+ total: z24.optional(z24.number()),
35882
35944
  /**
35883
35945
  * An optional message describing the current progress.
35884
35946
  */
35885
- message: z22.optional(z22.string())
35947
+ message: z24.optional(z24.string())
35886
35948
  });
35887
- ProgressNotificationParamsSchema = z22.object({
35949
+ ProgressNotificationParamsSchema = z24.object({
35888
35950
  ...NotificationsParamsSchema.shape,
35889
35951
  ...ProgressSchema.shape,
35890
35952
  /**
@@ -35893,7 +35955,7 @@ var init_types = __esm({
35893
35955
  progressToken: ProgressTokenSchema
35894
35956
  });
35895
35957
  ProgressNotificationSchema = NotificationSchema.extend({
35896
- method: z22.literal("notifications/progress"),
35958
+ method: z24.literal("notifications/progress"),
35897
35959
  params: ProgressNotificationParamsSchema
35898
35960
  });
35899
35961
  PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
@@ -35913,86 +35975,86 @@ var init_types = __esm({
35913
35975
  */
35914
35976
  nextCursor: CursorSchema.optional()
35915
35977
  });
35916
- TaskStatusSchema = z22.enum(["working", "input_required", "completed", "failed", "cancelled"]);
35917
- TaskSchema = z22.object({
35918
- taskId: z22.string(),
35978
+ TaskStatusSchema = z24.enum(["working", "input_required", "completed", "failed", "cancelled"]);
35979
+ TaskSchema = z24.object({
35980
+ taskId: z24.string(),
35919
35981
  status: TaskStatusSchema,
35920
35982
  /**
35921
35983
  * Time in milliseconds to keep task results available after completion.
35922
35984
  * If null, the task has unlimited lifetime until manually cleaned up.
35923
35985
  */
35924
- ttl: z22.union([z22.number(), z22.null()]),
35986
+ ttl: z24.union([z24.number(), z24.null()]),
35925
35987
  /**
35926
35988
  * ISO 8601 timestamp when the task was created.
35927
35989
  */
35928
- createdAt: z22.string(),
35990
+ createdAt: z24.string(),
35929
35991
  /**
35930
35992
  * ISO 8601 timestamp when the task was last updated.
35931
35993
  */
35932
- lastUpdatedAt: z22.string(),
35933
- pollInterval: z22.optional(z22.number()),
35994
+ lastUpdatedAt: z24.string(),
35995
+ pollInterval: z24.optional(z24.number()),
35934
35996
  /**
35935
35997
  * Optional diagnostic message for failed tasks or other status information.
35936
35998
  */
35937
- statusMessage: z22.optional(z22.string())
35999
+ statusMessage: z24.optional(z24.string())
35938
36000
  });
35939
36001
  CreateTaskResultSchema = ResultSchema.extend({
35940
36002
  task: TaskSchema
35941
36003
  });
35942
36004
  TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
35943
36005
  TaskStatusNotificationSchema = NotificationSchema.extend({
35944
- method: z22.literal("notifications/tasks/status"),
36006
+ method: z24.literal("notifications/tasks/status"),
35945
36007
  params: TaskStatusNotificationParamsSchema
35946
36008
  });
35947
36009
  GetTaskRequestSchema = RequestSchema.extend({
35948
- method: z22.literal("tasks/get"),
36010
+ method: z24.literal("tasks/get"),
35949
36011
  params: BaseRequestParamsSchema.extend({
35950
- taskId: z22.string()
36012
+ taskId: z24.string()
35951
36013
  })
35952
36014
  });
35953
36015
  GetTaskResultSchema = ResultSchema.merge(TaskSchema);
35954
36016
  GetTaskPayloadRequestSchema = RequestSchema.extend({
35955
- method: z22.literal("tasks/result"),
36017
+ method: z24.literal("tasks/result"),
35956
36018
  params: BaseRequestParamsSchema.extend({
35957
- taskId: z22.string()
36019
+ taskId: z24.string()
35958
36020
  })
35959
36021
  });
35960
36022
  ResultSchema.loose();
35961
36023
  ListTasksRequestSchema = PaginatedRequestSchema.extend({
35962
- method: z22.literal("tasks/list")
36024
+ method: z24.literal("tasks/list")
35963
36025
  });
35964
36026
  ListTasksResultSchema = PaginatedResultSchema.extend({
35965
- tasks: z22.array(TaskSchema)
36027
+ tasks: z24.array(TaskSchema)
35966
36028
  });
35967
36029
  CancelTaskRequestSchema = RequestSchema.extend({
35968
- method: z22.literal("tasks/cancel"),
36030
+ method: z24.literal("tasks/cancel"),
35969
36031
  params: BaseRequestParamsSchema.extend({
35970
- taskId: z22.string()
36032
+ taskId: z24.string()
35971
36033
  })
35972
36034
  });
35973
36035
  CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
35974
- ResourceContentsSchema = z22.object({
36036
+ ResourceContentsSchema = z24.object({
35975
36037
  /**
35976
36038
  * The URI of this resource.
35977
36039
  */
35978
- uri: z22.string(),
36040
+ uri: z24.string(),
35979
36041
  /**
35980
36042
  * The MIME type of this resource, if known.
35981
36043
  */
35982
- mimeType: z22.optional(z22.string()),
36044
+ mimeType: z24.optional(z24.string()),
35983
36045
  /**
35984
36046
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
35985
36047
  * for notes on _meta usage.
35986
36048
  */
35987
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36049
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
35988
36050
  });
35989
36051
  TextResourceContentsSchema = ResourceContentsSchema.extend({
35990
36052
  /**
35991
36053
  * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
35992
36054
  */
35993
- text: z22.string()
36055
+ text: z24.string()
35994
36056
  });
35995
- Base64Schema = z22.string().refine((val) => {
36057
+ Base64Schema = z24.string().refine((val) => {
35996
36058
  try {
35997
36059
  atob(val);
35998
36060
  return true;
@@ -36006,44 +36068,44 @@ var init_types = __esm({
36006
36068
  */
36007
36069
  blob: Base64Schema
36008
36070
  });
36009
- RoleSchema = z22.enum(["user", "assistant"]);
36010
- AnnotationsSchema = z22.object({
36071
+ RoleSchema = z24.enum(["user", "assistant"]);
36072
+ AnnotationsSchema = z24.object({
36011
36073
  /**
36012
36074
  * Intended audience(s) for the resource.
36013
36075
  */
36014
- audience: z22.array(RoleSchema).optional(),
36076
+ audience: z24.array(RoleSchema).optional(),
36015
36077
  /**
36016
36078
  * Importance hint for the resource, from 0 (least) to 1 (most).
36017
36079
  */
36018
- priority: z22.number().min(0).max(1).optional(),
36080
+ priority: z24.number().min(0).max(1).optional(),
36019
36081
  /**
36020
36082
  * ISO 8601 timestamp for the most recent modification.
36021
36083
  */
36022
- lastModified: z22.iso.datetime({ offset: true }).optional()
36084
+ lastModified: z24.iso.datetime({ offset: true }).optional()
36023
36085
  });
36024
- ResourceSchema = z22.object({
36086
+ ResourceSchema = z24.object({
36025
36087
  ...BaseMetadataSchema.shape,
36026
36088
  ...IconsSchema.shape,
36027
36089
  /**
36028
36090
  * The URI of this resource.
36029
36091
  */
36030
- uri: z22.string(),
36092
+ uri: z24.string(),
36031
36093
  /**
36032
36094
  * A description of what this resource represents.
36033
36095
  *
36034
36096
  * 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.
36035
36097
  */
36036
- description: z22.optional(z22.string()),
36098
+ description: z24.optional(z24.string()),
36037
36099
  /**
36038
36100
  * The MIME type of this resource, if known.
36039
36101
  */
36040
- mimeType: z22.optional(z22.string()),
36102
+ mimeType: z24.optional(z24.string()),
36041
36103
  /**
36042
36104
  * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
36043
36105
  *
36044
36106
  * This can be used by Hosts to display file sizes and estimate context window usage.
36045
36107
  */
36046
- size: z22.optional(z22.number()),
36108
+ size: z24.optional(z24.number()),
36047
36109
  /**
36048
36110
  * Optional annotations for the client.
36049
36111
  */
@@ -36052,25 +36114,25 @@ var init_types = __esm({
36052
36114
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36053
36115
  * for notes on _meta usage.
36054
36116
  */
36055
- _meta: z22.optional(z22.looseObject({}))
36117
+ _meta: z24.optional(z24.looseObject({}))
36056
36118
  });
36057
- ResourceTemplateSchema = z22.object({
36119
+ ResourceTemplateSchema = z24.object({
36058
36120
  ...BaseMetadataSchema.shape,
36059
36121
  ...IconsSchema.shape,
36060
36122
  /**
36061
36123
  * A URI template (according to RFC 6570) that can be used to construct resource URIs.
36062
36124
  */
36063
- uriTemplate: z22.string(),
36125
+ uriTemplate: z24.string(),
36064
36126
  /**
36065
36127
  * A description of what this template is for.
36066
36128
  *
36067
36129
  * 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.
36068
36130
  */
36069
- description: z22.optional(z22.string()),
36131
+ description: z24.optional(z24.string()),
36070
36132
  /**
36071
36133
  * 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.
36072
36134
  */
36073
- mimeType: z22.optional(z22.string()),
36135
+ mimeType: z24.optional(z24.string()),
36074
36136
  /**
36075
36137
  * Optional annotations for the client.
36076
36138
  */
@@ -36079,19 +36141,19 @@ var init_types = __esm({
36079
36141
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36080
36142
  * for notes on _meta usage.
36081
36143
  */
36082
- _meta: z22.optional(z22.looseObject({}))
36144
+ _meta: z24.optional(z24.looseObject({}))
36083
36145
  });
36084
36146
  ListResourcesRequestSchema = PaginatedRequestSchema.extend({
36085
- method: z22.literal("resources/list")
36147
+ method: z24.literal("resources/list")
36086
36148
  });
36087
36149
  ListResourcesResultSchema = PaginatedResultSchema.extend({
36088
- resources: z22.array(ResourceSchema)
36150
+ resources: z24.array(ResourceSchema)
36089
36151
  });
36090
36152
  ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
36091
- method: z22.literal("resources/templates/list")
36153
+ method: z24.literal("resources/templates/list")
36092
36154
  });
36093
36155
  ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
36094
- resourceTemplates: z22.array(ResourceTemplateSchema)
36156
+ resourceTemplates: z24.array(ResourceTemplateSchema)
36095
36157
  });
36096
36158
  ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
36097
36159
  /**
@@ -36099,97 +36161,97 @@ var init_types = __esm({
36099
36161
  *
36100
36162
  * @format uri
36101
36163
  */
36102
- uri: z22.string()
36164
+ uri: z24.string()
36103
36165
  });
36104
36166
  ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
36105
36167
  ReadResourceRequestSchema = RequestSchema.extend({
36106
- method: z22.literal("resources/read"),
36168
+ method: z24.literal("resources/read"),
36107
36169
  params: ReadResourceRequestParamsSchema
36108
36170
  });
36109
36171
  ReadResourceResultSchema = ResultSchema.extend({
36110
- contents: z22.array(z22.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
36172
+ contents: z24.array(z24.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
36111
36173
  });
36112
36174
  ResourceListChangedNotificationSchema = NotificationSchema.extend({
36113
- method: z22.literal("notifications/resources/list_changed"),
36175
+ method: z24.literal("notifications/resources/list_changed"),
36114
36176
  params: NotificationsParamsSchema.optional()
36115
36177
  });
36116
36178
  SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
36117
36179
  SubscribeRequestSchema = RequestSchema.extend({
36118
- method: z22.literal("resources/subscribe"),
36180
+ method: z24.literal("resources/subscribe"),
36119
36181
  params: SubscribeRequestParamsSchema
36120
36182
  });
36121
36183
  UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
36122
36184
  UnsubscribeRequestSchema = RequestSchema.extend({
36123
- method: z22.literal("resources/unsubscribe"),
36185
+ method: z24.literal("resources/unsubscribe"),
36124
36186
  params: UnsubscribeRequestParamsSchema
36125
36187
  });
36126
36188
  ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
36127
36189
  /**
36128
36190
  * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
36129
36191
  */
36130
- uri: z22.string()
36192
+ uri: z24.string()
36131
36193
  });
36132
36194
  ResourceUpdatedNotificationSchema = NotificationSchema.extend({
36133
- method: z22.literal("notifications/resources/updated"),
36195
+ method: z24.literal("notifications/resources/updated"),
36134
36196
  params: ResourceUpdatedNotificationParamsSchema
36135
36197
  });
36136
- PromptArgumentSchema = z22.object({
36198
+ PromptArgumentSchema = z24.object({
36137
36199
  /**
36138
36200
  * The name of the argument.
36139
36201
  */
36140
- name: z22.string(),
36202
+ name: z24.string(),
36141
36203
  /**
36142
36204
  * A human-readable description of the argument.
36143
36205
  */
36144
- description: z22.optional(z22.string()),
36206
+ description: z24.optional(z24.string()),
36145
36207
  /**
36146
36208
  * Whether this argument must be provided.
36147
36209
  */
36148
- required: z22.optional(z22.boolean())
36210
+ required: z24.optional(z24.boolean())
36149
36211
  });
36150
- PromptSchema = z22.object({
36212
+ PromptSchema = z24.object({
36151
36213
  ...BaseMetadataSchema.shape,
36152
36214
  ...IconsSchema.shape,
36153
36215
  /**
36154
36216
  * An optional description of what this prompt provides
36155
36217
  */
36156
- description: z22.optional(z22.string()),
36218
+ description: z24.optional(z24.string()),
36157
36219
  /**
36158
36220
  * A list of arguments to use for templating the prompt.
36159
36221
  */
36160
- arguments: z22.optional(z22.array(PromptArgumentSchema)),
36222
+ arguments: z24.optional(z24.array(PromptArgumentSchema)),
36161
36223
  /**
36162
36224
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36163
36225
  * for notes on _meta usage.
36164
36226
  */
36165
- _meta: z22.optional(z22.looseObject({}))
36227
+ _meta: z24.optional(z24.looseObject({}))
36166
36228
  });
36167
36229
  ListPromptsRequestSchema = PaginatedRequestSchema.extend({
36168
- method: z22.literal("prompts/list")
36230
+ method: z24.literal("prompts/list")
36169
36231
  });
36170
36232
  ListPromptsResultSchema = PaginatedResultSchema.extend({
36171
- prompts: z22.array(PromptSchema)
36233
+ prompts: z24.array(PromptSchema)
36172
36234
  });
36173
36235
  GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
36174
36236
  /**
36175
36237
  * The name of the prompt or prompt template.
36176
36238
  */
36177
- name: z22.string(),
36239
+ name: z24.string(),
36178
36240
  /**
36179
36241
  * Arguments to use for templating the prompt.
36180
36242
  */
36181
- arguments: z22.record(z22.string(), z22.string()).optional()
36243
+ arguments: z24.record(z24.string(), z24.string()).optional()
36182
36244
  });
36183
36245
  GetPromptRequestSchema = RequestSchema.extend({
36184
- method: z22.literal("prompts/get"),
36246
+ method: z24.literal("prompts/get"),
36185
36247
  params: GetPromptRequestParamsSchema
36186
36248
  });
36187
- TextContentSchema = z22.object({
36188
- type: z22.literal("text"),
36249
+ TextContentSchema = z24.object({
36250
+ type: z24.literal("text"),
36189
36251
  /**
36190
36252
  * The text content of the message.
36191
36253
  */
36192
- text: z22.string(),
36254
+ text: z24.string(),
36193
36255
  /**
36194
36256
  * Optional annotations for the client.
36195
36257
  */
@@ -36198,10 +36260,10 @@ var init_types = __esm({
36198
36260
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36199
36261
  * for notes on _meta usage.
36200
36262
  */
36201
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36263
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36202
36264
  });
36203
- ImageContentSchema = z22.object({
36204
- type: z22.literal("image"),
36265
+ ImageContentSchema = z24.object({
36266
+ type: z24.literal("image"),
36205
36267
  /**
36206
36268
  * The base64-encoded image data.
36207
36269
  */
@@ -36209,7 +36271,7 @@ var init_types = __esm({
36209
36271
  /**
36210
36272
  * The MIME type of the image. Different providers may support different image types.
36211
36273
  */
36212
- mimeType: z22.string(),
36274
+ mimeType: z24.string(),
36213
36275
  /**
36214
36276
  * Optional annotations for the client.
36215
36277
  */
@@ -36218,10 +36280,10 @@ var init_types = __esm({
36218
36280
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36219
36281
  * for notes on _meta usage.
36220
36282
  */
36221
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36283
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36222
36284
  });
36223
- AudioContentSchema = z22.object({
36224
- type: z22.literal("audio"),
36285
+ AudioContentSchema = z24.object({
36286
+ type: z24.literal("audio"),
36225
36287
  /**
36226
36288
  * The base64-encoded audio data.
36227
36289
  */
@@ -36229,7 +36291,7 @@ var init_types = __esm({
36229
36291
  /**
36230
36292
  * The MIME type of the audio. Different providers may support different audio types.
36231
36293
  */
36232
- mimeType: z22.string(),
36294
+ mimeType: z24.string(),
36233
36295
  /**
36234
36296
  * Optional annotations for the client.
36235
36297
  */
@@ -36238,34 +36300,34 @@ var init_types = __esm({
36238
36300
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36239
36301
  * for notes on _meta usage.
36240
36302
  */
36241
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36303
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36242
36304
  });
36243
- ToolUseContentSchema = z22.object({
36244
- type: z22.literal("tool_use"),
36305
+ ToolUseContentSchema = z24.object({
36306
+ type: z24.literal("tool_use"),
36245
36307
  /**
36246
36308
  * The name of the tool to invoke.
36247
36309
  * Must match a tool name from the request's tools array.
36248
36310
  */
36249
- name: z22.string(),
36311
+ name: z24.string(),
36250
36312
  /**
36251
36313
  * Unique identifier for this tool call.
36252
36314
  * Used to correlate with ToolResultContent in subsequent messages.
36253
36315
  */
36254
- id: z22.string(),
36316
+ id: z24.string(),
36255
36317
  /**
36256
36318
  * Arguments to pass to the tool.
36257
36319
  * Must conform to the tool's inputSchema.
36258
36320
  */
36259
- input: z22.record(z22.string(), z22.unknown()),
36321
+ input: z24.record(z24.string(), z24.unknown()),
36260
36322
  /**
36261
36323
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36262
36324
  * for notes on _meta usage.
36263
36325
  */
36264
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36326
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36265
36327
  });
36266
- EmbeddedResourceSchema = z22.object({
36267
- type: z22.literal("resource"),
36268
- resource: z22.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
36328
+ EmbeddedResourceSchema = z24.object({
36329
+ type: z24.literal("resource"),
36330
+ resource: z24.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
36269
36331
  /**
36270
36332
  * Optional annotations for the client.
36271
36333
  */
@@ -36274,19 +36336,19 @@ var init_types = __esm({
36274
36336
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36275
36337
  * for notes on _meta usage.
36276
36338
  */
36277
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36339
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36278
36340
  });
36279
36341
  ResourceLinkSchema = ResourceSchema.extend({
36280
- type: z22.literal("resource_link")
36342
+ type: z24.literal("resource_link")
36281
36343
  });
36282
- ContentBlockSchema = z22.union([
36344
+ ContentBlockSchema = z24.union([
36283
36345
  TextContentSchema,
36284
36346
  ImageContentSchema,
36285
36347
  AudioContentSchema,
36286
36348
  ResourceLinkSchema,
36287
36349
  EmbeddedResourceSchema
36288
36350
  ]);
36289
- PromptMessageSchema = z22.object({
36351
+ PromptMessageSchema = z24.object({
36290
36352
  role: RoleSchema,
36291
36353
  content: ContentBlockSchema
36292
36354
  });
@@ -36294,24 +36356,24 @@ var init_types = __esm({
36294
36356
  /**
36295
36357
  * An optional description for the prompt.
36296
36358
  */
36297
- description: z22.string().optional(),
36298
- messages: z22.array(PromptMessageSchema)
36359
+ description: z24.string().optional(),
36360
+ messages: z24.array(PromptMessageSchema)
36299
36361
  });
36300
36362
  PromptListChangedNotificationSchema = NotificationSchema.extend({
36301
- method: z22.literal("notifications/prompts/list_changed"),
36363
+ method: z24.literal("notifications/prompts/list_changed"),
36302
36364
  params: NotificationsParamsSchema.optional()
36303
36365
  });
36304
- ToolAnnotationsSchema = z22.object({
36366
+ ToolAnnotationsSchema = z24.object({
36305
36367
  /**
36306
36368
  * A human-readable title for the tool.
36307
36369
  */
36308
- title: z22.string().optional(),
36370
+ title: z24.string().optional(),
36309
36371
  /**
36310
36372
  * If true, the tool does not modify its environment.
36311
36373
  *
36312
36374
  * Default: false
36313
36375
  */
36314
- readOnlyHint: z22.boolean().optional(),
36376
+ readOnlyHint: z24.boolean().optional(),
36315
36377
  /**
36316
36378
  * If true, the tool may perform destructive updates to its environment.
36317
36379
  * If false, the tool performs only additive updates.
@@ -36320,7 +36382,7 @@ var init_types = __esm({
36320
36382
  *
36321
36383
  * Default: true
36322
36384
  */
36323
- destructiveHint: z22.boolean().optional(),
36385
+ destructiveHint: z24.boolean().optional(),
36324
36386
  /**
36325
36387
  * If true, calling the tool repeatedly with the same arguments
36326
36388
  * will have no additional effect on the its environment.
@@ -36329,7 +36391,7 @@ var init_types = __esm({
36329
36391
  *
36330
36392
  * Default: false
36331
36393
  */
36332
- idempotentHint: z22.boolean().optional(),
36394
+ idempotentHint: z24.boolean().optional(),
36333
36395
  /**
36334
36396
  * If true, this tool may interact with an "open world" of external
36335
36397
  * entities. If false, the tool's domain of interaction is closed.
@@ -36338,9 +36400,9 @@ var init_types = __esm({
36338
36400
  *
36339
36401
  * Default: true
36340
36402
  */
36341
- openWorldHint: z22.boolean().optional()
36403
+ openWorldHint: z24.boolean().optional()
36342
36404
  });
36343
- ToolExecutionSchema = z22.object({
36405
+ ToolExecutionSchema = z24.object({
36344
36406
  /**
36345
36407
  * Indicates the tool's preference for task-augmented execution.
36346
36408
  * - "required": Clients MUST invoke the tool as a task
@@ -36349,34 +36411,34 @@ var init_types = __esm({
36349
36411
  *
36350
36412
  * If not present, defaults to "forbidden".
36351
36413
  */
36352
- taskSupport: z22.enum(["required", "optional", "forbidden"]).optional()
36414
+ taskSupport: z24.enum(["required", "optional", "forbidden"]).optional()
36353
36415
  });
36354
- ToolSchema = z22.object({
36416
+ ToolSchema = z24.object({
36355
36417
  ...BaseMetadataSchema.shape,
36356
36418
  ...IconsSchema.shape,
36357
36419
  /**
36358
36420
  * A human-readable description of the tool.
36359
36421
  */
36360
- description: z22.string().optional(),
36422
+ description: z24.string().optional(),
36361
36423
  /**
36362
36424
  * A JSON Schema 2020-12 object defining the expected parameters for the tool.
36363
36425
  * Must have type: 'object' at the root level per MCP spec.
36364
36426
  */
36365
- inputSchema: z22.object({
36366
- type: z22.literal("object"),
36367
- properties: z22.record(z22.string(), AssertObjectSchema).optional(),
36368
- required: z22.array(z22.string()).optional()
36369
- }).catchall(z22.unknown()),
36427
+ inputSchema: z24.object({
36428
+ type: z24.literal("object"),
36429
+ properties: z24.record(z24.string(), AssertObjectSchema).optional(),
36430
+ required: z24.array(z24.string()).optional()
36431
+ }).catchall(z24.unknown()),
36370
36432
  /**
36371
36433
  * An optional JSON Schema 2020-12 object defining the structure of the tool's output
36372
36434
  * returned in the structuredContent field of a CallToolResult.
36373
36435
  * Must have type: 'object' at the root level per MCP spec.
36374
36436
  */
36375
- outputSchema: z22.object({
36376
- type: z22.literal("object"),
36377
- properties: z22.record(z22.string(), AssertObjectSchema).optional(),
36378
- required: z22.array(z22.string()).optional()
36379
- }).catchall(z22.unknown()).optional(),
36437
+ outputSchema: z24.object({
36438
+ type: z24.literal("object"),
36439
+ properties: z24.record(z24.string(), AssertObjectSchema).optional(),
36440
+ required: z24.array(z24.string()).optional()
36441
+ }).catchall(z24.unknown()).optional(),
36380
36442
  /**
36381
36443
  * Optional additional tool information.
36382
36444
  */
@@ -36389,13 +36451,13 @@ var init_types = __esm({
36389
36451
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36390
36452
  * for notes on _meta usage.
36391
36453
  */
36392
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36454
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36393
36455
  });
36394
36456
  ListToolsRequestSchema = PaginatedRequestSchema.extend({
36395
- method: z22.literal("tools/list")
36457
+ method: z24.literal("tools/list")
36396
36458
  });
36397
36459
  ListToolsResultSchema = PaginatedResultSchema.extend({
36398
- tools: z22.array(ToolSchema)
36460
+ tools: z24.array(ToolSchema)
36399
36461
  });
36400
36462
  CallToolResultSchema = ResultSchema.extend({
36401
36463
  /**
@@ -36404,13 +36466,13 @@ var init_types = __esm({
36404
36466
  * If the Tool does not define an outputSchema, this field MUST be present in the result.
36405
36467
  * For backwards compatibility, this field is always present, but it may be empty.
36406
36468
  */
36407
- content: z22.array(ContentBlockSchema).default([]),
36469
+ content: z24.array(ContentBlockSchema).default([]),
36408
36470
  /**
36409
36471
  * An object containing structured tool output.
36410
36472
  *
36411
36473
  * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
36412
36474
  */
36413
- structuredContent: z22.record(z22.string(), z22.unknown()).optional(),
36475
+ structuredContent: z24.record(z24.string(), z24.unknown()).optional(),
36414
36476
  /**
36415
36477
  * Whether the tool call ended in an error.
36416
36478
  *
@@ -36425,30 +36487,30 @@ var init_types = __esm({
36425
36487
  * server does not support tool calls, or any other exceptional conditions,
36426
36488
  * should be reported as an MCP error response.
36427
36489
  */
36428
- isError: z22.boolean().optional()
36490
+ isError: z24.boolean().optional()
36429
36491
  });
36430
36492
  CallToolResultSchema.or(ResultSchema.extend({
36431
- toolResult: z22.unknown()
36493
+ toolResult: z24.unknown()
36432
36494
  }));
36433
36495
  CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36434
36496
  /**
36435
36497
  * The name of the tool to call.
36436
36498
  */
36437
- name: z22.string(),
36499
+ name: z24.string(),
36438
36500
  /**
36439
36501
  * Arguments to pass to the tool.
36440
36502
  */
36441
- arguments: z22.record(z22.string(), z22.unknown()).optional()
36503
+ arguments: z24.record(z24.string(), z24.unknown()).optional()
36442
36504
  });
36443
36505
  CallToolRequestSchema = RequestSchema.extend({
36444
- method: z22.literal("tools/call"),
36506
+ method: z24.literal("tools/call"),
36445
36507
  params: CallToolRequestParamsSchema
36446
36508
  });
36447
36509
  ToolListChangedNotificationSchema = NotificationSchema.extend({
36448
- method: z22.literal("notifications/tools/list_changed"),
36510
+ method: z24.literal("notifications/tools/list_changed"),
36449
36511
  params: NotificationsParamsSchema.optional()
36450
36512
  });
36451
- ListChangedOptionsBaseSchema = z22.object({
36513
+ ListChangedOptionsBaseSchema = z24.object({
36452
36514
  /**
36453
36515
  * If true, the list will be refreshed automatically when a list changed notification is received.
36454
36516
  * The callback will be called with the updated list.
@@ -36457,7 +36519,7 @@ var init_types = __esm({
36457
36519
  *
36458
36520
  * @default true
36459
36521
  */
36460
- autoRefresh: z22.boolean().default(true),
36522
+ autoRefresh: z24.boolean().default(true),
36461
36523
  /**
36462
36524
  * Debounce time in milliseconds for list changed notification processing.
36463
36525
  *
@@ -36466,9 +36528,9 @@ var init_types = __esm({
36466
36528
  *
36467
36529
  * @default 300
36468
36530
  */
36469
- debounceMs: z22.number().int().nonnegative().default(300)
36531
+ debounceMs: z24.number().int().nonnegative().default(300)
36470
36532
  });
36471
- LoggingLevelSchema = z22.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
36533
+ LoggingLevelSchema = z24.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
36472
36534
  SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
36473
36535
  /**
36474
36536
  * 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.
@@ -36476,7 +36538,7 @@ var init_types = __esm({
36476
36538
  level: LoggingLevelSchema
36477
36539
  });
36478
36540
  SetLevelRequestSchema = RequestSchema.extend({
36479
- method: z22.literal("logging/setLevel"),
36541
+ method: z24.literal("logging/setLevel"),
36480
36542
  params: SetLevelRequestParamsSchema
36481
36543
  });
36482
36544
  LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
@@ -36487,80 +36549,80 @@ var init_types = __esm({
36487
36549
  /**
36488
36550
  * An optional name of the logger issuing this message.
36489
36551
  */
36490
- logger: z22.string().optional(),
36552
+ logger: z24.string().optional(),
36491
36553
  /**
36492
36554
  * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
36493
36555
  */
36494
- data: z22.unknown()
36556
+ data: z24.unknown()
36495
36557
  });
36496
36558
  LoggingMessageNotificationSchema = NotificationSchema.extend({
36497
- method: z22.literal("notifications/message"),
36559
+ method: z24.literal("notifications/message"),
36498
36560
  params: LoggingMessageNotificationParamsSchema
36499
36561
  });
36500
- ModelHintSchema = z22.object({
36562
+ ModelHintSchema = z24.object({
36501
36563
  /**
36502
36564
  * A hint for a model name.
36503
36565
  */
36504
- name: z22.string().optional()
36566
+ name: z24.string().optional()
36505
36567
  });
36506
- ModelPreferencesSchema = z22.object({
36568
+ ModelPreferencesSchema = z24.object({
36507
36569
  /**
36508
36570
  * Optional hints to use for model selection.
36509
36571
  */
36510
- hints: z22.array(ModelHintSchema).optional(),
36572
+ hints: z24.array(ModelHintSchema).optional(),
36511
36573
  /**
36512
36574
  * How much to prioritize cost when selecting a model.
36513
36575
  */
36514
- costPriority: z22.number().min(0).max(1).optional(),
36576
+ costPriority: z24.number().min(0).max(1).optional(),
36515
36577
  /**
36516
36578
  * How much to prioritize sampling speed (latency) when selecting a model.
36517
36579
  */
36518
- speedPriority: z22.number().min(0).max(1).optional(),
36580
+ speedPriority: z24.number().min(0).max(1).optional(),
36519
36581
  /**
36520
36582
  * How much to prioritize intelligence and capabilities when selecting a model.
36521
36583
  */
36522
- intelligencePriority: z22.number().min(0).max(1).optional()
36584
+ intelligencePriority: z24.number().min(0).max(1).optional()
36523
36585
  });
36524
- ToolChoiceSchema = z22.object({
36586
+ ToolChoiceSchema = z24.object({
36525
36587
  /**
36526
36588
  * Controls when tools are used:
36527
36589
  * - "auto": Model decides whether to use tools (default)
36528
36590
  * - "required": Model MUST use at least one tool before completing
36529
36591
  * - "none": Model MUST NOT use any tools
36530
36592
  */
36531
- mode: z22.enum(["auto", "required", "none"]).optional()
36593
+ mode: z24.enum(["auto", "required", "none"]).optional()
36532
36594
  });
36533
- ToolResultContentSchema = z22.object({
36534
- type: z22.literal("tool_result"),
36535
- toolUseId: z22.string().describe("The unique identifier for the corresponding tool call."),
36536
- content: z22.array(ContentBlockSchema).default([]),
36537
- structuredContent: z22.object({}).loose().optional(),
36538
- isError: z22.boolean().optional(),
36595
+ ToolResultContentSchema = z24.object({
36596
+ type: z24.literal("tool_result"),
36597
+ toolUseId: z24.string().describe("The unique identifier for the corresponding tool call."),
36598
+ content: z24.array(ContentBlockSchema).default([]),
36599
+ structuredContent: z24.object({}).loose().optional(),
36600
+ isError: z24.boolean().optional(),
36539
36601
  /**
36540
36602
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36541
36603
  * for notes on _meta usage.
36542
36604
  */
36543
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36605
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36544
36606
  });
36545
- SamplingContentSchema = z22.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
36546
- SamplingMessageContentBlockSchema = z22.discriminatedUnion("type", [
36607
+ SamplingContentSchema = z24.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
36608
+ SamplingMessageContentBlockSchema = z24.discriminatedUnion("type", [
36547
36609
  TextContentSchema,
36548
36610
  ImageContentSchema,
36549
36611
  AudioContentSchema,
36550
36612
  ToolUseContentSchema,
36551
36613
  ToolResultContentSchema
36552
36614
  ]);
36553
- SamplingMessageSchema = z22.object({
36615
+ SamplingMessageSchema = z24.object({
36554
36616
  role: RoleSchema,
36555
- content: z22.union([SamplingMessageContentBlockSchema, z22.array(SamplingMessageContentBlockSchema)]),
36617
+ content: z24.union([SamplingMessageContentBlockSchema, z24.array(SamplingMessageContentBlockSchema)]),
36556
36618
  /**
36557
36619
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36558
36620
  * for notes on _meta usage.
36559
36621
  */
36560
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36622
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36561
36623
  });
36562
36624
  CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36563
- messages: z22.array(SamplingMessageSchema),
36625
+ messages: z24.array(SamplingMessageSchema),
36564
36626
  /**
36565
36627
  * The server's preferences for which model to select. The client MAY modify or omit this request.
36566
36628
  */
@@ -36568,7 +36630,7 @@ var init_types = __esm({
36568
36630
  /**
36569
36631
  * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
36570
36632
  */
36571
- systemPrompt: z22.string().optional(),
36633
+ systemPrompt: z24.string().optional(),
36572
36634
  /**
36573
36635
  * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
36574
36636
  * The client MAY ignore this request.
@@ -36576,15 +36638,15 @@ var init_types = __esm({
36576
36638
  * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
36577
36639
  * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
36578
36640
  */
36579
- includeContext: z22.enum(["none", "thisServer", "allServers"]).optional(),
36580
- temperature: z22.number().optional(),
36641
+ includeContext: z24.enum(["none", "thisServer", "allServers"]).optional(),
36642
+ temperature: z24.number().optional(),
36581
36643
  /**
36582
36644
  * The requested maximum number of tokens to sample (to prevent runaway completions).
36583
36645
  *
36584
36646
  * The client MAY choose to sample fewer tokens than the requested maximum.
36585
36647
  */
36586
- maxTokens: z22.number().int(),
36587
- stopSequences: z22.array(z22.string()).optional(),
36648
+ maxTokens: z24.number().int(),
36649
+ stopSequences: z24.array(z24.string()).optional(),
36588
36650
  /**
36589
36651
  * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
36590
36652
  */
@@ -36593,7 +36655,7 @@ var init_types = __esm({
36593
36655
  * Tools that the model may use during generation.
36594
36656
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
36595
36657
  */
36596
- tools: z22.array(ToolSchema).optional(),
36658
+ tools: z24.array(ToolSchema).optional(),
36597
36659
  /**
36598
36660
  * Controls how the model uses tools.
36599
36661
  * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
@@ -36602,14 +36664,14 @@ var init_types = __esm({
36602
36664
  toolChoice: ToolChoiceSchema.optional()
36603
36665
  });
36604
36666
  CreateMessageRequestSchema = RequestSchema.extend({
36605
- method: z22.literal("sampling/createMessage"),
36667
+ method: z24.literal("sampling/createMessage"),
36606
36668
  params: CreateMessageRequestParamsSchema
36607
36669
  });
36608
36670
  CreateMessageResultSchema = ResultSchema.extend({
36609
36671
  /**
36610
36672
  * The name of the model that generated the message.
36611
36673
  */
36612
- model: z22.string(),
36674
+ model: z24.string(),
36613
36675
  /**
36614
36676
  * The reason why sampling stopped, if known.
36615
36677
  *
@@ -36620,7 +36682,7 @@ var init_types = __esm({
36620
36682
  *
36621
36683
  * This field is an open string to allow for provider-specific stop reasons.
36622
36684
  */
36623
- stopReason: z22.optional(z22.enum(["endTurn", "stopSequence", "maxTokens"]).or(z22.string())),
36685
+ stopReason: z24.optional(z24.enum(["endTurn", "stopSequence", "maxTokens"]).or(z24.string())),
36624
36686
  role: RoleSchema,
36625
36687
  /**
36626
36688
  * Response content. Single content block (text, image, or audio).
@@ -36631,7 +36693,7 @@ var init_types = __esm({
36631
36693
  /**
36632
36694
  * The name of the model that generated the message.
36633
36695
  */
36634
- model: z22.string(),
36696
+ model: z24.string(),
36635
36697
  /**
36636
36698
  * The reason why sampling stopped, if known.
36637
36699
  *
@@ -36643,144 +36705,144 @@ var init_types = __esm({
36643
36705
  *
36644
36706
  * This field is an open string to allow for provider-specific stop reasons.
36645
36707
  */
36646
- stopReason: z22.optional(z22.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z22.string())),
36708
+ stopReason: z24.optional(z24.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z24.string())),
36647
36709
  role: RoleSchema,
36648
36710
  /**
36649
36711
  * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
36650
36712
  */
36651
- content: z22.union([SamplingMessageContentBlockSchema, z22.array(SamplingMessageContentBlockSchema)])
36652
- });
36653
- BooleanSchemaSchema = z22.object({
36654
- type: z22.literal("boolean"),
36655
- title: z22.string().optional(),
36656
- description: z22.string().optional(),
36657
- default: z22.boolean().optional()
36658
- });
36659
- StringSchemaSchema = z22.object({
36660
- type: z22.literal("string"),
36661
- title: z22.string().optional(),
36662
- description: z22.string().optional(),
36663
- minLength: z22.number().optional(),
36664
- maxLength: z22.number().optional(),
36665
- format: z22.enum(["email", "uri", "date", "date-time"]).optional(),
36666
- default: z22.string().optional()
36667
- });
36668
- NumberSchemaSchema = z22.object({
36669
- type: z22.enum(["number", "integer"]),
36670
- title: z22.string().optional(),
36671
- description: z22.string().optional(),
36672
- minimum: z22.number().optional(),
36673
- maximum: z22.number().optional(),
36674
- default: z22.number().optional()
36675
- });
36676
- UntitledSingleSelectEnumSchemaSchema = z22.object({
36677
- type: z22.literal("string"),
36678
- title: z22.string().optional(),
36679
- description: z22.string().optional(),
36680
- enum: z22.array(z22.string()),
36681
- default: z22.string().optional()
36682
- });
36683
- TitledSingleSelectEnumSchemaSchema = z22.object({
36684
- type: z22.literal("string"),
36685
- title: z22.string().optional(),
36686
- description: z22.string().optional(),
36687
- oneOf: z22.array(z22.object({
36688
- const: z22.string(),
36689
- title: z22.string()
36713
+ content: z24.union([SamplingMessageContentBlockSchema, z24.array(SamplingMessageContentBlockSchema)])
36714
+ });
36715
+ BooleanSchemaSchema = z24.object({
36716
+ type: z24.literal("boolean"),
36717
+ title: z24.string().optional(),
36718
+ description: z24.string().optional(),
36719
+ default: z24.boolean().optional()
36720
+ });
36721
+ StringSchemaSchema = z24.object({
36722
+ type: z24.literal("string"),
36723
+ title: z24.string().optional(),
36724
+ description: z24.string().optional(),
36725
+ minLength: z24.number().optional(),
36726
+ maxLength: z24.number().optional(),
36727
+ format: z24.enum(["email", "uri", "date", "date-time"]).optional(),
36728
+ default: z24.string().optional()
36729
+ });
36730
+ NumberSchemaSchema = z24.object({
36731
+ type: z24.enum(["number", "integer"]),
36732
+ title: z24.string().optional(),
36733
+ description: z24.string().optional(),
36734
+ minimum: z24.number().optional(),
36735
+ maximum: z24.number().optional(),
36736
+ default: z24.number().optional()
36737
+ });
36738
+ UntitledSingleSelectEnumSchemaSchema = z24.object({
36739
+ type: z24.literal("string"),
36740
+ title: z24.string().optional(),
36741
+ description: z24.string().optional(),
36742
+ enum: z24.array(z24.string()),
36743
+ default: z24.string().optional()
36744
+ });
36745
+ TitledSingleSelectEnumSchemaSchema = z24.object({
36746
+ type: z24.literal("string"),
36747
+ title: z24.string().optional(),
36748
+ description: z24.string().optional(),
36749
+ oneOf: z24.array(z24.object({
36750
+ const: z24.string(),
36751
+ title: z24.string()
36690
36752
  })),
36691
- default: z22.string().optional()
36692
- });
36693
- LegacyTitledEnumSchemaSchema = z22.object({
36694
- type: z22.literal("string"),
36695
- title: z22.string().optional(),
36696
- description: z22.string().optional(),
36697
- enum: z22.array(z22.string()),
36698
- enumNames: z22.array(z22.string()).optional(),
36699
- default: z22.string().optional()
36700
- });
36701
- SingleSelectEnumSchemaSchema = z22.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
36702
- UntitledMultiSelectEnumSchemaSchema = z22.object({
36703
- type: z22.literal("array"),
36704
- title: z22.string().optional(),
36705
- description: z22.string().optional(),
36706
- minItems: z22.number().optional(),
36707
- maxItems: z22.number().optional(),
36708
- items: z22.object({
36709
- type: z22.literal("string"),
36710
- enum: z22.array(z22.string())
36753
+ default: z24.string().optional()
36754
+ });
36755
+ LegacyTitledEnumSchemaSchema = z24.object({
36756
+ type: z24.literal("string"),
36757
+ title: z24.string().optional(),
36758
+ description: z24.string().optional(),
36759
+ enum: z24.array(z24.string()),
36760
+ enumNames: z24.array(z24.string()).optional(),
36761
+ default: z24.string().optional()
36762
+ });
36763
+ SingleSelectEnumSchemaSchema = z24.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
36764
+ UntitledMultiSelectEnumSchemaSchema = z24.object({
36765
+ type: z24.literal("array"),
36766
+ title: z24.string().optional(),
36767
+ description: z24.string().optional(),
36768
+ minItems: z24.number().optional(),
36769
+ maxItems: z24.number().optional(),
36770
+ items: z24.object({
36771
+ type: z24.literal("string"),
36772
+ enum: z24.array(z24.string())
36711
36773
  }),
36712
- default: z22.array(z22.string()).optional()
36713
- });
36714
- TitledMultiSelectEnumSchemaSchema = z22.object({
36715
- type: z22.literal("array"),
36716
- title: z22.string().optional(),
36717
- description: z22.string().optional(),
36718
- minItems: z22.number().optional(),
36719
- maxItems: z22.number().optional(),
36720
- items: z22.object({
36721
- anyOf: z22.array(z22.object({
36722
- const: z22.string(),
36723
- title: z22.string()
36774
+ default: z24.array(z24.string()).optional()
36775
+ });
36776
+ TitledMultiSelectEnumSchemaSchema = z24.object({
36777
+ type: z24.literal("array"),
36778
+ title: z24.string().optional(),
36779
+ description: z24.string().optional(),
36780
+ minItems: z24.number().optional(),
36781
+ maxItems: z24.number().optional(),
36782
+ items: z24.object({
36783
+ anyOf: z24.array(z24.object({
36784
+ const: z24.string(),
36785
+ title: z24.string()
36724
36786
  }))
36725
36787
  }),
36726
- default: z22.array(z22.string()).optional()
36788
+ default: z24.array(z24.string()).optional()
36727
36789
  });
36728
- MultiSelectEnumSchemaSchema = z22.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
36729
- EnumSchemaSchema = z22.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
36730
- PrimitiveSchemaDefinitionSchema = z22.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
36790
+ MultiSelectEnumSchemaSchema = z24.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
36791
+ EnumSchemaSchema = z24.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
36792
+ PrimitiveSchemaDefinitionSchema = z24.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
36731
36793
  ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36732
36794
  /**
36733
36795
  * The elicitation mode.
36734
36796
  *
36735
36797
  * Optional for backward compatibility. Clients MUST treat missing mode as "form".
36736
36798
  */
36737
- mode: z22.literal("form").optional(),
36799
+ mode: z24.literal("form").optional(),
36738
36800
  /**
36739
36801
  * The message to present to the user describing what information is being requested.
36740
36802
  */
36741
- message: z22.string(),
36803
+ message: z24.string(),
36742
36804
  /**
36743
36805
  * A restricted subset of JSON Schema.
36744
36806
  * Only top-level properties are allowed, without nesting.
36745
36807
  */
36746
- requestedSchema: z22.object({
36747
- type: z22.literal("object"),
36748
- properties: z22.record(z22.string(), PrimitiveSchemaDefinitionSchema),
36749
- required: z22.array(z22.string()).optional()
36808
+ requestedSchema: z24.object({
36809
+ type: z24.literal("object"),
36810
+ properties: z24.record(z24.string(), PrimitiveSchemaDefinitionSchema),
36811
+ required: z24.array(z24.string()).optional()
36750
36812
  })
36751
36813
  });
36752
36814
  ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
36753
36815
  /**
36754
36816
  * The elicitation mode.
36755
36817
  */
36756
- mode: z22.literal("url"),
36818
+ mode: z24.literal("url"),
36757
36819
  /**
36758
36820
  * The message to present to the user explaining why the interaction is needed.
36759
36821
  */
36760
- message: z22.string(),
36822
+ message: z24.string(),
36761
36823
  /**
36762
36824
  * The ID of the elicitation, which must be unique within the context of the server.
36763
36825
  * The client MUST treat this ID as an opaque value.
36764
36826
  */
36765
- elicitationId: z22.string(),
36827
+ elicitationId: z24.string(),
36766
36828
  /**
36767
36829
  * The URL that the user should navigate to.
36768
36830
  */
36769
- url: z22.string().url()
36831
+ url: z24.string().url()
36770
36832
  });
36771
- ElicitRequestParamsSchema = z22.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
36833
+ ElicitRequestParamsSchema = z24.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
36772
36834
  ElicitRequestSchema = RequestSchema.extend({
36773
- method: z22.literal("elicitation/create"),
36835
+ method: z24.literal("elicitation/create"),
36774
36836
  params: ElicitRequestParamsSchema
36775
36837
  });
36776
36838
  ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
36777
36839
  /**
36778
36840
  * The ID of the elicitation that completed.
36779
36841
  */
36780
- elicitationId: z22.string()
36842
+ elicitationId: z24.string()
36781
36843
  });
36782
36844
  ElicitationCompleteNotificationSchema = NotificationSchema.extend({
36783
- method: z22.literal("notifications/elicitation/complete"),
36845
+ method: z24.literal("notifications/elicitation/complete"),
36784
36846
  params: ElicitationCompleteNotificationParamsSchema
36785
36847
  });
36786
36848
  ElicitResultSchema = ResultSchema.extend({
@@ -36790,98 +36852,98 @@ var init_types = __esm({
36790
36852
  * - "decline": User explicitly decline the action
36791
36853
  * - "cancel": User dismissed without making an explicit choice
36792
36854
  */
36793
- action: z22.enum(["accept", "decline", "cancel"]),
36855
+ action: z24.enum(["accept", "decline", "cancel"]),
36794
36856
  /**
36795
36857
  * The submitted form data, only present when action is "accept".
36796
36858
  * Contains values matching the requested schema.
36797
36859
  * Per MCP spec, content is "typically omitted" for decline/cancel actions.
36798
36860
  * We normalize null to undefined for leniency while maintaining type compatibility.
36799
36861
  */
36800
- 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())
36862
+ 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())
36801
36863
  });
36802
- ResourceTemplateReferenceSchema = z22.object({
36803
- type: z22.literal("ref/resource"),
36864
+ ResourceTemplateReferenceSchema = z24.object({
36865
+ type: z24.literal("ref/resource"),
36804
36866
  /**
36805
36867
  * The URI or URI template of the resource.
36806
36868
  */
36807
- uri: z22.string()
36869
+ uri: z24.string()
36808
36870
  });
36809
- PromptReferenceSchema = z22.object({
36810
- type: z22.literal("ref/prompt"),
36871
+ PromptReferenceSchema = z24.object({
36872
+ type: z24.literal("ref/prompt"),
36811
36873
  /**
36812
36874
  * The name of the prompt or prompt template
36813
36875
  */
36814
- name: z22.string()
36876
+ name: z24.string()
36815
36877
  });
36816
36878
  CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
36817
- ref: z22.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
36879
+ ref: z24.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
36818
36880
  /**
36819
36881
  * The argument's information
36820
36882
  */
36821
- argument: z22.object({
36883
+ argument: z24.object({
36822
36884
  /**
36823
36885
  * The name of the argument
36824
36886
  */
36825
- name: z22.string(),
36887
+ name: z24.string(),
36826
36888
  /**
36827
36889
  * The value of the argument to use for completion matching.
36828
36890
  */
36829
- value: z22.string()
36891
+ value: z24.string()
36830
36892
  }),
36831
- context: z22.object({
36893
+ context: z24.object({
36832
36894
  /**
36833
36895
  * Previously-resolved variables in a URI template or prompt.
36834
36896
  */
36835
- arguments: z22.record(z22.string(), z22.string()).optional()
36897
+ arguments: z24.record(z24.string(), z24.string()).optional()
36836
36898
  }).optional()
36837
36899
  });
36838
36900
  CompleteRequestSchema = RequestSchema.extend({
36839
- method: z22.literal("completion/complete"),
36901
+ method: z24.literal("completion/complete"),
36840
36902
  params: CompleteRequestParamsSchema
36841
36903
  });
36842
36904
  CompleteResultSchema = ResultSchema.extend({
36843
- completion: z22.looseObject({
36905
+ completion: z24.looseObject({
36844
36906
  /**
36845
36907
  * An array of completion values. Must not exceed 100 items.
36846
36908
  */
36847
- values: z22.array(z22.string()).max(100),
36909
+ values: z24.array(z24.string()).max(100),
36848
36910
  /**
36849
36911
  * The total number of completion options available. This can exceed the number of values actually sent in the response.
36850
36912
  */
36851
- total: z22.optional(z22.number().int()),
36913
+ total: z24.optional(z24.number().int()),
36852
36914
  /**
36853
36915
  * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
36854
36916
  */
36855
- hasMore: z22.optional(z22.boolean())
36917
+ hasMore: z24.optional(z24.boolean())
36856
36918
  })
36857
36919
  });
36858
- RootSchema = z22.object({
36920
+ RootSchema = z24.object({
36859
36921
  /**
36860
36922
  * The URI identifying the root. This *must* start with file:// for now.
36861
36923
  */
36862
- uri: z22.string().startsWith("file://"),
36924
+ uri: z24.string().startsWith("file://"),
36863
36925
  /**
36864
36926
  * An optional name for the root.
36865
36927
  */
36866
- name: z22.string().optional(),
36928
+ name: z24.string().optional(),
36867
36929
  /**
36868
36930
  * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
36869
36931
  * for notes on _meta usage.
36870
36932
  */
36871
- _meta: z22.record(z22.string(), z22.unknown()).optional()
36933
+ _meta: z24.record(z24.string(), z24.unknown()).optional()
36872
36934
  });
36873
36935
  ListRootsRequestSchema = RequestSchema.extend({
36874
- method: z22.literal("roots/list"),
36936
+ method: z24.literal("roots/list"),
36875
36937
  params: BaseRequestParamsSchema.optional()
36876
36938
  });
36877
36939
  ListRootsResultSchema = ResultSchema.extend({
36878
- roots: z22.array(RootSchema)
36940
+ roots: z24.array(RootSchema)
36879
36941
  });
36880
36942
  RootsListChangedNotificationSchema = NotificationSchema.extend({
36881
- method: z22.literal("notifications/roots/list_changed"),
36943
+ method: z24.literal("notifications/roots/list_changed"),
36882
36944
  params: NotificationsParamsSchema.optional()
36883
36945
  });
36884
- z22.union([
36946
+ z24.union([
36885
36947
  PingRequestSchema,
36886
36948
  InitializeRequestSchema,
36887
36949
  CompleteRequestSchema,
@@ -36900,14 +36962,14 @@ var init_types = __esm({
36900
36962
  ListTasksRequestSchema,
36901
36963
  CancelTaskRequestSchema
36902
36964
  ]);
36903
- z22.union([
36965
+ z24.union([
36904
36966
  CancelledNotificationSchema,
36905
36967
  ProgressNotificationSchema,
36906
36968
  InitializedNotificationSchema,
36907
36969
  RootsListChangedNotificationSchema,
36908
36970
  TaskStatusNotificationSchema
36909
36971
  ]);
36910
- z22.union([
36972
+ z24.union([
36911
36973
  EmptyResultSchema,
36912
36974
  CreateMessageResultSchema,
36913
36975
  CreateMessageResultWithToolsSchema,
@@ -36917,7 +36979,7 @@ var init_types = __esm({
36917
36979
  ListTasksResultSchema,
36918
36980
  CreateTaskResultSchema
36919
36981
  ]);
36920
- z22.union([
36982
+ z24.union([
36921
36983
  PingRequestSchema,
36922
36984
  CreateMessageRequestSchema,
36923
36985
  ElicitRequestSchema,
@@ -36927,7 +36989,7 @@ var init_types = __esm({
36927
36989
  ListTasksRequestSchema,
36928
36990
  CancelTaskRequestSchema
36929
36991
  ]);
36930
- z22.union([
36992
+ z24.union([
36931
36993
  CancelledNotificationSchema,
36932
36994
  ProgressNotificationSchema,
36933
36995
  LoggingMessageNotificationSchema,
@@ -36938,7 +37000,7 @@ var init_types = __esm({
36938
37000
  TaskStatusNotificationSchema,
36939
37001
  ElicitationCompleteNotificationSchema
36940
37002
  ]);
36941
- z22.union([
37003
+ z24.union([
36942
37004
  EmptyResultSchema,
36943
37005
  InitializeResultSchema,
36944
37006
  CompleteResultSchema,
@@ -47130,147 +47192,147 @@ var init_index_node = __esm({
47130
47192
  var SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OptionalSafeUrlSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema;
47131
47193
  var init_auth = __esm({
47132
47194
  "../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
47133
- SafeUrlSchema = z22.url().superRefine((val, ctx) => {
47195
+ SafeUrlSchema = z24.url().superRefine((val, ctx) => {
47134
47196
  if (!URL.canParse(val)) {
47135
47197
  ctx.addIssue({
47136
- code: z22.ZodIssueCode.custom,
47198
+ code: z24.ZodIssueCode.custom,
47137
47199
  message: "URL must be parseable",
47138
47200
  fatal: true
47139
47201
  });
47140
- return z22.NEVER;
47202
+ return z24.NEVER;
47141
47203
  }
47142
47204
  }).refine((url2) => {
47143
47205
  const u2 = new URL(url2);
47144
47206
  return u2.protocol !== "javascript:" && u2.protocol !== "data:" && u2.protocol !== "vbscript:";
47145
47207
  }, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
47146
- OAuthProtectedResourceMetadataSchema = z22.looseObject({
47147
- resource: z22.string().url(),
47148
- authorization_servers: z22.array(SafeUrlSchema).optional(),
47149
- jwks_uri: z22.string().url().optional(),
47150
- scopes_supported: z22.array(z22.string()).optional(),
47151
- bearer_methods_supported: z22.array(z22.string()).optional(),
47152
- resource_signing_alg_values_supported: z22.array(z22.string()).optional(),
47153
- resource_name: z22.string().optional(),
47154
- resource_documentation: z22.string().optional(),
47155
- resource_policy_uri: z22.string().url().optional(),
47156
- resource_tos_uri: z22.string().url().optional(),
47157
- tls_client_certificate_bound_access_tokens: z22.boolean().optional(),
47158
- authorization_details_types_supported: z22.array(z22.string()).optional(),
47159
- dpop_signing_alg_values_supported: z22.array(z22.string()).optional(),
47160
- dpop_bound_access_tokens_required: z22.boolean().optional()
47161
- });
47162
- OAuthMetadataSchema = z22.looseObject({
47163
- issuer: z22.string(),
47208
+ OAuthProtectedResourceMetadataSchema = z24.looseObject({
47209
+ resource: z24.string().url(),
47210
+ authorization_servers: z24.array(SafeUrlSchema).optional(),
47211
+ jwks_uri: z24.string().url().optional(),
47212
+ scopes_supported: z24.array(z24.string()).optional(),
47213
+ bearer_methods_supported: z24.array(z24.string()).optional(),
47214
+ resource_signing_alg_values_supported: z24.array(z24.string()).optional(),
47215
+ resource_name: z24.string().optional(),
47216
+ resource_documentation: z24.string().optional(),
47217
+ resource_policy_uri: z24.string().url().optional(),
47218
+ resource_tos_uri: z24.string().url().optional(),
47219
+ tls_client_certificate_bound_access_tokens: z24.boolean().optional(),
47220
+ authorization_details_types_supported: z24.array(z24.string()).optional(),
47221
+ dpop_signing_alg_values_supported: z24.array(z24.string()).optional(),
47222
+ dpop_bound_access_tokens_required: z24.boolean().optional()
47223
+ });
47224
+ OAuthMetadataSchema = z24.looseObject({
47225
+ issuer: z24.string(),
47164
47226
  authorization_endpoint: SafeUrlSchema,
47165
47227
  token_endpoint: SafeUrlSchema,
47166
47228
  registration_endpoint: SafeUrlSchema.optional(),
47167
- scopes_supported: z22.array(z22.string()).optional(),
47168
- response_types_supported: z22.array(z22.string()),
47169
- response_modes_supported: z22.array(z22.string()).optional(),
47170
- grant_types_supported: z22.array(z22.string()).optional(),
47171
- token_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47172
- token_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47229
+ scopes_supported: z24.array(z24.string()).optional(),
47230
+ response_types_supported: z24.array(z24.string()),
47231
+ response_modes_supported: z24.array(z24.string()).optional(),
47232
+ grant_types_supported: z24.array(z24.string()).optional(),
47233
+ token_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47234
+ token_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47173
47235
  service_documentation: SafeUrlSchema.optional(),
47174
47236
  revocation_endpoint: SafeUrlSchema.optional(),
47175
- revocation_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47176
- revocation_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47177
- introspection_endpoint: z22.string().optional(),
47178
- introspection_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47179
- introspection_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47180
- code_challenge_methods_supported: z22.array(z22.string()).optional(),
47181
- client_id_metadata_document_supported: z22.boolean().optional()
47182
- });
47183
- OpenIdProviderMetadataSchema = z22.looseObject({
47184
- issuer: z22.string(),
47237
+ revocation_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47238
+ revocation_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47239
+ introspection_endpoint: z24.string().optional(),
47240
+ introspection_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47241
+ introspection_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47242
+ code_challenge_methods_supported: z24.array(z24.string()).optional(),
47243
+ client_id_metadata_document_supported: z24.boolean().optional()
47244
+ });
47245
+ OpenIdProviderMetadataSchema = z24.looseObject({
47246
+ issuer: z24.string(),
47185
47247
  authorization_endpoint: SafeUrlSchema,
47186
47248
  token_endpoint: SafeUrlSchema,
47187
47249
  userinfo_endpoint: SafeUrlSchema.optional(),
47188
47250
  jwks_uri: SafeUrlSchema,
47189
47251
  registration_endpoint: SafeUrlSchema.optional(),
47190
- scopes_supported: z22.array(z22.string()).optional(),
47191
- response_types_supported: z22.array(z22.string()),
47192
- response_modes_supported: z22.array(z22.string()).optional(),
47193
- grant_types_supported: z22.array(z22.string()).optional(),
47194
- acr_values_supported: z22.array(z22.string()).optional(),
47195
- subject_types_supported: z22.array(z22.string()),
47196
- id_token_signing_alg_values_supported: z22.array(z22.string()),
47197
- id_token_encryption_alg_values_supported: z22.array(z22.string()).optional(),
47198
- id_token_encryption_enc_values_supported: z22.array(z22.string()).optional(),
47199
- userinfo_signing_alg_values_supported: z22.array(z22.string()).optional(),
47200
- userinfo_encryption_alg_values_supported: z22.array(z22.string()).optional(),
47201
- userinfo_encryption_enc_values_supported: z22.array(z22.string()).optional(),
47202
- request_object_signing_alg_values_supported: z22.array(z22.string()).optional(),
47203
- request_object_encryption_alg_values_supported: z22.array(z22.string()).optional(),
47204
- request_object_encryption_enc_values_supported: z22.array(z22.string()).optional(),
47205
- token_endpoint_auth_methods_supported: z22.array(z22.string()).optional(),
47206
- token_endpoint_auth_signing_alg_values_supported: z22.array(z22.string()).optional(),
47207
- display_values_supported: z22.array(z22.string()).optional(),
47208
- claim_types_supported: z22.array(z22.string()).optional(),
47209
- claims_supported: z22.array(z22.string()).optional(),
47210
- service_documentation: z22.string().optional(),
47211
- claims_locales_supported: z22.array(z22.string()).optional(),
47212
- ui_locales_supported: z22.array(z22.string()).optional(),
47213
- claims_parameter_supported: z22.boolean().optional(),
47214
- request_parameter_supported: z22.boolean().optional(),
47215
- request_uri_parameter_supported: z22.boolean().optional(),
47216
- require_request_uri_registration: z22.boolean().optional(),
47252
+ scopes_supported: z24.array(z24.string()).optional(),
47253
+ response_types_supported: z24.array(z24.string()),
47254
+ response_modes_supported: z24.array(z24.string()).optional(),
47255
+ grant_types_supported: z24.array(z24.string()).optional(),
47256
+ acr_values_supported: z24.array(z24.string()).optional(),
47257
+ subject_types_supported: z24.array(z24.string()),
47258
+ id_token_signing_alg_values_supported: z24.array(z24.string()),
47259
+ id_token_encryption_alg_values_supported: z24.array(z24.string()).optional(),
47260
+ id_token_encryption_enc_values_supported: z24.array(z24.string()).optional(),
47261
+ userinfo_signing_alg_values_supported: z24.array(z24.string()).optional(),
47262
+ userinfo_encryption_alg_values_supported: z24.array(z24.string()).optional(),
47263
+ userinfo_encryption_enc_values_supported: z24.array(z24.string()).optional(),
47264
+ request_object_signing_alg_values_supported: z24.array(z24.string()).optional(),
47265
+ request_object_encryption_alg_values_supported: z24.array(z24.string()).optional(),
47266
+ request_object_encryption_enc_values_supported: z24.array(z24.string()).optional(),
47267
+ token_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
47268
+ token_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
47269
+ display_values_supported: z24.array(z24.string()).optional(),
47270
+ claim_types_supported: z24.array(z24.string()).optional(),
47271
+ claims_supported: z24.array(z24.string()).optional(),
47272
+ service_documentation: z24.string().optional(),
47273
+ claims_locales_supported: z24.array(z24.string()).optional(),
47274
+ ui_locales_supported: z24.array(z24.string()).optional(),
47275
+ claims_parameter_supported: z24.boolean().optional(),
47276
+ request_parameter_supported: z24.boolean().optional(),
47277
+ request_uri_parameter_supported: z24.boolean().optional(),
47278
+ require_request_uri_registration: z24.boolean().optional(),
47217
47279
  op_policy_uri: SafeUrlSchema.optional(),
47218
47280
  op_tos_uri: SafeUrlSchema.optional(),
47219
- client_id_metadata_document_supported: z22.boolean().optional()
47281
+ client_id_metadata_document_supported: z24.boolean().optional()
47220
47282
  });
47221
- OpenIdProviderDiscoveryMetadataSchema = z22.object({
47283
+ OpenIdProviderDiscoveryMetadataSchema = z24.object({
47222
47284
  ...OpenIdProviderMetadataSchema.shape,
47223
47285
  ...OAuthMetadataSchema.pick({
47224
47286
  code_challenge_methods_supported: true
47225
47287
  }).shape
47226
47288
  });
47227
- OAuthTokensSchema = z22.object({
47228
- access_token: z22.string(),
47229
- id_token: z22.string().optional(),
47289
+ OAuthTokensSchema = z24.object({
47290
+ access_token: z24.string(),
47291
+ id_token: z24.string().optional(),
47230
47292
  // Optional for OAuth 2.1, but necessary in OpenID Connect
47231
- token_type: z22.string(),
47232
- expires_in: z22.coerce.number().optional(),
47233
- scope: z22.string().optional(),
47234
- refresh_token: z22.string().optional()
47293
+ token_type: z24.string(),
47294
+ expires_in: z24.coerce.number().optional(),
47295
+ scope: z24.string().optional(),
47296
+ refresh_token: z24.string().optional()
47235
47297
  }).strip();
47236
- OAuthErrorResponseSchema = z22.object({
47237
- error: z22.string(),
47238
- error_description: z22.string().optional(),
47239
- error_uri: z22.string().optional()
47240
- });
47241
- OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z22.literal("").transform(() => void 0));
47242
- OAuthClientMetadataSchema = z22.object({
47243
- redirect_uris: z22.array(SafeUrlSchema),
47244
- token_endpoint_auth_method: z22.string().optional(),
47245
- grant_types: z22.array(z22.string()).optional(),
47246
- response_types: z22.array(z22.string()).optional(),
47247
- client_name: z22.string().optional(),
47298
+ OAuthErrorResponseSchema = z24.object({
47299
+ error: z24.string(),
47300
+ error_description: z24.string().optional(),
47301
+ error_uri: z24.string().optional()
47302
+ });
47303
+ OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z24.literal("").transform(() => void 0));
47304
+ OAuthClientMetadataSchema = z24.object({
47305
+ redirect_uris: z24.array(SafeUrlSchema),
47306
+ token_endpoint_auth_method: z24.string().optional(),
47307
+ grant_types: z24.array(z24.string()).optional(),
47308
+ response_types: z24.array(z24.string()).optional(),
47309
+ client_name: z24.string().optional(),
47248
47310
  client_uri: SafeUrlSchema.optional(),
47249
47311
  logo_uri: OptionalSafeUrlSchema,
47250
- scope: z22.string().optional(),
47251
- contacts: z22.array(z22.string()).optional(),
47312
+ scope: z24.string().optional(),
47313
+ contacts: z24.array(z24.string()).optional(),
47252
47314
  tos_uri: OptionalSafeUrlSchema,
47253
- policy_uri: z22.string().optional(),
47315
+ policy_uri: z24.string().optional(),
47254
47316
  jwks_uri: SafeUrlSchema.optional(),
47255
- jwks: z22.any().optional(),
47256
- software_id: z22.string().optional(),
47257
- software_version: z22.string().optional(),
47258
- software_statement: z22.string().optional()
47317
+ jwks: z24.any().optional(),
47318
+ software_id: z24.string().optional(),
47319
+ software_version: z24.string().optional(),
47320
+ software_statement: z24.string().optional()
47259
47321
  }).strip();
47260
- OAuthClientInformationSchema = z22.object({
47261
- client_id: z22.string(),
47262
- client_secret: z22.string().optional(),
47263
- client_id_issued_at: z22.number().optional(),
47264
- client_secret_expires_at: z22.number().optional()
47322
+ OAuthClientInformationSchema = z24.object({
47323
+ client_id: z24.string(),
47324
+ client_secret: z24.string().optional(),
47325
+ client_id_issued_at: z24.number().optional(),
47326
+ client_secret_expires_at: z24.number().optional()
47265
47327
  }).strip();
47266
47328
  OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
47267
- z22.object({
47268
- error: z22.string(),
47269
- error_description: z22.string().optional()
47329
+ z24.object({
47330
+ error: z24.string(),
47331
+ error_description: z24.string().optional()
47270
47332
  }).strip();
47271
- z22.object({
47272
- token: z22.string(),
47273
- token_type_hint: z22.string().optional()
47333
+ z24.object({
47334
+ token: z24.string(),
47335
+ token_type_hint: z24.string().optional()
47274
47336
  }).strip();
47275
47337
  }
47276
47338
  });
@@ -49405,10 +49467,10 @@ var require_react_production_min = __commonJS({
49405
49467
  var w4 = /* @__PURE__ */ Symbol.for("react.suspense");
49406
49468
  var x4 = /* @__PURE__ */ Symbol.for("react.memo");
49407
49469
  var y2 = /* @__PURE__ */ Symbol.for("react.lazy");
49408
- var z55 = Symbol.iterator;
49470
+ var z58 = Symbol.iterator;
49409
49471
  function A3(a2) {
49410
49472
  if (null === a2 || "object" !== typeof a2) return null;
49411
- a2 = z55 && a2[z55] || a2["@@iterator"];
49473
+ a2 = z58 && a2[z58] || a2["@@iterator"];
49412
49474
  return "function" === typeof a2 ? a2 : null;
49413
49475
  }
49414
49476
  var B2 = { isMounted: function() {
@@ -49475,7 +49537,7 @@ var require_react_production_min = __commonJS({
49475
49537
  });
49476
49538
  }
49477
49539
  var P3 = /\/+/g;
49478
- function Q4(a2, b3) {
49540
+ function Q3(a2, b3) {
49479
49541
  return "object" === typeof a2 && null !== a2 && null != a2.key ? escape4("" + a2.key) : b3.toString(36);
49480
49542
  }
49481
49543
  function R4(a2, b3, e3, d2, c2) {
@@ -49495,17 +49557,17 @@ var require_react_production_min = __commonJS({
49495
49557
  h3 = true;
49496
49558
  }
49497
49559
  }
49498
- 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) {
49560
+ 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) {
49499
49561
  return a3;
49500
49562
  })) : null != c2 && (O3(c2) && (c2 = N2(c2, e3 + (!c2.key || h3 && h3.key === c2.key ? "" : ("" + c2.key).replace(P3, "$&/") + "/") + a2)), b3.push(c2)), 1;
49501
49563
  h3 = 0;
49502
49564
  d2 = "" === d2 ? "." : d2 + ":";
49503
49565
  if (I2(a2)) for (var g2 = 0; g2 < a2.length; g2++) {
49504
49566
  k3 = a2[g2];
49505
- var f3 = d2 + Q4(k3, g2);
49567
+ var f3 = d2 + Q3(k3, g2);
49506
49568
  h3 += R4(k3, b3, e3, f3, c2);
49507
49569
  }
49508
- 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);
49570
+ 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);
49509
49571
  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.");
49510
49572
  return h3;
49511
49573
  }
@@ -52215,7 +52277,7 @@ var init_yoga_wasm_base64_esm = __esm({
52215
52277
  h3.noExitRuntime || true;
52216
52278
  "object" != typeof WebAssembly && x4("no native wasm support detected");
52217
52279
  var fa, ha = false;
52218
- function z55(a2, b3, c2) {
52280
+ function z58(a2, b3, c2) {
52219
52281
  c2 = b3 + c2;
52220
52282
  for (var d2 = ""; !(b3 >= c2); ) {
52221
52283
  var e3 = a2[b3++];
@@ -52363,7 +52425,7 @@ var init_yoga_wasm_base64_esm = __esm({
52363
52425
  a2["delete"]();
52364
52426
  }
52365
52427
  }
52366
- var P3 = void 0, Q4 = {};
52428
+ var P3 = void 0, Q3 = {};
52367
52429
  function Ia(a2, b3) {
52368
52430
  for (void 0 === b3 && L3("ptr should not be undefined"); a2.R; ) b3 = a2.ba(b3), a2 = a2.R;
52369
52431
  return b3;
@@ -52396,7 +52458,7 @@ var init_yoga_wasm_base64_esm = __esm({
52396
52458
  var Qa = {};
52397
52459
  function Ra(a2, b3) {
52398
52460
  b3 = Ia(a2, b3);
52399
- return Q4[b3];
52461
+ return Q3[b3];
52400
52462
  }
52401
52463
  var Sa = void 0;
52402
52464
  function Ta(a2) {
@@ -52767,11 +52829,11 @@ var init_yoga_wasm_base64_esm = __esm({
52767
52829
  for (var Gb = Array(256), Hb = 0; 256 > Hb; ++Hb) Gb[Hb] = String.fromCharCode(Hb);
52768
52830
  Ga = Gb;
52769
52831
  h3.getInheritedInstanceCount = function() {
52770
- return Object.keys(Q4).length;
52832
+ return Object.keys(Q3).length;
52771
52833
  };
52772
52834
  h3.getLiveInheritedInstances = function() {
52773
52835
  var a2 = [], b3;
52774
- for (b3 in Q4) Q4.hasOwnProperty(b3) && a2.push(Q4[b3]);
52836
+ for (b3 in Q3) Q3.hasOwnProperty(b3) && a2.push(Q3[b3]);
52775
52837
  return a2;
52776
52838
  };
52777
52839
  h3.flushPendingDeletes = Ha;
@@ -52865,7 +52927,7 @@ var init_yoga_wasm_base64_esm = __esm({
52865
52927
  return b3;
52866
52928
  }, Jb = {
52867
52929
  l: function(a2, b3, c2, d2) {
52868
- x4("Assertion failed: " + (a2 ? z55(A3, a2) : "") + ", at: " + [b3 ? b3 ? z55(A3, b3) : "" : "unknown filename", c2, d2 ? d2 ? z55(A3, d2) : "" : "unknown function"]);
52930
+ x4("Assertion failed: " + (a2 ? z58(A3, a2) : "") + ", at: " + [b3 ? b3 ? z58(A3, b3) : "" : "unknown filename", c2, d2 ? d2 ? z58(A3, d2) : "" : "unknown function"]);
52869
52931
  },
52870
52932
  q: function(a2, b3, c2) {
52871
52933
  a2 = N2(a2);
@@ -52890,14 +52952,14 @@ var init_yoga_wasm_base64_esm = __esm({
52890
52952
  T2(this);
52891
52953
  l2 = n2.O;
52892
52954
  l2 = Ia(e3, l2);
52893
- Q4.hasOwnProperty(l2) ? L3("Tried to register registered instance: " + l2) : Q4[l2] = this;
52955
+ Q3.hasOwnProperty(l2) ? L3("Tried to register registered instance: " + l2) : Q3[l2] = this;
52894
52956
  };
52895
52957
  f3.__destruct = function() {
52896
52958
  this === f3 && L3("Pass correct 'this' to __destruct");
52897
52959
  Ma(this);
52898
52960
  var l2 = this.M.O;
52899
52961
  l2 = Ia(e3, l2);
52900
- Q4.hasOwnProperty(l2) ? delete Q4[l2] : L3("Tried to unregister unregistered instance: " + l2);
52962
+ Q3.hasOwnProperty(l2) ? delete Q3[l2] : L3("Tried to unregister unregistered instance: " + l2);
52901
52963
  };
52902
52964
  a2.prototype = Object.create(f3);
52903
52965
  for (var m3 in c2) a2.prototype[m3] = c2[m3];
@@ -53118,7 +53180,7 @@ var init_yoga_wasm_base64_esm = __esm({
53118
53180
  if (c2) for (var g2 = f3, k3 = 0; k3 <= e3; ++k3) {
53119
53181
  var m3 = f3 + k3;
53120
53182
  if (k3 == e3 || 0 == A3[m3]) {
53121
- g2 = g2 ? z55(A3, g2, m3 - g2) : "";
53183
+ g2 = g2 ? z58(A3, g2, m3 - g2) : "";
53122
53184
  if (void 0 === l2) var l2 = g2;
53123
53185
  else l2 += String.fromCharCode(0), l2 += g2;
53124
53186
  g2 = m3 + 1;
@@ -53315,7 +53377,7 @@ var init_yoga_wasm_base64_esm = __esm({
53315
53377
  b3 += 8;
53316
53378
  for (var m3 = 0; m3 < k3; m3++) {
53317
53379
  var l2 = A3[g2 + m3], n2 = Fb[a2];
53318
- 0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v3)(z55(n2, 0)), n2.length = 0) : n2.push(l2);
53380
+ 0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v3)(z58(n2, 0)), n2.length = 0) : n2.push(l2);
53319
53381
  }
53320
53382
  e3 += k3;
53321
53383
  }
@@ -53803,7 +53865,7 @@ var require_scheduler_production_min = __commonJS({
53803
53865
  var u2 = 1;
53804
53866
  var v3 = null;
53805
53867
  var y2 = 3;
53806
- var z55 = false;
53868
+ var z58 = false;
53807
53869
  var A3 = false;
53808
53870
  var B2 = false;
53809
53871
  var D3 = "function" === typeof setTimeout ? setTimeout : null;
@@ -53830,7 +53892,7 @@ var require_scheduler_production_min = __commonJS({
53830
53892
  function J2(a2, b3) {
53831
53893
  A3 = false;
53832
53894
  B2 && (B2 = false, E3(L3), L3 = -1);
53833
- z55 = true;
53895
+ z58 = true;
53834
53896
  var c2 = y2;
53835
53897
  try {
53836
53898
  G3(b3);
@@ -53854,21 +53916,21 @@ var require_scheduler_production_min = __commonJS({
53854
53916
  }
53855
53917
  return w4;
53856
53918
  } finally {
53857
- v3 = null, y2 = c2, z55 = false;
53919
+ v3 = null, y2 = c2, z58 = false;
53858
53920
  }
53859
53921
  }
53860
53922
  var N2 = false;
53861
53923
  var O3 = null;
53862
53924
  var L3 = -1;
53863
53925
  var P3 = 5;
53864
- var Q4 = -1;
53926
+ var Q3 = -1;
53865
53927
  function M2() {
53866
- return exports.unstable_now() - Q4 < P3 ? false : true;
53928
+ return exports.unstable_now() - Q3 < P3 ? false : true;
53867
53929
  }
53868
53930
  function R4() {
53869
53931
  if (null !== O3) {
53870
53932
  var a2 = exports.unstable_now();
53871
- Q4 = a2;
53933
+ Q3 = a2;
53872
53934
  var b3 = true;
53873
53935
  try {
53874
53936
  b3 = O3(true, a2);
@@ -53911,7 +53973,7 @@ var require_scheduler_production_min = __commonJS({
53911
53973
  a2.callback = null;
53912
53974
  };
53913
53975
  exports.unstable_continueExecution = function() {
53914
- A3 || z55 || (A3 = true, I2(J2));
53976
+ A3 || z58 || (A3 = true, I2(J2));
53915
53977
  };
53916
53978
  exports.unstable_forceFrameRate = function(a2) {
53917
53979
  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;
@@ -53984,7 +54046,7 @@ var require_scheduler_production_min = __commonJS({
53984
54046
  }
53985
54047
  e3 = c2 + e3;
53986
54048
  a2 = { id: u2++, callback: b3, priorityLevel: a2, startTime: c2, expirationTime: e3, sortIndex: -1 };
53987
- 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)));
54049
+ 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)));
53988
54050
  return a2;
53989
54051
  };
53990
54052
  exports.unstable_shouldYield = M2;
@@ -54741,7 +54803,7 @@ var require_react_reconciler_production_min = __commonJS({
54741
54803
  gc[hc] = a2.current;
54742
54804
  a2.current = b3;
54743
54805
  }
54744
- var jc = {}, x4 = ic(jc), z55 = ic(false), kc = jc;
54806
+ var jc = {}, x4 = ic(jc), z58 = ic(false), kc = jc;
54745
54807
  function mc(a2, b3) {
54746
54808
  var c2 = a2.type.contextTypes;
54747
54809
  if (!c2) return jc;
@@ -54757,13 +54819,13 @@ var require_react_reconciler_production_min = __commonJS({
54757
54819
  return null !== a2 && void 0 !== a2;
54758
54820
  }
54759
54821
  function nc() {
54760
- q3(z55);
54822
+ q3(z58);
54761
54823
  q3(x4);
54762
54824
  }
54763
54825
  function oc(a2, b3, c2) {
54764
54826
  if (x4.current !== jc) throw Error(n2(168));
54765
54827
  v3(x4, b3);
54766
- v3(z55, c2);
54828
+ v3(z58, c2);
54767
54829
  }
54768
54830
  function pc(a2, b3, c2) {
54769
54831
  var d2 = a2.stateNode;
@@ -54777,14 +54839,14 @@ var require_react_reconciler_production_min = __commonJS({
54777
54839
  a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || jc;
54778
54840
  kc = x4.current;
54779
54841
  v3(x4, a2);
54780
- v3(z55, z55.current);
54842
+ v3(z58, z58.current);
54781
54843
  return true;
54782
54844
  }
54783
54845
  function rc(a2, b3, c2) {
54784
54846
  var d2 = a2.stateNode;
54785
54847
  if (!d2) throw Error(n2(169));
54786
- c2 ? (a2 = pc(a2, b3, kc), d2.__reactInternalMemoizedMergedChildContext = a2, q3(z55), q3(x4), v3(x4, a2)) : q3(z55);
54787
- v3(z55, c2);
54848
+ c2 ? (a2 = pc(a2, b3, kc), d2.__reactInternalMemoizedMergedChildContext = a2, q3(z58), q3(x4), v3(x4, a2)) : q3(z58);
54849
+ v3(z58, c2);
54788
54850
  }
54789
54851
  var tc = Math.clz32 ? Math.clz32 : sc, uc = Math.log, vc = Math.LN2;
54790
54852
  function sc(a2) {
@@ -55651,7 +55713,7 @@ var require_react_reconciler_production_min = __commonJS({
55651
55713
  b3 = Ga(c2, a2.type, b3);
55652
55714
  c2 !== b3 && (v3(pe2, a2), v3(oe2, b3));
55653
55715
  }
55654
- function ve3(a2) {
55716
+ function ve2(a2) {
55655
55717
  pe2.current === a2 && (q3(oe2), q3(pe2));
55656
55718
  }
55657
55719
  var I2 = ic(0);
@@ -56382,7 +56444,7 @@ var require_react_reconciler_production_min = __commonJS({
56382
56444
  g2.state = p3;
56383
56445
  ke2(b3, d2, g2, e3);
56384
56446
  k3 = b3.memoizedState;
56385
- 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);
56447
+ 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);
56386
56448
  } else {
56387
56449
  g2 = b3.stateNode;
56388
56450
  fe2(a2, b3);
@@ -56400,7 +56462,7 @@ var require_react_reconciler_production_min = __commonJS({
56400
56462
  g2.state = p3;
56401
56463
  ke2(b3, d2, g2, e3);
56402
56464
  var w4 = b3.memoizedState;
56403
- 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);
56465
+ 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);
56404
56466
  }
56405
56467
  return dg(a2, b3, c2, d2, f3, e3);
56406
56468
  }
@@ -56841,7 +56903,7 @@ var require_react_reconciler_production_min = __commonJS({
56841
56903
  null === d2 ? b3 || null === a2.tail ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null;
56842
56904
  }
56843
56905
  }
56844
- function Q4(a2) {
56906
+ function Q3(a2) {
56845
56907
  var b3 = null !== a2.alternate && a2.alternate.child === a2.child, c2 = 0, d2 = 0;
56846
56908
  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;
56847
56909
  else for (e3 = a2.child; null !== e3; ) c2 |= e3.lanes | e3.childLanes, d2 |= e3.subtreeFlags, d2 |= e3.flags, e3.return = a2, e3 = e3.sibling;
@@ -56863,29 +56925,29 @@ var require_react_reconciler_production_min = __commonJS({
56863
56925
  case 12:
56864
56926
  case 9:
56865
56927
  case 14:
56866
- return Q4(b3), null;
56928
+ return Q3(b3), null;
56867
56929
  case 1:
56868
- return A3(b3.type) && nc(), Q4(b3), null;
56930
+ return A3(b3.type) && nc(), Q3(b3), null;
56869
56931
  case 3:
56870
56932
  c2 = b3.stateNode;
56871
56933
  te3();
56872
- q3(z55);
56934
+ q3(z58);
56873
56935
  q3(x4);
56874
56936
  ye3();
56875
56937
  c2.pendingContext && (c2.context = c2.pendingContext, c2.pendingContext = null);
56876
56938
  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));
56877
56939
  wg(a2, b3);
56878
- Q4(b3);
56940
+ Q3(b3);
56879
56941
  return null;
56880
56942
  case 5:
56881
- ve3(b3);
56943
+ ve2(b3);
56882
56944
  c2 = re2(qe2.current);
56883
56945
  var e3 = b3.type;
56884
56946
  if (null !== a2 && null != b3.stateNode) xg(a2, b3, e3, d2, c2), a2.ref !== b3.ref && (b3.flags |= 512, b3.flags |= 2097152);
56885
56947
  else {
56886
56948
  if (!d2) {
56887
56949
  if (null === b3.stateNode) throw Error(n2(166));
56888
- Q4(b3);
56950
+ Q3(b3);
56889
56951
  return null;
56890
56952
  }
56891
56953
  a2 = re2(oe2.current);
@@ -56902,7 +56964,7 @@ var require_react_reconciler_production_min = __commonJS({
56902
56964
  }
56903
56965
  null !== b3.ref && (b3.flags |= 512, b3.flags |= 2097152);
56904
56966
  }
56905
- Q4(b3);
56967
+ Q3(b3);
56906
56968
  return null;
56907
56969
  case 6:
56908
56970
  if (a2 && null != b3.stateNode) yg(a2, b3, a2.memoizedProps, d2);
@@ -56926,7 +56988,7 @@ var require_react_reconciler_production_min = __commonJS({
56926
56988
  d2 && tg(b3);
56927
56989
  } else b3.stateNode = Oa(d2, a2, c2, b3);
56928
56990
  }
56929
- Q4(b3);
56991
+ Q3(b3);
56930
56992
  return null;
56931
56993
  case 13:
56932
56994
  q3(I2);
@@ -56942,7 +57004,7 @@ var require_react_reconciler_production_min = __commonJS({
56942
57004
  if (!e3) throw Error(n2(317));
56943
57005
  Tb(e3, b3);
56944
57006
  } else Ad(), 0 === (b3.flags & 128) && (b3.memoizedState = null), b3.flags |= 4;
56945
- Q4(b3);
57007
+ Q3(b3);
56946
57008
  e3 = false;
56947
57009
  } else null !== rd && (Cg(rd), rd = null), e3 = true;
56948
57010
  if (!e3) return b3.flags & 65536 ? b3 : null;
@@ -56951,18 +57013,18 @@ var require_react_reconciler_production_min = __commonJS({
56951
57013
  c2 = null !== d2;
56952
57014
  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()));
56953
57015
  null !== b3.updateQueue && (b3.flags |= 4);
56954
- Q4(b3);
57016
+ Q3(b3);
56955
57017
  return null;
56956
57018
  case 4:
56957
- return te3(), wg(a2, b3), null === a2 && Xa(b3.stateNode.containerInfo), Q4(b3), null;
57019
+ return te3(), wg(a2, b3), null === a2 && Xa(b3.stateNode.containerInfo), Q3(b3), null;
56958
57020
  case 10:
56959
- return Wd(b3.type._context), Q4(b3), null;
57021
+ return Wd(b3.type._context), Q3(b3), null;
56960
57022
  case 17:
56961
- return A3(b3.type) && nc(), Q4(b3), null;
57023
+ return A3(b3.type) && nc(), Q3(b3), null;
56962
57024
  case 19:
56963
57025
  q3(I2);
56964
57026
  e3 = b3.memoizedState;
56965
- if (null === e3) return Q4(b3), null;
57027
+ if (null === e3) return Q3(b3), null;
56966
57028
  d2 = 0 !== (b3.flags & 128);
56967
57029
  f3 = e3.rendering;
56968
57030
  if (null === f3) if (d2) Ag(e3, false);
@@ -56986,16 +57048,16 @@ var require_react_reconciler_production_min = __commonJS({
56986
57048
  }
56987
57049
  else {
56988
57050
  if (!d2) if (a2 = we3(f3), null !== a2) {
56989
- 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;
57051
+ 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;
56990
57052
  } else 2 * D3() - e3.renderingStartTime > Dg && 1073741824 !== c2 && (b3.flags |= 128, d2 = true, Ag(e3, false), b3.lanes = 4194304);
56991
57053
  e3.isBackwards ? (f3.sibling = b3.child, b3.child = f3) : (a2 = e3.last, null !== a2 ? a2.sibling = f3 : b3.child = f3, e3.last = f3);
56992
57054
  }
56993
57055
  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;
56994
- Q4(b3);
57056
+ Q3(b3);
56995
57057
  return null;
56996
57058
  case 22:
56997
57059
  case 23:
56998
- 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;
57060
+ 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;
56999
57061
  case 24:
57000
57062
  return null;
57001
57063
  case 25:
@@ -57012,9 +57074,9 @@ var require_react_reconciler_production_min = __commonJS({
57012
57074
  case 1:
57013
57075
  return A3(b3.type) && nc(), a2 = b3.flags, a2 & 65536 ? (b3.flags = a2 & -65537 | 128, b3) : null;
57014
57076
  case 3:
57015
- return te3(), q3(z55), q3(x4), ye3(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
57077
+ return te3(), q3(z58), q3(x4), ye3(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
57016
57078
  case 5:
57017
- return ve3(b3), null;
57079
+ return ve2(b3), null;
57018
57080
  case 13:
57019
57081
  q3(I2);
57020
57082
  a2 = b3.memoizedState;
@@ -58067,12 +58129,12 @@ var require_react_reconciler_production_min = __commonJS({
58067
58129
  break;
58068
58130
  case 3:
58069
58131
  te3();
58070
- q3(z55);
58132
+ q3(z58);
58071
58133
  q3(x4);
58072
58134
  ye3();
58073
58135
  break;
58074
58136
  case 5:
58075
- ve3(d2);
58137
+ ve2(d2);
58076
58138
  break;
58077
58139
  case 4:
58078
58140
  te3();
@@ -58544,7 +58606,7 @@ var require_react_reconciler_production_min = __commonJS({
58544
58606
  }
58545
58607
  var ai;
58546
58608
  ai = function(a2, b3, c2) {
58547
- if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z55.current) G3 = true;
58609
+ if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z58.current) G3 = true;
58548
58610
  else {
58549
58611
  if (0 === (a2.lanes & c2) && 0 === (b3.flags & 128)) return G3 = false, sg(a2, b3, c2);
58550
58612
  G3 = 0 !== (a2.flags & 131072) ? true : false;
@@ -58653,7 +58715,7 @@ var require_react_reconciler_production_min = __commonJS({
58653
58715
  g2 = e3.value;
58654
58716
  Vd(b3, d2, g2);
58655
58717
  if (null !== f3) if (Vc(f3.value, g2)) {
58656
- if (f3.children === e3.children && !z55.current) {
58718
+ if (f3.children === e3.children && !z58.current) {
58657
58719
  b3 = Tf(a2, b3, c2);
58658
58720
  break a;
58659
58721
  }
@@ -79286,11 +79348,11 @@ var init_devtools = __esm({
79286
79348
  devtools_stub_default.connectToDevTools();
79287
79349
  }
79288
79350
  });
79289
- var import_react_reconciler, import_constants23, diff, cleanupYogaNode, reconciler_default;
79351
+ var import_react_reconciler, import_constants28, diff, cleanupYogaNode, reconciler_default;
79290
79352
  var init_reconciler = __esm({
79291
79353
  async "../../node_modules/.pnpm/ink@5.2.1_@types+react@18.3.28_react@18.3.1/node_modules/ink/build/reconciler.js"() {
79292
79354
  import_react_reconciler = __toESM(require_react_reconciler());
79293
- import_constants23 = __toESM(require_constants3());
79355
+ import_constants28 = __toESM(require_constants3());
79294
79356
  await init_src();
79295
79357
  await init_dom();
79296
79358
  await init_styles();
@@ -79440,7 +79502,7 @@ $ npm install --save-dev react-devtools-core
79440
79502
  scheduleTimeout: setTimeout,
79441
79503
  cancelTimeout: clearTimeout,
79442
79504
  noTimeout: -1,
79443
- getCurrentEventPriority: () => import_constants23.DefaultEventPriority,
79505
+ getCurrentEventPriority: () => import_constants28.DefaultEventPriority,
79444
79506
  beforeActiveInstanceBlur() {
79445
79507
  },
79446
79508
  afterActiveInstanceBlur() {
@@ -83740,6 +83802,9 @@ function contextColor(pct2) {
83740
83802
  return Colors.busy;
83741
83803
  return void 0;
83742
83804
  }
83805
+ function badgeBackground(tone) {
83806
+ return tone === "attention" ? Colors.mode : Colors.chrome;
83807
+ }
83743
83808
  var Glyphs, Colors, Border;
83744
83809
  var init_theme = __esm({
83745
83810
  "../plugin-cli/dist/theme.js"() {
@@ -83869,6 +83934,11 @@ var init_SlashCommands = __esm({
83869
83934
  aliases: ["loop"]
83870
83935
  },
83871
83936
  { name: "mcp", description: "Enable / disable / remove MCP servers" },
83937
+ {
83938
+ name: "goal",
83939
+ description: "Work autonomously until the objective is delivered (switches mode + auto-approves; Esc stops)",
83940
+ argumentHint: "<objective>"
83941
+ },
83872
83942
  {
83873
83943
  name: "yolo",
83874
83944
  description: "Toggle auto-approve mode \u2014 every tool call allowed without asking",
@@ -84750,7 +84820,7 @@ function tokenizeInline(input) {
84750
84820
  return out;
84751
84821
  }
84752
84822
  function stripInline(s2) {
84753
- return s2.replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1");
84823
+ return s2.replace(/`([^`\n]+)`/g, "$1").replace(/\*\*([^*\n]+)\*\*/g, "$1").replace(/\*([^*\n]+)\*/g, "$1").replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, "$1");
84754
84824
  }
84755
84825
  var init_inline = __esm({
84756
84826
  "../chat-model/dist/markdown/inline.js"() {
@@ -85200,6 +85270,7 @@ function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
85200
85270
  markOrphansAtTurnBoundary();
85201
85271
  pendingLoadSkillCallId = null;
85202
85272
  continuationSkillEvent = null;
85273
+ suppressedCallIds.clear();
85203
85274
  root.push({ kind: "event", id: e3.id, event: e3 });
85204
85275
  continue;
85205
85276
  }
@@ -85285,6 +85356,8 @@ function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
85285
85356
  continuationSkillEvent = openScope.skillEvent;
85286
85357
  openScope.closed = true;
85287
85358
  openScope = null;
85359
+ } else {
85360
+ continuationSkillEvent = null;
85288
85361
  }
85289
85362
  root.push({ kind: "event", id: e3.id, event: e3 });
85290
85363
  continue;
@@ -85638,7 +85711,7 @@ var init_ModeFooter = __esm({
85638
85711
  });
85639
85712
 
85640
85713
  // ../plugin-cli/dist/components/StatusLine.js
85641
- var import_jsx_runtime21, import_react42, StatusLine, ProviderBadge, BusyMarker, CONTEXT_BAR_WIDTH, ContextMeter;
85714
+ var import_jsx_runtime21, import_react42, StatusLine, ProviderBadge, ModeBadgePill, BusyMarker, CONTEXT_BAR_WIDTH, ContextMeter;
85642
85715
  var init_StatusLine = __esm({
85643
85716
  async "../plugin-cli/dist/components/StatusLine.js"() {
85644
85717
  import_jsx_runtime21 = __toESM(require_jsx_runtime());
@@ -85648,14 +85721,21 @@ var init_StatusLine = __esm({
85648
85721
  init_theme();
85649
85722
  await init_Spinner();
85650
85723
  await init_ModeFooter();
85651
- StatusLine = ({ busyStartedAt, queueCount, modeName, provider, model, mcp, contextUsed, contextWindow }) => {
85724
+ StatusLine = ({ busyStartedAt, queueCount, modeName, modeBadge, provider, model, mcp, contextUsed, contextWindow }) => {
85652
85725
  const busy = busyStartedAt != null;
85653
85726
  const showQueue = (queueCount ?? 0) > 0;
85654
85727
  const showMcp = !!(mcp && mcp.enabled > 0);
85655
85728
  const showCtx = !!(contextWindow && contextWindow > 0);
85656
- return (0, import_jsx_runtime21.jsxs)(Box_default, { justifyContent: "space-between", children: [(0, import_jsx_runtime21.jsx)(Box_default, { children: busy ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(BusyMarker, { startedAt: busyStartedAt }), showQueue ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: " " }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: `${Glyphs.contextUp} ${queueCount} queued` })] }) : null] }) : (0, import_jsx_runtime21.jsx)(ModeFooter, { modeName }) }), (0, import_jsx_runtime21.jsxs)(Box_default, { children: [(0, import_jsx_runtime21.jsx)(ProviderBadge, { name: provider }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${model}` }), showMcp ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: "mcp " }), (0, import_jsx_runtime21.jsx)(Text, { children: `${mcp.connected}/${mcp.enabled}` })] }) : null, showCtx ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(ContextMeter, { used: contextUsed ?? 0, total: contextWindow })] }) : null] })] });
85729
+ const queuedTail = showQueue ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: " " }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: `${Glyphs.contextUp} ${queueCount} queued` })] }) : null;
85730
+ return (0, import_jsx_runtime21.jsxs)(Box_default, { justifyContent: "space-between", children: [(0, import_jsx_runtime21.jsx)(Box_default, { children: modeBadge ? (
85731
+ // Badged (autonomous) mode: the pill is pinned left at all times,
85732
+ // with the busy marker / idle hint trailing it — so the user always
85733
+ // sees the mode even mid-run, when a plain footer would be hidden.
85734
+ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(ModeBadgePill, { badge: modeBadge }), (0, import_jsx_runtime21.jsx)(Text, { children: " " }), busy ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime21.jsx)(Text, { color: Colors.chrome, dimColor: true, children: "Esc stops \xB7 shift+tab to change" })] })
85735
+ ) : busy ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(BusyMarker, { startedAt: busyStartedAt }), queuedTail] }) : (0, import_jsx_runtime21.jsx)(ModeFooter, { modeName }) }), (0, import_jsx_runtime21.jsxs)(Box_default, { children: [(0, import_jsx_runtime21.jsx)(ProviderBadge, { name: provider }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${model}` }), showMcp ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: "mcp " }), (0, import_jsx_runtime21.jsx)(Text, { children: `${mcp.connected}/${mcp.enabled}` })] }) : null, showCtx ? (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [(0, import_jsx_runtime21.jsx)(Text, { dimColor: true, children: ` ${Glyphs.midDot} ` }), (0, import_jsx_runtime21.jsx)(ContextMeter, { used: contextUsed ?? 0, total: contextWindow })] }) : null] })] });
85657
85736
  };
85658
85737
  ProviderBadge = ({ name }) => (0, import_jsx_runtime21.jsx)(Text, { backgroundColor: Colors.chrome, color: "black", bold: true, children: ` ${name} ` });
85738
+ ModeBadgePill = ({ badge }) => (0, import_jsx_runtime21.jsx)(Text, { backgroundColor: badgeBackground(badge.tone), color: "black", bold: true, children: ` ${badge.label} ` });
85659
85739
  BusyMarker = ({ startedAt }) => {
85660
85740
  const [now, setNow] = (0, import_react42.useState)(() => Date.now());
85661
85741
  (0, import_react42.useEffect)(() => {
@@ -85726,6 +85806,13 @@ function getModeName(session) {
85726
85806
  return "(none)";
85727
85807
  }
85728
85808
  }
85809
+ function getModeBadge(session) {
85810
+ try {
85811
+ return session.getInfo().activeModeBadge;
85812
+ } catch {
85813
+ return null;
85814
+ }
85815
+ }
85729
85816
  function formatTokensShort(n2) {
85730
85817
  if (n2 >= 1e6)
85731
85818
  return `${(n2 / 1e6).toFixed(1)}M`;
@@ -86602,6 +86689,8 @@ function runSlash2(cmd, deps) {
86602
86689
  case "/mode":
86603
86690
  case "/loop":
86604
86691
  return openModePicker(deps, args);
86692
+ case "/goal":
86693
+ return startGoal(deps, args);
86605
86694
  case "/yolo":
86606
86695
  case "/auto-approve":
86607
86696
  deps.setYolo((y2) => {
@@ -86703,6 +86792,25 @@ function openMcpPicker(deps) {
86703
86792
  }
86704
86793
  })();
86705
86794
  }
86795
+ function startGoal(deps, arg) {
86796
+ const objective = arg.trim();
86797
+ const GOAL_MODE = "goal";
86798
+ if (!deps.session.modes.list().some((m3) => m3.name === GOAL_MODE)) {
86799
+ deps.setSystemNotice("goal mode is not available (mode-goal plugin not loaded)");
86800
+ return;
86801
+ }
86802
+ try {
86803
+ deps.session.modes.setActive(GOAL_MODE);
86804
+ void savePreferences({ mode: GOAL_MODE });
86805
+ } catch (err) {
86806
+ deps.setSystemNotice(`failed to switch to goal mode: ${err instanceof Error ? err.message : String(err)}`);
86807
+ return;
86808
+ }
86809
+ deps.setYolo(() => true);
86810
+ 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).");
86811
+ if (objective)
86812
+ deps.submitPrompt(objective);
86813
+ }
86706
86814
  function openModePicker(deps, arg = "") {
86707
86815
  const modes = deps.session.modes.list();
86708
86816
  if (modes.length === 0) {
@@ -88101,6 +88209,7 @@ var init_SessionView = __esm({
88101
88209
  const contextWindow = resolveContextWindow(session, activeModel2);
88102
88210
  const contextUsed = estimateContextTokens(session.log);
88103
88211
  const modeName = getModeName(session);
88212
+ const modeBadge = getModeBadge(session);
88104
88213
  const cycleMode = import_react62.default.useCallback(() => {
88105
88214
  const modes = session.modes.list();
88106
88215
  if (modes.length === 0)
@@ -88176,7 +88285,18 @@ var init_SessionView = __esm({
88176
88285
  setPicker,
88177
88286
  queueRef: turn.queueRef,
88178
88287
  setQueueCount: turn.setQueueCount,
88179
- performSessionAction: performSessionAction2
88288
+ performSessionAction: performSessionAction2,
88289
+ // Start a turn directly (e.g. /goal kicking off autonomous work)
88290
+ // without clearing the just-set system notice. Objectives are plain
88291
+ // text, so no image-attachment resolution is needed.
88292
+ submitPrompt: (prompt) => {
88293
+ if (turn.busyRef.current) {
88294
+ turn.queueRef.current.push({ text: prompt, attachments: [] });
88295
+ turn.setQueueCount(turn.queueRef.current.length);
88296
+ return;
88297
+ }
88298
+ void turn.runTurnWith(prompt, []);
88299
+ }
88180
88300
  });
88181
88301
  return;
88182
88302
  }
@@ -88214,7 +88334,7 @@ var init_SessionView = __esm({
88214
88334
  const { resolve: resolve12 } = pendingApproval;
88215
88335
  permissions.setPendingApproval(null);
88216
88336
  resolve12(decision);
88217
- }, onPickerSelect: handlePickerSelect, onPickerCancel: () => setPicker(null), onSubmit: handleSubmit, onPasteText: images.handlePasteText }), (0, import_jsx_runtime34.jsx)(StatusLine, { busyStartedAt: turn.busy && !pendingPermission && !pendingApproval ? turn.busyStartedAt : null, queueCount: turn.queueCount, modeName, provider: providerName, model: activeModel2, mcp: mcpStatus, contextUsed, ...contextWindow ? { contextWindow } : {} })] });
88337
+ }, onPickerSelect: handlePickerSelect, onPickerCancel: () => setPicker(null), onSubmit: handleSubmit, onPasteText: images.handlePasteText }), (0, import_jsx_runtime34.jsx)(StatusLine, { busyStartedAt: turn.busy && !pendingPermission && !pendingApproval ? turn.busyStartedAt : null, queueCount: turn.queueCount, modeName, modeBadge, provider: providerName, model: activeModel2, mcp: mcpStatus, contextUsed, ...contextWindow ? { contextWindow } : {} })] });
88218
88338
  };
88219
88339
  }
88220
88340
  });
@@ -92006,6 +92126,7 @@ async function buildSession(args) {
92006
92126
  // scan, so pluginHost.reload() (install_plugin, self-update) rediscovers
92007
92127
  // and preserves runtime-installed / scaffolded plugins.
92008
92128
  pluginDiscoveryPaths: [userPluginsDir2, path3.join(userPluginsDir2, "node_modules")],
92129
+ ...args.secretResolver ? { secretResolver: args.secretResolver } : {},
92009
92130
  ...args.resumeSessionId ? { sessionId: args.resumeSessionId } : {},
92010
92131
  // Seed restored events directly into the log so subscribers don't
92011
92132
  // re-fire side effects for historical events. New appends from this
@@ -104179,15 +104300,14 @@ var CodexOAuthTranscriber = class {
104179
104300
  cause: err
104180
104301
  });
104181
104302
  }
104182
- const text = payload && typeof payload === "object" && typeof payload.text === "string" ? payload.text.trim() : "";
104183
- if (!text) {
104303
+ if (!payload || typeof payload !== "object" || typeof payload.text !== "string") {
104184
104304
  throw new MoxxyError({
104185
104305
  code: "PROVIDER_UNKNOWN_RESPONSE",
104186
- message: "Codex transcription returned an empty transcript.",
104306
+ message: "Codex transcription response was missing a text field.",
104187
104307
  context: { provider: CODEX_PROVIDER_ID, url: this.endpoint }
104188
104308
  });
104189
104309
  }
104190
- return { text };
104310
+ return { text: payload.text.trim() };
104191
104311
  }
104192
104312
  async loadTokens() {
104193
104313
  try {
@@ -104727,6 +104847,53 @@ function safeJson(v3, indent) {
104727
104847
  return String(v3);
104728
104848
  }
104729
104849
  }
104850
+ var MAX_SLEEP_MS = 3e5;
104851
+ function resolveSleepMs(input) {
104852
+ const requested = (input.seconds ?? 0) * 1e3 + (input.ms ?? 0);
104853
+ return Math.min(Math.round(requested), MAX_SLEEP_MS);
104854
+ }
104855
+ var sleepTool = defineTool({
104856
+ name: "Sleep",
104857
+ 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.",
104858
+ inputSchema: z$1.object({
104859
+ seconds: z$1.number().positive().optional().describe("Seconds to pause. Summed with `ms` when both are given."),
104860
+ ms: z$1.number().int().positive().optional().describe("Milliseconds to pause. Summed with `seconds` when both are given.")
104861
+ }).refine((v3) => v3.seconds !== void 0 || v3.ms !== void 0, {
104862
+ message: "Provide `seconds` and/or `ms`."
104863
+ }),
104864
+ // No side effects — safe to auto-allow without a permission prompt.
104865
+ permission: { action: "allow" },
104866
+ compact: {
104867
+ verb: "Sleeping",
104868
+ noun: { one: "pause", other: "pauses" }
104869
+ },
104870
+ isolation: {
104871
+ capabilities: {
104872
+ net: { mode: "none" },
104873
+ // Slightly above the cap so the isolator's own timeout never fires
104874
+ // before a max-length sleep resolves on its own.
104875
+ timeMs: MAX_SLEEP_MS + 1e3
104876
+ }
104877
+ },
104878
+ async handler(input, ctx) {
104879
+ const totalMs = resolveSleepMs(input);
104880
+ if (ctx.signal.aborted) {
104881
+ throw new MoxxyError({ code: "ABORTED", message: "Sleep aborted before start" });
104882
+ }
104883
+ await new Promise((resolve12, reject) => {
104884
+ const timer = setTimeout(() => {
104885
+ ctx.signal.removeEventListener("abort", onAbort);
104886
+ resolve12();
104887
+ }, totalMs);
104888
+ const onAbort = () => {
104889
+ clearTimeout(timer);
104890
+ reject(new MoxxyError({ code: "ABORTED", message: `Sleep interrupted after request for ${totalMs}ms` }));
104891
+ };
104892
+ ctx.signal.addEventListener("abort", onAbort, { once: true });
104893
+ });
104894
+ return `slept ${totalMs}ms`;
104895
+ }
104896
+ });
104730
104897
  var writeTool = defineTool({
104731
104898
  name: "Write",
104732
104899
  description: "Write a UTF-8 file to disk, creating parent directories as needed. Overwrites if exists.",
@@ -104765,7 +104932,8 @@ var builtinTools = [
104765
104932
  bashTool,
104766
104933
  grepTool,
104767
104934
  globTool,
104768
- recallTool
104935
+ recallTool,
104936
+ sleepTool
104769
104937
  ];
104770
104938
  var builtinToolsPlugin = definePlugin({
104771
104939
  name: "@moxxy/tools-builtin",
@@ -104879,6 +105047,7 @@ async function* runToolUseMode(ctx) {
104879
105047
  });
104880
105048
  }
104881
105049
  async function* emitRequestsAndDetectStuck(ctx, toolUses, detector) {
105050
+ const emitted = [];
104882
105051
  for (const t2 of toolUses) {
104883
105052
  yield await ctx.emit({
104884
105053
  type: "tool_call_requested",
@@ -104889,8 +105058,20 @@ async function* emitRequestsAndDetectStuck(ctx, toolUses, detector) {
104889
105058
  name: t2.name,
104890
105059
  input: t2.input
104891
105060
  });
105061
+ emitted.push(t2);
104892
105062
  const sig = detector.record(t2.name, t2.input);
104893
105063
  if (sig.stuck) {
105064
+ for (const r2 of emitted) {
105065
+ yield await ctx.emit({
105066
+ type: "tool_result",
105067
+ sessionId: ctx.sessionId,
105068
+ turnId: ctx.turnId,
105069
+ source: "tool",
105070
+ callId: asToolCallId(r2.id),
105071
+ ok: false,
105072
+ error: { kind: "aborted", message: "tool-use loop aborted (stuck pattern) before this call ran" }
105073
+ });
105074
+ }
104894
105075
  const how = sig.kind === "near" ? "against the same target (only volatile args like maxBytes varied)" : "with identical input";
104895
105076
  yield await ctx.emit({
104896
105077
  type: "error",
@@ -106461,6 +106642,442 @@ var developerModePlugin = definePlugin({
106461
106642
  version: "0.0.0",
106462
106643
  modes: [developerMode]
106463
106644
  });
106645
+ var GOAL_MODE_NAME = "goal";
106646
+ var GOAL_PLUGIN_ID = asPluginId("@moxxy/mode-goal");
106647
+ var GOAL_COMPLETE_TOOL = "goal_complete";
106648
+ var GOAL_ABANDON_TOOL = "goal_abandon";
106649
+ var GOAL_MAX_ITERATIONS = 150;
106650
+ var GOAL_MAX_NOOP_ITERATIONS = 3;
106651
+ var GOAL_TOKEN_BUDGET = 4e6;
106652
+ 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.
106653
+
106654
+ How goal mode ends \u2014 this is the most important rule:
106655
+ - 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.
106656
+ - 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).
106657
+ - 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.
106658
+
106659
+ While working:
106660
+ - 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.
106661
+ - Verify your work as you go (run the project's tests / build / linter when relevant) before declaring the goal complete.
106662
+ - 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.
106663
+ - Don't repeat the same failing action. If an approach isn't working, change it; if nothing works, abandon with a clear explanation.
106664
+ - Don't declare the goal complete prematurely. "I think this should work" is not done \u2014 verify first.`;
106665
+ 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.`;
106666
+ 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.`;
106667
+ var goalCompleteTool = defineTool({
106668
+ name: GOAL_COMPLETE_TOOL,
106669
+ 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.",
106670
+ inputSchema: z.object({
106671
+ summary: z.string().min(1).describe("One- or two-sentence summary of what was accomplished."),
106672
+ evidence: z.array(z.string()).optional().describe("Concrete proof the goal is met: commands run and their results, files changed, tests passed.")
106673
+ }),
106674
+ permission: { action: "allow" },
106675
+ handler: (input) => {
106676
+ const { summary, evidence } = input;
106677
+ return {
106678
+ acknowledged: true,
106679
+ summary,
106680
+ evidenceCount: evidence?.length ?? 0
106681
+ };
106682
+ }
106683
+ });
106684
+ var goalAbandonTool = defineTool({
106685
+ name: GOAL_ABANDON_TOOL,
106686
+ 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.",
106687
+ inputSchema: z.object({
106688
+ reason: z.string().min(1).describe("Why you cannot proceed."),
106689
+ needsFromUser: z.string().optional().describe("What the user must provide or decide for the goal to continue.")
106690
+ }),
106691
+ permission: { action: "allow" },
106692
+ handler: (input) => {
106693
+ const { reason, needsFromUser } = input;
106694
+ return { acknowledged: true, reason, ...needsFromUser ? { needsFromUser } : {} };
106695
+ }
106696
+ });
106697
+ var goalTools = [goalCompleteTool, goalAbandonTool];
106698
+
106699
+ // ../mode-goal/dist/completion.js
106700
+ function detectGoalTerminal(log, batch) {
106701
+ const goalCalls = /* @__PURE__ */ new Map();
106702
+ for (const t2 of batch) {
106703
+ if (t2.name === GOAL_COMPLETE_TOOL || t2.name === GOAL_ABANDON_TOOL)
106704
+ goalCalls.set(t2.id, t2);
106705
+ }
106706
+ if (goalCalls.size === 0)
106707
+ return null;
106708
+ for (let i2 = log.length - 1; i2 >= 0; i2--) {
106709
+ const e3 = log[i2];
106710
+ if (!e3 || e3.type !== "tool_result" || !e3.ok)
106711
+ continue;
106712
+ const call = goalCalls.get(String(e3.callId));
106713
+ if (!call)
106714
+ continue;
106715
+ const input = call.input ?? {};
106716
+ if (call.name === GOAL_COMPLETE_TOOL) {
106717
+ return {
106718
+ kind: "complete",
106719
+ summary: typeof input.summary === "string" ? input.summary : "Goal completed.",
106720
+ evidence: Array.isArray(input.evidence) ? input.evidence : []
106721
+ };
106722
+ }
106723
+ return {
106724
+ kind: "abandon",
106725
+ reason: typeof input.reason === "string" ? input.reason : "Goal abandoned.",
106726
+ ...typeof input.needsFromUser === "string" ? { needsFromUser: input.needsFromUser } : {}
106727
+ };
106728
+ }
106729
+ return null;
106730
+ }
106731
+
106732
+ // ../mode-goal/dist/goal-loop.js
106733
+ async function* runGoalMode(ctx) {
106734
+ if (ctx.signal.aborted) {
106735
+ yield await ctx.emit({
106736
+ type: "abort",
106737
+ sessionId: ctx.sessionId,
106738
+ turnId: ctx.turnId,
106739
+ source: "system",
106740
+ reason: "aborted before goal mode start"
106741
+ });
106742
+ return;
106743
+ }
106744
+ const autoApprove = {
106745
+ name: "goal-auto-approve",
106746
+ check: async () => ({ mode: "allow", reason: "goal mode runs tools unattended (auto-approve)" })
106747
+ };
106748
+ const goalCtx = {
106749
+ ...ctx,
106750
+ systemPrompt: composeSystemPrompts2(ctx.systemPrompt, GOAL_SYSTEM_PROMPT),
106751
+ permissions: autoApprove
106752
+ };
106753
+ yield await ctx.emit({
106754
+ type: "plugin_event",
106755
+ sessionId: ctx.sessionId,
106756
+ turnId: ctx.turnId,
106757
+ source: "plugin",
106758
+ pluginId: GOAL_PLUGIN_ID,
106759
+ subtype: "goal_started",
106760
+ payload: { autoApprove: true, maxIterations: ctx.maxIterations ?? GOAL_MAX_ITERATIONS }
106761
+ });
106762
+ const detector = createStuckLoopDetector();
106763
+ const maxIterations = ctx.maxIterations ?? GOAL_MAX_ITERATIONS;
106764
+ let noop3 = 0;
106765
+ let totalTokens = 0;
106766
+ let reactiveCompactions = 0;
106767
+ const MAX_REACTIVE_COMPACTIONS = 2;
106768
+ for (let iteration = 1; iteration <= maxIterations; iteration++) {
106769
+ if (ctx.signal.aborted) {
106770
+ yield await ctx.emit({
106771
+ type: "abort",
106772
+ sessionId: ctx.sessionId,
106773
+ turnId: ctx.turnId,
106774
+ source: "system",
106775
+ reason: "signal aborted"
106776
+ });
106777
+ return;
106778
+ }
106779
+ yield await ctx.emit({
106780
+ type: "mode_iteration",
106781
+ sessionId: ctx.sessionId,
106782
+ turnId: ctx.turnId,
106783
+ source: "system",
106784
+ strategy: GOAL_MODE_NAME,
106785
+ iteration
106786
+ });
106787
+ await runCompactionIfNeeded(goalCtx);
106788
+ await runElisionIfNeeded(goalCtx);
106789
+ const nudge = noop3 === 0 ? void 0 : noop3 >= GOAL_MAX_NOOP_ITERATIONS - 1 ? STALL_NUDGE : CONTINUE_NUDGE;
106790
+ const baseSystem = buildSystemPromptWithSkills(goalCtx.systemPrompt, goalCtx.skills.list()) ?? "";
106791
+ const { messages, stablePrefixIndex } = projectMessages(goalCtx, {
106792
+ ...baseSystem ? { systemPrompt: baseSystem } : {},
106793
+ ...nudge ? { trailingUserText: nudge } : {}
106794
+ });
106795
+ yield await ctx.emit({
106796
+ type: "provider_request",
106797
+ sessionId: ctx.sessionId,
106798
+ turnId: ctx.turnId,
106799
+ source: "system",
106800
+ provider: goalCtx.provider.name,
106801
+ model: goalCtx.model
106802
+ });
106803
+ const { text, toolUses, stopReason, error: error2, usage } = await collectProviderStream(goalCtx, messages, { iteration, stablePrefixIndex });
106804
+ yield await ctx.emit({
106805
+ type: "provider_response",
106806
+ sessionId: ctx.sessionId,
106807
+ turnId: ctx.turnId,
106808
+ source: "system",
106809
+ provider: goalCtx.provider.name,
106810
+ model: goalCtx.model,
106811
+ ...usageEventFields(usage)
106812
+ });
106813
+ if (usage)
106814
+ totalTokens += (usage.inputTokens ?? 0) + (usage.outputTokens ?? 0);
106815
+ if (error2) {
106816
+ if (isContextOverflowError(error2.message) && reactiveCompactions < MAX_REACTIVE_COMPACTIONS) {
106817
+ reactiveCompactions += 1;
106818
+ const compacted = await runCompactionIfNeeded(goalCtx, { force: true });
106819
+ if (compacted) {
106820
+ yield await ctx.emit({
106821
+ type: "error",
106822
+ sessionId: ctx.sessionId,
106823
+ turnId: ctx.turnId,
106824
+ source: "system",
106825
+ kind: "retryable",
106826
+ message: "context window exceeded \u2014 compacted older turns, retrying"
106827
+ });
106828
+ continue;
106829
+ }
106830
+ }
106831
+ yield await ctx.emit({
106832
+ type: "error",
106833
+ sessionId: ctx.sessionId,
106834
+ turnId: ctx.turnId,
106835
+ source: "system",
106836
+ kind: error2.retryable ? "retryable" : "fatal",
106837
+ message: `goal: ${error2.message}`
106838
+ });
106839
+ if (!error2.retryable)
106840
+ return;
106841
+ continue;
106842
+ }
106843
+ reactiveCompactions = 0;
106844
+ if (totalTokens > GOAL_TOKEN_BUDGET) {
106845
+ yield await ctx.emit({
106846
+ type: "plugin_event",
106847
+ sessionId: ctx.sessionId,
106848
+ turnId: ctx.turnId,
106849
+ source: "plugin",
106850
+ pluginId: GOAL_PLUGIN_ID,
106851
+ subtype: "goal_budget_exhausted",
106852
+ payload: { totalTokens, budget: GOAL_TOKEN_BUDGET, iteration }
106853
+ });
106854
+ yield await ctx.emit({
106855
+ type: "assistant_message",
106856
+ sessionId: ctx.sessionId,
106857
+ turnId: ctx.turnId,
106858
+ source: "system",
106859
+ 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.`,
106860
+ stopReason: "end_turn"
106861
+ });
106862
+ return;
106863
+ }
106864
+ const stuck = yield* emitRequestsAndDetectStuck2(ctx, toolUses, detector);
106865
+ if (stuck)
106866
+ return;
106867
+ if (text || stopReason === "end_turn" || toolUses.length === 0) {
106868
+ yield await ctx.emit({
106869
+ type: "assistant_message",
106870
+ sessionId: ctx.sessionId,
106871
+ turnId: ctx.turnId,
106872
+ source: "model",
106873
+ content: text,
106874
+ stopReason
106875
+ });
106876
+ }
106877
+ if (toolUses.length === 0) {
106878
+ noop3 += 1;
106879
+ if (noop3 >= GOAL_MAX_NOOP_ITERATIONS) {
106880
+ yield await ctx.emit({
106881
+ type: "plugin_event",
106882
+ sessionId: ctx.sessionId,
106883
+ turnId: ctx.turnId,
106884
+ source: "plugin",
106885
+ pluginId: GOAL_PLUGIN_ID,
106886
+ subtype: "goal_stalled",
106887
+ payload: { idleIterations: noop3, iteration }
106888
+ });
106889
+ yield await ctx.emit({
106890
+ type: "assistant_message",
106891
+ sessionId: ctx.sessionId,
106892
+ turnId: ctx.turnId,
106893
+ source: "system",
106894
+ 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.",
106895
+ stopReason: "end_turn"
106896
+ });
106897
+ return;
106898
+ }
106899
+ continue;
106900
+ }
106901
+ noop3 = 0;
106902
+ const exited = yield* executeToolUses2(goalCtx, toolUses, iteration);
106903
+ if (exited)
106904
+ return;
106905
+ const terminal = detectGoalTerminal(ctx.log.slice(), toolUses);
106906
+ if (terminal?.kind === "complete") {
106907
+ yield await ctx.emit({
106908
+ type: "plugin_event",
106909
+ sessionId: ctx.sessionId,
106910
+ turnId: ctx.turnId,
106911
+ source: "plugin",
106912
+ pluginId: GOAL_PLUGIN_ID,
106913
+ subtype: "goal_completed",
106914
+ payload: { summary: terminal.summary, evidenceCount: terminal.evidence.length, iterations: iteration }
106915
+ });
106916
+ const evidenceBlock = terminal.evidence.length > 0 ? `
106917
+
106918
+ ${terminal.evidence.map((e3) => `- ${e3}`).join("\n")}` : "";
106919
+ yield await ctx.emit({
106920
+ type: "assistant_message",
106921
+ sessionId: ctx.sessionId,
106922
+ turnId: ctx.turnId,
106923
+ source: "system",
106924
+ content: `\u2713 Goal complete \u2014 ${terminal.summary}${evidenceBlock}`,
106925
+ stopReason: "end_turn"
106926
+ });
106927
+ return;
106928
+ }
106929
+ if (terminal?.kind === "abandon") {
106930
+ yield await ctx.emit({
106931
+ type: "plugin_event",
106932
+ sessionId: ctx.sessionId,
106933
+ turnId: ctx.turnId,
106934
+ source: "plugin",
106935
+ pluginId: GOAL_PLUGIN_ID,
106936
+ subtype: "goal_abandoned",
106937
+ payload: { reason: terminal.reason, ...terminal.needsFromUser ? { needsFromUser: terminal.needsFromUser } : {}, iterations: iteration }
106938
+ });
106939
+ const needs = terminal.needsFromUser ? `
106940
+
106941
+ Needs from you: ${terminal.needsFromUser}` : "";
106942
+ yield await ctx.emit({
106943
+ type: "assistant_message",
106944
+ sessionId: ctx.sessionId,
106945
+ turnId: ctx.turnId,
106946
+ source: "system",
106947
+ content: `Goal abandoned \u2014 ${terminal.reason}${needs}`,
106948
+ stopReason: "end_turn"
106949
+ });
106950
+ return;
106951
+ }
106952
+ }
106953
+ yield await ctx.emit({
106954
+ type: "plugin_event",
106955
+ sessionId: ctx.sessionId,
106956
+ turnId: ctx.turnId,
106957
+ source: "plugin",
106958
+ pluginId: GOAL_PLUGIN_ID,
106959
+ subtype: "goal_max_iterations",
106960
+ payload: { maxIterations }
106961
+ });
106962
+ yield await ctx.emit({
106963
+ type: "error",
106964
+ sessionId: ctx.sessionId,
106965
+ turnId: ctx.turnId,
106966
+ source: "system",
106967
+ kind: "fatal",
106968
+ message: `goal mode reached the iteration cap (${maxIterations}) without calling goal_complete. Stopping to avoid an unbounded run; send another message to continue.`
106969
+ });
106970
+ }
106971
+ function composeSystemPrompts2(user, layer) {
106972
+ if (!user || user.trim() === "")
106973
+ return layer;
106974
+ return `${layer}
106975
+
106976
+ ---
106977
+
106978
+ ${user}`;
106979
+ }
106980
+ async function* emitRequestsAndDetectStuck2(ctx, toolUses, detector) {
106981
+ const emitted = [];
106982
+ for (const t2 of toolUses) {
106983
+ yield await ctx.emit({
106984
+ type: "tool_call_requested",
106985
+ sessionId: ctx.sessionId,
106986
+ turnId: ctx.turnId,
106987
+ source: "model",
106988
+ callId: asToolCallId(t2.id),
106989
+ name: t2.name,
106990
+ input: t2.input
106991
+ });
106992
+ emitted.push(t2);
106993
+ const sig = detector.record(t2.name, t2.input);
106994
+ if (sig.stuck) {
106995
+ for (const r2 of emitted) {
106996
+ yield await ctx.emit({
106997
+ type: "tool_result",
106998
+ sessionId: ctx.sessionId,
106999
+ turnId: ctx.turnId,
107000
+ source: "tool",
107001
+ callId: asToolCallId(r2.id),
107002
+ ok: false,
107003
+ error: { kind: "aborted", message: "goal mode aborted (stuck pattern) before this call ran" }
107004
+ });
107005
+ }
107006
+ const how = sig.kind === "near" ? "against the same target (only volatile args varied)" : "with identical input";
107007
+ yield await ctx.emit({
107008
+ type: "plugin_event",
107009
+ sessionId: ctx.sessionId,
107010
+ turnId: ctx.turnId,
107011
+ source: "plugin",
107012
+ pluginId: GOAL_PLUGIN_ID,
107013
+ subtype: "goal_stuck",
107014
+ payload: { tool: t2.name, count: sig.count, kind: sig.kind }
107015
+ });
107016
+ yield await ctx.emit({
107017
+ type: "error",
107018
+ sessionId: ctx.sessionId,
107019
+ turnId: ctx.turnId,
107020
+ source: "system",
107021
+ kind: "fatal",
107022
+ 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.`
107023
+ });
107024
+ return true;
107025
+ }
107026
+ }
107027
+ return false;
107028
+ }
107029
+ async function* executeToolUses2(ctx, toolUses, iteration) {
107030
+ const unresolved = new Set(toolUses.map((t2) => t2.id));
107031
+ for (const t2 of toolUses) {
107032
+ if (ctx.signal.aborted) {
107033
+ for (const orphanId of unresolved) {
107034
+ yield await ctx.emit({
107035
+ type: "tool_result",
107036
+ sessionId: ctx.sessionId,
107037
+ turnId: ctx.turnId,
107038
+ source: "tool",
107039
+ callId: asToolCallId(orphanId),
107040
+ ok: false,
107041
+ error: { kind: "aborted", message: "turn aborted before tool ran" }
107042
+ });
107043
+ }
107044
+ unresolved.clear();
107045
+ yield await ctx.emit({
107046
+ type: "abort",
107047
+ sessionId: ctx.sessionId,
107048
+ turnId: ctx.turnId,
107049
+ source: "system",
107050
+ reason: "signal aborted during tool execution"
107051
+ });
107052
+ return true;
107053
+ }
107054
+ try {
107055
+ yield* dispatchToolCall(ctx, t2, iteration);
107056
+ } finally {
107057
+ unresolved.delete(t2.id);
107058
+ }
107059
+ }
107060
+ return false;
107061
+ }
107062
+
107063
+ // ../mode-goal/dist/index.js
107064
+ var goalMode = defineMode({
107065
+ name: GOAL_MODE_NAME,
107066
+ description: "Autonomous goal loop: works across many turns until it calls goal_complete (tools auto-approved)",
107067
+ // Goal mode auto-approves tools and keeps working unattended, so channels
107068
+ // surface a persistent accent badge while it's active — the user must always
107069
+ // know the agent is driving itself.
107070
+ badge: { label: "GOAL", tone: "attention" },
107071
+ run: runGoalMode
107072
+ });
107073
+ var goalModePlugin = definePlugin({
107074
+ name: "@moxxy/mode-goal",
107075
+ version: "0.0.0",
107076
+ // The mode AND its control tools ship together: the loop watches for the
107077
+ // tools' results to terminate, so they're useless apart.
107078
+ modes: [goalMode],
107079
+ tools: goalTools
107080
+ });
106464
107081
  var DEEP_RESEARCH_MODE_NAME = "deep-research";
106465
107082
  var DEEP_RESEARCH_PLUGIN_ID = asPluginId("@moxxy/mode-deep-research");
106466
107083
  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.
@@ -109120,7 +109737,7 @@ function C2(r2, t2) {
109120
109737
  for (const s2 of r2) if (s2 !== void 0 && C2(s2, t2)) return true;
109121
109738
  return false;
109122
109739
  }
109123
- function z19(r2, t2) {
109740
+ function z21(r2, t2) {
109124
109741
  if (r2 === t2) return;
109125
109742
  const s2 = r2.split(`
109126
109743
  `), e3 = t2.split(`
@@ -109260,7 +109877,7 @@ var m2 = class {
109260
109877
  if (t2 !== this._prevFrame) {
109261
109878
  if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
109262
109879
  else {
109263
- const s2 = z19(this._prevFrame, t2), e3 = L2(this.output);
109880
+ const s2 = z21(this._prevFrame, t2), e3 = L2(this.output);
109264
109881
  if (this.restoreCursor(), s2) {
109265
109882
  const i2 = Math.max(0, s2.numLinesAfter - e3), n2 = Math.max(0, s2.numLinesBefore - e3);
109266
109883
  let o2 = s2.lines.find((u2) => u2 >= i2);
@@ -109311,52 +109928,6 @@ var X2 = class extends m2 {
109311
109928
  });
109312
109929
  }
109313
109930
  };
109314
- var nt2 = class extends m2 {
109315
- options;
109316
- cursor = 0;
109317
- get _value() {
109318
- return this.options[this.cursor].value;
109319
- }
109320
- get _enabledOptions() {
109321
- return this.options.filter((t2) => t2.disabled !== true);
109322
- }
109323
- toggleAll() {
109324
- const t2 = this._enabledOptions, s2 = this.value !== void 0 && this.value.length === t2.length;
109325
- this.value = s2 ? [] : t2.map((e3) => e3.value);
109326
- }
109327
- toggleInvert() {
109328
- const t2 = this.value;
109329
- if (!t2) return;
109330
- const s2 = this._enabledOptions.filter((e3) => !t2.includes(e3.value));
109331
- this.value = s2.map((e3) => e3.value);
109332
- }
109333
- toggleValue() {
109334
- this.value === void 0 && (this.value = []);
109335
- const t2 = this.value.includes(this._value);
109336
- this.value = t2 ? this.value.filter((s2) => s2 !== this._value) : [...this.value, this._value];
109337
- }
109338
- constructor(t2) {
109339
- super(t2, false), this.options = t2.options, this.value = [...t2.initialValues ?? []];
109340
- const s2 = Math.max(this.options.findIndex(({ value: e3 }) => e3 === t2.cursorAt), 0);
109341
- this.cursor = this.options[s2].disabled ? f2(s2, 1, this.options) : s2, this.on("key", (e3) => {
109342
- e3 === "a" && this.toggleAll(), e3 === "i" && this.toggleInvert();
109343
- }), this.on("cursor", (e3) => {
109344
- switch (e3) {
109345
- case "left":
109346
- case "up":
109347
- this.cursor = f2(this.cursor, -1, this.options);
109348
- break;
109349
- case "down":
109350
- case "right":
109351
- this.cursor = f2(this.cursor, 1, this.options);
109352
- break;
109353
- case "space":
109354
- this.toggleValue();
109355
- break;
109356
- }
109357
- });
109358
- }
109359
- };
109360
109931
  var ot2 = class extends m2 {
109361
109932
  _mask = "\u2022";
109362
109933
  get cursor() {
@@ -109441,11 +110012,8 @@ var H2 = w3("\u25C7", "o");
109441
110012
  var lt2 = w3("\u250C", "T");
109442
110013
  var $2 = w3("\u2502", "|");
109443
110014
  var x3 = w3("\u2514", "\u2014");
109444
- var z20 = w3("\u25CF", ">");
110015
+ var z22 = w3("\u25CF", ">");
109445
110016
  var U2 = w3("\u25CB", " ");
109446
- var et3 = w3("\u25FB", "[\u2022]");
109447
- var K3 = w3("\u25FC", "[+]");
109448
- var Y3 = w3("\u25FB", "[ ]");
109449
110017
  var Et2 = w3("\u25AA", "\u2022");
109450
110018
  var st2 = w3("\u2500", "-");
109451
110019
  var ct2 = w3("\u256E", "+");
@@ -109531,9 +110099,9 @@ ${styleText("gray", $2)}` : ""}`;
109531
110099
  }
109532
110100
  default: {
109533
110101
  const l2 = r2 ? `${styleText("cyan", $2)} ` : "", d2 = r2 ? styleText("cyan", x3) : "";
109534
- return `${c2}${l2}${this.value ? `${styleText("green", z20)} ${i2}` : `${styleText("dim", U2)} ${styleText("dim", i2)}`}${t2.vertical ? r2 ? `
110102
+ return `${c2}${l2}${this.value ? `${styleText("green", z22)} ${i2}` : `${styleText("dim", U2)} ${styleText("dim", i2)}`}${t2.vertical ? r2 ? `
109535
110103
  ${styleText("cyan", $2)} ` : `
109536
- ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U2)} ${styleText("dim", s2)}` : `${styleText("green", z20)} ${s2}`}
110104
+ ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U2)} ${styleText("dim", s2)}` : `${styleText("green", z22)} ${s2}`}
109537
110105
  ${d2}
109538
110106
  `;
109539
110107
  }
@@ -109584,59 +110152,6 @@ ${styleText("gray", x3)} ` ;
109584
110152
 
109585
110153
  `);
109586
110154
  };
109587
- var Q3 = (t2, i2) => t2.split(`
109588
- `).map((s2) => i2(s2)).join(`
109589
- `);
109590
- var ve2 = (t2) => {
109591
- const i2 = (r2, u2) => {
109592
- const n2 = r2.label ?? String(r2.value);
109593
- 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))}`;
109594
- }, s2 = t2.required ?? true;
109595
- 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) {
109596
- if (s2 && (r2 === void 0 || r2.length === 0)) return `Please select at least one option.
109597
- ${styleText("reset", styleText("dim", `Press ${styleText(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
109598
- }, render() {
109599
- const r2 = t2.withGuide ?? h2.withGuide, u2 = W2(t2.output, t2.message, r2 ? `${yt2(this.state)} ` : "", `${P2(this.state)} `), n2 = `${r2 ? `${styleText("gray", $2)}
109600
- ` : ""}${u2}
109601
- `, a2 = this.value ?? [], c2 = (o2, l2) => {
109602
- if (o2.disabled) return i2(o2, "disabled");
109603
- const d2 = a2.includes(o2.value);
109604
- return l2 && d2 ? i2(o2, "active-selected") : d2 ? i2(o2, "selected") : i2(o2, l2 ? "active" : "inactive");
109605
- };
109606
- switch (this.state) {
109607
- case "submit": {
109608
- 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)} ` : "");
109609
- return `${n2}${l2}`;
109610
- }
109611
- case "cancel": {
109612
- const o2 = this.options.filter(({ value: d2 }) => a2.includes(d2)).map((d2) => i2(d2, "cancelled")).join(styleText("dim", ", "));
109613
- if (o2.trim() === "") return `${n2}${styleText("gray", $2)}`;
109614
- const l2 = W2(t2.output, o2, r2 ? `${styleText("gray", $2)} ` : "");
109615
- return `${n2}${l2}${r2 ? `
109616
- ${styleText("gray", $2)}` : ""}`;
109617
- }
109618
- case "error": {
109619
- const o2 = r2 ? `${styleText("yellow", $2)} ` : "", l2 = this.error.split(`
109620
- `).map((p3, f3) => f3 === 0 ? `${r2 ? `${styleText("yellow", x3)} ` : ""}${styleText("yellow", p3)}` : ` ${p3}`).join(`
109621
- `), d2 = n2.split(`
109622
- `).length, g2 = l2.split(`
109623
- `).length + 1;
109624
- 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(`
109625
- ${o2}`)}
109626
- ${l2}
109627
- `;
109628
- }
109629
- default: {
109630
- const o2 = r2 ? `${styleText("cyan", $2)} ` : "", l2 = n2.split(`
109631
- `).length, d2 = r2 ? 2 : 1;
109632
- 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(`
109633
- ${o2}`)}
109634
- ${r2 ? styleText("cyan", x3) : ""}
109635
- `;
109636
- }
109637
- }
109638
- } }).prompt();
109639
- };
109640
110155
  var we2 = (t2) => styleText("dim", t2);
109641
110156
  var be2 = (t2, i2, s2) => {
109642
110157
  const r2 = { hard: true, trim: false }, u2 = wrapAnsi(t2, i2, r2).split(`
@@ -109751,7 +110266,7 @@ var xe2 = (t2) => {
109751
110266
  case "selected":
109752
110267
  return `${it3(u2, (n2) => styleText("dim", n2))}`;
109753
110268
  case "active":
109754
- return `${styleText("green", z20)} ${u2}${s2.hint ? ` ${styleText("dim", `(${s2.hint})`)}` : ""}`;
110269
+ return `${styleText("green", z22)} ${u2}${s2.hint ? ` ${styleText("dim", `(${s2.hint})`)}` : ""}`;
109755
110270
  case "cancelled":
109756
110271
  return `${it3(u2, (n2) => styleText(["strikethrough", "dim"], n2))}`;
109757
110272
  default:
@@ -111799,6 +112314,15 @@ async function installPluginPackage(opts) {
111799
112314
  }
111800
112315
  return { installed: opts.packageName, dir };
111801
112316
  }
112317
+ async function removePluginPackage(opts) {
112318
+ const dir = userPluginsDir();
112319
+ await ensurePackageJson(dir);
112320
+ const { exitCode, stderr } = await runNpm(["uninstall", "--prefix", dir, "--no-fund", "--no-audit", "--save", opts.packageName], opts.signal);
112321
+ if (exitCode !== 0) {
112322
+ throw new Error(`npm uninstall failed (exit ${exitCode}): ${truncate9(stderr, 400)}`);
112323
+ }
112324
+ return { removed: opts.packageName, dir };
112325
+ }
111802
112326
  function buildInstallPluginTool(deps) {
111803
112327
  return defineTool({
111804
112328
  name: "install_plugin",
@@ -111838,6 +112362,36 @@ function buildInstallPluginTool(deps) {
111838
112362
  }
111839
112363
  });
111840
112364
  }
112365
+ function buildUninstallPluginTool(deps) {
112366
+ return defineTool({
112367
+ name: "uninstall_plugin",
112368
+ 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.",
112369
+ inputSchema: z$1.object({
112370
+ packageName: z$1.string().min(1).refine((s2) => NPM_NAME_RE.test(s2), {
112371
+ message: "must be a valid npm package name (e.g. @moxxy/agent-researcher)"
112372
+ }).describe("npm package name to uninstall. Scoped (@org/pkg) or bare.")
112373
+ }),
112374
+ permission: { action: "prompt" },
112375
+ isolation: {
112376
+ capabilities: {
112377
+ subprocess: true,
112378
+ commands: ["npm"],
112379
+ fs: { read: ["$cwd/**"], write: [`${userPluginsDir()}/**`] }
112380
+ }
112381
+ },
112382
+ handler: async ({ packageName }, ctx) => {
112383
+ const before = deps.snapshot();
112384
+ const { removed } = await removePluginPackage({ packageName, signal: ctx.signal });
112385
+ await deps.reload();
112386
+ const after = deps.snapshot();
112387
+ return {
112388
+ removed,
112389
+ // before-minus-after == contributions the removed package had provided.
112390
+ unregistered: diffSnapshot2(after, before)
112391
+ };
112392
+ }
112393
+ });
112394
+ }
111841
112395
  async function ensurePackageJson(dir) {
111842
112396
  const pkgPath = path3.join(dir, "package.json");
111843
112397
  try {
@@ -111904,7 +112458,7 @@ function buildPluginsAdminPlugin(opts) {
111904
112458
  return definePlugin({
111905
112459
  name: "@moxxy/plugin-plugins-admin",
111906
112460
  version: "0.0.0",
111907
- tools: [buildInstallPluginTool(deps)]
112461
+ tools: [buildInstallPluginTool(deps), buildUninstallPluginTool(deps)]
111908
112462
  });
111909
112463
  }
111910
112464
  function buildProviderDef(entry) {
@@ -117720,6 +118274,7 @@ function buildBuiltinsCore(args) {
117720
118274
  { name: "@moxxy/mode-plan-execute", plugin: planExecuteModePlugin },
117721
118275
  { name: "@moxxy/mode-bmad", plugin: bmadModePlugin },
117722
118276
  { name: "@moxxy/mode-developer", plugin: developerModePlugin },
118277
+ { name: "@moxxy/mode-goal", plugin: goalModePlugin },
117723
118278
  { name: "@moxxy/mode-deep-research", plugin: deepResearchModePlugin },
117724
118279
  { name: "@moxxy/compactor-summarize", plugin: summarizeCompactorPlugin },
117725
118280
  { name: "@moxxy/cache-strategy-stable-prefix", plugin: stablePrefixCacheStrategyPlugin },
@@ -117861,12 +118416,69 @@ function buildBuiltinsCore(args) {
117861
118416
  // options.allowCoreUpdate = false to hide the self_update_core_* tools.
117862
118417
  // options.repoUrl overrides the git source (needed if @moxxy/core's
117863
118418
  // published package.json lacks a `repository` field).
118419
+ //
118420
+ // MOXXY_NO_CORE_UPDATE=1 hard-disables Tier-2 regardless of config —
118421
+ // the desktop sets this on the runner spawn because core patches
118422
+ // (git clone + build + dist overlay + restart) can't work inside a
118423
+ // read-only, packaged .app and would only confuse the model.
117864
118424
  coreUpdate: {
117865
- enabled: rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.allowCoreUpdate !== false,
118425
+ enabled: process.env.MOXXY_NO_CORE_UPDATE !== "1" && rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.allowCoreUpdate !== false,
117866
118426
  ...typeof rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.repoUrl === "string" ? { repoUrlOverride: rawConfig.plugins["@moxxy/plugin-self-update"].options.repoUrl } : {}
117867
118427
  }
117868
118428
  })
117869
118429
  },
118430
+ // Voice/TTS control — lets the agent switch which text-to-speech backend
118431
+ // read-aloud surfaces (the desktop's speaker button) use, without a
118432
+ // settings UI. `set_voice` activates a registered synthesizer by name, or
118433
+ // 'system' to deactivate (fall back to the OS voice). `list_voices` reports
118434
+ // what's available + which is active. A synthesizer authored via
118435
+ // self-update auto-activates on load, so this is for switching afterwards.
118436
+ {
118437
+ name: "@moxxy/voice-admin",
118438
+ plugin: (() => {
118439
+ const voiceNames = () => [
118440
+ "system",
118441
+ ...session.synthesizers.list().map((s2) => s2.name)
118442
+ ];
118443
+ return definePlugin({
118444
+ name: "@moxxy/voice-admin",
118445
+ version: "0.0.0",
118446
+ tools: [
118447
+ defineTool({
118448
+ name: "list_voices",
118449
+ 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).',
118450
+ inputSchema: z$1.object({}),
118451
+ permission: { action: "allow" },
118452
+ handler: () => ({
118453
+ active: session.synthesizers.getActiveName() ?? "system",
118454
+ available: voiceNames()
118455
+ })
118456
+ }),
118457
+ defineTool({
118458
+ name: "set_voice",
118459
+ 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.',
118460
+ inputSchema: z$1.object({
118461
+ synthesizer: z$1.string().min(1).describe('Synthesizer name to activate, or "system" for the OS voice.')
118462
+ }),
118463
+ permission: { action: "allow" },
118464
+ handler: ({ synthesizer }) => {
118465
+ if (synthesizer === "system") {
118466
+ session.synthesizers.clearActive();
118467
+ return { active: "system" };
118468
+ }
118469
+ if (!session.synthesizers.has(synthesizer)) {
118470
+ throw new Error(
118471
+ `No synthesizer named "${synthesizer}". Available: ${voiceNames().join(", ")}.`
118472
+ );
118473
+ }
118474
+ session.synthesizers.setActive(synthesizer);
118475
+ return { active: synthesizer };
118476
+ }
118477
+ })
118478
+ ]
118479
+ });
118480
+ })()
118481
+ },
117870
118482
  // Provider admin tools (provider_add, provider_list, provider_remove,
117871
118483
  // provider_test). Persists OpenAI-compatible vendor registrations to
117872
118484
  // ~/.moxxy/providers.json; the plugin's onInit re-registers them on
@@ -118388,7 +119000,12 @@ async function setupSessionWithConfig(opts) {
118388
119000
  config,
118389
119001
  resolver: opts.resolver,
118390
119002
  resumeSessionId: opts.resumeSessionId,
118391
- logger
119003
+ logger,
119004
+ // Surface vault secrets to tool handlers as `ctx.getSecret(name)`. The
119005
+ // value never enters the model's context or `process.env` — only the
119006
+ // handler that asks receives it. `vault.get` lazily opens the vault and
119007
+ // returns null for unknown names.
119008
+ secretResolver: (name) => vault.get(name)
118392
119009
  });
118393
119010
  const { plugin: memoryPlugin, store: memory } = buildMemoryPlugin({
118394
119011
  embedder: () => session.embedders.tryGetActive()
@@ -118957,6 +119574,8 @@ var RunnerMethod = {
118957
119574
  CommandRun: "command.run",
118958
119575
  /** client->server: transcribe audio using the runner's active transcriber. */
118959
119576
  Transcribe: "transcribe",
119577
+ /** client->server: synthesize text to audio using the runner's active synthesizer. */
119578
+ Synthesize: "synthesize",
118960
119579
  /** client->server: list every MCP server the runner knows about. */
118961
119580
  McpListServers: "mcp.listServers",
118962
119581
  /** client->server: enable an MCP server + attach its tools. */
@@ -119025,6 +119644,12 @@ var transcribeParamsSchema = z.object({
119025
119644
  language: z.string().optional(),
119026
119645
  prompt: z.string().optional()
119027
119646
  });
119647
+ var synthesizeParamsSchema = z.object({
119648
+ text: z.string(),
119649
+ voice: z.string().optional(),
119650
+ language: z.string().optional(),
119651
+ rate: z.number().optional()
119652
+ });
119028
119653
  var mcpEnableAndAttachParamsSchema = z.object({ name: z.string() });
119029
119654
  var mcpDetachParamsSchema = z.object({ name: z.string() });
119030
119655
  var workflowSetEnabledParamsSchema = z.object({
@@ -119097,6 +119722,7 @@ var RunnerServer = class {
119097
119722
  peer.handle(RunnerMethod.PermissionAddAllow, (raw) => this.handlePermissionAddAllow(raw));
119098
119723
  peer.handle(RunnerMethod.CommandRun, (raw) => this.handleCommandRun(raw));
119099
119724
  peer.handle(RunnerMethod.Transcribe, (raw) => this.handleTranscribe(raw));
119725
+ peer.handle(RunnerMethod.Synthesize, (raw) => this.handleSynthesize(raw));
119100
119726
  peer.handle(RunnerMethod.McpListServers, () => this.handleMcpListServers());
119101
119727
  peer.handle(RunnerMethod.McpEnableAndAttach, (raw) => this.handleMcpEnableAndAttach(raw));
119102
119728
  peer.handle(RunnerMethod.McpDetach, (raw) => this.handleMcpDetach(raw));
@@ -119233,6 +119859,22 @@ var RunnerServer = class {
119233
119859
  }
119234
119860
  throw lastErr;
119235
119861
  }
119862
+ async handleSynthesize(raw) {
119863
+ const params = synthesizeParamsSchema.parse(raw);
119864
+ const synth = this.session.synthesizers.tryGetActive();
119865
+ if (!synth)
119866
+ throw new Error("no active synthesizer on the runner");
119867
+ const opts = {
119868
+ ...params.voice ? { voice: params.voice } : {},
119869
+ ...params.language ? { language: params.language } : {},
119870
+ ...typeof params.rate === "number" ? { rate: params.rate } : {}
119871
+ };
119872
+ const result = await synth.synthesize(params.text, opts);
119873
+ return {
119874
+ audio: Buffer.from(result.audio).toString("base64"),
119875
+ mimeType: result.mimeType
119876
+ };
119877
+ }
119236
119878
  /** Ordered candidate list for a transcribe call.
119237
119879
  * - First the active one (if any) — respects an explicit host /
119238
119880
  * user choice.
@@ -119411,6 +120053,7 @@ var RemoteSession = class {
119411
120053
  skills;
119412
120054
  agents;
119413
120055
  transcribers;
120056
+ synthesizers;
119414
120057
  requirements;
119415
120058
  permissions;
119416
120059
  mcpAdmin;
@@ -119470,6 +120113,7 @@ var RemoteSession = class {
119470
120113
  this.skills = this.makeSkillsView();
119471
120114
  this.agents = { list: () => [] };
119472
120115
  this.transcribers = this.makeTranscribersView();
120116
+ this.synthesizers = this.makeSynthesizersView();
119473
120117
  this.requirements = { check: () => ({ ready: false, issues: [] }) };
119474
120118
  this.permissions = this.makePermissionsView();
119475
120119
  this.mcpAdmin = this.makeMcpAdminView();
@@ -119655,6 +120299,37 @@ var RemoteSession = class {
119655
120299
  }
119656
120300
  };
119657
120301
  }
120302
+ makeSynthesizersView() {
120303
+ const proxy = () => ({
120304
+ name: this.info?.activeSynthesizer ?? "runner",
120305
+ synthesize: async (text, opts) => {
120306
+ const res = await this.peer.request(RunnerMethod.Synthesize, {
120307
+ text,
120308
+ ...opts?.voice ? { voice: opts.voice } : {},
120309
+ ...opts?.language ? { language: opts.language } : {},
120310
+ ...typeof opts?.rate === "number" ? { rate: opts.rate } : {}
120311
+ });
120312
+ return {
120313
+ audio: new Uint8Array(Buffer.from(res.audio, "base64")),
120314
+ mimeType: res.mimeType
120315
+ };
120316
+ }
120317
+ });
120318
+ return {
120319
+ getActiveName: () => this.info?.activeSynthesizer ?? null,
120320
+ has: (name) => name === this.info?.activeSynthesizer,
120321
+ getActive: () => {
120322
+ if (!this.info?.activeSynthesizer) {
120323
+ throw new Error("no active synthesizer on the runner");
120324
+ }
120325
+ return proxy();
120326
+ },
120327
+ tryGetActive: () => this.info?.activeSynthesizer ? proxy() : null,
120328
+ setActive: () => {
120329
+ throw new Error("switch the active synthesizer on the runner, not the attached client");
120330
+ }
120331
+ };
120332
+ }
119658
120333
  makePermissionsView() {
119659
120334
  return {
119660
120335
  addAllow: async (rule) => {
@@ -119912,8 +120587,8 @@ async function runSetupWizard(opts) {
119912
120587
  ge2(`${colors.bold("moxxy")}${version} ${colors.dim("\u2014 first-time setup")}`);
119913
120588
  Se2(
119914
120589
  [
119915
- `${colors.bold("1.")} Pick one or more LLM providers`,
119916
- `${colors.bold("2.")} Paste each API key (stored encrypted in the vault)`,
120590
+ `${colors.bold("1.")} Pick an LLM provider`,
120591
+ `${colors.bold("2.")} Paste your API key (stored encrypted in the vault)`,
119917
120592
  `${colors.bold("3.")} Choose a default model, mode, and memory embedder`,
119918
120593
  `${colors.bold("4.")} Review and write ${colors.bold("moxxy.config.yaml")} into the project`
119919
120594
  ].join("\n"),
@@ -119927,66 +120602,54 @@ async function runSetupWizard(opts) {
119927
120602
  me2("No selectable providers are registered. Install a provider plugin and try again.");
119928
120603
  process.exit(1);
119929
120604
  }
119930
- const chosenProvidersRaw = await ve2({
119931
- message: "Step 1 \u2014 Which provider(s) do you want to use?",
120605
+ const providerRaw = await xe2({
120606
+ message: "Step 1 \u2014 Which provider do you want to use?",
119932
120607
  options: providerOptions,
119933
- required: true,
119934
- initialValues: [providerOptions[0].value]
120608
+ initialValue: providerOptions[0].value
119935
120609
  });
119936
- const chosenProviders = guard(chosenProvidersRaw);
120610
+ const provider = guard(providerRaw);
119937
120611
  const apiKeys = {};
119938
- for (const providerId of chosenProviders) {
119939
- if (authKind(opts.authKinds, providerId) === "oauth") {
119940
- if (!opts.controller.loginOAuth) {
119941
- me2(
119942
- `Provider ${providerId} requires OAuth but the wizard has no loginOAuth handler wired up.`
119943
- );
119944
- process.exit(1);
119945
- }
119946
- await collectOAuth(providerId, opts.controller.loginOAuth);
119947
- } else {
119948
- apiKeys[providerId] = await collectKey(providerId, opts.controller);
120612
+ if (authKind(opts.authKinds, provider) === "oauth") {
120613
+ if (!opts.controller.loginOAuth) {
120614
+ me2(
120615
+ `Provider ${provider} requires OAuth but the wizard has no loginOAuth handler wired up.`
120616
+ );
120617
+ process.exit(1);
119949
120618
  }
120619
+ await collectOAuth(provider, opts.controller.loginOAuth);
120620
+ } else {
120621
+ apiKeys[provider] = await collectKey(provider, opts.controller);
119950
120622
  }
119951
- let primary = chosenProviders[0];
119952
- if (chosenProviders.length > 1) {
119953
- const primaryRaw = await xe2({
119954
- message: "Step 3 \u2014 Which provider should be primary?",
119955
- options: chosenProviders.map((id) => ({ value: id, label: id })),
119956
- initialValue: primary
119957
- });
119958
- primary = guard(primaryRaw);
119959
- }
119960
- const modelChoices = opts.models[primary] ?? [];
120623
+ const modelChoices = opts.models[provider] ?? [];
119961
120624
  let model = null;
119962
120625
  if (modelChoices.length > 0) {
119963
120626
  const modelRaw = await xe2({
119964
- message: `Step 4 \u2014 Default model for ${colors.bold(primary)}`,
120627
+ message: `Step 3 \u2014 Default model for ${colors.bold(provider)}`,
119965
120628
  options: toOptions(modelChoices),
119966
120629
  initialValue: modelChoices[0].id
119967
120630
  });
119968
120631
  model = guard(modelRaw);
119969
120632
  }
119970
120633
  const modeRaw = await xe2({
119971
- message: "Step 5 \u2014 Mode",
120634
+ message: "Step 4 \u2014 Mode",
119972
120635
  options: toOptions(opts.modes),
119973
120636
  initialValue: opts.modes[0]?.id ?? "tool-use"
119974
120637
  });
119975
120638
  const mode = guard(modeRaw);
119976
120639
  const embedderRaw = await xe2({
119977
- message: "Step 6 \u2014 Memory embedder",
120640
+ message: "Step 5 \u2014 Memory embedder",
119978
120641
  options: toOptions(opts.embedders),
119979
120642
  initialValue: opts.embedders[0]?.id ?? "tfidf"
119980
120643
  });
119981
120644
  const embedder = guard(embedderRaw);
119982
120645
  const securityRaw = await ue2({
119983
- message: "Step 7 \u2014 Enable plugin-security? " + colors.dim("(per-tool capability isolation; off by default)"),
120646
+ message: "Step 6 \u2014 Enable plugin-security? " + colors.dim("(per-tool capability isolation; off by default)"),
119984
120647
  initialValue: false
119985
120648
  });
119986
120649
  const securityEnabled = guard(securityRaw);
119987
120650
  const selections = {
119988
- providers: chosenProviders,
119989
- primary,
120651
+ providers: [provider],
120652
+ primary: provider,
119990
120653
  model,
119991
120654
  mode,
119992
120655
  embedder,
@@ -120003,10 +120666,9 @@ async function runSetupWizard(opts) {
120003
120666
  if (!confirmed) bail();
120004
120667
  const persist = ft2();
120005
120668
  persist.start("Writing config and storing keys");
120006
- for (const providerId of chosenProviders) {
120007
- if (authKind(opts.authKinds, providerId) === "oauth") continue;
120008
- const key = apiKeys[providerId];
120009
- if (key) await opts.controller.saveApiKey(providerId, key);
120669
+ if (authKind(opts.authKinds, provider) !== "oauth") {
120670
+ const key = apiKeys[provider];
120671
+ if (key) await opts.controller.saveApiKey(provider, key);
120010
120672
  }
120011
120673
  const configPath = await opts.controller.writeConfig(yaml);
120012
120674
  persist.stop(`Wrote ${colors.bold(configPath)}`);