windows-development-sandbox 1.4.0 → 1.4.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/.sandbox-config.example.json +2 -1
- package/config.example.json +1 -0
- package/dist/cli/boot-progress.d.ts +22 -0
- package/dist/cli/boot-progress.js +59 -0
- package/dist/cli/commands/launch.d.ts +5 -2
- package/dist/cli/commands/launch.js +77 -22
- package/dist/cli/commands/maintenance.js +36 -3
- package/dist/cli/commands/project.d.ts +10 -6
- package/dist/cli/commands/project.js +42 -3
- package/dist/cli/commands/restart.js +17 -7
- package/dist/cli/commands/sessions.js +2 -1
- package/dist/cli/manifest.js +1 -1
- package/dist/cli/progress.d.ts +15 -0
- package/dist/cli/progress.js +52 -0
- package/dist/core/config.js +1 -1
- package/dist/core/local-config.d.ts +16 -1
- package/dist/core/local-config.js +15 -9
- package/dist/core/project-policy.d.ts +50 -3
- package/dist/core/project-policy.js +90 -4
- package/dist/core/schema/config.d.ts +3 -2
- package/dist/core/schema/config.js +1 -1
- package/dist/core/schema/projects.d.ts +1 -0
- package/dist/core/schema/projects.js +1 -0
- package/dist/core/schema/sandbox.d.ts +1 -1
- package/dist/core/schema/sandbox.js +1 -1
- package/dist/core/types.d.ts +18 -1
- package/dist/core/workspace.d.ts +21 -4
- package/dist/core/workspace.js +87 -26
- package/dist/guest/env.d.ts +6 -2
- package/dist/guest/env.js +15 -3
- package/dist/guest/main.js +5 -1
- package/dist/guest/toolchains/index.js +29 -3
- package/dist/host/channel.d.ts +2 -2
- package/dist/host/channel.js +3 -2
- package/dist/host/generate.d.ts +1 -1
- package/dist/host/generate.js +13 -6
- package/dist/host/join.d.ts +7 -0
- package/dist/host/join.js +23 -9
- package/dist/host/launch/mappings.d.ts +7 -2
- package/dist/host/launch/mappings.js +64 -18
- package/dist/host/launch/projects.d.ts +2 -0
- package/dist/host/launch/projects.js +11 -5
- package/dist/host/projects.d.ts +25 -2
- package/dist/host/projects.js +54 -5
- package/dist/runtime/daemon.js +71 -9
- package/dist/runtime/db.js +33 -3
- package/dist/runtime/main.js +191 -30
- package/dist/runtime/netproxy.js +15 -3
- package/dist/runtime/view.js +262 -128
- package/dist/selftest/channel.test.js +38 -2
- package/dist/selftest/fixtures.d.ts +2 -1
- package/dist/selftest/index.js +2 -1
- package/dist/selftest/live-terminal.test.d.ts +2 -0
- package/dist/selftest/live-terminal.test.js +169 -0
- package/dist/selftest/local-config.test.js +28 -3
- package/dist/selftest/mirror.test.js +36 -7
- package/dist/selftest/projects.test.js +76 -7
- package/dist/shared/console-input.d.ts +11 -0
- package/dist/shared/console-input.js +61 -0
- package/dist/shared/download.d.ts +3 -0
- package/dist/shared/download.js +25 -2
- package/dist/shared/guest-paths.d.ts +27 -0
- package/dist/shared/guest-paths.js +68 -0
- package/dist/shared/projects.d.ts +27 -4
- package/dist/shared/projects.js +72 -13
- package/dist/shared/pty-client.d.ts +17 -0
- package/dist/shared/pty-client.js +65 -8
- package/dist/shared/schema.d.ts +24 -0
- package/dist/shared/schema.js +12 -0
- package/package.json +1 -1
- package/sandbox/ptyhost.cs +60 -3
- package/schemas/config.schema.json +15 -1
- package/schemas/sandbox-config.schema.json +4 -3
package/dist/runtime/view.js
CHANGED
|
@@ -1363,11 +1363,11 @@ var require_lodash = __commonJS({
|
|
|
1363
1363
|
return isFunction(object2[key]);
|
|
1364
1364
|
});
|
|
1365
1365
|
}
|
|
1366
|
-
function baseGet(object2,
|
|
1367
|
-
|
|
1368
|
-
var index = 0, length =
|
|
1366
|
+
function baseGet(object2, path4) {
|
|
1367
|
+
path4 = castPath(path4, object2);
|
|
1368
|
+
var index = 0, length = path4.length;
|
|
1369
1369
|
while (object2 != null && index < length) {
|
|
1370
|
-
object2 = object2[toKey(
|
|
1370
|
+
object2 = object2[toKey(path4[index++])];
|
|
1371
1371
|
}
|
|
1372
1372
|
return index && index == length ? object2 : undefined2;
|
|
1373
1373
|
}
|
|
@@ -1431,10 +1431,10 @@ var require_lodash = __commonJS({
|
|
|
1431
1431
|
});
|
|
1432
1432
|
return accumulator;
|
|
1433
1433
|
}
|
|
1434
|
-
function baseInvoke(object2,
|
|
1435
|
-
|
|
1436
|
-
object2 = parent(object2,
|
|
1437
|
-
var func = object2 == null ? object2 : object2[toKey(last(
|
|
1434
|
+
function baseInvoke(object2, path4, args) {
|
|
1435
|
+
path4 = castPath(path4, object2);
|
|
1436
|
+
object2 = parent(object2, path4);
|
|
1437
|
+
var func = object2 == null ? object2 : object2[toKey(last(path4))];
|
|
1438
1438
|
return func == null ? undefined2 : apply(func, object2, args);
|
|
1439
1439
|
}
|
|
1440
1440
|
function baseIsArguments(value) {
|
|
@@ -1590,13 +1590,13 @@ var require_lodash = __commonJS({
|
|
|
1590
1590
|
return object2 === source || baseIsMatch(object2, source, matchData);
|
|
1591
1591
|
};
|
|
1592
1592
|
}
|
|
1593
|
-
function baseMatchesProperty(
|
|
1594
|
-
if (isKey(
|
|
1595
|
-
return matchesStrictComparable(toKey(
|
|
1593
|
+
function baseMatchesProperty(path4, srcValue) {
|
|
1594
|
+
if (isKey(path4) && isStrictComparable(srcValue)) {
|
|
1595
|
+
return matchesStrictComparable(toKey(path4), srcValue);
|
|
1596
1596
|
}
|
|
1597
1597
|
return function(object2) {
|
|
1598
|
-
var objValue = get(object2,
|
|
1599
|
-
return objValue === undefined2 && objValue === srcValue ? hasIn(object2,
|
|
1598
|
+
var objValue = get(object2, path4);
|
|
1599
|
+
return objValue === undefined2 && objValue === srcValue ? hasIn(object2, path4) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
1600
1600
|
};
|
|
1601
1601
|
}
|
|
1602
1602
|
function baseMerge(object2, source, srcIndex, customizer, stack) {
|
|
@@ -1693,23 +1693,23 @@ var require_lodash = __commonJS({
|
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
function basePick(object2, paths) {
|
|
1696
|
-
return basePickBy(object2, paths, function(value,
|
|
1697
|
-
return hasIn(object2,
|
|
1696
|
+
return basePickBy(object2, paths, function(value, path4) {
|
|
1697
|
+
return hasIn(object2, path4);
|
|
1698
1698
|
});
|
|
1699
1699
|
}
|
|
1700
1700
|
function basePickBy(object2, paths, predicate) {
|
|
1701
1701
|
var index = -1, length = paths.length, result2 = {};
|
|
1702
1702
|
while (++index < length) {
|
|
1703
|
-
var
|
|
1704
|
-
if (predicate(value,
|
|
1705
|
-
baseSet(result2, castPath(
|
|
1703
|
+
var path4 = paths[index], value = baseGet(object2, path4);
|
|
1704
|
+
if (predicate(value, path4)) {
|
|
1705
|
+
baseSet(result2, castPath(path4, object2), value);
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
1708
1708
|
return result2;
|
|
1709
1709
|
}
|
|
1710
|
-
function basePropertyDeep(
|
|
1710
|
+
function basePropertyDeep(path4) {
|
|
1711
1711
|
return function(object2) {
|
|
1712
|
-
return baseGet(object2,
|
|
1712
|
+
return baseGet(object2, path4);
|
|
1713
1713
|
};
|
|
1714
1714
|
}
|
|
1715
1715
|
function basePullAll(array2, values2, iteratee2, comparator) {
|
|
@@ -1783,14 +1783,14 @@ var require_lodash = __commonJS({
|
|
|
1783
1783
|
var array2 = values(collection);
|
|
1784
1784
|
return shuffleSelf(array2, baseClamp(n, 0, array2.length));
|
|
1785
1785
|
}
|
|
1786
|
-
function baseSet(object2,
|
|
1786
|
+
function baseSet(object2, path4, value, customizer) {
|
|
1787
1787
|
if (!isObject2(object2)) {
|
|
1788
1788
|
return object2;
|
|
1789
1789
|
}
|
|
1790
|
-
|
|
1791
|
-
var index = -1, length =
|
|
1790
|
+
path4 = castPath(path4, object2);
|
|
1791
|
+
var index = -1, length = path4.length, lastIndex = length - 1, nested = object2;
|
|
1792
1792
|
while (nested != null && ++index < length) {
|
|
1793
|
-
var key = toKey(
|
|
1793
|
+
var key = toKey(path4[index]), newValue = value;
|
|
1794
1794
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
1795
1795
|
return object2;
|
|
1796
1796
|
}
|
|
@@ -1798,7 +1798,7 @@ var require_lodash = __commonJS({
|
|
|
1798
1798
|
var objValue = nested[key];
|
|
1799
1799
|
newValue = customizer ? customizer(objValue, key, nested) : undefined2;
|
|
1800
1800
|
if (newValue === undefined2) {
|
|
1801
|
-
newValue = isObject2(objValue) ? objValue : isIndex(
|
|
1801
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path4[index + 1]) ? [] : {};
|
|
1802
1802
|
}
|
|
1803
1803
|
}
|
|
1804
1804
|
assignValue(nested, key, newValue);
|
|
@@ -1964,14 +1964,14 @@ var require_lodash = __commonJS({
|
|
|
1964
1964
|
}
|
|
1965
1965
|
return result2;
|
|
1966
1966
|
}
|
|
1967
|
-
function baseUnset(object2,
|
|
1968
|
-
|
|
1969
|
-
var index = -1, length =
|
|
1967
|
+
function baseUnset(object2, path4) {
|
|
1968
|
+
path4 = castPath(path4, object2);
|
|
1969
|
+
var index = -1, length = path4.length;
|
|
1970
1970
|
if (!length) {
|
|
1971
1971
|
return true;
|
|
1972
1972
|
}
|
|
1973
1973
|
while (++index < length) {
|
|
1974
|
-
var key = toKey(
|
|
1974
|
+
var key = toKey(path4[index]);
|
|
1975
1975
|
if (key === "__proto__" && !hasOwnProperty.call(object2, "__proto__")) {
|
|
1976
1976
|
return false;
|
|
1977
1977
|
}
|
|
@@ -1979,11 +1979,11 @@ var require_lodash = __commonJS({
|
|
|
1979
1979
|
return false;
|
|
1980
1980
|
}
|
|
1981
1981
|
}
|
|
1982
|
-
var obj = parent(object2,
|
|
1983
|
-
return obj == null || delete obj[toKey(last(
|
|
1982
|
+
var obj = parent(object2, path4);
|
|
1983
|
+
return obj == null || delete obj[toKey(last(path4))];
|
|
1984
1984
|
}
|
|
1985
|
-
function baseUpdate(object2,
|
|
1986
|
-
return baseSet(object2,
|
|
1985
|
+
function baseUpdate(object2, path4, updater, customizer) {
|
|
1986
|
+
return baseSet(object2, path4, updater(baseGet(object2, path4)), customizer);
|
|
1987
1987
|
}
|
|
1988
1988
|
function baseWhile(array2, predicate, isDrop, fromRight) {
|
|
1989
1989
|
var length = array2.length, index = fromRight ? length : -1;
|
|
@@ -2866,11 +2866,11 @@ var require_lodash = __commonJS({
|
|
|
2866
2866
|
var match = source.match(reWrapDetails);
|
|
2867
2867
|
return match ? match[1].split(reSplitDetails) : [];
|
|
2868
2868
|
}
|
|
2869
|
-
function hasPath(object2,
|
|
2870
|
-
|
|
2871
|
-
var index = -1, length =
|
|
2869
|
+
function hasPath(object2, path4, hasFunc) {
|
|
2870
|
+
path4 = castPath(path4, object2);
|
|
2871
|
+
var index = -1, length = path4.length, result2 = false;
|
|
2872
2872
|
while (++index < length) {
|
|
2873
|
-
var key = toKey(
|
|
2873
|
+
var key = toKey(path4[index]);
|
|
2874
2874
|
if (!(result2 = object2 != null && hasFunc(object2, key))) {
|
|
2875
2875
|
break;
|
|
2876
2876
|
}
|
|
@@ -3072,8 +3072,8 @@ var require_lodash = __commonJS({
|
|
|
3072
3072
|
return apply(func, this, otherArgs);
|
|
3073
3073
|
};
|
|
3074
3074
|
}
|
|
3075
|
-
function parent(object2,
|
|
3076
|
-
return
|
|
3075
|
+
function parent(object2, path4) {
|
|
3076
|
+
return path4.length < 2 ? object2 : baseGet(object2, baseSlice(path4, 0, -1));
|
|
3077
3077
|
}
|
|
3078
3078
|
function reorder(array2, indexes) {
|
|
3079
3079
|
var arrLength = array2.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array2);
|
|
@@ -3708,10 +3708,10 @@ var require_lodash = __commonJS({
|
|
|
3708
3708
|
}
|
|
3709
3709
|
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
3710
3710
|
}
|
|
3711
|
-
var invokeMap = baseRest(function(collection,
|
|
3712
|
-
var index = -1, isFunc = typeof
|
|
3711
|
+
var invokeMap = baseRest(function(collection, path4, args) {
|
|
3712
|
+
var index = -1, isFunc = typeof path4 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
3713
3713
|
baseEach(collection, function(value) {
|
|
3714
|
-
result2[++index] = isFunc ? apply(
|
|
3714
|
+
result2[++index] = isFunc ? apply(path4, value, args) : baseInvoke(value, path4, args);
|
|
3715
3715
|
});
|
|
3716
3716
|
return result2;
|
|
3717
3717
|
});
|
|
@@ -4363,15 +4363,15 @@ var require_lodash = __commonJS({
|
|
|
4363
4363
|
function functionsIn(object2) {
|
|
4364
4364
|
return object2 == null ? [] : baseFunctions(object2, keysIn(object2));
|
|
4365
4365
|
}
|
|
4366
|
-
function get(object2,
|
|
4367
|
-
var result2 = object2 == null ? undefined2 : baseGet(object2,
|
|
4366
|
+
function get(object2, path4, defaultValue) {
|
|
4367
|
+
var result2 = object2 == null ? undefined2 : baseGet(object2, path4);
|
|
4368
4368
|
return result2 === undefined2 ? defaultValue : result2;
|
|
4369
4369
|
}
|
|
4370
|
-
function has(object2,
|
|
4371
|
-
return object2 != null && hasPath(object2,
|
|
4370
|
+
function has(object2, path4) {
|
|
4371
|
+
return object2 != null && hasPath(object2, path4, baseHas);
|
|
4372
4372
|
}
|
|
4373
|
-
function hasIn(object2,
|
|
4374
|
-
return object2 != null && hasPath(object2,
|
|
4373
|
+
function hasIn(object2, path4) {
|
|
4374
|
+
return object2 != null && hasPath(object2, path4, baseHasIn);
|
|
4375
4375
|
}
|
|
4376
4376
|
var invert = createInverter(function(result2, value, key) {
|
|
4377
4377
|
if (value != null && typeof value.toString != "function") {
|
|
@@ -4424,10 +4424,10 @@ var require_lodash = __commonJS({
|
|
|
4424
4424
|
return result2;
|
|
4425
4425
|
}
|
|
4426
4426
|
var isDeep = false;
|
|
4427
|
-
paths = arrayMap(paths, function(
|
|
4428
|
-
|
|
4429
|
-
isDeep || (isDeep =
|
|
4430
|
-
return
|
|
4427
|
+
paths = arrayMap(paths, function(path4) {
|
|
4428
|
+
path4 = castPath(path4, object2);
|
|
4429
|
+
isDeep || (isDeep = path4.length > 1);
|
|
4430
|
+
return path4;
|
|
4431
4431
|
});
|
|
4432
4432
|
copyObject(object2, getAllKeysIn(object2), result2);
|
|
4433
4433
|
if (isDeep) {
|
|
@@ -4453,19 +4453,19 @@ var require_lodash = __commonJS({
|
|
|
4453
4453
|
return [prop];
|
|
4454
4454
|
});
|
|
4455
4455
|
predicate = getIteratee(predicate);
|
|
4456
|
-
return basePickBy(object2, props, function(value,
|
|
4457
|
-
return predicate(value,
|
|
4456
|
+
return basePickBy(object2, props, function(value, path4) {
|
|
4457
|
+
return predicate(value, path4[0]);
|
|
4458
4458
|
});
|
|
4459
4459
|
}
|
|
4460
|
-
function result(object2,
|
|
4461
|
-
|
|
4462
|
-
var index = -1, length =
|
|
4460
|
+
function result(object2, path4, defaultValue) {
|
|
4461
|
+
path4 = castPath(path4, object2);
|
|
4462
|
+
var index = -1, length = path4.length;
|
|
4463
4463
|
if (!length) {
|
|
4464
4464
|
length = 1;
|
|
4465
4465
|
object2 = undefined2;
|
|
4466
4466
|
}
|
|
4467
4467
|
while (++index < length) {
|
|
4468
|
-
var value = object2 == null ? undefined2 : object2[toKey(
|
|
4468
|
+
var value = object2 == null ? undefined2 : object2[toKey(path4[index])];
|
|
4469
4469
|
if (value === undefined2) {
|
|
4470
4470
|
index = length;
|
|
4471
4471
|
value = defaultValue;
|
|
@@ -4474,12 +4474,12 @@ var require_lodash = __commonJS({
|
|
|
4474
4474
|
}
|
|
4475
4475
|
return object2;
|
|
4476
4476
|
}
|
|
4477
|
-
function set2(object2,
|
|
4478
|
-
return object2 == null ? object2 : baseSet(object2,
|
|
4477
|
+
function set2(object2, path4, value) {
|
|
4478
|
+
return object2 == null ? object2 : baseSet(object2, path4, value);
|
|
4479
4479
|
}
|
|
4480
|
-
function setWith(object2,
|
|
4480
|
+
function setWith(object2, path4, value, customizer) {
|
|
4481
4481
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4482
|
-
return object2 == null ? object2 : baseSet(object2,
|
|
4482
|
+
return object2 == null ? object2 : baseSet(object2, path4, value, customizer);
|
|
4483
4483
|
}
|
|
4484
4484
|
var toPairs = createToPairs(keys);
|
|
4485
4485
|
var toPairsIn = createToPairs(keysIn);
|
|
@@ -4501,15 +4501,15 @@ var require_lodash = __commonJS({
|
|
|
4501
4501
|
});
|
|
4502
4502
|
return accumulator;
|
|
4503
4503
|
}
|
|
4504
|
-
function unset(object2,
|
|
4505
|
-
return object2 == null ? true : baseUnset(object2,
|
|
4504
|
+
function unset(object2, path4) {
|
|
4505
|
+
return object2 == null ? true : baseUnset(object2, path4);
|
|
4506
4506
|
}
|
|
4507
|
-
function update(object2,
|
|
4508
|
-
return object2 == null ? object2 : baseUpdate(object2,
|
|
4507
|
+
function update(object2, path4, updater) {
|
|
4508
|
+
return object2 == null ? object2 : baseUpdate(object2, path4, castFunction(updater));
|
|
4509
4509
|
}
|
|
4510
|
-
function updateWith(object2,
|
|
4510
|
+
function updateWith(object2, path4, updater, customizer) {
|
|
4511
4511
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
4512
|
-
return object2 == null ? object2 : baseUpdate(object2,
|
|
4512
|
+
return object2 == null ? object2 : baseUpdate(object2, path4, castFunction(updater), customizer);
|
|
4513
4513
|
}
|
|
4514
4514
|
function values(object2) {
|
|
4515
4515
|
return object2 == null ? [] : baseValues(object2, keys(object2));
|
|
@@ -4895,17 +4895,17 @@ var require_lodash = __commonJS({
|
|
|
4895
4895
|
function matches(source) {
|
|
4896
4896
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
|
4897
4897
|
}
|
|
4898
|
-
function matchesProperty(
|
|
4899
|
-
return baseMatchesProperty(
|
|
4898
|
+
function matchesProperty(path4, srcValue) {
|
|
4899
|
+
return baseMatchesProperty(path4, baseClone(srcValue, CLONE_DEEP_FLAG));
|
|
4900
4900
|
}
|
|
4901
|
-
var method = baseRest(function(
|
|
4901
|
+
var method = baseRest(function(path4, args) {
|
|
4902
4902
|
return function(object2) {
|
|
4903
|
-
return baseInvoke(object2,
|
|
4903
|
+
return baseInvoke(object2, path4, args);
|
|
4904
4904
|
};
|
|
4905
4905
|
});
|
|
4906
4906
|
var methodOf = baseRest(function(object2, args) {
|
|
4907
|
-
return function(
|
|
4908
|
-
return baseInvoke(object2,
|
|
4907
|
+
return function(path4) {
|
|
4908
|
+
return baseInvoke(object2, path4, args);
|
|
4909
4909
|
};
|
|
4910
4910
|
});
|
|
4911
4911
|
function mixin(object2, source, options) {
|
|
@@ -4952,12 +4952,12 @@ var require_lodash = __commonJS({
|
|
|
4952
4952
|
var over = createOver(arrayMap);
|
|
4953
4953
|
var overEvery = createOver(arrayEvery);
|
|
4954
4954
|
var overSome = createOver(arraySome);
|
|
4955
|
-
function property(
|
|
4956
|
-
return isKey(
|
|
4955
|
+
function property(path4) {
|
|
4956
|
+
return isKey(path4) ? baseProperty(toKey(path4)) : basePropertyDeep(path4);
|
|
4957
4957
|
}
|
|
4958
4958
|
function propertyOf(object2) {
|
|
4959
|
-
return function(
|
|
4960
|
-
return object2 == null ? undefined2 : baseGet(object2,
|
|
4959
|
+
return function(path4) {
|
|
4960
|
+
return object2 == null ? undefined2 : baseGet(object2, path4);
|
|
4961
4961
|
};
|
|
4962
4962
|
}
|
|
4963
4963
|
var range = createRange();
|
|
@@ -5410,12 +5410,12 @@ var require_lodash = __commonJS({
|
|
|
5410
5410
|
LazyWrapper.prototype.findLast = function(predicate) {
|
|
5411
5411
|
return this.reverse().find(predicate);
|
|
5412
5412
|
};
|
|
5413
|
-
LazyWrapper.prototype.invokeMap = baseRest(function(
|
|
5414
|
-
if (typeof
|
|
5413
|
+
LazyWrapper.prototype.invokeMap = baseRest(function(path4, args) {
|
|
5414
|
+
if (typeof path4 == "function") {
|
|
5415
5415
|
return new LazyWrapper(this);
|
|
5416
5416
|
}
|
|
5417
5417
|
return this.map(function(value) {
|
|
5418
|
-
return baseInvoke(value,
|
|
5418
|
+
return baseInvoke(value, path4, args);
|
|
5419
5419
|
});
|
|
5420
5420
|
});
|
|
5421
5421
|
LazyWrapper.prototype.reject = function(predicate) {
|
|
@@ -5533,8 +5533,87 @@ var require_lodash = __commonJS({
|
|
|
5533
5533
|
|
|
5534
5534
|
// src/shared/pty-client.ts
|
|
5535
5535
|
import net from "node:net";
|
|
5536
|
+
|
|
5537
|
+
// src/shared/console-input.ts
|
|
5538
|
+
import { spawn } from "node:child_process";
|
|
5539
|
+
|
|
5540
|
+
// src/shared/system.ts
|
|
5541
|
+
import path from "node:path";
|
|
5542
|
+
var systemRoot = () => process.env.SystemRoot ?? process.env.WINDIR ?? "C:\\Windows";
|
|
5543
|
+
var system32 = (exe) => path.join(systemRoot(), "System32", exe);
|
|
5544
|
+
var SYSTEM = {
|
|
5545
|
+
cmd: () => system32("cmd.exe"),
|
|
5546
|
+
powershell: () => system32("WindowsPowerShell\\v1.0\\powershell.exe"),
|
|
5547
|
+
tasklist: () => system32("tasklist.exe"),
|
|
5548
|
+
tar: () => system32("tar.exe"),
|
|
5549
|
+
reg: () => system32("reg.exe"),
|
|
5550
|
+
netsh: () => system32("netsh.exe"),
|
|
5551
|
+
netstat: () => system32("NETSTAT.EXE"),
|
|
5552
|
+
route: () => system32("ROUTE.EXE"),
|
|
5553
|
+
ipconfig: () => system32("ipconfig.exe"),
|
|
5554
|
+
robocopy: () => system32("Robocopy.exe"),
|
|
5555
|
+
shutdown: () => system32("shutdown.exe"),
|
|
5556
|
+
dism: () => system32("Dism.exe"),
|
|
5557
|
+
msiexec: () => system32("msiexec.exe")
|
|
5558
|
+
};
|
|
5559
|
+
|
|
5560
|
+
// src/shared/console-input.ts
|
|
5561
|
+
var script = (pid) => [
|
|
5562
|
+
'Add-Type -TypeDefinition @"',
|
|
5563
|
+
"using System; using System.Runtime.InteropServices;",
|
|
5564
|
+
"public static class SbxVtInput {",
|
|
5565
|
+
' [DllImport("kernel32.dll")] static extern bool FreeConsole();',
|
|
5566
|
+
' [DllImport("kernel32.dll")] static extern bool AttachConsole(uint pid);',
|
|
5567
|
+
' [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] static extern IntPtr CreateFileW(string name, uint access, uint share, IntPtr security, uint creation, uint flags, IntPtr template);',
|
|
5568
|
+
' [DllImport("kernel32.dll")] static extern bool GetConsoleMode(IntPtr handle, out uint mode);',
|
|
5569
|
+
' [DllImport("kernel32.dll")] static extern bool SetConsoleMode(IntPtr handle, uint mode);',
|
|
5570
|
+
' [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr handle);',
|
|
5571
|
+
" public static int On(uint pid) {",
|
|
5572
|
+
" FreeConsole();",
|
|
5573
|
+
" if (!AttachConsole(pid)) return 2;",
|
|
5574
|
+
' IntPtr input = CreateFileW("CONIN$", 0xC0000000, 3, IntPtr.Zero, 3, 0, IntPtr.Zero);',
|
|
5575
|
+
" if (input == new IntPtr(-1)) return 3;",
|
|
5576
|
+
" uint mode; bool ok = GetConsoleMode(input, out mode) && SetConsoleMode(input, mode | 0x200);",
|
|
5577
|
+
" CloseHandle(input);",
|
|
5578
|
+
" FreeConsole();",
|
|
5579
|
+
" return ok ? 0 : 4;",
|
|
5580
|
+
" }",
|
|
5581
|
+
"}",
|
|
5582
|
+
'"@',
|
|
5583
|
+
"exit [SbxVtInput]::On(" + pid + ")"
|
|
5584
|
+
].join("\n");
|
|
5585
|
+
var enableVtInput = () => {
|
|
5586
|
+
if (process.platform !== "win32" || !process.stdin.isTTY) return { ready: Promise.resolve(false), stop: () => Promise.resolve() };
|
|
5587
|
+
let child = null;
|
|
5588
|
+
let exited = Promise.resolve();
|
|
5589
|
+
const ready = new Promise((resolve) => {
|
|
5590
|
+
try {
|
|
5591
|
+
child = spawn(SYSTEM.powershell(), ["-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", Buffer.from(script(process.pid), "utf16le").toString("base64")], { stdio: "ignore", windowsHide: true });
|
|
5592
|
+
} catch {
|
|
5593
|
+
resolve(false);
|
|
5594
|
+
return;
|
|
5595
|
+
}
|
|
5596
|
+
exited = new Promise((done) => {
|
|
5597
|
+
child?.on("exit", (code) => {
|
|
5598
|
+
resolve(code === 0);
|
|
5599
|
+
done();
|
|
5600
|
+
});
|
|
5601
|
+
child?.on("error", () => {
|
|
5602
|
+
resolve(false);
|
|
5603
|
+
done();
|
|
5604
|
+
});
|
|
5605
|
+
});
|
|
5606
|
+
});
|
|
5607
|
+
return { ready, stop: () => {
|
|
5608
|
+
if (child && child.exitCode === null && child.signalCode === null) child.kill();
|
|
5609
|
+
return exited;
|
|
5610
|
+
} };
|
|
5611
|
+
};
|
|
5612
|
+
|
|
5613
|
+
// src/shared/pty-client.ts
|
|
5536
5614
|
var FrameType = { Hello: 1, Input: 2, Resize: 3, Restart: 4, Ping: 5, Output: 16, Exit: 17, Error: 18, Restarting: 19, Status: 20, Console: 21 };
|
|
5537
5615
|
var PING_INTERVAL_MS = 5e3;
|
|
5616
|
+
var MOUSE_OFF = "\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1005l\x1B[?1006l\x1B[?1015l";
|
|
5538
5617
|
var encodeFrame = (type, payload = Buffer.alloc(0)) => {
|
|
5539
5618
|
const header = Buffer.alloc(5);
|
|
5540
5619
|
header.writeUInt8(type, 0);
|
|
@@ -5710,6 +5789,34 @@ var fixWindowsKeys = (chunk) => {
|
|
|
5710
5789
|
if (!chunk.includes(8) && !chunk.includes(127)) return chunk;
|
|
5711
5790
|
return Buffer.from(chunk.map((b) => b === 8 ? 127 : b === 127 ? 8 : b));
|
|
5712
5791
|
};
|
|
5792
|
+
var JOIN_MS = 30;
|
|
5793
|
+
var MAX_HELD = 64;
|
|
5794
|
+
var InputJoiner = class {
|
|
5795
|
+
held = Buffer.alloc(0);
|
|
5796
|
+
/** The bytes to send now; an unfinished sequence at the end is kept for the next chunk. */
|
|
5797
|
+
push(chunk) {
|
|
5798
|
+
const data = this.held.length ? Buffer.concat([this.held, chunk]) : chunk;
|
|
5799
|
+
const cut = unfinishedSequence(data);
|
|
5800
|
+
this.held = Buffer.from(data.subarray(cut));
|
|
5801
|
+
return data.subarray(0, cut);
|
|
5802
|
+
}
|
|
5803
|
+
holding() {
|
|
5804
|
+
return this.held.length > 0;
|
|
5805
|
+
}
|
|
5806
|
+
flush() {
|
|
5807
|
+
const out = this.held;
|
|
5808
|
+
this.held = Buffer.alloc(0);
|
|
5809
|
+
return out;
|
|
5810
|
+
}
|
|
5811
|
+
};
|
|
5812
|
+
var unfinishedSequence = (data) => {
|
|
5813
|
+
const start = data.lastIndexOf(27, -1);
|
|
5814
|
+
if (start === -1 || data.length - start > MAX_HELD) return data.length;
|
|
5815
|
+
const rest = data.subarray(start + 1);
|
|
5816
|
+
if (rest.length === 0) return start;
|
|
5817
|
+
if (rest[0] === 91 || rest[0] === 79) return rest.subarray(1).every((b) => b >= 32 && b <= 63) && (rest[0] === 91 || rest.length === 1) ? start : data.length;
|
|
5818
|
+
return data.length;
|
|
5819
|
+
};
|
|
5713
5820
|
var runTerminalClient = (socket, token, options = {}) => {
|
|
5714
5821
|
const stdin = process.stdin;
|
|
5715
5822
|
const stdout = process.stdout;
|
|
@@ -5717,13 +5824,14 @@ var runTerminalClient = (socket, token, options = {}) => {
|
|
|
5717
5824
|
const [c, r] = stdout.isTTY ? stdout.getWindowSize() : [0, 0];
|
|
5718
5825
|
return [c || 120, r || 30];
|
|
5719
5826
|
};
|
|
5720
|
-
|
|
5827
|
+
let swapKeys = process.platform === "win32" && stdin.isTTY;
|
|
5721
5828
|
return new Promise((resolve) => {
|
|
5722
5829
|
let done = false;
|
|
5723
5830
|
const reader = new FrameReader();
|
|
5724
5831
|
const filter = new OutputFilter();
|
|
5725
5832
|
let sent = size();
|
|
5726
5833
|
let resizeTimer;
|
|
5834
|
+
let vtInput;
|
|
5727
5835
|
const finish = (result) => {
|
|
5728
5836
|
if (done) return;
|
|
5729
5837
|
done = true;
|
|
@@ -5732,18 +5840,28 @@ var runTerminalClient = (socket, token, options = {}) => {
|
|
|
5732
5840
|
clearTimeout(resizeTimer);
|
|
5733
5841
|
clearInterval(heartbeat);
|
|
5734
5842
|
clearInterval(sizeWatch);
|
|
5735
|
-
|
|
5736
|
-
stdin.pause();
|
|
5843
|
+
clearTimeout(joinTimer);
|
|
5737
5844
|
socket.destroy();
|
|
5738
|
-
stdout.write("\x1B[0m\x1B[?25h\r\n");
|
|
5739
|
-
resolve(
|
|
5845
|
+
stdout.write("\x1B[0m\x1B[?25h" + MOUSE_OFF + "\r\n");
|
|
5846
|
+
void (vtInput?.stop() ?? Promise.resolve()).then(() => {
|
|
5847
|
+
if (stdin.isTTY) stdin.setRawMode(false);
|
|
5848
|
+
stdin.pause();
|
|
5849
|
+
resolve(result);
|
|
5850
|
+
});
|
|
5851
|
+
};
|
|
5852
|
+
const joiner = new InputJoiner();
|
|
5853
|
+
let joinTimer;
|
|
5854
|
+
const sendInput = (data) => {
|
|
5855
|
+
if (data.length && !done) socket.write(encodeFrame(FrameType.Input, swapKeys ? fixWindowsKeys(data) : data));
|
|
5740
5856
|
};
|
|
5741
5857
|
const onInput = (chunk) => {
|
|
5742
5858
|
if (options.detachKey !== void 0 && chunk.includes(options.detachKey)) {
|
|
5743
5859
|
finish({ reason: "detach" });
|
|
5744
5860
|
return;
|
|
5745
5861
|
}
|
|
5746
|
-
|
|
5862
|
+
clearTimeout(joinTimer);
|
|
5863
|
+
sendInput(joiner.push(chunk));
|
|
5864
|
+
if (joiner.holding()) joinTimer = setTimeout(() => sendInput(joiner.flush()), JOIN_MS);
|
|
5747
5865
|
};
|
|
5748
5866
|
let passthrough = false;
|
|
5749
5867
|
const sendSize = () => {
|
|
@@ -5775,7 +5893,7 @@ var runTerminalClient = (socket, token, options = {}) => {
|
|
|
5775
5893
|
for (const frame of frames) {
|
|
5776
5894
|
if (frame.type === FrameType.Output) stdout.write(filter.push(frame.payload));
|
|
5777
5895
|
else if (frame.type === FrameType.Console) passthrough = frame.payload.toString("latin1") === "conpty.dll";
|
|
5778
|
-
else if (frame.type === FrameType.Restarting) stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
5896
|
+
else if (frame.type === FrameType.Restarting) stdout.write(MOUSE_OFF + "\x1B[2J\x1B[3J\x1B[H");
|
|
5779
5897
|
else if (frame.type === FrameType.Exit) finish({ reason: "exit", exitCode: frame.payload.length >= 4 ? frame.payload.readInt32LE(0) : 1 });
|
|
5780
5898
|
else if (frame.type === FrameType.Error) finish({ reason: "error", message: frame.payload.toString("utf8").slice(0, 500).replace(/[\x00-\x1f\x7f]/g, " ") });
|
|
5781
5899
|
}
|
|
@@ -5786,6 +5904,10 @@ var runTerminalClient = (socket, token, options = {}) => {
|
|
|
5786
5904
|
stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
5787
5905
|
socket.write(helloFrame(token, c, r));
|
|
5788
5906
|
if (stdin.isTTY) stdin.setRawMode(true);
|
|
5907
|
+
vtInput = enableVtInput();
|
|
5908
|
+
void vtInput.ready.then((on) => {
|
|
5909
|
+
if (on) swapKeys = false;
|
|
5910
|
+
});
|
|
5789
5911
|
stdin.on("data", onInput);
|
|
5790
5912
|
stdin.resume();
|
|
5791
5913
|
stdout.on("resize", onResize);
|
|
@@ -5794,7 +5916,7 @@ var runTerminalClient = (socket, token, options = {}) => {
|
|
|
5794
5916
|
|
|
5795
5917
|
// src/shared/rundir.ts
|
|
5796
5918
|
import fs from "node:fs";
|
|
5797
|
-
import
|
|
5919
|
+
import path2 from "node:path";
|
|
5798
5920
|
|
|
5799
5921
|
// node_modules/zod/v4/classic/external.js
|
|
5800
5922
|
var external_exports = {};
|
|
@@ -6612,10 +6734,10 @@ function mergeDefs(...defs) {
|
|
|
6612
6734
|
function cloneDef(schema) {
|
|
6613
6735
|
return mergeDefs(schema._zod.def);
|
|
6614
6736
|
}
|
|
6615
|
-
function getElementAtPath(obj,
|
|
6616
|
-
if (!
|
|
6737
|
+
function getElementAtPath(obj, path4) {
|
|
6738
|
+
if (!path4)
|
|
6617
6739
|
return obj;
|
|
6618
|
-
return
|
|
6740
|
+
return path4.reduce((acc, key) => acc?.[key], obj);
|
|
6619
6741
|
}
|
|
6620
6742
|
function promiseAllObject(promisesObj) {
|
|
6621
6743
|
const keys = Object.keys(promisesObj);
|
|
@@ -6955,11 +7077,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
6955
7077
|
}
|
|
6956
7078
|
return false;
|
|
6957
7079
|
}
|
|
6958
|
-
function prefixIssues(
|
|
7080
|
+
function prefixIssues(path4, issues) {
|
|
6959
7081
|
return issues.map((iss) => {
|
|
6960
7082
|
var _a3;
|
|
6961
7083
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
6962
|
-
iss.path.unshift(
|
|
7084
|
+
iss.path.unshift(path4);
|
|
6963
7085
|
return iss;
|
|
6964
7086
|
});
|
|
6965
7087
|
}
|
|
@@ -7409,16 +7531,16 @@ function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
|
7409
7531
|
}
|
|
7410
7532
|
function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
7411
7533
|
const fieldErrors = { _errors: [] };
|
|
7412
|
-
const processError = (error63,
|
|
7534
|
+
const processError = (error63, path4 = []) => {
|
|
7413
7535
|
for (const issue2 of error63.issues) {
|
|
7414
7536
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7415
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
7537
|
+
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
7416
7538
|
} else if (issue2.code === "invalid_key") {
|
|
7417
|
-
processError({ issues: issue2.issues }, [...
|
|
7539
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
7418
7540
|
} else if (issue2.code === "invalid_element") {
|
|
7419
|
-
processError({ issues: issue2.issues }, [...
|
|
7541
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
7420
7542
|
} else {
|
|
7421
|
-
const fullpath = [...
|
|
7543
|
+
const fullpath = [...path4, ...issue2.path];
|
|
7422
7544
|
if (fullpath.length === 0) {
|
|
7423
7545
|
fieldErrors._errors.push(mapper(issue2));
|
|
7424
7546
|
} else {
|
|
@@ -7457,17 +7579,17 @@ function formatError(error62, mapper = (issue2) => issue2.message) {
|
|
|
7457
7579
|
}
|
|
7458
7580
|
function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
7459
7581
|
const result = { errors: [] };
|
|
7460
|
-
const processError = (error63,
|
|
7582
|
+
const processError = (error63, path4 = []) => {
|
|
7461
7583
|
var _a3;
|
|
7462
7584
|
for (const issue2 of error63.issues) {
|
|
7463
7585
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
7464
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
7586
|
+
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
7465
7587
|
} else if (issue2.code === "invalid_key") {
|
|
7466
|
-
processError({ issues: issue2.issues }, [...
|
|
7588
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
7467
7589
|
} else if (issue2.code === "invalid_element") {
|
|
7468
|
-
processError({ issues: issue2.issues }, [...
|
|
7590
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
7469
7591
|
} else {
|
|
7470
|
-
const fullpath = [...
|
|
7592
|
+
const fullpath = [...path4, ...issue2.path];
|
|
7471
7593
|
if (fullpath.length === 0) {
|
|
7472
7594
|
result.errors.push(mapper(issue2));
|
|
7473
7595
|
continue;
|
|
@@ -7506,8 +7628,8 @@ function treeifyError(error62, mapper = (issue2) => issue2.message) {
|
|
|
7506
7628
|
}
|
|
7507
7629
|
function toDotPath(_path) {
|
|
7508
7630
|
const segs = [];
|
|
7509
|
-
const
|
|
7510
|
-
for (const seg of
|
|
7631
|
+
const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
7632
|
+
for (const seg of path4) {
|
|
7511
7633
|
if (typeof seg === "number")
|
|
7512
7634
|
segs.push(`[${seg}]`);
|
|
7513
7635
|
else if (typeof seg === "symbol")
|
|
@@ -24609,13 +24731,13 @@ function resolveRef(ref, ctx) {
|
|
|
24609
24731
|
if (!ref.startsWith("#")) {
|
|
24610
24732
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
24611
24733
|
}
|
|
24612
|
-
const
|
|
24613
|
-
if (
|
|
24734
|
+
const path4 = ref.slice(1).split("/").filter(Boolean);
|
|
24735
|
+
if (path4.length === 0) {
|
|
24614
24736
|
return ctx.rootSchema;
|
|
24615
24737
|
}
|
|
24616
24738
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
24617
|
-
if (
|
|
24618
|
-
const key =
|
|
24739
|
+
if (path4[0] === defsKey) {
|
|
24740
|
+
const key = path4[1] === void 0 ? void 0 : decodeJSONPointerSegment(path4[1]);
|
|
24619
24741
|
if (!key || !ctx.defs[key]) {
|
|
24620
24742
|
throw new Error(`Reference not found: ${ref}`);
|
|
24621
24743
|
}
|
|
@@ -25578,7 +25700,7 @@ var ClaudeProfile = external_exports.strictObject({
|
|
|
25578
25700
|
var GuestWorkspace = external_exports.union([external_exports.literal("auto"), external_exports.literal("mirror"), GuestPath]).describe('Where the workspace appears inside the sandbox. "auto" = C:\\Workspace\\<folder name>. "mirror" = the same path as on this PC, so absolute paths in configs and build caches match (another drive letter such as F: is a subst drive onto C:\\Mirror\\F); paths the sandbox reserves (C:\\Users\\..., C:\\Program Files\\...) fall back to "auto".');
|
|
25579
25701
|
var Mapping = external_exports.strictObject({
|
|
25580
25702
|
host: external_exports.string().min(1).describe("Folder on this PC (relative paths are relative to the config file)."),
|
|
25581
|
-
guest:
|
|
25703
|
+
guest: external_exports.string().min(1).max(1024).optional().describe("Where it appears inside the sandbox, e.g. C:\\Assets, or on another drive letter (D: to Z:) such as F:\\SteamLibrary\\steamapps\\common\\Game (shown as F: at boot). Leave it out to use the same path as on this PC (a folder inside the project stays where it is in the project). A path the sandbox cannot use (C:\\Windows\\..., C:\\Users\\..., one already in use) goes to C:\\Mapped\\<drive>\\<path> instead, and the launch says so."),
|
|
25582
25704
|
readOnly: external_exports.boolean().describe("true = the agent can only read it."),
|
|
25583
25705
|
optional: external_exports.boolean().optional().describe("true = skip it quietly when the host folder does not exist.")
|
|
25584
25706
|
});
|
|
@@ -25835,6 +25957,7 @@ var Projects = external_exports.strictObject({
|
|
|
25835
25957
|
roots: external_exports.array(external_exports.string().min(1)).describe('Folders whose subfolders are your projects (e.g. "F:\\\\Code"), mapped read/write at every start. Any project inside one, including ones you create later, opens in the running sandbox at once, without a restart. Every agent in the sandbox can see all of them.'),
|
|
25836
25958
|
askToAddRoot: external_exports.boolean().describe("When you start a project whose parent folder is not a root yet, ask once whether to add it."),
|
|
25837
25959
|
declinedRoots: external_exports.array(external_exports.string().min(1)).describe("Parent folders you said no to (not asked again)."),
|
|
25960
|
+
allowOutsideMappings: external_exports.union([external_exports.literal("ask"), external_exports.boolean()]).describe(`A project's .sandbox-config.json may map folders from outside the project (e.g. a game folder on another drive). "ask" = an interactive launch asks once per project and set of folders, and remembers your answer; true = always allowed (still listed when you approve the file); false = never (the launch stops and says which folders). Only your own settings decide this, never a project file.`),
|
|
25838
25961
|
wsbShare: external_exports.boolean().describe("On Windows 11 24H2+ with the Windows Sandbox command line (wsb), add other folders to the running sandbox with `wsb share` (untested). Otherwise starting a project outside every root offers a restart.")
|
|
25839
25962
|
});
|
|
25840
25963
|
|
|
@@ -25877,7 +26000,7 @@ var LocalOverrides = external_exports.strictObject({
|
|
|
25877
26000
|
readOnly: external_exports.boolean().describe("Map this project read-only."),
|
|
25878
26001
|
// A project may turn the filter on and keep more out, never let ignored files in.
|
|
25879
26002
|
workspaceFilter: WorkspaceFilter.pick({ enabled: true, exclude: true }).partial(),
|
|
25880
|
-
mappings: external_exports.array(Mapping).describe("Extra folders
|
|
26003
|
+
mappings: external_exports.array(Mapping).describe("Extra folders (relative paths are relative to this file), e.g. a read-only data folder at another place in the sandbox. Folders outside the project are used only as your projects.allowOutsideMappings setting allows (by default you are asked once)."),
|
|
25881
26004
|
scripts: Strings.describe("Scripts (.ps1 / .mjs / .cmd, relative to this file) run inside the sandbox before the agent."),
|
|
25882
26005
|
// This PC's resources are yours to share: CPU and paging file (this PC's disk) are not a project's to set.
|
|
25883
26006
|
sandbox: Sandbox.omit({ cpuLimit: true, pageFileMb: true }).partial(),
|
|
@@ -25908,6 +26031,15 @@ var AttachEndpoint = external_exports.strictObject({
|
|
|
25908
26031
|
port: external_exports.number().int().min(1024).max(65535),
|
|
25909
26032
|
token: Text(256)
|
|
25910
26033
|
});
|
|
26034
|
+
var BootProgress = external_exports.strictObject({
|
|
26035
|
+
step: external_exports.number().int().min(1).max(32),
|
|
26036
|
+
steps: external_exports.number().int().min(1).max(32),
|
|
26037
|
+
title: Text(120),
|
|
26038
|
+
/** Being set up now; percent while it downloads (when the size is known). */
|
|
26039
|
+
active: external_exports.array(external_exports.strictObject({ name: Text(64), percent: external_exports.number().int().min(0).max(100).optional() })).max(8),
|
|
26040
|
+
done: external_exports.number().int().min(0).max(1e3),
|
|
26041
|
+
total: external_exports.number().int().min(0).max(1e3)
|
|
26042
|
+
});
|
|
25911
26043
|
var SandboxStatus = external_exports.object({
|
|
25912
26044
|
launchId: Text(64),
|
|
25913
26045
|
phase: external_exports.enum(["booting", "provisioning", "ready", "failed"]),
|
|
@@ -25917,7 +26049,9 @@ var SandboxStatus = external_exports.object({
|
|
|
25917
26049
|
guestWorkspace: Text(),
|
|
25918
26050
|
headless: external_exports.boolean(),
|
|
25919
26051
|
/** The sandbox's IPv4 addresses (for network.forwardPorts; the host only uses ones on its Hyper-V network). */
|
|
25920
|
-
addresses: external_exports.array(external_exports.string().max(45)).max(8).optional()
|
|
26052
|
+
addresses: external_exports.array(external_exports.string().max(45)).max(8).optional(),
|
|
26053
|
+
/** A malformed progress is dropped, never the status (the phase still counts). */
|
|
26054
|
+
progress: BootProgress.optional().catch(void 0)
|
|
25921
26055
|
});
|
|
25922
26056
|
var Version = external_exports.strictObject({ spec: Text(128), source: Text(256) });
|
|
25923
26057
|
var DatabasePlan = external_exports.strictObject({
|
|
@@ -25986,17 +26120,17 @@ var ProjectStatus = external_exports.object({
|
|
|
25986
26120
|
var MAX_MESSAGE_BYTES = 8 * 1024 * 1024;
|
|
25987
26121
|
var safeId = (id) => Id.parse(id);
|
|
25988
26122
|
var runPaths = (dataDir2) => {
|
|
25989
|
-
const run2 =
|
|
25990
|
-
const file2 = (dir) => (id) =>
|
|
26123
|
+
const run2 = path2.join(dataDir2, "run");
|
|
26124
|
+
const file2 = (dir) => (id) => path2.join(run2, dir, safeId(id) + ".json");
|
|
25991
26125
|
return {
|
|
25992
26126
|
run: run2,
|
|
25993
|
-
sandbox:
|
|
25994
|
-
requests:
|
|
25995
|
-
responses:
|
|
25996
|
-
sessions:
|
|
25997
|
-
projects:
|
|
26127
|
+
sandbox: path2.join(run2, "sandbox.json"),
|
|
26128
|
+
requests: path2.join(run2, "requests"),
|
|
26129
|
+
responses: path2.join(run2, "responses"),
|
|
26130
|
+
sessions: path2.join(run2, "sessions"),
|
|
26131
|
+
projects: path2.join(run2, "projects"),
|
|
25998
26132
|
/** audit.processes: programs the sandbox started, in small .jsonl files the host takes in and deletes. */
|
|
25999
|
-
audit:
|
|
26133
|
+
audit: path2.join(run2, "audit"),
|
|
26000
26134
|
request: file2("requests"),
|
|
26001
26135
|
response: file2("responses"),
|
|
26002
26136
|
session: file2("sessions"),
|
|
@@ -26019,7 +26153,7 @@ var readSession = (dataDir2, id) => readValid(SessionStatus, runPaths(dataDir2).
|
|
|
26019
26153
|
|
|
26020
26154
|
// src/guest/env.ts
|
|
26021
26155
|
import fs2 from "node:fs";
|
|
26022
|
-
import
|
|
26156
|
+
import path3 from "node:path";
|
|
26023
26157
|
|
|
26024
26158
|
// src/shared/download.ts
|
|
26025
26159
|
var checksumRequired = false;
|
|
@@ -26035,16 +26169,16 @@ var launchDir = process.env.AGENT_LAUNCH_DIR ?? "C:\\AgentLaunch";
|
|
|
26035
26169
|
var dataDir = process.env.AGENT_DATA_DIR ?? "C:\\AgentData";
|
|
26036
26170
|
var hostToolsDir = process.env.AGENT_HOST_TOOLS_DIR ?? "C:\\HostTools";
|
|
26037
26171
|
var localDir = process.env.AGENT_LOCAL_DIR ?? "C:\\nvm";
|
|
26038
|
-
var toolsDir =
|
|
26039
|
-
var logsDir =
|
|
26172
|
+
var toolsDir = path3.join(dataDir, "tools");
|
|
26173
|
+
var logsDir = path3.join(dataDir, "logs");
|
|
26040
26174
|
var run = runPaths(dataDir);
|
|
26041
|
-
var session = JSON.parse(fs2.readFileSync(
|
|
26175
|
+
var session = JSON.parse(fs2.readFileSync(path3.join(launchDir, "session.json"), "utf8").replace(/^\uFEFF/, ""));
|
|
26042
26176
|
setChecksumRequired(session.downloads?.requireChecksum === true);
|
|
26043
26177
|
var workspace = process.env.AGENT_WORKSPACE ?? session.workspace;
|
|
26044
|
-
var stateDir =
|
|
26045
|
-
var claudeDir =
|
|
26178
|
+
var stateDir = path3.join(dataDir, session.persistAgentState ? "state" : "state-session");
|
|
26179
|
+
var claudeDir = path3.join(stateDir, "claude");
|
|
26046
26180
|
fs2.mkdirSync(logsDir, { recursive: true });
|
|
26047
|
-
var logFile =
|
|
26181
|
+
var logFile = path3.join(logsDir, (process.env.AGENT_LOG_PREFIX ?? "guest") + "-" + (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-") + ".log");
|
|
26048
26182
|
|
|
26049
26183
|
// src/guest/view.ts
|
|
26050
26184
|
var waitUntilStarted = async (id) => {
|