@agent-os-sdk/client 0.9.24 → 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 (185) hide show
  1. package/package.json +15 -8
  2. package/src/generated/openapi.ts +90 -0
  3. package/src/generated/swagger.json +181 -0
  4. package/src/modules/runs.ts +64 -0
  5. package/src/modules/templates.ts +35 -0
  6. package/dist/client/AgentOsClient.d.ts +0 -141
  7. package/dist/client/AgentOsClient.d.ts.map +0 -1
  8. package/dist/client/AgentOsClient.js +0 -250
  9. package/dist/client/HttpRequestBuilder.d.ts +0 -50
  10. package/dist/client/HttpRequestBuilder.d.ts.map +0 -1
  11. package/dist/client/HttpRequestBuilder.js +0 -83
  12. package/dist/client/OperationContext.d.ts +0 -19
  13. package/dist/client/OperationContext.d.ts.map +0 -1
  14. package/dist/client/OperationContext.js +0 -13
  15. package/dist/client/OperationContextProvider.d.ts +0 -54
  16. package/dist/client/OperationContextProvider.d.ts.map +0 -1
  17. package/dist/client/OperationContextProvider.js +0 -71
  18. package/dist/client/auth.d.ts +0 -100
  19. package/dist/client/auth.d.ts.map +0 -1
  20. package/dist/client/auth.js +0 -38
  21. package/dist/client/config.d.ts +0 -49
  22. package/dist/client/config.d.ts.map +0 -1
  23. package/dist/client/config.js +0 -62
  24. package/dist/client/helpers.d.ts +0 -63
  25. package/dist/client/helpers.d.ts.map +0 -1
  26. package/dist/client/helpers.js +0 -55
  27. package/dist/client/pagination.d.ts +0 -105
  28. package/dist/client/pagination.d.ts.map +0 -1
  29. package/dist/client/pagination.js +0 -117
  30. package/dist/client/raw.d.ts +0 -277
  31. package/dist/client/raw.d.ts.map +0 -1
  32. package/dist/client/raw.js +0 -337
  33. package/dist/client/retry.d.ts +0 -37
  34. package/dist/client/retry.d.ts.map +0 -1
  35. package/dist/client/retry.js +0 -108
  36. package/dist/client/sanitize.d.ts +0 -19
  37. package/dist/client/sanitize.d.ts.map +0 -1
  38. package/dist/client/sanitize.js +0 -28
  39. package/dist/client/timeout.d.ts +0 -26
  40. package/dist/client/timeout.d.ts.map +0 -1
  41. package/dist/client/timeout.js +0 -51
  42. package/dist/errors/factory.d.ts +0 -22
  43. package/dist/errors/factory.d.ts.map +0 -1
  44. package/dist/errors/factory.js +0 -101
  45. package/dist/errors/index.d.ts +0 -210
  46. package/dist/errors/index.d.ts.map +0 -1
  47. package/dist/errors/index.js +0 -283
  48. package/dist/generated/client.d.ts +0 -20
  49. package/dist/generated/client.d.ts.map +0 -1
  50. package/dist/generated/client.js +0 -15
  51. package/dist/generated/index.d.ts +0 -2
  52. package/dist/generated/index.d.ts.map +0 -1
  53. package/dist/generated/index.js +0 -1
  54. package/dist/generated/openapi.d.ts +0 -12294
  55. package/dist/generated/openapi.d.ts.map +0 -1
  56. package/dist/generated/openapi.js +0 -5
  57. package/dist/index.d.ts +0 -69
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/index.js +0 -81
  60. package/dist/modules/a2a.d.ts +0 -48
  61. package/dist/modules/a2a.d.ts.map +0 -1
  62. package/dist/modules/a2a.js +0 -37
  63. package/dist/modules/agents.d.ts +0 -346
  64. package/dist/modules/agents.d.ts.map +0 -1
  65. package/dist/modules/agents.js +0 -296
  66. package/dist/modules/apiTokens.d.ts +0 -62
  67. package/dist/modules/apiTokens.d.ts.map +0 -1
  68. package/dist/modules/apiTokens.js +0 -56
  69. package/dist/modules/approvals.d.ts +0 -75
  70. package/dist/modules/approvals.d.ts.map +0 -1
  71. package/dist/modules/approvals.js +0 -91
  72. package/dist/modules/audit.d.ts +0 -78
  73. package/dist/modules/audit.d.ts.map +0 -1
  74. package/dist/modules/audit.js +0 -94
  75. package/dist/modules/auth.d.ts +0 -28
  76. package/dist/modules/auth.d.ts.map +0 -1
  77. package/dist/modules/auth.js +0 -22
  78. package/dist/modules/builder.d.ts +0 -242
  79. package/dist/modules/builder.d.ts.map +0 -1
  80. package/dist/modules/builder.js +0 -248
  81. package/dist/modules/catalog.d.ts +0 -142
  82. package/dist/modules/catalog.d.ts.map +0 -1
  83. package/dist/modules/catalog.js +0 -136
  84. package/dist/modules/chatwoot.d.ts +0 -59
  85. package/dist/modules/chatwoot.d.ts.map +0 -1
  86. package/dist/modules/chatwoot.js +0 -200
  87. package/dist/modules/checkpoints.d.ts +0 -62
  88. package/dist/modules/checkpoints.d.ts.map +0 -1
  89. package/dist/modules/checkpoints.js +0 -48
  90. package/dist/modules/contracts.d.ts +0 -48
  91. package/dist/modules/contracts.d.ts.map +0 -1
  92. package/dist/modules/contracts.js +0 -25
  93. package/dist/modules/credentials.d.ts +0 -105
  94. package/dist/modules/credentials.d.ts.map +0 -1
  95. package/dist/modules/credentials.js +0 -135
  96. package/dist/modules/crons.d.ts +0 -73
  97. package/dist/modules/crons.d.ts.map +0 -1
  98. package/dist/modules/crons.js +0 -67
  99. package/dist/modules/datasets.d.ts +0 -80
  100. package/dist/modules/datasets.d.ts.map +0 -1
  101. package/dist/modules/datasets.js +0 -91
  102. package/dist/modules/evaluation.d.ts +0 -183
  103. package/dist/modules/evaluation.d.ts.map +0 -1
  104. package/dist/modules/evaluation.js +0 -108
  105. package/dist/modules/files.d.ts +0 -89
  106. package/dist/modules/files.d.ts.map +0 -1
  107. package/dist/modules/files.js +0 -133
  108. package/dist/modules/graphs.d.ts +0 -120
  109. package/dist/modules/graphs.d.ts.map +0 -1
  110. package/dist/modules/graphs.js +0 -69
  111. package/dist/modules/improvements.d.ts +0 -52
  112. package/dist/modules/improvements.d.ts.map +0 -1
  113. package/dist/modules/improvements.js +0 -27
  114. package/dist/modules/info.d.ts +0 -76
  115. package/dist/modules/info.d.ts.map +0 -1
  116. package/dist/modules/info.js +0 -93
  117. package/dist/modules/knowledge.d.ts +0 -91
  118. package/dist/modules/knowledge.d.ts.map +0 -1
  119. package/dist/modules/knowledge.js +0 -80
  120. package/dist/modules/me.d.ts +0 -58
  121. package/dist/modules/me.d.ts.map +0 -1
  122. package/dist/modules/me.js +0 -28
  123. package/dist/modules/members.d.ts +0 -124
  124. package/dist/modules/members.d.ts.map +0 -1
  125. package/dist/modules/members.js +0 -142
  126. package/dist/modules/memberships.d.ts +0 -25
  127. package/dist/modules/memberships.d.ts.map +0 -1
  128. package/dist/modules/memberships.js +0 -20
  129. package/dist/modules/metaAgent.d.ts +0 -95
  130. package/dist/modules/metaAgent.d.ts.map +0 -1
  131. package/dist/modules/metaAgent.js +0 -32
  132. package/dist/modules/metrics.d.ts +0 -20
  133. package/dist/modules/metrics.d.ts.map +0 -1
  134. package/dist/modules/metrics.js +0 -27
  135. package/dist/modules/observability.d.ts +0 -19
  136. package/dist/modules/observability.d.ts.map +0 -1
  137. package/dist/modules/observability.js +0 -14
  138. package/dist/modules/playground.d.ts +0 -42
  139. package/dist/modules/playground.d.ts.map +0 -1
  140. package/dist/modules/playground.js +0 -48
  141. package/dist/modules/presets.d.ts +0 -32
  142. package/dist/modules/presets.d.ts.map +0 -1
  143. package/dist/modules/presets.js +0 -199
  144. package/dist/modules/prompts.d.ts +0 -87
  145. package/dist/modules/prompts.d.ts.map +0 -1
  146. package/dist/modules/prompts.js +0 -87
  147. package/dist/modules/roles.d.ts +0 -64
  148. package/dist/modules/roles.d.ts.map +0 -1
  149. package/dist/modules/roles.js +0 -79
  150. package/dist/modules/runs.d.ts +0 -400
  151. package/dist/modules/runs.d.ts.map +0 -1
  152. package/dist/modules/runs.js +0 -526
  153. package/dist/modules/store.d.ts +0 -37
  154. package/dist/modules/store.d.ts.map +0 -1
  155. package/dist/modules/store.js +0 -48
  156. package/dist/modules/templates.d.ts +0 -28
  157. package/dist/modules/templates.d.ts.map +0 -1
  158. package/dist/modules/templates.js +0 -19
  159. package/dist/modules/tenants.d.ts +0 -49
  160. package/dist/modules/tenants.d.ts.map +0 -1
  161. package/dist/modules/tenants.js +0 -56
  162. package/dist/modules/threads.d.ts +0 -205
  163. package/dist/modules/threads.d.ts.map +0 -1
  164. package/dist/modules/threads.js +0 -225
  165. package/dist/modules/tools.d.ts +0 -62
  166. package/dist/modules/tools.d.ts.map +0 -1
  167. package/dist/modules/tools.js +0 -45
  168. package/dist/modules/traces.d.ts +0 -89
  169. package/dist/modules/traces.d.ts.map +0 -1
  170. package/dist/modules/traces.js +0 -65
  171. package/dist/modules/triggers.d.ts +0 -228
  172. package/dist/modules/triggers.d.ts.map +0 -1
  173. package/dist/modules/triggers.js +0 -176
  174. package/dist/modules/usage.d.ts +0 -85
  175. package/dist/modules/usage.d.ts.map +0 -1
  176. package/dist/modules/usage.js +0 -43
  177. package/dist/modules/vectorStores.d.ts +0 -100
  178. package/dist/modules/vectorStores.d.ts.map +0 -1
  179. package/dist/modules/vectorStores.js +0 -159
  180. package/dist/modules/workspaces.d.ts +0 -138
  181. package/dist/modules/workspaces.d.ts.map +0 -1
  182. package/dist/modules/workspaces.js +0 -121
  183. package/dist/sse/client.d.ts +0 -140
  184. package/dist/sse/client.d.ts.map +0 -1
  185. package/dist/sse/client.js +0 -103
@@ -1,283 +0,0 @@
1
- /**
2
- * Agent OS SDK - Typed Errors
3
- *
4
- * Enterprise-grade error classification for predictable error handling.
5
- * All errors extend AgentOsError and include semantic information.
6
- */
7
- /**
8
- * Base class for all Agent OS SDK errors.
9
- * Provides consistent structure for error handling and classification.
10
- */
11
- export class AgentOsError extends Error {
12
- /** Request ID from x-request-id header */
13
- requestId;
14
- /** Original error code from backend (preserves backend semantics) */
15
- backendCode;
16
- /** Raw details object from backend response */
17
- details;
18
- /** Timestamp when error occurred */
19
- timestamp = new Date().toISOString();
20
- constructor(message, options) {
21
- super(message);
22
- this.name = this.constructor.name;
23
- this.requestId = options?.requestId;
24
- this.backendCode = options?.backendCode;
25
- this.details = options?.details;
26
- // Maintains proper stack trace (V8 engines only)
27
- if ("captureStackTrace" in Error && typeof Error.captureStackTrace === "function") {
28
- Error.captureStackTrace(this, this.constructor);
29
- }
30
- }
31
- /**
32
- * Whether this error is retryable with the same request.
33
- * Override in subclasses for specific behavior.
34
- */
35
- isRetryable() {
36
- return false;
37
- }
38
- /** Convert to JSON for logging/serialization */
39
- toJSON() {
40
- return {
41
- name: this.name,
42
- code: this.code,
43
- status: this.status,
44
- message: this.message,
45
- requestId: this.requestId,
46
- backendCode: this.backendCode,
47
- details: this.details,
48
- timestamp: this.timestamp,
49
- };
50
- }
51
- }
52
- // ============================================================================
53
- // Authentication & Authorization Errors
54
- // ============================================================================
55
- /**
56
- * 401 Unauthorized - Invalid or missing authentication.
57
- *
58
- * @example
59
- * if (error instanceof UnauthorizedError) {
60
- * // Redirect to login
61
- * }
62
- */
63
- export class UnauthorizedError extends AgentOsError {
64
- code = "UNAUTHORIZED";
65
- status = 401;
66
- constructor(message = "Authentication required", options) {
67
- super(message, options);
68
- }
69
- }
70
- /**
71
- * 403 Forbidden - Valid auth but insufficient permissions.
72
- *
73
- * @example
74
- * if (error instanceof ForbiddenError) {
75
- * showToast("You don't have permission to perform this action");
76
- * }
77
- */
78
- export class ForbiddenError extends AgentOsError {
79
- code = "FORBIDDEN";
80
- status = 403;
81
- constructor(message = "Access denied", options) {
82
- super(message, options);
83
- }
84
- }
85
- // ============================================================================
86
- // Resource Errors
87
- // ============================================================================
88
- /**
89
- * 404 Not Found - Resource does not exist.
90
- *
91
- * @example
92
- * if (error instanceof NotFoundError) {
93
- * console.log(`Not found at: ${error.path}`);
94
- * }
95
- */
96
- export class NotFoundError extends AgentOsError {
97
- path;
98
- code = "NOT_FOUND";
99
- status = 404;
100
- constructor(message = "Resource not found",
101
- /** The request path that returned 404 */
102
- path, options) {
103
- super(message, options);
104
- this.path = path;
105
- }
106
- }
107
- /**
108
- * 409 Conflict - Resource already exists or state conflict.
109
- *
110
- * @example
111
- * if (error instanceof ConflictError) {
112
- * // Handle duplicate or version mismatch
113
- * }
114
- */
115
- export class ConflictError extends AgentOsError {
116
- code = "CONFLICT";
117
- status = 409;
118
- constructor(message = "Resource conflict", options) {
119
- super(message, options);
120
- }
121
- }
122
- /**
123
- * 400/422 Validation Error - Invalid request data.
124
- *
125
- * @example
126
- * if (error instanceof ValidationError) {
127
- * error.fieldErrors?.forEach(fe => {
128
- * showFieldError(fe.field, fe.message);
129
- * });
130
- * }
131
- */
132
- export class ValidationError extends AgentOsError {
133
- fieldErrors;
134
- code = "VALIDATION_ERROR";
135
- status;
136
- constructor(message = "Validation failed", status = 400, fieldErrors, options) {
137
- super(message, options);
138
- this.fieldErrors = fieldErrors;
139
- this.status = status;
140
- }
141
- /** Get error message for a specific field */
142
- getFieldError(field) {
143
- return this.fieldErrors?.find(fe => fe.field === field)?.message;
144
- }
145
- /** Check if a specific field has an error */
146
- hasFieldError(field) {
147
- return this.fieldErrors?.some(fe => fe.field === field) ?? false;
148
- }
149
- }
150
- // ============================================================================
151
- // Rate Limiting
152
- // ============================================================================
153
- /**
154
- * 429 Too Many Requests - Rate limit exceeded.
155
- *
156
- * @example
157
- * if (error instanceof RateLimitError) {
158
- * if (error.retryAfterMs) {
159
- * await sleep(error.retryAfterMs);
160
- * // Retry request
161
- * }
162
- * }
163
- */
164
- export class RateLimitError extends AgentOsError {
165
- retryAfterMs;
166
- code = "RATE_LIMITED";
167
- status = 429;
168
- constructor(message = "Rate limit exceeded",
169
- /** Time to wait before retrying (milliseconds) */
170
- retryAfterMs, options) {
171
- super(message, options);
172
- this.retryAfterMs = retryAfterMs;
173
- }
174
- isRetryable() {
175
- return true;
176
- }
177
- /** Get retry delay or default */
178
- getRetryDelay(defaultMs = 1000) {
179
- return this.retryAfterMs ?? defaultMs;
180
- }
181
- }
182
- // ============================================================================
183
- // Server Errors
184
- // ============================================================================
185
- /**
186
- * 5xx Server Error - Backend failure.
187
- *
188
- * @example
189
- * if (error instanceof ServerError) {
190
- * if (error.isRetryable()) {
191
- * // Retry with backoff
192
- * }
193
- * }
194
- */
195
- export class ServerError extends AgentOsError {
196
- status;
197
- code = "SERVER_ERROR";
198
- constructor(message = "Internal server error", status = 500, options) {
199
- super(message, options);
200
- this.status = status;
201
- }
202
- isRetryable() {
203
- // 500, 502, 503, 504 are typically retryable
204
- return [500, 502, 503, 504].includes(this.status);
205
- }
206
- }
207
- // ============================================================================
208
- // Network & Timeout Errors
209
- // ============================================================================
210
- /**
211
- * Network Error - Fetch failed (no response received).
212
- *
213
- * @example
214
- * if (error instanceof NetworkError) {
215
- * showToast("Network connection failed. Check your internet.");
216
- * }
217
- */
218
- export class NetworkError extends AgentOsError {
219
- cause;
220
- code = "NETWORK_ERROR";
221
- status = 0;
222
- constructor(message = "Network request failed", cause) {
223
- super(message);
224
- this.cause = cause;
225
- }
226
- isRetryable() {
227
- return true;
228
- }
229
- }
230
- /**
231
- * Timeout Error - Request exceeded time limit.
232
- *
233
- * @example
234
- * if (error instanceof TimeoutError) {
235
- * console.log(`Request timed out after ${error.timeoutMs}ms`);
236
- * }
237
- */
238
- export class TimeoutError extends AgentOsError {
239
- timeoutMs;
240
- code = "TIMEOUT";
241
- status = 0;
242
- constructor(
243
- /** Timeout duration in milliseconds */
244
- timeoutMs) {
245
- super(`Request timed out after ${timeoutMs}ms`);
246
- this.timeoutMs = timeoutMs;
247
- }
248
- isRetryable() {
249
- return true;
250
- }
251
- }
252
- // ============================================================================
253
- // Error Type Guards
254
- // ============================================================================
255
- /** Check if error is any Agent OS SDK error */
256
- export function isAgentOsError(error) {
257
- return error instanceof AgentOsError;
258
- }
259
- /** Check if error is retryable */
260
- export function isRetryableError(error) {
261
- if (error instanceof AgentOsError) {
262
- return error.isRetryable();
263
- }
264
- return false;
265
- }
266
- /** Check if error is an auth error (401 or 403) */
267
- export function isAuthError(error) {
268
- return error instanceof UnauthorizedError || error instanceof ForbiddenError;
269
- }
270
- /** Check if error is a client error (4xx) */
271
- export function isClientError(error) {
272
- if (error instanceof AgentOsError) {
273
- return error.status >= 400 && error.status < 500;
274
- }
275
- return false;
276
- }
277
- /** Check if error is a server error (5xx) */
278
- export function isServerError(error) {
279
- if (error instanceof AgentOsError) {
280
- return error.status >= 500 && error.status < 600;
281
- }
282
- return false;
283
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * Agent OS SDK - 100% Auto-Generated Client
3
- *
4
- * This client is fully generated from the OpenAPI specification.
5
- * NO manual types, NO manual endpoints - everything comes from swagger.json.
6
- */
7
- export type { paths, components } from "./openapi.js";
8
- import { type ClientOptions as OpenapiClientOptions } from "openapi-fetch";
9
- import type { paths } from "./openapi.js";
10
- export type ClientOptions = OpenapiClientOptions & {
11
- baseUrl: string;
12
- };
13
- /**
14
- * Create a fully typed API client.
15
- * All endpoints and types are auto-generated from OpenAPI spec.
16
- */
17
- export declare function createClient(options: ClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
18
- export type AgentOsClient = ReturnType<typeof createClient>;
19
- export type Schema<T extends keyof import("./openapi.js").components["schemas"]> = import("./openapi.js").components["schemas"][T];
20
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/generated/client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGtD,OAAsB,EAAE,KAAK,aAAa,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG;IAC/C,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,gEAElD;AAGD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAG5D,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,OAAO,cAAc,EAAE,UAAU,CAAC,SAAS,CAAC,IAC3E,OAAO,cAAc,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Agent OS SDK - 100% Auto-Generated Client
3
- *
4
- * This client is fully generated from the OpenAPI specification.
5
- * NO manual types, NO manual endpoints - everything comes from swagger.json.
6
- */
7
- // Re-export openapi-fetch createClient
8
- import _createClient, {} from "openapi-fetch";
9
- /**
10
- * Create a fully typed API client.
11
- * All endpoints and types are auto-generated from OpenAPI spec.
12
- */
13
- export function createClient(options) {
14
- return _createClient(options);
15
- }
@@ -1,2 +0,0 @@
1
- export type * from "./openapi.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generated/index.ts"],"names":[],"mappings":"AACA,mBAAmB,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- export {};