@llmsafespaces/sdk 0.13.0 → 0.14.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.
- package/dist/index.cjs +24 -0
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +24 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -258,6 +258,18 @@ var WorkspacesAPI = class {
|
|
|
258
258
|
deleteEnv(id, varName) {
|
|
259
259
|
return this.client.request("DELETE", `/workspaces/${id}/env/${varName}`);
|
|
260
260
|
}
|
|
261
|
+
setDevPreview(id, enabled) {
|
|
262
|
+
return this.client.request("PUT", `/workspaces/${id}/dev-preview`, { enabled });
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Returns the URL to open the dev-preview proxy in a browser.
|
|
266
|
+
* The URL is authenticated via session cookie; no token in the URL.
|
|
267
|
+
* The dev server must be running on `port` inside the workspace.
|
|
268
|
+
*/
|
|
269
|
+
devPreviewUrl(id, port, path = "/") {
|
|
270
|
+
const p = path.startsWith("/") ? path : `/${path}`;
|
|
271
|
+
return `${this.client.baseUrl}/api/v1/workspaces/${id}/dev-preview/${port}${p}`;
|
|
272
|
+
}
|
|
261
273
|
};
|
|
262
274
|
var SessionsAPI = class {
|
|
263
275
|
constructor(client) {
|
|
@@ -302,9 +314,21 @@ var SessionsAPI = class {
|
|
|
302
314
|
enqueue(workspaceId, sessionId, text) {
|
|
303
315
|
return this.client.request("POST", `/workspaces/${workspaceId}/sessions/${sessionId}/queue`, { text });
|
|
304
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* @deprecated Under the V2 session-queue model (Epic 63), the queue is
|
|
319
|
+
* inboard in opencode and this endpoint returns a best-effort shadow
|
|
320
|
+
* derived from SSE events. Subscribe to the workspace SSE stream and
|
|
321
|
+
* track `queue.update` events instead. Removed in next major.
|
|
322
|
+
*/
|
|
305
323
|
listQueue(workspaceId, sessionId) {
|
|
306
324
|
return this.client.request("GET", `/workspaces/${workspaceId}/sessions/${sessionId}/queue`);
|
|
307
325
|
}
|
|
326
|
+
/**
|
|
327
|
+
* @deprecated Under the V2 session-queue model (Epic 63), abort is
|
|
328
|
+
* non-destructive and queued messages survive. This removes from the
|
|
329
|
+
* best-effort shadow only; it does not revoke the durable input.
|
|
330
|
+
* Removed in next major.
|
|
331
|
+
*/
|
|
308
332
|
dismissQueued(workspaceId, sessionId, messageId) {
|
|
309
333
|
return this.client.request("DELETE", `/workspaces/${workspaceId}/sessions/${sessionId}/queue/${messageId}`);
|
|
310
334
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -182,6 +182,13 @@ interface UpdateProviderCredentialRequest {
|
|
|
182
182
|
modelContextLimits?: Record<string, number>;
|
|
183
183
|
modelOutputLimits?: Record<string, number>;
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* A message waiting in the session queue.
|
|
187
|
+
*
|
|
188
|
+
* Under the V2 session-queue model (Epic 63), this is a best-effort shadow
|
|
189
|
+
* derived from SSE events. `retry_count` is vestigial (V2 has no retry —
|
|
190
|
+
* opencode handles durability internally).
|
|
191
|
+
*/
|
|
185
192
|
interface QueuedMessage {
|
|
186
193
|
id: string;
|
|
187
194
|
text: string;
|
|
@@ -192,7 +199,7 @@ interface QueuedMessage {
|
|
|
192
199
|
}
|
|
193
200
|
|
|
194
201
|
declare class LLMSafeSpaces {
|
|
195
|
-
|
|
202
|
+
readonly baseUrl: string;
|
|
196
203
|
private readonly timeout;
|
|
197
204
|
private readonly fetchFn;
|
|
198
205
|
private token;
|
|
@@ -255,6 +262,13 @@ declare class WorkspacesAPI {
|
|
|
255
262
|
vars: string[];
|
|
256
263
|
}>;
|
|
257
264
|
deleteEnv(id: string, varName: string): Promise<void>;
|
|
265
|
+
setDevPreview(id: string, enabled: boolean): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Returns the URL to open the dev-preview proxy in a browser.
|
|
268
|
+
* The URL is authenticated via session cookie; no token in the URL.
|
|
269
|
+
* The dev server must be running on `port` inside the workspace.
|
|
270
|
+
*/
|
|
271
|
+
devPreviewUrl(id: string, port: number, path?: string): string;
|
|
258
272
|
}
|
|
259
273
|
declare class SessionsAPI {
|
|
260
274
|
private client;
|
|
@@ -272,9 +286,21 @@ declare class SessionsAPI {
|
|
|
272
286
|
enqueue(workspaceId: string, sessionId: string, text: string): Promise<{
|
|
273
287
|
messageID: string;
|
|
274
288
|
}>;
|
|
289
|
+
/**
|
|
290
|
+
* @deprecated Under the V2 session-queue model (Epic 63), the queue is
|
|
291
|
+
* inboard in opencode and this endpoint returns a best-effort shadow
|
|
292
|
+
* derived from SSE events. Subscribe to the workspace SSE stream and
|
|
293
|
+
* track `queue.update` events instead. Removed in next major.
|
|
294
|
+
*/
|
|
275
295
|
listQueue(workspaceId: string, sessionId: string): Promise<{
|
|
276
296
|
messages: QueuedMessage[];
|
|
277
297
|
}>;
|
|
298
|
+
/**
|
|
299
|
+
* @deprecated Under the V2 session-queue model (Epic 63), abort is
|
|
300
|
+
* non-destructive and queued messages survive. This removes from the
|
|
301
|
+
* best-effort shadow only; it does not revoke the durable input.
|
|
302
|
+
* Removed in next major.
|
|
303
|
+
*/
|
|
278
304
|
dismissQueued(workspaceId: string, sessionId: string, messageId: string): Promise<void>;
|
|
279
305
|
markSeen(workspaceId: string, sessionId: string): Promise<void>;
|
|
280
306
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -182,6 +182,13 @@ interface UpdateProviderCredentialRequest {
|
|
|
182
182
|
modelContextLimits?: Record<string, number>;
|
|
183
183
|
modelOutputLimits?: Record<string, number>;
|
|
184
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* A message waiting in the session queue.
|
|
187
|
+
*
|
|
188
|
+
* Under the V2 session-queue model (Epic 63), this is a best-effort shadow
|
|
189
|
+
* derived from SSE events. `retry_count` is vestigial (V2 has no retry —
|
|
190
|
+
* opencode handles durability internally).
|
|
191
|
+
*/
|
|
185
192
|
interface QueuedMessage {
|
|
186
193
|
id: string;
|
|
187
194
|
text: string;
|
|
@@ -192,7 +199,7 @@ interface QueuedMessage {
|
|
|
192
199
|
}
|
|
193
200
|
|
|
194
201
|
declare class LLMSafeSpaces {
|
|
195
|
-
|
|
202
|
+
readonly baseUrl: string;
|
|
196
203
|
private readonly timeout;
|
|
197
204
|
private readonly fetchFn;
|
|
198
205
|
private token;
|
|
@@ -255,6 +262,13 @@ declare class WorkspacesAPI {
|
|
|
255
262
|
vars: string[];
|
|
256
263
|
}>;
|
|
257
264
|
deleteEnv(id: string, varName: string): Promise<void>;
|
|
265
|
+
setDevPreview(id: string, enabled: boolean): Promise<void>;
|
|
266
|
+
/**
|
|
267
|
+
* Returns the URL to open the dev-preview proxy in a browser.
|
|
268
|
+
* The URL is authenticated via session cookie; no token in the URL.
|
|
269
|
+
* The dev server must be running on `port` inside the workspace.
|
|
270
|
+
*/
|
|
271
|
+
devPreviewUrl(id: string, port: number, path?: string): string;
|
|
258
272
|
}
|
|
259
273
|
declare class SessionsAPI {
|
|
260
274
|
private client;
|
|
@@ -272,9 +286,21 @@ declare class SessionsAPI {
|
|
|
272
286
|
enqueue(workspaceId: string, sessionId: string, text: string): Promise<{
|
|
273
287
|
messageID: string;
|
|
274
288
|
}>;
|
|
289
|
+
/**
|
|
290
|
+
* @deprecated Under the V2 session-queue model (Epic 63), the queue is
|
|
291
|
+
* inboard in opencode and this endpoint returns a best-effort shadow
|
|
292
|
+
* derived from SSE events. Subscribe to the workspace SSE stream and
|
|
293
|
+
* track `queue.update` events instead. Removed in next major.
|
|
294
|
+
*/
|
|
275
295
|
listQueue(workspaceId: string, sessionId: string): Promise<{
|
|
276
296
|
messages: QueuedMessage[];
|
|
277
297
|
}>;
|
|
298
|
+
/**
|
|
299
|
+
* @deprecated Under the V2 session-queue model (Epic 63), abort is
|
|
300
|
+
* non-destructive and queued messages survive. This removes from the
|
|
301
|
+
* best-effort shadow only; it does not revoke the durable input.
|
|
302
|
+
* Removed in next major.
|
|
303
|
+
*/
|
|
278
304
|
dismissQueued(workspaceId: string, sessionId: string, messageId: string): Promise<void>;
|
|
279
305
|
markSeen(workspaceId: string, sessionId: string): Promise<void>;
|
|
280
306
|
}
|
package/dist/index.js
CHANGED
|
@@ -225,6 +225,18 @@ var WorkspacesAPI = class {
|
|
|
225
225
|
deleteEnv(id, varName) {
|
|
226
226
|
return this.client.request("DELETE", `/workspaces/${id}/env/${varName}`);
|
|
227
227
|
}
|
|
228
|
+
setDevPreview(id, enabled) {
|
|
229
|
+
return this.client.request("PUT", `/workspaces/${id}/dev-preview`, { enabled });
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Returns the URL to open the dev-preview proxy in a browser.
|
|
233
|
+
* The URL is authenticated via session cookie; no token in the URL.
|
|
234
|
+
* The dev server must be running on `port` inside the workspace.
|
|
235
|
+
*/
|
|
236
|
+
devPreviewUrl(id, port, path = "/") {
|
|
237
|
+
const p = path.startsWith("/") ? path : `/${path}`;
|
|
238
|
+
return `${this.client.baseUrl}/api/v1/workspaces/${id}/dev-preview/${port}${p}`;
|
|
239
|
+
}
|
|
228
240
|
};
|
|
229
241
|
var SessionsAPI = class {
|
|
230
242
|
constructor(client) {
|
|
@@ -269,9 +281,21 @@ var SessionsAPI = class {
|
|
|
269
281
|
enqueue(workspaceId, sessionId, text) {
|
|
270
282
|
return this.client.request("POST", `/workspaces/${workspaceId}/sessions/${sessionId}/queue`, { text });
|
|
271
283
|
}
|
|
284
|
+
/**
|
|
285
|
+
* @deprecated Under the V2 session-queue model (Epic 63), the queue is
|
|
286
|
+
* inboard in opencode and this endpoint returns a best-effort shadow
|
|
287
|
+
* derived from SSE events. Subscribe to the workspace SSE stream and
|
|
288
|
+
* track `queue.update` events instead. Removed in next major.
|
|
289
|
+
*/
|
|
272
290
|
listQueue(workspaceId, sessionId) {
|
|
273
291
|
return this.client.request("GET", `/workspaces/${workspaceId}/sessions/${sessionId}/queue`);
|
|
274
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* @deprecated Under the V2 session-queue model (Epic 63), abort is
|
|
295
|
+
* non-destructive and queued messages survive. This removes from the
|
|
296
|
+
* best-effort shadow only; it does not revoke the durable input.
|
|
297
|
+
* Removed in next major.
|
|
298
|
+
*/
|
|
275
299
|
dismissQueued(workspaceId, sessionId, messageId) {
|
|
276
300
|
return this.client.request("DELETE", `/workspaces/${workspaceId}/sessions/${sessionId}/queue/${messageId}`);
|
|
277
301
|
}
|