@realtimex/sdk 1.7.28 → 2.0.2
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.
- package/dist/chunk-DZUAP6FW.mjs +598 -0
- package/dist/errors-DwEt8WYf.d.mts +399 -0
- package/dist/errors-DwEt8WYf.d.ts +399 -0
- package/dist/index.d.mts +8 -2048
- package/dist/index.d.ts +8 -2048
- package/dist/index.js +308 -4537
- package/dist/index.mjs +7 -3783
- package/dist/v1/index.d.mts +3 -56
- package/dist/v1/index.d.ts +3 -56
- package/dist/v1/index.js +255 -681
- package/dist/v1/index.mjs +4 -42
- package/package.json +6 -7
- package/dist/chunk-Z5GAUBIM.mjs +0 -993
- package/dist/errors-NufsyIZ-.d.mts +0 -678
- package/dist/errors-NufsyIZ-.d.ts +0 -678
- package/skills/realtimex-moderator-sdk/SKILL.md +0 -102
- package/skills/realtimex-moderator-sdk/references/activities.md +0 -14
- package/skills/realtimex-moderator-sdk/references/agents.md +0 -13
- package/skills/realtimex-moderator-sdk/references/api-reference/acpagent.md +0 -105
- package/skills/realtimex-moderator-sdk/references/api-reference/activities.md +0 -24
- package/skills/realtimex-moderator-sdk/references/api-reference/agent.md +0 -27
- package/skills/realtimex-moderator-sdk/references/api-reference/api.md +0 -17
- package/skills/realtimex-moderator-sdk/references/api-reference/auth.md +0 -36
- package/skills/realtimex-moderator-sdk/references/api-reference/contract.md +0 -27
- package/skills/realtimex-moderator-sdk/references/api-reference/core.md +0 -40
- package/skills/realtimex-moderator-sdk/references/api-reference/database.md +0 -24
- package/skills/realtimex-moderator-sdk/references/api-reference/index.md +0 -43
- package/skills/realtimex-moderator-sdk/references/api-reference/llm.md +0 -176
- package/skills/realtimex-moderator-sdk/references/api-reference/mcp.md +0 -50
- package/skills/realtimex-moderator-sdk/references/api-reference/port.md +0 -21
- package/skills/realtimex-moderator-sdk/references/api-reference/stt.md +0 -15
- package/skills/realtimex-moderator-sdk/references/api-reference/task.md +0 -62
- package/skills/realtimex-moderator-sdk/references/api-reference/tts.md +0 -18
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-acpauth.md +0 -21
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-acpcommands.md +0 -15
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-admin.md +0 -48
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-auth.md +0 -18
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-channels.md +0 -78
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-credentials.md +0 -27
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-customthemes.md +0 -24
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-desktopbrowser.md +0 -39
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-desktopembed.md +0 -24
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-desktopruntimesessions.md +0 -33
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-document.md +0 -39
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-embed.md +0 -27
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-openai.md +0 -21
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-sttapi.md +0 -12
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-system.md +0 -36
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-thread.md +0 -26
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-users.md +0 -15
- package/skills/realtimex-moderator-sdk/references/api-reference/v1-workspace.md +0 -39
- package/skills/realtimex-moderator-sdk/references/api-reference/webhook.md +0 -13
- package/skills/realtimex-moderator-sdk/references/api-reference.md +0 -1330
- package/skills/realtimex-moderator-sdk/references/app-concepts.md +0 -1276
- package/skills/realtimex-moderator-sdk/references/browser.md +0 -27
- package/skills/realtimex-moderator-sdk/references/channels.md +0 -189
- package/skills/realtimex-moderator-sdk/references/credentials.md +0 -111
- package/skills/realtimex-moderator-sdk/references/known-issues.md +0 -237
- package/skills/realtimex-moderator-sdk/references/llm.md +0 -13
- package/skills/realtimex-moderator-sdk/references/mcp.md +0 -13
- package/skills/realtimex-moderator-sdk/references/permissions.md +0 -30
- package/skills/realtimex-moderator-sdk/references/quickstart.md +0 -16
- package/skills/realtimex-moderator-sdk/references/terminal-sessions.md +0 -34
- package/skills/realtimex-moderator-sdk/references/workspaces.md +0 -20
- package/skills/realtimex-moderator-sdk/scripts/lib/sdk-init.js +0 -171
- package/skills/realtimex-moderator-sdk/scripts/rtx.js +0 -1359
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
// src/v1/errors.ts
|
|
2
|
+
var DeveloperApiError = class extends Error {
|
|
3
|
+
constructor(status, code, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.status = status;
|
|
6
|
+
this.code = code;
|
|
7
|
+
this.name = "DeveloperApiError";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var AuthenticationError = class extends DeveloperApiError {
|
|
11
|
+
constructor(message = "Invalid or missing API key") {
|
|
12
|
+
super(403, "AUTHENTICATION_ERROR", message);
|
|
13
|
+
this.name = "AuthenticationError";
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
var NotFoundError = class extends DeveloperApiError {
|
|
17
|
+
constructor(message = "Resource not found") {
|
|
18
|
+
super(404, "NOT_FOUND", message);
|
|
19
|
+
this.name = "NotFoundError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var ValidationError = class extends DeveloperApiError {
|
|
23
|
+
constructor(message) {
|
|
24
|
+
super(400, "VALIDATION_ERROR", message);
|
|
25
|
+
this.name = "ValidationError";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var ServerError = class extends DeveloperApiError {
|
|
29
|
+
constructor(message = "Internal server error") {
|
|
30
|
+
super(500, "SERVER_ERROR", message);
|
|
31
|
+
this.name = "ServerError";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/v1/client.ts
|
|
36
|
+
var DeveloperApiClient = class {
|
|
37
|
+
constructor(baseUrl, apiKey, appId) {
|
|
38
|
+
this.baseUrl = baseUrl.replace(/\/$/, "");
|
|
39
|
+
this.apiKey = apiKey;
|
|
40
|
+
this.appId = appId;
|
|
41
|
+
}
|
|
42
|
+
getHeaders(extra) {
|
|
43
|
+
const headers = {
|
|
44
|
+
"Content-Type": "application/json",
|
|
45
|
+
"Authorization": `Bearer ${this.apiKey}`
|
|
46
|
+
};
|
|
47
|
+
if (this.appId) headers["x-app-id"] = this.appId;
|
|
48
|
+
return { ...headers, ...extra };
|
|
49
|
+
}
|
|
50
|
+
async handleResponse(response) {
|
|
51
|
+
let data;
|
|
52
|
+
try {
|
|
53
|
+
data = await response.json();
|
|
54
|
+
} catch {
|
|
55
|
+
data = {};
|
|
56
|
+
}
|
|
57
|
+
if (response.ok) return data;
|
|
58
|
+
const message = data?.message || data?.error || response.statusText || "Request failed";
|
|
59
|
+
switch (response.status) {
|
|
60
|
+
case 400:
|
|
61
|
+
throw new ValidationError(message);
|
|
62
|
+
case 401:
|
|
63
|
+
case 403:
|
|
64
|
+
throw new AuthenticationError(message);
|
|
65
|
+
case 404:
|
|
66
|
+
throw new NotFoundError(message);
|
|
67
|
+
case 500:
|
|
68
|
+
case 502:
|
|
69
|
+
case 503:
|
|
70
|
+
throw new ServerError(message);
|
|
71
|
+
default:
|
|
72
|
+
throw new DeveloperApiError(response.status, "API_ERROR", message);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Make a JSON request to the v1 API.
|
|
77
|
+
*/
|
|
78
|
+
async request(method, path, body) {
|
|
79
|
+
const url = `${this.baseUrl}/api${path}`;
|
|
80
|
+
const response = await fetch(url, {
|
|
81
|
+
method,
|
|
82
|
+
headers: this.getHeaders(),
|
|
83
|
+
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
84
|
+
});
|
|
85
|
+
return this.handleResponse(response);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Make a multipart/form-data request (e.g. file uploads).
|
|
89
|
+
* Do NOT set Content-Type — browser/fetch will set it with the boundary.
|
|
90
|
+
*/
|
|
91
|
+
async requestMultipart(method, path, form) {
|
|
92
|
+
const url = `${this.baseUrl}/api${path}`;
|
|
93
|
+
const authHeaders = { "Authorization": `Bearer ${this.apiKey}` };
|
|
94
|
+
if (this.appId) authHeaders["x-app-id"] = this.appId;
|
|
95
|
+
const response = await fetch(url, {
|
|
96
|
+
method,
|
|
97
|
+
headers: authHeaders,
|
|
98
|
+
body: form
|
|
99
|
+
});
|
|
100
|
+
return this.handleResponse(response);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Make a raw request and return the Response object directly.
|
|
104
|
+
* Used for streaming (SSE) endpoints.
|
|
105
|
+
*/
|
|
106
|
+
async requestRaw(method, path, body) {
|
|
107
|
+
const url = `${this.baseUrl}/api${path}`;
|
|
108
|
+
return fetch(url, {
|
|
109
|
+
method,
|
|
110
|
+
headers: this.getHeaders(),
|
|
111
|
+
body: body !== void 0 ? JSON.stringify(body) : void 0
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// src/v1/modules/v1Chat.ts
|
|
117
|
+
var V1ChatModule = class {
|
|
118
|
+
constructor(client) {
|
|
119
|
+
this.client = client;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Stream a chat response for a workspace default thread.
|
|
123
|
+
* @see POST /v1/workspace/{slug}/stream-chat
|
|
124
|
+
*/
|
|
125
|
+
// @streaming-stub — implement SSE parsing in overrides/v1ChatStreaming.ts
|
|
126
|
+
async streamWorkspaceChat(slug, body) {
|
|
127
|
+
return this.client.requestRaw("POST", `/v1/workspace/${slug}/stream-chat`, body);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Stream a chat response for a workspace thread.
|
|
131
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/stream-chat
|
|
132
|
+
*/
|
|
133
|
+
// @streaming-stub — implement SSE parsing in overrides/v1ChatStreaming.ts
|
|
134
|
+
async streamThreadChat(slug, threadSlug, body) {
|
|
135
|
+
return this.client.requestRaw("POST", `/v1/workspace/${slug}/thread/${threadSlug}/stream-chat`, body);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// src/v1/modules/v1Workspace.ts
|
|
140
|
+
var V1WorkspaceModule = class {
|
|
141
|
+
constructor(client) {
|
|
142
|
+
this.client = client;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* List workspaces using the app workspace list behavior.
|
|
146
|
+
* @see GET /v1/workspaces
|
|
147
|
+
*/
|
|
148
|
+
async listWorkspaces() {
|
|
149
|
+
return this.client.request("GET", `/v1/workspaces`);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Create a workspace using the app workspace creation behavior.
|
|
153
|
+
* @see POST /v1/workspace/new
|
|
154
|
+
*/
|
|
155
|
+
async createWorkspace(body) {
|
|
156
|
+
return this.client.request("POST", `/v1/workspace/new`, body);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Search workspaces and threads.
|
|
160
|
+
* @see POST /v1/workspace/search
|
|
161
|
+
*/
|
|
162
|
+
async searchWorkspaces(body) {
|
|
163
|
+
return this.client.request("POST", `/v1/workspace/search`, body);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get a workspace by slug.
|
|
167
|
+
* @see GET /v1/workspace/{slug}
|
|
168
|
+
*/
|
|
169
|
+
async getWorkspace(slug) {
|
|
170
|
+
return this.client.request("GET", `/v1/workspace/${slug}`);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Delete a workspace.
|
|
174
|
+
* @see DELETE /v1/workspace/{slug}
|
|
175
|
+
*/
|
|
176
|
+
async deleteWorkspace(slug) {
|
|
177
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}`);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Get document content for a workspace document.
|
|
181
|
+
* @see GET /v1/workspace/{slug}/document/{docPath}
|
|
182
|
+
*/
|
|
183
|
+
async getWorkspaceDocument(slug, docPath) {
|
|
184
|
+
return this.client.request("GET", `/v1/workspace/${slug}/document/${docPath}`);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get or create workspace config.
|
|
188
|
+
* @see GET /v1/workspace/{slug}/config
|
|
189
|
+
*/
|
|
190
|
+
async getWorkspaceConfig(slug) {
|
|
191
|
+
return this.client.request("GET", `/v1/workspace/${slug}/config`);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Update workspace config.
|
|
195
|
+
* @see POST /v1/workspace/{slug}/config
|
|
196
|
+
*/
|
|
197
|
+
async updateWorkspaceConfig(slug, body) {
|
|
198
|
+
return this.client.request("POST", `/v1/workspace/${slug}/config`, body);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Update workspace settings by slug.
|
|
202
|
+
* @see POST /v1/workspace/{slug}/update
|
|
203
|
+
*/
|
|
204
|
+
async updateWorkspace(slug, body) {
|
|
205
|
+
return this.client.request("POST", `/v1/workspace/${slug}/update`, body);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Generate a local LLM tuning suggestion.
|
|
209
|
+
* @see POST /v1/workspace/{slug}/local-llm-tuning-suggestion
|
|
210
|
+
*/
|
|
211
|
+
async suggestWorkspaceLocalLlmTuning(slug, body) {
|
|
212
|
+
return this.client.request("POST", `/v1/workspace/${slug}/local-llm-tuning-suggestion`, body);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Upload a document to workspace documents.
|
|
216
|
+
* @see POST /v1/workspace/{slug}/upload
|
|
217
|
+
*/
|
|
218
|
+
// @upload-stub — multipart upload; wire form manually or use helper
|
|
219
|
+
async uploadWorkspaceDocument(slug, form) {
|
|
220
|
+
return this.client.requestMultipart("POST", `/v1/workspace/${slug}/upload`, form);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Upload a link to workspace documents.
|
|
224
|
+
* @see POST /v1/workspace/{slug}/upload-link
|
|
225
|
+
*/
|
|
226
|
+
async uploadWorkspaceLink(slug, body) {
|
|
227
|
+
return this.client.request("POST", `/v1/workspace/${slug}/upload-link`, body);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Update workspace document embeddings.
|
|
231
|
+
* @see POST /v1/workspace/{slug}/update-embeddings
|
|
232
|
+
*/
|
|
233
|
+
async updateWorkspaceEmbeddings(slug, body) {
|
|
234
|
+
return this.client.request("POST", `/v1/workspace/${slug}/update-embeddings`, body);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Reset workspace vector database records.
|
|
238
|
+
* @see DELETE /v1/workspace/{slug}/reset-vector-db
|
|
239
|
+
*/
|
|
240
|
+
async resetWorkspaceVectorDb(slug) {
|
|
241
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/reset-vector-db`);
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Get workspace LLM provider metadata.
|
|
245
|
+
* @see GET /v1/workspace/{slug}/llm-provider
|
|
246
|
+
*/
|
|
247
|
+
async getWorkspaceLlmProvider(slug) {
|
|
248
|
+
return this.client.request("GET", `/v1/workspace/${slug}/llm-provider`);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Get workspace vision availability.
|
|
252
|
+
* @see GET /v1/workspace/{slug}/vision-availability
|
|
253
|
+
*/
|
|
254
|
+
async getWorkspaceVisionAvailability(slug) {
|
|
255
|
+
return this.client.request("GET", `/v1/workspace/${slug}/vision-availability`);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Get workspace chats.
|
|
259
|
+
* @see GET /v1/workspace/{slug}/chats
|
|
260
|
+
*/
|
|
261
|
+
async getWorkspaceChats(slug) {
|
|
262
|
+
return this.client.request("GET", `/v1/workspace/${slug}/chats`);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Get workspace terminal session details.
|
|
266
|
+
* @see GET /v1/workspace/{slug}/terminal-session-details
|
|
267
|
+
*/
|
|
268
|
+
async getWorkspaceTerminalSessionDetails(slug) {
|
|
269
|
+
return this.client.request("GET", `/v1/workspace/${slug}/terminal-session-details`);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Persist terminal UI events.
|
|
273
|
+
* @see POST /v1/workspace/{slug}/terminal-ui-events
|
|
274
|
+
*/
|
|
275
|
+
async persistWorkspaceTerminalUiEvents(slug, body) {
|
|
276
|
+
return this.client.request("POST", `/v1/workspace/${slug}/terminal-ui-events`, body);
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Persist a linked terminal message.
|
|
280
|
+
* @see POST /v1/workspace/{slug}/linked-terminal-message
|
|
281
|
+
*/
|
|
282
|
+
async createWorkspaceLinkedTerminalMessage(slug, body) {
|
|
283
|
+
return this.client.request("POST", `/v1/workspace/${slug}/linked-terminal-message`, body);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Delete selected workspace chats.
|
|
287
|
+
* @see DELETE /v1/workspace/{slug}/delete-chats
|
|
288
|
+
*/
|
|
289
|
+
async deleteWorkspaceChats(slug, body) {
|
|
290
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/delete-chats`, body);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Delete edited workspace chats from a starting id.
|
|
294
|
+
* @see DELETE /v1/workspace/{slug}/delete-edited-chats
|
|
295
|
+
*/
|
|
296
|
+
async deleteEditedWorkspaceChats(slug, body) {
|
|
297
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/delete-edited-chats`, body);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Update a workspace chat response.
|
|
301
|
+
* @see POST /v1/workspace/{slug}/update-chat
|
|
302
|
+
*/
|
|
303
|
+
async updateWorkspaceChat(slug, body) {
|
|
304
|
+
return this.client.request("POST", `/v1/workspace/${slug}/update-chat`, body);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Update workspace chat feedback.
|
|
308
|
+
* @see POST /v1/workspace/{slug}/chat-feedback/{chatId}
|
|
309
|
+
*/
|
|
310
|
+
async updateWorkspaceChatFeedback(slug, chatId, body) {
|
|
311
|
+
return this.client.request("POST", `/v1/workspace/${slug}/chat-feedback/${chatId}`, body);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Get suggested messages for a workspace.
|
|
315
|
+
* @see GET /v1/workspace/{slug}/suggested-messages
|
|
316
|
+
*/
|
|
317
|
+
async getWorkspaceSuggestedMessages(slug) {
|
|
318
|
+
return this.client.request("GET", `/v1/workspace/${slug}/suggested-messages`);
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Save suggested messages for a workspace.
|
|
322
|
+
* @see POST /v1/workspace/{slug}/suggested-messages
|
|
323
|
+
*/
|
|
324
|
+
async saveWorkspaceSuggestedMessages(slug, body) {
|
|
325
|
+
return this.client.request("POST", `/v1/workspace/${slug}/suggested-messages`, body);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Update workspace document pin status.
|
|
329
|
+
* @see POST /v1/workspace/{slug}/update-pin
|
|
330
|
+
*/
|
|
331
|
+
async updateWorkspaceDocumentPin(slug, body) {
|
|
332
|
+
return this.client.request("POST", `/v1/workspace/${slug}/update-pin`, body);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Generate text-to-speech audio for a workspace chat.
|
|
336
|
+
* @see GET /v1/workspace/{slug}/tts/{chatId}
|
|
337
|
+
*/
|
|
338
|
+
async getWorkspaceChatTts(slug, chatId) {
|
|
339
|
+
return this.client.request("GET", `/v1/workspace/${slug}/tts/${chatId}`);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Get a workspace profile picture.
|
|
343
|
+
* @see GET /v1/workspace/{slug}/pfp
|
|
344
|
+
*/
|
|
345
|
+
async getWorkspaceProfilePicture(slug) {
|
|
346
|
+
return this.client.request("GET", `/v1/workspace/${slug}/pfp`);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Upload a workspace profile picture.
|
|
350
|
+
* @see POST /v1/workspace/{slug}/upload-pfp
|
|
351
|
+
*/
|
|
352
|
+
// @upload-stub — multipart upload; wire form manually or use helper
|
|
353
|
+
async uploadWorkspaceProfilePicture(slug, form) {
|
|
354
|
+
return this.client.requestMultipart("POST", `/v1/workspace/${slug}/upload-pfp`, form);
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Remove a workspace profile picture.
|
|
358
|
+
* @see DELETE /v1/workspace/{slug}/remove-pfp
|
|
359
|
+
*/
|
|
360
|
+
async removeWorkspaceProfilePicture(slug) {
|
|
361
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/remove-pfp`);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Fork the workspace default thread.
|
|
365
|
+
* @see POST /v1/workspace/{slug}/thread/fork
|
|
366
|
+
*/
|
|
367
|
+
async forkThread(slug, body) {
|
|
368
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/fork`, body);
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Hide a workspace chat.
|
|
372
|
+
* @see PUT /v1/workspace/workspace-chats/{id}
|
|
373
|
+
*/
|
|
374
|
+
async hideWorkspaceChat(id) {
|
|
375
|
+
return this.client.request("PUT", `/v1/workspace/workspace-chats/${id}`);
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Upload and embed a document.
|
|
379
|
+
* @see POST /v1/workspace/{slug}/upload-and-embed
|
|
380
|
+
*/
|
|
381
|
+
// @upload-stub — multipart upload; wire form manually or use helper
|
|
382
|
+
async uploadAndEmbedWorkspaceDocument(slug, form) {
|
|
383
|
+
return this.client.requestMultipart("POST", `/v1/workspace/${slug}/upload-and-embed`, form);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Remove and unembed a document.
|
|
387
|
+
* @see DELETE /v1/workspace/{slug}/remove-and-unembed
|
|
388
|
+
*/
|
|
389
|
+
async removeAndUnembedWorkspaceDocument(slug, body) {
|
|
390
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/remove-and-unembed`, body);
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Get workspace prompt history.
|
|
394
|
+
* @see GET /v1/workspace/{slug}/prompt-history
|
|
395
|
+
*/
|
|
396
|
+
async getWorkspacePromptHistory(slug) {
|
|
397
|
+
return this.client.request("GET", `/v1/workspace/${slug}/prompt-history`);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Clear workspace prompt history.
|
|
401
|
+
* @see DELETE /v1/workspace/{slug}/prompt-history
|
|
402
|
+
*/
|
|
403
|
+
async deleteWorkspacePromptHistory(slug) {
|
|
404
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/prompt-history`);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Delete a workspace prompt history entry.
|
|
408
|
+
* @see DELETE /v1/workspace/{slug}/prompt-history/{id}
|
|
409
|
+
*/
|
|
410
|
+
async deleteWorkspacePromptHistoryEntry(slug, id) {
|
|
411
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/prompt-history/${id}`);
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Validate search provider configuration.
|
|
415
|
+
* @see POST /v1/workspace/{slug}/search/validate
|
|
416
|
+
*/
|
|
417
|
+
async validateWorkspaceSearchProvider(slug, body) {
|
|
418
|
+
return this.client.request("POST", `/v1/workspace/${slug}/search/validate`, body);
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// src/v1/modules/v1Thread.ts
|
|
423
|
+
var V1ThreadModule = class {
|
|
424
|
+
constructor(client) {
|
|
425
|
+
this.client = client;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Create a workspace thread.
|
|
429
|
+
* @see POST /v1/workspace/{slug}/thread/new
|
|
430
|
+
*/
|
|
431
|
+
async createThread(slug) {
|
|
432
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/new`);
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* List workspace threads.
|
|
436
|
+
* @see GET /v1/workspace/{slug}/threads
|
|
437
|
+
*/
|
|
438
|
+
async listThreads(slug) {
|
|
439
|
+
return this.client.request("GET", `/v1/workspace/${slug}/threads`);
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Open an SSE stream for workspace thread events.
|
|
443
|
+
* @see GET /v1/workspace/{slug}/thread-events
|
|
444
|
+
*/
|
|
445
|
+
async openThreadEventsStream(slug) {
|
|
446
|
+
return this.client.request("GET", `/v1/workspace/${slug}/thread-events`);
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Get a workspace thread.
|
|
450
|
+
* @see GET /v1/workspace/{slug}/thread/{threadSlug}
|
|
451
|
+
*/
|
|
452
|
+
async getThread(slug, threadSlug) {
|
|
453
|
+
return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}`);
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Delete a workspace thread.
|
|
457
|
+
* @see DELETE /v1/workspace/{slug}/thread/{threadSlug}
|
|
458
|
+
*/
|
|
459
|
+
async deleteThread(slug, threadSlug) {
|
|
460
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/thread/${threadSlug}`);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Get thread vision availability.
|
|
464
|
+
* @see GET /v1/workspace/{slug}/thread/{threadSlug}/vision-availability
|
|
465
|
+
*/
|
|
466
|
+
async getThreadVisionAvailability(slug, threadSlug) {
|
|
467
|
+
return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/vision-availability`);
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Promote a thread into a tracked goal.
|
|
471
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/goal
|
|
472
|
+
*/
|
|
473
|
+
async createThreadGoal(slug, threadSlug, body) {
|
|
474
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/goal`, body);
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Draft a terminal goal for a workspace.
|
|
478
|
+
* @see POST /v1/workspace/{slug}/terminal-goal-draft
|
|
479
|
+
*/
|
|
480
|
+
async draftWorkspaceTerminalGoal(slug, body) {
|
|
481
|
+
return this.client.request("POST", `/v1/workspace/${slug}/terminal-goal-draft`, body);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Create a terminal goal for a workspace.
|
|
485
|
+
* @see POST /v1/workspace/{slug}/terminal-goal
|
|
486
|
+
*/
|
|
487
|
+
async createWorkspaceTerminalGoal(slug, body) {
|
|
488
|
+
return this.client.request("POST", `/v1/workspace/${slug}/terminal-goal`, body);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Draft a terminal goal for a workspace thread.
|
|
492
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-goal-draft
|
|
493
|
+
*/
|
|
494
|
+
async draftThreadTerminalGoal(slug, threadSlug, body) {
|
|
495
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-goal-draft`, body);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Create a terminal goal for a workspace thread.
|
|
499
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-goal
|
|
500
|
+
*/
|
|
501
|
+
async createThreadTerminalGoal(slug, threadSlug, body) {
|
|
502
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-goal`, body);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Bulk delete workspace threads.
|
|
506
|
+
* @see DELETE /v1/workspace/{slug}/thread-bulk-delete
|
|
507
|
+
*/
|
|
508
|
+
async bulkDeleteThreads(slug, body) {
|
|
509
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/thread-bulk-delete`, body);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Get workspace thread chats.
|
|
513
|
+
* @see GET /v1/workspace/{slug}/thread/{threadSlug}/chats
|
|
514
|
+
*/
|
|
515
|
+
async getThreadChats(slug, threadSlug) {
|
|
516
|
+
return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/chats`);
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Get thread terminal session details.
|
|
520
|
+
* @see GET /v1/workspace/{slug}/thread/{threadSlug}/terminal-session-details
|
|
521
|
+
*/
|
|
522
|
+
async getThreadTerminalSessionDetails(slug, threadSlug) {
|
|
523
|
+
return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-session-details`);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Update a workspace thread.
|
|
527
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/update
|
|
528
|
+
*/
|
|
529
|
+
async updateThread(slug, threadSlug, body) {
|
|
530
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/update`, body);
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Delete edited chats from a thread.
|
|
534
|
+
* @see DELETE /v1/workspace/{slug}/thread/{threadSlug}/delete-edited-chats
|
|
535
|
+
*/
|
|
536
|
+
async deleteEditedThreadChats(slug, threadSlug, body) {
|
|
537
|
+
return this.client.request("DELETE", `/v1/workspace/${slug}/thread/${threadSlug}/delete-edited-chats`, body);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Update a thread chat response.
|
|
541
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/update-chat
|
|
542
|
+
*/
|
|
543
|
+
async updateThreadChat(slug, threadSlug, body) {
|
|
544
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/update-chat`, body);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Persist terminal UI events for a workspace thread.
|
|
548
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/terminal-ui-events
|
|
549
|
+
*/
|
|
550
|
+
async persistThreadTerminalUiEvents(slug, threadSlug, body) {
|
|
551
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/terminal-ui-events`, body);
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Persist a linked terminal message for a workspace thread.
|
|
555
|
+
* @see POST /v1/workspace/{slug}/thread/{threadSlug}/linked-terminal-message
|
|
556
|
+
*/
|
|
557
|
+
async createThreadLinkedTerminalMessage(slug, threadSlug, body) {
|
|
558
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/${threadSlug}/linked-terminal-message`, body);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Coordinate a task into a workspace thread.
|
|
562
|
+
* @see POST /v1/workspace/{slug}/thread/coordinate-task
|
|
563
|
+
*/
|
|
564
|
+
async coordinateThreadTask(slug, body) {
|
|
565
|
+
return this.client.request("POST", `/v1/workspace/${slug}/thread/coordinate-task`, body);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Open an SSE stream for external workspace thread chat events.
|
|
569
|
+
* @see GET /v1/workspace/{slug}/thread/{threadSlug}/chat-stream
|
|
570
|
+
*/
|
|
571
|
+
async openThreadChatStream(slug, threadSlug) {
|
|
572
|
+
return this.client.request("GET", `/v1/workspace/${slug}/thread/${threadSlug}/chat-stream`);
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
// src/v1/namespace.ts
|
|
577
|
+
var V1ApiNamespace = class {
|
|
578
|
+
// [GENERATED-PROPS-END]
|
|
579
|
+
constructor(baseUrl, apiKey, appId) {
|
|
580
|
+
this._client = new DeveloperApiClient(baseUrl, apiKey, appId);
|
|
581
|
+
this.chat = new V1ChatModule(this._client);
|
|
582
|
+
this.workspace = new V1WorkspaceModule(this._client);
|
|
583
|
+
this.thread = new V1ThreadModule(this._client);
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
export {
|
|
588
|
+
DeveloperApiError,
|
|
589
|
+
AuthenticationError,
|
|
590
|
+
NotFoundError,
|
|
591
|
+
ValidationError,
|
|
592
|
+
ServerError,
|
|
593
|
+
DeveloperApiClient,
|
|
594
|
+
V1ChatModule,
|
|
595
|
+
V1WorkspaceModule,
|
|
596
|
+
V1ThreadModule,
|
|
597
|
+
V1ApiNamespace
|
|
598
|
+
};
|