@taico/client 0.6.0 → 0.7.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.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # @taico/client
2
2
 
3
- [![Socket Badge](https://badge.socket.dev/npm/package/@taico/client/0.6.0)](https://badge.socket.dev/npm/package/@taico/client/0.6.0)
3
+ [![Socket Badge](https://badge.socket.dev/npm/package/@taico/client/0.7.0)](https://badge.socket.dev/npm/package/@taico/client/0.7.0)
@@ -1436,6 +1436,23 @@ export interface paths {
1436
1436
  patch: operations["ThreadsController_updateThreadState"];
1437
1437
  trace?: never;
1438
1438
  };
1439
+ "/api/v1/threads/{id}/token-usage": {
1440
+ parameters: {
1441
+ query?: never;
1442
+ header?: never;
1443
+ path?: never;
1444
+ cookie?: never;
1445
+ };
1446
+ /** Get the token usage the model provider reported for a thread (debug) */
1447
+ get: operations["ThreadsController_getThreadTokenUsage"];
1448
+ put?: never;
1449
+ post?: never;
1450
+ delete?: never;
1451
+ options?: never;
1452
+ head?: never;
1453
+ patch?: never;
1454
+ trace?: never;
1455
+ };
1439
1456
  "/api/v1/threads/{id}/state/append": {
1440
1457
  parameters: {
1441
1458
  query?: never;
@@ -1460,7 +1477,7 @@ export interface paths {
1460
1477
  path?: never;
1461
1478
  cookie?: never;
1462
1479
  };
1463
- /** List messages in a thread */
1480
+ /** List messages in a thread, newest first */
1464
1481
  get: operations["ThreadsController_listMessages"];
1465
1482
  put?: never;
1466
1483
  /** Create a message in the thread */
@@ -1471,6 +1488,23 @@ export interface paths {
1471
1488
  patch?: never;
1472
1489
  trace?: never;
1473
1490
  };
1491
+ "/api/v1/threads/{id}/read": {
1492
+ parameters: {
1493
+ query?: never;
1494
+ header?: never;
1495
+ path?: never;
1496
+ cookie?: never;
1497
+ };
1498
+ get?: never;
1499
+ put?: never;
1500
+ /** Mark every message in the thread as read by the caller */
1501
+ post: operations["ThreadsController_markThreadRead"];
1502
+ delete?: never;
1503
+ options?: never;
1504
+ head?: never;
1505
+ patch?: never;
1506
+ trace?: never;
1507
+ };
1474
1508
  "/api/v1/agents": {
1475
1509
  parameters: {
1476
1510
  query?: never;
@@ -4682,6 +4716,16 @@ export interface components {
4682
4716
  * @example 123e4567-e89b-12d3-a456-426614174000
4683
4717
  */
4684
4718
  stateContextBlockId: string;
4719
+ /**
4720
+ * @description When the latest message people can see was posted, or when the thread was created if it has none. The list is ordered by this, newest first
4721
+ * @example 2026-01-01T00:00:00.000Z
4722
+ */
4723
+ lastActivityAt: string;
4724
+ /**
4725
+ * @description Messages in this thread written by someone else that the caller has not read yet
4726
+ * @example 2
4727
+ */
4728
+ unreadCount: number;
4685
4729
  };
4686
4730
  ThreadListResponseDto: {
4687
4731
  /** @description Array of thread list items */
@@ -4736,6 +4780,28 @@ export interface components {
4736
4780
  */
4737
4781
  content: string;
4738
4782
  };
4783
+ ThreadTokenUsageResponseDto: {
4784
+ /**
4785
+ * @description Input tokens of the most recent model step: roughly the size of the conversation the model reads now. Null when the provider reported no figure.
4786
+ * @example 42351
4787
+ */
4788
+ contextTokens: number | null;
4789
+ /**
4790
+ * @description Input tokens summed over every model step in the thread. Null when no step reported a figure.
4791
+ * @example 423512
4792
+ */
4793
+ inputTokens: number | null;
4794
+ /**
4795
+ * @description Output tokens summed over every model step in the thread. Null when no step reported a figure.
4796
+ * @example 8123
4797
+ */
4798
+ outputTokens: number | null;
4799
+ /**
4800
+ * @description Number of model steps that reported token usage
4801
+ * @example 12
4802
+ */
4803
+ steps: number;
4804
+ };
4739
4805
  UpdateThreadStateDto: {
4740
4806
  /**
4741
4807
  * @description New content for the thread state
@@ -10253,6 +10319,36 @@ export interface operations {
10253
10319
  };
10254
10320
  };
10255
10321
  };
10322
+ ThreadsController_getThreadTokenUsage: {
10323
+ parameters: {
10324
+ query?: never;
10325
+ header?: never;
10326
+ path: {
10327
+ /** @description Thread UUID */
10328
+ id: string;
10329
+ };
10330
+ cookie?: never;
10331
+ };
10332
+ requestBody?: never;
10333
+ responses: {
10334
+ /** @description Token usage retrieved successfully */
10335
+ 200: {
10336
+ headers: {
10337
+ [name: string]: unknown;
10338
+ };
10339
+ content: {
10340
+ "application/json": components["schemas"]["ThreadTokenUsageResponseDto"];
10341
+ };
10342
+ };
10343
+ /** @description Thread not found */
10344
+ 404: {
10345
+ headers: {
10346
+ [name: string]: unknown;
10347
+ };
10348
+ content?: never;
10349
+ };
10350
+ };
10351
+ };
10256
10352
  ThreadsController_appendThreadState: {
10257
10353
  parameters: {
10258
10354
  query?: never;
@@ -10370,6 +10466,34 @@ export interface operations {
10370
10466
  };
10371
10467
  };
10372
10468
  };
10469
+ ThreadsController_markThreadRead: {
10470
+ parameters: {
10471
+ query?: never;
10472
+ header?: never;
10473
+ path: {
10474
+ /** @description Thread UUID */
10475
+ id: string;
10476
+ };
10477
+ cookie?: never;
10478
+ };
10479
+ requestBody?: never;
10480
+ responses: {
10481
+ /** @description Thread marked as read */
10482
+ 204: {
10483
+ headers: {
10484
+ [name: string]: unknown;
10485
+ };
10486
+ content?: never;
10487
+ };
10488
+ /** @description Thread not found */
10489
+ 404: {
10490
+ headers: {
10491
+ [name: string]: unknown;
10492
+ };
10493
+ content?: never;
10494
+ };
10495
+ };
10496
+ };
10373
10497
  AgentsController_listAgents: {
10374
10498
  parameters: {
10375
10499
  query?: {
@@ -139,6 +139,7 @@ export type { ThreadListResponseDto } from './models/ThreadListResponseDto.js';
139
139
  export type { ThreadMessageResponseDto } from './models/ThreadMessageResponseDto.js';
140
140
  export type { ThreadResponseDto } from './models/ThreadResponseDto.js';
141
141
  export type { ThreadStateResponseDto } from './models/ThreadStateResponseDto.js';
142
+ export type { ThreadTokenUsageResponseDto } from './models/ThreadTokenUsageResponseDto.js';
142
143
  export { TokenExchangeRequestDto } from './models/TokenExchangeRequestDto.js';
143
144
  export type { TokenExchangeResponseDto } from './models/TokenExchangeResponseDto.js';
144
145
  export { TokenRequestDto } from './models/TokenRequestDto.js';
@@ -11,4 +11,12 @@ export type ThreadListItemResponseDto = {
11
11
  * State context block ID that tracks the evolving state of this thread
12
12
  */
13
13
  stateContextBlockId: string;
14
+ /**
15
+ * When the latest message people can see was posted, or when the thread was created if it has none. The list is ordered by this, newest first
16
+ */
17
+ lastActivityAt: string;
18
+ /**
19
+ * Messages in this thread written by someone else that the caller has not read yet
20
+ */
21
+ unreadCount: number;
14
22
  };
@@ -0,0 +1,18 @@
1
+ export type ThreadTokenUsageResponseDto = {
2
+ /**
3
+ * Input tokens of the most recent model step: roughly the size of the conversation the model reads now. Null when the provider reported no figure.
4
+ */
5
+ contextTokens: number | null;
6
+ /**
7
+ * Input tokens summed over every model step in the thread. Null when no step reported a figure.
8
+ */
9
+ inputTokens: number | null;
10
+ /**
11
+ * Output tokens summed over every model step in the thread. Null when no step reported a figure.
12
+ */
13
+ outputTokens: number | null;
14
+ /**
15
+ * Number of model steps that reported token usage
16
+ */
17
+ steps: number;
18
+ };
@@ -10,6 +10,7 @@ import type { ThreadListResponseDto } from '../models/ThreadListResponseDto.js';
10
10
  import type { ThreadMessageResponseDto } from '../models/ThreadMessageResponseDto.js';
11
11
  import type { ThreadResponseDto } from '../models/ThreadResponseDto.js';
12
12
  import type { ThreadStateResponseDto } from '../models/ThreadStateResponseDto.js';
13
+ import type { ThreadTokenUsageResponseDto } from '../models/ThreadTokenUsageResponseDto.js';
13
14
  import type { UpdateThreadDto } from '../models/UpdateThreadDto.js';
14
15
  import type { UpdateThreadStateDto } from '../models/UpdateThreadStateDto.js';
15
16
  import type { CancelablePromise } from '../core/CancelablePromise.js';
@@ -121,6 +122,13 @@ export declare class ThreadsService {
121
122
  * @throws ApiError
122
123
  */
123
124
  static threadsControllerUpdateThreadState(id: string, requestBody: UpdateThreadStateDto, config?: OpenAPIConfig): CancelablePromise<ThreadStateResponseDto>;
125
+ /**
126
+ * Get the token usage the model provider reported for a thread (debug)
127
+ * @param id Thread UUID
128
+ * @returns ThreadTokenUsageResponseDto Token usage retrieved successfully
129
+ * @throws ApiError
130
+ */
131
+ static threadsControllerGetThreadTokenUsage(id: string, config?: OpenAPIConfig): CancelablePromise<ThreadTokenUsageResponseDto>;
124
132
  /**
125
133
  * Append content to the state of a thread
126
134
  * @param id Thread UUID
@@ -138,7 +146,7 @@ export declare class ThreadsService {
138
146
  */
139
147
  static threadsControllerCreateMessage(id: string, requestBody: CreateThreadMessageDto, config?: OpenAPIConfig): CancelablePromise<ThreadMessageResponseDto>;
140
148
  /**
141
- * List messages in a thread
149
+ * List messages in a thread, newest first
142
150
  * @param id Thread UUID
143
151
  * @param page Page number
144
152
  * @param limit Number of items per page
@@ -146,4 +154,11 @@ export declare class ThreadsService {
146
154
  * @throws ApiError
147
155
  */
148
156
  static threadsControllerListMessages(id: string, page?: number, limit?: number, config?: OpenAPIConfig): CancelablePromise<ListThreadMessagesResponseDto>;
157
+ /**
158
+ * Mark every message in the thread as read by the caller
159
+ * @param id Thread UUID
160
+ * @returns void
161
+ * @throws ApiError
162
+ */
163
+ static threadsControllerMarkThreadRead(id: string, config?: OpenAPIConfig): CancelablePromise<void>;
149
164
  }
@@ -271,6 +271,24 @@ export class ThreadsService {
271
271
  },
272
272
  });
273
273
  }
274
+ /**
275
+ * Get the token usage the model provider reported for a thread (debug)
276
+ * @param id Thread UUID
277
+ * @returns ThreadTokenUsageResponseDto Token usage retrieved successfully
278
+ * @throws ApiError
279
+ */
280
+ static threadsControllerGetThreadTokenUsage(id, config = OpenAPI) {
281
+ return __request(config, {
282
+ method: 'GET',
283
+ url: '/api/v1/threads/{id}/token-usage',
284
+ path: {
285
+ 'id': id,
286
+ },
287
+ errors: {
288
+ 404: `Thread not found`,
289
+ },
290
+ });
291
+ }
274
292
  /**
275
293
  * Append content to the state of a thread
276
294
  * @param id Thread UUID
@@ -316,7 +334,7 @@ export class ThreadsService {
316
334
  });
317
335
  }
318
336
  /**
319
- * List messages in a thread
337
+ * List messages in a thread, newest first
320
338
  * @param id Thread UUID
321
339
  * @param page Page number
322
340
  * @param limit Number of items per page
@@ -339,4 +357,22 @@ export class ThreadsService {
339
357
  },
340
358
  });
341
359
  }
360
+ /**
361
+ * Mark every message in the thread as read by the caller
362
+ * @param id Thread UUID
363
+ * @returns void
364
+ * @throws ApiError
365
+ */
366
+ static threadsControllerMarkThreadRead(id, config = OpenAPI) {
367
+ return __request(config, {
368
+ method: 'POST',
369
+ url: '/api/v1/threads/{id}/read',
370
+ path: {
371
+ 'id': id,
372
+ },
373
+ errors: {
374
+ 404: `Thread not found`,
375
+ },
376
+ });
377
+ }
342
378
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseClient, ClientConfig } from './base-client.js';
2
- import type { AddParticipantDto, AppendThreadStateDto, AttachTaskDto, CreateTagDto, CreateThreadDto, CreateThreadMessageDto, ListThreadMessagesResponseDto, ReferenceContextBlockDto, ThreadListResponseDto, ThreadMessageResponseDto, ThreadResponseDto, ThreadStateResponseDto, UpdateThreadDto, UpdateThreadStateDto } from './types.js';
2
+ import type { AddParticipantDto, AppendThreadStateDto, AttachTaskDto, CreateTagDto, CreateThreadDto, CreateThreadMessageDto, ListThreadMessagesResponseDto, ReferenceContextBlockDto, ThreadListResponseDto, ThreadMessageResponseDto, ThreadResponseDto, ThreadStateResponseDto, ThreadTokenUsageResponseDto, UpdateThreadDto, UpdateThreadStateDto } from './types.js';
3
3
  export declare class ThreadsResource extends BaseClient {
4
4
  constructor(config: ClientConfig);
5
5
  /** Create a new thread */
@@ -80,6 +80,11 @@ export declare class ThreadsResource extends BaseClient {
80
80
  body: UpdateThreadStateDto;
81
81
  signal?: AbortSignal;
82
82
  }): Promise<ThreadStateResponseDto>;
83
+ /** Get the token usage the model provider reported for a thread (debug) */
84
+ ThreadsController_getThreadTokenUsage(params: {
85
+ id: string;
86
+ signal?: AbortSignal;
87
+ }): Promise<ThreadTokenUsageResponseDto>;
83
88
  /** Append content to the state of a thread */
84
89
  ThreadsController_appendThreadState(params: {
85
90
  id: string;
@@ -92,11 +97,16 @@ export declare class ThreadsResource extends BaseClient {
92
97
  body: CreateThreadMessageDto;
93
98
  signal?: AbortSignal;
94
99
  }): Promise<ThreadMessageResponseDto>;
95
- /** List messages in a thread */
100
+ /** List messages in a thread, newest first */
96
101
  ThreadsController_listMessages(params: {
97
102
  id: string;
98
103
  page?: number;
99
104
  limit?: number;
100
105
  signal?: AbortSignal;
101
106
  }): Promise<ListThreadMessagesResponseDto>;
107
+ /** Mark every message in the thread as read by the caller */
108
+ ThreadsController_markThreadRead(params: {
109
+ id: string;
110
+ signal?: AbortSignal;
111
+ }): Promise<void>;
102
112
  }
@@ -59,6 +59,10 @@ export class ThreadsResource extends BaseClient {
59
59
  async ThreadsController_updateThreadState(params) {
60
60
  return this.request('PATCH', `/api/v1/threads/${params.id}/state`, { body: params.body, signal: params?.signal });
61
61
  }
62
+ /** Get the token usage the model provider reported for a thread (debug) */
63
+ async ThreadsController_getThreadTokenUsage(params) {
64
+ return this.request('GET', `/api/v1/threads/${params.id}/token-usage`, { signal: params?.signal });
65
+ }
62
66
  /** Append content to the state of a thread */
63
67
  async ThreadsController_appendThreadState(params) {
64
68
  return this.request('POST', `/api/v1/threads/${params.id}/state/append`, { body: params.body, signal: params?.signal });
@@ -67,8 +71,12 @@ export class ThreadsResource extends BaseClient {
67
71
  async ThreadsController_createMessage(params) {
68
72
  return this.request('POST', `/api/v1/threads/${params.id}/messages`, { body: params.body, signal: params?.signal });
69
73
  }
70
- /** List messages in a thread */
74
+ /** List messages in a thread, newest first */
71
75
  async ThreadsController_listMessages(params) {
72
76
  return this.request('GET', `/api/v1/threads/${params.id}/messages`, { params: { page: params.page, limit: params.limit }, signal: params?.signal });
73
77
  }
78
+ /** Mark every message in the thread as read by the caller */
79
+ async ThreadsController_markThreadRead(params) {
80
+ return this.request('POST', `/api/v1/threads/${params.id}/read`, { responseType: 'void', signal: params?.signal });
81
+ }
74
82
  }
@@ -620,6 +620,8 @@ export interface ThreadListItemResponseDto {
620
620
  id: string;
621
621
  title: string;
622
622
  stateContextBlockId: string;
623
+ lastActivityAt: string;
624
+ unreadCount: number;
623
625
  }
624
626
  export interface ThreadListResponseDto {
625
627
  items: ThreadListItemResponseDto[];
@@ -640,6 +642,12 @@ export interface AddParticipantDto {
640
642
  export interface ThreadStateResponseDto {
641
643
  content: string;
642
644
  }
645
+ export interface ThreadTokenUsageResponseDto {
646
+ contextTokens: number | null;
647
+ inputTokens: number | null;
648
+ outputTokens: number | null;
649
+ steps: number;
650
+ }
643
651
  export interface UpdateThreadStateDto {
644
652
  content: string;
645
653
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taico/client",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "PolyForm-Small-Business-1.0.0",