@moxxy/cli 0.1.6 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1397 -786
- package/dist/bin.js.map +1 -1
- package/dist/skills/self-update.md +76 -0
- package/dist/skills/vault-setup.md +1 -1
- package/package.json +1 -1
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
|
|
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/
|
|
2220
|
-
var
|
|
2221
|
-
var
|
|
2222
|
-
"../core/dist/registries/
|
|
2223
|
-
|
|
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(
|
|
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
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
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 =
|
|
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(
|
|
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
|
|
2305
|
+
throw new Error(`Active ${this.opts.noun.toLowerCase()} has no instance: ${this.active}`);
|
|
2271
2306
|
return inst;
|
|
2272
2307
|
}
|
|
2273
|
-
/** Active
|
|
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
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
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({
|
|
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,
|
|
@@ -3009,7 +3063,9 @@ var init_session = __esm({
|
|
|
3009
3063
|
// For UI affordance gating (showing / hiding a mic button),
|
|
3010
3064
|
// any registered transcriber means "voice is wired."
|
|
3011
3065
|
hasTranscriber: this.transcribers.list().length > 0,
|
|
3012
|
-
activeTranscriber: this.transcribers.getActiveName()
|
|
3066
|
+
activeTranscriber: this.transcribers.getActiveName(),
|
|
3067
|
+
hasSynthesizer: this.synthesizers.list().length > 0,
|
|
3068
|
+
activeSynthesizer: this.synthesizers.getActiveName()
|
|
3013
3069
|
};
|
|
3014
3070
|
}
|
|
3015
3071
|
registerHookOptions(_hooks) {
|
|
@@ -4205,7 +4261,7 @@ var require_jiti = __commonJS({
|
|
|
4205
4261
|
function V4() {
|
|
4206
4262
|
return 10 !== n3.getToken() ? (k3(3, [], [2, 5]), false) : (P3(false), 6 === n3.getToken() ? (I3(":"), T2(), U3() || k3(4, [], [2, 5])) : k3(5, [], [2, 5]), a3.pop(), true);
|
|
4207
4263
|
}
|
|
4208
|
-
function
|
|
4264
|
+
function z58() {
|
|
4209
4265
|
l3(), T2();
|
|
4210
4266
|
let e6 = false;
|
|
4211
4267
|
for (; 2 !== n3.getToken() && 17 !== n3.getToken(); ) {
|
|
@@ -4232,14 +4288,14 @@ var require_jiti = __commonJS({
|
|
|
4232
4288
|
case 3:
|
|
4233
4289
|
return G3();
|
|
4234
4290
|
case 1:
|
|
4235
|
-
return
|
|
4291
|
+
return z58();
|
|
4236
4292
|
case 10:
|
|
4237
4293
|
return P3(true);
|
|
4238
4294
|
default:
|
|
4239
4295
|
return J2();
|
|
4240
4296
|
}
|
|
4241
4297
|
}
|
|
4242
|
-
return r2(T2, "scanNext"), r2(k3, "handleError"), r2(P3, "parseString"), r2(J2, "parseLiteral"), r2(V4, "parseProperty"), r2(
|
|
4298
|
+
return r2(T2, "scanNext"), r2(k3, "handleError"), r2(P3, "parseString"), r2(J2, "parseLiteral"), r2(V4, "parseProperty"), r2(z58, "parseObject"), r2(G3, "parseArray"), r2(U3, "parseValue"), T2(), 17 === n3.getToken() ? !!i4.allowEmptyContent || (k3(4, [], []), false) : U3() ? (17 !== n3.getToken() && k3(9, [], []), true) : (k3(4, [], []), false);
|
|
4243
4299
|
}
|
|
4244
4300
|
new Array(W3).fill(0).map((e5, t4) => "\n" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r\n" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\n" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r" + " ".repeat(t4)), new Array(W3).fill(0).map((e5, t4) => "\r\n" + " ".repeat(t4)), (function(e5) {
|
|
4245
4301
|
e5.DEFAULT = { allowTrailingComma: false };
|
|
@@ -4248,12 +4304,12 @@ var require_jiti = __commonJS({
|
|
|
4248
4304
|
})(H3 || (H3 = {})), (function(e5) {
|
|
4249
4305
|
e5[e5.OpenBraceToken = 1] = "OpenBraceToken", e5[e5.CloseBraceToken = 2] = "CloseBraceToken", e5[e5.OpenBracketToken = 3] = "OpenBracketToken", e5[e5.CloseBracketToken = 4] = "CloseBracketToken", e5[e5.CommaToken = 5] = "CommaToken", e5[e5.ColonToken = 6] = "ColonToken", e5[e5.NullKeyword = 7] = "NullKeyword", e5[e5.TrueKeyword = 8] = "TrueKeyword", e5[e5.FalseKeyword = 9] = "FalseKeyword", e5[e5.StringLiteral = 10] = "StringLiteral", e5[e5.NumericLiteral = 11] = "NumericLiteral", e5[e5.LineCommentTrivia = 12] = "LineCommentTrivia", e5[e5.BlockCommentTrivia = 13] = "BlockCommentTrivia", e5[e5.LineBreakTrivia = 14] = "LineBreakTrivia", e5[e5.Trivia = 15] = "Trivia", e5[e5.Unknown = 16] = "Unknown", e5[e5.EOF = 17] = "EOF";
|
|
4250
4306
|
})(Y4 || (Y4 = {}));
|
|
4251
|
-
const
|
|
4307
|
+
const Q3 = Pe3;
|
|
4252
4308
|
var Z2;
|
|
4253
4309
|
!(function(e5) {
|
|
4254
4310
|
e5[e5.InvalidSymbol = 1] = "InvalidSymbol", e5[e5.InvalidNumberFormat = 2] = "InvalidNumberFormat", e5[e5.PropertyNameExpected = 3] = "PropertyNameExpected", e5[e5.ValueExpected = 4] = "ValueExpected", e5[e5.ColonExpected = 5] = "ColonExpected", e5[e5.CommaExpected = 6] = "CommaExpected", e5[e5.CloseBraceExpected = 7] = "CloseBraceExpected", e5[e5.CloseBracketExpected = 8] = "CloseBracketExpected", e5[e5.EndOfFileExpected = 9] = "EndOfFileExpected", e5[e5.InvalidCommentToken = 10] = "InvalidCommentToken", e5[e5.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e5[e5.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e5[e5.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e5[e5.InvalidUnicode = 14] = "InvalidUnicode", e5[e5.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e5[e5.InvalidCharacter = 16] = "InvalidCharacter";
|
|
4255
4311
|
})(Z2 || (Z2 = {}));
|
|
4256
|
-
const X3 = r2((e5, t4) =>
|
|
4312
|
+
const X3 = r2((e5, t4) => Q3(N2(t4, e5, "utf8")), "readJsonc"), te3 = /* @__PURE__ */ Symbol("implicitBaseUrl"), ie2 = "${configDir}", se2 = r2(() => {
|
|
4257
4313
|
const { findPnpApi: e5 } = l2;
|
|
4258
4314
|
return e5 && e5(process.cwd());
|
|
4259
4315
|
}, "getPnpApi"), re2 = r2((e5, t4, i4, n3) => {
|
|
@@ -4425,7 +4481,7 @@ var require_jiti = __commonJS({
|
|
|
4425
4481
|
"node" === t4 && (t4 = "node10"), e5.moduleResolution = t4, ("node16" === t4 || "nodenext" === t4 || "bundler" === t4) && (null != e5.resolvePackageJsonExports || (e5.resolvePackageJsonExports = true), null != e5.resolvePackageJsonImports || (e5.resolvePackageJsonImports = true)), "bundler" === t4 && (null != e5.allowSyntheticDefaultImports || (e5.allowSyntheticDefaultImports = true), null != e5.resolveJsonModule || (e5.resolveJsonModule = true));
|
|
4426
4482
|
}
|
|
4427
4483
|
e5.jsx && (e5.jsx = e5.jsx.toLowerCase()), e5.moduleDetection && (e5.moduleDetection = e5.moduleDetection.toLowerCase()), e5.importsNotUsedAsValues && (e5.importsNotUsedAsValues = e5.importsNotUsedAsValues.toLowerCase()), e5.newLine && (e5.newLine = e5.newLine.toLowerCase()), e5.esModuleInterop && (null != e5.allowSyntheticDefaultImports || (e5.allowSyntheticDefaultImports = true)), e5.verbatimModuleSyntax && (null != e5.isolatedModules || (e5.isolatedModules = true), null != e5.preserveConstEnums || (e5.preserveConstEnums = true)), e5.isolatedModules && (null != e5.preserveConstEnums || (e5.preserveConstEnums = true)), e5.rewriteRelativeImportExtensions && (null != e5.allowImportingTsExtensions || (e5.allowImportingTsExtensions = true)), e5.lib && (e5.lib = e5.lib.map((e6) => e6.toLowerCase())), e5.checkJs && (null != e5.allowJs || (e5.allowJs = true));
|
|
4428
|
-
}, "normalizeCompilerOptions"),
|
|
4484
|
+
}, "normalizeCompilerOptions"), ve2 = r2((e5, t4 = /* @__PURE__ */ new Map()) => {
|
|
4429
4485
|
const i4 = a2.resolve(e5), n3 = fe2(i4, t4), c3 = a2.dirname(i4), { compilerOptions: l3 } = n3;
|
|
4430
4486
|
if (l3) {
|
|
4431
4487
|
for (const e7 of ge3) {
|
|
@@ -4523,7 +4579,7 @@ var require_jiti = __commonJS({
|
|
|
4523
4579
|
for (; ; ) {
|
|
4524
4580
|
const e6 = j3(c3, t4, i4);
|
|
4525
4581
|
if (!e6) return;
|
|
4526
|
-
const l3 = a2.resolve(e6), y3 =
|
|
4582
|
+
const l3 = a2.resolve(e6), y3 = ve2(l3, i4), E4 = { path: h3(l3), config: y3 };
|
|
4527
4583
|
if (je2(E4)(n3)) return E4;
|
|
4528
4584
|
const w5 = a2.dirname(e6), C4 = a2.dirname(w5);
|
|
4529
4585
|
if (C4 === w5) return;
|
|
@@ -4537,7 +4593,7 @@ var require_jiti = __commonJS({
|
|
|
4537
4593
|
if (!n3) {
|
|
4538
4594
|
const n4 = Be2(e5, t4, i4);
|
|
4539
4595
|
if (!n4) return null;
|
|
4540
|
-
return { path: n4, config:
|
|
4596
|
+
return { path: n4, config: ve2(n4, i4) };
|
|
4541
4597
|
}
|
|
4542
4598
|
return null != (a3 = Fe2(e5, t4, i4)) ? a3 : null;
|
|
4543
4599
|
}, "getTsconfig"), qe2 = /\*/g, Ge2 = r2((e5, t4) => {
|
|
@@ -4684,9 +4740,9 @@ var require_jiti = __commonJS({
|
|
|
4684
4740
|
return W3.call(e5, t4);
|
|
4685
4741
|
}, Y4 = Array.isArray || function(e5) {
|
|
4686
4742
|
return "[object Array]" === K4.call(e5);
|
|
4687
|
-
},
|
|
4743
|
+
}, Q3 = /* @__PURE__ */ Object.create(null);
|
|
4688
4744
|
function wordsRegexp(e5) {
|
|
4689
|
-
return
|
|
4745
|
+
return Q3[e5] || (Q3[e5] = new RegExp("^(?:" + e5.replace(/ /g, "|") + ")$"));
|
|
4690
4746
|
}
|
|
4691
4747
|
function codePointToString(e5) {
|
|
4692
4748
|
return e5 <= 65535 ? String.fromCharCode(e5) : (e5 -= 65536, String.fromCharCode(55296 + (e5 >> 10), 56320 + (1023 & e5)));
|
|
@@ -5778,13 +5834,13 @@ var require_jiti = __commonJS({
|
|
|
5778
5834
|
var t4 = this.startNode();
|
|
5779
5835
|
return this.next(), t4.argument = this.parseMaybeUnary(null, true, false, e5), this.finishNode(t4, "AwaitExpression");
|
|
5780
5836
|
};
|
|
5781
|
-
var
|
|
5782
|
-
|
|
5837
|
+
var ve2 = acorn_Parser.prototype;
|
|
5838
|
+
ve2.raise = function(e5, t4) {
|
|
5783
5839
|
var i3 = getLineInfo(this.input, e5);
|
|
5784
5840
|
t4 += " (" + i3.line + ":" + i3.column + ")", this.sourceFile && (t4 += " in " + this.sourceFile);
|
|
5785
5841
|
var n3 = new SyntaxError(t4);
|
|
5786
5842
|
throw n3.pos = e5, n3.loc = i3, n3.raisedAt = this.pos, n3;
|
|
5787
|
-
},
|
|
5843
|
+
}, ve2.raiseRecoverable = ve2.raise, ve2.curPosition = function() {
|
|
5788
5844
|
if (this.options.locations) return new acorn_Position(this.curLine, this.pos - this.lineStart);
|
|
5789
5845
|
};
|
|
5790
5846
|
var ye3 = acorn_Parser.prototype, acorn_Scope = function(e5) {
|
|
@@ -7789,6 +7845,7 @@ __export(dist_exports, {
|
|
|
7789
7845
|
SessionPersistence: () => SessionPersistence,
|
|
7790
7846
|
SkillRegistryImpl: () => SkillRegistryImpl,
|
|
7791
7847
|
SkillRouter: () => SkillRouter,
|
|
7848
|
+
SynthesizerRegistry: () => SynthesizerRegistry,
|
|
7792
7849
|
ToolRegistryImpl: () => ToolRegistryImpl,
|
|
7793
7850
|
TranscriberRegistry: () => TranscriberRegistry,
|
|
7794
7851
|
TunnelProviderRegistry: () => TunnelProviderRegistry,
|
|
@@ -7863,6 +7920,7 @@ var init_dist = __esm({
|
|
|
7863
7920
|
init_agents();
|
|
7864
7921
|
init_commands();
|
|
7865
7922
|
init_transcribers();
|
|
7923
|
+
init_synthesizers();
|
|
7866
7924
|
init_embedders();
|
|
7867
7925
|
init_isolators();
|
|
7868
7926
|
init_requirements();
|
|
@@ -22621,25 +22679,25 @@ function kt(e3, t2, r2, o2, n2, a2) {
|
|
|
22621
22679
|
m(e4);
|
|
22622
22680
|
}
|
|
22623
22681
|
function B2() {
|
|
22624
|
-
return v3 = "closed", r2 ? L3() :
|
|
22682
|
+
return v3 = "closed", r2 ? L3() : z58((() => (Ge(t2) && (T2 = rt(t2), R4 = t2._state), T2 || "closed" === R4 ? c(void 0) : "erroring" === R4 || "errored" === R4 ? d(_2) : (T2 = true, l2.close()))), false, void 0), null;
|
|
22625
22683
|
}
|
|
22626
22684
|
function A3(e4) {
|
|
22627
|
-
return w4 || (v3 = "errored", s2 = e4, o2 ? L3(true, e4) :
|
|
22685
|
+
return w4 || (v3 = "errored", s2 = e4, o2 ? L3(true, e4) : z58((() => l2.abort(e4)), true, e4)), null;
|
|
22628
22686
|
}
|
|
22629
22687
|
function j3(e4) {
|
|
22630
|
-
return S2 || (R4 = "errored", _2 = e4, n2 ? L3(true, e4) :
|
|
22688
|
+
return S2 || (R4 = "errored", _2 = e4, n2 ? L3(true, e4) : z58((() => i2.cancel(e4)), true, e4)), null;
|
|
22631
22689
|
}
|
|
22632
22690
|
if (void 0 !== a2 && (k3 = () => {
|
|
22633
22691
|
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))),
|
|
22692
|
+
o2 || t3.push((() => "writable" === R4 ? l2.abort(e4) : c(void 0))), n2 || t3.push((() => "readable" === v3 ? i2.cancel(e4) : c(void 0))), z58((() => Promise.all(t3.map(((e5) => e5())))), true, e4);
|
|
22635
22693
|
}, a2.aborted ? k3() : a2.addEventListener("abort", k3)), Vt(e3) && (v3 = e3._state, s2 = e3._storedError), Ge(t2) && (R4 = t2._state, _2 = t2._storedError, T2 = rt(t2)), Vt(e3) && Ge(t2) && (q3 = true, g2()), "errored" === v3) A3(s2);
|
|
22636
22694
|
else if ("erroring" === R4 || "errored" === R4) j3(_2);
|
|
22637
22695
|
else if ("closed" === v3) B2();
|
|
22638
22696
|
else if (T2 || "closed" === R4) {
|
|
22639
22697
|
const e4 = new TypeError("the destination writable stream closed before all data could be piped to it");
|
|
22640
|
-
n2 ? L3(true, e4) :
|
|
22698
|
+
n2 ? L3(true, e4) : z58((() => i2.cancel(e4)), true, e4);
|
|
22641
22699
|
}
|
|
22642
|
-
function
|
|
22700
|
+
function z58(e4, t3, r3) {
|
|
22643
22701
|
function o3() {
|
|
22644
22702
|
return "writable" !== R4 || T2 ? n3() : h((function() {
|
|
22645
22703
|
let e5;
|
|
@@ -22654,7 +22712,7 @@ function kt(e3, t2, r2, o2, n2, a2) {
|
|
|
22654
22712
|
w4 || (w4 = true, q3 ? o3() : h(C3, o3));
|
|
22655
22713
|
}
|
|
22656
22714
|
function L3(e4, t3) {
|
|
22657
|
-
|
|
22715
|
+
z58(void 0, e4, t3);
|
|
22658
22716
|
}
|
|
22659
22717
|
function F3(e4, t3) {
|
|
22660
22718
|
return S2 = true, l2.releaseLock(), i2.releaseLock(), void 0 !== a2 && a2.removeEventListener("abort", k3), e4 ? W3(t3) : P3(void 0), null;
|
|
@@ -35470,26 +35528,26 @@ var init_types = __esm({
|
|
|
35470
35528
|
SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
35471
35529
|
RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
35472
35530
|
JSONRPC_VERSION = "2.0";
|
|
35473
|
-
AssertObjectSchema =
|
|
35474
|
-
ProgressTokenSchema =
|
|
35475
|
-
CursorSchema =
|
|
35476
|
-
|
|
35531
|
+
AssertObjectSchema = z24.custom((v3) => v3 !== null && (typeof v3 === "object" || typeof v3 === "function"));
|
|
35532
|
+
ProgressTokenSchema = z24.union([z24.string(), z24.number().int()]);
|
|
35533
|
+
CursorSchema = z24.string();
|
|
35534
|
+
z24.looseObject({
|
|
35477
35535
|
/**
|
|
35478
35536
|
* Requested duration in milliseconds to retain task from creation.
|
|
35479
35537
|
*/
|
|
35480
|
-
ttl:
|
|
35538
|
+
ttl: z24.number().optional(),
|
|
35481
35539
|
/**
|
|
35482
35540
|
* Time in milliseconds to wait between task status requests.
|
|
35483
35541
|
*/
|
|
35484
|
-
pollInterval:
|
|
35542
|
+
pollInterval: z24.number().optional()
|
|
35485
35543
|
});
|
|
35486
|
-
TaskMetadataSchema =
|
|
35487
|
-
ttl:
|
|
35544
|
+
TaskMetadataSchema = z24.object({
|
|
35545
|
+
ttl: z24.number().optional()
|
|
35488
35546
|
});
|
|
35489
|
-
RelatedTaskMetadataSchema =
|
|
35490
|
-
taskId:
|
|
35547
|
+
RelatedTaskMetadataSchema = z24.object({
|
|
35548
|
+
taskId: z24.string()
|
|
35491
35549
|
});
|
|
35492
|
-
RequestMetaSchema =
|
|
35550
|
+
RequestMetaSchema = z24.looseObject({
|
|
35493
35551
|
/**
|
|
35494
35552
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
35495
35553
|
*/
|
|
@@ -35499,7 +35557,7 @@ var init_types = __esm({
|
|
|
35499
35557
|
*/
|
|
35500
35558
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
35501
35559
|
});
|
|
35502
|
-
BaseRequestParamsSchema =
|
|
35560
|
+
BaseRequestParamsSchema = z24.object({
|
|
35503
35561
|
/**
|
|
35504
35562
|
* See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
|
|
35505
35563
|
*/
|
|
@@ -35517,42 +35575,42 @@ var init_types = __esm({
|
|
|
35517
35575
|
task: TaskMetadataSchema.optional()
|
|
35518
35576
|
});
|
|
35519
35577
|
isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
35520
|
-
RequestSchema =
|
|
35521
|
-
method:
|
|
35578
|
+
RequestSchema = z24.object({
|
|
35579
|
+
method: z24.string(),
|
|
35522
35580
|
params: BaseRequestParamsSchema.loose().optional()
|
|
35523
35581
|
});
|
|
35524
|
-
NotificationsParamsSchema =
|
|
35582
|
+
NotificationsParamsSchema = z24.object({
|
|
35525
35583
|
/**
|
|
35526
35584
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
35527
35585
|
* for notes on _meta usage.
|
|
35528
35586
|
*/
|
|
35529
35587
|
_meta: RequestMetaSchema.optional()
|
|
35530
35588
|
});
|
|
35531
|
-
NotificationSchema =
|
|
35532
|
-
method:
|
|
35589
|
+
NotificationSchema = z24.object({
|
|
35590
|
+
method: z24.string(),
|
|
35533
35591
|
params: NotificationsParamsSchema.loose().optional()
|
|
35534
35592
|
});
|
|
35535
|
-
ResultSchema =
|
|
35593
|
+
ResultSchema = z24.looseObject({
|
|
35536
35594
|
/**
|
|
35537
35595
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
35538
35596
|
* for notes on _meta usage.
|
|
35539
35597
|
*/
|
|
35540
35598
|
_meta: RequestMetaSchema.optional()
|
|
35541
35599
|
});
|
|
35542
|
-
RequestIdSchema =
|
|
35543
|
-
JSONRPCRequestSchema =
|
|
35544
|
-
jsonrpc:
|
|
35600
|
+
RequestIdSchema = z24.union([z24.string(), z24.number().int()]);
|
|
35601
|
+
JSONRPCRequestSchema = z24.object({
|
|
35602
|
+
jsonrpc: z24.literal(JSONRPC_VERSION),
|
|
35545
35603
|
id: RequestIdSchema,
|
|
35546
35604
|
...RequestSchema.shape
|
|
35547
35605
|
}).strict();
|
|
35548
35606
|
isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
35549
|
-
JSONRPCNotificationSchema =
|
|
35550
|
-
jsonrpc:
|
|
35607
|
+
JSONRPCNotificationSchema = z24.object({
|
|
35608
|
+
jsonrpc: z24.literal(JSONRPC_VERSION),
|
|
35551
35609
|
...NotificationSchema.shape
|
|
35552
35610
|
}).strict();
|
|
35553
35611
|
isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
35554
|
-
JSONRPCResultResponseSchema =
|
|
35555
|
-
jsonrpc:
|
|
35612
|
+
JSONRPCResultResponseSchema = z24.object({
|
|
35613
|
+
jsonrpc: z24.literal(JSONRPC_VERSION),
|
|
35556
35614
|
id: RequestIdSchema,
|
|
35557
35615
|
result: ResultSchema
|
|
35558
35616
|
}).strict();
|
|
@@ -35567,32 +35625,32 @@ var init_types = __esm({
|
|
|
35567
35625
|
ErrorCode2[ErrorCode2["InternalError"] = -32603] = "InternalError";
|
|
35568
35626
|
ErrorCode2[ErrorCode2["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
35569
35627
|
})(ErrorCode || (ErrorCode = {}));
|
|
35570
|
-
JSONRPCErrorResponseSchema =
|
|
35571
|
-
jsonrpc:
|
|
35628
|
+
JSONRPCErrorResponseSchema = z24.object({
|
|
35629
|
+
jsonrpc: z24.literal(JSONRPC_VERSION),
|
|
35572
35630
|
id: RequestIdSchema.optional(),
|
|
35573
|
-
error:
|
|
35631
|
+
error: z24.object({
|
|
35574
35632
|
/**
|
|
35575
35633
|
* The error type that occurred.
|
|
35576
35634
|
*/
|
|
35577
|
-
code:
|
|
35635
|
+
code: z24.number().int(),
|
|
35578
35636
|
/**
|
|
35579
35637
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
35580
35638
|
*/
|
|
35581
|
-
message:
|
|
35639
|
+
message: z24.string(),
|
|
35582
35640
|
/**
|
|
35583
35641
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
35584
35642
|
*/
|
|
35585
|
-
data:
|
|
35643
|
+
data: z24.unknown().optional()
|
|
35586
35644
|
})
|
|
35587
35645
|
}).strict();
|
|
35588
35646
|
isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
35589
|
-
JSONRPCMessageSchema =
|
|
35647
|
+
JSONRPCMessageSchema = z24.union([
|
|
35590
35648
|
JSONRPCRequestSchema,
|
|
35591
35649
|
JSONRPCNotificationSchema,
|
|
35592
35650
|
JSONRPCResultResponseSchema,
|
|
35593
35651
|
JSONRPCErrorResponseSchema
|
|
35594
35652
|
]);
|
|
35595
|
-
|
|
35653
|
+
z24.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
35596
35654
|
EmptyResultSchema = ResultSchema.strict();
|
|
35597
35655
|
CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
35598
35656
|
/**
|
|
@@ -35604,28 +35662,28 @@ var init_types = __esm({
|
|
|
35604
35662
|
/**
|
|
35605
35663
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
35606
35664
|
*/
|
|
35607
|
-
reason:
|
|
35665
|
+
reason: z24.string().optional()
|
|
35608
35666
|
});
|
|
35609
35667
|
CancelledNotificationSchema = NotificationSchema.extend({
|
|
35610
|
-
method:
|
|
35668
|
+
method: z24.literal("notifications/cancelled"),
|
|
35611
35669
|
params: CancelledNotificationParamsSchema
|
|
35612
35670
|
});
|
|
35613
|
-
IconSchema =
|
|
35671
|
+
IconSchema = z24.object({
|
|
35614
35672
|
/**
|
|
35615
35673
|
* URL or data URI for the icon.
|
|
35616
35674
|
*/
|
|
35617
|
-
src:
|
|
35675
|
+
src: z24.string(),
|
|
35618
35676
|
/**
|
|
35619
35677
|
* Optional MIME type for the icon.
|
|
35620
35678
|
*/
|
|
35621
|
-
mimeType:
|
|
35679
|
+
mimeType: z24.string().optional(),
|
|
35622
35680
|
/**
|
|
35623
35681
|
* Optional array of strings that specify sizes at which the icon can be used.
|
|
35624
35682
|
* Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
|
|
35625
35683
|
*
|
|
35626
35684
|
* If not provided, the client should assume that the icon can be used at any size.
|
|
35627
35685
|
*/
|
|
35628
|
-
sizes:
|
|
35686
|
+
sizes: z24.array(z24.string()).optional(),
|
|
35629
35687
|
/**
|
|
35630
35688
|
* Optional specifier for the theme this icon is designed for. `light` indicates
|
|
35631
35689
|
* the icon is designed to be used with a light background, and `dark` indicates
|
|
@@ -35633,9 +35691,9 @@ var init_types = __esm({
|
|
|
35633
35691
|
*
|
|
35634
35692
|
* If not provided, the client should assume the icon can be used with any theme.
|
|
35635
35693
|
*/
|
|
35636
|
-
theme:
|
|
35694
|
+
theme: z24.enum(["light", "dark"]).optional()
|
|
35637
35695
|
});
|
|
35638
|
-
IconsSchema =
|
|
35696
|
+
IconsSchema = z24.object({
|
|
35639
35697
|
/**
|
|
35640
35698
|
* Optional set of sized icons that the client can display in a user interface.
|
|
35641
35699
|
*
|
|
@@ -35647,11 +35705,11 @@ var init_types = __esm({
|
|
|
35647
35705
|
* - `image/svg+xml` - SVG images (scalable but requires security precautions)
|
|
35648
35706
|
* - `image/webp` - WebP images (modern, efficient format)
|
|
35649
35707
|
*/
|
|
35650
|
-
icons:
|
|
35708
|
+
icons: z24.array(IconSchema).optional()
|
|
35651
35709
|
});
|
|
35652
|
-
BaseMetadataSchema =
|
|
35710
|
+
BaseMetadataSchema = z24.object({
|
|
35653
35711
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
35654
|
-
name:
|
|
35712
|
+
name: z24.string(),
|
|
35655
35713
|
/**
|
|
35656
35714
|
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
35657
35715
|
* even by those unfamiliar with domain-specific terminology.
|
|
@@ -35660,16 +35718,16 @@ var init_types = __esm({
|
|
|
35660
35718
|
* where `annotations.title` should be given precedence over using `name`,
|
|
35661
35719
|
* if present).
|
|
35662
35720
|
*/
|
|
35663
|
-
title:
|
|
35721
|
+
title: z24.string().optional()
|
|
35664
35722
|
});
|
|
35665
35723
|
ImplementationSchema = BaseMetadataSchema.extend({
|
|
35666
35724
|
...BaseMetadataSchema.shape,
|
|
35667
35725
|
...IconsSchema.shape,
|
|
35668
|
-
version:
|
|
35726
|
+
version: z24.string(),
|
|
35669
35727
|
/**
|
|
35670
35728
|
* An optional URL of the website for this implementation.
|
|
35671
35729
|
*/
|
|
35672
|
-
websiteUrl:
|
|
35730
|
+
websiteUrl: z24.string().optional(),
|
|
35673
35731
|
/**
|
|
35674
35732
|
* An optional human-readable description of what this implementation does.
|
|
35675
35733
|
*
|
|
@@ -35677,23 +35735,23 @@ var init_types = __esm({
|
|
|
35677
35735
|
* and capabilities. For example, a server might describe the types of resources
|
|
35678
35736
|
* or tools it provides, while a client might describe its intended use case.
|
|
35679
35737
|
*/
|
|
35680
|
-
description:
|
|
35738
|
+
description: z24.string().optional()
|
|
35681
35739
|
});
|
|
35682
|
-
FormElicitationCapabilitySchema =
|
|
35683
|
-
applyDefaults:
|
|
35684
|
-
}),
|
|
35685
|
-
ElicitationCapabilitySchema =
|
|
35740
|
+
FormElicitationCapabilitySchema = z24.intersection(z24.object({
|
|
35741
|
+
applyDefaults: z24.boolean().optional()
|
|
35742
|
+
}), z24.record(z24.string(), z24.unknown()));
|
|
35743
|
+
ElicitationCapabilitySchema = z24.preprocess((value) => {
|
|
35686
35744
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
35687
35745
|
if (Object.keys(value).length === 0) {
|
|
35688
35746
|
return { form: {} };
|
|
35689
35747
|
}
|
|
35690
35748
|
}
|
|
35691
35749
|
return value;
|
|
35692
|
-
},
|
|
35750
|
+
}, z24.intersection(z24.object({
|
|
35693
35751
|
form: FormElicitationCapabilitySchema.optional(),
|
|
35694
35752
|
url: AssertObjectSchema.optional()
|
|
35695
|
-
}),
|
|
35696
|
-
ClientTasksCapabilitySchema =
|
|
35753
|
+
}), z24.record(z24.string(), z24.unknown()).optional()));
|
|
35754
|
+
ClientTasksCapabilitySchema = z24.looseObject({
|
|
35697
35755
|
/**
|
|
35698
35756
|
* Present if the client supports listing tasks.
|
|
35699
35757
|
*/
|
|
@@ -35705,22 +35763,22 @@ var init_types = __esm({
|
|
|
35705
35763
|
/**
|
|
35706
35764
|
* Capabilities for task creation on specific request types.
|
|
35707
35765
|
*/
|
|
35708
|
-
requests:
|
|
35766
|
+
requests: z24.looseObject({
|
|
35709
35767
|
/**
|
|
35710
35768
|
* Task support for sampling requests.
|
|
35711
35769
|
*/
|
|
35712
|
-
sampling:
|
|
35770
|
+
sampling: z24.looseObject({
|
|
35713
35771
|
createMessage: AssertObjectSchema.optional()
|
|
35714
35772
|
}).optional(),
|
|
35715
35773
|
/**
|
|
35716
35774
|
* Task support for elicitation requests.
|
|
35717
35775
|
*/
|
|
35718
|
-
elicitation:
|
|
35776
|
+
elicitation: z24.looseObject({
|
|
35719
35777
|
create: AssertObjectSchema.optional()
|
|
35720
35778
|
}).optional()
|
|
35721
35779
|
}).optional()
|
|
35722
35780
|
});
|
|
35723
|
-
ServerTasksCapabilitySchema =
|
|
35781
|
+
ServerTasksCapabilitySchema = z24.looseObject({
|
|
35724
35782
|
/**
|
|
35725
35783
|
* Present if the server supports listing tasks.
|
|
35726
35784
|
*/
|
|
@@ -35732,24 +35790,24 @@ var init_types = __esm({
|
|
|
35732
35790
|
/**
|
|
35733
35791
|
* Capabilities for task creation on specific request types.
|
|
35734
35792
|
*/
|
|
35735
|
-
requests:
|
|
35793
|
+
requests: z24.looseObject({
|
|
35736
35794
|
/**
|
|
35737
35795
|
* Task support for tool requests.
|
|
35738
35796
|
*/
|
|
35739
|
-
tools:
|
|
35797
|
+
tools: z24.looseObject({
|
|
35740
35798
|
call: AssertObjectSchema.optional()
|
|
35741
35799
|
}).optional()
|
|
35742
35800
|
}).optional()
|
|
35743
35801
|
});
|
|
35744
|
-
ClientCapabilitiesSchema =
|
|
35802
|
+
ClientCapabilitiesSchema = z24.object({
|
|
35745
35803
|
/**
|
|
35746
35804
|
* Experimental, non-standard capabilities that the client supports.
|
|
35747
35805
|
*/
|
|
35748
|
-
experimental:
|
|
35806
|
+
experimental: z24.record(z24.string(), AssertObjectSchema).optional(),
|
|
35749
35807
|
/**
|
|
35750
35808
|
* Present if the client supports sampling from an LLM.
|
|
35751
35809
|
*/
|
|
35752
|
-
sampling:
|
|
35810
|
+
sampling: z24.object({
|
|
35753
35811
|
/**
|
|
35754
35812
|
* Present if the client supports context inclusion via includeContext parameter.
|
|
35755
35813
|
* If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
|
|
@@ -35767,11 +35825,11 @@ var init_types = __esm({
|
|
|
35767
35825
|
/**
|
|
35768
35826
|
* Present if the client supports listing roots.
|
|
35769
35827
|
*/
|
|
35770
|
-
roots:
|
|
35828
|
+
roots: z24.object({
|
|
35771
35829
|
/**
|
|
35772
35830
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
35773
35831
|
*/
|
|
35774
|
-
listChanged:
|
|
35832
|
+
listChanged: z24.boolean().optional()
|
|
35775
35833
|
}).optional(),
|
|
35776
35834
|
/**
|
|
35777
35835
|
* Present if the client supports task creation.
|
|
@@ -35780,25 +35838,25 @@ var init_types = __esm({
|
|
|
35780
35838
|
/**
|
|
35781
35839
|
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
35782
35840
|
*/
|
|
35783
|
-
extensions:
|
|
35841
|
+
extensions: z24.record(z24.string(), AssertObjectSchema).optional()
|
|
35784
35842
|
});
|
|
35785
35843
|
InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
35786
35844
|
/**
|
|
35787
35845
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
35788
35846
|
*/
|
|
35789
|
-
protocolVersion:
|
|
35847
|
+
protocolVersion: z24.string(),
|
|
35790
35848
|
capabilities: ClientCapabilitiesSchema,
|
|
35791
35849
|
clientInfo: ImplementationSchema
|
|
35792
35850
|
});
|
|
35793
35851
|
InitializeRequestSchema = RequestSchema.extend({
|
|
35794
|
-
method:
|
|
35852
|
+
method: z24.literal("initialize"),
|
|
35795
35853
|
params: InitializeRequestParamsSchema
|
|
35796
35854
|
});
|
|
35797
|
-
ServerCapabilitiesSchema =
|
|
35855
|
+
ServerCapabilitiesSchema = z24.object({
|
|
35798
35856
|
/**
|
|
35799
35857
|
* Experimental, non-standard capabilities that the server supports.
|
|
35800
35858
|
*/
|
|
35801
|
-
experimental:
|
|
35859
|
+
experimental: z24.record(z24.string(), AssertObjectSchema).optional(),
|
|
35802
35860
|
/**
|
|
35803
35861
|
* Present if the server supports sending log messages to the client.
|
|
35804
35862
|
*/
|
|
@@ -35810,33 +35868,33 @@ var init_types = __esm({
|
|
|
35810
35868
|
/**
|
|
35811
35869
|
* Present if the server offers any prompt templates.
|
|
35812
35870
|
*/
|
|
35813
|
-
prompts:
|
|
35871
|
+
prompts: z24.object({
|
|
35814
35872
|
/**
|
|
35815
35873
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
35816
35874
|
*/
|
|
35817
|
-
listChanged:
|
|
35875
|
+
listChanged: z24.boolean().optional()
|
|
35818
35876
|
}).optional(),
|
|
35819
35877
|
/**
|
|
35820
35878
|
* Present if the server offers any resources to read.
|
|
35821
35879
|
*/
|
|
35822
|
-
resources:
|
|
35880
|
+
resources: z24.object({
|
|
35823
35881
|
/**
|
|
35824
35882
|
* Whether this server supports clients subscribing to resource updates.
|
|
35825
35883
|
*/
|
|
35826
|
-
subscribe:
|
|
35884
|
+
subscribe: z24.boolean().optional(),
|
|
35827
35885
|
/**
|
|
35828
35886
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
35829
35887
|
*/
|
|
35830
|
-
listChanged:
|
|
35888
|
+
listChanged: z24.boolean().optional()
|
|
35831
35889
|
}).optional(),
|
|
35832
35890
|
/**
|
|
35833
35891
|
* Present if the server offers any tools to call.
|
|
35834
35892
|
*/
|
|
35835
|
-
tools:
|
|
35893
|
+
tools: z24.object({
|
|
35836
35894
|
/**
|
|
35837
35895
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
35838
35896
|
*/
|
|
35839
|
-
listChanged:
|
|
35897
|
+
listChanged: z24.boolean().optional()
|
|
35840
35898
|
}).optional(),
|
|
35841
35899
|
/**
|
|
35842
35900
|
* Present if the server supports task creation.
|
|
@@ -35845,13 +35903,13 @@ var init_types = __esm({
|
|
|
35845
35903
|
/**
|
|
35846
35904
|
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
35847
35905
|
*/
|
|
35848
|
-
extensions:
|
|
35906
|
+
extensions: z24.record(z24.string(), AssertObjectSchema).optional()
|
|
35849
35907
|
});
|
|
35850
35908
|
InitializeResultSchema = ResultSchema.extend({
|
|
35851
35909
|
/**
|
|
35852
35910
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
|
35853
35911
|
*/
|
|
35854
|
-
protocolVersion:
|
|
35912
|
+
protocolVersion: z24.string(),
|
|
35855
35913
|
capabilities: ServerCapabilitiesSchema,
|
|
35856
35914
|
serverInfo: ImplementationSchema,
|
|
35857
35915
|
/**
|
|
@@ -35859,32 +35917,32 @@ var init_types = __esm({
|
|
|
35859
35917
|
*
|
|
35860
35918
|
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
|
35861
35919
|
*/
|
|
35862
|
-
instructions:
|
|
35920
|
+
instructions: z24.string().optional()
|
|
35863
35921
|
});
|
|
35864
35922
|
InitializedNotificationSchema = NotificationSchema.extend({
|
|
35865
|
-
method:
|
|
35923
|
+
method: z24.literal("notifications/initialized"),
|
|
35866
35924
|
params: NotificationsParamsSchema.optional()
|
|
35867
35925
|
});
|
|
35868
35926
|
isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
|
|
35869
35927
|
PingRequestSchema = RequestSchema.extend({
|
|
35870
|
-
method:
|
|
35928
|
+
method: z24.literal("ping"),
|
|
35871
35929
|
params: BaseRequestParamsSchema.optional()
|
|
35872
35930
|
});
|
|
35873
|
-
ProgressSchema =
|
|
35931
|
+
ProgressSchema = z24.object({
|
|
35874
35932
|
/**
|
|
35875
35933
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
35876
35934
|
*/
|
|
35877
|
-
progress:
|
|
35935
|
+
progress: z24.number(),
|
|
35878
35936
|
/**
|
|
35879
35937
|
* Total number of items to process (or total progress required), if known.
|
|
35880
35938
|
*/
|
|
35881
|
-
total:
|
|
35939
|
+
total: z24.optional(z24.number()),
|
|
35882
35940
|
/**
|
|
35883
35941
|
* An optional message describing the current progress.
|
|
35884
35942
|
*/
|
|
35885
|
-
message:
|
|
35943
|
+
message: z24.optional(z24.string())
|
|
35886
35944
|
});
|
|
35887
|
-
ProgressNotificationParamsSchema =
|
|
35945
|
+
ProgressNotificationParamsSchema = z24.object({
|
|
35888
35946
|
...NotificationsParamsSchema.shape,
|
|
35889
35947
|
...ProgressSchema.shape,
|
|
35890
35948
|
/**
|
|
@@ -35893,7 +35951,7 @@ var init_types = __esm({
|
|
|
35893
35951
|
progressToken: ProgressTokenSchema
|
|
35894
35952
|
});
|
|
35895
35953
|
ProgressNotificationSchema = NotificationSchema.extend({
|
|
35896
|
-
method:
|
|
35954
|
+
method: z24.literal("notifications/progress"),
|
|
35897
35955
|
params: ProgressNotificationParamsSchema
|
|
35898
35956
|
});
|
|
35899
35957
|
PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -35913,86 +35971,86 @@ var init_types = __esm({
|
|
|
35913
35971
|
*/
|
|
35914
35972
|
nextCursor: CursorSchema.optional()
|
|
35915
35973
|
});
|
|
35916
|
-
TaskStatusSchema =
|
|
35917
|
-
TaskSchema =
|
|
35918
|
-
taskId:
|
|
35974
|
+
TaskStatusSchema = z24.enum(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
35975
|
+
TaskSchema = z24.object({
|
|
35976
|
+
taskId: z24.string(),
|
|
35919
35977
|
status: TaskStatusSchema,
|
|
35920
35978
|
/**
|
|
35921
35979
|
* Time in milliseconds to keep task results available after completion.
|
|
35922
35980
|
* If null, the task has unlimited lifetime until manually cleaned up.
|
|
35923
35981
|
*/
|
|
35924
|
-
ttl:
|
|
35982
|
+
ttl: z24.union([z24.number(), z24.null()]),
|
|
35925
35983
|
/**
|
|
35926
35984
|
* ISO 8601 timestamp when the task was created.
|
|
35927
35985
|
*/
|
|
35928
|
-
createdAt:
|
|
35986
|
+
createdAt: z24.string(),
|
|
35929
35987
|
/**
|
|
35930
35988
|
* ISO 8601 timestamp when the task was last updated.
|
|
35931
35989
|
*/
|
|
35932
|
-
lastUpdatedAt:
|
|
35933
|
-
pollInterval:
|
|
35990
|
+
lastUpdatedAt: z24.string(),
|
|
35991
|
+
pollInterval: z24.optional(z24.number()),
|
|
35934
35992
|
/**
|
|
35935
35993
|
* Optional diagnostic message for failed tasks or other status information.
|
|
35936
35994
|
*/
|
|
35937
|
-
statusMessage:
|
|
35995
|
+
statusMessage: z24.optional(z24.string())
|
|
35938
35996
|
});
|
|
35939
35997
|
CreateTaskResultSchema = ResultSchema.extend({
|
|
35940
35998
|
task: TaskSchema
|
|
35941
35999
|
});
|
|
35942
36000
|
TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
|
|
35943
36001
|
TaskStatusNotificationSchema = NotificationSchema.extend({
|
|
35944
|
-
method:
|
|
36002
|
+
method: z24.literal("notifications/tasks/status"),
|
|
35945
36003
|
params: TaskStatusNotificationParamsSchema
|
|
35946
36004
|
});
|
|
35947
36005
|
GetTaskRequestSchema = RequestSchema.extend({
|
|
35948
|
-
method:
|
|
36006
|
+
method: z24.literal("tasks/get"),
|
|
35949
36007
|
params: BaseRequestParamsSchema.extend({
|
|
35950
|
-
taskId:
|
|
36008
|
+
taskId: z24.string()
|
|
35951
36009
|
})
|
|
35952
36010
|
});
|
|
35953
36011
|
GetTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
35954
36012
|
GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
35955
|
-
method:
|
|
36013
|
+
method: z24.literal("tasks/result"),
|
|
35956
36014
|
params: BaseRequestParamsSchema.extend({
|
|
35957
|
-
taskId:
|
|
36015
|
+
taskId: z24.string()
|
|
35958
36016
|
})
|
|
35959
36017
|
});
|
|
35960
36018
|
ResultSchema.loose();
|
|
35961
36019
|
ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
35962
|
-
method:
|
|
36020
|
+
method: z24.literal("tasks/list")
|
|
35963
36021
|
});
|
|
35964
36022
|
ListTasksResultSchema = PaginatedResultSchema.extend({
|
|
35965
|
-
tasks:
|
|
36023
|
+
tasks: z24.array(TaskSchema)
|
|
35966
36024
|
});
|
|
35967
36025
|
CancelTaskRequestSchema = RequestSchema.extend({
|
|
35968
|
-
method:
|
|
36026
|
+
method: z24.literal("tasks/cancel"),
|
|
35969
36027
|
params: BaseRequestParamsSchema.extend({
|
|
35970
|
-
taskId:
|
|
36028
|
+
taskId: z24.string()
|
|
35971
36029
|
})
|
|
35972
36030
|
});
|
|
35973
36031
|
CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
|
|
35974
|
-
ResourceContentsSchema =
|
|
36032
|
+
ResourceContentsSchema = z24.object({
|
|
35975
36033
|
/**
|
|
35976
36034
|
* The URI of this resource.
|
|
35977
36035
|
*/
|
|
35978
|
-
uri:
|
|
36036
|
+
uri: z24.string(),
|
|
35979
36037
|
/**
|
|
35980
36038
|
* The MIME type of this resource, if known.
|
|
35981
36039
|
*/
|
|
35982
|
-
mimeType:
|
|
36040
|
+
mimeType: z24.optional(z24.string()),
|
|
35983
36041
|
/**
|
|
35984
36042
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
35985
36043
|
* for notes on _meta usage.
|
|
35986
36044
|
*/
|
|
35987
|
-
_meta:
|
|
36045
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
35988
36046
|
});
|
|
35989
36047
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
35990
36048
|
/**
|
|
35991
36049
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
35992
36050
|
*/
|
|
35993
|
-
text:
|
|
36051
|
+
text: z24.string()
|
|
35994
36052
|
});
|
|
35995
|
-
Base64Schema =
|
|
36053
|
+
Base64Schema = z24.string().refine((val) => {
|
|
35996
36054
|
try {
|
|
35997
36055
|
atob(val);
|
|
35998
36056
|
return true;
|
|
@@ -36006,44 +36064,44 @@ var init_types = __esm({
|
|
|
36006
36064
|
*/
|
|
36007
36065
|
blob: Base64Schema
|
|
36008
36066
|
});
|
|
36009
|
-
RoleSchema =
|
|
36010
|
-
AnnotationsSchema =
|
|
36067
|
+
RoleSchema = z24.enum(["user", "assistant"]);
|
|
36068
|
+
AnnotationsSchema = z24.object({
|
|
36011
36069
|
/**
|
|
36012
36070
|
* Intended audience(s) for the resource.
|
|
36013
36071
|
*/
|
|
36014
|
-
audience:
|
|
36072
|
+
audience: z24.array(RoleSchema).optional(),
|
|
36015
36073
|
/**
|
|
36016
36074
|
* Importance hint for the resource, from 0 (least) to 1 (most).
|
|
36017
36075
|
*/
|
|
36018
|
-
priority:
|
|
36076
|
+
priority: z24.number().min(0).max(1).optional(),
|
|
36019
36077
|
/**
|
|
36020
36078
|
* ISO 8601 timestamp for the most recent modification.
|
|
36021
36079
|
*/
|
|
36022
|
-
lastModified:
|
|
36080
|
+
lastModified: z24.iso.datetime({ offset: true }).optional()
|
|
36023
36081
|
});
|
|
36024
|
-
ResourceSchema =
|
|
36082
|
+
ResourceSchema = z24.object({
|
|
36025
36083
|
...BaseMetadataSchema.shape,
|
|
36026
36084
|
...IconsSchema.shape,
|
|
36027
36085
|
/**
|
|
36028
36086
|
* The URI of this resource.
|
|
36029
36087
|
*/
|
|
36030
|
-
uri:
|
|
36088
|
+
uri: z24.string(),
|
|
36031
36089
|
/**
|
|
36032
36090
|
* A description of what this resource represents.
|
|
36033
36091
|
*
|
|
36034
36092
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
36035
36093
|
*/
|
|
36036
|
-
description:
|
|
36094
|
+
description: z24.optional(z24.string()),
|
|
36037
36095
|
/**
|
|
36038
36096
|
* The MIME type of this resource, if known.
|
|
36039
36097
|
*/
|
|
36040
|
-
mimeType:
|
|
36098
|
+
mimeType: z24.optional(z24.string()),
|
|
36041
36099
|
/**
|
|
36042
36100
|
* The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known.
|
|
36043
36101
|
*
|
|
36044
36102
|
* This can be used by Hosts to display file sizes and estimate context window usage.
|
|
36045
36103
|
*/
|
|
36046
|
-
size:
|
|
36104
|
+
size: z24.optional(z24.number()),
|
|
36047
36105
|
/**
|
|
36048
36106
|
* Optional annotations for the client.
|
|
36049
36107
|
*/
|
|
@@ -36052,25 +36110,25 @@ var init_types = __esm({
|
|
|
36052
36110
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36053
36111
|
* for notes on _meta usage.
|
|
36054
36112
|
*/
|
|
36055
|
-
_meta:
|
|
36113
|
+
_meta: z24.optional(z24.looseObject({}))
|
|
36056
36114
|
});
|
|
36057
|
-
ResourceTemplateSchema =
|
|
36115
|
+
ResourceTemplateSchema = z24.object({
|
|
36058
36116
|
...BaseMetadataSchema.shape,
|
|
36059
36117
|
...IconsSchema.shape,
|
|
36060
36118
|
/**
|
|
36061
36119
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
36062
36120
|
*/
|
|
36063
|
-
uriTemplate:
|
|
36121
|
+
uriTemplate: z24.string(),
|
|
36064
36122
|
/**
|
|
36065
36123
|
* A description of what this template is for.
|
|
36066
36124
|
*
|
|
36067
36125
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
36068
36126
|
*/
|
|
36069
|
-
description:
|
|
36127
|
+
description: z24.optional(z24.string()),
|
|
36070
36128
|
/**
|
|
36071
36129
|
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
36072
36130
|
*/
|
|
36073
|
-
mimeType:
|
|
36131
|
+
mimeType: z24.optional(z24.string()),
|
|
36074
36132
|
/**
|
|
36075
36133
|
* Optional annotations for the client.
|
|
36076
36134
|
*/
|
|
@@ -36079,19 +36137,19 @@ var init_types = __esm({
|
|
|
36079
36137
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36080
36138
|
* for notes on _meta usage.
|
|
36081
36139
|
*/
|
|
36082
|
-
_meta:
|
|
36140
|
+
_meta: z24.optional(z24.looseObject({}))
|
|
36083
36141
|
});
|
|
36084
36142
|
ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
36085
|
-
method:
|
|
36143
|
+
method: z24.literal("resources/list")
|
|
36086
36144
|
});
|
|
36087
36145
|
ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
36088
|
-
resources:
|
|
36146
|
+
resources: z24.array(ResourceSchema)
|
|
36089
36147
|
});
|
|
36090
36148
|
ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
36091
|
-
method:
|
|
36149
|
+
method: z24.literal("resources/templates/list")
|
|
36092
36150
|
});
|
|
36093
36151
|
ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
36094
|
-
resourceTemplates:
|
|
36152
|
+
resourceTemplates: z24.array(ResourceTemplateSchema)
|
|
36095
36153
|
});
|
|
36096
36154
|
ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
36097
36155
|
/**
|
|
@@ -36099,97 +36157,97 @@ var init_types = __esm({
|
|
|
36099
36157
|
*
|
|
36100
36158
|
* @format uri
|
|
36101
36159
|
*/
|
|
36102
|
-
uri:
|
|
36160
|
+
uri: z24.string()
|
|
36103
36161
|
});
|
|
36104
36162
|
ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
36105
36163
|
ReadResourceRequestSchema = RequestSchema.extend({
|
|
36106
|
-
method:
|
|
36164
|
+
method: z24.literal("resources/read"),
|
|
36107
36165
|
params: ReadResourceRequestParamsSchema
|
|
36108
36166
|
});
|
|
36109
36167
|
ReadResourceResultSchema = ResultSchema.extend({
|
|
36110
|
-
contents:
|
|
36168
|
+
contents: z24.array(z24.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
36111
36169
|
});
|
|
36112
36170
|
ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
36113
|
-
method:
|
|
36171
|
+
method: z24.literal("notifications/resources/list_changed"),
|
|
36114
36172
|
params: NotificationsParamsSchema.optional()
|
|
36115
36173
|
});
|
|
36116
36174
|
SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
36117
36175
|
SubscribeRequestSchema = RequestSchema.extend({
|
|
36118
|
-
method:
|
|
36176
|
+
method: z24.literal("resources/subscribe"),
|
|
36119
36177
|
params: SubscribeRequestParamsSchema
|
|
36120
36178
|
});
|
|
36121
36179
|
UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
36122
36180
|
UnsubscribeRequestSchema = RequestSchema.extend({
|
|
36123
|
-
method:
|
|
36181
|
+
method: z24.literal("resources/unsubscribe"),
|
|
36124
36182
|
params: UnsubscribeRequestParamsSchema
|
|
36125
36183
|
});
|
|
36126
36184
|
ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
36127
36185
|
/**
|
|
36128
36186
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
36129
36187
|
*/
|
|
36130
|
-
uri:
|
|
36188
|
+
uri: z24.string()
|
|
36131
36189
|
});
|
|
36132
36190
|
ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
36133
|
-
method:
|
|
36191
|
+
method: z24.literal("notifications/resources/updated"),
|
|
36134
36192
|
params: ResourceUpdatedNotificationParamsSchema
|
|
36135
36193
|
});
|
|
36136
|
-
PromptArgumentSchema =
|
|
36194
|
+
PromptArgumentSchema = z24.object({
|
|
36137
36195
|
/**
|
|
36138
36196
|
* The name of the argument.
|
|
36139
36197
|
*/
|
|
36140
|
-
name:
|
|
36198
|
+
name: z24.string(),
|
|
36141
36199
|
/**
|
|
36142
36200
|
* A human-readable description of the argument.
|
|
36143
36201
|
*/
|
|
36144
|
-
description:
|
|
36202
|
+
description: z24.optional(z24.string()),
|
|
36145
36203
|
/**
|
|
36146
36204
|
* Whether this argument must be provided.
|
|
36147
36205
|
*/
|
|
36148
|
-
required:
|
|
36206
|
+
required: z24.optional(z24.boolean())
|
|
36149
36207
|
});
|
|
36150
|
-
PromptSchema =
|
|
36208
|
+
PromptSchema = z24.object({
|
|
36151
36209
|
...BaseMetadataSchema.shape,
|
|
36152
36210
|
...IconsSchema.shape,
|
|
36153
36211
|
/**
|
|
36154
36212
|
* An optional description of what this prompt provides
|
|
36155
36213
|
*/
|
|
36156
|
-
description:
|
|
36214
|
+
description: z24.optional(z24.string()),
|
|
36157
36215
|
/**
|
|
36158
36216
|
* A list of arguments to use for templating the prompt.
|
|
36159
36217
|
*/
|
|
36160
|
-
arguments:
|
|
36218
|
+
arguments: z24.optional(z24.array(PromptArgumentSchema)),
|
|
36161
36219
|
/**
|
|
36162
36220
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36163
36221
|
* for notes on _meta usage.
|
|
36164
36222
|
*/
|
|
36165
|
-
_meta:
|
|
36223
|
+
_meta: z24.optional(z24.looseObject({}))
|
|
36166
36224
|
});
|
|
36167
36225
|
ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
36168
|
-
method:
|
|
36226
|
+
method: z24.literal("prompts/list")
|
|
36169
36227
|
});
|
|
36170
36228
|
ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
36171
|
-
prompts:
|
|
36229
|
+
prompts: z24.array(PromptSchema)
|
|
36172
36230
|
});
|
|
36173
36231
|
GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
36174
36232
|
/**
|
|
36175
36233
|
* The name of the prompt or prompt template.
|
|
36176
36234
|
*/
|
|
36177
|
-
name:
|
|
36235
|
+
name: z24.string(),
|
|
36178
36236
|
/**
|
|
36179
36237
|
* Arguments to use for templating the prompt.
|
|
36180
36238
|
*/
|
|
36181
|
-
arguments:
|
|
36239
|
+
arguments: z24.record(z24.string(), z24.string()).optional()
|
|
36182
36240
|
});
|
|
36183
36241
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
36184
|
-
method:
|
|
36242
|
+
method: z24.literal("prompts/get"),
|
|
36185
36243
|
params: GetPromptRequestParamsSchema
|
|
36186
36244
|
});
|
|
36187
|
-
TextContentSchema =
|
|
36188
|
-
type:
|
|
36245
|
+
TextContentSchema = z24.object({
|
|
36246
|
+
type: z24.literal("text"),
|
|
36189
36247
|
/**
|
|
36190
36248
|
* The text content of the message.
|
|
36191
36249
|
*/
|
|
36192
|
-
text:
|
|
36250
|
+
text: z24.string(),
|
|
36193
36251
|
/**
|
|
36194
36252
|
* Optional annotations for the client.
|
|
36195
36253
|
*/
|
|
@@ -36198,10 +36256,10 @@ var init_types = __esm({
|
|
|
36198
36256
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36199
36257
|
* for notes on _meta usage.
|
|
36200
36258
|
*/
|
|
36201
|
-
_meta:
|
|
36259
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36202
36260
|
});
|
|
36203
|
-
ImageContentSchema =
|
|
36204
|
-
type:
|
|
36261
|
+
ImageContentSchema = z24.object({
|
|
36262
|
+
type: z24.literal("image"),
|
|
36205
36263
|
/**
|
|
36206
36264
|
* The base64-encoded image data.
|
|
36207
36265
|
*/
|
|
@@ -36209,7 +36267,7 @@ var init_types = __esm({
|
|
|
36209
36267
|
/**
|
|
36210
36268
|
* The MIME type of the image. Different providers may support different image types.
|
|
36211
36269
|
*/
|
|
36212
|
-
mimeType:
|
|
36270
|
+
mimeType: z24.string(),
|
|
36213
36271
|
/**
|
|
36214
36272
|
* Optional annotations for the client.
|
|
36215
36273
|
*/
|
|
@@ -36218,10 +36276,10 @@ var init_types = __esm({
|
|
|
36218
36276
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36219
36277
|
* for notes on _meta usage.
|
|
36220
36278
|
*/
|
|
36221
|
-
_meta:
|
|
36279
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36222
36280
|
});
|
|
36223
|
-
AudioContentSchema =
|
|
36224
|
-
type:
|
|
36281
|
+
AudioContentSchema = z24.object({
|
|
36282
|
+
type: z24.literal("audio"),
|
|
36225
36283
|
/**
|
|
36226
36284
|
* The base64-encoded audio data.
|
|
36227
36285
|
*/
|
|
@@ -36229,7 +36287,7 @@ var init_types = __esm({
|
|
|
36229
36287
|
/**
|
|
36230
36288
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
36231
36289
|
*/
|
|
36232
|
-
mimeType:
|
|
36290
|
+
mimeType: z24.string(),
|
|
36233
36291
|
/**
|
|
36234
36292
|
* Optional annotations for the client.
|
|
36235
36293
|
*/
|
|
@@ -36238,34 +36296,34 @@ var init_types = __esm({
|
|
|
36238
36296
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36239
36297
|
* for notes on _meta usage.
|
|
36240
36298
|
*/
|
|
36241
|
-
_meta:
|
|
36299
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36242
36300
|
});
|
|
36243
|
-
ToolUseContentSchema =
|
|
36244
|
-
type:
|
|
36301
|
+
ToolUseContentSchema = z24.object({
|
|
36302
|
+
type: z24.literal("tool_use"),
|
|
36245
36303
|
/**
|
|
36246
36304
|
* The name of the tool to invoke.
|
|
36247
36305
|
* Must match a tool name from the request's tools array.
|
|
36248
36306
|
*/
|
|
36249
|
-
name:
|
|
36307
|
+
name: z24.string(),
|
|
36250
36308
|
/**
|
|
36251
36309
|
* Unique identifier for this tool call.
|
|
36252
36310
|
* Used to correlate with ToolResultContent in subsequent messages.
|
|
36253
36311
|
*/
|
|
36254
|
-
id:
|
|
36312
|
+
id: z24.string(),
|
|
36255
36313
|
/**
|
|
36256
36314
|
* Arguments to pass to the tool.
|
|
36257
36315
|
* Must conform to the tool's inputSchema.
|
|
36258
36316
|
*/
|
|
36259
|
-
input:
|
|
36317
|
+
input: z24.record(z24.string(), z24.unknown()),
|
|
36260
36318
|
/**
|
|
36261
36319
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36262
36320
|
* for notes on _meta usage.
|
|
36263
36321
|
*/
|
|
36264
|
-
_meta:
|
|
36322
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36265
36323
|
});
|
|
36266
|
-
EmbeddedResourceSchema =
|
|
36267
|
-
type:
|
|
36268
|
-
resource:
|
|
36324
|
+
EmbeddedResourceSchema = z24.object({
|
|
36325
|
+
type: z24.literal("resource"),
|
|
36326
|
+
resource: z24.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
36269
36327
|
/**
|
|
36270
36328
|
* Optional annotations for the client.
|
|
36271
36329
|
*/
|
|
@@ -36274,19 +36332,19 @@ var init_types = __esm({
|
|
|
36274
36332
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36275
36333
|
* for notes on _meta usage.
|
|
36276
36334
|
*/
|
|
36277
|
-
_meta:
|
|
36335
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36278
36336
|
});
|
|
36279
36337
|
ResourceLinkSchema = ResourceSchema.extend({
|
|
36280
|
-
type:
|
|
36338
|
+
type: z24.literal("resource_link")
|
|
36281
36339
|
});
|
|
36282
|
-
ContentBlockSchema =
|
|
36340
|
+
ContentBlockSchema = z24.union([
|
|
36283
36341
|
TextContentSchema,
|
|
36284
36342
|
ImageContentSchema,
|
|
36285
36343
|
AudioContentSchema,
|
|
36286
36344
|
ResourceLinkSchema,
|
|
36287
36345
|
EmbeddedResourceSchema
|
|
36288
36346
|
]);
|
|
36289
|
-
PromptMessageSchema =
|
|
36347
|
+
PromptMessageSchema = z24.object({
|
|
36290
36348
|
role: RoleSchema,
|
|
36291
36349
|
content: ContentBlockSchema
|
|
36292
36350
|
});
|
|
@@ -36294,24 +36352,24 @@ var init_types = __esm({
|
|
|
36294
36352
|
/**
|
|
36295
36353
|
* An optional description for the prompt.
|
|
36296
36354
|
*/
|
|
36297
|
-
description:
|
|
36298
|
-
messages:
|
|
36355
|
+
description: z24.string().optional(),
|
|
36356
|
+
messages: z24.array(PromptMessageSchema)
|
|
36299
36357
|
});
|
|
36300
36358
|
PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
36301
|
-
method:
|
|
36359
|
+
method: z24.literal("notifications/prompts/list_changed"),
|
|
36302
36360
|
params: NotificationsParamsSchema.optional()
|
|
36303
36361
|
});
|
|
36304
|
-
ToolAnnotationsSchema =
|
|
36362
|
+
ToolAnnotationsSchema = z24.object({
|
|
36305
36363
|
/**
|
|
36306
36364
|
* A human-readable title for the tool.
|
|
36307
36365
|
*/
|
|
36308
|
-
title:
|
|
36366
|
+
title: z24.string().optional(),
|
|
36309
36367
|
/**
|
|
36310
36368
|
* If true, the tool does not modify its environment.
|
|
36311
36369
|
*
|
|
36312
36370
|
* Default: false
|
|
36313
36371
|
*/
|
|
36314
|
-
readOnlyHint:
|
|
36372
|
+
readOnlyHint: z24.boolean().optional(),
|
|
36315
36373
|
/**
|
|
36316
36374
|
* If true, the tool may perform destructive updates to its environment.
|
|
36317
36375
|
* If false, the tool performs only additive updates.
|
|
@@ -36320,7 +36378,7 @@ var init_types = __esm({
|
|
|
36320
36378
|
*
|
|
36321
36379
|
* Default: true
|
|
36322
36380
|
*/
|
|
36323
|
-
destructiveHint:
|
|
36381
|
+
destructiveHint: z24.boolean().optional(),
|
|
36324
36382
|
/**
|
|
36325
36383
|
* If true, calling the tool repeatedly with the same arguments
|
|
36326
36384
|
* will have no additional effect on the its environment.
|
|
@@ -36329,7 +36387,7 @@ var init_types = __esm({
|
|
|
36329
36387
|
*
|
|
36330
36388
|
* Default: false
|
|
36331
36389
|
*/
|
|
36332
|
-
idempotentHint:
|
|
36390
|
+
idempotentHint: z24.boolean().optional(),
|
|
36333
36391
|
/**
|
|
36334
36392
|
* If true, this tool may interact with an "open world" of external
|
|
36335
36393
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -36338,9 +36396,9 @@ var init_types = __esm({
|
|
|
36338
36396
|
*
|
|
36339
36397
|
* Default: true
|
|
36340
36398
|
*/
|
|
36341
|
-
openWorldHint:
|
|
36399
|
+
openWorldHint: z24.boolean().optional()
|
|
36342
36400
|
});
|
|
36343
|
-
ToolExecutionSchema =
|
|
36401
|
+
ToolExecutionSchema = z24.object({
|
|
36344
36402
|
/**
|
|
36345
36403
|
* Indicates the tool's preference for task-augmented execution.
|
|
36346
36404
|
* - "required": Clients MUST invoke the tool as a task
|
|
@@ -36349,34 +36407,34 @@ var init_types = __esm({
|
|
|
36349
36407
|
*
|
|
36350
36408
|
* If not present, defaults to "forbidden".
|
|
36351
36409
|
*/
|
|
36352
|
-
taskSupport:
|
|
36410
|
+
taskSupport: z24.enum(["required", "optional", "forbidden"]).optional()
|
|
36353
36411
|
});
|
|
36354
|
-
ToolSchema =
|
|
36412
|
+
ToolSchema = z24.object({
|
|
36355
36413
|
...BaseMetadataSchema.shape,
|
|
36356
36414
|
...IconsSchema.shape,
|
|
36357
36415
|
/**
|
|
36358
36416
|
* A human-readable description of the tool.
|
|
36359
36417
|
*/
|
|
36360
|
-
description:
|
|
36418
|
+
description: z24.string().optional(),
|
|
36361
36419
|
/**
|
|
36362
36420
|
* A JSON Schema 2020-12 object defining the expected parameters for the tool.
|
|
36363
36421
|
* Must have type: 'object' at the root level per MCP spec.
|
|
36364
36422
|
*/
|
|
36365
|
-
inputSchema:
|
|
36366
|
-
type:
|
|
36367
|
-
properties:
|
|
36368
|
-
required:
|
|
36369
|
-
}).catchall(
|
|
36423
|
+
inputSchema: z24.object({
|
|
36424
|
+
type: z24.literal("object"),
|
|
36425
|
+
properties: z24.record(z24.string(), AssertObjectSchema).optional(),
|
|
36426
|
+
required: z24.array(z24.string()).optional()
|
|
36427
|
+
}).catchall(z24.unknown()),
|
|
36370
36428
|
/**
|
|
36371
36429
|
* An optional JSON Schema 2020-12 object defining the structure of the tool's output
|
|
36372
36430
|
* returned in the structuredContent field of a CallToolResult.
|
|
36373
36431
|
* Must have type: 'object' at the root level per MCP spec.
|
|
36374
36432
|
*/
|
|
36375
|
-
outputSchema:
|
|
36376
|
-
type:
|
|
36377
|
-
properties:
|
|
36378
|
-
required:
|
|
36379
|
-
}).catchall(
|
|
36433
|
+
outputSchema: z24.object({
|
|
36434
|
+
type: z24.literal("object"),
|
|
36435
|
+
properties: z24.record(z24.string(), AssertObjectSchema).optional(),
|
|
36436
|
+
required: z24.array(z24.string()).optional()
|
|
36437
|
+
}).catchall(z24.unknown()).optional(),
|
|
36380
36438
|
/**
|
|
36381
36439
|
* Optional additional tool information.
|
|
36382
36440
|
*/
|
|
@@ -36389,13 +36447,13 @@ var init_types = __esm({
|
|
|
36389
36447
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36390
36448
|
* for notes on _meta usage.
|
|
36391
36449
|
*/
|
|
36392
|
-
_meta:
|
|
36450
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36393
36451
|
});
|
|
36394
36452
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
36395
|
-
method:
|
|
36453
|
+
method: z24.literal("tools/list")
|
|
36396
36454
|
});
|
|
36397
36455
|
ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
36398
|
-
tools:
|
|
36456
|
+
tools: z24.array(ToolSchema)
|
|
36399
36457
|
});
|
|
36400
36458
|
CallToolResultSchema = ResultSchema.extend({
|
|
36401
36459
|
/**
|
|
@@ -36404,13 +36462,13 @@ var init_types = __esm({
|
|
|
36404
36462
|
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
36405
36463
|
* For backwards compatibility, this field is always present, but it may be empty.
|
|
36406
36464
|
*/
|
|
36407
|
-
content:
|
|
36465
|
+
content: z24.array(ContentBlockSchema).default([]),
|
|
36408
36466
|
/**
|
|
36409
36467
|
* An object containing structured tool output.
|
|
36410
36468
|
*
|
|
36411
36469
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
36412
36470
|
*/
|
|
36413
|
-
structuredContent:
|
|
36471
|
+
structuredContent: z24.record(z24.string(), z24.unknown()).optional(),
|
|
36414
36472
|
/**
|
|
36415
36473
|
* Whether the tool call ended in an error.
|
|
36416
36474
|
*
|
|
@@ -36425,30 +36483,30 @@ var init_types = __esm({
|
|
|
36425
36483
|
* server does not support tool calls, or any other exceptional conditions,
|
|
36426
36484
|
* should be reported as an MCP error response.
|
|
36427
36485
|
*/
|
|
36428
|
-
isError:
|
|
36486
|
+
isError: z24.boolean().optional()
|
|
36429
36487
|
});
|
|
36430
36488
|
CallToolResultSchema.or(ResultSchema.extend({
|
|
36431
|
-
toolResult:
|
|
36489
|
+
toolResult: z24.unknown()
|
|
36432
36490
|
}));
|
|
36433
36491
|
CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
36434
36492
|
/**
|
|
36435
36493
|
* The name of the tool to call.
|
|
36436
36494
|
*/
|
|
36437
|
-
name:
|
|
36495
|
+
name: z24.string(),
|
|
36438
36496
|
/**
|
|
36439
36497
|
* Arguments to pass to the tool.
|
|
36440
36498
|
*/
|
|
36441
|
-
arguments:
|
|
36499
|
+
arguments: z24.record(z24.string(), z24.unknown()).optional()
|
|
36442
36500
|
});
|
|
36443
36501
|
CallToolRequestSchema = RequestSchema.extend({
|
|
36444
|
-
method:
|
|
36502
|
+
method: z24.literal("tools/call"),
|
|
36445
36503
|
params: CallToolRequestParamsSchema
|
|
36446
36504
|
});
|
|
36447
36505
|
ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
36448
|
-
method:
|
|
36506
|
+
method: z24.literal("notifications/tools/list_changed"),
|
|
36449
36507
|
params: NotificationsParamsSchema.optional()
|
|
36450
36508
|
});
|
|
36451
|
-
ListChangedOptionsBaseSchema =
|
|
36509
|
+
ListChangedOptionsBaseSchema = z24.object({
|
|
36452
36510
|
/**
|
|
36453
36511
|
* If true, the list will be refreshed automatically when a list changed notification is received.
|
|
36454
36512
|
* The callback will be called with the updated list.
|
|
@@ -36457,7 +36515,7 @@ var init_types = __esm({
|
|
|
36457
36515
|
*
|
|
36458
36516
|
* @default true
|
|
36459
36517
|
*/
|
|
36460
|
-
autoRefresh:
|
|
36518
|
+
autoRefresh: z24.boolean().default(true),
|
|
36461
36519
|
/**
|
|
36462
36520
|
* Debounce time in milliseconds for list changed notification processing.
|
|
36463
36521
|
*
|
|
@@ -36466,9 +36524,9 @@ var init_types = __esm({
|
|
|
36466
36524
|
*
|
|
36467
36525
|
* @default 300
|
|
36468
36526
|
*/
|
|
36469
|
-
debounceMs:
|
|
36527
|
+
debounceMs: z24.number().int().nonnegative().default(300)
|
|
36470
36528
|
});
|
|
36471
|
-
LoggingLevelSchema =
|
|
36529
|
+
LoggingLevelSchema = z24.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
36472
36530
|
SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
36473
36531
|
/**
|
|
36474
36532
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
|
@@ -36476,7 +36534,7 @@ var init_types = __esm({
|
|
|
36476
36534
|
level: LoggingLevelSchema
|
|
36477
36535
|
});
|
|
36478
36536
|
SetLevelRequestSchema = RequestSchema.extend({
|
|
36479
|
-
method:
|
|
36537
|
+
method: z24.literal("logging/setLevel"),
|
|
36480
36538
|
params: SetLevelRequestParamsSchema
|
|
36481
36539
|
});
|
|
36482
36540
|
LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
@@ -36487,80 +36545,80 @@ var init_types = __esm({
|
|
|
36487
36545
|
/**
|
|
36488
36546
|
* An optional name of the logger issuing this message.
|
|
36489
36547
|
*/
|
|
36490
|
-
logger:
|
|
36548
|
+
logger: z24.string().optional(),
|
|
36491
36549
|
/**
|
|
36492
36550
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
36493
36551
|
*/
|
|
36494
|
-
data:
|
|
36552
|
+
data: z24.unknown()
|
|
36495
36553
|
});
|
|
36496
36554
|
LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
36497
|
-
method:
|
|
36555
|
+
method: z24.literal("notifications/message"),
|
|
36498
36556
|
params: LoggingMessageNotificationParamsSchema
|
|
36499
36557
|
});
|
|
36500
|
-
ModelHintSchema =
|
|
36558
|
+
ModelHintSchema = z24.object({
|
|
36501
36559
|
/**
|
|
36502
36560
|
* A hint for a model name.
|
|
36503
36561
|
*/
|
|
36504
|
-
name:
|
|
36562
|
+
name: z24.string().optional()
|
|
36505
36563
|
});
|
|
36506
|
-
ModelPreferencesSchema =
|
|
36564
|
+
ModelPreferencesSchema = z24.object({
|
|
36507
36565
|
/**
|
|
36508
36566
|
* Optional hints to use for model selection.
|
|
36509
36567
|
*/
|
|
36510
|
-
hints:
|
|
36568
|
+
hints: z24.array(ModelHintSchema).optional(),
|
|
36511
36569
|
/**
|
|
36512
36570
|
* How much to prioritize cost when selecting a model.
|
|
36513
36571
|
*/
|
|
36514
|
-
costPriority:
|
|
36572
|
+
costPriority: z24.number().min(0).max(1).optional(),
|
|
36515
36573
|
/**
|
|
36516
36574
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
36517
36575
|
*/
|
|
36518
|
-
speedPriority:
|
|
36576
|
+
speedPriority: z24.number().min(0).max(1).optional(),
|
|
36519
36577
|
/**
|
|
36520
36578
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
36521
36579
|
*/
|
|
36522
|
-
intelligencePriority:
|
|
36580
|
+
intelligencePriority: z24.number().min(0).max(1).optional()
|
|
36523
36581
|
});
|
|
36524
|
-
ToolChoiceSchema =
|
|
36582
|
+
ToolChoiceSchema = z24.object({
|
|
36525
36583
|
/**
|
|
36526
36584
|
* Controls when tools are used:
|
|
36527
36585
|
* - "auto": Model decides whether to use tools (default)
|
|
36528
36586
|
* - "required": Model MUST use at least one tool before completing
|
|
36529
36587
|
* - "none": Model MUST NOT use any tools
|
|
36530
36588
|
*/
|
|
36531
|
-
mode:
|
|
36589
|
+
mode: z24.enum(["auto", "required", "none"]).optional()
|
|
36532
36590
|
});
|
|
36533
|
-
ToolResultContentSchema =
|
|
36534
|
-
type:
|
|
36535
|
-
toolUseId:
|
|
36536
|
-
content:
|
|
36537
|
-
structuredContent:
|
|
36538
|
-
isError:
|
|
36591
|
+
ToolResultContentSchema = z24.object({
|
|
36592
|
+
type: z24.literal("tool_result"),
|
|
36593
|
+
toolUseId: z24.string().describe("The unique identifier for the corresponding tool call."),
|
|
36594
|
+
content: z24.array(ContentBlockSchema).default([]),
|
|
36595
|
+
structuredContent: z24.object({}).loose().optional(),
|
|
36596
|
+
isError: z24.boolean().optional(),
|
|
36539
36597
|
/**
|
|
36540
36598
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36541
36599
|
* for notes on _meta usage.
|
|
36542
36600
|
*/
|
|
36543
|
-
_meta:
|
|
36601
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36544
36602
|
});
|
|
36545
|
-
SamplingContentSchema =
|
|
36546
|
-
SamplingMessageContentBlockSchema =
|
|
36603
|
+
SamplingContentSchema = z24.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
36604
|
+
SamplingMessageContentBlockSchema = z24.discriminatedUnion("type", [
|
|
36547
36605
|
TextContentSchema,
|
|
36548
36606
|
ImageContentSchema,
|
|
36549
36607
|
AudioContentSchema,
|
|
36550
36608
|
ToolUseContentSchema,
|
|
36551
36609
|
ToolResultContentSchema
|
|
36552
36610
|
]);
|
|
36553
|
-
SamplingMessageSchema =
|
|
36611
|
+
SamplingMessageSchema = z24.object({
|
|
36554
36612
|
role: RoleSchema,
|
|
36555
|
-
content:
|
|
36613
|
+
content: z24.union([SamplingMessageContentBlockSchema, z24.array(SamplingMessageContentBlockSchema)]),
|
|
36556
36614
|
/**
|
|
36557
36615
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36558
36616
|
* for notes on _meta usage.
|
|
36559
36617
|
*/
|
|
36560
|
-
_meta:
|
|
36618
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36561
36619
|
});
|
|
36562
36620
|
CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
36563
|
-
messages:
|
|
36621
|
+
messages: z24.array(SamplingMessageSchema),
|
|
36564
36622
|
/**
|
|
36565
36623
|
* The server's preferences for which model to select. The client MAY modify or omit this request.
|
|
36566
36624
|
*/
|
|
@@ -36568,7 +36626,7 @@ var init_types = __esm({
|
|
|
36568
36626
|
/**
|
|
36569
36627
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
36570
36628
|
*/
|
|
36571
|
-
systemPrompt:
|
|
36629
|
+
systemPrompt: z24.string().optional(),
|
|
36572
36630
|
/**
|
|
36573
36631
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
|
|
36574
36632
|
* The client MAY ignore this request.
|
|
@@ -36576,15 +36634,15 @@ var init_types = __esm({
|
|
|
36576
36634
|
* Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
|
|
36577
36635
|
* declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
|
|
36578
36636
|
*/
|
|
36579
|
-
includeContext:
|
|
36580
|
-
temperature:
|
|
36637
|
+
includeContext: z24.enum(["none", "thisServer", "allServers"]).optional(),
|
|
36638
|
+
temperature: z24.number().optional(),
|
|
36581
36639
|
/**
|
|
36582
36640
|
* The requested maximum number of tokens to sample (to prevent runaway completions).
|
|
36583
36641
|
*
|
|
36584
36642
|
* The client MAY choose to sample fewer tokens than the requested maximum.
|
|
36585
36643
|
*/
|
|
36586
|
-
maxTokens:
|
|
36587
|
-
stopSequences:
|
|
36644
|
+
maxTokens: z24.number().int(),
|
|
36645
|
+
stopSequences: z24.array(z24.string()).optional(),
|
|
36588
36646
|
/**
|
|
36589
36647
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
36590
36648
|
*/
|
|
@@ -36593,7 +36651,7 @@ var init_types = __esm({
|
|
|
36593
36651
|
* Tools that the model may use during generation.
|
|
36594
36652
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
36595
36653
|
*/
|
|
36596
|
-
tools:
|
|
36654
|
+
tools: z24.array(ToolSchema).optional(),
|
|
36597
36655
|
/**
|
|
36598
36656
|
* Controls how the model uses tools.
|
|
36599
36657
|
* The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
|
|
@@ -36602,14 +36660,14 @@ var init_types = __esm({
|
|
|
36602
36660
|
toolChoice: ToolChoiceSchema.optional()
|
|
36603
36661
|
});
|
|
36604
36662
|
CreateMessageRequestSchema = RequestSchema.extend({
|
|
36605
|
-
method:
|
|
36663
|
+
method: z24.literal("sampling/createMessage"),
|
|
36606
36664
|
params: CreateMessageRequestParamsSchema
|
|
36607
36665
|
});
|
|
36608
36666
|
CreateMessageResultSchema = ResultSchema.extend({
|
|
36609
36667
|
/**
|
|
36610
36668
|
* The name of the model that generated the message.
|
|
36611
36669
|
*/
|
|
36612
|
-
model:
|
|
36670
|
+
model: z24.string(),
|
|
36613
36671
|
/**
|
|
36614
36672
|
* The reason why sampling stopped, if known.
|
|
36615
36673
|
*
|
|
@@ -36620,7 +36678,7 @@ var init_types = __esm({
|
|
|
36620
36678
|
*
|
|
36621
36679
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
36622
36680
|
*/
|
|
36623
|
-
stopReason:
|
|
36681
|
+
stopReason: z24.optional(z24.enum(["endTurn", "stopSequence", "maxTokens"]).or(z24.string())),
|
|
36624
36682
|
role: RoleSchema,
|
|
36625
36683
|
/**
|
|
36626
36684
|
* Response content. Single content block (text, image, or audio).
|
|
@@ -36631,7 +36689,7 @@ var init_types = __esm({
|
|
|
36631
36689
|
/**
|
|
36632
36690
|
* The name of the model that generated the message.
|
|
36633
36691
|
*/
|
|
36634
|
-
model:
|
|
36692
|
+
model: z24.string(),
|
|
36635
36693
|
/**
|
|
36636
36694
|
* The reason why sampling stopped, if known.
|
|
36637
36695
|
*
|
|
@@ -36643,144 +36701,144 @@ var init_types = __esm({
|
|
|
36643
36701
|
*
|
|
36644
36702
|
* This field is an open string to allow for provider-specific stop reasons.
|
|
36645
36703
|
*/
|
|
36646
|
-
stopReason:
|
|
36704
|
+
stopReason: z24.optional(z24.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z24.string())),
|
|
36647
36705
|
role: RoleSchema,
|
|
36648
36706
|
/**
|
|
36649
36707
|
* Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
|
|
36650
36708
|
*/
|
|
36651
|
-
content:
|
|
36652
|
-
});
|
|
36653
|
-
BooleanSchemaSchema =
|
|
36654
|
-
type:
|
|
36655
|
-
title:
|
|
36656
|
-
description:
|
|
36657
|
-
default:
|
|
36658
|
-
});
|
|
36659
|
-
StringSchemaSchema =
|
|
36660
|
-
type:
|
|
36661
|
-
title:
|
|
36662
|
-
description:
|
|
36663
|
-
minLength:
|
|
36664
|
-
maxLength:
|
|
36665
|
-
format:
|
|
36666
|
-
default:
|
|
36667
|
-
});
|
|
36668
|
-
NumberSchemaSchema =
|
|
36669
|
-
type:
|
|
36670
|
-
title:
|
|
36671
|
-
description:
|
|
36672
|
-
minimum:
|
|
36673
|
-
maximum:
|
|
36674
|
-
default:
|
|
36675
|
-
});
|
|
36676
|
-
UntitledSingleSelectEnumSchemaSchema =
|
|
36677
|
-
type:
|
|
36678
|
-
title:
|
|
36679
|
-
description:
|
|
36680
|
-
enum:
|
|
36681
|
-
default:
|
|
36682
|
-
});
|
|
36683
|
-
TitledSingleSelectEnumSchemaSchema =
|
|
36684
|
-
type:
|
|
36685
|
-
title:
|
|
36686
|
-
description:
|
|
36687
|
-
oneOf:
|
|
36688
|
-
const:
|
|
36689
|
-
title:
|
|
36709
|
+
content: z24.union([SamplingMessageContentBlockSchema, z24.array(SamplingMessageContentBlockSchema)])
|
|
36710
|
+
});
|
|
36711
|
+
BooleanSchemaSchema = z24.object({
|
|
36712
|
+
type: z24.literal("boolean"),
|
|
36713
|
+
title: z24.string().optional(),
|
|
36714
|
+
description: z24.string().optional(),
|
|
36715
|
+
default: z24.boolean().optional()
|
|
36716
|
+
});
|
|
36717
|
+
StringSchemaSchema = z24.object({
|
|
36718
|
+
type: z24.literal("string"),
|
|
36719
|
+
title: z24.string().optional(),
|
|
36720
|
+
description: z24.string().optional(),
|
|
36721
|
+
minLength: z24.number().optional(),
|
|
36722
|
+
maxLength: z24.number().optional(),
|
|
36723
|
+
format: z24.enum(["email", "uri", "date", "date-time"]).optional(),
|
|
36724
|
+
default: z24.string().optional()
|
|
36725
|
+
});
|
|
36726
|
+
NumberSchemaSchema = z24.object({
|
|
36727
|
+
type: z24.enum(["number", "integer"]),
|
|
36728
|
+
title: z24.string().optional(),
|
|
36729
|
+
description: z24.string().optional(),
|
|
36730
|
+
minimum: z24.number().optional(),
|
|
36731
|
+
maximum: z24.number().optional(),
|
|
36732
|
+
default: z24.number().optional()
|
|
36733
|
+
});
|
|
36734
|
+
UntitledSingleSelectEnumSchemaSchema = z24.object({
|
|
36735
|
+
type: z24.literal("string"),
|
|
36736
|
+
title: z24.string().optional(),
|
|
36737
|
+
description: z24.string().optional(),
|
|
36738
|
+
enum: z24.array(z24.string()),
|
|
36739
|
+
default: z24.string().optional()
|
|
36740
|
+
});
|
|
36741
|
+
TitledSingleSelectEnumSchemaSchema = z24.object({
|
|
36742
|
+
type: z24.literal("string"),
|
|
36743
|
+
title: z24.string().optional(),
|
|
36744
|
+
description: z24.string().optional(),
|
|
36745
|
+
oneOf: z24.array(z24.object({
|
|
36746
|
+
const: z24.string(),
|
|
36747
|
+
title: z24.string()
|
|
36690
36748
|
})),
|
|
36691
|
-
default:
|
|
36692
|
-
});
|
|
36693
|
-
LegacyTitledEnumSchemaSchema =
|
|
36694
|
-
type:
|
|
36695
|
-
title:
|
|
36696
|
-
description:
|
|
36697
|
-
enum:
|
|
36698
|
-
enumNames:
|
|
36699
|
-
default:
|
|
36700
|
-
});
|
|
36701
|
-
SingleSelectEnumSchemaSchema =
|
|
36702
|
-
UntitledMultiSelectEnumSchemaSchema =
|
|
36703
|
-
type:
|
|
36704
|
-
title:
|
|
36705
|
-
description:
|
|
36706
|
-
minItems:
|
|
36707
|
-
maxItems:
|
|
36708
|
-
items:
|
|
36709
|
-
type:
|
|
36710
|
-
enum:
|
|
36749
|
+
default: z24.string().optional()
|
|
36750
|
+
});
|
|
36751
|
+
LegacyTitledEnumSchemaSchema = z24.object({
|
|
36752
|
+
type: z24.literal("string"),
|
|
36753
|
+
title: z24.string().optional(),
|
|
36754
|
+
description: z24.string().optional(),
|
|
36755
|
+
enum: z24.array(z24.string()),
|
|
36756
|
+
enumNames: z24.array(z24.string()).optional(),
|
|
36757
|
+
default: z24.string().optional()
|
|
36758
|
+
});
|
|
36759
|
+
SingleSelectEnumSchemaSchema = z24.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
36760
|
+
UntitledMultiSelectEnumSchemaSchema = z24.object({
|
|
36761
|
+
type: z24.literal("array"),
|
|
36762
|
+
title: z24.string().optional(),
|
|
36763
|
+
description: z24.string().optional(),
|
|
36764
|
+
minItems: z24.number().optional(),
|
|
36765
|
+
maxItems: z24.number().optional(),
|
|
36766
|
+
items: z24.object({
|
|
36767
|
+
type: z24.literal("string"),
|
|
36768
|
+
enum: z24.array(z24.string())
|
|
36711
36769
|
}),
|
|
36712
|
-
default:
|
|
36713
|
-
});
|
|
36714
|
-
TitledMultiSelectEnumSchemaSchema =
|
|
36715
|
-
type:
|
|
36716
|
-
title:
|
|
36717
|
-
description:
|
|
36718
|
-
minItems:
|
|
36719
|
-
maxItems:
|
|
36720
|
-
items:
|
|
36721
|
-
anyOf:
|
|
36722
|
-
const:
|
|
36723
|
-
title:
|
|
36770
|
+
default: z24.array(z24.string()).optional()
|
|
36771
|
+
});
|
|
36772
|
+
TitledMultiSelectEnumSchemaSchema = z24.object({
|
|
36773
|
+
type: z24.literal("array"),
|
|
36774
|
+
title: z24.string().optional(),
|
|
36775
|
+
description: z24.string().optional(),
|
|
36776
|
+
minItems: z24.number().optional(),
|
|
36777
|
+
maxItems: z24.number().optional(),
|
|
36778
|
+
items: z24.object({
|
|
36779
|
+
anyOf: z24.array(z24.object({
|
|
36780
|
+
const: z24.string(),
|
|
36781
|
+
title: z24.string()
|
|
36724
36782
|
}))
|
|
36725
36783
|
}),
|
|
36726
|
-
default:
|
|
36784
|
+
default: z24.array(z24.string()).optional()
|
|
36727
36785
|
});
|
|
36728
|
-
MultiSelectEnumSchemaSchema =
|
|
36729
|
-
EnumSchemaSchema =
|
|
36730
|
-
PrimitiveSchemaDefinitionSchema =
|
|
36786
|
+
MultiSelectEnumSchemaSchema = z24.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
36787
|
+
EnumSchemaSchema = z24.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
36788
|
+
PrimitiveSchemaDefinitionSchema = z24.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
36731
36789
|
ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
36732
36790
|
/**
|
|
36733
36791
|
* The elicitation mode.
|
|
36734
36792
|
*
|
|
36735
36793
|
* Optional for backward compatibility. Clients MUST treat missing mode as "form".
|
|
36736
36794
|
*/
|
|
36737
|
-
mode:
|
|
36795
|
+
mode: z24.literal("form").optional(),
|
|
36738
36796
|
/**
|
|
36739
36797
|
* The message to present to the user describing what information is being requested.
|
|
36740
36798
|
*/
|
|
36741
|
-
message:
|
|
36799
|
+
message: z24.string(),
|
|
36742
36800
|
/**
|
|
36743
36801
|
* A restricted subset of JSON Schema.
|
|
36744
36802
|
* Only top-level properties are allowed, without nesting.
|
|
36745
36803
|
*/
|
|
36746
|
-
requestedSchema:
|
|
36747
|
-
type:
|
|
36748
|
-
properties:
|
|
36749
|
-
required:
|
|
36804
|
+
requestedSchema: z24.object({
|
|
36805
|
+
type: z24.literal("object"),
|
|
36806
|
+
properties: z24.record(z24.string(), PrimitiveSchemaDefinitionSchema),
|
|
36807
|
+
required: z24.array(z24.string()).optional()
|
|
36750
36808
|
})
|
|
36751
36809
|
});
|
|
36752
36810
|
ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
36753
36811
|
/**
|
|
36754
36812
|
* The elicitation mode.
|
|
36755
36813
|
*/
|
|
36756
|
-
mode:
|
|
36814
|
+
mode: z24.literal("url"),
|
|
36757
36815
|
/**
|
|
36758
36816
|
* The message to present to the user explaining why the interaction is needed.
|
|
36759
36817
|
*/
|
|
36760
|
-
message:
|
|
36818
|
+
message: z24.string(),
|
|
36761
36819
|
/**
|
|
36762
36820
|
* The ID of the elicitation, which must be unique within the context of the server.
|
|
36763
36821
|
* The client MUST treat this ID as an opaque value.
|
|
36764
36822
|
*/
|
|
36765
|
-
elicitationId:
|
|
36823
|
+
elicitationId: z24.string(),
|
|
36766
36824
|
/**
|
|
36767
36825
|
* The URL that the user should navigate to.
|
|
36768
36826
|
*/
|
|
36769
|
-
url:
|
|
36827
|
+
url: z24.string().url()
|
|
36770
36828
|
});
|
|
36771
|
-
ElicitRequestParamsSchema =
|
|
36829
|
+
ElicitRequestParamsSchema = z24.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
36772
36830
|
ElicitRequestSchema = RequestSchema.extend({
|
|
36773
|
-
method:
|
|
36831
|
+
method: z24.literal("elicitation/create"),
|
|
36774
36832
|
params: ElicitRequestParamsSchema
|
|
36775
36833
|
});
|
|
36776
36834
|
ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
36777
36835
|
/**
|
|
36778
36836
|
* The ID of the elicitation that completed.
|
|
36779
36837
|
*/
|
|
36780
|
-
elicitationId:
|
|
36838
|
+
elicitationId: z24.string()
|
|
36781
36839
|
});
|
|
36782
36840
|
ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
36783
|
-
method:
|
|
36841
|
+
method: z24.literal("notifications/elicitation/complete"),
|
|
36784
36842
|
params: ElicitationCompleteNotificationParamsSchema
|
|
36785
36843
|
});
|
|
36786
36844
|
ElicitResultSchema = ResultSchema.extend({
|
|
@@ -36790,98 +36848,98 @@ var init_types = __esm({
|
|
|
36790
36848
|
* - "decline": User explicitly decline the action
|
|
36791
36849
|
* - "cancel": User dismissed without making an explicit choice
|
|
36792
36850
|
*/
|
|
36793
|
-
action:
|
|
36851
|
+
action: z24.enum(["accept", "decline", "cancel"]),
|
|
36794
36852
|
/**
|
|
36795
36853
|
* The submitted form data, only present when action is "accept".
|
|
36796
36854
|
* Contains values matching the requested schema.
|
|
36797
36855
|
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
|
|
36798
36856
|
* We normalize null to undefined for leniency while maintaining type compatibility.
|
|
36799
36857
|
*/
|
|
36800
|
-
content:
|
|
36858
|
+
content: z24.preprocess((val) => val === null ? void 0 : val, z24.record(z24.string(), z24.union([z24.string(), z24.number(), z24.boolean(), z24.array(z24.string())])).optional())
|
|
36801
36859
|
});
|
|
36802
|
-
ResourceTemplateReferenceSchema =
|
|
36803
|
-
type:
|
|
36860
|
+
ResourceTemplateReferenceSchema = z24.object({
|
|
36861
|
+
type: z24.literal("ref/resource"),
|
|
36804
36862
|
/**
|
|
36805
36863
|
* The URI or URI template of the resource.
|
|
36806
36864
|
*/
|
|
36807
|
-
uri:
|
|
36865
|
+
uri: z24.string()
|
|
36808
36866
|
});
|
|
36809
|
-
PromptReferenceSchema =
|
|
36810
|
-
type:
|
|
36867
|
+
PromptReferenceSchema = z24.object({
|
|
36868
|
+
type: z24.literal("ref/prompt"),
|
|
36811
36869
|
/**
|
|
36812
36870
|
* The name of the prompt or prompt template
|
|
36813
36871
|
*/
|
|
36814
|
-
name:
|
|
36872
|
+
name: z24.string()
|
|
36815
36873
|
});
|
|
36816
36874
|
CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
36817
|
-
ref:
|
|
36875
|
+
ref: z24.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
36818
36876
|
/**
|
|
36819
36877
|
* The argument's information
|
|
36820
36878
|
*/
|
|
36821
|
-
argument:
|
|
36879
|
+
argument: z24.object({
|
|
36822
36880
|
/**
|
|
36823
36881
|
* The name of the argument
|
|
36824
36882
|
*/
|
|
36825
|
-
name:
|
|
36883
|
+
name: z24.string(),
|
|
36826
36884
|
/**
|
|
36827
36885
|
* The value of the argument to use for completion matching.
|
|
36828
36886
|
*/
|
|
36829
|
-
value:
|
|
36887
|
+
value: z24.string()
|
|
36830
36888
|
}),
|
|
36831
|
-
context:
|
|
36889
|
+
context: z24.object({
|
|
36832
36890
|
/**
|
|
36833
36891
|
* Previously-resolved variables in a URI template or prompt.
|
|
36834
36892
|
*/
|
|
36835
|
-
arguments:
|
|
36893
|
+
arguments: z24.record(z24.string(), z24.string()).optional()
|
|
36836
36894
|
}).optional()
|
|
36837
36895
|
});
|
|
36838
36896
|
CompleteRequestSchema = RequestSchema.extend({
|
|
36839
|
-
method:
|
|
36897
|
+
method: z24.literal("completion/complete"),
|
|
36840
36898
|
params: CompleteRequestParamsSchema
|
|
36841
36899
|
});
|
|
36842
36900
|
CompleteResultSchema = ResultSchema.extend({
|
|
36843
|
-
completion:
|
|
36901
|
+
completion: z24.looseObject({
|
|
36844
36902
|
/**
|
|
36845
36903
|
* An array of completion values. Must not exceed 100 items.
|
|
36846
36904
|
*/
|
|
36847
|
-
values:
|
|
36905
|
+
values: z24.array(z24.string()).max(100),
|
|
36848
36906
|
/**
|
|
36849
36907
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
36850
36908
|
*/
|
|
36851
|
-
total:
|
|
36909
|
+
total: z24.optional(z24.number().int()),
|
|
36852
36910
|
/**
|
|
36853
36911
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
36854
36912
|
*/
|
|
36855
|
-
hasMore:
|
|
36913
|
+
hasMore: z24.optional(z24.boolean())
|
|
36856
36914
|
})
|
|
36857
36915
|
});
|
|
36858
|
-
RootSchema =
|
|
36916
|
+
RootSchema = z24.object({
|
|
36859
36917
|
/**
|
|
36860
36918
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
36861
36919
|
*/
|
|
36862
|
-
uri:
|
|
36920
|
+
uri: z24.string().startsWith("file://"),
|
|
36863
36921
|
/**
|
|
36864
36922
|
* An optional name for the root.
|
|
36865
36923
|
*/
|
|
36866
|
-
name:
|
|
36924
|
+
name: z24.string().optional(),
|
|
36867
36925
|
/**
|
|
36868
36926
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
36869
36927
|
* for notes on _meta usage.
|
|
36870
36928
|
*/
|
|
36871
|
-
_meta:
|
|
36929
|
+
_meta: z24.record(z24.string(), z24.unknown()).optional()
|
|
36872
36930
|
});
|
|
36873
36931
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
36874
|
-
method:
|
|
36932
|
+
method: z24.literal("roots/list"),
|
|
36875
36933
|
params: BaseRequestParamsSchema.optional()
|
|
36876
36934
|
});
|
|
36877
36935
|
ListRootsResultSchema = ResultSchema.extend({
|
|
36878
|
-
roots:
|
|
36936
|
+
roots: z24.array(RootSchema)
|
|
36879
36937
|
});
|
|
36880
36938
|
RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
36881
|
-
method:
|
|
36939
|
+
method: z24.literal("notifications/roots/list_changed"),
|
|
36882
36940
|
params: NotificationsParamsSchema.optional()
|
|
36883
36941
|
});
|
|
36884
|
-
|
|
36942
|
+
z24.union([
|
|
36885
36943
|
PingRequestSchema,
|
|
36886
36944
|
InitializeRequestSchema,
|
|
36887
36945
|
CompleteRequestSchema,
|
|
@@ -36900,14 +36958,14 @@ var init_types = __esm({
|
|
|
36900
36958
|
ListTasksRequestSchema,
|
|
36901
36959
|
CancelTaskRequestSchema
|
|
36902
36960
|
]);
|
|
36903
|
-
|
|
36961
|
+
z24.union([
|
|
36904
36962
|
CancelledNotificationSchema,
|
|
36905
36963
|
ProgressNotificationSchema,
|
|
36906
36964
|
InitializedNotificationSchema,
|
|
36907
36965
|
RootsListChangedNotificationSchema,
|
|
36908
36966
|
TaskStatusNotificationSchema
|
|
36909
36967
|
]);
|
|
36910
|
-
|
|
36968
|
+
z24.union([
|
|
36911
36969
|
EmptyResultSchema,
|
|
36912
36970
|
CreateMessageResultSchema,
|
|
36913
36971
|
CreateMessageResultWithToolsSchema,
|
|
@@ -36917,7 +36975,7 @@ var init_types = __esm({
|
|
|
36917
36975
|
ListTasksResultSchema,
|
|
36918
36976
|
CreateTaskResultSchema
|
|
36919
36977
|
]);
|
|
36920
|
-
|
|
36978
|
+
z24.union([
|
|
36921
36979
|
PingRequestSchema,
|
|
36922
36980
|
CreateMessageRequestSchema,
|
|
36923
36981
|
ElicitRequestSchema,
|
|
@@ -36927,7 +36985,7 @@ var init_types = __esm({
|
|
|
36927
36985
|
ListTasksRequestSchema,
|
|
36928
36986
|
CancelTaskRequestSchema
|
|
36929
36987
|
]);
|
|
36930
|
-
|
|
36988
|
+
z24.union([
|
|
36931
36989
|
CancelledNotificationSchema,
|
|
36932
36990
|
ProgressNotificationSchema,
|
|
36933
36991
|
LoggingMessageNotificationSchema,
|
|
@@ -36938,7 +36996,7 @@ var init_types = __esm({
|
|
|
36938
36996
|
TaskStatusNotificationSchema,
|
|
36939
36997
|
ElicitationCompleteNotificationSchema
|
|
36940
36998
|
]);
|
|
36941
|
-
|
|
36999
|
+
z24.union([
|
|
36942
37000
|
EmptyResultSchema,
|
|
36943
37001
|
InitializeResultSchema,
|
|
36944
37002
|
CompleteResultSchema,
|
|
@@ -47130,147 +47188,147 @@ var init_index_node = __esm({
|
|
|
47130
47188
|
var SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OptionalSafeUrlSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema;
|
|
47131
47189
|
var init_auth = __esm({
|
|
47132
47190
|
"../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.29.0_zod@3.25.76/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
|
|
47133
|
-
SafeUrlSchema =
|
|
47191
|
+
SafeUrlSchema = z24.url().superRefine((val, ctx) => {
|
|
47134
47192
|
if (!URL.canParse(val)) {
|
|
47135
47193
|
ctx.addIssue({
|
|
47136
|
-
code:
|
|
47194
|
+
code: z24.ZodIssueCode.custom,
|
|
47137
47195
|
message: "URL must be parseable",
|
|
47138
47196
|
fatal: true
|
|
47139
47197
|
});
|
|
47140
|
-
return
|
|
47198
|
+
return z24.NEVER;
|
|
47141
47199
|
}
|
|
47142
47200
|
}).refine((url2) => {
|
|
47143
47201
|
const u2 = new URL(url2);
|
|
47144
47202
|
return u2.protocol !== "javascript:" && u2.protocol !== "data:" && u2.protocol !== "vbscript:";
|
|
47145
47203
|
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
47146
|
-
OAuthProtectedResourceMetadataSchema =
|
|
47147
|
-
resource:
|
|
47148
|
-
authorization_servers:
|
|
47149
|
-
jwks_uri:
|
|
47150
|
-
scopes_supported:
|
|
47151
|
-
bearer_methods_supported:
|
|
47152
|
-
resource_signing_alg_values_supported:
|
|
47153
|
-
resource_name:
|
|
47154
|
-
resource_documentation:
|
|
47155
|
-
resource_policy_uri:
|
|
47156
|
-
resource_tos_uri:
|
|
47157
|
-
tls_client_certificate_bound_access_tokens:
|
|
47158
|
-
authorization_details_types_supported:
|
|
47159
|
-
dpop_signing_alg_values_supported:
|
|
47160
|
-
dpop_bound_access_tokens_required:
|
|
47161
|
-
});
|
|
47162
|
-
OAuthMetadataSchema =
|
|
47163
|
-
issuer:
|
|
47204
|
+
OAuthProtectedResourceMetadataSchema = z24.looseObject({
|
|
47205
|
+
resource: z24.string().url(),
|
|
47206
|
+
authorization_servers: z24.array(SafeUrlSchema).optional(),
|
|
47207
|
+
jwks_uri: z24.string().url().optional(),
|
|
47208
|
+
scopes_supported: z24.array(z24.string()).optional(),
|
|
47209
|
+
bearer_methods_supported: z24.array(z24.string()).optional(),
|
|
47210
|
+
resource_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47211
|
+
resource_name: z24.string().optional(),
|
|
47212
|
+
resource_documentation: z24.string().optional(),
|
|
47213
|
+
resource_policy_uri: z24.string().url().optional(),
|
|
47214
|
+
resource_tos_uri: z24.string().url().optional(),
|
|
47215
|
+
tls_client_certificate_bound_access_tokens: z24.boolean().optional(),
|
|
47216
|
+
authorization_details_types_supported: z24.array(z24.string()).optional(),
|
|
47217
|
+
dpop_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47218
|
+
dpop_bound_access_tokens_required: z24.boolean().optional()
|
|
47219
|
+
});
|
|
47220
|
+
OAuthMetadataSchema = z24.looseObject({
|
|
47221
|
+
issuer: z24.string(),
|
|
47164
47222
|
authorization_endpoint: SafeUrlSchema,
|
|
47165
47223
|
token_endpoint: SafeUrlSchema,
|
|
47166
47224
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
47167
|
-
scopes_supported:
|
|
47168
|
-
response_types_supported:
|
|
47169
|
-
response_modes_supported:
|
|
47170
|
-
grant_types_supported:
|
|
47171
|
-
token_endpoint_auth_methods_supported:
|
|
47172
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
47225
|
+
scopes_supported: z24.array(z24.string()).optional(),
|
|
47226
|
+
response_types_supported: z24.array(z24.string()),
|
|
47227
|
+
response_modes_supported: z24.array(z24.string()).optional(),
|
|
47228
|
+
grant_types_supported: z24.array(z24.string()).optional(),
|
|
47229
|
+
token_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
|
|
47230
|
+
token_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47173
47231
|
service_documentation: SafeUrlSchema.optional(),
|
|
47174
47232
|
revocation_endpoint: SafeUrlSchema.optional(),
|
|
47175
|
-
revocation_endpoint_auth_methods_supported:
|
|
47176
|
-
revocation_endpoint_auth_signing_alg_values_supported:
|
|
47177
|
-
introspection_endpoint:
|
|
47178
|
-
introspection_endpoint_auth_methods_supported:
|
|
47179
|
-
introspection_endpoint_auth_signing_alg_values_supported:
|
|
47180
|
-
code_challenge_methods_supported:
|
|
47181
|
-
client_id_metadata_document_supported:
|
|
47182
|
-
});
|
|
47183
|
-
OpenIdProviderMetadataSchema =
|
|
47184
|
-
issuer:
|
|
47233
|
+
revocation_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
|
|
47234
|
+
revocation_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47235
|
+
introspection_endpoint: z24.string().optional(),
|
|
47236
|
+
introspection_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
|
|
47237
|
+
introspection_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47238
|
+
code_challenge_methods_supported: z24.array(z24.string()).optional(),
|
|
47239
|
+
client_id_metadata_document_supported: z24.boolean().optional()
|
|
47240
|
+
});
|
|
47241
|
+
OpenIdProviderMetadataSchema = z24.looseObject({
|
|
47242
|
+
issuer: z24.string(),
|
|
47185
47243
|
authorization_endpoint: SafeUrlSchema,
|
|
47186
47244
|
token_endpoint: SafeUrlSchema,
|
|
47187
47245
|
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
47188
47246
|
jwks_uri: SafeUrlSchema,
|
|
47189
47247
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
47190
|
-
scopes_supported:
|
|
47191
|
-
response_types_supported:
|
|
47192
|
-
response_modes_supported:
|
|
47193
|
-
grant_types_supported:
|
|
47194
|
-
acr_values_supported:
|
|
47195
|
-
subject_types_supported:
|
|
47196
|
-
id_token_signing_alg_values_supported:
|
|
47197
|
-
id_token_encryption_alg_values_supported:
|
|
47198
|
-
id_token_encryption_enc_values_supported:
|
|
47199
|
-
userinfo_signing_alg_values_supported:
|
|
47200
|
-
userinfo_encryption_alg_values_supported:
|
|
47201
|
-
userinfo_encryption_enc_values_supported:
|
|
47202
|
-
request_object_signing_alg_values_supported:
|
|
47203
|
-
request_object_encryption_alg_values_supported:
|
|
47204
|
-
request_object_encryption_enc_values_supported:
|
|
47205
|
-
token_endpoint_auth_methods_supported:
|
|
47206
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
47207
|
-
display_values_supported:
|
|
47208
|
-
claim_types_supported:
|
|
47209
|
-
claims_supported:
|
|
47210
|
-
service_documentation:
|
|
47211
|
-
claims_locales_supported:
|
|
47212
|
-
ui_locales_supported:
|
|
47213
|
-
claims_parameter_supported:
|
|
47214
|
-
request_parameter_supported:
|
|
47215
|
-
request_uri_parameter_supported:
|
|
47216
|
-
require_request_uri_registration:
|
|
47248
|
+
scopes_supported: z24.array(z24.string()).optional(),
|
|
47249
|
+
response_types_supported: z24.array(z24.string()),
|
|
47250
|
+
response_modes_supported: z24.array(z24.string()).optional(),
|
|
47251
|
+
grant_types_supported: z24.array(z24.string()).optional(),
|
|
47252
|
+
acr_values_supported: z24.array(z24.string()).optional(),
|
|
47253
|
+
subject_types_supported: z24.array(z24.string()),
|
|
47254
|
+
id_token_signing_alg_values_supported: z24.array(z24.string()),
|
|
47255
|
+
id_token_encryption_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47256
|
+
id_token_encryption_enc_values_supported: z24.array(z24.string()).optional(),
|
|
47257
|
+
userinfo_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47258
|
+
userinfo_encryption_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47259
|
+
userinfo_encryption_enc_values_supported: z24.array(z24.string()).optional(),
|
|
47260
|
+
request_object_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47261
|
+
request_object_encryption_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47262
|
+
request_object_encryption_enc_values_supported: z24.array(z24.string()).optional(),
|
|
47263
|
+
token_endpoint_auth_methods_supported: z24.array(z24.string()).optional(),
|
|
47264
|
+
token_endpoint_auth_signing_alg_values_supported: z24.array(z24.string()).optional(),
|
|
47265
|
+
display_values_supported: z24.array(z24.string()).optional(),
|
|
47266
|
+
claim_types_supported: z24.array(z24.string()).optional(),
|
|
47267
|
+
claims_supported: z24.array(z24.string()).optional(),
|
|
47268
|
+
service_documentation: z24.string().optional(),
|
|
47269
|
+
claims_locales_supported: z24.array(z24.string()).optional(),
|
|
47270
|
+
ui_locales_supported: z24.array(z24.string()).optional(),
|
|
47271
|
+
claims_parameter_supported: z24.boolean().optional(),
|
|
47272
|
+
request_parameter_supported: z24.boolean().optional(),
|
|
47273
|
+
request_uri_parameter_supported: z24.boolean().optional(),
|
|
47274
|
+
require_request_uri_registration: z24.boolean().optional(),
|
|
47217
47275
|
op_policy_uri: SafeUrlSchema.optional(),
|
|
47218
47276
|
op_tos_uri: SafeUrlSchema.optional(),
|
|
47219
|
-
client_id_metadata_document_supported:
|
|
47277
|
+
client_id_metadata_document_supported: z24.boolean().optional()
|
|
47220
47278
|
});
|
|
47221
|
-
OpenIdProviderDiscoveryMetadataSchema =
|
|
47279
|
+
OpenIdProviderDiscoveryMetadataSchema = z24.object({
|
|
47222
47280
|
...OpenIdProviderMetadataSchema.shape,
|
|
47223
47281
|
...OAuthMetadataSchema.pick({
|
|
47224
47282
|
code_challenge_methods_supported: true
|
|
47225
47283
|
}).shape
|
|
47226
47284
|
});
|
|
47227
|
-
OAuthTokensSchema =
|
|
47228
|
-
access_token:
|
|
47229
|
-
id_token:
|
|
47285
|
+
OAuthTokensSchema = z24.object({
|
|
47286
|
+
access_token: z24.string(),
|
|
47287
|
+
id_token: z24.string().optional(),
|
|
47230
47288
|
// Optional for OAuth 2.1, but necessary in OpenID Connect
|
|
47231
|
-
token_type:
|
|
47232
|
-
expires_in:
|
|
47233
|
-
scope:
|
|
47234
|
-
refresh_token:
|
|
47289
|
+
token_type: z24.string(),
|
|
47290
|
+
expires_in: z24.coerce.number().optional(),
|
|
47291
|
+
scope: z24.string().optional(),
|
|
47292
|
+
refresh_token: z24.string().optional()
|
|
47235
47293
|
}).strip();
|
|
47236
|
-
OAuthErrorResponseSchema =
|
|
47237
|
-
error:
|
|
47238
|
-
error_description:
|
|
47239
|
-
error_uri:
|
|
47240
|
-
});
|
|
47241
|
-
OptionalSafeUrlSchema = SafeUrlSchema.optional().or(
|
|
47242
|
-
OAuthClientMetadataSchema =
|
|
47243
|
-
redirect_uris:
|
|
47244
|
-
token_endpoint_auth_method:
|
|
47245
|
-
grant_types:
|
|
47246
|
-
response_types:
|
|
47247
|
-
client_name:
|
|
47294
|
+
OAuthErrorResponseSchema = z24.object({
|
|
47295
|
+
error: z24.string(),
|
|
47296
|
+
error_description: z24.string().optional(),
|
|
47297
|
+
error_uri: z24.string().optional()
|
|
47298
|
+
});
|
|
47299
|
+
OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z24.literal("").transform(() => void 0));
|
|
47300
|
+
OAuthClientMetadataSchema = z24.object({
|
|
47301
|
+
redirect_uris: z24.array(SafeUrlSchema),
|
|
47302
|
+
token_endpoint_auth_method: z24.string().optional(),
|
|
47303
|
+
grant_types: z24.array(z24.string()).optional(),
|
|
47304
|
+
response_types: z24.array(z24.string()).optional(),
|
|
47305
|
+
client_name: z24.string().optional(),
|
|
47248
47306
|
client_uri: SafeUrlSchema.optional(),
|
|
47249
47307
|
logo_uri: OptionalSafeUrlSchema,
|
|
47250
|
-
scope:
|
|
47251
|
-
contacts:
|
|
47308
|
+
scope: z24.string().optional(),
|
|
47309
|
+
contacts: z24.array(z24.string()).optional(),
|
|
47252
47310
|
tos_uri: OptionalSafeUrlSchema,
|
|
47253
|
-
policy_uri:
|
|
47311
|
+
policy_uri: z24.string().optional(),
|
|
47254
47312
|
jwks_uri: SafeUrlSchema.optional(),
|
|
47255
|
-
jwks:
|
|
47256
|
-
software_id:
|
|
47257
|
-
software_version:
|
|
47258
|
-
software_statement:
|
|
47313
|
+
jwks: z24.any().optional(),
|
|
47314
|
+
software_id: z24.string().optional(),
|
|
47315
|
+
software_version: z24.string().optional(),
|
|
47316
|
+
software_statement: z24.string().optional()
|
|
47259
47317
|
}).strip();
|
|
47260
|
-
OAuthClientInformationSchema =
|
|
47261
|
-
client_id:
|
|
47262
|
-
client_secret:
|
|
47263
|
-
client_id_issued_at:
|
|
47264
|
-
client_secret_expires_at:
|
|
47318
|
+
OAuthClientInformationSchema = z24.object({
|
|
47319
|
+
client_id: z24.string(),
|
|
47320
|
+
client_secret: z24.string().optional(),
|
|
47321
|
+
client_id_issued_at: z24.number().optional(),
|
|
47322
|
+
client_secret_expires_at: z24.number().optional()
|
|
47265
47323
|
}).strip();
|
|
47266
47324
|
OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
47267
|
-
|
|
47268
|
-
error:
|
|
47269
|
-
error_description:
|
|
47325
|
+
z24.object({
|
|
47326
|
+
error: z24.string(),
|
|
47327
|
+
error_description: z24.string().optional()
|
|
47270
47328
|
}).strip();
|
|
47271
|
-
|
|
47272
|
-
token:
|
|
47273
|
-
token_type_hint:
|
|
47329
|
+
z24.object({
|
|
47330
|
+
token: z24.string(),
|
|
47331
|
+
token_type_hint: z24.string().optional()
|
|
47274
47332
|
}).strip();
|
|
47275
47333
|
}
|
|
47276
47334
|
});
|
|
@@ -49405,10 +49463,10 @@ var require_react_production_min = __commonJS({
|
|
|
49405
49463
|
var w4 = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
49406
49464
|
var x4 = /* @__PURE__ */ Symbol.for("react.memo");
|
|
49407
49465
|
var y2 = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
49408
|
-
var
|
|
49466
|
+
var z58 = Symbol.iterator;
|
|
49409
49467
|
function A3(a2) {
|
|
49410
49468
|
if (null === a2 || "object" !== typeof a2) return null;
|
|
49411
|
-
a2 =
|
|
49469
|
+
a2 = z58 && a2[z58] || a2["@@iterator"];
|
|
49412
49470
|
return "function" === typeof a2 ? a2 : null;
|
|
49413
49471
|
}
|
|
49414
49472
|
var B2 = { isMounted: function() {
|
|
@@ -49475,7 +49533,7 @@ var require_react_production_min = __commonJS({
|
|
|
49475
49533
|
});
|
|
49476
49534
|
}
|
|
49477
49535
|
var P3 = /\/+/g;
|
|
49478
|
-
function
|
|
49536
|
+
function Q3(a2, b3) {
|
|
49479
49537
|
return "object" === typeof a2 && null !== a2 && null != a2.key ? escape4("" + a2.key) : b3.toString(36);
|
|
49480
49538
|
}
|
|
49481
49539
|
function R4(a2, b3, e3, d2, c2) {
|
|
@@ -49495,17 +49553,17 @@ var require_react_production_min = __commonJS({
|
|
|
49495
49553
|
h3 = true;
|
|
49496
49554
|
}
|
|
49497
49555
|
}
|
|
49498
|
-
if (h3) return h3 = a2, c2 = c2(h3), a2 = "" === d2 ? "." +
|
|
49556
|
+
if (h3) return h3 = a2, c2 = c2(h3), a2 = "" === d2 ? "." + Q3(h3, 0) : d2, I2(c2) ? (e3 = "", null != a2 && (e3 = a2.replace(P3, "$&/") + "/"), R4(c2, b3, e3, "", function(a3) {
|
|
49499
49557
|
return a3;
|
|
49500
49558
|
})) : null != c2 && (O3(c2) && (c2 = N2(c2, e3 + (!c2.key || h3 && h3.key === c2.key ? "" : ("" + c2.key).replace(P3, "$&/") + "/") + a2)), b3.push(c2)), 1;
|
|
49501
49559
|
h3 = 0;
|
|
49502
49560
|
d2 = "" === d2 ? "." : d2 + ":";
|
|
49503
49561
|
if (I2(a2)) for (var g2 = 0; g2 < a2.length; g2++) {
|
|
49504
49562
|
k3 = a2[g2];
|
|
49505
|
-
var f3 = d2 +
|
|
49563
|
+
var f3 = d2 + Q3(k3, g2);
|
|
49506
49564
|
h3 += R4(k3, b3, e3, f3, c2);
|
|
49507
49565
|
}
|
|
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 +
|
|
49566
|
+
else if (f3 = A3(a2), "function" === typeof f3) for (a2 = f3.call(a2), g2 = 0; !(k3 = a2.next()).done; ) k3 = k3.value, f3 = d2 + Q3(k3, g2++), h3 += R4(k3, b3, e3, f3, c2);
|
|
49509
49567
|
else if ("object" === k3) throw b3 = String(a2), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b3 ? "object with keys {" + Object.keys(a2).join(", ") + "}" : b3) + "). If you meant to render a collection of children, use an array instead.");
|
|
49510
49568
|
return h3;
|
|
49511
49569
|
}
|
|
@@ -52215,7 +52273,7 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
52215
52273
|
h3.noExitRuntime || true;
|
|
52216
52274
|
"object" != typeof WebAssembly && x4("no native wasm support detected");
|
|
52217
52275
|
var fa, ha = false;
|
|
52218
|
-
function
|
|
52276
|
+
function z58(a2, b3, c2) {
|
|
52219
52277
|
c2 = b3 + c2;
|
|
52220
52278
|
for (var d2 = ""; !(b3 >= c2); ) {
|
|
52221
52279
|
var e3 = a2[b3++];
|
|
@@ -52363,7 +52421,7 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
52363
52421
|
a2["delete"]();
|
|
52364
52422
|
}
|
|
52365
52423
|
}
|
|
52366
|
-
var P3 = void 0,
|
|
52424
|
+
var P3 = void 0, Q3 = {};
|
|
52367
52425
|
function Ia(a2, b3) {
|
|
52368
52426
|
for (void 0 === b3 && L3("ptr should not be undefined"); a2.R; ) b3 = a2.ba(b3), a2 = a2.R;
|
|
52369
52427
|
return b3;
|
|
@@ -52396,7 +52454,7 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
52396
52454
|
var Qa = {};
|
|
52397
52455
|
function Ra(a2, b3) {
|
|
52398
52456
|
b3 = Ia(a2, b3);
|
|
52399
|
-
return
|
|
52457
|
+
return Q3[b3];
|
|
52400
52458
|
}
|
|
52401
52459
|
var Sa = void 0;
|
|
52402
52460
|
function Ta(a2) {
|
|
@@ -52767,11 +52825,11 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
52767
52825
|
for (var Gb = Array(256), Hb = 0; 256 > Hb; ++Hb) Gb[Hb] = String.fromCharCode(Hb);
|
|
52768
52826
|
Ga = Gb;
|
|
52769
52827
|
h3.getInheritedInstanceCount = function() {
|
|
52770
|
-
return Object.keys(
|
|
52828
|
+
return Object.keys(Q3).length;
|
|
52771
52829
|
};
|
|
52772
52830
|
h3.getLiveInheritedInstances = function() {
|
|
52773
52831
|
var a2 = [], b3;
|
|
52774
|
-
for (b3 in
|
|
52832
|
+
for (b3 in Q3) Q3.hasOwnProperty(b3) && a2.push(Q3[b3]);
|
|
52775
52833
|
return a2;
|
|
52776
52834
|
};
|
|
52777
52835
|
h3.flushPendingDeletes = Ha;
|
|
@@ -52865,7 +52923,7 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
52865
52923
|
return b3;
|
|
52866
52924
|
}, Jb = {
|
|
52867
52925
|
l: function(a2, b3, c2, d2) {
|
|
52868
|
-
x4("Assertion failed: " + (a2 ?
|
|
52926
|
+
x4("Assertion failed: " + (a2 ? z58(A3, a2) : "") + ", at: " + [b3 ? b3 ? z58(A3, b3) : "" : "unknown filename", c2, d2 ? d2 ? z58(A3, d2) : "" : "unknown function"]);
|
|
52869
52927
|
},
|
|
52870
52928
|
q: function(a2, b3, c2) {
|
|
52871
52929
|
a2 = N2(a2);
|
|
@@ -52890,14 +52948,14 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
52890
52948
|
T2(this);
|
|
52891
52949
|
l2 = n2.O;
|
|
52892
52950
|
l2 = Ia(e3, l2);
|
|
52893
|
-
|
|
52951
|
+
Q3.hasOwnProperty(l2) ? L3("Tried to register registered instance: " + l2) : Q3[l2] = this;
|
|
52894
52952
|
};
|
|
52895
52953
|
f3.__destruct = function() {
|
|
52896
52954
|
this === f3 && L3("Pass correct 'this' to __destruct");
|
|
52897
52955
|
Ma(this);
|
|
52898
52956
|
var l2 = this.M.O;
|
|
52899
52957
|
l2 = Ia(e3, l2);
|
|
52900
|
-
|
|
52958
|
+
Q3.hasOwnProperty(l2) ? delete Q3[l2] : L3("Tried to unregister unregistered instance: " + l2);
|
|
52901
52959
|
};
|
|
52902
52960
|
a2.prototype = Object.create(f3);
|
|
52903
52961
|
for (var m3 in c2) a2.prototype[m3] = c2[m3];
|
|
@@ -53118,7 +53176,7 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
53118
53176
|
if (c2) for (var g2 = f3, k3 = 0; k3 <= e3; ++k3) {
|
|
53119
53177
|
var m3 = f3 + k3;
|
|
53120
53178
|
if (k3 == e3 || 0 == A3[m3]) {
|
|
53121
|
-
g2 = g2 ?
|
|
53179
|
+
g2 = g2 ? z58(A3, g2, m3 - g2) : "";
|
|
53122
53180
|
if (void 0 === l2) var l2 = g2;
|
|
53123
53181
|
else l2 += String.fromCharCode(0), l2 += g2;
|
|
53124
53182
|
g2 = m3 + 1;
|
|
@@ -53315,7 +53373,7 @@ var init_yoga_wasm_base64_esm = __esm({
|
|
|
53315
53373
|
b3 += 8;
|
|
53316
53374
|
for (var m3 = 0; m3 < k3; m3++) {
|
|
53317
53375
|
var l2 = A3[g2 + m3], n2 = Fb[a2];
|
|
53318
|
-
0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v3)(
|
|
53376
|
+
0 === l2 || 10 === l2 ? ((1 === a2 ? ea : v3)(z58(n2, 0)), n2.length = 0) : n2.push(l2);
|
|
53319
53377
|
}
|
|
53320
53378
|
e3 += k3;
|
|
53321
53379
|
}
|
|
@@ -53803,7 +53861,7 @@ var require_scheduler_production_min = __commonJS({
|
|
|
53803
53861
|
var u2 = 1;
|
|
53804
53862
|
var v3 = null;
|
|
53805
53863
|
var y2 = 3;
|
|
53806
|
-
var
|
|
53864
|
+
var z58 = false;
|
|
53807
53865
|
var A3 = false;
|
|
53808
53866
|
var B2 = false;
|
|
53809
53867
|
var D3 = "function" === typeof setTimeout ? setTimeout : null;
|
|
@@ -53830,7 +53888,7 @@ var require_scheduler_production_min = __commonJS({
|
|
|
53830
53888
|
function J2(a2, b3) {
|
|
53831
53889
|
A3 = false;
|
|
53832
53890
|
B2 && (B2 = false, E3(L3), L3 = -1);
|
|
53833
|
-
|
|
53891
|
+
z58 = true;
|
|
53834
53892
|
var c2 = y2;
|
|
53835
53893
|
try {
|
|
53836
53894
|
G3(b3);
|
|
@@ -53854,21 +53912,21 @@ var require_scheduler_production_min = __commonJS({
|
|
|
53854
53912
|
}
|
|
53855
53913
|
return w4;
|
|
53856
53914
|
} finally {
|
|
53857
|
-
v3 = null, y2 = c2,
|
|
53915
|
+
v3 = null, y2 = c2, z58 = false;
|
|
53858
53916
|
}
|
|
53859
53917
|
}
|
|
53860
53918
|
var N2 = false;
|
|
53861
53919
|
var O3 = null;
|
|
53862
53920
|
var L3 = -1;
|
|
53863
53921
|
var P3 = 5;
|
|
53864
|
-
var
|
|
53922
|
+
var Q3 = -1;
|
|
53865
53923
|
function M2() {
|
|
53866
|
-
return exports.unstable_now() -
|
|
53924
|
+
return exports.unstable_now() - Q3 < P3 ? false : true;
|
|
53867
53925
|
}
|
|
53868
53926
|
function R4() {
|
|
53869
53927
|
if (null !== O3) {
|
|
53870
53928
|
var a2 = exports.unstable_now();
|
|
53871
|
-
|
|
53929
|
+
Q3 = a2;
|
|
53872
53930
|
var b3 = true;
|
|
53873
53931
|
try {
|
|
53874
53932
|
b3 = O3(true, a2);
|
|
@@ -53911,7 +53969,7 @@ var require_scheduler_production_min = __commonJS({
|
|
|
53911
53969
|
a2.callback = null;
|
|
53912
53970
|
};
|
|
53913
53971
|
exports.unstable_continueExecution = function() {
|
|
53914
|
-
A3 ||
|
|
53972
|
+
A3 || z58 || (A3 = true, I2(J2));
|
|
53915
53973
|
};
|
|
53916
53974
|
exports.unstable_forceFrameRate = function(a2) {
|
|
53917
53975
|
0 > a2 || 125 < a2 ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : P3 = 0 < a2 ? Math.floor(1e3 / a2) : 5;
|
|
@@ -53984,7 +54042,7 @@ var require_scheduler_production_min = __commonJS({
|
|
|
53984
54042
|
}
|
|
53985
54043
|
e3 = c2 + e3;
|
|
53986
54044
|
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 ||
|
|
54045
|
+
c2 > d2 ? (a2.sortIndex = c2, f3(t2, a2), null === h3(r2) && a2 === h3(t2) && (B2 ? (E3(L3), L3 = -1) : B2 = true, K4(H3, c2 - d2))) : (a2.sortIndex = e3, f3(r2, a2), A3 || z58 || (A3 = true, I2(J2)));
|
|
53988
54046
|
return a2;
|
|
53989
54047
|
};
|
|
53990
54048
|
exports.unstable_shouldYield = M2;
|
|
@@ -54741,7 +54799,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
54741
54799
|
gc[hc] = a2.current;
|
|
54742
54800
|
a2.current = b3;
|
|
54743
54801
|
}
|
|
54744
|
-
var jc = {}, x4 = ic(jc),
|
|
54802
|
+
var jc = {}, x4 = ic(jc), z58 = ic(false), kc = jc;
|
|
54745
54803
|
function mc(a2, b3) {
|
|
54746
54804
|
var c2 = a2.type.contextTypes;
|
|
54747
54805
|
if (!c2) return jc;
|
|
@@ -54757,13 +54815,13 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
54757
54815
|
return null !== a2 && void 0 !== a2;
|
|
54758
54816
|
}
|
|
54759
54817
|
function nc() {
|
|
54760
|
-
q3(
|
|
54818
|
+
q3(z58);
|
|
54761
54819
|
q3(x4);
|
|
54762
54820
|
}
|
|
54763
54821
|
function oc(a2, b3, c2) {
|
|
54764
54822
|
if (x4.current !== jc) throw Error(n2(168));
|
|
54765
54823
|
v3(x4, b3);
|
|
54766
|
-
v3(
|
|
54824
|
+
v3(z58, c2);
|
|
54767
54825
|
}
|
|
54768
54826
|
function pc(a2, b3, c2) {
|
|
54769
54827
|
var d2 = a2.stateNode;
|
|
@@ -54777,14 +54835,14 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
54777
54835
|
a2 = (a2 = a2.stateNode) && a2.__reactInternalMemoizedMergedChildContext || jc;
|
|
54778
54836
|
kc = x4.current;
|
|
54779
54837
|
v3(x4, a2);
|
|
54780
|
-
v3(
|
|
54838
|
+
v3(z58, z58.current);
|
|
54781
54839
|
return true;
|
|
54782
54840
|
}
|
|
54783
54841
|
function rc(a2, b3, c2) {
|
|
54784
54842
|
var d2 = a2.stateNode;
|
|
54785
54843
|
if (!d2) throw Error(n2(169));
|
|
54786
|
-
c2 ? (a2 = pc(a2, b3, kc), d2.__reactInternalMemoizedMergedChildContext = a2, q3(
|
|
54787
|
-
v3(
|
|
54844
|
+
c2 ? (a2 = pc(a2, b3, kc), d2.__reactInternalMemoizedMergedChildContext = a2, q3(z58), q3(x4), v3(x4, a2)) : q3(z58);
|
|
54845
|
+
v3(z58, c2);
|
|
54788
54846
|
}
|
|
54789
54847
|
var tc = Math.clz32 ? Math.clz32 : sc, uc = Math.log, vc = Math.LN2;
|
|
54790
54848
|
function sc(a2) {
|
|
@@ -55651,7 +55709,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
55651
55709
|
b3 = Ga(c2, a2.type, b3);
|
|
55652
55710
|
c2 !== b3 && (v3(pe2, a2), v3(oe2, b3));
|
|
55653
55711
|
}
|
|
55654
|
-
function
|
|
55712
|
+
function ve2(a2) {
|
|
55655
55713
|
pe2.current === a2 && (q3(oe2), q3(pe2));
|
|
55656
55714
|
}
|
|
55657
55715
|
var I2 = ic(0);
|
|
@@ -56382,7 +56440,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56382
56440
|
g2.state = p3;
|
|
56383
56441
|
ke2(b3, d2, g2, e3);
|
|
56384
56442
|
k3 = b3.memoizedState;
|
|
56385
|
-
h3 !== d2 || p3 !== k3 ||
|
|
56443
|
+
h3 !== d2 || p3 !== k3 || z58.current || de2 ? ("function" === typeof m3 && (yf(b3, c2, m3, d2), k3 = b3.memoizedState), (h3 = de2 || Af(b3, c2, h3, d2, p3, k3, l2)) ? (r2 || "function" !== typeof g2.UNSAFE_componentWillMount && "function" !== typeof g2.componentWillMount || ("function" === typeof g2.componentWillMount && g2.componentWillMount(), "function" === typeof g2.UNSAFE_componentWillMount && g2.UNSAFE_componentWillMount()), "function" === typeof g2.componentDidMount && (b3.flags |= 4194308)) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), b3.memoizedProps = d2, b3.memoizedState = k3), g2.props = d2, g2.state = k3, g2.context = l2, d2 = h3) : ("function" === typeof g2.componentDidMount && (b3.flags |= 4194308), d2 = false);
|
|
56386
56444
|
} else {
|
|
56387
56445
|
g2 = b3.stateNode;
|
|
56388
56446
|
fe2(a2, b3);
|
|
@@ -56400,7 +56458,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56400
56458
|
g2.state = p3;
|
|
56401
56459
|
ke2(b3, d2, g2, e3);
|
|
56402
56460
|
var w4 = b3.memoizedState;
|
|
56403
|
-
h3 !== r2 || p3 !== w4 ||
|
|
56461
|
+
h3 !== r2 || p3 !== w4 || z58.current || de2 ? ("function" === typeof B2 && (yf(b3, c2, B2, d2), w4 = b3.memoizedState), (l2 = de2 || Af(b3, c2, l2, d2, p3, w4, k3) || false) ? (m3 || "function" !== typeof g2.UNSAFE_componentWillUpdate && "function" !== typeof g2.componentWillUpdate || ("function" === typeof g2.componentWillUpdate && g2.componentWillUpdate(d2, w4, k3), "function" === typeof g2.UNSAFE_componentWillUpdate && g2.UNSAFE_componentWillUpdate(d2, w4, k3)), "function" === typeof g2.componentDidUpdate && (b3.flags |= 4), "function" === typeof g2.getSnapshotBeforeUpdate && (b3.flags |= 1024)) : ("function" !== typeof g2.componentDidUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), b3.memoizedProps = d2, b3.memoizedState = w4), g2.props = d2, g2.state = w4, g2.context = k3, d2 = l2) : ("function" !== typeof g2.componentDidUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 4), "function" !== typeof g2.getSnapshotBeforeUpdate || h3 === a2.memoizedProps && p3 === a2.memoizedState || (b3.flags |= 1024), d2 = false);
|
|
56404
56462
|
}
|
|
56405
56463
|
return dg(a2, b3, c2, d2, f3, e3);
|
|
56406
56464
|
}
|
|
@@ -56841,7 +56899,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56841
56899
|
null === d2 ? b3 || null === a2.tail ? a2.tail = null : a2.tail.sibling = null : d2.sibling = null;
|
|
56842
56900
|
}
|
|
56843
56901
|
}
|
|
56844
|
-
function
|
|
56902
|
+
function Q3(a2) {
|
|
56845
56903
|
var b3 = null !== a2.alternate && a2.alternate.child === a2.child, c2 = 0, d2 = 0;
|
|
56846
56904
|
if (b3) for (var e3 = a2.child; null !== e3; ) c2 |= e3.lanes | e3.childLanes, d2 |= e3.subtreeFlags & 14680064, d2 |= e3.flags & 14680064, e3.return = a2, e3 = e3.sibling;
|
|
56847
56905
|
else for (e3 = a2.child; null !== e3; ) c2 |= e3.lanes | e3.childLanes, d2 |= e3.subtreeFlags, d2 |= e3.flags, e3.return = a2, e3 = e3.sibling;
|
|
@@ -56863,29 +56921,29 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56863
56921
|
case 12:
|
|
56864
56922
|
case 9:
|
|
56865
56923
|
case 14:
|
|
56866
|
-
return
|
|
56924
|
+
return Q3(b3), null;
|
|
56867
56925
|
case 1:
|
|
56868
|
-
return A3(b3.type) && nc(),
|
|
56926
|
+
return A3(b3.type) && nc(), Q3(b3), null;
|
|
56869
56927
|
case 3:
|
|
56870
56928
|
c2 = b3.stateNode;
|
|
56871
56929
|
te3();
|
|
56872
|
-
q3(
|
|
56930
|
+
q3(z58);
|
|
56873
56931
|
q3(x4);
|
|
56874
56932
|
ye3();
|
|
56875
56933
|
c2.pendingContext && (c2.context = c2.pendingContext, c2.pendingContext = null);
|
|
56876
56934
|
if (null === a2 || null === a2.child) yd(b3) ? tg(b3) : null === a2 || a2.memoizedState.isDehydrated && 0 === (b3.flags & 256) || (b3.flags |= 1024, null !== rd && (Cg(rd), rd = null));
|
|
56877
56935
|
wg(a2, b3);
|
|
56878
|
-
|
|
56936
|
+
Q3(b3);
|
|
56879
56937
|
return null;
|
|
56880
56938
|
case 5:
|
|
56881
|
-
|
|
56939
|
+
ve2(b3);
|
|
56882
56940
|
c2 = re2(qe2.current);
|
|
56883
56941
|
var e3 = b3.type;
|
|
56884
56942
|
if (null !== a2 && null != b3.stateNode) xg(a2, b3, e3, d2, c2), a2.ref !== b3.ref && (b3.flags |= 512, b3.flags |= 2097152);
|
|
56885
56943
|
else {
|
|
56886
56944
|
if (!d2) {
|
|
56887
56945
|
if (null === b3.stateNode) throw Error(n2(166));
|
|
56888
|
-
|
|
56946
|
+
Q3(b3);
|
|
56889
56947
|
return null;
|
|
56890
56948
|
}
|
|
56891
56949
|
a2 = re2(oe2.current);
|
|
@@ -56902,7 +56960,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56902
56960
|
}
|
|
56903
56961
|
null !== b3.ref && (b3.flags |= 512, b3.flags |= 2097152);
|
|
56904
56962
|
}
|
|
56905
|
-
|
|
56963
|
+
Q3(b3);
|
|
56906
56964
|
return null;
|
|
56907
56965
|
case 6:
|
|
56908
56966
|
if (a2 && null != b3.stateNode) yg(a2, b3, a2.memoizedProps, d2);
|
|
@@ -56926,7 +56984,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56926
56984
|
d2 && tg(b3);
|
|
56927
56985
|
} else b3.stateNode = Oa(d2, a2, c2, b3);
|
|
56928
56986
|
}
|
|
56929
|
-
|
|
56987
|
+
Q3(b3);
|
|
56930
56988
|
return null;
|
|
56931
56989
|
case 13:
|
|
56932
56990
|
q3(I2);
|
|
@@ -56942,7 +57000,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56942
57000
|
if (!e3) throw Error(n2(317));
|
|
56943
57001
|
Tb(e3, b3);
|
|
56944
57002
|
} else Ad(), 0 === (b3.flags & 128) && (b3.memoizedState = null), b3.flags |= 4;
|
|
56945
|
-
|
|
57003
|
+
Q3(b3);
|
|
56946
57004
|
e3 = false;
|
|
56947
57005
|
} else null !== rd && (Cg(rd), rd = null), e3 = true;
|
|
56948
57006
|
if (!e3) return b3.flags & 65536 ? b3 : null;
|
|
@@ -56951,18 +57009,18 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56951
57009
|
c2 = null !== d2;
|
|
56952
57010
|
c2 !== (null !== a2 && null !== a2.memoizedState) && c2 && (b3.child.flags |= 8192, 0 !== (b3.mode & 1) && (null === a2 || 0 !== (I2.current & 1) ? 0 === R4 && (R4 = 3) : ng()));
|
|
56953
57011
|
null !== b3.updateQueue && (b3.flags |= 4);
|
|
56954
|
-
|
|
57012
|
+
Q3(b3);
|
|
56955
57013
|
return null;
|
|
56956
57014
|
case 4:
|
|
56957
|
-
return te3(), wg(a2, b3), null === a2 && Xa(b3.stateNode.containerInfo),
|
|
57015
|
+
return te3(), wg(a2, b3), null === a2 && Xa(b3.stateNode.containerInfo), Q3(b3), null;
|
|
56958
57016
|
case 10:
|
|
56959
|
-
return Wd(b3.type._context),
|
|
57017
|
+
return Wd(b3.type._context), Q3(b3), null;
|
|
56960
57018
|
case 17:
|
|
56961
|
-
return A3(b3.type) && nc(),
|
|
57019
|
+
return A3(b3.type) && nc(), Q3(b3), null;
|
|
56962
57020
|
case 19:
|
|
56963
57021
|
q3(I2);
|
|
56964
57022
|
e3 = b3.memoizedState;
|
|
56965
|
-
if (null === e3) return
|
|
57023
|
+
if (null === e3) return Q3(b3), null;
|
|
56966
57024
|
d2 = 0 !== (b3.flags & 128);
|
|
56967
57025
|
f3 = e3.rendering;
|
|
56968
57026
|
if (null === f3) if (d2) Ag(e3, false);
|
|
@@ -56986,16 +57044,16 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
56986
57044
|
}
|
|
56987
57045
|
else {
|
|
56988
57046
|
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
|
|
57047
|
+
if (b3.flags |= 128, d2 = true, a2 = a2.updateQueue, null !== a2 && (b3.updateQueue = a2, b3.flags |= 4), Ag(e3, true), null === e3.tail && "hidden" === e3.tailMode && !f3.alternate && !F3) return Q3(b3), null;
|
|
56990
57048
|
} else 2 * D3() - e3.renderingStartTime > Dg && 1073741824 !== c2 && (b3.flags |= 128, d2 = true, Ag(e3, false), b3.lanes = 4194304);
|
|
56991
57049
|
e3.isBackwards ? (f3.sibling = b3.child, b3.child = f3) : (a2 = e3.last, null !== a2 ? a2.sibling = f3 : b3.child = f3, e3.last = f3);
|
|
56992
57050
|
}
|
|
56993
57051
|
if (null !== e3.tail) return b3 = e3.tail, e3.rendering = b3, e3.tail = b3.sibling, e3.renderingStartTime = D3(), b3.sibling = null, a2 = I2.current, v3(I2, d2 ? a2 & 1 | 2 : a2 & 1), b3;
|
|
56994
|
-
|
|
57052
|
+
Q3(b3);
|
|
56995
57053
|
return null;
|
|
56996
57054
|
case 22:
|
|
56997
57055
|
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) && (
|
|
57056
|
+
return Eg(), c2 = null !== b3.memoizedState, null !== a2 && null !== a2.memoizedState !== c2 && (b3.flags |= 8192), c2 && 0 !== (b3.mode & 1) ? 0 !== ($f & 1073741824) && (Q3(b3), Ta && b3.subtreeFlags & 6 && (b3.flags |= 8192)) : Q3(b3), null;
|
|
56999
57057
|
case 24:
|
|
57000
57058
|
return null;
|
|
57001
57059
|
case 25:
|
|
@@ -57012,9 +57070,9 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
57012
57070
|
case 1:
|
|
57013
57071
|
return A3(b3.type) && nc(), a2 = b3.flags, a2 & 65536 ? (b3.flags = a2 & -65537 | 128, b3) : null;
|
|
57014
57072
|
case 3:
|
|
57015
|
-
return te3(), q3(
|
|
57073
|
+
return te3(), q3(z58), q3(x4), ye3(), a2 = b3.flags, 0 !== (a2 & 65536) && 0 === (a2 & 128) ? (b3.flags = a2 & -65537 | 128, b3) : null;
|
|
57016
57074
|
case 5:
|
|
57017
|
-
return
|
|
57075
|
+
return ve2(b3), null;
|
|
57018
57076
|
case 13:
|
|
57019
57077
|
q3(I2);
|
|
57020
57078
|
a2 = b3.memoizedState;
|
|
@@ -58067,12 +58125,12 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
58067
58125
|
break;
|
|
58068
58126
|
case 3:
|
|
58069
58127
|
te3();
|
|
58070
|
-
q3(
|
|
58128
|
+
q3(z58);
|
|
58071
58129
|
q3(x4);
|
|
58072
58130
|
ye3();
|
|
58073
58131
|
break;
|
|
58074
58132
|
case 5:
|
|
58075
|
-
|
|
58133
|
+
ve2(d2);
|
|
58076
58134
|
break;
|
|
58077
58135
|
case 4:
|
|
58078
58136
|
te3();
|
|
@@ -58544,7 +58602,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
58544
58602
|
}
|
|
58545
58603
|
var ai;
|
|
58546
58604
|
ai = function(a2, b3, c2) {
|
|
58547
|
-
if (null !== a2) if (a2.memoizedProps !== b3.pendingProps ||
|
|
58605
|
+
if (null !== a2) if (a2.memoizedProps !== b3.pendingProps || z58.current) G3 = true;
|
|
58548
58606
|
else {
|
|
58549
58607
|
if (0 === (a2.lanes & c2) && 0 === (b3.flags & 128)) return G3 = false, sg(a2, b3, c2);
|
|
58550
58608
|
G3 = 0 !== (a2.flags & 131072) ? true : false;
|
|
@@ -58653,7 +58711,7 @@ var require_react_reconciler_production_min = __commonJS({
|
|
|
58653
58711
|
g2 = e3.value;
|
|
58654
58712
|
Vd(b3, d2, g2);
|
|
58655
58713
|
if (null !== f3) if (Vc(f3.value, g2)) {
|
|
58656
|
-
if (f3.children === e3.children && !
|
|
58714
|
+
if (f3.children === e3.children && !z58.current) {
|
|
58657
58715
|
b3 = Tf(a2, b3, c2);
|
|
58658
58716
|
break a;
|
|
58659
58717
|
}
|
|
@@ -79286,11 +79344,11 @@ var init_devtools = __esm({
|
|
|
79286
79344
|
devtools_stub_default.connectToDevTools();
|
|
79287
79345
|
}
|
|
79288
79346
|
});
|
|
79289
|
-
var import_react_reconciler,
|
|
79347
|
+
var import_react_reconciler, import_constants28, diff, cleanupYogaNode, reconciler_default;
|
|
79290
79348
|
var init_reconciler = __esm({
|
|
79291
79349
|
async "../../node_modules/.pnpm/ink@5.2.1_@types+react@18.3.28_react@18.3.1/node_modules/ink/build/reconciler.js"() {
|
|
79292
79350
|
import_react_reconciler = __toESM(require_react_reconciler());
|
|
79293
|
-
|
|
79351
|
+
import_constants28 = __toESM(require_constants3());
|
|
79294
79352
|
await init_src();
|
|
79295
79353
|
await init_dom();
|
|
79296
79354
|
await init_styles();
|
|
@@ -79440,7 +79498,7 @@ $ npm install --save-dev react-devtools-core
|
|
|
79440
79498
|
scheduleTimeout: setTimeout,
|
|
79441
79499
|
cancelTimeout: clearTimeout,
|
|
79442
79500
|
noTimeout: -1,
|
|
79443
|
-
getCurrentEventPriority: () =>
|
|
79501
|
+
getCurrentEventPriority: () => import_constants28.DefaultEventPriority,
|
|
79444
79502
|
beforeActiveInstanceBlur() {
|
|
79445
79503
|
},
|
|
79446
79504
|
afterActiveInstanceBlur() {
|
|
@@ -83869,6 +83927,11 @@ var init_SlashCommands = __esm({
|
|
|
83869
83927
|
aliases: ["loop"]
|
|
83870
83928
|
},
|
|
83871
83929
|
{ name: "mcp", description: "Enable / disable / remove MCP servers" },
|
|
83930
|
+
{
|
|
83931
|
+
name: "goal",
|
|
83932
|
+
description: "Work autonomously until the objective is delivered (switches mode + auto-approves; Esc stops)",
|
|
83933
|
+
argumentHint: "<objective>"
|
|
83934
|
+
},
|
|
83872
83935
|
{
|
|
83873
83936
|
name: "yolo",
|
|
83874
83937
|
description: "Toggle auto-approve mode \u2014 every tool call allowed without asking",
|
|
@@ -84750,7 +84813,7 @@ function tokenizeInline(input) {
|
|
|
84750
84813
|
return out;
|
|
84751
84814
|
}
|
|
84752
84815
|
function stripInline(s2) {
|
|
84753
|
-
return s2.replace(/`([
|
|
84816
|
+
return s2.replace(/`([^`\n]+)`/g, "$1").replace(/\*\*([^*\n]+)\*\*/g, "$1").replace(/\*([^*\n]+)\*/g, "$1").replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, "$1");
|
|
84754
84817
|
}
|
|
84755
84818
|
var init_inline = __esm({
|
|
84756
84819
|
"../chat-model/dist/markdown/inline.js"() {
|
|
@@ -85200,6 +85263,7 @@ function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
|
|
|
85200
85263
|
markOrphansAtTurnBoundary();
|
|
85201
85264
|
pendingLoadSkillCallId = null;
|
|
85202
85265
|
continuationSkillEvent = null;
|
|
85266
|
+
suppressedCallIds.clear();
|
|
85203
85267
|
root.push({ kind: "event", id: e3.id, event: e3 });
|
|
85204
85268
|
continue;
|
|
85205
85269
|
}
|
|
@@ -85285,6 +85349,8 @@ function pairToolEvents(events, compactByName = EMPTY_COMPACT_MAP) {
|
|
|
85285
85349
|
continuationSkillEvent = openScope.skillEvent;
|
|
85286
85350
|
openScope.closed = true;
|
|
85287
85351
|
openScope = null;
|
|
85352
|
+
} else {
|
|
85353
|
+
continuationSkillEvent = null;
|
|
85288
85354
|
}
|
|
85289
85355
|
root.push({ kind: "event", id: e3.id, event: e3 });
|
|
85290
85356
|
continue;
|
|
@@ -86602,6 +86668,8 @@ function runSlash2(cmd, deps) {
|
|
|
86602
86668
|
case "/mode":
|
|
86603
86669
|
case "/loop":
|
|
86604
86670
|
return openModePicker(deps, args);
|
|
86671
|
+
case "/goal":
|
|
86672
|
+
return startGoal(deps, args);
|
|
86605
86673
|
case "/yolo":
|
|
86606
86674
|
case "/auto-approve":
|
|
86607
86675
|
deps.setYolo((y2) => {
|
|
@@ -86703,6 +86771,25 @@ function openMcpPicker(deps) {
|
|
|
86703
86771
|
}
|
|
86704
86772
|
})();
|
|
86705
86773
|
}
|
|
86774
|
+
function startGoal(deps, arg) {
|
|
86775
|
+
const objective = arg.trim();
|
|
86776
|
+
const GOAL_MODE = "goal";
|
|
86777
|
+
if (!deps.session.modes.list().some((m3) => m3.name === GOAL_MODE)) {
|
|
86778
|
+
deps.setSystemNotice("goal mode is not available (mode-goal plugin not loaded)");
|
|
86779
|
+
return;
|
|
86780
|
+
}
|
|
86781
|
+
try {
|
|
86782
|
+
deps.session.modes.setActive(GOAL_MODE);
|
|
86783
|
+
void savePreferences({ mode: GOAL_MODE });
|
|
86784
|
+
} catch (err) {
|
|
86785
|
+
deps.setSystemNotice(`failed to switch to goal mode: ${err instanceof Error ? err.message : String(err)}`);
|
|
86786
|
+
return;
|
|
86787
|
+
}
|
|
86788
|
+
deps.setYolo(() => true);
|
|
86789
|
+
deps.setSystemNotice(objective ? "\u{1F3AF} goal mode \u2014 tools auto-approved; working until the objective is delivered. Press Esc to stop." : "\u{1F3AF} goal mode on \u2014 tools auto-approved. Send your objective as the next message (Esc stops).");
|
|
86790
|
+
if (objective)
|
|
86791
|
+
deps.submitPrompt(objective);
|
|
86792
|
+
}
|
|
86706
86793
|
function openModePicker(deps, arg = "") {
|
|
86707
86794
|
const modes = deps.session.modes.list();
|
|
86708
86795
|
if (modes.length === 0) {
|
|
@@ -88176,7 +88263,18 @@ var init_SessionView = __esm({
|
|
|
88176
88263
|
setPicker,
|
|
88177
88264
|
queueRef: turn.queueRef,
|
|
88178
88265
|
setQueueCount: turn.setQueueCount,
|
|
88179
|
-
performSessionAction: performSessionAction2
|
|
88266
|
+
performSessionAction: performSessionAction2,
|
|
88267
|
+
// Start a turn directly (e.g. /goal kicking off autonomous work)
|
|
88268
|
+
// without clearing the just-set system notice. Objectives are plain
|
|
88269
|
+
// text, so no image-attachment resolution is needed.
|
|
88270
|
+
submitPrompt: (prompt) => {
|
|
88271
|
+
if (turn.busyRef.current) {
|
|
88272
|
+
turn.queueRef.current.push({ text: prompt, attachments: [] });
|
|
88273
|
+
turn.setQueueCount(turn.queueRef.current.length);
|
|
88274
|
+
return;
|
|
88275
|
+
}
|
|
88276
|
+
void turn.runTurnWith(prompt, []);
|
|
88277
|
+
}
|
|
88180
88278
|
});
|
|
88181
88279
|
return;
|
|
88182
88280
|
}
|
|
@@ -92006,6 +92104,7 @@ async function buildSession(args) {
|
|
|
92006
92104
|
// scan, so pluginHost.reload() (install_plugin, self-update) rediscovers
|
|
92007
92105
|
// and preserves runtime-installed / scaffolded plugins.
|
|
92008
92106
|
pluginDiscoveryPaths: [userPluginsDir2, path3.join(userPluginsDir2, "node_modules")],
|
|
92107
|
+
...args.secretResolver ? { secretResolver: args.secretResolver } : {},
|
|
92009
92108
|
...args.resumeSessionId ? { sessionId: args.resumeSessionId } : {},
|
|
92010
92109
|
// Seed restored events directly into the log so subscribers don't
|
|
92011
92110
|
// re-fire side effects for historical events. New appends from this
|
|
@@ -104727,6 +104826,53 @@ function safeJson(v3, indent) {
|
|
|
104727
104826
|
return String(v3);
|
|
104728
104827
|
}
|
|
104729
104828
|
}
|
|
104829
|
+
var MAX_SLEEP_MS = 3e5;
|
|
104830
|
+
function resolveSleepMs(input) {
|
|
104831
|
+
const requested = (input.seconds ?? 0) * 1e3 + (input.ms ?? 0);
|
|
104832
|
+
return Math.min(Math.round(requested), MAX_SLEEP_MS);
|
|
104833
|
+
}
|
|
104834
|
+
var sleepTool = defineTool({
|
|
104835
|
+
name: "Sleep",
|
|
104836
|
+
description: "Pause for a set duration before continuing. Use it to wait for an external/async process (a build, a deploy, a server warming up) before re-checking, instead of busy-looping. Give `seconds` and/or `ms` (they sum); capped at 5 minutes per call. Interruptible.",
|
|
104837
|
+
inputSchema: z$1.object({
|
|
104838
|
+
seconds: z$1.number().positive().optional().describe("Seconds to pause. Summed with `ms` when both are given."),
|
|
104839
|
+
ms: z$1.number().int().positive().optional().describe("Milliseconds to pause. Summed with `seconds` when both are given.")
|
|
104840
|
+
}).refine((v3) => v3.seconds !== void 0 || v3.ms !== void 0, {
|
|
104841
|
+
message: "Provide `seconds` and/or `ms`."
|
|
104842
|
+
}),
|
|
104843
|
+
// No side effects — safe to auto-allow without a permission prompt.
|
|
104844
|
+
permission: { action: "allow" },
|
|
104845
|
+
compact: {
|
|
104846
|
+
verb: "Sleeping",
|
|
104847
|
+
noun: { one: "pause", other: "pauses" }
|
|
104848
|
+
},
|
|
104849
|
+
isolation: {
|
|
104850
|
+
capabilities: {
|
|
104851
|
+
net: { mode: "none" },
|
|
104852
|
+
// Slightly above the cap so the isolator's own timeout never fires
|
|
104853
|
+
// before a max-length sleep resolves on its own.
|
|
104854
|
+
timeMs: MAX_SLEEP_MS + 1e3
|
|
104855
|
+
}
|
|
104856
|
+
},
|
|
104857
|
+
async handler(input, ctx) {
|
|
104858
|
+
const totalMs = resolveSleepMs(input);
|
|
104859
|
+
if (ctx.signal.aborted) {
|
|
104860
|
+
throw new MoxxyError({ code: "ABORTED", message: "Sleep aborted before start" });
|
|
104861
|
+
}
|
|
104862
|
+
await new Promise((resolve12, reject) => {
|
|
104863
|
+
const timer = setTimeout(() => {
|
|
104864
|
+
ctx.signal.removeEventListener("abort", onAbort);
|
|
104865
|
+
resolve12();
|
|
104866
|
+
}, totalMs);
|
|
104867
|
+
const onAbort = () => {
|
|
104868
|
+
clearTimeout(timer);
|
|
104869
|
+
reject(new MoxxyError({ code: "ABORTED", message: `Sleep interrupted after request for ${totalMs}ms` }));
|
|
104870
|
+
};
|
|
104871
|
+
ctx.signal.addEventListener("abort", onAbort, { once: true });
|
|
104872
|
+
});
|
|
104873
|
+
return `slept ${totalMs}ms`;
|
|
104874
|
+
}
|
|
104875
|
+
});
|
|
104730
104876
|
var writeTool = defineTool({
|
|
104731
104877
|
name: "Write",
|
|
104732
104878
|
description: "Write a UTF-8 file to disk, creating parent directories as needed. Overwrites if exists.",
|
|
@@ -104765,7 +104911,8 @@ var builtinTools = [
|
|
|
104765
104911
|
bashTool,
|
|
104766
104912
|
grepTool,
|
|
104767
104913
|
globTool,
|
|
104768
|
-
recallTool
|
|
104914
|
+
recallTool,
|
|
104915
|
+
sleepTool
|
|
104769
104916
|
];
|
|
104770
104917
|
var builtinToolsPlugin = definePlugin({
|
|
104771
104918
|
name: "@moxxy/tools-builtin",
|
|
@@ -106461,6 +106608,425 @@ var developerModePlugin = definePlugin({
|
|
|
106461
106608
|
version: "0.0.0",
|
|
106462
106609
|
modes: [developerMode]
|
|
106463
106610
|
});
|
|
106611
|
+
var GOAL_MODE_NAME = "goal";
|
|
106612
|
+
var GOAL_PLUGIN_ID = asPluginId("@moxxy/mode-goal");
|
|
106613
|
+
var GOAL_COMPLETE_TOOL = "goal_complete";
|
|
106614
|
+
var GOAL_ABANDON_TOOL = "goal_abandon";
|
|
106615
|
+
var GOAL_MAX_ITERATIONS = 150;
|
|
106616
|
+
var GOAL_MAX_NOOP_ITERATIONS = 3;
|
|
106617
|
+
var GOAL_TOKEN_BUDGET = 4e6;
|
|
106618
|
+
var GOAL_SYSTEM_PROMPT = `You are operating in GOAL MODE. The user has given you a goal and you will work on it AUTONOMOUSLY, across as many steps as it takes, until it is genuinely done. You are running unattended \u2014 the user is not watching each step and your tool calls are auto-approved \u2014 so act like a careful senior engineer who has been handed the keys.
|
|
106619
|
+
|
|
106620
|
+
How goal mode ends \u2014 this is the most important rule:
|
|
106621
|
+
- The loop does NOT end when you stop talking. It ends ONLY when you call the \`${GOAL_COMPLETE_TOOL}\` tool. If you produce a message without tool calls, you will simply be prompted to continue.
|
|
106622
|
+
- When (and only when) the goal is FULLY achieved AND you have verified it, call \`${GOAL_COMPLETE_TOOL}\` with a short summary and concrete evidence (commands you ran and their results, files you changed, tests that passed).
|
|
106623
|
+
- If you become genuinely blocked \u2014 a missing credential, a destructive action you shouldn't take unattended, or a requirement too ambiguous to proceed on \u2014 call \`${GOAL_ABANDON_TOOL}\` with the reason and exactly what you need from the user. Do NOT spin on something you cannot resolve.
|
|
106624
|
+
|
|
106625
|
+
While working:
|
|
106626
|
+
- Break the goal into steps and just do them \u2014 don't stop to ask for confirmation on routine work; you have autonomy for this run.
|
|
106627
|
+
- Verify your work as you go (run the project's tests / build / linter when relevant) before declaring the goal complete.
|
|
106628
|
+
- Be careful with irreversible or destructive operations (deleting data, force-pushing, external side effects). When something is high-stakes and reversible-only-by-the-user, prefer to \`${GOAL_ABANDON_TOOL}\` and ask rather than guess.
|
|
106629
|
+
- Don't repeat the same failing action. If an approach isn't working, change it; if nothing works, abandon with a clear explanation.
|
|
106630
|
+
- Don't declare the goal complete prematurely. "I think this should work" is not done \u2014 verify first.`;
|
|
106631
|
+
var CONTINUE_NUDGE = `You stopped without calling \`${GOAL_COMPLETE_TOOL}\`. If the goal is fully achieved AND verified, call \`${GOAL_COMPLETE_TOOL}\` now. Otherwise, take the next concrete step toward it.`;
|
|
106632
|
+
var STALL_NUDGE = `You have produced no tool calls for several turns. Either take a concrete next action toward the goal, or call \`${GOAL_COMPLETE_TOOL}\` (if done) / \`${GOAL_ABANDON_TOOL}\` (if blocked). Do not reply with only text again.`;
|
|
106633
|
+
var goalCompleteTool = defineTool({
|
|
106634
|
+
name: GOAL_COMPLETE_TOOL,
|
|
106635
|
+
description: "Declare the goal FULLY ACHIEVED and end goal mode. Call this only after you have verified the work. Provide a short summary and concrete evidence (commands run + results, files changed, tests that passed). This is the only way to end a goal-mode run successfully.",
|
|
106636
|
+
inputSchema: z.object({
|
|
106637
|
+
summary: z.string().min(1).describe("One- or two-sentence summary of what was accomplished."),
|
|
106638
|
+
evidence: z.array(z.string()).optional().describe("Concrete proof the goal is met: commands run and their results, files changed, tests passed.")
|
|
106639
|
+
}),
|
|
106640
|
+
permission: { action: "allow" },
|
|
106641
|
+
handler: (input) => {
|
|
106642
|
+
const { summary, evidence } = input;
|
|
106643
|
+
return {
|
|
106644
|
+
acknowledged: true,
|
|
106645
|
+
summary,
|
|
106646
|
+
evidenceCount: evidence?.length ?? 0
|
|
106647
|
+
};
|
|
106648
|
+
}
|
|
106649
|
+
});
|
|
106650
|
+
var goalAbandonTool = defineTool({
|
|
106651
|
+
name: GOAL_ABANDON_TOOL,
|
|
106652
|
+
description: "Give up on the goal because you are genuinely blocked \u2014 a missing credential, a destructive action you should not take unattended, or a requirement too ambiguous to proceed. Provide the reason and exactly what you need from the user. This ends goal mode without claiming success.",
|
|
106653
|
+
inputSchema: z.object({
|
|
106654
|
+
reason: z.string().min(1).describe("Why you cannot proceed."),
|
|
106655
|
+
needsFromUser: z.string().optional().describe("What the user must provide or decide for the goal to continue.")
|
|
106656
|
+
}),
|
|
106657
|
+
permission: { action: "allow" },
|
|
106658
|
+
handler: (input) => {
|
|
106659
|
+
const { reason, needsFromUser } = input;
|
|
106660
|
+
return { acknowledged: true, reason, ...needsFromUser ? { needsFromUser } : {} };
|
|
106661
|
+
}
|
|
106662
|
+
});
|
|
106663
|
+
var goalTools = [goalCompleteTool, goalAbandonTool];
|
|
106664
|
+
|
|
106665
|
+
// ../mode-goal/dist/completion.js
|
|
106666
|
+
function detectGoalTerminal(log, batch) {
|
|
106667
|
+
const goalCalls = /* @__PURE__ */ new Map();
|
|
106668
|
+
for (const t2 of batch) {
|
|
106669
|
+
if (t2.name === GOAL_COMPLETE_TOOL || t2.name === GOAL_ABANDON_TOOL)
|
|
106670
|
+
goalCalls.set(t2.id, t2);
|
|
106671
|
+
}
|
|
106672
|
+
if (goalCalls.size === 0)
|
|
106673
|
+
return null;
|
|
106674
|
+
for (let i2 = log.length - 1; i2 >= 0; i2--) {
|
|
106675
|
+
const e3 = log[i2];
|
|
106676
|
+
if (!e3 || e3.type !== "tool_result" || !e3.ok)
|
|
106677
|
+
continue;
|
|
106678
|
+
const call = goalCalls.get(String(e3.callId));
|
|
106679
|
+
if (!call)
|
|
106680
|
+
continue;
|
|
106681
|
+
const input = call.input ?? {};
|
|
106682
|
+
if (call.name === GOAL_COMPLETE_TOOL) {
|
|
106683
|
+
return {
|
|
106684
|
+
kind: "complete",
|
|
106685
|
+
summary: typeof input.summary === "string" ? input.summary : "Goal completed.",
|
|
106686
|
+
evidence: Array.isArray(input.evidence) ? input.evidence : []
|
|
106687
|
+
};
|
|
106688
|
+
}
|
|
106689
|
+
return {
|
|
106690
|
+
kind: "abandon",
|
|
106691
|
+
reason: typeof input.reason === "string" ? input.reason : "Goal abandoned.",
|
|
106692
|
+
...typeof input.needsFromUser === "string" ? { needsFromUser: input.needsFromUser } : {}
|
|
106693
|
+
};
|
|
106694
|
+
}
|
|
106695
|
+
return null;
|
|
106696
|
+
}
|
|
106697
|
+
|
|
106698
|
+
// ../mode-goal/dist/goal-loop.js
|
|
106699
|
+
async function* runGoalMode(ctx) {
|
|
106700
|
+
if (ctx.signal.aborted) {
|
|
106701
|
+
yield await ctx.emit({
|
|
106702
|
+
type: "abort",
|
|
106703
|
+
sessionId: ctx.sessionId,
|
|
106704
|
+
turnId: ctx.turnId,
|
|
106705
|
+
source: "system",
|
|
106706
|
+
reason: "aborted before goal mode start"
|
|
106707
|
+
});
|
|
106708
|
+
return;
|
|
106709
|
+
}
|
|
106710
|
+
const autoApprove = {
|
|
106711
|
+
name: "goal-auto-approve",
|
|
106712
|
+
check: async () => ({ mode: "allow", reason: "goal mode runs tools unattended (auto-approve)" })
|
|
106713
|
+
};
|
|
106714
|
+
const goalCtx = {
|
|
106715
|
+
...ctx,
|
|
106716
|
+
systemPrompt: composeSystemPrompts2(ctx.systemPrompt, GOAL_SYSTEM_PROMPT),
|
|
106717
|
+
permissions: autoApprove
|
|
106718
|
+
};
|
|
106719
|
+
yield await ctx.emit({
|
|
106720
|
+
type: "plugin_event",
|
|
106721
|
+
sessionId: ctx.sessionId,
|
|
106722
|
+
turnId: ctx.turnId,
|
|
106723
|
+
source: "plugin",
|
|
106724
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106725
|
+
subtype: "goal_started",
|
|
106726
|
+
payload: { autoApprove: true, maxIterations: ctx.maxIterations ?? GOAL_MAX_ITERATIONS }
|
|
106727
|
+
});
|
|
106728
|
+
const detector = createStuckLoopDetector();
|
|
106729
|
+
const maxIterations = ctx.maxIterations ?? GOAL_MAX_ITERATIONS;
|
|
106730
|
+
let noop3 = 0;
|
|
106731
|
+
let totalTokens = 0;
|
|
106732
|
+
let reactiveCompactions = 0;
|
|
106733
|
+
const MAX_REACTIVE_COMPACTIONS = 2;
|
|
106734
|
+
for (let iteration = 1; iteration <= maxIterations; iteration++) {
|
|
106735
|
+
if (ctx.signal.aborted) {
|
|
106736
|
+
yield await ctx.emit({
|
|
106737
|
+
type: "abort",
|
|
106738
|
+
sessionId: ctx.sessionId,
|
|
106739
|
+
turnId: ctx.turnId,
|
|
106740
|
+
source: "system",
|
|
106741
|
+
reason: "signal aborted"
|
|
106742
|
+
});
|
|
106743
|
+
return;
|
|
106744
|
+
}
|
|
106745
|
+
yield await ctx.emit({
|
|
106746
|
+
type: "mode_iteration",
|
|
106747
|
+
sessionId: ctx.sessionId,
|
|
106748
|
+
turnId: ctx.turnId,
|
|
106749
|
+
source: "system",
|
|
106750
|
+
strategy: GOAL_MODE_NAME,
|
|
106751
|
+
iteration
|
|
106752
|
+
});
|
|
106753
|
+
await runCompactionIfNeeded(goalCtx);
|
|
106754
|
+
await runElisionIfNeeded(goalCtx);
|
|
106755
|
+
const nudge = noop3 === 0 ? void 0 : noop3 >= GOAL_MAX_NOOP_ITERATIONS - 1 ? STALL_NUDGE : CONTINUE_NUDGE;
|
|
106756
|
+
const baseSystem = buildSystemPromptWithSkills(goalCtx.systemPrompt, goalCtx.skills.list()) ?? "";
|
|
106757
|
+
const { messages, stablePrefixIndex } = projectMessages(goalCtx, {
|
|
106758
|
+
...baseSystem ? { systemPrompt: baseSystem } : {},
|
|
106759
|
+
...nudge ? { trailingUserText: nudge } : {}
|
|
106760
|
+
});
|
|
106761
|
+
yield await ctx.emit({
|
|
106762
|
+
type: "provider_request",
|
|
106763
|
+
sessionId: ctx.sessionId,
|
|
106764
|
+
turnId: ctx.turnId,
|
|
106765
|
+
source: "system",
|
|
106766
|
+
provider: goalCtx.provider.name,
|
|
106767
|
+
model: goalCtx.model
|
|
106768
|
+
});
|
|
106769
|
+
const { text, toolUses, stopReason, error: error2, usage } = await collectProviderStream(goalCtx, messages, { iteration, stablePrefixIndex });
|
|
106770
|
+
yield await ctx.emit({
|
|
106771
|
+
type: "provider_response",
|
|
106772
|
+
sessionId: ctx.sessionId,
|
|
106773
|
+
turnId: ctx.turnId,
|
|
106774
|
+
source: "system",
|
|
106775
|
+
provider: goalCtx.provider.name,
|
|
106776
|
+
model: goalCtx.model,
|
|
106777
|
+
...usageEventFields(usage)
|
|
106778
|
+
});
|
|
106779
|
+
if (usage)
|
|
106780
|
+
totalTokens += (usage.inputTokens ?? 0) + (usage.outputTokens ?? 0);
|
|
106781
|
+
if (error2) {
|
|
106782
|
+
if (isContextOverflowError(error2.message) && reactiveCompactions < MAX_REACTIVE_COMPACTIONS) {
|
|
106783
|
+
reactiveCompactions += 1;
|
|
106784
|
+
const compacted = await runCompactionIfNeeded(goalCtx, { force: true });
|
|
106785
|
+
if (compacted) {
|
|
106786
|
+
yield await ctx.emit({
|
|
106787
|
+
type: "error",
|
|
106788
|
+
sessionId: ctx.sessionId,
|
|
106789
|
+
turnId: ctx.turnId,
|
|
106790
|
+
source: "system",
|
|
106791
|
+
kind: "retryable",
|
|
106792
|
+
message: "context window exceeded \u2014 compacted older turns, retrying"
|
|
106793
|
+
});
|
|
106794
|
+
continue;
|
|
106795
|
+
}
|
|
106796
|
+
}
|
|
106797
|
+
yield await ctx.emit({
|
|
106798
|
+
type: "error",
|
|
106799
|
+
sessionId: ctx.sessionId,
|
|
106800
|
+
turnId: ctx.turnId,
|
|
106801
|
+
source: "system",
|
|
106802
|
+
kind: error2.retryable ? "retryable" : "fatal",
|
|
106803
|
+
message: `goal: ${error2.message}`
|
|
106804
|
+
});
|
|
106805
|
+
if (!error2.retryable)
|
|
106806
|
+
return;
|
|
106807
|
+
continue;
|
|
106808
|
+
}
|
|
106809
|
+
reactiveCompactions = 0;
|
|
106810
|
+
if (totalTokens > GOAL_TOKEN_BUDGET) {
|
|
106811
|
+
yield await ctx.emit({
|
|
106812
|
+
type: "plugin_event",
|
|
106813
|
+
sessionId: ctx.sessionId,
|
|
106814
|
+
turnId: ctx.turnId,
|
|
106815
|
+
source: "plugin",
|
|
106816
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106817
|
+
subtype: "goal_budget_exhausted",
|
|
106818
|
+
payload: { totalTokens, budget: GOAL_TOKEN_BUDGET, iteration }
|
|
106819
|
+
});
|
|
106820
|
+
yield await ctx.emit({
|
|
106821
|
+
type: "assistant_message",
|
|
106822
|
+
sessionId: ctx.sessionId,
|
|
106823
|
+
turnId: ctx.turnId,
|
|
106824
|
+
source: "system",
|
|
106825
|
+
content: `Goal mode stopped: token budget exhausted (${totalTokens.toLocaleString()} > ${GOAL_TOKEN_BUDGET.toLocaleString()}) before the goal was completed. Send another message to continue from here.`,
|
|
106826
|
+
stopReason: "end_turn"
|
|
106827
|
+
});
|
|
106828
|
+
return;
|
|
106829
|
+
}
|
|
106830
|
+
const stuck = yield* emitRequestsAndDetectStuck2(ctx, toolUses, detector);
|
|
106831
|
+
if (stuck)
|
|
106832
|
+
return;
|
|
106833
|
+
if (text || stopReason === "end_turn" || toolUses.length === 0) {
|
|
106834
|
+
yield await ctx.emit({
|
|
106835
|
+
type: "assistant_message",
|
|
106836
|
+
sessionId: ctx.sessionId,
|
|
106837
|
+
turnId: ctx.turnId,
|
|
106838
|
+
source: "model",
|
|
106839
|
+
content: text,
|
|
106840
|
+
stopReason
|
|
106841
|
+
});
|
|
106842
|
+
}
|
|
106843
|
+
if (toolUses.length === 0) {
|
|
106844
|
+
noop3 += 1;
|
|
106845
|
+
if (noop3 >= GOAL_MAX_NOOP_ITERATIONS) {
|
|
106846
|
+
yield await ctx.emit({
|
|
106847
|
+
type: "plugin_event",
|
|
106848
|
+
sessionId: ctx.sessionId,
|
|
106849
|
+
turnId: ctx.turnId,
|
|
106850
|
+
source: "plugin",
|
|
106851
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106852
|
+
subtype: "goal_stalled",
|
|
106853
|
+
payload: { idleIterations: noop3, iteration }
|
|
106854
|
+
});
|
|
106855
|
+
yield await ctx.emit({
|
|
106856
|
+
type: "assistant_message",
|
|
106857
|
+
sessionId: ctx.sessionId,
|
|
106858
|
+
turnId: ctx.turnId,
|
|
106859
|
+
source: "system",
|
|
106860
|
+
content: "Goal mode stopped: the model went idle without calling `goal_complete`. It may believe the goal is done \u2014 review the work above, and send another message to continue if not.",
|
|
106861
|
+
stopReason: "end_turn"
|
|
106862
|
+
});
|
|
106863
|
+
return;
|
|
106864
|
+
}
|
|
106865
|
+
continue;
|
|
106866
|
+
}
|
|
106867
|
+
noop3 = 0;
|
|
106868
|
+
const exited = yield* executeToolUses2(goalCtx, toolUses, iteration);
|
|
106869
|
+
if (exited)
|
|
106870
|
+
return;
|
|
106871
|
+
const terminal = detectGoalTerminal(ctx.log.slice(), toolUses);
|
|
106872
|
+
if (terminal?.kind === "complete") {
|
|
106873
|
+
yield await ctx.emit({
|
|
106874
|
+
type: "plugin_event",
|
|
106875
|
+
sessionId: ctx.sessionId,
|
|
106876
|
+
turnId: ctx.turnId,
|
|
106877
|
+
source: "plugin",
|
|
106878
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106879
|
+
subtype: "goal_completed",
|
|
106880
|
+
payload: { summary: terminal.summary, evidenceCount: terminal.evidence.length, iterations: iteration }
|
|
106881
|
+
});
|
|
106882
|
+
const evidenceBlock = terminal.evidence.length > 0 ? `
|
|
106883
|
+
|
|
106884
|
+
${terminal.evidence.map((e3) => `- ${e3}`).join("\n")}` : "";
|
|
106885
|
+
yield await ctx.emit({
|
|
106886
|
+
type: "assistant_message",
|
|
106887
|
+
sessionId: ctx.sessionId,
|
|
106888
|
+
turnId: ctx.turnId,
|
|
106889
|
+
source: "system",
|
|
106890
|
+
content: `\u2713 Goal complete \u2014 ${terminal.summary}${evidenceBlock}`,
|
|
106891
|
+
stopReason: "end_turn"
|
|
106892
|
+
});
|
|
106893
|
+
return;
|
|
106894
|
+
}
|
|
106895
|
+
if (terminal?.kind === "abandon") {
|
|
106896
|
+
yield await ctx.emit({
|
|
106897
|
+
type: "plugin_event",
|
|
106898
|
+
sessionId: ctx.sessionId,
|
|
106899
|
+
turnId: ctx.turnId,
|
|
106900
|
+
source: "plugin",
|
|
106901
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106902
|
+
subtype: "goal_abandoned",
|
|
106903
|
+
payload: { reason: terminal.reason, ...terminal.needsFromUser ? { needsFromUser: terminal.needsFromUser } : {}, iterations: iteration }
|
|
106904
|
+
});
|
|
106905
|
+
const needs = terminal.needsFromUser ? `
|
|
106906
|
+
|
|
106907
|
+
Needs from you: ${terminal.needsFromUser}` : "";
|
|
106908
|
+
yield await ctx.emit({
|
|
106909
|
+
type: "assistant_message",
|
|
106910
|
+
sessionId: ctx.sessionId,
|
|
106911
|
+
turnId: ctx.turnId,
|
|
106912
|
+
source: "system",
|
|
106913
|
+
content: `Goal abandoned \u2014 ${terminal.reason}${needs}`,
|
|
106914
|
+
stopReason: "end_turn"
|
|
106915
|
+
});
|
|
106916
|
+
return;
|
|
106917
|
+
}
|
|
106918
|
+
}
|
|
106919
|
+
yield await ctx.emit({
|
|
106920
|
+
type: "plugin_event",
|
|
106921
|
+
sessionId: ctx.sessionId,
|
|
106922
|
+
turnId: ctx.turnId,
|
|
106923
|
+
source: "plugin",
|
|
106924
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106925
|
+
subtype: "goal_max_iterations",
|
|
106926
|
+
payload: { maxIterations }
|
|
106927
|
+
});
|
|
106928
|
+
yield await ctx.emit({
|
|
106929
|
+
type: "error",
|
|
106930
|
+
sessionId: ctx.sessionId,
|
|
106931
|
+
turnId: ctx.turnId,
|
|
106932
|
+
source: "system",
|
|
106933
|
+
kind: "fatal",
|
|
106934
|
+
message: `goal mode reached the iteration cap (${maxIterations}) without calling goal_complete. Stopping to avoid an unbounded run; send another message to continue.`
|
|
106935
|
+
});
|
|
106936
|
+
}
|
|
106937
|
+
function composeSystemPrompts2(user, layer) {
|
|
106938
|
+
if (!user || user.trim() === "")
|
|
106939
|
+
return layer;
|
|
106940
|
+
return `${layer}
|
|
106941
|
+
|
|
106942
|
+
---
|
|
106943
|
+
|
|
106944
|
+
${user}`;
|
|
106945
|
+
}
|
|
106946
|
+
async function* emitRequestsAndDetectStuck2(ctx, toolUses, detector) {
|
|
106947
|
+
for (const t2 of toolUses) {
|
|
106948
|
+
yield await ctx.emit({
|
|
106949
|
+
type: "tool_call_requested",
|
|
106950
|
+
sessionId: ctx.sessionId,
|
|
106951
|
+
turnId: ctx.turnId,
|
|
106952
|
+
source: "model",
|
|
106953
|
+
callId: asToolCallId(t2.id),
|
|
106954
|
+
name: t2.name,
|
|
106955
|
+
input: t2.input
|
|
106956
|
+
});
|
|
106957
|
+
const sig = detector.record(t2.name, t2.input);
|
|
106958
|
+
if (sig.stuck) {
|
|
106959
|
+
const how = sig.kind === "near" ? "against the same target (only volatile args varied)" : "with identical input";
|
|
106960
|
+
yield await ctx.emit({
|
|
106961
|
+
type: "plugin_event",
|
|
106962
|
+
sessionId: ctx.sessionId,
|
|
106963
|
+
turnId: ctx.turnId,
|
|
106964
|
+
source: "plugin",
|
|
106965
|
+
pluginId: GOAL_PLUGIN_ID,
|
|
106966
|
+
subtype: "goal_stuck",
|
|
106967
|
+
payload: { tool: t2.name, count: sig.count, kind: sig.kind }
|
|
106968
|
+
});
|
|
106969
|
+
yield await ctx.emit({
|
|
106970
|
+
type: "error",
|
|
106971
|
+
sessionId: ctx.sessionId,
|
|
106972
|
+
turnId: ctx.turnId,
|
|
106973
|
+
source: "system",
|
|
106974
|
+
kind: "fatal",
|
|
106975
|
+
message: `goal mode aborted \u2014 stuck pattern: tool "${t2.name}" called ${sig.count} times ${how}. The model is looping on the same call; send another message to redirect it.`
|
|
106976
|
+
});
|
|
106977
|
+
return true;
|
|
106978
|
+
}
|
|
106979
|
+
}
|
|
106980
|
+
return false;
|
|
106981
|
+
}
|
|
106982
|
+
async function* executeToolUses2(ctx, toolUses, iteration) {
|
|
106983
|
+
const unresolved = new Set(toolUses.map((t2) => t2.id));
|
|
106984
|
+
for (const t2 of toolUses) {
|
|
106985
|
+
if (ctx.signal.aborted) {
|
|
106986
|
+
for (const orphanId of unresolved) {
|
|
106987
|
+
yield await ctx.emit({
|
|
106988
|
+
type: "tool_result",
|
|
106989
|
+
sessionId: ctx.sessionId,
|
|
106990
|
+
turnId: ctx.turnId,
|
|
106991
|
+
source: "tool",
|
|
106992
|
+
callId: asToolCallId(orphanId),
|
|
106993
|
+
ok: false,
|
|
106994
|
+
error: { kind: "aborted", message: "turn aborted before tool ran" }
|
|
106995
|
+
});
|
|
106996
|
+
}
|
|
106997
|
+
unresolved.clear();
|
|
106998
|
+
yield await ctx.emit({
|
|
106999
|
+
type: "abort",
|
|
107000
|
+
sessionId: ctx.sessionId,
|
|
107001
|
+
turnId: ctx.turnId,
|
|
107002
|
+
source: "system",
|
|
107003
|
+
reason: "signal aborted during tool execution"
|
|
107004
|
+
});
|
|
107005
|
+
return true;
|
|
107006
|
+
}
|
|
107007
|
+
try {
|
|
107008
|
+
yield* dispatchToolCall(ctx, t2, iteration);
|
|
107009
|
+
} finally {
|
|
107010
|
+
unresolved.delete(t2.id);
|
|
107011
|
+
}
|
|
107012
|
+
}
|
|
107013
|
+
return false;
|
|
107014
|
+
}
|
|
107015
|
+
|
|
107016
|
+
// ../mode-goal/dist/index.js
|
|
107017
|
+
var goalMode = defineMode({
|
|
107018
|
+
name: GOAL_MODE_NAME,
|
|
107019
|
+
description: "Autonomous goal loop: works across many turns until it calls goal_complete (tools auto-approved)",
|
|
107020
|
+
run: runGoalMode
|
|
107021
|
+
});
|
|
107022
|
+
var goalModePlugin = definePlugin({
|
|
107023
|
+
name: "@moxxy/mode-goal",
|
|
107024
|
+
version: "0.0.0",
|
|
107025
|
+
// The mode AND its control tools ship together: the loop watches for the
|
|
107026
|
+
// tools' results to terminate, so they're useless apart.
|
|
107027
|
+
modes: [goalMode],
|
|
107028
|
+
tools: goalTools
|
|
107029
|
+
});
|
|
106464
107030
|
var DEEP_RESEARCH_MODE_NAME = "deep-research";
|
|
106465
107031
|
var DEEP_RESEARCH_PLUGIN_ID = asPluginId("@moxxy/mode-deep-research");
|
|
106466
107032
|
var QUERY_PLAN_SYSTEM_PROMPT = `You are scoping a deep-research task. Produce 2-5 PARALLEL GATHERING queries \u2014 one per independent angle of raw evidence the synthesis phase will need.
|
|
@@ -109120,7 +109686,7 @@ function C2(r2, t2) {
|
|
|
109120
109686
|
for (const s2 of r2) if (s2 !== void 0 && C2(s2, t2)) return true;
|
|
109121
109687
|
return false;
|
|
109122
109688
|
}
|
|
109123
|
-
function
|
|
109689
|
+
function z21(r2, t2) {
|
|
109124
109690
|
if (r2 === t2) return;
|
|
109125
109691
|
const s2 = r2.split(`
|
|
109126
109692
|
`), e3 = t2.split(`
|
|
@@ -109260,7 +109826,7 @@ var m2 = class {
|
|
|
109260
109826
|
if (t2 !== this._prevFrame) {
|
|
109261
109827
|
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
109262
109828
|
else {
|
|
109263
|
-
const s2 =
|
|
109829
|
+
const s2 = z21(this._prevFrame, t2), e3 = L2(this.output);
|
|
109264
109830
|
if (this.restoreCursor(), s2) {
|
|
109265
109831
|
const i2 = Math.max(0, s2.numLinesAfter - e3), n2 = Math.max(0, s2.numLinesBefore - e3);
|
|
109266
109832
|
let o2 = s2.lines.find((u2) => u2 >= i2);
|
|
@@ -109311,52 +109877,6 @@ var X2 = class extends m2 {
|
|
|
109311
109877
|
});
|
|
109312
109878
|
}
|
|
109313
109879
|
};
|
|
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
109880
|
var ot2 = class extends m2 {
|
|
109361
109881
|
_mask = "\u2022";
|
|
109362
109882
|
get cursor() {
|
|
@@ -109441,11 +109961,8 @@ var H2 = w3("\u25C7", "o");
|
|
|
109441
109961
|
var lt2 = w3("\u250C", "T");
|
|
109442
109962
|
var $2 = w3("\u2502", "|");
|
|
109443
109963
|
var x3 = w3("\u2514", "\u2014");
|
|
109444
|
-
var
|
|
109964
|
+
var z22 = w3("\u25CF", ">");
|
|
109445
109965
|
var U2 = w3("\u25CB", " ");
|
|
109446
|
-
var et3 = w3("\u25FB", "[\u2022]");
|
|
109447
|
-
var K3 = w3("\u25FC", "[+]");
|
|
109448
|
-
var Y3 = w3("\u25FB", "[ ]");
|
|
109449
109966
|
var Et2 = w3("\u25AA", "\u2022");
|
|
109450
109967
|
var st2 = w3("\u2500", "-");
|
|
109451
109968
|
var ct2 = w3("\u256E", "+");
|
|
@@ -109531,9 +110048,9 @@ ${styleText("gray", $2)}` : ""}`;
|
|
|
109531
110048
|
}
|
|
109532
110049
|
default: {
|
|
109533
110050
|
const l2 = r2 ? `${styleText("cyan", $2)} ` : "", d2 = r2 ? styleText("cyan", x3) : "";
|
|
109534
|
-
return `${c2}${l2}${this.value ? `${styleText("green",
|
|
110051
|
+
return `${c2}${l2}${this.value ? `${styleText("green", z22)} ${i2}` : `${styleText("dim", U2)} ${styleText("dim", i2)}`}${t2.vertical ? r2 ? `
|
|
109535
110052
|
${styleText("cyan", $2)} ` : `
|
|
109536
|
-
` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U2)} ${styleText("dim", s2)}` : `${styleText("green",
|
|
110053
|
+
` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", U2)} ${styleText("dim", s2)}` : `${styleText("green", z22)} ${s2}`}
|
|
109537
110054
|
${d2}
|
|
109538
110055
|
`;
|
|
109539
110056
|
}
|
|
@@ -109584,59 +110101,6 @@ ${styleText("gray", x3)} ` ;
|
|
|
109584
110101
|
|
|
109585
110102
|
`);
|
|
109586
110103
|
};
|
|
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
110104
|
var we2 = (t2) => styleText("dim", t2);
|
|
109641
110105
|
var be2 = (t2, i2, s2) => {
|
|
109642
110106
|
const r2 = { hard: true, trim: false }, u2 = wrapAnsi(t2, i2, r2).split(`
|
|
@@ -109751,7 +110215,7 @@ var xe2 = (t2) => {
|
|
|
109751
110215
|
case "selected":
|
|
109752
110216
|
return `${it3(u2, (n2) => styleText("dim", n2))}`;
|
|
109753
110217
|
case "active":
|
|
109754
|
-
return `${styleText("green",
|
|
110218
|
+
return `${styleText("green", z22)} ${u2}${s2.hint ? ` ${styleText("dim", `(${s2.hint})`)}` : ""}`;
|
|
109755
110219
|
case "cancelled":
|
|
109756
110220
|
return `${it3(u2, (n2) => styleText(["strikethrough", "dim"], n2))}`;
|
|
109757
110221
|
default:
|
|
@@ -111799,6 +112263,15 @@ async function installPluginPackage(opts) {
|
|
|
111799
112263
|
}
|
|
111800
112264
|
return { installed: opts.packageName, dir };
|
|
111801
112265
|
}
|
|
112266
|
+
async function removePluginPackage(opts) {
|
|
112267
|
+
const dir = userPluginsDir();
|
|
112268
|
+
await ensurePackageJson(dir);
|
|
112269
|
+
const { exitCode, stderr } = await runNpm(["uninstall", "--prefix", dir, "--no-fund", "--no-audit", "--save", opts.packageName], opts.signal);
|
|
112270
|
+
if (exitCode !== 0) {
|
|
112271
|
+
throw new Error(`npm uninstall failed (exit ${exitCode}): ${truncate9(stderr, 400)}`);
|
|
112272
|
+
}
|
|
112273
|
+
return { removed: opts.packageName, dir };
|
|
112274
|
+
}
|
|
111802
112275
|
function buildInstallPluginTool(deps) {
|
|
111803
112276
|
return defineTool({
|
|
111804
112277
|
name: "install_plugin",
|
|
@@ -111838,6 +112311,36 @@ function buildInstallPluginTool(deps) {
|
|
|
111838
112311
|
}
|
|
111839
112312
|
});
|
|
111840
112313
|
}
|
|
112314
|
+
function buildUninstallPluginTool(deps) {
|
|
112315
|
+
return defineTool({
|
|
112316
|
+
name: "uninstall_plugin",
|
|
112317
|
+
description: "Uninstall an npm-installed moxxy plugin from the user plugin directory (~/.moxxy/plugins/) via `npm uninstall`, then hot-reload the plugin host so its tools / agents / providers / modes / channels disappear from the current session. Requires `npm` on PATH. Returns the diff of what got unregistered. Use this when the user asks to remove a plugin they installed. NOTE: this only removes npm packages \u2014 a scaffolded plugin authored under ~/.moxxy/plugins is removed by rolling back its self-update transaction instead.",
|
|
112318
|
+
inputSchema: z$1.object({
|
|
112319
|
+
packageName: z$1.string().min(1).refine((s2) => NPM_NAME_RE.test(s2), {
|
|
112320
|
+
message: "must be a valid npm package name (e.g. @moxxy/agent-researcher)"
|
|
112321
|
+
}).describe("npm package name to uninstall. Scoped (@org/pkg) or bare.")
|
|
112322
|
+
}),
|
|
112323
|
+
permission: { action: "prompt" },
|
|
112324
|
+
isolation: {
|
|
112325
|
+
capabilities: {
|
|
112326
|
+
subprocess: true,
|
|
112327
|
+
commands: ["npm"],
|
|
112328
|
+
fs: { read: ["$cwd/**"], write: [`${userPluginsDir()}/**`] }
|
|
112329
|
+
}
|
|
112330
|
+
},
|
|
112331
|
+
handler: async ({ packageName }, ctx) => {
|
|
112332
|
+
const before = deps.snapshot();
|
|
112333
|
+
const { removed } = await removePluginPackage({ packageName, signal: ctx.signal });
|
|
112334
|
+
await deps.reload();
|
|
112335
|
+
const after = deps.snapshot();
|
|
112336
|
+
return {
|
|
112337
|
+
removed,
|
|
112338
|
+
// before-minus-after == contributions the removed package had provided.
|
|
112339
|
+
unregistered: diffSnapshot2(after, before)
|
|
112340
|
+
};
|
|
112341
|
+
}
|
|
112342
|
+
});
|
|
112343
|
+
}
|
|
111841
112344
|
async function ensurePackageJson(dir) {
|
|
111842
112345
|
const pkgPath = path3.join(dir, "package.json");
|
|
111843
112346
|
try {
|
|
@@ -111904,7 +112407,7 @@ function buildPluginsAdminPlugin(opts) {
|
|
|
111904
112407
|
return definePlugin({
|
|
111905
112408
|
name: "@moxxy/plugin-plugins-admin",
|
|
111906
112409
|
version: "0.0.0",
|
|
111907
|
-
tools: [buildInstallPluginTool(deps)]
|
|
112410
|
+
tools: [buildInstallPluginTool(deps), buildUninstallPluginTool(deps)]
|
|
111908
112411
|
});
|
|
111909
112412
|
}
|
|
111910
112413
|
function buildProviderDef(entry) {
|
|
@@ -117720,6 +118223,7 @@ function buildBuiltinsCore(args) {
|
|
|
117720
118223
|
{ name: "@moxxy/mode-plan-execute", plugin: planExecuteModePlugin },
|
|
117721
118224
|
{ name: "@moxxy/mode-bmad", plugin: bmadModePlugin },
|
|
117722
118225
|
{ name: "@moxxy/mode-developer", plugin: developerModePlugin },
|
|
118226
|
+
{ name: "@moxxy/mode-goal", plugin: goalModePlugin },
|
|
117723
118227
|
{ name: "@moxxy/mode-deep-research", plugin: deepResearchModePlugin },
|
|
117724
118228
|
{ name: "@moxxy/compactor-summarize", plugin: summarizeCompactorPlugin },
|
|
117725
118229
|
{ name: "@moxxy/cache-strategy-stable-prefix", plugin: stablePrefixCacheStrategyPlugin },
|
|
@@ -117861,12 +118365,69 @@ function buildBuiltinsCore(args) {
|
|
|
117861
118365
|
// options.allowCoreUpdate = false to hide the self_update_core_* tools.
|
|
117862
118366
|
// options.repoUrl overrides the git source (needed if @moxxy/core's
|
|
117863
118367
|
// published package.json lacks a `repository` field).
|
|
118368
|
+
//
|
|
118369
|
+
// MOXXY_NO_CORE_UPDATE=1 hard-disables Tier-2 regardless of config —
|
|
118370
|
+
// the desktop sets this on the runner spawn because core patches
|
|
118371
|
+
// (git clone + build + dist overlay + restart) can't work inside a
|
|
118372
|
+
// read-only, packaged .app and would only confuse the model.
|
|
117864
118373
|
coreUpdate: {
|
|
117865
|
-
enabled: rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.allowCoreUpdate !== false,
|
|
118374
|
+
enabled: process.env.MOXXY_NO_CORE_UPDATE !== "1" && rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.allowCoreUpdate !== false,
|
|
117866
118375
|
...typeof rawConfig.plugins?.["@moxxy/plugin-self-update"]?.options?.repoUrl === "string" ? { repoUrlOverride: rawConfig.plugins["@moxxy/plugin-self-update"].options.repoUrl } : {}
|
|
117867
118376
|
}
|
|
117868
118377
|
})
|
|
117869
118378
|
},
|
|
118379
|
+
// Voice/TTS control — lets the agent switch which text-to-speech backend
|
|
118380
|
+
// read-aloud surfaces (the desktop's speaker button) use, without a
|
|
118381
|
+
// settings UI. `set_voice` activates a registered synthesizer by name, or
|
|
118382
|
+
// 'system' to deactivate (fall back to the OS voice). `list_voices` reports
|
|
118383
|
+
// what's available + which is active. A synthesizer authored via
|
|
118384
|
+
// self-update auto-activates on load, so this is for switching afterwards.
|
|
118385
|
+
{
|
|
118386
|
+
name: "@moxxy/voice-admin",
|
|
118387
|
+
plugin: (() => {
|
|
118388
|
+
const voiceNames = () => [
|
|
118389
|
+
"system",
|
|
118390
|
+
...session.synthesizers.list().map((s2) => s2.name)
|
|
118391
|
+
];
|
|
118392
|
+
return definePlugin({
|
|
118393
|
+
name: "@moxxy/voice-admin",
|
|
118394
|
+
version: "0.0.0",
|
|
118395
|
+
tools: [
|
|
118396
|
+
defineTool({
|
|
118397
|
+
name: "list_voices",
|
|
118398
|
+
description: 'List the text-to-speech (synthesizer) backends registered on this session and which one is active. "system" means the OS voice (no plugin synthesizer active).',
|
|
118399
|
+
inputSchema: z$1.object({}),
|
|
118400
|
+
permission: { action: "allow" },
|
|
118401
|
+
handler: () => ({
|
|
118402
|
+
active: session.synthesizers.getActiveName() ?? "system",
|
|
118403
|
+
available: voiceNames()
|
|
118404
|
+
})
|
|
118405
|
+
}),
|
|
118406
|
+
defineTool({
|
|
118407
|
+
name: "set_voice",
|
|
118408
|
+
description: 'Choose which text-to-speech backend read-aloud uses. Pass a registered synthesizer name (see list_voices) to activate it, or "system" to fall back to the OS voice. Use this to switch between an installed TTS plugin (e.g. ElevenLabs) and the built-in voice.',
|
|
118409
|
+
inputSchema: z$1.object({
|
|
118410
|
+
synthesizer: z$1.string().min(1).describe('Synthesizer name to activate, or "system" for the OS voice.')
|
|
118411
|
+
}),
|
|
118412
|
+
permission: { action: "allow" },
|
|
118413
|
+
handler: ({ synthesizer }) => {
|
|
118414
|
+
if (synthesizer === "system") {
|
|
118415
|
+
session.synthesizers.clearActive();
|
|
118416
|
+
return { active: "system" };
|
|
118417
|
+
}
|
|
118418
|
+
if (!session.synthesizers.has(synthesizer)) {
|
|
118419
|
+
throw new Error(
|
|
118420
|
+
`No synthesizer named "${synthesizer}". Available: ${voiceNames().join(", ")}.`
|
|
118421
|
+
);
|
|
118422
|
+
}
|
|
118423
|
+
session.synthesizers.setActive(synthesizer);
|
|
118424
|
+
return { active: synthesizer };
|
|
118425
|
+
}
|
|
118426
|
+
})
|
|
118427
|
+
]
|
|
118428
|
+
});
|
|
118429
|
+
})()
|
|
118430
|
+
},
|
|
117870
118431
|
// Provider admin tools (provider_add, provider_list, provider_remove,
|
|
117871
118432
|
// provider_test). Persists OpenAI-compatible vendor registrations to
|
|
117872
118433
|
// ~/.moxxy/providers.json; the plugin's onInit re-registers them on
|
|
@@ -118388,7 +118949,12 @@ async function setupSessionWithConfig(opts) {
|
|
|
118388
118949
|
config,
|
|
118389
118950
|
resolver: opts.resolver,
|
|
118390
118951
|
resumeSessionId: opts.resumeSessionId,
|
|
118391
|
-
logger
|
|
118952
|
+
logger,
|
|
118953
|
+
// Surface vault secrets to tool handlers as `ctx.getSecret(name)`. The
|
|
118954
|
+
// value never enters the model's context or `process.env` — only the
|
|
118955
|
+
// handler that asks receives it. `vault.get` lazily opens the vault and
|
|
118956
|
+
// returns null for unknown names.
|
|
118957
|
+
secretResolver: (name) => vault.get(name)
|
|
118392
118958
|
});
|
|
118393
118959
|
const { plugin: memoryPlugin, store: memory } = buildMemoryPlugin({
|
|
118394
118960
|
embedder: () => session.embedders.tryGetActive()
|
|
@@ -118957,6 +119523,8 @@ var RunnerMethod = {
|
|
|
118957
119523
|
CommandRun: "command.run",
|
|
118958
119524
|
/** client->server: transcribe audio using the runner's active transcriber. */
|
|
118959
119525
|
Transcribe: "transcribe",
|
|
119526
|
+
/** client->server: synthesize text to audio using the runner's active synthesizer. */
|
|
119527
|
+
Synthesize: "synthesize",
|
|
118960
119528
|
/** client->server: list every MCP server the runner knows about. */
|
|
118961
119529
|
McpListServers: "mcp.listServers",
|
|
118962
119530
|
/** client->server: enable an MCP server + attach its tools. */
|
|
@@ -119025,6 +119593,12 @@ var transcribeParamsSchema = z.object({
|
|
|
119025
119593
|
language: z.string().optional(),
|
|
119026
119594
|
prompt: z.string().optional()
|
|
119027
119595
|
});
|
|
119596
|
+
var synthesizeParamsSchema = z.object({
|
|
119597
|
+
text: z.string(),
|
|
119598
|
+
voice: z.string().optional(),
|
|
119599
|
+
language: z.string().optional(),
|
|
119600
|
+
rate: z.number().optional()
|
|
119601
|
+
});
|
|
119028
119602
|
var mcpEnableAndAttachParamsSchema = z.object({ name: z.string() });
|
|
119029
119603
|
var mcpDetachParamsSchema = z.object({ name: z.string() });
|
|
119030
119604
|
var workflowSetEnabledParamsSchema = z.object({
|
|
@@ -119097,6 +119671,7 @@ var RunnerServer = class {
|
|
|
119097
119671
|
peer.handle(RunnerMethod.PermissionAddAllow, (raw) => this.handlePermissionAddAllow(raw));
|
|
119098
119672
|
peer.handle(RunnerMethod.CommandRun, (raw) => this.handleCommandRun(raw));
|
|
119099
119673
|
peer.handle(RunnerMethod.Transcribe, (raw) => this.handleTranscribe(raw));
|
|
119674
|
+
peer.handle(RunnerMethod.Synthesize, (raw) => this.handleSynthesize(raw));
|
|
119100
119675
|
peer.handle(RunnerMethod.McpListServers, () => this.handleMcpListServers());
|
|
119101
119676
|
peer.handle(RunnerMethod.McpEnableAndAttach, (raw) => this.handleMcpEnableAndAttach(raw));
|
|
119102
119677
|
peer.handle(RunnerMethod.McpDetach, (raw) => this.handleMcpDetach(raw));
|
|
@@ -119233,6 +119808,22 @@ var RunnerServer = class {
|
|
|
119233
119808
|
}
|
|
119234
119809
|
throw lastErr;
|
|
119235
119810
|
}
|
|
119811
|
+
async handleSynthesize(raw) {
|
|
119812
|
+
const params = synthesizeParamsSchema.parse(raw);
|
|
119813
|
+
const synth = this.session.synthesizers.tryGetActive();
|
|
119814
|
+
if (!synth)
|
|
119815
|
+
throw new Error("no active synthesizer on the runner");
|
|
119816
|
+
const opts = {
|
|
119817
|
+
...params.voice ? { voice: params.voice } : {},
|
|
119818
|
+
...params.language ? { language: params.language } : {},
|
|
119819
|
+
...typeof params.rate === "number" ? { rate: params.rate } : {}
|
|
119820
|
+
};
|
|
119821
|
+
const result = await synth.synthesize(params.text, opts);
|
|
119822
|
+
return {
|
|
119823
|
+
audio: Buffer.from(result.audio).toString("base64"),
|
|
119824
|
+
mimeType: result.mimeType
|
|
119825
|
+
};
|
|
119826
|
+
}
|
|
119236
119827
|
/** Ordered candidate list for a transcribe call.
|
|
119237
119828
|
* - First the active one (if any) — respects an explicit host /
|
|
119238
119829
|
* user choice.
|
|
@@ -119411,6 +120002,7 @@ var RemoteSession = class {
|
|
|
119411
120002
|
skills;
|
|
119412
120003
|
agents;
|
|
119413
120004
|
transcribers;
|
|
120005
|
+
synthesizers;
|
|
119414
120006
|
requirements;
|
|
119415
120007
|
permissions;
|
|
119416
120008
|
mcpAdmin;
|
|
@@ -119470,6 +120062,7 @@ var RemoteSession = class {
|
|
|
119470
120062
|
this.skills = this.makeSkillsView();
|
|
119471
120063
|
this.agents = { list: () => [] };
|
|
119472
120064
|
this.transcribers = this.makeTranscribersView();
|
|
120065
|
+
this.synthesizers = this.makeSynthesizersView();
|
|
119473
120066
|
this.requirements = { check: () => ({ ready: false, issues: [] }) };
|
|
119474
120067
|
this.permissions = this.makePermissionsView();
|
|
119475
120068
|
this.mcpAdmin = this.makeMcpAdminView();
|
|
@@ -119655,6 +120248,37 @@ var RemoteSession = class {
|
|
|
119655
120248
|
}
|
|
119656
120249
|
};
|
|
119657
120250
|
}
|
|
120251
|
+
makeSynthesizersView() {
|
|
120252
|
+
const proxy = () => ({
|
|
120253
|
+
name: this.info?.activeSynthesizer ?? "runner",
|
|
120254
|
+
synthesize: async (text, opts) => {
|
|
120255
|
+
const res = await this.peer.request(RunnerMethod.Synthesize, {
|
|
120256
|
+
text,
|
|
120257
|
+
...opts?.voice ? { voice: opts.voice } : {},
|
|
120258
|
+
...opts?.language ? { language: opts.language } : {},
|
|
120259
|
+
...typeof opts?.rate === "number" ? { rate: opts.rate } : {}
|
|
120260
|
+
});
|
|
120261
|
+
return {
|
|
120262
|
+
audio: new Uint8Array(Buffer.from(res.audio, "base64")),
|
|
120263
|
+
mimeType: res.mimeType
|
|
120264
|
+
};
|
|
120265
|
+
}
|
|
120266
|
+
});
|
|
120267
|
+
return {
|
|
120268
|
+
getActiveName: () => this.info?.activeSynthesizer ?? null,
|
|
120269
|
+
has: (name) => name === this.info?.activeSynthesizer,
|
|
120270
|
+
getActive: () => {
|
|
120271
|
+
if (!this.info?.activeSynthesizer) {
|
|
120272
|
+
throw new Error("no active synthesizer on the runner");
|
|
120273
|
+
}
|
|
120274
|
+
return proxy();
|
|
120275
|
+
},
|
|
120276
|
+
tryGetActive: () => this.info?.activeSynthesizer ? proxy() : null,
|
|
120277
|
+
setActive: () => {
|
|
120278
|
+
throw new Error("switch the active synthesizer on the runner, not the attached client");
|
|
120279
|
+
}
|
|
120280
|
+
};
|
|
120281
|
+
}
|
|
119658
120282
|
makePermissionsView() {
|
|
119659
120283
|
return {
|
|
119660
120284
|
addAllow: async (rule) => {
|
|
@@ -119912,8 +120536,8 @@ async function runSetupWizard(opts) {
|
|
|
119912
120536
|
ge2(`${colors.bold("moxxy")}${version} ${colors.dim("\u2014 first-time setup")}`);
|
|
119913
120537
|
Se2(
|
|
119914
120538
|
[
|
|
119915
|
-
`${colors.bold("1.")} Pick
|
|
119916
|
-
`${colors.bold("2.")} Paste
|
|
120539
|
+
`${colors.bold("1.")} Pick an LLM provider`,
|
|
120540
|
+
`${colors.bold("2.")} Paste your API key (stored encrypted in the vault)`,
|
|
119917
120541
|
`${colors.bold("3.")} Choose a default model, mode, and memory embedder`,
|
|
119918
120542
|
`${colors.bold("4.")} Review and write ${colors.bold("moxxy.config.yaml")} into the project`
|
|
119919
120543
|
].join("\n"),
|
|
@@ -119927,66 +120551,54 @@ async function runSetupWizard(opts) {
|
|
|
119927
120551
|
me2("No selectable providers are registered. Install a provider plugin and try again.");
|
|
119928
120552
|
process.exit(1);
|
|
119929
120553
|
}
|
|
119930
|
-
const
|
|
119931
|
-
message: "Step 1 \u2014 Which provider
|
|
120554
|
+
const providerRaw = await xe2({
|
|
120555
|
+
message: "Step 1 \u2014 Which provider do you want to use?",
|
|
119932
120556
|
options: providerOptions,
|
|
119933
|
-
|
|
119934
|
-
initialValues: [providerOptions[0].value]
|
|
120557
|
+
initialValue: providerOptions[0].value
|
|
119935
120558
|
});
|
|
119936
|
-
const
|
|
120559
|
+
const provider = guard(providerRaw);
|
|
119937
120560
|
const apiKeys = {};
|
|
119938
|
-
|
|
119939
|
-
if (
|
|
119940
|
-
|
|
119941
|
-
|
|
119942
|
-
|
|
119943
|
-
|
|
119944
|
-
process.exit(1);
|
|
119945
|
-
}
|
|
119946
|
-
await collectOAuth(providerId, opts.controller.loginOAuth);
|
|
119947
|
-
} else {
|
|
119948
|
-
apiKeys[providerId] = await collectKey(providerId, opts.controller);
|
|
120561
|
+
if (authKind(opts.authKinds, provider) === "oauth") {
|
|
120562
|
+
if (!opts.controller.loginOAuth) {
|
|
120563
|
+
me2(
|
|
120564
|
+
`Provider ${provider} requires OAuth but the wizard has no loginOAuth handler wired up.`
|
|
120565
|
+
);
|
|
120566
|
+
process.exit(1);
|
|
119949
120567
|
}
|
|
120568
|
+
await collectOAuth(provider, opts.controller.loginOAuth);
|
|
120569
|
+
} else {
|
|
120570
|
+
apiKeys[provider] = await collectKey(provider, opts.controller);
|
|
119950
120571
|
}
|
|
119951
|
-
|
|
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] ?? [];
|
|
120572
|
+
const modelChoices = opts.models[provider] ?? [];
|
|
119961
120573
|
let model = null;
|
|
119962
120574
|
if (modelChoices.length > 0) {
|
|
119963
120575
|
const modelRaw = await xe2({
|
|
119964
|
-
message: `Step
|
|
120576
|
+
message: `Step 3 \u2014 Default model for ${colors.bold(provider)}`,
|
|
119965
120577
|
options: toOptions(modelChoices),
|
|
119966
120578
|
initialValue: modelChoices[0].id
|
|
119967
120579
|
});
|
|
119968
120580
|
model = guard(modelRaw);
|
|
119969
120581
|
}
|
|
119970
120582
|
const modeRaw = await xe2({
|
|
119971
|
-
message: "Step
|
|
120583
|
+
message: "Step 4 \u2014 Mode",
|
|
119972
120584
|
options: toOptions(opts.modes),
|
|
119973
120585
|
initialValue: opts.modes[0]?.id ?? "tool-use"
|
|
119974
120586
|
});
|
|
119975
120587
|
const mode = guard(modeRaw);
|
|
119976
120588
|
const embedderRaw = await xe2({
|
|
119977
|
-
message: "Step
|
|
120589
|
+
message: "Step 5 \u2014 Memory embedder",
|
|
119978
120590
|
options: toOptions(opts.embedders),
|
|
119979
120591
|
initialValue: opts.embedders[0]?.id ?? "tfidf"
|
|
119980
120592
|
});
|
|
119981
120593
|
const embedder = guard(embedderRaw);
|
|
119982
120594
|
const securityRaw = await ue2({
|
|
119983
|
-
message: "Step
|
|
120595
|
+
message: "Step 6 \u2014 Enable plugin-security? " + colors.dim("(per-tool capability isolation; off by default)"),
|
|
119984
120596
|
initialValue: false
|
|
119985
120597
|
});
|
|
119986
120598
|
const securityEnabled = guard(securityRaw);
|
|
119987
120599
|
const selections = {
|
|
119988
|
-
providers:
|
|
119989
|
-
primary,
|
|
120600
|
+
providers: [provider],
|
|
120601
|
+
primary: provider,
|
|
119990
120602
|
model,
|
|
119991
120603
|
mode,
|
|
119992
120604
|
embedder,
|
|
@@ -120003,10 +120615,9 @@ async function runSetupWizard(opts) {
|
|
|
120003
120615
|
if (!confirmed) bail();
|
|
120004
120616
|
const persist = ft2();
|
|
120005
120617
|
persist.start("Writing config and storing keys");
|
|
120006
|
-
|
|
120007
|
-
|
|
120008
|
-
|
|
120009
|
-
if (key) await opts.controller.saveApiKey(providerId, key);
|
|
120618
|
+
if (authKind(opts.authKinds, provider) !== "oauth") {
|
|
120619
|
+
const key = apiKeys[provider];
|
|
120620
|
+
if (key) await opts.controller.saveApiKey(provider, key);
|
|
120010
120621
|
}
|
|
120011
120622
|
const configPath = await opts.controller.writeConfig(yaml);
|
|
120012
120623
|
persist.stop(`Wrote ${colors.bold(configPath)}`);
|