@tambo-ai/typescript-sdk 0.86.0 → 0.87.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 (51) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/index.d.mts +1 -1
  10. package/resources/index.d.mts.map +1 -1
  11. package/resources/index.d.ts +1 -1
  12. package/resources/index.d.ts.map +1 -1
  13. package/resources/index.js.map +1 -1
  14. package/resources/index.mjs.map +1 -1
  15. package/resources/threads/index.d.mts +1 -1
  16. package/resources/threads/index.d.mts.map +1 -1
  17. package/resources/threads/index.d.ts +1 -1
  18. package/resources/threads/index.d.ts.map +1 -1
  19. package/resources/threads/index.js.map +1 -1
  20. package/resources/threads/index.mjs.map +1 -1
  21. package/resources/threads/runs.d.mts +12 -4
  22. package/resources/threads/runs.d.mts.map +1 -1
  23. package/resources/threads/runs.d.ts +12 -4
  24. package/resources/threads/runs.d.ts.map +1 -1
  25. package/resources/threads/state.d.mts +24 -38
  26. package/resources/threads/state.d.mts.map +1 -1
  27. package/resources/threads/state.d.ts +24 -38
  28. package/resources/threads/state.d.ts.map +1 -1
  29. package/resources/threads/state.js +1 -4
  30. package/resources/threads/state.js.map +1 -1
  31. package/resources/threads/state.mjs +1 -4
  32. package/resources/threads/state.mjs.map +1 -1
  33. package/resources/threads/threads.d.mts +28 -22
  34. package/resources/threads/threads.d.mts.map +1 -1
  35. package/resources/threads/threads.d.ts +28 -22
  36. package/resources/threads/threads.d.ts.map +1 -1
  37. package/resources/threads/threads.js +3 -3
  38. package/resources/threads/threads.js.map +1 -1
  39. package/resources/threads/threads.mjs +3 -3
  40. package/resources/threads/threads.mjs.map +1 -1
  41. package/src/client.ts +2 -0
  42. package/src/resources/index.ts +1 -0
  43. package/src/resources/threads/index.ts +1 -0
  44. package/src/resources/threads/runs.ts +15 -5
  45. package/src/resources/threads/state.ts +27 -41
  46. package/src/resources/threads/threads.ts +38 -26
  47. package/src/version.ts +1 -1
  48. package/version.d.mts +1 -1
  49. package/version.d.ts +1 -1
  50. package/version.js +1 -1
  51. package/version.mjs +1 -1
@@ -14,10 +14,7 @@ export class State extends APIResource {
14
14
  * ```ts
15
15
  * const response = await client.threads.state.updateState(
16
16
  * 'comp_xyz789abc',
17
- * {
18
- * threadId: 'thr_abc123xyz',
19
- * state: { foo: 'bar' },
20
- * },
17
+ * { threadId: 'thr_abc123xyz' },
21
18
  * );
22
19
  * ```
23
20
  */
@@ -41,55 +38,44 @@ export interface StateUpdateStateResponse {
41
38
  state: unknown;
42
39
  }
43
40
 
44
- export type StateUpdateStateParams = StateUpdateStateParams.Variant0 | StateUpdateStateParams.Variant1;
41
+ export interface StateUpdateStateParams {
42
+ /**
43
+ * Path param: Thread ID
44
+ */
45
+ threadId: string;
46
+
47
+ /**
48
+ * Body param: JSON Patch operations to apply to current state
49
+ */
50
+ patch?: Array<StateUpdateStateParams.Patch>;
45
51
 
46
- export declare namespace StateUpdateStateParams {
47
- export interface Variant0 {
52
+ /**
53
+ * Body param: Full replacement state object
54
+ */
55
+ state?: unknown;
56
+ }
57
+
58
+ export namespace StateUpdateStateParams {
59
+ export interface Patch {
48
60
  /**
49
- * Path param: Thread ID
61
+ * Operation type
50
62
  */
51
- threadId: string;
63
+ op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
52
64
 
53
65
  /**
54
- * Body param
66
+ * JSON Pointer path to the target location
55
67
  */
56
- state: { [key: string]: unknown };
57
- }
68
+ path: string;
58
69
 
59
- export interface Variant1 {
60
70
  /**
61
- * Path param: Thread ID
71
+ * Source path for move and copy operations
62
72
  */
63
- threadId: string;
73
+ from?: string;
64
74
 
65
75
  /**
66
- * Body param
76
+ * Value to add, replace, or test (required for add, replace, test)
67
77
  */
68
- patch: Array<Variant1.Patch>;
69
- }
70
-
71
- export namespace Variant1 {
72
- export interface Patch {
73
- /**
74
- * Operation type
75
- */
76
- op: 'add' | 'remove' | 'replace' | 'move' | 'copy' | 'test';
77
-
78
- /**
79
- * JSON Pointer path to the target location
80
- */
81
- path: string;
82
-
83
- /**
84
- * Source path for move and copy operations
85
- */
86
- from?: string;
87
-
88
- /**
89
- * Value to add, replace, or test (required for add, replace, test)
90
- */
91
- value?: unknown;
92
- }
78
+ value?: unknown;
93
79
  }
94
80
  }
95
81
 
@@ -58,13 +58,17 @@ export class Threads extends APIResource {
58
58
  * );
59
59
  * ```
60
60
  */
61
- retrieve(threadID: string, options?: RequestOptions): APIPromise<ThreadRetrieveResponse> {
62
- return this._client.get(path`/v1/threads/${threadID}`, options);
61
+ retrieve(
62
+ threadID: string,
63
+ query: ThreadRetrieveParams | null | undefined = {},
64
+ options?: RequestOptions,
65
+ ): APIPromise<ThreadRetrieveResponse> {
66
+ return this._client.get(path`/v1/threads/${threadID}`, { query, ...options });
63
67
  }
64
68
 
65
69
  /**
66
70
  * List all threads for the authenticated project. Supports cursor-based pagination
67
- * and filtering by context key.
71
+ * and filtering by user key.
68
72
  *
69
73
  * @example
70
74
  * ```ts
@@ -223,11 +227,6 @@ export interface ThreadCreateResponse {
223
227
  */
224
228
  updatedAt: string;
225
229
 
226
- /**
227
- * Optional context key for thread organization
228
- */
229
- contextKey?: string;
230
-
231
230
  /**
232
231
  * ID of the currently active run (when not idle)
233
232
  */
@@ -264,6 +263,11 @@ export interface ThreadCreateResponse {
264
263
  * Human-readable status message (e.g., 'Fetching weather data...')
265
264
  */
266
265
  statusMessage?: string;
266
+
267
+ /**
268
+ * Optional user key for thread organization
269
+ */
270
+ userKey?: string;
267
271
  }
268
272
 
269
273
  export interface ThreadRetrieveResponse {
@@ -293,11 +297,6 @@ export interface ThreadRetrieveResponse {
293
297
  */
294
298
  updatedAt: string;
295
299
 
296
- /**
297
- * Optional context key for thread organization
298
- */
299
- contextKey?: string;
300
-
301
300
  /**
302
301
  * ID of the currently active run (when not idle)
303
302
  */
@@ -334,6 +333,11 @@ export interface ThreadRetrieveResponse {
334
333
  * Human-readable status message (e.g., 'Fetching weather data...')
335
334
  */
336
335
  statusMessage?: string;
336
+
337
+ /**
338
+ * Optional user key for thread organization
339
+ */
340
+ userKey?: string;
337
341
  }
338
342
 
339
343
  export namespace ThreadRetrieveResponse {
@@ -411,11 +415,6 @@ export namespace ThreadListResponse {
411
415
  */
412
416
  updatedAt: string;
413
417
 
414
- /**
415
- * Optional context key for thread organization
416
- */
417
- contextKey?: string;
418
-
419
418
  /**
420
419
  * ID of the currently active run (when not idle)
421
420
  */
@@ -452,15 +451,15 @@ export namespace ThreadListResponse {
452
451
  * Human-readable status message (e.g., 'Fetching weather data...')
453
452
  */
454
453
  statusMessage?: string;
454
+
455
+ /**
456
+ * Optional user key for thread organization
457
+ */
458
+ userKey?: string;
455
459
  }
456
460
  }
457
461
 
458
462
  export interface ThreadCreateParams {
459
- /**
460
- * Optional context key for thread organization
461
- */
462
- contextKey?: string;
463
-
464
463
  /**
465
464
  * Initial messages to seed the thread with
466
465
  */
@@ -470,14 +469,21 @@ export interface ThreadCreateParams {
470
469
  * Additional metadata to attach to the thread
471
470
  */
472
471
  metadata?: unknown;
472
+
473
+ /**
474
+ * Optional user key for thread organization
475
+ */
476
+ userKey?: string;
473
477
  }
474
478
 
475
- export interface ThreadListParams {
479
+ export interface ThreadRetrieveParams {
476
480
  /**
477
- * Filter by context key
481
+ * Optional user key for thread organization
478
482
  */
479
- contextKey?: string;
483
+ userKey?: string;
484
+ }
480
485
 
486
+ export interface ThreadListParams {
481
487
  /**
482
488
  * Cursor for pagination
483
489
  */
@@ -487,6 +493,11 @@ export interface ThreadListParams {
487
493
  * Maximum number of threads to return
488
494
  */
489
495
  limit?: string;
496
+
497
+ /**
498
+ * Filter by user key
499
+ */
500
+ userKey?: string;
490
501
  }
491
502
 
492
503
  Threads.State = State;
@@ -505,6 +516,7 @@ export declare namespace Threads {
505
516
  type ThreadRetrieveResponse as ThreadRetrieveResponse,
506
517
  type ThreadListResponse as ThreadListResponse,
507
518
  type ThreadCreateParams as ThreadCreateParams,
519
+ type ThreadRetrieveParams as ThreadRetrieveParams,
508
520
  type ThreadListParams as ThreadListParams,
509
521
  };
510
522
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.86.0'; // x-release-please-version
1
+ export const VERSION = '0.87.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.0";
1
+ export declare const VERSION = "0.87.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.86.0";
1
+ export declare const VERSION = "0.87.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.86.0'; // x-release-please-version
4
+ exports.VERSION = '0.87.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.86.0'; // x-release-please-version
1
+ export const VERSION = '0.87.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map