@blazingagents/sdk 0.30.0 → 0.31.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
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { chat, completion, continueChat, objectGeneration, } from "./generation.js";
3
- import { createAgentsResource } from "./resources/agents.js";
3
+ import { createAgentsResource, createUserAgentsResource, } from "./resources/agents.js";
4
4
  import { createArtifactsResource } from "./resources/artifacts.js";
5
5
  import { createChatConnectionsResource } from "./resources/chat-connections.js";
6
6
  import { createChatDeliveriesResource } from "./resources/chat-deliveries.js";
@@ -29,7 +29,7 @@ const scopedUserIdSchema = z
29
29
  function createUserClient(config) {
30
30
  const usage = createUsageResource(config);
31
31
  return {
32
- agents: createAgentsResource(config),
32
+ agents: createUserAgentsResource(config),
33
33
  sessions: createSessionsResource(config),
34
34
  prompts: createPromptsResource(config),
35
35
  tasks: createTasksResource(config),
@@ -1,7 +1,13 @@
1
- import type { AgentsResource, HttpConfig } from "../types.ts";
1
+ import type { AgentsResource, HttpConfig, UserAgentsResource } from "../types.ts";
2
2
  /**
3
- * Builds the Agents operations using the shared HTTP configuration.
3
+ * Builds the Agents operations, including the spending limits that need tenant authority.
4
4
  * @param config - Shared authentication and transport configuration.
5
5
  * @returns The configured resource client.
6
6
  */
7
7
  export declare function createAgentsResource(config: HttpConfig): AgentsResource;
8
+ /**
9
+ * Builds the Agents operations a user-scoped client may call.
10
+ * @param config - Shared authentication and transport configuration.
11
+ * @returns The configured resource client.
12
+ */
13
+ export declare function createUserAgentsResource(config: HttpConfig): UserAgentsResource;
@@ -3,20 +3,13 @@ import { mcpAttachmentResponseSchema, mcpAttachmentsResponseSchema, } from "../c
3
3
  import { spendingLimitResponseSchema } from "../contracts/entities/spending-limits.js";
4
4
  import { requestJson } from "../http.js";
5
5
  /**
6
- * Builds the Agents operations using the shared HTTP configuration.
6
+ * Builds the Agents operations, including the spending limits that need tenant authority.
7
7
  * @param config - Shared authentication and transport configuration.
8
8
  * @returns The configured resource client.
9
9
  */
10
10
  export function createAgentsResource(config) {
11
- /**
12
- * Updates agents.
13
- */
14
- const update = async ({ agentId, abortSignal, ...body }) => requestJson(config, `/v1/agents/${agentId}`, {
15
- json: body,
16
- signal: abortSignal,
17
- method: "PUT",
18
- }, agentResponseSchema);
19
11
  return {
12
+ ...createUserAgentsResource(config),
20
13
  /** Retrieves the model spending limit using tenant authority. */
21
14
  async getSpendingLimit({ agentId, abortSignal }) {
22
15
  return await requestJson(config, `/v1/agents/${agentId}/spending-limit`, { signal: abortSignal }, spendingLimitResponseSchema);
@@ -25,6 +18,23 @@ export function createAgentsResource(config) {
25
18
  async updateSpendingLimit({ agentId, abortSignal, ...body }) {
26
19
  return await requestJson(config, `/v1/agents/${agentId}/spending-limit`, { method: "PUT", json: body, signal: abortSignal }, spendingLimitResponseSchema);
27
20
  },
21
+ };
22
+ }
23
+ /**
24
+ * Builds the Agents operations a user-scoped client may call.
25
+ * @param config - Shared authentication and transport configuration.
26
+ * @returns The configured resource client.
27
+ */
28
+ export function createUserAgentsResource(config) {
29
+ /**
30
+ * Updates agents.
31
+ */
32
+ const update = async ({ agentId, abortSignal, ...body }) => requestJson(config, `/v1/agents/${agentId}`, {
33
+ json: body,
34
+ signal: abortSignal,
35
+ method: "PUT",
36
+ }, agentResponseSchema);
37
+ return {
28
38
  /**
29
39
  * Creates agents.
30
40
  */
package/dist/types.d.ts CHANGED
@@ -61,24 +61,8 @@ 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
+ /** Agent operations on a user-scoped client, which has no spending limits. */
65
+ export type UserAgentsResource = Omit<AgentsResource, "getSpendingLimit" | "updateSpendingLimit">;
82
66
  export interface UserClient {
83
67
  /**
84
68
  * Returns the Skill operations for the selected Agent.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {