@dexto/server 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hono/__tests__/test-fixtures.cjs +1 -1
- package/dist/hono/__tests__/test-fixtures.d.ts.map +1 -1
- package/dist/hono/__tests__/test-fixtures.js +1 -1
- package/dist/hono/index.cjs +41 -5
- package/dist/hono/index.d.ts +451 -452
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/index.js +41 -5
- package/dist/hono/routes/a2a-jsonrpc.cjs +3 -3
- package/dist/hono/routes/a2a-jsonrpc.d.ts +4 -1
- package/dist/hono/routes/a2a-jsonrpc.d.ts.map +1 -1
- package/dist/hono/routes/a2a-jsonrpc.js +3 -3
- package/dist/hono/routes/a2a-tasks.cjs +5 -5
- package/dist/hono/routes/a2a-tasks.d.ts +13 -10
- package/dist/hono/routes/a2a-tasks.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.js +5 -5
- package/dist/hono/routes/agents.cjs +25 -35
- package/dist/hono/routes/agents.d.ts +6 -407
- package/dist/hono/routes/agents.d.ts.map +1 -1
- package/dist/hono/routes/agents.js +25 -35
- package/dist/hono/routes/approvals.cjs +2 -2
- package/dist/hono/routes/approvals.d.ts +4 -1
- package/dist/hono/routes/approvals.d.ts.map +1 -1
- package/dist/hono/routes/approvals.js +2 -2
- package/dist/hono/routes/discovery.cjs +67 -0
- package/dist/hono/routes/discovery.d.ts +44 -0
- package/dist/hono/routes/discovery.d.ts.map +1 -0
- package/dist/hono/routes/discovery.js +43 -0
- package/dist/hono/routes/greeting.cjs +2 -2
- package/dist/hono/routes/greeting.d.ts +2 -2
- package/dist/hono/routes/greeting.d.ts.map +1 -1
- package/dist/hono/routes/greeting.js +2 -2
- package/dist/hono/routes/health.d.ts +2 -2
- package/dist/hono/routes/health.d.ts.map +1 -1
- package/dist/hono/routes/key.cjs +110 -0
- package/dist/hono/routes/key.d.ts +48 -0
- package/dist/hono/routes/key.d.ts.map +1 -0
- package/dist/hono/routes/key.js +90 -0
- package/dist/hono/routes/llm.cjs +12 -34
- package/dist/hono/routes/llm.d.ts +173 -25
- package/dist/hono/routes/llm.d.ts.map +1 -1
- package/dist/hono/routes/llm.js +12 -35
- package/dist/hono/routes/mcp.cjs +8 -8
- package/dist/hono/routes/mcp.d.ts +2 -2
- package/dist/hono/routes/mcp.d.ts.map +1 -1
- package/dist/hono/routes/mcp.js +8 -8
- package/dist/hono/routes/memory.cjs +5 -5
- package/dist/hono/routes/memory.d.ts +4 -1
- package/dist/hono/routes/memory.d.ts.map +1 -1
- package/dist/hono/routes/memory.js +5 -5
- package/dist/hono/routes/messages.cjs +4 -4
- package/dist/hono/routes/messages.d.ts +12 -12
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +4 -4
- package/dist/hono/routes/models.cjs +319 -0
- package/dist/hono/routes/models.d.ts +107 -0
- package/dist/hono/routes/models.d.ts.map +1 -0
- package/dist/hono/routes/models.js +305 -0
- package/dist/hono/routes/openrouter.cjs +153 -0
- package/dist/hono/routes/openrouter.d.ts +54 -0
- package/dist/hono/routes/openrouter.d.ts.map +1 -0
- package/dist/hono/routes/openrouter.js +134 -0
- package/dist/hono/routes/prompts.cjs +5 -5
- package/dist/hono/routes/prompts.d.ts +4 -1
- package/dist/hono/routes/prompts.d.ts.map +1 -1
- package/dist/hono/routes/prompts.js +5 -5
- package/dist/hono/routes/queue.cjs +4 -4
- package/dist/hono/routes/queue.d.ts +4 -1
- package/dist/hono/routes/queue.d.ts.map +1 -1
- package/dist/hono/routes/queue.js +4 -4
- package/dist/hono/routes/resources.cjs +3 -3
- package/dist/hono/routes/resources.d.ts +2 -2
- package/dist/hono/routes/resources.d.ts.map +1 -1
- package/dist/hono/routes/resources.js +3 -3
- package/dist/hono/routes/search.cjs +2 -2
- package/dist/hono/routes/search.d.ts +6 -3
- package/dist/hono/routes/search.d.ts.map +1 -1
- package/dist/hono/routes/search.js +2 -2
- package/dist/hono/routes/sessions.cjs +9 -9
- package/dist/hono/routes/sessions.d.ts +3 -3
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +9 -9
- package/dist/hono/routes/tools.cjs +126 -0
- package/dist/hono/routes/tools.d.ts +42 -0
- package/dist/hono/routes/tools.d.ts.map +1 -0
- package/dist/hono/routes/tools.js +102 -0
- package/dist/hono/routes/webhooks.cjs +4 -4
- package/dist/hono/routes/webhooks.d.ts +4 -1
- package/dist/hono/routes/webhooks.d.ts.map +1 -1
- package/dist/hono/routes/webhooks.js +4 -4
- package/dist/hono/schemas/responses.d.ts +41 -41
- package/dist/hono/start-server.cjs +102 -0
- package/dist/hono/start-server.d.ts +61 -0
- package/dist/hono/start-server.d.ts.map +1 -0
- package/dist/hono/start-server.js +78 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
|
|
2
|
+
const JsonSchemaProperty = z.object({
|
|
3
|
+
type: z.enum(["string", "number", "integer", "boolean", "object", "array"]).optional().describe("Property type"),
|
|
4
|
+
description: z.string().optional().describe("Property description"),
|
|
5
|
+
enum: z.array(z.union([z.string(), z.number(), z.boolean()])).optional().describe("Enum values"),
|
|
6
|
+
default: z.any().optional().describe("Default value")
|
|
7
|
+
}).passthrough().describe("JSON Schema property definition");
|
|
8
|
+
const ToolInputSchema = z.object({
|
|
9
|
+
type: z.literal("object").optional().describe('Schema type, always "object" when present'),
|
|
10
|
+
properties: z.record(JsonSchemaProperty).optional().describe("Property definitions"),
|
|
11
|
+
required: z.array(z.string()).optional().describe("Required property names")
|
|
12
|
+
}).passthrough().describe("JSON Schema for tool input parameters");
|
|
13
|
+
const ToolInfoSchema = z.object({
|
|
14
|
+
id: z.string().describe("Tool identifier"),
|
|
15
|
+
name: z.string().describe("Tool name"),
|
|
16
|
+
description: z.string().describe("Tool description"),
|
|
17
|
+
source: z.enum(["internal", "custom", "mcp"]).describe("Source of the tool (internal, custom, or mcp)"),
|
|
18
|
+
serverName: z.string().optional().describe("MCP server name (if source is mcp)"),
|
|
19
|
+
inputSchema: ToolInputSchema.optional().describe("JSON Schema for tool input parameters")
|
|
20
|
+
}).strict().describe("Tool information");
|
|
21
|
+
const AllToolsResponseSchema = z.object({
|
|
22
|
+
tools: z.array(ToolInfoSchema).describe("Array of all available tools"),
|
|
23
|
+
totalCount: z.number().describe("Total number of tools"),
|
|
24
|
+
internalCount: z.number().describe("Number of internal tools"),
|
|
25
|
+
customCount: z.number().describe("Number of custom tools"),
|
|
26
|
+
mcpCount: z.number().describe("Number of MCP tools")
|
|
27
|
+
}).strict().describe("All available tools from all sources");
|
|
28
|
+
function createToolsRouter(getAgent) {
|
|
29
|
+
const app = new OpenAPIHono();
|
|
30
|
+
const allToolsRoute = createRoute({
|
|
31
|
+
method: "get",
|
|
32
|
+
path: "/tools",
|
|
33
|
+
summary: "List All Tools",
|
|
34
|
+
description: "Retrieves all available tools from all sources (internal, custom, and MCP servers)",
|
|
35
|
+
tags: ["tools"],
|
|
36
|
+
responses: {
|
|
37
|
+
200: {
|
|
38
|
+
description: "All tools",
|
|
39
|
+
content: { "application/json": { schema: AllToolsResponseSchema } }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return app.openapi(allToolsRoute, async (ctx) => {
|
|
44
|
+
const agent = await getAgent(ctx);
|
|
45
|
+
const allTools = await agent.getAllTools();
|
|
46
|
+
const mcpToolsWithServerInfo = agent.getAllMcpToolsWithServerInfo();
|
|
47
|
+
const toolList = [];
|
|
48
|
+
let internalCount = 0;
|
|
49
|
+
let customCount = 0;
|
|
50
|
+
let mcpCount = 0;
|
|
51
|
+
for (const [toolName, toolInfo] of Object.entries(allTools)) {
|
|
52
|
+
let source;
|
|
53
|
+
let serverName;
|
|
54
|
+
if (toolName.startsWith("mcp--")) {
|
|
55
|
+
const mcpToolName = toolName.substring(5);
|
|
56
|
+
const mcpToolInfo = mcpToolsWithServerInfo.get(mcpToolName);
|
|
57
|
+
if (mcpToolInfo) {
|
|
58
|
+
source = "mcp";
|
|
59
|
+
serverName = mcpToolInfo.serverName;
|
|
60
|
+
mcpCount++;
|
|
61
|
+
} else {
|
|
62
|
+
source = "mcp";
|
|
63
|
+
mcpCount++;
|
|
64
|
+
}
|
|
65
|
+
} else if (toolName.startsWith("internal--")) {
|
|
66
|
+
source = "internal";
|
|
67
|
+
internalCount++;
|
|
68
|
+
} else if (toolName.startsWith("custom--")) {
|
|
69
|
+
source = "custom";
|
|
70
|
+
customCount++;
|
|
71
|
+
} else {
|
|
72
|
+
source = "internal";
|
|
73
|
+
internalCount++;
|
|
74
|
+
}
|
|
75
|
+
toolList.push({
|
|
76
|
+
id: toolName,
|
|
77
|
+
name: toolName,
|
|
78
|
+
description: toolInfo.description || "No description available",
|
|
79
|
+
source,
|
|
80
|
+
serverName,
|
|
81
|
+
inputSchema: toolInfo.parameters
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
toolList.sort((a, b) => {
|
|
85
|
+
const sourceOrder = { internal: 0, custom: 1, mcp: 2 };
|
|
86
|
+
if (a.source !== b.source) {
|
|
87
|
+
return sourceOrder[a.source] - sourceOrder[b.source];
|
|
88
|
+
}
|
|
89
|
+
return a.name.localeCompare(b.name);
|
|
90
|
+
});
|
|
91
|
+
return ctx.json({
|
|
92
|
+
tools: toolList,
|
|
93
|
+
totalCount: toolList.length,
|
|
94
|
+
internalCount,
|
|
95
|
+
customCount,
|
|
96
|
+
mcpCount
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
createToolsRouter
|
|
102
|
+
};
|
|
@@ -148,7 +148,7 @@ function createWebhooksRouter(getAgent, webhookSubscriber) {
|
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
return app.openapi(registerRoute, async (ctx) => {
|
|
151
|
-
const agent = getAgent();
|
|
151
|
+
const agent = await getAgent(ctx);
|
|
152
152
|
const { url, secret, description } = ctx.req.valid("json");
|
|
153
153
|
const webhookId = `wh_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
154
154
|
const webhook = {
|
|
@@ -193,8 +193,8 @@ function createWebhooksRouter(getAgent, webhookSubscriber) {
|
|
|
193
193
|
createdAt: webhook.createdAt
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
}).openapi(deleteRoute, (ctx) => {
|
|
197
|
-
const agent = getAgent();
|
|
196
|
+
}).openapi(deleteRoute, async (ctx) => {
|
|
197
|
+
const agent = await getAgent(ctx);
|
|
198
198
|
const { webhookId } = ctx.req.valid("param");
|
|
199
199
|
const removed = webhookSubscriber.removeWebhook(webhookId);
|
|
200
200
|
if (!removed) {
|
|
@@ -203,7 +203,7 @@ function createWebhooksRouter(getAgent, webhookSubscriber) {
|
|
|
203
203
|
agent.logger.info(`Webhook removed: ${webhookId}`);
|
|
204
204
|
return ctx.json({ status: "removed", webhookId });
|
|
205
205
|
}).openapi(testRoute, async (ctx) => {
|
|
206
|
-
const agent = getAgent();
|
|
206
|
+
const agent = await getAgent(ctx);
|
|
207
207
|
const { webhookId } = ctx.req.valid("param");
|
|
208
208
|
const webhook = webhookSubscriber.getWebhook(webhookId);
|
|
209
209
|
if (!webhook) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
2
2
|
import type { DextoAgent } from '@dexto/core';
|
|
3
3
|
import { WebhookEventSubscriber } from '../../events/webhook-subscriber.js';
|
|
4
|
-
|
|
4
|
+
import type { Context } from 'hono';
|
|
5
|
+
type GetAgentFn = (ctx: Context) => DextoAgent | Promise<DextoAgent>;
|
|
6
|
+
export declare function createWebhooksRouter(getAgent: GetAgentFn, webhookSubscriber: WebhookEventSubscriber): OpenAPIHono<import("hono").Env, {
|
|
5
7
|
"/webhooks": {
|
|
6
8
|
$post: {
|
|
7
9
|
input: {
|
|
@@ -124,4 +126,5 @@ export declare function createWebhooksRouter(getAgent: () => DextoAgent, webhook
|
|
|
124
126
|
};
|
|
125
127
|
};
|
|
126
128
|
}, "/">;
|
|
129
|
+
export {};
|
|
127
130
|
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,KAAK,UAAU,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAkCrE,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,UAAU,EACpB,iBAAiB,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0N5C"}
|
|
@@ -125,7 +125,7 @@ function createWebhooksRouter(getAgent, webhookSubscriber) {
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
return app.openapi(registerRoute, async (ctx) => {
|
|
128
|
-
const agent = getAgent();
|
|
128
|
+
const agent = await getAgent(ctx);
|
|
129
129
|
const { url, secret, description } = ctx.req.valid("json");
|
|
130
130
|
const webhookId = `wh_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
131
131
|
const webhook = {
|
|
@@ -170,8 +170,8 @@ function createWebhooksRouter(getAgent, webhookSubscriber) {
|
|
|
170
170
|
createdAt: webhook.createdAt
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
|
-
}).openapi(deleteRoute, (ctx) => {
|
|
174
|
-
const agent = getAgent();
|
|
173
|
+
}).openapi(deleteRoute, async (ctx) => {
|
|
174
|
+
const agent = await getAgent(ctx);
|
|
175
175
|
const { webhookId } = ctx.req.valid("param");
|
|
176
176
|
const removed = webhookSubscriber.removeWebhook(webhookId);
|
|
177
177
|
if (!removed) {
|
|
@@ -180,7 +180,7 @@ function createWebhooksRouter(getAgent, webhookSubscriber) {
|
|
|
180
180
|
agent.logger.info(`Webhook removed: ${webhookId}`);
|
|
181
181
|
return ctx.json({ status: "removed", webhookId });
|
|
182
182
|
}).openapi(testRoute, async (ctx) => {
|
|
183
|
-
const agent = getAgent();
|
|
183
|
+
const agent = await getAgent(ctx);
|
|
184
184
|
const { webhookId } = ctx.req.valid("param");
|
|
185
185
|
const webhook = webhookSubscriber.getWebhook(webhookId);
|
|
186
186
|
if (!webhook) {
|
|
@@ -380,7 +380,7 @@ export declare const InternalMessageSchema: z.ZodObject<{
|
|
|
380
380
|
totalTokens?: number | undefined;
|
|
381
381
|
}>>;
|
|
382
382
|
model: z.ZodOptional<z.ZodString>;
|
|
383
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
383
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
384
384
|
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
385
385
|
id: z.ZodString;
|
|
386
386
|
type: z.ZodLiteral<"function">;
|
|
@@ -451,7 +451,7 @@ export declare const InternalMessageSchema: z.ZodObject<{
|
|
|
451
451
|
totalTokens?: number | undefined;
|
|
452
452
|
} | undefined;
|
|
453
453
|
model?: string | undefined;
|
|
454
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
454
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
455
455
|
toolCalls?: {
|
|
456
456
|
function: {
|
|
457
457
|
name: string;
|
|
@@ -501,7 +501,7 @@ export declare const InternalMessageSchema: z.ZodObject<{
|
|
|
501
501
|
totalTokens?: number | undefined;
|
|
502
502
|
} | undefined;
|
|
503
503
|
model?: string | undefined;
|
|
504
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
504
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
505
505
|
toolCalls?: {
|
|
506
506
|
function: {
|
|
507
507
|
name: string;
|
|
@@ -521,9 +521,9 @@ export type ToolCall = z.output<typeof ToolCallSchema>;
|
|
|
521
521
|
export type TokenUsage = z.output<typeof TokenUsageSchema>;
|
|
522
522
|
export type InternalMessage = z.output<typeof InternalMessageSchema>;
|
|
523
523
|
export declare const LLMConfigResponseSchema: z.ZodObject<Omit<{
|
|
524
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>;
|
|
524
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
525
525
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
526
|
-
apiKey: z.ZodEffects<z.ZodString, string, string
|
|
526
|
+
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
527
527
|
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
528
528
|
baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
|
|
529
529
|
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -534,7 +534,7 @@ export declare const LLMConfigResponseSchema: z.ZodObject<Omit<{
|
|
|
534
534
|
hasApiKey: z.ZodOptional<z.ZodBoolean>;
|
|
535
535
|
}, "strict", z.ZodTypeAny, {
|
|
536
536
|
model: string;
|
|
537
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
537
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
538
538
|
maxIterations: number;
|
|
539
539
|
baseURL?: string | undefined;
|
|
540
540
|
maxInputTokens?: number | undefined;
|
|
@@ -544,7 +544,7 @@ export declare const LLMConfigResponseSchema: z.ZodObject<Omit<{
|
|
|
544
544
|
hasApiKey?: boolean | undefined;
|
|
545
545
|
}, {
|
|
546
546
|
model: string;
|
|
547
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
547
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
548
548
|
maxIterations?: number | undefined;
|
|
549
549
|
baseURL?: string | undefined;
|
|
550
550
|
maxInputTokens?: number | undefined;
|
|
@@ -554,9 +554,9 @@ export declare const LLMConfigResponseSchema: z.ZodObject<Omit<{
|
|
|
554
554
|
hasApiKey?: boolean | undefined;
|
|
555
555
|
}>;
|
|
556
556
|
export declare const LLMConfigSchema: z.ZodObject<{
|
|
557
|
-
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>;
|
|
557
|
+
provider: z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>;
|
|
558
558
|
model: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
559
|
-
apiKey: z.ZodEffects<z.ZodString, string, string
|
|
559
|
+
apiKey: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
560
560
|
maxIterations: z.ZodDefault<z.ZodNumber>;
|
|
561
561
|
baseURL: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string | undefined, string>>;
|
|
562
562
|
maxInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -565,9 +565,9 @@ export declare const LLMConfigSchema: z.ZodObject<{
|
|
|
565
565
|
allowedMediaTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
566
566
|
}, "strict", z.ZodTypeAny, {
|
|
567
567
|
model: string;
|
|
568
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
569
|
-
apiKey: string;
|
|
568
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
570
569
|
maxIterations: number;
|
|
570
|
+
apiKey?: string | undefined;
|
|
571
571
|
baseURL?: string | undefined;
|
|
572
572
|
maxInputTokens?: number | undefined;
|
|
573
573
|
maxOutputTokens?: number | undefined;
|
|
@@ -575,8 +575,8 @@ export declare const LLMConfigSchema: z.ZodObject<{
|
|
|
575
575
|
allowedMediaTypes?: string[] | undefined;
|
|
576
576
|
}, {
|
|
577
577
|
model: string;
|
|
578
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere";
|
|
579
|
-
apiKey
|
|
578
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
579
|
+
apiKey?: string | undefined;
|
|
580
580
|
maxIterations?: number | undefined;
|
|
581
581
|
baseURL?: string | undefined;
|
|
582
582
|
maxInputTokens?: number | undefined;
|
|
@@ -727,7 +727,7 @@ export declare const SearchResultSchema: z.ZodObject<{
|
|
|
727
727
|
totalTokens?: number | undefined;
|
|
728
728
|
}>>;
|
|
729
729
|
model: z.ZodOptional<z.ZodString>;
|
|
730
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
730
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
731
731
|
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
732
732
|
id: z.ZodString;
|
|
733
733
|
type: z.ZodLiteral<"function">;
|
|
@@ -798,7 +798,7 @@ export declare const SearchResultSchema: z.ZodObject<{
|
|
|
798
798
|
totalTokens?: number | undefined;
|
|
799
799
|
} | undefined;
|
|
800
800
|
model?: string | undefined;
|
|
801
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
801
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
802
802
|
toolCalls?: {
|
|
803
803
|
function: {
|
|
804
804
|
name: string;
|
|
@@ -848,7 +848,7 @@ export declare const SearchResultSchema: z.ZodObject<{
|
|
|
848
848
|
totalTokens?: number | undefined;
|
|
849
849
|
} | undefined;
|
|
850
850
|
model?: string | undefined;
|
|
851
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
851
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
852
852
|
toolCalls?: {
|
|
853
853
|
function: {
|
|
854
854
|
name: string;
|
|
@@ -903,7 +903,7 @@ export declare const SearchResultSchema: z.ZodObject<{
|
|
|
903
903
|
totalTokens?: number | undefined;
|
|
904
904
|
} | undefined;
|
|
905
905
|
model?: string | undefined;
|
|
906
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
906
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
907
907
|
toolCalls?: {
|
|
908
908
|
function: {
|
|
909
909
|
name: string;
|
|
@@ -959,7 +959,7 @@ export declare const SearchResultSchema: z.ZodObject<{
|
|
|
959
959
|
totalTokens?: number | undefined;
|
|
960
960
|
} | undefined;
|
|
961
961
|
model?: string | undefined;
|
|
962
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
962
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
963
963
|
toolCalls?: {
|
|
964
964
|
function: {
|
|
965
965
|
name: string;
|
|
@@ -1098,7 +1098,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1098
1098
|
totalTokens?: number | undefined;
|
|
1099
1099
|
}>>;
|
|
1100
1100
|
model: z.ZodOptional<z.ZodString>;
|
|
1101
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
1101
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
1102
1102
|
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1103
1103
|
id: z.ZodString;
|
|
1104
1104
|
type: z.ZodLiteral<"function">;
|
|
@@ -1169,7 +1169,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1169
1169
|
totalTokens?: number | undefined;
|
|
1170
1170
|
} | undefined;
|
|
1171
1171
|
model?: string | undefined;
|
|
1172
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1172
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1173
1173
|
toolCalls?: {
|
|
1174
1174
|
function: {
|
|
1175
1175
|
name: string;
|
|
@@ -1219,7 +1219,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1219
1219
|
totalTokens?: number | undefined;
|
|
1220
1220
|
} | undefined;
|
|
1221
1221
|
model?: string | undefined;
|
|
1222
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1222
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1223
1223
|
toolCalls?: {
|
|
1224
1224
|
function: {
|
|
1225
1225
|
name: string;
|
|
@@ -1274,7 +1274,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1274
1274
|
totalTokens?: number | undefined;
|
|
1275
1275
|
} | undefined;
|
|
1276
1276
|
model?: string | undefined;
|
|
1277
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1277
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1278
1278
|
toolCalls?: {
|
|
1279
1279
|
function: {
|
|
1280
1280
|
name: string;
|
|
@@ -1330,7 +1330,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1330
1330
|
totalTokens?: number | undefined;
|
|
1331
1331
|
} | undefined;
|
|
1332
1332
|
model?: string | undefined;
|
|
1333
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1333
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1334
1334
|
toolCalls?: {
|
|
1335
1335
|
function: {
|
|
1336
1336
|
name: string;
|
|
@@ -1408,7 +1408,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1408
1408
|
totalTokens?: number | undefined;
|
|
1409
1409
|
} | undefined;
|
|
1410
1410
|
model?: string | undefined;
|
|
1411
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1411
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1412
1412
|
toolCalls?: {
|
|
1413
1413
|
function: {
|
|
1414
1414
|
name: string;
|
|
@@ -1473,7 +1473,7 @@ export declare const SessionSearchResultSchema: z.ZodObject<{
|
|
|
1473
1473
|
totalTokens?: number | undefined;
|
|
1474
1474
|
} | undefined;
|
|
1475
1475
|
model?: string | undefined;
|
|
1476
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1476
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1477
1477
|
toolCalls?: {
|
|
1478
1478
|
function: {
|
|
1479
1479
|
name: string;
|
|
@@ -1611,7 +1611,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1611
1611
|
totalTokens?: number | undefined;
|
|
1612
1612
|
}>>;
|
|
1613
1613
|
model: z.ZodOptional<z.ZodString>;
|
|
1614
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
1614
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
1615
1615
|
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1616
1616
|
id: z.ZodString;
|
|
1617
1617
|
type: z.ZodLiteral<"function">;
|
|
@@ -1682,7 +1682,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1682
1682
|
totalTokens?: number | undefined;
|
|
1683
1683
|
} | undefined;
|
|
1684
1684
|
model?: string | undefined;
|
|
1685
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1685
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1686
1686
|
toolCalls?: {
|
|
1687
1687
|
function: {
|
|
1688
1688
|
name: string;
|
|
@@ -1732,7 +1732,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1732
1732
|
totalTokens?: number | undefined;
|
|
1733
1733
|
} | undefined;
|
|
1734
1734
|
model?: string | undefined;
|
|
1735
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1735
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1736
1736
|
toolCalls?: {
|
|
1737
1737
|
function: {
|
|
1738
1738
|
name: string;
|
|
@@ -1787,7 +1787,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1787
1787
|
totalTokens?: number | undefined;
|
|
1788
1788
|
} | undefined;
|
|
1789
1789
|
model?: string | undefined;
|
|
1790
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1790
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1791
1791
|
toolCalls?: {
|
|
1792
1792
|
function: {
|
|
1793
1793
|
name: string;
|
|
@@ -1843,7 +1843,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1843
1843
|
totalTokens?: number | undefined;
|
|
1844
1844
|
} | undefined;
|
|
1845
1845
|
model?: string | undefined;
|
|
1846
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1846
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1847
1847
|
toolCalls?: {
|
|
1848
1848
|
function: {
|
|
1849
1849
|
name: string;
|
|
@@ -1905,7 +1905,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1905
1905
|
totalTokens?: number | undefined;
|
|
1906
1906
|
} | undefined;
|
|
1907
1907
|
model?: string | undefined;
|
|
1908
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1908
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1909
1909
|
toolCalls?: {
|
|
1910
1910
|
function: {
|
|
1911
1911
|
name: string;
|
|
@@ -1966,7 +1966,7 @@ export declare const MessageSearchResponseSchema: z.ZodObject<{
|
|
|
1966
1966
|
totalTokens?: number | undefined;
|
|
1967
1967
|
} | undefined;
|
|
1968
1968
|
model?: string | undefined;
|
|
1969
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
1969
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1970
1970
|
toolCalls?: {
|
|
1971
1971
|
function: {
|
|
1972
1972
|
name: string;
|
|
@@ -2109,7 +2109,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2109
2109
|
totalTokens?: number | undefined;
|
|
2110
2110
|
}>>;
|
|
2111
2111
|
model: z.ZodOptional<z.ZodString>;
|
|
2112
|
-
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere"]>>;
|
|
2112
|
+
provider: z.ZodOptional<z.ZodEnum<["openai", "openai-compatible", "anthropic", "google", "groq", "xai", "cohere", "openrouter", "litellm", "glama", "vertex", "bedrock", "local", "ollama"]>>;
|
|
2113
2113
|
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2114
2114
|
id: z.ZodString;
|
|
2115
2115
|
type: z.ZodLiteral<"function">;
|
|
@@ -2180,7 +2180,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2180
2180
|
totalTokens?: number | undefined;
|
|
2181
2181
|
} | undefined;
|
|
2182
2182
|
model?: string | undefined;
|
|
2183
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2183
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2184
2184
|
toolCalls?: {
|
|
2185
2185
|
function: {
|
|
2186
2186
|
name: string;
|
|
@@ -2230,7 +2230,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2230
2230
|
totalTokens?: number | undefined;
|
|
2231
2231
|
} | undefined;
|
|
2232
2232
|
model?: string | undefined;
|
|
2233
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2233
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2234
2234
|
toolCalls?: {
|
|
2235
2235
|
function: {
|
|
2236
2236
|
name: string;
|
|
@@ -2285,7 +2285,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2285
2285
|
totalTokens?: number | undefined;
|
|
2286
2286
|
} | undefined;
|
|
2287
2287
|
model?: string | undefined;
|
|
2288
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2288
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2289
2289
|
toolCalls?: {
|
|
2290
2290
|
function: {
|
|
2291
2291
|
name: string;
|
|
@@ -2341,7 +2341,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2341
2341
|
totalTokens?: number | undefined;
|
|
2342
2342
|
} | undefined;
|
|
2343
2343
|
model?: string | undefined;
|
|
2344
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2344
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2345
2345
|
toolCalls?: {
|
|
2346
2346
|
function: {
|
|
2347
2347
|
name: string;
|
|
@@ -2419,7 +2419,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2419
2419
|
totalTokens?: number | undefined;
|
|
2420
2420
|
} | undefined;
|
|
2421
2421
|
model?: string | undefined;
|
|
2422
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2422
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2423
2423
|
toolCalls?: {
|
|
2424
2424
|
function: {
|
|
2425
2425
|
name: string;
|
|
@@ -2484,7 +2484,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2484
2484
|
totalTokens?: number | undefined;
|
|
2485
2485
|
} | undefined;
|
|
2486
2486
|
model?: string | undefined;
|
|
2487
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2487
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2488
2488
|
toolCalls?: {
|
|
2489
2489
|
function: {
|
|
2490
2490
|
name: string;
|
|
@@ -2555,7 +2555,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2555
2555
|
totalTokens?: number | undefined;
|
|
2556
2556
|
} | undefined;
|
|
2557
2557
|
model?: string | undefined;
|
|
2558
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2558
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2559
2559
|
toolCalls?: {
|
|
2560
2560
|
function: {
|
|
2561
2561
|
name: string;
|
|
@@ -2625,7 +2625,7 @@ export declare const SessionSearchResponseSchema: z.ZodObject<{
|
|
|
2625
2625
|
totalTokens?: number | undefined;
|
|
2626
2626
|
} | undefined;
|
|
2627
2627
|
model?: string | undefined;
|
|
2628
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | undefined;
|
|
2628
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2629
2629
|
toolCalls?: {
|
|
2630
2630
|
function: {
|
|
2631
2631
|
name: string;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var start_server_exports = {};
|
|
20
|
+
__export(start_server_exports, {
|
|
21
|
+
startDextoServer: () => startDextoServer
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(start_server_exports);
|
|
24
|
+
var import_core = require("@dexto/core");
|
|
25
|
+
var import_index = require("./index.js");
|
|
26
|
+
var import_node = require("./node/index.js");
|
|
27
|
+
var import_webhook_subscriber = require("../events/webhook-subscriber.js");
|
|
28
|
+
var import_a2a_sse_subscriber = require("../events/a2a-sse-subscriber.js");
|
|
29
|
+
var import_approval_coordinator = require("../approval/approval-coordinator.js");
|
|
30
|
+
var import_manual_approval_handler = require("../approval/manual-approval-handler.js");
|
|
31
|
+
async function startDextoServer(agent, options = {}) {
|
|
32
|
+
const {
|
|
33
|
+
port: requestedPort,
|
|
34
|
+
hostname = "0.0.0.0",
|
|
35
|
+
agentCard: agentCardOverride = {},
|
|
36
|
+
webRoot,
|
|
37
|
+
webUIConfig,
|
|
38
|
+
baseUrl: baseUrlOverride
|
|
39
|
+
} = options;
|
|
40
|
+
const resolvedPort = requestedPort ?? (process.env.PORT ? Number(process.env.PORT) : 3e3);
|
|
41
|
+
const baseUrl = baseUrlOverride ?? `http://localhost:${resolvedPort}`;
|
|
42
|
+
import_core.logger.info(`Initializing Dexto server on ${hostname}:${resolvedPort}...`);
|
|
43
|
+
const agentCard = (0, import_core.createAgentCard)(
|
|
44
|
+
{
|
|
45
|
+
defaultName: agentCardOverride.name ?? "dexto-agent",
|
|
46
|
+
defaultVersion: agentCardOverride.version ?? "1.0.0",
|
|
47
|
+
defaultBaseUrl: baseUrl
|
|
48
|
+
},
|
|
49
|
+
agentCardOverride
|
|
50
|
+
);
|
|
51
|
+
import_core.logger.debug("Creating event infrastructure...");
|
|
52
|
+
const webhookSubscriber = new import_webhook_subscriber.WebhookEventSubscriber();
|
|
53
|
+
const sseSubscriber = new import_a2a_sse_subscriber.A2ASseEventSubscriber();
|
|
54
|
+
const approvalCoordinator = new import_approval_coordinator.ApprovalCoordinator();
|
|
55
|
+
import_core.logger.debug("Creating Hono application...");
|
|
56
|
+
const app = (0, import_index.createDextoApp)({
|
|
57
|
+
getAgent: (_ctx) => agent,
|
|
58
|
+
getAgentCard: () => agentCard,
|
|
59
|
+
approvalCoordinator,
|
|
60
|
+
webhookSubscriber,
|
|
61
|
+
sseSubscriber,
|
|
62
|
+
...webRoot ? { webRoot } : {},
|
|
63
|
+
...webUIConfig ? { webUIConfig } : {}
|
|
64
|
+
});
|
|
65
|
+
import_core.logger.debug("Creating Node.js HTTP server...");
|
|
66
|
+
const { server, webhookSubscriber: bridgeWebhookSubscriber } = (0, import_node.createNodeServer)(app, {
|
|
67
|
+
getAgent: () => agent,
|
|
68
|
+
port: resolvedPort,
|
|
69
|
+
hostname
|
|
70
|
+
});
|
|
71
|
+
if (bridgeWebhookSubscriber) {
|
|
72
|
+
import_core.logger.debug("Registering webhook subscriber with agent...");
|
|
73
|
+
agent.registerSubscriber(bridgeWebhookSubscriber);
|
|
74
|
+
}
|
|
75
|
+
const needsHandler = agent.config.toolConfirmation?.mode === "manual" || agent.config.elicitation.enabled;
|
|
76
|
+
if (needsHandler) {
|
|
77
|
+
import_core.logger.debug("Setting up manual approval handler...");
|
|
78
|
+
const handler = (0, import_manual_approval_handler.createManualApprovalHandler)(approvalCoordinator);
|
|
79
|
+
agent.setApprovalHandler(handler);
|
|
80
|
+
}
|
|
81
|
+
import_core.logger.debug("Wiring event subscribers to agent...");
|
|
82
|
+
webhookSubscriber.subscribe(agent.agentEventBus);
|
|
83
|
+
sseSubscriber.subscribe(agent.agentEventBus);
|
|
84
|
+
import_core.logger.info("Starting agent...");
|
|
85
|
+
await agent.start();
|
|
86
|
+
import_core.logger.info(`Server running at http://${hostname}:${resolvedPort}`, null, "green");
|
|
87
|
+
return {
|
|
88
|
+
server,
|
|
89
|
+
app,
|
|
90
|
+
agentCard,
|
|
91
|
+
stop: async () => {
|
|
92
|
+
import_core.logger.info("Stopping Dexto server...");
|
|
93
|
+
await agent.stop();
|
|
94
|
+
server.close();
|
|
95
|
+
import_core.logger.info("Server stopped", null, "yellow");
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
100
|
+
0 && (module.exports = {
|
|
101
|
+
startDextoServer
|
|
102
|
+
});
|