@tambo-ai/typescript-sdk 0.80.0 → 0.83.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 (132) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +1 -3
  3. package/bin/migration-config.json +66 -0
  4. package/client.d.mts +6 -0
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +6 -0
  7. package/client.d.ts.map +1 -1
  8. package/client.js +6 -0
  9. package/client.js.map +1 -1
  10. package/client.mjs +6 -0
  11. package/client.mjs.map +1 -1
  12. package/lib/advance-stream.d.mts +2 -2
  13. package/lib/advance-stream.d.mts.map +1 -1
  14. package/lib/advance-stream.d.ts +2 -2
  15. package/lib/advance-stream.d.ts.map +1 -1
  16. package/lib/advance-stream.js.map +1 -1
  17. package/lib/advance-stream.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/beta/beta.d.mts +2 -2
  20. package/resources/beta/beta.d.mts.map +1 -1
  21. package/resources/beta/beta.d.ts +2 -2
  22. package/resources/beta/beta.d.ts.map +1 -1
  23. package/resources/beta/beta.js.map +1 -1
  24. package/resources/beta/beta.mjs.map +1 -1
  25. package/resources/beta/index.d.mts +1 -1
  26. package/resources/beta/index.d.mts.map +1 -1
  27. package/resources/beta/index.d.ts +1 -1
  28. package/resources/beta/index.d.ts.map +1 -1
  29. package/resources/beta/index.js.map +1 -1
  30. package/resources/beta/index.mjs.map +1 -1
  31. package/resources/beta/threads/index.d.mts +1 -1
  32. package/resources/beta/threads/index.d.mts.map +1 -1
  33. package/resources/beta/threads/index.d.ts +1 -1
  34. package/resources/beta/threads/index.d.ts.map +1 -1
  35. package/resources/beta/threads/index.js.map +1 -1
  36. package/resources/beta/threads/index.mjs.map +1 -1
  37. package/resources/beta/threads/messages.d.mts +5 -2
  38. package/resources/beta/threads/messages.d.mts.map +1 -1
  39. package/resources/beta/threads/messages.d.ts +5 -2
  40. package/resources/beta/threads/messages.d.ts.map +1 -1
  41. package/resources/beta/threads/messages.js +4 -1
  42. package/resources/beta/threads/messages.js.map +1 -1
  43. package/resources/beta/threads/messages.mjs +4 -1
  44. package/resources/beta/threads/messages.mjs.map +1 -1
  45. package/resources/beta/threads/threads.d.mts +6 -135
  46. package/resources/beta/threads/threads.d.mts.map +1 -1
  47. package/resources/beta/threads/threads.d.ts +6 -135
  48. package/resources/beta/threads/threads.d.ts.map +1 -1
  49. package/resources/beta/threads/threads.js +6 -25
  50. package/resources/beta/threads/threads.js.map +1 -1
  51. package/resources/beta/threads/threads.mjs +6 -25
  52. package/resources/beta/threads/threads.mjs.map +1 -1
  53. package/resources/index.d.mts +2 -0
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +2 -0
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/index.js +5 -1
  58. package/resources/index.js.map +1 -1
  59. package/resources/index.mjs +2 -0
  60. package/resources/index.mjs.map +1 -1
  61. package/resources/shared.d.mts +3 -0
  62. package/resources/shared.d.mts.map +1 -1
  63. package/resources/shared.d.ts +3 -0
  64. package/resources/shared.d.ts.map +1 -1
  65. package/resources/storage.d.mts +46 -0
  66. package/resources/storage.d.mts.map +1 -0
  67. package/resources/storage.d.ts +46 -0
  68. package/resources/storage.d.ts.map +1 -0
  69. package/resources/storage.js +24 -0
  70. package/resources/storage.js.map +1 -0
  71. package/resources/storage.mjs +20 -0
  72. package/resources/storage.mjs.map +1 -0
  73. package/resources/threads/index.d.mts +4 -0
  74. package/resources/threads/index.d.mts.map +1 -0
  75. package/resources/threads/index.d.ts +4 -0
  76. package/resources/threads/index.d.ts.map +1 -0
  77. package/resources/threads/index.js +11 -0
  78. package/resources/threads/index.js.map +1 -0
  79. package/resources/threads/index.mjs +5 -0
  80. package/resources/threads/index.mjs.map +1 -0
  81. package/resources/threads/messages.d.mts +113 -0
  82. package/resources/threads/messages.d.mts.map +1 -0
  83. package/resources/threads/messages.d.ts +113 -0
  84. package/resources/threads/messages.d.ts.map +1 -0
  85. package/resources/threads/messages.js +38 -0
  86. package/resources/threads/messages.js.map +1 -0
  87. package/resources/threads/messages.mjs +34 -0
  88. package/resources/threads/messages.mjs.map +1 -0
  89. package/resources/threads/runs.d.mts +277 -0
  90. package/resources/threads/runs.d.mts.map +1 -0
  91. package/resources/threads/runs.d.ts +277 -0
  92. package/resources/threads/runs.d.ts.map +1 -0
  93. package/resources/threads/runs.js +69 -0
  94. package/resources/threads/runs.js.map +1 -0
  95. package/resources/threads/runs.mjs +65 -0
  96. package/resources/threads/runs.mjs.map +1 -0
  97. package/resources/threads/threads.d.mts +391 -0
  98. package/resources/threads/threads.d.mts.map +1 -0
  99. package/resources/threads/threads.d.ts +391 -0
  100. package/resources/threads/threads.d.ts.map +1 -0
  101. package/resources/threads/threads.js +75 -0
  102. package/resources/threads/threads.js.map +1 -0
  103. package/resources/threads/threads.mjs +70 -0
  104. package/resources/threads/threads.mjs.map +1 -0
  105. package/resources/threads.d.mts +2 -0
  106. package/resources/threads.d.mts.map +1 -0
  107. package/resources/threads.d.ts +2 -0
  108. package/resources/threads.d.ts.map +1 -0
  109. package/resources/threads.js +6 -0
  110. package/resources/threads.js.map +1 -0
  111. package/resources/threads.mjs +3 -0
  112. package/resources/threads.mjs.map +1 -0
  113. package/src/client.ts +40 -0
  114. package/src/lib/advance-stream.ts +2 -2
  115. package/src/resources/beta/beta.ts +0 -2
  116. package/src/resources/beta/index.ts +0 -1
  117. package/src/resources/beta/threads/index.ts +0 -1
  118. package/src/resources/beta/threads/messages.ts +5 -2
  119. package/src/resources/beta/threads/threads.ts +6 -157
  120. package/src/resources/index.ts +15 -0
  121. package/src/resources/shared.ts +3 -0
  122. package/src/resources/storage.ts +59 -0
  123. package/src/resources/threads/index.ts +31 -0
  124. package/src/resources/threads/messages.ts +161 -0
  125. package/src/resources/threads/runs.ts +354 -0
  126. package/src/resources/threads/threads.ts +536 -0
  127. package/src/resources/threads.ts +3 -0
  128. package/src/version.ts +1 -1
  129. package/version.d.mts +1 -1
  130. package/version.d.ts +1 -1
  131. package/version.js +1 -1
  132. package/version.mjs +1 -1
@@ -0,0 +1,391 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as ThreadsAPI from "./threads.js";
3
+ import * as Shared from "../shared.js";
4
+ import * as MessagesAPI from "./messages.js";
5
+ import { MessageGetParams, MessageGetResponse, MessageListParams, MessageListResponse, Messages } from "./messages.js";
6
+ import * as RunsAPI from "./runs.js";
7
+ import { InputMessage, RunCreateParams, RunDeleteParams, RunDeleteResponse, RunRunParams, Runs } from "./runs.js";
8
+ import { APIPromise } from "../../core/api-promise.js";
9
+ import { RequestOptions } from "../../internal/request-options.js";
10
+ export declare class Threads extends APIResource {
11
+ messages: MessagesAPI.Messages;
12
+ runs: RunsAPI.Runs;
13
+ /**
14
+ * Create a new empty thread. Note: initialMessages is not supported yet; create
15
+ * the thread first, then add messages via runs/message endpoints.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const thread = await client.threads.create();
20
+ * ```
21
+ */
22
+ create(body: ThreadCreateParams, options?: RequestOptions): APIPromise<ThreadCreateResponse>;
23
+ /**
24
+ * Get a thread by ID with all its messages. The thread must belong to the
25
+ * authenticated project.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const thread = await client.threads.retrieve(
30
+ * 'thr_abc123xyz',
31
+ * );
32
+ * ```
33
+ */
34
+ retrieve(threadID: string, options?: RequestOptions): APIPromise<ThreadRetrieveResponse>;
35
+ /**
36
+ * List all threads for the authenticated project. Supports cursor-based pagination
37
+ * and filtering by context key.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const threads = await client.threads.list();
42
+ * ```
43
+ */
44
+ list(query?: ThreadListParams | null | undefined, options?: RequestOptions): APIPromise<ThreadListResponse>;
45
+ /**
46
+ * Delete a thread and all its messages. This action cannot be undone.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * await client.threads.delete('thr_abc123xyz');
51
+ * ```
52
+ */
53
+ delete(threadID: string, options?: RequestOptions): APIPromise<void>;
54
+ }
55
+ export interface ComponentContent {
56
+ /**
57
+ * Unique identifier for this component instance
58
+ */
59
+ id: string;
60
+ /**
61
+ * Name of the component to render
62
+ */
63
+ name: string;
64
+ /**
65
+ * Props to pass to the component
66
+ */
67
+ props: unknown;
68
+ /**
69
+ * Content block type identifier
70
+ */
71
+ type: 'component';
72
+ /**
73
+ * Current state of the component
74
+ */
75
+ state?: unknown;
76
+ }
77
+ export interface ResourceContent {
78
+ /**
79
+ * Resource data containing URI, text, or blob
80
+ */
81
+ resource: Shared.Resource;
82
+ /**
83
+ * Content block type identifier
84
+ */
85
+ type: 'resource';
86
+ }
87
+ export interface RunError {
88
+ /**
89
+ * Error message
90
+ */
91
+ message: string;
92
+ /**
93
+ * Error code
94
+ */
95
+ code?: string;
96
+ }
97
+ export interface TextContent {
98
+ /**
99
+ * The text content
100
+ */
101
+ text: string;
102
+ /**
103
+ * Content block type identifier
104
+ */
105
+ type: 'text';
106
+ }
107
+ export interface ToolResultContent {
108
+ /**
109
+ * Result content (text or resource blocks)
110
+ */
111
+ content: Array<TextContent | ResourceContent>;
112
+ /**
113
+ * ID of the tool call this result responds to
114
+ */
115
+ toolUseId: string;
116
+ /**
117
+ * Content block type identifier
118
+ */
119
+ type: 'tool_result';
120
+ /**
121
+ * Whether the tool call resulted in an error
122
+ */
123
+ isError?: boolean;
124
+ }
125
+ export interface ToolUseContent {
126
+ /**
127
+ * Unique identifier for this tool call
128
+ */
129
+ id: string;
130
+ /**
131
+ * Input arguments for the tool
132
+ */
133
+ input: unknown;
134
+ /**
135
+ * Name of the tool being called
136
+ */
137
+ name: string;
138
+ /**
139
+ * Content block type identifier
140
+ */
141
+ type: 'tool_use';
142
+ }
143
+ export interface ThreadCreateResponse {
144
+ /**
145
+ * Unique identifier for this thread
146
+ */
147
+ id: string;
148
+ /**
149
+ * When the thread was created (ISO 8601)
150
+ */
151
+ createdAt: string;
152
+ /**
153
+ * Project this thread belongs to
154
+ */
155
+ projectId: string;
156
+ /**
157
+ * Current run status: idle (no run), waiting (run started, awaiting content),
158
+ * streaming (receiving content)
159
+ */
160
+ runStatus: 'idle' | 'waiting' | 'streaming';
161
+ /**
162
+ * When the thread was last updated (ISO 8601)
163
+ */
164
+ updatedAt: string;
165
+ /**
166
+ * Optional context key for thread organization
167
+ */
168
+ contextKey?: string;
169
+ /**
170
+ * ID of the currently active run (when not idle)
171
+ */
172
+ currentRunId?: string;
173
+ /**
174
+ * ID of the last completed run. Required as previousRunId when continuing after
175
+ * tool calls.
176
+ */
177
+ lastCompletedRunId?: string;
178
+ /**
179
+ * Whether the last run was cancelled
180
+ */
181
+ lastRunCancelled?: boolean;
182
+ /**
183
+ * Error information from the last run
184
+ */
185
+ lastRunError?: RunError;
186
+ /**
187
+ * Additional metadata
188
+ */
189
+ metadata?: unknown;
190
+ /**
191
+ * Tool call IDs awaiting client-side results. If non-empty, next run must provide
192
+ * tool_result content with previousRunId set.
193
+ */
194
+ pendingToolCallIds?: Array<string>;
195
+ /**
196
+ * Human-readable status message (e.g., 'Fetching weather data...')
197
+ */
198
+ statusMessage?: string;
199
+ }
200
+ export interface ThreadRetrieveResponse {
201
+ /**
202
+ * Unique identifier for this thread
203
+ */
204
+ id: string;
205
+ /**
206
+ * When the thread was created (ISO 8601)
207
+ */
208
+ createdAt: string;
209
+ /**
210
+ * Messages in this thread
211
+ */
212
+ messages: Array<ThreadRetrieveResponse.Message>;
213
+ /**
214
+ * Project this thread belongs to
215
+ */
216
+ projectId: string;
217
+ /**
218
+ * Current run status: idle (no run), waiting (run started, awaiting content),
219
+ * streaming (receiving content)
220
+ */
221
+ runStatus: 'idle' | 'waiting' | 'streaming';
222
+ /**
223
+ * When the thread was last updated (ISO 8601)
224
+ */
225
+ updatedAt: string;
226
+ /**
227
+ * Optional context key for thread organization
228
+ */
229
+ contextKey?: string;
230
+ /**
231
+ * ID of the currently active run (when not idle)
232
+ */
233
+ currentRunId?: string;
234
+ /**
235
+ * ID of the last completed run. Required as previousRunId when continuing after
236
+ * tool calls.
237
+ */
238
+ lastCompletedRunId?: string;
239
+ /**
240
+ * Whether the last run was cancelled
241
+ */
242
+ lastRunCancelled?: boolean;
243
+ /**
244
+ * Error information from the last run
245
+ */
246
+ lastRunError?: RunError;
247
+ /**
248
+ * Additional metadata
249
+ */
250
+ metadata?: unknown;
251
+ /**
252
+ * Tool call IDs awaiting client-side results. If non-empty, next run must provide
253
+ * tool_result content with previousRunId set.
254
+ */
255
+ pendingToolCallIds?: Array<string>;
256
+ /**
257
+ * Human-readable status message (e.g., 'Fetching weather data...')
258
+ */
259
+ statusMessage?: string;
260
+ }
261
+ export declare namespace ThreadRetrieveResponse {
262
+ interface Message {
263
+ /**
264
+ * Unique identifier for this message
265
+ */
266
+ id: string;
267
+ /**
268
+ * Content blocks in this message
269
+ */
270
+ content: Array<ThreadsAPI.TextContent | ThreadsAPI.ResourceContent | ThreadsAPI.ToolUseContent | ThreadsAPI.ToolResultContent | ThreadsAPI.ComponentContent>;
271
+ /**
272
+ * Message role
273
+ */
274
+ role: 'user' | 'assistant' | 'system';
275
+ /**
276
+ * When the message was created (ISO 8601)
277
+ */
278
+ createdAt?: string;
279
+ /**
280
+ * Additional metadata
281
+ */
282
+ metadata?: unknown;
283
+ }
284
+ }
285
+ export interface ThreadListResponse {
286
+ /**
287
+ * Whether there are more results
288
+ */
289
+ hasMore: boolean;
290
+ /**
291
+ * List of threads
292
+ */
293
+ threads: Array<ThreadListResponse.Thread>;
294
+ /**
295
+ * Cursor for the next page of results
296
+ */
297
+ nextCursor?: string;
298
+ }
299
+ export declare namespace ThreadListResponse {
300
+ interface Thread {
301
+ /**
302
+ * Unique identifier for this thread
303
+ */
304
+ id: string;
305
+ /**
306
+ * When the thread was created (ISO 8601)
307
+ */
308
+ createdAt: string;
309
+ /**
310
+ * Project this thread belongs to
311
+ */
312
+ projectId: string;
313
+ /**
314
+ * Current run status: idle (no run), waiting (run started, awaiting content),
315
+ * streaming (receiving content)
316
+ */
317
+ runStatus: 'idle' | 'waiting' | 'streaming';
318
+ /**
319
+ * When the thread was last updated (ISO 8601)
320
+ */
321
+ updatedAt: string;
322
+ /**
323
+ * Optional context key for thread organization
324
+ */
325
+ contextKey?: string;
326
+ /**
327
+ * ID of the currently active run (when not idle)
328
+ */
329
+ currentRunId?: string;
330
+ /**
331
+ * ID of the last completed run. Required as previousRunId when continuing after
332
+ * tool calls.
333
+ */
334
+ lastCompletedRunId?: string;
335
+ /**
336
+ * Whether the last run was cancelled
337
+ */
338
+ lastRunCancelled?: boolean;
339
+ /**
340
+ * Error information from the last run
341
+ */
342
+ lastRunError?: ThreadsAPI.RunError;
343
+ /**
344
+ * Additional metadata
345
+ */
346
+ metadata?: unknown;
347
+ /**
348
+ * Tool call IDs awaiting client-side results. If non-empty, next run must provide
349
+ * tool_result content with previousRunId set.
350
+ */
351
+ pendingToolCallIds?: Array<string>;
352
+ /**
353
+ * Human-readable status message (e.g., 'Fetching weather data...')
354
+ */
355
+ statusMessage?: string;
356
+ }
357
+ }
358
+ export interface ThreadCreateParams {
359
+ /**
360
+ * Optional context key for thread organization
361
+ */
362
+ contextKey?: string;
363
+ /**
364
+ * Initial messages to seed the thread with
365
+ */
366
+ initialMessages?: Array<RunsAPI.InputMessage>;
367
+ /**
368
+ * Additional metadata to attach to the thread
369
+ */
370
+ metadata?: unknown;
371
+ }
372
+ export interface ThreadListParams {
373
+ /**
374
+ * Filter by context key
375
+ */
376
+ contextKey?: string;
377
+ /**
378
+ * Cursor for pagination
379
+ */
380
+ cursor?: string;
381
+ /**
382
+ * Maximum number of threads to return
383
+ */
384
+ limit?: string;
385
+ }
386
+ export declare namespace Threads {
387
+ export { type ComponentContent as ComponentContent, type ResourceContent as ResourceContent, type RunError as RunError, type TextContent as TextContent, type ToolResultContent as ToolResultContent, type ToolUseContent as ToolUseContent, type ThreadCreateResponse as ThreadCreateResponse, type ThreadRetrieveResponse as ThreadRetrieveResponse, type ThreadListResponse as ThreadListResponse, type ThreadCreateParams as ThreadCreateParams, type ThreadListParams as ThreadListParams, };
388
+ export { Messages as Messages, type MessageListResponse as MessageListResponse, type MessageGetResponse as MessageGetResponse, type MessageListParams as MessageListParams, type MessageGetParams as MessageGetParams, };
389
+ export { Runs as Runs, type InputMessage as InputMessage, type RunDeleteResponse as RunDeleteResponse, type RunCreateParams as RunCreateParams, type RunDeleteParams as RunDeleteParams, type RunRunParams as RunRunParams, };
390
+ }
391
+ //# sourceMappingURL=threads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,UAAU;OACf,KAAK,MAAM;OACX,KAAK,WAAW;OAChB,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,EACT;OACM,KAAK,OAAO;OACZ,EACL,YAAY,EACZ,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,IAAI,EACL;OACM,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAA0C;IACxE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAkC;IAEpD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAIxF;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,gBAAgB,GAAG,IAAI,GAAG,SAAc,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,kBAAkB,CAAC;IAIjC;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EA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,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,IAAI,IAAI,IAAI,EACZ,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,YAAY,IAAI,YAAY,GAClC,CAAC;CACH"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Threads = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const MessagesAPI = tslib_1.__importStar(require("./messages.js"));
8
+ const messages_1 = require("./messages.js");
9
+ const RunsAPI = tslib_1.__importStar(require("./runs.js"));
10
+ const runs_1 = require("./runs.js");
11
+ const headers_1 = require("../../internal/headers.js");
12
+ const path_1 = require("../../internal/utils/path.js");
13
+ class Threads extends resource_1.APIResource {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.messages = new MessagesAPI.Messages(this._client);
17
+ this.runs = new RunsAPI.Runs(this._client);
18
+ }
19
+ /**
20
+ * Create a new empty thread. Note: initialMessages is not supported yet; create
21
+ * the thread first, then add messages via runs/message endpoints.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const thread = await client.threads.create();
26
+ * ```
27
+ */
28
+ create(body, options) {
29
+ return this._client.post('/v1/threads', { body, ...options });
30
+ }
31
+ /**
32
+ * Get a thread by ID with all its messages. The thread must belong to the
33
+ * authenticated project.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const thread = await client.threads.retrieve(
38
+ * 'thr_abc123xyz',
39
+ * );
40
+ * ```
41
+ */
42
+ retrieve(threadID, options) {
43
+ return this._client.get((0, path_1.path) `/v1/threads/${threadID}`, options);
44
+ }
45
+ /**
46
+ * List all threads for the authenticated project. Supports cursor-based pagination
47
+ * and filtering by context key.
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const threads = await client.threads.list();
52
+ * ```
53
+ */
54
+ list(query = {}, options) {
55
+ return this._client.get('/v1/threads', { query, ...options });
56
+ }
57
+ /**
58
+ * Delete a thread and all its messages. This action cannot be undone.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * await client.threads.delete('thr_abc123xyz');
63
+ * ```
64
+ */
65
+ delete(threadID, options) {
66
+ return this._client.delete((0, path_1.path) `/v1/threads/${threadID}`, {
67
+ ...options,
68
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
69
+ });
70
+ }
71
+ }
72
+ exports.Threads = Threads;
73
+ Threads.Messages = messages_1.Messages;
74
+ Threads.Runs = runs_1.Runs;
75
+ //# sourceMappingURL=threads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.js","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,mEAA0C;AAC1C,4CAMoB;AACpB,2DAAkC;AAClC,oCAOgB;AAEhB,uDAAsD;AAEtD,uDAAiD;AAEjD,MAAa,OAAQ,SAAQ,sBAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4DtD,CAAC;IA1DC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,eAAe,QAAQ,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA9DD,0BA8DC;AA4ZD,OAAO,CAAC,QAAQ,GAAG,mBAAQ,CAAC;AAC5B,OAAO,CAAC,IAAI,GAAG,WAAI,CAAC"}
@@ -0,0 +1,70 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as MessagesAPI from "./messages.mjs";
4
+ import { Messages, } from "./messages.mjs";
5
+ import * as RunsAPI from "./runs.mjs";
6
+ import { Runs, } from "./runs.mjs";
7
+ import { buildHeaders } from "../../internal/headers.mjs";
8
+ import { path } from "../../internal/utils/path.mjs";
9
+ export class Threads extends APIResource {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.messages = new MessagesAPI.Messages(this._client);
13
+ this.runs = new RunsAPI.Runs(this._client);
14
+ }
15
+ /**
16
+ * Create a new empty thread. Note: initialMessages is not supported yet; create
17
+ * the thread first, then add messages via runs/message endpoints.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const thread = await client.threads.create();
22
+ * ```
23
+ */
24
+ create(body, options) {
25
+ return this._client.post('/v1/threads', { body, ...options });
26
+ }
27
+ /**
28
+ * Get a thread by ID with all its messages. The thread must belong to the
29
+ * authenticated project.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const thread = await client.threads.retrieve(
34
+ * 'thr_abc123xyz',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(threadID, options) {
39
+ return this._client.get(path `/v1/threads/${threadID}`, options);
40
+ }
41
+ /**
42
+ * List all threads for the authenticated project. Supports cursor-based pagination
43
+ * and filtering by context key.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const threads = await client.threads.list();
48
+ * ```
49
+ */
50
+ list(query = {}, options) {
51
+ return this._client.get('/v1/threads', { query, ...options });
52
+ }
53
+ /**
54
+ * Delete a thread and all its messages. This action cannot be undone.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * await client.threads.delete('thr_abc123xyz');
59
+ * ```
60
+ */
61
+ delete(threadID, options) {
62
+ return this._client.delete(path `/v1/threads/${threadID}`, {
63
+ ...options,
64
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
65
+ });
66
+ }
67
+ }
68
+ Threads.Messages = Messages;
69
+ Threads.Runs = Runs;
70
+ //# sourceMappingURL=threads.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.mjs","sourceRoot":"","sources":["../../src/resources/threads/threads.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,WAAW;OAChB,EAKL,QAAQ,GACT;OACM,KAAK,OAAO;OACZ,EAML,IAAI,GACL;OAEM,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4DtD,CAAC;IA1DC;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAwB,EAAE,OAAwB;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAA6C,EAAE,EAC/C,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,eAAe,QAAQ,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;CACF;AA4ZD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC5B,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./threads/index.mjs";
2
+ //# sourceMappingURL=threads.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.d.mts","sourceRoot":"","sources":["../src/resources/threads.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./threads/index.js";
2
+ //# sourceMappingURL=threads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../src/resources/threads.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./threads/index.js"), exports);
6
+ //# sourceMappingURL=threads.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.js","sourceRoot":"","sources":["../src/resources/threads.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6DAAgC"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./threads/index.mjs";
3
+ //# sourceMappingURL=threads.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threads.mjs","sourceRoot":"","sources":["../src/resources/threads.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
package/src/client.ts CHANGED
@@ -18,7 +18,22 @@ import { AbstractPage, type OffsetAndLimitParams, OffsetAndLimitResponse } from
18
18
  import * as Uploads from './core/uploads';
19
19
  import * as API from './resources/index';
20
20
  import { APIPromise } from './core/api-promise';
21
+ import { Storage, StoragePresignParams, StoragePresignResponse } from './resources/storage';
21
22
  import { Beta } from './resources/beta/beta';
23
+ import {
24
+ ComponentContent,
25
+ ResourceContent,
26
+ RunError,
27
+ TextContent,
28
+ ThreadCreateParams,
29
+ ThreadCreateResponse,
30
+ ThreadListParams,
31
+ ThreadListResponse,
32
+ ThreadRetrieveResponse,
33
+ Threads,
34
+ ToolResultContent,
35
+ ToolUseContent,
36
+ } from './resources/threads/threads';
22
37
  import { type Fetch } from './internal/builtin-types';
23
38
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
24
39
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -795,9 +810,13 @@ export class TamboAI {
795
810
  static toFile = Uploads.toFile;
796
811
 
797
812
  beta: API.Beta = new API.Beta(this);
813
+ storage: API.Storage = new API.Storage(this);
814
+ threads: API.Threads = new API.Threads(this);
798
815
  }
799
816
 
800
817
  TamboAI.Beta = Beta;
818
+ TamboAI.Storage = Storage;
819
+ TamboAI.Threads = Threads;
801
820
 
802
821
  export declare namespace TamboAI {
803
822
  export type RequestOptions = Opts.RequestOptions;
@@ -810,6 +829,27 @@ export declare namespace TamboAI {
810
829
 
811
830
  export { Beta as Beta };
812
831
 
832
+ export {
833
+ Storage as Storage,
834
+ type StoragePresignResponse as StoragePresignResponse,
835
+ type StoragePresignParams as StoragePresignParams,
836
+ };
837
+
838
+ export {
839
+ Threads as Threads,
840
+ type ComponentContent as ComponentContent,
841
+ type ResourceContent as ResourceContent,
842
+ type RunError as RunError,
843
+ type TextContent as TextContent,
844
+ type ToolResultContent as ToolResultContent,
845
+ type ToolUseContent as ToolUseContent,
846
+ type ThreadCreateResponse as ThreadCreateResponse,
847
+ type ThreadRetrieveResponse as ThreadRetrieveResponse,
848
+ type ThreadListResponse as ThreadListResponse,
849
+ type ThreadCreateParams as ThreadCreateParams,
850
+ type ThreadListParams as ThreadListParams,
851
+ };
852
+
813
853
  export type AvailableComponent = API.AvailableComponent;
814
854
  export type ComponentContextToolMetadata = API.ComponentContextToolMetadata;
815
855
  export type Resource = API.Resource;
@@ -1,11 +1,11 @@
1
1
  import { type TamboAI } from '../client';
2
2
  import { APIPromise } from '../core/api-promise';
3
3
  import { RequestOptions } from '../internal/request-options';
4
- import { ThreadAdvanceParams, ThreadAdvanceResponse } from '../resources/beta';
4
+ import { ThreadAdvanceByIDParams, ThreadAdvanceResponse } from '../resources/beta';
5
5
 
6
6
  export async function advanceStream(
7
7
  client: TamboAI,
8
- body: ThreadAdvanceParams,
8
+ body: ThreadAdvanceByIDParams,
9
9
  threadId?: string,
10
10
  options?: RequestOptions,
11
11
  ): Promise<AsyncIterable<ThreadAdvanceResponse>> {