ppio-sandbox 2.1.0 → 2.1.1-a3
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-GOSA2RSG.mjs → chunk-2DT26FMV.mjs} +2 -2
- package/dist/{chunk-GFQFOIS4.mjs → chunk-ALX77S7W.mjs} +130 -117
- package/dist/chunk-ALX77S7W.mjs.map +1 -0
- package/dist/{chunk-NRVME35H.mjs → chunk-LMH22YPW.mjs} +2 -2
- package/dist/code-interpreter.js +133 -119
- package/dist/code-interpreter.js.map +1 -1
- package/dist/code-interpreter.mjs +2 -2
- package/dist/desktop.js +133 -119
- package/dist/desktop.js.map +1 -1
- package/dist/desktop.mjs +2 -2
- package/dist/index.js +133 -119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/sandbox-SMDAOO7A.mjs +8 -0
- package/dist/sandbox-TZ5BE2RX.mjs +8 -0
- package/package.json +1 -1
- package/dist/chunk-GFQFOIS4.mjs.map +0 -1
- package/dist/sandbox-7DONHEV2.mjs +0 -8
- package/dist/sandbox-FGY2BWMG.mjs +0 -8
- /package/dist/{chunk-GOSA2RSG.mjs.map → chunk-2DT26FMV.mjs.map} +0 -0
- /package/dist/{chunk-NRVME35H.mjs.map → chunk-LMH22YPW.mjs.map} +0 -0
- /package/dist/{sandbox-7DONHEV2.mjs.map → sandbox-SMDAOO7A.mjs.map} +0 -0
- /package/dist/{sandbox-FGY2BWMG.mjs.map → sandbox-TZ5BE2RX.mjs.map} +0 -0
package/dist/code-interpreter.js
CHANGED
|
@@ -80,7 +80,7 @@ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")])
|
|
|
80
80
|
var version;
|
|
81
81
|
var init_package = __esm({
|
|
82
82
|
"package.json"() {
|
|
83
|
-
version = "2.1.
|
|
83
|
+
version = "2.1.1-a3";
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
|
|
@@ -1580,7 +1580,7 @@ var init_filesystem = __esm({
|
|
|
1580
1580
|
this.defaultWatchRecursive = false;
|
|
1581
1581
|
this.rpc = (0, import_connect5.createClient)(Filesystem, transport);
|
|
1582
1582
|
}
|
|
1583
|
-
async read(
|
|
1583
|
+
async read(path3, opts) {
|
|
1584
1584
|
var _a3;
|
|
1585
1585
|
const format = (_a3 = opts == null ? void 0 : opts.format) != null ? _a3 : "text";
|
|
1586
1586
|
let user = opts == null ? void 0 : opts.user;
|
|
@@ -1594,7 +1594,7 @@ var init_filesystem = __esm({
|
|
|
1594
1594
|
const res = await this.envdApi.api.GET("/files", {
|
|
1595
1595
|
params: {
|
|
1596
1596
|
query: {
|
|
1597
|
-
path:
|
|
1597
|
+
path: path3,
|
|
1598
1598
|
username: user
|
|
1599
1599
|
}
|
|
1600
1600
|
},
|
|
@@ -1627,7 +1627,7 @@ var init_filesystem = __esm({
|
|
|
1627
1627
|
"Cannot specify both path and array of files. You have to specify either path and data for a single file or an array for multiple files."
|
|
1628
1628
|
);
|
|
1629
1629
|
}
|
|
1630
|
-
const { path:
|
|
1630
|
+
const { path: path3, writeOpts, writeFiles } = typeof pathOrFiles === "string" ? {
|
|
1631
1631
|
path: pathOrFiles,
|
|
1632
1632
|
writeOpts: opts,
|
|
1633
1633
|
writeFiles: [
|
|
@@ -1657,7 +1657,7 @@ var init_filesystem = __esm({
|
|
|
1657
1657
|
}
|
|
1658
1658
|
const uploadResults = await Promise.all(
|
|
1659
1659
|
writeFiles.map(async (file) => {
|
|
1660
|
-
const filePath =
|
|
1660
|
+
const filePath = path3 != null ? path3 : file.path;
|
|
1661
1661
|
const body = await toUploadBody(file.data, useGzip);
|
|
1662
1662
|
const res = await this.envdApi.api.POST("/files", {
|
|
1663
1663
|
params: {
|
|
@@ -1695,13 +1695,13 @@ var init_filesystem = __esm({
|
|
|
1695
1695
|
formData.append(
|
|
1696
1696
|
"file",
|
|
1697
1697
|
await toBlob(file.data),
|
|
1698
|
-
(_a3 = file.path) != null ? _a3 :
|
|
1698
|
+
(_a3 = file.path) != null ? _a3 : path3
|
|
1699
1699
|
);
|
|
1700
1700
|
}
|
|
1701
1701
|
const res = await this.envdApi.api.POST("/files", {
|
|
1702
1702
|
params: {
|
|
1703
1703
|
query: {
|
|
1704
|
-
path:
|
|
1704
|
+
path: path3,
|
|
1705
1705
|
username: user
|
|
1706
1706
|
}
|
|
1707
1707
|
},
|
|
@@ -1719,7 +1719,7 @@ var init_filesystem = __esm({
|
|
|
1719
1719
|
}
|
|
1720
1720
|
results.push(...files);
|
|
1721
1721
|
}
|
|
1722
|
-
return results.length === 1 &&
|
|
1722
|
+
return results.length === 1 && path3 ? results[0] : results;
|
|
1723
1723
|
}
|
|
1724
1724
|
/**
|
|
1725
1725
|
* Write multiple files.
|
|
@@ -1747,7 +1747,7 @@ var init_filesystem = __esm({
|
|
|
1747
1747
|
*
|
|
1748
1748
|
* @returns list of entries in the sandbox filesystem directory.
|
|
1749
1749
|
*/
|
|
1750
|
-
async list(
|
|
1750
|
+
async list(path3, opts) {
|
|
1751
1751
|
var _a3;
|
|
1752
1752
|
if (typeof (opts == null ? void 0 : opts.depth) === "number" && opts.depth < 1) {
|
|
1753
1753
|
throw new InvalidArgumentError("depth should be at least one");
|
|
@@ -1755,7 +1755,7 @@ var init_filesystem = __esm({
|
|
|
1755
1755
|
try {
|
|
1756
1756
|
const res = await this.rpc.listDir(
|
|
1757
1757
|
{
|
|
1758
|
-
path:
|
|
1758
|
+
path: path3,
|
|
1759
1759
|
depth: (_a3 = opts == null ? void 0 : opts.depth) != null ? _a3 : 1
|
|
1760
1760
|
},
|
|
1761
1761
|
{
|
|
@@ -1794,10 +1794,10 @@ var init_filesystem = __esm({
|
|
|
1794
1794
|
*
|
|
1795
1795
|
* @returns `true` if the directory was created, `false` if it already exists.
|
|
1796
1796
|
*/
|
|
1797
|
-
async makeDir(
|
|
1797
|
+
async makeDir(path3, opts) {
|
|
1798
1798
|
try {
|
|
1799
1799
|
await this.rpc.makeDir(
|
|
1800
|
-
{ path:
|
|
1800
|
+
{ path: path3 },
|
|
1801
1801
|
{
|
|
1802
1802
|
headers: authenticationHeader(this.envdApi.version, opts == null ? void 0 : opts.user),
|
|
1803
1803
|
signal: this.connectionConfig.getSignal(opts == null ? void 0 : opts.requestTimeoutMs)
|
|
@@ -1860,10 +1860,10 @@ var init_filesystem = __esm({
|
|
|
1860
1860
|
* @param path path to a file or directory.
|
|
1861
1861
|
* @param opts connection options.
|
|
1862
1862
|
*/
|
|
1863
|
-
async remove(
|
|
1863
|
+
async remove(path3, opts) {
|
|
1864
1864
|
try {
|
|
1865
1865
|
await this.rpc.remove(
|
|
1866
|
-
{ path:
|
|
1866
|
+
{ path: path3 },
|
|
1867
1867
|
{
|
|
1868
1868
|
headers: authenticationHeader(this.envdApi.version, opts == null ? void 0 : opts.user),
|
|
1869
1869
|
signal: this.connectionConfig.getSignal(opts == null ? void 0 : opts.requestTimeoutMs)
|
|
@@ -1881,10 +1881,10 @@ var init_filesystem = __esm({
|
|
|
1881
1881
|
*
|
|
1882
1882
|
* @returns `true` if the file or directory exists, `false` otherwise
|
|
1883
1883
|
*/
|
|
1884
|
-
async exists(
|
|
1884
|
+
async exists(path3, opts) {
|
|
1885
1885
|
try {
|
|
1886
1886
|
await this.rpc.stat(
|
|
1887
|
-
{ path:
|
|
1887
|
+
{ path: path3 },
|
|
1888
1888
|
{
|
|
1889
1889
|
headers: authenticationHeader(this.envdApi.version, opts == null ? void 0 : opts.user),
|
|
1890
1890
|
signal: this.connectionConfig.getSignal(opts == null ? void 0 : opts.requestTimeoutMs)
|
|
@@ -1908,10 +1908,10 @@ var init_filesystem = __esm({
|
|
|
1908
1908
|
*
|
|
1909
1909
|
* @returns information about the file or directory like name, type, and path.
|
|
1910
1910
|
*/
|
|
1911
|
-
async getInfo(
|
|
1911
|
+
async getInfo(path3, opts) {
|
|
1912
1912
|
try {
|
|
1913
1913
|
const res = await this.rpc.stat(
|
|
1914
|
-
{ path:
|
|
1914
|
+
{ path: path3 },
|
|
1915
1915
|
{
|
|
1916
1916
|
headers: authenticationHeader(this.envdApi.version, opts == null ? void 0 : opts.user),
|
|
1917
1917
|
signal: this.connectionConfig.getSignal(opts == null ? void 0 : opts.requestTimeoutMs)
|
|
@@ -1947,7 +1947,7 @@ var init_filesystem = __esm({
|
|
|
1947
1947
|
*
|
|
1948
1948
|
* @returns `WatchHandle` object for stopping watching directory.
|
|
1949
1949
|
*/
|
|
1950
|
-
async watchDir(
|
|
1950
|
+
async watchDir(path3, onEvent, opts) {
|
|
1951
1951
|
var _a3, _b, _c;
|
|
1952
1952
|
if ((opts == null ? void 0 : opts.recursive) && this.envdApi.version && (0, import_compare_versions3.compareVersions)(this.envdApi.version, ENVD_VERSION_RECURSIVE_WATCH) < 0) {
|
|
1953
1953
|
throw new TemplateError(
|
|
@@ -1961,7 +1961,7 @@ var init_filesystem = __esm({
|
|
|
1961
1961
|
}, requestTimeoutMs) : void 0;
|
|
1962
1962
|
const events = this.rpc.watchDir(
|
|
1963
1963
|
{
|
|
1964
|
-
path:
|
|
1964
|
+
path: path3,
|
|
1965
1965
|
recursive: (_b = opts == null ? void 0 : opts.recursive) != null ? _b : this.defaultWatchRecursive
|
|
1966
1966
|
},
|
|
1967
1967
|
{
|
|
@@ -2184,11 +2184,11 @@ function parseGitStatus(output) {
|
|
|
2184
2184
|
}
|
|
2185
2185
|
const indexStatus = line[0];
|
|
2186
2186
|
const workingTreeStatus = line[1];
|
|
2187
|
-
const
|
|
2187
|
+
const path3 = line.slice(3);
|
|
2188
2188
|
let renamedFrom;
|
|
2189
|
-
let name =
|
|
2190
|
-
if (
|
|
2191
|
-
const parts =
|
|
2189
|
+
let name = path3;
|
|
2190
|
+
if (path3.includes(" -> ")) {
|
|
2191
|
+
const parts = path3.split(" -> ");
|
|
2192
2192
|
renamedFrom = parts[0];
|
|
2193
2193
|
name = parts.slice(1).join(" -> ");
|
|
2194
2194
|
}
|
|
@@ -2297,16 +2297,16 @@ function buildUpstreamErrorMessage(action) {
|
|
|
2297
2297
|
}
|
|
2298
2298
|
return "Git pull failed because no upstream branch is configured. Pass remote and branch explicitly, or set upstream once (push with { setUpstream: true } or run: git branch --set-upstream-to=origin/<branch> <branch>).";
|
|
2299
2299
|
}
|
|
2300
|
-
function getRepoPathForScope(scope,
|
|
2300
|
+
function getRepoPathForScope(scope, path3) {
|
|
2301
2301
|
if (scope !== "local") {
|
|
2302
2302
|
return void 0;
|
|
2303
2303
|
}
|
|
2304
|
-
if (!
|
|
2304
|
+
if (!path3) {
|
|
2305
2305
|
throw new InvalidArgumentError(
|
|
2306
2306
|
'A repository path is required when using scope "local".'
|
|
2307
2307
|
);
|
|
2308
2308
|
}
|
|
2309
|
-
return
|
|
2309
|
+
return path3;
|
|
2310
2310
|
}
|
|
2311
2311
|
var init_utils2 = __esm({
|
|
2312
2312
|
"src/core/sandbox/git/utils.ts"() {
|
|
@@ -2343,7 +2343,7 @@ var init_git = __esm({
|
|
|
2343
2343
|
password,
|
|
2344
2344
|
branch,
|
|
2345
2345
|
depth,
|
|
2346
|
-
path:
|
|
2346
|
+
path: path3,
|
|
2347
2347
|
dangerouslyStoreCredentials
|
|
2348
2348
|
} = _a3, rest = __objRest(_a3, [
|
|
2349
2349
|
"username",
|
|
@@ -2362,7 +2362,7 @@ var init_git = __esm({
|
|
|
2362
2362
|
const urlWithCreds = authUsername && authPassword ? withCredentials(url, authUsername, authPassword) : url;
|
|
2363
2363
|
const sanitizedUrl = stripCredentials(urlWithCreds);
|
|
2364
2364
|
const stripInlineCreds = !dangerouslyStoreCredentials && sanitizedUrl !== urlWithCreds;
|
|
2365
|
-
const repoPath = stripInlineCreds ?
|
|
2365
|
+
const repoPath = stripInlineCreds ? path3 != null ? path3 : deriveRepoDirFromUrl(url) : path3;
|
|
2366
2366
|
if (stripInlineCreds && !repoPath) {
|
|
2367
2367
|
throw new InvalidArgumentError(
|
|
2368
2368
|
"A destination path is required when using credentials without storing them."
|
|
@@ -2400,7 +2400,7 @@ var init_git = __esm({
|
|
|
2400
2400
|
* @param opts Init options.
|
|
2401
2401
|
* @returns Command result from the command runner.
|
|
2402
2402
|
*/
|
|
2403
|
-
async init(
|
|
2403
|
+
async init(path3, opts) {
|
|
2404
2404
|
const _a3 = opts != null ? opts : {}, { bare, initialBranch } = _a3, rest = __objRest(_a3, ["bare", "initialBranch"]);
|
|
2405
2405
|
const args = ["init"];
|
|
2406
2406
|
if (initialBranch) {
|
|
@@ -2409,7 +2409,7 @@ var init_git = __esm({
|
|
|
2409
2409
|
if (bare) {
|
|
2410
2410
|
args.push("--bare");
|
|
2411
2411
|
}
|
|
2412
|
-
args.push(
|
|
2412
|
+
args.push(path3);
|
|
2413
2413
|
return this.runGit(args, void 0, rest);
|
|
2414
2414
|
}
|
|
2415
2415
|
/**
|
|
@@ -2421,7 +2421,7 @@ var init_git = __esm({
|
|
|
2421
2421
|
* @param opts Remote add options.
|
|
2422
2422
|
* @returns Command result from the command runner.
|
|
2423
2423
|
*/
|
|
2424
|
-
async remoteAdd(
|
|
2424
|
+
async remoteAdd(path3, name, url, opts) {
|
|
2425
2425
|
if (!name || !url) {
|
|
2426
2426
|
throw new InvalidArgumentError(
|
|
2427
2427
|
"Both remote name and URL are required to add a git remote."
|
|
@@ -2434,13 +2434,13 @@ var init_git = __esm({
|
|
|
2434
2434
|
}
|
|
2435
2435
|
addArgs.push(name, url);
|
|
2436
2436
|
if (!overwrite) {
|
|
2437
|
-
return this.runGit(addArgs,
|
|
2437
|
+
return this.runGit(addArgs, path3, rest);
|
|
2438
2438
|
}
|
|
2439
|
-
const addCmd = buildGitCommand(addArgs,
|
|
2440
|
-
const setUrlCmd = buildGitCommand(["remote", "set-url", name, url],
|
|
2439
|
+
const addCmd = buildGitCommand(addArgs, path3);
|
|
2440
|
+
const setUrlCmd = buildGitCommand(["remote", "set-url", name, url], path3);
|
|
2441
2441
|
let cmd = `${addCmd} || ${setUrlCmd}`;
|
|
2442
2442
|
if (fetch2) {
|
|
2443
|
-
const fetchCmd = buildGitCommand(["fetch", name],
|
|
2443
|
+
const fetchCmd = buildGitCommand(["fetch", name], path3);
|
|
2444
2444
|
cmd = `(${cmd}) && ${fetchCmd}`;
|
|
2445
2445
|
}
|
|
2446
2446
|
return this.runShell(cmd, rest);
|
|
@@ -2455,11 +2455,11 @@ var init_git = __esm({
|
|
|
2455
2455
|
* @param opts Command execution options.
|
|
2456
2456
|
* @returns Remote URL if present.
|
|
2457
2457
|
*/
|
|
2458
|
-
async remoteGet(
|
|
2458
|
+
async remoteGet(path3, name, opts) {
|
|
2459
2459
|
if (!name) {
|
|
2460
2460
|
throw new InvalidArgumentError("Remote name is required.");
|
|
2461
2461
|
}
|
|
2462
|
-
const cmd = `${buildGitCommand(["remote", "get-url", name],
|
|
2462
|
+
const cmd = `${buildGitCommand(["remote", "get-url", name], path3)} || true`;
|
|
2463
2463
|
const result = await this.runShell(cmd, opts);
|
|
2464
2464
|
const trimmed = result.stdout.trim();
|
|
2465
2465
|
return trimmed.length > 0 ? trimmed : void 0;
|
|
@@ -2471,10 +2471,10 @@ var init_git = __esm({
|
|
|
2471
2471
|
* @param opts Command execution options.
|
|
2472
2472
|
* @returns Parsed git status.
|
|
2473
2473
|
*/
|
|
2474
|
-
async status(
|
|
2474
|
+
async status(path3, opts) {
|
|
2475
2475
|
const result = await this.runGit(
|
|
2476
2476
|
["status", "--porcelain=1", "-b"],
|
|
2477
|
-
|
|
2477
|
+
path3,
|
|
2478
2478
|
opts
|
|
2479
2479
|
);
|
|
2480
2480
|
return parseGitStatus(result.stdout);
|
|
@@ -2486,10 +2486,10 @@ var init_git = __esm({
|
|
|
2486
2486
|
* @param opts Command execution options.
|
|
2487
2487
|
* @returns Parsed branch list.
|
|
2488
2488
|
*/
|
|
2489
|
-
async branches(
|
|
2489
|
+
async branches(path3, opts) {
|
|
2490
2490
|
const result = await this.runGit(
|
|
2491
2491
|
["branch", "--format=%(refname:short) %(HEAD)"],
|
|
2492
|
-
|
|
2492
|
+
path3,
|
|
2493
2493
|
opts
|
|
2494
2494
|
);
|
|
2495
2495
|
return parseGitBranches(result.stdout);
|
|
@@ -2502,8 +2502,8 @@ var init_git = __esm({
|
|
|
2502
2502
|
* @param opts Command execution options.
|
|
2503
2503
|
* @returns Command result from the command runner.
|
|
2504
2504
|
*/
|
|
2505
|
-
async createBranch(
|
|
2506
|
-
return this.runGit(["checkout", "-b", branch],
|
|
2505
|
+
async createBranch(path3, branch, opts) {
|
|
2506
|
+
return this.runGit(["checkout", "-b", branch], path3, opts);
|
|
2507
2507
|
}
|
|
2508
2508
|
/**
|
|
2509
2509
|
* Check out an existing branch.
|
|
@@ -2513,8 +2513,8 @@ var init_git = __esm({
|
|
|
2513
2513
|
* @param opts Command execution options.
|
|
2514
2514
|
* @returns Command result from the command runner.
|
|
2515
2515
|
*/
|
|
2516
|
-
async checkoutBranch(
|
|
2517
|
-
return this.runGit(["checkout", branch],
|
|
2516
|
+
async checkoutBranch(path3, branch, opts) {
|
|
2517
|
+
return this.runGit(["checkout", branch], path3, opts);
|
|
2518
2518
|
}
|
|
2519
2519
|
/**
|
|
2520
2520
|
* Delete a branch.
|
|
@@ -2524,10 +2524,10 @@ var init_git = __esm({
|
|
|
2524
2524
|
* @param opts Delete options.
|
|
2525
2525
|
* @returns Command result from the command runner.
|
|
2526
2526
|
*/
|
|
2527
|
-
async deleteBranch(
|
|
2527
|
+
async deleteBranch(path3, branch, opts) {
|
|
2528
2528
|
const _a3 = opts != null ? opts : {}, { force } = _a3, rest = __objRest(_a3, ["force"]);
|
|
2529
2529
|
const args = ["branch", force ? "-D" : "-d", branch];
|
|
2530
|
-
return this.runGit(args,
|
|
2530
|
+
return this.runGit(args, path3, rest);
|
|
2531
2531
|
}
|
|
2532
2532
|
/**
|
|
2533
2533
|
* Stage files for commit.
|
|
@@ -2536,7 +2536,7 @@ var init_git = __esm({
|
|
|
2536
2536
|
* @param opts Add options.
|
|
2537
2537
|
* @returns Command result from the command runner.
|
|
2538
2538
|
*/
|
|
2539
|
-
async add(
|
|
2539
|
+
async add(path3, opts) {
|
|
2540
2540
|
const _a3 = opts != null ? opts : {}, { files, all = true } = _a3, rest = __objRest(_a3, ["files", "all"]);
|
|
2541
2541
|
const args = ["add"];
|
|
2542
2542
|
if (!files || files.length === 0) {
|
|
@@ -2544,7 +2544,7 @@ var init_git = __esm({
|
|
|
2544
2544
|
} else {
|
|
2545
2545
|
args.push("--", ...files);
|
|
2546
2546
|
}
|
|
2547
|
-
return this.runGit(args,
|
|
2547
|
+
return this.runGit(args, path3, rest);
|
|
2548
2548
|
}
|
|
2549
2549
|
/**
|
|
2550
2550
|
* Create a commit in the repository.
|
|
@@ -2554,7 +2554,7 @@ var init_git = __esm({
|
|
|
2554
2554
|
* @param opts Commit options.
|
|
2555
2555
|
* @returns Command result from the command runner.
|
|
2556
2556
|
*/
|
|
2557
|
-
async commit(
|
|
2557
|
+
async commit(path3, message, opts) {
|
|
2558
2558
|
const _a3 = opts != null ? opts : {}, { authorName, authorEmail, allowEmpty } = _a3, rest = __objRest(_a3, ["authorName", "authorEmail", "allowEmpty"]);
|
|
2559
2559
|
const args = ["commit", "-m", message];
|
|
2560
2560
|
if (allowEmpty) {
|
|
@@ -2567,7 +2567,7 @@ var init_git = __esm({
|
|
|
2567
2567
|
if (authorEmail) {
|
|
2568
2568
|
authorArgs.push("-c", `user.email=${authorEmail}`);
|
|
2569
2569
|
}
|
|
2570
|
-
return this.runGit([...authorArgs, ...args],
|
|
2570
|
+
return this.runGit([...authorArgs, ...args], path3, rest);
|
|
2571
2571
|
}
|
|
2572
2572
|
/**
|
|
2573
2573
|
* Reset the current HEAD to a specified state.
|
|
@@ -2576,7 +2576,7 @@ var init_git = __esm({
|
|
|
2576
2576
|
* @param opts Reset options.
|
|
2577
2577
|
* @returns Command result from the command runner.
|
|
2578
2578
|
*/
|
|
2579
|
-
async reset(
|
|
2579
|
+
async reset(path3, opts) {
|
|
2580
2580
|
const _a3 = opts != null ? opts : {}, { mode, target, paths: paths2 } = _a3, rest = __objRest(_a3, ["mode", "target", "paths"]);
|
|
2581
2581
|
const allowedModes = [
|
|
2582
2582
|
"soft",
|
|
@@ -2600,7 +2600,7 @@ var init_git = __esm({
|
|
|
2600
2600
|
if (paths2 && paths2.length > 0) {
|
|
2601
2601
|
args.push("--", ...paths2);
|
|
2602
2602
|
}
|
|
2603
|
-
return this.runGit(args,
|
|
2603
|
+
return this.runGit(args, path3, rest);
|
|
2604
2604
|
}
|
|
2605
2605
|
/**
|
|
2606
2606
|
* Restore working tree files or unstage changes.
|
|
@@ -2609,7 +2609,7 @@ var init_git = __esm({
|
|
|
2609
2609
|
* @param opts Restore options.
|
|
2610
2610
|
* @returns Command result from the command runner.
|
|
2611
2611
|
*/
|
|
2612
|
-
async restore(
|
|
2612
|
+
async restore(path3, opts) {
|
|
2613
2613
|
const _a3 = opts, { paths: paths2, staged, worktree, source } = _a3, rest = __objRest(_a3, ["paths", "staged", "worktree", "source"]);
|
|
2614
2614
|
if (!paths2 || paths2.length === 0) {
|
|
2615
2615
|
throw new InvalidArgumentError("At least one path is required.");
|
|
@@ -2639,7 +2639,7 @@ var init_git = __esm({
|
|
|
2639
2639
|
args.push("--source", source);
|
|
2640
2640
|
}
|
|
2641
2641
|
args.push("--", ...paths2);
|
|
2642
|
-
return this.runGit(args,
|
|
2642
|
+
return this.runGit(args, path3, rest);
|
|
2643
2643
|
}
|
|
2644
2644
|
/**
|
|
2645
2645
|
* Push commits to a remote.
|
|
@@ -2648,7 +2648,7 @@ var init_git = __esm({
|
|
|
2648
2648
|
* @param opts Push options.
|
|
2649
2649
|
* @returns Command result from the command runner.
|
|
2650
2650
|
*/
|
|
2651
|
-
async push(
|
|
2651
|
+
async push(path3, opts) {
|
|
2652
2652
|
const _a3 = opts != null ? opts : {}, {
|
|
2653
2653
|
remote,
|
|
2654
2654
|
branch,
|
|
@@ -2668,16 +2668,16 @@ var init_git = __esm({
|
|
|
2668
2668
|
);
|
|
2669
2669
|
}
|
|
2670
2670
|
if (username && password) {
|
|
2671
|
-
const remoteName = await this.resolveRemoteName(
|
|
2671
|
+
const remoteName = await this.resolveRemoteName(path3, remote, rest);
|
|
2672
2672
|
return this.withRemoteCredentials(
|
|
2673
|
-
|
|
2673
|
+
path3,
|
|
2674
2674
|
remoteName,
|
|
2675
2675
|
username,
|
|
2676
2676
|
password,
|
|
2677
2677
|
rest,
|
|
2678
2678
|
() => this.runGit(
|
|
2679
2679
|
buildPushArgs(remoteName, { remote, branch, setUpstream }),
|
|
2680
|
-
|
|
2680
|
+
path3,
|
|
2681
2681
|
rest
|
|
2682
2682
|
)
|
|
2683
2683
|
);
|
|
@@ -2685,7 +2685,7 @@ var init_git = __esm({
|
|
|
2685
2685
|
try {
|
|
2686
2686
|
return await this.runGit(
|
|
2687
2687
|
buildPushArgs(void 0, { remote, branch, setUpstream }),
|
|
2688
|
-
|
|
2688
|
+
path3,
|
|
2689
2689
|
rest
|
|
2690
2690
|
);
|
|
2691
2691
|
} catch (err) {
|
|
@@ -2707,7 +2707,7 @@ var init_git = __esm({
|
|
|
2707
2707
|
* @param opts Pull options.
|
|
2708
2708
|
* @returns Command result from the command runner.
|
|
2709
2709
|
*/
|
|
2710
|
-
async pull(
|
|
2710
|
+
async pull(path3, opts) {
|
|
2711
2711
|
const _a3 = opts != null ? opts : {}, { remote, branch, username, password } = _a3, rest = __objRest(_a3, ["remote", "branch", "username", "password"]);
|
|
2712
2712
|
if (password && !username) {
|
|
2713
2713
|
throw new InvalidArgumentError(
|
|
@@ -2715,7 +2715,7 @@ var init_git = __esm({
|
|
|
2715
2715
|
);
|
|
2716
2716
|
}
|
|
2717
2717
|
if (!remote && !branch) {
|
|
2718
|
-
const hasUpstream = await this.hasUpstream(
|
|
2718
|
+
const hasUpstream = await this.hasUpstream(path3, rest);
|
|
2719
2719
|
if (!hasUpstream) {
|
|
2720
2720
|
throw new GitUpstreamError(buildUpstreamErrorMessage("pull"));
|
|
2721
2721
|
}
|
|
@@ -2732,18 +2732,18 @@ var init_git = __esm({
|
|
|
2732
2732
|
return args;
|
|
2733
2733
|
};
|
|
2734
2734
|
if (username && password) {
|
|
2735
|
-
const remoteName = await this.resolveRemoteName(
|
|
2735
|
+
const remoteName = await this.resolveRemoteName(path3, remote, rest);
|
|
2736
2736
|
return this.withRemoteCredentials(
|
|
2737
|
-
|
|
2737
|
+
path3,
|
|
2738
2738
|
remoteName,
|
|
2739
2739
|
username,
|
|
2740
2740
|
password,
|
|
2741
2741
|
rest,
|
|
2742
|
-
() => this.runGit(buildArgs(remoteName),
|
|
2742
|
+
() => this.runGit(buildArgs(remoteName), path3, rest)
|
|
2743
2743
|
);
|
|
2744
2744
|
}
|
|
2745
2745
|
try {
|
|
2746
|
-
return await this.runGit(buildArgs(),
|
|
2746
|
+
return await this.runGit(buildArgs(), path3, rest);
|
|
2747
2747
|
} catch (err) {
|
|
2748
2748
|
if (isAuthFailure(err)) {
|
|
2749
2749
|
throw new GitAuthError(
|
|
@@ -2880,8 +2880,8 @@ var init_git = __esm({
|
|
|
2880
2880
|
envs: mergedEnvs
|
|
2881
2881
|
}));
|
|
2882
2882
|
}
|
|
2883
|
-
async getRemoteUrl(
|
|
2884
|
-
const result = await this.runGit(["remote", "get-url", remote],
|
|
2883
|
+
async getRemoteUrl(path3, remote, opts) {
|
|
2884
|
+
const result = await this.runGit(["remote", "get-url", remote], path3, opts);
|
|
2885
2885
|
const url = result.stdout.trim();
|
|
2886
2886
|
if (!url) {
|
|
2887
2887
|
throw new InvalidArgumentError(
|
|
@@ -2890,11 +2890,11 @@ var init_git = __esm({
|
|
|
2890
2890
|
}
|
|
2891
2891
|
return url;
|
|
2892
2892
|
}
|
|
2893
|
-
async resolveRemoteName(
|
|
2893
|
+
async resolveRemoteName(path3, remote, opts) {
|
|
2894
2894
|
if (remote) {
|
|
2895
2895
|
return remote;
|
|
2896
2896
|
}
|
|
2897
|
-
const result = await this.runGit(["remote"],
|
|
2897
|
+
const result = await this.runGit(["remote"], path3, opts);
|
|
2898
2898
|
const remotes = result.stdout.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
2899
2899
|
if (remotes.length === 1) {
|
|
2900
2900
|
return remotes[0];
|
|
@@ -2903,10 +2903,10 @@ var init_git = __esm({
|
|
|
2903
2903
|
"Remote is required when using username/password and the repository has multiple remotes."
|
|
2904
2904
|
);
|
|
2905
2905
|
}
|
|
2906
|
-
async withRemoteCredentials(
|
|
2907
|
-
const originalUrl = await this.getRemoteUrl(
|
|
2906
|
+
async withRemoteCredentials(path3, remote, username, password, opts, operation) {
|
|
2907
|
+
const originalUrl = await this.getRemoteUrl(path3, remote, opts);
|
|
2908
2908
|
const credentialUrl = withCredentials(originalUrl, username, password);
|
|
2909
|
-
await this.runGit(["remote", "set-url", remote, credentialUrl],
|
|
2909
|
+
await this.runGit(["remote", "set-url", remote, credentialUrl], path3, opts);
|
|
2910
2910
|
let result;
|
|
2911
2911
|
let operationError;
|
|
2912
2912
|
try {
|
|
@@ -2916,7 +2916,7 @@ var init_git = __esm({
|
|
|
2916
2916
|
}
|
|
2917
2917
|
let restoreError;
|
|
2918
2918
|
try {
|
|
2919
|
-
await this.runGit(["remote", "set-url", remote, originalUrl],
|
|
2919
|
+
await this.runGit(["remote", "set-url", remote, originalUrl], path3, opts);
|
|
2920
2920
|
} catch (err) {
|
|
2921
2921
|
restoreError = err;
|
|
2922
2922
|
}
|
|
@@ -2928,11 +2928,11 @@ var init_git = __esm({
|
|
|
2928
2928
|
}
|
|
2929
2929
|
return result;
|
|
2930
2930
|
}
|
|
2931
|
-
async hasUpstream(
|
|
2931
|
+
async hasUpstream(path3, opts) {
|
|
2932
2932
|
try {
|
|
2933
2933
|
const result = await this.runGit(
|
|
2934
2934
|
["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}"],
|
|
2935
|
-
|
|
2935
|
+
path3,
|
|
2936
2936
|
opts
|
|
2937
2937
|
);
|
|
2938
2938
|
return result.stdout.trim().length > 0;
|
|
@@ -3015,11 +3015,11 @@ function normalizeSecretHosts(hosts) {
|
|
|
3015
3015
|
}
|
|
3016
3016
|
return normalizedHosts;
|
|
3017
3017
|
}
|
|
3018
|
-
async function request(method,
|
|
3018
|
+
async function request(method, path3, feature, opts, body) {
|
|
3019
3019
|
const config = new ConnectionConfig(opts);
|
|
3020
3020
|
raiseIfLegacy(config, feature, SecretError);
|
|
3021
3021
|
const headers = __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, config.headers), body ? { "Content-Type": "application/json" } : {}), config.apiKey ? { "X-API-KEY": config.apiKey } : {}), config.accessToken ? { Authorization: `Bearer ${config.accessToken}` } : {});
|
|
3022
|
-
const response = await fetch(`${config.apiUrl}${
|
|
3022
|
+
const response = await fetch(`${config.apiUrl}${path3}`, {
|
|
3023
3023
|
method,
|
|
3024
3024
|
headers,
|
|
3025
3025
|
body: body ? JSON.stringify(body) : void 0,
|
|
@@ -3437,7 +3437,7 @@ var init_sandboxApi = __esm({
|
|
|
3437
3437
|
}
|
|
3438
3438
|
return true;
|
|
3439
3439
|
}
|
|
3440
|
-
static async mountVolume(sandboxId, name,
|
|
3440
|
+
static async mountVolume(sandboxId, name, path3, opts) {
|
|
3441
3441
|
var _a3, _b;
|
|
3442
3442
|
const config = new ConnectionConfig(opts);
|
|
3443
3443
|
raiseIfLegacy(config, "Sandbox.mountVolume", SandboxError);
|
|
@@ -3448,7 +3448,7 @@ var init_sandboxApi = __esm({
|
|
|
3448
3448
|
headers: getRawApiHeaders(config, {
|
|
3449
3449
|
"Content-Type": "application/json"
|
|
3450
3450
|
}),
|
|
3451
|
-
body: JSON.stringify({ name, path:
|
|
3451
|
+
body: JSON.stringify({ name, path: path3 }),
|
|
3452
3452
|
signal: config.getSignal(opts == null ? void 0 : opts.requestTimeoutMs)
|
|
3453
3453
|
}
|
|
3454
3454
|
);
|
|
@@ -3473,14 +3473,14 @@ var init_sandboxApi = __esm({
|
|
|
3473
3473
|
volumeMounts: (_b = data.volumeMounts) != null ? _b : []
|
|
3474
3474
|
};
|
|
3475
3475
|
}
|
|
3476
|
-
static async unmountVolume(sandboxId,
|
|
3476
|
+
static async unmountVolume(sandboxId, path3, opts) {
|
|
3477
3477
|
var _a3, _b;
|
|
3478
3478
|
const config = new ConnectionConfig(opts);
|
|
3479
3479
|
raiseIfLegacy(config, "Sandbox.unmountVolume", SandboxError);
|
|
3480
3480
|
const url = new URL(
|
|
3481
3481
|
`${config.apiUrl}/sandboxes/${encodeURIComponent(sandboxId)}/volume-mounts`
|
|
3482
3482
|
);
|
|
3483
|
-
url.searchParams.set("path",
|
|
3483
|
+
url.searchParams.set("path", path3);
|
|
3484
3484
|
if (opts == null ? void 0 : opts.force) {
|
|
3485
3485
|
url.searchParams.set("force", "true");
|
|
3486
3486
|
}
|
|
@@ -4162,7 +4162,7 @@ var init_sandboxApi = __esm({
|
|
|
4162
4162
|
|
|
4163
4163
|
// src/core/sandbox/signature.ts
|
|
4164
4164
|
async function getSignature({
|
|
4165
|
-
path:
|
|
4165
|
+
path: path3,
|
|
4166
4166
|
operation,
|
|
4167
4167
|
user,
|
|
4168
4168
|
expirationInSeconds,
|
|
@@ -4179,9 +4179,9 @@ async function getSignature({
|
|
|
4179
4179
|
user = "";
|
|
4180
4180
|
}
|
|
4181
4181
|
if (signatureExpiration === null) {
|
|
4182
|
-
signatureRaw = `${
|
|
4182
|
+
signatureRaw = `${path3}:${operation}:${user}:${envdAccessToken}`;
|
|
4183
4183
|
} else {
|
|
4184
|
-
signatureRaw = `${
|
|
4184
|
+
signatureRaw = `${path3}:${operation}:${user}:${envdAccessToken}:${signatureExpiration.toString()}`;
|
|
4185
4185
|
}
|
|
4186
4186
|
const hashBase64 = await sha256(signatureRaw);
|
|
4187
4187
|
const signature = "v1_" + hashBase64.replace(/=+$/, "");
|
|
@@ -4387,8 +4387,8 @@ var init_sandbox = __esm({
|
|
|
4387
4387
|
*
|
|
4388
4388
|
* @returns updated sandbox information.
|
|
4389
4389
|
*/
|
|
4390
|
-
static async mountVolume(sandboxId, name,
|
|
4391
|
-
return await SandboxApi.mountVolume(sandboxId, name,
|
|
4390
|
+
static async mountVolume(sandboxId, name, path3, opts) {
|
|
4391
|
+
return await SandboxApi.mountVolume(sandboxId, name, path3, opts);
|
|
4392
4392
|
}
|
|
4393
4393
|
/**
|
|
4394
4394
|
* Unmount a volume from a sandbox.
|
|
@@ -4400,8 +4400,8 @@ var init_sandbox = __esm({
|
|
|
4400
4400
|
*
|
|
4401
4401
|
* @returns updated sandbox information.
|
|
4402
4402
|
*/
|
|
4403
|
-
static async unmountVolume(sandboxId,
|
|
4404
|
-
return await SandboxApi.unmountVolume(sandboxId,
|
|
4403
|
+
static async unmountVolume(sandboxId, path3, opts) {
|
|
4404
|
+
return await SandboxApi.unmountVolume(sandboxId, path3, opts);
|
|
4405
4405
|
}
|
|
4406
4406
|
/**
|
|
4407
4407
|
* Commit a sandbox to create a snapshot template.
|
|
@@ -4636,11 +4636,11 @@ var init_sandbox = __esm({
|
|
|
4636
4636
|
*
|
|
4637
4637
|
* @returns updated sandbox information.
|
|
4638
4638
|
*/
|
|
4639
|
-
async mountVolume(name,
|
|
4639
|
+
async mountVolume(name, path3, opts) {
|
|
4640
4640
|
return await SandboxApi.mountVolume(
|
|
4641
4641
|
this.sandboxId,
|
|
4642
4642
|
name,
|
|
4643
|
-
|
|
4643
|
+
path3,
|
|
4644
4644
|
this.resolveApiOpts(opts)
|
|
4645
4645
|
);
|
|
4646
4646
|
}
|
|
@@ -4653,10 +4653,10 @@ var init_sandbox = __esm({
|
|
|
4653
4653
|
*
|
|
4654
4654
|
* @returns updated sandbox information.
|
|
4655
4655
|
*/
|
|
4656
|
-
async unmountVolume(
|
|
4656
|
+
async unmountVolume(path3, opts) {
|
|
4657
4657
|
return await SandboxApi.unmountVolume(
|
|
4658
4658
|
this.sandboxId,
|
|
4659
|
-
|
|
4659
|
+
path3,
|
|
4660
4660
|
this.resolveApiOpts(opts)
|
|
4661
4661
|
);
|
|
4662
4662
|
}
|
|
@@ -4790,7 +4790,7 @@ var init_sandbox = __esm({
|
|
|
4790
4790
|
*
|
|
4791
4791
|
* @returns URL for uploading file.
|
|
4792
4792
|
*/
|
|
4793
|
-
async uploadUrl(
|
|
4793
|
+
async uploadUrl(path3, opts) {
|
|
4794
4794
|
opts = opts != null ? opts : {};
|
|
4795
4795
|
const useSignature = !!this.envdAccessToken;
|
|
4796
4796
|
if (!useSignature && opts.useSignatureExpiration != void 0) {
|
|
@@ -4802,7 +4802,7 @@ var init_sandbox = __esm({
|
|
|
4802
4802
|
if (username == void 0 && (0, import_compare_versions5.compareVersions)(this.envdApi.version, ENVD_DEFAULT_USER) < 0) {
|
|
4803
4803
|
username = defaultUsername;
|
|
4804
4804
|
}
|
|
4805
|
-
const filePath =
|
|
4805
|
+
const filePath = path3 != null ? path3 : "";
|
|
4806
4806
|
const fileUrl = this.fileUrl(filePath, username);
|
|
4807
4807
|
if (useSignature) {
|
|
4808
4808
|
const url = new URL(fileUrl);
|
|
@@ -4830,7 +4830,7 @@ var init_sandbox = __esm({
|
|
|
4830
4830
|
*
|
|
4831
4831
|
* @returns URL for downloading file.
|
|
4832
4832
|
*/
|
|
4833
|
-
async downloadUrl(
|
|
4833
|
+
async downloadUrl(path3, opts) {
|
|
4834
4834
|
opts = opts != null ? opts : {};
|
|
4835
4835
|
const useSignature = !!this.envdAccessToken;
|
|
4836
4836
|
if (!useSignature && opts.useSignatureExpiration != void 0) {
|
|
@@ -4842,11 +4842,11 @@ var init_sandbox = __esm({
|
|
|
4842
4842
|
if (username == void 0 && (0, import_compare_versions5.compareVersions)(this.envdApi.version, ENVD_DEFAULT_USER) < 0) {
|
|
4843
4843
|
username = defaultUsername;
|
|
4844
4844
|
}
|
|
4845
|
-
const fileUrl = this.fileUrl(
|
|
4845
|
+
const fileUrl = this.fileUrl(path3, username);
|
|
4846
4846
|
if (useSignature) {
|
|
4847
4847
|
const url = new URL(fileUrl);
|
|
4848
4848
|
const sig = await getSignature({
|
|
4849
|
-
path:
|
|
4849
|
+
path: path3,
|
|
4850
4850
|
operation: "read",
|
|
4851
4851
|
user: username,
|
|
4852
4852
|
expirationInSeconds: opts.useSignatureExpiration,
|
|
@@ -4900,13 +4900,13 @@ var init_sandbox = __esm({
|
|
|
4900
4900
|
resolveApiOpts(opts) {
|
|
4901
4901
|
return __spreadValues(__spreadValues({}, this.connectionConfig), opts != null ? opts : {});
|
|
4902
4902
|
}
|
|
4903
|
-
fileUrl(
|
|
4903
|
+
fileUrl(path3, username) {
|
|
4904
4904
|
const url = new URL("/files", this.envdApiUrl);
|
|
4905
4905
|
if (username) {
|
|
4906
4906
|
url.searchParams.set("username", username);
|
|
4907
4907
|
}
|
|
4908
|
-
if (
|
|
4909
|
-
url.searchParams.set("path",
|
|
4908
|
+
if (path3) {
|
|
4909
|
+
url.searchParams.set("path", path3);
|
|
4910
4910
|
}
|
|
4911
4911
|
return url.toString();
|
|
4912
4912
|
}
|
|
@@ -5097,8 +5097,8 @@ function readDockerignore(contextPath) {
|
|
|
5097
5097
|
const content = import_node_fs.default.readFileSync(dockerignorePath, "utf-8");
|
|
5098
5098
|
return content.split("\n").map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
5099
5099
|
}
|
|
5100
|
-
function normalizePath(
|
|
5101
|
-
return
|
|
5100
|
+
function normalizePath(path3) {
|
|
5101
|
+
return path3.replace(/\\/g, "/");
|
|
5102
5102
|
}
|
|
5103
5103
|
async function getAllFilesInPath(src, contextPath, ignorePatterns, includeDirectories = true) {
|
|
5104
5104
|
const { glob } = await dynamicImport("glob");
|
|
@@ -5210,8 +5210,8 @@ function getCallerDirectory(depth) {
|
|
|
5210
5210
|
return void 0;
|
|
5211
5211
|
}
|
|
5212
5212
|
if (fileName.startsWith("file:")) {
|
|
5213
|
-
const { fileURLToPath } = dynamicRequire("node:url");
|
|
5214
|
-
fileName =
|
|
5213
|
+
const { fileURLToPath: fileURLToPath2 } = dynamicRequire("node:url");
|
|
5214
|
+
fileName = fileURLToPath2(fileName);
|
|
5215
5215
|
}
|
|
5216
5216
|
return import_node_path.default.dirname(fileName);
|
|
5217
5217
|
}
|
|
@@ -6735,8 +6735,8 @@ var init_template = __esm({
|
|
|
6735
6735
|
});
|
|
6736
6736
|
return this;
|
|
6737
6737
|
}
|
|
6738
|
-
remove(
|
|
6739
|
-
const paths2 = Array.isArray(
|
|
6738
|
+
remove(path3, options) {
|
|
6739
|
+
const paths2 = Array.isArray(path3) ? path3 : [path3];
|
|
6740
6740
|
const args = ["rm"];
|
|
6741
6741
|
if (options == null ? void 0 : options.recursive) {
|
|
6742
6742
|
args.push("-r");
|
|
@@ -6758,8 +6758,8 @@ var init_template = __esm({
|
|
|
6758
6758
|
() => this.runCmd(args.join(" "), { user: options == null ? void 0 : options.user })
|
|
6759
6759
|
);
|
|
6760
6760
|
}
|
|
6761
|
-
makeDir(
|
|
6762
|
-
const paths2 = Array.isArray(
|
|
6761
|
+
makeDir(path3, options) {
|
|
6762
|
+
const paths2 = Array.isArray(path3) ? path3 : [path3];
|
|
6763
6763
|
const args = ["mkdir", "-p"];
|
|
6764
6764
|
if (options == null ? void 0 : options.mode) {
|
|
6765
6765
|
args.push(`-m ${padOctal(options.mode)}`);
|
|
@@ -6894,7 +6894,7 @@ var init_template = __esm({
|
|
|
6894
6894
|
})
|
|
6895
6895
|
);
|
|
6896
6896
|
}
|
|
6897
|
-
gitClone(url,
|
|
6897
|
+
gitClone(url, path3, options) {
|
|
6898
6898
|
const args = ["git", "clone", url];
|
|
6899
6899
|
if (options == null ? void 0 : options.branch) {
|
|
6900
6900
|
args.push(`--branch ${options.branch}`);
|
|
@@ -6903,8 +6903,8 @@ var init_template = __esm({
|
|
|
6903
6903
|
if (options == null ? void 0 : options.depth) {
|
|
6904
6904
|
args.push(`--depth ${options.depth}`);
|
|
6905
6905
|
}
|
|
6906
|
-
if (
|
|
6907
|
-
args.push(
|
|
6906
|
+
if (path3) {
|
|
6907
|
+
args.push(path3.toString());
|
|
6908
6908
|
}
|
|
6909
6909
|
return this.runInNewStackTraceContext(
|
|
6910
6910
|
() => this.runCmd(args.join(" "), { user: options == null ? void 0 : options.user })
|
|
@@ -8305,10 +8305,10 @@ var init_sandbox3 = __esm({
|
|
|
8305
8305
|
}
|
|
8306
8306
|
}
|
|
8307
8307
|
async screenshot(format = "bytes") {
|
|
8308
|
-
const
|
|
8309
|
-
await this.commands.run(`scrot --pointer ${
|
|
8310
|
-
const file = await this.files.read(
|
|
8311
|
-
this.files.remove(
|
|
8308
|
+
const path3 = `/tmp/screenshot-${generateRandomString()}.png`;
|
|
8309
|
+
await this.commands.run(`scrot --pointer ${path3}`);
|
|
8310
|
+
const file = await this.files.read(path3, { format });
|
|
8311
|
+
this.files.remove(path3);
|
|
8312
8312
|
return file;
|
|
8313
8313
|
}
|
|
8314
8314
|
/**
|
|
@@ -8657,7 +8657,7 @@ function mergeConnectionOpts(base, next) {
|
|
|
8657
8657
|
headers: __spreadValues(__spreadValues({}, baseHeaders), nextHeaders)
|
|
8658
8658
|
});
|
|
8659
8659
|
}
|
|
8660
|
-
var RuntimeSandboxNamespace, SandboxNamespace, TemplateNamespace, VolumeNamespace, SecretNamespace, PPIO;
|
|
8660
|
+
var import_node_path2, import_node_url, RuntimeSandboxNamespace, SandboxNamespace, TemplateNamespace, VolumeNamespace, SecretNamespace, PPIO;
|
|
8661
8661
|
var init_client = __esm({
|
|
8662
8662
|
"src/core/client.ts"() {
|
|
8663
8663
|
"use strict";
|
|
@@ -8665,6 +8665,9 @@ var init_client = __esm({
|
|
|
8665
8665
|
init_template();
|
|
8666
8666
|
init_volume();
|
|
8667
8667
|
init_secret();
|
|
8668
|
+
init_utils3();
|
|
8669
|
+
import_node_path2 = __toESM(require("path"));
|
|
8670
|
+
import_node_url = require("url");
|
|
8668
8671
|
RuntimeSandboxNamespace = class {
|
|
8669
8672
|
constructor(opts, loadSandbox) {
|
|
8670
8673
|
this.opts = opts;
|
|
@@ -8861,7 +8864,18 @@ var init_client = __esm({
|
|
|
8861
8864
|
this.toDockerfile = Template.toDockerfile;
|
|
8862
8865
|
}
|
|
8863
8866
|
new(options) {
|
|
8864
|
-
|
|
8867
|
+
var _a3;
|
|
8868
|
+
let callerContext = ".";
|
|
8869
|
+
for (const site of callsites(2)) {
|
|
8870
|
+
const fileName = site.getFileName();
|
|
8871
|
+
if (fileName && (!fileName.includes("/src/core/") || fileName.includes("/src/core/tests/")) && !fileName.includes("/node_modules/ppio-sandbox/")) {
|
|
8872
|
+
callerContext = import_node_path2.default.dirname(fileName.startsWith("file:") ? (0, import_node_url.fileURLToPath)(fileName) : fileName);
|
|
8873
|
+
break;
|
|
8874
|
+
}
|
|
8875
|
+
}
|
|
8876
|
+
return Template(__spreadProps(__spreadValues({}, options), {
|
|
8877
|
+
fileContextPath: (_a3 = options == null ? void 0 : options.fileContextPath) != null ? _a3 : callerContext
|
|
8878
|
+
}));
|
|
8865
8879
|
}
|
|
8866
8880
|
list(opts) {
|
|
8867
8881
|
return Template.list(mergeConnectionOpts(this.opts, opts));
|