@agent-os-sdk/client 0.9.25 → 0.9.26

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 (184) hide show
  1. package/package.json +15 -8
  2. package/src/generated/openapi.ts +82 -0
  3. package/src/generated/swagger.json +163 -0
  4. package/src/modules/templates.ts +35 -0
  5. package/dist/client/AgentOsClient.d.ts +0 -141
  6. package/dist/client/AgentOsClient.d.ts.map +0 -1
  7. package/dist/client/AgentOsClient.js +0 -250
  8. package/dist/client/HttpRequestBuilder.d.ts +0 -50
  9. package/dist/client/HttpRequestBuilder.d.ts.map +0 -1
  10. package/dist/client/HttpRequestBuilder.js +0 -83
  11. package/dist/client/OperationContext.d.ts +0 -19
  12. package/dist/client/OperationContext.d.ts.map +0 -1
  13. package/dist/client/OperationContext.js +0 -13
  14. package/dist/client/OperationContextProvider.d.ts +0 -54
  15. package/dist/client/OperationContextProvider.d.ts.map +0 -1
  16. package/dist/client/OperationContextProvider.js +0 -71
  17. package/dist/client/auth.d.ts +0 -100
  18. package/dist/client/auth.d.ts.map +0 -1
  19. package/dist/client/auth.js +0 -38
  20. package/dist/client/config.d.ts +0 -49
  21. package/dist/client/config.d.ts.map +0 -1
  22. package/dist/client/config.js +0 -62
  23. package/dist/client/helpers.d.ts +0 -63
  24. package/dist/client/helpers.d.ts.map +0 -1
  25. package/dist/client/helpers.js +0 -55
  26. package/dist/client/pagination.d.ts +0 -105
  27. package/dist/client/pagination.d.ts.map +0 -1
  28. package/dist/client/pagination.js +0 -117
  29. package/dist/client/raw.d.ts +0 -277
  30. package/dist/client/raw.d.ts.map +0 -1
  31. package/dist/client/raw.js +0 -337
  32. package/dist/client/retry.d.ts +0 -37
  33. package/dist/client/retry.d.ts.map +0 -1
  34. package/dist/client/retry.js +0 -108
  35. package/dist/client/sanitize.d.ts +0 -19
  36. package/dist/client/sanitize.d.ts.map +0 -1
  37. package/dist/client/sanitize.js +0 -28
  38. package/dist/client/timeout.d.ts +0 -26
  39. package/dist/client/timeout.d.ts.map +0 -1
  40. package/dist/client/timeout.js +0 -51
  41. package/dist/errors/factory.d.ts +0 -22
  42. package/dist/errors/factory.d.ts.map +0 -1
  43. package/dist/errors/factory.js +0 -101
  44. package/dist/errors/index.d.ts +0 -210
  45. package/dist/errors/index.d.ts.map +0 -1
  46. package/dist/errors/index.js +0 -283
  47. package/dist/generated/client.d.ts +0 -20
  48. package/dist/generated/client.d.ts.map +0 -1
  49. package/dist/generated/client.js +0 -15
  50. package/dist/generated/index.d.ts +0 -2
  51. package/dist/generated/index.d.ts.map +0 -1
  52. package/dist/generated/index.js +0 -1
  53. package/dist/generated/openapi.d.ts +0 -12302
  54. package/dist/generated/openapi.d.ts.map +0 -1
  55. package/dist/generated/openapi.js +0 -5
  56. package/dist/index.d.ts +0 -69
  57. package/dist/index.d.ts.map +0 -1
  58. package/dist/index.js +0 -81
  59. package/dist/modules/a2a.d.ts +0 -48
  60. package/dist/modules/a2a.d.ts.map +0 -1
  61. package/dist/modules/a2a.js +0 -37
  62. package/dist/modules/agents.d.ts +0 -346
  63. package/dist/modules/agents.d.ts.map +0 -1
  64. package/dist/modules/agents.js +0 -296
  65. package/dist/modules/apiTokens.d.ts +0 -62
  66. package/dist/modules/apiTokens.d.ts.map +0 -1
  67. package/dist/modules/apiTokens.js +0 -56
  68. package/dist/modules/approvals.d.ts +0 -75
  69. package/dist/modules/approvals.d.ts.map +0 -1
  70. package/dist/modules/approvals.js +0 -91
  71. package/dist/modules/audit.d.ts +0 -78
  72. package/dist/modules/audit.d.ts.map +0 -1
  73. package/dist/modules/audit.js +0 -94
  74. package/dist/modules/auth.d.ts +0 -28
  75. package/dist/modules/auth.d.ts.map +0 -1
  76. package/dist/modules/auth.js +0 -22
  77. package/dist/modules/builder.d.ts +0 -242
  78. package/dist/modules/builder.d.ts.map +0 -1
  79. package/dist/modules/builder.js +0 -248
  80. package/dist/modules/catalog.d.ts +0 -142
  81. package/dist/modules/catalog.d.ts.map +0 -1
  82. package/dist/modules/catalog.js +0 -136
  83. package/dist/modules/chatwoot.d.ts +0 -59
  84. package/dist/modules/chatwoot.d.ts.map +0 -1
  85. package/dist/modules/chatwoot.js +0 -200
  86. package/dist/modules/checkpoints.d.ts +0 -62
  87. package/dist/modules/checkpoints.d.ts.map +0 -1
  88. package/dist/modules/checkpoints.js +0 -48
  89. package/dist/modules/contracts.d.ts +0 -48
  90. package/dist/modules/contracts.d.ts.map +0 -1
  91. package/dist/modules/contracts.js +0 -25
  92. package/dist/modules/credentials.d.ts +0 -105
  93. package/dist/modules/credentials.d.ts.map +0 -1
  94. package/dist/modules/credentials.js +0 -135
  95. package/dist/modules/crons.d.ts +0 -73
  96. package/dist/modules/crons.d.ts.map +0 -1
  97. package/dist/modules/crons.js +0 -67
  98. package/dist/modules/datasets.d.ts +0 -80
  99. package/dist/modules/datasets.d.ts.map +0 -1
  100. package/dist/modules/datasets.js +0 -91
  101. package/dist/modules/evaluation.d.ts +0 -183
  102. package/dist/modules/evaluation.d.ts.map +0 -1
  103. package/dist/modules/evaluation.js +0 -108
  104. package/dist/modules/files.d.ts +0 -89
  105. package/dist/modules/files.d.ts.map +0 -1
  106. package/dist/modules/files.js +0 -133
  107. package/dist/modules/graphs.d.ts +0 -120
  108. package/dist/modules/graphs.d.ts.map +0 -1
  109. package/dist/modules/graphs.js +0 -69
  110. package/dist/modules/improvements.d.ts +0 -52
  111. package/dist/modules/improvements.d.ts.map +0 -1
  112. package/dist/modules/improvements.js +0 -27
  113. package/dist/modules/info.d.ts +0 -76
  114. package/dist/modules/info.d.ts.map +0 -1
  115. package/dist/modules/info.js +0 -93
  116. package/dist/modules/knowledge.d.ts +0 -91
  117. package/dist/modules/knowledge.d.ts.map +0 -1
  118. package/dist/modules/knowledge.js +0 -80
  119. package/dist/modules/me.d.ts +0 -58
  120. package/dist/modules/me.d.ts.map +0 -1
  121. package/dist/modules/me.js +0 -28
  122. package/dist/modules/members.d.ts +0 -124
  123. package/dist/modules/members.d.ts.map +0 -1
  124. package/dist/modules/members.js +0 -142
  125. package/dist/modules/memberships.d.ts +0 -25
  126. package/dist/modules/memberships.d.ts.map +0 -1
  127. package/dist/modules/memberships.js +0 -20
  128. package/dist/modules/metaAgent.d.ts +0 -95
  129. package/dist/modules/metaAgent.d.ts.map +0 -1
  130. package/dist/modules/metaAgent.js +0 -32
  131. package/dist/modules/metrics.d.ts +0 -20
  132. package/dist/modules/metrics.d.ts.map +0 -1
  133. package/dist/modules/metrics.js +0 -27
  134. package/dist/modules/observability.d.ts +0 -19
  135. package/dist/modules/observability.d.ts.map +0 -1
  136. package/dist/modules/observability.js +0 -14
  137. package/dist/modules/playground.d.ts +0 -42
  138. package/dist/modules/playground.d.ts.map +0 -1
  139. package/dist/modules/playground.js +0 -48
  140. package/dist/modules/presets.d.ts +0 -32
  141. package/dist/modules/presets.d.ts.map +0 -1
  142. package/dist/modules/presets.js +0 -199
  143. package/dist/modules/prompts.d.ts +0 -87
  144. package/dist/modules/prompts.d.ts.map +0 -1
  145. package/dist/modules/prompts.js +0 -87
  146. package/dist/modules/roles.d.ts +0 -64
  147. package/dist/modules/roles.d.ts.map +0 -1
  148. package/dist/modules/roles.js +0 -79
  149. package/dist/modules/runs.d.ts +0 -451
  150. package/dist/modules/runs.d.ts.map +0 -1
  151. package/dist/modules/runs.js +0 -536
  152. package/dist/modules/store.d.ts +0 -37
  153. package/dist/modules/store.d.ts.map +0 -1
  154. package/dist/modules/store.js +0 -48
  155. package/dist/modules/templates.d.ts +0 -28
  156. package/dist/modules/templates.d.ts.map +0 -1
  157. package/dist/modules/templates.js +0 -19
  158. package/dist/modules/tenants.d.ts +0 -49
  159. package/dist/modules/tenants.d.ts.map +0 -1
  160. package/dist/modules/tenants.js +0 -56
  161. package/dist/modules/threads.d.ts +0 -205
  162. package/dist/modules/threads.d.ts.map +0 -1
  163. package/dist/modules/threads.js +0 -225
  164. package/dist/modules/tools.d.ts +0 -62
  165. package/dist/modules/tools.d.ts.map +0 -1
  166. package/dist/modules/tools.js +0 -45
  167. package/dist/modules/traces.d.ts +0 -89
  168. package/dist/modules/traces.d.ts.map +0 -1
  169. package/dist/modules/traces.js +0 -65
  170. package/dist/modules/triggers.d.ts +0 -228
  171. package/dist/modules/triggers.d.ts.map +0 -1
  172. package/dist/modules/triggers.js +0 -176
  173. package/dist/modules/usage.d.ts +0 -85
  174. package/dist/modules/usage.d.ts.map +0 -1
  175. package/dist/modules/usage.js +0 -43
  176. package/dist/modules/vectorStores.d.ts +0 -100
  177. package/dist/modules/vectorStores.d.ts.map +0 -1
  178. package/dist/modules/vectorStores.js +0 -159
  179. package/dist/modules/workspaces.d.ts +0 -138
  180. package/dist/modules/workspaces.d.ts.map +0 -1
  181. package/dist/modules/workspaces.js +0 -121
  182. package/dist/sse/client.d.ts +0 -140
  183. package/dist/sse/client.d.ts.map +0 -1
  184. package/dist/sse/client.js +0 -103
@@ -1,49 +0,0 @@
1
- /**
2
- * Tenants Module - Fully Typed
3
- */
4
- import type { RawClient, APIResponse } from "../client/raw.js";
5
- export interface Tenant {
6
- id: string;
7
- name: string;
8
- slug: string;
9
- owner_id?: string;
10
- settings?: Record<string, unknown>;
11
- created_at: string;
12
- updated_at: string;
13
- }
14
- export interface TenantListResponse {
15
- items: Tenant[];
16
- total: number;
17
- }
18
- export declare class TenantsModule {
19
- private client;
20
- private headers;
21
- constructor(client: RawClient, headers: () => Record<string, string>);
22
- /**
23
- * List all tenants the user has access to.
24
- */
25
- /**
26
- * List all tenants the user has access to.
27
- */
28
- list(): Promise<APIResponse<TenantListResponse>>;
29
- /**
30
- * Get the current tenant.
31
- */
32
- get(): Promise<APIResponse<Tenant>>;
33
- /**
34
- * Update the current tenant.
35
- */
36
- update(body: {
37
- name?: string;
38
- slug?: string;
39
- }): Promise<APIResponse<Tenant>>;
40
- /**
41
- * Get tenant settings.
42
- */
43
- getSettings(): Promise<APIResponse<Record<string, unknown>>>;
44
- /**
45
- * Update tenant settings.
46
- */
47
- updateSettings(settings: Record<string, unknown>): Promise<APIResponse<void>>;
48
- }
49
- //# sourceMappingURL=tenants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../src/modules/tenants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAI3E,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,aAAa;IACV,OAAO,CAAC,MAAM;IAAa,OAAO,CAAC,OAAO;gBAAlC,MAAM,EAAE,SAAS,EAAU,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEpF;;OAEG;IACH;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAMtD;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAMzC;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAOhC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAMlE;;OAEG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CAMtF"}
@@ -1,56 +0,0 @@
1
- /**
2
- * Tenants Module - Fully Typed
3
- */
4
- export class TenantsModule {
5
- client;
6
- headers;
7
- constructor(client, headers) {
8
- this.client = client;
9
- this.headers = headers;
10
- }
11
- /**
12
- * List all tenants the user has access to.
13
- */
14
- /**
15
- * List all tenants the user has access to.
16
- */
17
- async list() {
18
- return this.client.GET("/v1/api/tenants", {
19
- headers: this.headers(),
20
- });
21
- }
22
- /**
23
- * Get the current tenant.
24
- */
25
- async get() {
26
- return this.client.GET("/v1/api/tenants/current", {
27
- headers: this.headers(),
28
- });
29
- }
30
- /**
31
- * Update the current tenant.
32
- */
33
- async update(body) {
34
- return this.client.PUT("/v1/api/tenants/current", {
35
- body,
36
- headers: this.headers(),
37
- });
38
- }
39
- /**
40
- * Get tenant settings.
41
- */
42
- async getSettings() {
43
- return this.client.GET("/v1/api/tenants/current/settings", {
44
- headers: this.headers(),
45
- });
46
- }
47
- /**
48
- * Update tenant settings.
49
- */
50
- async updateSettings(settings) {
51
- return this.client.PUT("/v1/api/tenants/current/settings", {
52
- body: settings,
53
- headers: this.headers(),
54
- });
55
- }
56
- }
@@ -1,205 +0,0 @@
1
- /**
2
- * Threads Module - Fully Typed
3
- *
4
- * Naming conventions:
5
- * - get* for singular items
6
- * - list* for collections
7
- * - create*, update*, delete* for mutations
8
- *
9
- * Convenience aliases are provided for common access patterns.
10
- */
11
- import type { RawClient, APIResponse } from "../client/raw.js";
12
- import type { PaginationParams, PaginatedResponse } from "../client/helpers.js";
13
- export interface Thread {
14
- id: string;
15
- workspace_id: string;
16
- tenant_id: string;
17
- channel?: string;
18
- external_conversation_id?: string;
19
- metadata?: Record<string, unknown>;
20
- created_at: string;
21
- updated_at: string;
22
- }
23
- export interface ThreadState {
24
- thread_id: string;
25
- values: Record<string, unknown>;
26
- next?: string[];
27
- tasks?: unknown[];
28
- metadata?: Record<string, unknown>;
29
- }
30
- export interface ThreadHistory {
31
- thread_id: string;
32
- checkpoints: unknown[];
33
- }
34
- export interface ThreadMessage {
35
- id: string;
36
- thread_id: string;
37
- role: "human" | "assistant" | "system" | "developer";
38
- content: string;
39
- metadata?: Record<string, unknown>;
40
- created_at: string;
41
- }
42
- export interface ThreadRun {
43
- run_id: string;
44
- thread_id: string;
45
- agent_id: string;
46
- status: string;
47
- created_at: string;
48
- completed_at?: string;
49
- }
50
- export type ThreadListResponse = PaginatedResponse<Thread>;
51
- export type ThreadMessagesResponse = PaginatedResponse<ThreadMessage>;
52
- export type ThreadRunsResponse = PaginatedResponse<ThreadRun>;
53
- export interface ThreadSearchResponse {
54
- items: Thread[];
55
- total: number;
56
- }
57
- export interface ThreadPruneResponse {
58
- deleted_count: number;
59
- thread_ids: string[];
60
- }
61
- export declare class ThreadsModule {
62
- private client;
63
- private headers;
64
- constructor(client: RawClient, headers: () => Record<string, string>);
65
- /**
66
- * Create a new thread.
67
- * @example
68
- * ```ts
69
- * const { data: thread } = await client.threads.create();
70
- *
71
- * // With idempotency (safe to retry)
72
- * const { data: thread } = await client.threads.create({
73
- * idempotency_key: "my-unique-key"
74
- * });
75
- * ```
76
- */
77
- create(body?: {
78
- channel?: string;
79
- external_conversation_id?: string;
80
- metadata?: Record<string, unknown>;
81
- /** Idempotency key for safe retries. When set, duplicate requests with the same key return the original response. */
82
- idempotency_key?: string;
83
- }): Promise<APIResponse<Thread>>;
84
- /**
85
- * Get a thread by ID.
86
- * @example
87
- * ```ts
88
- * const { data: thread } = await client.threads.get("thread-uuid");
89
- * ```
90
- */
91
- get(threadId: string): Promise<APIResponse<Thread>>;
92
- /**
93
- * List all threads.
94
- * @example
95
- * ```ts
96
- * const { data } = await client.threads.list({ limit: 20 });
97
- * ```
98
- */
99
- list(params?: PaginationParams & {
100
- workspace_id?: string;
101
- }): Promise<APIResponse<ThreadListResponse>>;
102
- /**
103
- * Iterate through all threads with automatic pagination.
104
- *
105
- * @example
106
- * ```ts
107
- * for await (const thread of client.threads.iterate()) {
108
- * console.log(thread.id);
109
- * }
110
- * ```
111
- */
112
- iterate(filters?: {
113
- workspace_id?: string;
114
- }, options?: {
115
- pageSize?: number;
116
- maxItems?: number;
117
- signal?: AbortSignal;
118
- }): AsyncGenerator<Thread, void, unknown>;
119
- /**
120
- * Delete a thread.
121
- */
122
- delete(threadId: string): Promise<APIResponse<void>>;
123
- /**
124
- * Get the current state of a thread.
125
- * @example
126
- * ```ts
127
- * const { data: state } = await client.threads.getState("thread-uuid");
128
- * ```
129
- */
130
- getState(threadId: string): Promise<APIResponse<ThreadState>>;
131
- /** Alias: threads.state() -> threads.getState() */
132
- state: (threadId: string) => Promise<APIResponse<ThreadState>>;
133
- /**
134
- * Get the history of a thread.
135
- */
136
- getHistory(threadId: string): Promise<APIResponse<ThreadHistory>>;
137
- /** Alias: threads.history() -> threads.getHistory() */
138
- history: (threadId: string) => Promise<APIResponse<ThreadHistory>>;
139
- /**
140
- * Get runs for a thread.
141
- * @example
142
- * ```ts
143
- * const { data } = await client.threads.getRuns("thread-uuid");
144
- * ```
145
- */
146
- getRuns(threadId: string, params?: PaginationParams & {
147
- status?: string;
148
- }): Promise<APIResponse<ThreadRunsResponse>>;
149
- /** Alias: threads.runs() -> threads.getRuns() */
150
- runs: (threadId: string, params?: PaginationParams & {
151
- status?: string;
152
- }) => Promise<APIResponse<ThreadRunsResponse>>;
153
- /**
154
- * Create a run within a thread.
155
- */
156
- createRun(threadId: string, body: {
157
- agent_id: string;
158
- input?: unknown;
159
- idempotency_key?: string;
160
- }): Promise<APIResponse<ThreadRun>>;
161
- /**
162
- * Get messages in a thread.
163
- * @example
164
- * ```ts
165
- * const { data } = await client.threads.getMessages("thread-uuid");
166
- * ```
167
- */
168
- getMessages(threadId: string, params?: PaginationParams): Promise<APIResponse<ThreadMessagesResponse>>;
169
- /** Alias: threads.messages() -> threads.getMessages() */
170
- messages: (threadId: string, params?: PaginationParams) => Promise<APIResponse<ThreadMessagesResponse>>;
171
- /**
172
- * Add a message to a thread.
173
- */
174
- addMessage(threadId: string, body: {
175
- role?: "human" | "system" | "developer";
176
- content: string;
177
- metadata?: Record<string, unknown>;
178
- }): Promise<APIResponse<ThreadMessage>>;
179
- /**
180
- * Search threads.
181
- */
182
- search(body: {
183
- workspace_id?: string;
184
- agent_id?: string;
185
- created_after?: string;
186
- created_before?: string;
187
- sort_by?: string;
188
- sort_desc?: boolean;
189
- } & PaginationParams): Promise<APIResponse<ThreadSearchResponse>>;
190
- /**
191
- * Copy/fork a thread.
192
- */
193
- copy(threadId: string, options?: {
194
- copy_history?: boolean;
195
- }): Promise<APIResponse<Thread>>;
196
- /**
197
- * Prune old threads.
198
- */
199
- prune(body: {
200
- workspace_id?: string;
201
- older_than_days?: number;
202
- dry_run?: boolean;
203
- } & PaginationParams): Promise<APIResponse<ThreadPruneResponse>>;
204
- }
205
- //# sourceMappingURL=threads.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/modules/threads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGhF,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IACl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EAAE;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,OAAO,CAAC;KACvB,GAAG,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IASjE;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAUhG;;OAEG;IACG,KAAK,CAAC,IAAI,EAAE;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,GAAG,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;CAMnE"}
@@ -1,225 +0,0 @@
1
- /**
2
- * Threads Module - Fully Typed
3
- *
4
- * Naming conventions:
5
- * - get* for singular items
6
- * - list* for collections
7
- * - create*, update*, delete* for mutations
8
- *
9
- * Convenience aliases are provided for common access patterns.
10
- */
11
- export class ThreadsModule {
12
- client;
13
- headers;
14
- constructor(client, headers) {
15
- this.client = client;
16
- this.headers = headers;
17
- }
18
- // ======================== CRUD ========================
19
- /**
20
- * Create a new thread.
21
- * @example
22
- * ```ts
23
- * const { data: thread } = await client.threads.create();
24
- *
25
- * // With idempotency (safe to retry)
26
- * const { data: thread } = await client.threads.create({
27
- * idempotency_key: "my-unique-key"
28
- * });
29
- * ```
30
- */
31
- async create(body) {
32
- // Send canonical X-Idempotency-Key header + body idempotency_key for backend contract parity.
33
- const headers = { ...this.headers() };
34
- if (body?.idempotency_key) {
35
- headers["X-Idempotency-Key"] = body.idempotency_key;
36
- }
37
- return this.client.POST("/v1/api/threads", {
38
- body: body ?? {},
39
- headers,
40
- });
41
- }
42
- /**
43
- * Get a thread by ID.
44
- * @example
45
- * ```ts
46
- * const { data: thread } = await client.threads.get("thread-uuid");
47
- * ```
48
- */
49
- async get(threadId) {
50
- return this.client.GET("/v1/api/threads/{id}", {
51
- params: { path: { id: threadId } },
52
- headers: this.headers(),
53
- });
54
- }
55
- /**
56
- * List all threads.
57
- * @example
58
- * ```ts
59
- * const { data } = await client.threads.list({ limit: 20 });
60
- * ```
61
- */
62
- async list(params) {
63
- return this.client.GET("/v1/api/threads", {
64
- params: { query: params },
65
- headers: this.headers(),
66
- });
67
- }
68
- /**
69
- * Iterate through all threads with automatic pagination.
70
- *
71
- * @example
72
- * ```ts
73
- * for await (const thread of client.threads.iterate()) {
74
- * console.log(thread.id);
75
- * }
76
- * ```
77
- */
78
- async *iterate(filters, options) {
79
- const pageSize = options?.pageSize ?? 100;
80
- const maxItems = options?.maxItems ?? Infinity;
81
- let offset = 0;
82
- let yielded = 0;
83
- let hasMore = true;
84
- while (hasMore && yielded < maxItems) {
85
- if (options?.signal?.aborted)
86
- return;
87
- const response = await this.list({
88
- ...filters,
89
- limit: Math.min(pageSize, maxItems - yielded),
90
- offset,
91
- });
92
- if (response.error)
93
- throw response.error;
94
- const data = response.data;
95
- for (const thread of data.items) {
96
- if (yielded >= maxItems)
97
- return;
98
- yield thread;
99
- yielded++;
100
- }
101
- offset += data.items.length;
102
- hasMore = offset < data.total && data.items.length > 0;
103
- }
104
- }
105
- /**
106
- * Delete a thread.
107
- */
108
- async delete(threadId) {
109
- return this.client.DELETE("/v1/api/threads/{id}", {
110
- params: { path: { id: threadId } },
111
- headers: this.headers(),
112
- });
113
- }
114
- // ======================== State ========================
115
- /**
116
- * Get the current state of a thread.
117
- * @example
118
- * ```ts
119
- * const { data: state } = await client.threads.getState("thread-uuid");
120
- * ```
121
- */
122
- async getState(threadId) {
123
- return this.client.GET("/v1/api/threads/{id}/state", {
124
- params: { path: { id: threadId } },
125
- headers: this.headers(),
126
- });
127
- }
128
- /** Alias: threads.state() -> threads.getState() */
129
- state = (threadId) => this.getState(threadId);
130
- // ======================== History ========================
131
- /**
132
- * Get the history of a thread.
133
- */
134
- async getHistory(threadId) {
135
- return this.client.GET("/v1/api/threads/{id}/history", {
136
- params: { path: { id: threadId } },
137
- headers: this.headers(),
138
- });
139
- }
140
- /** Alias: threads.history() -> threads.getHistory() */
141
- history = (threadId) => this.getHistory(threadId);
142
- // ======================== Runs ========================
143
- /**
144
- * Get runs for a thread.
145
- * @example
146
- * ```ts
147
- * const { data } = await client.threads.getRuns("thread-uuid");
148
- * ```
149
- */
150
- async getRuns(threadId, params) {
151
- return this.client.GET("/v1/api/threads/{id}/runs", {
152
- params: { path: { id: threadId }, query: params },
153
- headers: this.headers(),
154
- });
155
- }
156
- /** Alias: threads.runs() -> threads.getRuns() */
157
- runs = (threadId, params) => this.getRuns(threadId, params);
158
- /**
159
- * Create a run within a thread.
160
- */
161
- async createRun(threadId, body) {
162
- return this.client.POST("/v1/api/threads/{id}/runs", {
163
- params: { path: { id: threadId } },
164
- body,
165
- headers: this.headers(),
166
- });
167
- }
168
- // ======================== Messages ========================
169
- /**
170
- * Get messages in a thread.
171
- * @example
172
- * ```ts
173
- * const { data } = await client.threads.getMessages("thread-uuid");
174
- * ```
175
- */
176
- async getMessages(threadId, params) {
177
- return this.client.GET("/v1/api/threads/{id}/messages", {
178
- params: { path: { id: threadId }, query: params },
179
- headers: this.headers(),
180
- });
181
- }
182
- /** Alias: threads.messages() -> threads.getMessages() */
183
- messages = (threadId, params) => this.getMessages(threadId, params);
184
- /**
185
- * Add a message to a thread.
186
- */
187
- async addMessage(threadId, body) {
188
- return this.client.POST("/v1/api/threads/{id}/messages", {
189
- params: { path: { id: threadId } },
190
- body,
191
- headers: this.headers(),
192
- });
193
- }
194
- // ======================== Search ========================
195
- /**
196
- * Search threads.
197
- */
198
- async search(body) {
199
- return this.client.POST("/v1/api/threads/search", {
200
- body,
201
- headers: this.headers(),
202
- });
203
- }
204
- // ======================== Copy/Fork ========================
205
- /**
206
- * Copy/fork a thread.
207
- */
208
- async copy(threadId, options) {
209
- return this.client.POST("/v1/api/threads/{id}/copy", {
210
- params: { path: { id: threadId } },
211
- body: options ?? {},
212
- headers: this.headers(),
213
- });
214
- }
215
- // ======================== Prune ========================
216
- /**
217
- * Prune old threads.
218
- */
219
- async prune(body) {
220
- return this.client.POST("/v1/api/threads/prune", {
221
- body,
222
- headers: this.headers(),
223
- });
224
- }
225
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * Tools Module - Fully Typed
3
- */
4
- import type { RawClient, APIResponse } from "../client/raw.js";
5
- export interface Tool {
6
- name: string;
7
- description?: string;
8
- category?: string;
9
- parameters?: Record<string, unknown>;
10
- required_credentials: string[];
11
- is_builtin: boolean;
12
- created_at?: string;
13
- }
14
- export interface ToolListResponse {
15
- items: Tool[];
16
- total: number;
17
- }
18
- export interface ToolDefinition {
19
- capability_ref: string;
20
- capability_version: string;
21
- execution_binding: string;
22
- slug?: string;
23
- required_credentials: string[];
24
- name: string;
25
- description?: string;
26
- type: string;
27
- version?: number;
28
- input_schema?: Record<string, unknown>;
29
- output_schema?: Record<string, unknown>;
30
- }
31
- export interface ToolDefinitionsResponse {
32
- version: string;
33
- tools: ToolDefinition[];
34
- }
35
- export interface ToolCallResult {
36
- success: boolean;
37
- output?: unknown;
38
- error?: string;
39
- }
40
- export declare class ToolsModule {
41
- private client;
42
- private headers;
43
- constructor(client: RawClient, headers: () => Record<string, string>);
44
- /**
45
- * List all available tools.
46
- */
47
- list(params?: {
48
- category?: string;
49
- limit?: number;
50
- offset?: number;
51
- }): Promise<APIResponse<ToolListResponse>>;
52
- /**
53
- * Get a tool by name.
54
- */
55
- get(toolName: string): Promise<APIResponse<Tool>>;
56
- getDefinitions(version?: string): Promise<APIResponse<ToolDefinitionsResponse>>;
57
- /**
58
- * Call a tool directly (testing).
59
- */
60
- call(toolName: string, args: unknown): Promise<APIResponse<ToolCallResult>>;
61
- }
62
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/modules/tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,IAAI;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,WAAW;IACR,OAAO,CAAC,MAAM;IAAa,OAAO,CAAC,OAAO;gBAAlC,MAAM,EAAE,SAAS,EAAU,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAEpF;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAO1C;;OAEG;IACG,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAOjD,cAAc,CAAC,OAAO,GAAE,MAAY,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAO1F;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;CAOpF"}
@@ -1,45 +0,0 @@
1
- /**
2
- * Tools Module - Fully Typed
3
- */
4
- export class ToolsModule {
5
- client;
6
- headers;
7
- constructor(client, headers) {
8
- this.client = client;
9
- this.headers = headers;
10
- }
11
- /**
12
- * List all available tools.
13
- */
14
- async list(params) {
15
- return this.client.GET("/v1/api/tools", {
16
- params: { query: params },
17
- headers: this.headers(),
18
- });
19
- }
20
- /**
21
- * Get a tool by name.
22
- */
23
- async get(toolName) {
24
- return this.client.GET("/v1/api/tools/{name}", {
25
- params: { path: { name: toolName } },
26
- headers: this.headers(),
27
- });
28
- }
29
- async getDefinitions(version = "1") {
30
- return this.client.GET("/v1/api/tools/definitions", {
31
- params: { query: { version } },
32
- headers: this.headers(),
33
- });
34
- }
35
- /**
36
- * Call a tool directly (testing).
37
- */
38
- async call(toolName, args) {
39
- return this.client.POST("/v1/api/tools/{name}/call", {
40
- params: { path: { name: toolName } },
41
- body: { arguments: args },
42
- headers: this.headers(),
43
- });
44
- }
45
- }