@dexto/server 1.5.6 → 1.5.7
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/index.cjs +6 -1
- package/dist/hono/index.d.ts +122 -22
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/index.js +6 -1
- package/dist/hono/middleware/error.cjs +6 -2
- package/dist/hono/middleware/error.d.ts.map +1 -1
- package/dist/hono/middleware/error.js +6 -2
- package/dist/hono/routes/a2a-tasks.d.ts +5 -5
- package/dist/hono/routes/dexto-auth.cjs +72 -0
- package/dist/hono/routes/dexto-auth.d.ts +21 -0
- package/dist/hono/routes/dexto-auth.d.ts.map +1 -0
- package/dist/hono/routes/dexto-auth.js +52 -0
- package/dist/hono/routes/key.d.ts +4 -4
- package/dist/hono/routes/llm.cjs +58 -2
- package/dist/hono/routes/llm.d.ts +95 -8
- package/dist/hono/routes/llm.d.ts.map +1 -1
- package/dist/hono/routes/llm.js +62 -3
- package/dist/hono/routes/mcp.d.ts +1 -1
- package/dist/hono/routes/messages.d.ts +1 -1
- package/dist/hono/routes/search.d.ts +2 -2
- package/dist/hono/routes/sessions.d.ts +1 -1
- package/dist/hono/schemas/responses.d.ts +41 -41
- package/dist/mcp/mcp-handler.cjs +0 -1
- package/dist/mcp/mcp-handler.d.ts.map +1 -1
- package/dist/mcp/mcp-handler.js +0 -1
- package/package.json +4 -4
package/dist/hono/index.cjs
CHANGED
|
@@ -45,6 +45,7 @@ var import_key = require("./routes/key.js");
|
|
|
45
45
|
var import_tools = require("./routes/tools.js");
|
|
46
46
|
var import_discovery = require("./routes/discovery.js");
|
|
47
47
|
var import_models = require("./routes/models.js");
|
|
48
|
+
var import_dexto_auth = require("./routes/dexto-auth.js");
|
|
48
49
|
var import_static = require("./routes/static.js");
|
|
49
50
|
var import_error = require("./middleware/error.js");
|
|
50
51
|
var import_redaction = require("./middleware/redaction.js");
|
|
@@ -102,7 +103,7 @@ function createDextoApp(options) {
|
|
|
102
103
|
app.use(middlewarePattern, import_redaction.prettyJsonMiddleware);
|
|
103
104
|
app.use(middlewarePattern, import_redaction.redactionMiddleware);
|
|
104
105
|
const routePrefix = normalizedPrefix;
|
|
105
|
-
const fullApp = app.route("/health", (0, import_health.createHealthRouter)(getAgent)).route("/", (0, import_a2a.createA2aRouter)(getAgentCard)).route("/", (0, import_a2a_jsonrpc.createA2AJsonRpcRouter)(getAgent, sseSubscriber)).route("/", (0, import_a2a_tasks.createA2ATasksRouter)(getAgent, sseSubscriber)).route(routePrefix, (0, import_greeting.createGreetingRouter)(getAgent)).route(routePrefix, (0, import_messages.createMessagesRouter)(getAgent, approvalCoordinator)).route(routePrefix, (0, import_llm.createLlmRouter)(getAgent)).route(routePrefix, (0, import_sessions.createSessionsRouter)(getAgent)).route(routePrefix, (0, import_search.createSearchRouter)(getAgent)).route(routePrefix, (0, import_mcp.createMcpRouter)(getAgent)).route(routePrefix, (0, import_webhooks.createWebhooksRouter)(getAgent, webhookSubscriber)).route(routePrefix, (0, import_prompts.createPromptsRouter)(getAgent)).route(routePrefix, (0, import_resources.createResourcesRouter)(getAgent)).route(routePrefix, (0, import_memory.createMemoryRouter)(getAgent)).route(routePrefix, (0, import_approvals.createApprovalsRouter)(getAgent, approvalCoordinator)).route(routePrefix, (0, import_agents.createAgentsRouter)(getAgent, agentsContext || dummyAgentsContext)).route(routePrefix, (0, import_queue.createQueueRouter)(getAgent)).route(routePrefix, (0, import_openrouter.createOpenRouterRouter)()).route(routePrefix, (0, import_key.createKeyRouter)()).route(routePrefix, (0, import_tools.createToolsRouter)(getAgent)).route(routePrefix, (0, import_discovery.createDiscoveryRouter)()).route(routePrefix, (0, import_models.createModelsRouter)());
|
|
106
|
+
const fullApp = app.route("/health", (0, import_health.createHealthRouter)(getAgent)).route("/", (0, import_a2a.createA2aRouter)(getAgentCard)).route("/", (0, import_a2a_jsonrpc.createA2AJsonRpcRouter)(getAgent, sseSubscriber)).route("/", (0, import_a2a_tasks.createA2ATasksRouter)(getAgent, sseSubscriber)).route(routePrefix, (0, import_greeting.createGreetingRouter)(getAgent)).route(routePrefix, (0, import_messages.createMessagesRouter)(getAgent, approvalCoordinator)).route(routePrefix, (0, import_llm.createLlmRouter)(getAgent)).route(routePrefix, (0, import_sessions.createSessionsRouter)(getAgent)).route(routePrefix, (0, import_search.createSearchRouter)(getAgent)).route(routePrefix, (0, import_mcp.createMcpRouter)(getAgent)).route(routePrefix, (0, import_webhooks.createWebhooksRouter)(getAgent, webhookSubscriber)).route(routePrefix, (0, import_prompts.createPromptsRouter)(getAgent)).route(routePrefix, (0, import_resources.createResourcesRouter)(getAgent)).route(routePrefix, (0, import_memory.createMemoryRouter)(getAgent)).route(routePrefix, (0, import_approvals.createApprovalsRouter)(getAgent, approvalCoordinator)).route(routePrefix, (0, import_agents.createAgentsRouter)(getAgent, agentsContext || dummyAgentsContext)).route(routePrefix, (0, import_queue.createQueueRouter)(getAgent)).route(routePrefix, (0, import_openrouter.createOpenRouterRouter)()).route(routePrefix, (0, import_key.createKeyRouter)()).route(routePrefix, (0, import_tools.createToolsRouter)(getAgent)).route(routePrefix, (0, import_discovery.createDiscoveryRouter)()).route(routePrefix, (0, import_models.createModelsRouter)()).route(routePrefix, (0, import_dexto_auth.createDextoAuthRouter)(getAgent));
|
|
106
107
|
fullApp.doc("/openapi.json", {
|
|
107
108
|
openapi: "3.0.0",
|
|
108
109
|
info: {
|
|
@@ -198,6 +199,10 @@ function createDextoApp(options) {
|
|
|
198
199
|
{
|
|
199
200
|
name: "models",
|
|
200
201
|
description: "List and manage local GGUF models and Ollama models"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "auth",
|
|
205
|
+
description: "Dexto authentication status and management"
|
|
201
206
|
}
|
|
202
207
|
]
|
|
203
208
|
});
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -26,6 +26,19 @@ export type CreateDextoAppOptions = {
|
|
|
26
26
|
disableAuth?: boolean;
|
|
27
27
|
};
|
|
28
28
|
export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIHono<import("hono").Env, import("hono/types").MergeSchemaPath<{
|
|
29
|
+
"/dexto-auth/status": {
|
|
30
|
+
$get: {
|
|
31
|
+
input: {};
|
|
32
|
+
output: {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
authenticated: boolean;
|
|
35
|
+
canUse: boolean;
|
|
36
|
+
};
|
|
37
|
+
outputFormat: "json";
|
|
38
|
+
status: 200;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}, "/api"> & import("hono/types").MergeSchemaPath<{
|
|
29
42
|
"/models/local": {
|
|
30
43
|
$get: {
|
|
31
44
|
input: {};
|
|
@@ -213,11 +226,11 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
213
226
|
$get: {
|
|
214
227
|
input: {
|
|
215
228
|
param: {
|
|
216
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
229
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
217
230
|
};
|
|
218
231
|
};
|
|
219
232
|
output: {
|
|
220
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
233
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
221
234
|
hasKey: boolean;
|
|
222
235
|
envVar: string;
|
|
223
236
|
keyValue?: string | undefined;
|
|
@@ -231,12 +244,12 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
231
244
|
$post: {
|
|
232
245
|
input: {
|
|
233
246
|
json: {
|
|
234
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
247
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
235
248
|
apiKey: string;
|
|
236
249
|
};
|
|
237
250
|
};
|
|
238
251
|
output: {
|
|
239
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
252
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
240
253
|
ok: true;
|
|
241
254
|
envVar: string;
|
|
242
255
|
};
|
|
@@ -1325,7 +1338,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
1325
1338
|
input: {};
|
|
1326
1339
|
output: {
|
|
1327
1340
|
servers: {
|
|
1328
|
-
status: "error" | "connected" | "disconnected";
|
|
1341
|
+
status: "error" | "connected" | "disconnected" | "auth-required";
|
|
1329
1342
|
id: string;
|
|
1330
1343
|
name: string;
|
|
1331
1344
|
}[];
|
|
@@ -1578,7 +1591,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
1578
1591
|
totalTokens?: number | undefined;
|
|
1579
1592
|
} | undefined;
|
|
1580
1593
|
model?: string | undefined;
|
|
1581
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1594
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto" | undefined;
|
|
1582
1595
|
toolCalls?: {
|
|
1583
1596
|
function: {
|
|
1584
1597
|
name: string;
|
|
@@ -1660,7 +1673,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
1660
1673
|
totalTokens?: number | undefined;
|
|
1661
1674
|
} | undefined;
|
|
1662
1675
|
model?: string | undefined;
|
|
1663
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1676
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto" | undefined;
|
|
1664
1677
|
toolCalls?: {
|
|
1665
1678
|
function: {
|
|
1666
1679
|
name: string;
|
|
@@ -1793,7 +1806,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
1793
1806
|
totalTokens?: number | undefined;
|
|
1794
1807
|
} | undefined;
|
|
1795
1808
|
model?: string | undefined;
|
|
1796
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
1809
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto" | undefined;
|
|
1797
1810
|
toolCalls?: {
|
|
1798
1811
|
function: {
|
|
1799
1812
|
name: string;
|
|
@@ -1943,7 +1956,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
1943
1956
|
output: {
|
|
1944
1957
|
config: {
|
|
1945
1958
|
model: string;
|
|
1946
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
1959
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
1947
1960
|
maxIterations?: number | undefined;
|
|
1948
1961
|
baseURL?: string | undefined;
|
|
1949
1962
|
maxInputTokens?: number | undefined;
|
|
@@ -1954,6 +1967,9 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
1954
1967
|
hasApiKey?: boolean | undefined;
|
|
1955
1968
|
displayName?: string | undefined;
|
|
1956
1969
|
};
|
|
1970
|
+
routing: {
|
|
1971
|
+
viaDexto: boolean;
|
|
1972
|
+
};
|
|
1957
1973
|
};
|
|
1958
1974
|
outputFormat: "json";
|
|
1959
1975
|
status: 200;
|
|
@@ -2127,6 +2143,50 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2127
2143
|
} | undefined;
|
|
2128
2144
|
}[];
|
|
2129
2145
|
} | undefined;
|
|
2146
|
+
minimax?: {
|
|
2147
|
+
name: string;
|
|
2148
|
+
hasApiKey: boolean;
|
|
2149
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2150
|
+
primaryEnvVar: string;
|
|
2151
|
+
supportsBaseURL: boolean;
|
|
2152
|
+
models: {
|
|
2153
|
+
name: string;
|
|
2154
|
+
maxInputTokens: number;
|
|
2155
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2156
|
+
default?: boolean | undefined;
|
|
2157
|
+
displayName?: string | undefined;
|
|
2158
|
+
pricing?: {
|
|
2159
|
+
inputPerM: number;
|
|
2160
|
+
outputPerM: number;
|
|
2161
|
+
cacheReadPerM?: number | undefined;
|
|
2162
|
+
cacheWritePerM?: number | undefined;
|
|
2163
|
+
currency?: "USD" | undefined;
|
|
2164
|
+
unit?: "per_million_tokens" | undefined;
|
|
2165
|
+
} | undefined;
|
|
2166
|
+
}[];
|
|
2167
|
+
} | undefined;
|
|
2168
|
+
glm?: {
|
|
2169
|
+
name: string;
|
|
2170
|
+
hasApiKey: boolean;
|
|
2171
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2172
|
+
primaryEnvVar: string;
|
|
2173
|
+
supportsBaseURL: boolean;
|
|
2174
|
+
models: {
|
|
2175
|
+
name: string;
|
|
2176
|
+
maxInputTokens: number;
|
|
2177
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2178
|
+
default?: boolean | undefined;
|
|
2179
|
+
displayName?: string | undefined;
|
|
2180
|
+
pricing?: {
|
|
2181
|
+
inputPerM: number;
|
|
2182
|
+
outputPerM: number;
|
|
2183
|
+
cacheReadPerM?: number | undefined;
|
|
2184
|
+
cacheWritePerM?: number | undefined;
|
|
2185
|
+
currency?: "USD" | undefined;
|
|
2186
|
+
unit?: "per_million_tokens" | undefined;
|
|
2187
|
+
} | undefined;
|
|
2188
|
+
}[];
|
|
2189
|
+
} | undefined;
|
|
2130
2190
|
openrouter?: {
|
|
2131
2191
|
name: string;
|
|
2132
2192
|
hasApiKey: boolean;
|
|
@@ -2281,6 +2341,28 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2281
2341
|
} | undefined;
|
|
2282
2342
|
}[];
|
|
2283
2343
|
} | undefined;
|
|
2344
|
+
dexto?: {
|
|
2345
|
+
name: string;
|
|
2346
|
+
hasApiKey: boolean;
|
|
2347
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2348
|
+
primaryEnvVar: string;
|
|
2349
|
+
supportsBaseURL: boolean;
|
|
2350
|
+
models: {
|
|
2351
|
+
name: string;
|
|
2352
|
+
maxInputTokens: number;
|
|
2353
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2354
|
+
default?: boolean | undefined;
|
|
2355
|
+
displayName?: string | undefined;
|
|
2356
|
+
pricing?: {
|
|
2357
|
+
inputPerM: number;
|
|
2358
|
+
outputPerM: number;
|
|
2359
|
+
cacheReadPerM?: number | undefined;
|
|
2360
|
+
cacheWritePerM?: number | undefined;
|
|
2361
|
+
currency?: "USD" | undefined;
|
|
2362
|
+
unit?: "per_million_tokens" | undefined;
|
|
2363
|
+
} | undefined;
|
|
2364
|
+
}[];
|
|
2365
|
+
} | undefined;
|
|
2284
2366
|
};
|
|
2285
2367
|
} | {
|
|
2286
2368
|
models: {
|
|
@@ -2310,15 +2392,15 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2310
2392
|
input: {
|
|
2311
2393
|
json: {
|
|
2312
2394
|
model?: string | undefined;
|
|
2313
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2395
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto" | undefined;
|
|
2314
2396
|
apiKey?: string | undefined;
|
|
2397
|
+
maxInputTokens?: number | undefined;
|
|
2315
2398
|
maxIterations?: number | undefined;
|
|
2316
2399
|
baseURL?: string | undefined;
|
|
2317
|
-
maxInputTokens?: number | undefined;
|
|
2318
2400
|
maxOutputTokens?: number | undefined;
|
|
2319
2401
|
temperature?: number | undefined;
|
|
2320
2402
|
allowedMediaTypes?: string[] | undefined;
|
|
2321
|
-
reasoningEffort?: "
|
|
2403
|
+
reasoningEffort?: "low" | "none" | "minimal" | "medium" | "high" | "xhigh" | undefined;
|
|
2322
2404
|
} & {
|
|
2323
2405
|
sessionId?: string | undefined;
|
|
2324
2406
|
};
|
|
@@ -2326,7 +2408,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2326
2408
|
output: {
|
|
2327
2409
|
config: {
|
|
2328
2410
|
model: string;
|
|
2329
|
-
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
2411
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
2330
2412
|
maxIterations?: number | undefined;
|
|
2331
2413
|
baseURL?: string | undefined;
|
|
2332
2414
|
maxInputTokens?: number | undefined;
|
|
@@ -2349,7 +2431,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2349
2431
|
output: {
|
|
2350
2432
|
models: {
|
|
2351
2433
|
name: string;
|
|
2352
|
-
provider: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
2434
|
+
provider: "dexto" | "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
2353
2435
|
apiKey?: string | undefined | undefined;
|
|
2354
2436
|
baseURL?: string | undefined | undefined;
|
|
2355
2437
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined | undefined;
|
|
@@ -2369,7 +2451,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2369
2451
|
input: {
|
|
2370
2452
|
json: {
|
|
2371
2453
|
name: string;
|
|
2372
|
-
provider?: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2454
|
+
provider?: "dexto" | "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2373
2455
|
apiKey?: string | undefined;
|
|
2374
2456
|
baseURL?: string | undefined;
|
|
2375
2457
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
|
|
@@ -2382,7 +2464,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2382
2464
|
output: {
|
|
2383
2465
|
model: {
|
|
2384
2466
|
name: string;
|
|
2385
|
-
provider: "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
2467
|
+
provider: "dexto" | "openai-compatible" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama";
|
|
2386
2468
|
apiKey?: string | undefined | undefined;
|
|
2387
2469
|
baseURL?: string | undefined | undefined;
|
|
2388
2470
|
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined | undefined;
|
|
@@ -2425,6 +2507,24 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2425
2507
|
status: 404;
|
|
2426
2508
|
};
|
|
2427
2509
|
};
|
|
2510
|
+
} & {
|
|
2511
|
+
"/llm/capabilities": {
|
|
2512
|
+
$get: {
|
|
2513
|
+
input: {
|
|
2514
|
+
query: {
|
|
2515
|
+
model: string;
|
|
2516
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
2517
|
+
};
|
|
2518
|
+
};
|
|
2519
|
+
output: {
|
|
2520
|
+
model: string;
|
|
2521
|
+
provider: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto";
|
|
2522
|
+
supportedFileTypes: ("image" | "audio" | "pdf")[];
|
|
2523
|
+
};
|
|
2524
|
+
outputFormat: "json";
|
|
2525
|
+
status: 200;
|
|
2526
|
+
};
|
|
2527
|
+
};
|
|
2428
2528
|
}, "/api"> & import("hono/types").MergeSchemaPath<{
|
|
2429
2529
|
"/message": {
|
|
2430
2530
|
$post: {
|
|
@@ -2530,7 +2630,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2530
2630
|
totalTokens?: number | undefined;
|
|
2531
2631
|
} | undefined;
|
|
2532
2632
|
model?: string | undefined;
|
|
2533
|
-
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | undefined;
|
|
2633
|
+
provider?: "openai" | "openai-compatible" | "anthropic" | "google" | "groq" | "xai" | "cohere" | "minimax" | "glm" | "openrouter" | "litellm" | "glama" | "vertex" | "bedrock" | "local" | "ollama" | "dexto" | undefined;
|
|
2534
2634
|
};
|
|
2535
2635
|
outputFormat: "json";
|
|
2536
2636
|
status: 200;
|
|
@@ -2692,7 +2792,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2692
2792
|
};
|
|
2693
2793
|
output: {
|
|
2694
2794
|
status: {
|
|
2695
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
2795
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
2696
2796
|
message?: {
|
|
2697
2797
|
role: "user" | "agent";
|
|
2698
2798
|
kind: "message";
|
|
@@ -2794,7 +2894,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2794
2894
|
$get: {
|
|
2795
2895
|
input: {
|
|
2796
2896
|
query: {
|
|
2797
|
-
status?: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" |
|
|
2897
|
+
status?: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | undefined;
|
|
2798
2898
|
contextId?: string | undefined;
|
|
2799
2899
|
pageSize?: string | undefined;
|
|
2800
2900
|
historyLength?: string | undefined;
|
|
@@ -2806,7 +2906,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2806
2906
|
output: {
|
|
2807
2907
|
tasks: {
|
|
2808
2908
|
status: {
|
|
2809
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
2909
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
2810
2910
|
message?: {
|
|
2811
2911
|
role: "user" | "agent";
|
|
2812
2912
|
kind: "message";
|
|
@@ -2926,7 +3026,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
2926
3026
|
};
|
|
2927
3027
|
output: {
|
|
2928
3028
|
status: {
|
|
2929
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
3029
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
2930
3030
|
message?: {
|
|
2931
3031
|
role: "user" | "agent";
|
|
2932
3032
|
kind: "message";
|
|
@@ -3042,7 +3142,7 @@ export declare function createDextoApp(options: CreateDextoAppOptions): OpenAPIH
|
|
|
3042
3142
|
};
|
|
3043
3143
|
output: {
|
|
3044
3144
|
status: {
|
|
3045
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
3145
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
3046
3146
|
message?: {
|
|
3047
3147
|
role: "user" | "agent";
|
|
3048
3148
|
kind: "message";
|
package/dist/hono/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hono/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBA4M5D;AAID,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAGxD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/hono/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import { createKeyRouter } from "./routes/key.js";
|
|
|
22
22
|
import { createToolsRouter } from "./routes/tools.js";
|
|
23
23
|
import { createDiscoveryRouter } from "./routes/discovery.js";
|
|
24
24
|
import { createModelsRouter } from "./routes/models.js";
|
|
25
|
+
import { createDextoAuthRouter } from "./routes/dexto-auth.js";
|
|
25
26
|
import {
|
|
26
27
|
createStaticRouter,
|
|
27
28
|
createSpaFallbackHandler
|
|
@@ -81,7 +82,7 @@ function createDextoApp(options) {
|
|
|
81
82
|
app.use(middlewarePattern, prettyJsonMiddleware);
|
|
82
83
|
app.use(middlewarePattern, redactionMiddleware);
|
|
83
84
|
const routePrefix = normalizedPrefix;
|
|
84
|
-
const fullApp = app.route("/health", createHealthRouter(getAgent)).route("/", createA2aRouter(getAgentCard)).route("/", createA2AJsonRpcRouter(getAgent, sseSubscriber)).route("/", createA2ATasksRouter(getAgent, sseSubscriber)).route(routePrefix, createGreetingRouter(getAgent)).route(routePrefix, createMessagesRouter(getAgent, approvalCoordinator)).route(routePrefix, createLlmRouter(getAgent)).route(routePrefix, createSessionsRouter(getAgent)).route(routePrefix, createSearchRouter(getAgent)).route(routePrefix, createMcpRouter(getAgent)).route(routePrefix, createWebhooksRouter(getAgent, webhookSubscriber)).route(routePrefix, createPromptsRouter(getAgent)).route(routePrefix, createResourcesRouter(getAgent)).route(routePrefix, createMemoryRouter(getAgent)).route(routePrefix, createApprovalsRouter(getAgent, approvalCoordinator)).route(routePrefix, createAgentsRouter(getAgent, agentsContext || dummyAgentsContext)).route(routePrefix, createQueueRouter(getAgent)).route(routePrefix, createOpenRouterRouter()).route(routePrefix, createKeyRouter()).route(routePrefix, createToolsRouter(getAgent)).route(routePrefix, createDiscoveryRouter()).route(routePrefix, createModelsRouter());
|
|
85
|
+
const fullApp = app.route("/health", createHealthRouter(getAgent)).route("/", createA2aRouter(getAgentCard)).route("/", createA2AJsonRpcRouter(getAgent, sseSubscriber)).route("/", createA2ATasksRouter(getAgent, sseSubscriber)).route(routePrefix, createGreetingRouter(getAgent)).route(routePrefix, createMessagesRouter(getAgent, approvalCoordinator)).route(routePrefix, createLlmRouter(getAgent)).route(routePrefix, createSessionsRouter(getAgent)).route(routePrefix, createSearchRouter(getAgent)).route(routePrefix, createMcpRouter(getAgent)).route(routePrefix, createWebhooksRouter(getAgent, webhookSubscriber)).route(routePrefix, createPromptsRouter(getAgent)).route(routePrefix, createResourcesRouter(getAgent)).route(routePrefix, createMemoryRouter(getAgent)).route(routePrefix, createApprovalsRouter(getAgent, approvalCoordinator)).route(routePrefix, createAgentsRouter(getAgent, agentsContext || dummyAgentsContext)).route(routePrefix, createQueueRouter(getAgent)).route(routePrefix, createOpenRouterRouter()).route(routePrefix, createKeyRouter()).route(routePrefix, createToolsRouter(getAgent)).route(routePrefix, createDiscoveryRouter()).route(routePrefix, createModelsRouter()).route(routePrefix, createDextoAuthRouter(getAgent));
|
|
85
86
|
fullApp.doc("/openapi.json", {
|
|
86
87
|
openapi: "3.0.0",
|
|
87
88
|
info: {
|
|
@@ -177,6 +178,10 @@ function createDextoApp(options) {
|
|
|
177
178
|
{
|
|
178
179
|
name: "models",
|
|
179
180
|
description: "List and manage local GGUF models and Ollama models"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
name: "auth",
|
|
184
|
+
description: "Dexto authentication status and management"
|
|
180
185
|
}
|
|
181
186
|
]
|
|
182
187
|
});
|
|
@@ -30,12 +30,16 @@ const mapErrorTypeToStatus = (type) => {
|
|
|
30
30
|
switch (type) {
|
|
31
31
|
case import_core.ErrorType.USER:
|
|
32
32
|
return 400;
|
|
33
|
-
case import_core.ErrorType.
|
|
34
|
-
return
|
|
33
|
+
case import_core.ErrorType.PAYMENT_REQUIRED:
|
|
34
|
+
return 402;
|
|
35
35
|
case import_core.ErrorType.FORBIDDEN:
|
|
36
36
|
return 403;
|
|
37
|
+
case import_core.ErrorType.NOT_FOUND:
|
|
38
|
+
return 404;
|
|
37
39
|
case import_core.ErrorType.TIMEOUT:
|
|
38
40
|
return 408;
|
|
41
|
+
case import_core.ErrorType.CONFLICT:
|
|
42
|
+
return 409;
|
|
39
43
|
case import_core.ErrorType.RATE_LIMIT:
|
|
40
44
|
return 429;
|
|
41
45
|
case import_core.ErrorType.SYSTEM:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/hono/middleware/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAc9F,eAAO,MAAM,oBAAoB,GAAI,MAAM,SAAS,KAAG,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/hono/middleware/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAc9F,eAAO,MAAM,oBAAoB,GAAI,MAAM,SAAS,KAAG,MAwBtD,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,UAAU,CAAC,OAAO,WAAW,CAAC,KAAG,MAI5E,CAAC;AAEF,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,OAkFrD"}
|
|
@@ -5,12 +5,16 @@ const mapErrorTypeToStatus = (type) => {
|
|
|
5
5
|
switch (type) {
|
|
6
6
|
case ErrorType.USER:
|
|
7
7
|
return 400;
|
|
8
|
-
case ErrorType.
|
|
9
|
-
return
|
|
8
|
+
case ErrorType.PAYMENT_REQUIRED:
|
|
9
|
+
return 402;
|
|
10
10
|
case ErrorType.FORBIDDEN:
|
|
11
11
|
return 403;
|
|
12
|
+
case ErrorType.NOT_FOUND:
|
|
13
|
+
return 404;
|
|
12
14
|
case ErrorType.TIMEOUT:
|
|
13
15
|
return 408;
|
|
16
|
+
case ErrorType.CONFLICT:
|
|
17
|
+
return 409;
|
|
14
18
|
case ErrorType.RATE_LIMIT:
|
|
15
19
|
return 429;
|
|
16
20
|
case ErrorType.SYSTEM:
|
|
@@ -81,7 +81,7 @@ export declare function createA2ATasksRouter(getAgent: GetAgentFn, sseSubscriber
|
|
|
81
81
|
};
|
|
82
82
|
output: {
|
|
83
83
|
status: {
|
|
84
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
84
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
85
85
|
message?: {
|
|
86
86
|
role: "user" | "agent";
|
|
87
87
|
kind: "message";
|
|
@@ -183,7 +183,7 @@ export declare function createA2ATasksRouter(getAgent: GetAgentFn, sseSubscriber
|
|
|
183
183
|
$get: {
|
|
184
184
|
input: {
|
|
185
185
|
query: {
|
|
186
|
-
status?: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" |
|
|
186
|
+
status?: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected" | undefined;
|
|
187
187
|
contextId?: string | undefined;
|
|
188
188
|
pageSize?: string | undefined;
|
|
189
189
|
historyLength?: string | undefined;
|
|
@@ -195,7 +195,7 @@ export declare function createA2ATasksRouter(getAgent: GetAgentFn, sseSubscriber
|
|
|
195
195
|
output: {
|
|
196
196
|
tasks: {
|
|
197
197
|
status: {
|
|
198
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
198
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
199
199
|
message?: {
|
|
200
200
|
role: "user" | "agent";
|
|
201
201
|
kind: "message";
|
|
@@ -315,7 +315,7 @@ export declare function createA2ATasksRouter(getAgent: GetAgentFn, sseSubscriber
|
|
|
315
315
|
};
|
|
316
316
|
output: {
|
|
317
317
|
status: {
|
|
318
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
318
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
319
319
|
message?: {
|
|
320
320
|
role: "user" | "agent";
|
|
321
321
|
kind: "message";
|
|
@@ -431,7 +431,7 @@ export declare function createA2ATasksRouter(getAgent: GetAgentFn, sseSubscriber
|
|
|
431
431
|
};
|
|
432
432
|
output: {
|
|
433
433
|
status: {
|
|
434
|
-
state: "unknown" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected"
|
|
434
|
+
state: "unknown" | "auth-required" | "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "rejected";
|
|
435
435
|
message?: {
|
|
436
436
|
role: "user" | "agent";
|
|
437
437
|
kind: "message";
|
|
@@ -0,0 +1,72 @@
|
|
|
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 dexto_auth_exports = {};
|
|
20
|
+
__export(dexto_auth_exports, {
|
|
21
|
+
createDextoAuthRouter: () => createDextoAuthRouter
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(dexto_auth_exports);
|
|
24
|
+
var import_zod_openapi = require("@hono/zod-openapi");
|
|
25
|
+
var import_agent_management = require("@dexto/agent-management");
|
|
26
|
+
function createDextoAuthRouter(_getAgent) {
|
|
27
|
+
const app = new import_zod_openapi.OpenAPIHono();
|
|
28
|
+
const statusRoute = (0, import_zod_openapi.createRoute)({
|
|
29
|
+
method: "get",
|
|
30
|
+
path: "/dexto-auth/status",
|
|
31
|
+
summary: "Dexto Auth Status",
|
|
32
|
+
description: "Returns dexto authentication status. Used by Web UI to check if user can use dexto features.",
|
|
33
|
+
tags: ["auth"],
|
|
34
|
+
responses: {
|
|
35
|
+
200: {
|
|
36
|
+
description: "Dexto auth status",
|
|
37
|
+
content: {
|
|
38
|
+
"application/json": {
|
|
39
|
+
schema: import_zod_openapi.z.object({
|
|
40
|
+
enabled: import_zod_openapi.z.boolean().describe("Whether dexto auth feature is enabled"),
|
|
41
|
+
authenticated: import_zod_openapi.z.boolean().describe("Whether user is authenticated with dexto"),
|
|
42
|
+
canUse: import_zod_openapi.z.boolean().describe(
|
|
43
|
+
"Whether user can use dexto (authenticated AND has API key)"
|
|
44
|
+
)
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return app.openapi(statusRoute, async (c) => {
|
|
52
|
+
const enabled = (0, import_agent_management.isDextoAuthEnabled)();
|
|
53
|
+
if (!enabled) {
|
|
54
|
+
return c.json({
|
|
55
|
+
enabled: false,
|
|
56
|
+
authenticated: false,
|
|
57
|
+
canUse: false
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const authenticated = await (0, import_agent_management.isDextoAuthenticated)();
|
|
61
|
+
const canUse = await (0, import_agent_management.canUseDextoProvider)();
|
|
62
|
+
return c.json({
|
|
63
|
+
enabled,
|
|
64
|
+
authenticated,
|
|
65
|
+
canUse
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
70
|
+
0 && (module.exports = {
|
|
71
|
+
createDextoAuthRouter
|
|
72
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { OpenAPIHono } from '@hono/zod-openapi';
|
|
2
|
+
import type { GetAgentFn } from '../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Dexto authentication status routes.
|
|
5
|
+
* Provides endpoints to check dexto auth status for Web UI.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createDextoAuthRouter(_getAgent: GetAgentFn): OpenAPIHono<import("hono").Env, {
|
|
8
|
+
"/dexto-auth/status": {
|
|
9
|
+
$get: {
|
|
10
|
+
input: {};
|
|
11
|
+
output: {
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
authenticated: boolean;
|
|
14
|
+
canUse: boolean;
|
|
15
|
+
};
|
|
16
|
+
outputFormat: "json";
|
|
17
|
+
status: 200;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, "/">;
|
|
21
|
+
//# sourceMappingURL=dexto-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dexto-auth.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/dexto-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAO9C;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,UAAU;;;;;;;;;;;;;QAoD1D"}
|