@dexto/server 1.6.16 → 1.6.18
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/events/a2a-sse-subscriber.cjs +9 -2
- package/dist/events/a2a-sse-subscriber.d.ts.map +1 -1
- package/dist/events/a2a-sse-subscriber.js +9 -2
- package/dist/events/usage-event-subscriber.cjs +263 -0
- package/dist/events/usage-event-subscriber.d.ts +35 -0
- package/dist/events/usage-event-subscriber.d.ts.map +1 -0
- package/dist/events/usage-event-subscriber.js +244 -0
- package/dist/events/usage-event-types.cjs +16 -0
- package/dist/events/usage-event-types.d.ts +33 -0
- package/dist/events/usage-event-types.d.ts.map +1 -0
- package/dist/events/usage-event-types.js +0 -0
- package/dist/hono/__tests__/test-fixtures.cjs +3 -2
- package/dist/hono/__tests__/test-fixtures.d.ts +6 -2
- package/dist/hono/__tests__/test-fixtures.d.ts.map +1 -1
- package/dist/hono/__tests__/test-fixtures.js +3 -2
- package/dist/hono/index.d.ts +245 -33
- package/dist/hono/index.d.ts.map +1 -1
- package/dist/hono/routes/a2a-tasks.d.ts +9 -9
- package/dist/hono/routes/approvals.cjs +94 -6
- package/dist/hono/routes/approvals.d.ts +22 -6
- package/dist/hono/routes/approvals.d.ts.map +1 -1
- package/dist/hono/routes/approvals.js +94 -6
- package/dist/hono/routes/messages.cjs +16 -5
- package/dist/hono/routes/messages.d.ts +6 -0
- package/dist/hono/routes/messages.d.ts.map +1 -1
- package/dist/hono/routes/messages.js +17 -6
- package/dist/hono/routes/search.d.ts +10 -0
- package/dist/hono/routes/search.d.ts.map +1 -1
- package/dist/hono/routes/sessions.cjs +251 -2
- package/dist/hono/routes/sessions.d.ts +198 -18
- package/dist/hono/routes/sessions.d.ts.map +1 -1
- package/dist/hono/routes/sessions.js +259 -3
- package/dist/hono/routes/system-prompt.d.ts +1 -1
- package/dist/hono/schemas/responses.cjs +48 -8
- package/dist/hono/schemas/responses.d.ts +489 -22
- package/dist/hono/schemas/responses.d.ts.map +1 -1
- package/dist/hono/schemas/responses.js +49 -9
- package/dist/index.cjs +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/hono/schemas/responses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"responses.d.ts","sourceRoot":"","sources":["../../../src/hono/schemas/responses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAyBxB,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAM3E,eAAO,MAAM,cAAc;;;;;;;;;EAMO,CAAC;AAEnC,eAAO,MAAM,eAAe;;;;;;;;;;;;EAOO,CAAC;AAEpC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;EAQO,CAAC;AAEnC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B0C,CAAC;AAE5E,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAO2C,CAAC;AAE1E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;EAeqB,CAAC;AAEjD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;EAyBU,CAAC;AAExC,eAAO,MAAM,mBAAmB,sCAE+B,CAA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AAO,2BAA2B,CAAC,CAAC;AAGjF,eAAO,MAAM,oBAAoB;;;;;;;;;EAMD,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGnE,eAAO,MAAM,oBAAoB;;;;;;;;;EAMS,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
LLM_PRICING_STATUSES,
|
|
4
|
+
LLMConfigBaseSchema as CoreLLMConfigBaseSchema,
|
|
5
|
+
LLM_PROVIDERS
|
|
6
|
+
} from "@dexto/core";
|
|
3
7
|
import { MemorySchema } from "@dexto/core";
|
|
4
8
|
import { LLMConfigBaseSchema } from "@dexto/core";
|
|
5
9
|
const TextPartSchema = z.object({
|
|
@@ -49,8 +53,11 @@ const TokenUsageSchema = z.object({
|
|
|
49
53
|
inputTokens: z.number().int().nonnegative().optional().describe("Number of input tokens"),
|
|
50
54
|
outputTokens: z.number().int().nonnegative().optional().describe("Number of output tokens"),
|
|
51
55
|
reasoningTokens: z.number().int().nonnegative().optional().describe("Number of reasoning tokens"),
|
|
56
|
+
cacheReadTokens: z.number().int().nonnegative().optional().describe("Number of cache read tokens"),
|
|
57
|
+
cacheWriteTokens: z.number().int().nonnegative().optional().describe("Number of cache write tokens"),
|
|
52
58
|
totalTokens: z.number().int().nonnegative().optional().describe("Total tokens used")
|
|
53
59
|
}).strict().describe("Token usage accounting");
|
|
60
|
+
const PricingStatusSchema = z.enum(LLM_PRICING_STATUSES).describe("Whether pricing was resolved for this response");
|
|
54
61
|
const InternalMessageSchema = z.object({
|
|
55
62
|
id: z.string().uuid().optional().describe("Unique message identifier (UUID)"),
|
|
56
63
|
role: z.enum(["system", "user", "assistant", "tool"]).describe("Role of the message sender"),
|
|
@@ -58,6 +65,11 @@ const InternalMessageSchema = z.object({
|
|
|
58
65
|
content: z.union([z.string(), z.null(), z.array(ContentPartSchema)]).describe("Message content (string, null, or array of parts)"),
|
|
59
66
|
reasoning: z.string().optional().describe("Optional model reasoning text"),
|
|
60
67
|
tokenUsage: TokenUsageSchema.optional().describe("Optional token usage accounting"),
|
|
68
|
+
estimatedCost: z.number().nonnegative().optional().describe("Estimated cost in USD for this response"),
|
|
69
|
+
pricingStatus: PricingStatusSchema.optional().describe(
|
|
70
|
+
"Whether pricing was resolved for this response"
|
|
71
|
+
),
|
|
72
|
+
usageScopeId: z.string().optional().describe("Optional usage scope identifier for runtime-scoped metering"),
|
|
61
73
|
model: z.string().optional().describe("Model identifier for assistant messages"),
|
|
62
74
|
provider: z.enum(LLM_PROVIDERS).optional().describe("Provider identifier for assistant messages"),
|
|
63
75
|
toolCalls: z.array(ToolCallSchema).optional().describe("Tool calls made by the assistant"),
|
|
@@ -78,14 +90,12 @@ import {
|
|
|
78
90
|
} from "@dexto/core";
|
|
79
91
|
import { PermissionsConfigSchema } from "@dexto/core";
|
|
80
92
|
import { ResourceConfigSchema } from "@dexto/core";
|
|
81
|
-
const SessionTokenUsageSchema =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
totalTokens: z.number().int().nonnegative().describe("Total tokens used")
|
|
88
|
-
}).strict().describe("Session-level token usage (all fields required for cumulative totals)");
|
|
93
|
+
const SessionTokenUsageSchema = TokenUsageSchema.required().describe(
|
|
94
|
+
"Session-level token usage (all fields required for cumulative totals)"
|
|
95
|
+
);
|
|
96
|
+
const SessionUsageTrackingSchema = z.object({
|
|
97
|
+
hasUntrackedChatGPTLoginUsage: z.boolean().optional().describe("Whether this session includes known untracked ChatGPT Login usage")
|
|
98
|
+
}).strict().describe("Usage tracking caveats for a session");
|
|
89
99
|
const ModelStatisticsSchema = z.object({
|
|
90
100
|
provider: z.string().describe("LLM provider identifier"),
|
|
91
101
|
model: z.string().describe("Model identifier"),
|
|
@@ -95,6 +105,29 @@ const ModelStatisticsSchema = z.object({
|
|
|
95
105
|
firstUsedAt: z.number().int().positive().describe("First use timestamp (Unix ms)"),
|
|
96
106
|
lastUsedAt: z.number().int().positive().describe("Last use timestamp (Unix ms)")
|
|
97
107
|
}).strict().describe("Per-model statistics within a session");
|
|
108
|
+
const UsageSummarySchema = z.object({
|
|
109
|
+
tokenUsage: SessionTokenUsageSchema.describe(
|
|
110
|
+
"Aggregate token usage for the selected scope"
|
|
111
|
+
),
|
|
112
|
+
estimatedCost: z.number().nonnegative().describe("Total estimated cost in USD for the selected scope"),
|
|
113
|
+
hasUnpricedResponses: z.boolean().describe(
|
|
114
|
+
"Whether any response in the selected scope has usage but no resolved pricing"
|
|
115
|
+
),
|
|
116
|
+
modelStats: z.array(
|
|
117
|
+
z.object({
|
|
118
|
+
provider: z.string().describe("LLM provider identifier"),
|
|
119
|
+
model: z.string().describe("Model identifier"),
|
|
120
|
+
messageCount: z.number().int().nonnegative().describe("Number of responses using this model in the selected scope"),
|
|
121
|
+
tokenUsage: SessionTokenUsageSchema.describe(
|
|
122
|
+
"Token usage for this model in the selected scope"
|
|
123
|
+
),
|
|
124
|
+
estimatedCost: z.number().nonnegative().describe("Estimated cost in USD for this model in the selected scope")
|
|
125
|
+
}).strict()
|
|
126
|
+
).optional().describe("Per-model usage statistics within the selected scope")
|
|
127
|
+
}).strict().describe("Usage summary for a session or session scope");
|
|
128
|
+
const ScopedUsageSummarySchema = UsageSummarySchema.extend({
|
|
129
|
+
scopeId: z.string().describe("Usage scope identifier")
|
|
130
|
+
}).strict().describe("Usage summary for a specific scope within a session");
|
|
98
131
|
const SessionMetadataSchema = z.object({
|
|
99
132
|
id: z.string().describe("Unique session identifier"),
|
|
100
133
|
createdAt: z.number().int().positive().nullable().describe("Creation timestamp (Unix ms, null if unavailable)"),
|
|
@@ -106,6 +139,9 @@ const SessionMetadataSchema = z.object({
|
|
|
106
139
|
),
|
|
107
140
|
estimatedCost: z.number().nonnegative().optional().describe("Total estimated cost in USD across all models"),
|
|
108
141
|
modelStats: z.array(ModelStatisticsSchema).optional().describe("Per-model usage statistics (for multi-model sessions)"),
|
|
142
|
+
usageTracking: SessionUsageTrackingSchema.optional().describe(
|
|
143
|
+
"Known caveats or gaps in usage tracking for this session"
|
|
144
|
+
),
|
|
109
145
|
workspaceId: z.string().optional().nullable().describe("Associated workspace ID, if any"),
|
|
110
146
|
parentSessionId: z.string().optional().nullable().describe("Parent session ID if this session was forked, otherwise null")
|
|
111
147
|
}).strict().describe("Session metadata");
|
|
@@ -315,6 +351,7 @@ export {
|
|
|
315
351
|
ModelStatisticsSchema,
|
|
316
352
|
OkResponseSchema,
|
|
317
353
|
PermissionsConfigSchema,
|
|
354
|
+
PricingStatusSchema,
|
|
318
355
|
PromptArgumentSchema,
|
|
319
356
|
PromptDefinitionSchema,
|
|
320
357
|
PromptInfoSchema,
|
|
@@ -324,11 +361,13 @@ export {
|
|
|
324
361
|
ResourceSchema,
|
|
325
362
|
ScheduleSchema,
|
|
326
363
|
ScheduleTaskSchema,
|
|
364
|
+
ScopedUsageSummarySchema,
|
|
327
365
|
SearchResultSchema,
|
|
328
366
|
SessionMetadataSchema,
|
|
329
367
|
SessionSearchResponseSchema,
|
|
330
368
|
SessionSearchResultSchema,
|
|
331
369
|
SessionTokenUsageSchema,
|
|
370
|
+
SessionUsageTrackingSchema,
|
|
332
371
|
SseServerConfigSchema,
|
|
333
372
|
StandardErrorEnvelopeSchema,
|
|
334
373
|
StatusResponseSchema,
|
|
@@ -338,6 +377,7 @@ export {
|
|
|
338
377
|
ToolCallSchema,
|
|
339
378
|
ToolSchema,
|
|
340
379
|
UIResourcePartSchema,
|
|
380
|
+
UsageSummarySchema,
|
|
341
381
|
WebhookSchema,
|
|
342
382
|
WorkspaceSchema
|
|
343
383
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,8 @@ __reExport(index_exports, require("./hono/node/index.js"), module.exports);
|
|
|
27
27
|
__reExport(index_exports, require("./hono/start-server.js"), module.exports);
|
|
28
28
|
__reExport(index_exports, require("./events/webhook-subscriber.js"), module.exports);
|
|
29
29
|
__reExport(index_exports, require("./events/a2a-sse-subscriber.js"), module.exports);
|
|
30
|
+
__reExport(index_exports, require("./events/usage-event-subscriber.js"), module.exports);
|
|
31
|
+
__reExport(index_exports, require("./events/usage-event-types.js"), module.exports);
|
|
30
32
|
__reExport(index_exports, require("./events/webhook-types.js"), module.exports);
|
|
31
33
|
__reExport(index_exports, require("./events/types.js"), module.exports);
|
|
32
34
|
__reExport(index_exports, require("./mcp/mcp-handler.js"), module.exports);
|
|
@@ -41,6 +43,8 @@ var import_service = require("@dexto/tools-scheduler/service");
|
|
|
41
43
|
...require("./hono/start-server.js"),
|
|
42
44
|
...require("./events/webhook-subscriber.js"),
|
|
43
45
|
...require("./events/a2a-sse-subscriber.js"),
|
|
46
|
+
...require("./events/usage-event-subscriber.js"),
|
|
47
|
+
...require("./events/usage-event-types.js"),
|
|
44
48
|
...require("./events/webhook-types.js"),
|
|
45
49
|
...require("./events/types.js"),
|
|
46
50
|
...require("./mcp/mcp-handler.js"),
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export * from './hono/start-server.js';
|
|
|
4
4
|
export type { DextoApp } from './hono/types.js';
|
|
5
5
|
export * from './events/webhook-subscriber.js';
|
|
6
6
|
export * from './events/a2a-sse-subscriber.js';
|
|
7
|
+
export * from './events/usage-event-subscriber.js';
|
|
8
|
+
export * from './events/usage-event-types.js';
|
|
7
9
|
export * from './events/webhook-types.js';
|
|
8
10
|
export * from './events/types.js';
|
|
9
11
|
export * from './mcp/mcp-handler.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,8 @@ export * from "./hono/node/index.js";
|
|
|
3
3
|
export * from "./hono/start-server.js";
|
|
4
4
|
export * from "./events/webhook-subscriber.js";
|
|
5
5
|
export * from "./events/a2a-sse-subscriber.js";
|
|
6
|
+
export * from "./events/usage-event-subscriber.js";
|
|
7
|
+
export * from "./events/usage-event-types.js";
|
|
6
8
|
export * from "./events/webhook-types.js";
|
|
7
9
|
export * from "./events/types.js";
|
|
8
10
|
export * from "./mcp/mcp-handler.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexto/server",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.18",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@hono/node-server": "1.19.
|
|
28
|
+
"@hono/node-server": "1.19.10",
|
|
29
29
|
"@hono/zod-openapi": "^0.19.1",
|
|
30
|
-
"hono": "^4.
|
|
30
|
+
"hono": "^4.12.7",
|
|
31
31
|
"ws": "^8.18.1",
|
|
32
32
|
"yaml": "^2.7.1",
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
34
|
-
"@dexto/agent-config": "1.6.
|
|
35
|
-
"@dexto/
|
|
36
|
-
"@dexto/
|
|
37
|
-
"@dexto/
|
|
38
|
-
"@dexto/
|
|
39
|
-
"@dexto/
|
|
34
|
+
"@dexto/agent-config": "1.6.18",
|
|
35
|
+
"@dexto/agent-management": "1.6.18",
|
|
36
|
+
"@dexto/core": "1.6.18",
|
|
37
|
+
"@dexto/image-local": "1.6.18",
|
|
38
|
+
"@dexto/storage": "1.6.18",
|
|
39
|
+
"@dexto/tools-scheduler": "1.6.18"
|
|
40
40
|
},
|
|
41
41
|
"files": [
|
|
42
42
|
"dist",
|