veryfront 0.1.276 → 0.1.278
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/esm/deno.js +2 -1
- package/esm/src/sandbox/sandbox.d.ts +3 -1
- package/esm/src/sandbox/sandbox.d.ts.map +1 -1
- package/esm/src/sandbox/sandbox.js +12 -2
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/deno.js +2 -1
- package/src/src/sandbox/sandbox.ts +17 -3
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LazySandbox, type LazySandboxOptions } from "./lazy-sandbox.js";
|
|
2
|
-
/** Options for command execution: working directory, timeout, and
|
|
2
|
+
/** Options for command execution: working directory, timeout, environment variables, and optional project reference. */
|
|
3
3
|
export interface ExecOptions {
|
|
4
4
|
/** Working directory for the command. */
|
|
5
5
|
cwd?: string;
|
|
@@ -7,6 +7,8 @@ export interface ExecOptions {
|
|
|
7
7
|
timeout_seconds?: number;
|
|
8
8
|
/** Additional environment variables for the command. */
|
|
9
9
|
env?: Record<string, string>;
|
|
10
|
+
/** Optional project reference forwarded to sandbox command surfaces that support project-scoped execution. */
|
|
11
|
+
projectReference?: string;
|
|
10
12
|
}
|
|
11
13
|
/** Options for creating a sandbox session. */
|
|
12
14
|
export interface SandboxOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/sandbox.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../src/src/sandbox/sandbox.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAA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;IACtC,eAAe,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAgB9C,mCAAmC;IAC7B,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAe1D,OAAO,CAAC,MAAM,CAAC,aAAa;IAe5B,gDAAgD;IAC1C,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAahC,uDAAuD;IACjD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAa5B,0BAA0B;IAC1B,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,oCAAoC;IACpC,IAAI,GAAG,IAAI,MAAM,CAEhB;CACF;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BhB"}
|
|
@@ -298,17 +298,27 @@ export class Sandbox {
|
|
|
298
298
|
}
|
|
299
299
|
/** Send a heartbeat to prevent idle timeout. */
|
|
300
300
|
async heartbeat() {
|
|
301
|
-
await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}/heartbeat`, {
|
|
301
|
+
const res = await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}/heartbeat`, {
|
|
302
302
|
method: "POST",
|
|
303
303
|
headers: { Authorization: `Bearer ${this.authToken}` },
|
|
304
304
|
});
|
|
305
|
+
if (!res.ok) {
|
|
306
|
+
throw REQUEST_ERROR.create({
|
|
307
|
+
detail: `Sandbox heartbeat failed: ${res.status} ${await res.text()}`,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
305
310
|
}
|
|
306
311
|
/** Close the sandbox session and mark for deletion. */
|
|
307
312
|
async close() {
|
|
308
|
-
await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}`, {
|
|
313
|
+
const res = await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}`, {
|
|
309
314
|
method: "DELETE",
|
|
310
315
|
headers: { Authorization: `Bearer ${this.authToken}` },
|
|
311
316
|
});
|
|
317
|
+
if (!res.ok) {
|
|
318
|
+
throw REQUEST_ERROR.create({
|
|
319
|
+
detail: `Close sandbox failed: ${res.status} ${await res.text()}`,
|
|
320
|
+
});
|
|
321
|
+
}
|
|
312
322
|
}
|
|
313
323
|
/** Get the session ID. */
|
|
314
324
|
get id() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.278";
|
|
2
2
|
//# sourceMappingURL=version-constant.d.ts.map
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -20,7 +20,7 @@ import { getVeryfrontCloudAuthToken } from "../platform/cloud/resolver.js";
|
|
|
20
20
|
import { getHostEnv } from "../platform/compat/process.js";
|
|
21
21
|
import { LazySandbox, type LazySandboxOptions } from "./lazy-sandbox.js";
|
|
22
22
|
|
|
23
|
-
/** Options for command execution: working directory, timeout, and
|
|
23
|
+
/** Options for command execution: working directory, timeout, environment variables, and optional project reference. */
|
|
24
24
|
export interface ExecOptions {
|
|
25
25
|
/** Working directory for the command. */
|
|
26
26
|
cwd?: string;
|
|
@@ -28,6 +28,8 @@ export interface ExecOptions {
|
|
|
28
28
|
timeout_seconds?: number;
|
|
29
29
|
/** Additional environment variables for the command. */
|
|
30
30
|
env?: Record<string, string>;
|
|
31
|
+
/** Optional project reference forwarded to sandbox command surfaces that support project-scoped execution. */
|
|
32
|
+
projectReference?: string;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
/** Options for creating a sandbox session. */
|
|
@@ -457,18 +459,30 @@ export class Sandbox {
|
|
|
457
459
|
|
|
458
460
|
/** Send a heartbeat to prevent idle timeout. */
|
|
459
461
|
async heartbeat(): Promise<void> {
|
|
460
|
-
await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}/heartbeat`, {
|
|
462
|
+
const res = await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}/heartbeat`, {
|
|
461
463
|
method: "POST",
|
|
462
464
|
headers: { Authorization: `Bearer ${this.authToken}` },
|
|
463
465
|
});
|
|
466
|
+
|
|
467
|
+
if (!res.ok) {
|
|
468
|
+
throw REQUEST_ERROR.create({
|
|
469
|
+
detail: `Sandbox heartbeat failed: ${res.status} ${await res.text()}`,
|
|
470
|
+
});
|
|
471
|
+
}
|
|
464
472
|
}
|
|
465
473
|
|
|
466
474
|
/** Close the sandbox session and mark for deletion. */
|
|
467
475
|
async close(): Promise<void> {
|
|
468
|
-
await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}`, {
|
|
476
|
+
const res = await fetch(`${this.apiUrl}/sandbox-sessions/${this.sessionId}`, {
|
|
469
477
|
method: "DELETE",
|
|
470
478
|
headers: { Authorization: `Bearer ${this.authToken}` },
|
|
471
479
|
});
|
|
480
|
+
|
|
481
|
+
if (!res.ok) {
|
|
482
|
+
throw REQUEST_ERROR.create({
|
|
483
|
+
detail: `Close sandbox failed: ${res.status} ${await res.text()}`,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
472
486
|
}
|
|
473
487
|
|
|
474
488
|
/** Get the session ID. */
|