@nodetool-ai/protocol 0.7.0-rc.11
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/agent-protocol.d.ts +217 -0
- package/dist/agent-protocol.d.ts.map +1 -0
- package/dist/agent-protocol.js +85 -0
- package/dist/agent-protocol.js.map +1 -0
- package/dist/api-schemas/api-error-code.d.ts +21 -0
- package/dist/api-schemas/api-error-code.d.ts.map +1 -0
- package/dist/api-schemas/api-error-code.js +20 -0
- package/dist/api-schemas/api-error-code.js.map +1 -0
- package/dist/api-schemas/assets.d.ts +162 -0
- package/dist/api-schemas/assets.d.ts.map +1 -0
- package/dist/api-schemas/assets.js +119 -0
- package/dist/api-schemas/assets.js.map +1 -0
- package/dist/api-schemas/collections.d.ts +64 -0
- package/dist/api-schemas/collections.d.ts.map +1 -0
- package/dist/api-schemas/collections.js +67 -0
- package/dist/api-schemas/collections.js.map +1 -0
- package/dist/api-schemas/costs.d.ts +168 -0
- package/dist/api-schemas/costs.d.ts.map +1 -0
- package/dist/api-schemas/costs.js +90 -0
- package/dist/api-schemas/costs.js.map +1 -0
- package/dist/api-schemas/error-helpers.d.ts +19 -0
- package/dist/api-schemas/error-helpers.d.ts.map +1 -0
- package/dist/api-schemas/error-helpers.js +7 -0
- package/dist/api-schemas/error-helpers.js.map +1 -0
- package/dist/api-schemas/files.d.ts +38 -0
- package/dist/api-schemas/files.d.ts.map +1 -0
- package/dist/api-schemas/files.js +25 -0
- package/dist/api-schemas/files.js.map +1 -0
- package/dist/api-schemas/fonts.d.ts +6 -0
- package/dist/api-schemas/fonts.d.ts.map +1 -0
- package/dist/api-schemas/fonts.js +8 -0
- package/dist/api-schemas/fonts.js.map +1 -0
- package/dist/api-schemas/index.d.ts +20 -0
- package/dist/api-schemas/index.d.ts.map +1 -0
- package/dist/api-schemas/index.js +20 -0
- package/dist/api-schemas/index.js.map +1 -0
- package/dist/api-schemas/jobs.d.ts +77 -0
- package/dist/api-schemas/jobs.d.ts.map +1 -0
- package/dist/api-schemas/jobs.js +60 -0
- package/dist/api-schemas/jobs.js.map +1 -0
- package/dist/api-schemas/mcp-config.d.ts +119 -0
- package/dist/api-schemas/mcp-config.d.ts.map +1 -0
- package/dist/api-schemas/mcp-config.js +59 -0
- package/dist/api-schemas/mcp-config.js.map +1 -0
- package/dist/api-schemas/messages.d.ts +77 -0
- package/dist/api-schemas/messages.d.ts.map +1 -0
- package/dist/api-schemas/messages.js +81 -0
- package/dist/api-schemas/messages.js.map +1 -0
- package/dist/api-schemas/models.d.ts +202 -0
- package/dist/api-schemas/models.d.ts.map +1 -0
- package/dist/api-schemas/models.js +135 -0
- package/dist/api-schemas/models.js.map +1 -0
- package/dist/api-schemas/nodes.d.ts +23 -0
- package/dist/api-schemas/nodes.d.ts.map +1 -0
- package/dist/api-schemas/nodes.js +20 -0
- package/dist/api-schemas/nodes.js.map +1 -0
- package/dist/api-schemas/settings.d.ts +75 -0
- package/dist/api-schemas/settings.d.ts.map +1 -0
- package/dist/api-schemas/settings.js +66 -0
- package/dist/api-schemas/settings.js.map +1 -0
- package/dist/api-schemas/skills.d.ts +19 -0
- package/dist/api-schemas/skills.d.ts.map +1 -0
- package/dist/api-schemas/skills.js +16 -0
- package/dist/api-schemas/skills.js.map +1 -0
- package/dist/api-schemas/storage.d.ts +46 -0
- package/dist/api-schemas/storage.d.ts.map +1 -0
- package/dist/api-schemas/storage.js +32 -0
- package/dist/api-schemas/storage.js.map +1 -0
- package/dist/api-schemas/threads.d.ts +58 -0
- package/dist/api-schemas/threads.d.ts.map +1 -0
- package/dist/api-schemas/threads.js +52 -0
- package/dist/api-schemas/threads.js.map +1 -0
- package/dist/api-schemas/users.d.ts +49 -0
- package/dist/api-schemas/users.d.ts.map +1 -0
- package/dist/api-schemas/users.js +44 -0
- package/dist/api-schemas/users.js.map +1 -0
- package/dist/api-schemas/workflows.d.ts +489 -0
- package/dist/api-schemas/workflows.d.ts.map +1 -0
- package/dist/api-schemas/workflows.js +248 -0
- package/dist/api-schemas/workflows.js.map +1 -0
- package/dist/api-schemas/workspace.d.ts +88 -0
- package/dist/api-schemas/workspace.d.ts.map +1 -0
- package/dist/api-schemas/workspace.js +65 -0
- package/dist/api-schemas/workspace.js.map +1 -0
- package/dist/api-types.d.ts +809 -0
- package/dist/api-types.d.ts.map +1 -0
- package/dist/api-types.js +9 -0
- package/dist/api-types.js.map +1 -0
- package/dist/graph.d.ts +75 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +15 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +334 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +71 -0
- package/dist/messages.js.map +1 -0
- package/dist/toolSchemas.d.ts +108 -0
- package/dist/toolSchemas.d.ts.map +1 -0
- package/dist/toolSchemas.js +205 -0
- package/dist/toolSchemas.js.map +1 -0
- package/dist/type-metadata.d.ts +39 -0
- package/dist/type-metadata.d.ts.map +1 -0
- package/dist/type-metadata.js +126 -0
- package/dist/type-metadata.js.map +1 -0
- package/dist/typecheck.d.ts +17 -0
- package/dist/typecheck.d.ts.map +1 -0
- package/dist/typecheck.js +63 -0
- package/dist/typecheck.js.map +1 -0
- package/dist/wrap-primitives.d.ts +18 -0
- package/dist/wrap-primitives.d.ts.map +1 -0
- package/dist/wrap-primitives.js +28 -0
- package/dist/wrap-primitives.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const collectionMetadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3
|
+
export type CollectionMetadata = z.infer<typeof collectionMetadata>;
|
|
4
|
+
export declare const collectionListItem: z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
count: z.ZodNumber;
|
|
7
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
8
|
+
workflow_name: z.ZodNullable<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const collectionResponse: z.ZodObject<{
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
13
|
+
count: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const listOutput: z.ZodObject<{
|
|
16
|
+
collections: z.ZodArray<z.ZodObject<{
|
|
17
|
+
name: z.ZodString;
|
|
18
|
+
count: z.ZodNumber;
|
|
19
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
20
|
+
workflow_name: z.ZodNullable<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
count: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const getInput: z.ZodObject<{
|
|
25
|
+
name: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const createInput: z.ZodObject<{
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
embedding_model: z.ZodOptional<z.ZodString>;
|
|
30
|
+
embedding_provider: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export declare const updateInput: z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
rename: z.ZodOptional<z.ZodString>;
|
|
35
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const deleteInput: z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export declare const deleteOutput: z.ZodObject<{
|
|
41
|
+
message: z.ZodString;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const queryInput: z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
query_texts: z.ZodArray<z.ZodString>;
|
|
46
|
+
n_results: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export declare const queryOutput: z.ZodObject<{
|
|
49
|
+
ids: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
50
|
+
documents: z.ZodArray<z.ZodArray<z.ZodNullable<z.ZodString>>>;
|
|
51
|
+
metadatas: z.ZodArray<z.ZodArray<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
52
|
+
distances: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type CollectionListItem = z.infer<typeof collectionListItem>;
|
|
55
|
+
export type CollectionResponse = z.infer<typeof collectionResponse>;
|
|
56
|
+
export type ListOutput = z.infer<typeof listOutput>;
|
|
57
|
+
export type GetInput = z.infer<typeof getInput>;
|
|
58
|
+
export type CreateInput = z.infer<typeof createInput>;
|
|
59
|
+
export type UpdateInput = z.infer<typeof updateInput>;
|
|
60
|
+
export type DeleteInput = z.infer<typeof deleteInput>;
|
|
61
|
+
export type DeleteOutput = z.infer<typeof deleteOutput>;
|
|
62
|
+
export type QueryInput = z.infer<typeof queryInput>;
|
|
63
|
+
export type QueryOutput = z.infer<typeof queryOutput>;
|
|
64
|
+
//# sourceMappingURL=collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/api-schemas/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,kBAAkB,yFAG9B,CAAC;AACF,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MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Metadata ──────────────────────────────────────────────────────
|
|
3
|
+
// CollectionMetadata from vectorstore is `Record<string, string|number|boolean|undefined>`.
|
|
4
|
+
// We keep `undefined` out of the wire schema and normalize to `string | number | boolean`.
|
|
5
|
+
export const collectionMetadata = z.record(z.string(), z.union([z.string(), z.number(), z.boolean()]));
|
|
6
|
+
// ── Collection response shapes ────────────────────────────────────
|
|
7
|
+
// Mirrors the REST handler's list-item response (with workflow_name resolved).
|
|
8
|
+
export const collectionListItem = z.object({
|
|
9
|
+
name: z.string(),
|
|
10
|
+
count: z.number(),
|
|
11
|
+
metadata: collectionMetadata,
|
|
12
|
+
workflow_name: z.string().nullable()
|
|
13
|
+
});
|
|
14
|
+
// Mirrors the single-collection response (create, get, update).
|
|
15
|
+
export const collectionResponse = z.object({
|
|
16
|
+
name: z.string(),
|
|
17
|
+
metadata: collectionMetadata,
|
|
18
|
+
count: z.number()
|
|
19
|
+
});
|
|
20
|
+
// ── list (GET /api/collections) ───────────────────────────────────
|
|
21
|
+
export const listOutput = z.object({
|
|
22
|
+
collections: z.array(collectionListItem),
|
|
23
|
+
count: z.number()
|
|
24
|
+
});
|
|
25
|
+
// ── get (GET /api/collections/:name) ──────────────────────────────
|
|
26
|
+
export const getInput = z.object({
|
|
27
|
+
name: z.string().min(1)
|
|
28
|
+
});
|
|
29
|
+
// ── create (POST /api/collections) ────────────────────────────────
|
|
30
|
+
export const createInput = z.object({
|
|
31
|
+
name: z.string().min(1),
|
|
32
|
+
embedding_model: z.string().optional(),
|
|
33
|
+
embedding_provider: z.string().optional()
|
|
34
|
+
});
|
|
35
|
+
// ── update (PUT /api/collections/:name) ───────────────────────────
|
|
36
|
+
export const updateInput = z.object({
|
|
37
|
+
name: z.string().min(1), // current name
|
|
38
|
+
rename: z.string().min(1).optional(), // new name (maps to body.name in REST)
|
|
39
|
+
metadata: z
|
|
40
|
+
.record(z.string(), z.union([z.string(), z.number(), z.boolean()]))
|
|
41
|
+
.optional()
|
|
42
|
+
});
|
|
43
|
+
// ── delete (DELETE /api/collections/:name) ────────────────────────
|
|
44
|
+
export const deleteInput = z.object({
|
|
45
|
+
name: z.string().min(1)
|
|
46
|
+
});
|
|
47
|
+
export const deleteOutput = z.object({
|
|
48
|
+
message: z.string()
|
|
49
|
+
});
|
|
50
|
+
// ── query (POST /api/collections/:name/query) ─────────────────────
|
|
51
|
+
// Mirrors VecCollection.query opts — we expose the common shape used by the
|
|
52
|
+
// REST handler: query_texts + n_results. Advanced filters (queryEmbeddings,
|
|
53
|
+
// queryURIs, whereDocument, include) are intentionally not part of the public
|
|
54
|
+
// tRPC surface at this stage.
|
|
55
|
+
export const queryInput = z.object({
|
|
56
|
+
name: z.string().min(1),
|
|
57
|
+
query_texts: z.array(z.string()).min(1),
|
|
58
|
+
n_results: z.number().int().min(1).max(1000).default(10)
|
|
59
|
+
});
|
|
60
|
+
// Mirrors QueryResult shape in sqlite-vec-store.ts.
|
|
61
|
+
export const queryOutput = z.object({
|
|
62
|
+
ids: z.array(z.array(z.string())),
|
|
63
|
+
documents: z.array(z.array(z.string().nullable())),
|
|
64
|
+
metadatas: z.array(z.array(z.record(z.string(), z.unknown()).nullable())),
|
|
65
|
+
distances: z.array(z.array(z.number()))
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/api-schemas/collections.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qEAAqE;AACrE,4FAA4F;AAC5F,2FAA2F;AAC3F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CACxC,CAAC,CAAC,MAAM,EAAE,EACV,CAAC,CAAC,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CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD,CAAC,CAAC;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACjC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const listPredictionsInput: z.ZodObject<{
|
|
3
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
4
|
+
model: z.ZodOptional<z.ZodString>;
|
|
5
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
startKey: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const aggregateInput: z.ZodObject<{
|
|
9
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
10
|
+
model: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const aggregateByModelInput: z.ZodObject<{
|
|
13
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/**
|
|
16
|
+
* Shape returned by `toPredictionResponse` in cost-api.ts.
|
|
17
|
+
* Mirrors `Prediction` model fields exposed by the REST handler — note `node_id`
|
|
18
|
+
* is coalesced to `""` (never null), and other optional fields are coalesced
|
|
19
|
+
* to `null`.
|
|
20
|
+
*/
|
|
21
|
+
export declare const predictionResponse: z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
user_id: z.ZodString;
|
|
24
|
+
node_id: z.ZodString;
|
|
25
|
+
provider: z.ZodString;
|
|
26
|
+
model: z.ZodString;
|
|
27
|
+
workflow_id: z.ZodNullable<z.ZodString>;
|
|
28
|
+
cost: z.ZodNullable<z.ZodNumber>;
|
|
29
|
+
input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
30
|
+
output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
31
|
+
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
cached_tokens: z.ZodNullable<z.ZodNumber>;
|
|
33
|
+
reasoning_tokens: z.ZodNullable<z.ZodNumber>;
|
|
34
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
35
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const listPredictionsOutput: z.ZodObject<{
|
|
38
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
user_id: z.ZodString;
|
|
41
|
+
node_id: z.ZodString;
|
|
42
|
+
provider: z.ZodString;
|
|
43
|
+
model: z.ZodString;
|
|
44
|
+
workflow_id: z.ZodNullable<z.ZodString>;
|
|
45
|
+
cost: z.ZodNullable<z.ZodNumber>;
|
|
46
|
+
input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
47
|
+
output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
48
|
+
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
49
|
+
cached_tokens: z.ZodNullable<z.ZodNumber>;
|
|
50
|
+
reasoning_tokens: z.ZodNullable<z.ZodNumber>;
|
|
51
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
52
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
next_start_key: z.ZodNullable<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
/**
|
|
57
|
+
* Shape returned by `Prediction.aggregateByUser(userId, opts)` —
|
|
58
|
+
* see `AggregateResult` in `packages/models/src/prediction.ts`.
|
|
59
|
+
*/
|
|
60
|
+
export declare const aggregateByUserOutput: z.ZodObject<{
|
|
61
|
+
user_id: z.ZodString;
|
|
62
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
63
|
+
model: z.ZodNullable<z.ZodString>;
|
|
64
|
+
total_cost: z.ZodNumber;
|
|
65
|
+
total_input_tokens: z.ZodNumber;
|
|
66
|
+
total_output_tokens: z.ZodNumber;
|
|
67
|
+
total_tokens: z.ZodNumber;
|
|
68
|
+
call_count: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
/**
|
|
71
|
+
* Shape of one element returned by `Prediction.aggregateByProvider(userId)` —
|
|
72
|
+
* see `ProviderAggregateResult`.
|
|
73
|
+
*/
|
|
74
|
+
export declare const providerAggregate: z.ZodObject<{
|
|
75
|
+
provider: z.ZodString;
|
|
76
|
+
total_cost: z.ZodNumber;
|
|
77
|
+
total_input_tokens: z.ZodNumber;
|
|
78
|
+
total_output_tokens: z.ZodNumber;
|
|
79
|
+
total_tokens: z.ZodNumber;
|
|
80
|
+
call_count: z.ZodNumber;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export declare const aggregateByProviderOutput: z.ZodArray<z.ZodObject<{
|
|
83
|
+
provider: z.ZodString;
|
|
84
|
+
total_cost: z.ZodNumber;
|
|
85
|
+
total_input_tokens: z.ZodNumber;
|
|
86
|
+
total_output_tokens: z.ZodNumber;
|
|
87
|
+
total_tokens: z.ZodNumber;
|
|
88
|
+
call_count: z.ZodNumber;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
/**
|
|
91
|
+
* Shape of one element returned by `Prediction.aggregateByModel(userId, opts)` —
|
|
92
|
+
* see `ModelAggregateResult`.
|
|
93
|
+
*/
|
|
94
|
+
export declare const modelAggregate: z.ZodObject<{
|
|
95
|
+
provider: z.ZodString;
|
|
96
|
+
model: z.ZodString;
|
|
97
|
+
total_cost: z.ZodNumber;
|
|
98
|
+
total_input_tokens: z.ZodNumber;
|
|
99
|
+
total_output_tokens: z.ZodNumber;
|
|
100
|
+
total_tokens: z.ZodNumber;
|
|
101
|
+
call_count: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export declare const aggregateByModelOutput: z.ZodArray<z.ZodObject<{
|
|
104
|
+
provider: z.ZodString;
|
|
105
|
+
model: z.ZodString;
|
|
106
|
+
total_cost: z.ZodNumber;
|
|
107
|
+
total_input_tokens: z.ZodNumber;
|
|
108
|
+
total_output_tokens: z.ZodNumber;
|
|
109
|
+
total_tokens: z.ZodNumber;
|
|
110
|
+
call_count: z.ZodNumber;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
export declare const summaryOutput: z.ZodObject<{
|
|
113
|
+
overall: z.ZodObject<{
|
|
114
|
+
user_id: z.ZodString;
|
|
115
|
+
provider: z.ZodNullable<z.ZodString>;
|
|
116
|
+
model: z.ZodNullable<z.ZodString>;
|
|
117
|
+
total_cost: z.ZodNumber;
|
|
118
|
+
total_input_tokens: z.ZodNumber;
|
|
119
|
+
total_output_tokens: z.ZodNumber;
|
|
120
|
+
total_tokens: z.ZodNumber;
|
|
121
|
+
call_count: z.ZodNumber;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
by_provider: z.ZodArray<z.ZodObject<{
|
|
124
|
+
provider: z.ZodString;
|
|
125
|
+
total_cost: z.ZodNumber;
|
|
126
|
+
total_input_tokens: z.ZodNumber;
|
|
127
|
+
total_output_tokens: z.ZodNumber;
|
|
128
|
+
total_tokens: z.ZodNumber;
|
|
129
|
+
call_count: z.ZodNumber;
|
|
130
|
+
}, z.core.$strip>>;
|
|
131
|
+
by_model: z.ZodArray<z.ZodObject<{
|
|
132
|
+
provider: z.ZodString;
|
|
133
|
+
model: z.ZodString;
|
|
134
|
+
total_cost: z.ZodNumber;
|
|
135
|
+
total_input_tokens: z.ZodNumber;
|
|
136
|
+
total_output_tokens: z.ZodNumber;
|
|
137
|
+
total_tokens: z.ZodNumber;
|
|
138
|
+
call_count: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
recent_calls: z.ZodArray<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
user_id: z.ZodString;
|
|
143
|
+
node_id: z.ZodString;
|
|
144
|
+
provider: z.ZodString;
|
|
145
|
+
model: z.ZodString;
|
|
146
|
+
workflow_id: z.ZodNullable<z.ZodString>;
|
|
147
|
+
cost: z.ZodNullable<z.ZodNumber>;
|
|
148
|
+
input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
149
|
+
output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
150
|
+
total_tokens: z.ZodNullable<z.ZodNumber>;
|
|
151
|
+
cached_tokens: z.ZodNullable<z.ZodNumber>;
|
|
152
|
+
reasoning_tokens: z.ZodNullable<z.ZodNumber>;
|
|
153
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
154
|
+
metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
155
|
+
}, z.core.$strip>>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
export type ListPredictionsInput = z.infer<typeof listPredictionsInput>;
|
|
158
|
+
export type AggregateInput = z.infer<typeof aggregateInput>;
|
|
159
|
+
export type AggregateByModelInput = z.infer<typeof aggregateByModelInput>;
|
|
160
|
+
export type PredictionResponse = z.infer<typeof predictionResponse>;
|
|
161
|
+
export type ListPredictionsOutput = z.infer<typeof listPredictionsOutput>;
|
|
162
|
+
export type AggregateByUserOutput = z.infer<typeof aggregateByUserOutput>;
|
|
163
|
+
export type ProviderAggregate = z.infer<typeof providerAggregate>;
|
|
164
|
+
export type AggregateByProviderOutput = z.infer<typeof aggregateByProviderOutput>;
|
|
165
|
+
export type ModelAggregate = z.infer<typeof modelAggregate>;
|
|
166
|
+
export type AggregateByModelOutput = z.infer<typeof aggregateByModelOutput>;
|
|
167
|
+
export type SummaryOutput = z.infer<typeof summaryOutput>;
|
|
168
|
+
//# sourceMappingURL=costs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costs.d.ts","sourceRoot":"","sources":["../../src/api-schemas/costs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAC;AAEH,eAAO,MAAM,cAAc;;;iBAGzB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;iBAEhC,CAAC;AAIH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAe7B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;iBAGhC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;iBAShC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;iBAO5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;kBAA6B,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;iBAQzB,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;kBAA0B,CAAC;AAE9D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAKxB,CAAC;AAIH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAClE,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAClF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC5E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Input schemas ──────────────────────────────────────────────────
|
|
3
|
+
export const listPredictionsInput = z.object({
|
|
4
|
+
provider: z.string().optional(),
|
|
5
|
+
model: z.string().optional(),
|
|
6
|
+
limit: z.number().int().min(1).max(500).default(50),
|
|
7
|
+
startKey: z.string().optional()
|
|
8
|
+
});
|
|
9
|
+
export const aggregateInput = z.object({
|
|
10
|
+
provider: z.string().optional(),
|
|
11
|
+
model: z.string().optional()
|
|
12
|
+
});
|
|
13
|
+
export const aggregateByModelInput = z.object({
|
|
14
|
+
provider: z.string().optional()
|
|
15
|
+
});
|
|
16
|
+
// ── Response schemas ───────────────────────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* Shape returned by `toPredictionResponse` in cost-api.ts.
|
|
19
|
+
* Mirrors `Prediction` model fields exposed by the REST handler — note `node_id`
|
|
20
|
+
* is coalesced to `""` (never null), and other optional fields are coalesced
|
|
21
|
+
* to `null`.
|
|
22
|
+
*/
|
|
23
|
+
export const predictionResponse = z.object({
|
|
24
|
+
id: z.string(),
|
|
25
|
+
user_id: z.string(),
|
|
26
|
+
node_id: z.string(),
|
|
27
|
+
provider: z.string(),
|
|
28
|
+
model: z.string(),
|
|
29
|
+
workflow_id: z.string().nullable(),
|
|
30
|
+
cost: z.number().nullable(),
|
|
31
|
+
input_tokens: z.number().nullable(),
|
|
32
|
+
output_tokens: z.number().nullable(),
|
|
33
|
+
total_tokens: z.number().nullable(),
|
|
34
|
+
cached_tokens: z.number().nullable(),
|
|
35
|
+
reasoning_tokens: z.number().nullable(),
|
|
36
|
+
created_at: z.string().nullable(),
|
|
37
|
+
metadata: z.record(z.string(), z.unknown()).nullable()
|
|
38
|
+
});
|
|
39
|
+
export const listPredictionsOutput = z.object({
|
|
40
|
+
calls: z.array(predictionResponse),
|
|
41
|
+
next_start_key: z.string().nullable()
|
|
42
|
+
});
|
|
43
|
+
/**
|
|
44
|
+
* Shape returned by `Prediction.aggregateByUser(userId, opts)` —
|
|
45
|
+
* see `AggregateResult` in `packages/models/src/prediction.ts`.
|
|
46
|
+
*/
|
|
47
|
+
export const aggregateByUserOutput = z.object({
|
|
48
|
+
user_id: z.string(),
|
|
49
|
+
provider: z.string().nullable(),
|
|
50
|
+
model: z.string().nullable(),
|
|
51
|
+
total_cost: z.number(),
|
|
52
|
+
total_input_tokens: z.number(),
|
|
53
|
+
total_output_tokens: z.number(),
|
|
54
|
+
total_tokens: z.number(),
|
|
55
|
+
call_count: z.number()
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Shape of one element returned by `Prediction.aggregateByProvider(userId)` —
|
|
59
|
+
* see `ProviderAggregateResult`.
|
|
60
|
+
*/
|
|
61
|
+
export const providerAggregate = z.object({
|
|
62
|
+
provider: z.string(),
|
|
63
|
+
total_cost: z.number(),
|
|
64
|
+
total_input_tokens: z.number(),
|
|
65
|
+
total_output_tokens: z.number(),
|
|
66
|
+
total_tokens: z.number(),
|
|
67
|
+
call_count: z.number()
|
|
68
|
+
});
|
|
69
|
+
export const aggregateByProviderOutput = z.array(providerAggregate);
|
|
70
|
+
/**
|
|
71
|
+
* Shape of one element returned by `Prediction.aggregateByModel(userId, opts)` —
|
|
72
|
+
* see `ModelAggregateResult`.
|
|
73
|
+
*/
|
|
74
|
+
export const modelAggregate = z.object({
|
|
75
|
+
provider: z.string(),
|
|
76
|
+
model: z.string(),
|
|
77
|
+
total_cost: z.number(),
|
|
78
|
+
total_input_tokens: z.number(),
|
|
79
|
+
total_output_tokens: z.number(),
|
|
80
|
+
total_tokens: z.number(),
|
|
81
|
+
call_count: z.number()
|
|
82
|
+
});
|
|
83
|
+
export const aggregateByModelOutput = z.array(modelAggregate);
|
|
84
|
+
export const summaryOutput = z.object({
|
|
85
|
+
overall: aggregateByUserOutput,
|
|
86
|
+
by_provider: aggregateByProviderOutput,
|
|
87
|
+
by_model: aggregateByModelOutput,
|
|
88
|
+
recent_calls: z.array(predictionResponse)
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=costs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"costs.js","sourceRoot":"","sources":["../../src/api-schemas/costs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sEAAsE;AAEtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE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C,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC/B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAE9D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,qBAAqB;IAC9B,WAAW,EAAE,yBAAyB;IACtC,QAAQ,EAAE,sBAAsB;IAChC,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAC1C,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApiErrorCode } from "./api-error-code.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shape of the `error.data` object attached to TRPCClientError when the server
|
|
4
|
+
* uses the errorFormatter from @nodetool-ai/websocket/src/trpc/error-formatter.
|
|
5
|
+
* Re-declared here so clients don't depend on server internals.
|
|
6
|
+
*/
|
|
7
|
+
export interface NodetoolTRPCErrorData {
|
|
8
|
+
apiCode: ApiErrorCode | null;
|
|
9
|
+
zodError: Record<string, string[]> | null;
|
|
10
|
+
code?: string;
|
|
11
|
+
httpStatus?: number;
|
|
12
|
+
path?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface NodetoolTRPCClientError {
|
|
15
|
+
data?: NodetoolTRPCErrorData | null;
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function isTRPCErrorWithCode(err: unknown, code: ApiErrorCode): err is NodetoolTRPCClientError;
|
|
19
|
+
//# sourceMappingURL=error-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-helpers.d.ts","sourceRoot":"","sources":["../../src/api-schemas/error-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,YAAY,GACjB,GAAG,IAAI,uBAAuB,CAIhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-helpers.js","sourceRoot":"","sources":["../../src/api-schemas/error-helpers.ts"],"names":[],"mappings":"AAoBA,MAAM,UAAU,mBAAmB,CACjC,GAAY,EACZ,IAAkB;IAElB,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACzD,MAAM,SAAS,GAAG,GAAuC,CAAC;IAC1D,OAAO,SAAS,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for the files domain — local filesystem browser (JSON ops only).
|
|
3
|
+
* Binary download (/api/files/download) stays as REST.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
export declare const fileEntrySchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
size: z.ZodNumber;
|
|
10
|
+
is_dir: z.ZodBoolean;
|
|
11
|
+
modified_at: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export type FileEntry = z.infer<typeof fileEntrySchema>;
|
|
14
|
+
export declare const listFilesInput: z.ZodObject<{
|
|
15
|
+
path: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const listFilesOutput: z.ZodArray<z.ZodObject<{
|
|
18
|
+
name: z.ZodString;
|
|
19
|
+
path: z.ZodString;
|
|
20
|
+
size: z.ZodNumber;
|
|
21
|
+
is_dir: z.ZodBoolean;
|
|
22
|
+
modified_at: z.ZodString;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
export type ListFilesInput = z.infer<typeof listFilesInput>;
|
|
25
|
+
export type ListFilesOutput = z.infer<typeof listFilesOutput>;
|
|
26
|
+
export declare const fileInfoInput: z.ZodObject<{
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const fileInfoOutput: z.ZodObject<{
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
path: z.ZodString;
|
|
32
|
+
size: z.ZodNumber;
|
|
33
|
+
is_dir: z.ZodBoolean;
|
|
34
|
+
modified_at: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type FileInfoInput = z.infer<typeof fileInfoInput>;
|
|
37
|
+
export type FileInfoOutput = z.infer<typeof fileInfoOutput>;
|
|
38
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/api-schemas/files.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;iBAO1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,cAAc;;iBAEzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;kBAA2B,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAI9D,eAAO,MAAM,aAAa;;iBAExB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;iBAAkB,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for the files domain — local filesystem browser (JSON ops only).
|
|
3
|
+
* Binary download (/api/files/download) stays as REST.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
// ── Shared types ────────────────────────────────────────────────────────────
|
|
7
|
+
export const fileEntrySchema = z.object({
|
|
8
|
+
name: z.string(),
|
|
9
|
+
/** Full absolute path to the entry */
|
|
10
|
+
path: z.string(),
|
|
11
|
+
size: z.number(),
|
|
12
|
+
is_dir: z.boolean(),
|
|
13
|
+
modified_at: z.string()
|
|
14
|
+
});
|
|
15
|
+
// ── files.list ──────────────────────────────────────────────────────────────
|
|
16
|
+
export const listFilesInput = z.object({
|
|
17
|
+
path: z.string().min(1)
|
|
18
|
+
});
|
|
19
|
+
export const listFilesOutput = z.array(fileEntrySchema);
|
|
20
|
+
// ── files.info ──────────────────────────────────────────────────────────────
|
|
21
|
+
export const fileInfoInput = z.object({
|
|
22
|
+
path: z.string().min(1)
|
|
23
|
+
});
|
|
24
|
+
export const fileInfoOutput = fileEntrySchema;
|
|
25
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/api-schemas/files.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,sCAAsC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAIH,+EAA+E;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AAKxD,+EAA+E;AAE/E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../src/api-schemas/fonts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,UAAU;;iBAErB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// ── Fonts list response ──────────────────────────────────────────
|
|
3
|
+
// Mirrors `handleFontsRequest` in skills-api.ts — returns a sorted unique
|
|
4
|
+
// list of system font family names (no file extensions).
|
|
5
|
+
export const listOutput = z.object({
|
|
6
|
+
fonts: z.array(z.string())
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../src/api-schemas/fonts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oEAAoE;AACpE,0EAA0E;AAC1E,yDAAyD;AACzD,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./api-error-code.js";
|
|
2
|
+
export * from "./error-helpers.js";
|
|
3
|
+
export * as assets from "./assets.js";
|
|
4
|
+
export * as collections from "./collections.js";
|
|
5
|
+
export * as costs from "./costs.js";
|
|
6
|
+
export * as files from "./files.js";
|
|
7
|
+
export * as fonts from "./fonts.js";
|
|
8
|
+
export * as jobs from "./jobs.js";
|
|
9
|
+
export * as mcpConfig from "./mcp-config.js";
|
|
10
|
+
export * as messages from "./messages.js";
|
|
11
|
+
export * as models from "./models.js";
|
|
12
|
+
export * as nodes from "./nodes.js";
|
|
13
|
+
export * as settings from "./settings.js";
|
|
14
|
+
export * as skills from "./skills.js";
|
|
15
|
+
export * as storage from "./storage.js";
|
|
16
|
+
export * as threads from "./threads.js";
|
|
17
|
+
export * as users from "./users.js";
|
|
18
|
+
export * as workflows from "./workflows.js";
|
|
19
|
+
export * as workspace from "./workspace.js";
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api-schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from "./api-error-code.js";
|
|
2
|
+
export * from "./error-helpers.js";
|
|
3
|
+
export * as assets from "./assets.js";
|
|
4
|
+
export * as collections from "./collections.js";
|
|
5
|
+
export * as costs from "./costs.js";
|
|
6
|
+
export * as files from "./files.js";
|
|
7
|
+
export * as fonts from "./fonts.js";
|
|
8
|
+
export * as jobs from "./jobs.js";
|
|
9
|
+
export * as mcpConfig from "./mcp-config.js";
|
|
10
|
+
export * as messages from "./messages.js";
|
|
11
|
+
export * as models from "./models.js";
|
|
12
|
+
export * as nodes from "./nodes.js";
|
|
13
|
+
export * as settings from "./settings.js";
|
|
14
|
+
export * as skills from "./skills.js";
|
|
15
|
+
export * as storage from "./storage.js";
|
|
16
|
+
export * as threads from "./threads.js";
|
|
17
|
+
export * as users from "./users.js";
|
|
18
|
+
export * as workflows from "./workflows.js";
|
|
19
|
+
export * as workspace from "./workspace.js";
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api-schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC"}
|