@blazingagents/sdk 0.2.1 → 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.
Files changed (55) hide show
  1. package/README.md +115 -344
  2. package/dist/client.d.ts +3 -1
  3. package/dist/client.js +1 -1
  4. package/dist/contracts/api.d.ts +1 -1
  5. package/dist/contracts/api.js +1 -1
  6. package/dist/contracts/entities/agents.d.ts +14 -7
  7. package/dist/contracts/entities/agents.js +7 -3
  8. package/dist/contracts/entities/artifacts.d.ts +9 -9
  9. package/dist/contracts/entities/artifacts.js +5 -5
  10. package/dist/contracts/entities/chat.d.ts +7 -7
  11. package/dist/contracts/entities/chat.js +5 -5
  12. package/dist/contracts/entities/mcp-connections.d.ts +18 -18
  13. package/dist/contracts/entities/mcp-connections.js +13 -13
  14. package/dist/contracts/entities/memories.d.ts +5 -5
  15. package/dist/contracts/entities/memories.js +2 -2
  16. package/dist/contracts/entities/prompts.d.ts +4 -4
  17. package/dist/contracts/entities/prompts.js +2 -2
  18. package/dist/contracts/entities/providers.d.ts +12 -7
  19. package/dist/contracts/entities/providers.js +12 -6
  20. package/dist/contracts/entities/sessions.d.ts +10 -10
  21. package/dist/contracts/entities/sessions.js +6 -6
  22. package/dist/contracts/entities/skills.d.ts +18 -18
  23. package/dist/contracts/entities/skills.js +6 -6
  24. package/dist/contracts/entities/tasks.d.ts +56 -46
  25. package/dist/contracts/entities/tasks.js +25 -16
  26. package/dist/contracts/entities/tenants.d.ts +6 -6
  27. package/dist/contracts/entities/tenants.js +4 -4
  28. package/dist/contracts/entities/usage.d.ts +5 -5
  29. package/dist/contracts/entities/usage.js +3 -3
  30. package/dist/contracts/entities/workspaces.d.ts +9 -9
  31. package/dist/contracts/entities/workspaces.js +7 -2
  32. package/dist/contracts/index.d.ts +1 -1
  33. package/dist/contracts/index.js +1 -1
  34. package/dist/direct-chat-transport.d.ts +16 -0
  35. package/dist/direct-chat-transport.js +49 -0
  36. package/dist/generation.js +4 -3
  37. package/dist/http.d.ts +2 -0
  38. package/dist/http.js +2 -2
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.js +1 -0
  41. package/dist/relay.js +2 -2
  42. package/dist/resources/agents.js +37 -22
  43. package/dist/resources/artifacts.js +8 -6
  44. package/dist/resources/mcp-connections.js +19 -15
  45. package/dist/resources/memories.js +10 -9
  46. package/dist/resources/prompts.js +10 -6
  47. package/dist/resources/providers.js +18 -12
  48. package/dist/resources/sessions.js +12 -10
  49. package/dist/resources/skills.js +33 -21
  50. package/dist/resources/tasks.js +22 -14
  51. package/dist/resources/tenant.js +4 -3
  52. package/dist/resources/usage.js +4 -3
  53. package/dist/resources/workspaces.js +10 -8
  54. package/dist/types.d.ts +225 -104
  55. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ import type { BlazingAgentsChatMessageMetadata } from "./contracts/entities/chat
6
6
  import type { CreateMcpConnectionBody, McpAttachmentResponse, McpAttachmentsResponse, McpConnectionOauthConnectResponse, McpConnectionReconnectResult, McpConnectionResponse, McpConnectionsResponse, McpConnectionTestResponse, ReconnectMcpConnectionBody, UpdateMcpAttachmentBody, UpdateMcpConnectionBody } from "./contracts/entities/mcp-connections.ts";
7
7
  import type { CreateMemoryBody, MemoriesListResponse, MemoryResponse, UpdateMemoryBody } from "./contracts/entities/memories.ts";
8
8
  import type { CreatePromptBody, PromptResponse, PromptsResponse, UpdatePromptBody } from "./contracts/entities/prompts.ts";
9
- import type { CreateProviderBody, DeleteProviderOptions, ProviderModelsResponse, ProviderResponse, ProvidersResponse, UpdateProviderBody } from "./contracts/entities/providers.ts";
9
+ import type { CreateProviderBody, DeleteProviderOptions, ProviderModelsResponse, ProviderResponse, ProvidersResponse, ThinkingLevelsResponse, UpdateProviderBody } from "./contracts/entities/providers.ts";
10
10
  import type { DecideToolApprovalBody, SessionMessagesResponse, SessionsListResponse, ToolApprovalDecisionResponse, ToolApprovalsResponse } from "./contracts/entities/sessions.ts";
11
11
  import type { CreateSkillBody, SkillArchiveType, SkillCopyResults, SkillDetail, SkillsListResponse } from "./contracts/entities/skills.ts";
12
12
  import type { CreateTaskBody, CreateTaskResponse, CreateTaskRunBody, CreateTaskRunResponse, TaskResponse, TaskRunMessagesResponse, TaskRunResponse, TaskRunsListResponse, TasksListResponse, UpdateTaskBody } from "./contracts/entities/tasks.ts";
@@ -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;
@@ -127,28 +127,32 @@ export interface ChatResult {
127
127
  */
128
128
  sessionId: Promise<string>;
129
129
  toResponse: () => Response;
130
+ /** Claims the SSE bytes once, without constructing a Response. Shares ownership with toResponse(). */
131
+ toStream: () => ReadableStream<Uint8Array>;
130
132
  }
131
133
  export interface TerminalStreamResult {
132
134
  requestId?: string;
133
135
  toResponse: () => Response;
136
+ /** Claims the SSE bytes once, without constructing a Response. Shares ownership with toResponse(). */
137
+ toStream: () => ReadableStream<Uint8Array>;
134
138
  }
135
139
  interface StatelessGenerationInput extends AttributionInput, CorrelatedRequestInput {
136
140
  version?: number;
137
141
  }
138
142
  export interface CompletionPromptInput extends StatelessGenerationInput {
143
+ abortSignal?: AbortSignal;
139
144
  agentId: string;
140
145
  prompt: string;
141
146
  promptId?: never;
142
147
  schema?: never;
143
- signal?: AbortSignal;
144
148
  variables?: never;
145
149
  }
146
150
  export interface CompletionPromptIdInput extends StatelessGenerationInput {
151
+ abortSignal?: AbortSignal;
147
152
  agentId: string;
148
153
  prompt?: never;
149
154
  promptId: string;
150
155
  schema?: never;
151
- signal?: AbortSignal;
152
156
  variables?: Record<string, string>;
153
157
  }
154
158
  export type CompletionInput = CompletionPromptInput | CompletionPromptIdInput;
@@ -159,19 +163,19 @@ export interface CompletionResult {
159
163
  toResponse: () => Response;
160
164
  }
161
165
  export interface ObjectPromptInput extends StatelessGenerationInput {
166
+ abortSignal?: AbortSignal;
162
167
  agentId: string;
163
168
  prompt: string;
164
169
  promptId?: never;
165
170
  schema: Record<string, unknown>;
166
- signal?: AbortSignal;
167
171
  variables?: never;
168
172
  }
169
173
  export interface ObjectPromptIdInput extends StatelessGenerationInput {
174
+ abortSignal?: AbortSignal;
170
175
  agentId: string;
171
176
  prompt?: never;
172
177
  promptId: string;
173
178
  schema: Record<string, unknown>;
174
- signal?: AbortSignal;
175
179
  variables?: Record<string, string>;
176
180
  }
177
181
  export type ObjectInput = ObjectPromptInput | ObjectPromptIdInput;
@@ -181,128 +185,224 @@ export interface ObjectResult {
181
185
  requestId?: string;
182
186
  toResponse: () => Response;
183
187
  }
188
+ export interface ResourceRequestOptions {
189
+ abortSignal?: AbortSignal;
190
+ }
184
191
  export interface AgentsResource {
185
192
  /** Omitting `workspaceId` attaches a default Workspace with a lazy runtime. */
186
- create(body: CreateAgentBody): Promise<Agent>;
193
+ create(input: CreateAgentBody & ResourceRequestOptions): Promise<Agent>;
187
194
  /** Deletes the Agent while preserving its attached Workspace. */
188
- delete(agentId: string, includeArtifacts: boolean): Promise<void>;
189
- disable(agentId: string): Promise<Agent>;
190
- enable(agentId: string): Promise<Agent>;
191
- get(agentId: string): Promise<Agent>;
192
- getVersion(agentId: string, version: number): Promise<AgentVersion>;
193
- list(options?: AgentsListOptions): Promise<AgentsResponse>;
194
- listMcpAttachments(agentId: string): Promise<McpAttachmentsResponse>;
195
- listVersions(agentId: string, options?: AgentVersionsListOptions): Promise<AgentVersionsResponse>;
196
- removeAvatar(agentId: string): Promise<Agent>;
197
- /**
198
- * Copies an immutable Version's configuration into the Agent through the
199
- * ordinary update path, creating a new latest Version without rewriting history.
200
- */
201
- 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>;
202
227
  /** A concrete `workspaceId` switches the Agent; detachment is unsupported. */
203
- update(agentId: string, body: UpdateAgentBody): Promise<Agent>;
204
- updateMcpAttachment(agentId: string, mcpConnectionId: string, body: UpdateMcpAttachmentBody): Promise<McpAttachmentResponse>;
205
- 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>;
206
239
  }
207
240
  export interface AgentClient {
208
241
  readonly skills: AgentSkillsResource;
209
242
  }
210
- export interface AgentsListOptions {
243
+ export interface AgentsListOptions extends ResourceRequestOptions {
211
244
  userId?: string;
212
245
  workspaceId?: string;
213
246
  }
214
247
  export interface WorkspacesResource {
215
- create(body?: CreateWorkspaceBody): Promise<Workspace>;
248
+ create(input?: CreateWorkspaceBody & ResourceRequestOptions): Promise<Workspace>;
216
249
  delete(input: {
217
250
  workspaceId: string;
218
- }): Promise<"completed" | "pending">;
251
+ } & ResourceRequestOptions): Promise<"completed" | "pending">;
219
252
  get(input: {
220
253
  workspaceId: string;
221
- }): Promise<Workspace>;
222
- list(options?: WorkspacesListOptions): Promise<WorkspacesListResponse>;
254
+ } & ResourceRequestOptions): Promise<Workspace>;
255
+ list(input?: WorkspacesListOptions): Promise<WorkspacesListResponse>;
223
256
  update(input: UpdateWorkspaceBody & {
224
257
  workspaceId: string;
225
- }): Promise<Workspace>;
258
+ } & ResourceRequestOptions): Promise<Workspace>;
226
259
  }
227
- export interface WorkspacesListOptions {
260
+ export interface WorkspacesListOptions extends ResourceRequestOptions {
228
261
  cursor?: string;
229
262
  limit?: number;
230
263
  userId?: string;
231
264
  }
232
- export interface AgentVersionsListOptions {
265
+ export interface AgentVersionsListOptions extends ResourceRequestOptions {
233
266
  cursor?: string;
234
267
  limit?: number;
235
268
  }
236
- export interface ArtifactsListOptions {
269
+ export interface ArtifactsListOptions extends ResourceRequestOptions {
237
270
  agentId?: string;
238
271
  cursor?: string;
239
272
  sessionId?: string;
240
273
  }
241
274
  export interface ArtifactsResource {
242
- createDownloadUrl(artifactId: string): Promise<ArtifactDownloadUrlResponse>;
243
- delete(artifactId: string): Promise<void>;
244
- get(artifactId: string): Promise<ArtifactListItem>;
245
- 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>;
246
285
  }
247
286
  export interface MemoriesResource {
248
- create(agentId: string, body: CreateMemoryBody): Promise<MemoryResponse>;
249
- delete(agentId: string, memoryId: string): Promise<void>;
250
- get(agentId: string, memoryId: string): Promise<MemoryResponse>;
251
- list(agentId: string, options?: MemoriesListOptions): Promise<MemoriesListResponse>;
252
- update(agentId: string, memoryId: string, body: UpdateMemoryBody): Promise<MemoryResponse>;
253
- }
254
- export interface MemoriesListOptions {
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 {
255
307
  cursor?: string;
256
308
  limit?: number;
257
309
  search?: string;
258
310
  userId?: string;
259
311
  }
260
312
  export interface PromptsResource {
261
- create(body: CreatePromptBody): Promise<PromptResponse>;
262
- delete(promptId: string): Promise<void>;
263
- get(promptId: string): Promise<PromptResponse>;
264
- list(userId?: string): Promise<PromptsResponse>;
265
- 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>;
266
326
  }
267
327
  export interface ProvidersResource {
268
- create(body: CreateProviderBody): Promise<ProviderResponse>;
269
- delete(id: string, options?: DeleteProviderOptions): Promise<void>;
270
- get(id: string): Promise<ProviderResponse>;
271
- list(): Promise<ProvidersResponse>;
272
- listModels(id: string): Promise<ProviderModelsResponse>;
273
- 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>;
274
346
  }
275
347
  export interface McpConnectionsResource {
276
- connect(id: string): Promise<McpConnectionOauthConnectResponse>;
277
- create(body: CreateMcpConnectionBody): Promise<McpConnectionResponse>;
278
- delete(id: string): Promise<void>;
279
- get(id: string): Promise<McpConnectionResponse>;
280
- list(): Promise<McpConnectionsResponse>;
281
- reconnect(id: string, body: ReconnectMcpConnectionBody): Promise<McpConnectionReconnectResult>;
282
- test(id: string): Promise<McpConnectionTestResponse>;
283
- update(id: string, body: UpdateMcpConnectionBody): Promise<McpConnectionResponse>;
284
- }
285
- export interface SessionsListOptions {
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 {
286
370
  cursor?: string;
287
371
  limit?: number;
288
372
  userId?: string;
289
373
  }
290
- export interface SessionMessagesOptions {
374
+ export interface SessionMessagesOptions extends ResourceRequestOptions {
291
375
  after?: string;
292
376
  cursor?: string;
293
377
  limit?: number;
294
378
  }
295
379
  export interface SessionsResource {
296
- decideToolApproval(agentId: string, sessionId: string, approvalId: string, decision: DecideToolApprovalBody, options?: {
297
- signal?: AbortSignal;
298
- }): Promise<ToolApprovalDecisionResponse>;
299
- delete(agentId: string, sessionId: string, deleteArtifacts: boolean): Promise<void>;
300
- joinToolApprovalContinuation(agentId: string, sessionId: string, continuationId: string, options?: {
301
- signal?: AbortSignal;
302
- }): Promise<TerminalStreamResult>;
303
- list(agentId: string, options?: SessionsListOptions): Promise<SessionsListResponse>;
304
- messages(agentId: string, sessionId: string, options?: SessionMessagesOptions): Promise<SessionMessagesResponse>;
305
- toolApprovals(agentId: string, sessionId: string): 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>;
306
406
  }
307
407
  export interface AgentSkillsResource {
308
408
  copy(input: {
@@ -310,72 +410,93 @@ export interface AgentSkillsResource {
310
410
  to: {
311
411
  agentIds: string[];
312
412
  };
313
- }): Promise<SkillCopyResults>;
314
- create(input: CreateSkillBody): Promise<SkillDetail>;
413
+ } & ResourceRequestOptions): Promise<SkillCopyResults>;
414
+ create(input: CreateSkillBody & ResourceRequestOptions): Promise<SkillDetail>;
315
415
  delete(input: {
316
416
  skillId: string;
317
- }): Promise<void>;
417
+ } & ResourceRequestOptions): Promise<void>;
318
418
  deleteFile(input: {
319
419
  path: string;
320
420
  skillId: string;
321
- }): Promise<SkillDetail>;
421
+ } & ResourceRequestOptions): Promise<SkillDetail>;
322
422
  get(input: {
323
423
  skillId: string;
324
- }): Promise<SkillDetail>;
424
+ } & ResourceRequestOptions): Promise<SkillDetail>;
325
425
  getFile(input: {
326
426
  path: string;
327
427
  skillId: string;
328
- }): Promise<Uint8Array>;
329
- list(options?: SkillsListOptions): Promise<SkillsListResponse>;
428
+ } & ResourceRequestOptions): Promise<Uint8Array>;
429
+ list(input?: SkillsListOptions): Promise<SkillsListResponse>;
330
430
  putFile(input: {
331
431
  content: Blob | string | Uint8Array;
332
432
  path: string;
333
433
  skillId: string;
334
- }): Promise<SkillDetail>;
434
+ } & ResourceRequestOptions): Promise<SkillDetail>;
335
435
  upload(input: {
336
436
  source: {
337
437
  file: Blob | Uint8Array;
338
438
  type: SkillArchiveType;
339
439
  };
340
- }): Promise<SkillDetail>;
440
+ } & ResourceRequestOptions): Promise<SkillDetail>;
341
441
  }
342
- export interface SkillsListOptions {
442
+ export interface SkillsListOptions extends ResourceRequestOptions {
343
443
  cursor?: string;
344
444
  limit?: number;
345
445
  }
346
- export interface TasksListOptions {
446
+ export interface TasksListOptions extends ResourceRequestOptions {
347
447
  agentId?: string;
348
448
  cursor?: string;
349
449
  limit?: number;
350
450
  userId?: string;
351
451
  }
352
- export interface TaskRunsListOptions {
452
+ export interface TaskRunsListOptions extends ResourceRequestOptions {
353
453
  cursor?: string;
354
454
  limit?: number;
355
455
  }
356
- export interface TaskRunMessagesOptions {
456
+ export interface TaskRunMessagesOptions extends ResourceRequestOptions {
357
457
  after?: string;
358
458
  cursor?: string;
359
459
  limit?: number;
360
460
  }
361
461
  export interface TasksResource {
362
- cancelRun(taskId: string, runId: string): Promise<void>;
363
- create(body: CreateTaskBody): Promise<CreateTaskResponse>;
364
- createRun(taskId: string, body?: CreateTaskRunBody): Promise<CreateTaskRunResponse>;
365
- delete(taskId: string): Promise<void>;
366
- get(taskId: string): Promise<TaskResponse>;
367
- getRun(taskId: string, runId: string): Promise<TaskRunResponse>;
368
- list(options?: TasksListOptions): Promise<TasksListResponse>;
369
- listRuns(taskId: string, options?: TaskRunsListOptions): Promise<TaskRunsListResponse>;
370
- runMessages(taskId: string, runId: string, options?: TaskRunMessagesOptions): Promise<TaskRunMessagesResponse>;
371
- 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>;
372
491
  }
373
492
  export interface TenantResource {
374
- get(): Promise<TenantSettingsResponse>;
375
- patch(body: UpdateTenantSettingsBody): Promise<TenantSettingsResponse>;
493
+ get(input?: ResourceRequestOptions): Promise<TenantSettingsResponse>;
494
+ patch(input: UpdateTenantSettingsBody & ResourceRequestOptions): Promise<TenantSettingsResponse>;
376
495
  }
377
496
  export interface UsageResource {
378
- get(query?: Partial<UsageQuery>): Promise<UsageResponse>;
379
- getForAgent(agentId: string, query?: Partial<UsageQuery>): Promise<UsageResponse>;
497
+ get(input?: Partial<UsageQuery> & ResourceRequestOptions): Promise<UsageResponse>;
498
+ getForAgent(input: Partial<UsageQuery> & {
499
+ agentId: string;
500
+ } & ResourceRequestOptions): Promise<UsageResponse>;
380
501
  }
381
502
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazingagents/sdk",
3
- "version": "0.2.1",
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": {
@@ -35,7 +35,7 @@
35
35
  "lint": "ultracite check",
36
36
  "prepack": "npm run build",
37
37
  "test": "vitest run --coverage",
38
- "test:consumer": "npm run build && vitest run -c vitest.consumer.config.mts",
38
+ "test:consumer": "npm run build && tsc -p tsconfig.consumer.json && vitest run -c vitest.consumer.config.mts",
39
39
  "typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.tests.json"
40
40
  },
41
41
  "dependencies": {