@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,296 +0,0 @@
1
- /**
2
- * Agents Module - Fully Typed
3
- *
4
- * Naming conventions:
5
- * - get* for singular items: getAgent(id)
6
- * - list* for collections: listAgents()
7
- * - create*, update*, delete* for mutations
8
- */
9
- export class AgentsModule {
10
- client;
11
- headers;
12
- constructor(client, headers) {
13
- this.client = client;
14
- this.headers = headers;
15
- }
16
- // ======================== CRUD ========================
17
- /**
18
- * List all agents in the workspace.
19
- * @example
20
- * ```ts
21
- * const { data } = await client.agents.list({ limit: 10 });
22
- * data?.items.forEach(agent => console.log(agent.name));
23
- * ```
24
- */
25
- async list(params) {
26
- return this.client.GET("/v1/api/agents", {
27
- params: { query: params },
28
- headers: this.headers(),
29
- });
30
- }
31
- /**
32
- * Get a single agent by ID.
33
- * @example
34
- * ```ts
35
- * const { data: agent } = await client.agents.get("agent-uuid");
36
- * ```
37
- */
38
- async get(agentId) {
39
- return this.client.GET("/v1/api/agents/{agentId}", {
40
- params: { path: { agentId } },
41
- headers: this.headers(),
42
- });
43
- }
44
- /**
45
- * Create a new agent.
46
- * Backend only accepts `name` per CreateAgentRequest DTO.
47
- * @example
48
- * ```ts
49
- * const { data: agent } = await client.agents.create({ name: "My Agent" });
50
- *
51
- * // With idempotency (safe to retry)
52
- * const { data: agent } = await client.agents.create({
53
- * name: "My Agent",
54
- * idempotency_key: "unique-key"
55
- * });
56
- * ```
57
- */
58
- async create(body) {
59
- const headers = { ...this.headers() };
60
- if (body.idempotency_key) {
61
- headers["X-Idempotency-Key"] = body.idempotency_key;
62
- }
63
- return this.client.POST("/v1/api/agents", {
64
- body: {
65
- name: body.name,
66
- metadata: body.metadata
67
- },
68
- headers,
69
- });
70
- }
71
- /**
72
- * Update an existing agent.
73
- * Uses PATCH per backend AgentsController.
74
- */
75
- async update(agentId, body) {
76
- return this.client.PATCH("/v1/api/agents/{id}", {
77
- params: { path: { id: agentId } },
78
- body,
79
- headers: this.headers(),
80
- });
81
- }
82
- /**
83
- * Delete an agent.
84
- */
85
- async delete(agentId) {
86
- return this.client.DELETE("/v1/api/agents/{agentId}", {
87
- params: { path: { agentId } },
88
- headers: this.headers(),
89
- });
90
- }
91
- // ======================== Runtime Contexts ========================
92
- /**
93
- * List current runtime contexts for an agent.
94
- */
95
- async listRuntimeContexts(agentId) {
96
- return this.client.GET("/v1/api/agents/{agentId}/runtime-contexts", {
97
- params: { path: { agentId } },
98
- headers: this.headers(),
99
- });
100
- }
101
- /**
102
- * Get the current runtime context for a given key.
103
- */
104
- async getRuntimeContext(agentId, contextKey) {
105
- return this.client.GET("/v1/api/agents/{agentId}/runtime-contexts/{contextKey}", {
106
- params: { path: { agentId, contextKey } },
107
- headers: this.headers(),
108
- });
109
- }
110
- /**
111
- * Create or update the current runtime context for a given key.
112
- */
113
- async upsertRuntimeContext(agentId, contextKey, body) {
114
- return this.client.PUT("/v1/api/agents/{agentId}/runtime-contexts/{contextKey}", {
115
- params: { path: { agentId, contextKey } },
116
- body: {
117
- content: body.content,
118
- source: body.source ?? null,
119
- },
120
- headers: this.headers(),
121
- });
122
- }
123
- // ======================== Portability ========================
124
- /**
125
- * Export an agent as a JSON bundle.
126
- */
127
- async export(agentId) {
128
- return this.client.GET("/v1/api/agents/{id}/export", {
129
- params: { path: { id: agentId } },
130
- headers: this.headers(),
131
- });
132
- }
133
- /**
134
- * Import an agent bundle.
135
- */
136
- async import(bundle) {
137
- return this.client.POST("/v1/api/agents/import", {
138
- body: bundle,
139
- headers: this.headers(),
140
- });
141
- }
142
- // ======================== Graph ========================
143
- /**
144
- * Get the graph for an agent (Mermaid or JSON).
145
- */
146
- async getGraph(agentId, format) {
147
- return this.client.GET("/v1/api/agents/{agentId}/graph", {
148
- params: { path: { agentId }, query: { format } },
149
- headers: this.headers(),
150
- });
151
- }
152
- /** Alias for getGraph (convenience) */
153
- graph = (agentId, format) => this.getGraph(agentId, format);
154
- /**
155
- * Validate the graph configuration.
156
- */
157
- async validateGraph(agentId) {
158
- return this.client.POST("/v1/api/agents/{agentId}/graph/validate", {
159
- params: { path: { agentId } },
160
- headers: this.headers(),
161
- });
162
- }
163
- async getPublishPreview(agentId, irJson) {
164
- if (irJson) {
165
- return this.client.POST("/v1/api/agents/{id}/publish-preview", {
166
- params: { path: { id: agentId } },
167
- body: { ir_json: irJson },
168
- headers: this.headers(),
169
- });
170
- }
171
- return this.client.GET("/v1/api/agents/{id}/publish-preview", {
172
- params: { path: { id: agentId } },
173
- headers: this.headers(),
174
- });
175
- }
176
- // ======================== Draft IR ========================
177
- async getDraftIr(agentId) {
178
- return this.client.GET("/v1/api/agents/{id}/draft/ir", {
179
- params: { path: { id: agentId } },
180
- headers: this.headers(),
181
- });
182
- }
183
- async updateDraftIr(agentId, irJson, options) {
184
- const headers = { ...this.headers() };
185
- if (options?.if_match) {
186
- headers["If-Match"] = options.if_match;
187
- }
188
- const response = await this.client.PUT("/v1/api/agents/{id}/draft/ir", {
189
- params: { path: { id: agentId } },
190
- body: {
191
- ir_json: irJson,
192
- },
193
- headers,
194
- });
195
- const unwrapped = response.data &&
196
- typeof response.data === "object" &&
197
- "data" in response.data &&
198
- typeof response.data.data === "object"
199
- ? (response.data.data ?? undefined)
200
- : response.data;
201
- return {
202
- ...response,
203
- data: unwrapped,
204
- };
205
- }
206
- // ======================== Publishing ========================
207
- /**
208
- * Publish the committed agent artifact pointed to by the current authoring revision.
209
- * The client does not send authoring JSON anymore.
210
- * @param agentId The agent UUID
211
- * @param options Optional settings: version_label for tagging, set_as_live to make this the active version, idempotency_key for safe retries
212
- * @returns Bundle response with version details
213
- * @example
214
- * ```ts
215
- * const { data: bundle } = await client.agents.publish(agentId, {
216
- * idempotency_key: "publish-unique-key"
217
- * });
218
- * ```
219
- */
220
- async publish(agentId, options) {
221
- const headers = { ...this.headers() };
222
- if (options?.idempotency_key) {
223
- headers["X-Idempotency-Key"] = options.idempotency_key;
224
- }
225
- return this.client.POST("/v1/api/agents/{id}/publish", {
226
- params: { path: { id: agentId } },
227
- body: {
228
- version_label: options?.version_label ?? null,
229
- set_as_live: options?.set_as_live ?? true,
230
- required_tools: options?.required_tools ?? []
231
- },
232
- headers
233
- });
234
- }
235
- async listPublishes(agentId) {
236
- return this.client.GET("/v1/api/agents/{id}/publishes", {
237
- params: { path: { id: agentId } },
238
- headers: this.headers(),
239
- });
240
- }
241
- async rollback(agentId, body) {
242
- return this.client.POST("/v1/api/agents/{id}/rollback", {
243
- params: { path: { id: agentId } },
244
- body,
245
- headers: this.headers(),
246
- });
247
- }
248
- // ======================== Bundles ========================
249
- /**
250
- * Get the manifest for a specific bundle.
251
- * Returns artifact metadata only.
252
- * @example
253
- * ```ts
254
- * const { data } = await client.agents.getBundleManifest(agentId, bundleId);
255
- * console.log(data?.artifact_hash);
256
- * ```
257
- */
258
- async getBundleManifest(agentId, bundleId) {
259
- return this.client.GET("/v1/api/agents/{agentId}/bundles/{bundleId}/manifest", {
260
- params: { path: { agentId, bundleId } },
261
- headers: this.headers(),
262
- });
263
- }
264
- /**
265
- * Get Mermaid diagram for a specific bundle graph.
266
- */
267
- async getBundleMermaid(agentId, bundleId) {
268
- return this.client.GET("/v1/api/agents/{agentId}/bundles/{bundleId}/graph/mermaid", {
269
- params: { path: { agentId, bundleId } },
270
- headers: this.headers(),
271
- });
272
- }
273
- /**
274
- * Creates or updates an agent credential binding by binding key.
275
- */
276
- async upsertCredentialBinding(agentId, body) {
277
- return this.client.POST("/v1/api/agents/{id}/credential-bindings", {
278
- params: { path: { id: agentId } },
279
- body: {
280
- credential_instance_ref: body.credential_instance_ref,
281
- binding_key: body.binding_key,
282
- priority: body.priority ?? 0,
283
- },
284
- headers: this.headers(),
285
- });
286
- }
287
- /**
288
- * Lists credential bindings for an agent.
289
- */
290
- async listCredentialBindings(agentId) {
291
- return this.client.GET("/v1/api/agents/{id}/credential-bindings", {
292
- params: { path: { id: agentId } },
293
- headers: this.headers(),
294
- });
295
- }
296
- }
@@ -1,62 +0,0 @@
1
- import type { APIResponse, RawClient } from "../client/raw.js";
2
- export interface ApiToken {
3
- id: string;
4
- name: string;
5
- token_prefix: string;
6
- scopes: string[];
7
- created_at: string;
8
- expires_at?: string | null;
9
- last_used_at?: string | null;
10
- }
11
- export interface ApiTokenSecret extends ApiToken {
12
- token: string;
13
- workspace_id: string;
14
- }
15
- export interface CreateTokenRequest {
16
- name: string;
17
- scopes?: string[];
18
- expires_at?: string | null;
19
- environment?: "live" | "test";
20
- }
21
- export interface RotateTokenResponse extends ApiTokenSecret {
22
- rotated_from: string;
23
- }
24
- export interface ScopeInfo {
25
- key: string;
26
- description: string;
27
- }
28
- export interface ScopeListResponse {
29
- scopes: ScopeInfo[];
30
- }
31
- export declare class ApiTokensModule {
32
- private client;
33
- constructor(client: RawClient);
34
- private headers;
35
- /**
36
- * List all API tokens for the current workspace.
37
- */
38
- list(): Promise<APIResponse<{
39
- tokens: ApiToken[];
40
- }>>;
41
- /**
42
- * Create a new API token.
43
- * The full token secret is only returned in this response.
44
- */
45
- create(body: CreateTokenRequest): Promise<APIResponse<ApiTokenSecret>>;
46
- /**
47
- * List all available scopes.
48
- */
49
- listScopes(): Promise<APIResponse<ScopeListResponse>>;
50
- /**
51
- * Revoke an API token immediately.
52
- */
53
- revoke(id: string): Promise<APIResponse<{
54
- message: string;
55
- }>>;
56
- /**
57
- * Rotate a token (revoke old, create new).
58
- * Returns the new token secret.
59
- */
60
- rotate(id: string): Promise<APIResponse<RotateTokenResponse>>;
61
- }
62
- //# sourceMappingURL=apiTokens.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiTokens.d.ts","sourceRoot":"","sources":["../../src/modules/apiTokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACvD,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,SAAS,EAAE,CAAC;CACvB;AAED,qBAAa,eAAe;IACxB,OAAO,CAAC,MAAM,CAAY;gBAEd,MAAM,EAAE,SAAS;IAI7B,OAAO,CAAC,OAAO;IAMf;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;QAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAC,CAAC;IAM1D;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAO5E;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAM3D;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAOnE;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;CAMtE"}
@@ -1,56 +0,0 @@
1
- export class ApiTokensModule {
2
- client;
3
- constructor(client) {
4
- this.client = client;
5
- }
6
- headers() {
7
- return {
8
- "Content-Type": "application/json",
9
- };
10
- }
11
- /**
12
- * List all API tokens for the current workspace.
13
- */
14
- async list() {
15
- return this.client.GET("/v1/api/tokens", {
16
- headers: this.headers(),
17
- });
18
- }
19
- /**
20
- * Create a new API token.
21
- * The full token secret is only returned in this response.
22
- */
23
- async create(body) {
24
- return this.client.POST("/v1/api/tokens", {
25
- body,
26
- headers: this.headers(),
27
- });
28
- }
29
- /**
30
- * List all available scopes.
31
- */
32
- async listScopes() {
33
- return this.client.GET("/v1/api/tokens/available-scopes", {
34
- headers: this.headers(),
35
- });
36
- }
37
- /**
38
- * Revoke an API token immediately.
39
- */
40
- async revoke(id) {
41
- return this.client.DELETE("/v1/api/tokens/{id}", {
42
- params: { path: { id } },
43
- headers: this.headers(),
44
- });
45
- }
46
- /**
47
- * Rotate a token (revoke old, create new).
48
- * Returns the new token secret.
49
- */
50
- async rotate(id) {
51
- return this.client.POST("/v1/api/tokens/{id}/rotate", {
52
- params: { path: { id } },
53
- headers: this.headers(),
54
- });
55
- }
56
- }
@@ -1,75 +0,0 @@
1
- /**
2
- * Approvals Module - Human-in-the-Loop Native
3
- *
4
- * Wave 2.x: Real implementation for HITL workflow.
5
- * Endpoints: /v1/api/workspaces/{workspaceId}/approvals
6
- */
7
- import type { RawClient, APIResponse } from "../client/raw.js";
8
- export type ApprovalStatus = "pending" | "approved" | "denied" | "expired";
9
- export interface Approval {
10
- id: string;
11
- run_id: string;
12
- attempt_id: string;
13
- policy_name: string;
14
- reason: string;
15
- status: ApprovalStatus;
16
- created_at: string;
17
- decided_at?: string;
18
- decided_by_actor?: string;
19
- payload?: Record<string, unknown>;
20
- }
21
- export interface ApprovalDecision {
22
- decision: "approve" | "deny";
23
- comment?: string;
24
- }
25
- export interface ApprovalListResponse {
26
- items: Approval[];
27
- total: number;
28
- }
29
- export interface ApprovalStatusResponse {
30
- id: string;
31
- status: ApprovalStatus;
32
- decided_at?: string;
33
- decided_by_actor?: string;
34
- decision_comment?: string;
35
- }
36
- export declare class ApprovalsModule {
37
- private client;
38
- private headers;
39
- constructor(client: RawClient, headers: () => Record<string, string>);
40
- /**
41
- * List approvals for a workspace.
42
- * @param workspaceId - Workspace ID
43
- * @param params - Filter options
44
- */
45
- list(workspaceId: string, params?: {
46
- status?: ApprovalStatus;
47
- limit?: number;
48
- }): Promise<APIResponse<ApprovalListResponse>>;
49
- /**
50
- * Get a specific approval by ID.
51
- * @param workspaceId - Workspace ID
52
- * @param approvalId - Approval ID
53
- */
54
- get(workspaceId: string, approvalId: string): Promise<APIResponse<Approval>>;
55
- /**
56
- * Approve an approval request.
57
- * @param workspaceId - Workspace ID
58
- * @param approvalId - Approval ID
59
- * @param comment - Optional reason for approval
60
- */
61
- approve(workspaceId: string, approvalId: string, comment?: string): Promise<APIResponse<ApprovalStatusResponse>>;
62
- /**
63
- * Deny an approval request.
64
- * @param workspaceId - Workspace ID
65
- * @param approvalId - Approval ID
66
- * @param comment - Optional reason for denial
67
- */
68
- deny(workspaceId: string, approvalId: string, comment?: string): Promise<APIResponse<ApprovalStatusResponse>>;
69
- /**
70
- * Shorthand: List pending approvals for a workspace.
71
- */
72
- listPending(workspaceId: string, limit?: number): Promise<APIResponse<ApprovalListResponse>>;
73
- reject: (workspaceId: string, approvalId: string, comment?: string) => Promise<APIResponse<ApprovalStatusResponse>>;
74
- }
75
- //# sourceMappingURL=approvals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../../src/modules/approvals.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAM/D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3E,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACjC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAA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Native
3
- *
4
- * Wave 2.x: Real implementation for HITL workflow.
5
- * Endpoints: /v1/api/workspaces/{workspaceId}/approvals
6
- */
7
- // ============================================================================
8
- // Module
9
- // ============================================================================
10
- export class ApprovalsModule {
11
- client;
12
- headers;
13
- constructor(client, headers) {
14
- this.client = client;
15
- this.headers = headers;
16
- }
17
- /**
18
- * List approvals for a workspace.
19
- * @param workspaceId - Workspace ID
20
- * @param params - Filter options
21
- */
22
- async list(workspaceId, params) {
23
- return this.client.GET("/v1/api/workspaces/{workspaceId}/approvals", {
24
- params: {
25
- path: { workspaceId },
26
- query: {
27
- status: params?.status,
28
- limit: params?.limit ?? 50
29
- }
30
- },
31
- headers: this.headers(),
32
- });
33
- }
34
- /**
35
- * Get a specific approval by ID.
36
- * @param workspaceId - Workspace ID
37
- * @param approvalId - Approval ID
38
- */
39
- async get(workspaceId, approvalId) {
40
- return this.client.GET("/v1/api/workspaces/{workspaceId}/approvals/{approvalId}", {
41
- params: {
42
- path: { workspaceId, approvalId }
43
- },
44
- headers: this.headers(),
45
- });
46
- }
47
- /**
48
- * Approve an approval request.
49
- * @param workspaceId - Workspace ID
50
- * @param approvalId - Approval ID
51
- * @param comment - Optional reason for approval
52
- */
53
- async approve(workspaceId, approvalId, comment) {
54
- return this.client.POST("/v1/api/workspaces/{workspaceId}/approvals/{approvalId}/decision", {
55
- params: {
56
- path: { workspaceId, approvalId }
57
- },
58
- body: {
59
- decision: "approve",
60
- comment
61
- },
62
- headers: this.headers(),
63
- });
64
- }
65
- /**
66
- * Deny an approval request.
67
- * @param workspaceId - Workspace ID
68
- * @param approvalId - Approval ID
69
- * @param comment - Optional reason for denial
70
- */
71
- async deny(workspaceId, approvalId, comment) {
72
- return this.client.POST("/v1/api/workspaces/{workspaceId}/approvals/{approvalId}/decision", {
73
- params: {
74
- path: { workspaceId, approvalId }
75
- },
76
- body: {
77
- decision: "deny",
78
- comment
79
- },
80
- headers: this.headers(),
81
- });
82
- }
83
- /**
84
- * Shorthand: List pending approvals for a workspace.
85
- */
86
- async listPending(workspaceId, limit = 50) {
87
- return this.list(workspaceId, { status: "pending", limit });
88
- }
89
- // Convenience aliases
90
- reject = this.deny;
91
- }
@@ -1,78 +0,0 @@
1
- /**
2
- * Audit Module - Fully Typed
3
- */
4
- import type { RawClient, APIResponse } from "../client/raw.js";
5
- export interface AuditLogEntry {
6
- id: string;
7
- tenant_id: string;
8
- workspace_id?: string;
9
- actor: string;
10
- actor_type: "user" | "system" | "api_token";
11
- action: string;
12
- resource: string;
13
- resource_id?: string;
14
- metadata?: Record<string, unknown>;
15
- ip_address?: string;
16
- user_agent?: string;
17
- created_at: string;
18
- }
19
- export interface AuditListResponse {
20
- items: AuditLogEntry[];
21
- total: number;
22
- }
23
- export declare class AuditModule {
24
- private client;
25
- private headers;
26
- constructor(client: RawClient, headers: () => Record<string, string>);
27
- /**
28
- * List audit log entries.
29
- */
30
- list(params?: {
31
- actor?: string;
32
- action?: string;
33
- resource?: string;
34
- workspace_id?: string;
35
- from?: string;
36
- to?: string;
37
- limit?: number;
38
- offset?: number;
39
- }): Promise<APIResponse<AuditListResponse>>;
40
- /**
41
- * Get a specific audit log entry.
42
- */
43
- get(auditId: string): Promise<APIResponse<AuditLogEntry>>;
44
- /**
45
- * Search audit logs by action pattern.
46
- */
47
- search(params?: {
48
- query?: string;
49
- from?: string;
50
- to?: string;
51
- limit?: number;
52
- offset?: number;
53
- }): Promise<APIResponse<AuditListResponse>>;
54
- /**
55
- * Iterate through all audit logs with automatic pagination.
56
- *
57
- * @example
58
- * ```ts
59
- * // Get all audit logs for a specific action
60
- * for await (const entry of client.audit.iterate({ action: "agent.created" })) {
61
- * console.log(entry.actor, entry.action);
62
- * }
63
- * ```
64
- */
65
- iterate(filters?: {
66
- actor?: string;
67
- action?: string;
68
- resource?: string;
69
- workspace_id?: string;
70
- from?: string;
71
- to?: string;
72
- }, options?: {
73
- pageSize?: number;
74
- maxItems?: number;
75
- signal?: AbortSignal;
76
- }): AsyncGenerator<AuditLogEntry, void, unknown>;
77
- }
78
- //# sourceMappingURL=audit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/modules/audit.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACjB;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,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,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