@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,43 +0,0 @@
1
- /**
2
- * Usage Module — Tenant-level usage metrics and quotas.
3
- *
4
- * Endpoints: GET /v1/api/quotas, GET /v1/api/usage
5
- * Source: runtime.cost_events aggregation
6
- */
7
- // =============================================================================
8
- // Module
9
- // =============================================================================
10
- export class UsageModule {
11
- client;
12
- headers;
13
- constructor(client, headers) {
14
- this.client = client;
15
- this.headers = headers;
16
- }
17
- /**
18
- * Get current quota status (tenant-level).
19
- */
20
- async getQuotas(params) {
21
- const query = {
22
- workspaceId: params?.workspaceId ?? params?.workspace_id,
23
- };
24
- return this.client.GET("/v1/api/quotas", {
25
- params: { query },
26
- headers: this.headers(),
27
- });
28
- }
29
- /**
30
- * Get usage metrics with real data from runtime.cost_events.
31
- */
32
- async getUsage(params) {
33
- const query = {
34
- workspaceId: params?.workspaceId ?? params?.workspace_id,
35
- from: params?.from,
36
- to: params?.to,
37
- };
38
- return this.client.GET("/v1/api/usage", {
39
- params: { query },
40
- headers: this.headers(),
41
- });
42
- }
43
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * Vector Stores Module - Fully Typed
3
- */
4
- import type { RawClient, APIResponse } from "../client/raw.js";
5
- export interface VectorStore {
6
- id: string;
7
- name: string;
8
- embedding_provider: string;
9
- embedding_model: string;
10
- dimension: number;
11
- credential_binding_key?: string;
12
- file_count: number;
13
- created_at: string;
14
- }
15
- export interface VectorStoreListResponse {
16
- items: VectorStore[];
17
- total: number;
18
- }
19
- export interface VectorSearchResult {
20
- id: string;
21
- chunk_index: number;
22
- content_text: string;
23
- score: number;
24
- file_id?: string;
25
- }
26
- export interface VectorQueryResult {
27
- query: string;
28
- results: VectorSearchResult[];
29
- total_results: number;
30
- }
31
- export interface VectorStoreFile {
32
- id: string;
33
- file_id: string;
34
- filename: string;
35
- status: "pending" | "processing" | "completed" | "failed";
36
- created_at: string;
37
- }
38
- export interface VectorStoreFilesResponse {
39
- items: VectorStoreFile[];
40
- total: number;
41
- }
42
- export declare class VectorStoresModule {
43
- private client;
44
- private headers;
45
- constructor(client: RawClient, headers: () => Record<string, string>);
46
- /**
47
- * List all vector stores.
48
- */
49
- list(params?: {
50
- workspace_id?: string;
51
- limit?: number;
52
- offset?: number;
53
- }): Promise<APIResponse<VectorStoreListResponse>>;
54
- /**
55
- * Get a vector store by ID.
56
- */
57
- get(storeId: string): Promise<APIResponse<VectorStore>>;
58
- /**
59
- * Create a new vector store.
60
- */
61
- create(body: {
62
- name: string;
63
- embedding_provider?: string;
64
- embedding_model?: string;
65
- dimension?: number;
66
- credential_binding_key?: string;
67
- }): Promise<APIResponse<VectorStore>>;
68
- /**
69
- * Delete a vector store.
70
- */
71
- delete(storeId: string): Promise<APIResponse<void>>;
72
- /**
73
- * Query a vector store for similar content.
74
- */
75
- query(storeId: string, body: {
76
- query: string;
77
- top_k?: number;
78
- min_score?: number;
79
- }): Promise<APIResponse<VectorQueryResult>>;
80
- /**
81
- * List files in a vector store.
82
- */
83
- listFiles(storeId: string, params?: {
84
- skip?: number;
85
- take?: number;
86
- }): Promise<APIResponse<VectorStoreFilesResponse>>;
87
- /**
88
- * Attach a file to a vector store.
89
- */
90
- attachFile(storeId: string, fileId: string): Promise<APIResponse<VectorStoreFile>>;
91
- /**
92
- * Remove a file from a vector store.
93
- */
94
- removeFile(storeId: string, fileId: string): Promise<APIResponse<void>>;
95
- /**
96
- * Bind a vector store to an agent.
97
- */
98
- bindAgent(storeId: string, agentId: string): Promise<APIResponse<void>>;
99
- }
100
- //# sourceMappingURL=vectorStores.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vectorStores.d.ts","sourceRoot":"","sources":["../../src/modules/vectorStores.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAM3E,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM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OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAU3C;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;QACtC,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAmBlD;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAiBxF;;OAEG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAO7E;;OAEG;IACG,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;CAOhF"}
@@ -1,159 +0,0 @@
1
- /**
2
- * Vector Stores Module - Fully Typed
3
- */
4
- function toVectorStore(item) {
5
- return {
6
- id: item.id ?? "",
7
- name: item.name ?? "",
8
- embedding_provider: item.embedding_provider ?? item.embeddingProvider ?? "",
9
- embedding_model: item.embedding_model ?? item.embeddingModel ?? "",
10
- dimension: item.dimension ?? 0,
11
- credential_binding_key: item.credential_binding_key ?? item.credentialBindingKey ?? undefined,
12
- file_count: item.file_count ?? item.fileCount ?? 0,
13
- created_at: item.created_at ?? item.createdAt ?? "",
14
- };
15
- }
16
- function toVectorStoreFile(item) {
17
- return {
18
- id: item.id ?? "",
19
- file_id: item.file_id ?? item.fileId ?? "",
20
- filename: item.filename ?? "",
21
- status: (item.status ?? "pending"),
22
- created_at: item.created_at ?? item.createdAt ?? "",
23
- };
24
- }
25
- export class VectorStoresModule {
26
- client;
27
- headers;
28
- constructor(client, headers) {
29
- this.client = client;
30
- this.headers = headers;
31
- }
32
- /**
33
- * List all vector stores.
34
- */
35
- async list(params) {
36
- const response = await this.client.GET("/v1/api/vector-stores", {
37
- params: { query: params },
38
- headers: this.headers(),
39
- });
40
- const items = Array.isArray(response.data)
41
- ? response.data.map((item) => toVectorStore(item))
42
- : [];
43
- return {
44
- ...response,
45
- data: {
46
- items,
47
- total: items.length,
48
- },
49
- };
50
- }
51
- /**
52
- * Get a vector store by ID.
53
- */
54
- async get(storeId) {
55
- const response = await this.client.GET("/v1/api/vector-stores/{vectorStoreId}", {
56
- params: { path: { vectorStoreId: storeId } },
57
- headers: this.headers(),
58
- });
59
- if (!response.data) {
60
- return response;
61
- }
62
- return {
63
- ...response,
64
- data: toVectorStore(response.data),
65
- };
66
- }
67
- /**
68
- * Create a new vector store.
69
- */
70
- async create(body) {
71
- const response = await this.client.POST("/v1/api/vector-stores", {
72
- body,
73
- headers: this.headers(),
74
- });
75
- if (!response.data) {
76
- return response;
77
- }
78
- return {
79
- ...response,
80
- data: toVectorStore(response.data),
81
- };
82
- }
83
- /**
84
- * Delete a vector store.
85
- */
86
- async delete(storeId) {
87
- return this.client.DELETE("/v1/api/vector-stores/{vectorStoreId}", {
88
- params: { path: { vectorStoreId: storeId } },
89
- headers: this.headers(),
90
- });
91
- }
92
- // ======================== Query ========================
93
- /**
94
- * Query a vector store for similar content.
95
- */
96
- async query(storeId, body) {
97
- return this.client.POST("/v1/api/vector-stores/{vectorStoreId}/query", {
98
- params: { path: { vectorStoreId: storeId } },
99
- body,
100
- headers: this.headers(),
101
- });
102
- }
103
- // ======================== Files ========================
104
- /**
105
- * List files in a vector store.
106
- */
107
- async listFiles(storeId, params) {
108
- const response = await this.client.GET("/v1/api/vector-stores/{vectorStoreId}/files", {
109
- params: { path: { vectorStoreId: storeId }, query: params },
110
- headers: this.headers(),
111
- });
112
- const items = Array.isArray(response.data)
113
- ? response.data.map((item) => toVectorStoreFile(item))
114
- : [];
115
- return {
116
- ...response,
117
- data: {
118
- items,
119
- total: items.length,
120
- },
121
- };
122
- }
123
- /**
124
- * Attach a file to a vector store.
125
- */
126
- async attachFile(storeId, fileId) {
127
- const response = await this.client.POST("/v1/api/vector-stores/{vectorStoreId}/files", {
128
- params: { path: { vectorStoreId: storeId } },
129
- body: { file_id: fileId },
130
- headers: this.headers(),
131
- });
132
- if (!response.data) {
133
- return response;
134
- }
135
- return {
136
- ...response,
137
- data: toVectorStoreFile(response.data),
138
- };
139
- }
140
- /**
141
- * Remove a file from a vector store.
142
- */
143
- async removeFile(storeId, fileId) {
144
- return this.client.DELETE("/v1/api/vector-stores/{vectorStoreId}/files/{fileId}", {
145
- params: { path: { vectorStoreId: storeId, fileId } },
146
- headers: this.headers(),
147
- });
148
- }
149
- /**
150
- * Bind a vector store to an agent.
151
- */
152
- async bindAgent(storeId, agentId) {
153
- return this.client.POST("/v1/api/vector-stores/{vectorStoreId}/bind-agent", {
154
- params: { path: { vectorStoreId: storeId } },
155
- body: { agent_id: agentId },
156
- headers: this.headers(),
157
- });
158
- }
159
- }
@@ -1,138 +0,0 @@
1
- /**
2
- * Workspaces Module - Fully Typed
3
- */
4
- import type { RawClient, APIResponse } from "../client/raw.js";
5
- /** Event emitted by workspace-level SSE stream. */
6
- export interface WorkspaceEvent {
7
- type: string;
8
- workspace_id: string;
9
- run_id?: string;
10
- agent_id?: string;
11
- old_status?: string;
12
- new_status?: string;
13
- ts: number;
14
- }
15
- /** Options for followEvents(). */
16
- export interface WorkspaceFollowOptions {
17
- /** AbortSignal to kill the SSE connection. Required for cleanup. */
18
- signal?: AbortSignal;
19
- }
20
- export interface Workspace {
21
- id: string;
22
- tenant_id: string;
23
- name: string;
24
- is_default: boolean;
25
- settings?: Record<string, unknown>;
26
- created_at: string;
27
- updated_at: string;
28
- }
29
- export interface WorkspaceListResponse {
30
- items: Workspace[];
31
- total: number;
32
- }
33
- export declare class WorkspacesModule {
34
- private client;
35
- private getTenantId;
36
- private headers;
37
- constructor(client: RawClient, getTenantId: () => string, headers: () => Record<string, string>);
38
- /**
39
- * List all workspaces.
40
- */
41
- list(params?: {
42
- limit?: number;
43
- offset?: number;
44
- }): Promise<APIResponse<WorkspaceListResponse>>;
45
- /**
46
- * Get a workspace by ID.
47
- */
48
- get(workspaceId: string): Promise<APIResponse<Workspace>>;
49
- /**
50
- * Create a new workspace.
51
- */
52
- create(body: {
53
- name: string;
54
- is_default?: boolean;
55
- }): Promise<APIResponse<Workspace>>;
56
- /**
57
- * Update a workspace.
58
- */
59
- update(workspaceId: string, body: {
60
- name?: string;
61
- }): Promise<APIResponse<Workspace>>;
62
- /**
63
- * Delete a workspace.
64
- */
65
- delete(workspaceId: string): Promise<APIResponse<void>>;
66
- /**
67
- * Get workspace quotas.
68
- */
69
- getQuotas(workspaceId: string): Promise<APIResponse<WorkspaceQuotaResponse>>;
70
- /**
71
- * Get workspace usage.
72
- */
73
- getUsage(workspaceId: string, params?: {
74
- from?: string;
75
- to?: string;
76
- }): Promise<APIResponse<WorkspaceUsageResponse>>;
77
- /**
78
- * Stream workspace events via SSE.
79
- * Workspace identity flows via X-Workspace-Id header (same as all SDK methods).
80
- *
81
- * @param options - AbortSignal for cleanup (MUST be used to avoid leaking connections)
82
- *
83
- * @example
84
- * ```ts
85
- * const controller = new AbortController();
86
- * for await (const event of client.workspaces.followEvents({ signal: controller.signal })) {
87
- * if (event.type === 'run_status_changed') {
88
- * console.log(`Run ${event.run_id} → ${event.new_status}`);
89
- * }
90
- * }
91
- * // On cleanup:
92
- * controller.abort();
93
- * ```
94
- */
95
- followEvents(options?: WorkspaceFollowOptions): AsyncGenerator<WorkspaceEvent, void, unknown>;
96
- }
97
- export interface WorkspaceQuotaResponse {
98
- workspace_id: string;
99
- quotas: {
100
- runs_per_month: Quota;
101
- tokens_per_month: Quota;
102
- agents_max: Quota;
103
- storage_mb: Quota;
104
- };
105
- reset_at: string;
106
- source: string;
107
- }
108
- export interface Quota {
109
- limit: number;
110
- used: number;
111
- remaining: number;
112
- }
113
- export interface WorkspaceUsageResponse {
114
- workspace_id: string;
115
- period: {
116
- from: string;
117
- to: string;
118
- };
119
- usage: {
120
- total_runs: number;
121
- completed_runs: number;
122
- failed_runs: number;
123
- total_tokens: number;
124
- input_tokens: number;
125
- output_tokens: number;
126
- total_duration_ms: number;
127
- estimated_count: number;
128
- };
129
- daily_breakdown: Array<{
130
- date: string;
131
- runs: number;
132
- tokens_in: number;
133
- tokens_out: number;
134
- duration_ms: number;
135
- }>;
136
- source: string;
137
- }
138
- //# sourceMappingURL=workspaces.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/modules/workspaces.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAc,MAAM,kBAAkB,CAAC;AAO3E,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,kCAAkC;AAClC,MAAM,WAAW,sBAAsB;IACnC,oEAAoE;IACpE,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,gBAAgB;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AAO,CAAC,EAAE,sBAAsB,GAAG,cAAc,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,CAAC;CAyBvG;AAED,MAAM,WAAW,sBAAsB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE;QACJ,cAAc,EAAE,KAAK,CAAC;QACtB,gBAAgB,EAAE,KAAK,CAAC;QACxB,UAAU,EAAE,KAAK,CAAC;QAClB,UAAU,EAAE,KAAK,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,KAAK,EAAE;QACH,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,eAAe,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,MAAM,EAAE,MAAM,CAAC;CAClB"}
@@ -1,121 +0,0 @@
1
- /**
2
- * Workspaces Module - Fully Typed
3
- */
4
- import { parseSSE } from "../sse/client.js";
5
- export class WorkspacesModule {
6
- client;
7
- getTenantId;
8
- headers;
9
- constructor(client, getTenantId, headers) {
10
- this.client = client;
11
- this.getTenantId = getTenantId;
12
- this.headers = headers;
13
- }
14
- /**
15
- * List all workspaces.
16
- */
17
- async list(params) {
18
- return this.client.GET("/v1/api/workspaces", {
19
- params: { query: params },
20
- headers: this.headers(),
21
- });
22
- }
23
- /**
24
- * Get a workspace by ID.
25
- */
26
- async get(workspaceId) {
27
- return this.client.GET("/v1/api/workspaces/{id}", {
28
- params: { path: { id: workspaceId } },
29
- headers: this.headers(),
30
- });
31
- }
32
- /**
33
- * Create a new workspace.
34
- */
35
- async create(body) {
36
- return this.client.POST("/v1/api/workspaces", {
37
- body,
38
- headers: this.headers(),
39
- });
40
- }
41
- /**
42
- * Update a workspace.
43
- */
44
- async update(workspaceId, body) {
45
- return this.client.PUT("/v1/api/workspaces/{id}", {
46
- params: { path: { id: workspaceId } },
47
- body,
48
- headers: this.headers(),
49
- });
50
- }
51
- /**
52
- * Delete a workspace.
53
- */
54
- async delete(workspaceId) {
55
- return this.client.DELETE("/v1/api/workspaces/{id}", {
56
- params: { path: { id: workspaceId } },
57
- headers: this.headers(),
58
- });
59
- }
60
- /**
61
- * Get workspace quotas.
62
- */
63
- async getQuotas(workspaceId) {
64
- return this.client.GET("/v1/api/workspaces/{workspaceId}/quotas", {
65
- params: { path: { workspaceId } },
66
- headers: this.headers(),
67
- });
68
- }
69
- /**
70
- * Get workspace usage.
71
- */
72
- async getUsage(workspaceId, params) {
73
- return this.client.GET("/v1/api/workspaces/{workspaceId}/usage", {
74
- params: { path: { workspaceId }, query: params },
75
- headers: this.headers(),
76
- });
77
- }
78
- // ======================== FOLLOW (Workspace SSE) ========================
79
- /**
80
- * Stream workspace events via SSE.
81
- * Workspace identity flows via X-Workspace-Id header (same as all SDK methods).
82
- *
83
- * @param options - AbortSignal for cleanup (MUST be used to avoid leaking connections)
84
- *
85
- * @example
86
- * ```ts
87
- * const controller = new AbortController();
88
- * for await (const event of client.workspaces.followEvents({ signal: controller.signal })) {
89
- * if (event.type === 'run_status_changed') {
90
- * console.log(`Run ${event.run_id} → ${event.new_status}`);
91
- * }
92
- * }
93
- * // On cleanup:
94
- * controller.abort();
95
- * ```
96
- */
97
- async *followEvents(options) {
98
- // Workspace identity flows via X-Workspace-Id header (set by this.headers()),
99
- // consistent with all other SDK endpoints. No path param needed.
100
- const response = await this.client.streamGet("/v1/api/workspaces/events/stream", {
101
- headers: this.headers(),
102
- signal: options?.signal,
103
- });
104
- try {
105
- for await (const rawEvent of parseSSE(response)) {
106
- if (rawEvent.data != null) {
107
- yield rawEvent.data;
108
- }
109
- }
110
- }
111
- catch (err) {
112
- // Abort is normal cleanup — not an error worth surfacing.
113
- // Check both signal state and error name (covers proxy/wrapper edge cases).
114
- if (options?.signal?.aborted)
115
- return;
116
- if (err instanceof Error && err.name === "AbortError")
117
- return;
118
- throw err;
119
- }
120
- }
121
- }