@blazingagents/sdk 0.28.1 → 0.30.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/client.js CHANGED
@@ -36,7 +36,11 @@ function createUserClient(config) {
36
36
  artifacts: createArtifactsResource(config),
37
37
  workspaces: createWorkspacesResource(config),
38
38
  memories: createMemoriesResource(config),
39
- usage: { get: usage.get, sessions: usage.sessions },
39
+ usage: {
40
+ get: usage.get,
41
+ getForAgent: usage.getForAgent,
42
+ sessions: usage.sessions,
43
+ },
40
44
  /** Returns Skill operations for the selected Agent. */
41
45
  agent: ({ agentId }) => ({
42
46
  skills: createAgentSkillsResource(config, agentId),
@@ -37,17 +37,7 @@ export type AgentToolTags = readonly [
37
37
  AgentToolGroupTag,
38
38
  ...AgentToolFileAccessTag[]
39
39
  ];
40
- /** @deprecated Use `AgentToolGroupTag`. */
41
- export type AgentToolCategoryId = AgentToolGroupTag;
42
- /** @deprecated Use `AGENT_TOOL_GROUPS`, keyed by `tag`. */
43
- export declare const AGENT_TOOL_CATEGORIES: readonly {
44
- description: string;
45
- id: AgentToolGroupTag;
46
- name: string;
47
- }[];
48
40
  export interface AgentToolDefinition {
49
- /** @deprecated Use the group tag in `tags`. */
50
- category: AgentToolGroupTag;
51
41
  description: string;
52
42
  name: string;
53
43
  /** The tool runs in the Agent's attached Workspace. */
@@ -57,85 +47,71 @@ export interface AgentToolDefinition {
57
47
  declare const CATALOG: readonly [{
58
48
  readonly name: "read";
59
49
  readonly tags: readonly ["files", "file_read"];
60
- readonly category: "files";
61
50
  readonly requiresWorkspace: true;
62
51
  readonly description: "Read a file from the Workspace.";
63
52
  }, {
64
53
  readonly name: "write";
65
54
  readonly tags: readonly ["files", "file_write"];
66
- readonly category: "files";
67
55
  readonly requiresWorkspace: true;
68
56
  readonly description: "Create or overwrite a file in the Workspace.";
69
57
  }, {
70
58
  readonly name: "edit";
71
59
  readonly tags: readonly ["files", "file_write"];
72
- readonly category: "files";
73
60
  readonly requiresWorkspace: true;
74
61
  readonly description: "Replace exact text in a Workspace file.";
75
62
  }, {
76
63
  readonly name: "grep";
77
64
  readonly tags: readonly ["files", "file_read"];
78
- readonly category: "files";
79
65
  readonly requiresWorkspace: true;
80
66
  readonly description: "Search Workspace file contents with a regular expression.";
81
67
  }, {
82
68
  readonly name: "glob";
83
69
  readonly tags: readonly ["files", "file_read"];
84
- readonly category: "files";
85
70
  readonly requiresWorkspace: true;
86
71
  readonly description: "Find Workspace files by path pattern.";
87
72
  }, {
88
73
  readonly name: "bash";
89
74
  readonly tags: readonly ["files", "execute"];
90
- readonly category: "files";
91
75
  readonly requiresWorkspace: true;
92
76
  readonly description: "Run shell commands in the Workspace.";
93
77
  }, {
94
78
  readonly name: "publish_artifacts";
95
79
  readonly tags: readonly ["files"];
96
- readonly category: "files";
97
80
  readonly requiresWorkspace: true;
98
81
  readonly description: "Publish Workspace files as downloadable Artifacts.";
99
82
  }, {
100
83
  readonly name: "write_todos";
101
84
  readonly tags: readonly ["planning"];
102
- readonly category: "planning";
103
85
  readonly requiresWorkspace: false;
104
86
  readonly description: "Plan and track multi-step work with a todo list.";
105
87
  }, {
106
88
  readonly name: "save_memory";
107
89
  readonly tags: readonly ["memory"];
108
- readonly category: "memory";
109
90
  readonly requiresWorkspace: false;
110
91
  readonly description: "Save a durable note.";
111
92
  }, {
112
93
  readonly name: "get_memory";
113
94
  readonly tags: readonly ["memory"];
114
- readonly category: "memory";
115
95
  readonly requiresWorkspace: false;
116
96
  readonly description: "Read one saved note.";
117
97
  }, {
118
98
  readonly name: "search_memories";
119
99
  readonly tags: readonly ["memory"];
120
- readonly category: "memory";
121
100
  readonly requiresWorkspace: false;
122
101
  readonly description: "Search saved notes.";
123
102
  }, {
124
103
  readonly name: "update_memory";
125
104
  readonly tags: readonly ["memory"];
126
- readonly category: "memory";
127
105
  readonly requiresWorkspace: false;
128
106
  readonly description: "Update a saved note.";
129
107
  }, {
130
108
  readonly name: "delete_memory";
131
109
  readonly tags: readonly ["memory"];
132
- readonly category: "memory";
133
110
  readonly requiresWorkspace: false;
134
111
  readonly description: "Delete a saved note.";
135
112
  }, {
136
113
  readonly name: "web_search";
137
114
  readonly tags: readonly ["web"];
138
- readonly category: "web";
139
115
  readonly requiresWorkspace: false;
140
116
  readonly description: "Search the public web for current results. Each search consumes Usage credit.";
141
117
  }];
@@ -41,104 +41,88 @@ export const AGENT_TOOL_TAGS = [
41
41
  ...AGENT_TOOL_GROUPS.map((group) => group.tag),
42
42
  ...AGENT_TOOL_FILE_ACCESS_TAGS,
43
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
44
  const CATALOG = [
47
45
  {
48
46
  name: "read",
49
47
  tags: ["files", "file_read"],
50
- category: "files",
51
48
  requiresWorkspace: true,
52
49
  description: "Read a file from the Workspace.",
53
50
  },
54
51
  {
55
52
  name: "write",
56
53
  tags: ["files", "file_write"],
57
- category: "files",
58
54
  requiresWorkspace: true,
59
55
  description: "Create or overwrite a file in the Workspace.",
60
56
  },
61
57
  {
62
58
  name: "edit",
63
59
  tags: ["files", "file_write"],
64
- category: "files",
65
60
  requiresWorkspace: true,
66
61
  description: "Replace exact text in a Workspace file.",
67
62
  },
68
63
  {
69
64
  name: "grep",
70
65
  tags: ["files", "file_read"],
71
- category: "files",
72
66
  requiresWorkspace: true,
73
67
  description: "Search Workspace file contents with a regular expression.",
74
68
  },
75
69
  {
76
70
  name: "glob",
77
71
  tags: ["files", "file_read"],
78
- category: "files",
79
72
  requiresWorkspace: true,
80
73
  description: "Find Workspace files by path pattern.",
81
74
  },
82
75
  {
83
76
  name: "bash",
84
77
  tags: ["files", "execute"],
85
- category: "files",
86
78
  requiresWorkspace: true,
87
79
  description: "Run shell commands in the Workspace.",
88
80
  },
89
81
  {
90
82
  name: "publish_artifacts",
91
83
  tags: ["files"],
92
- category: "files",
93
84
  requiresWorkspace: true,
94
85
  description: "Publish Workspace files as downloadable Artifacts.",
95
86
  },
96
87
  {
97
88
  name: "write_todos",
98
89
  tags: ["planning"],
99
- category: "planning",
100
90
  requiresWorkspace: false,
101
91
  description: "Plan and track multi-step work with a todo list.",
102
92
  },
103
93
  {
104
94
  name: "save_memory",
105
95
  tags: ["memory"],
106
- category: "memory",
107
96
  requiresWorkspace: false,
108
97
  description: "Save a durable note.",
109
98
  },
110
99
  {
111
100
  name: "get_memory",
112
101
  tags: ["memory"],
113
- category: "memory",
114
102
  requiresWorkspace: false,
115
103
  description: "Read one saved note.",
116
104
  },
117
105
  {
118
106
  name: "search_memories",
119
107
  tags: ["memory"],
120
- category: "memory",
121
108
  requiresWorkspace: false,
122
109
  description: "Search saved notes.",
123
110
  },
124
111
  {
125
112
  name: "update_memory",
126
113
  tags: ["memory"],
127
- category: "memory",
128
114
  requiresWorkspace: false,
129
115
  description: "Update a saved note.",
130
116
  },
131
117
  {
132
118
  name: "delete_memory",
133
119
  tags: ["memory"],
134
- category: "memory",
135
120
  requiresWorkspace: false,
136
121
  description: "Delete a saved note.",
137
122
  },
138
123
  {
139
124
  name: "web_search",
140
125
  tags: ["web"],
141
- category: "web",
142
126
  requiresWorkspace: false,
143
127
  description: "Search the public web for current results. Each search consumes Usage credit.",
144
128
  },
@@ -2,8 +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 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";
5
+ export type { AgentToolDefinition, AgentToolFileAccessTag, AgentToolGroupTag, AgentToolName, AgentToolTag, AgentToolTags, } from "./entities/agent-tools.ts";
6
+ export { AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, agentToolNames, chatFunctionNameSchema, } from "./entities/agent-tools.ts";
7
7
  export { agentConfigSchema, agentResponseSchema, agentStatusSchema, agentsListQuerySchema, agentsResponseSchema, createAgentBodySchema, updateAgentBodySchema, } from "./entities/agents.ts";
8
8
  export { artifactDownloadUrlResponseSchema, artifactListItemSchema, artifactsListResponseSchema, } from "./entities/artifacts.ts";
9
9
  export { attributionCreateInputSchema, metadataSchema, } from "./entities/attribution.ts";
@@ -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 { AGENT_TOOL_CATEGORIES, AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, agentToolNames, chatFunctionNameSchema, } from "./entities/agent-tools.js";
5
+ export { 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";
package/dist/index.d.ts CHANGED
@@ -7,7 +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
+ export { AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, type AgentToolDefinition, type AgentToolFileAccessTag, type AgentToolGroupTag, type AgentToolName, type AgentToolTag, type AgentToolTags, } from "./contracts/entities/agent-tools.ts";
11
11
  export type { Agent, AgentConfig, AgentResponse, AgentsListQuery, AgentsResponse, CreateAgentBody, UpdateAgentBody, } from "./contracts/entities/agents.ts";
12
12
  export { agentConfigSchema } from "./contracts/entities/agents.ts";
13
13
  export type { ArtifactDownloadUrlResponse, ArtifactListItem, ArtifactsListResponse, } from "./contracts/entities/artifacts.ts";
@@ -28,4 +28,4 @@ export { BlazingAgentsDirectChatTransport, type BlazingAgentsDirectChatTransport
28
28
  export { BlazingAgentsError } from "./errors.ts";
29
29
  export { type ChatFunction, type ChatFunctionContext, type ChatFunctions, defineFunction, } from "./functions.ts";
30
30
  export { createChatRelay, createCompletionRelay, type RelayContext, type SessionOwnershipStore, } from "./relay.ts";
31
- export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, BlazingAgentsUIMessageData, ChatConnectionsResource, ChatDeliveriesListOptions, ChatDeliveriesResource, ChatInput, ChatMessageInput, ChatMessagesInput, ChatPromptInput, ChatResult, ChatTrigger, CompletionInput, CompletionPromptIdInput, CompletionPromptInput, CompletionResult, ContinueChatInput, KnownBlazingAgentsErrorCode, LatestSessionsListOptions, McpConnectionsResource, MemoriesListOptions, MemoriesResource, MerchantBindingsListOptions, MerchantBindingsResource, MerchantConnectionResource, MerchantUsageEventsListOptions, MerchantUsageEventsResource, ObjectInput, ObjectPromptIdInput, ObjectPromptInput, ObjectResult, PromptsResource, ProvidersResource, ResourceRequestOptions, ResponseObservation, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, UserClient, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
31
+ export type { AgentClient, AgentSkillsResource, AgentsListOptions, AgentsResource, ArtifactsResource, AttributionInput, BlazingAgentsErrorCode, BlazingAgentsOptions, BlazingAgentsRequestOptions, BlazingAgentsUIMessage, BlazingAgentsUIMessageChunk, BlazingAgentsUIMessageData, ChatConnectionsResource, ChatDeliveriesListOptions, ChatDeliveriesResource, ChatInput, ChatMessageInput, ChatMessagesInput, ChatPromptInput, ChatResult, ChatTrigger, CompletionInput, CompletionPromptIdInput, CompletionPromptInput, CompletionResult, ContinueChatInput, KnownBlazingAgentsErrorCode, LatestSessionsListOptions, McpConnectionsResource, MemoriesListOptions, MemoriesResource, MerchantBindingsListOptions, MerchantBindingsResource, MerchantConnectionResource, MerchantUsageEventsListOptions, MerchantUsageEventsResource, ObjectInput, ObjectPromptIdInput, ObjectPromptInput, ObjectResult, PromptsResource, ProvidersResource, ResourceRequestOptions, ResponseObservation, SessionsResource, SkillsListOptions, TasksResource, TenantResource, TerminalStreamResult, UsageResource, UserAgentsResource, UserClient, WorkspacesListOptions, WorkspacesResource, } from "./types.ts";
package/dist/index.js CHANGED
@@ -6,7 +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
+ export { AGENT_TOOL_FILE_ACCESS_TAGS, AGENT_TOOL_GROUPS, AGENT_TOOL_TAGS, AGENT_TOOLS, } from "./contracts/entities/agent-tools.js";
10
10
  export { agentConfigSchema } from "./contracts/entities/agents.js";
11
11
  export { sessionResponseSchema } from "./contracts/entities/sessions.js";
12
12
  export { nextSpendingLimitReset } from "./contracts/entities/spending-limits.js";
package/dist/types.d.ts CHANGED
@@ -61,6 +61,24 @@ export interface BlazingAgentsOptions {
61
61
  export interface BlazingAgentsRequestOptions {
62
62
  clientRequestId: string;
63
63
  }
64
+ /**
65
+ * Agent operations on a user-scoped client. The API refuses the spending limit
66
+ * methods for user-scoped callers.
67
+ */
68
+ export interface UserAgentsResource extends Omit<AgentsResource, "getSpendingLimit" | "updateSpendingLimit"> {
69
+ /**
70
+ * @deprecated The API always refuses this for user-scoped callers with
71
+ * `forbidden` (403). Call it on the tenant client instead. It is removed
72
+ * from user-scoped clients in a later release.
73
+ */
74
+ getSpendingLimit: AgentsResource["getSpendingLimit"];
75
+ /**
76
+ * @deprecated The API always refuses this for user-scoped callers with
77
+ * `forbidden` (403). Call it on the tenant client instead. It is removed
78
+ * from user-scoped clients in a later release.
79
+ */
80
+ updateSpendingLimit: AgentsResource["updateSpendingLimit"];
81
+ }
64
82
  export interface UserClient {
65
83
  /**
66
84
  * Returns the Skill operations for the selected Agent.
@@ -70,7 +88,7 @@ export interface UserClient {
70
88
  agent(input: {
71
89
  agentId: string;
72
90
  }): AgentClient;
73
- readonly agents: AgentsResource;
91
+ readonly agents: UserAgentsResource;
74
92
  readonly artifacts: ArtifactsResource;
75
93
  /**
76
94
  * Creates or resumes a Session and returns its SSE stream and Session ID.
@@ -100,7 +118,7 @@ export interface UserClient {
100
118
  readonly prompts: PromptsResource;
101
119
  readonly sessions: SessionsResource;
102
120
  readonly tasks: TasksResource;
103
- readonly usage: Pick<UsageResource, "get" | "sessions">;
121
+ readonly usage: Pick<UsageResource, "get" | "getForAgent" | "sessions">;
104
122
  /**
105
123
  * Creates a client view with the supplied request correlation ID.
106
124
  * @param options - Caller-owned request correlation ID for subsequent calls.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.28.1",
3
+ "version": "0.30.0",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {