@taico/client 0.6.0 → 0.8.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 (33) hide show
  1. package/README.md +1 -1
  2. package/dist/contracts/types.d.ts +363 -3
  3. package/dist/src/v1/client/index.d.ts +7 -0
  4. package/dist/src/v1/client/index.js +2 -0
  5. package/dist/src/v1/client/models/AiProviderConnectionResponseDto.d.ts +49 -0
  6. package/dist/src/v1/client/models/AiProviderConnectionResponseDto.js +13 -0
  7. package/dist/src/v1/client/models/AiProviderResponseDto.d.ts +2 -1
  8. package/dist/src/v1/client/models/AiProviderResponseDto.js +1 -0
  9. package/dist/src/v1/client/models/CompleteAiProviderAuthorizationDto.d.ts +26 -0
  10. package/dist/src/v1/client/models/CompleteAiProviderAuthorizationDto.js +1 -0
  11. package/dist/src/v1/client/models/CreateAiProviderDto.d.ts +2 -1
  12. package/dist/src/v1/client/models/CreateAiProviderDto.js +1 -0
  13. package/dist/src/v1/client/models/DisconnectAiProviderResponseDto.d.ts +6 -0
  14. package/dist/src/v1/client/models/DisconnectAiProviderResponseDto.js +1 -0
  15. package/dist/src/v1/client/models/StartAiProviderAuthorizationResponseDto.d.ts +10 -0
  16. package/dist/src/v1/client/models/StartAiProviderAuthorizationResponseDto.js +1 -0
  17. package/dist/src/v1/client/models/ThreadListItemResponseDto.d.ts +8 -0
  18. package/dist/src/v1/client/models/ThreadTokenUsageResponseDto.d.ts +18 -0
  19. package/dist/src/v1/client/models/ThreadTokenUsageResponseDto.js +1 -0
  20. package/dist/src/v1/client/models/UpdateAiProviderConnectionDto.d.ts +6 -0
  21. package/dist/src/v1/client/models/UpdateAiProviderConnectionDto.js +1 -0
  22. package/dist/src/v1/client/services/AiProviderConnectionsService.d.ts +46 -0
  23. package/dist/src/v1/client/services/AiProviderConnectionsService.js +88 -0
  24. package/dist/src/v1/client/services/ThreadsService.d.ts +16 -1
  25. package/dist/src/v1/client/services/ThreadsService.js +37 -1
  26. package/dist/src/v2/ai-provider-connections-resource.d.ts +32 -0
  27. package/dist/src/v2/ai-provider-connections-resource.js +26 -0
  28. package/dist/src/v2/client.d.ts +2 -0
  29. package/dist/src/v2/client.js +3 -0
  30. package/dist/src/v2/threads-resource.d.ts +12 -2
  31. package/dist/src/v2/threads-resource.js +9 -1
  32. package/dist/src/v2/types.d.ts +39 -2
  33. package/package.json +1 -1
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.8.0)](https://badge.socket.dev/npm/package/@taico/client/0.8.0)
@@ -941,6 +941,59 @@ export interface paths {
941
941
  patch?: never;
942
942
  trace?: never;
943
943
  };
944
+ "/api/v1/ai-providers/{id}/connection": {
945
+ parameters: {
946
+ query?: never;
947
+ header?: never;
948
+ path?: never;
949
+ cookie?: never;
950
+ };
951
+ /** Get your own connection to the provider */
952
+ get: operations["AiProviderConnectionsController_getConnection"];
953
+ put?: never;
954
+ post?: never;
955
+ /** Disconnect your account and revoke its grant at the provider */
956
+ delete: operations["AiProviderConnectionsController_disconnect"];
957
+ options?: never;
958
+ head?: never;
959
+ /** Change what your connection may be used for */
960
+ patch: operations["AiProviderConnectionsController_updateConnection"];
961
+ trace?: never;
962
+ };
963
+ "/api/v1/ai-providers/{id}/connection/authorize": {
964
+ parameters: {
965
+ query?: never;
966
+ header?: never;
967
+ path?: never;
968
+ cookie?: never;
969
+ };
970
+ get?: never;
971
+ put?: never;
972
+ /** Start signing in to the provider with your own account */
973
+ post: operations["AiProviderConnectionsController_startAuthorization"];
974
+ delete?: never;
975
+ options?: never;
976
+ head?: never;
977
+ patch?: never;
978
+ trace?: never;
979
+ };
980
+ "/api/v1/ai-providers/{id}/connection/callback": {
981
+ parameters: {
982
+ query?: never;
983
+ header?: never;
984
+ path?: never;
985
+ cookie?: never;
986
+ };
987
+ get?: never;
988
+ put?: never;
989
+ /** Finish the sign-in you started with what the provider sent back */
990
+ post: operations["AiProviderConnectionsController_completeAuthorization"];
991
+ delete?: never;
992
+ options?: never;
993
+ head?: never;
994
+ patch?: never;
995
+ trace?: never;
996
+ };
944
997
  "/api/v1/secrets": {
945
998
  parameters: {
946
999
  query?: never;
@@ -1436,6 +1489,23 @@ export interface paths {
1436
1489
  patch: operations["ThreadsController_updateThreadState"];
1437
1490
  trace?: never;
1438
1491
  };
1492
+ "/api/v1/threads/{id}/token-usage": {
1493
+ parameters: {
1494
+ query?: never;
1495
+ header?: never;
1496
+ path?: never;
1497
+ cookie?: never;
1498
+ };
1499
+ /** Get the token usage the model provider reported for a thread (debug) */
1500
+ get: operations["ThreadsController_getThreadTokenUsage"];
1501
+ put?: never;
1502
+ post?: never;
1503
+ delete?: never;
1504
+ options?: never;
1505
+ head?: never;
1506
+ patch?: never;
1507
+ trace?: never;
1508
+ };
1439
1509
  "/api/v1/threads/{id}/state/append": {
1440
1510
  parameters: {
1441
1511
  query?: never;
@@ -1460,7 +1530,7 @@ export interface paths {
1460
1530
  path?: never;
1461
1531
  cookie?: never;
1462
1532
  };
1463
- /** List messages in a thread */
1533
+ /** List messages in a thread, newest first */
1464
1534
  get: operations["ThreadsController_listMessages"];
1465
1535
  put?: never;
1466
1536
  /** Create a message in the thread */
@@ -1471,6 +1541,23 @@ export interface paths {
1471
1541
  patch?: never;
1472
1542
  trace?: never;
1473
1543
  };
1544
+ "/api/v1/threads/{id}/read": {
1545
+ parameters: {
1546
+ query?: never;
1547
+ header?: never;
1548
+ path?: never;
1549
+ cookie?: never;
1550
+ };
1551
+ get?: never;
1552
+ put?: never;
1553
+ /** Mark every message in the thread as read by the caller */
1554
+ post: operations["ThreadsController_markThreadRead"];
1555
+ delete?: never;
1556
+ options?: never;
1557
+ head?: never;
1558
+ patch?: never;
1559
+ trace?: never;
1560
+ };
1474
1561
  "/api/v1/agents": {
1475
1562
  parameters: {
1476
1563
  query?: never;
@@ -3694,7 +3781,7 @@ export interface components {
3694
3781
  * @example openai
3695
3782
  * @enum {string}
3696
3783
  */
3697
- type: "openai" | "anthropic" | "google" | "google_vertex" | "xai" | "openai_compatible";
3784
+ type: "openai" | "anthropic" | "google" | "google_vertex" | "xai" | "openai_compatible" | "chatgpt_subscription";
3698
3785
  /**
3699
3786
  * @description ID of the secret containing the API key
3700
3787
  * @example 123e4567-e89b-12d3-a456-426614174000
@@ -3732,7 +3819,7 @@ export interface components {
3732
3819
  * @example openai
3733
3820
  * @enum {string}
3734
3821
  */
3735
- type: "openai" | "anthropic" | "google" | "google_vertex" | "xai" | "openai_compatible";
3822
+ type: "openai" | "anthropic" | "google" | "google_vertex" | "xai" | "openai_compatible" | "chatgpt_subscription";
3736
3823
  /**
3737
3824
  * @description ID of the secret containing the API key
3738
3825
  * @example 123e4567-e89b-12d3-a456-426614174000
@@ -3874,6 +3961,64 @@ export interface components {
3874
3961
  */
3875
3962
  modelId: string;
3876
3963
  };
3964
+ AiProviderConnectionResponseDto: {
3965
+ /** @description AI provider identifier */
3966
+ aiProviderId: string;
3967
+ /**
3968
+ * @description State of your own connection to the provider
3969
+ * @example connected
3970
+ * @enum {string}
3971
+ */
3972
+ status: "connected" | "plan_access_not_granted" | "needs_reauthorization" | "disconnected";
3973
+ /** @description Email of the connected account */
3974
+ accountEmail?: string | null;
3975
+ /** @description Whether requests can run on your plan right now */
3976
+ canUsePlan: boolean;
3977
+ /** @description Whether turns nobody typed (task updates) may run on your plan */
3978
+ automatedTurnsAllowed: boolean;
3979
+ /** @description Whether a sign-in was started and not finished */
3980
+ isAuthorizationPending: boolean;
3981
+ /**
3982
+ * @description The provider's code for the last failed request, cleared by the next success
3983
+ * @example subscription_sharing_usage_limit_exceeded
3984
+ */
3985
+ lastErrorCode?: string | null;
3986
+ /** @description ISO timestamp of the last failed request */
3987
+ lastErrorAt?: string | null;
3988
+ /** @description Where you see and manage your plan usage */
3989
+ manageUsageUrl: string;
3990
+ };
3991
+ StartAiProviderAuthorizationResponseDto: {
3992
+ /** @description Address to open in the browser to sign in at the provider */
3993
+ authorizationUrl: string;
3994
+ /** @description ISO timestamp after which this sign-in can no longer be finished */
3995
+ expiresAt: string;
3996
+ };
3997
+ CompleteAiProviderAuthorizationDto: {
3998
+ /**
3999
+ * @description The full address the browser was sent back to, pasted as is
4000
+ * @example http://127.0.0.1:41873/auth/callback?code=...&state=...
4001
+ */
4002
+ callbackUrl?: string;
4003
+ /** @description The `state` query parameter */
4004
+ state?: string;
4005
+ /** @description The `code` query parameter */
4006
+ code?: string;
4007
+ /** @description The `client_id` query parameter */
4008
+ clientId?: string;
4009
+ /** @description The `error` query parameter */
4010
+ error?: string;
4011
+ /** @description The `error_description` query parameter */
4012
+ errorDescription?: string;
4013
+ };
4014
+ UpdateAiProviderConnectionDto: {
4015
+ /** @description Allow turns nobody typed (task updates in threads you subscribed to) to run on your plan */
4016
+ automatedTurnsAllowed: boolean;
4017
+ };
4018
+ DisconnectAiProviderResponseDto: {
4019
+ /** @description False when the provider could not be told. The tokens stored in Taico are removed either way. */
4020
+ revokedAtProvider: boolean;
4021
+ };
3877
4022
  CreateSecretDto: {
3878
4023
  /**
3879
4024
  * @description Unique name for the secret
@@ -4682,6 +4827,16 @@ export interface components {
4682
4827
  * @example 123e4567-e89b-12d3-a456-426614174000
4683
4828
  */
4684
4829
  stateContextBlockId: string;
4830
+ /**
4831
+ * @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
4832
+ * @example 2026-01-01T00:00:00.000Z
4833
+ */
4834
+ lastActivityAt: string;
4835
+ /**
4836
+ * @description Messages in this thread written by someone else that the caller has not read yet
4837
+ * @example 2
4838
+ */
4839
+ unreadCount: number;
4685
4840
  };
4686
4841
  ThreadListResponseDto: {
4687
4842
  /** @description Array of thread list items */
@@ -4736,6 +4891,28 @@ export interface components {
4736
4891
  */
4737
4892
  content: string;
4738
4893
  };
4894
+ ThreadTokenUsageResponseDto: {
4895
+ /**
4896
+ * @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.
4897
+ * @example 42351
4898
+ */
4899
+ contextTokens: number | null;
4900
+ /**
4901
+ * @description Input tokens summed over every model step in the thread. Null when no step reported a figure.
4902
+ * @example 423512
4903
+ */
4904
+ inputTokens: number | null;
4905
+ /**
4906
+ * @description Output tokens summed over every model step in the thread. Null when no step reported a figure.
4907
+ * @example 8123
4908
+ */
4909
+ outputTokens: number | null;
4910
+ /**
4911
+ * @description Number of model steps that reported token usage
4912
+ * @example 12
4913
+ */
4914
+ steps: number;
4915
+ };
4739
4916
  UpdateThreadStateDto: {
4740
4917
  /**
4741
4918
  * @description New content for the thread state
@@ -8840,6 +9017,131 @@ export interface operations {
8840
9017
  };
8841
9018
  };
8842
9019
  };
9020
+ AiProviderConnectionsController_getConnection: {
9021
+ parameters: {
9022
+ query?: never;
9023
+ header?: never;
9024
+ path: {
9025
+ /** @description AI provider identifier */
9026
+ id: string;
9027
+ };
9028
+ cookie?: never;
9029
+ };
9030
+ requestBody?: never;
9031
+ responses: {
9032
+ 200: {
9033
+ headers: {
9034
+ [name: string]: unknown;
9035
+ };
9036
+ content: {
9037
+ "application/json": components["schemas"]["AiProviderConnectionResponseDto"];
9038
+ };
9039
+ };
9040
+ /** @description AI provider not found */
9041
+ 404: {
9042
+ headers: {
9043
+ [name: string]: unknown;
9044
+ };
9045
+ content?: never;
9046
+ };
9047
+ };
9048
+ };
9049
+ AiProviderConnectionsController_disconnect: {
9050
+ parameters: {
9051
+ query?: never;
9052
+ header?: never;
9053
+ path: {
9054
+ /** @description AI provider identifier */
9055
+ id: string;
9056
+ };
9057
+ cookie?: never;
9058
+ };
9059
+ requestBody?: never;
9060
+ responses: {
9061
+ 200: {
9062
+ headers: {
9063
+ [name: string]: unknown;
9064
+ };
9065
+ content: {
9066
+ "application/json": components["schemas"]["DisconnectAiProviderResponseDto"];
9067
+ };
9068
+ };
9069
+ };
9070
+ };
9071
+ AiProviderConnectionsController_updateConnection: {
9072
+ parameters: {
9073
+ query?: never;
9074
+ header?: never;
9075
+ path: {
9076
+ /** @description AI provider identifier */
9077
+ id: string;
9078
+ };
9079
+ cookie?: never;
9080
+ };
9081
+ requestBody: {
9082
+ content: {
9083
+ "application/json": components["schemas"]["UpdateAiProviderConnectionDto"];
9084
+ };
9085
+ };
9086
+ responses: {
9087
+ 200: {
9088
+ headers: {
9089
+ [name: string]: unknown;
9090
+ };
9091
+ content: {
9092
+ "application/json": components["schemas"]["AiProviderConnectionResponseDto"];
9093
+ };
9094
+ };
9095
+ };
9096
+ };
9097
+ AiProviderConnectionsController_startAuthorization: {
9098
+ parameters: {
9099
+ query?: never;
9100
+ header?: never;
9101
+ path: {
9102
+ /** @description AI provider identifier */
9103
+ id: string;
9104
+ };
9105
+ cookie?: never;
9106
+ };
9107
+ requestBody?: never;
9108
+ responses: {
9109
+ 201: {
9110
+ headers: {
9111
+ [name: string]: unknown;
9112
+ };
9113
+ content: {
9114
+ "application/json": components["schemas"]["StartAiProviderAuthorizationResponseDto"];
9115
+ };
9116
+ };
9117
+ };
9118
+ };
9119
+ AiProviderConnectionsController_completeAuthorization: {
9120
+ parameters: {
9121
+ query?: never;
9122
+ header?: never;
9123
+ path: {
9124
+ /** @description AI provider identifier */
9125
+ id: string;
9126
+ };
9127
+ cookie?: never;
9128
+ };
9129
+ requestBody: {
9130
+ content: {
9131
+ "application/json": components["schemas"]["CompleteAiProviderAuthorizationDto"];
9132
+ };
9133
+ };
9134
+ responses: {
9135
+ 201: {
9136
+ headers: {
9137
+ [name: string]: unknown;
9138
+ };
9139
+ content: {
9140
+ "application/json": components["schemas"]["AiProviderConnectionResponseDto"];
9141
+ };
9142
+ };
9143
+ };
9144
+ };
8843
9145
  SecretsController_listSecrets: {
8844
9146
  parameters: {
8845
9147
  query?: never;
@@ -10253,6 +10555,36 @@ export interface operations {
10253
10555
  };
10254
10556
  };
10255
10557
  };
10558
+ ThreadsController_getThreadTokenUsage: {
10559
+ parameters: {
10560
+ query?: never;
10561
+ header?: never;
10562
+ path: {
10563
+ /** @description Thread UUID */
10564
+ id: string;
10565
+ };
10566
+ cookie?: never;
10567
+ };
10568
+ requestBody?: never;
10569
+ responses: {
10570
+ /** @description Token usage retrieved successfully */
10571
+ 200: {
10572
+ headers: {
10573
+ [name: string]: unknown;
10574
+ };
10575
+ content: {
10576
+ "application/json": components["schemas"]["ThreadTokenUsageResponseDto"];
10577
+ };
10578
+ };
10579
+ /** @description Thread not found */
10580
+ 404: {
10581
+ headers: {
10582
+ [name: string]: unknown;
10583
+ };
10584
+ content?: never;
10585
+ };
10586
+ };
10587
+ };
10256
10588
  ThreadsController_appendThreadState: {
10257
10589
  parameters: {
10258
10590
  query?: never;
@@ -10370,6 +10702,34 @@ export interface operations {
10370
10702
  };
10371
10703
  };
10372
10704
  };
10705
+ ThreadsController_markThreadRead: {
10706
+ parameters: {
10707
+ query?: never;
10708
+ header?: never;
10709
+ path: {
10710
+ /** @description Thread UUID */
10711
+ id: string;
10712
+ };
10713
+ cookie?: never;
10714
+ };
10715
+ requestBody?: never;
10716
+ responses: {
10717
+ /** @description Thread marked as read */
10718
+ 204: {
10719
+ headers: {
10720
+ [name: string]: unknown;
10721
+ };
10722
+ content?: never;
10723
+ };
10724
+ /** @description Thread not found */
10725
+ 404: {
10726
+ headers: {
10727
+ [name: string]: unknown;
10728
+ };
10729
+ content?: never;
10730
+ };
10731
+ };
10732
+ };
10373
10733
  AgentsController_listAgents: {
10374
10734
  parameters: {
10375
10735
  query?: {
@@ -23,6 +23,7 @@ export type { AgentToolPermissionResponseDto } from './models/AgentToolPermissio
23
23
  export type { AgentToolPermissionScopeResponseDto } from './models/AgentToolPermissionScopeResponseDto.js';
24
24
  export { AgentToolPermissionServerResponseDto } from './models/AgentToolPermissionServerResponseDto.js';
25
25
  export { AiModelSelectionResponseDto } from './models/AiModelSelectionResponseDto.js';
26
+ export { AiProviderConnectionResponseDto } from './models/AiProviderConnectionResponseDto.js';
26
27
  export { AiProviderModelResponseDto } from './models/AiProviderModelResponseDto.js';
27
28
  export { AiProviderResponseDto } from './models/AiProviderResponseDto.js';
28
29
  export type { AnswerInputRequestDto } from './models/AnswerInputRequestDto.js';
@@ -42,6 +43,7 @@ export type { ChangePasswordRequestDto } from './models/ChangePasswordRequestDto
42
43
  export { ChangeTaskStatusDto } from './models/ChangeTaskStatusDto.js';
43
44
  export { ClientRegistrationResponseDto } from './models/ClientRegistrationResponseDto.js';
44
45
  export type { CommentResponseDto } from './models/CommentResponseDto.js';
46
+ export type { CompleteAiProviderAuthorizationDto } from './models/CompleteAiProviderAuthorizationDto.js';
45
47
  export { ConnectionFlowResponseDto } from './models/ConnectionFlowResponseDto.js';
46
48
  export type { ConnectionResponseDto } from './models/ConnectionResponseDto.js';
47
49
  export type { ConsentDecisionDto } from './models/ConsentDecisionDto.js';
@@ -71,6 +73,7 @@ export type { DeleteConnectionResponseDto } from './models/DeleteConnectionRespo
71
73
  export type { DeleteMappingResponseDto } from './models/DeleteMappingResponseDto.js';
72
74
  export type { DeleteScopeResponseDto } from './models/DeleteScopeResponseDto.js';
73
75
  export type { DeleteServerResponseDto } from './models/DeleteServerResponseDto.js';
76
+ export type { DisconnectAiProviderResponseDto } from './models/DisconnectAiProviderResponseDto.js';
74
77
  export type { ExecutionStatsResponseDto } from './models/ExecutionStatsResponseDto.js';
75
78
  export { FlowClientDto } from './models/FlowClientDto.js';
76
79
  export type { FlowServerDto } from './models/FlowServerDto.js';
@@ -120,6 +123,7 @@ export type { ServerListResponseDto } from './models/ServerListResponseDto.js';
120
123
  export { ServerResponseDto } from './models/ServerResponseDto.js';
121
124
  export type { SetAiModelSelectionDto } from './models/SetAiModelSelectionDto.js';
122
125
  export type { SetupManagedUserRequestDto } from './models/SetupManagedUserRequestDto.js';
126
+ export type { StartAiProviderAuthorizationResponseDto } from './models/StartAiProviderAuthorizationResponseDto.js';
123
127
  export { StopActiveTaskExecutionDto } from './models/StopActiveTaskExecutionDto.js';
124
128
  export type { TagResponseDto } from './models/TagResponseDto.js';
125
129
  export type { TaskBlueprintListResponseDto } from './models/TaskBlueprintListResponseDto.js';
@@ -139,11 +143,13 @@ export type { ThreadListResponseDto } from './models/ThreadListResponseDto.js';
139
143
  export type { ThreadMessageResponseDto } from './models/ThreadMessageResponseDto.js';
140
144
  export type { ThreadResponseDto } from './models/ThreadResponseDto.js';
141
145
  export type { ThreadStateResponseDto } from './models/ThreadStateResponseDto.js';
146
+ export type { ThreadTokenUsageResponseDto } from './models/ThreadTokenUsageResponseDto.js';
142
147
  export { TokenExchangeRequestDto } from './models/TokenExchangeRequestDto.js';
143
148
  export type { TokenExchangeResponseDto } from './models/TokenExchangeResponseDto.js';
144
149
  export { TokenRequestDto } from './models/TokenRequestDto.js';
145
150
  export { TokenResponseDto } from './models/TokenResponseDto.js';
146
151
  export type { UpdateAgentRunDto } from './models/UpdateAgentRunDto.js';
152
+ export type { UpdateAiProviderConnectionDto } from './models/UpdateAiProviderConnectionDto.js';
147
153
  export type { UpdateAiProviderDto } from './models/UpdateAiProviderDto.js';
148
154
  export type { UpdateBlockDto } from './models/UpdateBlockDto.js';
149
155
  export type { UpdateConnectionDto } from './models/UpdateConnectionDto.js';
@@ -168,6 +174,7 @@ export { AgentExecutionTokensService } from './services/AgentExecutionTokensServ
168
174
  export { AgentRunService } from './services/AgentRunService.js';
169
175
  export { AgentTokensService } from './services/AgentTokensService.js';
170
176
  export { AiModelSelectionsService } from './services/AiModelSelectionsService.js';
177
+ export { AiProviderConnectionsService } from './services/AiProviderConnectionsService.js';
171
178
  export { AiProvidersService } from './services/AiProvidersService.js';
172
179
  export { AppService } from './services/AppService.js';
173
180
  export { AuthorizationJourneysService } from './services/AuthorizationJourneysService.js';
@@ -12,6 +12,7 @@ export { AgentTemplateDto } from './models/AgentTemplateDto.js';
12
12
  export { AgentTemplateHarnessDto } from './models/AgentTemplateHarnessDto.js';
13
13
  export { AgentToolPermissionServerResponseDto } from './models/AgentToolPermissionServerResponseDto.js';
14
14
  export { AiModelSelectionResponseDto } from './models/AiModelSelectionResponseDto.js';
15
+ export { AiProviderConnectionResponseDto } from './models/AiProviderConnectionResponseDto.js';
15
16
  export { AiProviderModelResponseDto } from './models/AiProviderModelResponseDto.js';
16
17
  export { AiProviderResponseDto } from './models/AiProviderResponseDto.js';
17
18
  export { AuthJourneyResponseDto } from './models/AuthJourneyResponseDto.js';
@@ -52,6 +53,7 @@ export { AgentExecutionTokensService } from './services/AgentExecutionTokensServ
52
53
  export { AgentRunService } from './services/AgentRunService.js';
53
54
  export { AgentTokensService } from './services/AgentTokensService.js';
54
55
  export { AiModelSelectionsService } from './services/AiModelSelectionsService.js';
56
+ export { AiProviderConnectionsService } from './services/AiProviderConnectionsService.js';
55
57
  export { AiProvidersService } from './services/AiProvidersService.js';
56
58
  export { AppService } from './services/AppService.js';
57
59
  export { AuthorizationJourneysService } from './services/AuthorizationJourneysService.js';
@@ -0,0 +1,49 @@
1
+ export type AiProviderConnectionResponseDto = {
2
+ /**
3
+ * AI provider identifier
4
+ */
5
+ aiProviderId: string;
6
+ /**
7
+ * State of your own connection to the provider
8
+ */
9
+ status: AiProviderConnectionResponseDto.status;
10
+ /**
11
+ * Email of the connected account
12
+ */
13
+ accountEmail?: string | null;
14
+ /**
15
+ * Whether requests can run on your plan right now
16
+ */
17
+ canUsePlan: boolean;
18
+ /**
19
+ * Whether turns nobody typed (task updates) may run on your plan
20
+ */
21
+ automatedTurnsAllowed: boolean;
22
+ /**
23
+ * Whether a sign-in was started and not finished
24
+ */
25
+ isAuthorizationPending: boolean;
26
+ /**
27
+ * The provider's code for the last failed request, cleared by the next success
28
+ */
29
+ lastErrorCode?: string | null;
30
+ /**
31
+ * ISO timestamp of the last failed request
32
+ */
33
+ lastErrorAt?: string | null;
34
+ /**
35
+ * Where you see and manage your plan usage
36
+ */
37
+ manageUsageUrl: string;
38
+ };
39
+ export declare namespace AiProviderConnectionResponseDto {
40
+ /**
41
+ * State of your own connection to the provider
42
+ */
43
+ enum status {
44
+ CONNECTED = "connected",
45
+ PLAN_ACCESS_NOT_GRANTED = "plan_access_not_granted",
46
+ NEEDS_REAUTHORIZATION = "needs_reauthorization",
47
+ DISCONNECTED = "disconnected"
48
+ }
49
+ }
@@ -0,0 +1,13 @@
1
+ export var AiProviderConnectionResponseDto;
2
+ (function (AiProviderConnectionResponseDto) {
3
+ /**
4
+ * State of your own connection to the provider
5
+ */
6
+ let status;
7
+ (function (status) {
8
+ status["CONNECTED"] = "connected";
9
+ status["PLAN_ACCESS_NOT_GRANTED"] = "plan_access_not_granted";
10
+ status["NEEDS_REAUTHORIZATION"] = "needs_reauthorization";
11
+ status["DISCONNECTED"] = "disconnected";
12
+ })(status = AiProviderConnectionResponseDto.status || (AiProviderConnectionResponseDto.status = {}));
13
+ })(AiProviderConnectionResponseDto || (AiProviderConnectionResponseDto = {}));
@@ -54,6 +54,7 @@ export declare namespace AiProviderResponseDto {
54
54
  GOOGLE = "google",
55
55
  GOOGLE_VERTEX = "google_vertex",
56
56
  XAI = "xai",
57
- OPENAI_COMPATIBLE = "openai_compatible"
57
+ OPENAI_COMPATIBLE = "openai_compatible",
58
+ CHATGPT_SUBSCRIPTION = "chatgpt_subscription"
58
59
  }
59
60
  }
@@ -11,5 +11,6 @@ export var AiProviderResponseDto;
11
11
  type["GOOGLE_VERTEX"] = "google_vertex";
12
12
  type["XAI"] = "xai";
13
13
  type["OPENAI_COMPATIBLE"] = "openai_compatible";
14
+ type["CHATGPT_SUBSCRIPTION"] = "chatgpt_subscription";
14
15
  })(type = AiProviderResponseDto.type || (AiProviderResponseDto.type = {}));
15
16
  })(AiProviderResponseDto || (AiProviderResponseDto = {}));
@@ -0,0 +1,26 @@
1
+ export type CompleteAiProviderAuthorizationDto = {
2
+ /**
3
+ * The full address the browser was sent back to, pasted as is
4
+ */
5
+ callbackUrl?: string;
6
+ /**
7
+ * The `state` query parameter
8
+ */
9
+ state?: string;
10
+ /**
11
+ * The `code` query parameter
12
+ */
13
+ code?: string;
14
+ /**
15
+ * The `client_id` query parameter
16
+ */
17
+ clientId?: string;
18
+ /**
19
+ * The `error` query parameter
20
+ */
21
+ error?: string;
22
+ /**
23
+ * The `error_description` query parameter
24
+ */
25
+ errorDescription?: string;
26
+ };
@@ -34,6 +34,7 @@ export declare namespace CreateAiProviderDto {
34
34
  GOOGLE = "google",
35
35
  GOOGLE_VERTEX = "google_vertex",
36
36
  XAI = "xai",
37
- OPENAI_COMPATIBLE = "openai_compatible"
37
+ OPENAI_COMPATIBLE = "openai_compatible",
38
+ CHATGPT_SUBSCRIPTION = "chatgpt_subscription"
38
39
  }
39
40
  }
@@ -11,5 +11,6 @@ export var CreateAiProviderDto;
11
11
  type["GOOGLE_VERTEX"] = "google_vertex";
12
12
  type["XAI"] = "xai";
13
13
  type["OPENAI_COMPATIBLE"] = "openai_compatible";
14
+ type["CHATGPT_SUBSCRIPTION"] = "chatgpt_subscription";
14
15
  })(type = CreateAiProviderDto.type || (CreateAiProviderDto.type = {}));
15
16
  })(CreateAiProviderDto || (CreateAiProviderDto = {}));
@@ -0,0 +1,6 @@
1
+ export type DisconnectAiProviderResponseDto = {
2
+ /**
3
+ * False when the provider could not be told. The tokens stored in Taico are removed either way.
4
+ */
5
+ revokedAtProvider: boolean;
6
+ };
@@ -0,0 +1,10 @@
1
+ export type StartAiProviderAuthorizationResponseDto = {
2
+ /**
3
+ * Address to open in the browser to sign in at the provider
4
+ */
5
+ authorizationUrl: string;
6
+ /**
7
+ * ISO timestamp after which this sign-in can no longer be finished
8
+ */
9
+ expiresAt: string;
10
+ };
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ export type UpdateAiProviderConnectionDto = {
2
+ /**
3
+ * Allow turns nobody typed (task updates in threads you subscribed to) to run on your plan
4
+ */
5
+ automatedTurnsAllowed: boolean;
6
+ };
@@ -0,0 +1,46 @@
1
+ import type { AiProviderConnectionResponseDto } from '../models/AiProviderConnectionResponseDto.js';
2
+ import type { CompleteAiProviderAuthorizationDto } from '../models/CompleteAiProviderAuthorizationDto.js';
3
+ import type { DisconnectAiProviderResponseDto } from '../models/DisconnectAiProviderResponseDto.js';
4
+ import type { StartAiProviderAuthorizationResponseDto } from '../models/StartAiProviderAuthorizationResponseDto.js';
5
+ import type { UpdateAiProviderConnectionDto } from '../models/UpdateAiProviderConnectionDto.js';
6
+ import type { CancelablePromise } from '../core/CancelablePromise.js';
7
+ import type { OpenAPIConfig } from '../core/OpenAPI.js';
8
+ export declare class AiProviderConnectionsService {
9
+ /**
10
+ * Get your own connection to the provider
11
+ * @param id AI provider identifier
12
+ * @returns AiProviderConnectionResponseDto
13
+ * @throws ApiError
14
+ */
15
+ static aiProviderConnectionsControllerGetConnection(id: string, config?: OpenAPIConfig): CancelablePromise<AiProviderConnectionResponseDto>;
16
+ /**
17
+ * Change what your connection may be used for
18
+ * @param id AI provider identifier
19
+ * @param requestBody
20
+ * @returns AiProviderConnectionResponseDto
21
+ * @throws ApiError
22
+ */
23
+ static aiProviderConnectionsControllerUpdateConnection(id: string, requestBody: UpdateAiProviderConnectionDto, config?: OpenAPIConfig): CancelablePromise<AiProviderConnectionResponseDto>;
24
+ /**
25
+ * Disconnect your account and revoke its grant at the provider
26
+ * @param id AI provider identifier
27
+ * @returns DisconnectAiProviderResponseDto
28
+ * @throws ApiError
29
+ */
30
+ static aiProviderConnectionsControllerDisconnect(id: string, config?: OpenAPIConfig): CancelablePromise<DisconnectAiProviderResponseDto>;
31
+ /**
32
+ * Start signing in to the provider with your own account
33
+ * @param id AI provider identifier
34
+ * @returns StartAiProviderAuthorizationResponseDto
35
+ * @throws ApiError
36
+ */
37
+ static aiProviderConnectionsControllerStartAuthorization(id: string, config?: OpenAPIConfig): CancelablePromise<StartAiProviderAuthorizationResponseDto>;
38
+ /**
39
+ * Finish the sign-in you started with what the provider sent back
40
+ * @param id AI provider identifier
41
+ * @param requestBody
42
+ * @returns AiProviderConnectionResponseDto
43
+ * @throws ApiError
44
+ */
45
+ static aiProviderConnectionsControllerCompleteAuthorization(id: string, requestBody: CompleteAiProviderAuthorizationDto, config?: OpenAPIConfig): CancelablePromise<AiProviderConnectionResponseDto>;
46
+ }
@@ -0,0 +1,88 @@
1
+ import { OpenAPI } from '../core/OpenAPI.js';
2
+ import { request as __request } from '../core/request.js';
3
+ export class AiProviderConnectionsService {
4
+ /**
5
+ * Get your own connection to the provider
6
+ * @param id AI provider identifier
7
+ * @returns AiProviderConnectionResponseDto
8
+ * @throws ApiError
9
+ */
10
+ static aiProviderConnectionsControllerGetConnection(id, config = OpenAPI) {
11
+ return __request(config, {
12
+ method: 'GET',
13
+ url: '/api/v1/ai-providers/{id}/connection',
14
+ path: {
15
+ 'id': id,
16
+ },
17
+ errors: {
18
+ 404: `AI provider not found`,
19
+ },
20
+ });
21
+ }
22
+ /**
23
+ * Change what your connection may be used for
24
+ * @param id AI provider identifier
25
+ * @param requestBody
26
+ * @returns AiProviderConnectionResponseDto
27
+ * @throws ApiError
28
+ */
29
+ static aiProviderConnectionsControllerUpdateConnection(id, requestBody, config = OpenAPI) {
30
+ return __request(config, {
31
+ method: 'PATCH',
32
+ url: '/api/v1/ai-providers/{id}/connection',
33
+ path: {
34
+ 'id': id,
35
+ },
36
+ body: requestBody,
37
+ mediaType: 'application/json',
38
+ });
39
+ }
40
+ /**
41
+ * Disconnect your account and revoke its grant at the provider
42
+ * @param id AI provider identifier
43
+ * @returns DisconnectAiProviderResponseDto
44
+ * @throws ApiError
45
+ */
46
+ static aiProviderConnectionsControllerDisconnect(id, config = OpenAPI) {
47
+ return __request(config, {
48
+ method: 'DELETE',
49
+ url: '/api/v1/ai-providers/{id}/connection',
50
+ path: {
51
+ 'id': id,
52
+ },
53
+ });
54
+ }
55
+ /**
56
+ * Start signing in to the provider with your own account
57
+ * @param id AI provider identifier
58
+ * @returns StartAiProviderAuthorizationResponseDto
59
+ * @throws ApiError
60
+ */
61
+ static aiProviderConnectionsControllerStartAuthorization(id, config = OpenAPI) {
62
+ return __request(config, {
63
+ method: 'POST',
64
+ url: '/api/v1/ai-providers/{id}/connection/authorize',
65
+ path: {
66
+ 'id': id,
67
+ },
68
+ });
69
+ }
70
+ /**
71
+ * Finish the sign-in you started with what the provider sent back
72
+ * @param id AI provider identifier
73
+ * @param requestBody
74
+ * @returns AiProviderConnectionResponseDto
75
+ * @throws ApiError
76
+ */
77
+ static aiProviderConnectionsControllerCompleteAuthorization(id, requestBody, config = OpenAPI) {
78
+ return __request(config, {
79
+ method: 'POST',
80
+ url: '/api/v1/ai-providers/{id}/connection/callback',
81
+ path: {
82
+ 'id': id,
83
+ },
84
+ body: requestBody,
85
+ mediaType: 'application/json',
86
+ });
87
+ }
88
+ }
@@ -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
  }
@@ -0,0 +1,32 @@
1
+ import { BaseClient, ClientConfig } from './base-client.js';
2
+ import type { AiProviderConnectionResponseDto, CompleteAiProviderAuthorizationDto, DisconnectAiProviderResponseDto, StartAiProviderAuthorizationResponseDto, UpdateAiProviderConnectionDto } from './types.js';
3
+ export declare class AiProviderConnectionsResource extends BaseClient {
4
+ constructor(config: ClientConfig);
5
+ /** Get your own connection to the provider */
6
+ AiProviderConnectionsController_getConnection(params: {
7
+ id: string;
8
+ signal?: AbortSignal;
9
+ }): Promise<AiProviderConnectionResponseDto>;
10
+ /** Change what your connection may be used for */
11
+ AiProviderConnectionsController_updateConnection(params: {
12
+ id: string;
13
+ body: UpdateAiProviderConnectionDto;
14
+ signal?: AbortSignal;
15
+ }): Promise<AiProviderConnectionResponseDto>;
16
+ /** Disconnect your account and revoke its grant at the provider */
17
+ AiProviderConnectionsController_disconnect(params: {
18
+ id: string;
19
+ signal?: AbortSignal;
20
+ }): Promise<DisconnectAiProviderResponseDto>;
21
+ /** Start signing in to the provider with your own account */
22
+ AiProviderConnectionsController_startAuthorization(params: {
23
+ id: string;
24
+ signal?: AbortSignal;
25
+ }): Promise<StartAiProviderAuthorizationResponseDto>;
26
+ /** Finish the sign-in you started with what the provider sent back */
27
+ AiProviderConnectionsController_completeAuthorization(params: {
28
+ id: string;
29
+ body: CompleteAiProviderAuthorizationDto;
30
+ signal?: AbortSignal;
31
+ }): Promise<AiProviderConnectionResponseDto>;
32
+ }
@@ -0,0 +1,26 @@
1
+ import { BaseClient } from './base-client.js';
2
+ export class AiProviderConnectionsResource extends BaseClient {
3
+ constructor(config) {
4
+ super(config);
5
+ }
6
+ /** Get your own connection to the provider */
7
+ async AiProviderConnectionsController_getConnection(params) {
8
+ return this.request('GET', `/api/v1/ai-providers/${params.id}/connection`, { signal: params?.signal });
9
+ }
10
+ /** Change what your connection may be used for */
11
+ async AiProviderConnectionsController_updateConnection(params) {
12
+ return this.request('PATCH', `/api/v1/ai-providers/${params.id}/connection`, { body: params.body, signal: params?.signal });
13
+ }
14
+ /** Disconnect your account and revoke its grant at the provider */
15
+ async AiProviderConnectionsController_disconnect(params) {
16
+ return this.request('DELETE', `/api/v1/ai-providers/${params.id}/connection`, { signal: params?.signal });
17
+ }
18
+ /** Start signing in to the provider with your own account */
19
+ async AiProviderConnectionsController_startAuthorization(params) {
20
+ return this.request('POST', `/api/v1/ai-providers/${params.id}/connection/authorize`, { signal: params?.signal });
21
+ }
22
+ /** Finish the sign-in you started with what the provider sent back */
23
+ async AiProviderConnectionsController_completeAuthorization(params) {
24
+ return this.request('POST', `/api/v1/ai-providers/${params.id}/connection/callback`, { body: params.body, signal: params?.signal });
25
+ }
26
+ }
@@ -10,6 +10,7 @@ import { JwksResource } from './jwks-resource.js';
10
10
  import { ActorsResource } from './actors-resource.js';
11
11
  import { AiProvidersResource } from './ai-providers-resource.js';
12
12
  import { AiModelSelectionsResource } from './ai-model-selections-resource.js';
13
+ import { AiProviderConnectionsResource } from './ai-provider-connections-resource.js';
13
14
  import { SecretsResource } from './secrets-resource.js';
14
15
  import { TaskResource } from './task-resource.js';
15
16
  import { AgentrunResource } from './agent-run-resource.js';
@@ -37,6 +38,7 @@ export declare class ApiClient {
37
38
  readonly actors: ActorsResource;
38
39
  readonly aiProviders: AiProvidersResource;
39
40
  readonly aiModelSelections: AiModelSelectionsResource;
41
+ readonly aiProviderConnections: AiProviderConnectionsResource;
40
42
  readonly secrets: SecretsResource;
41
43
  readonly task: TaskResource;
42
44
  readonly agentrun: AgentrunResource;
@@ -9,6 +9,7 @@ import { JwksResource } from './jwks-resource.js';
9
9
  import { ActorsResource } from './actors-resource.js';
10
10
  import { AiProvidersResource } from './ai-providers-resource.js';
11
11
  import { AiModelSelectionsResource } from './ai-model-selections-resource.js';
12
+ import { AiProviderConnectionsResource } from './ai-provider-connections-resource.js';
12
13
  import { SecretsResource } from './secrets-resource.js';
13
14
  import { TaskResource } from './task-resource.js';
14
15
  import { AgentrunResource } from './agent-run-resource.js';
@@ -36,6 +37,7 @@ export class ApiClient {
36
37
  actors;
37
38
  aiProviders;
38
39
  aiModelSelections;
40
+ aiProviderConnections;
39
41
  secrets;
40
42
  task;
41
43
  agentrun;
@@ -63,6 +65,7 @@ export class ApiClient {
63
65
  this.actors = new ActorsResource(config);
64
66
  this.aiProviders = new AiProvidersResource(config);
65
67
  this.aiModelSelections = new AiModelSelectionsResource(config);
68
+ this.aiProviderConnections = new AiProviderConnectionsResource(config);
66
69
  this.secrets = new SecretsResource(config);
67
70
  this.task = new TaskResource(config);
68
71
  this.agentrun = new AgentrunResource(config);
@@ -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
  }
@@ -359,7 +359,7 @@ export interface JwksResponseDto {
359
359
  }
360
360
  export interface CreateAiProviderDto {
361
361
  name: string;
362
- type: 'openai' | 'anthropic' | 'google' | 'google_vertex' | 'xai' | 'openai_compatible';
362
+ type: 'openai' | 'anthropic' | 'google' | 'google_vertex' | 'xai' | 'openai_compatible' | 'chatgpt_subscription';
363
363
  secretId?: string;
364
364
  baseUrl?: string | null;
365
365
  project?: string | null;
@@ -368,7 +368,7 @@ export interface CreateAiProviderDto {
368
368
  export interface AiProviderResponseDto {
369
369
  id: string;
370
370
  name: string;
371
- type: 'openai' | 'anthropic' | 'google' | 'google_vertex' | 'xai' | 'openai_compatible';
371
+ type: 'openai' | 'anthropic' | 'google' | 'google_vertex' | 'xai' | 'openai_compatible' | 'chatgpt_subscription';
372
372
  secretId?: string | null;
373
373
  baseUrl?: string | null;
374
374
  project?: string | null;
@@ -404,6 +404,35 @@ export interface SetAiModelSelectionDto {
404
404
  aiProviderId: string;
405
405
  modelId: string;
406
406
  }
407
+ export interface AiProviderConnectionResponseDto {
408
+ aiProviderId: string;
409
+ status: 'connected' | 'plan_access_not_granted' | 'needs_reauthorization' | 'disconnected';
410
+ accountEmail?: string | null;
411
+ canUsePlan: boolean;
412
+ automatedTurnsAllowed: boolean;
413
+ isAuthorizationPending: boolean;
414
+ lastErrorCode?: string | null;
415
+ lastErrorAt?: string | null;
416
+ manageUsageUrl: string;
417
+ }
418
+ export interface StartAiProviderAuthorizationResponseDto {
419
+ authorizationUrl: string;
420
+ expiresAt: string;
421
+ }
422
+ export interface CompleteAiProviderAuthorizationDto {
423
+ callbackUrl?: string;
424
+ state?: string;
425
+ code?: string;
426
+ clientId?: string;
427
+ error?: string;
428
+ errorDescription?: string;
429
+ }
430
+ export interface UpdateAiProviderConnectionDto {
431
+ automatedTurnsAllowed: boolean;
432
+ }
433
+ export interface DisconnectAiProviderResponseDto {
434
+ revokedAtProvider: boolean;
435
+ }
407
436
  export interface CreateSecretDto {
408
437
  name: string;
409
438
  description?: string;
@@ -620,6 +649,8 @@ export interface ThreadListItemResponseDto {
620
649
  id: string;
621
650
  title: string;
622
651
  stateContextBlockId: string;
652
+ lastActivityAt: string;
653
+ unreadCount: number;
623
654
  }
624
655
  export interface ThreadListResponseDto {
625
656
  items: ThreadListItemResponseDto[];
@@ -640,6 +671,12 @@ export interface AddParticipantDto {
640
671
  export interface ThreadStateResponseDto {
641
672
  content: string;
642
673
  }
674
+ export interface ThreadTokenUsageResponseDto {
675
+ contextTokens: number | null;
676
+ inputTokens: number | null;
677
+ outputTokens: number | null;
678
+ steps: number;
679
+ }
643
680
  export interface UpdateThreadStateDto {
644
681
  content: string;
645
682
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taico/client",
3
- "version": "0.6.0",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "license": "PolyForm-Small-Business-1.0.0",