@blazingagents/sdk 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/api.d.ts +1 -0
- package/dist/contracts/api.js +1 -0
- package/dist/contracts/entities/agent-approval.d.ts +3 -0
- package/dist/contracts/entities/agent-approval.js +2 -5
- package/dist/contracts/entities/agent-tools.d.ts +132 -16
- package/dist/contracts/entities/agent-tools.js +137 -33
- package/dist/contracts/entities/agents.d.ts +88 -12
- package/dist/contracts/entities/agents.js +3 -3
- package/dist/contracts/entities/sessions.d.ts +31 -2
- package/dist/contracts/entities/sessions.js +13 -0
- package/dist/contracts/entities/tasks.d.ts +30 -4
- package/dist/contracts/entities/usage.d.ts +21 -45
- package/dist/contracts/entities/usage.js +2 -47
- package/dist/contracts/index.d.ts +4 -3
- package/dist/contracts/index.js +2 -2
- package/dist/contracts/limitations.d.ts +0 -5
- package/dist/contracts/limitations.js +1 -5
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/resources/usage.d.ts +2 -2
- package/dist/resources/usage.js +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +2 -1
package/dist/contracts/api.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export declare const apiErrorCodeSchema: z.ZodEnum<{
|
|
|
65
65
|
session_busy: "session_busy";
|
|
66
66
|
session_fork_deleted: "session_fork_deleted";
|
|
67
67
|
session_fork_unavailable: "session_fork_unavailable";
|
|
68
|
+
session_turn_unresponsive: "session_turn_unresponsive";
|
|
68
69
|
session_version_mismatch: "session_version_mismatch";
|
|
69
70
|
skill_invalid_archive: "skill_invalid_archive";
|
|
70
71
|
skill_invalid_markdown: "skill_invalid_markdown";
|
package/dist/contracts/api.js
CHANGED
|
@@ -20,6 +20,7 @@ export declare const toolReferenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
20
20
|
save_memory: "save_memory";
|
|
21
21
|
search_memories: "search_memories";
|
|
22
22
|
update_memory: "update_memory";
|
|
23
|
+
web_search: "web_search";
|
|
23
24
|
write: "write";
|
|
24
25
|
write_todos: "write_todos";
|
|
25
26
|
}>;
|
|
@@ -48,6 +49,7 @@ export declare const toolExecutionReferenceSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
48
49
|
save_memory: "save_memory";
|
|
49
50
|
search_memories: "search_memories";
|
|
50
51
|
update_memory: "update_memory";
|
|
52
|
+
web_search: "web_search";
|
|
51
53
|
write: "write";
|
|
52
54
|
write_todos: "write_todos";
|
|
53
55
|
}>;
|
|
@@ -82,6 +84,7 @@ export declare const approvalPolicySchema: z.ZodObject<{
|
|
|
82
84
|
save_memory: "save_memory";
|
|
83
85
|
search_memories: "search_memories";
|
|
84
86
|
update_memory: "update_memory";
|
|
87
|
+
web_search: "web_search";
|
|
85
88
|
write: "write";
|
|
86
89
|
write_todos: "write_todos";
|
|
87
90
|
}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { mcpConnectionIdSchema } from "../ids.js";
|
|
3
|
-
import {
|
|
3
|
+
import { builtinToolNames, chatFunctionNameSchema } from "./agent-tools.js";
|
|
4
4
|
export const approvalDecisionSchema = z.enum([
|
|
5
5
|
"full",
|
|
6
6
|
"deny",
|
|
@@ -11,10 +11,7 @@ export const toolReferenceSchema = z.discriminatedUnion("type", [
|
|
|
11
11
|
z
|
|
12
12
|
.object({
|
|
13
13
|
type: z.literal("builtin"),
|
|
14
|
-
name: z.enum(
|
|
15
|
-
...AGENT_TOOL_CATALOG.flatMap((group) => group.tools),
|
|
16
|
-
"activate_skill",
|
|
17
|
-
]),
|
|
14
|
+
name: z.enum(builtinToolNames),
|
|
18
15
|
})
|
|
19
16
|
.strict(),
|
|
20
17
|
z
|
|
@@ -1,29 +1,145 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export declare const AGENT_TOOL_CATALOG: readonly [{
|
|
12
|
-
readonly id: "workspace";
|
|
2
|
+
/**
|
|
3
|
+
* Agent tools are toggled one by one. A tag describes a tool; it never enables
|
|
4
|
+
* anything on its own.
|
|
5
|
+
*
|
|
6
|
+
* Every tool has exactly one group tag, which display code groups tools by.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AGENT_TOOL_GROUPS: readonly [{
|
|
9
|
+
readonly tag: "files";
|
|
13
10
|
readonly name: "File operations";
|
|
14
11
|
readonly description: "Read, write, edit, search, and run shell commands in the attached Workspace.";
|
|
15
|
-
readonly tools: readonly ["read", "write", "edit", "grep", "glob", "bash", "publish_artifacts"];
|
|
16
12
|
}, {
|
|
17
|
-
readonly
|
|
13
|
+
readonly tag: "planning";
|
|
18
14
|
readonly name: "Task planning";
|
|
19
15
|
readonly description: "Create and manage a structured todo list to plan and track multi-step work.";
|
|
20
|
-
readonly tools: readonly ["write_todos"];
|
|
21
16
|
}, {
|
|
22
|
-
readonly
|
|
17
|
+
readonly tag: "memory";
|
|
23
18
|
readonly name: "Memory";
|
|
24
19
|
readonly description: "Save, recall, search, update, and delete durable notes owned by this Agent.";
|
|
25
|
-
|
|
20
|
+
}, {
|
|
21
|
+
readonly tag: "web";
|
|
22
|
+
readonly name: "Web";
|
|
23
|
+
readonly description: "Search the public web for current information.";
|
|
24
|
+
}];
|
|
25
|
+
export type AgentToolGroupTag = (typeof AGENT_TOOL_GROUPS)[number]["tag"];
|
|
26
|
+
/**
|
|
27
|
+
* What a file operation tool may do to the Workspace. `file_read` tools never
|
|
28
|
+
* change Workspace files, so an Agent limited to them is read-only.
|
|
29
|
+
* `execute` runs arbitrary commands, which can change files and more.
|
|
30
|
+
*/
|
|
31
|
+
export declare const AGENT_TOOL_FILE_ACCESS_TAGS: readonly ["file_read", "file_write", "execute"];
|
|
32
|
+
export type AgentToolFileAccessTag = (typeof AGENT_TOOL_FILE_ACCESS_TAGS)[number];
|
|
33
|
+
export declare const AGENT_TOOL_TAGS: readonly [...("files" | "memory" | "planning" | "web")[], "file_read", "file_write", "execute"];
|
|
34
|
+
export type AgentToolTag = AgentToolGroupTag | AgentToolFileAccessTag;
|
|
35
|
+
/** The group tag comes first; only a file operation tool adds a file access tag. */
|
|
36
|
+
export type AgentToolTags = readonly ["files"] | readonly ["files", AgentToolFileAccessTag] | readonly [Exclude<AgentToolGroupTag, "files">];
|
|
37
|
+
/** @deprecated Use `AgentToolGroupTag`. */
|
|
38
|
+
export type AgentToolCategoryId = AgentToolGroupTag;
|
|
39
|
+
/** @deprecated Use `AGENT_TOOL_GROUPS`, keyed by `tag`. */
|
|
40
|
+
export declare const AGENT_TOOL_CATEGORIES: readonly {
|
|
41
|
+
description: string;
|
|
42
|
+
id: AgentToolGroupTag;
|
|
43
|
+
name: string;
|
|
44
|
+
}[];
|
|
45
|
+
export interface AgentToolDefinition {
|
|
46
|
+
/** @deprecated Use the group tag in `tags`. */
|
|
47
|
+
category: AgentToolGroupTag;
|
|
48
|
+
description: string;
|
|
49
|
+
name: string;
|
|
50
|
+
/** The tool runs in the Agent's attached Workspace. */
|
|
51
|
+
requiresWorkspace: boolean;
|
|
52
|
+
tags: AgentToolTags;
|
|
53
|
+
}
|
|
54
|
+
export declare const AGENT_TOOLS: readonly [{
|
|
55
|
+
readonly name: "read";
|
|
56
|
+
readonly tags: readonly ["files", "file_read"];
|
|
57
|
+
readonly category: "files";
|
|
58
|
+
readonly requiresWorkspace: true;
|
|
59
|
+
readonly description: "Read a file from the Workspace.";
|
|
60
|
+
}, {
|
|
61
|
+
readonly name: "write";
|
|
62
|
+
readonly tags: readonly ["files", "file_write"];
|
|
63
|
+
readonly category: "files";
|
|
64
|
+
readonly requiresWorkspace: true;
|
|
65
|
+
readonly description: "Create or overwrite a file in the Workspace.";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "edit";
|
|
68
|
+
readonly tags: readonly ["files", "file_write"];
|
|
69
|
+
readonly category: "files";
|
|
70
|
+
readonly requiresWorkspace: true;
|
|
71
|
+
readonly description: "Replace exact text in a Workspace file.";
|
|
72
|
+
}, {
|
|
73
|
+
readonly name: "grep";
|
|
74
|
+
readonly tags: readonly ["files", "file_read"];
|
|
75
|
+
readonly category: "files";
|
|
76
|
+
readonly requiresWorkspace: true;
|
|
77
|
+
readonly description: "Search Workspace file contents with a regular expression.";
|
|
78
|
+
}, {
|
|
79
|
+
readonly name: "glob";
|
|
80
|
+
readonly tags: readonly ["files", "file_read"];
|
|
81
|
+
readonly category: "files";
|
|
82
|
+
readonly requiresWorkspace: true;
|
|
83
|
+
readonly description: "Find Workspace files by path pattern.";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "bash";
|
|
86
|
+
readonly tags: readonly ["files", "execute"];
|
|
87
|
+
readonly category: "files";
|
|
88
|
+
readonly requiresWorkspace: true;
|
|
89
|
+
readonly description: "Run shell commands in the Workspace.";
|
|
90
|
+
}, {
|
|
91
|
+
readonly name: "publish_artifacts";
|
|
92
|
+
readonly tags: readonly ["files"];
|
|
93
|
+
readonly category: "files";
|
|
94
|
+
readonly requiresWorkspace: true;
|
|
95
|
+
readonly description: "Publish Workspace files as downloadable Artifacts.";
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "write_todos";
|
|
98
|
+
readonly tags: readonly ["planning"];
|
|
99
|
+
readonly category: "planning";
|
|
100
|
+
readonly requiresWorkspace: false;
|
|
101
|
+
readonly description: "Plan and track multi-step work with a todo list.";
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "save_memory";
|
|
104
|
+
readonly tags: readonly ["memory"];
|
|
105
|
+
readonly category: "memory";
|
|
106
|
+
readonly requiresWorkspace: false;
|
|
107
|
+
readonly description: "Save a durable note.";
|
|
108
|
+
}, {
|
|
109
|
+
readonly name: "get_memory";
|
|
110
|
+
readonly tags: readonly ["memory"];
|
|
111
|
+
readonly category: "memory";
|
|
112
|
+
readonly requiresWorkspace: false;
|
|
113
|
+
readonly description: "Read one saved note.";
|
|
114
|
+
}, {
|
|
115
|
+
readonly name: "search_memories";
|
|
116
|
+
readonly tags: readonly ["memory"];
|
|
117
|
+
readonly category: "memory";
|
|
118
|
+
readonly requiresWorkspace: false;
|
|
119
|
+
readonly description: "Search saved notes.";
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "update_memory";
|
|
122
|
+
readonly tags: readonly ["memory"];
|
|
123
|
+
readonly category: "memory";
|
|
124
|
+
readonly requiresWorkspace: false;
|
|
125
|
+
readonly description: "Update a saved note.";
|
|
126
|
+
}, {
|
|
127
|
+
readonly name: "delete_memory";
|
|
128
|
+
readonly tags: readonly ["memory"];
|
|
129
|
+
readonly category: "memory";
|
|
130
|
+
readonly requiresWorkspace: false;
|
|
131
|
+
readonly description: "Delete a saved note.";
|
|
132
|
+
}, {
|
|
133
|
+
readonly name: "web_search";
|
|
134
|
+
readonly tags: readonly ["web"];
|
|
135
|
+
readonly category: "web";
|
|
136
|
+
readonly requiresWorkspace: false;
|
|
137
|
+
readonly description: "Search the public web for current results. Each search consumes Usage credit.";
|
|
26
138
|
}];
|
|
139
|
+
export type AgentToolName = (typeof AGENT_TOOLS)[number]["name"];
|
|
140
|
+
export declare const agentToolNames: readonly AgentToolName[];
|
|
141
|
+
/** Built-in tool names an approval policy can reference. */
|
|
142
|
+
export declare const builtinToolNames: readonly [...("bash" | "delete_memory" | "edit" | "get_memory" | "glob" | "grep" | "publish_artifacts" | "read" | "save_memory" | "search_memories" | "update_memory" | "web_search" | "write" | "write_todos")[], "activate_skill"];
|
|
27
143
|
/**
|
|
28
144
|
* A model-facing tool name. Built-in tool names and the `mcp__` prefix used
|
|
29
145
|
* for MCP tools are reserved so a caller function never shadows them.
|
|
@@ -1,48 +1,152 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const
|
|
2
|
+
/**
|
|
3
|
+
* Agent tools are toggled one by one. A tag describes a tool; it never enables
|
|
4
|
+
* anything on its own.
|
|
5
|
+
*
|
|
6
|
+
* Every tool has exactly one group tag, which display code groups tools by.
|
|
7
|
+
*/
|
|
8
|
+
export const AGENT_TOOL_GROUPS = [
|
|
9
9
|
{
|
|
10
|
-
|
|
10
|
+
tag: "files",
|
|
11
11
|
name: "File operations",
|
|
12
12
|
description: "Read, write, edit, search, and run shell commands in the attached Workspace.",
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"edit",
|
|
17
|
-
"grep",
|
|
18
|
-
"glob",
|
|
19
|
-
"bash",
|
|
20
|
-
"publish_artifacts",
|
|
21
|
-
],
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "write_todos",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
tag: "planning",
|
|
25
16
|
name: "Task planning",
|
|
26
17
|
description: "Create and manage a structured todo list to plan and track multi-step work.",
|
|
27
|
-
tools: ["write_todos"],
|
|
28
18
|
},
|
|
29
19
|
{
|
|
30
|
-
|
|
20
|
+
tag: "memory",
|
|
31
21
|
name: "Memory",
|
|
32
22
|
description: "Save, recall, search, update, and delete durable notes owned by this Agent.",
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
tag: "web",
|
|
26
|
+
name: "Web",
|
|
27
|
+
description: "Search the public web for current information.",
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* What a file operation tool may do to the Workspace. `file_read` tools never
|
|
32
|
+
* change Workspace files, so an Agent limited to them is read-only.
|
|
33
|
+
* `execute` runs arbitrary commands, which can change files and more.
|
|
34
|
+
*/
|
|
35
|
+
export const AGENT_TOOL_FILE_ACCESS_TAGS = [
|
|
36
|
+
"file_read",
|
|
37
|
+
"file_write",
|
|
38
|
+
"execute",
|
|
39
|
+
];
|
|
40
|
+
export const AGENT_TOOL_TAGS = [
|
|
41
|
+
...AGENT_TOOL_GROUPS.map((group) => group.tag),
|
|
42
|
+
...AGENT_TOOL_FILE_ACCESS_TAGS,
|
|
43
|
+
];
|
|
44
|
+
/** @deprecated Use `AGENT_TOOL_GROUPS`, keyed by `tag`. */
|
|
45
|
+
export const AGENT_TOOL_CATEGORIES = AGENT_TOOL_GROUPS.map(({ tag, ...group }) => ({ id: tag, ...group }));
|
|
46
|
+
export const AGENT_TOOLS = [
|
|
47
|
+
{
|
|
48
|
+
name: "read",
|
|
49
|
+
tags: ["files", "file_read"],
|
|
50
|
+
category: "files",
|
|
51
|
+
requiresWorkspace: true,
|
|
52
|
+
description: "Read a file from the Workspace.",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "write",
|
|
56
|
+
tags: ["files", "file_write"],
|
|
57
|
+
category: "files",
|
|
58
|
+
requiresWorkspace: true,
|
|
59
|
+
description: "Create or overwrite a file in the Workspace.",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "edit",
|
|
63
|
+
tags: ["files", "file_write"],
|
|
64
|
+
category: "files",
|
|
65
|
+
requiresWorkspace: true,
|
|
66
|
+
description: "Replace exact text in a Workspace file.",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "grep",
|
|
70
|
+
tags: ["files", "file_read"],
|
|
71
|
+
category: "files",
|
|
72
|
+
requiresWorkspace: true,
|
|
73
|
+
description: "Search Workspace file contents with a regular expression.",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "glob",
|
|
77
|
+
tags: ["files", "file_read"],
|
|
78
|
+
category: "files",
|
|
79
|
+
requiresWorkspace: true,
|
|
80
|
+
description: "Find Workspace files by path pattern.",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "bash",
|
|
84
|
+
tags: ["files", "execute"],
|
|
85
|
+
category: "files",
|
|
86
|
+
requiresWorkspace: true,
|
|
87
|
+
description: "Run shell commands in the Workspace.",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "publish_artifacts",
|
|
91
|
+
tags: ["files"],
|
|
92
|
+
category: "files",
|
|
93
|
+
requiresWorkspace: true,
|
|
94
|
+
description: "Publish Workspace files as downloadable Artifacts.",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "write_todos",
|
|
98
|
+
tags: ["planning"],
|
|
99
|
+
category: "planning",
|
|
100
|
+
requiresWorkspace: false,
|
|
101
|
+
description: "Plan and track multi-step work with a todo list.",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "save_memory",
|
|
105
|
+
tags: ["memory"],
|
|
106
|
+
category: "memory",
|
|
107
|
+
requiresWorkspace: false,
|
|
108
|
+
description: "Save a durable note.",
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: "get_memory",
|
|
112
|
+
tags: ["memory"],
|
|
113
|
+
category: "memory",
|
|
114
|
+
requiresWorkspace: false,
|
|
115
|
+
description: "Read one saved note.",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "search_memories",
|
|
119
|
+
tags: ["memory"],
|
|
120
|
+
category: "memory",
|
|
121
|
+
requiresWorkspace: false,
|
|
122
|
+
description: "Search saved notes.",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "update_memory",
|
|
126
|
+
tags: ["memory"],
|
|
127
|
+
category: "memory",
|
|
128
|
+
requiresWorkspace: false,
|
|
129
|
+
description: "Update a saved note.",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "delete_memory",
|
|
133
|
+
tags: ["memory"],
|
|
134
|
+
category: "memory",
|
|
135
|
+
requiresWorkspace: false,
|
|
136
|
+
description: "Delete a saved note.",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "web_search",
|
|
140
|
+
tags: ["web"],
|
|
141
|
+
category: "web",
|
|
142
|
+
requiresWorkspace: false,
|
|
143
|
+
description: "Search the public web for current results. Each search consumes Usage credit.",
|
|
40
144
|
},
|
|
41
145
|
];
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
146
|
+
export const agentToolNames = AGENT_TOOLS.map((tool) => tool.name);
|
|
147
|
+
/** Built-in tool names an approval policy can reference. */
|
|
148
|
+
export const builtinToolNames = [...agentToolNames, "activate_skill"];
|
|
149
|
+
const RESERVED_CHAT_FUNCTION_NAMES = new Set(builtinToolNames);
|
|
46
150
|
/**
|
|
47
151
|
* A model-facing tool name. Built-in tool names and the `mcp__` prefix used
|
|
48
152
|
* for MCP tools are reserved so a caller function never shadows them.
|
|
@@ -3,8 +3,19 @@ export declare const agentInstructionsSchema: z.ZodString;
|
|
|
3
3
|
/** Provider-native model id, passed through without interpretation. */
|
|
4
4
|
export declare const agentModelIdSchema: z.ZodString;
|
|
5
5
|
export declare const agentToolsSchema: z.ZodArray<z.ZodEnum<{
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
bash: "bash";
|
|
7
|
+
delete_memory: "delete_memory";
|
|
8
|
+
edit: "edit";
|
|
9
|
+
get_memory: "get_memory";
|
|
10
|
+
glob: "glob";
|
|
11
|
+
grep: "grep";
|
|
12
|
+
publish_artifacts: "publish_artifacts";
|
|
13
|
+
read: "read";
|
|
14
|
+
save_memory: "save_memory";
|
|
15
|
+
search_memories: "search_memories";
|
|
16
|
+
update_memory: "update_memory";
|
|
17
|
+
web_search: "web_search";
|
|
18
|
+
write: "write";
|
|
8
19
|
write_todos: "write_todos";
|
|
9
20
|
}>>;
|
|
10
21
|
export declare const agentMcpConnectionIdsSchema: z.ZodArray<z.ZodString>;
|
|
@@ -36,6 +47,7 @@ export declare const agentResponseSchema: z.ZodObject<{
|
|
|
36
47
|
save_memory: "save_memory";
|
|
37
48
|
search_memories: "search_memories";
|
|
38
49
|
update_memory: "update_memory";
|
|
50
|
+
web_search: "web_search";
|
|
39
51
|
write: "write";
|
|
40
52
|
write_todos: "write_todos";
|
|
41
53
|
}>;
|
|
@@ -75,6 +87,7 @@ export declare const agentResponseSchema: z.ZodObject<{
|
|
|
75
87
|
save_memory: "save_memory";
|
|
76
88
|
search_memories: "search_memories";
|
|
77
89
|
update_memory: "update_memory";
|
|
90
|
+
web_search: "web_search";
|
|
78
91
|
write: "write";
|
|
79
92
|
write_todos: "write_todos";
|
|
80
93
|
}>;
|
|
@@ -102,8 +115,19 @@ export declare const agentResponseSchema: z.ZodObject<{
|
|
|
102
115
|
compactionReserveTokens: z.ZodNumber;
|
|
103
116
|
memoryInjectionEnabled: z.ZodBoolean;
|
|
104
117
|
tools: z.ZodArray<z.ZodEnum<{
|
|
105
|
-
|
|
106
|
-
|
|
118
|
+
bash: "bash";
|
|
119
|
+
delete_memory: "delete_memory";
|
|
120
|
+
edit: "edit";
|
|
121
|
+
get_memory: "get_memory";
|
|
122
|
+
glob: "glob";
|
|
123
|
+
grep: "grep";
|
|
124
|
+
publish_artifacts: "publish_artifacts";
|
|
125
|
+
read: "read";
|
|
126
|
+
save_memory: "save_memory";
|
|
127
|
+
search_memories: "search_memories";
|
|
128
|
+
update_memory: "update_memory";
|
|
129
|
+
web_search: "web_search";
|
|
130
|
+
write: "write";
|
|
107
131
|
write_todos: "write_todos";
|
|
108
132
|
}>>;
|
|
109
133
|
instructions: z.ZodString;
|
|
@@ -143,6 +167,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
143
167
|
save_memory: "save_memory";
|
|
144
168
|
search_memories: "search_memories";
|
|
145
169
|
update_memory: "update_memory";
|
|
170
|
+
web_search: "web_search";
|
|
146
171
|
write: "write";
|
|
147
172
|
write_todos: "write_todos";
|
|
148
173
|
}>;
|
|
@@ -182,6 +207,7 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
182
207
|
save_memory: "save_memory";
|
|
183
208
|
search_memories: "search_memories";
|
|
184
209
|
update_memory: "update_memory";
|
|
210
|
+
web_search: "web_search";
|
|
185
211
|
write: "write";
|
|
186
212
|
write_todos: "write_todos";
|
|
187
213
|
}>;
|
|
@@ -209,8 +235,19 @@ export declare const agentsResponseSchema: z.ZodObject<{
|
|
|
209
235
|
compactionReserveTokens: z.ZodNumber;
|
|
210
236
|
memoryInjectionEnabled: z.ZodBoolean;
|
|
211
237
|
tools: z.ZodArray<z.ZodEnum<{
|
|
212
|
-
|
|
213
|
-
|
|
238
|
+
bash: "bash";
|
|
239
|
+
delete_memory: "delete_memory";
|
|
240
|
+
edit: "edit";
|
|
241
|
+
get_memory: "get_memory";
|
|
242
|
+
glob: "glob";
|
|
243
|
+
grep: "grep";
|
|
244
|
+
publish_artifacts: "publish_artifacts";
|
|
245
|
+
read: "read";
|
|
246
|
+
save_memory: "save_memory";
|
|
247
|
+
search_memories: "search_memories";
|
|
248
|
+
update_memory: "update_memory";
|
|
249
|
+
web_search: "web_search";
|
|
250
|
+
write: "write";
|
|
214
251
|
write_todos: "write_todos";
|
|
215
252
|
}>>;
|
|
216
253
|
instructions: z.ZodString;
|
|
@@ -257,6 +294,7 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
257
294
|
save_memory: "save_memory";
|
|
258
295
|
search_memories: "search_memories";
|
|
259
296
|
update_memory: "update_memory";
|
|
297
|
+
web_search: "web_search";
|
|
260
298
|
write: "write";
|
|
261
299
|
write_todos: "write_todos";
|
|
262
300
|
}>;
|
|
@@ -296,6 +334,7 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
296
334
|
save_memory: "save_memory";
|
|
297
335
|
search_memories: "search_memories";
|
|
298
336
|
update_memory: "update_memory";
|
|
337
|
+
web_search: "web_search";
|
|
299
338
|
write: "write";
|
|
300
339
|
write_todos: "write_todos";
|
|
301
340
|
}>;
|
|
@@ -320,8 +359,19 @@ export declare const agentConfigSchema: z.ZodObject<{
|
|
|
320
359
|
compactionReserveTokens: z.ZodNumber;
|
|
321
360
|
memoryInjectionEnabled: z.ZodBoolean;
|
|
322
361
|
tools: z.ZodArray<z.ZodEnum<{
|
|
323
|
-
|
|
324
|
-
|
|
362
|
+
bash: "bash";
|
|
363
|
+
delete_memory: "delete_memory";
|
|
364
|
+
edit: "edit";
|
|
365
|
+
get_memory: "get_memory";
|
|
366
|
+
glob: "glob";
|
|
367
|
+
grep: "grep";
|
|
368
|
+
publish_artifacts: "publish_artifacts";
|
|
369
|
+
read: "read";
|
|
370
|
+
save_memory: "save_memory";
|
|
371
|
+
search_memories: "search_memories";
|
|
372
|
+
update_memory: "update_memory";
|
|
373
|
+
web_search: "web_search";
|
|
374
|
+
write: "write";
|
|
325
375
|
write_todos: "write_todos";
|
|
326
376
|
}>>;
|
|
327
377
|
instructions: z.ZodString;
|
|
@@ -352,6 +402,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
|
|
|
352
402
|
save_memory: "save_memory";
|
|
353
403
|
search_memories: "search_memories";
|
|
354
404
|
update_memory: "update_memory";
|
|
405
|
+
web_search: "web_search";
|
|
355
406
|
write: "write";
|
|
356
407
|
write_todos: "write_todos";
|
|
357
408
|
}>;
|
|
@@ -391,6 +442,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
|
|
|
391
442
|
save_memory: "save_memory";
|
|
392
443
|
search_memories: "search_memories";
|
|
393
444
|
update_memory: "update_memory";
|
|
445
|
+
web_search: "web_search";
|
|
394
446
|
write: "write";
|
|
395
447
|
write_todos: "write_todos";
|
|
396
448
|
}>;
|
|
@@ -420,8 +472,19 @@ export declare const createAgentBodySchema: z.ZodObject<{
|
|
|
420
472
|
compactionReserveTokens: z.ZodDefault<z.ZodNumber>;
|
|
421
473
|
memoryInjectionEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
422
474
|
tools: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
423
|
-
|
|
424
|
-
|
|
475
|
+
bash: "bash";
|
|
476
|
+
delete_memory: "delete_memory";
|
|
477
|
+
edit: "edit";
|
|
478
|
+
get_memory: "get_memory";
|
|
479
|
+
glob: "glob";
|
|
480
|
+
grep: "grep";
|
|
481
|
+
publish_artifacts: "publish_artifacts";
|
|
482
|
+
read: "read";
|
|
483
|
+
save_memory: "save_memory";
|
|
484
|
+
search_memories: "search_memories";
|
|
485
|
+
update_memory: "update_memory";
|
|
486
|
+
web_search: "web_search";
|
|
487
|
+
write: "write";
|
|
425
488
|
write_todos: "write_todos";
|
|
426
489
|
}>>>;
|
|
427
490
|
instructions: z.ZodDefault<z.ZodString>;
|
|
@@ -453,6 +516,7 @@ export declare const updateAgentBodySchema: z.ZodObject<{
|
|
|
453
516
|
save_memory: "save_memory";
|
|
454
517
|
search_memories: "search_memories";
|
|
455
518
|
update_memory: "update_memory";
|
|
519
|
+
web_search: "web_search";
|
|
456
520
|
write: "write";
|
|
457
521
|
write_todos: "write_todos";
|
|
458
522
|
}>;
|
|
@@ -492,6 +556,7 @@ export declare const updateAgentBodySchema: z.ZodObject<{
|
|
|
492
556
|
save_memory: "save_memory";
|
|
493
557
|
search_memories: "search_memories";
|
|
494
558
|
update_memory: "update_memory";
|
|
559
|
+
web_search: "web_search";
|
|
495
560
|
write: "write";
|
|
496
561
|
write_todos: "write_todos";
|
|
497
562
|
}>;
|
|
@@ -517,8 +582,19 @@ export declare const updateAgentBodySchema: z.ZodObject<{
|
|
|
517
582
|
compactionReserveTokens: z.ZodOptional<z.ZodNumber>;
|
|
518
583
|
memoryInjectionEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
519
584
|
tools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
520
|
-
|
|
521
|
-
|
|
585
|
+
bash: "bash";
|
|
586
|
+
delete_memory: "delete_memory";
|
|
587
|
+
edit: "edit";
|
|
588
|
+
get_memory: "get_memory";
|
|
589
|
+
glob: "glob";
|
|
590
|
+
grep: "grep";
|
|
591
|
+
publish_artifacts: "publish_artifacts";
|
|
592
|
+
read: "read";
|
|
593
|
+
save_memory: "save_memory";
|
|
594
|
+
search_memories: "search_memories";
|
|
595
|
+
update_memory: "update_memory";
|
|
596
|
+
web_search: "web_search";
|
|
597
|
+
write: "write";
|
|
522
598
|
write_todos: "write_todos";
|
|
523
599
|
}>>>;
|
|
524
600
|
instructions: z.ZodOptional<z.ZodString>;
|
|
@@ -4,7 +4,7 @@ import { agentIdSchema, mcpConnectionIdSchema, providerIdSchema, tenantIdSchema,
|
|
|
4
4
|
import { DEFAULT_AGENTS_LIST_LIMIT, MAX_AGENT_INSTRUCTIONS_LENGTH, MAX_AGENT_NAME_LENGTH, MAX_AGENTS_LIST_LIMIT, MAX_MCP_CONNECTIONS_PER_AGENT, } from "../limitations.js";
|
|
5
5
|
import { atLeastOneFieldMessage, hasObjectKeys, hasUniqueValues, } from "../utils.js";
|
|
6
6
|
import { approvalPolicySchema } from "./agent-approval.js";
|
|
7
|
-
import {
|
|
7
|
+
import { agentToolNames } from "./agent-tools.js";
|
|
8
8
|
import { metadataSchema, userIdSchema } from "./attribution.js";
|
|
9
9
|
import { workspaceTierSchema } from "./workspaces.js";
|
|
10
10
|
const approvalFields = {
|
|
@@ -24,9 +24,9 @@ export const agentInstructionsSchema = z
|
|
|
24
24
|
/** Provider-native model id, passed through without interpretation. */
|
|
25
25
|
export const agentModelIdSchema = z.string().trim().min(1);
|
|
26
26
|
export const agentToolsSchema = z
|
|
27
|
-
.array(z.enum(
|
|
27
|
+
.array(z.enum(agentToolNames))
|
|
28
28
|
.refine(hasUniqueValues, {
|
|
29
|
-
message: "Tool
|
|
29
|
+
message: "Tool names must be unique.",
|
|
30
30
|
});
|
|
31
31
|
export const agentMcpConnectionIdsSchema = z
|
|
32
32
|
.array(mcpConnectionIdSchema)
|
|
@@ -60,6 +60,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
60
60
|
save_memory: "save_memory";
|
|
61
61
|
search_memories: "search_memories";
|
|
62
62
|
update_memory: "update_memory";
|
|
63
|
+
web_search: "web_search";
|
|
63
64
|
write: "write";
|
|
64
65
|
write_todos: "write_todos";
|
|
65
66
|
}>;
|
|
@@ -99,6 +100,7 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
99
100
|
save_memory: "save_memory";
|
|
100
101
|
search_memories: "search_memories";
|
|
101
102
|
update_memory: "update_memory";
|
|
103
|
+
web_search: "web_search";
|
|
102
104
|
write: "write";
|
|
103
105
|
write_todos: "write_todos";
|
|
104
106
|
}>;
|
|
@@ -123,8 +125,19 @@ export declare const sessionResponseSchema: z.ZodObject<{
|
|
|
123
125
|
compactionReserveTokens: z.ZodNumber;
|
|
124
126
|
memoryInjectionEnabled: z.ZodBoolean;
|
|
125
127
|
tools: z.ZodArray<z.ZodEnum<{
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
bash: "bash";
|
|
129
|
+
delete_memory: "delete_memory";
|
|
130
|
+
edit: "edit";
|
|
131
|
+
get_memory: "get_memory";
|
|
132
|
+
glob: "glob";
|
|
133
|
+
grep: "grep";
|
|
134
|
+
publish_artifacts: "publish_artifacts";
|
|
135
|
+
read: "read";
|
|
136
|
+
save_memory: "save_memory";
|
|
137
|
+
search_memories: "search_memories";
|
|
138
|
+
update_memory: "update_memory";
|
|
139
|
+
web_search: "web_search";
|
|
140
|
+
write: "write";
|
|
128
141
|
write_todos: "write_todos";
|
|
129
142
|
}>>;
|
|
130
143
|
instructions: z.ZodString;
|
|
@@ -249,6 +262,7 @@ export declare const toolApprovalStateSchema: z.ZodObject<{
|
|
|
249
262
|
save_memory: "save_memory";
|
|
250
263
|
search_memories: "search_memories";
|
|
251
264
|
update_memory: "update_memory";
|
|
265
|
+
web_search: "web_search";
|
|
252
266
|
write: "write";
|
|
253
267
|
write_todos: "write_todos";
|
|
254
268
|
}>;
|
|
@@ -300,6 +314,7 @@ export declare const toolApprovalsResponseSchema: z.ZodObject<{
|
|
|
300
314
|
save_memory: "save_memory";
|
|
301
315
|
search_memories: "search_memories";
|
|
302
316
|
update_memory: "update_memory";
|
|
317
|
+
web_search: "web_search";
|
|
303
318
|
write: "write";
|
|
304
319
|
write_todos: "write_todos";
|
|
305
320
|
}>;
|
|
@@ -346,6 +361,20 @@ export declare const continueToolApprovalsBodySchema: z.ZodObject<{
|
|
|
346
361
|
inputSchema: z.ZodCustom<z.core.JSONSchema.JSONSchema, z.core.JSONSchema.JSONSchema>;
|
|
347
362
|
}, z.core.$strict>>>;
|
|
348
363
|
}, z.core.$strict>;
|
|
364
|
+
/**
|
|
365
|
+
* Transient event that precedes the `error` chunk when a Turn stream is cut
|
|
366
|
+
* after it started. The `error` chunk has no field for a code, so the code
|
|
367
|
+
* rides here. `turn_interrupted` is never an HTTP error code. The Turn may
|
|
368
|
+
* have saved its work before the cut, so read the Session's messages.
|
|
369
|
+
*/
|
|
370
|
+
export declare const turnInterruptedEventSchema: z.ZodObject<{
|
|
371
|
+
type: z.ZodLiteral<"data-turn-interrupted">;
|
|
372
|
+
data: z.ZodObject<{
|
|
373
|
+
code: z.ZodLiteral<"turn_interrupted">;
|
|
374
|
+
}, z.core.$strict>;
|
|
375
|
+
transient: z.ZodLiteral<true>;
|
|
376
|
+
}, z.core.$strict>;
|
|
377
|
+
export type TurnInterruptedEvent = z.infer<typeof turnInterruptedEventSchema>;
|
|
349
378
|
export type SessionForkedFrom = z.infer<typeof sessionForkedFromSchema>;
|
|
350
379
|
export type SessionResponse = z.infer<typeof sessionResponseSchema>;
|
|
351
380
|
export type SessionsListResponse = z.infer<typeof sessionsListResponseSchema>;
|
|
@@ -134,3 +134,16 @@ export const continueToolApprovalsBodySchema = z
|
|
|
134
134
|
functions: chatFunctionDefinitionsSchema.optional(),
|
|
135
135
|
})
|
|
136
136
|
.strict();
|
|
137
|
+
/**
|
|
138
|
+
* Transient event that precedes the `error` chunk when a Turn stream is cut
|
|
139
|
+
* after it started. The `error` chunk has no field for a code, so the code
|
|
140
|
+
* rides here. `turn_interrupted` is never an HTTP error code. The Turn may
|
|
141
|
+
* have saved its work before the cut, so read the Session's messages.
|
|
142
|
+
*/
|
|
143
|
+
export const turnInterruptedEventSchema = z
|
|
144
|
+
.object({
|
|
145
|
+
type: z.literal("data-turn-interrupted"),
|
|
146
|
+
data: z.object({ code: z.literal("turn_interrupted") }).strict(),
|
|
147
|
+
transient: z.literal(true),
|
|
148
|
+
})
|
|
149
|
+
.strict();
|
|
@@ -290,6 +290,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
290
290
|
save_memory: "save_memory";
|
|
291
291
|
search_memories: "search_memories";
|
|
292
292
|
update_memory: "update_memory";
|
|
293
|
+
web_search: "web_search";
|
|
293
294
|
write: "write";
|
|
294
295
|
write_todos: "write_todos";
|
|
295
296
|
}>;
|
|
@@ -329,6 +330,7 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
329
330
|
save_memory: "save_memory";
|
|
330
331
|
search_memories: "search_memories";
|
|
331
332
|
update_memory: "update_memory";
|
|
333
|
+
web_search: "web_search";
|
|
332
334
|
write: "write";
|
|
333
335
|
write_todos: "write_todos";
|
|
334
336
|
}>;
|
|
@@ -353,8 +355,19 @@ export declare const taskRunResponseSchema: z.ZodObject<{
|
|
|
353
355
|
compactionReserveTokens: z.ZodNumber;
|
|
354
356
|
memoryInjectionEnabled: z.ZodBoolean;
|
|
355
357
|
tools: z.ZodArray<z.ZodEnum<{
|
|
356
|
-
|
|
357
|
-
|
|
358
|
+
bash: "bash";
|
|
359
|
+
delete_memory: "delete_memory";
|
|
360
|
+
edit: "edit";
|
|
361
|
+
get_memory: "get_memory";
|
|
362
|
+
glob: "glob";
|
|
363
|
+
grep: "grep";
|
|
364
|
+
publish_artifacts: "publish_artifacts";
|
|
365
|
+
read: "read";
|
|
366
|
+
save_memory: "save_memory";
|
|
367
|
+
search_memories: "search_memories";
|
|
368
|
+
update_memory: "update_memory";
|
|
369
|
+
web_search: "web_search";
|
|
370
|
+
write: "write";
|
|
358
371
|
write_todos: "write_todos";
|
|
359
372
|
}>>;
|
|
360
373
|
instructions: z.ZodString;
|
|
@@ -411,6 +424,7 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
411
424
|
save_memory: "save_memory";
|
|
412
425
|
search_memories: "search_memories";
|
|
413
426
|
update_memory: "update_memory";
|
|
427
|
+
web_search: "web_search";
|
|
414
428
|
write: "write";
|
|
415
429
|
write_todos: "write_todos";
|
|
416
430
|
}>;
|
|
@@ -450,6 +464,7 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
450
464
|
save_memory: "save_memory";
|
|
451
465
|
search_memories: "search_memories";
|
|
452
466
|
update_memory: "update_memory";
|
|
467
|
+
web_search: "web_search";
|
|
453
468
|
write: "write";
|
|
454
469
|
write_todos: "write_todos";
|
|
455
470
|
}>;
|
|
@@ -474,8 +489,19 @@ export declare const taskRunsListResponseSchema: z.ZodObject<{
|
|
|
474
489
|
compactionReserveTokens: z.ZodNumber;
|
|
475
490
|
memoryInjectionEnabled: z.ZodBoolean;
|
|
476
491
|
tools: z.ZodArray<z.ZodEnum<{
|
|
477
|
-
|
|
478
|
-
|
|
492
|
+
bash: "bash";
|
|
493
|
+
delete_memory: "delete_memory";
|
|
494
|
+
edit: "edit";
|
|
495
|
+
get_memory: "get_memory";
|
|
496
|
+
glob: "glob";
|
|
497
|
+
grep: "grep";
|
|
498
|
+
publish_artifacts: "publish_artifacts";
|
|
499
|
+
read: "read";
|
|
500
|
+
save_memory: "save_memory";
|
|
501
|
+
search_memories: "search_memories";
|
|
502
|
+
update_memory: "update_memory";
|
|
503
|
+
web_search: "web_search";
|
|
504
|
+
write: "write";
|
|
479
505
|
write_todos: "write_todos";
|
|
480
506
|
}>>;
|
|
481
507
|
instructions: z.ZodString;
|
|
@@ -1,50 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* `GET /v1/usage` groupBy — `day|agent|model|session|user`. `session` is
|
|
4
|
-
* top-N by tokens; the others are exhaustive and bounded. `user` is the
|
|
5
|
-
* end-user attribution dimension (ADR-0001) — one bucket per `userId`, with
|
|
6
|
-
* `''` emitted verbatim as the tenant-level bucket.
|
|
7
|
-
*/
|
|
8
|
-
export declare const usageGroupBySchema: z.ZodDefault<z.ZodEnum<{
|
|
9
|
-
agent: "agent";
|
|
10
|
-
day: "day";
|
|
11
|
-
model: "model";
|
|
12
|
-
session: "session";
|
|
13
|
-
user: "user";
|
|
14
|
-
}>>;
|
|
15
|
-
/**
|
|
16
|
-
* A `sessionId` filter value — either a real platform session id (`ss_…`)
|
|
17
|
-
* or the `''` sentinel for stateless `completion`/`object` turns. The daily
|
|
18
|
-
* table stores `''` for stateless turns; the bucket wire shape maps `''`
|
|
19
|
-
* back to `null` on read (see `usageBucketSchema.sessionId`).
|
|
20
|
-
*/
|
|
21
|
-
export declare const usageSessionFilterSchema: z.ZodString;
|
|
22
|
-
/**
|
|
23
|
-
* `?from=&to=&agentId=&sessionId=&userId=&groupBy=&limit=` — `from`/`to` are
|
|
24
|
-
* date strings (`YYYY-MM-DD`) since the daily table is keyed by `day date`.
|
|
25
|
-
* Range capped at 31 days; default is the last 30 days ending today (UTC).
|
|
26
|
-
* The `sessionId` filter accepts `''` to drill into stateless turns only.
|
|
27
|
-
* The `userId` filter accepts any opaque string (including `''` for
|
|
28
|
-
* tenant-level usage only) — see ADR-0001 for the three filter modes.
|
|
29
|
-
*/
|
|
30
|
-
export declare const usageQuerySchema: z.ZodObject<{
|
|
31
|
-
from: z.ZodOptional<z.ZodISODate>;
|
|
32
|
-
to: z.ZodOptional<z.ZodISODate>;
|
|
33
|
-
agentId: z.ZodOptional<z.ZodString>;
|
|
34
|
-
sessionId: z.ZodOptional<z.ZodString>;
|
|
35
|
-
userId: z.ZodOptional<z.ZodString>;
|
|
36
|
-
groupBy: z.ZodDefault<z.ZodEnum<{
|
|
37
|
-
agent: "agent";
|
|
38
|
-
day: "day";
|
|
39
|
-
model: "model";
|
|
40
|
-
session: "session";
|
|
41
|
-
user: "user";
|
|
42
|
-
}>>;
|
|
43
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
44
|
-
}, z.core.$strict>;
|
|
45
2
|
/**
|
|
46
3
|
* Query for the bounded dashboard-oriented usage overview. The date range has
|
|
47
|
-
* the same semantics as `
|
|
4
|
+
* the same semantics as `UsageQuery`; `limit` bounds each ranking.
|
|
48
5
|
*/
|
|
49
6
|
export declare const usageOverviewQuerySchema: z.ZodObject<{
|
|
50
7
|
from: z.ZodOptional<z.ZodISODate>;
|
|
@@ -236,7 +193,26 @@ export declare function usageOverviewResponseSchemaForQuery(query?: Partial<Usag
|
|
|
236
193
|
}, z.core.$strip>>;
|
|
237
194
|
activeAgentCount: z.ZodNumber;
|
|
238
195
|
}, z.core.$strip>;
|
|
239
|
-
|
|
196
|
+
/**
|
|
197
|
+
* `?from=&to=&agentId=&sessionId=&userId=&groupBy=&limit=` for `GET /v1/usage`.
|
|
198
|
+
* `from`/`to` are `YYYY-MM-DD` dates, both present or both absent and at most
|
|
199
|
+
* 31 days apart; the default is the last 30 days ending today (UTC). `groupBy`
|
|
200
|
+
* defaults to `day`; `session` is top-N by tokens, bounded by `limit` (default
|
|
201
|
+
* 50, at most 200), and `user` is the end-user attribution dimension
|
|
202
|
+
* (ADR-0001) with `''` emitted verbatim as the tenant-level bucket. The
|
|
203
|
+
* `sessionId` filter accepts `''` to drill into stateless `completion`/`object`
|
|
204
|
+
* turns; `userId` accepts any opaque string, including `''` for tenant-level
|
|
205
|
+
* usage only. The server enforces these rules; the SDK passes the query through.
|
|
206
|
+
*/
|
|
207
|
+
export interface UsageQuery {
|
|
208
|
+
agentId?: string;
|
|
209
|
+
from?: string;
|
|
210
|
+
groupBy?: "day" | "agent" | "model" | "session" | "user";
|
|
211
|
+
limit?: number;
|
|
212
|
+
sessionId?: string;
|
|
213
|
+
to?: string;
|
|
214
|
+
userId?: string;
|
|
215
|
+
}
|
|
240
216
|
export type UsageBucket = z.infer<typeof usageBucketSchema>;
|
|
241
217
|
export type UsageTotals = z.infer<typeof usageTotalsSchema>;
|
|
242
218
|
export type UsageResponse = z.infer<typeof usageResponseSchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { agentIdSchema, sessionIdSchema } from "../ids.js";
|
|
3
|
-
import { DEFAULT_USAGE_OVERVIEW_TOP_N, DEFAULT_USAGE_RANGE_DAYS,
|
|
3
|
+
import { DEFAULT_USAGE_OVERVIEW_TOP_N, DEFAULT_USAGE_RANGE_DAYS, MAX_USAGE_OVERVIEW_TOP_N, MAX_USAGE_RANGE_DAYS, } from "../limitations.js";
|
|
4
4
|
import { hasUniqueValues } from "../utils.js";
|
|
5
5
|
import { userIdSchema } from "./attribution.js";
|
|
6
6
|
/**
|
|
@@ -34,54 +34,9 @@ function validateUsageRange(value, ctx) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
/**
|
|
38
|
-
* `GET /v1/usage` groupBy — `day|agent|model|session|user`. `session` is
|
|
39
|
-
* top-N by tokens; the others are exhaustive and bounded. `user` is the
|
|
40
|
-
* end-user attribution dimension (ADR-0001) — one bucket per `userId`, with
|
|
41
|
-
* `''` emitted verbatim as the tenant-level bucket.
|
|
42
|
-
*/
|
|
43
|
-
export const usageGroupBySchema = z
|
|
44
|
-
.enum(["day", "agent", "model", "session", "user"])
|
|
45
|
-
.default("day");
|
|
46
|
-
/**
|
|
47
|
-
* A `sessionId` filter value — either a real platform session id (`ss_…`)
|
|
48
|
-
* or the `''` sentinel for stateless `completion`/`object` turns. The daily
|
|
49
|
-
* table stores `''` for stateless turns; the bucket wire shape maps `''`
|
|
50
|
-
* back to `null` on read (see `usageBucketSchema.sessionId`).
|
|
51
|
-
*/
|
|
52
|
-
export const usageSessionFilterSchema = z
|
|
53
|
-
.string()
|
|
54
|
-
.refine((v) => v === "" || z.validate(sessionIdSchema, v), {
|
|
55
|
-
message: "Must be a session id or '' for stateless turns.",
|
|
56
|
-
});
|
|
57
|
-
/**
|
|
58
|
-
* `?from=&to=&agentId=&sessionId=&userId=&groupBy=&limit=` — `from`/`to` are
|
|
59
|
-
* date strings (`YYYY-MM-DD`) since the daily table is keyed by `day date`.
|
|
60
|
-
* Range capped at 31 days; default is the last 30 days ending today (UTC).
|
|
61
|
-
* The `sessionId` filter accepts `''` to drill into stateless turns only.
|
|
62
|
-
* The `userId` filter accepts any opaque string (including `''` for
|
|
63
|
-
* tenant-level usage only) — see ADR-0001 for the three filter modes.
|
|
64
|
-
*/
|
|
65
|
-
export const usageQuerySchema = z
|
|
66
|
-
.object({
|
|
67
|
-
from: z.iso.date().optional(),
|
|
68
|
-
to: z.iso.date().optional(),
|
|
69
|
-
agentId: agentIdSchema.optional(),
|
|
70
|
-
sessionId: usageSessionFilterSchema.optional(),
|
|
71
|
-
userId: userIdSchema.optional(),
|
|
72
|
-
groupBy: usageGroupBySchema,
|
|
73
|
-
limit: z
|
|
74
|
-
.number()
|
|
75
|
-
.int()
|
|
76
|
-
.min(1)
|
|
77
|
-
.max(MAX_USAGE_SESSION_TOP_N)
|
|
78
|
-
.default(DEFAULT_USAGE_SESSION_TOP_N),
|
|
79
|
-
})
|
|
80
|
-
.strict()
|
|
81
|
-
.superRefine(validateUsageRange);
|
|
82
37
|
/**
|
|
83
38
|
* Query for the bounded dashboard-oriented usage overview. The date range has
|
|
84
|
-
* the same semantics as `
|
|
39
|
+
* the same semantics as `UsageQuery`; `limit` bounds each ranking.
|
|
85
40
|
*/
|
|
86
41
|
export const usageOverviewQuerySchema = z
|
|
87
42
|
.object({
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
export { receivedApiErrorResponseSchema } from "./api.ts";
|
|
3
3
|
export type { ApprovalDecision, ApprovalPolicy, ToolExecutionReference, ToolReference, } from "./entities/agent-approval.ts";
|
|
4
4
|
export { approvalDecisionSchema, approvalPolicySchema, toolExecutionReferenceSchema, toolReferenceSchema, } from "./entities/agent-approval.ts";
|
|
5
|
-
export {
|
|
5
|
+
export type { AgentToolCategoryId, AgentToolDefinition, AgentToolFileAccessTag, AgentToolGroupTag, AgentToolName, AgentToolTag, AgentToolTags, } from "./entities/agent-tools.ts";
|
|
6
|
+
export { AGENT_TOOL_CATEGORIES, AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, agentToolNames, chatFunctionNameSchema, } from "./entities/agent-tools.ts";
|
|
6
7
|
export { agentConfigSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.ts";
|
|
7
8
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
|
|
8
9
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
|
|
@@ -16,8 +17,8 @@ export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, pro
|
|
|
16
17
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.ts";
|
|
17
18
|
export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./entities/session-inputs.ts";
|
|
18
19
|
export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.ts";
|
|
19
|
-
export type { ContinueToolApprovalsBody, SessionForkedFrom, ToolApprovalContinuationState, ToolApprovalDecision, ToolApprovalsResponse, } from "./entities/sessions.ts";
|
|
20
|
-
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.ts";
|
|
20
|
+
export type { ContinueToolApprovalsBody, SessionForkedFrom, ToolApprovalContinuationState, ToolApprovalDecision, ToolApprovalsResponse, TurnInterruptedEvent, } from "./entities/sessions.ts";
|
|
21
|
+
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnInterruptedEventSchema, } from "./entities/sessions.ts";
|
|
21
22
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.ts";
|
|
22
23
|
export type { SpendingLimit, SpendingLimitResponse, SpendingLimitStopDetails, SpendingLimitStopEvent, UpdateSpendingLimitBody, } from "./entities/spending-limits.ts";
|
|
23
24
|
export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, spendingLimitStopEventSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.ts";
|
package/dist/contracts/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// biome-ignore lint/performance/noBarrelFile: public contract entry point
|
|
3
3
|
export { receivedApiErrorResponseSchema } from "./api.js";
|
|
4
4
|
export { approvalDecisionSchema, approvalPolicySchema, toolExecutionReferenceSchema, toolReferenceSchema, } from "./entities/agent-approval.js";
|
|
5
|
-
export { chatFunctionNameSchema } from "./entities/agent-tools.js";
|
|
5
|
+
export { AGENT_TOOL_CATEGORIES, AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, agentToolNames, chatFunctionNameSchema, } from "./entities/agent-tools.js";
|
|
6
6
|
export { agentConfigSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.js";
|
|
7
7
|
export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.js";
|
|
8
8
|
export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.js";
|
|
@@ -14,7 +14,7 @@ export { createMerchantConnectionBodySchema, merchantBindingResponseSchema, merc
|
|
|
14
14
|
export { createPromptBodySchema, parsePromptVariables, promptResponseSchema, promptsListQuerySchema, promptsResponseSchema, promptTemplateSchema, renderPromptTemplate, updatePromptBodySchema, } from "./entities/prompts.js";
|
|
15
15
|
export { createProviderBodySchema, providerListItemSchema, providerModelsResponseSchema, providerResponseSchema, providersResponseSchema, providerTypeSchema, thinkingLevelsResponseSchema, updateProviderBodySchema, } from "./entities/providers.js";
|
|
16
16
|
export { chatSteerConsumedEventSchema, sessionActivitySchema, sessionInputRequestIdSchema, sessionInputResponseSchema, sessionInputSchema, sessionInputStateSchema, sessionInputsQuerySchema, sessionInputsResponseSchema, stopSessionBodySchema, stopSessionResponseSchema, submitSessionInputBodySchema, } from "./entities/session-inputs.js";
|
|
17
|
-
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, } from "./entities/sessions.js";
|
|
17
|
+
export { continueToolApprovalsBodySchema, latestSessionListItemSchema, latestSessionsListResponseSchema, sessionForkedFromSchema, sessionListItemSchema, sessionMessageSchema, sessionMessagesResponseSchema, sessionResponseSchema, sessionsListResponseSchema, toolApprovalContinuationStateSchema, toolApprovalDecisionSchema, toolApprovalStateSchema, toolApprovalsResponseSchema, turnInterruptedEventSchema, } from "./entities/sessions.js";
|
|
18
18
|
export { copySkillBodySchema, createSkillBodySchema, skillCopyResultsSchema, skillDetailSchema, skillsListResponseSchema, } from "./entities/skills.js";
|
|
19
19
|
export { nextSpendingLimitReset, spendingLimitPeriodSchema, spendingLimitResetIntervalSchema, spendingLimitResponseSchema, spendingLimitSchema, spendingLimitStopDetailsSchema, spendingLimitStopEventSchema, updateSpendingLimitBodySchema, } from "./entities/spending-limits.js";
|
|
20
20
|
export { createTaskBodySchema, createTaskResponseSchema, createTaskRunBodySchema, createTaskRunResponseSchema, taskCronConfigSchema, taskIntervalConfigSchema, taskListItemSchema, taskOnceConfigSchema, taskResponseSchema, taskRunMessagesResponseSchema, taskRunResponseSchema, taskRunStatusSchema, taskRunsListResponseSchema, taskScheduleInputSchema, taskScheduleKindSchema, tasksListResponseSchema, updateTaskBodySchema, } from "./entities/tasks.js";
|
|
@@ -45,13 +45,8 @@ export declare const MAX_AGENT_INSTRUCTIONS_LENGTH = 3000;
|
|
|
45
45
|
export declare const MAX_ARTIFACT_BYTES: number;
|
|
46
46
|
/** Memories — 10 KiB of text per memory. */
|
|
47
47
|
export declare const MAX_MEMORY_TEXT_BYTES: number;
|
|
48
|
-
/**
|
|
49
|
-
* Usage — range cap 31 days, default 30 days; top-N sessions default 50, max 200.
|
|
50
|
-
*/
|
|
51
48
|
export declare const MAX_USAGE_RANGE_DAYS = 31;
|
|
52
49
|
export declare const DEFAULT_USAGE_RANGE_DAYS = 30;
|
|
53
|
-
export declare const DEFAULT_USAGE_SESSION_TOP_N = 50;
|
|
54
|
-
export declare const MAX_USAGE_SESSION_TOP_N = 200;
|
|
55
50
|
export declare const DEFAULT_USAGE_OVERVIEW_TOP_N = 5;
|
|
56
51
|
export declare const MAX_USAGE_OVERVIEW_TOP_N = 20;
|
|
57
52
|
export declare const MIN_QUOTA_RESET_DAY = 1;
|
|
@@ -45,13 +45,9 @@ export const MAX_AGENT_INSTRUCTIONS_LENGTH = 3000;
|
|
|
45
45
|
export const MAX_ARTIFACT_BYTES = 10 * 1024 * 1024;
|
|
46
46
|
/** Memories — 10 KiB of text per memory. */
|
|
47
47
|
export const MAX_MEMORY_TEXT_BYTES = 10 * 1024;
|
|
48
|
-
|
|
49
|
-
* Usage — range cap 31 days, default 30 days; top-N sessions default 50, max 200.
|
|
50
|
-
*/
|
|
48
|
+
// Usage — range cap 31 days, default 30 days; overview rankings default 5, max 20.
|
|
51
49
|
export const MAX_USAGE_RANGE_DAYS = 31;
|
|
52
50
|
export const DEFAULT_USAGE_RANGE_DAYS = 30;
|
|
53
|
-
export const DEFAULT_USAGE_SESSION_TOP_N = 50;
|
|
54
|
-
export const MAX_USAGE_SESSION_TOP_N = 200;
|
|
55
51
|
export const DEFAULT_USAGE_OVERVIEW_TOP_N = 5;
|
|
56
52
|
export const MAX_USAGE_OVERVIEW_TOP_N = 20;
|
|
57
53
|
// Quota — reset day between 1 and 28.
|
package/dist/http.d.ts
CHANGED
|
@@ -46,4 +46,4 @@ export declare function requestAbortedError(cause: unknown): BlazingAgentsError;
|
|
|
46
46
|
* @param headers - Response headers to preserve or inspect.
|
|
47
47
|
* @returns The server error, or invalid_response when the envelope is malformed.
|
|
48
48
|
*/
|
|
49
|
-
export declare function parseErrorEnvelope(bodyText: string, status: number, headers
|
|
49
|
+
export declare function parseErrorEnvelope(bodyText: string, status: number, headers: Headers): BlazingAgentsError;
|
package/dist/http.js
CHANGED
|
@@ -305,7 +305,7 @@ function decodeChunks(chunks, byteLength, truncated) {
|
|
|
305
305
|
* @param headers - Response headers to preserve or inspect.
|
|
306
306
|
* @returns The server error, or invalid_response when the envelope is malformed.
|
|
307
307
|
*/
|
|
308
|
-
export function parseErrorEnvelope(bodyText, status, headers
|
|
308
|
+
export function parseErrorEnvelope(bodyText, status, headers) {
|
|
309
309
|
let parsed;
|
|
310
310
|
if (bodyText.length === 0) {
|
|
311
311
|
parsed = null;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type { UIMessage } from "ai";
|
|
|
7
7
|
export { BlazingAgentsChatTransport, type BlazingAgentsChatTransportOptions, } from "./chat-transport.ts";
|
|
8
8
|
export { BlazingAgents } from "./client.ts";
|
|
9
9
|
export type { ApprovalDecision, ApprovalPolicy, ToolExecutionReference, ToolReference, } from "./contracts/entities/agent-approval.ts";
|
|
10
|
+
export { AGENT_TOOL_CATEGORIES, AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, type AgentToolCategoryId, type AgentToolDefinition, type AgentToolFileAccessTag, type AgentToolGroupTag, type AgentToolName, type AgentToolTag, type AgentToolTags, } from "./contracts/entities/agent-tools.ts";
|
|
10
11
|
export type { Agent, AgentConfig, AgentResponse, AgentsListQuery, AgentsResponse, CreateAgentBody, UpdateAgentBody, } from "./contracts/entities/agents.ts";
|
|
11
12
|
export { agentConfigSchema } from "./contracts/entities/agents.ts";
|
|
12
13
|
export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
|
|
@@ -16,7 +17,7 @@ export type { CreateMerchantConnectionBody, MerchantBindingResponse, MerchantBin
|
|
|
16
17
|
export type { CreatePromptBody, PromptResponse, PromptsListQuery, PromptsResponse, UpdatePromptBody, } from "./contracts/entities/prompts.ts";
|
|
17
18
|
export type { CreateProviderBody, ProviderListItem, ProviderModel, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ProviderType, ThinkingLevelsResponse, UpdateProviderBody, } from "./contracts/entities/providers.ts";
|
|
18
19
|
export type { ChatSteerConsumedEvent, SessionActivity, SessionInput, SessionInputResponse, SessionInputState, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody, } from "./contracts/entities/session-inputs.ts";
|
|
19
|
-
export type { ContinueToolApprovalsBody, SessionForkedFrom, SessionResponse, ToolApprovalDecision, ToolApprovalState, ToolApprovalsResponse, } from "./contracts/entities/sessions.ts";
|
|
20
|
+
export type { ContinueToolApprovalsBody, SessionForkedFrom, SessionResponse, ToolApprovalDecision, ToolApprovalState, ToolApprovalsResponse, TurnInterruptedEvent, } from "./contracts/entities/sessions.ts";
|
|
20
21
|
export { sessionResponseSchema } from "./contracts/entities/sessions.ts";
|
|
21
22
|
export type { CreateSkillBody, Skill, SkillArchiveType, SkillCopyResult, SkillCopyResults, SkillDetail, SkillFile, SkillsListResponse, } from "./contracts/entities/skills.ts";
|
|
22
23
|
export type { SpendingLimit, SpendingLimitResponse, SpendingLimitStopDetails, SpendingLimitStopEvent, UpdateSpendingLimitBody, } from "./contracts/entities/spending-limits.ts";
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
// biome-ignore lint/performance/noBarrelFile: package entry point
|
|
7
7
|
export { BlazingAgentsChatTransport, } from "./chat-transport.js";
|
|
8
8
|
export { BlazingAgents } from "./client.js";
|
|
9
|
+
export { AGENT_TOOL_CATEGORIES, AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, } from "./contracts/entities/agent-tools.js";
|
|
9
10
|
export { agentConfigSchema } from "./contracts/entities/agents.js";
|
|
10
11
|
export { sessionResponseSchema } from "./contracts/entities/sessions.js";
|
|
11
12
|
export { nextSpendingLimitReset } from "./contracts/entities/spending-limits.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HttpConfig, UsageResource } from "../types.ts";
|
|
2
2
|
/**
|
|
3
3
|
* `client.usage` — get over `/v1/usage` (tenant-wide) and
|
|
4
|
-
* `/v1/agents/:agentId/usage` (per-agent). The query shape is
|
|
5
|
-
*
|
|
4
|
+
* `/v1/agents/:agentId/usage` (per-agent). The query shape is `UsageQuery`;
|
|
5
|
+
* the SDK passes it through as query params.
|
|
6
6
|
* @param config - Shared authentication and transport configuration.
|
|
7
7
|
* @returns The configured resource client.
|
|
8
8
|
*/
|
package/dist/resources/usage.js
CHANGED
|
@@ -2,8 +2,8 @@ import { sessionUsageQuerySchema, sessionUsageResponseSchema, usageOverviewRespo
|
|
|
2
2
|
import { requestJson } from "../http.js";
|
|
3
3
|
/**
|
|
4
4
|
* `client.usage` — get over `/v1/usage` (tenant-wide) and
|
|
5
|
-
* `/v1/agents/:agentId/usage` (per-agent). The query shape is
|
|
6
|
-
*
|
|
5
|
+
* `/v1/agents/:agentId/usage` (per-agent). The query shape is `UsageQuery`;
|
|
6
|
+
* the SDK passes it through as query params.
|
|
7
7
|
* @param config - Shared authentication and transport configuration.
|
|
8
8
|
* @returns The configured resource client.
|
|
9
9
|
*/
|
package/dist/types.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { CreateMerchantConnectionBody, MerchantBindingResponse, MerchantBin
|
|
|
10
10
|
import type { CreatePromptBody, PromptResponse, PromptsResponse, UpdatePromptBody } from "./contracts/entities/prompts.ts";
|
|
11
11
|
import type { CreateProviderBody, DeleteProviderOptions, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ThinkingLevelsResponse, UpdateProviderBody } from "./contracts/entities/providers.ts";
|
|
12
12
|
import type { ChatSteerConsumedEvent, SessionInputResponse, SessionInputsQuery, SessionInputsResponse, StopSessionBody, StopSessionResponse, SubmitSessionInputBody } from "./contracts/entities/session-inputs.ts";
|
|
13
|
-
import type { LatestSessionsListResponse, SessionMessagesResponse, SessionResponse, SessionsListResponse, ToolApprovalDecision, ToolApprovalsResponse } from "./contracts/entities/sessions.ts";
|
|
13
|
+
import type { LatestSessionsListResponse, SessionMessagesResponse, SessionResponse, SessionsListResponse, ToolApprovalDecision, ToolApprovalsResponse, TurnInterruptedEvent } from "./contracts/entities/sessions.ts";
|
|
14
14
|
import type { CreateSkillBody, SkillArchiveType, SkillCopyResults, SkillDetail, SkillsListResponse } from "./contracts/entities/skills.ts";
|
|
15
15
|
import type { SpendingLimitResponse, SpendingLimitStopEvent, UpdateSpendingLimitBody } from "./contracts/entities/spending-limits.ts";
|
|
16
16
|
import type { CreateTaskBody, CreateTaskResponse, CreateTaskRunBody, CreateTaskRunResponse, TaskResponse, TaskRunMessagesResponse, TaskRunResponse, TaskRunsListResponse, TasksListResponse, UpdateTaskBody } from "./contracts/entities/tasks.ts";
|
|
@@ -118,7 +118,7 @@ export interface ResponseObservation {
|
|
|
118
118
|
status: number;
|
|
119
119
|
}
|
|
120
120
|
export type ChatTrigger = "submit-message" | "regenerate-message";
|
|
121
|
-
export type BlazingAgentsUIMessageData = Record<"ba-steer-consumed", ChatSteerConsumedEvent["data"]> & Record<"model-spending-limit", SpendingLimitStopEvent["data"]>;
|
|
121
|
+
export type BlazingAgentsUIMessageData = Record<"ba-steer-consumed", ChatSteerConsumedEvent["data"]> & Record<"model-spending-limit", SpendingLimitStopEvent["data"]> & Record<"turn-interrupted", TurnInterruptedEvent["data"]>;
|
|
122
122
|
export type BlazingAgentsUIMessage = UIMessage<BlazingAgentsChatMessageMetadata, BlazingAgentsUIMessageData>;
|
|
123
123
|
export type BlazingAgentsUIMessageChunk = UIMessageChunk<BlazingAgentsChatMessageMetadata, BlazingAgentsUIMessageData>;
|
|
124
124
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blazingagents/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "TypeScript SDK for the Blazing Agents API",
|
|
5
5
|
"homepage": "https://docs.blazingagents.com",
|
|
6
6
|
"bugs": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"README.md"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
+
"agent-tools:json": "node scripts/write-agent-tools-json.ts",
|
|
32
33
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
33
34
|
"check": "npm run typecheck && npm run test && npm run lint && npm run unused",
|
|
34
35
|
"fix": "ultracite fix",
|