@blazingagents/sdk 0.2.0 → 0.2.2

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 (52) hide show
  1. package/README.md +99 -344
  2. package/dist/contracts/api.d.ts +1 -1
  3. package/dist/contracts/api.js +1 -1
  4. package/dist/contracts/entities/agents.d.ts +14 -7
  5. package/dist/contracts/entities/agents.js +7 -3
  6. package/dist/contracts/entities/artifacts.d.ts +9 -9
  7. package/dist/contracts/entities/artifacts.js +5 -5
  8. package/dist/contracts/entities/chat.d.ts +7 -7
  9. package/dist/contracts/entities/chat.js +5 -5
  10. package/dist/contracts/entities/mcp-connections.d.ts +18 -18
  11. package/dist/contracts/entities/mcp-connections.js +13 -13
  12. package/dist/contracts/entities/memories.d.ts +5 -5
  13. package/dist/contracts/entities/memories.js +2 -2
  14. package/dist/contracts/entities/prompts.d.ts +4 -4
  15. package/dist/contracts/entities/prompts.js +2 -2
  16. package/dist/contracts/entities/providers.d.ts +12 -7
  17. package/dist/contracts/entities/providers.js +12 -6
  18. package/dist/contracts/entities/sessions.d.ts +10 -10
  19. package/dist/contracts/entities/sessions.js +6 -6
  20. package/dist/contracts/entities/skills.d.ts +18 -18
  21. package/dist/contracts/entities/skills.js +6 -6
  22. package/dist/contracts/entities/tasks.d.ts +56 -46
  23. package/dist/contracts/entities/tasks.js +25 -16
  24. package/dist/contracts/entities/tenants.d.ts +6 -6
  25. package/dist/contracts/entities/tenants.js +4 -4
  26. package/dist/contracts/entities/usage.d.ts +5 -5
  27. package/dist/contracts/entities/usage.js +3 -3
  28. package/dist/contracts/entities/workspaces.d.ts +9 -9
  29. package/dist/contracts/entities/workspaces.js +7 -2
  30. package/dist/contracts/index.d.ts +6 -4
  31. package/dist/contracts/index.js +4 -4
  32. package/dist/direct-chat-transport.d.ts +16 -0
  33. package/dist/direct-chat-transport.js +49 -0
  34. package/dist/generation.js +1 -0
  35. package/dist/http.d.ts +2 -0
  36. package/dist/http.js +2 -2
  37. package/dist/index.d.ts +3 -2
  38. package/dist/index.js +1 -0
  39. package/dist/resources/agents.js +11 -6
  40. package/dist/resources/artifacts.js +3 -2
  41. package/dist/resources/mcp-connections.js +4 -4
  42. package/dist/resources/memories.js +3 -2
  43. package/dist/resources/prompts.js +4 -3
  44. package/dist/resources/providers.js +10 -7
  45. package/dist/resources/sessions.js +4 -2
  46. package/dist/resources/skills.js +18 -10
  47. package/dist/resources/tasks.js +10 -5
  48. package/dist/resources/tenant.js +2 -2
  49. package/dist/resources/usage.js +4 -3
  50. package/dist/resources/workspaces.js +3 -2
  51. package/dist/types.d.ts +39 -33
  52. package/package.json +2 -2
package/README.md CHANGED
@@ -1,383 +1,138 @@
1
- # `@blazingagents/sdk`
2
-
3
- The resource-style client SDK for the Blazing Agents `/v1` API.
4
-
5
- ## Overview
6
-
7
- The SDK wraps the Blazing Agents REST API with a thin, typed client in the
8
- stripe/openai-node shape. It provides:
9
-
10
- - **Resource namespaces** for management CRUD (`agents`, `workspaces`,
11
- `prompts`, `providers`, `tasks`, `sessions`, `artifacts`, `tenant`, `usage`),
12
- plus Agent-scoped Skills through `client.agent(agentId).skills`.
13
- - **Generation methods** with a raw `useChat` SSE relay and AI SDK–shaped
14
- completion/object results.
15
- - **A single error class** (`BlazingAgentsError`) with known-code completion
16
- and forward-compatible server codes.
17
-
18
- `ai` is a peer dependency (`^7`). The SDK re-exports `UIMessage` from `ai` —
19
- it never redeclares it.
20
-
21
- ## Runtime contracts
22
-
23
- Import the public Zod schemas from the explicit contracts entry point:
24
-
25
- ```ts
26
- import {
27
- agentIdSchema,
28
- createAgentBodySchema,
29
- } from "@blazingagents/sdk/contracts";
30
-
31
- const agentId = agentIdSchema.parse("ag_0123456789abcdef");
32
- const input = createAgentBodySchema.parse({ name: "Support agent" });
1
+ <div align="center">
2
+ <a href="https://docs.blazingagents.com">
3
+ <img src="https://raw.githubusercontent.com/blazingagents/docs/main/public/brand/icon.svg" alt="Blazing Agents logo" width="96">
4
+ </a>
5
+ <h1>Blazing Agents TypeScript SDK</h1>
6
+ <p>Build production agents with a typed TypeScript client for the Blazing Agents API.</p>
7
+ <p>
8
+ <a href="https://docs.blazingagents.com/sdk/typescript">Documentation</a> ·
9
+ <a href="https://www.npmjs.com/package/@blazingagents/sdk">npm</a>
10
+ </p>
11
+ </div>
12
+
13
+ The official resource-style client SDK for the Blazing Agents `/v1` API. It
14
+ requires Node.js 24 or newer.
15
+
16
+ ## Features
17
+
18
+ - Typed clients for Agents, Workspaces, Skills, Providers, Prompts, Tasks,
19
+ Sessions, Artifacts, usage, and Tenant settings.
20
+ - Stateful chat and stateless text or structured-object generation.
21
+ - Public Zod contracts for validating API requests and responses.
22
+ - Cursor pagination and binary transfers.
23
+ - Request correlation and a typed, forward-compatible error model.
24
+
25
+ ## Installation
26
+
27
+ ```console
28
+ npm install @blazingagents/sdk ai@7.0.84
33
29
  ```
34
30
 
35
- The contracts entry point contains public HTTP request and response schemas.
36
- Platform-only persistence and service contracts are not part of the SDK.
31
+ `ai` is a peer dependency. The SDK re-exports its `UIMessage` type.
37
32
 
38
33
  ## Quick start
39
34
 
40
- ```ts
41
- import { BlazingAgents } from "@blazingagents/sdk";
42
-
43
- const client = new BlazingAgents({
44
- apiKey: "ba_your_api_key",
45
- // baseUrl defaults to https://api.blazingagents.com.
46
- onResponse(response) {
47
- // Store response.requestId with your logs for support correlation.
48
- console.log(response.requestId, response.status);
49
- },
50
- });
51
-
52
- // --- Management ---
53
-
54
- // Agents
55
- const agent = await client.agents.create({
56
- name: "My Agent",
57
- model: "openrouter/auto",
58
- instructions: "Be helpful.",
59
- tools: ["write_todos"],
60
- });
61
- // Every Agent receives a Workspace. Its runtime stays lazy until first use.
62
- const defaultWorkspace = await client.workspaces.get({
63
- workspaceId: agent.workspaceId,
64
- });
65
-
66
- const list = await client.agents.list();
67
- const fetched = await client.agents.get(agent.id);
68
- const updated = await client.agents.update(agent.id, { name: "Renamed" });
69
-
70
- // Pass an existing Workspace to share it, or switch to one later.
71
- const sharedWorkspace = await client.workspaces.create({ name: "Team files" });
72
- const teammate = await client.agents.create({
73
- name: "Teammate",
74
- model: "openrouter/auto",
75
- workspaceId: sharedWorkspace.id,
76
- });
77
- await client.agents.update(agent.id, { workspaceId: sharedWorkspace.id });
78
-
79
- // Agent-owned Skills
80
- const skills = client.agent(teammate.id).skills;
81
- const skill = await skills.create({
82
- path: "SKILL.md",
83
- content: "---\nname: release-notes\ndescription: Draft release notes.\n---\n",
84
- });
85
- await skills.putFile({
86
- skillId: skill.id,
87
- path: "references/style.md",
88
- content: "Use sentence case.",
89
- });
90
-
91
- // Deleting an Agent preserves its Workspace for explicit cleanup or reuse.
92
- await client.agents.delete(agent.id, false);
93
- await client.workspaces.get({ workspaceId: sharedWorkspace.id });
94
-
95
- // Prompts
96
- const prompt = await client.prompts.create({
97
- name: "Greeting",
98
- template: "Hello {{name}}!",
99
- });
100
- const promptList = await client.prompts.list();
101
-
102
- // Providers
103
- const provider = await client.providers.create({
104
- name: "My OpenRouter",
105
- providerType: "openrouter",
106
- apiKey: "sk-or-...",
107
- });
108
-
109
- // Tenant settings
110
- const settings = await client.tenant.get();
111
- await client.tenant.patch({
112
- quota: { monthlyTokenLimit: 100_000, monthlyRequestLimit: null, resetDay: 1 },
113
- });
114
-
115
- // Usage
116
- const usage = await client.usage.get({ groupBy: "agent" });
117
- const agentUsage = await client.usage.getForAgent(agent.id);
118
-
119
- // Tasks
120
- const task = await client.tasks.create({
121
- agentId: agent.id,
122
- name: "Daily Report",
123
- prompt: "Generate the daily report",
124
- });
125
- const run = await client.tasks.createRun(task.task.id);
126
-
127
- // Persist task.task.id and run.runId, then return to the caller.
128
-
129
- // In a later request, scheduled job, or worker invocation:
130
- const outcome = await client.tasks.getRun(task.task.id, run.runId);
131
- if (outcome.status !== "queued" && outcome.status !== "running") {
132
- const transcript = await client.tasks.runMessages(task.task.id, run.runId);
133
- }
134
-
135
- // Sessions
136
- const sessions = await client.sessions.list(agent.id);
137
- const messages = await client.sessions.messages(agent.id, sessionId);
138
-
139
- // Artifacts
140
- const artifacts = await client.artifacts.list({ agentId: agent.id });
141
- const artifact = artifacts.data[0];
142
- if (artifact) {
143
- const { url } = await client.artifacts.createDownloadUrl(artifact.artifactId);
144
- const bytes = await (await fetch(url)).arrayBuffer();
145
- }
146
- ```
147
-
148
- Generation request inputs accept `clientRequestId` for caller-owned
149
- correlation without raw headers. For any resource or generation request, use
150
- `client.withOptions({ clientRequestId })` to create a scoped client view. The
151
- callback receives the method, path
152
- without query, status, duration, server `requestId`, and the same optional
153
- `clientRequestId` once for every received response, including errors and
154
- streaming handshakes. Callback failures are ignored and transport failures
155
- with no response do not invoke it. The server-owned `requestId` identifies one
156
- HTTP attempt and should be retained when contacting support.
157
- Successful generated message metadata separately exposes `usage.turnId` for
158
- the admitted, metered Turn. It is not the HTTP `requestId` or message ID.
159
-
160
- ## Generation methods
161
-
162
- ### `client.chat(input)` — stateful UI message stream
163
-
164
- The server mints the `ss_` session id. Start a new chat with a single
165
- `client.chat({ agentId, message })` call — no `sessionId`, no `mode` —
166
- and read the minted id from `await result.sessionId` (resolved from the
167
- create response's `Location` header):
35
+ Create a Tenant API key in the Blazing Agents dashboard, then pass it to the
36
+ client or read it from your server environment.
168
37
 
169
38
  ```ts
170
- // Create — the server mints the ss_ id and returns it via Location.
171
- const created = await client.chat({
172
- agentId: agent.id,
173
- message: {
174
- id: "msg_user_1",
175
- role: "user",
176
- parts: [{ type: "text", text: "Hello!" }],
177
- },
178
- });
179
- const sessionId = await created.sessionId;
180
- return created.toResponse();
181
- ```
182
-
183
- `toResponse()` exposes the server's AI SDK UI-message SSE response unchanged
184
- for relay to the browser. It is one-shot; a repeated call throws a
185
- `BlazingAgentsError` with `code: "stream_error"`. `result.sessionId` remains
186
- independently awaitable before or after selecting the response.
187
-
188
- After `useChat` successfully consumes that response, pass the same `sessionId`
189
- on a later request to continue the chat:
190
-
191
- ```ts
192
- const result = await client.chat({
193
- agentId: agent.id,
194
- sessionId,
195
- message: {
196
- id: "msg_user_2",
197
- role: "user",
198
- parts: [{ type: "text", text: "Follow up" }],
199
- },
200
- });
201
-
202
- return result.toResponse();
203
- ```
204
-
205
- `trigger: "regenerate-message"` is valid only when `sessionId` is present.
206
- `messageId` remains optional when regenerating an existing Session.
207
-
208
- Prompt-invocation variant (server resolves + renders the template):
209
-
210
- ```ts
211
- const result = await client.chat({
212
- agentId: agent.id,
213
- promptId: "prompt_...",
214
- variables: { name: "Alice" },
215
- });
216
- ```
217
-
218
- ### `client.completion(input)` — stateless text stream
39
+ import { BlazingAgents } from "@blazingagents/sdk";
219
40
 
220
- `POST /v1/agents/:agentId/generation` with text output. Returns a text-stream result:
41
+ const client = new BlazingAgents({ apiKey: "ba_..." });
221
42
 
222
- ```ts
223
43
  const result = await client.completion({
224
- agentId: agent.id,
225
- prompt: "Write a haiku about the sea.",
44
+ agentId: "ag_...",
45
+ prompt: "Write a friendly welcome message.",
226
46
  });
227
47
 
228
- for await (const delta of result.textStream) {
229
- process.stdout.write(delta);
230
- }
231
-
232
- const fullText = await result.text;
48
+ console.log(await result.text);
233
49
  ```
234
50
 
235
- ### `client.object(input)` — stateless structured output
51
+ Keep API keys on the server. For browser chat applications, relay `chat()`
52
+ through your backend and use `BlazingAgentsChatTransport` with AI SDK
53
+ `useChat`.
236
54
 
237
- `POST /v1/agents/:agentId/generation` with structured output. Returns a partial-object stream:
55
+ ## Documentation
238
56
 
239
- ```ts
240
- const result = await client.object({
241
- agentId: agent.id,
242
- prompt: "Give me a person",
243
- schema: {
244
- type: "object",
245
- properties: {
246
- name: { type: "string" },
247
- age: { type: "number" },
248
- },
249
- required: ["name"],
250
- },
251
- });
57
+ Read the
58
+ [TypeScript SDK documentation](https://docs.blazingagents.com/sdk/typescript)
59
+ for authentication, resource guides, generation and streaming, React
60
+ integration, error handling, and the complete API reference.
252
61
 
253
- for await (const partial of result.partialObjectStream) {
254
- console.log(partial);
255
- }
62
+ ## Development
256
63
 
257
- const finalObject = await result.object;
64
+ ```console
65
+ npm ci
66
+ npm run check
67
+ npm run test:consumer
258
68
  ```
259
69
 
260
- ## React `useChat` transport
70
+ ## License
261
71
 
262
- Keep `BlazingAgents` and its API key on your backend. The browser-safe
263
- `BlazingAgentsChatTransport` sends the latest user message, forwards
264
- regeneration metadata, captures the Session ID from the first response's
265
- `Location` header, and includes that ID on later sends.
72
+ [MIT](LICENSE)
266
73
 
267
- ### Tenant backend
74
+ ### Thinking level
268
75
 
269
- ```ts
270
- import {
271
- BlazingAgents,
272
- createChatRelay,
273
- createCompletionRelay,
274
- } from "@blazingagents/sdk";
76
+ Agent create/update accepts `thinkingLevel: "high"`, `"off"`, `"max"`, or
77
+ another nonempty string supported by the selected Model. Omission on creation
78
+ means Provider default; omission on update preserves the saved value, while
79
+ `thinkingLevel: null` clears it. Agent and Version responses include the
80
+ selection, and `restoreVersion` restores it through ordinary validation.
81
+ Use `client.providers.getThinkingLevels(providerId, model)` to read
82
+ `{ known, levels }`. Unknown capabilities permit custom values that can still
83
+ be rejected during execution. Levels control reasoning, not a token/cost cap.
275
84
 
276
- const client = new BlazingAgents({ apiKey: process.env.BLAZING_AGENTS_API_KEY });
85
+ For native clients whose `Response` constructor does not support streaming bodies,
86
+ use `result.toStream()` on chat or terminal continuation results to read the
87
+ original SSE bytes. It shares one-shot ownership with `toResponse()`; choose one
88
+ accessor per result. Stream errors and cancellation retain the same behavior.
277
89
 
278
- const resolveContext = async (request: Request) => {
279
- const user = await authenticateApplicationRequest(request);
280
- return user ? { agentId: "ag_...", userId: user.id } : null;
281
- };
90
+ ### Direct native chat
282
91
 
283
- export const POST = createChatRelay({
284
- client,
285
- resolveContext,
286
- sessions: {
287
- ownerOf: (sessionId) => chatSessions.ownerOf(sessionId),
288
- recordOwner: (sessionId, userId) =>
289
- chatSessions.recordOwner(sessionId, userId),
290
- },
291
- });
292
-
293
- export const POST_COMPLETION = createCompletionRelay({ client, resolveContext });
294
- ```
295
-
296
- Both factories accept standard Web `Request` objects and return standard Web
297
- `Response` objects. They validate AI SDK input, ignore browser attempts to set
298
- reserved agent/attribution fields, authorize Session resumes, record ownership
299
- before returning a created stream, preserve safe status and correlation
300
- headers, and propagate request cancellation. Framework adapters only need to
301
- pass their request to the returned function.
302
-
303
- ### Browser
92
+ For a direct SDK integration, use `BlazingAgentsDirectChatTransport` with AI SDK
93
+ `useChat`. It sends through `client.chat()` and uses AI SDK's stream decoder
94
+ without constructing a streaming `Response`. Inject your native streaming fetch
95
+ implementation into `BlazingAgents` when the runtime requires one.
304
96
 
305
97
  ```tsx
98
+ import { useMemo } from "react";
306
99
  import { useChat } from "@ai-sdk/react";
307
- import { BlazingAgentsChatTransport } from "@blazingagents/sdk";
308
- import { useState } from "react";
309
-
310
- function useBlazingChat({
311
- initialSessionId,
312
- rememberSessionId,
313
- }: {
314
- initialSessionId?: string;
315
- rememberSessionId: (sessionId: string) => void;
316
- }) {
317
- const [transport] = useState(
318
- () =>
319
- new BlazingAgentsChatTransport({
320
- api: "/api/chat",
321
- onSessionId: rememberSessionId,
322
- sessionId: initialSessionId,
323
- }),
100
+ import { BlazingAgentsDirectChatTransport } from "@blazingagents/sdk";
101
+
102
+ function Chat({ client, agentId, initialSessionId, saveSessionId }) {
103
+ const transport = useMemo(
104
+ () => new BlazingAgentsDirectChatTransport({
105
+ client,
106
+ agentId,
107
+ sessionId: initialSessionId,
108
+ onSessionId: saveSessionId,
109
+ }),
110
+ [client, agentId, initialSessionId, saveSessionId],
324
111
  );
325
- return useChat({ transport });
112
+ const chat = useChat({ transport });
113
+ // Render chat.messages and submit using chat.sendMessage({ text }).
326
114
  }
327
115
  ```
328
116
 
329
- The backend should derive `userId` from its authenticated session, never from
330
- an untrusted browser field. The Session store is a durable server-owned mapping;
331
- the opaque browser `sessionId` and End-user Attribution are not authorization.
332
- Use one stable transport instance per chat. Persist the ID received by
333
- `onSessionId`, and restore it through `sessionId` only after the backend has
334
- authorized that Session for the current application user.
335
-
336
- ## Error model
117
+ Install `@ai-sdk/react` for the React hook. Keep the transport stable for one chat;
118
+ remount the chat with a new transport when switching credentials, Agents, or
119
+ Sessions. `onSessionId` runs once for a newly created Session before stream
120
+ consumption, so it can be saved even if streaming later fails. The adapter
121
+ preserves user message IDs, regeneration targets, and `useChat` cancellation.
122
+ Regeneration requires an existing Session. Reconnection returns `null`; the
123
+ adapter does not retry interrupted Turns or resume their streams.
337
124
 
338
- All SDK failures use `BlazingAgentsError`. The server's lower-snake-case code
339
- is preserved exactly, including a future code unknown to the installed SDK.
340
- `KnownBlazingAgentsErrorCode` provides editor completion for the current API
341
- catalog and four SDK-local codes:
125
+ ### Cancel resource reads
342
126
 
343
- | Local code | Meaning |
344
- | --- | --- |
345
- | `invalid_response` | A response is not a valid API envelope or successful JSON result. |
346
- | `network_error` | Fetch failed before an HTTP exchange for a reason other than caller abort. |
347
- | `request_aborted` | The caller's `AbortSignal` aborted the request. |
348
- | `stream_error` | A stream failed after its response started or violated its stream contract. |
349
-
350
- `BlazingAgentsError` exposes `code`, `message`, and optional `status`,
351
- `details`, `param`, `headers`, `requestId`, `responseBody`,
352
- `responseBodyTruncated`, and `cause`. A malformed response uses the stable
353
- `invalid_response` message and retains a size-bounded body separately.
354
- Response-backed failures copy `X-Request-Id` into `requestId`.
127
+ Pass an optional `signal` to resource reads when leaving a screen or switching
128
+ credentials:
355
129
 
356
130
  ```ts
357
- import { BlazingAgentsError } from "@blazingagents/sdk";
358
-
359
- try {
360
- await client.agents.get("ag_nonexistent...");
361
- } catch (error) {
362
- if (BlazingAgentsError.isInstance(error)) {
363
- console.log(error.code);
364
- console.log(error.status);
365
- console.log(error.requestId);
366
- console.log(error.message);
367
- }
368
- }
131
+ const controller = new AbortController();
132
+ const agents = client.agents.list({ signal: controller.signal });
133
+ controller.abort();
134
+ await agents; // Rejects with the SDK's typed cancellation error.
369
135
  ```
370
136
 
371
- Use `BlazingAgentsError.isInstance()` instead of `instanceof` when package
372
- copies may cross realms or bundlers. See the public
373
- [error catalog and stream boundary](https://docs.blazingagents.com/api-reference/protocols/errors).
374
-
375
- ## Development
376
-
377
- Install dependencies and run the complete standalone check:
378
-
379
- ```bash
380
- npm ci
381
- npm run check
382
- npm run test:consumer
383
- ```
137
+ SDK response parsing strips unknown object fields while validating required
138
+ fields and known field types. Request validation remains strict.
@@ -238,7 +238,7 @@ export declare const cursorSchema: z.ZodString;
238
238
  export declare function paginatedResponseSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
239
239
  data: z.ZodArray<T>;
240
240
  nextCursor: z.ZodNullable<z.ZodString>;
241
- }, z.core.$strict>;
241
+ }, z.core.$strip>;
242
242
  /**
243
243
  * Opaque keyset cursor helpers. Cursors are base64url-encoded JSON of the
244
244
  * keyset tuple the endpoint paginates by — never a raw value, never a row
@@ -132,7 +132,7 @@ export function paginatedResponseSchema(itemSchema) {
132
132
  data: z.array(itemSchema),
133
133
  nextCursor: z.string().nullable(),
134
134
  })
135
- .strict();
135
+ .strip();
136
136
  }
137
137
  /**
138
138
  * Opaque keyset cursor helpers. Cursors are base64url-encoded JSON of the
@@ -18,6 +18,7 @@ export declare const agentSchema: z.ZodObject<{
18
18
  tenantId: z.ZodString;
19
19
  name: z.ZodString;
20
20
  model: z.ZodNullable<z.ZodString>;
21
+ thinkingLevel: z.ZodNullable<z.ZodString>;
21
22
  providerId: z.ZodNullable<z.ZodString>;
22
23
  workspaceId: z.ZodString;
23
24
  memoryInjectionEnabled: z.ZodBoolean;
@@ -38,13 +39,14 @@ export declare const agentSchema: z.ZodObject<{
38
39
  active: "active";
39
40
  disabled: "disabled";
40
41
  }>;
41
- }, z.core.$strict>;
42
+ }, z.core.$strip>;
42
43
  export declare const agentsResponseSchema: z.ZodObject<{
43
44
  agents: z.ZodArray<z.ZodObject<{
44
45
  id: z.ZodString;
45
46
  tenantId: z.ZodString;
46
47
  name: z.ZodString;
47
48
  model: z.ZodNullable<z.ZodString>;
49
+ thinkingLevel: z.ZodNullable<z.ZodString>;
48
50
  providerId: z.ZodNullable<z.ZodString>;
49
51
  workspaceId: z.ZodString;
50
52
  memoryInjectionEnabled: z.ZodBoolean;
@@ -65,13 +67,14 @@ export declare const agentsResponseSchema: z.ZodObject<{
65
67
  active: "active";
66
68
  disabled: "disabled";
67
69
  }>;
68
- }, z.core.$strict>>;
69
- }, z.core.$strict>;
70
+ }, z.core.$strip>>;
71
+ }, z.core.$strip>;
70
72
  export declare const agentResponseSchema: z.ZodObject<{
71
73
  id: z.ZodString;
72
74
  tenantId: z.ZodString;
73
75
  name: z.ZodString;
74
76
  model: z.ZodNullable<z.ZodString>;
77
+ thinkingLevel: z.ZodNullable<z.ZodString>;
75
78
  providerId: z.ZodNullable<z.ZodString>;
76
79
  workspaceId: z.ZodString;
77
80
  memoryInjectionEnabled: z.ZodBoolean;
@@ -92,7 +95,7 @@ export declare const agentResponseSchema: z.ZodObject<{
92
95
  active: "active";
93
96
  disabled: "disabled";
94
97
  }>;
95
- }, z.core.$strict>;
98
+ }, z.core.$strip>;
96
99
  export declare const agentsListQuerySchema: z.ZodObject<{
97
100
  userId: z.ZodOptional<z.ZodString>;
98
101
  workspaceId: z.ZodOptional<z.ZodString>;
@@ -103,6 +106,7 @@ export declare const agentVersionSchema: z.ZodObject<{
103
106
  version: z.ZodNumber;
104
107
  name: z.ZodString;
105
108
  model: z.ZodNullable<z.ZodString>;
109
+ thinkingLevel: z.ZodNullable<z.ZodString>;
106
110
  providerId: z.ZodNullable<z.ZodString>;
107
111
  memoryInjectionEnabled: z.ZodBoolean;
108
112
  tools: z.ZodArray<z.ZodEnum<{
@@ -114,7 +118,7 @@ export declare const agentVersionSchema: z.ZodObject<{
114
118
  metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
115
119
  mcpConnectionIds: z.ZodArray<z.ZodString>;
116
120
  createdAt: z.ZodISODateTime;
117
- }, z.core.$strict>;
121
+ }, z.core.$strip>;
118
122
  export declare const agentVersionsListQuerySchema: z.ZodObject<{
119
123
  cursor: z.ZodOptional<z.ZodString>;
120
124
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -126,6 +130,7 @@ export declare const agentVersionsResponseSchema: z.ZodObject<{
126
130
  version: z.ZodNumber;
127
131
  name: z.ZodString;
128
132
  model: z.ZodNullable<z.ZodString>;
133
+ thinkingLevel: z.ZodNullable<z.ZodString>;
129
134
  providerId: z.ZodNullable<z.ZodString>;
130
135
  memoryInjectionEnabled: z.ZodBoolean;
131
136
  tools: z.ZodArray<z.ZodEnum<{
@@ -137,12 +142,13 @@ export declare const agentVersionsResponseSchema: z.ZodObject<{
137
142
  metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
138
143
  mcpConnectionIds: z.ZodArray<z.ZodString>;
139
144
  createdAt: z.ZodISODateTime;
140
- }, z.core.$strict>>;
145
+ }, z.core.$strip>>;
141
146
  nextCursor: z.ZodNullable<z.ZodString>;
142
- }, z.core.$strict>;
147
+ }, z.core.$strip>;
143
148
  export declare const createAgentBodySchema: z.ZodObject<{
144
149
  name: z.ZodString;
145
150
  model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
151
+ thinkingLevel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
146
152
  providerId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
147
153
  workspaceId: z.ZodOptional<z.ZodString>;
148
154
  memoryInjectionEnabled: z.ZodDefault<z.ZodBoolean>;
@@ -159,6 +165,7 @@ export declare const createAgentBodySchema: z.ZodObject<{
159
165
  export declare const updateAgentBodySchema: z.ZodObject<{
160
166
  name: z.ZodOptional<z.ZodString>;
161
167
  model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
168
+ thinkingLevel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
162
169
  providerId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
163
170
  workspaceId: z.ZodOptional<z.ZodString>;
164
171
  memoryInjectionEnabled: z.ZodOptional<z.ZodBoolean>;
@@ -38,6 +38,7 @@ export const agentSchema = z
38
38
  tenantId: tenantIdSchema,
39
39
  name: agentNameSchema,
40
40
  model: agentModelIdSchema.nullable(),
41
+ thinkingLevel: z.string().min(1).nullable(),
41
42
  providerId: providerIdSchema.nullable(),
42
43
  workspaceId: workspaceIdSchema,
43
44
  memoryInjectionEnabled: z.boolean(),
@@ -53,7 +54,7 @@ export const agentSchema = z
53
54
  version: agentVersionNumberSchema,
54
55
  status: agentStatusSchema,
55
56
  })
56
- .strict()
57
+ .strip()
57
58
  .refine(hasProviderModelPair, {
58
59
  message: providerModelPairMessage,
59
60
  path: ["providerId"],
@@ -62,7 +63,7 @@ export const agentsResponseSchema = z
62
63
  .object({
63
64
  agents: z.array(agentSchema),
64
65
  })
65
- .strict();
66
+ .strip();
66
67
  export const agentResponseSchema = agentSchema;
67
68
  export const agentsListQuerySchema = z
68
69
  .object({
@@ -77,6 +78,7 @@ export const agentVersionSchema = z
77
78
  version: agentVersionNumberSchema,
78
79
  name: agentSchema.shape.name,
79
80
  model: agentSchema.shape.model,
81
+ thinkingLevel: agentSchema.shape.thinkingLevel,
80
82
  providerId: agentSchema.shape.providerId,
81
83
  memoryInjectionEnabled: agentSchema.shape.memoryInjectionEnabled,
82
84
  tools: agentSchema.shape.tools,
@@ -85,7 +87,7 @@ export const agentVersionSchema = z
85
87
  mcpConnectionIds: agentSchema.shape.mcpConnectionIds,
86
88
  createdAt: agentSchema.shape.createdAt,
87
89
  })
88
- .strict()
90
+ .strip()
89
91
  .refine(hasProviderModelPair, {
90
92
  message: providerModelPairMessage,
91
93
  path: ["providerId"],
@@ -106,6 +108,7 @@ export const createAgentBodySchema = z
106
108
  .object({
107
109
  name: agentNameSchema,
108
110
  model: agentModelIdSchema.nullable().default(null),
111
+ thinkingLevel: z.string().min(1).nullable().default(null),
109
112
  providerId: providerIdSchema.nullable().default(null),
110
113
  workspaceId: workspaceIdSchema.optional(),
111
114
  memoryInjectionEnabled: z.boolean().default(false),
@@ -124,6 +127,7 @@ export const updateAgentBodySchema = z
124
127
  .object({
125
128
  name: agentNameSchema.optional(),
126
129
  model: agentModelIdSchema.nullable().optional(),
130
+ thinkingLevel: z.string().min(1).nullable().optional(),
127
131
  providerId: providerIdSchema.nullable().optional(),
128
132
  workspaceId: workspaceIdSchema.optional(),
129
133
  memoryInjectionEnabled: z.boolean().optional(),