@blazingagents/sdk 0.2.2 → 0.3.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.
@@ -7,15 +7,16 @@ import { requestJson } from "../http.js";
7
7
  */
8
8
  export function createTasksResource(config) {
9
9
  return {
10
- async create(body) {
10
+ async create({ abortSignal, ...body }) {
11
11
  return await requestJson(config, "/v1/tasks", {
12
12
  json: body,
13
+ signal: abortSignal,
13
14
  method: "POST",
14
15
  }, createTaskResponseSchema);
15
16
  },
16
17
  async list(options = {}) {
17
18
  return await requestJson(config, "/v1/tasks", {
18
- signal: options.signal,
19
+ signal: options.abortSignal,
19
20
  query: {
20
21
  agentId: options.agentId,
21
22
  cursor: options.cursor,
@@ -25,35 +26,37 @@ export function createTasksResource(config) {
25
26
  },
26
27
  }, tasksListResponseSchema);
27
28
  },
28
- async get(taskId, options = {}) {
29
- return await requestJson(config, `/v1/tasks/${taskId}`, options, taskResponseSchema);
29
+ async get({ taskId, abortSignal }) {
30
+ return await requestJson(config, `/v1/tasks/${taskId}`, { signal: abortSignal }, taskResponseSchema);
30
31
  },
31
- async update(taskId, body) {
32
+ async update({ taskId, abortSignal, ...body }) {
32
33
  return await requestJson(config, `/v1/tasks/${taskId}`, {
33
34
  json: body,
35
+ signal: abortSignal,
34
36
  method: "PATCH",
35
37
  }, taskResponseSchema);
36
38
  },
37
- async delete(taskId) {
39
+ async delete({ taskId, abortSignal }) {
38
40
  await requestJson(config, `/v1/tasks/${taskId}`, {
39
41
  method: "DELETE",
42
+ signal: abortSignal,
40
43
  });
41
44
  },
42
- async createRun(taskId, body = {}) {
43
- return await requestJson(config, `/v1/tasks/${taskId}/runs`, { json: body, method: "POST" }, createTaskRunResponseSchema);
45
+ async createRun({ taskId, abortSignal, ...body }) {
46
+ return await requestJson(config, `/v1/tasks/${taskId}/runs`, { json: body, method: "POST", signal: abortSignal }, createTaskRunResponseSchema);
44
47
  },
45
- async listRuns(taskId, options = {}) {
48
+ async listRuns({ taskId, ...options }) {
46
49
  return await requestJson(config, `/v1/tasks/${taskId}/runs`, {
47
- signal: options.signal,
50
+ signal: options.abortSignal,
48
51
  query: { cursor: options.cursor, limit: options.limit },
49
52
  }, taskRunsListResponseSchema);
50
53
  },
51
- async getRun(taskId, runId, options = {}) {
52
- return await requestJson(config, `/v1/tasks/${taskId}/runs/${runId}`, options, taskRunResponseSchema);
54
+ async getRun({ taskId, runId, abortSignal }) {
55
+ return await requestJson(config, `/v1/tasks/${taskId}/runs/${runId}`, { signal: abortSignal }, taskRunResponseSchema);
53
56
  },
54
- async runMessages(taskId, runId, options = {}) {
57
+ async runMessages({ taskId, runId, ...options }) {
55
58
  return await requestJson(config, `/v1/tasks/${taskId}/runs/${runId}/messages`, {
56
- signal: options.signal,
59
+ signal: options.abortSignal,
57
60
  query: {
58
61
  cursor: options.cursor,
59
62
  after: options.after,
@@ -61,8 +64,8 @@ export function createTasksResource(config) {
61
64
  },
62
65
  }, taskRunMessagesResponseSchema);
63
66
  },
64
- async cancelRun(taskId, runId) {
65
- await requestJson(config, `/v1/tasks/${taskId}/runs/${runId}/cancel`, { method: "POST" });
67
+ async cancelRun({ taskId, runId, abortSignal }) {
68
+ await requestJson(config, `/v1/tasks/${taskId}/runs/${runId}/cancel`, { method: "POST", signal: abortSignal });
66
69
  },
67
70
  };
68
71
  }
@@ -6,12 +6,13 @@ import { requestJson } from "../http.js";
6
6
  */
7
7
  export function createTenantResource(config) {
8
8
  return {
9
- async get(options = {}) {
10
- return await requestJson(config, "/v1/tenant", options, tenantSettingsResponseSchema);
9
+ async get({ abortSignal } = {}) {
10
+ return await requestJson(config, "/v1/tenant", { signal: abortSignal }, tenantSettingsResponseSchema);
11
11
  },
12
- async patch(body) {
12
+ async patch({ abortSignal, ...body }) {
13
13
  return await requestJson(config, "/v1/tenant", {
14
14
  json: body,
15
+ signal: abortSignal,
15
16
  method: "PATCH",
16
17
  }, tenantSettingsResponseSchema);
17
18
  },
@@ -7,14 +7,14 @@ import { requestJson } from "../http.js";
7
7
  */
8
8
  export function createUsageResource(config) {
9
9
  return {
10
- async get({ signal, ...query } = {}) {
10
+ async get({ abortSignal, ...query } = {}) {
11
11
  return await requestJson(config, "/v1/usage", {
12
12
  query,
13
- signal,
13
+ signal: abortSignal,
14
14
  }, usageResponseSchema);
15
15
  },
16
- async getForAgent(agentId, { signal, ...query } = {}) {
17
- return await requestJson(config, `/v1/agents/${agentId}/usage`, { query, signal }, usageResponseSchema);
16
+ async getForAgent({ agentId, abortSignal, ...query }) {
17
+ return await requestJson(config, `/v1/agents/${agentId}/usage`, { query, signal: abortSignal }, usageResponseSchema);
18
18
  },
19
19
  };
20
20
  }
@@ -2,22 +2,23 @@ import { workspaceSchema, workspacesListResponseSchema, } from "../contracts/ent
2
2
  import { requestJson, requestStream } from "../http.js";
3
3
  export function createWorkspacesResource(config) {
4
4
  return {
5
- async create(body = {}) {
5
+ async create({ abortSignal, ...body } = {}) {
6
6
  return await requestJson(config, "/v1/workspaces", {
7
7
  json: body,
8
+ signal: abortSignal,
8
9
  method: "POST",
9
10
  }, workspaceSchema);
10
11
  },
11
- async delete({ workspaceId }) {
12
- const response = await requestStream(config, `/v1/workspaces/${encodeURIComponent(workspaceId)}`, { method: "DELETE" });
12
+ async delete({ workspaceId, abortSignal }) {
13
+ const response = await requestStream(config, `/v1/workspaces/${encodeURIComponent(workspaceId)}`, { method: "DELETE", signal: abortSignal });
13
14
  return response.status === 202 ? "pending" : "completed";
14
15
  },
15
- async get({ workspaceId }, options = {}) {
16
- return await requestJson(config, `/v1/workspaces/${encodeURIComponent(workspaceId)}`, options, workspaceSchema);
16
+ async get({ workspaceId, abortSignal }) {
17
+ return await requestJson(config, `/v1/workspaces/${encodeURIComponent(workspaceId)}`, { signal: abortSignal }, workspaceSchema);
17
18
  },
18
- async list(options = {}) {
19
+ async list({ abortSignal, ...options } = {}) {
19
20
  return await requestJson(config, "/v1/workspaces", {
20
- signal: options.signal,
21
+ signal: abortSignal,
21
22
  query: {
22
23
  cursor: options.cursor,
23
24
  limit: options.limit,
@@ -25,8 +26,8 @@ export function createWorkspacesResource(config) {
25
26
  },
26
27
  }, workspacesListResponseSchema);
27
28
  },
28
- async update({ workspaceId, ...body }) {
29
- return await requestJson(config, `/v1/workspaces/${encodeURIComponent(workspaceId)}`, { json: body, method: "PUT" }, workspaceSchema);
29
+ async update({ workspaceId, abortSignal, ...body }) {
30
+ return await requestJson(config, `/v1/workspaces/${encodeURIComponent(workspaceId)}`, { json: body, signal: abortSignal, method: "PUT" }, workspaceSchema);
30
31
  },
31
32
  };
32
33
  }
package/dist/types.d.ts CHANGED
@@ -99,19 +99,19 @@ interface ExistingSessionInput {
99
99
  }
100
100
  type ChatSessionInput = NewSessionInput | ExistingSessionInput;
101
101
  interface ChatMessageContentInput extends AttributionInput, CorrelatedRequestInput {
102
+ abortSignal?: AbortSignal;
102
103
  agentId: string;
103
104
  message: UIMessage;
104
105
  messageId?: string;
105
106
  promptId?: never;
106
- signal?: AbortSignal;
107
107
  variables?: never;
108
108
  }
109
109
  interface ChatPromptContentInput extends AttributionInput, CorrelatedRequestInput {
110
+ abortSignal?: AbortSignal;
110
111
  agentId: string;
111
112
  message?: never;
112
113
  messageId?: string;
113
114
  promptId: string;
114
- signal?: AbortSignal;
115
115
  variables?: Record<string, string>;
116
116
  }
117
117
  export type ChatMessageInput = ChatMessageContentInput & ChatSessionInput;
@@ -140,19 +140,19 @@ interface StatelessGenerationInput extends AttributionInput, CorrelatedRequestIn
140
140
  version?: number;
141
141
  }
142
142
  export interface CompletionPromptInput extends StatelessGenerationInput {
143
+ abortSignal?: AbortSignal;
143
144
  agentId: string;
144
145
  prompt: string;
145
146
  promptId?: never;
146
147
  schema?: never;
147
- signal?: AbortSignal;
148
148
  variables?: never;
149
149
  }
150
150
  export interface CompletionPromptIdInput extends StatelessGenerationInput {
151
+ abortSignal?: AbortSignal;
151
152
  agentId: string;
152
153
  prompt?: never;
153
154
  promptId: string;
154
155
  schema?: never;
155
- signal?: AbortSignal;
156
156
  variables?: Record<string, string>;
157
157
  }
158
158
  export type CompletionInput = CompletionPromptInput | CompletionPromptIdInput;
@@ -163,19 +163,19 @@ export interface CompletionResult {
163
163
  toResponse: () => Response;
164
164
  }
165
165
  export interface ObjectPromptInput extends StatelessGenerationInput {
166
+ abortSignal?: AbortSignal;
166
167
  agentId: string;
167
168
  prompt: string;
168
169
  promptId?: never;
169
170
  schema: Record<string, unknown>;
170
- signal?: AbortSignal;
171
171
  variables?: never;
172
172
  }
173
173
  export interface ObjectPromptIdInput extends StatelessGenerationInput {
174
+ abortSignal?: AbortSignal;
174
175
  agentId: string;
175
176
  prompt?: never;
176
177
  promptId: string;
177
178
  schema: Record<string, unknown>;
178
- signal?: AbortSignal;
179
179
  variables?: Record<string, string>;
180
180
  }
181
181
  export type ObjectInput = ObjectPromptInput | ObjectPromptIdInput;
@@ -185,130 +185,224 @@ export interface ObjectResult {
185
185
  requestId?: string;
186
186
  toResponse: () => Response;
187
187
  }
188
- export type ResourceReadOptions = Pick<RequestOptions, "signal">;
188
+ export interface ResourceRequestOptions {
189
+ abortSignal?: AbortSignal;
190
+ }
189
191
  export interface AgentsResource {
190
192
  /** Omitting `workspaceId` attaches a default Workspace with a lazy runtime. */
191
- create(body: CreateAgentBody): Promise<Agent>;
193
+ create(input: CreateAgentBody & ResourceRequestOptions): Promise<Agent>;
192
194
  /** Deletes the Agent while preserving its attached Workspace. */
193
- delete(agentId: string, includeArtifacts: boolean): Promise<void>;
194
- disable(agentId: string): Promise<Agent>;
195
- enable(agentId: string): Promise<Agent>;
196
- get(agentId: string, options?: ResourceReadOptions): Promise<Agent>;
197
- getVersion(agentId: string, version: number, options?: ResourceReadOptions): Promise<AgentVersion>;
198
- list(options?: AgentsListOptions): Promise<AgentsResponse>;
199
- listMcpAttachments(agentId: string, options?: ResourceReadOptions): Promise<McpAttachmentsResponse>;
200
- listVersions(agentId: string, options?: AgentVersionsListOptions): Promise<AgentVersionsResponse>;
201
- removeAvatar(agentId: string): Promise<Agent>;
202
- /**
203
- * Copies an immutable Version's configuration into the Agent through the
204
- * ordinary update path, creating a new latest Version without rewriting history.
205
- */
206
- restoreVersion(agentId: string, version: number): Promise<Agent>;
195
+ delete(input: {
196
+ agentId: string;
197
+ includeArtifacts: boolean;
198
+ } & ResourceRequestOptions): Promise<void>;
199
+ disable(input: {
200
+ agentId: string;
201
+ } & ResourceRequestOptions): Promise<Agent>;
202
+ enable(input: {
203
+ agentId: string;
204
+ } & ResourceRequestOptions): Promise<Agent>;
205
+ get(input: {
206
+ agentId: string;
207
+ } & ResourceRequestOptions): Promise<Agent>;
208
+ getVersion(input: {
209
+ agentId: string;
210
+ version: number;
211
+ } & ResourceRequestOptions): Promise<AgentVersion>;
212
+ list(input?: AgentsListOptions): Promise<AgentsResponse>;
213
+ listMcpAttachments(input: {
214
+ agentId: string;
215
+ } & ResourceRequestOptions): Promise<McpAttachmentsResponse>;
216
+ listVersions(input: {
217
+ agentId: string;
218
+ } & AgentVersionsListOptions): Promise<AgentVersionsResponse>;
219
+ removeAvatar(input: {
220
+ agentId: string;
221
+ } & ResourceRequestOptions): Promise<Agent>;
222
+ /** Copies an immutable Version into the Agent, creating a new latest Version. */
223
+ restoreVersion(input: {
224
+ agentId: string;
225
+ version: number;
226
+ } & ResourceRequestOptions): Promise<Agent>;
207
227
  /** A concrete `workspaceId` switches the Agent; detachment is unsupported. */
208
- update(agentId: string, body: UpdateAgentBody): Promise<Agent>;
209
- updateMcpAttachment(agentId: string, mcpConnectionId: string, body: UpdateMcpAttachmentBody): Promise<McpAttachmentResponse>;
210
- uploadAvatar(agentId: string, file: File): Promise<Agent>;
228
+ update(input: UpdateAgentBody & {
229
+ agentId: string;
230
+ } & ResourceRequestOptions): Promise<Agent>;
231
+ updateMcpAttachment(input: UpdateMcpAttachmentBody & {
232
+ agentId: string;
233
+ mcpConnectionId: string;
234
+ } & ResourceRequestOptions): Promise<McpAttachmentResponse>;
235
+ uploadAvatar(input: {
236
+ agentId: string;
237
+ file: File;
238
+ } & ResourceRequestOptions): Promise<Agent>;
211
239
  }
212
240
  export interface AgentClient {
213
241
  readonly skills: AgentSkillsResource;
214
242
  }
215
- export interface AgentsListOptions extends ResourceReadOptions {
243
+ export interface AgentsListOptions extends ResourceRequestOptions {
216
244
  userId?: string;
217
245
  workspaceId?: string;
218
246
  }
219
247
  export interface WorkspacesResource {
220
- create(body?: CreateWorkspaceBody): Promise<Workspace>;
248
+ create(input?: CreateWorkspaceBody & ResourceRequestOptions): Promise<Workspace>;
221
249
  delete(input: {
222
250
  workspaceId: string;
223
- }): Promise<"completed" | "pending">;
251
+ } & ResourceRequestOptions): Promise<"completed" | "pending">;
224
252
  get(input: {
225
253
  workspaceId: string;
226
- }, options?: ResourceReadOptions): Promise<Workspace>;
227
- list(options?: WorkspacesListOptions): Promise<WorkspacesListResponse>;
254
+ } & ResourceRequestOptions): Promise<Workspace>;
255
+ list(input?: WorkspacesListOptions): Promise<WorkspacesListResponse>;
228
256
  update(input: UpdateWorkspaceBody & {
229
257
  workspaceId: string;
230
- }): Promise<Workspace>;
258
+ } & ResourceRequestOptions): Promise<Workspace>;
231
259
  }
232
- export interface WorkspacesListOptions extends ResourceReadOptions {
260
+ export interface WorkspacesListOptions extends ResourceRequestOptions {
233
261
  cursor?: string;
234
262
  limit?: number;
235
263
  userId?: string;
236
264
  }
237
- export interface AgentVersionsListOptions extends ResourceReadOptions {
265
+ export interface AgentVersionsListOptions extends ResourceRequestOptions {
238
266
  cursor?: string;
239
267
  limit?: number;
240
268
  }
241
- export interface ArtifactsListOptions extends ResourceReadOptions {
269
+ export interface ArtifactsListOptions extends ResourceRequestOptions {
242
270
  agentId?: string;
243
271
  cursor?: string;
244
272
  sessionId?: string;
245
273
  }
246
274
  export interface ArtifactsResource {
247
- createDownloadUrl(artifactId: string): Promise<ArtifactDownloadUrlResponse>;
248
- delete(artifactId: string): Promise<void>;
249
- get(artifactId: string, options?: ResourceReadOptions): Promise<ArtifactListItem>;
250
- list(options?: ArtifactsListOptions): Promise<ArtifactsListResponse>;
275
+ createDownloadUrl(input: {
276
+ artifactId: string;
277
+ } & ResourceRequestOptions): Promise<ArtifactDownloadUrlResponse>;
278
+ delete(input: {
279
+ artifactId: string;
280
+ } & ResourceRequestOptions): Promise<void>;
281
+ get(input: {
282
+ artifactId: string;
283
+ } & ResourceRequestOptions): Promise<ArtifactListItem>;
284
+ list(input?: ArtifactsListOptions): Promise<ArtifactsListResponse>;
251
285
  }
252
286
  export interface MemoriesResource {
253
- create(agentId: string, body: CreateMemoryBody): Promise<MemoryResponse>;
254
- delete(agentId: string, memoryId: string): Promise<void>;
255
- get(agentId: string, memoryId: string, options?: ResourceReadOptions): Promise<MemoryResponse>;
256
- list(agentId: string, options?: MemoriesListOptions): Promise<MemoriesListResponse>;
257
- update(agentId: string, memoryId: string, body: UpdateMemoryBody): Promise<MemoryResponse>;
258
- }
259
- export interface MemoriesListOptions extends ResourceReadOptions {
287
+ create(input: CreateMemoryBody & {
288
+ agentId: string;
289
+ } & ResourceRequestOptions): Promise<MemoryResponse>;
290
+ delete(input: {
291
+ agentId: string;
292
+ memoryId: string;
293
+ } & ResourceRequestOptions): Promise<void>;
294
+ get(input: {
295
+ agentId: string;
296
+ memoryId: string;
297
+ } & ResourceRequestOptions): Promise<MemoryResponse>;
298
+ list(input: {
299
+ agentId: string;
300
+ } & MemoriesListOptions): Promise<MemoriesListResponse>;
301
+ update(input: UpdateMemoryBody & {
302
+ agentId: string;
303
+ memoryId: string;
304
+ } & ResourceRequestOptions): Promise<MemoryResponse>;
305
+ }
306
+ export interface MemoriesListOptions extends ResourceRequestOptions {
260
307
  cursor?: string;
261
308
  limit?: number;
262
309
  search?: string;
263
310
  userId?: string;
264
311
  }
265
312
  export interface PromptsResource {
266
- create(body: CreatePromptBody): Promise<PromptResponse>;
267
- delete(promptId: string): Promise<void>;
268
- get(promptId: string, options?: ResourceReadOptions): Promise<PromptResponse>;
269
- list(userId?: string, options?: ResourceReadOptions): Promise<PromptsResponse>;
270
- update(promptId: string, body: UpdatePromptBody): Promise<PromptResponse>;
313
+ create(input: CreatePromptBody & ResourceRequestOptions): Promise<PromptResponse>;
314
+ delete(input: {
315
+ promptId: string;
316
+ } & ResourceRequestOptions): Promise<void>;
317
+ get(input: {
318
+ promptId: string;
319
+ } & ResourceRequestOptions): Promise<PromptResponse>;
320
+ list(input?: {
321
+ userId?: string;
322
+ } & ResourceRequestOptions): Promise<PromptsResponse>;
323
+ update(input: UpdatePromptBody & {
324
+ promptId: string;
325
+ } & ResourceRequestOptions): Promise<PromptResponse>;
271
326
  }
272
327
  export interface ProvidersResource {
273
- create(body: CreateProviderBody): Promise<ProviderResponse>;
274
- delete(id: string, options?: DeleteProviderOptions): Promise<void>;
275
- get(id: string, options?: ResourceReadOptions): Promise<ProviderResponse>;
276
- getThinkingLevels(id: string, model: string, options?: ResourceReadOptions): Promise<ThinkingLevelsResponse>;
277
- list(options?: ResourceReadOptions): Promise<ProvidersResponse>;
278
- listModels(id: string, options?: ResourceReadOptions): Promise<ProviderModelsResponse>;
279
- update(id: string, body: UpdateProviderBody): Promise<ProviderResponse>;
328
+ create(input: CreateProviderBody & ResourceRequestOptions): Promise<ProviderResponse>;
329
+ delete(input: DeleteProviderOptions & {
330
+ providerId: string;
331
+ } & ResourceRequestOptions): Promise<void>;
332
+ get(input: {
333
+ providerId: string;
334
+ } & ResourceRequestOptions): Promise<ProviderResponse>;
335
+ getThinkingLevels(input: {
336
+ providerId: string;
337
+ model: string;
338
+ } & ResourceRequestOptions): Promise<ThinkingLevelsResponse>;
339
+ list(input?: ResourceRequestOptions): Promise<ProvidersResponse>;
340
+ listModels(input: {
341
+ providerId: string;
342
+ } & ResourceRequestOptions): Promise<ProviderModelsResponse>;
343
+ update(input: UpdateProviderBody & {
344
+ providerId: string;
345
+ } & ResourceRequestOptions): Promise<ProviderResponse>;
280
346
  }
281
347
  export interface McpConnectionsResource {
282
- connect(id: string): Promise<McpConnectionOauthConnectResponse>;
283
- create(body: CreateMcpConnectionBody): Promise<McpConnectionResponse>;
284
- delete(id: string): Promise<void>;
285
- get(id: string, options?: ResourceReadOptions): Promise<McpConnectionResponse>;
286
- list(options?: ResourceReadOptions): Promise<McpConnectionsResponse>;
287
- reconnect(id: string, body: ReconnectMcpConnectionBody): Promise<McpConnectionReconnectResult>;
288
- test(id: string): Promise<McpConnectionTestResponse>;
289
- update(id: string, body: UpdateMcpConnectionBody): Promise<McpConnectionResponse>;
290
- }
291
- export interface SessionsListOptions extends ResourceReadOptions {
348
+ connect(input: {
349
+ mcpConnectionId: string;
350
+ } & ResourceRequestOptions): Promise<McpConnectionOauthConnectResponse>;
351
+ create(input: CreateMcpConnectionBody & ResourceRequestOptions): Promise<McpConnectionResponse>;
352
+ delete(input: {
353
+ mcpConnectionId: string;
354
+ } & ResourceRequestOptions): Promise<void>;
355
+ get(input: {
356
+ mcpConnectionId: string;
357
+ } & ResourceRequestOptions): Promise<McpConnectionResponse>;
358
+ list(input?: ResourceRequestOptions): Promise<McpConnectionsResponse>;
359
+ reconnect(input: ReconnectMcpConnectionBody & {
360
+ mcpConnectionId: string;
361
+ } & ResourceRequestOptions): Promise<McpConnectionReconnectResult>;
362
+ test(input: {
363
+ mcpConnectionId: string;
364
+ } & ResourceRequestOptions): Promise<McpConnectionTestResponse>;
365
+ update(input: UpdateMcpConnectionBody & {
366
+ mcpConnectionId: string;
367
+ } & ResourceRequestOptions): Promise<McpConnectionResponse>;
368
+ }
369
+ export interface SessionsListOptions extends ResourceRequestOptions {
292
370
  cursor?: string;
293
371
  limit?: number;
294
372
  userId?: string;
295
373
  }
296
- export interface SessionMessagesOptions extends ResourceReadOptions {
374
+ export interface SessionMessagesOptions extends ResourceRequestOptions {
297
375
  after?: string;
298
376
  cursor?: string;
299
377
  limit?: number;
300
378
  }
301
379
  export interface SessionsResource {
302
- decideToolApproval(agentId: string, sessionId: string, approvalId: string, decision: DecideToolApprovalBody, options?: {
303
- signal?: AbortSignal;
304
- }): Promise<ToolApprovalDecisionResponse>;
305
- delete(agentId: string, sessionId: string, deleteArtifacts: boolean): Promise<void>;
306
- joinToolApprovalContinuation(agentId: string, sessionId: string, continuationId: string, options?: {
307
- signal?: AbortSignal;
308
- }): Promise<TerminalStreamResult>;
309
- list(agentId: string, options?: SessionsListOptions): Promise<SessionsListResponse>;
310
- messages(agentId: string, sessionId: string, options?: SessionMessagesOptions): Promise<SessionMessagesResponse>;
311
- toolApprovals(agentId: string, sessionId: string, options?: ResourceReadOptions): Promise<ToolApprovalsResponse>;
380
+ decideToolApproval(input: DecideToolApprovalBody & {
381
+ agentId: string;
382
+ sessionId: string;
383
+ approvalId: string;
384
+ } & ResourceRequestOptions): Promise<ToolApprovalDecisionResponse>;
385
+ delete(input: {
386
+ agentId: string;
387
+ sessionId: string;
388
+ deleteArtifacts: boolean;
389
+ } & ResourceRequestOptions): Promise<void>;
390
+ joinToolApprovalContinuation(input: {
391
+ agentId: string;
392
+ sessionId: string;
393
+ continuationId: string;
394
+ } & ResourceRequestOptions): Promise<TerminalStreamResult>;
395
+ list(input: {
396
+ agentId: string;
397
+ } & SessionsListOptions): Promise<SessionsListResponse>;
398
+ messages(input: {
399
+ agentId: string;
400
+ sessionId: string;
401
+ } & SessionMessagesOptions): Promise<SessionMessagesResponse>;
402
+ toolApprovals(input: {
403
+ agentId: string;
404
+ sessionId: string;
405
+ } & ResourceRequestOptions): Promise<ToolApprovalsResponse>;
312
406
  }
313
407
  export interface AgentSkillsResource {
314
408
  copy(input: {
@@ -316,72 +410,93 @@ export interface AgentSkillsResource {
316
410
  to: {
317
411
  agentIds: string[];
318
412
  };
319
- }): Promise<SkillCopyResults>;
320
- create(input: CreateSkillBody): Promise<SkillDetail>;
413
+ } & ResourceRequestOptions): Promise<SkillCopyResults>;
414
+ create(input: CreateSkillBody & ResourceRequestOptions): Promise<SkillDetail>;
321
415
  delete(input: {
322
416
  skillId: string;
323
- }): Promise<void>;
417
+ } & ResourceRequestOptions): Promise<void>;
324
418
  deleteFile(input: {
325
419
  path: string;
326
420
  skillId: string;
327
- }): Promise<SkillDetail>;
421
+ } & ResourceRequestOptions): Promise<SkillDetail>;
328
422
  get(input: {
329
423
  skillId: string;
330
- }, options?: ResourceReadOptions): Promise<SkillDetail>;
424
+ } & ResourceRequestOptions): Promise<SkillDetail>;
331
425
  getFile(input: {
332
426
  path: string;
333
427
  skillId: string;
334
- }, options?: ResourceReadOptions): Promise<Uint8Array>;
335
- list(options?: SkillsListOptions): Promise<SkillsListResponse>;
428
+ } & ResourceRequestOptions): Promise<Uint8Array>;
429
+ list(input?: SkillsListOptions): Promise<SkillsListResponse>;
336
430
  putFile(input: {
337
431
  content: Blob | string | Uint8Array;
338
432
  path: string;
339
433
  skillId: string;
340
- }): Promise<SkillDetail>;
434
+ } & ResourceRequestOptions): Promise<SkillDetail>;
341
435
  upload(input: {
342
436
  source: {
343
437
  file: Blob | Uint8Array;
344
438
  type: SkillArchiveType;
345
439
  };
346
- }): Promise<SkillDetail>;
440
+ } & ResourceRequestOptions): Promise<SkillDetail>;
347
441
  }
348
- export interface SkillsListOptions extends ResourceReadOptions {
442
+ export interface SkillsListOptions extends ResourceRequestOptions {
349
443
  cursor?: string;
350
444
  limit?: number;
351
445
  }
352
- export interface TasksListOptions extends ResourceReadOptions {
446
+ export interface TasksListOptions extends ResourceRequestOptions {
353
447
  agentId?: string;
354
448
  cursor?: string;
355
449
  limit?: number;
356
450
  userId?: string;
357
451
  }
358
- export interface TaskRunsListOptions extends ResourceReadOptions {
452
+ export interface TaskRunsListOptions extends ResourceRequestOptions {
359
453
  cursor?: string;
360
454
  limit?: number;
361
455
  }
362
- export interface TaskRunMessagesOptions extends ResourceReadOptions {
456
+ export interface TaskRunMessagesOptions extends ResourceRequestOptions {
363
457
  after?: string;
364
458
  cursor?: string;
365
459
  limit?: number;
366
460
  }
367
461
  export interface TasksResource {
368
- cancelRun(taskId: string, runId: string): Promise<void>;
369
- create(body: CreateTaskBody): Promise<CreateTaskResponse>;
370
- createRun(taskId: string, body?: CreateTaskRunBody): Promise<CreateTaskRunResponse>;
371
- delete(taskId: string): Promise<void>;
372
- get(taskId: string, options?: ResourceReadOptions): Promise<TaskResponse>;
373
- getRun(taskId: string, runId: string, options?: ResourceReadOptions): Promise<TaskRunResponse>;
374
- list(options?: TasksListOptions): Promise<TasksListResponse>;
375
- listRuns(taskId: string, options?: TaskRunsListOptions): Promise<TaskRunsListResponse>;
376
- runMessages(taskId: string, runId: string, options?: TaskRunMessagesOptions): Promise<TaskRunMessagesResponse>;
377
- update(taskId: string, body: UpdateTaskBody): Promise<TaskResponse>;
462
+ cancelRun(input: {
463
+ taskId: string;
464
+ runId: string;
465
+ } & ResourceRequestOptions): Promise<void>;
466
+ create(input: CreateTaskBody & ResourceRequestOptions): Promise<CreateTaskResponse>;
467
+ createRun(input: CreateTaskRunBody & {
468
+ taskId: string;
469
+ } & ResourceRequestOptions): Promise<CreateTaskRunResponse>;
470
+ delete(input: {
471
+ taskId: string;
472
+ } & ResourceRequestOptions): Promise<void>;
473
+ get(input: {
474
+ taskId: string;
475
+ } & ResourceRequestOptions): Promise<TaskResponse>;
476
+ getRun(input: {
477
+ taskId: string;
478
+ runId: string;
479
+ } & ResourceRequestOptions): Promise<TaskRunResponse>;
480
+ list(input?: TasksListOptions): Promise<TasksListResponse>;
481
+ listRuns(input: {
482
+ taskId: string;
483
+ } & TaskRunsListOptions): Promise<TaskRunsListResponse>;
484
+ runMessages(input: {
485
+ taskId: string;
486
+ runId: string;
487
+ } & TaskRunMessagesOptions): Promise<TaskRunMessagesResponse>;
488
+ update(input: UpdateTaskBody & {
489
+ taskId: string;
490
+ } & ResourceRequestOptions): Promise<TaskResponse>;
378
491
  }
379
492
  export interface TenantResource {
380
- get(options?: ResourceReadOptions): Promise<TenantSettingsResponse>;
381
- patch(body: UpdateTenantSettingsBody): Promise<TenantSettingsResponse>;
493
+ get(input?: ResourceRequestOptions): Promise<TenantSettingsResponse>;
494
+ patch(input: UpdateTenantSettingsBody & ResourceRequestOptions): Promise<TenantSettingsResponse>;
382
495
  }
383
496
  export interface UsageResource {
384
- get(query?: Partial<UsageQuery> & ResourceReadOptions): Promise<UsageResponse>;
385
- getForAgent(agentId: string, query?: Partial<UsageQuery> & ResourceReadOptions): Promise<UsageResponse>;
497
+ get(input?: Partial<UsageQuery> & ResourceRequestOptions): Promise<UsageResponse>;
498
+ getForAgent(input: Partial<UsageQuery> & {
499
+ agentId: string;
500
+ } & ResourceRequestOptions): Promise<UsageResponse>;
386
501
  }
387
502
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "TypeScript SDK for the Blazing Agents API",
5
5
  "homepage": "https://docs.blazingagents.com",
6
6
  "bugs": {