@inkeep/agents-cli 0.0.0-dev-20251109004542 → 0.0.0-dev-20251110174655
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/index.js +1096 -913
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -71,6 +71,220 @@ var init_base_client = __esm({
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
+
// ../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js
|
|
75
|
+
var require_main = __commonJS({
|
|
76
|
+
"../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js"(exports, module) {
|
|
77
|
+
"use strict";
|
|
78
|
+
init_esm_shims();
|
|
79
|
+
function _resolveEscapeSequences(value) {
|
|
80
|
+
return value.replace(/\\\$/g, "$");
|
|
81
|
+
}
|
|
82
|
+
function expandValue(value, processEnv, runningParsed) {
|
|
83
|
+
const env3 = { ...runningParsed, ...processEnv };
|
|
84
|
+
const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
85
|
+
let result = value;
|
|
86
|
+
let match2;
|
|
87
|
+
const seen = /* @__PURE__ */ new Set();
|
|
88
|
+
while ((match2 = regex.exec(result)) !== null) {
|
|
89
|
+
seen.add(result);
|
|
90
|
+
const [template, bracedExpression, unbracedExpression] = match2;
|
|
91
|
+
const expression = bracedExpression || unbracedExpression;
|
|
92
|
+
const opRegex = /(:\+|\+|:-|-)/;
|
|
93
|
+
const opMatch = expression.match(opRegex);
|
|
94
|
+
const splitter = opMatch ? opMatch[0] : null;
|
|
95
|
+
const r = expression.split(splitter);
|
|
96
|
+
let defaultValue;
|
|
97
|
+
let value2;
|
|
98
|
+
const key = r.shift();
|
|
99
|
+
if ([":+", "+"].includes(splitter)) {
|
|
100
|
+
defaultValue = env3[key] ? r.join(splitter) : "";
|
|
101
|
+
value2 = null;
|
|
102
|
+
} else {
|
|
103
|
+
defaultValue = r.join(splitter);
|
|
104
|
+
value2 = env3[key];
|
|
105
|
+
}
|
|
106
|
+
if (value2) {
|
|
107
|
+
if (seen.has(value2)) {
|
|
108
|
+
result = result.replace(template, defaultValue);
|
|
109
|
+
} else {
|
|
110
|
+
result = result.replace(template, value2);
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
result = result.replace(template, defaultValue);
|
|
114
|
+
}
|
|
115
|
+
if (result === runningParsed[key]) {
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
regex.lastIndex = 0;
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
function expand2(options) {
|
|
123
|
+
const runningParsed = {};
|
|
124
|
+
let processEnv = process.env;
|
|
125
|
+
if (options && options.processEnv != null) {
|
|
126
|
+
processEnv = options.processEnv;
|
|
127
|
+
}
|
|
128
|
+
for (const key in options.parsed) {
|
|
129
|
+
let value = options.parsed[key];
|
|
130
|
+
if (processEnv[key] && processEnv[key] !== value) {
|
|
131
|
+
value = processEnv[key];
|
|
132
|
+
} else {
|
|
133
|
+
value = expandValue(value, processEnv, runningParsed);
|
|
134
|
+
}
|
|
135
|
+
options.parsed[key] = _resolveEscapeSequences(value);
|
|
136
|
+
runningParsed[key] = _resolveEscapeSequences(value);
|
|
137
|
+
}
|
|
138
|
+
for (const processKey in options.parsed) {
|
|
139
|
+
processEnv[processKey] = options.parsed[processKey];
|
|
140
|
+
}
|
|
141
|
+
return options;
|
|
142
|
+
}
|
|
143
|
+
module.exports.expand = expand2;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// ../packages/agents-core/src/env.ts
|
|
148
|
+
import fs from "fs";
|
|
149
|
+
import os from "os";
|
|
150
|
+
import path2 from "path";
|
|
151
|
+
import dotenv from "dotenv";
|
|
152
|
+
import { findUpSync } from "find-up";
|
|
153
|
+
import { z } from "zod";
|
|
154
|
+
var import_dotenv_expand, loadEnvironmentFiles, envSchema, parseEnv, env;
|
|
155
|
+
var init_env = __esm({
|
|
156
|
+
"../packages/agents-core/src/env.ts"() {
|
|
157
|
+
"use strict";
|
|
158
|
+
init_esm_shims();
|
|
159
|
+
import_dotenv_expand = __toESM(require_main(), 1);
|
|
160
|
+
loadEnvironmentFiles = () => {
|
|
161
|
+
const environmentFiles = [];
|
|
162
|
+
const currentEnv = path2.resolve(process.cwd(), ".env");
|
|
163
|
+
if (fs.existsSync(currentEnv)) {
|
|
164
|
+
environmentFiles.push(currentEnv);
|
|
165
|
+
}
|
|
166
|
+
const rootEnv = findUpSync(".env", { cwd: path2.dirname(process.cwd()) });
|
|
167
|
+
if (rootEnv) {
|
|
168
|
+
if (rootEnv !== currentEnv) {
|
|
169
|
+
environmentFiles.push(rootEnv);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const userConfigPath = path2.join(os.homedir(), ".inkeep", "config");
|
|
173
|
+
if (fs.existsSync(userConfigPath)) {
|
|
174
|
+
dotenv.config({ path: userConfigPath, override: true, quiet: true });
|
|
175
|
+
}
|
|
176
|
+
if (environmentFiles.length > 0) {
|
|
177
|
+
dotenv.config({
|
|
178
|
+
path: environmentFiles,
|
|
179
|
+
override: false,
|
|
180
|
+
quiet: true
|
|
181
|
+
});
|
|
182
|
+
(0, import_dotenv_expand.expand)({ processEnv: process.env });
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
loadEnvironmentFiles();
|
|
186
|
+
envSchema = z.object({
|
|
187
|
+
ENVIRONMENT: z.enum(["development", "production", "pentest", "test"]).optional(),
|
|
188
|
+
DB_FILE_NAME: z.string().optional(),
|
|
189
|
+
TURSO_DATABASE_URL: z.string().optional(),
|
|
190
|
+
TURSO_AUTH_TOKEN: z.string().optional(),
|
|
191
|
+
INKEEP_AGENTS_JWT_SIGNING_SECRET: z.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional()
|
|
192
|
+
});
|
|
193
|
+
parseEnv = () => {
|
|
194
|
+
try {
|
|
195
|
+
const parsedEnv = envSchema.parse(process.env);
|
|
196
|
+
return parsedEnv;
|
|
197
|
+
} catch (error) {
|
|
198
|
+
if (error instanceof z.ZodError) {
|
|
199
|
+
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
200
|
+
throw new Error(
|
|
201
|
+
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
202
|
+
${error.message}`
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
env = parseEnv();
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// ../packages/agents-core/src/constants/execution-limits-shared/defaults.ts
|
|
213
|
+
var executionLimitsSharedDefaults;
|
|
214
|
+
var init_defaults = __esm({
|
|
215
|
+
"../packages/agents-core/src/constants/execution-limits-shared/defaults.ts"() {
|
|
216
|
+
"use strict";
|
|
217
|
+
init_esm_shims();
|
|
218
|
+
executionLimitsSharedDefaults = {
|
|
219
|
+
// MCP Tool Connection and Retry Behavior
|
|
220
|
+
// Model Context Protocol (MCP) enables agents to connect to external tools and services.
|
|
221
|
+
// These constants control connection timeouts and retry strategy with exponential backoff.
|
|
222
|
+
// CONNECTION_TIMEOUT_MS: Maximum wait time for initial MCP server connection
|
|
223
|
+
// MAX_RETRIES: Maximum number of connection retry attempts before failing
|
|
224
|
+
// INITIAL_RECONNECTION_DELAY_MS: Starting delay between retry attempts
|
|
225
|
+
// MAX_RECONNECTION_DELAY_MS: Maximum delay between retry attempts (after exponential growth)
|
|
226
|
+
// RECONNECTION_DELAY_GROWTH_FACTOR: Multiplier applied to delay after each failed retry (exponential backoff)
|
|
227
|
+
MCP_TOOL_CONNECTION_TIMEOUT_MS: 3e3,
|
|
228
|
+
// 3 seconds
|
|
229
|
+
MCP_TOOL_MAX_RETRIES: 3,
|
|
230
|
+
MCP_TOOL_MAX_RECONNECTION_DELAY_MS: 3e4,
|
|
231
|
+
// 30 seconds
|
|
232
|
+
MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS: 1e3,
|
|
233
|
+
// 1 second
|
|
234
|
+
MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR: 1.5,
|
|
235
|
+
// Conversation History Context Window
|
|
236
|
+
// CONVERSATION_HISTORY_DEFAULT_LIMIT: Default number of recent messages to retrieve from conversation history.
|
|
237
|
+
// Used when fetching conversation context for status updates and other operations.
|
|
238
|
+
CONVERSATION_HISTORY_DEFAULT_LIMIT: 50,
|
|
239
|
+
// CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: Maximum number of tokens from previous conversation messages
|
|
240
|
+
// to include in the LLM prompt. Prevents excessive token usage while maintaining relevant conversation context.
|
|
241
|
+
// Messages exceeding this limit are truncated from the beginning of the conversation.
|
|
242
|
+
CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 4e3
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
// ../packages/agents-core/src/constants/execution-limits-shared/index.ts
|
|
248
|
+
import { z as z2 } from "zod";
|
|
249
|
+
var constantsSchema, parseConstants, constants, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT;
|
|
250
|
+
var init_execution_limits_shared = __esm({
|
|
251
|
+
"../packages/agents-core/src/constants/execution-limits-shared/index.ts"() {
|
|
252
|
+
"use strict";
|
|
253
|
+
init_esm_shims();
|
|
254
|
+
init_env();
|
|
255
|
+
init_defaults();
|
|
256
|
+
init_defaults();
|
|
257
|
+
loadEnvironmentFiles();
|
|
258
|
+
constantsSchema = z2.object(
|
|
259
|
+
Object.fromEntries(
|
|
260
|
+
Object.keys(executionLimitsSharedDefaults).map((key) => [
|
|
261
|
+
`AGENTS_${key}`,
|
|
262
|
+
z2.coerce.number().optional()
|
|
263
|
+
])
|
|
264
|
+
)
|
|
265
|
+
);
|
|
266
|
+
parseConstants = () => {
|
|
267
|
+
const envOverrides = constantsSchema.parse(process.env);
|
|
268
|
+
return Object.fromEntries(
|
|
269
|
+
Object.entries(executionLimitsSharedDefaults).map(([key, defaultValue]) => [
|
|
270
|
+
key,
|
|
271
|
+
envOverrides[`AGENTS_${key}`] ?? defaultValue
|
|
272
|
+
])
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
constants = parseConstants();
|
|
276
|
+
({
|
|
277
|
+
MCP_TOOL_CONNECTION_TIMEOUT_MS,
|
|
278
|
+
MCP_TOOL_MAX_RETRIES,
|
|
279
|
+
MCP_TOOL_MAX_RECONNECTION_DELAY_MS,
|
|
280
|
+
MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS,
|
|
281
|
+
MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR,
|
|
282
|
+
CONVERSATION_HISTORY_DEFAULT_LIMIT,
|
|
283
|
+
CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT
|
|
284
|
+
} = constants);
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
74
288
|
// ../packages/agents-core/src/constants/models.ts
|
|
75
289
|
var ANTHROPIC_MODELS, OPENAI_MODELS, GOOGLE_MODELS;
|
|
76
290
|
var init_models = __esm({
|
|
@@ -119,6 +333,92 @@ var init_otel_attributes = __esm({
|
|
|
119
333
|
}
|
|
120
334
|
});
|
|
121
335
|
|
|
336
|
+
// ../packages/agents-core/src/constants/schema-validation/defaults.ts
|
|
337
|
+
var schemaValidationDefaults;
|
|
338
|
+
var init_defaults2 = __esm({
|
|
339
|
+
"../packages/agents-core/src/constants/schema-validation/defaults.ts"() {
|
|
340
|
+
"use strict";
|
|
341
|
+
init_esm_shims();
|
|
342
|
+
schemaValidationDefaults = {
|
|
343
|
+
// Agent Execution Transfer Count
|
|
344
|
+
// Controls how many times an agent can transfer control to sub-agents in a single conversation turn.
|
|
345
|
+
// This prevents infinite transfer loops while allowing multi-agent collaboration workflows.
|
|
346
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN: 1,
|
|
347
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX: 1e3,
|
|
348
|
+
AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT: 10,
|
|
349
|
+
// Sub-Agent Turn Generation Steps
|
|
350
|
+
// Limits how many AI generation steps a sub-agent can perform within a single turn.
|
|
351
|
+
// Each generation step typically involves sending a prompt to the LLM and processing its response.
|
|
352
|
+
// This prevents runaway token usage while allowing complex multi-step reasoning.
|
|
353
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN: 1,
|
|
354
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX: 1e3,
|
|
355
|
+
SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT: 12,
|
|
356
|
+
// Status Update Thresholds
|
|
357
|
+
// Real-time status updates are triggered when either threshold is exceeded during longer operations.
|
|
358
|
+
// MAX_NUM_EVENTS: Maximum number of internal events before forcing a status update to the client.
|
|
359
|
+
// MAX_INTERVAL_SECONDS: Maximum time between status updates regardless of event count.
|
|
360
|
+
STATUS_UPDATE_MAX_NUM_EVENTS: 100,
|
|
361
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS: 600,
|
|
362
|
+
// 10 minutes
|
|
363
|
+
// Prompt Text Length Validation
|
|
364
|
+
// Maximum character limits for agent and sub-agent system prompts to prevent excessive token usage.
|
|
365
|
+
// Enforced during agent configuration to ensure prompts remain focused and manageable.
|
|
366
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS: 2e3,
|
|
367
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS: 5e3,
|
|
368
|
+
// Context Fetcher HTTP Timeout
|
|
369
|
+
// Maximum time allowed for HTTP requests made by Context Fetchers (e.g., CRM lookups, external API calls).
|
|
370
|
+
// Context Fetchers automatically retrieve external data at the start of a conversation to enrich agent context.
|
|
371
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT: 1e4
|
|
372
|
+
// 10 seconds
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// ../packages/agents-core/src/constants/schema-validation/index.ts
|
|
378
|
+
import { z as z3 } from "zod";
|
|
379
|
+
var constantsSchema2, parseConstants2, constants2, AGENT_EXECUTION_TRANSFER_COUNT_MIN, AGENT_EXECUTION_TRANSFER_COUNT_MAX, AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT, SUB_AGENT_TURN_GENERATION_STEPS_MIN, SUB_AGENT_TURN_GENERATION_STEPS_MAX, SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT, STATUS_UPDATE_MAX_NUM_EVENTS, STATUS_UPDATE_MAX_INTERVAL_SECONDS, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS, VALIDATION_AGENT_PROMPT_MAX_CHARS, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT;
|
|
380
|
+
var init_schema_validation = __esm({
|
|
381
|
+
"../packages/agents-core/src/constants/schema-validation/index.ts"() {
|
|
382
|
+
"use strict";
|
|
383
|
+
init_esm_shims();
|
|
384
|
+
init_env();
|
|
385
|
+
init_defaults2();
|
|
386
|
+
init_defaults2();
|
|
387
|
+
loadEnvironmentFiles();
|
|
388
|
+
constantsSchema2 = z3.object(
|
|
389
|
+
Object.fromEntries(
|
|
390
|
+
Object.keys(schemaValidationDefaults).map((key) => [
|
|
391
|
+
`AGENTS_${key}`,
|
|
392
|
+
z3.coerce.number().optional()
|
|
393
|
+
])
|
|
394
|
+
)
|
|
395
|
+
);
|
|
396
|
+
parseConstants2 = () => {
|
|
397
|
+
const envOverrides = constantsSchema2.parse(process.env);
|
|
398
|
+
return Object.fromEntries(
|
|
399
|
+
Object.entries(schemaValidationDefaults).map(([key, defaultValue]) => [
|
|
400
|
+
key,
|
|
401
|
+
envOverrides[`AGENTS_${key}`] ?? defaultValue
|
|
402
|
+
])
|
|
403
|
+
);
|
|
404
|
+
};
|
|
405
|
+
constants2 = parseConstants2();
|
|
406
|
+
({
|
|
407
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN,
|
|
408
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX,
|
|
409
|
+
AGENT_EXECUTION_TRANSFER_COUNT_DEFAULT,
|
|
410
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN,
|
|
411
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX,
|
|
412
|
+
SUB_AGENT_TURN_GENERATION_STEPS_DEFAULT,
|
|
413
|
+
STATUS_UPDATE_MAX_NUM_EVENTS,
|
|
414
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS,
|
|
415
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS,
|
|
416
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS,
|
|
417
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT
|
|
418
|
+
} = constants2);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
|
|
122
422
|
// ../packages/agents-core/src/constants/signoz-queries.ts
|
|
123
423
|
var DATA_TYPES, FIELD_TYPES, QUERY_FIELD_CONFIGS;
|
|
124
424
|
var init_signoz_queries = __esm({
|
|
@@ -349,7 +649,7 @@ var init_logger = __esm({
|
|
|
349
649
|
});
|
|
350
650
|
|
|
351
651
|
// ../packages/agents-core/src/utils/schema-conversion.ts
|
|
352
|
-
import { z } from "zod";
|
|
652
|
+
import { z as z4 } from "zod";
|
|
353
653
|
var logger;
|
|
354
654
|
var init_schema_conversion = __esm({
|
|
355
655
|
"../packages/agents-core/src/utils/schema-conversion.ts"() {
|
|
@@ -1253,7 +1553,7 @@ var init_dist3 = __esm({
|
|
|
1253
1553
|
});
|
|
1254
1554
|
|
|
1255
1555
|
// ../node_modules/.pnpm/@hono+zod-openapi@1.1.4_hono@4.10.4_zod@4.1.12/node_modules/@hono/zod-openapi/dist/index.js
|
|
1256
|
-
import { z as
|
|
1556
|
+
import { z as z5 } from "zod";
|
|
1257
1557
|
var init_dist4 = __esm({
|
|
1258
1558
|
"../node_modules/.pnpm/@hono+zod-openapi@1.1.4_hono@4.10.4_zod@4.1.12/node_modules/@hono/zod-openapi/dist/index.js"() {
|
|
1259
1559
|
"use strict";
|
|
@@ -1262,12 +1562,12 @@ var init_dist4 = __esm({
|
|
|
1262
1562
|
init_dist2();
|
|
1263
1563
|
init_dist3();
|
|
1264
1564
|
init_url();
|
|
1265
|
-
extendZodWithOpenApi(
|
|
1565
|
+
extendZodWithOpenApi(z5);
|
|
1266
1566
|
}
|
|
1267
1567
|
});
|
|
1268
1568
|
|
|
1269
1569
|
// ../node_modules/.pnpm/drizzle-zod@0.8.3_drizzle-orm@0.44.7_@libsql+client@0.15.15_@opentelemetry+api@1.9.0_@types+pg@8.15.5__zod@4.1.12/node_modules/drizzle-zod/index.mjs
|
|
1270
|
-
import { z as
|
|
1570
|
+
import { z as z6 } from "zod/v4";
|
|
1271
1571
|
import { isTable, getTableColumns, getViewSelectedFields, is, Column, SQL, isView } from "drizzle-orm";
|
|
1272
1572
|
function isColumnType(column, columnTypes) {
|
|
1273
1573
|
return columnTypes.includes(column.columnType);
|
|
@@ -1276,7 +1576,7 @@ function isWithEnum(column) {
|
|
|
1276
1576
|
return "enumValues" in column && Array.isArray(column.enumValues) && column.enumValues.length > 0;
|
|
1277
1577
|
}
|
|
1278
1578
|
function columnToSchema(column, factory) {
|
|
1279
|
-
const z$1 = factory?.zodInstance ??
|
|
1579
|
+
const z$1 = factory?.zodInstance ?? z6;
|
|
1280
1580
|
const coerce = factory?.coerce ?? {};
|
|
1281
1581
|
let schema;
|
|
1282
1582
|
if (isWithEnum(column)) {
|
|
@@ -1326,7 +1626,7 @@ function columnToSchema(column, factory) {
|
|
|
1326
1626
|
}
|
|
1327
1627
|
return schema;
|
|
1328
1628
|
}
|
|
1329
|
-
function numberColumnToSchema(column,
|
|
1629
|
+
function numberColumnToSchema(column, z15, coerce) {
|
|
1330
1630
|
let unsigned = column.getSQLType().includes("unsigned");
|
|
1331
1631
|
let min;
|
|
1332
1632
|
let max;
|
|
@@ -1394,20 +1694,20 @@ function numberColumnToSchema(column, z13, coerce) {
|
|
|
1394
1694
|
min = Number.MIN_SAFE_INTEGER;
|
|
1395
1695
|
max = Number.MAX_SAFE_INTEGER;
|
|
1396
1696
|
}
|
|
1397
|
-
let schema = coerce === true || coerce?.number ? integer2 ?
|
|
1697
|
+
let schema = coerce === true || coerce?.number ? integer2 ? z15.coerce.number() : z15.coerce.number().int() : integer2 ? z15.int() : z15.number();
|
|
1398
1698
|
schema = schema.gte(min).lte(max);
|
|
1399
1699
|
return schema;
|
|
1400
1700
|
}
|
|
1401
|
-
function bigintColumnToSchema(column,
|
|
1701
|
+
function bigintColumnToSchema(column, z15, coerce) {
|
|
1402
1702
|
const unsigned = column.getSQLType().includes("unsigned");
|
|
1403
1703
|
const min = unsigned ? 0n : CONSTANTS.INT64_MIN;
|
|
1404
1704
|
const max = unsigned ? CONSTANTS.INT64_UNSIGNED_MAX : CONSTANTS.INT64_MAX;
|
|
1405
|
-
const schema = coerce === true || coerce?.bigint ?
|
|
1705
|
+
const schema = coerce === true || coerce?.bigint ? z15.coerce.bigint() : z15.bigint();
|
|
1406
1706
|
return schema.gte(min).lte(max);
|
|
1407
1707
|
}
|
|
1408
|
-
function stringColumnToSchema(column,
|
|
1708
|
+
function stringColumnToSchema(column, z15, coerce) {
|
|
1409
1709
|
if (isColumnType(column, ["PgUUID"])) {
|
|
1410
|
-
return
|
|
1710
|
+
return z15.uuid();
|
|
1411
1711
|
}
|
|
1412
1712
|
let max;
|
|
1413
1713
|
let regex;
|
|
@@ -1439,7 +1739,7 @@ function stringColumnToSchema(column, z13, coerce) {
|
|
|
1439
1739
|
regex = /^[01]+$/;
|
|
1440
1740
|
max = column.dimensions;
|
|
1441
1741
|
}
|
|
1442
|
-
let schema = coerce === true || coerce?.string ?
|
|
1742
|
+
let schema = coerce === true || coerce?.string ? z15.coerce.string() : z15.string();
|
|
1443
1743
|
schema = regex ? schema.regex(regex) : schema;
|
|
1444
1744
|
return max && fixed ? schema.length(max) : max ? schema.max(max) : schema;
|
|
1445
1745
|
}
|
|
@@ -1460,7 +1760,7 @@ function handleColumns(columns, refinements, conditions, factory) {
|
|
|
1460
1760
|
continue;
|
|
1461
1761
|
}
|
|
1462
1762
|
const column = is(selected, Column) ? selected : void 0;
|
|
1463
|
-
const schema = column ? columnToSchema(column, factory) :
|
|
1763
|
+
const schema = column ? columnToSchema(column, factory) : z6.any();
|
|
1464
1764
|
const refined = typeof refinement === "function" ? refinement(schema) : schema;
|
|
1465
1765
|
if (conditions.never(column)) {
|
|
1466
1766
|
continue;
|
|
@@ -1476,10 +1776,10 @@ function handleColumns(columns, refinements, conditions, factory) {
|
|
|
1476
1776
|
}
|
|
1477
1777
|
}
|
|
1478
1778
|
}
|
|
1479
|
-
return
|
|
1779
|
+
return z6.object(columnSchemas);
|
|
1480
1780
|
}
|
|
1481
1781
|
function handleEnum(enum_, factory) {
|
|
1482
|
-
const zod = factory?.zodInstance ??
|
|
1782
|
+
const zod = factory?.zodInstance ?? z6;
|
|
1483
1783
|
return zod.enum(enum_.enumValues);
|
|
1484
1784
|
}
|
|
1485
1785
|
var CONSTANTS, isPgEnum, literalSchema, jsonSchema, bufferSchema, selectConditions, insertConditions, createSelectSchema, createInsertSchema;
|
|
@@ -1508,13 +1808,13 @@ var init_drizzle_zod = __esm({
|
|
|
1508
1808
|
INT64_UNSIGNED_MAX: 18446744073709551615n
|
|
1509
1809
|
};
|
|
1510
1810
|
isPgEnum = isWithEnum;
|
|
1511
|
-
literalSchema =
|
|
1512
|
-
jsonSchema =
|
|
1811
|
+
literalSchema = z6.union([z6.string(), z6.number(), z6.boolean(), z6.null()]);
|
|
1812
|
+
jsonSchema = z6.union([
|
|
1513
1813
|
literalSchema,
|
|
1514
|
-
|
|
1515
|
-
|
|
1814
|
+
z6.record(z6.string(), z6.any()),
|
|
1815
|
+
z6.array(z6.any())
|
|
1516
1816
|
]);
|
|
1517
|
-
bufferSchema =
|
|
1817
|
+
bufferSchema = z6.custom((v) => v instanceof Buffer);
|
|
1518
1818
|
selectConditions = {
|
|
1519
1819
|
never: () => false,
|
|
1520
1820
|
optional: () => false,
|
|
@@ -2514,18 +2814,30 @@ var init_utility = __esm({
|
|
|
2514
2814
|
});
|
|
2515
2815
|
|
|
2516
2816
|
// ../packages/agents-core/src/validation/schemas.ts
|
|
2517
|
-
var StopWhenSchema, AgentStopWhenSchema, SubAgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createAgentScopedApiSchema, createAgentScopedApiInsertSchema, createAgentScopedApiUpdateSchema, SubAgentSelectSchema, SubAgentInsertSchema, SubAgentUpdateSchema, SubAgentApiSelectSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentRelationSelectSchema, SubAgentRelationInsertSchema, SubAgentRelationUpdateSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationQuerySchema, ExternalSubAgentRelationInsertSchema, ExternalSubAgentRelationApiInsertSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentUpdateSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentUpdateSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiUpdateSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, CredentialStoreSchema, CredentialStoreListResponseSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, RelatedAgentInfoSchema, ComponentAssociationSchema, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionToolSelectSchema, FunctionToolInsertSchema, FunctionToolUpdateSchema, FunctionToolApiSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationUpdateSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, TeamAgentSchema, FullAgentAgentInsertSchema, AgentWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, ProjectResponse, SubAgentResponse, AgentResponse, ToolResponse, ExternalAgentResponse, ContextConfigResponse, ApiKeyResponse, CredentialReferenceResponse, FunctionResponse, FunctionToolResponse, DataComponentResponse, ArtifactComponentResponse, SubAgentRelationResponse, SubAgentToolRelationResponse, ConversationResponse, MessageResponse, ProjectListResponse, SubAgentListResponse, AgentListResponse, ToolListResponse, ExternalAgentListResponse, ContextConfigListResponse, ApiKeyListResponse, CredentialReferenceListResponse, FunctionListResponse, FunctionToolListResponse, DataComponentListResponse, ArtifactComponentListResponse, SubAgentRelationListResponse, SubAgentToolRelationListResponse, ConversationListResponse, MessageListResponse, SubAgentDataComponentResponse, SubAgentArtifactComponentResponse, SubAgentDataComponentListResponse, SubAgentArtifactComponentListResponse, HeadersScopeSchema, TenantId, ProjectId, AgentId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, PaginationQueryParamsSchema;
|
|
2817
|
+
var AGENT_EXECUTION_TRANSFER_COUNT_MAX2, AGENT_EXECUTION_TRANSFER_COUNT_MIN2, CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT2, STATUS_UPDATE_MAX_INTERVAL_SECONDS2, STATUS_UPDATE_MAX_NUM_EVENTS2, SUB_AGENT_TURN_GENERATION_STEPS_MAX2, SUB_AGENT_TURN_GENERATION_STEPS_MIN2, VALIDATION_AGENT_PROMPT_MAX_CHARS2, VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2, StopWhenSchema, AgentStopWhenSchema, SubAgentStopWhenSchema, MIN_ID_LENGTH, MAX_ID_LENGTH, URL_SAFE_ID_PATTERN, resourceIdSchema, ModelSettingsSchema, ModelSchema, ProjectModelSchema, FunctionToolConfigSchema, createApiSchema, createApiInsertSchema, createApiUpdateSchema, createAgentScopedApiSchema, createAgentScopedApiInsertSchema, createAgentScopedApiUpdateSchema, SubAgentSelectSchema, SubAgentInsertSchema, SubAgentUpdateSchema, SubAgentApiSelectSchema, SubAgentApiInsertSchema, SubAgentApiUpdateSchema, SubAgentRelationSelectSchema, SubAgentRelationInsertSchema, SubAgentRelationUpdateSchema, SubAgentRelationApiSelectSchema, SubAgentRelationApiInsertSchema, SubAgentRelationApiUpdateSchema, SubAgentRelationQuerySchema, ExternalSubAgentRelationInsertSchema, ExternalSubAgentRelationApiInsertSchema, AgentSelectSchema, AgentInsertSchema, AgentUpdateSchema, AgentApiSelectSchema, AgentApiInsertSchema, AgentApiUpdateSchema, TaskSelectSchema, TaskInsertSchema, TaskUpdateSchema, TaskApiSelectSchema, TaskApiInsertSchema, TaskApiUpdateSchema, TaskRelationSelectSchema, TaskRelationInsertSchema, TaskRelationUpdateSchema, TaskRelationApiSelectSchema, TaskRelationApiInsertSchema, TaskRelationApiUpdateSchema, imageUrlSchema, McpTransportConfigSchema, ToolStatusSchema, McpToolDefinitionSchema, ToolSelectSchema, ToolInsertSchema, ConversationSelectSchema, ConversationInsertSchema, ConversationUpdateSchema, ConversationApiSelectSchema, ConversationApiInsertSchema, ConversationApiUpdateSchema, MessageSelectSchema, MessageInsertSchema, MessageUpdateSchema, MessageApiSelectSchema, MessageApiInsertSchema, MessageApiUpdateSchema, ContextCacheSelectSchema, ContextCacheInsertSchema, ContextCacheUpdateSchema, ContextCacheApiSelectSchema, ContextCacheApiInsertSchema, ContextCacheApiUpdateSchema, DataComponentSelectSchema, DataComponentInsertSchema, DataComponentBaseSchema, DataComponentUpdateSchema, DataComponentApiSelectSchema, DataComponentApiInsertSchema, DataComponentApiUpdateSchema, SubAgentDataComponentSelectSchema, SubAgentDataComponentInsertSchema, SubAgentDataComponentUpdateSchema, SubAgentDataComponentApiSelectSchema, SubAgentDataComponentApiInsertSchema, SubAgentDataComponentApiUpdateSchema, ArtifactComponentSelectSchema, ArtifactComponentInsertSchema, ArtifactComponentUpdateSchema, ArtifactComponentApiSelectSchema, ArtifactComponentApiInsertSchema, ArtifactComponentApiUpdateSchema, SubAgentArtifactComponentSelectSchema, SubAgentArtifactComponentInsertSchema, SubAgentArtifactComponentUpdateSchema, SubAgentArtifactComponentApiSelectSchema, SubAgentArtifactComponentApiInsertSchema, SubAgentArtifactComponentApiUpdateSchema, ExternalAgentSelectSchema, ExternalAgentInsertSchema, ExternalAgentUpdateSchema, ExternalAgentApiSelectSchema, ExternalAgentApiInsertSchema, ExternalAgentApiUpdateSchema, AllAgentSchema, ApiKeySelectSchema, ApiKeyInsertSchema, ApiKeyUpdateSchema, ApiKeyApiSelectSchema, ApiKeyApiCreationResponseSchema, ApiKeyApiInsertSchema, ApiKeyApiUpdateSchema, CredentialReferenceSelectSchema, CredentialReferenceInsertSchema, CredentialReferenceUpdateSchema, CredentialReferenceApiSelectSchema, CredentialReferenceApiInsertSchema, CredentialReferenceApiUpdateSchema, CredentialStoreSchema, CredentialStoreListResponseSchema, CreateCredentialInStoreRequestSchema, CreateCredentialInStoreResponseSchema, RelatedAgentInfoSchema, ComponentAssociationSchema, OAuthLoginQuerySchema, OAuthCallbackQuerySchema, McpToolSchema, MCPToolConfigSchema, ToolUpdateSchema, ToolApiSelectSchema, ToolApiInsertSchema, ToolApiUpdateSchema, FunctionToolSelectSchema, FunctionToolInsertSchema, FunctionToolUpdateSchema, FunctionToolApiSelectSchema, FunctionToolApiInsertSchema, FunctionToolApiUpdateSchema, FunctionSelectSchema, FunctionInsertSchema, FunctionUpdateSchema, FunctionApiSelectSchema, FunctionApiInsertSchema, FunctionApiUpdateSchema, FetchConfigSchema, FetchDefinitionSchema, ContextConfigSelectSchema, ContextConfigInsertSchema, ContextConfigUpdateSchema, ContextConfigApiSelectSchema, ContextConfigApiInsertSchema, ContextConfigApiUpdateSchema, SubAgentToolRelationSelectSchema, SubAgentToolRelationInsertSchema, SubAgentToolRelationUpdateSchema, SubAgentToolRelationApiSelectSchema, SubAgentToolRelationApiInsertSchema, SubAgentToolRelationApiUpdateSchema, SubAgentExternalAgentRelationSelectSchema, SubAgentExternalAgentRelationInsertSchema, SubAgentExternalAgentRelationUpdateSchema, SubAgentExternalAgentRelationApiSelectSchema, SubAgentExternalAgentRelationApiInsertSchema, SubAgentExternalAgentRelationApiUpdateSchema, SubAgentTeamAgentRelationSelectSchema, SubAgentTeamAgentRelationInsertSchema, SubAgentTeamAgentRelationUpdateSchema, SubAgentTeamAgentRelationApiSelectSchema, SubAgentTeamAgentRelationApiInsertSchema, SubAgentTeamAgentRelationApiUpdateSchema, LedgerArtifactSelectSchema, LedgerArtifactInsertSchema, LedgerArtifactUpdateSchema, LedgerArtifactApiSelectSchema, LedgerArtifactApiInsertSchema, LedgerArtifactApiUpdateSchema, StatusComponentSchema, StatusUpdateSchema, CanUseItemSchema, canDelegateToExternalAgentSchema, canDelegateToTeamAgentSchema, TeamAgentSchema, FullAgentAgentInsertSchema, AgentWithinContextOfProjectSchema, PaginationSchema, ErrorResponseSchema, ExistsResponseSchema, RemovedResponseSchema, ProjectSelectSchema, ProjectInsertSchema, ProjectUpdateSchema, ProjectApiSelectSchema, ProjectApiInsertSchema, ProjectApiUpdateSchema, FullProjectDefinitionSchema, ProjectResponse, SubAgentResponse, AgentResponse, ToolResponse, ExternalAgentResponse, ContextConfigResponse, ApiKeyResponse, CredentialReferenceResponse, FunctionResponse, FunctionToolResponse, DataComponentResponse, ArtifactComponentResponse, SubAgentRelationResponse, SubAgentToolRelationResponse, ConversationResponse, MessageResponse, ProjectListResponse, SubAgentListResponse, AgentListResponse, ToolListResponse, ExternalAgentListResponse, ContextConfigListResponse, ApiKeyListResponse, CredentialReferenceListResponse, FunctionListResponse, FunctionToolListResponse, DataComponentListResponse, ArtifactComponentListResponse, SubAgentRelationListResponse, SubAgentToolRelationListResponse, ConversationListResponse, MessageListResponse, SubAgentDataComponentResponse, SubAgentArtifactComponentResponse, SubAgentDataComponentListResponse, SubAgentArtifactComponentListResponse, HeadersScopeSchema, TenantId, ProjectId, AgentId, SubAgentId, TenantParamsSchema, TenantIdParamsSchema, TenantProjectParamsSchema, TenantProjectIdParamsSchema, TenantProjectAgentParamsSchema, TenantProjectAgentIdParamsSchema, TenantProjectAgentSubAgentParamsSchema, TenantProjectAgentSubAgentIdParamsSchema, PaginationQueryParamsSchema;
|
|
2518
2818
|
var init_schemas = __esm({
|
|
2519
2819
|
"../packages/agents-core/src/validation/schemas.ts"() {
|
|
2520
2820
|
"use strict";
|
|
2521
2821
|
init_esm_shims();
|
|
2522
2822
|
init_dist4();
|
|
2523
2823
|
init_drizzle_zod();
|
|
2824
|
+
init_defaults2();
|
|
2524
2825
|
init_schema();
|
|
2525
2826
|
init_utility();
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2827
|
+
({
|
|
2828
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MAX: AGENT_EXECUTION_TRANSFER_COUNT_MAX2,
|
|
2829
|
+
AGENT_EXECUTION_TRANSFER_COUNT_MIN: AGENT_EXECUTION_TRANSFER_COUNT_MIN2,
|
|
2830
|
+
CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT: CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT2,
|
|
2831
|
+
STATUS_UPDATE_MAX_INTERVAL_SECONDS: STATUS_UPDATE_MAX_INTERVAL_SECONDS2,
|
|
2832
|
+
STATUS_UPDATE_MAX_NUM_EVENTS: STATUS_UPDATE_MAX_NUM_EVENTS2,
|
|
2833
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MAX: SUB_AGENT_TURN_GENERATION_STEPS_MAX2,
|
|
2834
|
+
SUB_AGENT_TURN_GENERATION_STEPS_MIN: SUB_AGENT_TURN_GENERATION_STEPS_MIN2,
|
|
2835
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS: VALIDATION_AGENT_PROMPT_MAX_CHARS2,
|
|
2836
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS: VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2
|
|
2837
|
+
} = schemaValidationDefaults);
|
|
2838
|
+
StopWhenSchema = z5.object({
|
|
2839
|
+
transferCountIs: z5.number().min(AGENT_EXECUTION_TRANSFER_COUNT_MIN2).max(AGENT_EXECUTION_TRANSFER_COUNT_MAX2).optional().describe("The maximum number of transfers to trigger the stop condition."),
|
|
2840
|
+
stepCountIs: z5.number().min(SUB_AGENT_TURN_GENERATION_STEPS_MIN2).max(SUB_AGENT_TURN_GENERATION_STEPS_MAX2).optional().describe("The maximum number of steps to trigger the stop condition.")
|
|
2529
2841
|
}).openapi("StopWhen");
|
|
2530
2842
|
AgentStopWhenSchema = StopWhenSchema.pick({ transferCountIs: true }).openapi(
|
|
2531
2843
|
"AgentStopWhen"
|
|
@@ -2536,31 +2848,31 @@ var init_schemas = __esm({
|
|
|
2536
2848
|
MIN_ID_LENGTH = 1;
|
|
2537
2849
|
MAX_ID_LENGTH = 255;
|
|
2538
2850
|
URL_SAFE_ID_PATTERN = /^[a-zA-Z0-9\-_.]+$/;
|
|
2539
|
-
resourceIdSchema =
|
|
2851
|
+
resourceIdSchema = z5.string().min(MIN_ID_LENGTH).max(MAX_ID_LENGTH).describe("Resource identifier").regex(URL_SAFE_ID_PATTERN, {
|
|
2540
2852
|
message: "ID must contain only letters, numbers, hyphens, underscores, and dots"
|
|
2541
2853
|
}).openapi({
|
|
2542
2854
|
example: "resource_789"
|
|
2543
2855
|
});
|
|
2544
|
-
ModelSettingsSchema =
|
|
2545
|
-
model:
|
|
2546
|
-
providerOptions:
|
|
2856
|
+
ModelSettingsSchema = z5.object({
|
|
2857
|
+
model: z5.string().optional().describe("The model to use for the project."),
|
|
2858
|
+
providerOptions: z5.record(z5.string(), z5.any()).optional().describe("The provider options to use for the project.")
|
|
2547
2859
|
}).openapi("ModelSettings");
|
|
2548
|
-
ModelSchema =
|
|
2860
|
+
ModelSchema = z5.object({
|
|
2549
2861
|
base: ModelSettingsSchema.optional(),
|
|
2550
2862
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
2551
2863
|
summarizer: ModelSettingsSchema.optional()
|
|
2552
2864
|
}).openapi("Model");
|
|
2553
|
-
ProjectModelSchema =
|
|
2865
|
+
ProjectModelSchema = z5.object({
|
|
2554
2866
|
base: ModelSettingsSchema,
|
|
2555
2867
|
structuredOutput: ModelSettingsSchema.optional(),
|
|
2556
2868
|
summarizer: ModelSettingsSchema.optional()
|
|
2557
2869
|
}).openapi("ProjectModel");
|
|
2558
|
-
FunctionToolConfigSchema =
|
|
2559
|
-
name:
|
|
2560
|
-
description:
|
|
2561
|
-
inputSchema:
|
|
2562
|
-
dependencies:
|
|
2563
|
-
execute:
|
|
2870
|
+
FunctionToolConfigSchema = z5.object({
|
|
2871
|
+
name: z5.string(),
|
|
2872
|
+
description: z5.string(),
|
|
2873
|
+
inputSchema: z5.record(z5.string(), z5.unknown()),
|
|
2874
|
+
dependencies: z5.record(z5.string(), z5.string()).optional(),
|
|
2875
|
+
execute: z5.union([z5.function(), z5.string()])
|
|
2564
2876
|
});
|
|
2565
2877
|
createApiSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
2566
2878
|
createApiInsertSchema = (schema) => schema.omit({ tenantId: true, projectId: true });
|
|
@@ -2593,7 +2905,7 @@ var init_schemas = __esm({
|
|
|
2593
2905
|
SubAgentRelationApiInsertSchema = createAgentScopedApiInsertSchema(
|
|
2594
2906
|
SubAgentRelationInsertSchema
|
|
2595
2907
|
).extend({
|
|
2596
|
-
relationType:
|
|
2908
|
+
relationType: z5.enum(VALID_RELATION_TYPES)
|
|
2597
2909
|
}).refine(
|
|
2598
2910
|
(data) => {
|
|
2599
2911
|
const hasTarget = data.targetSubAgentId != null;
|
|
@@ -2610,7 +2922,7 @@ var init_schemas = __esm({
|
|
|
2610
2922
|
SubAgentRelationApiUpdateSchema = createAgentScopedApiUpdateSchema(
|
|
2611
2923
|
SubAgentRelationUpdateSchema
|
|
2612
2924
|
).extend({
|
|
2613
|
-
relationType:
|
|
2925
|
+
relationType: z5.enum(VALID_RELATION_TYPES).optional()
|
|
2614
2926
|
}).refine(
|
|
2615
2927
|
(data) => {
|
|
2616
2928
|
const hasTarget = data.targetSubAgentId != null;
|
|
@@ -2627,11 +2939,11 @@ var init_schemas = __esm({
|
|
|
2627
2939
|
path: ["targetSubAgentId", "externalSubAgentId", "teamSubAgentId"]
|
|
2628
2940
|
}
|
|
2629
2941
|
).openapi("SubAgentRelationUpdate");
|
|
2630
|
-
SubAgentRelationQuerySchema =
|
|
2631
|
-
sourceSubAgentId:
|
|
2632
|
-
targetSubAgentId:
|
|
2633
|
-
externalSubAgentId:
|
|
2634
|
-
teamSubAgentId:
|
|
2942
|
+
SubAgentRelationQuerySchema = z5.object({
|
|
2943
|
+
sourceSubAgentId: z5.string().optional(),
|
|
2944
|
+
targetSubAgentId: z5.string().optional(),
|
|
2945
|
+
externalSubAgentId: z5.string().optional(),
|
|
2946
|
+
teamSubAgentId: z5.string().optional()
|
|
2635
2947
|
});
|
|
2636
2948
|
ExternalSubAgentRelationInsertSchema = createInsertSchema(subAgentRelations).extend({
|
|
2637
2949
|
id: resourceIdSchema,
|
|
@@ -2671,7 +2983,7 @@ var init_schemas = __esm({
|
|
|
2671
2983
|
TaskRelationApiSelectSchema = createApiSchema(TaskRelationSelectSchema);
|
|
2672
2984
|
TaskRelationApiInsertSchema = createApiInsertSchema(TaskRelationInsertSchema);
|
|
2673
2985
|
TaskRelationApiUpdateSchema = createApiUpdateSchema(TaskRelationUpdateSchema);
|
|
2674
|
-
imageUrlSchema =
|
|
2986
|
+
imageUrlSchema = z5.string().optional().refine(
|
|
2675
2987
|
(url) => {
|
|
2676
2988
|
if (!url) return true;
|
|
2677
2989
|
if (url.startsWith("data:image/")) {
|
|
@@ -2690,43 +3002,43 @@ var init_schemas = __esm({
|
|
|
2690
3002
|
message: "Image URL must be a valid HTTP(S) URL or a base64 data URL (max 1MB)"
|
|
2691
3003
|
}
|
|
2692
3004
|
);
|
|
2693
|
-
McpTransportConfigSchema =
|
|
2694
|
-
type:
|
|
2695
|
-
requestInit:
|
|
2696
|
-
eventSourceInit:
|
|
2697
|
-
reconnectionOptions:
|
|
3005
|
+
McpTransportConfigSchema = z5.object({
|
|
3006
|
+
type: z5.enum(MCPTransportType),
|
|
3007
|
+
requestInit: z5.record(z5.string(), z5.unknown()).optional(),
|
|
3008
|
+
eventSourceInit: z5.record(z5.string(), z5.unknown()).optional(),
|
|
3009
|
+
reconnectionOptions: z5.any().optional().openapi({
|
|
2698
3010
|
type: "object",
|
|
2699
3011
|
description: "Reconnection options for streamable HTTP transport"
|
|
2700
3012
|
}),
|
|
2701
|
-
sessionId:
|
|
3013
|
+
sessionId: z5.string().optional()
|
|
2702
3014
|
}).openapi("McpTransportConfig");
|
|
2703
|
-
ToolStatusSchema =
|
|
2704
|
-
McpToolDefinitionSchema =
|
|
2705
|
-
name:
|
|
2706
|
-
description:
|
|
2707
|
-
inputSchema:
|
|
3015
|
+
ToolStatusSchema = z5.enum(TOOL_STATUS_VALUES);
|
|
3016
|
+
McpToolDefinitionSchema = z5.object({
|
|
3017
|
+
name: z5.string(),
|
|
3018
|
+
description: z5.string().optional(),
|
|
3019
|
+
inputSchema: z5.record(z5.string(), z5.unknown()).optional()
|
|
2708
3020
|
});
|
|
2709
3021
|
ToolSelectSchema = createSelectSchema(tools);
|
|
2710
3022
|
ToolInsertSchema = createInsertSchema(tools).extend({
|
|
2711
3023
|
id: resourceIdSchema,
|
|
2712
3024
|
imageUrl: imageUrlSchema,
|
|
2713
|
-
config:
|
|
2714
|
-
type:
|
|
2715
|
-
mcp:
|
|
2716
|
-
server:
|
|
2717
|
-
url:
|
|
3025
|
+
config: z5.object({
|
|
3026
|
+
type: z5.literal("mcp"),
|
|
3027
|
+
mcp: z5.object({
|
|
3028
|
+
server: z5.object({
|
|
3029
|
+
url: z5.url()
|
|
2718
3030
|
}),
|
|
2719
|
-
transport:
|
|
2720
|
-
type:
|
|
2721
|
-
requestInit:
|
|
2722
|
-
eventSourceInit:
|
|
2723
|
-
reconnectionOptions:
|
|
3031
|
+
transport: z5.object({
|
|
3032
|
+
type: z5.enum(MCPTransportType),
|
|
3033
|
+
requestInit: z5.record(z5.string(), z5.unknown()).optional(),
|
|
3034
|
+
eventSourceInit: z5.record(z5.string(), z5.unknown()).optional(),
|
|
3035
|
+
reconnectionOptions: z5.any().optional().openapi({
|
|
2724
3036
|
type: "object",
|
|
2725
3037
|
description: "Reconnection options for streamable HTTP transport"
|
|
2726
3038
|
}),
|
|
2727
|
-
sessionId:
|
|
3039
|
+
sessionId: z5.string().optional()
|
|
2728
3040
|
}).optional(),
|
|
2729
|
-
activeTools:
|
|
3041
|
+
activeTools: z5.array(z5.string()).optional()
|
|
2730
3042
|
})
|
|
2731
3043
|
})
|
|
2732
3044
|
});
|
|
@@ -2821,7 +3133,7 @@ var init_schemas = __esm({
|
|
|
2821
3133
|
SubAgentArtifactComponentUpdateSchema
|
|
2822
3134
|
);
|
|
2823
3135
|
ExternalAgentSelectSchema = createSelectSchema(externalAgents).extend({
|
|
2824
|
-
credentialReferenceId:
|
|
3136
|
+
credentialReferenceId: z5.string().nullable().optional()
|
|
2825
3137
|
});
|
|
2826
3138
|
ExternalAgentInsertSchema = createInsertSchema(externalAgents).extend({
|
|
2827
3139
|
id: resourceIdSchema
|
|
@@ -2830,9 +3142,9 @@ var init_schemas = __esm({
|
|
|
2830
3142
|
ExternalAgentApiSelectSchema = createApiSchema(ExternalAgentSelectSchema).openapi("ExternalAgent");
|
|
2831
3143
|
ExternalAgentApiInsertSchema = createApiInsertSchema(ExternalAgentInsertSchema).openapi("ExternalAgentCreate");
|
|
2832
3144
|
ExternalAgentApiUpdateSchema = createApiUpdateSchema(ExternalAgentUpdateSchema).openapi("ExternalAgentUpdate");
|
|
2833
|
-
AllAgentSchema =
|
|
2834
|
-
SubAgentApiSelectSchema.extend({ type:
|
|
2835
|
-
ExternalAgentApiSelectSchema.extend({ type:
|
|
3145
|
+
AllAgentSchema = z5.discriminatedUnion("type", [
|
|
3146
|
+
SubAgentApiSelectSchema.extend({ type: z5.literal("internal") }),
|
|
3147
|
+
ExternalAgentApiSelectSchema.extend({ type: z5.literal("external") })
|
|
2836
3148
|
]);
|
|
2837
3149
|
ApiKeySelectSchema = createSelectSchema(apiKeys);
|
|
2838
3150
|
ApiKeyInsertSchema = createInsertSchema(apiKeys).extend({
|
|
@@ -2854,10 +3166,10 @@ var init_schemas = __esm({
|
|
|
2854
3166
|
keyHash: true
|
|
2855
3167
|
// Never expose the hash
|
|
2856
3168
|
}).openapi("ApiKey");
|
|
2857
|
-
ApiKeyApiCreationResponseSchema =
|
|
2858
|
-
data:
|
|
3169
|
+
ApiKeyApiCreationResponseSchema = z5.object({
|
|
3170
|
+
data: z5.object({
|
|
2859
3171
|
apiKey: ApiKeyApiSelectSchema,
|
|
2860
|
-
key:
|
|
3172
|
+
key: z5.string().describe("The full API key (shown only once)")
|
|
2861
3173
|
})
|
|
2862
3174
|
});
|
|
2863
3175
|
ApiKeyApiInsertSchema = ApiKeyInsertSchema.omit({
|
|
@@ -2875,88 +3187,88 @@ var init_schemas = __esm({
|
|
|
2875
3187
|
// Not set on creation
|
|
2876
3188
|
}).openapi("ApiKeyCreate");
|
|
2877
3189
|
ApiKeyApiUpdateSchema = ApiKeyUpdateSchema.openapi("ApiKeyUpdate");
|
|
2878
|
-
CredentialReferenceSelectSchema =
|
|
2879
|
-
id:
|
|
2880
|
-
tenantId:
|
|
2881
|
-
projectId:
|
|
2882
|
-
name:
|
|
2883
|
-
type:
|
|
2884
|
-
credentialStoreId:
|
|
2885
|
-
retrievalParams:
|
|
2886
|
-
createdAt:
|
|
2887
|
-
updatedAt:
|
|
3190
|
+
CredentialReferenceSelectSchema = z5.object({
|
|
3191
|
+
id: z5.string(),
|
|
3192
|
+
tenantId: z5.string(),
|
|
3193
|
+
projectId: z5.string(),
|
|
3194
|
+
name: z5.string(),
|
|
3195
|
+
type: z5.string(),
|
|
3196
|
+
credentialStoreId: z5.string(),
|
|
3197
|
+
retrievalParams: z5.record(z5.string(), z5.unknown()).nullish(),
|
|
3198
|
+
createdAt: z5.string(),
|
|
3199
|
+
updatedAt: z5.string()
|
|
2888
3200
|
});
|
|
2889
3201
|
CredentialReferenceInsertSchema = createInsertSchema(credentialReferences).extend({
|
|
2890
3202
|
id: resourceIdSchema,
|
|
2891
|
-
type:
|
|
3203
|
+
type: z5.string(),
|
|
2892
3204
|
credentialStoreId: resourceIdSchema,
|
|
2893
|
-
retrievalParams:
|
|
3205
|
+
retrievalParams: z5.record(z5.string(), z5.unknown()).nullish()
|
|
2894
3206
|
});
|
|
2895
3207
|
CredentialReferenceUpdateSchema = CredentialReferenceInsertSchema.partial();
|
|
2896
3208
|
CredentialReferenceApiSelectSchema = createApiSchema(CredentialReferenceSelectSchema).extend({
|
|
2897
|
-
type:
|
|
2898
|
-
tools:
|
|
2899
|
-
externalAgents:
|
|
3209
|
+
type: z5.enum(CredentialStoreType),
|
|
3210
|
+
tools: z5.array(ToolSelectSchema).optional(),
|
|
3211
|
+
externalAgents: z5.array(ExternalAgentSelectSchema).optional()
|
|
2900
3212
|
}).openapi("CredentialReference");
|
|
2901
3213
|
CredentialReferenceApiInsertSchema = createApiInsertSchema(
|
|
2902
3214
|
CredentialReferenceInsertSchema
|
|
2903
3215
|
).extend({
|
|
2904
|
-
type:
|
|
3216
|
+
type: z5.enum(CredentialStoreType)
|
|
2905
3217
|
}).openapi("CredentialReferenceCreate");
|
|
2906
3218
|
CredentialReferenceApiUpdateSchema = createApiUpdateSchema(
|
|
2907
3219
|
CredentialReferenceUpdateSchema
|
|
2908
3220
|
).extend({
|
|
2909
|
-
type:
|
|
3221
|
+
type: z5.enum(CredentialStoreType).optional()
|
|
2910
3222
|
}).openapi("CredentialReferenceUpdate");
|
|
2911
|
-
CredentialStoreSchema =
|
|
2912
|
-
id:
|
|
2913
|
-
type:
|
|
2914
|
-
available:
|
|
2915
|
-
reason:
|
|
3223
|
+
CredentialStoreSchema = z5.object({
|
|
3224
|
+
id: z5.string().describe("Unique identifier of the credential store"),
|
|
3225
|
+
type: z5.enum(CredentialStoreType),
|
|
3226
|
+
available: z5.boolean().describe("Whether the store is functional and ready to use"),
|
|
3227
|
+
reason: z5.string().nullable().describe("Reason why store is not available, if applicable")
|
|
2916
3228
|
}).openapi("CredentialStore");
|
|
2917
|
-
CredentialStoreListResponseSchema =
|
|
2918
|
-
data:
|
|
3229
|
+
CredentialStoreListResponseSchema = z5.object({
|
|
3230
|
+
data: z5.array(CredentialStoreSchema).describe("List of credential stores")
|
|
2919
3231
|
}).openapi("CredentialStoreListResponse");
|
|
2920
|
-
CreateCredentialInStoreRequestSchema =
|
|
2921
|
-
key:
|
|
2922
|
-
value:
|
|
2923
|
-
metadata:
|
|
3232
|
+
CreateCredentialInStoreRequestSchema = z5.object({
|
|
3233
|
+
key: z5.string().describe("The credential key"),
|
|
3234
|
+
value: z5.string().describe("The credential value"),
|
|
3235
|
+
metadata: z5.record(z5.string(), z5.string()).nullish().describe("The metadata for the credential")
|
|
2924
3236
|
}).openapi("CreateCredentialInStoreRequest");
|
|
2925
|
-
CreateCredentialInStoreResponseSchema =
|
|
2926
|
-
data:
|
|
2927
|
-
key:
|
|
2928
|
-
storeId:
|
|
2929
|
-
createdAt:
|
|
3237
|
+
CreateCredentialInStoreResponseSchema = z5.object({
|
|
3238
|
+
data: z5.object({
|
|
3239
|
+
key: z5.string().describe("The credential key"),
|
|
3240
|
+
storeId: z5.string().describe("The store ID where credential was created"),
|
|
3241
|
+
createdAt: z5.string().describe("ISO timestamp of creation")
|
|
2930
3242
|
})
|
|
2931
3243
|
}).openapi("CreateCredentialInStoreResponse");
|
|
2932
|
-
RelatedAgentInfoSchema =
|
|
2933
|
-
id:
|
|
2934
|
-
name:
|
|
2935
|
-
description:
|
|
3244
|
+
RelatedAgentInfoSchema = z5.object({
|
|
3245
|
+
id: z5.string(),
|
|
3246
|
+
name: z5.string(),
|
|
3247
|
+
description: z5.string()
|
|
2936
3248
|
}).openapi("RelatedAgentInfo");
|
|
2937
|
-
ComponentAssociationSchema =
|
|
2938
|
-
subAgentId:
|
|
2939
|
-
createdAt:
|
|
3249
|
+
ComponentAssociationSchema = z5.object({
|
|
3250
|
+
subAgentId: z5.string(),
|
|
3251
|
+
createdAt: z5.string()
|
|
2940
3252
|
}).openapi("ComponentAssociation");
|
|
2941
|
-
OAuthLoginQuerySchema =
|
|
2942
|
-
tenantId:
|
|
2943
|
-
projectId:
|
|
2944
|
-
toolId:
|
|
3253
|
+
OAuthLoginQuerySchema = z5.object({
|
|
3254
|
+
tenantId: z5.string().min(1, "Tenant ID is required"),
|
|
3255
|
+
projectId: z5.string().min(1, "Project ID is required"),
|
|
3256
|
+
toolId: z5.string().min(1, "Tool ID is required")
|
|
2945
3257
|
}).openapi("OAuthLoginQuery");
|
|
2946
|
-
OAuthCallbackQuerySchema =
|
|
2947
|
-
code:
|
|
2948
|
-
state:
|
|
2949
|
-
error:
|
|
2950
|
-
error_description:
|
|
3258
|
+
OAuthCallbackQuerySchema = z5.object({
|
|
3259
|
+
code: z5.string().min(1, "Authorization code is required"),
|
|
3260
|
+
state: z5.string().min(1, "State parameter is required"),
|
|
3261
|
+
error: z5.string().optional(),
|
|
3262
|
+
error_description: z5.string().optional()
|
|
2951
3263
|
}).openapi("OAuthCallbackQuery");
|
|
2952
3264
|
McpToolSchema = ToolInsertSchema.extend({
|
|
2953
3265
|
imageUrl: imageUrlSchema,
|
|
2954
|
-
availableTools:
|
|
3266
|
+
availableTools: z5.array(McpToolDefinitionSchema).optional(),
|
|
2955
3267
|
status: ToolStatusSchema.default("unknown"),
|
|
2956
|
-
version:
|
|
2957
|
-
createdAt:
|
|
2958
|
-
updatedAt:
|
|
2959
|
-
expiresAt:
|
|
3268
|
+
version: z5.string().optional(),
|
|
3269
|
+
createdAt: z5.date(),
|
|
3270
|
+
updatedAt: z5.date(),
|
|
3271
|
+
expiresAt: z5.date().optional()
|
|
2960
3272
|
});
|
|
2961
3273
|
MCPToolConfigSchema = McpToolSchema.omit({
|
|
2962
3274
|
config: true,
|
|
@@ -2968,12 +3280,12 @@ var init_schemas = __esm({
|
|
|
2968
3280
|
updatedAt: true,
|
|
2969
3281
|
credentialReferenceId: true
|
|
2970
3282
|
}).extend({
|
|
2971
|
-
tenantId:
|
|
2972
|
-
projectId:
|
|
2973
|
-
description:
|
|
2974
|
-
serverUrl:
|
|
2975
|
-
activeTools:
|
|
2976
|
-
mcpType:
|
|
3283
|
+
tenantId: z5.string().optional(),
|
|
3284
|
+
projectId: z5.string().optional(),
|
|
3285
|
+
description: z5.string().optional(),
|
|
3286
|
+
serverUrl: z5.url(),
|
|
3287
|
+
activeTools: z5.array(z5.string()).optional(),
|
|
3288
|
+
mcpType: z5.enum(MCPServerType).optional(),
|
|
2977
3289
|
transport: McpTransportConfigSchema.optional(),
|
|
2978
3290
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
2979
3291
|
});
|
|
@@ -2997,40 +3309,40 @@ var init_schemas = __esm({
|
|
|
2997
3309
|
FunctionApiSelectSchema = createApiSchema(FunctionSelectSchema).openapi("Function");
|
|
2998
3310
|
FunctionApiInsertSchema = createApiInsertSchema(FunctionInsertSchema).openapi("FunctionCreate");
|
|
2999
3311
|
FunctionApiUpdateSchema = createApiUpdateSchema(FunctionUpdateSchema).openapi("FunctionUpdate");
|
|
3000
|
-
FetchConfigSchema =
|
|
3001
|
-
url:
|
|
3002
|
-
method:
|
|
3003
|
-
headers:
|
|
3004
|
-
body:
|
|
3005
|
-
transform:
|
|
3312
|
+
FetchConfigSchema = z5.object({
|
|
3313
|
+
url: z5.string().min(1, "URL is required"),
|
|
3314
|
+
method: z5.enum(["GET", "POST", "PUT", "DELETE", "PATCH"]).optional().default("GET"),
|
|
3315
|
+
headers: z5.record(z5.string(), z5.string()).optional(),
|
|
3316
|
+
body: z5.record(z5.string(), z5.unknown()).optional(),
|
|
3317
|
+
transform: z5.string().optional(),
|
|
3006
3318
|
// JSONPath or JS transform function
|
|
3007
|
-
timeout:
|
|
3319
|
+
timeout: z5.number().min(0).optional().default(CONTEXT_FETCHER_HTTP_TIMEOUT_MS_DEFAULT2).optional()
|
|
3008
3320
|
}).openapi("FetchConfig");
|
|
3009
|
-
FetchDefinitionSchema =
|
|
3010
|
-
id:
|
|
3011
|
-
name:
|
|
3012
|
-
trigger:
|
|
3321
|
+
FetchDefinitionSchema = z5.object({
|
|
3322
|
+
id: z5.string().min(1, "Fetch definition ID is required"),
|
|
3323
|
+
name: z5.string().optional(),
|
|
3324
|
+
trigger: z5.enum(["initialization", "invocation"]),
|
|
3013
3325
|
fetchConfig: FetchConfigSchema,
|
|
3014
|
-
responseSchema:
|
|
3326
|
+
responseSchema: z5.any().optional(),
|
|
3015
3327
|
// JSON Schema for validating HTTP response
|
|
3016
|
-
defaultValue:
|
|
3328
|
+
defaultValue: z5.any().optional().openapi({
|
|
3017
3329
|
description: "Default value if fetch fails"
|
|
3018
3330
|
}),
|
|
3019
3331
|
credential: CredentialReferenceApiInsertSchema.optional()
|
|
3020
3332
|
}).openapi("FetchDefinition");
|
|
3021
3333
|
ContextConfigSelectSchema = createSelectSchema(contextConfigs).extend({
|
|
3022
|
-
headersSchema:
|
|
3334
|
+
headersSchema: z5.any().optional().openapi({
|
|
3023
3335
|
type: "object",
|
|
3024
3336
|
description: "JSON Schema for validating request headers"
|
|
3025
3337
|
})
|
|
3026
3338
|
});
|
|
3027
3339
|
ContextConfigInsertSchema = createInsertSchema(contextConfigs).extend({
|
|
3028
3340
|
id: resourceIdSchema.optional(),
|
|
3029
|
-
headersSchema:
|
|
3341
|
+
headersSchema: z5.any().nullable().optional().openapi({
|
|
3030
3342
|
type: "object",
|
|
3031
3343
|
description: "JSON Schema for validating request headers"
|
|
3032
3344
|
}),
|
|
3033
|
-
contextVariables:
|
|
3345
|
+
contextVariables: z5.any().nullable().optional().openapi({
|
|
3034
3346
|
type: "object",
|
|
3035
3347
|
description: "Context variables configuration with fetch definitions"
|
|
3036
3348
|
})
|
|
@@ -3053,8 +3365,8 @@ var init_schemas = __esm({
|
|
|
3053
3365
|
id: resourceIdSchema,
|
|
3054
3366
|
subAgentId: resourceIdSchema,
|
|
3055
3367
|
toolId: resourceIdSchema,
|
|
3056
|
-
selectedTools:
|
|
3057
|
-
headers:
|
|
3368
|
+
selectedTools: z5.array(z5.string()).nullish(),
|
|
3369
|
+
headers: z5.record(z5.string(), z5.string()).nullish()
|
|
3058
3370
|
});
|
|
3059
3371
|
SubAgentToolRelationUpdateSchema = SubAgentToolRelationInsertSchema.partial();
|
|
3060
3372
|
SubAgentToolRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -3075,7 +3387,7 @@ var init_schemas = __esm({
|
|
|
3075
3387
|
id: resourceIdSchema,
|
|
3076
3388
|
subAgentId: resourceIdSchema,
|
|
3077
3389
|
externalAgentId: resourceIdSchema,
|
|
3078
|
-
headers:
|
|
3390
|
+
headers: z5.record(z5.string(), z5.string()).nullish()
|
|
3079
3391
|
});
|
|
3080
3392
|
SubAgentExternalAgentRelationUpdateSchema = SubAgentExternalAgentRelationInsertSchema.partial();
|
|
3081
3393
|
SubAgentExternalAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -3094,7 +3406,7 @@ var init_schemas = __esm({
|
|
|
3094
3406
|
id: resourceIdSchema,
|
|
3095
3407
|
subAgentId: resourceIdSchema,
|
|
3096
3408
|
targetAgentId: resourceIdSchema,
|
|
3097
|
-
headers:
|
|
3409
|
+
headers: z5.record(z5.string(), z5.string()).nullish()
|
|
3098
3410
|
});
|
|
3099
3411
|
SubAgentTeamAgentRelationUpdateSchema = SubAgentTeamAgentRelationInsertSchema.partial();
|
|
3100
3412
|
SubAgentTeamAgentRelationApiSelectSchema = createAgentScopedApiSchema(
|
|
@@ -3112,53 +3424,56 @@ var init_schemas = __esm({
|
|
|
3112
3424
|
LedgerArtifactApiSelectSchema = createApiSchema(LedgerArtifactSelectSchema);
|
|
3113
3425
|
LedgerArtifactApiInsertSchema = createApiInsertSchema(LedgerArtifactInsertSchema);
|
|
3114
3426
|
LedgerArtifactApiUpdateSchema = createApiUpdateSchema(LedgerArtifactUpdateSchema);
|
|
3115
|
-
StatusComponentSchema =
|
|
3116
|
-
type:
|
|
3117
|
-
description:
|
|
3118
|
-
detailsSchema:
|
|
3119
|
-
type:
|
|
3120
|
-
properties:
|
|
3121
|
-
required:
|
|
3427
|
+
StatusComponentSchema = z5.object({
|
|
3428
|
+
type: z5.string(),
|
|
3429
|
+
description: z5.string().optional(),
|
|
3430
|
+
detailsSchema: z5.object({
|
|
3431
|
+
type: z5.literal("object"),
|
|
3432
|
+
properties: z5.record(z5.string(), z5.any()),
|
|
3433
|
+
required: z5.array(z5.string()).optional()
|
|
3122
3434
|
}).optional()
|
|
3123
3435
|
}).openapi("StatusComponent");
|
|
3124
|
-
StatusUpdateSchema =
|
|
3125
|
-
enabled:
|
|
3126
|
-
numEvents:
|
|
3127
|
-
timeInSeconds:
|
|
3128
|
-
prompt:
|
|
3129
|
-
|
|
3436
|
+
StatusUpdateSchema = z5.object({
|
|
3437
|
+
enabled: z5.boolean().optional(),
|
|
3438
|
+
numEvents: z5.number().min(1).max(STATUS_UPDATE_MAX_NUM_EVENTS2).optional(),
|
|
3439
|
+
timeInSeconds: z5.number().min(1).max(STATUS_UPDATE_MAX_INTERVAL_SECONDS2).optional(),
|
|
3440
|
+
prompt: z5.string().max(
|
|
3441
|
+
VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2,
|
|
3442
|
+
`Custom prompt cannot exceed ${VALIDATION_SUB_AGENT_PROMPT_MAX_CHARS2} characters`
|
|
3443
|
+
).optional(),
|
|
3444
|
+
statusComponents: z5.array(StatusComponentSchema).optional()
|
|
3130
3445
|
}).openapi("StatusUpdate");
|
|
3131
|
-
CanUseItemSchema =
|
|
3132
|
-
agentToolRelationId:
|
|
3133
|
-
toolId:
|
|
3134
|
-
toolSelection:
|
|
3135
|
-
headers:
|
|
3446
|
+
CanUseItemSchema = z5.object({
|
|
3447
|
+
agentToolRelationId: z5.string().optional(),
|
|
3448
|
+
toolId: z5.string(),
|
|
3449
|
+
toolSelection: z5.array(z5.string()).nullish(),
|
|
3450
|
+
headers: z5.record(z5.string(), z5.string()).nullish()
|
|
3136
3451
|
}).openapi("CanUseItem");
|
|
3137
|
-
canDelegateToExternalAgentSchema =
|
|
3138
|
-
externalAgentId:
|
|
3139
|
-
subAgentExternalAgentRelationId:
|
|
3140
|
-
headers:
|
|
3452
|
+
canDelegateToExternalAgentSchema = z5.object({
|
|
3453
|
+
externalAgentId: z5.string(),
|
|
3454
|
+
subAgentExternalAgentRelationId: z5.string().optional(),
|
|
3455
|
+
headers: z5.record(z5.string(), z5.string()).nullish()
|
|
3141
3456
|
});
|
|
3142
|
-
canDelegateToTeamAgentSchema =
|
|
3143
|
-
agentId:
|
|
3144
|
-
subAgentTeamAgentRelationId:
|
|
3145
|
-
headers:
|
|
3457
|
+
canDelegateToTeamAgentSchema = z5.object({
|
|
3458
|
+
agentId: z5.string(),
|
|
3459
|
+
subAgentTeamAgentRelationId: z5.string().optional(),
|
|
3460
|
+
headers: z5.record(z5.string(), z5.string()).nullish()
|
|
3146
3461
|
});
|
|
3147
|
-
TeamAgentSchema =
|
|
3148
|
-
id:
|
|
3149
|
-
name:
|
|
3150
|
-
description:
|
|
3462
|
+
TeamAgentSchema = z5.object({
|
|
3463
|
+
id: z5.string(),
|
|
3464
|
+
name: z5.string(),
|
|
3465
|
+
description: z5.string()
|
|
3151
3466
|
});
|
|
3152
3467
|
FullAgentAgentInsertSchema = SubAgentApiInsertSchema.extend({
|
|
3153
|
-
type:
|
|
3154
|
-
canUse:
|
|
3468
|
+
type: z5.literal("internal"),
|
|
3469
|
+
canUse: z5.array(CanUseItemSchema),
|
|
3155
3470
|
// All tools (both MCP and function tools)
|
|
3156
|
-
dataComponents:
|
|
3157
|
-
artifactComponents:
|
|
3158
|
-
canTransferTo:
|
|
3159
|
-
canDelegateTo:
|
|
3160
|
-
|
|
3161
|
-
|
|
3471
|
+
dataComponents: z5.array(z5.string()).optional(),
|
|
3472
|
+
artifactComponents: z5.array(z5.string()).optional(),
|
|
3473
|
+
canTransferTo: z5.array(z5.string()).optional(),
|
|
3474
|
+
canDelegateTo: z5.array(
|
|
3475
|
+
z5.union([
|
|
3476
|
+
z5.string(),
|
|
3162
3477
|
// Internal subAgent ID
|
|
3163
3478
|
canDelegateToExternalAgentSchema,
|
|
3164
3479
|
// External agent with headers
|
|
@@ -3168,43 +3483,46 @@ var init_schemas = __esm({
|
|
|
3168
3483
|
).optional()
|
|
3169
3484
|
});
|
|
3170
3485
|
AgentWithinContextOfProjectSchema = AgentApiInsertSchema.extend({
|
|
3171
|
-
subAgents:
|
|
3486
|
+
subAgents: z5.record(z5.string(), FullAgentAgentInsertSchema),
|
|
3172
3487
|
// Lookup maps for UI to resolve canUse items
|
|
3173
|
-
tools:
|
|
3488
|
+
tools: z5.record(z5.string(), ToolApiInsertSchema).optional(),
|
|
3174
3489
|
// MCP tools (project-scoped)
|
|
3175
|
-
externalAgents:
|
|
3490
|
+
externalAgents: z5.record(z5.string(), ExternalAgentApiInsertSchema).optional(),
|
|
3176
3491
|
// External agents (project-scoped)
|
|
3177
|
-
teamAgents:
|
|
3492
|
+
teamAgents: z5.record(z5.string(), TeamAgentSchema).optional(),
|
|
3178
3493
|
// Team agents contain basic metadata for the agent to be delegated to
|
|
3179
|
-
functionTools:
|
|
3494
|
+
functionTools: z5.record(z5.string(), FunctionToolApiInsertSchema).optional(),
|
|
3180
3495
|
// Function tools (agent-scoped)
|
|
3181
|
-
functions:
|
|
3496
|
+
functions: z5.record(z5.string(), FunctionApiInsertSchema).optional(),
|
|
3182
3497
|
// Get function code for function tools
|
|
3183
|
-
contextConfig:
|
|
3184
|
-
statusUpdates:
|
|
3498
|
+
contextConfig: z5.optional(ContextConfigApiInsertSchema),
|
|
3499
|
+
statusUpdates: z5.optional(StatusUpdateSchema),
|
|
3185
3500
|
models: ModelSchema.optional(),
|
|
3186
3501
|
stopWhen: AgentStopWhenSchema.optional(),
|
|
3187
|
-
prompt:
|
|
3502
|
+
prompt: z5.string().max(
|
|
3503
|
+
VALIDATION_AGENT_PROMPT_MAX_CHARS2,
|
|
3504
|
+
`Agent prompt cannot exceed ${VALIDATION_AGENT_PROMPT_MAX_CHARS2} characters`
|
|
3505
|
+
).optional()
|
|
3188
3506
|
});
|
|
3189
|
-
PaginationSchema =
|
|
3190
|
-
page:
|
|
3191
|
-
limit:
|
|
3192
|
-
total:
|
|
3193
|
-
pages:
|
|
3507
|
+
PaginationSchema = z5.object({
|
|
3508
|
+
page: z5.coerce.number().min(1).default(1),
|
|
3509
|
+
limit: z5.coerce.number().min(1).max(100).default(10),
|
|
3510
|
+
total: z5.number(),
|
|
3511
|
+
pages: z5.number()
|
|
3194
3512
|
}).openapi("Pagination");
|
|
3195
|
-
ErrorResponseSchema =
|
|
3196
|
-
error:
|
|
3197
|
-
message:
|
|
3198
|
-
details:
|
|
3513
|
+
ErrorResponseSchema = z5.object({
|
|
3514
|
+
error: z5.string(),
|
|
3515
|
+
message: z5.string().optional(),
|
|
3516
|
+
details: z5.any().optional().openapi({
|
|
3199
3517
|
description: "Additional error details"
|
|
3200
3518
|
})
|
|
3201
3519
|
}).openapi("ErrorResponse");
|
|
3202
|
-
ExistsResponseSchema =
|
|
3203
|
-
exists:
|
|
3520
|
+
ExistsResponseSchema = z5.object({
|
|
3521
|
+
exists: z5.boolean()
|
|
3204
3522
|
}).openapi("ExistsResponse");
|
|
3205
|
-
RemovedResponseSchema =
|
|
3206
|
-
message:
|
|
3207
|
-
removed:
|
|
3523
|
+
RemovedResponseSchema = z5.object({
|
|
3524
|
+
message: z5.string(),
|
|
3525
|
+
removed: z5.boolean()
|
|
3208
3526
|
}).openapi("RemovedResponse");
|
|
3209
3527
|
ProjectSelectSchema = createSelectSchema(projects);
|
|
3210
3528
|
ProjectInsertSchema = createInsertSchema(projects).extend({
|
|
@@ -3225,139 +3543,139 @@ var init_schemas = __esm({
|
|
|
3225
3543
|
"ProjectUpdate"
|
|
3226
3544
|
);
|
|
3227
3545
|
FullProjectDefinitionSchema = ProjectApiInsertSchema.extend({
|
|
3228
|
-
agents:
|
|
3229
|
-
tools:
|
|
3230
|
-
functionTools:
|
|
3231
|
-
functions:
|
|
3232
|
-
dataComponents:
|
|
3233
|
-
artifactComponents:
|
|
3234
|
-
externalAgents:
|
|
3235
|
-
statusUpdates:
|
|
3236
|
-
credentialReferences:
|
|
3237
|
-
createdAt:
|
|
3238
|
-
updatedAt:
|
|
3546
|
+
agents: z5.record(z5.string(), AgentWithinContextOfProjectSchema),
|
|
3547
|
+
tools: z5.record(z5.string(), ToolApiInsertSchema),
|
|
3548
|
+
functionTools: z5.record(z5.string(), FunctionToolApiInsertSchema).optional(),
|
|
3549
|
+
functions: z5.record(z5.string(), FunctionApiInsertSchema).optional(),
|
|
3550
|
+
dataComponents: z5.record(z5.string(), DataComponentApiInsertSchema).optional(),
|
|
3551
|
+
artifactComponents: z5.record(z5.string(), ArtifactComponentApiInsertSchema).optional(),
|
|
3552
|
+
externalAgents: z5.record(z5.string(), ExternalAgentApiInsertSchema).optional(),
|
|
3553
|
+
statusUpdates: z5.optional(StatusUpdateSchema),
|
|
3554
|
+
credentialReferences: z5.record(z5.string(), CredentialReferenceApiInsertSchema).optional(),
|
|
3555
|
+
createdAt: z5.string().optional(),
|
|
3556
|
+
updatedAt: z5.string().optional()
|
|
3239
3557
|
});
|
|
3240
|
-
ProjectResponse =
|
|
3241
|
-
SubAgentResponse =
|
|
3242
|
-
AgentResponse =
|
|
3243
|
-
ToolResponse =
|
|
3244
|
-
ExternalAgentResponse =
|
|
3245
|
-
ContextConfigResponse =
|
|
3246
|
-
ApiKeyResponse =
|
|
3247
|
-
CredentialReferenceResponse =
|
|
3248
|
-
FunctionResponse =
|
|
3249
|
-
FunctionToolResponse =
|
|
3250
|
-
DataComponentResponse =
|
|
3251
|
-
ArtifactComponentResponse =
|
|
3252
|
-
SubAgentRelationResponse =
|
|
3253
|
-
SubAgentToolRelationResponse =
|
|
3254
|
-
ConversationResponse =
|
|
3255
|
-
MessageResponse =
|
|
3256
|
-
ProjectListResponse =
|
|
3257
|
-
data:
|
|
3558
|
+
ProjectResponse = z5.object({ data: ProjectApiSelectSchema }).openapi("ProjectResponse");
|
|
3559
|
+
SubAgentResponse = z5.object({ data: SubAgentApiSelectSchema }).openapi("SubAgentResponse");
|
|
3560
|
+
AgentResponse = z5.object({ data: AgentApiSelectSchema }).openapi("AgentResponse");
|
|
3561
|
+
ToolResponse = z5.object({ data: ToolApiSelectSchema }).openapi("ToolResponse");
|
|
3562
|
+
ExternalAgentResponse = z5.object({ data: ExternalAgentApiSelectSchema }).openapi("ExternalAgentResponse");
|
|
3563
|
+
ContextConfigResponse = z5.object({ data: ContextConfigApiSelectSchema }).openapi("ContextConfigResponse");
|
|
3564
|
+
ApiKeyResponse = z5.object({ data: ApiKeyApiSelectSchema }).openapi("ApiKeyResponse");
|
|
3565
|
+
CredentialReferenceResponse = z5.object({ data: CredentialReferenceApiSelectSchema }).openapi("CredentialReferenceResponse");
|
|
3566
|
+
FunctionResponse = z5.object({ data: FunctionApiSelectSchema }).openapi("FunctionResponse");
|
|
3567
|
+
FunctionToolResponse = z5.object({ data: FunctionToolApiSelectSchema }).openapi("FunctionToolResponse");
|
|
3568
|
+
DataComponentResponse = z5.object({ data: DataComponentApiSelectSchema }).openapi("DataComponentResponse");
|
|
3569
|
+
ArtifactComponentResponse = z5.object({ data: ArtifactComponentApiSelectSchema }).openapi("ArtifactComponentResponse");
|
|
3570
|
+
SubAgentRelationResponse = z5.object({ data: SubAgentRelationApiSelectSchema }).openapi("SubAgentRelationResponse");
|
|
3571
|
+
SubAgentToolRelationResponse = z5.object({ data: SubAgentToolRelationApiSelectSchema }).openapi("SubAgentToolRelationResponse");
|
|
3572
|
+
ConversationResponse = z5.object({ data: ConversationApiSelectSchema }).openapi("ConversationResponse");
|
|
3573
|
+
MessageResponse = z5.object({ data: MessageApiSelectSchema }).openapi("MessageResponse");
|
|
3574
|
+
ProjectListResponse = z5.object({
|
|
3575
|
+
data: z5.array(ProjectApiSelectSchema),
|
|
3258
3576
|
pagination: PaginationSchema
|
|
3259
3577
|
}).openapi("ProjectListResponse");
|
|
3260
|
-
SubAgentListResponse =
|
|
3261
|
-
data:
|
|
3578
|
+
SubAgentListResponse = z5.object({
|
|
3579
|
+
data: z5.array(SubAgentApiSelectSchema),
|
|
3262
3580
|
pagination: PaginationSchema
|
|
3263
3581
|
}).openapi("SubAgentListResponse");
|
|
3264
|
-
AgentListResponse =
|
|
3265
|
-
data:
|
|
3582
|
+
AgentListResponse = z5.object({
|
|
3583
|
+
data: z5.array(AgentApiSelectSchema),
|
|
3266
3584
|
pagination: PaginationSchema
|
|
3267
3585
|
}).openapi("AgentListResponse");
|
|
3268
|
-
ToolListResponse =
|
|
3269
|
-
data:
|
|
3586
|
+
ToolListResponse = z5.object({
|
|
3587
|
+
data: z5.array(ToolApiSelectSchema),
|
|
3270
3588
|
pagination: PaginationSchema
|
|
3271
3589
|
}).openapi("ToolListResponse");
|
|
3272
|
-
ExternalAgentListResponse =
|
|
3273
|
-
data:
|
|
3590
|
+
ExternalAgentListResponse = z5.object({
|
|
3591
|
+
data: z5.array(ExternalAgentApiSelectSchema),
|
|
3274
3592
|
pagination: PaginationSchema
|
|
3275
3593
|
}).openapi("ExternalAgentListResponse");
|
|
3276
|
-
ContextConfigListResponse =
|
|
3277
|
-
data:
|
|
3594
|
+
ContextConfigListResponse = z5.object({
|
|
3595
|
+
data: z5.array(ContextConfigApiSelectSchema),
|
|
3278
3596
|
pagination: PaginationSchema
|
|
3279
3597
|
}).openapi("ContextConfigListResponse");
|
|
3280
|
-
ApiKeyListResponse =
|
|
3281
|
-
data:
|
|
3598
|
+
ApiKeyListResponse = z5.object({
|
|
3599
|
+
data: z5.array(ApiKeyApiSelectSchema),
|
|
3282
3600
|
pagination: PaginationSchema
|
|
3283
3601
|
}).openapi("ApiKeyListResponse");
|
|
3284
|
-
CredentialReferenceListResponse =
|
|
3285
|
-
data:
|
|
3602
|
+
CredentialReferenceListResponse = z5.object({
|
|
3603
|
+
data: z5.array(CredentialReferenceApiSelectSchema),
|
|
3286
3604
|
pagination: PaginationSchema
|
|
3287
3605
|
}).openapi("CredentialReferenceListResponse");
|
|
3288
|
-
FunctionListResponse =
|
|
3289
|
-
data:
|
|
3606
|
+
FunctionListResponse = z5.object({
|
|
3607
|
+
data: z5.array(FunctionApiSelectSchema),
|
|
3290
3608
|
pagination: PaginationSchema
|
|
3291
3609
|
}).openapi("FunctionListResponse");
|
|
3292
|
-
FunctionToolListResponse =
|
|
3293
|
-
data:
|
|
3610
|
+
FunctionToolListResponse = z5.object({
|
|
3611
|
+
data: z5.array(FunctionToolApiSelectSchema),
|
|
3294
3612
|
pagination: PaginationSchema
|
|
3295
3613
|
}).openapi("FunctionToolListResponse");
|
|
3296
|
-
DataComponentListResponse =
|
|
3297
|
-
data:
|
|
3614
|
+
DataComponentListResponse = z5.object({
|
|
3615
|
+
data: z5.array(DataComponentApiSelectSchema),
|
|
3298
3616
|
pagination: PaginationSchema
|
|
3299
3617
|
}).openapi("DataComponentListResponse");
|
|
3300
|
-
ArtifactComponentListResponse =
|
|
3301
|
-
data:
|
|
3618
|
+
ArtifactComponentListResponse = z5.object({
|
|
3619
|
+
data: z5.array(ArtifactComponentApiSelectSchema),
|
|
3302
3620
|
pagination: PaginationSchema
|
|
3303
3621
|
}).openapi("ArtifactComponentListResponse");
|
|
3304
|
-
SubAgentRelationListResponse =
|
|
3305
|
-
data:
|
|
3622
|
+
SubAgentRelationListResponse = z5.object({
|
|
3623
|
+
data: z5.array(SubAgentRelationApiSelectSchema),
|
|
3306
3624
|
pagination: PaginationSchema
|
|
3307
3625
|
}).openapi("SubAgentRelationListResponse");
|
|
3308
|
-
SubAgentToolRelationListResponse =
|
|
3309
|
-
data:
|
|
3626
|
+
SubAgentToolRelationListResponse = z5.object({
|
|
3627
|
+
data: z5.array(SubAgentToolRelationApiSelectSchema),
|
|
3310
3628
|
pagination: PaginationSchema
|
|
3311
3629
|
}).openapi("SubAgentToolRelationListResponse");
|
|
3312
|
-
ConversationListResponse =
|
|
3313
|
-
data:
|
|
3630
|
+
ConversationListResponse = z5.object({
|
|
3631
|
+
data: z5.array(ConversationApiSelectSchema),
|
|
3314
3632
|
pagination: PaginationSchema
|
|
3315
3633
|
}).openapi("ConversationListResponse");
|
|
3316
|
-
MessageListResponse =
|
|
3317
|
-
data:
|
|
3634
|
+
MessageListResponse = z5.object({
|
|
3635
|
+
data: z5.array(MessageApiSelectSchema),
|
|
3318
3636
|
pagination: PaginationSchema
|
|
3319
3637
|
}).openapi("MessageListResponse");
|
|
3320
|
-
SubAgentDataComponentResponse =
|
|
3321
|
-
SubAgentArtifactComponentResponse =
|
|
3322
|
-
SubAgentDataComponentListResponse =
|
|
3323
|
-
data:
|
|
3638
|
+
SubAgentDataComponentResponse = z5.object({ data: SubAgentDataComponentApiSelectSchema }).openapi("SubAgentDataComponentResponse");
|
|
3639
|
+
SubAgentArtifactComponentResponse = z5.object({ data: SubAgentArtifactComponentApiSelectSchema }).openapi("SubAgentArtifactComponentResponse");
|
|
3640
|
+
SubAgentDataComponentListResponse = z5.object({
|
|
3641
|
+
data: z5.array(SubAgentDataComponentApiSelectSchema),
|
|
3324
3642
|
pagination: PaginationSchema
|
|
3325
3643
|
}).openapi("SubAgentDataComponentListResponse");
|
|
3326
|
-
SubAgentArtifactComponentListResponse =
|
|
3327
|
-
data:
|
|
3644
|
+
SubAgentArtifactComponentListResponse = z5.object({
|
|
3645
|
+
data: z5.array(SubAgentArtifactComponentApiSelectSchema),
|
|
3328
3646
|
pagination: PaginationSchema
|
|
3329
3647
|
}).openapi("SubAgentArtifactComponentListResponse");
|
|
3330
|
-
HeadersScopeSchema =
|
|
3331
|
-
"x-inkeep-tenant-id":
|
|
3648
|
+
HeadersScopeSchema = z5.object({
|
|
3649
|
+
"x-inkeep-tenant-id": z5.string().optional().openapi({
|
|
3332
3650
|
description: "Tenant identifier",
|
|
3333
3651
|
example: "tenant_123"
|
|
3334
3652
|
}),
|
|
3335
|
-
"x-inkeep-project-id":
|
|
3653
|
+
"x-inkeep-project-id": z5.string().optional().openapi({
|
|
3336
3654
|
description: "Project identifier",
|
|
3337
3655
|
example: "project_456"
|
|
3338
3656
|
}),
|
|
3339
|
-
"x-inkeep-agent-id":
|
|
3657
|
+
"x-inkeep-agent-id": z5.string().optional().openapi({
|
|
3340
3658
|
description: "Agent identifier",
|
|
3341
3659
|
example: "agent_789"
|
|
3342
3660
|
})
|
|
3343
3661
|
});
|
|
3344
|
-
TenantId =
|
|
3662
|
+
TenantId = z5.string().openapi({
|
|
3345
3663
|
description: "Tenant identifier",
|
|
3346
3664
|
example: "tenant_123"
|
|
3347
3665
|
});
|
|
3348
|
-
ProjectId =
|
|
3666
|
+
ProjectId = z5.string().openapi({
|
|
3349
3667
|
description: "Project identifier",
|
|
3350
3668
|
example: "project_456"
|
|
3351
3669
|
});
|
|
3352
|
-
AgentId =
|
|
3670
|
+
AgentId = z5.string().openapi({
|
|
3353
3671
|
description: "Agent identifier",
|
|
3354
3672
|
example: "agent_789"
|
|
3355
3673
|
});
|
|
3356
|
-
SubAgentId =
|
|
3674
|
+
SubAgentId = z5.string().openapi({
|
|
3357
3675
|
description: "Sub-agent identifier",
|
|
3358
3676
|
example: "sub_agent_123"
|
|
3359
3677
|
});
|
|
3360
|
-
TenantParamsSchema =
|
|
3678
|
+
TenantParamsSchema = z5.object({
|
|
3361
3679
|
tenantId: TenantId
|
|
3362
3680
|
}).openapi("TenantParams");
|
|
3363
3681
|
TenantIdParamsSchema = TenantParamsSchema.extend({
|
|
@@ -3381,15 +3699,15 @@ var init_schemas = __esm({
|
|
|
3381
3699
|
TenantProjectAgentSubAgentIdParamsSchema = TenantProjectAgentSubAgentParamsSchema.extend({
|
|
3382
3700
|
id: resourceIdSchema
|
|
3383
3701
|
}).openapi("TenantProjectAgentSubAgentIdParams");
|
|
3384
|
-
PaginationQueryParamsSchema =
|
|
3385
|
-
page:
|
|
3386
|
-
limit:
|
|
3702
|
+
PaginationQueryParamsSchema = z5.object({
|
|
3703
|
+
page: z5.coerce.number().min(1).default(1),
|
|
3704
|
+
limit: z5.coerce.number().min(1).max(100).default(10)
|
|
3387
3705
|
});
|
|
3388
3706
|
}
|
|
3389
3707
|
});
|
|
3390
3708
|
|
|
3391
3709
|
// ../packages/agents-core/src/context/ContextConfig.ts
|
|
3392
|
-
import { z as
|
|
3710
|
+
import { z as z7 } from "zod";
|
|
3393
3711
|
var logger2;
|
|
3394
3712
|
var init_ContextConfig = __esm({
|
|
3395
3713
|
"../packages/agents-core/src/context/ContextConfig.ts"() {
|
|
@@ -218247,56 +218565,56 @@ var init_index_node = __esm({
|
|
|
218247
218565
|
});
|
|
218248
218566
|
|
|
218249
218567
|
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.17.2/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
218250
|
-
import { z as
|
|
218568
|
+
import { z as z8 } from "zod";
|
|
218251
218569
|
var JSONRPC_VERSION, ProgressTokenSchema, CursorSchema, RequestMetaSchema, BaseRequestParamsSchema, RequestSchema, BaseNotificationParamsSchema, NotificationSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResponseSchema, ErrorCode, JSONRPCErrorSchema, JSONRPCMessageSchema, EmptyResultSchema, CancelledNotificationSchema, BaseMetadataSchema, ImplementationSchema, ClientCapabilitiesSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, PingRequestSchema, ProgressSchema, ProgressNotificationSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestSchema, UnsubscribeRequestSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, LoggingLevelSchema, SetLevelRequestSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, SamplingMessageSchema, CreateMessageRequestSchema, CreateMessageResultSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema;
|
|
218252
218570
|
var init_types2 = __esm({
|
|
218253
218571
|
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.17.2/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"() {
|
|
218254
218572
|
"use strict";
|
|
218255
218573
|
init_esm_shims();
|
|
218256
218574
|
JSONRPC_VERSION = "2.0";
|
|
218257
|
-
ProgressTokenSchema =
|
|
218258
|
-
CursorSchema =
|
|
218259
|
-
RequestMetaSchema =
|
|
218575
|
+
ProgressTokenSchema = z8.union([z8.string(), z8.number().int()]);
|
|
218576
|
+
CursorSchema = z8.string();
|
|
218577
|
+
RequestMetaSchema = z8.object({
|
|
218260
218578
|
/**
|
|
218261
218579
|
* If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
|
|
218262
218580
|
*/
|
|
218263
|
-
progressToken:
|
|
218581
|
+
progressToken: z8.optional(ProgressTokenSchema)
|
|
218264
218582
|
}).passthrough();
|
|
218265
|
-
BaseRequestParamsSchema =
|
|
218266
|
-
_meta:
|
|
218583
|
+
BaseRequestParamsSchema = z8.object({
|
|
218584
|
+
_meta: z8.optional(RequestMetaSchema)
|
|
218267
218585
|
}).passthrough();
|
|
218268
|
-
RequestSchema =
|
|
218269
|
-
method:
|
|
218270
|
-
params:
|
|
218586
|
+
RequestSchema = z8.object({
|
|
218587
|
+
method: z8.string(),
|
|
218588
|
+
params: z8.optional(BaseRequestParamsSchema)
|
|
218271
218589
|
});
|
|
218272
|
-
BaseNotificationParamsSchema =
|
|
218590
|
+
BaseNotificationParamsSchema = z8.object({
|
|
218273
218591
|
/**
|
|
218274
218592
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218275
218593
|
* for notes on _meta usage.
|
|
218276
218594
|
*/
|
|
218277
|
-
_meta:
|
|
218595
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218278
218596
|
}).passthrough();
|
|
218279
|
-
NotificationSchema =
|
|
218280
|
-
method:
|
|
218281
|
-
params:
|
|
218597
|
+
NotificationSchema = z8.object({
|
|
218598
|
+
method: z8.string(),
|
|
218599
|
+
params: z8.optional(BaseNotificationParamsSchema)
|
|
218282
218600
|
});
|
|
218283
|
-
ResultSchema =
|
|
218601
|
+
ResultSchema = z8.object({
|
|
218284
218602
|
/**
|
|
218285
218603
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218286
218604
|
* for notes on _meta usage.
|
|
218287
218605
|
*/
|
|
218288
|
-
_meta:
|
|
218606
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218289
218607
|
}).passthrough();
|
|
218290
|
-
RequestIdSchema =
|
|
218291
|
-
JSONRPCRequestSchema =
|
|
218292
|
-
jsonrpc:
|
|
218608
|
+
RequestIdSchema = z8.union([z8.string(), z8.number().int()]);
|
|
218609
|
+
JSONRPCRequestSchema = z8.object({
|
|
218610
|
+
jsonrpc: z8.literal(JSONRPC_VERSION),
|
|
218293
218611
|
id: RequestIdSchema
|
|
218294
218612
|
}).merge(RequestSchema).strict();
|
|
218295
|
-
JSONRPCNotificationSchema =
|
|
218296
|
-
jsonrpc:
|
|
218613
|
+
JSONRPCNotificationSchema = z8.object({
|
|
218614
|
+
jsonrpc: z8.literal(JSONRPC_VERSION)
|
|
218297
218615
|
}).merge(NotificationSchema).strict();
|
|
218298
|
-
JSONRPCResponseSchema =
|
|
218299
|
-
jsonrpc:
|
|
218616
|
+
JSONRPCResponseSchema = z8.object({
|
|
218617
|
+
jsonrpc: z8.literal(JSONRPC_VERSION),
|
|
218300
218618
|
id: RequestIdSchema,
|
|
218301
218619
|
result: ResultSchema
|
|
218302
218620
|
}).strict();
|
|
@@ -218309,25 +218627,25 @@ var init_types2 = __esm({
|
|
|
218309
218627
|
ErrorCode3[ErrorCode3["InvalidParams"] = -32602] = "InvalidParams";
|
|
218310
218628
|
ErrorCode3[ErrorCode3["InternalError"] = -32603] = "InternalError";
|
|
218311
218629
|
})(ErrorCode || (ErrorCode = {}));
|
|
218312
|
-
JSONRPCErrorSchema =
|
|
218313
|
-
jsonrpc:
|
|
218630
|
+
JSONRPCErrorSchema = z8.object({
|
|
218631
|
+
jsonrpc: z8.literal(JSONRPC_VERSION),
|
|
218314
218632
|
id: RequestIdSchema,
|
|
218315
|
-
error:
|
|
218633
|
+
error: z8.object({
|
|
218316
218634
|
/**
|
|
218317
218635
|
* The error type that occurred.
|
|
218318
218636
|
*/
|
|
218319
|
-
code:
|
|
218637
|
+
code: z8.number().int(),
|
|
218320
218638
|
/**
|
|
218321
218639
|
* A short description of the error. The message SHOULD be limited to a concise single sentence.
|
|
218322
218640
|
*/
|
|
218323
|
-
message:
|
|
218641
|
+
message: z8.string(),
|
|
218324
218642
|
/**
|
|
218325
218643
|
* Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
|
|
218326
218644
|
*/
|
|
218327
|
-
data:
|
|
218645
|
+
data: z8.optional(z8.unknown())
|
|
218328
218646
|
})
|
|
218329
218647
|
}).strict();
|
|
218330
|
-
JSONRPCMessageSchema =
|
|
218648
|
+
JSONRPCMessageSchema = z8.union([
|
|
218331
218649
|
JSONRPCRequestSchema,
|
|
218332
218650
|
JSONRPCNotificationSchema,
|
|
218333
218651
|
JSONRPCResponseSchema,
|
|
@@ -218335,7 +218653,7 @@ var init_types2 = __esm({
|
|
|
218335
218653
|
]);
|
|
218336
218654
|
EmptyResultSchema = ResultSchema.strict();
|
|
218337
218655
|
CancelledNotificationSchema = NotificationSchema.extend({
|
|
218338
|
-
method:
|
|
218656
|
+
method: z8.literal("notifications/cancelled"),
|
|
218339
218657
|
params: BaseNotificationParamsSchema.extend({
|
|
218340
218658
|
/**
|
|
218341
218659
|
* The ID of the request to cancel.
|
|
@@ -218346,12 +218664,12 @@ var init_types2 = __esm({
|
|
|
218346
218664
|
/**
|
|
218347
218665
|
* An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
|
|
218348
218666
|
*/
|
|
218349
|
-
reason:
|
|
218667
|
+
reason: z8.string().optional()
|
|
218350
218668
|
})
|
|
218351
218669
|
});
|
|
218352
|
-
BaseMetadataSchema =
|
|
218670
|
+
BaseMetadataSchema = z8.object({
|
|
218353
218671
|
/** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
|
|
218354
|
-
name:
|
|
218672
|
+
name: z8.string(),
|
|
218355
218673
|
/**
|
|
218356
218674
|
* Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
|
|
218357
218675
|
* even by those unfamiliar with domain-specific terminology.
|
|
@@ -218360,95 +218678,95 @@ var init_types2 = __esm({
|
|
|
218360
218678
|
* where `annotations.title` should be given precedence over using `name`,
|
|
218361
218679
|
* if present).
|
|
218362
218680
|
*/
|
|
218363
|
-
title:
|
|
218681
|
+
title: z8.optional(z8.string())
|
|
218364
218682
|
}).passthrough();
|
|
218365
218683
|
ImplementationSchema = BaseMetadataSchema.extend({
|
|
218366
|
-
version:
|
|
218684
|
+
version: z8.string()
|
|
218367
218685
|
});
|
|
218368
|
-
ClientCapabilitiesSchema =
|
|
218686
|
+
ClientCapabilitiesSchema = z8.object({
|
|
218369
218687
|
/**
|
|
218370
218688
|
* Experimental, non-standard capabilities that the client supports.
|
|
218371
218689
|
*/
|
|
218372
|
-
experimental:
|
|
218690
|
+
experimental: z8.optional(z8.object({}).passthrough()),
|
|
218373
218691
|
/**
|
|
218374
218692
|
* Present if the client supports sampling from an LLM.
|
|
218375
218693
|
*/
|
|
218376
|
-
sampling:
|
|
218694
|
+
sampling: z8.optional(z8.object({}).passthrough()),
|
|
218377
218695
|
/**
|
|
218378
218696
|
* Present if the client supports eliciting user input.
|
|
218379
218697
|
*/
|
|
218380
|
-
elicitation:
|
|
218698
|
+
elicitation: z8.optional(z8.object({}).passthrough()),
|
|
218381
218699
|
/**
|
|
218382
218700
|
* Present if the client supports listing roots.
|
|
218383
218701
|
*/
|
|
218384
|
-
roots:
|
|
218702
|
+
roots: z8.optional(z8.object({
|
|
218385
218703
|
/**
|
|
218386
218704
|
* Whether the client supports issuing notifications for changes to the roots list.
|
|
218387
218705
|
*/
|
|
218388
|
-
listChanged:
|
|
218706
|
+
listChanged: z8.optional(z8.boolean())
|
|
218389
218707
|
}).passthrough())
|
|
218390
218708
|
}).passthrough();
|
|
218391
218709
|
InitializeRequestSchema = RequestSchema.extend({
|
|
218392
|
-
method:
|
|
218710
|
+
method: z8.literal("initialize"),
|
|
218393
218711
|
params: BaseRequestParamsSchema.extend({
|
|
218394
218712
|
/**
|
|
218395
218713
|
* The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
|
|
218396
218714
|
*/
|
|
218397
|
-
protocolVersion:
|
|
218715
|
+
protocolVersion: z8.string(),
|
|
218398
218716
|
capabilities: ClientCapabilitiesSchema,
|
|
218399
218717
|
clientInfo: ImplementationSchema
|
|
218400
218718
|
})
|
|
218401
218719
|
});
|
|
218402
|
-
ServerCapabilitiesSchema =
|
|
218720
|
+
ServerCapabilitiesSchema = z8.object({
|
|
218403
218721
|
/**
|
|
218404
218722
|
* Experimental, non-standard capabilities that the server supports.
|
|
218405
218723
|
*/
|
|
218406
|
-
experimental:
|
|
218724
|
+
experimental: z8.optional(z8.object({}).passthrough()),
|
|
218407
218725
|
/**
|
|
218408
218726
|
* Present if the server supports sending log messages to the client.
|
|
218409
218727
|
*/
|
|
218410
|
-
logging:
|
|
218728
|
+
logging: z8.optional(z8.object({}).passthrough()),
|
|
218411
218729
|
/**
|
|
218412
218730
|
* Present if the server supports sending completions to the client.
|
|
218413
218731
|
*/
|
|
218414
|
-
completions:
|
|
218732
|
+
completions: z8.optional(z8.object({}).passthrough()),
|
|
218415
218733
|
/**
|
|
218416
218734
|
* Present if the server offers any prompt templates.
|
|
218417
218735
|
*/
|
|
218418
|
-
prompts:
|
|
218736
|
+
prompts: z8.optional(z8.object({
|
|
218419
218737
|
/**
|
|
218420
218738
|
* Whether this server supports issuing notifications for changes to the prompt list.
|
|
218421
218739
|
*/
|
|
218422
|
-
listChanged:
|
|
218740
|
+
listChanged: z8.optional(z8.boolean())
|
|
218423
218741
|
}).passthrough()),
|
|
218424
218742
|
/**
|
|
218425
218743
|
* Present if the server offers any resources to read.
|
|
218426
218744
|
*/
|
|
218427
|
-
resources:
|
|
218745
|
+
resources: z8.optional(z8.object({
|
|
218428
218746
|
/**
|
|
218429
218747
|
* Whether this server supports clients subscribing to resource updates.
|
|
218430
218748
|
*/
|
|
218431
|
-
subscribe:
|
|
218749
|
+
subscribe: z8.optional(z8.boolean()),
|
|
218432
218750
|
/**
|
|
218433
218751
|
* Whether this server supports issuing notifications for changes to the resource list.
|
|
218434
218752
|
*/
|
|
218435
|
-
listChanged:
|
|
218753
|
+
listChanged: z8.optional(z8.boolean())
|
|
218436
218754
|
}).passthrough()),
|
|
218437
218755
|
/**
|
|
218438
218756
|
* Present if the server offers any tools to call.
|
|
218439
218757
|
*/
|
|
218440
|
-
tools:
|
|
218758
|
+
tools: z8.optional(z8.object({
|
|
218441
218759
|
/**
|
|
218442
218760
|
* Whether this server supports issuing notifications for changes to the tool list.
|
|
218443
218761
|
*/
|
|
218444
|
-
listChanged:
|
|
218762
|
+
listChanged: z8.optional(z8.boolean())
|
|
218445
218763
|
}).passthrough())
|
|
218446
218764
|
}).passthrough();
|
|
218447
218765
|
InitializeResultSchema = ResultSchema.extend({
|
|
218448
218766
|
/**
|
|
218449
218767
|
* The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
|
|
218450
218768
|
*/
|
|
218451
|
-
protocolVersion:
|
|
218769
|
+
protocolVersion: z8.string(),
|
|
218452
218770
|
capabilities: ServerCapabilitiesSchema,
|
|
218453
218771
|
serverInfo: ImplementationSchema,
|
|
218454
218772
|
/**
|
|
@@ -218456,30 +218774,30 @@ var init_types2 = __esm({
|
|
|
218456
218774
|
*
|
|
218457
218775
|
* This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
|
|
218458
218776
|
*/
|
|
218459
|
-
instructions:
|
|
218777
|
+
instructions: z8.optional(z8.string())
|
|
218460
218778
|
});
|
|
218461
218779
|
InitializedNotificationSchema = NotificationSchema.extend({
|
|
218462
|
-
method:
|
|
218780
|
+
method: z8.literal("notifications/initialized")
|
|
218463
218781
|
});
|
|
218464
218782
|
PingRequestSchema = RequestSchema.extend({
|
|
218465
|
-
method:
|
|
218783
|
+
method: z8.literal("ping")
|
|
218466
218784
|
});
|
|
218467
|
-
ProgressSchema =
|
|
218785
|
+
ProgressSchema = z8.object({
|
|
218468
218786
|
/**
|
|
218469
218787
|
* The progress thus far. This should increase every time progress is made, even if the total is unknown.
|
|
218470
218788
|
*/
|
|
218471
|
-
progress:
|
|
218789
|
+
progress: z8.number(),
|
|
218472
218790
|
/**
|
|
218473
218791
|
* Total number of items to process (or total progress required), if known.
|
|
218474
218792
|
*/
|
|
218475
|
-
total:
|
|
218793
|
+
total: z8.optional(z8.number()),
|
|
218476
218794
|
/**
|
|
218477
218795
|
* An optional message describing the current progress.
|
|
218478
218796
|
*/
|
|
218479
|
-
message:
|
|
218797
|
+
message: z8.optional(z8.string())
|
|
218480
218798
|
}).passthrough();
|
|
218481
218799
|
ProgressNotificationSchema = NotificationSchema.extend({
|
|
218482
|
-
method:
|
|
218800
|
+
method: z8.literal("notifications/progress"),
|
|
218483
218801
|
params: BaseNotificationParamsSchema.merge(ProgressSchema).extend({
|
|
218484
218802
|
/**
|
|
218485
218803
|
* The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
|
|
@@ -218493,7 +218811,7 @@ var init_types2 = __esm({
|
|
|
218493
218811
|
* An opaque token representing the current pagination position.
|
|
218494
218812
|
* If provided, the server should return results starting after this cursor.
|
|
218495
218813
|
*/
|
|
218496
|
-
cursor:
|
|
218814
|
+
cursor: z8.optional(CursorSchema)
|
|
218497
218815
|
}).optional()
|
|
218498
218816
|
});
|
|
218499
218817
|
PaginatedResultSchema = ResultSchema.extend({
|
|
@@ -218501,30 +218819,30 @@ var init_types2 = __esm({
|
|
|
218501
218819
|
* An opaque token representing the pagination position after the last returned result.
|
|
218502
218820
|
* If present, there may be more results available.
|
|
218503
218821
|
*/
|
|
218504
|
-
nextCursor:
|
|
218822
|
+
nextCursor: z8.optional(CursorSchema)
|
|
218505
218823
|
});
|
|
218506
|
-
ResourceContentsSchema =
|
|
218824
|
+
ResourceContentsSchema = z8.object({
|
|
218507
218825
|
/**
|
|
218508
218826
|
* The URI of this resource.
|
|
218509
218827
|
*/
|
|
218510
|
-
uri:
|
|
218828
|
+
uri: z8.string(),
|
|
218511
218829
|
/**
|
|
218512
218830
|
* The MIME type of this resource, if known.
|
|
218513
218831
|
*/
|
|
218514
|
-
mimeType:
|
|
218832
|
+
mimeType: z8.optional(z8.string()),
|
|
218515
218833
|
/**
|
|
218516
218834
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218517
218835
|
* for notes on _meta usage.
|
|
218518
218836
|
*/
|
|
218519
|
-
_meta:
|
|
218837
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218520
218838
|
}).passthrough();
|
|
218521
218839
|
TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
218522
218840
|
/**
|
|
218523
218841
|
* The text of the item. This must only be set if the item can actually be represented as text (not binary data).
|
|
218524
218842
|
*/
|
|
218525
|
-
text:
|
|
218843
|
+
text: z8.string()
|
|
218526
218844
|
});
|
|
218527
|
-
Base64Schema =
|
|
218845
|
+
Base64Schema = z8.string().refine((val) => {
|
|
218528
218846
|
try {
|
|
218529
218847
|
atob(val);
|
|
218530
218848
|
return true;
|
|
@@ -218542,160 +218860,160 @@ var init_types2 = __esm({
|
|
|
218542
218860
|
/**
|
|
218543
218861
|
* The URI of this resource.
|
|
218544
218862
|
*/
|
|
218545
|
-
uri:
|
|
218863
|
+
uri: z8.string(),
|
|
218546
218864
|
/**
|
|
218547
218865
|
* A description of what this resource represents.
|
|
218548
218866
|
*
|
|
218549
218867
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
218550
218868
|
*/
|
|
218551
|
-
description:
|
|
218869
|
+
description: z8.optional(z8.string()),
|
|
218552
218870
|
/**
|
|
218553
218871
|
* The MIME type of this resource, if known.
|
|
218554
218872
|
*/
|
|
218555
|
-
mimeType:
|
|
218873
|
+
mimeType: z8.optional(z8.string()),
|
|
218556
218874
|
/**
|
|
218557
218875
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218558
218876
|
* for notes on _meta usage.
|
|
218559
218877
|
*/
|
|
218560
|
-
_meta:
|
|
218878
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218561
218879
|
});
|
|
218562
218880
|
ResourceTemplateSchema = BaseMetadataSchema.extend({
|
|
218563
218881
|
/**
|
|
218564
218882
|
* A URI template (according to RFC 6570) that can be used to construct resource URIs.
|
|
218565
218883
|
*/
|
|
218566
|
-
uriTemplate:
|
|
218884
|
+
uriTemplate: z8.string(),
|
|
218567
218885
|
/**
|
|
218568
218886
|
* A description of what this template is for.
|
|
218569
218887
|
*
|
|
218570
218888
|
* This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
|
|
218571
218889
|
*/
|
|
218572
|
-
description:
|
|
218890
|
+
description: z8.optional(z8.string()),
|
|
218573
218891
|
/**
|
|
218574
218892
|
* The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
|
|
218575
218893
|
*/
|
|
218576
|
-
mimeType:
|
|
218894
|
+
mimeType: z8.optional(z8.string()),
|
|
218577
218895
|
/**
|
|
218578
218896
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218579
218897
|
* for notes on _meta usage.
|
|
218580
218898
|
*/
|
|
218581
|
-
_meta:
|
|
218899
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218582
218900
|
});
|
|
218583
218901
|
ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
218584
|
-
method:
|
|
218902
|
+
method: z8.literal("resources/list")
|
|
218585
218903
|
});
|
|
218586
218904
|
ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
218587
|
-
resources:
|
|
218905
|
+
resources: z8.array(ResourceSchema)
|
|
218588
218906
|
});
|
|
218589
218907
|
ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
218590
|
-
method:
|
|
218908
|
+
method: z8.literal("resources/templates/list")
|
|
218591
218909
|
});
|
|
218592
218910
|
ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
218593
|
-
resourceTemplates:
|
|
218911
|
+
resourceTemplates: z8.array(ResourceTemplateSchema)
|
|
218594
218912
|
});
|
|
218595
218913
|
ReadResourceRequestSchema = RequestSchema.extend({
|
|
218596
|
-
method:
|
|
218914
|
+
method: z8.literal("resources/read"),
|
|
218597
218915
|
params: BaseRequestParamsSchema.extend({
|
|
218598
218916
|
/**
|
|
218599
218917
|
* The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
|
|
218600
218918
|
*/
|
|
218601
|
-
uri:
|
|
218919
|
+
uri: z8.string()
|
|
218602
218920
|
})
|
|
218603
218921
|
});
|
|
218604
218922
|
ReadResourceResultSchema = ResultSchema.extend({
|
|
218605
|
-
contents:
|
|
218923
|
+
contents: z8.array(z8.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
218606
218924
|
});
|
|
218607
218925
|
ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
218608
|
-
method:
|
|
218926
|
+
method: z8.literal("notifications/resources/list_changed")
|
|
218609
218927
|
});
|
|
218610
218928
|
SubscribeRequestSchema = RequestSchema.extend({
|
|
218611
|
-
method:
|
|
218929
|
+
method: z8.literal("resources/subscribe"),
|
|
218612
218930
|
params: BaseRequestParamsSchema.extend({
|
|
218613
218931
|
/**
|
|
218614
218932
|
* The URI of the resource to subscribe to. The URI can use any protocol; it is up to the server how to interpret it.
|
|
218615
218933
|
*/
|
|
218616
|
-
uri:
|
|
218934
|
+
uri: z8.string()
|
|
218617
218935
|
})
|
|
218618
218936
|
});
|
|
218619
218937
|
UnsubscribeRequestSchema = RequestSchema.extend({
|
|
218620
|
-
method:
|
|
218938
|
+
method: z8.literal("resources/unsubscribe"),
|
|
218621
218939
|
params: BaseRequestParamsSchema.extend({
|
|
218622
218940
|
/**
|
|
218623
218941
|
* The URI of the resource to unsubscribe from.
|
|
218624
218942
|
*/
|
|
218625
|
-
uri:
|
|
218943
|
+
uri: z8.string()
|
|
218626
218944
|
})
|
|
218627
218945
|
});
|
|
218628
218946
|
ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
218629
|
-
method:
|
|
218947
|
+
method: z8.literal("notifications/resources/updated"),
|
|
218630
218948
|
params: BaseNotificationParamsSchema.extend({
|
|
218631
218949
|
/**
|
|
218632
218950
|
* The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
|
|
218633
218951
|
*/
|
|
218634
|
-
uri:
|
|
218952
|
+
uri: z8.string()
|
|
218635
218953
|
})
|
|
218636
218954
|
});
|
|
218637
|
-
PromptArgumentSchema =
|
|
218955
|
+
PromptArgumentSchema = z8.object({
|
|
218638
218956
|
/**
|
|
218639
218957
|
* The name of the argument.
|
|
218640
218958
|
*/
|
|
218641
|
-
name:
|
|
218959
|
+
name: z8.string(),
|
|
218642
218960
|
/**
|
|
218643
218961
|
* A human-readable description of the argument.
|
|
218644
218962
|
*/
|
|
218645
|
-
description:
|
|
218963
|
+
description: z8.optional(z8.string()),
|
|
218646
218964
|
/**
|
|
218647
218965
|
* Whether this argument must be provided.
|
|
218648
218966
|
*/
|
|
218649
|
-
required:
|
|
218967
|
+
required: z8.optional(z8.boolean())
|
|
218650
218968
|
}).passthrough();
|
|
218651
218969
|
PromptSchema = BaseMetadataSchema.extend({
|
|
218652
218970
|
/**
|
|
218653
218971
|
* An optional description of what this prompt provides
|
|
218654
218972
|
*/
|
|
218655
|
-
description:
|
|
218973
|
+
description: z8.optional(z8.string()),
|
|
218656
218974
|
/**
|
|
218657
218975
|
* A list of arguments to use for templating the prompt.
|
|
218658
218976
|
*/
|
|
218659
|
-
arguments:
|
|
218977
|
+
arguments: z8.optional(z8.array(PromptArgumentSchema)),
|
|
218660
218978
|
/**
|
|
218661
218979
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218662
218980
|
* for notes on _meta usage.
|
|
218663
218981
|
*/
|
|
218664
|
-
_meta:
|
|
218982
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218665
218983
|
});
|
|
218666
218984
|
ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
218667
|
-
method:
|
|
218985
|
+
method: z8.literal("prompts/list")
|
|
218668
218986
|
});
|
|
218669
218987
|
ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
218670
|
-
prompts:
|
|
218988
|
+
prompts: z8.array(PromptSchema)
|
|
218671
218989
|
});
|
|
218672
218990
|
GetPromptRequestSchema = RequestSchema.extend({
|
|
218673
|
-
method:
|
|
218991
|
+
method: z8.literal("prompts/get"),
|
|
218674
218992
|
params: BaseRequestParamsSchema.extend({
|
|
218675
218993
|
/**
|
|
218676
218994
|
* The name of the prompt or prompt template.
|
|
218677
218995
|
*/
|
|
218678
|
-
name:
|
|
218996
|
+
name: z8.string(),
|
|
218679
218997
|
/**
|
|
218680
218998
|
* Arguments to use for templating the prompt.
|
|
218681
218999
|
*/
|
|
218682
|
-
arguments:
|
|
219000
|
+
arguments: z8.optional(z8.record(z8.string()))
|
|
218683
219001
|
})
|
|
218684
219002
|
});
|
|
218685
|
-
TextContentSchema =
|
|
218686
|
-
type:
|
|
219003
|
+
TextContentSchema = z8.object({
|
|
219004
|
+
type: z8.literal("text"),
|
|
218687
219005
|
/**
|
|
218688
219006
|
* The text content of the message.
|
|
218689
219007
|
*/
|
|
218690
|
-
text:
|
|
219008
|
+
text: z8.string(),
|
|
218691
219009
|
/**
|
|
218692
219010
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218693
219011
|
* for notes on _meta usage.
|
|
218694
219012
|
*/
|
|
218695
|
-
_meta:
|
|
219013
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218696
219014
|
}).passthrough();
|
|
218697
|
-
ImageContentSchema =
|
|
218698
|
-
type:
|
|
219015
|
+
ImageContentSchema = z8.object({
|
|
219016
|
+
type: z8.literal("image"),
|
|
218699
219017
|
/**
|
|
218700
219018
|
* The base64-encoded image data.
|
|
218701
219019
|
*/
|
|
@@ -218703,15 +219021,15 @@ var init_types2 = __esm({
|
|
|
218703
219021
|
/**
|
|
218704
219022
|
* The MIME type of the image. Different providers may support different image types.
|
|
218705
219023
|
*/
|
|
218706
|
-
mimeType:
|
|
219024
|
+
mimeType: z8.string(),
|
|
218707
219025
|
/**
|
|
218708
219026
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218709
219027
|
* for notes on _meta usage.
|
|
218710
219028
|
*/
|
|
218711
|
-
_meta:
|
|
219029
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218712
219030
|
}).passthrough();
|
|
218713
|
-
AudioContentSchema =
|
|
218714
|
-
type:
|
|
219031
|
+
AudioContentSchema = z8.object({
|
|
219032
|
+
type: z8.literal("audio"),
|
|
218715
219033
|
/**
|
|
218716
219034
|
* The base64-encoded audio data.
|
|
218717
219035
|
*/
|
|
@@ -218719,57 +219037,57 @@ var init_types2 = __esm({
|
|
|
218719
219037
|
/**
|
|
218720
219038
|
* The MIME type of the audio. Different providers may support different audio types.
|
|
218721
219039
|
*/
|
|
218722
|
-
mimeType:
|
|
219040
|
+
mimeType: z8.string(),
|
|
218723
219041
|
/**
|
|
218724
219042
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218725
219043
|
* for notes on _meta usage.
|
|
218726
219044
|
*/
|
|
218727
|
-
_meta:
|
|
219045
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218728
219046
|
}).passthrough();
|
|
218729
|
-
EmbeddedResourceSchema =
|
|
218730
|
-
type:
|
|
218731
|
-
resource:
|
|
219047
|
+
EmbeddedResourceSchema = z8.object({
|
|
219048
|
+
type: z8.literal("resource"),
|
|
219049
|
+
resource: z8.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
218732
219050
|
/**
|
|
218733
219051
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218734
219052
|
* for notes on _meta usage.
|
|
218735
219053
|
*/
|
|
218736
|
-
_meta:
|
|
219054
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218737
219055
|
}).passthrough();
|
|
218738
219056
|
ResourceLinkSchema = ResourceSchema.extend({
|
|
218739
|
-
type:
|
|
219057
|
+
type: z8.literal("resource_link")
|
|
218740
219058
|
});
|
|
218741
|
-
ContentBlockSchema =
|
|
219059
|
+
ContentBlockSchema = z8.union([
|
|
218742
219060
|
TextContentSchema,
|
|
218743
219061
|
ImageContentSchema,
|
|
218744
219062
|
AudioContentSchema,
|
|
218745
219063
|
ResourceLinkSchema,
|
|
218746
219064
|
EmbeddedResourceSchema
|
|
218747
219065
|
]);
|
|
218748
|
-
PromptMessageSchema =
|
|
218749
|
-
role:
|
|
219066
|
+
PromptMessageSchema = z8.object({
|
|
219067
|
+
role: z8.enum(["user", "assistant"]),
|
|
218750
219068
|
content: ContentBlockSchema
|
|
218751
219069
|
}).passthrough();
|
|
218752
219070
|
GetPromptResultSchema = ResultSchema.extend({
|
|
218753
219071
|
/**
|
|
218754
219072
|
* An optional description for the prompt.
|
|
218755
219073
|
*/
|
|
218756
|
-
description:
|
|
218757
|
-
messages:
|
|
219074
|
+
description: z8.optional(z8.string()),
|
|
219075
|
+
messages: z8.array(PromptMessageSchema)
|
|
218758
219076
|
});
|
|
218759
219077
|
PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
218760
|
-
method:
|
|
219078
|
+
method: z8.literal("notifications/prompts/list_changed")
|
|
218761
219079
|
});
|
|
218762
|
-
ToolAnnotationsSchema =
|
|
219080
|
+
ToolAnnotationsSchema = z8.object({
|
|
218763
219081
|
/**
|
|
218764
219082
|
* A human-readable title for the tool.
|
|
218765
219083
|
*/
|
|
218766
|
-
title:
|
|
219084
|
+
title: z8.optional(z8.string()),
|
|
218767
219085
|
/**
|
|
218768
219086
|
* If true, the tool does not modify its environment.
|
|
218769
219087
|
*
|
|
218770
219088
|
* Default: false
|
|
218771
219089
|
*/
|
|
218772
|
-
readOnlyHint:
|
|
219090
|
+
readOnlyHint: z8.optional(z8.boolean()),
|
|
218773
219091
|
/**
|
|
218774
219092
|
* If true, the tool may perform destructive updates to its environment.
|
|
218775
219093
|
* If false, the tool performs only additive updates.
|
|
@@ -218778,7 +219096,7 @@ var init_types2 = __esm({
|
|
|
218778
219096
|
*
|
|
218779
219097
|
* Default: true
|
|
218780
219098
|
*/
|
|
218781
|
-
destructiveHint:
|
|
219099
|
+
destructiveHint: z8.optional(z8.boolean()),
|
|
218782
219100
|
/**
|
|
218783
219101
|
* If true, calling the tool repeatedly with the same arguments
|
|
218784
219102
|
* will have no additional effect on the its environment.
|
|
@@ -218787,7 +219105,7 @@ var init_types2 = __esm({
|
|
|
218787
219105
|
*
|
|
218788
219106
|
* Default: false
|
|
218789
219107
|
*/
|
|
218790
|
-
idempotentHint:
|
|
219108
|
+
idempotentHint: z8.optional(z8.boolean()),
|
|
218791
219109
|
/**
|
|
218792
219110
|
* If true, this tool may interact with an "open world" of external
|
|
218793
219111
|
* entities. If false, the tool's domain of interaction is closed.
|
|
@@ -218796,45 +219114,45 @@ var init_types2 = __esm({
|
|
|
218796
219114
|
*
|
|
218797
219115
|
* Default: true
|
|
218798
219116
|
*/
|
|
218799
|
-
openWorldHint:
|
|
219117
|
+
openWorldHint: z8.optional(z8.boolean())
|
|
218800
219118
|
}).passthrough();
|
|
218801
219119
|
ToolSchema = BaseMetadataSchema.extend({
|
|
218802
219120
|
/**
|
|
218803
219121
|
* A human-readable description of the tool.
|
|
218804
219122
|
*/
|
|
218805
|
-
description:
|
|
219123
|
+
description: z8.optional(z8.string()),
|
|
218806
219124
|
/**
|
|
218807
219125
|
* A JSON Schema object defining the expected parameters for the tool.
|
|
218808
219126
|
*/
|
|
218809
|
-
inputSchema:
|
|
218810
|
-
type:
|
|
218811
|
-
properties:
|
|
218812
|
-
required:
|
|
219127
|
+
inputSchema: z8.object({
|
|
219128
|
+
type: z8.literal("object"),
|
|
219129
|
+
properties: z8.optional(z8.object({}).passthrough()),
|
|
219130
|
+
required: z8.optional(z8.array(z8.string()))
|
|
218813
219131
|
}).passthrough(),
|
|
218814
219132
|
/**
|
|
218815
219133
|
* An optional JSON Schema object defining the structure of the tool's output returned in
|
|
218816
219134
|
* the structuredContent field of a CallToolResult.
|
|
218817
219135
|
*/
|
|
218818
|
-
outputSchema:
|
|
218819
|
-
type:
|
|
218820
|
-
properties:
|
|
218821
|
-
required:
|
|
219136
|
+
outputSchema: z8.optional(z8.object({
|
|
219137
|
+
type: z8.literal("object"),
|
|
219138
|
+
properties: z8.optional(z8.object({}).passthrough()),
|
|
219139
|
+
required: z8.optional(z8.array(z8.string()))
|
|
218822
219140
|
}).passthrough()),
|
|
218823
219141
|
/**
|
|
218824
219142
|
* Optional additional tool information.
|
|
218825
219143
|
*/
|
|
218826
|
-
annotations:
|
|
219144
|
+
annotations: z8.optional(ToolAnnotationsSchema),
|
|
218827
219145
|
/**
|
|
218828
219146
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
218829
219147
|
* for notes on _meta usage.
|
|
218830
219148
|
*/
|
|
218831
|
-
_meta:
|
|
219149
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
218832
219150
|
});
|
|
218833
219151
|
ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
218834
|
-
method:
|
|
219152
|
+
method: z8.literal("tools/list")
|
|
218835
219153
|
});
|
|
218836
219154
|
ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
218837
|
-
tools:
|
|
219155
|
+
tools: z8.array(ToolSchema)
|
|
218838
219156
|
});
|
|
218839
219157
|
CallToolResultSchema = ResultSchema.extend({
|
|
218840
219158
|
/**
|
|
@@ -218843,13 +219161,13 @@ var init_types2 = __esm({
|
|
|
218843
219161
|
* If the Tool does not define an outputSchema, this field MUST be present in the result.
|
|
218844
219162
|
* For backwards compatibility, this field is always present, but it may be empty.
|
|
218845
219163
|
*/
|
|
218846
|
-
content:
|
|
219164
|
+
content: z8.array(ContentBlockSchema).default([]),
|
|
218847
219165
|
/**
|
|
218848
219166
|
* An object containing structured tool output.
|
|
218849
219167
|
*
|
|
218850
219168
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
218851
219169
|
*/
|
|
218852
|
-
structuredContent:
|
|
219170
|
+
structuredContent: z8.object({}).passthrough().optional(),
|
|
218853
219171
|
/**
|
|
218854
219172
|
* Whether the tool call ended in an error.
|
|
218855
219173
|
*
|
|
@@ -218864,22 +219182,22 @@ var init_types2 = __esm({
|
|
|
218864
219182
|
* server does not support tool calls, or any other exceptional conditions,
|
|
218865
219183
|
* should be reported as an MCP error response.
|
|
218866
219184
|
*/
|
|
218867
|
-
isError:
|
|
219185
|
+
isError: z8.optional(z8.boolean())
|
|
218868
219186
|
});
|
|
218869
219187
|
CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
218870
|
-
toolResult:
|
|
219188
|
+
toolResult: z8.unknown()
|
|
218871
219189
|
}));
|
|
218872
219190
|
CallToolRequestSchema = RequestSchema.extend({
|
|
218873
|
-
method:
|
|
219191
|
+
method: z8.literal("tools/call"),
|
|
218874
219192
|
params: BaseRequestParamsSchema.extend({
|
|
218875
|
-
name:
|
|
218876
|
-
arguments:
|
|
219193
|
+
name: z8.string(),
|
|
219194
|
+
arguments: z8.optional(z8.record(z8.unknown()))
|
|
218877
219195
|
})
|
|
218878
219196
|
});
|
|
218879
219197
|
ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
218880
|
-
method:
|
|
219198
|
+
method: z8.literal("notifications/tools/list_changed")
|
|
218881
219199
|
});
|
|
218882
|
-
LoggingLevelSchema =
|
|
219200
|
+
LoggingLevelSchema = z8.enum([
|
|
218883
219201
|
"debug",
|
|
218884
219202
|
"info",
|
|
218885
219203
|
"notice",
|
|
@@ -218890,7 +219208,7 @@ var init_types2 = __esm({
|
|
|
218890
219208
|
"emergency"
|
|
218891
219209
|
]);
|
|
218892
219210
|
SetLevelRequestSchema = RequestSchema.extend({
|
|
218893
|
-
method:
|
|
219211
|
+
method: z8.literal("logging/setLevel"),
|
|
218894
219212
|
params: BaseRequestParamsSchema.extend({
|
|
218895
219213
|
/**
|
|
218896
219214
|
* The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
|
|
@@ -218899,7 +219217,7 @@ var init_types2 = __esm({
|
|
|
218899
219217
|
})
|
|
218900
219218
|
});
|
|
218901
219219
|
LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
218902
|
-
method:
|
|
219220
|
+
method: z8.literal("notifications/message"),
|
|
218903
219221
|
params: BaseNotificationParamsSchema.extend({
|
|
218904
219222
|
/**
|
|
218905
219223
|
* The severity of this log message.
|
|
@@ -218908,133 +219226,133 @@ var init_types2 = __esm({
|
|
|
218908
219226
|
/**
|
|
218909
219227
|
* An optional name of the logger issuing this message.
|
|
218910
219228
|
*/
|
|
218911
|
-
logger:
|
|
219229
|
+
logger: z8.optional(z8.string()),
|
|
218912
219230
|
/**
|
|
218913
219231
|
* The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
|
|
218914
219232
|
*/
|
|
218915
|
-
data:
|
|
219233
|
+
data: z8.unknown()
|
|
218916
219234
|
})
|
|
218917
219235
|
});
|
|
218918
|
-
ModelHintSchema =
|
|
219236
|
+
ModelHintSchema = z8.object({
|
|
218919
219237
|
/**
|
|
218920
219238
|
* A hint for a model name.
|
|
218921
219239
|
*/
|
|
218922
|
-
name:
|
|
219240
|
+
name: z8.string().optional()
|
|
218923
219241
|
}).passthrough();
|
|
218924
|
-
ModelPreferencesSchema =
|
|
219242
|
+
ModelPreferencesSchema = z8.object({
|
|
218925
219243
|
/**
|
|
218926
219244
|
* Optional hints to use for model selection.
|
|
218927
219245
|
*/
|
|
218928
|
-
hints:
|
|
219246
|
+
hints: z8.optional(z8.array(ModelHintSchema)),
|
|
218929
219247
|
/**
|
|
218930
219248
|
* How much to prioritize cost when selecting a model.
|
|
218931
219249
|
*/
|
|
218932
|
-
costPriority:
|
|
219250
|
+
costPriority: z8.optional(z8.number().min(0).max(1)),
|
|
218933
219251
|
/**
|
|
218934
219252
|
* How much to prioritize sampling speed (latency) when selecting a model.
|
|
218935
219253
|
*/
|
|
218936
|
-
speedPriority:
|
|
219254
|
+
speedPriority: z8.optional(z8.number().min(0).max(1)),
|
|
218937
219255
|
/**
|
|
218938
219256
|
* How much to prioritize intelligence and capabilities when selecting a model.
|
|
218939
219257
|
*/
|
|
218940
|
-
intelligencePriority:
|
|
219258
|
+
intelligencePriority: z8.optional(z8.number().min(0).max(1))
|
|
218941
219259
|
}).passthrough();
|
|
218942
|
-
SamplingMessageSchema =
|
|
218943
|
-
role:
|
|
218944
|
-
content:
|
|
219260
|
+
SamplingMessageSchema = z8.object({
|
|
219261
|
+
role: z8.enum(["user", "assistant"]),
|
|
219262
|
+
content: z8.union([TextContentSchema, ImageContentSchema, AudioContentSchema])
|
|
218945
219263
|
}).passthrough();
|
|
218946
219264
|
CreateMessageRequestSchema = RequestSchema.extend({
|
|
218947
|
-
method:
|
|
219265
|
+
method: z8.literal("sampling/createMessage"),
|
|
218948
219266
|
params: BaseRequestParamsSchema.extend({
|
|
218949
|
-
messages:
|
|
219267
|
+
messages: z8.array(SamplingMessageSchema),
|
|
218950
219268
|
/**
|
|
218951
219269
|
* An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
|
|
218952
219270
|
*/
|
|
218953
|
-
systemPrompt:
|
|
219271
|
+
systemPrompt: z8.optional(z8.string()),
|
|
218954
219272
|
/**
|
|
218955
219273
|
* A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. The client MAY ignore this request.
|
|
218956
219274
|
*/
|
|
218957
|
-
includeContext:
|
|
218958
|
-
temperature:
|
|
219275
|
+
includeContext: z8.optional(z8.enum(["none", "thisServer", "allServers"])),
|
|
219276
|
+
temperature: z8.optional(z8.number()),
|
|
218959
219277
|
/**
|
|
218960
219278
|
* The maximum number of tokens to sample, as requested by the server. The client MAY choose to sample fewer tokens than requested.
|
|
218961
219279
|
*/
|
|
218962
|
-
maxTokens:
|
|
218963
|
-
stopSequences:
|
|
219280
|
+
maxTokens: z8.number().int(),
|
|
219281
|
+
stopSequences: z8.optional(z8.array(z8.string())),
|
|
218964
219282
|
/**
|
|
218965
219283
|
* Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
|
|
218966
219284
|
*/
|
|
218967
|
-
metadata:
|
|
219285
|
+
metadata: z8.optional(z8.object({}).passthrough()),
|
|
218968
219286
|
/**
|
|
218969
219287
|
* The server's preferences for which model to select.
|
|
218970
219288
|
*/
|
|
218971
|
-
modelPreferences:
|
|
219289
|
+
modelPreferences: z8.optional(ModelPreferencesSchema)
|
|
218972
219290
|
})
|
|
218973
219291
|
});
|
|
218974
219292
|
CreateMessageResultSchema = ResultSchema.extend({
|
|
218975
219293
|
/**
|
|
218976
219294
|
* The name of the model that generated the message.
|
|
218977
219295
|
*/
|
|
218978
|
-
model:
|
|
219296
|
+
model: z8.string(),
|
|
218979
219297
|
/**
|
|
218980
219298
|
* The reason why sampling stopped.
|
|
218981
219299
|
*/
|
|
218982
|
-
stopReason:
|
|
218983
|
-
role:
|
|
218984
|
-
content:
|
|
219300
|
+
stopReason: z8.optional(z8.enum(["endTurn", "stopSequence", "maxTokens"]).or(z8.string())),
|
|
219301
|
+
role: z8.enum(["user", "assistant"]),
|
|
219302
|
+
content: z8.discriminatedUnion("type", [
|
|
218985
219303
|
TextContentSchema,
|
|
218986
219304
|
ImageContentSchema,
|
|
218987
219305
|
AudioContentSchema
|
|
218988
219306
|
])
|
|
218989
219307
|
});
|
|
218990
|
-
BooleanSchemaSchema =
|
|
218991
|
-
type:
|
|
218992
|
-
title:
|
|
218993
|
-
description:
|
|
218994
|
-
default:
|
|
219308
|
+
BooleanSchemaSchema = z8.object({
|
|
219309
|
+
type: z8.literal("boolean"),
|
|
219310
|
+
title: z8.optional(z8.string()),
|
|
219311
|
+
description: z8.optional(z8.string()),
|
|
219312
|
+
default: z8.optional(z8.boolean())
|
|
218995
219313
|
}).passthrough();
|
|
218996
|
-
StringSchemaSchema =
|
|
218997
|
-
type:
|
|
218998
|
-
title:
|
|
218999
|
-
description:
|
|
219000
|
-
minLength:
|
|
219001
|
-
maxLength:
|
|
219002
|
-
format:
|
|
219314
|
+
StringSchemaSchema = z8.object({
|
|
219315
|
+
type: z8.literal("string"),
|
|
219316
|
+
title: z8.optional(z8.string()),
|
|
219317
|
+
description: z8.optional(z8.string()),
|
|
219318
|
+
minLength: z8.optional(z8.number()),
|
|
219319
|
+
maxLength: z8.optional(z8.number()),
|
|
219320
|
+
format: z8.optional(z8.enum(["email", "uri", "date", "date-time"]))
|
|
219003
219321
|
}).passthrough();
|
|
219004
|
-
NumberSchemaSchema =
|
|
219005
|
-
type:
|
|
219006
|
-
title:
|
|
219007
|
-
description:
|
|
219008
|
-
minimum:
|
|
219009
|
-
maximum:
|
|
219322
|
+
NumberSchemaSchema = z8.object({
|
|
219323
|
+
type: z8.enum(["number", "integer"]),
|
|
219324
|
+
title: z8.optional(z8.string()),
|
|
219325
|
+
description: z8.optional(z8.string()),
|
|
219326
|
+
minimum: z8.optional(z8.number()),
|
|
219327
|
+
maximum: z8.optional(z8.number())
|
|
219010
219328
|
}).passthrough();
|
|
219011
|
-
EnumSchemaSchema =
|
|
219012
|
-
type:
|
|
219013
|
-
title:
|
|
219014
|
-
description:
|
|
219015
|
-
enum:
|
|
219016
|
-
enumNames:
|
|
219329
|
+
EnumSchemaSchema = z8.object({
|
|
219330
|
+
type: z8.literal("string"),
|
|
219331
|
+
title: z8.optional(z8.string()),
|
|
219332
|
+
description: z8.optional(z8.string()),
|
|
219333
|
+
enum: z8.array(z8.string()),
|
|
219334
|
+
enumNames: z8.optional(z8.array(z8.string()))
|
|
219017
219335
|
}).passthrough();
|
|
219018
|
-
PrimitiveSchemaDefinitionSchema =
|
|
219336
|
+
PrimitiveSchemaDefinitionSchema = z8.union([
|
|
219019
219337
|
BooleanSchemaSchema,
|
|
219020
219338
|
StringSchemaSchema,
|
|
219021
219339
|
NumberSchemaSchema,
|
|
219022
219340
|
EnumSchemaSchema
|
|
219023
219341
|
]);
|
|
219024
219342
|
ElicitRequestSchema = RequestSchema.extend({
|
|
219025
|
-
method:
|
|
219343
|
+
method: z8.literal("elicitation/create"),
|
|
219026
219344
|
params: BaseRequestParamsSchema.extend({
|
|
219027
219345
|
/**
|
|
219028
219346
|
* The message to present to the user.
|
|
219029
219347
|
*/
|
|
219030
|
-
message:
|
|
219348
|
+
message: z8.string(),
|
|
219031
219349
|
/**
|
|
219032
219350
|
* The schema for the requested user input.
|
|
219033
219351
|
*/
|
|
219034
|
-
requestedSchema:
|
|
219035
|
-
type:
|
|
219036
|
-
properties:
|
|
219037
|
-
required:
|
|
219352
|
+
requestedSchema: z8.object({
|
|
219353
|
+
type: z8.literal("object"),
|
|
219354
|
+
properties: z8.record(z8.string(), PrimitiveSchemaDefinitionSchema),
|
|
219355
|
+
required: z8.optional(z8.array(z8.string()))
|
|
219038
219356
|
}).passthrough()
|
|
219039
219357
|
})
|
|
219040
219358
|
});
|
|
@@ -219042,92 +219360,92 @@ var init_types2 = __esm({
|
|
|
219042
219360
|
/**
|
|
219043
219361
|
* The user's response action.
|
|
219044
219362
|
*/
|
|
219045
|
-
action:
|
|
219363
|
+
action: z8.enum(["accept", "decline", "cancel"]),
|
|
219046
219364
|
/**
|
|
219047
219365
|
* The collected user input content (only present if action is "accept").
|
|
219048
219366
|
*/
|
|
219049
|
-
content:
|
|
219367
|
+
content: z8.optional(z8.record(z8.string(), z8.unknown()))
|
|
219050
219368
|
});
|
|
219051
|
-
ResourceTemplateReferenceSchema =
|
|
219052
|
-
type:
|
|
219369
|
+
ResourceTemplateReferenceSchema = z8.object({
|
|
219370
|
+
type: z8.literal("ref/resource"),
|
|
219053
219371
|
/**
|
|
219054
219372
|
* The URI or URI template of the resource.
|
|
219055
219373
|
*/
|
|
219056
|
-
uri:
|
|
219374
|
+
uri: z8.string()
|
|
219057
219375
|
}).passthrough();
|
|
219058
|
-
PromptReferenceSchema =
|
|
219059
|
-
type:
|
|
219376
|
+
PromptReferenceSchema = z8.object({
|
|
219377
|
+
type: z8.literal("ref/prompt"),
|
|
219060
219378
|
/**
|
|
219061
219379
|
* The name of the prompt or prompt template
|
|
219062
219380
|
*/
|
|
219063
|
-
name:
|
|
219381
|
+
name: z8.string()
|
|
219064
219382
|
}).passthrough();
|
|
219065
219383
|
CompleteRequestSchema = RequestSchema.extend({
|
|
219066
|
-
method:
|
|
219384
|
+
method: z8.literal("completion/complete"),
|
|
219067
219385
|
params: BaseRequestParamsSchema.extend({
|
|
219068
|
-
ref:
|
|
219386
|
+
ref: z8.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
219069
219387
|
/**
|
|
219070
219388
|
* The argument's information
|
|
219071
219389
|
*/
|
|
219072
|
-
argument:
|
|
219390
|
+
argument: z8.object({
|
|
219073
219391
|
/**
|
|
219074
219392
|
* The name of the argument
|
|
219075
219393
|
*/
|
|
219076
|
-
name:
|
|
219394
|
+
name: z8.string(),
|
|
219077
219395
|
/**
|
|
219078
219396
|
* The value of the argument to use for completion matching.
|
|
219079
219397
|
*/
|
|
219080
|
-
value:
|
|
219398
|
+
value: z8.string()
|
|
219081
219399
|
}).passthrough(),
|
|
219082
|
-
context:
|
|
219400
|
+
context: z8.optional(z8.object({
|
|
219083
219401
|
/**
|
|
219084
219402
|
* Previously-resolved variables in a URI template or prompt.
|
|
219085
219403
|
*/
|
|
219086
|
-
arguments:
|
|
219404
|
+
arguments: z8.optional(z8.record(z8.string(), z8.string()))
|
|
219087
219405
|
}))
|
|
219088
219406
|
})
|
|
219089
219407
|
});
|
|
219090
219408
|
CompleteResultSchema = ResultSchema.extend({
|
|
219091
|
-
completion:
|
|
219409
|
+
completion: z8.object({
|
|
219092
219410
|
/**
|
|
219093
219411
|
* An array of completion values. Must not exceed 100 items.
|
|
219094
219412
|
*/
|
|
219095
|
-
values:
|
|
219413
|
+
values: z8.array(z8.string()).max(100),
|
|
219096
219414
|
/**
|
|
219097
219415
|
* The total number of completion options available. This can exceed the number of values actually sent in the response.
|
|
219098
219416
|
*/
|
|
219099
|
-
total:
|
|
219417
|
+
total: z8.optional(z8.number().int()),
|
|
219100
219418
|
/**
|
|
219101
219419
|
* Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
|
|
219102
219420
|
*/
|
|
219103
|
-
hasMore:
|
|
219421
|
+
hasMore: z8.optional(z8.boolean())
|
|
219104
219422
|
}).passthrough()
|
|
219105
219423
|
});
|
|
219106
|
-
RootSchema =
|
|
219424
|
+
RootSchema = z8.object({
|
|
219107
219425
|
/**
|
|
219108
219426
|
* The URI identifying the root. This *must* start with file:// for now.
|
|
219109
219427
|
*/
|
|
219110
|
-
uri:
|
|
219428
|
+
uri: z8.string().startsWith("file://"),
|
|
219111
219429
|
/**
|
|
219112
219430
|
* An optional name for the root.
|
|
219113
219431
|
*/
|
|
219114
|
-
name:
|
|
219432
|
+
name: z8.optional(z8.string()),
|
|
219115
219433
|
/**
|
|
219116
219434
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
219117
219435
|
* for notes on _meta usage.
|
|
219118
219436
|
*/
|
|
219119
|
-
_meta:
|
|
219437
|
+
_meta: z8.optional(z8.object({}).passthrough())
|
|
219120
219438
|
}).passthrough();
|
|
219121
219439
|
ListRootsRequestSchema = RequestSchema.extend({
|
|
219122
|
-
method:
|
|
219440
|
+
method: z8.literal("roots/list")
|
|
219123
219441
|
});
|
|
219124
219442
|
ListRootsResultSchema = ResultSchema.extend({
|
|
219125
|
-
roots:
|
|
219443
|
+
roots: z8.array(RootSchema)
|
|
219126
219444
|
});
|
|
219127
219445
|
RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
219128
|
-
method:
|
|
219446
|
+
method: z8.literal("notifications/roots/list_changed")
|
|
219129
219447
|
});
|
|
219130
|
-
ClientRequestSchema =
|
|
219448
|
+
ClientRequestSchema = z8.union([
|
|
219131
219449
|
PingRequestSchema,
|
|
219132
219450
|
InitializeRequestSchema,
|
|
219133
219451
|
CompleteRequestSchema,
|
|
@@ -219142,25 +219460,25 @@ var init_types2 = __esm({
|
|
|
219142
219460
|
CallToolRequestSchema,
|
|
219143
219461
|
ListToolsRequestSchema
|
|
219144
219462
|
]);
|
|
219145
|
-
ClientNotificationSchema =
|
|
219463
|
+
ClientNotificationSchema = z8.union([
|
|
219146
219464
|
CancelledNotificationSchema,
|
|
219147
219465
|
ProgressNotificationSchema,
|
|
219148
219466
|
InitializedNotificationSchema,
|
|
219149
219467
|
RootsListChangedNotificationSchema
|
|
219150
219468
|
]);
|
|
219151
|
-
ClientResultSchema =
|
|
219469
|
+
ClientResultSchema = z8.union([
|
|
219152
219470
|
EmptyResultSchema,
|
|
219153
219471
|
CreateMessageResultSchema,
|
|
219154
219472
|
ElicitResultSchema,
|
|
219155
219473
|
ListRootsResultSchema
|
|
219156
219474
|
]);
|
|
219157
|
-
ServerRequestSchema =
|
|
219475
|
+
ServerRequestSchema = z8.union([
|
|
219158
219476
|
PingRequestSchema,
|
|
219159
219477
|
CreateMessageRequestSchema,
|
|
219160
219478
|
ElicitRequestSchema,
|
|
219161
219479
|
ListRootsRequestSchema
|
|
219162
219480
|
]);
|
|
219163
|
-
ServerNotificationSchema =
|
|
219481
|
+
ServerNotificationSchema = z8.union([
|
|
219164
219482
|
CancelledNotificationSchema,
|
|
219165
219483
|
ProgressNotificationSchema,
|
|
219166
219484
|
LoggingMessageNotificationSchema,
|
|
@@ -219169,7 +219487,7 @@ var init_types2 = __esm({
|
|
|
219169
219487
|
ToolListChangedNotificationSchema,
|
|
219170
219488
|
PromptListChangedNotificationSchema
|
|
219171
219489
|
]);
|
|
219172
|
-
ServerResultSchema =
|
|
219490
|
+
ServerResultSchema = z8.union([
|
|
219173
219491
|
EmptyResultSchema,
|
|
219174
219492
|
InitializeResultSchema,
|
|
219175
219493
|
CompleteResultSchema,
|
|
@@ -219185,134 +219503,134 @@ var init_types2 = __esm({
|
|
|
219185
219503
|
});
|
|
219186
219504
|
|
|
219187
219505
|
// ../node_modules/.pnpm/@modelcontextprotocol+sdk@1.17.2/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
219188
|
-
import { z as
|
|
219506
|
+
import { z as z9 } from "zod";
|
|
219189
219507
|
var OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, OAuthErrorResponseSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema, OAuthClientRegistrationErrorSchema, OAuthTokenRevocationRequestSchema;
|
|
219190
219508
|
var init_auth = __esm({
|
|
219191
219509
|
"../node_modules/.pnpm/@modelcontextprotocol+sdk@1.17.2/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js"() {
|
|
219192
219510
|
"use strict";
|
|
219193
219511
|
init_esm_shims();
|
|
219194
|
-
OAuthProtectedResourceMetadataSchema =
|
|
219195
|
-
resource:
|
|
219196
|
-
authorization_servers:
|
|
219197
|
-
jwks_uri:
|
|
219198
|
-
scopes_supported:
|
|
219199
|
-
bearer_methods_supported:
|
|
219200
|
-
resource_signing_alg_values_supported:
|
|
219201
|
-
resource_name:
|
|
219202
|
-
resource_documentation:
|
|
219203
|
-
resource_policy_uri:
|
|
219204
|
-
resource_tos_uri:
|
|
219205
|
-
tls_client_certificate_bound_access_tokens:
|
|
219206
|
-
authorization_details_types_supported:
|
|
219207
|
-
dpop_signing_alg_values_supported:
|
|
219208
|
-
dpop_bound_access_tokens_required:
|
|
219512
|
+
OAuthProtectedResourceMetadataSchema = z9.object({
|
|
219513
|
+
resource: z9.string().url(),
|
|
219514
|
+
authorization_servers: z9.array(z9.string().url()).optional(),
|
|
219515
|
+
jwks_uri: z9.string().url().optional(),
|
|
219516
|
+
scopes_supported: z9.array(z9.string()).optional(),
|
|
219517
|
+
bearer_methods_supported: z9.array(z9.string()).optional(),
|
|
219518
|
+
resource_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219519
|
+
resource_name: z9.string().optional(),
|
|
219520
|
+
resource_documentation: z9.string().optional(),
|
|
219521
|
+
resource_policy_uri: z9.string().url().optional(),
|
|
219522
|
+
resource_tos_uri: z9.string().url().optional(),
|
|
219523
|
+
tls_client_certificate_bound_access_tokens: z9.boolean().optional(),
|
|
219524
|
+
authorization_details_types_supported: z9.array(z9.string()).optional(),
|
|
219525
|
+
dpop_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219526
|
+
dpop_bound_access_tokens_required: z9.boolean().optional()
|
|
219209
219527
|
}).passthrough();
|
|
219210
|
-
OAuthMetadataSchema =
|
|
219211
|
-
issuer:
|
|
219212
|
-
authorization_endpoint:
|
|
219213
|
-
token_endpoint:
|
|
219214
|
-
registration_endpoint:
|
|
219215
|
-
scopes_supported:
|
|
219216
|
-
response_types_supported:
|
|
219217
|
-
response_modes_supported:
|
|
219218
|
-
grant_types_supported:
|
|
219219
|
-
token_endpoint_auth_methods_supported:
|
|
219220
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
219221
|
-
service_documentation:
|
|
219222
|
-
revocation_endpoint:
|
|
219223
|
-
revocation_endpoint_auth_methods_supported:
|
|
219224
|
-
revocation_endpoint_auth_signing_alg_values_supported:
|
|
219225
|
-
introspection_endpoint:
|
|
219226
|
-
introspection_endpoint_auth_methods_supported:
|
|
219227
|
-
introspection_endpoint_auth_signing_alg_values_supported:
|
|
219228
|
-
code_challenge_methods_supported:
|
|
219528
|
+
OAuthMetadataSchema = z9.object({
|
|
219529
|
+
issuer: z9.string(),
|
|
219530
|
+
authorization_endpoint: z9.string(),
|
|
219531
|
+
token_endpoint: z9.string(),
|
|
219532
|
+
registration_endpoint: z9.string().optional(),
|
|
219533
|
+
scopes_supported: z9.array(z9.string()).optional(),
|
|
219534
|
+
response_types_supported: z9.array(z9.string()),
|
|
219535
|
+
response_modes_supported: z9.array(z9.string()).optional(),
|
|
219536
|
+
grant_types_supported: z9.array(z9.string()).optional(),
|
|
219537
|
+
token_endpoint_auth_methods_supported: z9.array(z9.string()).optional(),
|
|
219538
|
+
token_endpoint_auth_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219539
|
+
service_documentation: z9.string().optional(),
|
|
219540
|
+
revocation_endpoint: z9.string().optional(),
|
|
219541
|
+
revocation_endpoint_auth_methods_supported: z9.array(z9.string()).optional(),
|
|
219542
|
+
revocation_endpoint_auth_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219543
|
+
introspection_endpoint: z9.string().optional(),
|
|
219544
|
+
introspection_endpoint_auth_methods_supported: z9.array(z9.string()).optional(),
|
|
219545
|
+
introspection_endpoint_auth_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219546
|
+
code_challenge_methods_supported: z9.array(z9.string()).optional()
|
|
219229
219547
|
}).passthrough();
|
|
219230
|
-
OpenIdProviderMetadataSchema =
|
|
219231
|
-
issuer:
|
|
219232
|
-
authorization_endpoint:
|
|
219233
|
-
token_endpoint:
|
|
219234
|
-
userinfo_endpoint:
|
|
219235
|
-
jwks_uri:
|
|
219236
|
-
registration_endpoint:
|
|
219237
|
-
scopes_supported:
|
|
219238
|
-
response_types_supported:
|
|
219239
|
-
response_modes_supported:
|
|
219240
|
-
grant_types_supported:
|
|
219241
|
-
acr_values_supported:
|
|
219242
|
-
subject_types_supported:
|
|
219243
|
-
id_token_signing_alg_values_supported:
|
|
219244
|
-
id_token_encryption_alg_values_supported:
|
|
219245
|
-
id_token_encryption_enc_values_supported:
|
|
219246
|
-
userinfo_signing_alg_values_supported:
|
|
219247
|
-
userinfo_encryption_alg_values_supported:
|
|
219248
|
-
userinfo_encryption_enc_values_supported:
|
|
219249
|
-
request_object_signing_alg_values_supported:
|
|
219250
|
-
request_object_encryption_alg_values_supported:
|
|
219251
|
-
request_object_encryption_enc_values_supported:
|
|
219252
|
-
token_endpoint_auth_methods_supported:
|
|
219253
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
219254
|
-
display_values_supported:
|
|
219255
|
-
claim_types_supported:
|
|
219256
|
-
claims_supported:
|
|
219257
|
-
service_documentation:
|
|
219258
|
-
claims_locales_supported:
|
|
219259
|
-
ui_locales_supported:
|
|
219260
|
-
claims_parameter_supported:
|
|
219261
|
-
request_parameter_supported:
|
|
219262
|
-
request_uri_parameter_supported:
|
|
219263
|
-
require_request_uri_registration:
|
|
219264
|
-
op_policy_uri:
|
|
219265
|
-
op_tos_uri:
|
|
219548
|
+
OpenIdProviderMetadataSchema = z9.object({
|
|
219549
|
+
issuer: z9.string(),
|
|
219550
|
+
authorization_endpoint: z9.string(),
|
|
219551
|
+
token_endpoint: z9.string(),
|
|
219552
|
+
userinfo_endpoint: z9.string().optional(),
|
|
219553
|
+
jwks_uri: z9.string(),
|
|
219554
|
+
registration_endpoint: z9.string().optional(),
|
|
219555
|
+
scopes_supported: z9.array(z9.string()).optional(),
|
|
219556
|
+
response_types_supported: z9.array(z9.string()),
|
|
219557
|
+
response_modes_supported: z9.array(z9.string()).optional(),
|
|
219558
|
+
grant_types_supported: z9.array(z9.string()).optional(),
|
|
219559
|
+
acr_values_supported: z9.array(z9.string()).optional(),
|
|
219560
|
+
subject_types_supported: z9.array(z9.string()),
|
|
219561
|
+
id_token_signing_alg_values_supported: z9.array(z9.string()),
|
|
219562
|
+
id_token_encryption_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219563
|
+
id_token_encryption_enc_values_supported: z9.array(z9.string()).optional(),
|
|
219564
|
+
userinfo_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219565
|
+
userinfo_encryption_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219566
|
+
userinfo_encryption_enc_values_supported: z9.array(z9.string()).optional(),
|
|
219567
|
+
request_object_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219568
|
+
request_object_encryption_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219569
|
+
request_object_encryption_enc_values_supported: z9.array(z9.string()).optional(),
|
|
219570
|
+
token_endpoint_auth_methods_supported: z9.array(z9.string()).optional(),
|
|
219571
|
+
token_endpoint_auth_signing_alg_values_supported: z9.array(z9.string()).optional(),
|
|
219572
|
+
display_values_supported: z9.array(z9.string()).optional(),
|
|
219573
|
+
claim_types_supported: z9.array(z9.string()).optional(),
|
|
219574
|
+
claims_supported: z9.array(z9.string()).optional(),
|
|
219575
|
+
service_documentation: z9.string().optional(),
|
|
219576
|
+
claims_locales_supported: z9.array(z9.string()).optional(),
|
|
219577
|
+
ui_locales_supported: z9.array(z9.string()).optional(),
|
|
219578
|
+
claims_parameter_supported: z9.boolean().optional(),
|
|
219579
|
+
request_parameter_supported: z9.boolean().optional(),
|
|
219580
|
+
request_uri_parameter_supported: z9.boolean().optional(),
|
|
219581
|
+
require_request_uri_registration: z9.boolean().optional(),
|
|
219582
|
+
op_policy_uri: z9.string().optional(),
|
|
219583
|
+
op_tos_uri: z9.string().optional()
|
|
219266
219584
|
}).passthrough();
|
|
219267
219585
|
OpenIdProviderDiscoveryMetadataSchema = OpenIdProviderMetadataSchema.merge(OAuthMetadataSchema.pick({
|
|
219268
219586
|
code_challenge_methods_supported: true
|
|
219269
219587
|
}));
|
|
219270
|
-
OAuthTokensSchema =
|
|
219271
|
-
access_token:
|
|
219272
|
-
id_token:
|
|
219588
|
+
OAuthTokensSchema = z9.object({
|
|
219589
|
+
access_token: z9.string(),
|
|
219590
|
+
id_token: z9.string().optional(),
|
|
219273
219591
|
// Optional for OAuth 2.1, but necessary in OpenID Connect
|
|
219274
|
-
token_type:
|
|
219275
|
-
expires_in:
|
|
219276
|
-
scope:
|
|
219277
|
-
refresh_token:
|
|
219592
|
+
token_type: z9.string(),
|
|
219593
|
+
expires_in: z9.number().optional(),
|
|
219594
|
+
scope: z9.string().optional(),
|
|
219595
|
+
refresh_token: z9.string().optional()
|
|
219278
219596
|
}).strip();
|
|
219279
|
-
OAuthErrorResponseSchema =
|
|
219280
|
-
error:
|
|
219281
|
-
error_description:
|
|
219282
|
-
error_uri:
|
|
219597
|
+
OAuthErrorResponseSchema = z9.object({
|
|
219598
|
+
error: z9.string(),
|
|
219599
|
+
error_description: z9.string().optional(),
|
|
219600
|
+
error_uri: z9.string().optional()
|
|
219283
219601
|
});
|
|
219284
|
-
OAuthClientMetadataSchema =
|
|
219285
|
-
redirect_uris:
|
|
219286
|
-
token_endpoint_auth_method:
|
|
219287
|
-
grant_types:
|
|
219288
|
-
response_types:
|
|
219289
|
-
client_name:
|
|
219290
|
-
client_uri:
|
|
219291
|
-
logo_uri:
|
|
219292
|
-
scope:
|
|
219293
|
-
contacts:
|
|
219294
|
-
tos_uri:
|
|
219295
|
-
policy_uri:
|
|
219296
|
-
jwks_uri:
|
|
219297
|
-
jwks:
|
|
219298
|
-
software_id:
|
|
219299
|
-
software_version:
|
|
219300
|
-
software_statement:
|
|
219602
|
+
OAuthClientMetadataSchema = z9.object({
|
|
219603
|
+
redirect_uris: z9.array(z9.string()).refine((uris) => uris.every((uri) => URL.canParse(uri)), { message: "redirect_uris must contain valid URLs" }),
|
|
219604
|
+
token_endpoint_auth_method: z9.string().optional(),
|
|
219605
|
+
grant_types: z9.array(z9.string()).optional(),
|
|
219606
|
+
response_types: z9.array(z9.string()).optional(),
|
|
219607
|
+
client_name: z9.string().optional(),
|
|
219608
|
+
client_uri: z9.string().optional(),
|
|
219609
|
+
logo_uri: z9.string().optional(),
|
|
219610
|
+
scope: z9.string().optional(),
|
|
219611
|
+
contacts: z9.array(z9.string()).optional(),
|
|
219612
|
+
tos_uri: z9.string().optional(),
|
|
219613
|
+
policy_uri: z9.string().optional(),
|
|
219614
|
+
jwks_uri: z9.string().optional(),
|
|
219615
|
+
jwks: z9.any().optional(),
|
|
219616
|
+
software_id: z9.string().optional(),
|
|
219617
|
+
software_version: z9.string().optional(),
|
|
219618
|
+
software_statement: z9.string().optional()
|
|
219301
219619
|
}).strip();
|
|
219302
|
-
OAuthClientInformationSchema =
|
|
219303
|
-
client_id:
|
|
219304
|
-
client_secret:
|
|
219305
|
-
client_id_issued_at:
|
|
219306
|
-
client_secret_expires_at:
|
|
219620
|
+
OAuthClientInformationSchema = z9.object({
|
|
219621
|
+
client_id: z9.string(),
|
|
219622
|
+
client_secret: z9.string().optional(),
|
|
219623
|
+
client_id_issued_at: z9.number().optional(),
|
|
219624
|
+
client_secret_expires_at: z9.number().optional()
|
|
219307
219625
|
}).strip();
|
|
219308
219626
|
OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
219309
|
-
OAuthClientRegistrationErrorSchema =
|
|
219310
|
-
error:
|
|
219311
|
-
error_description:
|
|
219627
|
+
OAuthClientRegistrationErrorSchema = z9.object({
|
|
219628
|
+
error: z9.string(),
|
|
219629
|
+
error_description: z9.string().optional()
|
|
219312
219630
|
}).strip();
|
|
219313
|
-
OAuthTokenRevocationRequestSchema =
|
|
219314
|
-
token:
|
|
219315
|
-
token_type_hint:
|
|
219631
|
+
OAuthTokenRevocationRequestSchema = z9.object({
|
|
219632
|
+
token: z9.string(),
|
|
219633
|
+
token_type_hint: z9.string().optional()
|
|
219316
219634
|
}).strip();
|
|
219317
219635
|
}
|
|
219318
219636
|
});
|
|
@@ -219475,7 +219793,7 @@ var init_error = __esm({
|
|
|
219475
219793
|
init_dist4();
|
|
219476
219794
|
init_http_exception();
|
|
219477
219795
|
init_logger();
|
|
219478
|
-
ErrorCode2 =
|
|
219796
|
+
ErrorCode2 = z5.enum([
|
|
219479
219797
|
"bad_request",
|
|
219480
219798
|
"unauthorized",
|
|
219481
219799
|
"forbidden",
|
|
@@ -219493,28 +219811,28 @@ var init_error = __esm({
|
|
|
219493
219811
|
unprocessable_entity: 422,
|
|
219494
219812
|
internal_server_error: 500
|
|
219495
219813
|
};
|
|
219496
|
-
problemDetailsSchema =
|
|
219814
|
+
problemDetailsSchema = z5.object({
|
|
219497
219815
|
// type: z.string().url().openapi({
|
|
219498
219816
|
// description: "A URI reference that identifies the problem type.",
|
|
219499
219817
|
// example: `${ERROR_DOCS_BASE_URL}#not-found`,
|
|
219500
219818
|
// }),
|
|
219501
|
-
title:
|
|
219819
|
+
title: z5.string().openapi({
|
|
219502
219820
|
description: "A short, human-readable summary of the problem type.",
|
|
219503
219821
|
example: "Resource Not Found"
|
|
219504
219822
|
}),
|
|
219505
|
-
status:
|
|
219823
|
+
status: z5.number().int().openapi({
|
|
219506
219824
|
description: "The HTTP status code.",
|
|
219507
219825
|
example: 404
|
|
219508
219826
|
}),
|
|
219509
|
-
detail:
|
|
219827
|
+
detail: z5.string().openapi({
|
|
219510
219828
|
description: "A human-readable explanation specific to this occurrence of the problem.",
|
|
219511
219829
|
example: "The requested resource was not found."
|
|
219512
219830
|
}),
|
|
219513
|
-
instance:
|
|
219831
|
+
instance: z5.string().optional().openapi({
|
|
219514
219832
|
description: "A URI reference that identifies the specific occurrence of the problem.",
|
|
219515
219833
|
example: "/conversations/123"
|
|
219516
219834
|
}),
|
|
219517
|
-
requestId:
|
|
219835
|
+
requestId: z5.string().optional().openapi({
|
|
219518
219836
|
description: "A unique identifier for the request, useful for troubleshooting.",
|
|
219519
219837
|
example: "req_1234567890"
|
|
219520
219838
|
}),
|
|
@@ -219523,13 +219841,13 @@ var init_error = __esm({
|
|
|
219523
219841
|
example: "not_found"
|
|
219524
219842
|
})
|
|
219525
219843
|
}).openapi("ProblemDetails");
|
|
219526
|
-
errorResponseSchema =
|
|
219527
|
-
error:
|
|
219844
|
+
errorResponseSchema = z5.object({
|
|
219845
|
+
error: z5.object({
|
|
219528
219846
|
code: ErrorCode2.openapi({
|
|
219529
219847
|
description: "A short code indicating the error code returned.",
|
|
219530
219848
|
example: "not_found"
|
|
219531
219849
|
}),
|
|
219532
|
-
message:
|
|
219850
|
+
message: z5.string().openapi({
|
|
219533
219851
|
description: "A human readable error message.",
|
|
219534
219852
|
example: "The requested resource was not found."
|
|
219535
219853
|
})
|
|
@@ -219541,15 +219859,15 @@ var init_error = __esm({
|
|
|
219541
219859
|
content: {
|
|
219542
219860
|
"application/problem+json": {
|
|
219543
219861
|
schema: problemDetailsSchema.extend({
|
|
219544
|
-
code:
|
|
219862
|
+
code: z5.literal(code).openapi({
|
|
219545
219863
|
description: "A short code indicating the error code returned.",
|
|
219546
219864
|
example: code
|
|
219547
219865
|
}),
|
|
219548
|
-
detail:
|
|
219866
|
+
detail: z5.string().openapi({
|
|
219549
219867
|
description: "A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.",
|
|
219550
219868
|
example: description
|
|
219551
219869
|
}),
|
|
219552
|
-
title:
|
|
219870
|
+
title: z5.string().openapi({
|
|
219553
219871
|
description: "A short, human-readable summary of the problem type.",
|
|
219554
219872
|
example: getTitleFromCode(code)
|
|
219555
219873
|
}),
|
|
@@ -219557,16 +219875,16 @@ var init_error = __esm({
|
|
|
219557
219875
|
// description: "A URI reference that identifies the problem type.",
|
|
219558
219876
|
// example: `${ERROR_DOCS_BASE_URL}#${code}`,
|
|
219559
219877
|
// }),
|
|
219560
|
-
status:
|
|
219878
|
+
status: z5.literal(errorCodeToHttpStatus[code]).openapi({
|
|
219561
219879
|
description: "The HTTP status code.",
|
|
219562
219880
|
example: errorCodeToHttpStatus[code]
|
|
219563
219881
|
}),
|
|
219564
|
-
error:
|
|
219565
|
-
code:
|
|
219882
|
+
error: z5.object({
|
|
219883
|
+
code: z5.literal(code).openapi({
|
|
219566
219884
|
description: "A short code indicating the error code returned.",
|
|
219567
219885
|
example: code
|
|
219568
219886
|
}),
|
|
219569
|
-
message:
|
|
219887
|
+
message: z5.string().openapi({
|
|
219570
219888
|
description: "A concise error message suitable for display to end users. May be truncated if the full detail is long.",
|
|
219571
219889
|
example: description.length > 100 ? `${description.substring(0, 97)}...` : description
|
|
219572
219890
|
})
|
|
@@ -225932,7 +226250,7 @@ var init_exit_hook = __esm({
|
|
|
225932
226250
|
|
|
225933
226251
|
// ../packages/agents-core/src/utils/mcp-client.ts
|
|
225934
226252
|
import { tool } from "ai";
|
|
225935
|
-
import { z as
|
|
226253
|
+
import { z as z10 } from "zod";
|
|
225936
226254
|
var init_mcp_client = __esm({
|
|
225937
226255
|
"../packages/agents-core/src/utils/mcp-client.ts"() {
|
|
225938
226256
|
"use strict";
|
|
@@ -225943,148 +226261,11 @@ var init_mcp_client = __esm({
|
|
|
225943
226261
|
init_protocol();
|
|
225944
226262
|
init_types2();
|
|
225945
226263
|
init_exit_hook();
|
|
226264
|
+
init_execution_limits_shared();
|
|
225946
226265
|
init_utility();
|
|
225947
226266
|
}
|
|
225948
226267
|
});
|
|
225949
226268
|
|
|
225950
|
-
// ../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js
|
|
225951
|
-
var require_main = __commonJS({
|
|
225952
|
-
"../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js"(exports, module) {
|
|
225953
|
-
"use strict";
|
|
225954
|
-
init_esm_shims();
|
|
225955
|
-
function _resolveEscapeSequences(value) {
|
|
225956
|
-
return value.replace(/\\\$/g, "$");
|
|
225957
|
-
}
|
|
225958
|
-
function expandValue(value, processEnv, runningParsed) {
|
|
225959
|
-
const env3 = { ...runningParsed, ...processEnv };
|
|
225960
|
-
const regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g;
|
|
225961
|
-
let result = value;
|
|
225962
|
-
let match2;
|
|
225963
|
-
const seen = /* @__PURE__ */ new Set();
|
|
225964
|
-
while ((match2 = regex.exec(result)) !== null) {
|
|
225965
|
-
seen.add(result);
|
|
225966
|
-
const [template, bracedExpression, unbracedExpression] = match2;
|
|
225967
|
-
const expression = bracedExpression || unbracedExpression;
|
|
225968
|
-
const opRegex = /(:\+|\+|:-|-)/;
|
|
225969
|
-
const opMatch = expression.match(opRegex);
|
|
225970
|
-
const splitter = opMatch ? opMatch[0] : null;
|
|
225971
|
-
const r = expression.split(splitter);
|
|
225972
|
-
let defaultValue;
|
|
225973
|
-
let value2;
|
|
225974
|
-
const key = r.shift();
|
|
225975
|
-
if ([":+", "+"].includes(splitter)) {
|
|
225976
|
-
defaultValue = env3[key] ? r.join(splitter) : "";
|
|
225977
|
-
value2 = null;
|
|
225978
|
-
} else {
|
|
225979
|
-
defaultValue = r.join(splitter);
|
|
225980
|
-
value2 = env3[key];
|
|
225981
|
-
}
|
|
225982
|
-
if (value2) {
|
|
225983
|
-
if (seen.has(value2)) {
|
|
225984
|
-
result = result.replace(template, defaultValue);
|
|
225985
|
-
} else {
|
|
225986
|
-
result = result.replace(template, value2);
|
|
225987
|
-
}
|
|
225988
|
-
} else {
|
|
225989
|
-
result = result.replace(template, defaultValue);
|
|
225990
|
-
}
|
|
225991
|
-
if (result === runningParsed[key]) {
|
|
225992
|
-
break;
|
|
225993
|
-
}
|
|
225994
|
-
regex.lastIndex = 0;
|
|
225995
|
-
}
|
|
225996
|
-
return result;
|
|
225997
|
-
}
|
|
225998
|
-
function expand2(options) {
|
|
225999
|
-
const runningParsed = {};
|
|
226000
|
-
let processEnv = process.env;
|
|
226001
|
-
if (options && options.processEnv != null) {
|
|
226002
|
-
processEnv = options.processEnv;
|
|
226003
|
-
}
|
|
226004
|
-
for (const key in options.parsed) {
|
|
226005
|
-
let value = options.parsed[key];
|
|
226006
|
-
if (processEnv[key] && processEnv[key] !== value) {
|
|
226007
|
-
value = processEnv[key];
|
|
226008
|
-
} else {
|
|
226009
|
-
value = expandValue(value, processEnv, runningParsed);
|
|
226010
|
-
}
|
|
226011
|
-
options.parsed[key] = _resolveEscapeSequences(value);
|
|
226012
|
-
runningParsed[key] = _resolveEscapeSequences(value);
|
|
226013
|
-
}
|
|
226014
|
-
for (const processKey in options.parsed) {
|
|
226015
|
-
processEnv[processKey] = options.parsed[processKey];
|
|
226016
|
-
}
|
|
226017
|
-
return options;
|
|
226018
|
-
}
|
|
226019
|
-
module.exports.expand = expand2;
|
|
226020
|
-
}
|
|
226021
|
-
});
|
|
226022
|
-
|
|
226023
|
-
// ../packages/agents-core/src/env.ts
|
|
226024
|
-
import fs from "fs";
|
|
226025
|
-
import os from "os";
|
|
226026
|
-
import path2 from "path";
|
|
226027
|
-
import dotenv from "dotenv";
|
|
226028
|
-
import { findUpSync } from "find-up";
|
|
226029
|
-
import { z as z8 } from "zod";
|
|
226030
|
-
var import_dotenv_expand, loadEnvironmentFiles, envSchema, parseEnv, env;
|
|
226031
|
-
var init_env = __esm({
|
|
226032
|
-
"../packages/agents-core/src/env.ts"() {
|
|
226033
|
-
"use strict";
|
|
226034
|
-
init_esm_shims();
|
|
226035
|
-
import_dotenv_expand = __toESM(require_main(), 1);
|
|
226036
|
-
loadEnvironmentFiles = () => {
|
|
226037
|
-
const environmentFiles = [];
|
|
226038
|
-
const currentEnv = path2.resolve(process.cwd(), ".env");
|
|
226039
|
-
if (fs.existsSync(currentEnv)) {
|
|
226040
|
-
environmentFiles.push(currentEnv);
|
|
226041
|
-
}
|
|
226042
|
-
const rootEnv = findUpSync(".env", { cwd: path2.dirname(process.cwd()) });
|
|
226043
|
-
if (rootEnv) {
|
|
226044
|
-
if (rootEnv !== currentEnv) {
|
|
226045
|
-
environmentFiles.push(rootEnv);
|
|
226046
|
-
}
|
|
226047
|
-
}
|
|
226048
|
-
const userConfigPath = path2.join(os.homedir(), ".inkeep", "config");
|
|
226049
|
-
if (fs.existsSync(userConfigPath)) {
|
|
226050
|
-
dotenv.config({ path: userConfigPath, override: true, quiet: true });
|
|
226051
|
-
}
|
|
226052
|
-
if (environmentFiles.length > 0) {
|
|
226053
|
-
dotenv.config({
|
|
226054
|
-
path: environmentFiles,
|
|
226055
|
-
override: false,
|
|
226056
|
-
quiet: true
|
|
226057
|
-
});
|
|
226058
|
-
(0, import_dotenv_expand.expand)({ processEnv: process.env });
|
|
226059
|
-
}
|
|
226060
|
-
};
|
|
226061
|
-
loadEnvironmentFiles();
|
|
226062
|
-
envSchema = z8.object({
|
|
226063
|
-
ENVIRONMENT: z8.enum(["development", "production", "pentest", "test"]).optional(),
|
|
226064
|
-
DB_FILE_NAME: z8.string().optional(),
|
|
226065
|
-
TURSO_DATABASE_URL: z8.string().optional(),
|
|
226066
|
-
TURSO_AUTH_TOKEN: z8.string().optional(),
|
|
226067
|
-
INKEEP_AGENTS_JWT_SIGNING_SECRET: z8.string().min(32, "INKEEP_AGENTS_JWT_SIGNING_SECRET must be at least 32 characters").optional()
|
|
226068
|
-
});
|
|
226069
|
-
parseEnv = () => {
|
|
226070
|
-
try {
|
|
226071
|
-
const parsedEnv = envSchema.parse(process.env);
|
|
226072
|
-
return parsedEnv;
|
|
226073
|
-
} catch (error) {
|
|
226074
|
-
if (error instanceof z8.ZodError) {
|
|
226075
|
-
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
226076
|
-
throw new Error(
|
|
226077
|
-
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|
|
226078
|
-
${error.message}`
|
|
226079
|
-
);
|
|
226080
|
-
}
|
|
226081
|
-
throw error;
|
|
226082
|
-
}
|
|
226083
|
-
};
|
|
226084
|
-
env = parseEnv();
|
|
226085
|
-
}
|
|
226086
|
-
});
|
|
226087
|
-
|
|
226088
226269
|
// ../packages/agents-core/src/utils/service-token-auth.ts
|
|
226089
226270
|
var logger6;
|
|
226090
226271
|
var init_service_token_auth = __esm({
|
|
@@ -227529,11 +227710,11 @@ var require_codegen = __commonJS({
|
|
|
227529
227710
|
const rhs = this.rhs === void 0 ? "" : ` = ${this.rhs}`;
|
|
227530
227711
|
return `${varKind} ${this.name}${rhs};` + _n;
|
|
227531
227712
|
}
|
|
227532
|
-
optimizeNames(names,
|
|
227713
|
+
optimizeNames(names, constants3) {
|
|
227533
227714
|
if (!names[this.name.str])
|
|
227534
227715
|
return;
|
|
227535
227716
|
if (this.rhs)
|
|
227536
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
227717
|
+
this.rhs = optimizeExpr(this.rhs, names, constants3);
|
|
227537
227718
|
return this;
|
|
227538
227719
|
}
|
|
227539
227720
|
get names() {
|
|
@@ -227550,10 +227731,10 @@ var require_codegen = __commonJS({
|
|
|
227550
227731
|
render({ _n }) {
|
|
227551
227732
|
return `${this.lhs} = ${this.rhs};` + _n;
|
|
227552
227733
|
}
|
|
227553
|
-
optimizeNames(names,
|
|
227734
|
+
optimizeNames(names, constants3) {
|
|
227554
227735
|
if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
|
|
227555
227736
|
return;
|
|
227556
|
-
this.rhs = optimizeExpr(this.rhs, names,
|
|
227737
|
+
this.rhs = optimizeExpr(this.rhs, names, constants3);
|
|
227557
227738
|
return this;
|
|
227558
227739
|
}
|
|
227559
227740
|
get names() {
|
|
@@ -227614,8 +227795,8 @@ var require_codegen = __commonJS({
|
|
|
227614
227795
|
optimizeNodes() {
|
|
227615
227796
|
return `${this.code}` ? this : void 0;
|
|
227616
227797
|
}
|
|
227617
|
-
optimizeNames(names,
|
|
227618
|
-
this.code = optimizeExpr(this.code, names,
|
|
227798
|
+
optimizeNames(names, constants3) {
|
|
227799
|
+
this.code = optimizeExpr(this.code, names, constants3);
|
|
227619
227800
|
return this;
|
|
227620
227801
|
}
|
|
227621
227802
|
get names() {
|
|
@@ -227644,12 +227825,12 @@ var require_codegen = __commonJS({
|
|
|
227644
227825
|
}
|
|
227645
227826
|
return nodes.length > 0 ? this : void 0;
|
|
227646
227827
|
}
|
|
227647
|
-
optimizeNames(names,
|
|
227828
|
+
optimizeNames(names, constants3) {
|
|
227648
227829
|
const { nodes } = this;
|
|
227649
227830
|
let i = nodes.length;
|
|
227650
227831
|
while (i--) {
|
|
227651
227832
|
const n = nodes[i];
|
|
227652
|
-
if (n.optimizeNames(names,
|
|
227833
|
+
if (n.optimizeNames(names, constants3))
|
|
227653
227834
|
continue;
|
|
227654
227835
|
subtractNames(names, n.names);
|
|
227655
227836
|
nodes.splice(i, 1);
|
|
@@ -227702,12 +227883,12 @@ var require_codegen = __commonJS({
|
|
|
227702
227883
|
return void 0;
|
|
227703
227884
|
return this;
|
|
227704
227885
|
}
|
|
227705
|
-
optimizeNames(names,
|
|
227886
|
+
optimizeNames(names, constants3) {
|
|
227706
227887
|
var _a;
|
|
227707
|
-
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names,
|
|
227708
|
-
if (!(super.optimizeNames(names,
|
|
227888
|
+
this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants3);
|
|
227889
|
+
if (!(super.optimizeNames(names, constants3) || this.else))
|
|
227709
227890
|
return;
|
|
227710
|
-
this.condition = optimizeExpr(this.condition, names,
|
|
227891
|
+
this.condition = optimizeExpr(this.condition, names, constants3);
|
|
227711
227892
|
return this;
|
|
227712
227893
|
}
|
|
227713
227894
|
get names() {
|
|
@@ -227730,10 +227911,10 @@ var require_codegen = __commonJS({
|
|
|
227730
227911
|
render(opts) {
|
|
227731
227912
|
return `for(${this.iteration})` + super.render(opts);
|
|
227732
227913
|
}
|
|
227733
|
-
optimizeNames(names,
|
|
227734
|
-
if (!super.optimizeNames(names,
|
|
227914
|
+
optimizeNames(names, constants3) {
|
|
227915
|
+
if (!super.optimizeNames(names, constants3))
|
|
227735
227916
|
return;
|
|
227736
|
-
this.iteration = optimizeExpr(this.iteration, names,
|
|
227917
|
+
this.iteration = optimizeExpr(this.iteration, names, constants3);
|
|
227737
227918
|
return this;
|
|
227738
227919
|
}
|
|
227739
227920
|
get names() {
|
|
@@ -227769,10 +227950,10 @@ var require_codegen = __commonJS({
|
|
|
227769
227950
|
render(opts) {
|
|
227770
227951
|
return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
|
|
227771
227952
|
}
|
|
227772
|
-
optimizeNames(names,
|
|
227773
|
-
if (!super.optimizeNames(names,
|
|
227953
|
+
optimizeNames(names, constants3) {
|
|
227954
|
+
if (!super.optimizeNames(names, constants3))
|
|
227774
227955
|
return;
|
|
227775
|
-
this.iterable = optimizeExpr(this.iterable, names,
|
|
227956
|
+
this.iterable = optimizeExpr(this.iterable, names, constants3);
|
|
227776
227957
|
return this;
|
|
227777
227958
|
}
|
|
227778
227959
|
get names() {
|
|
@@ -227814,11 +227995,11 @@ var require_codegen = __commonJS({
|
|
|
227814
227995
|
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
|
|
227815
227996
|
return this;
|
|
227816
227997
|
}
|
|
227817
|
-
optimizeNames(names,
|
|
227998
|
+
optimizeNames(names, constants3) {
|
|
227818
227999
|
var _a, _b;
|
|
227819
|
-
super.optimizeNames(names,
|
|
227820
|
-
(_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names,
|
|
227821
|
-
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names,
|
|
228000
|
+
super.optimizeNames(names, constants3);
|
|
228001
|
+
(_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants3);
|
|
228002
|
+
(_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants3);
|
|
227822
228003
|
return this;
|
|
227823
228004
|
}
|
|
227824
228005
|
get names() {
|
|
@@ -228119,7 +228300,7 @@ var require_codegen = __commonJS({
|
|
|
228119
228300
|
function addExprNames(names, from) {
|
|
228120
228301
|
return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
|
|
228121
228302
|
}
|
|
228122
|
-
function optimizeExpr(expr, names,
|
|
228303
|
+
function optimizeExpr(expr, names, constants3) {
|
|
228123
228304
|
if (expr instanceof code_1.Name)
|
|
228124
228305
|
return replaceName(expr);
|
|
228125
228306
|
if (!canOptimize(expr))
|
|
@@ -228134,14 +228315,14 @@ var require_codegen = __commonJS({
|
|
|
228134
228315
|
return items;
|
|
228135
228316
|
}, []));
|
|
228136
228317
|
function replaceName(n) {
|
|
228137
|
-
const c =
|
|
228318
|
+
const c = constants3[n.str];
|
|
228138
228319
|
if (c === void 0 || names[n.str] !== 1)
|
|
228139
228320
|
return n;
|
|
228140
228321
|
delete names[n.str];
|
|
228141
228322
|
return c;
|
|
228142
228323
|
}
|
|
228143
228324
|
function canOptimize(e) {
|
|
228144
|
-
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 &&
|
|
228325
|
+
return e instanceof code_1._Code && e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants3[c.str] !== void 0);
|
|
228145
228326
|
}
|
|
228146
228327
|
}
|
|
228147
228328
|
function subtractNames(names, from) {
|
|
@@ -234010,7 +234191,7 @@ var init_dist5 = __esm({
|
|
|
234010
234191
|
});
|
|
234011
234192
|
|
|
234012
234193
|
// ../packages/agents-core/src/credential-stores/nango-store.ts
|
|
234013
|
-
import { z as
|
|
234194
|
+
import { z as z11 } from "zod";
|
|
234014
234195
|
var logger14, CredentialKeySchema;
|
|
234015
234196
|
var init_nango_store = __esm({
|
|
234016
234197
|
"../packages/agents-core/src/credential-stores/nango-store.ts"() {
|
|
@@ -234020,16 +234201,16 @@ var init_nango_store = __esm({
|
|
|
234020
234201
|
init_types();
|
|
234021
234202
|
init_logger();
|
|
234022
234203
|
logger14 = getLogger("nango-credential-store");
|
|
234023
|
-
CredentialKeySchema =
|
|
234024
|
-
connectionId:
|
|
234025
|
-
providerConfigKey:
|
|
234026
|
-
integrationDisplayName:
|
|
234204
|
+
CredentialKeySchema = z11.object({
|
|
234205
|
+
connectionId: z11.string().min(1, "connectionId must be a non-empty string"),
|
|
234206
|
+
providerConfigKey: z11.string().min(1, "providerConfigKey must be a non-empty string"),
|
|
234207
|
+
integrationDisplayName: z11.string().nullish()
|
|
234027
234208
|
});
|
|
234028
234209
|
}
|
|
234029
234210
|
});
|
|
234030
234211
|
|
|
234031
234212
|
// ../packages/agents-core/src/credential-stores/defaults.ts
|
|
234032
|
-
var
|
|
234213
|
+
var init_defaults3 = __esm({
|
|
234033
234214
|
"../packages/agents-core/src/credential-stores/defaults.ts"() {
|
|
234034
234215
|
"use strict";
|
|
234035
234216
|
init_esm_shims();
|
|
@@ -234045,7 +234226,7 @@ var init_credential_stores = __esm({
|
|
|
234045
234226
|
"use strict";
|
|
234046
234227
|
init_esm_shims();
|
|
234047
234228
|
init_CredentialStoreRegistry();
|
|
234048
|
-
|
|
234229
|
+
init_defaults3();
|
|
234049
234230
|
init_keychain_store();
|
|
234050
234231
|
init_memory_store();
|
|
234051
234232
|
init_nango_store();
|
|
@@ -234053,48 +234234,48 @@ var init_credential_stores = __esm({
|
|
|
234053
234234
|
});
|
|
234054
234235
|
|
|
234055
234236
|
// ../packages/agents-core/src/validation/event-schemas.ts
|
|
234056
|
-
import { z as
|
|
234237
|
+
import { z as z12 } from "zod";
|
|
234057
234238
|
var TransferDataSchema, DelegationSentDataSchema, DelegationReturnedDataSchema, DataOperationDetailsSchema, DataOperationEventSchema, A2AMessageMetadataSchema;
|
|
234058
234239
|
var init_event_schemas = __esm({
|
|
234059
234240
|
"../packages/agents-core/src/validation/event-schemas.ts"() {
|
|
234060
234241
|
"use strict";
|
|
234061
234242
|
init_esm_shims();
|
|
234062
|
-
TransferDataSchema =
|
|
234063
|
-
fromSubAgent:
|
|
234064
|
-
targetSubAgent:
|
|
234065
|
-
reason:
|
|
234066
|
-
context:
|
|
234243
|
+
TransferDataSchema = z12.object({
|
|
234244
|
+
fromSubAgent: z12.string().describe("ID of the sub-agent transferring control"),
|
|
234245
|
+
targetSubAgent: z12.string().describe("ID of the sub-agent receiving control"),
|
|
234246
|
+
reason: z12.string().optional().describe("Reason for the transfer"),
|
|
234247
|
+
context: z12.any().optional().describe("Additional context data")
|
|
234067
234248
|
});
|
|
234068
|
-
DelegationSentDataSchema =
|
|
234069
|
-
delegationId:
|
|
234070
|
-
fromSubAgent:
|
|
234071
|
-
targetSubAgent:
|
|
234072
|
-
taskDescription:
|
|
234073
|
-
context:
|
|
234249
|
+
DelegationSentDataSchema = z12.object({
|
|
234250
|
+
delegationId: z12.string().describe("Unique identifier for this delegation"),
|
|
234251
|
+
fromSubAgent: z12.string().describe("ID of the delegating sub-agent"),
|
|
234252
|
+
targetSubAgent: z12.string().describe("ID of the sub-agent receiving the delegation"),
|
|
234253
|
+
taskDescription: z12.string().describe("Description of the delegated task"),
|
|
234254
|
+
context: z12.any().optional().describe("Additional context data")
|
|
234074
234255
|
});
|
|
234075
|
-
DelegationReturnedDataSchema =
|
|
234076
|
-
delegationId:
|
|
234077
|
-
fromSubAgent:
|
|
234078
|
-
targetSubAgent:
|
|
234079
|
-
result:
|
|
234256
|
+
DelegationReturnedDataSchema = z12.object({
|
|
234257
|
+
delegationId: z12.string().describe("Unique identifier matching the original delegation"),
|
|
234258
|
+
fromSubAgent: z12.string().describe("ID of the sub-agent that completed the task"),
|
|
234259
|
+
targetSubAgent: z12.string().describe("ID of the sub-agent receiving the result"),
|
|
234260
|
+
result: z12.any().optional().describe("Result data from the delegated task")
|
|
234080
234261
|
});
|
|
234081
|
-
DataOperationDetailsSchema =
|
|
234082
|
-
timestamp:
|
|
234083
|
-
subAgentId:
|
|
234084
|
-
data:
|
|
234262
|
+
DataOperationDetailsSchema = z12.object({
|
|
234263
|
+
timestamp: z12.number().describe("Unix timestamp in milliseconds"),
|
|
234264
|
+
subAgentId: z12.string().describe("ID of the sub-agent that generated this data"),
|
|
234265
|
+
data: z12.any().describe("The actual data payload")
|
|
234085
234266
|
});
|
|
234086
|
-
DataOperationEventSchema =
|
|
234087
|
-
type:
|
|
234088
|
-
label:
|
|
234267
|
+
DataOperationEventSchema = z12.object({
|
|
234268
|
+
type: z12.string().describe("Event type identifier"),
|
|
234269
|
+
label: z12.string().describe("Human-readable label for the event"),
|
|
234089
234270
|
details: DataOperationDetailsSchema
|
|
234090
234271
|
});
|
|
234091
|
-
A2AMessageMetadataSchema =
|
|
234092
|
-
fromSubAgentId:
|
|
234093
|
-
toSubAgentId:
|
|
234094
|
-
fromExternalAgentId:
|
|
234095
|
-
toExternalAgentId:
|
|
234096
|
-
taskId:
|
|
234097
|
-
a2aTaskId:
|
|
234272
|
+
A2AMessageMetadataSchema = z12.object({
|
|
234273
|
+
fromSubAgentId: z12.string().optional().describe("ID of the sending sub-agent"),
|
|
234274
|
+
toSubAgentId: z12.string().optional().describe("ID of the receiving sub-agent"),
|
|
234275
|
+
fromExternalAgentId: z12.string().optional().describe("ID of the sending external agent"),
|
|
234276
|
+
toExternalAgentId: z12.string().optional().describe("ID of the receiving external agent"),
|
|
234277
|
+
taskId: z12.string().optional().describe("Associated task ID"),
|
|
234278
|
+
a2aTaskId: z12.string().optional().describe("A2A-specific task ID")
|
|
234098
234279
|
});
|
|
234099
234280
|
}
|
|
234100
234281
|
});
|
|
@@ -234109,54 +234290,54 @@ var init_id_validation = __esm({
|
|
|
234109
234290
|
});
|
|
234110
234291
|
|
|
234111
234292
|
// ../packages/agents-core/src/validation/stream-event-schemas.ts
|
|
234112
|
-
import { z as
|
|
234293
|
+
import { z as z13 } from "zod";
|
|
234113
234294
|
var TextStartEventSchema, TextDeltaEventSchema, TextEndEventSchema, DataComponentStreamEventSchema, DataOperationStreamEventSchema, DataSummaryStreamEventSchema, StreamErrorEventSchema, StreamFinishEventSchema, StreamEventSchema;
|
|
234114
234295
|
var init_stream_event_schemas = __esm({
|
|
234115
234296
|
"../packages/agents-core/src/validation/stream-event-schemas.ts"() {
|
|
234116
234297
|
"use strict";
|
|
234117
234298
|
init_esm_shims();
|
|
234118
|
-
TextStartEventSchema =
|
|
234119
|
-
type:
|
|
234120
|
-
id:
|
|
234299
|
+
TextStartEventSchema = z13.object({
|
|
234300
|
+
type: z13.literal("text-start"),
|
|
234301
|
+
id: z13.string()
|
|
234121
234302
|
});
|
|
234122
|
-
TextDeltaEventSchema =
|
|
234123
|
-
type:
|
|
234124
|
-
id:
|
|
234125
|
-
delta:
|
|
234303
|
+
TextDeltaEventSchema = z13.object({
|
|
234304
|
+
type: z13.literal("text-delta"),
|
|
234305
|
+
id: z13.string(),
|
|
234306
|
+
delta: z13.string()
|
|
234126
234307
|
});
|
|
234127
|
-
TextEndEventSchema =
|
|
234128
|
-
type:
|
|
234129
|
-
id:
|
|
234308
|
+
TextEndEventSchema = z13.object({
|
|
234309
|
+
type: z13.literal("text-end"),
|
|
234310
|
+
id: z13.string()
|
|
234130
234311
|
});
|
|
234131
|
-
DataComponentStreamEventSchema =
|
|
234132
|
-
type:
|
|
234133
|
-
id:
|
|
234134
|
-
data:
|
|
234312
|
+
DataComponentStreamEventSchema = z13.object({
|
|
234313
|
+
type: z13.literal("data-component"),
|
|
234314
|
+
id: z13.string(),
|
|
234315
|
+
data: z13.any()
|
|
234135
234316
|
});
|
|
234136
|
-
DataOperationStreamEventSchema =
|
|
234137
|
-
type:
|
|
234138
|
-
data:
|
|
234317
|
+
DataOperationStreamEventSchema = z13.object({
|
|
234318
|
+
type: z13.literal("data-operation"),
|
|
234319
|
+
data: z13.any()
|
|
234139
234320
|
// Contains OperationEvent types (AgentInitializingEvent, CompletionEvent, etc.)
|
|
234140
234321
|
});
|
|
234141
|
-
DataSummaryStreamEventSchema =
|
|
234142
|
-
type:
|
|
234143
|
-
data:
|
|
234322
|
+
DataSummaryStreamEventSchema = z13.object({
|
|
234323
|
+
type: z13.literal("data-summary"),
|
|
234324
|
+
data: z13.any()
|
|
234144
234325
|
// Contains SummaryEvent from entities.ts
|
|
234145
234326
|
});
|
|
234146
|
-
StreamErrorEventSchema =
|
|
234147
|
-
type:
|
|
234148
|
-
error:
|
|
234327
|
+
StreamErrorEventSchema = z13.object({
|
|
234328
|
+
type: z13.literal("error"),
|
|
234329
|
+
error: z13.string()
|
|
234149
234330
|
});
|
|
234150
|
-
StreamFinishEventSchema =
|
|
234151
|
-
type:
|
|
234152
|
-
finishReason:
|
|
234153
|
-
usage:
|
|
234154
|
-
promptTokens:
|
|
234155
|
-
completionTokens:
|
|
234156
|
-
totalTokens:
|
|
234331
|
+
StreamFinishEventSchema = z13.object({
|
|
234332
|
+
type: z13.literal("finish"),
|
|
234333
|
+
finishReason: z13.string().optional(),
|
|
234334
|
+
usage: z13.object({
|
|
234335
|
+
promptTokens: z13.number().optional(),
|
|
234336
|
+
completionTokens: z13.number().optional(),
|
|
234337
|
+
totalTokens: z13.number().optional()
|
|
234157
234338
|
}).optional()
|
|
234158
234339
|
});
|
|
234159
|
-
StreamEventSchema =
|
|
234340
|
+
StreamEventSchema = z13.discriminatedUnion("type", [
|
|
234160
234341
|
TextStartEventSchema,
|
|
234161
234342
|
TextDeltaEventSchema,
|
|
234162
234343
|
TextEndEventSchema,
|
|
@@ -234190,8 +234371,10 @@ var init_src = __esm({
|
|
|
234190
234371
|
"use strict";
|
|
234191
234372
|
init_esm_shims();
|
|
234192
234373
|
init_base_client();
|
|
234374
|
+
init_execution_limits_shared();
|
|
234193
234375
|
init_models();
|
|
234194
234376
|
init_otel_attributes();
|
|
234377
|
+
init_schema_validation();
|
|
234195
234378
|
init_signoz_queries();
|
|
234196
234379
|
init_context5();
|
|
234197
234380
|
init_credential_stores();
|
|
@@ -240811,26 +240994,26 @@ init_esm_shims();
|
|
|
240811
240994
|
// src/env.ts
|
|
240812
240995
|
init_esm_shims();
|
|
240813
240996
|
init_src();
|
|
240814
|
-
import { z as
|
|
240997
|
+
import { z as z14 } from "zod";
|
|
240815
240998
|
loadEnvironmentFiles();
|
|
240816
|
-
var envSchema2 =
|
|
240817
|
-
DEBUG:
|
|
240999
|
+
var envSchema2 = z14.object({
|
|
241000
|
+
DEBUG: z14.string().optional(),
|
|
240818
241001
|
// Secrets loaded from .env files (relative to where CLI is executed)
|
|
240819
|
-
ANTHROPIC_API_KEY:
|
|
240820
|
-
OPENAI_API_KEY:
|
|
240821
|
-
GOOGLE_API_KEY:
|
|
241002
|
+
ANTHROPIC_API_KEY: z14.string().optional(),
|
|
241003
|
+
OPENAI_API_KEY: z14.string().optional(),
|
|
241004
|
+
GOOGLE_API_KEY: z14.string().optional(),
|
|
240822
241005
|
// Langfuse configuration for LLM observability
|
|
240823
|
-
LANGFUSE_SECRET_KEY:
|
|
240824
|
-
LANGFUSE_PUBLIC_KEY:
|
|
240825
|
-
LANGFUSE_BASEURL:
|
|
240826
|
-
LANGFUSE_ENABLED:
|
|
241006
|
+
LANGFUSE_SECRET_KEY: z14.string().optional(),
|
|
241007
|
+
LANGFUSE_PUBLIC_KEY: z14.string().optional(),
|
|
241008
|
+
LANGFUSE_BASEURL: z14.string().optional().default("https://cloud.langfuse.com"),
|
|
241009
|
+
LANGFUSE_ENABLED: z14.string().optional().transform((val) => val === "true")
|
|
240827
241010
|
});
|
|
240828
241011
|
var parseEnv2 = () => {
|
|
240829
241012
|
try {
|
|
240830
241013
|
const parsedEnv = envSchema2.parse(process.env);
|
|
240831
241014
|
return parsedEnv;
|
|
240832
241015
|
} catch (error) {
|
|
240833
|
-
if (error instanceof
|
|
241016
|
+
if (error instanceof z14.ZodError) {
|
|
240834
241017
|
const missingVars = error.issues.map((issue) => issue.path.join("."));
|
|
240835
241018
|
throw new Error(
|
|
240836
241019
|
`\u274C Invalid environment variables: ${missingVars.join(", ")}
|