dexto 1.8.4 → 1.8.6
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/cli/commands/span/register.d.ts +6 -0
- package/dist/cli/commands/span/register.d.ts.map +1 -0
- package/dist/cli/commands/span/register.js +25 -0
- package/dist/cli/commands/trace/client.d.ts +98 -0
- package/dist/cli/commands/trace/client.d.ts.map +1 -0
- package/dist/cli/commands/trace/client.js +150 -0
- package/dist/cli/commands/trace/format.d.ts +5 -0
- package/dist/cli/commands/trace/format.d.ts.map +1 -0
- package/dist/cli/commands/trace/format.js +58 -0
- package/dist/cli/commands/trace/index.d.ts +21 -0
- package/dist/cli/commands/trace/index.d.ts.map +1 -0
- package/dist/cli/commands/trace/index.js +49 -0
- package/dist/cli/commands/trace/register.d.ts +6 -0
- package/dist/cli/commands/trace/register.d.ts.map +1 -0
- package/dist/cli/commands/trace/register.js +71 -0
- package/dist/index-main.js +4 -0
- package/dist/webui/assets/{index-DkS3oX-M.js → index-DMSYeYHF.js} +1 -1
- package/dist/webui/index.html +1 -1
- package/package.json +13 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/span/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,WAAW,0BAA0B;IACvC,OAAO,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,0BAA0B,GAAG,IAAI,CAwBjF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { withAnalytics, safeExit, ExitSignal } from '../../../analytics/wrapper.js';
|
|
2
|
+
export function registerSpanCommand({ program }) {
|
|
3
|
+
const span = program.command('span').description('Inspect hosted run spans from Dexto Cloud');
|
|
4
|
+
span.command('list <runId>')
|
|
5
|
+
.description('List spans for a hosted run')
|
|
6
|
+
.option('--json', 'Print the raw span list response as JSON')
|
|
7
|
+
.option('--limit <count>', 'Maximum number of spans to return')
|
|
8
|
+
.option('--name <spanName>', 'Filter to an exact span name')
|
|
9
|
+
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
10
|
+
.option('--sort <sort>', 'Sort by started_at or duration')
|
|
11
|
+
.option('--status <status>', 'Filter to a span status')
|
|
12
|
+
.action(withAnalytics('span:list', async (runId, options) => {
|
|
13
|
+
try {
|
|
14
|
+
const { handleSpanListCommand } = await import('../trace/index.js');
|
|
15
|
+
await handleSpanListCommand(runId, options);
|
|
16
|
+
safeExit('span:list', 0);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
if (err instanceof ExitSignal)
|
|
20
|
+
throw err;
|
|
21
|
+
console.error(`❌ dexto span list command failed: ${err}`);
|
|
22
|
+
safeExit('span:list', 1, 'error');
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const RunTraceSpanSchema: z.ZodObject<{
|
|
3
|
+
attributes: z.ZodUnknown;
|
|
4
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
5
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
6
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
7
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
parentSpanId: z.ZodNullable<z.ZodString>;
|
|
11
|
+
runAttemptId: z.ZodNullable<z.ZodString>;
|
|
12
|
+
runId: z.ZodString;
|
|
13
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
14
|
+
spanId: z.ZodString;
|
|
15
|
+
startedAt: z.ZodString;
|
|
16
|
+
status: z.ZodEnum<{
|
|
17
|
+
failed: "failed";
|
|
18
|
+
completed: "completed";
|
|
19
|
+
cancelled: "cancelled";
|
|
20
|
+
running: "running";
|
|
21
|
+
}>;
|
|
22
|
+
traceId: z.ZodString;
|
|
23
|
+
}, z.core.$loose>;
|
|
24
|
+
declare const RunTraceSchema: z.ZodObject<{
|
|
25
|
+
events: z.ZodArray<z.ZodObject<{
|
|
26
|
+
attributes: z.ZodUnknown;
|
|
27
|
+
eventId: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
occurredAt: z.ZodString;
|
|
30
|
+
runId: z.ZodString;
|
|
31
|
+
runSpanId: z.ZodString;
|
|
32
|
+
}, z.core.$loose>>;
|
|
33
|
+
spans: z.ZodArray<z.ZodObject<{
|
|
34
|
+
attributes: z.ZodUnknown;
|
|
35
|
+
durationMs: z.ZodNullable<z.ZodNumber>;
|
|
36
|
+
endedAt: z.ZodNullable<z.ZodString>;
|
|
37
|
+
errorCode: z.ZodNullable<z.ZodString>;
|
|
38
|
+
errorMessage: z.ZodNullable<z.ZodString>;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
parentSpanId: z.ZodNullable<z.ZodString>;
|
|
42
|
+
runAttemptId: z.ZodNullable<z.ZodString>;
|
|
43
|
+
runId: z.ZodString;
|
|
44
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
45
|
+
spanId: z.ZodString;
|
|
46
|
+
startedAt: z.ZodString;
|
|
47
|
+
status: z.ZodEnum<{
|
|
48
|
+
failed: "failed";
|
|
49
|
+
completed: "completed";
|
|
50
|
+
cancelled: "cancelled";
|
|
51
|
+
running: "running";
|
|
52
|
+
}>;
|
|
53
|
+
traceId: z.ZodString;
|
|
54
|
+
}, z.core.$loose>>;
|
|
55
|
+
}, z.core.$loose>;
|
|
56
|
+
declare const RunTraceSummarySchema: z.ZodObject<{
|
|
57
|
+
durationMs: z.ZodNumber;
|
|
58
|
+
errorCount: z.ZodNumber;
|
|
59
|
+
eventCount: z.ZodNumber;
|
|
60
|
+
firstSpanStartedAt: z.ZodString;
|
|
61
|
+
lastSpanStartedAt: z.ZodString;
|
|
62
|
+
runId: z.ZodString;
|
|
63
|
+
sessionId: z.ZodString;
|
|
64
|
+
spanCount: z.ZodNumber;
|
|
65
|
+
spanNames: z.ZodArray<z.ZodString>;
|
|
66
|
+
status: z.ZodString;
|
|
67
|
+
}, z.core.$loose>;
|
|
68
|
+
export type RunTrace = z.output<typeof RunTraceSchema>;
|
|
69
|
+
export type RunTraceSpan = z.output<typeof RunTraceSpanSchema>;
|
|
70
|
+
export type RunTraceSummary = z.output<typeof RunTraceSummarySchema>;
|
|
71
|
+
export interface TraceClientOptions {
|
|
72
|
+
platformUrl?: string | undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface RequestOptions {
|
|
75
|
+
signal?: AbortSignal | undefined;
|
|
76
|
+
}
|
|
77
|
+
export interface FetchRunTraceOptions extends RequestOptions {
|
|
78
|
+
}
|
|
79
|
+
export interface ListRunTracesOptions extends RequestOptions {
|
|
80
|
+
limit?: number | undefined;
|
|
81
|
+
period?: string | undefined;
|
|
82
|
+
sessionId?: string | undefined;
|
|
83
|
+
status?: string | undefined;
|
|
84
|
+
}
|
|
85
|
+
export interface ListRunSpansOptions extends RequestOptions {
|
|
86
|
+
limit?: number | undefined;
|
|
87
|
+
name?: string | undefined;
|
|
88
|
+
sort?: 'started_at' | 'duration' | undefined;
|
|
89
|
+
status?: string | undefined;
|
|
90
|
+
}
|
|
91
|
+
export declare function resolveTracePlatformUrl(platformUrl?: string): string;
|
|
92
|
+
export declare function createTraceClient(options?: TraceClientOptions): {
|
|
93
|
+
fetchRunTrace(runId: string, fetchOptions?: FetchRunTraceOptions): Promise<RunTrace>;
|
|
94
|
+
listRunSpans(runId: string, listOptions?: ListRunSpansOptions): Promise<RunTraceSpan[]>;
|
|
95
|
+
listRunTraces(listOptions?: ListRunTracesOptions): Promise<RunTraceSummary[]>;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
98
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/trace/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;iBAkBN,CAAC;AAanB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKF,CAAC;AAQnB,QAAA,MAAM,qBAAqB;;;;;;;;;;;iBAaT,CAAC;AAcnB,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AACvD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAErE,MAAM,WAAW,kBAAkB;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,cAAc;IAC3B,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc;CAAG;AAE/D,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,wBAAgB,uBAAuB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAOpE;AAiDD,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB;yBAsB/C,MAAM,iBACC,oBAAoB,GACnC,OAAO,CAAC,QAAQ,CAAC;wBAUT,MAAM,gBACA,mBAAmB,GACjC,OAAO,CAAC,YAAY,EAAE,CAAC;gCAYO,oBAAoB,GAAQ,OAAO,CAAC,eAAe,EAAE,CAAC;EAY9F"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DEXTO_PLATFORM_URL } from '../../auth/constants.js';
|
|
3
|
+
import { getDextoApiKey } from '../../auth/service.js';
|
|
4
|
+
const TRACE_REQUEST_TIMEOUT_MS = 10_000;
|
|
5
|
+
const RunTraceSpanStatusSchema = z.enum(['running', 'completed', 'failed', 'cancelled']);
|
|
6
|
+
const RunTraceSpanSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
attributes: z.unknown(),
|
|
9
|
+
durationMs: z.number().nullable(),
|
|
10
|
+
endedAt: z.string().nullable(),
|
|
11
|
+
errorCode: z.string().nullable(),
|
|
12
|
+
errorMessage: z.string().nullable(),
|
|
13
|
+
id: z.string(),
|
|
14
|
+
name: z.string(),
|
|
15
|
+
parentSpanId: z.string().nullable(),
|
|
16
|
+
runAttemptId: z.string().nullable(),
|
|
17
|
+
runId: z.string(),
|
|
18
|
+
sessionId: z.string().nullable(),
|
|
19
|
+
spanId: z.string(),
|
|
20
|
+
startedAt: z.string(),
|
|
21
|
+
status: RunTraceSpanStatusSchema,
|
|
22
|
+
traceId: z.string(),
|
|
23
|
+
})
|
|
24
|
+
.passthrough();
|
|
25
|
+
const RunTraceEventSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
attributes: z.unknown(),
|
|
28
|
+
eventId: z.string(),
|
|
29
|
+
name: z.string(),
|
|
30
|
+
occurredAt: z.string(),
|
|
31
|
+
runId: z.string(),
|
|
32
|
+
runSpanId: z.string(),
|
|
33
|
+
})
|
|
34
|
+
.passthrough();
|
|
35
|
+
const RunTraceSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
events: z.array(RunTraceEventSchema),
|
|
38
|
+
spans: z.array(RunTraceSpanSchema),
|
|
39
|
+
})
|
|
40
|
+
.passthrough();
|
|
41
|
+
const RunTraceResponseSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
trace: RunTraceSchema,
|
|
44
|
+
})
|
|
45
|
+
.passthrough();
|
|
46
|
+
const RunTraceSummarySchema = z
|
|
47
|
+
.object({
|
|
48
|
+
durationMs: z.number(),
|
|
49
|
+
errorCount: z.number(),
|
|
50
|
+
eventCount: z.number(),
|
|
51
|
+
firstSpanStartedAt: z.string(),
|
|
52
|
+
lastSpanStartedAt: z.string(),
|
|
53
|
+
runId: z.string(),
|
|
54
|
+
sessionId: z.string(),
|
|
55
|
+
spanCount: z.number(),
|
|
56
|
+
spanNames: z.array(z.string()),
|
|
57
|
+
status: z.string(),
|
|
58
|
+
})
|
|
59
|
+
.passthrough();
|
|
60
|
+
const RunTraceListResponseSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
traces: z.array(RunTraceSummarySchema),
|
|
63
|
+
})
|
|
64
|
+
.passthrough();
|
|
65
|
+
const RunSpansResponseSchema = z
|
|
66
|
+
.object({
|
|
67
|
+
spans: z.array(RunTraceSpanSchema),
|
|
68
|
+
})
|
|
69
|
+
.passthrough();
|
|
70
|
+
export function resolveTracePlatformUrl(platformUrl) {
|
|
71
|
+
const rawUrl = platformUrl?.trim() || DEXTO_PLATFORM_URL;
|
|
72
|
+
if (rawUrl.trim().length === 0) {
|
|
73
|
+
throw new Error('Dexto platform URL is empty.');
|
|
74
|
+
}
|
|
75
|
+
return rawUrl.replace(/\/+$/, '');
|
|
76
|
+
}
|
|
77
|
+
async function resolveTraceApiKey() {
|
|
78
|
+
const apiKey = await getDextoApiKey();
|
|
79
|
+
if (!apiKey?.trim()) {
|
|
80
|
+
throw new Error('Authentication required. Run `dexto login` before using `dexto trace`.');
|
|
81
|
+
}
|
|
82
|
+
return apiKey.trim();
|
|
83
|
+
}
|
|
84
|
+
async function parseJsonResponse(response) {
|
|
85
|
+
const contentType = response.headers.get('content-type') ?? '';
|
|
86
|
+
if (!contentType.toLowerCase().includes('application/json')) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
return response.json().catch(() => null);
|
|
90
|
+
}
|
|
91
|
+
function formatHttpFailure(status, payload) {
|
|
92
|
+
if (payload && typeof payload === 'object' && 'error' in payload) {
|
|
93
|
+
return `${status} ${JSON.stringify(payload)}`;
|
|
94
|
+
}
|
|
95
|
+
return `${status}`;
|
|
96
|
+
}
|
|
97
|
+
function appendOptionalSearchParam(url, key, value) {
|
|
98
|
+
if (value === undefined) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
url.searchParams.set(key, String(value));
|
|
102
|
+
}
|
|
103
|
+
function createRequestSignal(signal) {
|
|
104
|
+
const timeoutSignal = AbortSignal.timeout(TRACE_REQUEST_TIMEOUT_MS);
|
|
105
|
+
if (!signal) {
|
|
106
|
+
return timeoutSignal;
|
|
107
|
+
}
|
|
108
|
+
return AbortSignal.any([signal, timeoutSignal]);
|
|
109
|
+
}
|
|
110
|
+
export function createTraceClient(options = {}) {
|
|
111
|
+
const platformBaseUrl = resolveTracePlatformUrl(options.platformUrl);
|
|
112
|
+
async function fetchJson(path, fetchOptions = {}) {
|
|
113
|
+
const response = await fetch(`${platformBaseUrl}${path}`, {
|
|
114
|
+
method: 'GET',
|
|
115
|
+
headers: {
|
|
116
|
+
Authorization: `Bearer ${await resolveTraceApiKey()}`,
|
|
117
|
+
},
|
|
118
|
+
signal: createRequestSignal(fetchOptions.signal),
|
|
119
|
+
});
|
|
120
|
+
const payload = await parseJsonResponse(response);
|
|
121
|
+
if (!response.ok) {
|
|
122
|
+
throw new Error(`Trace request failed: ${formatHttpFailure(response.status, payload)}`);
|
|
123
|
+
}
|
|
124
|
+
return payload;
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
async fetchRunTrace(runId, fetchOptions = {}) {
|
|
128
|
+
const payload = await fetchJson(`/api/runs/${encodeURIComponent(runId)}/trace`, fetchOptions);
|
|
129
|
+
return RunTraceResponseSchema.parse(payload).trace;
|
|
130
|
+
},
|
|
131
|
+
async listRunSpans(runId, listOptions = {}) {
|
|
132
|
+
const url = new URL(`${platformBaseUrl}/api/runs/${encodeURIComponent(runId)}/spans`);
|
|
133
|
+
appendOptionalSearchParam(url, 'limit', listOptions.limit);
|
|
134
|
+
appendOptionalSearchParam(url, 'name', listOptions.name);
|
|
135
|
+
appendOptionalSearchParam(url, 'sort', listOptions.sort);
|
|
136
|
+
appendOptionalSearchParam(url, 'status', listOptions.status);
|
|
137
|
+
const payload = await fetchJson(`${url.pathname}${url.search}`, listOptions);
|
|
138
|
+
return RunSpansResponseSchema.parse(payload).spans;
|
|
139
|
+
},
|
|
140
|
+
async listRunTraces(listOptions = {}) {
|
|
141
|
+
const url = new URL(`${platformBaseUrl}/api/runs/traces`);
|
|
142
|
+
appendOptionalSearchParam(url, 'limit', listOptions.limit);
|
|
143
|
+
appendOptionalSearchParam(url, 'period', listOptions.period);
|
|
144
|
+
appendOptionalSearchParam(url, 'sessionId', listOptions.sessionId);
|
|
145
|
+
appendOptionalSearchParam(url, 'status', listOptions.status);
|
|
146
|
+
const payload = await fetchJson(`${url.pathname}${url.search}`, listOptions);
|
|
147
|
+
return RunTraceListResponseSchema.parse(payload).traces;
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RunTrace, RunTraceSpan, RunTraceSummary } from './client.js';
|
|
2
|
+
export declare function formatTraceSummary(runId: string, trace: RunTrace): string;
|
|
3
|
+
export declare function formatTraceList(traces: RunTraceSummary[]): string;
|
|
4
|
+
export declare function formatSpanList(runId: string, spans: RunTraceSpan[]): string;
|
|
5
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/trace/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAc3E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAsBzE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CAkBjE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CAoB3E"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function formatDuration(span) {
|
|
2
|
+
return span.durationMs === null ? 'running' : `${span.durationMs}ms`;
|
|
3
|
+
}
|
|
4
|
+
function formatDurationMs(durationMs) {
|
|
5
|
+
return durationMs === null ? 'running' : `${durationMs}ms`;
|
|
6
|
+
}
|
|
7
|
+
function sortSpans(spans) {
|
|
8
|
+
return [...spans].sort((left, right) => left.startedAt.localeCompare(right.startedAt));
|
|
9
|
+
}
|
|
10
|
+
export function formatTraceSummary(runId, trace) {
|
|
11
|
+
const lines = [
|
|
12
|
+
`Run trace ${runId}`,
|
|
13
|
+
`Spans: ${trace.spans.length} Events: ${trace.events.length}`,
|
|
14
|
+
];
|
|
15
|
+
if (trace.spans.length === 0) {
|
|
16
|
+
lines.push('No spans found.');
|
|
17
|
+
return lines.join('\n');
|
|
18
|
+
}
|
|
19
|
+
lines.push('');
|
|
20
|
+
for (const span of sortSpans(trace.spans)) {
|
|
21
|
+
lines.push(`${span.startedAt} ${span.status.padEnd(9)} ${formatDuration(span).padStart(8)} ${span.name}`);
|
|
22
|
+
if (span.errorMessage) {
|
|
23
|
+
lines.push(` error: ${span.errorMessage}`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return lines.join('\n');
|
|
27
|
+
}
|
|
28
|
+
export function formatTraceList(traces) {
|
|
29
|
+
if (traces.length === 0) {
|
|
30
|
+
return 'No run traces found.';
|
|
31
|
+
}
|
|
32
|
+
const lines = ['Recent run traces', ''];
|
|
33
|
+
for (const trace of traces) {
|
|
34
|
+
const names = trace.spanNames.slice(0, 5).join(', ');
|
|
35
|
+
lines.push(`${trace.lastSpanStartedAt} ${trace.status.padEnd(16)} spans=${String(trace.spanCount).padStart(2)} errors=${trace.errorCount} duration=${formatDurationMs(trace.durationMs).padStart(8)} ${trace.runId}`);
|
|
36
|
+
lines.push(` session: ${trace.sessionId}`);
|
|
37
|
+
if (names.length > 0) {
|
|
38
|
+
lines.push(` spans: ${names}`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return lines.join('\n');
|
|
42
|
+
}
|
|
43
|
+
export function formatSpanList(runId, spans) {
|
|
44
|
+
const lines = [`Spans for run ${runId}`, `Count: ${spans.length}`];
|
|
45
|
+
if (spans.length === 0) {
|
|
46
|
+
lines.push('No spans found.');
|
|
47
|
+
return lines.join('\n');
|
|
48
|
+
}
|
|
49
|
+
lines.push('');
|
|
50
|
+
for (const span of spans) {
|
|
51
|
+
lines.push(`${span.startedAt} ${span.status.padEnd(9)} ${formatDuration(span).padStart(8)} ${span.name}`);
|
|
52
|
+
lines.push(` span: ${span.spanId} trace: ${span.traceId}`);
|
|
53
|
+
if (span.errorMessage) {
|
|
54
|
+
lines.push(` error: ${span.errorMessage}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return lines.join('\n');
|
|
58
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface TraceCommandOptions {
|
|
2
|
+
json?: boolean | undefined;
|
|
3
|
+
platformUrl?: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface TraceListCommandOptions extends TraceCommandOptions {
|
|
6
|
+
limit?: string | number | undefined;
|
|
7
|
+
period?: string | undefined;
|
|
8
|
+
session?: string | undefined;
|
|
9
|
+
status?: string | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface SpanListCommandOptions extends TraceCommandOptions {
|
|
12
|
+
limit?: string | number | undefined;
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
sort?: 'started_at' | 'duration' | undefined;
|
|
15
|
+
status?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
export declare function handleTraceCommand(runId: string, options?: TraceCommandOptions): Promise<void>;
|
|
18
|
+
export declare function handleTraceViewCommand(runId: string, options?: TraceCommandOptions): Promise<void>;
|
|
19
|
+
export declare function handleTraceListCommand(options?: TraceListCommandOptions): Promise<void>;
|
|
20
|
+
export declare function handleSpanListCommand(runId: string, options?: SpanListCommandOptions): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/trace/index.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAChE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IAC/D,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAeD,wBAAsB,kBAAkB,CACpC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,wBAAsB,sBAAsB,CACxC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,mBAAwB,GAClC,OAAO,CAAC,IAAI,CAAC,CAWf;AAED,wBAAsB,sBAAsB,CAAC,OAAO,GAAE,uBAA4B,GAAG,OAAO,CAAC,IAAI,CAAC,CAcjG;AAED,wBAAsB,qBAAqB,CACvC,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,sBAA2B,GACrC,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { createTraceClient } from './client.js';
|
|
2
|
+
import { formatSpanList, formatTraceList, formatTraceSummary } from './format.js';
|
|
3
|
+
function parsePositiveInteger(value, fallback) {
|
|
4
|
+
if (value === undefined) {
|
|
5
|
+
return fallback;
|
|
6
|
+
}
|
|
7
|
+
const parsed = typeof value === 'number' ? value : Number(value);
|
|
8
|
+
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
9
|
+
throw new Error(`Expected a positive integer, received ${String(value)}.`);
|
|
10
|
+
}
|
|
11
|
+
return parsed;
|
|
12
|
+
}
|
|
13
|
+
export async function handleTraceCommand(runId, options = {}) {
|
|
14
|
+
await handleTraceViewCommand(runId, options);
|
|
15
|
+
}
|
|
16
|
+
export async function handleTraceViewCommand(runId, options = {}) {
|
|
17
|
+
const trace = await createTraceClient({ platformUrl: options.platformUrl }).fetchRunTrace(runId);
|
|
18
|
+
if (options.json) {
|
|
19
|
+
console.log(JSON.stringify({ trace }, null, 2));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(formatTraceSummary(runId, trace));
|
|
23
|
+
}
|
|
24
|
+
export async function handleTraceListCommand(options = {}) {
|
|
25
|
+
const traces = await createTraceClient({ platformUrl: options.platformUrl }).listRunTraces({
|
|
26
|
+
limit: parsePositiveInteger(options.limit, 20),
|
|
27
|
+
...(options.period === undefined ? {} : { period: options.period }),
|
|
28
|
+
...(options.session === undefined ? {} : { sessionId: options.session }),
|
|
29
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
30
|
+
});
|
|
31
|
+
if (options.json) {
|
|
32
|
+
console.log(JSON.stringify({ traces }, null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
console.log(formatTraceList(traces));
|
|
36
|
+
}
|
|
37
|
+
export async function handleSpanListCommand(runId, options = {}) {
|
|
38
|
+
const spans = await createTraceClient({ platformUrl: options.platformUrl }).listRunSpans(runId, {
|
|
39
|
+
limit: parsePositiveInteger(options.limit, 100),
|
|
40
|
+
...(options.name === undefined ? {} : { name: options.name }),
|
|
41
|
+
...(options.sort === undefined ? {} : { sort: options.sort }),
|
|
42
|
+
...(options.status === undefined ? {} : { status: options.status }),
|
|
43
|
+
});
|
|
44
|
+
if (options.json) {
|
|
45
|
+
console.log(JSON.stringify({ spans }, null, 2));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
console.log(formatSpanList(runId, spans));
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/trace/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,WAAW,2BAA2B;IACxC,OAAO,EAAE,OAAO,CAAC;CACpB;AAOD,wBAAgB,oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE,2BAA2B,GAAG,IAAI,CAuEnF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { withAnalytics, safeExit, ExitSignal } from '../../../analytics/wrapper.js';
|
|
2
|
+
export function registerTraceCommand({ program }) {
|
|
3
|
+
const trace = program
|
|
4
|
+
.command('trace [runId]')
|
|
5
|
+
.description('Discover and fetch hosted run traces from Dexto Cloud')
|
|
6
|
+
.option('--json', 'Print the raw trace response as JSON')
|
|
7
|
+
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
8
|
+
.action(withAnalytics('trace', async (runId, options) => {
|
|
9
|
+
try {
|
|
10
|
+
if (!runId) {
|
|
11
|
+
trace.help();
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const { handleTraceCommand } = await import('./index.js');
|
|
15
|
+
await handleTraceCommand(runId, options);
|
|
16
|
+
safeExit('trace', 0);
|
|
17
|
+
}
|
|
18
|
+
catch (err) {
|
|
19
|
+
if (err instanceof ExitSignal)
|
|
20
|
+
throw err;
|
|
21
|
+
console.error(`❌ dexto trace command failed: ${err}`);
|
|
22
|
+
safeExit('trace', 1, 'error');
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
trace
|
|
26
|
+
.command('list')
|
|
27
|
+
.description('List recent hosted run traces')
|
|
28
|
+
.option('--json', 'Print the raw trace list response as JSON')
|
|
29
|
+
.option('--limit <count>', 'Maximum number of traces to return')
|
|
30
|
+
.option('--period <period>', 'Filter to a recent period such as 15m, 3h, or 7d')
|
|
31
|
+
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
32
|
+
.option('--session <sessionId>', 'Filter to a session id')
|
|
33
|
+
.option('--status <status>', 'Filter to a run status')
|
|
34
|
+
.action(withAnalytics('trace:list', async (options) => {
|
|
35
|
+
try {
|
|
36
|
+
const { handleTraceListCommand } = await import('./index.js');
|
|
37
|
+
await handleTraceListCommand({
|
|
38
|
+
...trace.opts(),
|
|
39
|
+
...options,
|
|
40
|
+
});
|
|
41
|
+
safeExit('trace:list', 0);
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (err instanceof ExitSignal)
|
|
45
|
+
throw err;
|
|
46
|
+
console.error(`❌ dexto trace list command failed: ${err}`);
|
|
47
|
+
safeExit('trace:list', 1, 'error');
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
trace
|
|
51
|
+
.command('view <runId>')
|
|
52
|
+
.description('Fetch one hosted run trace')
|
|
53
|
+
.option('--json', 'Print the raw trace response as JSON')
|
|
54
|
+
.option('--platform-url <url>', 'Use a custom Dexto platform URL')
|
|
55
|
+
.action(withAnalytics('trace:view', async (runId, options) => {
|
|
56
|
+
try {
|
|
57
|
+
const { handleTraceViewCommand } = await import('./index.js');
|
|
58
|
+
await handleTraceViewCommand(runId, {
|
|
59
|
+
...trace.opts(),
|
|
60
|
+
...options,
|
|
61
|
+
});
|
|
62
|
+
safeExit('trace:view', 0);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
if (err instanceof ExitSignal)
|
|
66
|
+
throw err;
|
|
67
|
+
console.error(`❌ dexto trace view command failed: ${err}`);
|
|
68
|
+
safeExit('trace:view', 1, 'error');
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
}
|
package/dist/index-main.js
CHANGED
|
@@ -60,6 +60,8 @@ import { registerImageCommand } from './cli/commands/image/register.js';
|
|
|
60
60
|
import { registerPluginCommand } from './cli/commands/plugin/register.js';
|
|
61
61
|
import { registerAgentsCommand } from './cli/commands/agents/register.js';
|
|
62
62
|
import { registerDeployCommand } from './cli/commands/deploy/register.js';
|
|
63
|
+
import { registerSpanCommand } from './cli/commands/span/register.js';
|
|
64
|
+
import { registerTraceCommand } from './cli/commands/trace/register.js';
|
|
63
65
|
import { registerInitCommand } from './cli/commands/init.js';
|
|
64
66
|
import { ensureImageImporterConfigured } from './cli/utils/image-importer.js';
|
|
65
67
|
const program = new Command();
|
|
@@ -143,6 +145,8 @@ program
|
|
|
143
145
|
}));
|
|
144
146
|
registerImageCommand({ program });
|
|
145
147
|
registerDeployCommand({ program });
|
|
148
|
+
registerSpanCommand({ program });
|
|
149
|
+
registerTraceCommand({ program });
|
|
146
150
|
registerInitCommand({ program });
|
|
147
151
|
// 4) `init-app` SUB-COMMAND
|
|
148
152
|
program
|
|
@@ -47,7 +47,7 @@ Error generating stack: `+d.message+`
|
|
|
47
47
|
|
|
48
48
|
`)}y.write("payload.value = newResult;"),y.write("return payload;");const j=y.compile();return(E,T)=>j(v,E,T)};let i;const o=If,u=!bA.jitless,p=u&&m$.value,h=t.catchall;let g;e._zod.parse=(v,y)=>{g??(g=r.value);const S=v.value;return o(S)?u&&p&&y?.async===!1&&y.jitless!==!0?(i||(i=s(t.shape)),v=i(v,y),h?LA([],S,v,y,g,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),v)}});function QE(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Dc(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>ko(o,r,So())))}),t)}const zA=_e("$ZodUnion",(e,t)=>{$n.init(e,t),en(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),en(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),en(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),en(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${s.map(i=>kw(i.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(s,i)=>{if(n)return r(s,i);let o=!1;const u=[];for(const f of t.options){const p=f._zod.run({value:s.value,issues:[]},i);if(p instanceof Promise)u.push(p),o=!0;else{if(p.issues.length===0)return p;u.push(p)}}return o?Promise.all(u).then(f=>QE(f,s,e,i)):QE(u,s,e,i)}}),tU=_e("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,zA.init(e,t);const n=e._zod.parse;en(e._zod,"propValues",()=>{const s={};for(const i of t.options){const o=i._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[u,f]of Object.entries(o)){s[u]||(s[u]=new Set);for(const p of f)s[u].add(p)}}return s});const r=ag(()=>{const s=t.options,i=new Map;for(const o of s){const u=o._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const f of u){if(i.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);i.set(f,o)}}return i});e._zod.parse=(s,i)=>{const o=s.value;if(!If(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const u=r.value.get(o?.[t.discriminator]);return u?u._zod.run(s,i):t.unionFallback?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),s)}}),nU=_e("$ZodIntersection",(e,t)=>{$n.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([f,p])=>JE(n,f,p)):JE(n,i,o)}});function n0(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(au(e)&&au(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=n0(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=n0(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function JE(e,t,n){const r=new Map;let s;for(const u of t.issues)if(u.code==="unrecognized_keys"){s??(s=u);for(const f of u.keys)r.has(f)||r.set(f,{}),r.get(f).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const f of u.keys)r.has(f)||r.set(f,{}),r.get(f).r=!0;else e.issues.push(u);const i=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(i.length&&s&&e.issues.push({...s,keys:i}),Dc(e))return e;const o=n0(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const rU=_e("$ZodRecord",(e,t)=>{$n.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!au(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const u=new Set;for(const p of o)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){u.add(typeof p=="number"?p.toString():p);const h=t.valueType._zod.run({value:s[p],issues:[]},r);h instanceof Promise?i.push(h.then(g=>{g.issues.length&&n.issues.push(...Pc(p,g.issues)),n.value[p]=g.value})):(h.issues.length&&n.issues.push(...Pc(p,h.issues)),n.value[p]=h.value)}let f;for(const p in s)u.has(p)||(f=f??[],f.push(p));f&&f.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:f})}else{n.value={};for(const u of Reflect.ownKeys(s)){if(u==="__proto__")continue;let f=t.keyType._zod.run({value:u,issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&AA.test(u)&&f.issues.length){const g=t.keyType._zod.run({value:Number(u),issues:[]},r);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(f=g)}if(f.issues.length){t.mode==="loose"?n.value[u]=s[u]:n.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(g=>ko(g,r,So())),input:u,path:[u],inst:e});continue}const h=t.valueType._zod.run({value:s[u],issues:[]},r);h instanceof Promise?i.push(h.then(g=>{g.issues.length&&n.issues.push(...Pc(u,g.issues)),n.value[f.value]=g.value})):(h.issues.length&&n.issues.push(...Pc(u,h.issues)),n.value[f.value]=h.value)}}return i.length?Promise.all(i).then(()=>n):n}}),sU=_e("$ZodEnum",(e,t)=>{$n.init(e,t);const n=wA(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>g$.has(typeof s)).map(s=>typeof s=="string"?ou(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),iU=_e("$ZodLiteral",(e,t)=>{if($n.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ou(r):r?ou(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),aU=_e("$ZodTransform",(e,t)=>{$n.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new xA(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n));if(s instanceof Promise)throw new Zc;return n.value=s,n}});function ej(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $A=_e("$ZodOptional",(e,t)=>{$n.init(e,t),e._zod.optin="optional",e._zod.optout="optional",en(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),en(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kw(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>ej(i,n.value)):ej(s,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),oU=_e("$ZodExactOptional",(e,t)=>{$A.init(e,t),en(e._zod,"values",()=>t.innerType._zod.values),en(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),lU=_e("$ZodNullable",(e,t)=>{$n.init(e,t),en(e._zod,"optin",()=>t.innerType._zod.optin),en(e._zod,"optout",()=>t.innerType._zod.optout),en(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kw(n.source)}|null)$`):void 0}),en(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),cU=_e("$ZodDefault",(e,t)=>{$n.init(e,t),e._zod.optin="optional",en(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>tj(i,t)):tj(s,t)}});function tj(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const uU=_e("$ZodPrefault",(e,t)=>{$n.init(e,t),e._zod.optin="optional",en(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),dU=_e("$ZodNonOptional",(e,t)=>{$n.init(e,t),en(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>nj(i,e)):nj(s,e)}});function nj(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const fU=_e("$ZodCatch",(e,t)=>{$n.init(e,t),en(e._zod,"optin",()=>t.innerType._zod.optin),en(e._zod,"optout",()=>t.innerType._zod.optout),en(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>ko(o,r,So()))},input:n.value}),n.issues=[]),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>ko(i,r,So()))},input:n.value}),n.issues=[]),n)}}),pU=_e("$ZodPipe",(e,t)=>{$n.init(e,t),en(e._zod,"values",()=>t.in._zod.values),en(e._zod,"optin",()=>t.in._zod.optin),en(e._zod,"optout",()=>t.out._zod.optout),en(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>Eh(o,t.in,r)):Eh(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>Eh(i,t.out,r)):Eh(s,t.out,r)}});function Eh(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const hU=_e("$ZodReadonly",(e,t)=>{$n.init(e,t),en(e._zod,"propValues",()=>t.innerType._zod.propValues),en(e._zod,"values",()=>t.innerType._zod.values),en(e._zod,"optin",()=>t.innerType?._zod?.optin),en(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(rj):rj(s)}});function rj(e){return e.value=Object.freeze(e.value),e}const mU=_e("$ZodCustom",(e,t)=>{vs.init(e,t),$n.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>sj(i,n,r,e));sj(s,n,r,e)}});function sj(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(Df(s))}}var ij;class gU{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function vU(){return new gU}(ij=globalThis).__zod_globalRegistry??(ij.__zod_globalRegistry=vU());const af=globalThis.__zod_globalRegistry;function yU(e,t){return new e({type:"string",...pt(t)})}function xU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...pt(t)})}function aj(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...pt(t)})}function bU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...pt(t)})}function wU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...pt(t)})}function _U(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...pt(t)})}function SU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...pt(t)})}function kU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...pt(t)})}function NU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...pt(t)})}function EU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...pt(t)})}function jU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...pt(t)})}function TU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...pt(t)})}function CU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...pt(t)})}function AU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...pt(t)})}function MU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...pt(t)})}function RU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...pt(t)})}function OU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...pt(t)})}function IU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...pt(t)})}function DU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...pt(t)})}function PU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...pt(t)})}function LU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...pt(t)})}function zU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...pt(t)})}function $U(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...pt(t)})}function FU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...pt(t)})}function UU(e,t){return new e({type:"string",format:"date",check:"string_format",...pt(t)})}function BU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...pt(t)})}function qU(e,t){return new e({type:"string",format:"duration",check:"string_format",...pt(t)})}function HU(e,t){return new e({type:"number",coerce:!0,checks:[],...pt(t)})}function VU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...pt(t)})}function KU(e,t){return new e({type:"boolean",...pt(t)})}function GU(e){return new e({type:"unknown"})}function ZU(e,t){return new e({type:"never",...pt(t)})}function oj(e,t){return new RA({check:"less_than",...pt(t),value:e,inclusive:!1})}function xx(e,t){return new RA({check:"less_than",...pt(t),value:e,inclusive:!0})}function lj(e,t){return new OA({check:"greater_than",...pt(t),value:e,inclusive:!1})}function bx(e,t){return new OA({check:"greater_than",...pt(t),value:e,inclusive:!0})}function cj(e,t){return new cF({check:"multiple_of",...pt(t),value:e})}function FA(e,t){return new dF({check:"max_length",...pt(t),maximum:e})}function Mm(e,t){return new fF({check:"min_length",...pt(t),minimum:e})}function UA(e,t){return new pF({check:"length_equals",...pt(t),length:e})}function YU(e,t){return new hF({check:"string_format",format:"regex",...pt(t),pattern:e})}function WU(e){return new mF({check:"string_format",format:"lowercase",...pt(e)})}function XU(e){return new gF({check:"string_format",format:"uppercase",...pt(e)})}function QU(e,t){return new vF({check:"string_format",format:"includes",...pt(t),includes:e})}function JU(e,t){return new yF({check:"string_format",format:"starts_with",...pt(t),prefix:e})}function e6(e,t){return new xF({check:"string_format",format:"ends_with",...pt(t),suffix:e})}function wu(e){return new bF({check:"overwrite",tx:e})}function t6(e){return wu(t=>t.normalize(e))}function n6(){return wu(e=>e.trim())}function r6(){return wu(e=>e.toLowerCase())}function s6(){return wu(e=>e.toUpperCase())}function i6(){return wu(e=>h$(e))}function a6(e,t,n){return new e({type:"array",element:t,...pt(n)})}function o6(e,t,n){return new e({type:"custom",check:"custom",fn:t,...pt(n)})}function l6(e){const t=c6(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Df(r,n.value,t._zod.def));else{const s=r;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),n.issues.push(Df(s))}},e(n.value,n)));return t}function c6(e,t){const n=new vs({check:"custom",...pt(t)});return n._zod.check=e,n}function BA(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??af,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function lr(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const u=e._zod.toJSONSchema?.();if(u)o.schema=u;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const v=o.schema,y=t.processors[s.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);y(e,t,v,h)}const g=e._zod.parent;g&&(o.ref||(o.ref=g),lr(g,t,h),t.seen.get(g).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(o.schema,f),t.io==="input"&&Yr(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function qA(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const u=e.metadataRegistry.get(o[0])?.id;if(u){const f=r.get(u);if(f&&f!==o[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,o[0])}}const s=o=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=e.external.registry.get(o[0])?.id,v=e.external.uri??(S=>S);if(g)return{ref:v(g)};const y=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=y,{defId:y,ref:`${v("__shared")}#/${u}/${y}`}}if(o[1]===n)return{ref:"#"};const p=`#/${u}/`,h=o[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:p+h}},i=o=>{if(o[1].schema.$ref)return;const u=o[1],{ref:f,defId:p}=s(o);u.def={...u.schema},p&&(u.defId=p);const h=u.schema;for(const g in h)delete h[g];h.$ref=f};if(e.cycles==="throw")for(const o of e.seen.entries()){const u=o[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
49
49
|
|
|
50
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const u=o[1];if(t===o[0]){i(o);continue}if(e.external){const p=e.external.registry.get(o[0])?.id;if(t!==o[0]&&p){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(u.cycle){i(o);continue}if(u.count>1&&e.reused==="ref"){i(o);continue}}}function HA(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const u=e.seen.get(o);if(u.ref===null)return;const f=u.def??u.schema,p={...f},h=u.ref;if(u.ref=null,h){r(h);const v=e.seen.get(h),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,p),o._zod.parent===h)for(const w in f)w==="$ref"||w==="allOf"||w in p||delete f[w];if(y.$ref&&v.def)for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}const g=o._zod.parent;if(g&&g!==h){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:o,jsonSchema:f,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rm(t,"input",e.processors),output:Rm(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Yr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Yr(r.element,n);if(r.type==="set")return Yr(r.valueType,n);if(r.type==="lazy")return Yr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Yr(r.innerType,n);if(r.type==="intersection")return Yr(r.left,n)||Yr(r.right,n);if(r.type==="record"||r.type==="map")return Yr(r.keyType,n)||Yr(r.valueType,n);if(r.type==="pipe")return Yr(r.in,n)||Yr(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Yr(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Yr(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Yr(s,n))return!0;return!!(r.rest&&Yr(r.rest,n))}return!1}const u6=(e,t={})=>n=>{const r=BA({...n,processors:t});return lr(e,r),qA(r,e),HA(r,e)},Rm=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=BA({...s??{},target:i,io:t,processors:n});return lr(e,o),qA(o,e),HA(o,e)},d6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},f6=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:u,patterns:f,contentEncoding:p}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),u&&(s.format=d6[u]??u,s.format===""&&delete s.format,u==="time"&&delete s.format),p&&(s.contentEncoding=p),f&&f.size>0){const h=[...f];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},p6=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:u,multipleOf:f,exclusiveMaximum:p,exclusiveMinimum:h}=e._zod.bag;typeof u=="string"&&u.includes("int")?s.type="integer":s.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h),typeof i=="number"&&(s.minimum=i,typeof h=="number"&&t.target!=="draft-04"&&(h>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p),typeof o=="number"&&(s.maximum=o,typeof p=="number"&&t.target!=="draft-04"&&(p<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof f=="number"&&(s.multipleOf=f)},h6=(e,t,n,r)=>{n.type="boolean"},m6=(e,t,n,r)=>{n.not={}},g6=(e,t,n,r)=>{},v6=(e,t,n,r)=>{const s=e._zod.def,i=wA(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},y6=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},x6=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},b6=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},w6=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:u}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof u=="number"&&(s.maxItems=u),s.type="array",s.items=lr(i.element,t,{...r,path:[...r.path,"items"]})},_6=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const p in o)s.properties[p]=lr(o[p],t,{...r,path:[...r.path,"properties",p]});const u=new Set(Object.keys(o)),f=new Set([...u].filter(p=>{const h=i.shape[p]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));f.size>0&&(s.required=Array.from(f)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=lr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},S6=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((u,f)=>lr(u,t,{...r,path:[...r.path,i?"oneOf":"anyOf",f]}));i?n.oneOf=o:n.anyOf=o},k6=(e,t,n,r)=>{const s=e._zod.def,i=lr(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=lr(s.right,t,{...r,path:[...r.path,"allOf",1]}),u=p=>"allOf"in p&&Object.keys(p).length===1,f=[...u(i)?i.allOf:[i],...u(o)?o.allOf:[o]];n.allOf=f},N6=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,f=o._zod.bag?.patterns;if(i.mode==="loose"&&f&&f.size>0){const h=lr(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const g of f)s.patternProperties[g.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=lr(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=lr(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const p=o._zod.values;if(p){const h=[...p].filter(g=>typeof g=="string"||typeof g=="number");h.length>0&&(s.required=h)}},E6=(e,t,n,r)=>{const s=e._zod.def,i=lr(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},j6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},T6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},C6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},A6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},M6=(e,t,n,r)=>{const s=e._zod.def,i=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;lr(i,t,r);const o=t.seen.get(e);o.ref=i},R6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},VA=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},O6=_e("ZodISODateTime",(e,t)=>{IF.init(e,t),Un.init(e,t)});function I6(e){return FU(O6,e)}const D6=_e("ZodISODate",(e,t)=>{DF.init(e,t),Un.init(e,t)});function P6(e){return UU(D6,e)}const L6=_e("ZodISOTime",(e,t)=>{PF.init(e,t),Un.init(e,t)});function z6(e){return BU(L6,e)}const $6=_e("ZodISODuration",(e,t)=>{LF.init(e,t),Un.init(e,t)});function F6(e){return qU($6,e)}const U6=(e,t)=>{NA.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>j$(e,n)},flatten:{value:n=>E$(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,t0,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,t0,2)}},isEmpty:{get(){return e.issues.length===0}}})},ri=_e("ZodError",U6,{Parent:Error}),B6=Ew(ri),q6=jw(ri),H6=og(ri),V6=lg(ri),K6=A$(ri),G6=M$(ri),Z6=R$(ri),Y6=O$(ri),W6=I$(ri),X6=D$(ri),Q6=P$(ri),J6=L$(ri),Fn=_e("ZodType",(e,t)=>($n.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rm(e,"input"),output:Rm(e,"output")}}),e.toJSONSchema=u6(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Co(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Ao(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>B6(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>H6(e,n,r),e.parseAsync=async(n,r)=>q6(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>V6(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>K6(e,n,r),e.decode=(n,r)=>G6(e,n,r),e.encodeAsync=async(n,r)=>Z6(e,n,r),e.decodeAsync=async(n,r)=>Y6(e,n,r),e.safeEncode=(n,r)=>W6(e,n,r),e.safeDecode=(n,r)=>X6(e,n,r),e.safeEncodeAsync=async(n,r)=>Q6(e,n,r),e.safeDecodeAsync=async(n,r)=>J6(e,n,r),e.refine=(n,r)=>e.check(Z8(n,r)),e.superRefine=n=>e.check(Y8(n)),e.overwrite=n=>e.check(wu(n)),e.optional=()=>pj(e),e.exactOptional=()=>D8(e),e.nullable=()=>hj(e),e.nullish=()=>pj(hj(e)),e.nonoptional=n=>U8(e,n),e.array=()=>ZA(e),e.or=n=>N8([e,n]),e.and=n=>C8(e,n),e.transform=n=>mj(e,O8(n)),e.default=n=>z8(e,n),e.prefault=n=>F8(e,n),e.catch=n=>q8(e,n),e.pipe=n=>mj(e,n),e.readonly=()=>K8(e),e.describe=n=>{const r=e.clone();return af.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return af.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return af.get(e);const r=e.clone();return af.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),KA=_e("_ZodString",(e,t)=>{Tw.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>f6(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(YU(...r)),e.includes=(...r)=>e.check(QU(...r)),e.startsWith=(...r)=>e.check(JU(...r)),e.endsWith=(...r)=>e.check(e6(...r)),e.min=(...r)=>e.check(Mm(...r)),e.max=(...r)=>e.check(FA(...r)),e.length=(...r)=>e.check(UA(...r)),e.nonempty=(...r)=>e.check(Mm(1,...r)),e.lowercase=r=>e.check(WU(r)),e.uppercase=r=>e.check(XU(r)),e.trim=()=>e.check(n6()),e.normalize=(...r)=>e.check(t6(...r)),e.toLowerCase=()=>e.check(r6()),e.toUpperCase=()=>e.check(s6()),e.slugify=()=>e.check(i6())}),e8=_e("ZodString",(e,t)=>{Tw.init(e,t),KA.init(e,t),e.email=n=>e.check(xU(t8,n)),e.url=n=>e.check(kU(n8,n)),e.jwt=n=>e.check($U(v8,n)),e.emoji=n=>e.check(NU(r8,n)),e.guid=n=>e.check(aj(uj,n)),e.uuid=n=>e.check(bU(jh,n)),e.uuidv4=n=>e.check(wU(jh,n)),e.uuidv6=n=>e.check(_U(jh,n)),e.uuidv7=n=>e.check(SU(jh,n)),e.nanoid=n=>e.check(EU(s8,n)),e.guid=n=>e.check(aj(uj,n)),e.cuid=n=>e.check(jU(i8,n)),e.cuid2=n=>e.check(TU(a8,n)),e.ulid=n=>e.check(CU(o8,n)),e.base64=n=>e.check(PU(h8,n)),e.base64url=n=>e.check(LU(m8,n)),e.xid=n=>e.check(AU(l8,n)),e.ksuid=n=>e.check(MU(c8,n)),e.ipv4=n=>e.check(RU(u8,n)),e.ipv6=n=>e.check(OU(d8,n)),e.cidrv4=n=>e.check(IU(f8,n)),e.cidrv6=n=>e.check(DU(p8,n)),e.e164=n=>e.check(zU(g8,n)),e.datetime=n=>e.check(I6(n)),e.date=n=>e.check(P6(n)),e.time=n=>e.check(z6(n)),e.duration=n=>e.check(F6(n))});function Ll(e){return yU(e8,e)}const Un=_e("ZodStringFormat",(e,t)=>{On.init(e,t),KA.init(e,t)}),t8=_e("ZodEmail",(e,t)=>{NF.init(e,t),Un.init(e,t)}),uj=_e("ZodGUID",(e,t)=>{SF.init(e,t),Un.init(e,t)}),jh=_e("ZodUUID",(e,t)=>{kF.init(e,t),Un.init(e,t)}),n8=_e("ZodURL",(e,t)=>{EF.init(e,t),Un.init(e,t)}),r8=_e("ZodEmoji",(e,t)=>{jF.init(e,t),Un.init(e,t)}),s8=_e("ZodNanoID",(e,t)=>{TF.init(e,t),Un.init(e,t)}),i8=_e("ZodCUID",(e,t)=>{CF.init(e,t),Un.init(e,t)}),a8=_e("ZodCUID2",(e,t)=>{AF.init(e,t),Un.init(e,t)}),o8=_e("ZodULID",(e,t)=>{MF.init(e,t),Un.init(e,t)}),l8=_e("ZodXID",(e,t)=>{RF.init(e,t),Un.init(e,t)}),c8=_e("ZodKSUID",(e,t)=>{OF.init(e,t),Un.init(e,t)}),u8=_e("ZodIPv4",(e,t)=>{zF.init(e,t),Un.init(e,t)}),d8=_e("ZodIPv6",(e,t)=>{$F.init(e,t),Un.init(e,t)}),f8=_e("ZodCIDRv4",(e,t)=>{FF.init(e,t),Un.init(e,t)}),p8=_e("ZodCIDRv6",(e,t)=>{UF.init(e,t),Un.init(e,t)}),h8=_e("ZodBase64",(e,t)=>{BF.init(e,t),Un.init(e,t)}),m8=_e("ZodBase64URL",(e,t)=>{HF.init(e,t),Un.init(e,t)}),g8=_e("ZodE164",(e,t)=>{VF.init(e,t),Un.init(e,t)}),v8=_e("ZodJWT",(e,t)=>{GF.init(e,t),Un.init(e,t)}),GA=_e("ZodNumber",(e,t)=>{DA.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>p6(e,r,s),e.gt=(r,s)=>e.check(lj(r,s)),e.gte=(r,s)=>e.check(bx(r,s)),e.min=(r,s)=>e.check(bx(r,s)),e.lt=(r,s)=>e.check(oj(r,s)),e.lte=(r,s)=>e.check(xx(r,s)),e.max=(r,s)=>e.check(xx(r,s)),e.int=r=>e.check(dj(r)),e.safe=r=>e.check(dj(r)),e.positive=r=>e.check(lj(0,r)),e.nonnegative=r=>e.check(bx(0,r)),e.negative=r=>e.check(oj(0,r)),e.nonpositive=r=>e.check(xx(0,r)),e.multipleOf=(r,s)=>e.check(cj(r,s)),e.step=(r,s)=>e.check(cj(r,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),y8=_e("ZodNumberFormat",(e,t)=>{ZF.init(e,t),GA.init(e,t)});function dj(e){return VU(y8,e)}const x8=_e("ZodBoolean",(e,t)=>{YF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>h6(e,n,r)});function Cw(e){return KU(x8,e)}const b8=_e("ZodUnknown",(e,t)=>{WF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>g6()});function fj(){return GU(b8)}const w8=_e("ZodNever",(e,t)=>{XF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>m6(e,n,r)});function _8(e){return ZU(w8,e)}const S8=_e("ZodArray",(e,t)=>{QF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>w6(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(Mm(n,r)),e.nonempty=n=>e.check(Mm(1,n)),e.max=(n,r)=>e.check(FA(n,r)),e.length=(n,r)=>e.check(UA(n,r)),e.unwrap=()=>e.element});function ZA(e,t){return a6(S8,e,t)}const k8=_e("ZodObject",(e,t)=>{eU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_6(e,n,r,s),en(e,"shape",()=>t.shape),e.keyof=()=>dg(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fj()}),e.loose=()=>e.clone({...e._zod.def,catchall:fj()}),e.strict=()=>e.clone({...e._zod.def,catchall:_8()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>w$(e,n),e.safeExtend=n=>_$(e,n),e.merge=n=>S$(e,n),e.pick=n=>x$(e,n),e.omit=n=>b$(e,n),e.partial=(...n)=>k$(WA,e,n[0]),e.required=(...n)=>N$(XA,e,n[0])});function Aw(e,t){const n={type:"object",shape:e??{},...pt(t)};return new k8(n)}const YA=_e("ZodUnion",(e,t)=>{zA.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>S6(e,n,r,s),e.options=t.options});function N8(e,t){return new YA({type:"union",options:e,...pt(t)})}const E8=_e("ZodDiscriminatedUnion",(e,t)=>{YA.init(e,t),tU.init(e,t)});function j8(e,t,n){return new E8({type:"union",options:t,discriminator:e,...pt(n)})}const T8=_e("ZodIntersection",(e,t)=>{nU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>k6(e,n,r,s)});function C8(e,t){return new T8({type:"intersection",left:e,right:t})}const A8=_e("ZodRecord",(e,t)=>{rU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>N6(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function ug(e,t,n){return new A8({type:"record",keyType:e,valueType:t,...pt(n)})}const r0=_e("ZodEnum",(e,t)=>{sU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>v6(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new r0({...t,checks:[],...pt(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new r0({...t,checks:[],...pt(s),entries:i})}});function dg(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new r0({type:"enum",entries:n,...pt(t)})}const M8=_e("ZodLiteral",(e,t)=>{iU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>y6(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Mw(e,t){return new M8({type:"literal",values:Array.isArray(e)?e:[e],...pt(t)})}const R8=_e("ZodTransform",(e,t)=>{aU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>b6(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new xA(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Df(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Df(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function O8(e){return new R8({type:"transform",transform:e})}const WA=_e("ZodOptional",(e,t)=>{$A.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>VA(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pj(e){return new WA({type:"optional",innerType:e})}const I8=_e("ZodExactOptional",(e,t)=>{oU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>VA(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function D8(e){return new I8({type:"optional",innerType:e})}const P8=_e("ZodNullable",(e,t)=>{lU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>E6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function hj(e){return new P8({type:"nullable",innerType:e})}const L8=_e("ZodDefault",(e,t)=>{cU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>T6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function z8(e,t){return new L8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():SA(t)}})}const $8=_e("ZodPrefault",(e,t)=>{uU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>C6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function F8(e,t){return new $8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():SA(t)}})}const XA=_e("ZodNonOptional",(e,t)=>{dU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>j6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function U8(e,t){return new XA({type:"nonoptional",innerType:e,...pt(t)})}const B8=_e("ZodCatch",(e,t)=>{fU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>A6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function q8(e,t){return new B8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const H8=_e("ZodPipe",(e,t)=>{pU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>M6(e,n,r,s),e.in=t.in,e.out=t.out});function mj(e,t){return new H8({type:"pipe",in:e,out:t})}const V8=_e("ZodReadonly",(e,t)=>{hU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>R6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function K8(e){return new V8({type:"readonly",innerType:e})}const G8=_e("ZodCustom",(e,t)=>{mU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>x6(e,n)});function Z8(e,t={}){return o6(G8,e,t)}function Y8(e){return l6(e)}const W8={custom:"custom"};function Rw(e){return HU(GA,e)}var QA=(e=>(e.LLM="llm",e.AGENT="agent",e.CONFIG="config",e.CONTEXT="context",e.SESSION="session",e.MCP="mcp",e.TOOLS="tools",e.STORAGE="storage",e.LOGGER="logger",e.SYSTEM_PROMPT="system_prompt",e.RESOURCE="resource",e.PROMPT="prompt",e.MEMORY="memory",e.HOOK="hook",e.TELEMETRY="telemetry",e))(QA||{}),JA=(e=>(e.USER="user",e.PAYMENT_REQUIRED="payment_required",e.FORBIDDEN="forbidden",e.NOT_FOUND="not_found",e.TIMEOUT="timeout",e.CONFLICT="conflict",e.RATE_LIMIT="rate_limit",e.SYSTEM="system",e.THIRD_PARTY="third_party",e.UNKNOWN="unknown",e))(JA||{}),X8={};Ll().transform(e=>e.trim()).refine(e=>e.length>0,{message:"Required"});const eM=new Set(["http:","https:"]);function Q8(e){try{const t=new URL(e);return eM.has(t.protocol)}catch{return!1}}Ll().transform(e=>e.trim()).refine(e=>e===""||Q8(e),{message:"Invalid URL"}).transform(e=>e===""?void 0:e).optional();const Yc=e=>Ll().transform(t=>{if(typeof t!="string")return"";const n=e??X8;return t.replace(/\$([A-Z_][A-Z0-9_]*)|\${([A-Z_][A-Z0-9_]*)}/gi,(s,i,o)=>n[i||o]??"").trim()}),tM=e=>Yc(e).refine(t=>{try{const n=new URL(t);return eM.has(n.protocol)}catch{return!1}},{message:"Invalid URL"});function Om(e){return e?.startsWith("audio/")?"audio":e?.startsWith("video/")?"video":"binary"}function gj(e){return e?.startsWith("image/")?"image":e?.startsWith("audio/")?"audio":e?.startsWith("video/")?"video":"binary"}var Lc=["openai","openai-compatible","anthropic","google","groq","xai","cohere","minimax","glm","openrouter","litellm","glama","vertex","bedrock","local","ollama","dexto-nova"],J8={openai:[{name:"gpt-3.5-turbo",displayName:"GPT-3.5-turbo",maxInputTokens:16385,supportedFileTypes:[],reasoning:!1,supportsTemperature:!0,supportsToolCall:!1,releaseDate:"2023-03-01",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:.5,outputPerM:1.5,cacheReadPerM:0,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4",displayName:"GPT-4",maxInputTokens:8192,supportedFileTypes:[],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2023-11-06",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:30,outputPerM:60,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4-turbo",displayName:"GPT-4 Turbo",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2023-11-06",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:10,outputPerM:30,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4.1",displayName:"GPT-4.1",maxInputTokens:1047576,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2,outputPerM:8,cacheReadPerM:.5,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4.1-mini",displayName:"GPT-4.1 mini",maxInputTokens:1047576,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:.4,outputPerM:1.6,cacheReadPerM:.1,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4.1-nano",displayName:"GPT-4.1 nano",maxInputTokens:1047576,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2025-04-14",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.1,outputPerM:.4,cacheReadPerM:.025,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o",displayName:"GPT-4o",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-05-13",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-2024-05-13",displayName:"GPT-4o (2024-05-13)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-05-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:5,outputPerM:15,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-2024-08-06",displayName:"GPT-4o (2024-08-06)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-08-06",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-2024-11-20",displayName:"GPT-4o (2024-11-20)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-11-20",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-mini",displayName:"GPT-4o mini",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-07-18",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:.15,outputPerM:.6,cacheReadPerM:.075,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5",displayName:"GPT-5",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-chat-latest",displayName:"GPT-5 Chat (latest)",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!0,supportsToolCall:!1,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-codex",displayName:"GPT-5-Codex",maxInputTokens:272e3,supportedFileTypes:["image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-09-15",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-mini",displayName:"GPT-5 Mini",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.25,outputPerM:2,cacheReadPerM:.025,currency:"USD",unit:"per_million_tokens"},default:!0},{name:"gpt-5-nano",displayName:"GPT-5 Nano",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.05,outputPerM:.4,cacheReadPerM:.005,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-pro",displayName:"GPT-5 Pro",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-10-06",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:15,outputPerM:120,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1",displayName:"GPT-5.1",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-chat-latest",displayName:"GPT-5.1 Chat",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-codex",displayName:"GPT-5.1 Codex",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-codex-max",displayName:"GPT-5.1 Codex Max",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-codex-mini",displayName:"GPT-5.1 Codex mini",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.25,outputPerM:2,cacheReadPerM:.025,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2",displayName:"GPT-5.2",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2-chat-latest",displayName:"GPT-5.2 Chat",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2-codex",displayName:"GPT-5.2 Codex",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:21,outputPerM:168,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.3-chat-latest",displayName:"GPT-5.3 Chat (latest)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2026-03-03",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.3-codex",displayName:"GPT-5.3 Codex",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.3-codex-spark",displayName:"GPT-5.3 Codex Spark",maxInputTokens:1e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4",displayName:"GPT-5.4",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:15,cacheReadPerM:.25,contextOver200kPerM:{inputPerM:5,outputPerM:22.5},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4-mini",displayName:"GPT-5.4 mini",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-17",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.75,outputPerM:4.5,cacheReadPerM:.075,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4-nano",displayName:"GPT-5.4 nano",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-17",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.2,outputPerM:1.25,cacheReadPerM:.02,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4-pro",displayName:"GPT-5.4 Pro",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-05",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:30,outputPerM:180,contextOver200kPerM:{inputPerM:60,outputPerM:270},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.5",displayName:"GPT-5.5",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:5,outputPerM:30,cacheReadPerM:.5,contextOver200kPerM:{inputPerM:10,outputPerM:45},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.5-pro",displayName:"GPT-5.5 Pro",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:30,outputPerM:180,contextOver200kPerM:{inputPerM:60,outputPerM:270},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-image-1",displayName:"gpt-image-1",maxInputTokens:0,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2025-04-24",modalities:{input:["text","image"],output:["image"]}},{name:"gpt-image-1-mini",displayName:"gpt-image-1-mini",maxInputTokens:0,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2025-09-26",modalities:{input:["text","image"],output:["text","image"]}},{name:"gpt-image-1.5",displayName:"gpt-image-1.5",maxInputTokens:0,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2025-11-25",modalities:{input:["text","image"],output:["text","image"]}},{name:"o1",displayName:"o1",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-12-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:15,outputPerM:60,cacheReadPerM:7.5,currency:"USD",unit:"per_million_tokens"}},{name:"o1-mini",displayName:"o1-mini",maxInputTokens:128e3,supportedFileTypes:[],reasoning:!0,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2024-09-12",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:1.1,outputPerM:4.4,cacheReadPerM:.55,currency:"USD",unit:"per_million_tokens"}},{name:"o1-preview",displayName:"o1-preview",maxInputTokens:128e3,supportedFileTypes:[],reasoning:!0,supportsTemperature:!0,supportsToolCall:!1,releaseDate:"2024-09-12",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:15,outputPerM:60,cacheReadPerM:7.5,currency:"USD",unit:"per_million_tokens"}},{name:"o1-pro",displayName:"o1-pro",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-03-19",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:150,outputPerM:600,currency:"USD",unit:"per_million_tokens"}},{name:"o3",displayName:"o3",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-04-16",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2,outputPerM:8,cacheReadPerM:.5,currency:"USD",unit:"per_million_tokens"}},{name:"o3-deep-research",displayName:"o3-deep-research",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-06-26",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:10,outputPerM:40,cacheReadPerM:2.5,currency:"USD",unit:"per_million_tokens"}},{name:"o3-mini",displayName:"o3-mini",maxInputTokens:2e5,supportedFileTypes:[],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-12-20",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:1.1,outputPerM:4.4,cacheReadPerM:.55,currency:"USD",unit:"per_million_tokens"}},{name:"o3-pro",displayName:"o3-pro",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-06-10",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:20,outputPerM:80,currency:"USD",unit:"per_million_tokens"}},{name:"o4-mini",displayName:"o4-mini",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-04-16",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.1,outputPerM:4.4,cacheReadPerM:.275,currency:"USD",unit:"per_million_tokens"}},{name:"o4-mini-deep-research",displayName:"o4-mini-deep-research",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-06-26",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:2,outputPerM:8,cacheReadPerM:.5,currency:"USD",unit:"per_million_tokens"}}]},eB={openai:[{name:"gpt-4o-audio-preview",displayName:"GPT-4o Audio Preview",maxInputTokens:128e3,supportedFileTypes:["audio"],pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}}]};function tB(e,t){if(!t||t.length===0)return e;const n=[...e],r=new Map;for(let s=0;s<n.length;s++)r.set(n[s].name.toLowerCase(),s);for(const s of t){const i=s.name.toLowerCase(),o=r.get(i);o!=null?n[o]=s:(r.set(i,n.length),n.push(s))}return n}tB(J8.openai,eB.openai);var nM=(e=>(e.SCHEMA_VALIDATION="mcp_schema_validation",e.COMMAND_MISSING="mcp_command_missing",e.DUPLICATE_NAME="mcp_duplicate_name",e.CONNECTION_FAILED="mcp_connection_failed",e.DISCONNECTION_FAILED="mcp_disconnection_failed",e.AUTH_REQUIRED="mcp_auth_required",e.PROTOCOL_ERROR="mcp_protocol_error",e.SERVER_NOT_FOUND="mcp_server_not_found",e.TOOL_NOT_FOUND="mcp_tool_not_found",e.PROMPT_NOT_FOUND="mcp_prompt_not_found",e.RESOURCE_NOT_FOUND="mcp_resource_not_found",e))(nM||{}),rM={};const nB=["stdio","sse","http"],Ow=["strict","lenient"],Iw="lenient",rB=Aw({type:Mw("stdio"),enabled:Cw().default(!0).describe("Whether this server is enabled (disabled servers are not connected)"),command:Yc().superRefine((e,t)=>{e.length===0&&t.addIssue({code:W8.custom,message:"Stdio server requires a non-empty command",params:{code:nM.COMMAND_MISSING,scope:QA.MCP,type:JA.USER}})}),args:ZA(Yc()).default([]).describe("Array of arguments for the command (e.g., ['script.js'])"),env:ug(Ll(),Yc()).default({}).describe("Optional environment variables for the server process"),timeout:Rw().int().positive().default(3e4),connectionMode:dg(Ow).default(Iw)}).strict(),sB=Aw({type:Mw("sse"),enabled:Cw().default(!0).describe("Whether this server is enabled (disabled servers are not connected)"),url:tM(rM).describe("URL for the SSE server endpoint"),headers:ug(Ll(),Yc()).default({}),timeout:Rw().int().positive().default(3e4),connectionMode:dg(Ow).default(Iw)}).strict(),iB=Aw({type:Mw("http"),enabled:Cw().default(!0).describe("Whether this server is enabled (disabled servers are not connected)"),url:tM(rM).describe("URL for the HTTP server"),headers:ug(Ll(),Yc()).default({}),timeout:Rw().int().positive().default(3e4),connectionMode:dg(Ow).default(Iw)}).strict(),aB=j8("type",[rB,sB,iB]).superRefine((e,t)=>{}).brand();ug(Ll(),aB).describe("A dictionary of server configurations, keyed by server name").brand();const gf={APPROVED:"approved",DENIED:"denied",CANCELLED:"cancelled"},oB="modulepreload",lB=function(e){return"/"+e},vj={},cB=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let f=function(p){return Promise.all(p.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=o?.nonce||o?.getAttribute("nonce");s=f(n.map(p=>{if(p=lB(p),p in vj)return;vj[p]=!0;const h=p.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":oB,h||(v.as="script"),v.crossOrigin="",v.href=p,u&&v.setAttribute("nonce",u),document.head.appendChild(v),h)return new Promise((y,S)=>{v.addEventListener("load",y),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return s.then(o=>{for(const u of o||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};function uB(e){const t=[],n=new RegExp("(?:^|(?<=\\s))@(?:(<[^>]+>)|([a-zA-Z0-9_-]+):([a-zA-Z0-9._/-]+)|([a-zA-Z0-9._/-]+))(?![a-zA-Z0-9@.])","g");let r;for(;(r=n.exec(e))!==null;){const[s,i,o,u,f]=r;i?t.push({originalRef:s,type:"uri",identifier:i.slice(1,-1)}):o&&u?t.push({originalRef:s,type:"server-scoped",serverName:o,identifier:u}):f&&t.push({originalRef:s,type:"name",identifier:f})}return t}function dB(e,t){const n=e.map(r=>({...r}));for(const r of n)switch(r.type){case"uri":{if(t[r.identifier])r.resourceUri=r.identifier;else{const s=fB(t,r.identifier);s&&(r.resourceUri=s)}break}case"server-scoped":{const s=pB(t,r.serverName,r.identifier);s&&(r.resourceUri=s);break}case"name":{const s=hB(t,r.identifier);s&&(r.resourceUri=s);break}}return n}function fB(e,t){const n=t.trim().toLowerCase();for(const[r,s]of Object.entries(e)){const i=typeof s.metadata?.originalUri=="string"?s.metadata.originalUri:void 0;if(i&&i.toLowerCase()===n)return r}for(const[r,s]of Object.entries(e)){const i=typeof s.metadata?.originalUri=="string"?s.metadata.originalUri:void 0;if(i&&i.toLowerCase().includes(n))return r}}function pB(e,t,n){const r=n.trim().toLowerCase(),s=Object.entries(e).filter(([,i])=>i.serverName===t);for(const[i,o]of s){if(!o.name)continue;const u=o.name.trim().toLowerCase();if(u===r||u.includes(r))return i}for(const[i,o]of s)if((typeof o.metadata?.originalUri=="string"?o.metadata.originalUri:void 0)?.toLowerCase().includes(r)||i.toLowerCase().includes(r))return i}function hB(e,t){const n=t.trim().toLowerCase();for(const[r,s]of Object.entries(e)){if(!s.name)continue;const i=s.name.trim().toLowerCase();if(i===n||i.includes(n))return r}for(const[r,s]of Object.entries(e))if((typeof s.metadata?.originalUri=="string"?s.metadata.originalUri:void 0)?.toLowerCase().includes(n)||r.toLowerCase().includes(n))return r}function mB(e){return e===gf.APPROVED||e===gf.DENIED||e===gf.CANCELLED}const Dw=ka((e,t)=>({pendingApproval:null,queue:[],addApproval:n=>{e(r=>r.pendingApproval?{queue:[...r.queue,n]}:{pendingApproval:n})},processResponse:n=>{e(r=>{if(r.pendingApproval?.approvalId!==n.approvalId)return r;if(mB(n.status)){const[s,...i]=r.queue;return{pendingApproval:s??null,queue:i}}return r})},clearApproval:()=>{e(n=>{const[r,...s]=n.queue;return{pendingApproval:r??null,queue:s}})},clearAll:()=>{e({pendingApproval:null,queue:[]})},getPendingCount:()=>{const n=t();return(n.pendingApproval?1:0)+n.queue.length},getPendingForSession:n=>{const r=t(),s=[];return r.pendingApproval?.sessionId===n&&s.push(r.pendingApproval),s.push(...r.queue.filter(i=>i.sessionId===n)),s},hasPendingApproval:()=>t().pendingApproval!==null}));function gB(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var i;const o=f=>f===null?null:JSON.parse(f,void 0),u=(i=n.getItem(s))!=null?i:null;return u instanceof Promise?u.then(o):o(u)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const s0=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return s0(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return s0(r)(n)}}}},vB=(e,t)=>(n,r,s)=>{let i={storage:gB(()=>localStorage),partialize:w=>w,version:0,merge:(w,N)=>({...N,...w}),...t},o=!1;const u=new Set,f=new Set;let p=i.storage;if(!p)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...w)},r,s);const h=()=>{const w=i.partialize({...r()});return p.setItem(i.name,{state:w,version:i.version})},g=s.setState;s.setState=(w,N)=>(g(w,N),h());const v=e((...w)=>(n(...w),h()),r,s);s.getInitialState=()=>v;let y;const S=()=>{var w,N;if(!p)return;o=!1,u.forEach(j=>{var E;return j((E=r())!=null?E:v)});const k=((N=i.onRehydrateStorage)==null?void 0:N.call(i,(w=r())!=null?w:v))||void 0;return s0(p.getItem.bind(p))(i.name).then(j=>{if(j)if(typeof j.version=="number"&&j.version!==i.version){if(i.migrate){const E=i.migrate(j.state,j.version);return E instanceof Promise?E.then(T=>[!0,T]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,j.state];return[!1,void 0]}).then(j=>{var E;const[T,M]=j;if(y=i.merge(M,(E=r())!=null?E:v),n(y,!0),T)return h()}).then(()=>{k?.(y,void 0),y=r(),o=!0,f.forEach(j=>j(y))}).catch(j=>{k?.(void 0,j)})};return s.persist={setOptions:w=>{i={...i,...w},w.storage&&(p=w.storage)},clearStorage:()=>{p?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>o,onHydrate:w=>(u.add(w),()=>{u.delete(w)}),onFinishHydration:w=>(f.add(w),()=>{f.delete(w)})},i.skipHydration||S(),y||v},sM=vB,yB={isStreaming:!0},iM=ka()(sM(e=>({...yB,setStreaming:t=>{e({isStreaming:t})}}),{name:"dexto-preferences",version:1})),aM=ka()((e,t)=>({sessions:new Map,getTodos:n=>t().sessions.get(n)?.todos??[],setTodos:(n,r)=>{e(s=>{const i=new Map(s.sessions);return i.set(n,{todos:r}),{sessions:i}})},clearTodos:n=>{e(r=>{const s=new Map(r.sessions);return s.delete(n),{sessions:s}})}})),Pw=new Map;function cs(e,t){Pw.set(e,t)}function Lw(e){const t=Ft.getState();t.getSessionState(e).streamingMessage&&t.finalizeStreamingMessage(e,{})}function vf(e){if(e.startsWith("mcp--")){const t=e.substring(5),n=t.split("--");return n.length>=2?n.slice(1).join("--"):t}return e}function i0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xB(e){return i0(e)&&e.version===1}function bB(e){const t=i0(e.metadata)?e.metadata:{},n=typeof t.toolName=="string"?t.toolName:"unknown",r=typeof t.toolCallId=="string"?t.toolCallId:void 0,s=xB(t.presentationSnapshot)?t.presentationSnapshot:void 0,i=i0(t.args)?t.args:{};return{approvalId:e.approvalId,toolCallId:r,toolName:n,toolArgs:i,presentationSnapshot:s,approvalType:e.type}}function yj(e,t){return t!==void 0?!0:e?(e.inputTokens??0)>0||(e.outputTokens??0)>0||(e.reasoningTokens??0)>0||(e.cacheReadTokens??0)>0||(e.cacheWriteTokens??0)>0||(e.totalTokens??0)>0:!1}function wB(e){const{sessionId:t}=e;Ft.getState().setProcessing(t,!0),ps.getState().setThinking(t)}function _B(e){if(!iM.getState().isStreaming)return;const{sessionId:n,content:r,chunkType:s="text"}=e,i=Ft.getState();if(i.getSessionState(n).streamingMessage)i.appendToStreamingMessage(n,r,s);else{const u={id:ig(),role:"assistant",content:s==="text"?r:"",reasoning:s==="reasoning"?r:void 0,createdAt:Date.now(),sessionId:n};i.setStreamingMessage(n,u)}}function SB(e){const{sessionId:t,content:n,reasoning:r,tokenUsage:s,model:i,provider:o,estimatedCost:u,costBreakdown:f,estimatedInputTokens:p,reasoningVariant:h,reasoningBudgetTokens:g}=e,v=Ft.getState(),y=v.getSessionState(t),S=typeof n=="string"?n:"";if(y.streamingMessage){if(v.finalizeStreamingMessage(t,{content:S,...r&&{reasoning:r},tokenUsage:s,...i&&{model:i},...o&&{provider:o}}),yj(s,u)){let k;const j=s?.inputTokens;if(p!==void 0&&j){const E=p-j;k=Math.round(E/j*100)}UE({sessionId:t,provider:o,model:i,reasoningVariant:h,reasoningBudgetTokens:g,inputTokens:s?.inputTokens,outputTokens:s?.outputTokens,reasoningTokens:s?.reasoningTokens,totalTokens:s?.totalTokens,cacheReadTokens:s?.cacheReadTokens,cacheWriteTokens:s?.cacheWriteTokens,estimatedCostUsd:u,inputCostUsd:f?.inputUsd,outputCostUsd:f?.outputUsd,reasoningCostUsd:f?.reasoningUsd,cacheReadCostUsd:f?.cacheReadUsd,cacheWriteCostUsd:f?.cacheWriteUsd,estimatedInputTokens:p,estimateAccuracyPercent:k})}return}const w=y.messages;let N=null;for(let k=w.length-1;k>=0;k--){const j=w[k];if(j.role==="assistant"){N=j;break}if(j.role==="user")break}if(N?v.updateMessage(t,N.id,{content:S||N.content,...r&&{reasoning:r},tokenUsage:s,...i&&{model:i},...o&&{provider:o}}):S&&v.addMessage(t,{id:ig(),role:"assistant",content:S,...r&&{reasoning:r},tokenUsage:s,...i&&{model:i},...o&&{provider:o},createdAt:Date.now(),sessionId:t}),yj(s,u)){let k;const j=s?.inputTokens;if(p!==void 0&&j){const E=p-j;k=Math.round(E/j*100)}UE({sessionId:t,provider:o,model:i,reasoningVariant:h,reasoningBudgetTokens:g,inputTokens:s?.inputTokens,outputTokens:s?.outputTokens,reasoningTokens:s?.reasoningTokens,totalTokens:s?.totalTokens,cacheReadTokens:s?.cacheReadTokens,cacheWriteTokens:s?.cacheWriteTokens,estimatedCostUsd:u,inputCostUsd:f?.inputUsd,outputCostUsd:f?.outputUsd,reasoningCostUsd:f?.reasoningUsd,cacheReadCostUsd:f?.cacheReadUsd,cacheWriteCostUsd:f?.cacheWriteUsd,estimatedInputTokens:p,estimateAccuracyPercent:k})}}function kB(e){const{sessionId:t,content:n,provider:r,model:s,messageId:i}=e,o=Ft.getState();Lw(t),o.addMessage(t,{id:i,role:"assistant",content:n,provider:r,model:s,createdAt:Date.now(),sessionId:t}),o.setProcessing(t,!1),ps.getState().setIdle()}function NB(e){const{sessionId:t,toolName:n,args:r,callId:s,presentationSnapshot:i}=e,o=Ft.getState();Lw(t);const u=o.getMessages(t),f=u.find(v=>v.role==="tool"&&v.toolCallId===s&&v.toolResult===void 0);if(f){o.updateMessage(t,f.id,{toolArgs:r,...i!==void 0&&{presentationSnapshot:i}}),console.debug("[handlers] Tool call message already exists:",f.id);return}const p=vf(n),h=u.find(v=>v.role!=="tool"||v.toolResult!==void 0||v.requireApproval!==!0||v.approvalStatus!=="pending"?!1:!!(v.toolCallId===s||v.toolName===n||v.toolName&&vf(v.toolName)===p));if(h){o.updateMessage(t,h.id,{toolCallId:s,toolArgs:r,...i!==void 0&&{presentationSnapshot:i}}),console.debug("[handlers] Updated existing approval message with callId:",h.id);return}const g={id:`tool-${s}`,role:"tool",content:null,toolName:n,...i!==void 0&&{presentationSnapshot:i},toolArgs:r,toolCallId:s,createdAt:Date.now(),sessionId:t};o.addMessage(t,g),ps.getState().setExecutingTool(t,n)}function EB(e){const{sessionId:t,callId:n,success:r,sanitized:s,requireApproval:i,approvalStatus:o,presentationSnapshot:u}=e,f=Ft.getState();let p=n?f.getMessageByToolCallId(t,n):void 0;if(!p&&n&&(p=f.getMessages(t).find(g=>g.id===`tool-${n}`||g.id===`approval-${n}`)),!p){const g=f.getMessages(t).filter(v=>v.role==="tool"&&v.toolResult===void 0).sort((v,y)=>y.createdAt-v.createdAt);p=g.find(v=>v.id.startsWith("approval-"))||g[0]}p?f.updateMessage(t,p.id,{toolResult:s,toolResultMeta:s?.meta,toolResultSuccess:r,...u!==void 0&&{presentationSnapshot:u},...i!==void 0&&{requireApproval:i},...o!==void 0&&{approvalStatus:o}}):console.warn("[handlers] Could not find tool message to update for callId:",n)}function jB(e){const{sessionId:t,error:n,context:r,recoverable:s}=e,i=Ft.getState();i.setError(t,{id:ig(),message:n?.message||"Unknown error",timestamp:Date.now(),context:r,recoverable:s,sessionId:t}),i.setProcessing(t,!1),ps.getState().setIdle()}function TB(e){const t=e.sessionId||"",n=Ft.getState();t&&Lw(t),Dw.getState().addApproval(e);const{approvalId:r,toolCallId:s,toolName:i,toolArgs:o,presentationSnapshot:u,approvalType:f}=bB(e),p=vf(i),h=n.getMessages(t),g=s?h.find(v=>v.role==="tool"&&v.toolResult===void 0&&v.requireApproval!==!0&&v.toolCallId===s):h.find(v=>v.role!=="tool"||v.toolResult!==void 0||v.requireApproval===!0?!1:!!(v.toolName===i||v.toolName&&vf(v.toolName)===p));if(g)n.updateMessage(t,g.id,{requireApproval:!0,approvalStatus:"pending",toolResultSuccess:void 0,...u!==void 0&&{presentationSnapshot:u}}),console.debug("[handlers] Updated existing tool message with approval:",g.id);else if(t){const v=s?h.find(y=>y.role==="tool"&&y.requireApproval===!0&&y.approvalStatus==="pending"&&y.toolResult===void 0&&y.toolCallId===s):h.find(y=>y.role==="tool"&&y.requireApproval===!0&&y.approvalStatus==="pending"&&y.toolResult===void 0&&(y.toolName===i||y.toolName&&vf(y.toolName)===p));if(v)console.debug("[handlers] Approval message already exists:",v.id);else{const y={id:`approval-${r}`,role:"tool",content:null,toolName:i,...u!==void 0&&{presentationSnapshot:u},toolArgs:o,toolCallId:s??r,createdAt:Date.now(),sessionId:t,requireApproval:!0,approvalStatus:"pending",...f&&{approvalType:f}};n.addMessage(t,y)}}t&&ps.getState().setAwaitingApproval(t)}function CB(e){const{status:t}=e,n=e.sessionId||"",r=e.approvalId;if(Dw.getState().processResponse(e),n&&r){const i=Ft.getState(),u=i.getMessages(n).find(f=>f.id===`approval-${r}`||f.toolCallId===r&&f.requireApproval);if(u){const f=t==="approved"?"approved":"rejected";i.updateMessage(n,u.id,{approvalStatus:f,...f==="rejected"&&{toolResultSuccess:!1}}),console.debug("[handlers] Updated approval status:",u.id,f)}}t==="approved"?n&&ps.getState().setThinking(n):(ps.getState().setIdle(),n&&Ft.getState().setProcessing(n,!1))}function AB(e){const{sessionId:t}=e;Ft.getState().setProcessing(t,!1),ps.getState().setIdle()}function MB(e){console.debug("[handlers] session:title-updated",e.sessionId,e.title)}function RB(e){const{sessionId:t,content:n}=e,r=Ft.getState(),s=n.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
50
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const u=o[1];if(t===o[0]){i(o);continue}if(e.external){const p=e.external.registry.get(o[0])?.id;if(t!==o[0]&&p){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(u.cycle){i(o);continue}if(u.count>1&&e.reused==="ref"){i(o);continue}}}function HA(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const u=e.seen.get(o);if(u.ref===null)return;const f=u.def??u.schema,p={...f},h=u.ref;if(u.ref=null,h){r(h);const v=e.seen.get(h),y=v.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(y)):Object.assign(f,y),Object.assign(f,p),o._zod.parent===h)for(const w in f)w==="$ref"||w==="allOf"||w in p||delete f[w];if(y.$ref&&v.def)for(const w in f)w==="$ref"||w==="allOf"||w in v.def&&JSON.stringify(f[w])===JSON.stringify(v.def[w])&&delete f[w]}const g=o._zod.parent;if(g&&g!==h){r(g);const v=e.seen.get(g);if(v?.schema.$ref&&(f.$ref=v.schema.$ref,v.def))for(const y in f)y==="$ref"||y==="allOf"||y in v.def&&JSON.stringify(f[y])===JSON.stringify(v.def[y])&&delete f[y]}e.override({zodSchema:o,jsonSchema:f,path:u.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(o)}Object.assign(s,n.def??n.schema);const i=e.external?.defs??{};for(const o of e.seen.entries()){const u=o[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?s.$defs=i:s.definitions=i);try{const o=JSON.parse(JSON.stringify(s));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Rm(t,"input",e.processors),output:Rm(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Yr(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Yr(r.element,n);if(r.type==="set")return Yr(r.valueType,n);if(r.type==="lazy")return Yr(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Yr(r.innerType,n);if(r.type==="intersection")return Yr(r.left,n)||Yr(r.right,n);if(r.type==="record"||r.type==="map")return Yr(r.keyType,n)||Yr(r.valueType,n);if(r.type==="pipe")return Yr(r.in,n)||Yr(r.out,n);if(r.type==="object"){for(const s in r.shape)if(Yr(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(Yr(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(Yr(s,n))return!0;return!!(r.rest&&Yr(r.rest,n))}return!1}const u6=(e,t={})=>n=>{const r=BA({...n,processors:t});return lr(e,r),qA(r,e),HA(r,e)},Rm=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=BA({...s??{},target:i,io:t,processors:n});return lr(e,o),qA(o,e),HA(o,e)},d6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},f6=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:u,patterns:f,contentEncoding:p}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),u&&(s.format=d6[u]??u,s.format===""&&delete s.format,u==="time"&&delete s.format),p&&(s.contentEncoding=p),f&&f.size>0){const h=[...f];h.length===1?s.pattern=h[0].source:h.length>1&&(s.allOf=[...h.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},p6=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:u,multipleOf:f,exclusiveMaximum:p,exclusiveMinimum:h}=e._zod.bag;typeof u=="string"&&u.includes("int")?s.type="integer":s.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.minimum=h,s.exclusiveMinimum=!0):s.exclusiveMinimum=h),typeof i=="number"&&(s.minimum=i,typeof h=="number"&&t.target!=="draft-04"&&(h>=i?delete s.minimum:delete s.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(s.maximum=p,s.exclusiveMaximum=!0):s.exclusiveMaximum=p),typeof o=="number"&&(s.maximum=o,typeof p=="number"&&t.target!=="draft-04"&&(p<=o?delete s.maximum:delete s.exclusiveMaximum)),typeof f=="number"&&(s.multipleOf=f)},h6=(e,t,n,r)=>{n.type="boolean"},m6=(e,t,n,r)=>{n.not={}},g6=(e,t,n,r)=>{},v6=(e,t,n,r)=>{const s=e._zod.def,i=wA(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},y6=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},x6=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},b6=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},w6=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:u}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof u=="number"&&(s.maxItems=u),s.type="array",s.items=lr(i.element,t,{...r,path:[...r.path,"items"]})},_6=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const p in o)s.properties[p]=lr(o[p],t,{...r,path:[...r.path,"properties",p]});const u=new Set(Object.keys(o)),f=new Set([...u].filter(p=>{const h=i.shape[p]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));f.size>0&&(s.required=Array.from(f)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=lr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},S6=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((u,f)=>lr(u,t,{...r,path:[...r.path,i?"oneOf":"anyOf",f]}));i?n.oneOf=o:n.anyOf=o},k6=(e,t,n,r)=>{const s=e._zod.def,i=lr(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=lr(s.right,t,{...r,path:[...r.path,"allOf",1]}),u=p=>"allOf"in p&&Object.keys(p).length===1,f=[...u(i)?i.allOf:[i],...u(o)?o.allOf:[o]];n.allOf=f},N6=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,f=o._zod.bag?.patterns;if(i.mode==="loose"&&f&&f.size>0){const h=lr(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const g of f)s.patternProperties[g.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=lr(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=lr(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const p=o._zod.values;if(p){const h=[...p].filter(g=>typeof g=="string"||typeof g=="number");h.length>0&&(s.required=h)}},E6=(e,t,n,r)=>{const s=e._zod.def,i=lr(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},j6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},T6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},C6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},A6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},M6=(e,t,n,r)=>{const s=e._zod.def,i=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;lr(i,t,r);const o=t.seen.get(e);o.ref=i},R6=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},VA=(e,t,n,r)=>{const s=e._zod.def;lr(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},O6=_e("ZodISODateTime",(e,t)=>{IF.init(e,t),Un.init(e,t)});function I6(e){return FU(O6,e)}const D6=_e("ZodISODate",(e,t)=>{DF.init(e,t),Un.init(e,t)});function P6(e){return UU(D6,e)}const L6=_e("ZodISOTime",(e,t)=>{PF.init(e,t),Un.init(e,t)});function z6(e){return BU(L6,e)}const $6=_e("ZodISODuration",(e,t)=>{LF.init(e,t),Un.init(e,t)});function F6(e){return qU($6,e)}const U6=(e,t)=>{NA.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>j$(e,n)},flatten:{value:n=>E$(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,t0,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,t0,2)}},isEmpty:{get(){return e.issues.length===0}}})},ri=_e("ZodError",U6,{Parent:Error}),B6=Ew(ri),q6=jw(ri),H6=og(ri),V6=lg(ri),K6=A$(ri),G6=M$(ri),Z6=R$(ri),Y6=O$(ri),W6=I$(ri),X6=D$(ri),Q6=P$(ri),J6=L$(ri),Fn=_e("ZodType",(e,t)=>($n.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Rm(e,"input"),output:Rm(e,"output")}}),e.toJSONSchema=u6(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Co(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Ao(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>B6(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>H6(e,n,r),e.parseAsync=async(n,r)=>q6(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>V6(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>K6(e,n,r),e.decode=(n,r)=>G6(e,n,r),e.encodeAsync=async(n,r)=>Z6(e,n,r),e.decodeAsync=async(n,r)=>Y6(e,n,r),e.safeEncode=(n,r)=>W6(e,n,r),e.safeDecode=(n,r)=>X6(e,n,r),e.safeEncodeAsync=async(n,r)=>Q6(e,n,r),e.safeDecodeAsync=async(n,r)=>J6(e,n,r),e.refine=(n,r)=>e.check(Z8(n,r)),e.superRefine=n=>e.check(Y8(n)),e.overwrite=n=>e.check(wu(n)),e.optional=()=>pj(e),e.exactOptional=()=>D8(e),e.nullable=()=>hj(e),e.nullish=()=>pj(hj(e)),e.nonoptional=n=>U8(e,n),e.array=()=>ZA(e),e.or=n=>N8([e,n]),e.and=n=>C8(e,n),e.transform=n=>mj(e,O8(n)),e.default=n=>z8(e,n),e.prefault=n=>F8(e,n),e.catch=n=>q8(e,n),e.pipe=n=>mj(e,n),e.readonly=()=>K8(e),e.describe=n=>{const r=e.clone();return af.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return af.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return af.get(e);const r=e.clone();return af.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),KA=_e("_ZodString",(e,t)=>{Tw.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>f6(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(YU(...r)),e.includes=(...r)=>e.check(QU(...r)),e.startsWith=(...r)=>e.check(JU(...r)),e.endsWith=(...r)=>e.check(e6(...r)),e.min=(...r)=>e.check(Mm(...r)),e.max=(...r)=>e.check(FA(...r)),e.length=(...r)=>e.check(UA(...r)),e.nonempty=(...r)=>e.check(Mm(1,...r)),e.lowercase=r=>e.check(WU(r)),e.uppercase=r=>e.check(XU(r)),e.trim=()=>e.check(n6()),e.normalize=(...r)=>e.check(t6(...r)),e.toLowerCase=()=>e.check(r6()),e.toUpperCase=()=>e.check(s6()),e.slugify=()=>e.check(i6())}),e8=_e("ZodString",(e,t)=>{Tw.init(e,t),KA.init(e,t),e.email=n=>e.check(xU(t8,n)),e.url=n=>e.check(kU(n8,n)),e.jwt=n=>e.check($U(v8,n)),e.emoji=n=>e.check(NU(r8,n)),e.guid=n=>e.check(aj(uj,n)),e.uuid=n=>e.check(bU(jh,n)),e.uuidv4=n=>e.check(wU(jh,n)),e.uuidv6=n=>e.check(_U(jh,n)),e.uuidv7=n=>e.check(SU(jh,n)),e.nanoid=n=>e.check(EU(s8,n)),e.guid=n=>e.check(aj(uj,n)),e.cuid=n=>e.check(jU(i8,n)),e.cuid2=n=>e.check(TU(a8,n)),e.ulid=n=>e.check(CU(o8,n)),e.base64=n=>e.check(PU(h8,n)),e.base64url=n=>e.check(LU(m8,n)),e.xid=n=>e.check(AU(l8,n)),e.ksuid=n=>e.check(MU(c8,n)),e.ipv4=n=>e.check(RU(u8,n)),e.ipv6=n=>e.check(OU(d8,n)),e.cidrv4=n=>e.check(IU(f8,n)),e.cidrv6=n=>e.check(DU(p8,n)),e.e164=n=>e.check(zU(g8,n)),e.datetime=n=>e.check(I6(n)),e.date=n=>e.check(P6(n)),e.time=n=>e.check(z6(n)),e.duration=n=>e.check(F6(n))});function Ll(e){return yU(e8,e)}const Un=_e("ZodStringFormat",(e,t)=>{On.init(e,t),KA.init(e,t)}),t8=_e("ZodEmail",(e,t)=>{NF.init(e,t),Un.init(e,t)}),uj=_e("ZodGUID",(e,t)=>{SF.init(e,t),Un.init(e,t)}),jh=_e("ZodUUID",(e,t)=>{kF.init(e,t),Un.init(e,t)}),n8=_e("ZodURL",(e,t)=>{EF.init(e,t),Un.init(e,t)}),r8=_e("ZodEmoji",(e,t)=>{jF.init(e,t),Un.init(e,t)}),s8=_e("ZodNanoID",(e,t)=>{TF.init(e,t),Un.init(e,t)}),i8=_e("ZodCUID",(e,t)=>{CF.init(e,t),Un.init(e,t)}),a8=_e("ZodCUID2",(e,t)=>{AF.init(e,t),Un.init(e,t)}),o8=_e("ZodULID",(e,t)=>{MF.init(e,t),Un.init(e,t)}),l8=_e("ZodXID",(e,t)=>{RF.init(e,t),Un.init(e,t)}),c8=_e("ZodKSUID",(e,t)=>{OF.init(e,t),Un.init(e,t)}),u8=_e("ZodIPv4",(e,t)=>{zF.init(e,t),Un.init(e,t)}),d8=_e("ZodIPv6",(e,t)=>{$F.init(e,t),Un.init(e,t)}),f8=_e("ZodCIDRv4",(e,t)=>{FF.init(e,t),Un.init(e,t)}),p8=_e("ZodCIDRv6",(e,t)=>{UF.init(e,t),Un.init(e,t)}),h8=_e("ZodBase64",(e,t)=>{BF.init(e,t),Un.init(e,t)}),m8=_e("ZodBase64URL",(e,t)=>{HF.init(e,t),Un.init(e,t)}),g8=_e("ZodE164",(e,t)=>{VF.init(e,t),Un.init(e,t)}),v8=_e("ZodJWT",(e,t)=>{GF.init(e,t),Un.init(e,t)}),GA=_e("ZodNumber",(e,t)=>{DA.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>p6(e,r,s),e.gt=(r,s)=>e.check(lj(r,s)),e.gte=(r,s)=>e.check(bx(r,s)),e.min=(r,s)=>e.check(bx(r,s)),e.lt=(r,s)=>e.check(oj(r,s)),e.lte=(r,s)=>e.check(xx(r,s)),e.max=(r,s)=>e.check(xx(r,s)),e.int=r=>e.check(dj(r)),e.safe=r=>e.check(dj(r)),e.positive=r=>e.check(lj(0,r)),e.nonnegative=r=>e.check(bx(0,r)),e.negative=r=>e.check(oj(0,r)),e.nonpositive=r=>e.check(xx(0,r)),e.multipleOf=(r,s)=>e.check(cj(r,s)),e.step=(r,s)=>e.check(cj(r,s)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}),y8=_e("ZodNumberFormat",(e,t)=>{ZF.init(e,t),GA.init(e,t)});function dj(e){return VU(y8,e)}const x8=_e("ZodBoolean",(e,t)=>{YF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>h6(e,n,r)});function Cw(e){return KU(x8,e)}const b8=_e("ZodUnknown",(e,t)=>{WF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>g6()});function fj(){return GU(b8)}const w8=_e("ZodNever",(e,t)=>{XF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>m6(e,n,r)});function _8(e){return ZU(w8,e)}const S8=_e("ZodArray",(e,t)=>{QF.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>w6(e,n,r,s),e.element=t.element,e.min=(n,r)=>e.check(Mm(n,r)),e.nonempty=n=>e.check(Mm(1,n)),e.max=(n,r)=>e.check(FA(n,r)),e.length=(n,r)=>e.check(UA(n,r)),e.unwrap=()=>e.element});function ZA(e,t){return a6(S8,e,t)}const k8=_e("ZodObject",(e,t)=>{eU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>_6(e,n,r,s),en(e,"shape",()=>t.shape),e.keyof=()=>dg(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:fj()}),e.loose=()=>e.clone({...e._zod.def,catchall:fj()}),e.strict=()=>e.clone({...e._zod.def,catchall:_8()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>w$(e,n),e.safeExtend=n=>_$(e,n),e.merge=n=>S$(e,n),e.pick=n=>x$(e,n),e.omit=n=>b$(e,n),e.partial=(...n)=>k$(WA,e,n[0]),e.required=(...n)=>N$(XA,e,n[0])});function Aw(e,t){const n={type:"object",shape:e??{},...pt(t)};return new k8(n)}const YA=_e("ZodUnion",(e,t)=>{zA.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>S6(e,n,r,s),e.options=t.options});function N8(e,t){return new YA({type:"union",options:e,...pt(t)})}const E8=_e("ZodDiscriminatedUnion",(e,t)=>{YA.init(e,t),tU.init(e,t)});function j8(e,t,n){return new E8({type:"union",options:t,discriminator:e,...pt(n)})}const T8=_e("ZodIntersection",(e,t)=>{nU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>k6(e,n,r,s)});function C8(e,t){return new T8({type:"intersection",left:e,right:t})}const A8=_e("ZodRecord",(e,t)=>{rU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>N6(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function ug(e,t,n){return new A8({type:"record",keyType:e,valueType:t,...pt(n)})}const r0=_e("ZodEnum",(e,t)=>{sU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(r,s,i)=>v6(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new r0({...t,checks:[],...pt(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new r0({...t,checks:[],...pt(s),entries:i})}});function dg(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new r0({type:"enum",entries:n,...pt(t)})}const M8=_e("ZodLiteral",(e,t)=>{iU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>y6(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Mw(e,t){return new M8({type:"literal",values:Array.isArray(e)?e:[e],...pt(t)})}const R8=_e("ZodTransform",(e,t)=>{aU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>b6(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new xA(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Df(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Df(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n)):(n.value=s,n)}});function O8(e){return new R8({type:"transform",transform:e})}const WA=_e("ZodOptional",(e,t)=>{$A.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>VA(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pj(e){return new WA({type:"optional",innerType:e})}const I8=_e("ZodExactOptional",(e,t)=>{oU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>VA(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function D8(e){return new I8({type:"optional",innerType:e})}const P8=_e("ZodNullable",(e,t)=>{lU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>E6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function hj(e){return new P8({type:"nullable",innerType:e})}const L8=_e("ZodDefault",(e,t)=>{cU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>T6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function z8(e,t){return new L8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():SA(t)}})}const $8=_e("ZodPrefault",(e,t)=>{uU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>C6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function F8(e,t){return new $8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():SA(t)}})}const XA=_e("ZodNonOptional",(e,t)=>{dU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>j6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function U8(e,t){return new XA({type:"nonoptional",innerType:e,...pt(t)})}const B8=_e("ZodCatch",(e,t)=>{fU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>A6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function q8(e,t){return new B8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const H8=_e("ZodPipe",(e,t)=>{pU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>M6(e,n,r,s),e.in=t.in,e.out=t.out});function mj(e,t){return new H8({type:"pipe",in:e,out:t})}const V8=_e("ZodReadonly",(e,t)=>{hU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>R6(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function K8(e){return new V8({type:"readonly",innerType:e})}const G8=_e("ZodCustom",(e,t)=>{mU.init(e,t),Fn.init(e,t),e._zod.processJSONSchema=(n,r,s)=>x6(e,n)});function Z8(e,t={}){return o6(G8,e,t)}function Y8(e){return l6(e)}const W8={custom:"custom"};function Rw(e){return HU(GA,e)}var QA=(e=>(e.LLM="llm",e.AGENT="agent",e.CONFIG="config",e.CONTEXT="context",e.SESSION="session",e.MCP="mcp",e.TOOLS="tools",e.STORAGE="storage",e.LOGGER="logger",e.SYSTEM_PROMPT="system_prompt",e.RESOURCE="resource",e.PROMPT="prompt",e.MEMORY="memory",e.HOOK="hook",e.TELEMETRY="telemetry",e))(QA||{}),JA=(e=>(e.USER="user",e.PAYMENT_REQUIRED="payment_required",e.FORBIDDEN="forbidden",e.NOT_FOUND="not_found",e.TIMEOUT="timeout",e.CONFLICT="conflict",e.RATE_LIMIT="rate_limit",e.SYSTEM="system",e.THIRD_PARTY="third_party",e.UNKNOWN="unknown",e))(JA||{}),X8={};Ll().transform(e=>e.trim()).refine(e=>e.length>0,{message:"Required"});const eM=new Set(["http:","https:"]);function Q8(e){try{const t=new URL(e);return eM.has(t.protocol)}catch{return!1}}Ll().transform(e=>e.trim()).refine(e=>e===""||Q8(e),{message:"Invalid URL"}).transform(e=>e===""?void 0:e).optional();const Yc=e=>Ll().transform(t=>{if(typeof t!="string")return"";const n=e??X8;return t.replace(/\$([A-Z_][A-Z0-9_]*)|\${([A-Z_][A-Z0-9_]*)}/gi,(s,i,o)=>n[i||o]??"").trim()}),tM=e=>Yc(e).refine(t=>{try{const n=new URL(t);return eM.has(n.protocol)}catch{return!1}},{message:"Invalid URL"});function Om(e){return e?.startsWith("audio/")?"audio":e?.startsWith("video/")?"video":"binary"}function gj(e){return e?.startsWith("image/")?"image":e?.startsWith("audio/")?"audio":e?.startsWith("video/")?"video":"binary"}var Lc=["openai","openai-compatible","anthropic","google","groq","xai","cohere","minimax","glm","openrouter","litellm","glama","vertex","bedrock","local","ollama","dexto-nova"],J8={openai:[{name:"gpt-3.5-turbo",displayName:"GPT-3.5-turbo",maxInputTokens:16385,supportedFileTypes:[],reasoning:!1,supportsTemperature:!0,supportsToolCall:!1,releaseDate:"2023-03-01",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:.5,outputPerM:1.5,cacheReadPerM:0,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4",displayName:"GPT-4",maxInputTokens:8192,supportedFileTypes:[],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2023-11-06",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:30,outputPerM:60,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4-turbo",displayName:"GPT-4 Turbo",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2023-11-06",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:10,outputPerM:30,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4.1",displayName:"GPT-4.1",maxInputTokens:1047576,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2,outputPerM:8,cacheReadPerM:.5,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4.1-mini",displayName:"GPT-4.1 mini",maxInputTokens:1047576,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2025-04-14",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:.4,outputPerM:1.6,cacheReadPerM:.1,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4.1-nano",displayName:"GPT-4.1 nano",maxInputTokens:1047576,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2025-04-14",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.1,outputPerM:.4,cacheReadPerM:.025,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o",displayName:"GPT-4o",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-05-13",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-2024-05-13",displayName:"GPT-4o (2024-05-13)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-05-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:5,outputPerM:15,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-2024-08-06",displayName:"GPT-4o (2024-08-06)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-08-06",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-2024-11-20",displayName:"GPT-4o (2024-11-20)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-11-20",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-4o-mini",displayName:"GPT-4o mini",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2024-07-18",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:.15,outputPerM:.6,cacheReadPerM:.075,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5",displayName:"GPT-5",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-chat-latest",displayName:"GPT-5 Chat (latest)",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!0,supportsToolCall:!1,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-codex",displayName:"GPT-5-Codex",maxInputTokens:272e3,supportedFileTypes:["image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-09-15",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-mini",displayName:"GPT-5 Mini",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.25,outputPerM:2,cacheReadPerM:.025,currency:"USD",unit:"per_million_tokens"},default:!0},{name:"gpt-5-nano",displayName:"GPT-5 Nano",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-08-07",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.05,outputPerM:.4,cacheReadPerM:.005,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5-pro",displayName:"GPT-5 Pro",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-10-06",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:15,outputPerM:120,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1",displayName:"GPT-5.1",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-chat-latest",displayName:"GPT-5.1 Chat",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-codex",displayName:"GPT-5.1 Codex",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-codex-max",displayName:"GPT-5.1 Codex Max",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.25,outputPerM:10,cacheReadPerM:.125,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.1-codex-mini",displayName:"GPT-5.1 Codex mini",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-11-13",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.25,outputPerM:2,cacheReadPerM:.025,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2",displayName:"GPT-5.2",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2-chat-latest",displayName:"GPT-5.2 Chat",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2-codex",displayName:"GPT-5.2 Codex",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.2-pro",displayName:"GPT-5.2 Pro",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-12-11",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:21,outputPerM:168,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.3-chat-latest",displayName:"GPT-5.3 Chat (latest)",maxInputTokens:128e3,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!0,supportsToolCall:!0,releaseDate:"2026-03-03",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.3-codex",displayName:"GPT-5.3 Codex",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.3-codex-spark",displayName:"GPT-5.3 Codex Spark",maxInputTokens:1e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-02-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:1.75,outputPerM:14,cacheReadPerM:.175,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4",displayName:"GPT-5.4",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2.5,outputPerM:15,cacheReadPerM:.25,contextOver200kPerM:{inputPerM:5,outputPerM:22.5},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4-mini",displayName:"GPT-5.4 mini",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-17",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.75,outputPerM:4.5,cacheReadPerM:.075,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4-nano",displayName:"GPT-5.4 nano",maxInputTokens:272e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-17",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:.2,outputPerM:1.25,cacheReadPerM:.02,currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.4-pro",displayName:"GPT-5.4 Pro",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-03-05",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:30,outputPerM:180,contextOver200kPerM:{inputPerM:60,outputPerM:270},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.5",displayName:"GPT-5.5",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:5,outputPerM:30,cacheReadPerM:.5,contextOver200kPerM:{inputPerM:10,outputPerM:45},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-5.5-pro",displayName:"GPT-5.5 Pro",maxInputTokens:922e3,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2026-04-23",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:30,outputPerM:180,contextOver200kPerM:{inputPerM:60,outputPerM:270},currency:"USD",unit:"per_million_tokens"}},{name:"gpt-image-1",displayName:"gpt-image-1",maxInputTokens:0,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2025-04-24",modalities:{input:["text","image"],output:["image"]}},{name:"gpt-image-1-mini",displayName:"gpt-image-1-mini",maxInputTokens:0,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2025-09-26",modalities:{input:["text","image"],output:["text","image"]}},{name:"gpt-image-1.5",displayName:"gpt-image-1.5",maxInputTokens:0,supportedFileTypes:["pdf","image","document"],reasoning:!1,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2025-11-25",modalities:{input:["text","image"],output:["text","image"]}},{name:"o1",displayName:"o1",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-12-05",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:15,outputPerM:60,cacheReadPerM:7.5,currency:"USD",unit:"per_million_tokens"}},{name:"o1-mini",displayName:"o1-mini",maxInputTokens:128e3,supportedFileTypes:[],reasoning:!0,supportsTemperature:!1,supportsToolCall:!1,releaseDate:"2024-09-12",status:"deprecated",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:1.1,outputPerM:4.4,cacheReadPerM:.55,currency:"USD",unit:"per_million_tokens"}},{name:"o1-preview",displayName:"o1-preview",maxInputTokens:128e3,supportedFileTypes:[],reasoning:!0,supportsTemperature:!0,supportsToolCall:!1,releaseDate:"2024-09-12",status:"deprecated",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:15,outputPerM:60,cacheReadPerM:7.5,currency:"USD",unit:"per_million_tokens"}},{name:"o1-pro",displayName:"o1-pro",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-03-19",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:150,outputPerM:600,currency:"USD",unit:"per_million_tokens"}},{name:"o3",displayName:"o3",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-04-16",modalities:{input:["text","image","pdf"],output:["text"]},pricing:{inputPerM:2,outputPerM:8,cacheReadPerM:.5,currency:"USD",unit:"per_million_tokens"}},{name:"o3-deep-research",displayName:"o3-deep-research",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-06-26",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:10,outputPerM:40,cacheReadPerM:2.5,currency:"USD",unit:"per_million_tokens"}},{name:"o3-mini",displayName:"o3-mini",maxInputTokens:2e5,supportedFileTypes:[],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-12-20",modalities:{input:["text"],output:["text"]},pricing:{inputPerM:1.1,outputPerM:4.4,cacheReadPerM:.55,currency:"USD",unit:"per_million_tokens"}},{name:"o3-pro",displayName:"o3-pro",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-06-10",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:20,outputPerM:80,currency:"USD",unit:"per_million_tokens"}},{name:"o4-mini",displayName:"o4-mini",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2025-04-16",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:1.1,outputPerM:4.4,cacheReadPerM:.275,currency:"USD",unit:"per_million_tokens"}},{name:"o4-mini-deep-research",displayName:"o4-mini-deep-research",maxInputTokens:2e5,supportedFileTypes:["pdf","image","document"],reasoning:!0,supportsTemperature:!1,supportsToolCall:!0,releaseDate:"2024-06-26",modalities:{input:["text","image"],output:["text"]},pricing:{inputPerM:2,outputPerM:8,cacheReadPerM:.5,currency:"USD",unit:"per_million_tokens"}}]},eB={openai:[{name:"gpt-4o-audio-preview",displayName:"GPT-4o Audio Preview",maxInputTokens:128e3,supportedFileTypes:["audio"],pricing:{inputPerM:2.5,outputPerM:10,cacheReadPerM:1.25,currency:"USD",unit:"per_million_tokens"}}]};function tB(e,t){if(!t||t.length===0)return e;const n=[...e],r=new Map;for(let s=0;s<n.length;s++)r.set(n[s].name.toLowerCase(),s);for(const s of t){const i=s.name.toLowerCase(),o=r.get(i);o!=null?n[o]=s:(r.set(i,n.length),n.push(s))}return n}tB(J8.openai,eB.openai);var nM=(e=>(e.SCHEMA_VALIDATION="mcp_schema_validation",e.COMMAND_MISSING="mcp_command_missing",e.DUPLICATE_NAME="mcp_duplicate_name",e.CONNECTION_FAILED="mcp_connection_failed",e.DISCONNECTION_FAILED="mcp_disconnection_failed",e.AUTH_REQUIRED="mcp_auth_required",e.PROTOCOL_ERROR="mcp_protocol_error",e.SERVER_NOT_FOUND="mcp_server_not_found",e.TOOL_NOT_FOUND="mcp_tool_not_found",e.PROMPT_NOT_FOUND="mcp_prompt_not_found",e.RESOURCE_NOT_FOUND="mcp_resource_not_found",e))(nM||{}),rM={};const nB=["stdio","sse","http"],Ow=["strict","lenient"],Iw="lenient",rB=Aw({type:Mw("stdio"),enabled:Cw().default(!0).describe("Whether this server is enabled (disabled servers are not connected)"),command:Yc().superRefine((e,t)=>{e.length===0&&t.addIssue({code:W8.custom,message:"Stdio server requires a non-empty command",params:{code:nM.COMMAND_MISSING,scope:QA.MCP,type:JA.USER}})}),args:ZA(Yc()).default([]).describe("Array of arguments for the command (e.g., ['script.js'])"),env:ug(Ll(),Yc()).default({}).describe("Optional environment variables for the server process"),timeout:Rw().int().positive().default(3e4),connectionMode:dg(Ow).default(Iw)}).strict(),sB=Aw({type:Mw("sse"),enabled:Cw().default(!0).describe("Whether this server is enabled (disabled servers are not connected)"),url:tM(rM).describe("URL for the SSE server endpoint"),headers:ug(Ll(),Yc()).default({}),timeout:Rw().int().positive().default(3e4),connectionMode:dg(Ow).default(Iw)}).strict(),iB=Aw({type:Mw("http"),enabled:Cw().default(!0).describe("Whether this server is enabled (disabled servers are not connected)"),url:tM(rM).describe("URL for the HTTP server"),headers:ug(Ll(),Yc()).default({}),timeout:Rw().int().positive().default(3e4),connectionMode:dg(Ow).default(Iw)}).strict(),aB=j8("type",[rB,sB,iB]).superRefine((e,t)=>{}).brand();ug(Ll(),aB).describe("A dictionary of server configurations, keyed by server name").brand();const gf={APPROVED:"approved",DENIED:"denied",CANCELLED:"cancelled"},oB="modulepreload",lB=function(e){return"/"+e},vj={},cB=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let f=function(p){return Promise.all(p.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=o?.nonce||o?.getAttribute("nonce");s=f(n.map(p=>{if(p=lB(p),p in vj)return;vj[p]=!0;const h=p.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=h?"stylesheet":oB,h||(v.as="script"),v.crossOrigin="",v.href=p,u&&v.setAttribute("nonce",u),document.head.appendChild(v),h)return new Promise((y,S)=>{v.addEventListener("load",y),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function i(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return s.then(o=>{for(const u of o||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};function uB(e){const t=[],n=new RegExp("(?:^|(?<=\\s))@(?:(<[^>]+>)|([a-zA-Z0-9_-]+):([a-zA-Z0-9._/-]+)|([a-zA-Z0-9._/-]+))(?![a-zA-Z0-9@.])","g");let r;for(;(r=n.exec(e))!==null;){const[s,i,o,u,f]=r;i?t.push({originalRef:s,type:"uri",identifier:i.slice(1,-1)}):o&&u?t.push({originalRef:s,type:"server-scoped",serverName:o,identifier:u}):f&&t.push({originalRef:s,type:"name",identifier:f})}return t}function dB(e,t){const n=e.map(r=>({...r}));for(const r of n)switch(r.type){case"uri":{if(t[r.identifier])r.resourceUri=r.identifier;else{const s=fB(t,r.identifier);s&&(r.resourceUri=s)}break}case"server-scoped":{const s=pB(t,r.serverName,r.identifier);s&&(r.resourceUri=s);break}case"name":{const s=hB(t,r.identifier);s&&(r.resourceUri=s);break}}return n}function fB(e,t){const n=t.trim().toLowerCase();for(const[r,s]of Object.entries(e)){const i=typeof s.metadata?.originalUri=="string"?s.metadata.originalUri:void 0;if(i&&i.toLowerCase()===n)return r}for(const[r,s]of Object.entries(e)){const i=typeof s.metadata?.originalUri=="string"?s.metadata.originalUri:void 0;if(i&&i.toLowerCase().includes(n))return r}}function pB(e,t,n){const r=n.trim().toLowerCase(),s=Object.entries(e).filter(([,i])=>i.serverName===t);for(const[i,o]of s){if(!o.name)continue;const u=o.name.trim().toLowerCase();if(u===r||u.includes(r))return i}for(const[i,o]of s)if((typeof o.metadata?.originalUri=="string"?o.metadata.originalUri:void 0)?.toLowerCase().includes(r)||i.toLowerCase().includes(r))return i}function hB(e,t){const n=t.trim().toLowerCase();for(const[r,s]of Object.entries(e)){if(!s.name)continue;const i=s.name.trim().toLowerCase();if(i===n||i.includes(n))return r}for(const[r,s]of Object.entries(e))if((typeof s.metadata?.originalUri=="string"?s.metadata.originalUri:void 0)?.toLowerCase().includes(n)||r.toLowerCase().includes(n))return r}function mB(e){return e===gf.APPROVED||e===gf.DENIED||e===gf.CANCELLED}const Dw=ka((e,t)=>({pendingApproval:null,queue:[],addApproval:n=>{e(r=>r.pendingApproval?{queue:[...r.queue,n]}:{pendingApproval:n})},processResponse:n=>{e(r=>{if(r.pendingApproval?.approvalId!==n.approvalId)return r;if(mB(n.status)){const[s,...i]=r.queue;return{pendingApproval:s??null,queue:i}}return r})},clearApproval:()=>{e(n=>{const[r,...s]=n.queue;return{pendingApproval:r??null,queue:s}})},clearAll:()=>{e({pendingApproval:null,queue:[]})},getPendingCount:()=>{const n=t();return(n.pendingApproval?1:0)+n.queue.length},getPendingForSession:n=>{const r=t(),s=[];return r.pendingApproval?.sessionId===n&&s.push(r.pendingApproval),s.push(...r.queue.filter(i=>i.sessionId===n)),s},hasPendingApproval:()=>t().pendingApproval!==null}));function gB(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var i;const o=f=>f===null?null:JSON.parse(f,void 0),u=(i=n.getItem(s))!=null?i:null;return u instanceof Promise?u.then(o):o(u)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const s0=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return s0(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return s0(r)(n)}}}},vB=(e,t)=>(n,r,s)=>{let i={storage:gB(()=>localStorage),partialize:w=>w,version:0,merge:(w,N)=>({...N,...w}),...t},o=!1;const u=new Set,f=new Set;let p=i.storage;if(!p)return e((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...w)},r,s);const h=()=>{const w=i.partialize({...r()});return p.setItem(i.name,{state:w,version:i.version})},g=s.setState;s.setState=(w,N)=>(g(w,N),h());const v=e((...w)=>(n(...w),h()),r,s);s.getInitialState=()=>v;let y;const S=()=>{var w,N;if(!p)return;o=!1,u.forEach(j=>{var E;return j((E=r())!=null?E:v)});const k=((N=i.onRehydrateStorage)==null?void 0:N.call(i,(w=r())!=null?w:v))||void 0;return s0(p.getItem.bind(p))(i.name).then(j=>{if(j)if(typeof j.version=="number"&&j.version!==i.version){if(i.migrate){const E=i.migrate(j.state,j.version);return E instanceof Promise?E.then(T=>[!0,T]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,j.state];return[!1,void 0]}).then(j=>{var E;const[T,M]=j;if(y=i.merge(M,(E=r())!=null?E:v),n(y,!0),T)return h()}).then(()=>{k?.(y,void 0),y=r(),o=!0,f.forEach(j=>j(y))}).catch(j=>{k?.(void 0,j)})};return s.persist={setOptions:w=>{i={...i,...w},w.storage&&(p=w.storage)},clearStorage:()=>{p?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>o,onHydrate:w=>(u.add(w),()=>{u.delete(w)}),onFinishHydration:w=>(f.add(w),()=>{f.delete(w)})},i.skipHydration||S(),y||v},sM=vB,yB={isStreaming:!0},iM=ka()(sM(e=>({...yB,setStreaming:t=>{e({isStreaming:t})}}),{name:"dexto-preferences",version:1})),aM=ka()((e,t)=>({sessions:new Map,getTodos:n=>t().sessions.get(n)?.todos??[],setTodos:(n,r)=>{e(s=>{const i=new Map(s.sessions);return i.set(n,{todos:r}),{sessions:i}})},clearTodos:n=>{e(r=>{const s=new Map(r.sessions);return s.delete(n),{sessions:s}})}})),Pw=new Map;function cs(e,t){Pw.set(e,t)}function Lw(e){const t=Ft.getState();t.getSessionState(e).streamingMessage&&t.finalizeStreamingMessage(e,{})}function vf(e){if(e.startsWith("mcp--")){const t=e.substring(5),n=t.split("--");return n.length>=2?n.slice(1).join("--"):t}return e}function i0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function xB(e){return i0(e)&&e.version===1}function bB(e){const t=i0(e.metadata)?e.metadata:{},n=typeof t.toolName=="string"?t.toolName:"unknown",r=typeof t.toolCallId=="string"?t.toolCallId:void 0,s=xB(t.presentationSnapshot)?t.presentationSnapshot:void 0,i=i0(t.args)?t.args:{};return{approvalId:e.approvalId,toolCallId:r,toolName:n,toolArgs:i,presentationSnapshot:s,approvalType:e.type}}function yj(e,t){return t!==void 0?!0:e?(e.inputTokens??0)>0||(e.outputTokens??0)>0||(e.reasoningTokens??0)>0||(e.cacheReadTokens??0)>0||(e.cacheWriteTokens??0)>0||(e.totalTokens??0)>0:!1}function wB(e){const{sessionId:t}=e;Ft.getState().setProcessing(t,!0),ps.getState().setThinking(t)}function _B(e){if(!iM.getState().isStreaming)return;const{sessionId:n,content:r,chunkType:s="text"}=e,i=Ft.getState();if(i.getSessionState(n).streamingMessage)i.appendToStreamingMessage(n,r,s);else{const u={id:ig(),role:"assistant",content:s==="text"?r:"",reasoning:s==="reasoning"?r:void 0,createdAt:Date.now(),sessionId:n};i.setStreamingMessage(n,u)}}function SB(e){const{sessionId:t,content:n,reasoning:r,tokenUsage:s,model:i,provider:o,estimatedCost:u,costBreakdown:f,estimatedInputTokens:p,reasoningVariant:h,reasoningBudgetTokens:g}=e,v=Ft.getState(),y=v.getSessionState(t),S=typeof n=="string"?n:"";if(y.streamingMessage){if(v.finalizeStreamingMessage(t,{content:S,...r&&{reasoning:r},tokenUsage:s,...i&&{model:i},...o&&{provider:o}}),yj(s,u)){let k;const j=s?.inputTokens;if(p!==void 0&&j){const E=p-j;k=Math.round(E/j*100)}UE({sessionId:t,provider:o,model:i,reasoningVariant:h,reasoningBudgetTokens:g,inputTokens:s?.inputTokens,outputTokens:s?.outputTokens,reasoningTokens:s?.reasoningTokens,totalTokens:s?.totalTokens,cacheReadTokens:s?.cacheReadTokens,cacheWriteTokens:s?.cacheWriteTokens,estimatedCostUsd:u,inputCostUsd:f?.inputUsd,outputCostUsd:f?.outputUsd,reasoningCostUsd:f?.reasoningUsd,cacheReadCostUsd:f?.cacheReadUsd,cacheWriteCostUsd:f?.cacheWriteUsd,estimatedInputTokens:p,estimateAccuracyPercent:k})}return}const w=y.messages;let N=null;for(let k=w.length-1;k>=0;k--){const j=w[k];if(j.role==="assistant"){N=j;break}if(j.role==="user")break}if(N?v.updateMessage(t,N.id,{content:S||N.content,...r&&{reasoning:r},tokenUsage:s,...i&&{model:i},...o&&{provider:o}}):S&&v.addMessage(t,{id:ig(),role:"assistant",content:S,...r&&{reasoning:r},tokenUsage:s,...i&&{model:i},...o&&{provider:o},createdAt:Date.now(),sessionId:t}),yj(s,u)){let k;const j=s?.inputTokens;if(p!==void 0&&j){const E=p-j;k=Math.round(E/j*100)}UE({sessionId:t,provider:o,model:i,reasoningVariant:h,reasoningBudgetTokens:g,inputTokens:s?.inputTokens,outputTokens:s?.outputTokens,reasoningTokens:s?.reasoningTokens,totalTokens:s?.totalTokens,cacheReadTokens:s?.cacheReadTokens,cacheWriteTokens:s?.cacheWriteTokens,estimatedCostUsd:u,inputCostUsd:f?.inputUsd,outputCostUsd:f?.outputUsd,reasoningCostUsd:f?.reasoningUsd,cacheReadCostUsd:f?.cacheReadUsd,cacheWriteCostUsd:f?.cacheWriteUsd,estimatedInputTokens:p,estimateAccuracyPercent:k})}}function kB(e){const{sessionId:t,content:n,provider:r,model:s,messageId:i}=e,o=Ft.getState();Lw(t),o.addMessage(t,{id:i,role:"assistant",content:n,provider:r,model:s,createdAt:Date.now(),sessionId:t}),o.setProcessing(t,!1),ps.getState().setIdle()}function NB(e){const{sessionId:t,toolName:n,args:r,callId:s,presentationSnapshot:i}=e,o=Ft.getState();Lw(t);const u=o.getMessages(t),f=u.find(v=>v.role==="tool"&&v.toolCallId===s&&v.toolResult===void 0);if(f){o.updateMessage(t,f.id,{toolArgs:r,...i!==void 0&&{presentationSnapshot:i}}),console.debug("[handlers] Tool call message already exists:",f.id);return}const p=vf(n),h=u.find(v=>v.role!=="tool"||v.toolResult!==void 0||v.requireApproval!==!0||v.approvalStatus!=="pending"?!1:!!(v.toolCallId===s||v.toolName===n||v.toolName&&vf(v.toolName)===p));if(h){o.updateMessage(t,h.id,{toolCallId:s,toolArgs:r,...i!==void 0&&{presentationSnapshot:i}}),console.debug("[handlers] Updated existing approval message with callId:",h.id);return}const g={id:`tool-${s}`,role:"tool",content:null,toolName:n,...i!==void 0&&{presentationSnapshot:i},toolArgs:r,toolCallId:s,createdAt:Date.now(),sessionId:t};o.addMessage(t,g),ps.getState().setExecutingTool(t,n)}function EB(e){const{sessionId:t,callId:n,success:r,sanitized:s,requireApproval:i,approvalStatus:o,presentationSnapshot:u}=e,f=Ft.getState();let p=n?f.getMessageByToolCallId(t,n):void 0;if(!p&&n&&(p=f.getMessages(t).find(g=>g.id===`tool-${n}`||g.id===`approval-${n}`)),!p){const g=f.getMessages(t).filter(v=>v.role==="tool"&&v.toolResult===void 0).sort((v,y)=>y.createdAt-v.createdAt);p=g.find(v=>v.id.startsWith("approval-"))||g[0]}p?f.updateMessage(t,p.id,{toolResult:s,toolResultMeta:s?.meta,toolResultSuccess:r,...u!==void 0&&{presentationSnapshot:u},...i!==void 0&&{requireApproval:i},...o!==void 0&&{approvalStatus:o}}):console.warn("[handlers] Could not find tool message to update for callId:",n)}function jB(e){const{sessionId:t,error:n,context:r,recoverable:s}=e,i=Ft.getState();i.setError(t,{id:ig(),message:n?.message||"Unknown error",timestamp:Date.now(),context:r,recoverable:s,sessionId:t}),i.setProcessing(t,!1),ps.getState().setIdle()}function TB(e){const t=e.sessionId||"",n=Ft.getState();t&&Lw(t),Dw.getState().addApproval(e);const{approvalId:r,toolCallId:s,toolName:i,toolArgs:o,presentationSnapshot:u,approvalType:f}=bB(e),p=vf(i),h=n.getMessages(t),g=s?h.find(v=>v.role==="tool"&&v.toolResult===void 0&&v.requireApproval!==!0&&v.toolCallId===s):h.find(v=>v.role!=="tool"||v.toolResult!==void 0||v.requireApproval===!0?!1:!!(v.toolName===i||v.toolName&&vf(v.toolName)===p));if(g)n.updateMessage(t,g.id,{requireApproval:!0,approvalStatus:"pending",toolResultSuccess:void 0,...u!==void 0&&{presentationSnapshot:u}}),console.debug("[handlers] Updated existing tool message with approval:",g.id);else if(t){const v=s?h.find(y=>y.role==="tool"&&y.requireApproval===!0&&y.approvalStatus==="pending"&&y.toolResult===void 0&&y.toolCallId===s):h.find(y=>y.role==="tool"&&y.requireApproval===!0&&y.approvalStatus==="pending"&&y.toolResult===void 0&&(y.toolName===i||y.toolName&&vf(y.toolName)===p));if(v)console.debug("[handlers] Approval message already exists:",v.id);else{const y={id:`approval-${r}`,role:"tool",content:null,toolName:i,...u!==void 0&&{presentationSnapshot:u},toolArgs:o,toolCallId:s??r,createdAt:Date.now(),sessionId:t,requireApproval:!0,approvalStatus:"pending",...f&&{approvalType:f}};n.addMessage(t,y)}}t&&ps.getState().setAwaitingApproval(t)}function CB(e){const{status:t}=e,n=e.sessionId||"",r=e.approvalId;if(Dw.getState().processResponse(e),n&&r){const i=Ft.getState(),u=i.getMessages(n).find(f=>f.id===`approval-${r}`||f.toolCallId===r&&f.requireApproval);if(u){const f=t==="approved"?"approved":"rejected";i.updateMessage(n,u.id,{approvalStatus:f,...f==="rejected"&&{toolResultSuccess:!1}}),console.debug("[handlers] Updated approval status:",u.id,f)}}t==="approved"?n&&ps.getState().setThinking(n):(ps.getState().setIdle(),n&&Ft.getState().setProcessing(n,!1))}function AB(e){const{sessionId:t}=e;Ft.getState().setProcessing(t,!1),ps.getState().setIdle()}function MB(e){console.debug("[handlers] session:title-updated",e.sessionId,e.title)}function RB(e){const{sessionId:t,content:n}=e,r=Ft.getState(),s=n.filter(u=>u.type==="text").map(u=>u.text).join(`
|
|
51
51
|
`),i=n.find(u=>u.type==="image"),o=n.find(u=>u.type==="file");if(s||n.length>0){const u=i&&typeof i.image=="string"?{image:i.image,mimeType:i.mimeType??"image/jpeg"}:void 0,f={id:ig(),role:"user",content:s||"[attachment]",createdAt:Date.now(),sessionId:t,imageData:u,fileData:o?{data:typeof o.data=="string"?o.data:"",mimeType:o.mimeType,filename:o.filename}:void 0};r.addMessage(t,f)}}function OB(e){console.debug(`[handlers] Context compacted: ${e.originalTokens.toLocaleString()} → ${e.compactedTokens.toLocaleString()} tokens (${e.originalMessages} → ${e.compactedMessages} messages) via ${e.strategy}`)}function IB(e){const{service:t,event:n,toolCallId:r,sessionId:s,data:i}=e;if(t==="agent-spawner"&&n==="progress"&&r&&s){const o=Ft.getState(),u=i,p=o.getMessages(s).find(h=>h.role==="tool"&&h.toolCallId===r);p&&o.updateMessage(s,p.id,{subAgentProgress:{task:u.task,agentId:u.agentId,toolsCalled:u.toolsCalled,currentTool:u.currentTool,currentArgs:u.currentArgs}})}if(t==="todo"&&n==="updated"&&s){const o=i;aM.getState().setTodos(s,o.todos)}}function DB(){Pw.clear(),cs("llm:thinking",wB),cs("llm:chunk",_B),cs("llm:response",SB),cs("interaction:blocked",kB),cs("llm:tool-call",NB),cs("llm:tool-result",EB),cs("llm:error",jB),cs("approval:request",TB),cs("approval:response",CB),cs("run:complete",AB),cs("session:title-updated",MB),cs("message:dequeued",RB),cs("context:compacted",OB),cs("service:event",IB)}function PB(e){DB();const t=[];return Pw.forEach((n,r)=>{const s=e.on(r,n);t.push(s)}),()=>{t.forEach(n=>n.unsubscribe())}}const LB=b.createContext(null);function zB({children:e,middleware:t=[],enableLogging:n=!1,enableActivityLogging:r=!0,enableNotifications:s=!0,bus:i=_w}){b.useEffect(()=>{const u=[];let f;n&&(i.use(qE),u.push(qE)),r&&(i.use(GE),u.push(GE)),s&&(i.use(KE),u.push(KE));for(const p of t)i.use(p),u.push(p);return f=PB(i),()=>{for(const p of u)i.removeMiddleware(p);f?.()}},[i,n,r,s,t]);const o=b.useMemo(()=>({bus:i}),[i]);return l.jsx(LB.Provider,{value:o,children:e})}var $B=/^[\w!#$%&'*.^`|~+-]+$/,FB=(e,t,n={})=>{if(!$B.test(e))throw new Error("Invalid cookie name");let r=`${e}=${t}`;if(e.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(e.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}for(const s of["domain","path"])if(n[s]&&/[;\r\n]/.test(n[s]))throw new Error(`${s} must not contain ";", "\\r", or "\\n"`);if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},UB=(e,t,n)=>(t=encodeURIComponent(t),FB(e,t,n)),BB=(e,t)=>(e=e.replace(/\/+$/,""),e=e+"/",t=t.replace(/^\/+/,""),e+t),a0=(e,t)=>{for(const[n,r]of Object.entries(t)){const s=new RegExp("/:"+n+"(?:{[^/]+})?\\??");e=e.replace(s,r?`/${r}`:"")}return e},qB=e=>{const t=new URLSearchParams;for(const[n,r]of Object.entries(e))if(r!==void 0)if(Array.isArray(r))for(const s of r)t.append(n,s);else t.set(n,r);return t},HB=(e,t)=>{switch(t){case"ws":return e.replace(/^http/,"ws");case"http":return e.replace(/^ws/,"http")}},oM=e=>/^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e)?e.replace(/\/index(?=\?|$)/,"/"):e.replace(/\/index(?=\?|$)/,"");function Th(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lM(e,t){if(!Th(e)&&!Th(t))return t;const n={...e};for(const r in t){const s=t[r];Th(n[r])&&Th(s)?n[r]=lM(n[r],s):n[r]=s}return n}var cM=(e,t)=>new Proxy(()=>{},{get(r,s){if(!(typeof s!="string"||s==="then"))return cM(e,[...t,s])},apply(r,s,i){return e({path:t,args:i})}}),VB=class{url;method;buildSearchParams;queryParams=void 0;pathParams={};rBody;cType=void 0;constructor(e,t,n){this.url=e,this.method=t,this.buildSearchParams=n.buildSearchParams}fetch=async(e,t)=>{if(e){if(e.query&&(this.queryParams=this.buildSearchParams(e.query)),e.form){const u=new FormData;for(const[f,p]of Object.entries(e.form))if(p!==void 0)if(Array.isArray(p))for(const h of p)u.append(f,h);else u.append(f,p);this.rBody=u}e.json&&(this.rBody=JSON.stringify(e.json),this.cType="application/json"),e.param&&(this.pathParams=e.param)}let n=this.method.toUpperCase();const r={...e?.header,...typeof t?.headers=="function"?await t.headers():t?.headers};if(e?.cookie){const u=[];for(const[f,p]of Object.entries(e.cookie))u.push(UB(f,p,{path:"/"}));r.Cookie=u.join(",")}this.cType&&(r["Content-Type"]=this.cType);const s=new Headers(r??void 0);let i=this.url;i=oM(i),i=a0(i,this.pathParams),this.queryParams&&(i=i+"?"+this.queryParams.toString()),n=this.method.toUpperCase();const o=!(n==="GET"||n==="HEAD");return(t?.fetch||fetch)(i,{body:o?this.rBody:void 0,method:n,headers:s,...t?.init})}},KB=(e,t)=>cM(function n(r){const s=t?.buildSearchParams??qB,i=[...r.path],o=i.slice(-3).reverse();if(o[0]==="toString")return o[1]==="name"?o[2]||"":n.toString();if(o[0]==="valueOf")return o[1]==="name"?o[2]||"":n;let u="";if(/^\$/.test(o[0])){const g=i.pop();g&&(u=g.replace(/^\$/,""))}const f=i.join("/"),p=BB(e,f);if(u==="url"||u==="path"){let g=p;return r.args[0]&&(r.args[0].param&&(g=a0(p,r.args[0].param)),r.args[0].query&&(g=g+"?"+s(r.args[0].query).toString())),g=oM(g),u==="url"?new URL(g):g.slice(e.replace(/\/+$/,"").length).replace(/^\/?/,"/")}if(u==="ws"){const g=HB(r.args[0]&&r.args[0].param?a0(p,r.args[0].param):p,"ws"),v=new URL(g),y=r.args[0]?.query;return y&&Object.entries(y).forEach(([w,N])=>{Array.isArray(N)?N.forEach(k=>v.searchParams.append(w,k)):v.searchParams.set(w,N)}),((...w)=>t?.webSocket!==void 0&&typeof t.webSocket=="function"?t.webSocket(...w):new WebSocket(...w))(v.toString())}const h=new VB(p,u,{buildSearchParams:s});if(u){t??={};const g=lM(t,{...r.args[1]});return h.fetch(r.args[0],g)}return h},[]),GB=class extends Error{constructor(e,t){super(`SSE Error: ${e}`),this.status=e,this.body=t,this.name="SSEError"}};async function*ZB(e,t){var n;if(!e.ok){const p=e.headers.get("content-type");let h;try{p&&p.includes("application/json")?h=await e.json():h=await e.text()}catch{h="Unknown error"}throw new GB(e.status,h)}const r=(n=e.body)==null?void 0:n.getReader();if(!r)throw new Error("Response body is null");const s=new globalThis.TextDecoder;let i="";const o=t?.signal;let u=!1;const f=()=>{u=!0,r.cancel().catch(()=>{})};if(o){if(o.aborted){r.cancel().catch(()=>{});return}o.addEventListener("abort",f)}try{for(;;){if(u||o?.aborted)return;const p=i.split(`
|
|
52
52
|
|
|
53
53
|
`);if(p.length>1){const v=p.shift();i=p.join(`
|
package/dist/webui/index.html
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
if (theme === 'dark') document.documentElement.classList.add('dark');
|
|
19
19
|
})();
|
|
20
20
|
</script>
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/assets/index-DMSYeYHF.js"></script>
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/tanstack-CdDcRpJz.js">
|
|
23
23
|
<link rel="stylesheet" crossorigin href="/assets/index-cNwNJ0w6.css">
|
|
24
24
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dexto",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dexto": "./dist/index.js"
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"ws": "^8.18.1",
|
|
35
35
|
"yaml": "^2.8.3",
|
|
36
36
|
"zod": "^4.3.6",
|
|
37
|
-
"@dexto/agent-config": "1.8.
|
|
38
|
-
"@dexto/agent-management": "1.8.
|
|
39
|
-
"@dexto/analytics": "1.8.
|
|
40
|
-
"@dexto/client-sdk": "1.8.
|
|
41
|
-
"@dexto/core": "1.8.
|
|
42
|
-
"@dexto/image-local": "1.8.
|
|
43
|
-
"@dexto/image-logger-agent": "1.8.
|
|
44
|
-
"@dexto/llm": "1.8.
|
|
45
|
-
"@dexto/registry": "1.8.
|
|
46
|
-
"@dexto/server": "1.8.
|
|
47
|
-
"@dexto/storage": "1.8.
|
|
48
|
-
"@dexto/tui": "1.8.
|
|
37
|
+
"@dexto/agent-config": "1.8.6",
|
|
38
|
+
"@dexto/agent-management": "1.8.6",
|
|
39
|
+
"@dexto/analytics": "1.8.6",
|
|
40
|
+
"@dexto/client-sdk": "1.8.6",
|
|
41
|
+
"@dexto/core": "1.8.6",
|
|
42
|
+
"@dexto/image-local": "1.8.6",
|
|
43
|
+
"@dexto/image-logger-agent": "1.8.6",
|
|
44
|
+
"@dexto/llm": "1.8.6",
|
|
45
|
+
"@dexto/registry": "1.8.6",
|
|
46
|
+
"@dexto/server": "1.8.6",
|
|
47
|
+
"@dexto/storage": "1.8.6",
|
|
48
|
+
"@dexto/tui": "1.8.6"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/ws": "^8.5.11",
|