@proteos/sdk 0.18.1

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 (94) hide show
  1. package/LICENSE +40 -0
  2. package/dist/chunk-7RGN4E22.cjs +1185 -0
  3. package/dist/chunk-7RGN4E22.cjs.map +1 -0
  4. package/dist/chunk-XJP5WCRZ.js +1125 -0
  5. package/dist/chunk-XJP5WCRZ.js.map +1 -0
  6. package/dist/index.cjs +2384 -0
  7. package/dist/index.cjs.map +1 -0
  8. package/dist/index.d.cts +5225 -0
  9. package/dist/index.d.ts +5225 -0
  10. package/dist/index.js +2146 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/meta/index.cjs +204 -0
  13. package/dist/meta/index.cjs.map +1 -0
  14. package/dist/meta/index.d.cts +2 -0
  15. package/dist/meta/index.d.ts +2 -0
  16. package/dist/meta/index.js +3 -0
  17. package/dist/meta/index.js.map +1 -0
  18. package/dist/types-BNsjfU8N.d.cts +3299 -0
  19. package/dist/types-BNsjfU8N.d.ts +3299 -0
  20. package/package.json +86 -0
  21. package/src/agent/agents.ts +53 -0
  22. package/src/agent/index.ts +134 -0
  23. package/src/agent/mcp-servers.ts +102 -0
  24. package/src/agent/prompts.ts +80 -0
  25. package/src/agent/session-types.ts +397 -0
  26. package/src/agent/sessions.ts +197 -0
  27. package/src/agent/skills.ts +89 -0
  28. package/src/agent/tools.ts +53 -0
  29. package/src/agent/types.ts +362 -0
  30. package/src/auth/index.ts +111 -0
  31. package/src/auth/me.ts +46 -0
  32. package/src/auth/organizations.ts +128 -0
  33. package/src/auth/platform-entities.ts +78 -0
  34. package/src/auth/roles.ts +213 -0
  35. package/src/auth/types.ts +294 -0
  36. package/src/auth/users.ts +226 -0
  37. package/src/client.ts +441 -0
  38. package/src/connector/index.ts +120 -0
  39. package/src/connector/types.ts +150 -0
  40. package/src/conversation/index.ts +297 -0
  41. package/src/conversation/types.ts +590 -0
  42. package/src/conversation/voice.ts +123 -0
  43. package/src/data/index.ts +53 -0
  44. package/src/data/queries.ts +66 -0
  45. package/src/data/records.ts +122 -0
  46. package/src/data/types.ts +89 -0
  47. package/src/errors.ts +148 -0
  48. package/src/events/index.ts +172 -0
  49. package/src/events/types.ts +77 -0
  50. package/src/functions/actions.ts +95 -0
  51. package/src/functions/index.ts +32 -0
  52. package/src/functions/types.ts +71 -0
  53. package/src/http/index.ts +2 -0
  54. package/src/http/query-params.ts +106 -0
  55. package/src/index.ts +598 -0
  56. package/src/iterator.ts +183 -0
  57. package/src/knowledge/graph.ts +35 -0
  58. package/src/knowledge/index.ts +104 -0
  59. package/src/knowledge/labels.ts +70 -0
  60. package/src/knowledge/links.ts +65 -0
  61. package/src/knowledge/nodes.ts +198 -0
  62. package/src/knowledge/record-links.ts +66 -0
  63. package/src/knowledge/types.ts +569 -0
  64. package/src/meta/apps.ts +107 -0
  65. package/src/meta/components.ts +124 -0
  66. package/src/meta/currency/index.ts +202 -0
  67. package/src/meta/entities.ts +193 -0
  68. package/src/meta/filters.ts +76 -0
  69. package/src/meta/index.ts +227 -0
  70. package/src/meta/layout/common-props.ts +93 -0
  71. package/src/meta/layout/control-registry.json +70 -0
  72. package/src/meta/layout/control-registry.ts +92 -0
  73. package/src/meta/layout/elements.ts +203 -0
  74. package/src/meta/layout/index.ts +41 -0
  75. package/src/meta/layout/page-layout.ts +35 -0
  76. package/src/meta/layout/size-value.ts +27 -0
  77. package/src/meta/list-views.ts +109 -0
  78. package/src/meta/lists.ts +104 -0
  79. package/src/meta/menu-configurations.ts +128 -0
  80. package/src/meta/modules.ts +159 -0
  81. package/src/meta/pages.ts +106 -0
  82. package/src/meta/types.ts +1115 -0
  83. package/src/meta/variables.ts +98 -0
  84. package/src/storage/files.ts +183 -0
  85. package/src/storage/index.ts +33 -0
  86. package/src/storage/types.ts +70 -0
  87. package/src/types/common.ts +143 -0
  88. package/src/types/index.ts +28 -0
  89. package/src/types/options.ts +95 -0
  90. package/src/workflow/executions.ts +99 -0
  91. package/src/workflow/index.ts +109 -0
  92. package/src/workflow/node-types.ts +50 -0
  93. package/src/workflow/types.ts +658 -0
  94. package/src/workflow/workflows.ts +152 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2384 @@
1
+ 'use strict';
2
+
3
+ var chunk7RGN4E22_cjs = require('./chunk-7RGN4E22.cjs');
4
+ var zod = require('zod');
5
+ var fetchEventSource = require('@microsoft/fetch-event-source');
6
+
7
+ // src/agent/agents.ts
8
+ var AGENTS_BASE_PATH = "/agents/v1/agents";
9
+ var AgentServiceImpl = class {
10
+ constructor(client) {
11
+ this.client = client;
12
+ }
13
+ client;
14
+ list(options = {}) {
15
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
16
+ }
17
+ async listPage(options = {}) {
18
+ return this.client.requestWithQuery("GET", AGENTS_BASE_PATH, options);
19
+ }
20
+ async get(key) {
21
+ return this.client.request("GET", `${AGENTS_BASE_PATH}/${key}`);
22
+ }
23
+ async create(request) {
24
+ return this.client.request("POST", AGENTS_BASE_PATH, request);
25
+ }
26
+ async update(key, request) {
27
+ return this.client.request("PATCH", `${AGENTS_BASE_PATH}/${key}`, request);
28
+ }
29
+ async delete(key) {
30
+ await this.client.request("DELETE", `${AGENTS_BASE_PATH}/${key}`);
31
+ }
32
+ };
33
+
34
+ // src/agent/mcp-servers.ts
35
+ var MCP_SERVERS_BASE_PATH = "/agents/v1/mcp-servers";
36
+ var McpServerServiceImpl = class {
37
+ constructor(client) {
38
+ this.client = client;
39
+ }
40
+ client;
41
+ list(options = {}) {
42
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
43
+ }
44
+ async listPage(options = {}) {
45
+ return this.client.requestWithQuery(
46
+ "GET",
47
+ MCP_SERVERS_BASE_PATH,
48
+ options
49
+ );
50
+ }
51
+ async get(key) {
52
+ return this.client.request("GET", `${MCP_SERVERS_BASE_PATH}/${key}`);
53
+ }
54
+ async create(request) {
55
+ return this.client.request("POST", MCP_SERVERS_BASE_PATH, request);
56
+ }
57
+ async update(key, request) {
58
+ return this.client.request("PATCH", `${MCP_SERVERS_BASE_PATH}/${key}`, request);
59
+ }
60
+ async delete(key) {
61
+ await this.client.request("DELETE", `${MCP_SERVERS_BASE_PATH}/${key}`);
62
+ }
63
+ async listTools(key) {
64
+ const response = await this.client.request(
65
+ "GET",
66
+ `${MCP_SERVERS_BASE_PATH}/${key}/tools`
67
+ );
68
+ return response.data;
69
+ }
70
+ async getConnectionStatus(key) {
71
+ const response = await this.client.request(
72
+ "GET",
73
+ `${MCP_SERVERS_BASE_PATH}/${key}/connection`
74
+ );
75
+ return response.data;
76
+ }
77
+ async startOAuth(key) {
78
+ return this.client.request(
79
+ "POST",
80
+ `${MCP_SERVERS_BASE_PATH}/${key}/oauth/connect`
81
+ );
82
+ }
83
+ async disconnectOAuth(key) {
84
+ await this.client.request("DELETE", `${MCP_SERVERS_BASE_PATH}/${key}/oauth/connect`);
85
+ }
86
+ };
87
+
88
+ // src/agent/prompts.ts
89
+ var PROMPTS_BASE_PATH = "/agents/v1/prompts";
90
+ var PromptServiceImpl = class {
91
+ constructor(client) {
92
+ this.client = client;
93
+ }
94
+ client;
95
+ list(options = {}) {
96
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
97
+ }
98
+ async listPage(options = {}) {
99
+ return this.client.requestWithQuery("GET", PROMPTS_BASE_PATH, options);
100
+ }
101
+ async get(key) {
102
+ return this.client.request("GET", `${PROMPTS_BASE_PATH}/${key}`);
103
+ }
104
+ async create(request) {
105
+ return this.client.request("POST", PROMPTS_BASE_PATH, request);
106
+ }
107
+ async update(key, request) {
108
+ return this.client.request("PATCH", `${PROMPTS_BASE_PATH}/${key}`, request);
109
+ }
110
+ async delete(key) {
111
+ await this.client.request("DELETE", `${PROMPTS_BASE_PATH}/${key}`);
112
+ }
113
+ async listVersions(key) {
114
+ const response = await this.client.request(
115
+ "GET",
116
+ `${PROMPTS_BASE_PATH}/${key}/versions`
117
+ );
118
+ return response.data;
119
+ }
120
+ async getVersion(key, number) {
121
+ return this.client.request(
122
+ "GET",
123
+ `${PROMPTS_BASE_PATH}/${key}/versions/${number}`
124
+ );
125
+ }
126
+ };
127
+
128
+ // src/agent/sessions.ts
129
+ var SESSIONS_BASE_PATH = "/agents/v1/sessions";
130
+ var SessionServiceImpl = class {
131
+ constructor(client) {
132
+ this.client = client;
133
+ }
134
+ client;
135
+ list(options = {}) {
136
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
137
+ }
138
+ async listPage(options = {}) {
139
+ return this.client.requestWithQuery("GET", SESSIONS_BASE_PATH, options);
140
+ }
141
+ async get(id) {
142
+ return this.client.request("GET", `${SESSIONS_BASE_PATH}/${id}`);
143
+ }
144
+ async create(request) {
145
+ return this.client.request("POST", SESSIONS_BASE_PATH, request);
146
+ }
147
+ async events(id, options = {}) {
148
+ const { types, ...rest } = options;
149
+ const query = {
150
+ ...rest,
151
+ ...types && types.length > 0 ? { types: types.join(",") } : {}
152
+ };
153
+ const response = await this.client.requestWithQuery(
154
+ "GET",
155
+ `${SESSIONS_BASE_PATH}/${id}/events`,
156
+ query
157
+ );
158
+ return response.data ?? [];
159
+ }
160
+ async appendEvent(id, request) {
161
+ return this.client.request("POST", `${SESSIONS_BASE_PATH}/${id}/events`, request);
162
+ }
163
+ async turns(id) {
164
+ const response = await this.client.request(
165
+ "GET",
166
+ `${SESSIONS_BASE_PATH}/${id}/turns`
167
+ );
168
+ return response.data ?? [];
169
+ }
170
+ async *stream(id, options = {}) {
171
+ const query = options.afterSeq ? `?after_seq=${options.afterSeq}` : "";
172
+ const path = `${SESSIONS_BASE_PATH}/${id}/events/stream${query}`;
173
+ const streamOptions = options.signal ? { signal: options.signal } : {};
174
+ for await (const frame of this.client.streamEvents(path, streamOptions)) {
175
+ const event = parseEvent(frame.data);
176
+ if (event) yield event;
177
+ }
178
+ }
179
+ async sendMessage(id, text, turnId) {
180
+ return this.sendUserMessage(id, { text, ...turnId ? { turnId } : {} });
181
+ }
182
+ async sendUserMessage(id, input) {
183
+ const content = [];
184
+ const text = input.text?.trim();
185
+ if (text) content.push({ type: "text", text });
186
+ for (const file of input.files ?? []) {
187
+ content.push({ type: "file", ...file });
188
+ }
189
+ return this.appendEvent(id, {
190
+ type: "user.message",
191
+ ...input.turnId ? { turn_id: input.turnId } : {},
192
+ payload: { content }
193
+ });
194
+ }
195
+ async interrupt(id) {
196
+ return this.appendEvent(id, { type: "user.interrupt" });
197
+ }
198
+ async submitToolResult(id, input) {
199
+ return this.appendEvent(id, {
200
+ type: "user.tool_result",
201
+ payload: {
202
+ tool_use_id: input.toolUseId,
203
+ result: input.result,
204
+ outcome: input.outcome ?? "success"
205
+ }
206
+ });
207
+ }
208
+ };
209
+ function parseEvent(data) {
210
+ if (!data) return null;
211
+ try {
212
+ return JSON.parse(data);
213
+ } catch {
214
+ return null;
215
+ }
216
+ }
217
+
218
+ // src/agent/skills.ts
219
+ var SKILLS_BASE_PATH = "/agents/v1/skills";
220
+ var SkillServiceImpl = class {
221
+ constructor(client) {
222
+ this.client = client;
223
+ }
224
+ client;
225
+ list(options = {}) {
226
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
227
+ }
228
+ async listPage(options = {}) {
229
+ return this.client.requestWithQuery("GET", SKILLS_BASE_PATH, options);
230
+ }
231
+ async get(key) {
232
+ return this.client.request("GET", `${SKILLS_BASE_PATH}/${key}`);
233
+ }
234
+ async deploy(bundle, options) {
235
+ const formData = new FormData();
236
+ const filename = bundle instanceof File ? bundle.name : "skill.tar.gz";
237
+ formData.append("bundle", bundle, filename);
238
+ if (options?.displayName) {
239
+ formData.append("display_name", options.displayName);
240
+ }
241
+ if (options?.moduleSlug) {
242
+ formData.append("module_slug", options.moduleSlug);
243
+ }
244
+ return this.client.requestMultipart("POST", `${SKILLS_BASE_PATH}/deploy`, formData);
245
+ }
246
+ async delete(key) {
247
+ await this.client.request("DELETE", `${SKILLS_BASE_PATH}/${key}`);
248
+ }
249
+ async listVersions(key) {
250
+ const response = await this.client.request(
251
+ "GET",
252
+ `${SKILLS_BASE_PATH}/${key}/versions`
253
+ );
254
+ return response.data;
255
+ }
256
+ async getVersion(key, number) {
257
+ return this.client.request("GET", `${SKILLS_BASE_PATH}/${key}/versions/${number}`);
258
+ }
259
+ };
260
+
261
+ // src/agent/tools.ts
262
+ var TOOLS_BASE_PATH = "/agents/v1/tools";
263
+ var ToolServiceImpl = class {
264
+ constructor(client) {
265
+ this.client = client;
266
+ }
267
+ client;
268
+ list(options = {}) {
269
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
270
+ }
271
+ async listPage(options = {}) {
272
+ return this.client.requestWithQuery("GET", TOOLS_BASE_PATH, options);
273
+ }
274
+ async get(key) {
275
+ return this.client.request("GET", `${TOOLS_BASE_PATH}/${key}`);
276
+ }
277
+ async create(request) {
278
+ return this.client.request("POST", TOOLS_BASE_PATH, request);
279
+ }
280
+ async update(key, request) {
281
+ return this.client.request("PATCH", `${TOOLS_BASE_PATH}/${key}`, request);
282
+ }
283
+ async delete(key) {
284
+ await this.client.request("DELETE", `${TOOLS_BASE_PATH}/${key}`);
285
+ }
286
+ };
287
+
288
+ // src/agent/index.ts
289
+ var AgentClient = class {
290
+ /** Service for managing agents. */
291
+ agents;
292
+ /** Service for managing prompts (versioned). */
293
+ prompts;
294
+ /** Service for managing skills (versioned bundles). */
295
+ skills;
296
+ /** Service for managing tools. */
297
+ tools;
298
+ /** Service for managing MCP server registrations. */
299
+ mcpServers;
300
+ /** Service for managing chat sessions (conversations + event log + stream). */
301
+ sessions;
302
+ /**
303
+ * Creates a new AgentClient instance.
304
+ *
305
+ * @param client - The base ProteosClient to use for API requests
306
+ */
307
+ constructor(client) {
308
+ this.agents = new AgentServiceImpl(client);
309
+ this.prompts = new PromptServiceImpl(client);
310
+ this.skills = new SkillServiceImpl(client);
311
+ this.tools = new ToolServiceImpl(client);
312
+ this.mcpServers = new McpServerServiceImpl(client);
313
+ this.sessions = new SessionServiceImpl(client);
314
+ }
315
+ };
316
+
317
+ // src/auth/me.ts
318
+ var ME_BASE_PATH = "/accounts/v1/me";
319
+ var MeServiceImpl = class {
320
+ constructor(client) {
321
+ this.client = client;
322
+ }
323
+ client;
324
+ async get() {
325
+ return this.client.request("GET", ME_BASE_PATH);
326
+ }
327
+ async organizations() {
328
+ const response = await this.client.request(
329
+ "GET",
330
+ `${ME_BASE_PATH}/organizations`
331
+ );
332
+ return response.data;
333
+ }
334
+ };
335
+
336
+ // src/auth/organizations.ts
337
+ var ORGANIZATIONS_BASE_PATH = "/accounts/v1/organizations";
338
+ var OrganizationServiceImpl = class {
339
+ constructor(client) {
340
+ this.client = client;
341
+ }
342
+ client;
343
+ list(options = {}) {
344
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
345
+ }
346
+ async listPage(options = {}) {
347
+ return this.client.requestWithQuery(
348
+ "GET",
349
+ ORGANIZATIONS_BASE_PATH,
350
+ options
351
+ );
352
+ }
353
+ async get(id) {
354
+ return this.client.request("GET", `${ORGANIZATIONS_BASE_PATH}/${id}`);
355
+ }
356
+ async create(request) {
357
+ return this.client.request("POST", ORGANIZATIONS_BASE_PATH, request);
358
+ }
359
+ async update(id, request) {
360
+ return this.client.request("PATCH", `${ORGANIZATIONS_BASE_PATH}/${id}`, request);
361
+ }
362
+ async delete(id) {
363
+ await this.client.request("DELETE", `${ORGANIZATIONS_BASE_PATH}/${id}`);
364
+ }
365
+ };
366
+
367
+ // src/auth/roles.ts
368
+ var ROLES_BASE_PATH = "/accounts/v1/roles";
369
+ var RoleServiceImpl = class {
370
+ constructor(client) {
371
+ this.client = client;
372
+ }
373
+ client;
374
+ list(options = {}) {
375
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
376
+ }
377
+ async listPage(options = {}) {
378
+ return this.client.requestWithQuery("GET", ROLES_BASE_PATH, options);
379
+ }
380
+ async get(slug) {
381
+ return this.client.request("GET", `${ROLES_BASE_PATH}/${slug}`);
382
+ }
383
+ async create(request) {
384
+ return this.client.request("POST", ROLES_BASE_PATH, request);
385
+ }
386
+ async upsert(slug, request) {
387
+ return this.client.request("PUT", `${ROLES_BASE_PATH}/${slug}`, { ...request, slug });
388
+ }
389
+ async update(slug, request) {
390
+ return this.client.request("PATCH", `${ROLES_BASE_PATH}/${slug}`, request);
391
+ }
392
+ async delete(slug) {
393
+ await this.client.request("DELETE", `${ROLES_BASE_PATH}/${slug}`);
394
+ }
395
+ getPermissions(roleSlug, options = {}) {
396
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.fetchPermissionsPage(roleSlug, opts), options);
397
+ }
398
+ async assignPermission(roleSlug, request) {
399
+ return this.client.request(
400
+ "POST",
401
+ `${ROLES_BASE_PATH}/${roleSlug}/permissions`,
402
+ request
403
+ );
404
+ }
405
+ async removePermission(roleSlug, permissionId) {
406
+ await this.client.request(
407
+ "DELETE",
408
+ `${ROLES_BASE_PATH}/${roleSlug}/permissions/${permissionId}`
409
+ );
410
+ }
411
+ async fetchPermissionsPage(roleSlug, options) {
412
+ return this.client.requestWithQuery(
413
+ "GET",
414
+ `${ROLES_BASE_PATH}/${roleSlug}/permissions`,
415
+ options
416
+ );
417
+ }
418
+ };
419
+
420
+ // src/auth/users.ts
421
+ var USERS_BASE_PATH = "/accounts/v1/users";
422
+ var UserServiceImpl = class {
423
+ constructor(client) {
424
+ this.client = client;
425
+ }
426
+ client;
427
+ list(options = {}) {
428
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
429
+ }
430
+ async listPage(options = {}) {
431
+ return this.client.requestWithQuery("GET", USERS_BASE_PATH, options);
432
+ }
433
+ async get(id) {
434
+ return this.client.request("GET", `${USERS_BASE_PATH}/${id}`);
435
+ }
436
+ async create(request) {
437
+ return this.client.request("POST", USERS_BASE_PATH, request);
438
+ }
439
+ async update(id, request) {
440
+ return this.client.request("PATCH", `${USERS_BASE_PATH}/${id}`, request);
441
+ }
442
+ getRoles(userId, options = {}) {
443
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.fetchRolesPage(userId, opts), options);
444
+ }
445
+ async assignRole(userId, request) {
446
+ return this.client.request(
447
+ "POST",
448
+ `${USERS_BASE_PATH}/${userId}/roles`,
449
+ request
450
+ );
451
+ }
452
+ async unassignRole(userId, roleSlug) {
453
+ await this.client.request("DELETE", `${USERS_BASE_PATH}/${userId}/roles/${roleSlug}`);
454
+ }
455
+ async listApiKeys(userId) {
456
+ const response = await this.client.request(
457
+ "GET",
458
+ `${USERS_BASE_PATH}/${userId}/api-keys`
459
+ );
460
+ return response.data;
461
+ }
462
+ async createApiKey(userId, request) {
463
+ return this.client.request(
464
+ "POST",
465
+ `${USERS_BASE_PATH}/${userId}/api-keys`,
466
+ request
467
+ );
468
+ }
469
+ async deleteApiKey(userId, keyId) {
470
+ await this.client.request("DELETE", `${USERS_BASE_PATH}/${userId}/api-keys/${keyId}`);
471
+ }
472
+ async fetchRolesPage(userId, options) {
473
+ return this.client.requestWithQuery(
474
+ "GET",
475
+ `${USERS_BASE_PATH}/${userId}/roles`,
476
+ options
477
+ );
478
+ }
479
+ };
480
+
481
+ // src/auth/platform-entities.ts
482
+ var PLATFORM_ENTITIES = [
483
+ // Access (account-service)
484
+ { slug: "organizations", name: "Organizations" },
485
+ { slug: "users", name: "Users" },
486
+ { slug: "roles", name: "Roles" },
487
+ { slug: "user-role-assignments", name: "User Role Assignments" },
488
+ { slug: "role-entity-permissions", name: "Role Entity Permissions" },
489
+ // Schema / content (metadata-service)
490
+ { slug: "entities", name: "Entities" },
491
+ { slug: "pages", name: "Pages" },
492
+ { slug: "menu-configurations", name: "Menu Configurations" },
493
+ { slug: "apps", name: "Apps" },
494
+ { slug: "components", name: "Components" },
495
+ { slug: "lists", name: "Lists" },
496
+ { slug: "list-views", name: "List Views" },
497
+ // System (metadata-service)
498
+ { slug: "modules", name: "Modules" },
499
+ { slug: "variables", name: "Variables" },
500
+ { slug: "deployments", name: "Deployments" },
501
+ // Storage (storage-service)
502
+ { slug: "files", name: "Files" },
503
+ // Automation (function-service)
504
+ { slug: "hooks", name: "Hooks" },
505
+ { slug: "actions", name: "Actions" },
506
+ // Knowledge (knowledge-service)
507
+ { slug: "knowledge-nodes", name: "Knowledge Nodes" },
508
+ { slug: "knowledge-links", name: "Knowledge Links" },
509
+ { slug: "knowledge-labels", name: "Knowledge Labels" },
510
+ // Agent suite (agent-service)
511
+ { slug: "agents", name: "Agents" },
512
+ { slug: "prompts", name: "Prompts" },
513
+ { slug: "skills", name: "Skills" },
514
+ { slug: "tools", name: "Tools" },
515
+ { slug: "mcp-servers", name: "MCP Servers" },
516
+ { slug: "agent-sessions", name: "Agent Sessions" },
517
+ // Messaging bus (event-service)
518
+ { slug: "topics", name: "Topics" },
519
+ { slug: "events", name: "Events" },
520
+ // Conversations (conversation-service). NOTE: `connections` is enforced by
521
+ // BOTH conversation-service and connector-service (2026-07 decision) — same
522
+ // concept in both; conversation connections migrate onto connector-service
523
+ // later.
524
+ { slug: "connections", name: "Connections" },
525
+ { slug: "conversations", name: "Conversations" },
526
+ { slug: "messages", name: "Messages" },
527
+ { slug: "agent-listeners", name: "Agent Listeners" },
528
+ { slug: "transcriptions", name: "Transcriptions" },
529
+ // Connectors (connector-service). `connections` above is shared; this is the
530
+ // manifest catalog.
531
+ { slug: "connectors", name: "Connectors" }
532
+ ];
533
+ var PLATFORM_ENTITY_SLUGS = PLATFORM_ENTITIES.map(
534
+ (entity) => entity.slug
535
+ );
536
+ function isPlatformEntity(slug) {
537
+ return PLATFORM_ENTITY_SLUGS.includes(slug);
538
+ }
539
+ var RoleEntityPermissionSchema = chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
540
+ id: zod.z.string(),
541
+ role_slug: zod.z.string(),
542
+ entity_slug: zod.z.string(),
543
+ permission: zod.z.enum(["read", "write", "delete"])
544
+ });
545
+ var UserRoleAssignmentSchema = chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
546
+ id: zod.z.string(),
547
+ user_id: zod.z.string(),
548
+ role_slug: zod.z.string(),
549
+ org_id: zod.z.string()
550
+ });
551
+ var UserSchema = chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
552
+ id: zod.z.string(),
553
+ email: zod.z.string(),
554
+ given_name: zod.z.string(),
555
+ family_name: zod.z.string(),
556
+ external_id: zod.z.string(),
557
+ default_org_id: zod.z.string()
558
+ });
559
+ chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
560
+ id: zod.z.string(),
561
+ user_id: zod.z.string(),
562
+ org_id: zod.z.string(),
563
+ name: zod.z.string(),
564
+ token_prefix: zod.z.string(),
565
+ token_suffix: zod.z.string(),
566
+ expires_at: zod.z.string().nullable(),
567
+ last_used_at: zod.z.string().nullable()
568
+ });
569
+ var RoleSchema = chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
570
+ slug: zod.z.string(),
571
+ name: zod.z.string(),
572
+ org_id: zod.z.string(),
573
+ description: zod.z.string()
574
+ });
575
+ var OrganizationSchema = chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
576
+ id: zod.z.string(),
577
+ name: zod.z.string(),
578
+ description: zod.z.string()
579
+ });
580
+
581
+ // src/auth/index.ts
582
+ var AccountClient = class {
583
+ /**
584
+ * Service for caller-scoped queries ("who am I", my organizations).
585
+ */
586
+ me;
587
+ /**
588
+ * Service for managing users and their role assignments.
589
+ */
590
+ users;
591
+ /**
592
+ * Service for managing roles and their entity permissions.
593
+ */
594
+ roles;
595
+ /**
596
+ * Service for managing organizations.
597
+ */
598
+ organizations;
599
+ /**
600
+ * Creates a new AccountClient instance.
601
+ *
602
+ * @param client - The base ProteosClient to use for API requests
603
+ */
604
+ constructor(client) {
605
+ this.me = new MeServiceImpl(client);
606
+ this.users = new UserServiceImpl(client);
607
+ this.roles = new RoleServiceImpl(client);
608
+ this.organizations = new OrganizationServiceImpl(client);
609
+ }
610
+ };
611
+
612
+ // src/errors.ts
613
+ var ErrorCode = {
614
+ NOT_FOUND: "not_found",
615
+ UNAUTHORIZED: "unauthorized",
616
+ FORBIDDEN: "forbidden",
617
+ BAD_REQUEST: "bad_request",
618
+ CONFLICT: "conflict",
619
+ INTERNAL_SERVER_ERROR: "internal_server_error",
620
+ INVALID_PAYLOAD: "invalid_payload",
621
+ INVALID_PERSONA: "invalid_persona"
622
+ };
623
+ var ProteosError = class extends Error {
624
+ /** HTTP status code of the response */
625
+ httpStatus;
626
+ /** API error code (e.g., 'not_found', 'unauthorized') */
627
+ code;
628
+ constructor(message, httpStatus, code) {
629
+ super(message);
630
+ this.name = "ProteosError";
631
+ this.httpStatus = httpStatus;
632
+ this.code = code;
633
+ const v8Capture = Error.captureStackTrace;
634
+ if (v8Capture) v8Capture(this, this.constructor);
635
+ }
636
+ /**
637
+ * Returns a formatted string representation of the error.
638
+ */
639
+ toString() {
640
+ return `${this.code}: ${this.message} (HTTP ${this.httpStatus})`;
641
+ }
642
+ };
643
+ function isProteosError(error) {
644
+ return error instanceof ProteosError;
645
+ }
646
+ function isNotFound(error) {
647
+ return isProteosError(error) && error.httpStatus === 404;
648
+ }
649
+ function isUnauthorized(error) {
650
+ return isProteosError(error) && error.httpStatus === 401;
651
+ }
652
+ function isForbidden(error) {
653
+ return isProteosError(error) && error.httpStatus === 403;
654
+ }
655
+ function isBadRequest(error) {
656
+ return isProteosError(error) && error.httpStatus === 400;
657
+ }
658
+ function isConflict(error) {
659
+ return isProteosError(error) && error.httpStatus === 409;
660
+ }
661
+ function getDefaultErrorCode(httpStatus) {
662
+ switch (httpStatus) {
663
+ case 400:
664
+ return ErrorCode.BAD_REQUEST;
665
+ case 401:
666
+ return ErrorCode.UNAUTHORIZED;
667
+ case 403:
668
+ return ErrorCode.FORBIDDEN;
669
+ case 404:
670
+ return ErrorCode.NOT_FOUND;
671
+ case 409:
672
+ return ErrorCode.CONFLICT;
673
+ default:
674
+ return ErrorCode.INTERNAL_SERVER_ERROR;
675
+ }
676
+ }
677
+ async function parseErrorResponse(response) {
678
+ const httpStatus = response.status;
679
+ let code = getDefaultErrorCode(httpStatus);
680
+ let message = "Unknown error";
681
+ try {
682
+ const body = await response.text();
683
+ try {
684
+ const json = JSON.parse(body);
685
+ if (json.code) {
686
+ code = json.code;
687
+ }
688
+ if (json.message) {
689
+ message = json.message;
690
+ } else {
691
+ message = body || `HTTP ${httpStatus}`;
692
+ }
693
+ } catch {
694
+ message = body.trim() || `HTTP ${httpStatus}`;
695
+ }
696
+ } catch {
697
+ message = `HTTP ${httpStatus}`;
698
+ }
699
+ return new ProteosError(message, httpStatus, code);
700
+ }
701
+
702
+ // src/http/query-params.ts
703
+ function toQueryParams(obj) {
704
+ const params = new URLSearchParams();
705
+ if (!obj) {
706
+ return params;
707
+ }
708
+ for (const [key, value] of Object.entries(obj)) {
709
+ appendQueryParam(params, key, value);
710
+ }
711
+ return params;
712
+ }
713
+ function appendQueryParam(params, key, value) {
714
+ if (value === null || value === void 0) {
715
+ return;
716
+ }
717
+ if (Array.isArray(value)) {
718
+ for (const item of value) {
719
+ if (item !== null && item !== void 0) {
720
+ params.append(key, String(item));
721
+ }
722
+ }
723
+ return;
724
+ }
725
+ if (typeof value === "object") {
726
+ return;
727
+ }
728
+ params.set(key, String(value));
729
+ }
730
+ function toQueryString(params) {
731
+ const str = params.toString();
732
+ return str;
733
+ }
734
+ function buildUrl(baseUrl, path, query) {
735
+ const url = new URL(path, baseUrl);
736
+ if (query) {
737
+ const params = toQueryParams(query);
738
+ params.forEach((value, key) => {
739
+ url.searchParams.append(key, value);
740
+ });
741
+ }
742
+ return url.toString();
743
+ }
744
+
745
+ // src/types/options.ts
746
+ var DEFAULT_OPTIONS = {
747
+ timeout: 3e4,
748
+ headers: {}
749
+ };
750
+ function resolveOptions(options) {
751
+ return {
752
+ baseUrl: options.baseUrl.replace(/\/$/, ""),
753
+ // Remove trailing slash
754
+ ...options.token !== void 0 ? { token: options.token } : {},
755
+ ...options.tokenProvider !== void 0 ? { tokenProvider: options.tokenProvider } : {},
756
+ timeout: options.timeout ?? DEFAULT_OPTIONS.timeout,
757
+ fetch: (options.fetch ?? globalThis.fetch).bind(globalThis),
758
+ headers: { ...DEFAULT_OPTIONS.headers, ...options.headers }
759
+ };
760
+ }
761
+
762
+ // src/client.ts
763
+ function isAbortError(error) {
764
+ return error instanceof DOMException && error.name === "AbortError";
765
+ }
766
+ var ProteosClient = class {
767
+ options;
768
+ /**
769
+ * Creates a new ProteosClient instance.
770
+ *
771
+ * @param options - Client configuration options
772
+ *
773
+ * @example
774
+ * ```ts
775
+ * // With static token
776
+ * const client = new ProteosClient({
777
+ * baseUrl: 'https://api.proteos.ai',
778
+ * token: 'your-api-token',
779
+ * });
780
+ *
781
+ * // With dynamic token provider
782
+ * const client = new ProteosClient({
783
+ * baseUrl: 'https://api.proteos.ai',
784
+ * tokenProvider: async () => {
785
+ * return await authService.getAccessToken();
786
+ * },
787
+ * });
788
+ * ```
789
+ */
790
+ constructor(options) {
791
+ this.options = resolveOptions(options);
792
+ }
793
+ /**
794
+ * Returns the base URL configured for this client.
795
+ */
796
+ get baseUrl() {
797
+ return this.options.baseUrl;
798
+ }
799
+ /**
800
+ * Gets the current authentication token.
801
+ * Calls tokenProvider if available, otherwise returns static token.
802
+ */
803
+ async getToken() {
804
+ if (this.options.tokenProvider) {
805
+ return await this.options.tokenProvider();
806
+ }
807
+ return this.options.token;
808
+ }
809
+ /**
810
+ * Builds the headers for a request.
811
+ */
812
+ async buildHeaders(requestOptions) {
813
+ const headers = new Headers({
814
+ "Content-Type": "application/json",
815
+ Accept: "application/json",
816
+ ...this.options.headers,
817
+ ...requestOptions?.headers
818
+ });
819
+ const token = await this.getToken();
820
+ if (token) {
821
+ headers.set("Authorization", `Bearer ${token}`);
822
+ }
823
+ return headers;
824
+ }
825
+ /**
826
+ * Creates an AbortSignal with timeout.
827
+ */
828
+ createTimeoutSignal(requestOptions) {
829
+ const timeout = requestOptions?.timeout ?? this.options.timeout;
830
+ if (requestOptions?.signal) {
831
+ const controller = new AbortController();
832
+ requestOptions.signal.addEventListener("abort", () => {
833
+ controller.abort(requestOptions.signal?.reason);
834
+ });
835
+ const timeoutId = setTimeout(() => {
836
+ controller.abort(new Error(`Request timeout after ${timeout}ms`));
837
+ }, timeout);
838
+ controller.signal.addEventListener("abort", () => {
839
+ clearTimeout(timeoutId);
840
+ });
841
+ return controller.signal;
842
+ }
843
+ return AbortSignal.timeout(timeout);
844
+ }
845
+ /**
846
+ * Performs an HTTP request and decodes the JSON response.
847
+ *
848
+ * @param method - HTTP method (GET, POST, PATCH, DELETE, etc.)
849
+ * @param path - Request path (appended to baseUrl)
850
+ * @param body - Request body (will be JSON-serialized)
851
+ * @param requestOptions - Optional request configuration
852
+ * @returns Decoded response body
853
+ * @throws {ProteosError} If the response status is >= 400
854
+ */
855
+ async request(method, path, body, requestOptions) {
856
+ return this.requestWithQuery(method, path, void 0, body, requestOptions);
857
+ }
858
+ /**
859
+ * Performs an HTTP request with query parameters.
860
+ *
861
+ * @param method - HTTP method
862
+ * @param path - Request path
863
+ * @param query - Query parameters object
864
+ * @param body - Request body
865
+ * @param requestOptions - Optional request configuration
866
+ * @returns Decoded response body
867
+ * @throws {ProteosError} If the response status is >= 400
868
+ */
869
+ async requestWithQuery(method, path, query, body, requestOptions) {
870
+ let url = `${this.options.baseUrl}${path}`;
871
+ if (query) {
872
+ const params = toQueryParams(query);
873
+ const queryString = params.toString();
874
+ if (queryString) {
875
+ url += `?${queryString}`;
876
+ }
877
+ }
878
+ const headers = await this.buildHeaders(requestOptions);
879
+ const signal = this.createTimeoutSignal(requestOptions);
880
+ const response = await this.options.fetch(url, {
881
+ method,
882
+ headers,
883
+ body: body !== void 0 ? JSON.stringify(body) : null,
884
+ signal
885
+ });
886
+ if (response.status >= 400) {
887
+ throw await parseErrorResponse(response);
888
+ }
889
+ if (response.status === 204) {
890
+ return void 0;
891
+ }
892
+ const text = await response.text();
893
+ if (!text) {
894
+ return void 0;
895
+ }
896
+ try {
897
+ return JSON.parse(text);
898
+ } catch {
899
+ throw new ProteosError(
900
+ `Failed to parse response as JSON: ${text.slice(0, 100)}`,
901
+ response.status,
902
+ "parse_error"
903
+ );
904
+ }
905
+ }
906
+ /**
907
+ * Performs a multipart form request (for file uploads).
908
+ *
909
+ * @param method - HTTP method
910
+ * @param path - Request path
911
+ * @param formData - FormData instance with files and fields
912
+ * @param requestOptions - Optional request configuration
913
+ * @returns Decoded response body
914
+ * @throws {ProteosError} If the response status is >= 400
915
+ */
916
+ async requestMultipart(method, path, formData, requestOptions) {
917
+ const url = `${this.options.baseUrl}${path}`;
918
+ const headers = new Headers({
919
+ Accept: "application/json",
920
+ ...this.options.headers,
921
+ ...requestOptions?.headers
922
+ });
923
+ const token = await this.getToken();
924
+ if (token) {
925
+ headers.set("Authorization", `Bearer ${token}`);
926
+ }
927
+ const signal = this.createTimeoutSignal(requestOptions);
928
+ const response = await this.options.fetch(url, {
929
+ method,
930
+ headers,
931
+ body: formData,
932
+ signal
933
+ });
934
+ if (response.status >= 400) {
935
+ throw await parseErrorResponse(response);
936
+ }
937
+ if (response.status === 204) {
938
+ return void 0;
939
+ }
940
+ return await response.json();
941
+ }
942
+ /**
943
+ * Performs an HTTP request and returns the raw response.
944
+ * Used for downloading files or streaming responses.
945
+ *
946
+ * @param method - HTTP method
947
+ * @param path - Request path
948
+ * @param body - Request body
949
+ * @param requestOptions - Optional request configuration
950
+ * @returns Object with response body stream and full Response object
951
+ * @throws {ProteosError} If the response status is >= 400
952
+ */
953
+ async requestRaw(method, path, body, requestOptions) {
954
+ const url = `${this.options.baseUrl}${path}`;
955
+ const headers = await this.buildHeaders(requestOptions);
956
+ const signal = this.createTimeoutSignal(requestOptions);
957
+ const response = await this.options.fetch(url, {
958
+ method,
959
+ headers,
960
+ body: body !== void 0 ? JSON.stringify(body) : null,
961
+ signal
962
+ });
963
+ if (response.status >= 400) {
964
+ throw await parseErrorResponse(response);
965
+ }
966
+ return {
967
+ body: response.body,
968
+ response
969
+ };
970
+ }
971
+ /**
972
+ * Opens a Server-Sent-Events stream and yields each frame as it arrives.
973
+ *
974
+ * Built on `@microsoft/fetch-event-source` (not the browser-native
975
+ * `EventSource`, which can't set an `Authorization` header) so the bearer token
976
+ * is attached like any other request. The library tracks `Last-Event-ID` and
977
+ * reconnects with exponential backoff on transient errors; a 4xx is fatal and
978
+ * rejects. The stream runs until the caller's `AbortSignal` fires.
979
+ *
980
+ * The token is resolved once at stream start; teardown is the caller's signal.
981
+ *
982
+ * @param path - Request path (appended to baseUrl)
983
+ * @param requestOptions - Optional request configuration (signal)
984
+ * @returns Async generator of parsed {@link SseFrame}s
985
+ * @throws {ProteosError} On a non-retryable (4xx) response
986
+ */
987
+ async *streamEvents(path, requestOptions) {
988
+ const url = `${this.options.baseUrl}${path}`;
989
+ const headers = { ...this.options.headers };
990
+ const token = await this.getToken();
991
+ if (token) {
992
+ headers.Authorization = `Bearer ${token}`;
993
+ }
994
+ const queue = [];
995
+ let wake = null;
996
+ let finished = false;
997
+ let failure;
998
+ const notify = () => {
999
+ wake?.();
1000
+ wake = null;
1001
+ };
1002
+ const push = (frame) => {
1003
+ queue.push(frame);
1004
+ notify();
1005
+ };
1006
+ const finish = (error) => {
1007
+ if (error !== void 0) failure = error;
1008
+ finished = true;
1009
+ notify();
1010
+ };
1011
+ const controller = new AbortController();
1012
+ const onExternalAbort = () => controller.abort();
1013
+ if (requestOptions?.signal) {
1014
+ if (requestOptions.signal.aborted) controller.abort();
1015
+ else requestOptions.signal.addEventListener("abort", onExternalAbort, { once: true });
1016
+ }
1017
+ const streaming = fetchEventSource.fetchEventSource(url, {
1018
+ method: "GET",
1019
+ headers,
1020
+ signal: controller.signal,
1021
+ fetch: this.options.fetch,
1022
+ // Keep streaming when the tab is backgrounded (default would disconnect).
1023
+ openWhenHidden: true,
1024
+ onopen: async (response) => {
1025
+ if (response.status >= 400) {
1026
+ throw await parseErrorResponse(response);
1027
+ }
1028
+ },
1029
+ onmessage: (message) => {
1030
+ push({
1031
+ id: message.id || void 0,
1032
+ event: message.event || void 0,
1033
+ data: message.data
1034
+ });
1035
+ },
1036
+ onerror: (error) => {
1037
+ if (isAbortError(error)) throw error;
1038
+ if (error instanceof ProteosError && error.httpStatus >= 400 && error.httpStatus < 500) {
1039
+ throw error;
1040
+ }
1041
+ return 2e3;
1042
+ }
1043
+ }).then(() => finish()).catch((error) => finish(error));
1044
+ try {
1045
+ while (true) {
1046
+ if (queue.length > 0) {
1047
+ yield queue.shift();
1048
+ continue;
1049
+ }
1050
+ if (finished) break;
1051
+ await new Promise((resolve) => {
1052
+ wake = resolve;
1053
+ });
1054
+ }
1055
+ if (failure !== void 0 && !isAbortError(failure)) throw failure;
1056
+ } finally {
1057
+ controller.abort();
1058
+ requestOptions?.signal?.removeEventListener("abort", onExternalAbort);
1059
+ await streaming.catch(() => {
1060
+ });
1061
+ }
1062
+ }
1063
+ /**
1064
+ * Opens an authenticated WebSocket to a service path and resolves once it is
1065
+ * open.
1066
+ *
1067
+ * The browser-native `WebSocket` can't set an `Authorization` header, so the
1068
+ * access token is passed via the `bearer` subprotocol (`["bearer", token]`),
1069
+ * which the gateway lifts back into the auth header — the same token resolved
1070
+ * for every other request. The `http(s)` base URL is rewritten to `ws(s)`.
1071
+ *
1072
+ * @param path - Request path (appended to baseUrl), including any query string
1073
+ * @returns The open WebSocket
1074
+ */
1075
+ async openWebSocket(path) {
1076
+ const wsBaseUrl = this.options.baseUrl.replace(/^http/, "ws");
1077
+ const url = `${wsBaseUrl}${path}`;
1078
+ const token = await this.getToken();
1079
+ const socket = token ? new WebSocket(url, ["bearer", token]) : new WebSocket(url);
1080
+ await new Promise((resolve, reject) => {
1081
+ socket.onopen = () => resolve();
1082
+ socket.onerror = () => reject(new ProteosError("WebSocket connection failed", 0, "ws_error"));
1083
+ });
1084
+ socket.onopen = null;
1085
+ socket.onerror = null;
1086
+ return socket;
1087
+ }
1088
+ };
1089
+
1090
+ // src/conversation/voice.ts
1091
+ var VOICE_BASE_PATH = "/conversations/v1/voice";
1092
+ var VoiceServiceImpl = class {
1093
+ constructor(client) {
1094
+ this.client = client;
1095
+ }
1096
+ client;
1097
+ async transcribeStream(options) {
1098
+ const query = buildQuery(options);
1099
+ const socket = await this.client.openWebSocket(`${VOICE_BASE_PATH}/transcribe/stream${query}`);
1100
+ socket.binaryType = "arraybuffer";
1101
+ socket.onmessage = (event) => {
1102
+ if (typeof event.data !== "string") return;
1103
+ try {
1104
+ options.onResult(JSON.parse(event.data));
1105
+ } catch {
1106
+ }
1107
+ };
1108
+ if (options.onError) socket.onerror = options.onError;
1109
+ socket.onclose = () => options.onClose?.();
1110
+ const isOpen = () => socket.readyState === WebSocket.OPEN;
1111
+ return {
1112
+ sendAudio: (chunk) => {
1113
+ if (isOpen()) socket.send(chunk);
1114
+ },
1115
+ finalize: () => {
1116
+ if (isOpen()) socket.send(JSON.stringify({ type: "finalize" }));
1117
+ },
1118
+ close: () => socket.close()
1119
+ };
1120
+ }
1121
+ };
1122
+ function buildQuery(options) {
1123
+ const params = new URLSearchParams();
1124
+ if (options.language) params.set("language", options.language);
1125
+ if (options.interimResults !== void 0)
1126
+ params.set("interim_results", String(options.interimResults));
1127
+ if (options.punctuate !== void 0) params.set("punctuate", String(options.punctuate));
1128
+ if (options.smartFormat !== void 0) params.set("smart_format", String(options.smartFormat));
1129
+ if (options.encoding) params.set("encoding", options.encoding);
1130
+ if (options.sampleRate !== void 0) params.set("sample_rate", String(options.sampleRate));
1131
+ const queryString = params.toString();
1132
+ return queryString ? `?${queryString}` : "";
1133
+ }
1134
+
1135
+ // src/conversation/index.ts
1136
+ var CONVERSATION_BASE_PATH = "/conversations/v1";
1137
+ var ConversationClient = class {
1138
+ connections;
1139
+ conversations;
1140
+ messages;
1141
+ agentListeners;
1142
+ transcriptions;
1143
+ /** Realtime speech-to-text (dictation) — moved here from agent-service. */
1144
+ voice;
1145
+ constructor(client) {
1146
+ this.connections = new ConnectionServiceImpl(client);
1147
+ this.conversations = new ConversationServiceImpl(client);
1148
+ this.messages = new MessageServiceImpl(client);
1149
+ this.agentListeners = new AgentListenerServiceImpl(client);
1150
+ this.transcriptions = new TranscriptionServiceImpl(client);
1151
+ this.voice = new VoiceServiceImpl(client);
1152
+ }
1153
+ };
1154
+ var ConnectionServiceImpl = class {
1155
+ constructor(client) {
1156
+ this.client = client;
1157
+ }
1158
+ client;
1159
+ list(query = {}) {
1160
+ return this.client.requestWithQuery("GET", `${CONVERSATION_BASE_PATH}/connections`, query);
1161
+ }
1162
+ get(id) {
1163
+ return this.client.request("GET", `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(id)}`);
1164
+ }
1165
+ create(request) {
1166
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/connections`, request);
1167
+ }
1168
+ update(id, request) {
1169
+ return this.client.request("PATCH", `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(id)}`, request);
1170
+ }
1171
+ async delete(id) {
1172
+ await this.client.request("DELETE", `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(id)}`);
1173
+ }
1174
+ install(id) {
1175
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(id)}/install`);
1176
+ }
1177
+ listParticipants(connectionId, query = {}) {
1178
+ return this.client.requestWithQuery(
1179
+ "GET",
1180
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/participants`,
1181
+ query
1182
+ );
1183
+ }
1184
+ listRooms(connectionId, query = {}) {
1185
+ return this.client.requestWithQuery(
1186
+ "GET",
1187
+ `${CONVERSATION_BASE_PATH}/connections/${encodeURIComponent(connectionId)}/rooms`,
1188
+ query
1189
+ );
1190
+ }
1191
+ };
1192
+ var ConversationServiceImpl = class {
1193
+ constructor(client) {
1194
+ this.client = client;
1195
+ }
1196
+ client;
1197
+ list(query = {}) {
1198
+ return this.client.requestWithQuery("GET", `${CONVERSATION_BASE_PATH}/conversations`, query);
1199
+ }
1200
+ get(id) {
1201
+ return this.client.request("GET", `${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(id)}`);
1202
+ }
1203
+ end(id) {
1204
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(id)}/end`);
1205
+ }
1206
+ markRead(id) {
1207
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(id)}/read`);
1208
+ }
1209
+ markUnread(id) {
1210
+ return this.client.request("DELETE", `${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(id)}/read`);
1211
+ }
1212
+ unreadCounts() {
1213
+ return this.client.request("GET", `${CONVERSATION_BASE_PATH}/conversations/unread-counts`);
1214
+ }
1215
+ };
1216
+ var MessageServiceImpl = class {
1217
+ constructor(client) {
1218
+ this.client = client;
1219
+ }
1220
+ client;
1221
+ listByConversation(conversationId, query = {}) {
1222
+ return this.client.requestWithQuery(
1223
+ "GET",
1224
+ `${CONVERSATION_BASE_PATH}/conversations/${encodeURIComponent(conversationId)}/messages`,
1225
+ query
1226
+ );
1227
+ }
1228
+ send(request) {
1229
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/messages/send`, request);
1230
+ }
1231
+ async getReactions(messageId) {
1232
+ const response = await this.client.request(
1233
+ "GET",
1234
+ `${CONVERSATION_BASE_PATH}/messages/${encodeURIComponent(messageId)}/reactions`
1235
+ );
1236
+ return response.data;
1237
+ }
1238
+ async addReaction(messageId, emoji) {
1239
+ const response = await this.client.request(
1240
+ "POST",
1241
+ `${CONVERSATION_BASE_PATH}/messages/${encodeURIComponent(messageId)}/reactions`,
1242
+ { emoji }
1243
+ );
1244
+ return response.data;
1245
+ }
1246
+ async removeReaction(messageId, emoji) {
1247
+ const response = await this.client.request(
1248
+ "DELETE",
1249
+ `${CONVERSATION_BASE_PATH}/messages/${encodeURIComponent(messageId)}/reactions/${encodeURIComponent(emoji)}`
1250
+ );
1251
+ return response.data;
1252
+ }
1253
+ };
1254
+ var AgentListenerServiceImpl = class {
1255
+ constructor(client) {
1256
+ this.client = client;
1257
+ }
1258
+ client;
1259
+ list(query = {}) {
1260
+ return this.client.requestWithQuery("GET", `${CONVERSATION_BASE_PATH}/agent-listeners`, query);
1261
+ }
1262
+ get(id) {
1263
+ return this.client.request("GET", `${CONVERSATION_BASE_PATH}/agent-listeners/${encodeURIComponent(id)}`);
1264
+ }
1265
+ create(request) {
1266
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/agent-listeners`, request);
1267
+ }
1268
+ update(id, request) {
1269
+ return this.client.request("PATCH", `${CONVERSATION_BASE_PATH}/agent-listeners/${encodeURIComponent(id)}`, request);
1270
+ }
1271
+ async delete(id) {
1272
+ await this.client.request("DELETE", `${CONVERSATION_BASE_PATH}/agent-listeners/${encodeURIComponent(id)}`);
1273
+ }
1274
+ };
1275
+ var TranscriptionServiceImpl = class {
1276
+ constructor(client) {
1277
+ this.client = client;
1278
+ }
1279
+ client;
1280
+ createFromFile(request) {
1281
+ return this.client.request("POST", `${CONVERSATION_BASE_PATH}/transcriptions`, request);
1282
+ }
1283
+ list(query = {}) {
1284
+ return this.client.requestWithQuery("GET", `${CONVERSATION_BASE_PATH}/transcriptions`, query);
1285
+ }
1286
+ get(id) {
1287
+ return this.client.request("GET", `${CONVERSATION_BASE_PATH}/transcriptions/${encodeURIComponent(id)}`);
1288
+ }
1289
+ materialize(id, request = {}) {
1290
+ return this.client.request(
1291
+ "POST",
1292
+ `${CONVERSATION_BASE_PATH}/transcriptions/${encodeURIComponent(id)}/materialize`,
1293
+ request
1294
+ );
1295
+ }
1296
+ };
1297
+
1298
+ // src/connector/index.ts
1299
+ var CONNECTOR_BASE_PATH = "/connectors/v1";
1300
+ var ConnectorClient = class {
1301
+ connectors;
1302
+ connections;
1303
+ constructor(client) {
1304
+ this.connectors = new ConnectorCatalogServiceImpl(client);
1305
+ this.connections = new ConnectorConnectionServiceImpl(client);
1306
+ }
1307
+ };
1308
+ var ConnectorCatalogServiceImpl = class {
1309
+ constructor(client) {
1310
+ this.client = client;
1311
+ }
1312
+ client;
1313
+ list(query = {}) {
1314
+ return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connectors`, query);
1315
+ }
1316
+ get(key) {
1317
+ return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connectors/${encodeURIComponent(key)}`);
1318
+ }
1319
+ async listMethods(key) {
1320
+ const connector = await this.get(key);
1321
+ return connector.methods ?? [];
1322
+ }
1323
+ };
1324
+ var ConnectorConnectionServiceImpl = class {
1325
+ constructor(client) {
1326
+ this.client = client;
1327
+ }
1328
+ client;
1329
+ list(query = {}) {
1330
+ return this.client.requestWithQuery("GET", `${CONNECTOR_BASE_PATH}/connections`, query);
1331
+ }
1332
+ get(id) {
1333
+ return this.client.request("GET", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
1334
+ }
1335
+ create(request) {
1336
+ return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections`, request);
1337
+ }
1338
+ update(id, request) {
1339
+ return this.client.request("PATCH", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`, request);
1340
+ }
1341
+ async delete(id) {
1342
+ await this.client.request("DELETE", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}`);
1343
+ }
1344
+ install(id) {
1345
+ return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/install`);
1346
+ }
1347
+ token(id) {
1348
+ return this.client.request("POST", `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/token`);
1349
+ }
1350
+ async invokeMethod(id, method, params = {}) {
1351
+ const response = await this.client.request(
1352
+ "POST",
1353
+ `${CONNECTOR_BASE_PATH}/connections/${encodeURIComponent(id)}/methods/${encodeURIComponent(method)}/invoke`,
1354
+ params
1355
+ );
1356
+ return response.result;
1357
+ }
1358
+ };
1359
+
1360
+ // src/data/queries.ts
1361
+ var QUERY_BASE_PATH = "/data/v1/query";
1362
+ var QueryServiceImpl = class {
1363
+ constructor(client) {
1364
+ this.client = client;
1365
+ }
1366
+ client;
1367
+ async execute(sql) {
1368
+ return this.client.request("POST", `${QUERY_BASE_PATH}/execute`, { sql });
1369
+ }
1370
+ async validate(sql) {
1371
+ return this.client.request("POST", `${QUERY_BASE_PATH}/validate`, {
1372
+ sql
1373
+ });
1374
+ }
1375
+ };
1376
+
1377
+ // src/data/records.ts
1378
+ var RECORDS_BASE_PATH = "/data/v1/records";
1379
+ var BATCH_RECORDS_BASE_PATH = "/data/v1/batch/records";
1380
+ var RecordServiceImpl = class {
1381
+ constructor(client) {
1382
+ this.client = client;
1383
+ }
1384
+ client;
1385
+ list(entitySlug, options = {}) {
1386
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(entitySlug, opts), options);
1387
+ }
1388
+ async listPage(entitySlug, options = {}) {
1389
+ return this.client.requestWithQuery(
1390
+ "GET",
1391
+ `${RECORDS_BASE_PATH}/${entitySlug}`,
1392
+ options
1393
+ );
1394
+ }
1395
+ async get(entitySlug, id) {
1396
+ return this.client.request("GET", `${RECORDS_BASE_PATH}/${entitySlug}/${id}`);
1397
+ }
1398
+ async create(entitySlug, data) {
1399
+ return this.client.request("POST", `${RECORDS_BASE_PATH}/${entitySlug}`, data);
1400
+ }
1401
+ async update(entitySlug, id, data) {
1402
+ return this.client.request(
1403
+ "PATCH",
1404
+ `${RECORDS_BASE_PATH}/${entitySlug}/${id}`,
1405
+ data
1406
+ );
1407
+ }
1408
+ async delete(entitySlug, id) {
1409
+ await this.client.request("DELETE", `${RECORDS_BASE_PATH}/${entitySlug}/${id}`);
1410
+ }
1411
+ async batchUpsert(entitySlug, transactions) {
1412
+ return this.client.request(
1413
+ "POST",
1414
+ `${BATCH_RECORDS_BASE_PATH}/${entitySlug}/upsert`,
1415
+ transactions
1416
+ );
1417
+ }
1418
+ };
1419
+ var BatchUpsertTransactionSchema = zod.z.object({
1420
+ transaction_id: zod.z.string(),
1421
+ data: zod.z.record(zod.z.unknown())
1422
+ });
1423
+ var BatchTransactionErrorSchema = zod.z.object({
1424
+ code: zod.z.string(),
1425
+ message: zod.z.string()
1426
+ });
1427
+ var BatchUpsertTransactionResultSchema = zod.z.object({
1428
+ transaction_id: zod.z.string(),
1429
+ status: zod.z.enum(["success", "error"]),
1430
+ record: zod.z.record(zod.z.unknown()).optional(),
1431
+ error: BatchTransactionErrorSchema.optional()
1432
+ });
1433
+ var BatchUpsertRecordsResponseSchema = zod.z.object({
1434
+ results: zod.z.array(BatchUpsertTransactionResultSchema)
1435
+ });
1436
+
1437
+ // src/data/index.ts
1438
+ var DataClient = class {
1439
+ records;
1440
+ queries;
1441
+ constructor(client) {
1442
+ this.records = new RecordServiceImpl(client);
1443
+ this.queries = new QueryServiceImpl(client);
1444
+ }
1445
+ };
1446
+
1447
+ // src/events/index.ts
1448
+ var EVENTS_BASE_PATH = "/events/v1";
1449
+ var TAIL_TIMEOUT_MS = 24 * 60 * 60 * 1e3;
1450
+ var EventsClient = class {
1451
+ topics;
1452
+ constructor(client) {
1453
+ this.topics = new TopicServiceImpl(client);
1454
+ }
1455
+ };
1456
+ var TopicServiceImpl = class {
1457
+ constructor(client) {
1458
+ this.client = client;
1459
+ }
1460
+ client;
1461
+ async list() {
1462
+ const response = await this.client.request(
1463
+ "GET",
1464
+ `${EVENTS_BASE_PATH}/topics`
1465
+ );
1466
+ return response.data ?? [];
1467
+ }
1468
+ async events(topic, options = {}) {
1469
+ const response = await this.client.requestWithQuery(
1470
+ "GET",
1471
+ `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/events`,
1472
+ options
1473
+ );
1474
+ return response.data ?? [];
1475
+ }
1476
+ async *tail(topic, options = {}) {
1477
+ const path = `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/events?follow=true`;
1478
+ let body;
1479
+ try {
1480
+ ;
1481
+ ({ body } = await this.client.requestRaw("GET", path, void 0, {
1482
+ timeout: TAIL_TIMEOUT_MS,
1483
+ ...options.signal ? { signal: options.signal } : {},
1484
+ headers: { Accept: "application/x-ndjson" }
1485
+ }));
1486
+ } catch (error) {
1487
+ if (isAbort(error)) return;
1488
+ throw error;
1489
+ }
1490
+ if (!body) return;
1491
+ const reader = body.getReader();
1492
+ const decoder = new TextDecoder();
1493
+ let buffer = "";
1494
+ try {
1495
+ while (true) {
1496
+ const { done, value } = await reader.read();
1497
+ if (done) break;
1498
+ buffer += decoder.decode(value, { stream: true });
1499
+ let newlineIndex = buffer.indexOf("\n");
1500
+ while (newlineIndex !== -1) {
1501
+ const line = buffer.slice(0, newlineIndex).trim();
1502
+ buffer = buffer.slice(newlineIndex + 1);
1503
+ const event = parseLine(line);
1504
+ if (event) yield event;
1505
+ newlineIndex = buffer.indexOf("\n");
1506
+ }
1507
+ }
1508
+ const remainder = parseLine(buffer.trim());
1509
+ if (remainder) yield remainder;
1510
+ } catch (error) {
1511
+ if (!isAbort(error)) throw error;
1512
+ } finally {
1513
+ reader.releaseLock();
1514
+ void body.cancel().catch(() => {
1515
+ });
1516
+ }
1517
+ }
1518
+ async publish(topic, request) {
1519
+ return this.client.request(
1520
+ "POST",
1521
+ `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/events`,
1522
+ request
1523
+ );
1524
+ }
1525
+ async redrive(topic) {
1526
+ return this.client.request(
1527
+ "POST",
1528
+ `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/redrive`
1529
+ );
1530
+ }
1531
+ async purge(topic) {
1532
+ await this.client.request(
1533
+ "POST",
1534
+ `${EVENTS_BASE_PATH}/topics/${encodeURIComponent(topic)}/purge`
1535
+ );
1536
+ }
1537
+ };
1538
+ function isAbort(error) {
1539
+ return error instanceof DOMException && error.name === "AbortError";
1540
+ }
1541
+ function parseLine(line) {
1542
+ if (!line) return null;
1543
+ try {
1544
+ return JSON.parse(line);
1545
+ } catch {
1546
+ return null;
1547
+ }
1548
+ }
1549
+
1550
+ // src/functions/actions.ts
1551
+ var ACTIONS_BASE_PATH = "/functions/v1/actions";
1552
+ var ActionServiceImpl = class {
1553
+ constructor(client) {
1554
+ this.client = client;
1555
+ }
1556
+ client;
1557
+ list(options = {}) {
1558
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
1559
+ }
1560
+ async listPage(options = {}) {
1561
+ return this.client.requestWithQuery("GET", ACTIONS_BASE_PATH, options);
1562
+ }
1563
+ async get(slug) {
1564
+ return this.client.request("GET", `${ACTIONS_BASE_PATH}/${slug}`);
1565
+ }
1566
+ async invokeGlobal(slug, params) {
1567
+ const response = await this.client.request(
1568
+ "POST",
1569
+ `${ACTIONS_BASE_PATH}/${slug}/invoke`,
1570
+ params
1571
+ );
1572
+ return response.result;
1573
+ }
1574
+ async invokeEntity(entitySlug, recordId, slug, params) {
1575
+ const response = await this.client.request(
1576
+ "POST",
1577
+ `/functions/v1/entities/${entitySlug}/records/${recordId}/actions/${slug}/invoke`,
1578
+ params
1579
+ );
1580
+ return response.result;
1581
+ }
1582
+ };
1583
+ var ActionScopeSchema = zod.z.enum(["entity", "global"]);
1584
+ var ActionSchema = chunk7RGN4E22_cjs.AuditFieldsSchema.extend({
1585
+ slug: zod.z.string(),
1586
+ org_id: zod.z.string(),
1587
+ module_slug: zod.z.string(),
1588
+ scope: ActionScopeSchema,
1589
+ entity: zod.z.string().optional(),
1590
+ name: zod.z.string(),
1591
+ is_active: zod.z.boolean(),
1592
+ file_id: zod.z.string(),
1593
+ params: zod.z.array(chunk7RGN4E22_cjs.AttributeSchema),
1594
+ returns: zod.z.array(chunk7RGN4E22_cjs.AttributeSchema)
1595
+ });
1596
+
1597
+ // src/functions/index.ts
1598
+ var FunctionsClient = class {
1599
+ actions;
1600
+ constructor(client) {
1601
+ this.actions = new ActionServiceImpl(client);
1602
+ }
1603
+ };
1604
+
1605
+ // src/knowledge/graph.ts
1606
+ var GRAPH_BASE_PATH = "/knowledge/v1/graph";
1607
+ var GraphServiceImpl = class {
1608
+ constructor(client) {
1609
+ this.client = client;
1610
+ }
1611
+ client;
1612
+ async get(options = {}) {
1613
+ const query = {};
1614
+ if (options.label_ids && options.label_ids.length > 0) {
1615
+ query.label_ids = options.label_ids.join(",");
1616
+ }
1617
+ return this.client.requestWithQuery("GET", GRAPH_BASE_PATH, query);
1618
+ }
1619
+ };
1620
+
1621
+ // src/knowledge/labels.ts
1622
+ var LABELS_BASE_PATH = "/knowledge/v1/labels";
1623
+ var LabelServiceImpl = class {
1624
+ constructor(client) {
1625
+ this.client = client;
1626
+ }
1627
+ client;
1628
+ list(options = {}) {
1629
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
1630
+ }
1631
+ async listPage(options = {}) {
1632
+ return this.client.requestWithQuery(
1633
+ "GET",
1634
+ LABELS_BASE_PATH,
1635
+ options
1636
+ );
1637
+ }
1638
+ async get(id) {
1639
+ return this.client.request("GET", `${LABELS_BASE_PATH}/${id}`);
1640
+ }
1641
+ async create(request) {
1642
+ return this.client.request("POST", LABELS_BASE_PATH, request);
1643
+ }
1644
+ async update(id, request) {
1645
+ return this.client.request("PATCH", `${LABELS_BASE_PATH}/${id}`, request);
1646
+ }
1647
+ async delete(id) {
1648
+ await this.client.request("DELETE", `${LABELS_BASE_PATH}/${id}`);
1649
+ }
1650
+ };
1651
+
1652
+ // src/knowledge/links.ts
1653
+ var LINKS_BASE_PATH = "/knowledge/v1/links";
1654
+ var LinkServiceImpl = class {
1655
+ constructor(client) {
1656
+ this.client = client;
1657
+ }
1658
+ client;
1659
+ list(options = {}) {
1660
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
1661
+ }
1662
+ async listPage(options = {}) {
1663
+ return this.client.requestWithQuery("GET", LINKS_BASE_PATH, options);
1664
+ }
1665
+ async get(id) {
1666
+ return this.client.request("GET", `${LINKS_BASE_PATH}/${id}`);
1667
+ }
1668
+ async create(request) {
1669
+ return this.client.request("POST", LINKS_BASE_PATH, request);
1670
+ }
1671
+ async update(id, request) {
1672
+ return this.client.request("PATCH", `${LINKS_BASE_PATH}/${id}`, request);
1673
+ }
1674
+ async delete(id) {
1675
+ await this.client.request("DELETE", `${LINKS_BASE_PATH}/${id}`);
1676
+ }
1677
+ };
1678
+
1679
+ // src/knowledge/nodes.ts
1680
+ var NODES_BASE_PATH = "/knowledge/v1/nodes";
1681
+ var NodeServiceImpl = class {
1682
+ constructor(client) {
1683
+ this.client = client;
1684
+ }
1685
+ client;
1686
+ list(options = {}) {
1687
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
1688
+ }
1689
+ async listPage(options = {}) {
1690
+ const { label_ids, ...rest } = options;
1691
+ const query = { ...rest };
1692
+ if (label_ids && label_ids.length > 0) {
1693
+ query.label_ids = label_ids.join(",");
1694
+ }
1695
+ return this.client.requestWithQuery(
1696
+ "GET",
1697
+ NODES_BASE_PATH,
1698
+ query
1699
+ );
1700
+ }
1701
+ async get(id) {
1702
+ return this.client.request("GET", `${NODES_BASE_PATH}/${id}`);
1703
+ }
1704
+ async create(request) {
1705
+ return this.client.request("POST", NODES_BASE_PATH, request);
1706
+ }
1707
+ async update(id, request) {
1708
+ return this.client.request("PATCH", `${NODES_BASE_PATH}/${id}`, request);
1709
+ }
1710
+ async delete(id) {
1711
+ await this.client.request("DELETE", `${NODES_BASE_PATH}/${id}`);
1712
+ }
1713
+ async search(request) {
1714
+ return this.client.request(
1715
+ "POST",
1716
+ `${NODES_BASE_PATH}/actions/search`,
1717
+ request
1718
+ );
1719
+ }
1720
+ async neighbors(id, options = {}) {
1721
+ return this.client.requestWithQuery(
1722
+ "GET",
1723
+ `${NODES_BASE_PATH}/${id}/neighbors`,
1724
+ options
1725
+ );
1726
+ }
1727
+ async getContent(id) {
1728
+ return this.client.request("GET", `${NODES_BASE_PATH}/${id}/content`);
1729
+ }
1730
+ async writeContent(id, content) {
1731
+ return this.client.request("PUT", `${NODES_BASE_PATH}/${id}/content`, {
1732
+ content
1733
+ });
1734
+ }
1735
+ async editContent(id, request) {
1736
+ return this.client.request(
1737
+ "POST",
1738
+ `${NODES_BASE_PATH}/${id}/content/actions/edit`,
1739
+ request
1740
+ );
1741
+ }
1742
+ async getOutline(request) {
1743
+ return this.client.request(
1744
+ "POST",
1745
+ `${NODES_BASE_PATH}/content/actions/outline`,
1746
+ request
1747
+ );
1748
+ }
1749
+ async searchContent(request) {
1750
+ return this.client.request(
1751
+ "POST",
1752
+ `${NODES_BASE_PATH}/content/actions/search`,
1753
+ request
1754
+ );
1755
+ }
1756
+ async listLabels(id) {
1757
+ const result = await this.client.request(
1758
+ "GET",
1759
+ `${NODES_BASE_PATH}/${id}/labels`
1760
+ );
1761
+ return result.data;
1762
+ }
1763
+ async attachLabel(id, labelId) {
1764
+ return this.client.request("POST", `${NODES_BASE_PATH}/${id}/labels`, {
1765
+ label_id: labelId
1766
+ });
1767
+ }
1768
+ async detachLabel(id, labelId) {
1769
+ await this.client.request("DELETE", `${NODES_BASE_PATH}/${id}/labels/${labelId}`);
1770
+ }
1771
+ };
1772
+
1773
+ // src/knowledge/record-links.ts
1774
+ var RECORD_LINKS_BASE_PATH = "/knowledge/v1/record-links";
1775
+ var RecordLinkServiceImpl = class {
1776
+ constructor(client) {
1777
+ this.client = client;
1778
+ }
1779
+ client;
1780
+ list(options = {}) {
1781
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
1782
+ }
1783
+ async listPage(options = {}) {
1784
+ return this.client.requestWithQuery(
1785
+ "GET",
1786
+ RECORD_LINKS_BASE_PATH,
1787
+ options
1788
+ );
1789
+ }
1790
+ async get(id) {
1791
+ return this.client.request("GET", `${RECORD_LINKS_BASE_PATH}/${id}`);
1792
+ }
1793
+ async create(request) {
1794
+ return this.client.request("POST", RECORD_LINKS_BASE_PATH, request);
1795
+ }
1796
+ async delete(id) {
1797
+ await this.client.request("DELETE", `${RECORD_LINKS_BASE_PATH}/${id}`);
1798
+ }
1799
+ };
1800
+ var KnowledgeNodeMetadataSchema = zod.z.object({
1801
+ id: zod.z.string(),
1802
+ org_id: zod.z.string(),
1803
+ title: zod.z.string(),
1804
+ type: zod.z.enum(["markdown", "file", "url"]),
1805
+ status: zod.z.enum(["draft", "published", "archived"]),
1806
+ embedding_model: zod.z.string().nullish(),
1807
+ embedded_at: zod.z.string().nullish(),
1808
+ file_id: zod.z.string().nullish(),
1809
+ url: zod.z.string().nullish(),
1810
+ summary: zod.z.string().nullish(),
1811
+ valid_from: zod.z.string().nullish(),
1812
+ valid_until: zod.z.string().nullish()
1813
+ }).merge(chunk7RGN4E22_cjs.AuditFieldsSchema);
1814
+ var KnowledgeNodeSchema = KnowledgeNodeMetadataSchema.extend({
1815
+ content: zod.z.string()
1816
+ });
1817
+ var KnowledgeNodeSearchResultSchema = KnowledgeNodeMetadataSchema.extend({
1818
+ score: zod.z.number()
1819
+ });
1820
+ var KnowledgeLinkSchema = zod.z.object({
1821
+ id: zod.z.string(),
1822
+ org_id: zod.z.string(),
1823
+ from_id: zod.z.string(),
1824
+ to_id: zod.z.string(),
1825
+ type: zod.z.enum([
1826
+ "references",
1827
+ "relates_to",
1828
+ "depends_on",
1829
+ "part_of",
1830
+ "derived_from",
1831
+ "contradicts",
1832
+ "supports",
1833
+ "duplicates",
1834
+ "superseded_by"
1835
+ ]),
1836
+ description: zod.z.string().nullish()
1837
+ }).merge(chunk7RGN4E22_cjs.AuditFieldsSchema);
1838
+ var KnowledgeRecordLinkSchema = zod.z.object({
1839
+ id: zod.z.string(),
1840
+ org_id: zod.z.string(),
1841
+ node_id: zod.z.string(),
1842
+ entity_slug: zod.z.string(),
1843
+ record_id: zod.z.string(),
1844
+ created_at: zod.z.string(),
1845
+ created_by: chunk7RGN4E22_cjs.UserRefSchema
1846
+ });
1847
+ var KnowledgeLabelSchema = zod.z.object({
1848
+ id: zod.z.string(),
1849
+ org_id: zod.z.string(),
1850
+ name: zod.z.string(),
1851
+ slug: zod.z.string(),
1852
+ description: zod.z.string().nullish(),
1853
+ color: zod.z.string().nullish(),
1854
+ icon: zod.z.string().nullish()
1855
+ }).merge(chunk7RGN4E22_cjs.AuditFieldsSchema);
1856
+ var KnowledgeNodeLabelSchema = zod.z.object({
1857
+ org_id: zod.z.string(),
1858
+ node_id: zod.z.string(),
1859
+ label_id: zod.z.string(),
1860
+ created_at: zod.z.string(),
1861
+ created_by: chunk7RGN4E22_cjs.UserRefSchema
1862
+ });
1863
+ var NodeNeighborhoodSchema = zod.z.object({
1864
+ nodes: zod.z.array(
1865
+ zod.z.object({
1866
+ id: zod.z.string(),
1867
+ title: zod.z.string(),
1868
+ type: zod.z.enum(["markdown", "file", "url"]),
1869
+ status: zod.z.enum(["draft", "published", "archived"]),
1870
+ distance: zod.z.number()
1871
+ })
1872
+ ),
1873
+ edges: zod.z.array(
1874
+ zod.z.object({
1875
+ id: zod.z.string(),
1876
+ from_id: zod.z.string(),
1877
+ to_id: zod.z.string(),
1878
+ type: zod.z.string()
1879
+ })
1880
+ )
1881
+ });
1882
+
1883
+ // src/knowledge/index.ts
1884
+ var KnowledgeClient = class {
1885
+ nodes;
1886
+ links;
1887
+ /** Node→record edges (links to data-service records): `knowledge.recordLinks`. */
1888
+ recordLinks;
1889
+ labels;
1890
+ /** Whole-org graph bulk read (radiant graph view): `knowledge.graph.get()`. */
1891
+ graph;
1892
+ constructor(client) {
1893
+ this.nodes = new NodeServiceImpl(client);
1894
+ this.links = new LinkServiceImpl(client);
1895
+ this.recordLinks = new RecordLinkServiceImpl(client);
1896
+ this.labels = new LabelServiceImpl(client);
1897
+ this.graph = new GraphServiceImpl(client);
1898
+ }
1899
+ };
1900
+
1901
+ // src/storage/files.ts
1902
+ var FILES_BASE_PATH = "/storage/v1/files";
1903
+ var FileServiceImpl = class {
1904
+ constructor(client) {
1905
+ this.client = client;
1906
+ }
1907
+ client;
1908
+ async upload(file, options) {
1909
+ const metadata = {
1910
+ name: options?.name ?? file.name,
1911
+ content_type: options?.contentType ?? file.type ?? "application/octet-stream"
1912
+ };
1913
+ const formData = new FormData();
1914
+ formData.append("metadata", new Blob([JSON.stringify(metadata)], { type: "application/json" }));
1915
+ formData.append("file", file, metadata.name);
1916
+ const response = await this.client.requestMultipart(
1917
+ "POST",
1918
+ FILES_BASE_PATH,
1919
+ formData
1920
+ );
1921
+ return response.data;
1922
+ }
1923
+ async create(metadata) {
1924
+ const formData = new FormData();
1925
+ formData.append(
1926
+ "metadata",
1927
+ new Blob(
1928
+ [
1929
+ JSON.stringify({
1930
+ name: metadata.name,
1931
+ content_type: metadata.content_type ?? "application/octet-stream"
1932
+ })
1933
+ ],
1934
+ { type: "application/json" }
1935
+ )
1936
+ );
1937
+ const response = await this.client.requestMultipart(
1938
+ "POST",
1939
+ FILES_BASE_PATH,
1940
+ formData
1941
+ );
1942
+ return response.data;
1943
+ }
1944
+ async createUploadUrl(id) {
1945
+ const response = await this.client.request(
1946
+ "POST",
1947
+ `${FILES_BASE_PATH}/${id}/generate-upload-url`
1948
+ );
1949
+ return response.data;
1950
+ }
1951
+ async parse(id, options) {
1952
+ const response = await this.client.request(
1953
+ "POST",
1954
+ `${FILES_BASE_PATH}/${id}/parse`,
1955
+ options ?? {}
1956
+ );
1957
+ return response.data;
1958
+ }
1959
+ async getContent(id) {
1960
+ const response = await this.client.request(
1961
+ "GET",
1962
+ `${FILES_BASE_PATH}/${id}/content`
1963
+ );
1964
+ return response.data;
1965
+ }
1966
+ async get(id) {
1967
+ const response = await this.client.request(
1968
+ "GET",
1969
+ `${FILES_BASE_PATH}/${id}`
1970
+ );
1971
+ return response.data;
1972
+ }
1973
+ async createDownloadUrl(id, options) {
1974
+ const body = options?.allowsMultiUse !== void 0 ? { allows_multi_use: options.allowsMultiUse } : void 0;
1975
+ const response = await this.client.request(
1976
+ "POST",
1977
+ `${FILES_BASE_PATH}/${id}/generate-download-url`,
1978
+ body
1979
+ );
1980
+ return response.data;
1981
+ }
1982
+ async download(id) {
1983
+ const { response } = await this.client.requestRaw("GET", `${FILES_BASE_PATH}/${id}/download`);
1984
+ return await response.blob();
1985
+ }
1986
+ };
1987
+
1988
+ // src/storage/index.ts
1989
+ var StorageClient = class {
1990
+ files;
1991
+ constructor(client) {
1992
+ this.files = new FileServiceImpl(client);
1993
+ }
1994
+ };
1995
+
1996
+ // src/workflow/executions.ts
1997
+ var EXECUTIONS_BASE_PATH = "/workflows/v1/executions";
1998
+ var WORKFLOWS_BASE_PATH = "/workflows/v1/workflows";
1999
+ var ExecutionServiceImpl = class {
2000
+ constructor(client) {
2001
+ this.client = client;
2002
+ }
2003
+ client;
2004
+ list(options = {}) {
2005
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
2006
+ }
2007
+ async listPage(options = {}) {
2008
+ return this.client.requestWithQuery(
2009
+ "GET",
2010
+ EXECUTIONS_BASE_PATH,
2011
+ options
2012
+ );
2013
+ }
2014
+ async get(id) {
2015
+ return this.client.request("GET", `${EXECUTIONS_BASE_PATH}/${id}`);
2016
+ }
2017
+ async getDetail(id) {
2018
+ return this.client.request(
2019
+ "GET",
2020
+ `${EXECUTIONS_BASE_PATH}/${id}/detail`
2021
+ );
2022
+ }
2023
+ async getNodeItems(executionId, nodeId, runIndex, options = {}) {
2024
+ return this.client.requestWithQuery(
2025
+ "GET",
2026
+ `${EXECUTIONS_BASE_PATH}/${executionId}/nodes/${nodeId}/runs/${runIndex}/items`,
2027
+ options
2028
+ );
2029
+ }
2030
+ async listForWorkflow(key, options = {}) {
2031
+ return this.client.requestWithQuery(
2032
+ "GET",
2033
+ `${WORKFLOWS_BASE_PATH}/${key}/executions`,
2034
+ options
2035
+ );
2036
+ }
2037
+ };
2038
+
2039
+ // src/workflow/node-types.ts
2040
+ var NODE_TYPES_BASE_PATH = "/workflows/v1/node-types";
2041
+ var NodeTypeServiceImpl = class {
2042
+ constructor(client) {
2043
+ this.client = client;
2044
+ }
2045
+ client;
2046
+ async list() {
2047
+ const response = await this.client.request("GET", NODE_TYPES_BASE_PATH);
2048
+ return response.data;
2049
+ }
2050
+ async invokeMethod(type, method, request = {}) {
2051
+ const path = `${NODE_TYPES_BASE_PATH}/${encodeURIComponent(type)}/methods/${encodeURIComponent(method)}`;
2052
+ return this.client.request("POST", path, request);
2053
+ }
2054
+ };
2055
+
2056
+ // src/workflow/workflows.ts
2057
+ var WORKFLOWS_BASE_PATH2 = "/workflows/v1/workflows";
2058
+ var WorkflowServiceImpl = class {
2059
+ constructor(client) {
2060
+ this.client = client;
2061
+ }
2062
+ client;
2063
+ list(options = {}) {
2064
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listPage(opts), options);
2065
+ }
2066
+ async listPage(options = {}) {
2067
+ return this.client.requestWithQuery("GET", WORKFLOWS_BASE_PATH2, options);
2068
+ }
2069
+ async get(key) {
2070
+ return this.client.request("GET", `${WORKFLOWS_BASE_PATH2}/${key}`);
2071
+ }
2072
+ async create(request) {
2073
+ return this.client.request("POST", WORKFLOWS_BASE_PATH2, request);
2074
+ }
2075
+ async update(key, request) {
2076
+ return this.client.request("PATCH", `${WORKFLOWS_BASE_PATH2}/${key}`, request);
2077
+ }
2078
+ async delete(key) {
2079
+ await this.client.request("DELETE", `${WORKFLOWS_BASE_PATH2}/${key}`);
2080
+ }
2081
+ async run(key, request = {}) {
2082
+ return this.client.request(
2083
+ "POST",
2084
+ `${WORKFLOWS_BASE_PATH2}/${key}/run`,
2085
+ request
2086
+ );
2087
+ }
2088
+ async testNode(key, nodeId, request) {
2089
+ return this.client.request(
2090
+ "POST",
2091
+ `${WORKFLOWS_BASE_PATH2}/${key}/nodes/${nodeId}/test`,
2092
+ request
2093
+ );
2094
+ }
2095
+ async pause(key) {
2096
+ return this.client.request("POST", `${WORKFLOWS_BASE_PATH2}/${key}/pause`, {});
2097
+ }
2098
+ async unpause(key) {
2099
+ return this.client.request("POST", `${WORKFLOWS_BASE_PATH2}/${key}/unpause`, {});
2100
+ }
2101
+ listVersions(key, options = {}) {
2102
+ return new chunk7RGN4E22_cjs.PageIterator((opts) => this.listVersionsPage(key, opts), options);
2103
+ }
2104
+ async listVersionsPage(key, options = {}) {
2105
+ return this.client.requestWithQuery(
2106
+ "GET",
2107
+ `${WORKFLOWS_BASE_PATH2}/${key}/versions`,
2108
+ options
2109
+ );
2110
+ }
2111
+ async getVersion(key, version) {
2112
+ return this.client.request(
2113
+ "GET",
2114
+ `${WORKFLOWS_BASE_PATH2}/${key}/versions/${version}`
2115
+ );
2116
+ }
2117
+ async restoreVersion(key, version) {
2118
+ return this.client.request(
2119
+ "POST",
2120
+ `${WORKFLOWS_BASE_PATH2}/${key}/versions/${version}/restore`,
2121
+ {}
2122
+ );
2123
+ }
2124
+ };
2125
+
2126
+ // src/workflow/types.ts
2127
+ var DEFAULT_PORT = "main";
2128
+ var ERROR_PORT = "error";
2129
+
2130
+ // src/workflow/index.ts
2131
+ var WorkflowClient = class {
2132
+ /** Service for managing workflow definitions. */
2133
+ workflows;
2134
+ /** Service for reading workflow executions. */
2135
+ executions;
2136
+ /** Service for the node-type catalog + dynamic node methods. */
2137
+ nodeTypes;
2138
+ constructor(client) {
2139
+ this.workflows = new WorkflowServiceImpl(client);
2140
+ this.executions = new ExecutionServiceImpl(client);
2141
+ this.nodeTypes = new NodeTypeServiceImpl(client);
2142
+ }
2143
+ };
2144
+
2145
+ Object.defineProperty(exports, "AppSchema", {
2146
+ enumerable: true,
2147
+ get: function () { return chunk7RGN4E22_cjs.AppSchema; }
2148
+ });
2149
+ Object.defineProperty(exports, "AttributeSchema", {
2150
+ enumerable: true,
2151
+ get: function () { return chunk7RGN4E22_cjs.AttributeSchema; }
2152
+ });
2153
+ Object.defineProperty(exports, "AuditFieldsSchema", {
2154
+ enumerable: true,
2155
+ get: function () { return chunk7RGN4E22_cjs.AuditFieldsSchema; }
2156
+ });
2157
+ Object.defineProperty(exports, "ColumnSchema", {
2158
+ enumerable: true,
2159
+ get: function () { return chunk7RGN4E22_cjs.ColumnSchema; }
2160
+ });
2161
+ Object.defineProperty(exports, "ComponentSchema", {
2162
+ enumerable: true,
2163
+ get: function () { return chunk7RGN4E22_cjs.ComponentSchema; }
2164
+ });
2165
+ Object.defineProperty(exports, "CurrencyAttributeMetaSchema", {
2166
+ enumerable: true,
2167
+ get: function () { return chunk7RGN4E22_cjs.CurrencyAttributeMetaSchema; }
2168
+ });
2169
+ Object.defineProperty(exports, "DEFAULT_PAGE_SIZE", {
2170
+ enumerable: true,
2171
+ get: function () { return chunk7RGN4E22_cjs.DEFAULT_PAGE_SIZE; }
2172
+ });
2173
+ Object.defineProperty(exports, "DONE", {
2174
+ enumerable: true,
2175
+ get: function () { return chunk7RGN4E22_cjs.DONE; }
2176
+ });
2177
+ Object.defineProperty(exports, "EntitySchema", {
2178
+ enumerable: true,
2179
+ get: function () { return chunk7RGN4E22_cjs.EntitySchema; }
2180
+ });
2181
+ Object.defineProperty(exports, "EntityWithSchemaSchema", {
2182
+ enumerable: true,
2183
+ get: function () { return chunk7RGN4E22_cjs.EntityWithSchemaSchema; }
2184
+ });
2185
+ Object.defineProperty(exports, "FileRefSchema", {
2186
+ enumerable: true,
2187
+ get: function () { return chunk7RGN4E22_cjs.FileRefSchema; }
2188
+ });
2189
+ Object.defineProperty(exports, "FilterElementSchema", {
2190
+ enumerable: true,
2191
+ get: function () { return chunk7RGN4E22_cjs.FilterElementSchema; }
2192
+ });
2193
+ Object.defineProperty(exports, "FilterGroupSchema", {
2194
+ enumerable: true,
2195
+ get: function () { return chunk7RGN4E22_cjs.FilterGroupSchema; }
2196
+ });
2197
+ Object.defineProperty(exports, "ListSchema", {
2198
+ enumerable: true,
2199
+ get: function () { return chunk7RGN4E22_cjs.ListSchema; }
2200
+ });
2201
+ Object.defineProperty(exports, "ListViewSchema", {
2202
+ enumerable: true,
2203
+ get: function () { return chunk7RGN4E22_cjs.ListViewSchema; }
2204
+ });
2205
+ Object.defineProperty(exports, "MenuConfigurationSchema", {
2206
+ enumerable: true,
2207
+ get: function () { return chunk7RGN4E22_cjs.MenuConfigurationSchema; }
2208
+ });
2209
+ Object.defineProperty(exports, "MenuItemSchema", {
2210
+ enumerable: true,
2211
+ get: function () { return chunk7RGN4E22_cjs.MenuItemSchema; }
2212
+ });
2213
+ Object.defineProperty(exports, "MenuItemType", {
2214
+ enumerable: true,
2215
+ get: function () { return chunk7RGN4E22_cjs.MenuItemType; }
2216
+ });
2217
+ Object.defineProperty(exports, "MetaClient", {
2218
+ enumerable: true,
2219
+ get: function () { return chunk7RGN4E22_cjs.MetaClient; }
2220
+ });
2221
+ Object.defineProperty(exports, "ModuleSchema", {
2222
+ enumerable: true,
2223
+ get: function () { return chunk7RGN4E22_cjs.ModuleSchema; }
2224
+ });
2225
+ Object.defineProperty(exports, "OnDeleteActionSchema", {
2226
+ enumerable: true,
2227
+ get: function () { return chunk7RGN4E22_cjs.OnDeleteActionSchema; }
2228
+ });
2229
+ Object.defineProperty(exports, "PLATFORM_ATTRIBUTE_NAMES", {
2230
+ enumerable: true,
2231
+ get: function () { return chunk7RGN4E22_cjs.PLATFORM_ATTRIBUTE_NAMES; }
2232
+ });
2233
+ Object.defineProperty(exports, "PLATFORM_USER_ID", {
2234
+ enumerable: true,
2235
+ get: function () { return chunk7RGN4E22_cjs.PLATFORM_USER_ID; }
2236
+ });
2237
+ Object.defineProperty(exports, "PageActionSchema", {
2238
+ enumerable: true,
2239
+ get: function () { return chunk7RGN4E22_cjs.PageActionSchema; }
2240
+ });
2241
+ Object.defineProperty(exports, "PageIterator", {
2242
+ enumerable: true,
2243
+ get: function () { return chunk7RGN4E22_cjs.PageIterator; }
2244
+ });
2245
+ Object.defineProperty(exports, "PageLayoutSchema", {
2246
+ enumerable: true,
2247
+ get: function () { return chunk7RGN4E22_cjs.PageLayoutSchema; }
2248
+ });
2249
+ Object.defineProperty(exports, "PageSchema", {
2250
+ enumerable: true,
2251
+ get: function () { return chunk7RGN4E22_cjs.PageSchema; }
2252
+ });
2253
+ Object.defineProperty(exports, "RelationAttributeMetaSchema", {
2254
+ enumerable: true,
2255
+ get: function () { return chunk7RGN4E22_cjs.RelationAttributeMetaSchema; }
2256
+ });
2257
+ Object.defineProperty(exports, "ResponseMetaSchema", {
2258
+ enumerable: true,
2259
+ get: function () { return chunk7RGN4E22_cjs.ResponseMetaSchema; }
2260
+ });
2261
+ Object.defineProperty(exports, "SortConfigSchema", {
2262
+ enumerable: true,
2263
+ get: function () { return chunk7RGN4E22_cjs.SortConfigSchema; }
2264
+ });
2265
+ Object.defineProperty(exports, "UserRefSchema", {
2266
+ enumerable: true,
2267
+ get: function () { return chunk7RGN4E22_cjs.UserRefSchema; }
2268
+ });
2269
+ Object.defineProperty(exports, "VariableSchema", {
2270
+ enumerable: true,
2271
+ get: function () { return chunk7RGN4E22_cjs.VariableSchema; }
2272
+ });
2273
+ Object.defineProperty(exports, "allCurrencyCodes", {
2274
+ enumerable: true,
2275
+ get: function () { return chunk7RGN4E22_cjs.allCurrencyCodes; }
2276
+ });
2277
+ Object.defineProperty(exports, "createIterator", {
2278
+ enumerable: true,
2279
+ get: function () { return chunk7RGN4E22_cjs.createIterator; }
2280
+ });
2281
+ Object.defineProperty(exports, "createListResultSchema", {
2282
+ enumerable: true,
2283
+ get: function () { return chunk7RGN4E22_cjs.createListResultSchema; }
2284
+ });
2285
+ Object.defineProperty(exports, "currencyLabel", {
2286
+ enumerable: true,
2287
+ get: function () { return chunk7RGN4E22_cjs.currencyLabel; }
2288
+ });
2289
+ Object.defineProperty(exports, "currencySymbol", {
2290
+ enumerable: true,
2291
+ get: function () { return chunk7RGN4E22_cjs.currencySymbol; }
2292
+ });
2293
+ Object.defineProperty(exports, "currencySymbolSide", {
2294
+ enumerable: true,
2295
+ get: function () { return chunk7RGN4E22_cjs.currencySymbolSide; }
2296
+ });
2297
+ Object.defineProperty(exports, "formatAmount", {
2298
+ enumerable: true,
2299
+ get: function () { return chunk7RGN4E22_cjs.formatAmount; }
2300
+ });
2301
+ Object.defineProperty(exports, "formatMoney", {
2302
+ enumerable: true,
2303
+ get: function () { return chunk7RGN4E22_cjs.formatMoney; }
2304
+ });
2305
+ Object.defineProperty(exports, "isPlatformAttributeName", {
2306
+ enumerable: true,
2307
+ get: function () { return chunk7RGN4E22_cjs.isPlatformAttributeName; }
2308
+ });
2309
+ Object.defineProperty(exports, "localeNumberSeparators", {
2310
+ enumerable: true,
2311
+ get: function () { return chunk7RGN4E22_cjs.localeNumberSeparators; }
2312
+ });
2313
+ Object.defineProperty(exports, "parseAmount", {
2314
+ enumerable: true,
2315
+ get: function () { return chunk7RGN4E22_cjs.parseAmount; }
2316
+ });
2317
+ Object.defineProperty(exports, "parseCurrencyMeta", {
2318
+ enumerable: true,
2319
+ get: function () { return chunk7RGN4E22_cjs.parseCurrencyMeta; }
2320
+ });
2321
+ Object.defineProperty(exports, "parseFileMeta", {
2322
+ enumerable: true,
2323
+ get: function () { return chunk7RGN4E22_cjs.parseFileMeta; }
2324
+ });
2325
+ Object.defineProperty(exports, "parseRelationMeta", {
2326
+ enumerable: true,
2327
+ get: function () { return chunk7RGN4E22_cjs.parseRelationMeta; }
2328
+ });
2329
+ Object.defineProperty(exports, "platformAttributes", {
2330
+ enumerable: true,
2331
+ get: function () { return chunk7RGN4E22_cjs.platformAttributes; }
2332
+ });
2333
+ exports.AccountClient = AccountClient;
2334
+ exports.ActionSchema = ActionSchema;
2335
+ exports.ActionScopeSchema = ActionScopeSchema;
2336
+ exports.AgentClient = AgentClient;
2337
+ exports.BatchTransactionErrorSchema = BatchTransactionErrorSchema;
2338
+ exports.BatchUpsertRecordsResponseSchema = BatchUpsertRecordsResponseSchema;
2339
+ exports.BatchUpsertTransactionResultSchema = BatchUpsertTransactionResultSchema;
2340
+ exports.BatchUpsertTransactionSchema = BatchUpsertTransactionSchema;
2341
+ exports.ConnectorClient = ConnectorClient;
2342
+ exports.ConversationClient = ConversationClient;
2343
+ exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
2344
+ exports.DEFAULT_PORT = DEFAULT_PORT;
2345
+ exports.DataClient = DataClient;
2346
+ exports.ERROR_PORT = ERROR_PORT;
2347
+ exports.ErrorCode = ErrorCode;
2348
+ exports.EventsClient = EventsClient;
2349
+ exports.FunctionsClient = FunctionsClient;
2350
+ exports.KnowledgeClient = KnowledgeClient;
2351
+ exports.KnowledgeLabelSchema = KnowledgeLabelSchema;
2352
+ exports.KnowledgeLinkSchema = KnowledgeLinkSchema;
2353
+ exports.KnowledgeNodeLabelSchema = KnowledgeNodeLabelSchema;
2354
+ exports.KnowledgeNodeMetadataSchema = KnowledgeNodeMetadataSchema;
2355
+ exports.KnowledgeNodeSchema = KnowledgeNodeSchema;
2356
+ exports.KnowledgeNodeSearchResultSchema = KnowledgeNodeSearchResultSchema;
2357
+ exports.KnowledgeRecordLinkSchema = KnowledgeRecordLinkSchema;
2358
+ exports.NodeNeighborhoodSchema = NodeNeighborhoodSchema;
2359
+ exports.OrganizationSchema = OrganizationSchema;
2360
+ exports.PLATFORM_ENTITIES = PLATFORM_ENTITIES;
2361
+ exports.PLATFORM_ENTITY_SLUGS = PLATFORM_ENTITY_SLUGS;
2362
+ exports.ProteosClient = ProteosClient;
2363
+ exports.ProteosError = ProteosError;
2364
+ exports.RoleEntityPermissionSchema = RoleEntityPermissionSchema;
2365
+ exports.RoleSchema = RoleSchema;
2366
+ exports.StorageClient = StorageClient;
2367
+ exports.UserRoleAssignmentSchema = UserRoleAssignmentSchema;
2368
+ exports.UserSchema = UserSchema;
2369
+ exports.WorkflowClient = WorkflowClient;
2370
+ exports.buildUrl = buildUrl;
2371
+ exports.getDefaultErrorCode = getDefaultErrorCode;
2372
+ exports.isBadRequest = isBadRequest;
2373
+ exports.isConflict = isConflict;
2374
+ exports.isForbidden = isForbidden;
2375
+ exports.isNotFound = isNotFound;
2376
+ exports.isPlatformEntity = isPlatformEntity;
2377
+ exports.isProteosError = isProteosError;
2378
+ exports.isUnauthorized = isUnauthorized;
2379
+ exports.parseErrorResponse = parseErrorResponse;
2380
+ exports.resolveOptions = resolveOptions;
2381
+ exports.toQueryParams = toQueryParams;
2382
+ exports.toQueryString = toQueryString;
2383
+ //# sourceMappingURL=index.cjs.map
2384
+ //# sourceMappingURL=index.cjs.map