@ai-hero/sandcastle 0.12.0 → 0.14.0
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/README.md +15 -1368
- package/dist/LinuxCapability-B_PQfsY_.d.ts +32 -0
- package/dist/{SandboxProvider-EkSMuBp8.d.ts → SandboxProvider-Chsi-Zs6.d.ts} +31 -3
- package/dist/{chunk-NGBM7T3E.js → chunk-6NQPCXSG.js} +5 -2
- package/dist/chunk-6NQPCXSG.js.map +1 -0
- package/dist/chunk-7N7AMUYA.js +353 -0
- package/dist/chunk-7N7AMUYA.js.map +1 -0
- package/dist/chunk-ATA2V2TC.js +112 -0
- package/dist/chunk-ATA2V2TC.js.map +1 -0
- package/dist/chunk-BIF2X6QB.js +94 -0
- package/dist/chunk-BIF2X6QB.js.map +1 -0
- package/dist/{chunk-BIWNFKGV.js → chunk-BVZWLFFT.js} +2 -2
- package/dist/chunk-BVZWLFFT.js.map +1 -0
- package/dist/chunk-EXYXBRCX.js +60 -0
- package/dist/chunk-EXYXBRCX.js.map +1 -0
- package/dist/chunk-G2R53CVZ.js +3172 -0
- package/dist/chunk-G2R53CVZ.js.map +1 -0
- package/dist/{chunk-CP3TYXZA.js → chunk-GCLEXPXG.js} +95 -85
- package/dist/chunk-GCLEXPXG.js.map +1 -0
- package/dist/chunk-H2PEFS4W.js +1244 -0
- package/dist/chunk-H2PEFS4W.js.map +1 -0
- package/dist/chunk-HSXPRZKG.js +150 -0
- package/dist/chunk-HSXPRZKG.js.map +1 -0
- package/dist/chunk-IBK2XNSS.js +50 -0
- package/dist/chunk-IBK2XNSS.js.map +1 -0
- package/dist/chunk-RDW7FNN6.js +792 -0
- package/dist/chunk-RDW7FNN6.js.map +1 -0
- package/dist/{chunk-DJRHWPEH.js → chunk-S6UHPTRG.js} +284 -352
- package/dist/chunk-S6UHPTRG.js.map +1 -0
- package/dist/{chunk-VOG34SRF.js → chunk-STB2U7BB.js} +11823 -6977
- package/dist/chunk-STB2U7BB.js.map +1 -0
- package/dist/chunk-VRXR2T3S.js +24 -0
- package/dist/chunk-VRXR2T3S.js.map +1 -0
- package/dist/index.d.ts +241 -26
- package/dist/index.js +1082 -1679
- package/dist/index.js.map +1 -1
- package/dist/main.js +1248 -854
- package/dist/main.js.map +1 -1
- package/dist/sandboxes/bwrap.d.ts +58 -0
- package/dist/sandboxes/bwrap.js +296 -0
- package/dist/sandboxes/bwrap.js.map +1 -0
- package/dist/sandboxes/daytona.d.ts +1 -1
- package/dist/sandboxes/daytona.js +203 -98
- package/dist/sandboxes/daytona.js.map +1 -1
- package/dist/sandboxes/docker.d.ts +18 -4
- package/dist/sandboxes/docker.js +7 -4
- package/dist/sandboxes/e2b.d.ts +41 -0
- package/dist/sandboxes/e2b.js +202 -0
- package/dist/sandboxes/e2b.js.map +1 -0
- package/dist/sandboxes/modal.d.ts +78 -0
- package/dist/sandboxes/modal.js +171 -0
- package/dist/sandboxes/modal.js.map +1 -0
- package/dist/sandboxes/no-sandbox.d.ts +1 -1
- package/dist/sandboxes/no-sandbox.js +2 -2
- package/dist/sandboxes/podman.d.ts +18 -4
- package/dist/sandboxes/podman.js +72 -56
- package/dist/sandboxes/podman.js.map +1 -1
- package/dist/sandboxes/seatbelt.d.ts +65 -0
- package/dist/sandboxes/seatbelt.js +425 -0
- package/dist/sandboxes/seatbelt.js.map +1 -0
- package/dist/sandboxes/sprites.d.ts +54 -0
- package/dist/sandboxes/sprites.js +198 -0
- package/dist/sandboxes/sprites.js.map +1 -0
- package/dist/sandboxes/vercel.d.ts +12 -5
- package/dist/sandboxes/vercel.js +195 -126
- package/dist/sandboxes/vercel.js.map +1 -1
- package/dist/templates/parallel-planner/main.mts +13 -22
- package/dist/templates/parallel-planner-with-review/main.mts +13 -15
- package/package.json +63 -11
- package/dist/chunk-62WN33RK.js +0 -104
- package/dist/chunk-62WN33RK.js.map +0 -1
- package/dist/chunk-BIWNFKGV.js.map +0 -1
- package/dist/chunk-CP3TYXZA.js.map +0 -1
- package/dist/chunk-DJRHWPEH.js.map +0 -1
- package/dist/chunk-NGBM7T3E.js.map +0 -1
- package/dist/chunk-VOG34SRF.js.map +0 -1
- package/dist/mountUtils-CCA-bbpK.d.ts +0 -25
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import 'stream';
|
|
2
|
+
import { FileSystem, Path, TypeId, makeRunMain, WatchBackend, make, BadArgument, CommandExecutor, makeExecutor, Terminal, layerManager, flatten, stdin, ExitCode, ProcessId, ProcessTypeId, PlatformWorker, SystemError, effectify, Size, FileDescriptor, WatchEventUpdate, WatchEventRemove, WatchEventCreate, makePlatform, WorkerError, FileTypeId, NativeSandboxUnavailableError } from './chunk-RDW7FNN6.js';
|
|
3
|
+
import { effect, BaseProto, succeed3, pipe, mergeAll, provideMerge, constVoid, map4, serviceOption, try_, scoped2, provide2, async, fail3, _void, succeed2, tryPromise, acquireRelease, orDie, flatMap, getOrElse, unwrap, unwrapScoped, flatMap3, make5, constUndefined, unsafeDone, sync, match, zipRight, isDone, orElse2, _await, ignore, negate, transduce, drain, identity, tap, forkDaemon, run, fnUntraced, make6 as make6$1, gen, get3, make8, addFinalizer2, scoped, fromNullable, map, zip, suspend, asyncScoped, matchEffect, fromChannel2, fromChannel, asVoid, void_, uninterruptible, as, addFinalizer, interruptible, timeout, catchAllCause, flatMap4, embedInput, complete, failCause, suspend2, make2, unsafeMakeSemaphore, none, some, ensuring, void_2, unsafeMakeLatch, fromEffect, write, unsafeFromArray, ensuring2, fail } from './chunk-STB2U7BB.js';
|
|
4
|
+
import { __commonJS, __require, __export, __toESM, __reExport } from './chunk-6NQPCXSG.js';
|
|
6
5
|
import * as Crypto from 'crypto';
|
|
7
6
|
import * as NFS from 'fs';
|
|
8
7
|
import * as OS from 'os';
|
|
9
8
|
import * as Path2 from 'path';
|
|
9
|
+
import * as ChildProcess from 'child_process';
|
|
10
|
+
import 'stream';
|
|
10
11
|
import * as NodeUrl from 'url';
|
|
11
12
|
import * as readline from 'readline';
|
|
12
13
|
|
|
@@ -24619,10 +24620,10 @@ ${captureLines}` : capture.stack;
|
|
|
24619
24620
|
}
|
|
24620
24621
|
});
|
|
24621
24622
|
|
|
24622
|
-
// node_modules/@effect/platform-node/dist/esm/
|
|
24623
|
-
var
|
|
24624
|
-
__export(
|
|
24625
|
-
layer: () =>
|
|
24623
|
+
// node_modules/@effect/platform-node/dist/esm/NodeFileSystem.js
|
|
24624
|
+
var NodeFileSystem_exports = {};
|
|
24625
|
+
__export(NodeFileSystem_exports, {
|
|
24626
|
+
layer: () => layer3
|
|
24626
24627
|
});
|
|
24627
24628
|
|
|
24628
24629
|
// node_modules/@effect/platform-node-shared/dist/esm/internal/error.js
|
|
@@ -24661,234 +24662,8 @@ var handleErrnoException = (module, method) => (err, [path]) => {
|
|
|
24661
24662
|
cause: err
|
|
24662
24663
|
});
|
|
24663
24664
|
};
|
|
24664
|
-
var fromReadable = (evaluate, onError, options) => fromChannel(fromReadableChannel(evaluate, onError));
|
|
24665
|
-
var fromReadableChannel = (evaluate, onError, options) => suspend2(() => unsafeReadableRead(evaluate(), onError, make2(void 0)));
|
|
24666
|
-
var writeInput = (writable, onFailure, {
|
|
24667
|
-
encoding,
|
|
24668
|
-
endOnDone = true
|
|
24669
|
-
} = {}, onDone = _void) => {
|
|
24670
|
-
const write3 = writeEffect(writable, encoding);
|
|
24671
|
-
const close2 = endOnDone ? async((resume) => {
|
|
24672
|
-
if ("closed" in writable && writable.closed) {
|
|
24673
|
-
resume(_void);
|
|
24674
|
-
} else {
|
|
24675
|
-
writable.once("finish", () => resume(_void));
|
|
24676
|
-
writable.end();
|
|
24677
|
-
}
|
|
24678
|
-
}) : _void;
|
|
24679
|
-
return {
|
|
24680
|
-
awaitRead: () => _void,
|
|
24681
|
-
emit: write3,
|
|
24682
|
-
error: (cause) => zipRight(close2, onFailure(cause)),
|
|
24683
|
-
done: (_) => zipRight(close2, onDone)
|
|
24684
|
-
};
|
|
24685
|
-
};
|
|
24686
|
-
var writeEffect = (writable, encoding) => (chunk) => chunk.length === 0 ? _void : async((resume) => {
|
|
24687
|
-
const iterator = chunk[Symbol.iterator]();
|
|
24688
|
-
let next = iterator.next();
|
|
24689
|
-
function loop() {
|
|
24690
|
-
const item = next;
|
|
24691
|
-
next = iterator.next();
|
|
24692
|
-
const success = writable.write(item.value, encoding);
|
|
24693
|
-
if (next.done) {
|
|
24694
|
-
resume(_void);
|
|
24695
|
-
} else if (success) {
|
|
24696
|
-
loop();
|
|
24697
|
-
} else {
|
|
24698
|
-
writable.once("drain", loop);
|
|
24699
|
-
}
|
|
24700
|
-
}
|
|
24701
|
-
loop();
|
|
24702
|
-
});
|
|
24703
|
-
var unsafeReadableRead = (readable, onError, exit, options) => {
|
|
24704
|
-
if (!readable.readable) {
|
|
24705
|
-
return void_2;
|
|
24706
|
-
}
|
|
24707
|
-
const latch = unsafeMakeLatch(false);
|
|
24708
|
-
function onReadable() {
|
|
24709
|
-
latch.unsafeOpen();
|
|
24710
|
-
}
|
|
24711
|
-
function onErr(err) {
|
|
24712
|
-
exit.current = fail(onError(err));
|
|
24713
|
-
latch.unsafeOpen();
|
|
24714
|
-
}
|
|
24715
|
-
function onEnd() {
|
|
24716
|
-
exit.current = void_;
|
|
24717
|
-
latch.unsafeOpen();
|
|
24718
|
-
}
|
|
24719
|
-
readable.on("readable", onReadable);
|
|
24720
|
-
readable.on("error", onErr);
|
|
24721
|
-
readable.on("end", onEnd);
|
|
24722
|
-
const chunkSize = void 0;
|
|
24723
|
-
const read2 = suspend2(function loop() {
|
|
24724
|
-
let item = readable.read(chunkSize);
|
|
24725
|
-
if (item === null) {
|
|
24726
|
-
if (exit.current) {
|
|
24727
|
-
return fromEffect(exit.current);
|
|
24728
|
-
}
|
|
24729
|
-
latch.unsafeClose();
|
|
24730
|
-
return flatMap4(latch.await, loop);
|
|
24731
|
-
}
|
|
24732
|
-
const arr = [item];
|
|
24733
|
-
while (true) {
|
|
24734
|
-
item = readable.read(chunkSize);
|
|
24735
|
-
if (item === null) {
|
|
24736
|
-
return flatMap4(write(unsafeFromArray(arr)), loop);
|
|
24737
|
-
}
|
|
24738
|
-
arr.push(item);
|
|
24739
|
-
}
|
|
24740
|
-
});
|
|
24741
|
-
return ensuring2(read2, sync(() => {
|
|
24742
|
-
readable.off("readable", onReadable);
|
|
24743
|
-
readable.off("error", onErr);
|
|
24744
|
-
readable.off("end", onEnd);
|
|
24745
|
-
if ("closed" in readable && !readable.closed) {
|
|
24746
|
-
readable.destroy();
|
|
24747
|
-
}
|
|
24748
|
-
}));
|
|
24749
|
-
};
|
|
24750
|
-
|
|
24751
|
-
// node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js
|
|
24752
|
-
var fromWritable = (evaluate, onError, options) => fromChannel2(fromWritableChannel(evaluate, onError, options));
|
|
24753
|
-
var fromWritableChannel = (writable, onError, options) => flatMap4(zip(sync(() => writable()), make5()), ([writable2, deferred]) => embedInput(writableOutput(writable2, deferred, onError), writeInput(writable2, (cause) => failCause(deferred, cause), options, complete(deferred, _void))));
|
|
24754
|
-
var writableOutput = (writable, deferred, onError) => suspend(() => {
|
|
24755
|
-
function handleError(err) {
|
|
24756
|
-
unsafeDone(deferred, fail2(onError(err)));
|
|
24757
|
-
}
|
|
24758
|
-
writable.on("error", handleError);
|
|
24759
|
-
return ensuring(_await(deferred), sync(() => {
|
|
24760
|
-
writable.removeListener("error", handleError);
|
|
24761
|
-
}));
|
|
24762
|
-
});
|
|
24763
24665
|
|
|
24764
|
-
// node_modules/@effect/platform-node-shared/dist/esm/internal/
|
|
24765
|
-
var inputToStdioOption = (stdin2) => typeof stdin2 === "string" ? stdin2 : "pipe";
|
|
24766
|
-
var outputToStdioOption = (output) => typeof output === "string" ? output : "pipe";
|
|
24767
|
-
var toError = (err) => err instanceof globalThis.Error ? err : new globalThis.Error(String(err));
|
|
24768
|
-
var toPlatformError = (method, error, command) => {
|
|
24769
|
-
const flattened = flatten2(command).reduce((acc, curr) => {
|
|
24770
|
-
const command2 = `${curr.command} ${curr.args.join(" ")}`;
|
|
24771
|
-
return acc.length === 0 ? command2 : `${acc} | ${command2}`;
|
|
24772
|
-
}, "");
|
|
24773
|
-
return handleErrnoException("Command", method)(error, [flattened]);
|
|
24774
|
-
};
|
|
24775
|
-
var ProcessProto = {
|
|
24776
|
-
[ProcessTypeId]: ProcessTypeId,
|
|
24777
|
-
...BaseProto,
|
|
24778
|
-
toJSON() {
|
|
24779
|
-
return {
|
|
24780
|
-
_id: "@effect/platform/CommandExecutor/Process",
|
|
24781
|
-
pid: this.pid
|
|
24782
|
-
};
|
|
24783
|
-
}
|
|
24784
|
-
};
|
|
24785
|
-
var runCommand = (fileSystem) => (command) => {
|
|
24786
|
-
switch (command._tag) {
|
|
24787
|
-
case "StandardCommand": {
|
|
24788
|
-
const spawn2 = flatMap3(make5(), (exitCode) => async((resume) => {
|
|
24789
|
-
const handle = ChildProcess.spawn(command.command, command.args, {
|
|
24790
|
-
stdio: [inputToStdioOption(command.stdin), outputToStdioOption(command.stdout), outputToStdioOption(command.stderr)],
|
|
24791
|
-
cwd: getOrElse(command.cwd, constUndefined),
|
|
24792
|
-
shell: command.shell,
|
|
24793
|
-
env: {
|
|
24794
|
-
...process.env,
|
|
24795
|
-
...Object.fromEntries(command.env)
|
|
24796
|
-
},
|
|
24797
|
-
detached: process.platform !== "win32"
|
|
24798
|
-
});
|
|
24799
|
-
handle.on("error", (err) => {
|
|
24800
|
-
resume(fail2(toPlatformError("spawn", err, command)));
|
|
24801
|
-
});
|
|
24802
|
-
handle.on("exit", (...args) => {
|
|
24803
|
-
unsafeDone(exitCode, succeed(args));
|
|
24804
|
-
});
|
|
24805
|
-
handle.on("spawn", () => {
|
|
24806
|
-
resume(succeed([handle, exitCode]));
|
|
24807
|
-
});
|
|
24808
|
-
return sync(() => {
|
|
24809
|
-
handle.kill("SIGTERM");
|
|
24810
|
-
});
|
|
24811
|
-
}));
|
|
24812
|
-
const killProcessGroup = process.platform === "win32" ? (handle, _) => async((resume) => {
|
|
24813
|
-
ChildProcess.exec(`taskkill /pid ${handle.pid} /T /F`, (error) => {
|
|
24814
|
-
if (error) {
|
|
24815
|
-
resume(fail2(toPlatformError("kill", toError(error), command)));
|
|
24816
|
-
} else {
|
|
24817
|
-
resume(_void);
|
|
24818
|
-
}
|
|
24819
|
-
});
|
|
24820
|
-
}) : (handle, signal) => try_({
|
|
24821
|
-
try: () => process.kill(-handle.pid, signal),
|
|
24822
|
-
catch: (error) => toPlatformError("kill", toError(error), command)
|
|
24823
|
-
});
|
|
24824
|
-
const killProcess = (handle, signal) => suspend(() => handle.kill(signal) ? _void : fail2(toPlatformError("kill", new globalThis.Error("Failed to kill process"), command)));
|
|
24825
|
-
return pipe(
|
|
24826
|
-
// Validate that the directory is accessible
|
|
24827
|
-
match(command.cwd, {
|
|
24828
|
-
onNone: () => _void,
|
|
24829
|
-
onSome: (dir) => fileSystem.access(dir)
|
|
24830
|
-
}),
|
|
24831
|
-
zipRight(acquireRelease(spawn2, ([handle, exitCode]) => flatMap3(isDone(exitCode), (done) => {
|
|
24832
|
-
if (!done) {
|
|
24833
|
-
return killProcessGroup(handle, "SIGTERM").pipe(orElse2(() => killProcess(handle, "SIGTERM")), zipRight(_await(exitCode)), ignore);
|
|
24834
|
-
}
|
|
24835
|
-
return flatMap3(_await(exitCode), ([code]) => {
|
|
24836
|
-
if (code !== 0 && code !== null) {
|
|
24837
|
-
return killProcessGroup(handle, "SIGTERM").pipe(ignore);
|
|
24838
|
-
}
|
|
24839
|
-
return _void;
|
|
24840
|
-
});
|
|
24841
|
-
}))),
|
|
24842
|
-
map3(([handle, exitCodeDeferred]) => {
|
|
24843
|
-
let stdin2 = drain;
|
|
24844
|
-
if (handle.stdin !== null) {
|
|
24845
|
-
stdin2 = fromWritable(() => handle.stdin, (err) => toPlatformError("toWritable", toError(err), command));
|
|
24846
|
-
}
|
|
24847
|
-
const exitCode = flatMap3(_await(exitCodeDeferred), ([code, signal]) => {
|
|
24848
|
-
if (code !== null) {
|
|
24849
|
-
return succeed(ExitCode(code));
|
|
24850
|
-
}
|
|
24851
|
-
return fail2(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${signal}`), command));
|
|
24852
|
-
});
|
|
24853
|
-
const isRunning = negate(isDone(exitCodeDeferred));
|
|
24854
|
-
const kill = (signal = "SIGTERM") => killProcessGroup(handle, signal).pipe(orElse2(() => killProcess(handle, signal)), zipRight(asVoid(_await(exitCodeDeferred))));
|
|
24855
|
-
const pid = ProcessId(handle.pid);
|
|
24856
|
-
const stderr = fromReadable(() => handle.stderr, (err) => toPlatformError("fromReadable(stderr)", toError(err), command));
|
|
24857
|
-
let stdout = fromReadable(() => handle.stdout, (err) => toPlatformError("fromReadable(stdout)", toError(err), command));
|
|
24858
|
-
if (typeof command.stdout !== "string") {
|
|
24859
|
-
stdout = transduce(stdout, command.stdout);
|
|
24860
|
-
}
|
|
24861
|
-
return Object.assign(Object.create(ProcessProto), {
|
|
24862
|
-
pid,
|
|
24863
|
-
exitCode,
|
|
24864
|
-
isRunning,
|
|
24865
|
-
kill,
|
|
24866
|
-
stdin: stdin2,
|
|
24867
|
-
stderr,
|
|
24868
|
-
stdout
|
|
24869
|
-
});
|
|
24870
|
-
}),
|
|
24871
|
-
typeof command.stdin === "string" ? identity : tap((process2) => forkDaemon(run(command.stdin, process2.stdin)))
|
|
24872
|
-
);
|
|
24873
|
-
}
|
|
24874
|
-
case "PipedCommand": {
|
|
24875
|
-
const flattened = flatten2(command);
|
|
24876
|
-
if (flattened.length === 1) {
|
|
24877
|
-
return pipe(flattened[0], runCommand(fileSystem));
|
|
24878
|
-
}
|
|
24879
|
-
const head = flattened[0];
|
|
24880
|
-
const tail = flattened.slice(1);
|
|
24881
|
-
const initial = tail.slice(0, tail.length - 1);
|
|
24882
|
-
const last = tail[tail.length - 1];
|
|
24883
|
-
const stream = initial.reduce((stdin2, command2) => pipe(stdin(command2, stdin2), runCommand(fileSystem), map3((process2) => process2.stdout), unwrapScoped), pipe(runCommand(fileSystem)(head), map3((process2) => process2.stdout), unwrapScoped));
|
|
24884
|
-
return pipe(stdin(last, stream), runCommand(fileSystem));
|
|
24885
|
-
}
|
|
24886
|
-
}
|
|
24887
|
-
};
|
|
24888
|
-
var layer = /* @__PURE__ */ effect(CommandExecutor, /* @__PURE__ */ pipe(FileSystem, /* @__PURE__ */ map3((fileSystem) => makeExecutor(runCommand(fileSystem)))));
|
|
24889
|
-
|
|
24890
|
-
// node_modules/@effect/platform-node-shared/dist/esm/NodeCommandExecutor.js
|
|
24891
|
-
var layer2 = layer;
|
|
24666
|
+
// node_modules/@effect/platform-node-shared/dist/esm/internal/fileSystem.js
|
|
24892
24667
|
var handleBadArgument = (method) => (cause) => new BadArgument({
|
|
24893
24668
|
module: "FileSystem",
|
|
24894
24669
|
method,
|
|
@@ -24965,7 +24740,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
24965
24740
|
var openFactory = (method) => {
|
|
24966
24741
|
const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
24967
24742
|
const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
24968
|
-
return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))),
|
|
24743
|
+
return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map4((fd) => makeFile(FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
|
|
24969
24744
|
};
|
|
24970
24745
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
24971
24746
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -24990,7 +24765,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
24990
24765
|
this[FileTypeId] = FileTypeId;
|
|
24991
24766
|
}
|
|
24992
24767
|
get stat() {
|
|
24993
|
-
return
|
|
24768
|
+
return map4(nodeStat(this.fd), makeFileInfo);
|
|
24994
24769
|
}
|
|
24995
24770
|
get sync() {
|
|
24996
24771
|
return nodeSync(this.fd);
|
|
@@ -25007,7 +24782,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
25007
24782
|
}));
|
|
25008
24783
|
}
|
|
25009
24784
|
read(buffer) {
|
|
25010
|
-
return this.semaphore.withPermits(1)(
|
|
24785
|
+
return this.semaphore.withPermits(1)(map4(suspend(() => nodeRead(this.fd, {
|
|
25011
24786
|
buffer,
|
|
25012
24787
|
position: this.position
|
|
25013
24788
|
})), (bytesRead) => {
|
|
@@ -25018,7 +24793,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
25018
24793
|
}
|
|
25019
24794
|
readAlloc(size) {
|
|
25020
24795
|
const sizeNumber = Number(size);
|
|
25021
|
-
return this.semaphore.withPermits(1)(flatMap3(sync(() => Buffer.allocUnsafeSlow(sizeNumber)), (buffer) =>
|
|
24796
|
+
return this.semaphore.withPermits(1)(flatMap3(sync(() => Buffer.allocUnsafeSlow(sizeNumber)), (buffer) => map4(nodeReadAlloc(this.fd, {
|
|
25022
24797
|
buffer,
|
|
25023
24798
|
position: this.position
|
|
25024
24799
|
}), (bytesRead) => {
|
|
@@ -25035,7 +24810,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
25035
24810
|
})));
|
|
25036
24811
|
}
|
|
25037
24812
|
truncate(length) {
|
|
25038
|
-
return this.semaphore.withPermits(1)(
|
|
24813
|
+
return this.semaphore.withPermits(1)(map4(nodeTruncate(this.fd, length ? Number(length) : void 0), () => {
|
|
25039
24814
|
if (!this.append) {
|
|
25040
24815
|
const len = BigInt(length ?? 0);
|
|
25041
24816
|
if (this.position > len) {
|
|
@@ -25045,7 +24820,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
25045
24820
|
}));
|
|
25046
24821
|
}
|
|
25047
24822
|
write(buffer) {
|
|
25048
|
-
return this.semaphore.withPermits(1)(
|
|
24823
|
+
return this.semaphore.withPermits(1)(map4(suspend(() => nodeWrite(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(this.position))), (bytesWritten) => {
|
|
25049
24824
|
const sizeWritten = Size(bytesWritten);
|
|
25050
24825
|
if (!this.append) {
|
|
25051
24826
|
this.position = this.position + sizeWritten;
|
|
@@ -25056,7 +24831,7 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
25056
24831
|
writeAllChunk(buffer) {
|
|
25057
24832
|
return flatMap3(suspend(() => nodeWriteAll(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(this.position))), (bytesWritten) => {
|
|
25058
24833
|
if (bytesWritten === 0) {
|
|
25059
|
-
return
|
|
24834
|
+
return fail3(new SystemError({
|
|
25060
24835
|
module: "FileSystem",
|
|
25061
24836
|
method: "writeAll",
|
|
25062
24837
|
reason: "WriteZero",
|
|
@@ -25080,7 +24855,7 @@ var makeTempFileFactory = (method) => {
|
|
|
25080
24855
|
const makeDirectory2 = makeTempDirectoryFactory(method);
|
|
25081
24856
|
const open3 = openFactory(method);
|
|
25082
24857
|
const randomHexString = (bytes) => sync(() => Crypto.randomBytes(bytes).toString("hex"));
|
|
25083
|
-
return (options) => pipe(zip(makeDirectory2(options), randomHexString(6)),
|
|
24858
|
+
return (options) => pipe(zip(makeDirectory2(options), randomHexString(6)), map4(([directory, random]) => Path2.join(directory, random + (options?.suffix ?? ""))), tap((path) => scoped(open3(path, {
|
|
25084
24859
|
flag: "w+"
|
|
25085
24860
|
}))));
|
|
25086
24861
|
};
|
|
@@ -25102,13 +24877,13 @@ var readFile2 = (path) => async((resume, signal) => {
|
|
|
25102
24877
|
signal
|
|
25103
24878
|
}, (err, data) => {
|
|
25104
24879
|
if (err) {
|
|
25105
|
-
resume(
|
|
24880
|
+
resume(fail3(handleErrnoException("FileSystem", "readFile")(err, [path])));
|
|
25106
24881
|
} else {
|
|
25107
|
-
resume(
|
|
24882
|
+
resume(succeed2(data));
|
|
25108
24883
|
}
|
|
25109
24884
|
});
|
|
25110
24885
|
} catch (err) {
|
|
25111
|
-
resume(
|
|
24886
|
+
resume(fail3(handleBadArgument("readFile")(err)));
|
|
25112
24887
|
}
|
|
25113
24888
|
});
|
|
25114
24889
|
var readLink = /* @__PURE__ */ (() => {
|
|
@@ -25141,7 +24916,7 @@ var makeFileInfo = (stat3) => ({
|
|
|
25141
24916
|
});
|
|
25142
24917
|
var stat2 = /* @__PURE__ */ (() => {
|
|
25143
24918
|
const nodeStat = /* @__PURE__ */ effectify(NFS.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
25144
|
-
return (path) =>
|
|
24919
|
+
return (path) => map4(nodeStat(path), makeFileInfo);
|
|
25145
24920
|
})();
|
|
25146
24921
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
25147
24922
|
const nodeSymlink = /* @__PURE__ */ effectify(NFS.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
@@ -25163,12 +24938,12 @@ var watchNode = (path, options) => asyncScoped((emit) => acquireRelease(sync(()
|
|
|
25163
24938
|
switch (event) {
|
|
25164
24939
|
case "rename": {
|
|
25165
24940
|
emit.fromEffect(matchEffect(stat2(path2), {
|
|
25166
|
-
onSuccess: (_) =>
|
|
24941
|
+
onSuccess: (_) => succeed2(WatchEventCreate({
|
|
25167
24942
|
path: path2
|
|
25168
24943
|
})),
|
|
25169
|
-
onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ?
|
|
24944
|
+
onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ? succeed2(WatchEventRemove({
|
|
25170
24945
|
path: path2
|
|
25171
|
-
})) :
|
|
24946
|
+
})) : fail3(err)
|
|
25172
24947
|
}));
|
|
25173
24948
|
return;
|
|
25174
24949
|
}
|
|
@@ -25194,7 +24969,7 @@ var watchNode = (path, options) => asyncScoped((emit) => acquireRelease(sync(()
|
|
|
25194
24969
|
});
|
|
25195
24970
|
return watcher;
|
|
25196
24971
|
}), (watcher) => sync(() => watcher.close())));
|
|
25197
|
-
var watch2 = (backend, path, options) => stat2(path).pipe(
|
|
24972
|
+
var watch2 = (backend, path, options) => stat2(path).pipe(map4((stat3) => backend.pipe(flatMap((_) => _.register(path, stat3, options)), getOrElse(() => watchNode(path, options)))), unwrap);
|
|
25198
24973
|
var writeFile2 = (path, data, options) => async((resume, signal) => {
|
|
25199
24974
|
try {
|
|
25200
24975
|
NFS.writeFile(path, data, {
|
|
@@ -25203,16 +24978,16 @@ var writeFile2 = (path, data, options) => async((resume, signal) => {
|
|
|
25203
24978
|
mode: options?.mode
|
|
25204
24979
|
}, (err) => {
|
|
25205
24980
|
if (err) {
|
|
25206
|
-
resume(
|
|
24981
|
+
resume(fail3(handleErrnoException("FileSystem", "writeFile")(err, [path])));
|
|
25207
24982
|
} else {
|
|
25208
24983
|
resume(_void);
|
|
25209
24984
|
}
|
|
25210
24985
|
});
|
|
25211
24986
|
} catch (err) {
|
|
25212
|
-
resume(
|
|
24987
|
+
resume(fail3(handleBadArgument("writeFile")(err)));
|
|
25213
24988
|
}
|
|
25214
24989
|
});
|
|
25215
|
-
var makeFileSystem = /* @__PURE__ */
|
|
24990
|
+
var makeFileSystem = /* @__PURE__ */ map4(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make({
|
|
25216
24991
|
access: access2,
|
|
25217
24992
|
chmod: chmod2,
|
|
25218
24993
|
chown: chown2,
|
|
@@ -25240,10 +25015,247 @@ var makeFileSystem = /* @__PURE__ */ map3(/* @__PURE__ */ serviceOption(WatchBac
|
|
|
25240
25015
|
},
|
|
25241
25016
|
writeFile: writeFile2
|
|
25242
25017
|
}));
|
|
25243
|
-
var
|
|
25018
|
+
var layer = /* @__PURE__ */ effect(FileSystem, makeFileSystem);
|
|
25244
25019
|
|
|
25245
25020
|
// node_modules/@effect/platform-node-shared/dist/esm/NodeFileSystem.js
|
|
25246
|
-
var
|
|
25021
|
+
var layer2 = layer;
|
|
25022
|
+
|
|
25023
|
+
// node_modules/@effect/platform-node/dist/esm/NodeFileSystem.js
|
|
25024
|
+
var layer3 = layer2;
|
|
25025
|
+
|
|
25026
|
+
// node_modules/@effect/platform-node/dist/esm/NodeContext.js
|
|
25027
|
+
var NodeContext_exports = {};
|
|
25028
|
+
__export(NodeContext_exports, {
|
|
25029
|
+
layer: () => layer11
|
|
25030
|
+
});
|
|
25031
|
+
var fromReadable = (evaluate, onError, options) => fromChannel(fromReadableChannel(evaluate, onError));
|
|
25032
|
+
var fromReadableChannel = (evaluate, onError, options) => suspend2(() => unsafeReadableRead(evaluate(), onError, make2(void 0)));
|
|
25033
|
+
var writeInput = (writable, onFailure, {
|
|
25034
|
+
encoding,
|
|
25035
|
+
endOnDone = true
|
|
25036
|
+
} = {}, onDone = _void) => {
|
|
25037
|
+
const write3 = writeEffect(writable, encoding);
|
|
25038
|
+
const close2 = endOnDone ? async((resume) => {
|
|
25039
|
+
if ("closed" in writable && writable.closed) {
|
|
25040
|
+
resume(_void);
|
|
25041
|
+
} else {
|
|
25042
|
+
writable.once("finish", () => resume(_void));
|
|
25043
|
+
writable.end();
|
|
25044
|
+
}
|
|
25045
|
+
}) : _void;
|
|
25046
|
+
return {
|
|
25047
|
+
awaitRead: () => _void,
|
|
25048
|
+
emit: write3,
|
|
25049
|
+
error: (cause) => zipRight(close2, onFailure(cause)),
|
|
25050
|
+
done: (_) => zipRight(close2, onDone)
|
|
25051
|
+
};
|
|
25052
|
+
};
|
|
25053
|
+
var writeEffect = (writable, encoding) => (chunk) => chunk.length === 0 ? _void : async((resume) => {
|
|
25054
|
+
const iterator = chunk[Symbol.iterator]();
|
|
25055
|
+
let next = iterator.next();
|
|
25056
|
+
function loop() {
|
|
25057
|
+
const item = next;
|
|
25058
|
+
next = iterator.next();
|
|
25059
|
+
const success = writable.write(item.value, encoding);
|
|
25060
|
+
if (next.done) {
|
|
25061
|
+
resume(_void);
|
|
25062
|
+
} else if (success) {
|
|
25063
|
+
loop();
|
|
25064
|
+
} else {
|
|
25065
|
+
writable.once("drain", loop);
|
|
25066
|
+
}
|
|
25067
|
+
}
|
|
25068
|
+
loop();
|
|
25069
|
+
});
|
|
25070
|
+
var unsafeReadableRead = (readable, onError, exit, options) => {
|
|
25071
|
+
if (!readable.readable) {
|
|
25072
|
+
return void_2;
|
|
25073
|
+
}
|
|
25074
|
+
const latch = unsafeMakeLatch(false);
|
|
25075
|
+
function onReadable() {
|
|
25076
|
+
latch.unsafeOpen();
|
|
25077
|
+
}
|
|
25078
|
+
function onErr(err) {
|
|
25079
|
+
exit.current = fail(onError(err));
|
|
25080
|
+
latch.unsafeOpen();
|
|
25081
|
+
}
|
|
25082
|
+
function onEnd() {
|
|
25083
|
+
exit.current = void_;
|
|
25084
|
+
latch.unsafeOpen();
|
|
25085
|
+
}
|
|
25086
|
+
readable.on("readable", onReadable);
|
|
25087
|
+
readable.on("error", onErr);
|
|
25088
|
+
readable.on("end", onEnd);
|
|
25089
|
+
const chunkSize = void 0;
|
|
25090
|
+
const read2 = suspend2(function loop() {
|
|
25091
|
+
let item = readable.read(chunkSize);
|
|
25092
|
+
if (item === null) {
|
|
25093
|
+
if (exit.current) {
|
|
25094
|
+
return fromEffect(exit.current);
|
|
25095
|
+
}
|
|
25096
|
+
latch.unsafeClose();
|
|
25097
|
+
return flatMap4(latch.await, loop);
|
|
25098
|
+
}
|
|
25099
|
+
const arr = [item];
|
|
25100
|
+
while (true) {
|
|
25101
|
+
item = readable.read(chunkSize);
|
|
25102
|
+
if (item === null) {
|
|
25103
|
+
return flatMap4(write(unsafeFromArray(arr)), loop);
|
|
25104
|
+
}
|
|
25105
|
+
arr.push(item);
|
|
25106
|
+
}
|
|
25107
|
+
});
|
|
25108
|
+
return ensuring2(read2, sync(() => {
|
|
25109
|
+
readable.off("readable", onReadable);
|
|
25110
|
+
readable.off("error", onErr);
|
|
25111
|
+
readable.off("end", onEnd);
|
|
25112
|
+
if ("closed" in readable && !readable.closed) {
|
|
25113
|
+
readable.destroy();
|
|
25114
|
+
}
|
|
25115
|
+
}));
|
|
25116
|
+
};
|
|
25117
|
+
|
|
25118
|
+
// node_modules/@effect/platform-node-shared/dist/esm/internal/sink.js
|
|
25119
|
+
var fromWritable = (evaluate, onError, options) => fromChannel2(fromWritableChannel(evaluate, onError, options));
|
|
25120
|
+
var fromWritableChannel = (writable, onError, options) => flatMap4(zip(sync(() => writable()), make5()), ([writable2, deferred]) => embedInput(writableOutput(writable2, deferred, onError), writeInput(writable2, (cause) => failCause(deferred, cause), options, complete(deferred, _void))));
|
|
25121
|
+
var writableOutput = (writable, deferred, onError) => suspend(() => {
|
|
25122
|
+
function handleError(err) {
|
|
25123
|
+
unsafeDone(deferred, fail3(onError(err)));
|
|
25124
|
+
}
|
|
25125
|
+
writable.on("error", handleError);
|
|
25126
|
+
return ensuring(_await(deferred), sync(() => {
|
|
25127
|
+
writable.removeListener("error", handleError);
|
|
25128
|
+
}));
|
|
25129
|
+
});
|
|
25130
|
+
|
|
25131
|
+
// node_modules/@effect/platform-node-shared/dist/esm/internal/commandExecutor.js
|
|
25132
|
+
var inputToStdioOption = (stdin2) => typeof stdin2 === "string" ? stdin2 : "pipe";
|
|
25133
|
+
var outputToStdioOption = (output) => typeof output === "string" ? output : "pipe";
|
|
25134
|
+
var toError = (err) => err instanceof globalThis.Error ? err : new globalThis.Error(String(err));
|
|
25135
|
+
var toPlatformError = (method, error, command) => {
|
|
25136
|
+
const flattened = flatten(command).reduce((acc, curr) => {
|
|
25137
|
+
const command2 = `${curr.command} ${curr.args.join(" ")}`;
|
|
25138
|
+
return acc.length === 0 ? command2 : `${acc} | ${command2}`;
|
|
25139
|
+
}, "");
|
|
25140
|
+
return handleErrnoException("Command", method)(error, [flattened]);
|
|
25141
|
+
};
|
|
25142
|
+
var ProcessProto = {
|
|
25143
|
+
[ProcessTypeId]: ProcessTypeId,
|
|
25144
|
+
...BaseProto,
|
|
25145
|
+
toJSON() {
|
|
25146
|
+
return {
|
|
25147
|
+
_id: "@effect/platform/CommandExecutor/Process",
|
|
25148
|
+
pid: this.pid
|
|
25149
|
+
};
|
|
25150
|
+
}
|
|
25151
|
+
};
|
|
25152
|
+
var runCommand = (fileSystem) => (command) => {
|
|
25153
|
+
switch (command._tag) {
|
|
25154
|
+
case "StandardCommand": {
|
|
25155
|
+
const spawn2 = flatMap3(make5(), (exitCode) => async((resume) => {
|
|
25156
|
+
const handle = ChildProcess.spawn(command.command, command.args, {
|
|
25157
|
+
stdio: [inputToStdioOption(command.stdin), outputToStdioOption(command.stdout), outputToStdioOption(command.stderr)],
|
|
25158
|
+
cwd: getOrElse(command.cwd, constUndefined),
|
|
25159
|
+
shell: command.shell,
|
|
25160
|
+
env: {
|
|
25161
|
+
...process.env,
|
|
25162
|
+
...Object.fromEntries(command.env)
|
|
25163
|
+
},
|
|
25164
|
+
detached: process.platform !== "win32"
|
|
25165
|
+
});
|
|
25166
|
+
handle.on("error", (err) => {
|
|
25167
|
+
resume(fail3(toPlatformError("spawn", err, command)));
|
|
25168
|
+
});
|
|
25169
|
+
handle.on("exit", (...args) => {
|
|
25170
|
+
unsafeDone(exitCode, succeed2(args));
|
|
25171
|
+
});
|
|
25172
|
+
handle.on("spawn", () => {
|
|
25173
|
+
resume(succeed2([handle, exitCode]));
|
|
25174
|
+
});
|
|
25175
|
+
return sync(() => {
|
|
25176
|
+
handle.kill("SIGTERM");
|
|
25177
|
+
});
|
|
25178
|
+
}));
|
|
25179
|
+
const killProcessGroup = process.platform === "win32" ? (handle, _) => async((resume) => {
|
|
25180
|
+
ChildProcess.exec(`taskkill /pid ${handle.pid} /T /F`, (error) => {
|
|
25181
|
+
if (error) {
|
|
25182
|
+
resume(fail3(toPlatformError("kill", toError(error), command)));
|
|
25183
|
+
} else {
|
|
25184
|
+
resume(_void);
|
|
25185
|
+
}
|
|
25186
|
+
});
|
|
25187
|
+
}) : (handle, signal) => try_({
|
|
25188
|
+
try: () => process.kill(-handle.pid, signal),
|
|
25189
|
+
catch: (error) => toPlatformError("kill", toError(error), command)
|
|
25190
|
+
});
|
|
25191
|
+
const killProcess = (handle, signal) => suspend(() => handle.kill(signal) ? _void : fail3(toPlatformError("kill", new globalThis.Error("Failed to kill process"), command)));
|
|
25192
|
+
return pipe(
|
|
25193
|
+
// Validate that the directory is accessible
|
|
25194
|
+
match(command.cwd, {
|
|
25195
|
+
onNone: () => _void,
|
|
25196
|
+
onSome: (dir) => fileSystem.access(dir)
|
|
25197
|
+
}),
|
|
25198
|
+
zipRight(acquireRelease(spawn2, ([handle, exitCode]) => flatMap3(isDone(exitCode), (done) => {
|
|
25199
|
+
if (!done) {
|
|
25200
|
+
return killProcessGroup(handle, "SIGTERM").pipe(orElse2(() => killProcess(handle, "SIGTERM")), zipRight(_await(exitCode)), ignore);
|
|
25201
|
+
}
|
|
25202
|
+
return flatMap3(_await(exitCode), ([code]) => {
|
|
25203
|
+
if (code !== 0 && code !== null) {
|
|
25204
|
+
return killProcessGroup(handle, "SIGTERM").pipe(ignore);
|
|
25205
|
+
}
|
|
25206
|
+
return _void;
|
|
25207
|
+
});
|
|
25208
|
+
}))),
|
|
25209
|
+
map4(([handle, exitCodeDeferred]) => {
|
|
25210
|
+
let stdin2 = drain;
|
|
25211
|
+
if (handle.stdin !== null) {
|
|
25212
|
+
stdin2 = fromWritable(() => handle.stdin, (err) => toPlatformError("toWritable", toError(err), command));
|
|
25213
|
+
}
|
|
25214
|
+
const exitCode = flatMap3(_await(exitCodeDeferred), ([code, signal]) => {
|
|
25215
|
+
if (code !== null) {
|
|
25216
|
+
return succeed2(ExitCode(code));
|
|
25217
|
+
}
|
|
25218
|
+
return fail3(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: ${signal}`), command));
|
|
25219
|
+
});
|
|
25220
|
+
const isRunning = negate(isDone(exitCodeDeferred));
|
|
25221
|
+
const kill = (signal = "SIGTERM") => killProcessGroup(handle, signal).pipe(orElse2(() => killProcess(handle, signal)), zipRight(asVoid(_await(exitCodeDeferred))));
|
|
25222
|
+
const pid = ProcessId(handle.pid);
|
|
25223
|
+
const stderr = fromReadable(() => handle.stderr, (err) => toPlatformError("fromReadable(stderr)", toError(err), command));
|
|
25224
|
+
let stdout = fromReadable(() => handle.stdout, (err) => toPlatformError("fromReadable(stdout)", toError(err), command));
|
|
25225
|
+
if (typeof command.stdout !== "string") {
|
|
25226
|
+
stdout = transduce(stdout, command.stdout);
|
|
25227
|
+
}
|
|
25228
|
+
return Object.assign(Object.create(ProcessProto), {
|
|
25229
|
+
pid,
|
|
25230
|
+
exitCode,
|
|
25231
|
+
isRunning,
|
|
25232
|
+
kill,
|
|
25233
|
+
stdin: stdin2,
|
|
25234
|
+
stderr,
|
|
25235
|
+
stdout
|
|
25236
|
+
});
|
|
25237
|
+
}),
|
|
25238
|
+
typeof command.stdin === "string" ? identity : tap((process2) => forkDaemon(run(command.stdin, process2.stdin)))
|
|
25239
|
+
);
|
|
25240
|
+
}
|
|
25241
|
+
case "PipedCommand": {
|
|
25242
|
+
const flattened = flatten(command);
|
|
25243
|
+
if (flattened.length === 1) {
|
|
25244
|
+
return pipe(flattened[0], runCommand(fileSystem));
|
|
25245
|
+
}
|
|
25246
|
+
const head = flattened[0];
|
|
25247
|
+
const tail = flattened.slice(1);
|
|
25248
|
+
const initial = tail.slice(0, tail.length - 1);
|
|
25249
|
+
const last = tail[tail.length - 1];
|
|
25250
|
+
const stream = initial.reduce((stdin2, command2) => pipe(stdin(command2, stdin2), runCommand(fileSystem), map4((process2) => process2.stdout), unwrapScoped), pipe(runCommand(fileSystem)(head), map4((process2) => process2.stdout), unwrapScoped));
|
|
25251
|
+
return pipe(stdin(last, stream), runCommand(fileSystem));
|
|
25252
|
+
}
|
|
25253
|
+
}
|
|
25254
|
+
};
|
|
25255
|
+
var layer4 = /* @__PURE__ */ effect(CommandExecutor, /* @__PURE__ */ pipe(FileSystem, /* @__PURE__ */ map4((fileSystem) => makeExecutor(runCommand(fileSystem)))));
|
|
25256
|
+
|
|
25257
|
+
// node_modules/@effect/platform-node-shared/dist/esm/NodeCommandExecutor.js
|
|
25258
|
+
var layer5 = layer4;
|
|
25247
25259
|
var fromFileUrl = (url) => try_({
|
|
25248
25260
|
try: () => NodeUrl.fileURLToPath(url),
|
|
25249
25261
|
catch: (error) => new BadArgument({
|
|
@@ -25262,19 +25274,19 @@ var toFileUrl = (path) => try_({
|
|
|
25262
25274
|
cause: error
|
|
25263
25275
|
})
|
|
25264
25276
|
});
|
|
25265
|
-
/* @__PURE__ */
|
|
25277
|
+
/* @__PURE__ */ succeed3(Path, /* @__PURE__ */ Path.of({
|
|
25266
25278
|
[TypeId]: TypeId,
|
|
25267
25279
|
...Path2.posix,
|
|
25268
25280
|
fromFileUrl,
|
|
25269
25281
|
toFileUrl
|
|
25270
25282
|
}));
|
|
25271
|
-
/* @__PURE__ */
|
|
25283
|
+
/* @__PURE__ */ succeed3(Path, /* @__PURE__ */ Path.of({
|
|
25272
25284
|
[TypeId]: TypeId,
|
|
25273
25285
|
...Path2.win32,
|
|
25274
25286
|
fromFileUrl,
|
|
25275
25287
|
toFileUrl
|
|
25276
25288
|
}));
|
|
25277
|
-
var
|
|
25289
|
+
var layer6 = /* @__PURE__ */ succeed3(Path, /* @__PURE__ */ Path.of({
|
|
25278
25290
|
[TypeId]: TypeId,
|
|
25279
25291
|
...Path2,
|
|
25280
25292
|
fromFileUrl,
|
|
@@ -25282,7 +25294,7 @@ var layer5 = /* @__PURE__ */ succeed2(Path, /* @__PURE__ */ Path.of({
|
|
|
25282
25294
|
}));
|
|
25283
25295
|
|
|
25284
25296
|
// node_modules/@effect/platform-node-shared/dist/esm/NodePath.js
|
|
25285
|
-
var
|
|
25297
|
+
var layer7 = layer6;
|
|
25286
25298
|
var defaultShouldQuit = (input) => input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
25287
25299
|
var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
25288
25300
|
const stdin2 = process.stdin;
|
|
@@ -25310,7 +25322,7 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
25310
25322
|
const isTTY = sync(() => Boolean(stdout.isTTY));
|
|
25311
25323
|
const readInput = gen(function* () {
|
|
25312
25324
|
yield* get3(rlRef);
|
|
25313
|
-
const mailbox = yield*
|
|
25325
|
+
const mailbox = yield* make8();
|
|
25314
25326
|
const handleKeypress = (s, k) => {
|
|
25315
25327
|
const userInput = {
|
|
25316
25328
|
input: fromNullable(s),
|
|
@@ -25331,12 +25343,12 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
25331
25343
|
return mailbox;
|
|
25332
25344
|
});
|
|
25333
25345
|
const readLine = get3(rlRef).pipe(flatMap3((readlineInterface) => async((resume) => {
|
|
25334
|
-
const onLine = (line) => resume(
|
|
25346
|
+
const onLine = (line) => resume(succeed2(line));
|
|
25335
25347
|
readlineInterface.once("line", onLine);
|
|
25336
25348
|
return sync(() => readlineInterface.off("line", onLine));
|
|
25337
25349
|
})), scoped);
|
|
25338
25350
|
const display = (prompt) => uninterruptible(async((resume) => {
|
|
25339
|
-
stdout.write(prompt, (err) => err ? resume(
|
|
25351
|
+
stdout.write(prompt, (err) => err ? resume(fail3(new BadArgument({
|
|
25340
25352
|
module: "Terminal",
|
|
25341
25353
|
method: "display",
|
|
25342
25354
|
description: "Failed to write prompt to stdout",
|
|
@@ -25352,10 +25364,10 @@ var make6 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit
|
|
|
25352
25364
|
display
|
|
25353
25365
|
});
|
|
25354
25366
|
});
|
|
25355
|
-
var
|
|
25367
|
+
var layer8 = /* @__PURE__ */ scoped2(Terminal, /* @__PURE__ */ make6(defaultShouldQuit));
|
|
25356
25368
|
|
|
25357
25369
|
// node_modules/@effect/platform-node-shared/dist/esm/NodeTerminal.js
|
|
25358
|
-
var
|
|
25370
|
+
var layer9 = layer8;
|
|
25359
25371
|
|
|
25360
25372
|
// node_modules/@effect/platform-node/dist/esm/internal/worker.js
|
|
25361
25373
|
var platformWorkerImpl = /* @__PURE__ */ makePlatform()({
|
|
@@ -25415,14 +25427,14 @@ var platformWorkerImpl = /* @__PURE__ */ makePlatform()({
|
|
|
25415
25427
|
return _void;
|
|
25416
25428
|
}
|
|
25417
25429
|
});
|
|
25418
|
-
var layerWorker = /* @__PURE__ */
|
|
25430
|
+
var layerWorker = /* @__PURE__ */ succeed3(PlatformWorker, platformWorkerImpl);
|
|
25419
25431
|
var layerManager2 = /* @__PURE__ */ provide2(layerManager, layerWorker);
|
|
25420
25432
|
|
|
25421
25433
|
// node_modules/@effect/platform-node/dist/esm/NodeWorker.js
|
|
25422
25434
|
var layerManager3 = layerManager2;
|
|
25423
25435
|
|
|
25424
25436
|
// node_modules/@effect/platform-node/dist/esm/NodeContext.js
|
|
25425
|
-
var
|
|
25437
|
+
var layer11 = /* @__PURE__ */ pipe(/* @__PURE__ */ mergeAll(layer7, layer5, layer9, layerManager3), /* @__PURE__ */ provideMerge(layer2));
|
|
25426
25438
|
|
|
25427
25439
|
// node_modules/@effect/platform-node/dist/esm/NodeRuntime.js
|
|
25428
25440
|
var NodeRuntime_exports = {};
|
|
@@ -25465,13 +25477,6 @@ var runMain2 = runMain;
|
|
|
25465
25477
|
// node_modules/@effect/platform-node/dist/esm/NodeRuntime.js
|
|
25466
25478
|
var runMain3 = runMain2;
|
|
25467
25479
|
|
|
25468
|
-
// node_modules/@effect/platform-node/dist/esm/NodeFileSystem.js
|
|
25469
|
-
var NodeFileSystem_exports2 = {};
|
|
25470
|
-
__export(NodeFileSystem_exports2, {
|
|
25471
|
-
layer: () => layer11
|
|
25472
|
-
});
|
|
25473
|
-
var layer11 = layer4;
|
|
25474
|
-
|
|
25475
25480
|
// node_modules/@effect/platform-node/dist/esm/Undici.js
|
|
25476
25481
|
var Undici_exports = {};
|
|
25477
25482
|
__export(Undici_exports, {
|
|
@@ -25480,81 +25485,8 @@ __export(Undici_exports, {
|
|
|
25480
25485
|
var import_undici = __toESM(require_undici(), 1);
|
|
25481
25486
|
__reExport(Undici_exports, __toESM(require_undici(), 1));
|
|
25482
25487
|
|
|
25483
|
-
// src/
|
|
25484
|
-
var
|
|
25485
|
-
switch (error._tag) {
|
|
25486
|
-
case "ExecError":
|
|
25487
|
-
return `Command failed in sandbox (${error.command}): ${error.message}`;
|
|
25488
|
-
case "ExecHostError":
|
|
25489
|
-
return `Command failed on host (${error.command}): ${error.message}`;
|
|
25490
|
-
case "CopyError":
|
|
25491
|
-
return `File copy failed: ${error.message}`;
|
|
25492
|
-
case "DockerError":
|
|
25493
|
-
return `Docker operation failed: ${error.message}. Is Docker running?`;
|
|
25494
|
-
case "PodmanError":
|
|
25495
|
-
return `Podman operation failed: ${error.message}. Is Podman running?`;
|
|
25496
|
-
case "SyncError":
|
|
25497
|
-
return `Git sync failed: ${error.message}`;
|
|
25498
|
-
case "WorktreeError":
|
|
25499
|
-
return `Git worktree operation failed: ${error.message}`;
|
|
25500
|
-
case "PromptError":
|
|
25501
|
-
return `Failed to resolve prompt: ${error.message}`;
|
|
25502
|
-
case "AgentError":
|
|
25503
|
-
return `Agent invocation failed: ${error.message}`;
|
|
25504
|
-
case "ConfigDirError":
|
|
25505
|
-
return `${error.message}`;
|
|
25506
|
-
case "InitError":
|
|
25507
|
-
return `${error.message}`;
|
|
25508
|
-
case "AgentIdleTimeoutError":
|
|
25509
|
-
case "WorktreeTimeoutError":
|
|
25510
|
-
case "ContainerStartTimeoutError":
|
|
25511
|
-
case "CopyToWorktreeTimeoutError":
|
|
25512
|
-
case "CopyToWorktreeError":
|
|
25513
|
-
case "SyncInTimeoutError":
|
|
25514
|
-
case "HookTimeoutError":
|
|
25515
|
-
case "GitSetupTimeoutError":
|
|
25516
|
-
case "PromptExpansionTimeoutError":
|
|
25517
|
-
case "CommitCollectionTimeoutError":
|
|
25518
|
-
case "MergeToHostTimeoutError":
|
|
25519
|
-
case "SessionCaptureError":
|
|
25520
|
-
case "CwdError":
|
|
25521
|
-
return error.message;
|
|
25522
|
-
}
|
|
25523
|
-
};
|
|
25524
|
-
var showErrorAndExit = (error) => Effect_exports.gen(function* () {
|
|
25525
|
-
const d = yield* Display;
|
|
25526
|
-
yield* d.status(formatErrorMessage(error), "error");
|
|
25527
|
-
return yield* Effect_exports.sync(() => process.exit(1));
|
|
25528
|
-
});
|
|
25529
|
-
var withFriendlyErrors = (effect2) => (
|
|
25530
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25531
|
-
Effect_exports.catchTags(effect2, {
|
|
25532
|
-
ExecError: showErrorAndExit,
|
|
25533
|
-
ExecHostError: showErrorAndExit,
|
|
25534
|
-
CopyError: showErrorAndExit,
|
|
25535
|
-
DockerError: showErrorAndExit,
|
|
25536
|
-
PodmanError: showErrorAndExit,
|
|
25537
|
-
SyncError: showErrorAndExit,
|
|
25538
|
-
WorktreeError: showErrorAndExit,
|
|
25539
|
-
PromptError: showErrorAndExit,
|
|
25540
|
-
AgentError: showErrorAndExit,
|
|
25541
|
-
ConfigDirError: showErrorAndExit,
|
|
25542
|
-
InitError: showErrorAndExit,
|
|
25543
|
-
AgentIdleTimeoutError: showErrorAndExit,
|
|
25544
|
-
WorktreeTimeoutError: showErrorAndExit,
|
|
25545
|
-
ContainerStartTimeoutError: showErrorAndExit,
|
|
25546
|
-
CopyToWorktreeTimeoutError: showErrorAndExit,
|
|
25547
|
-
CopyToWorktreeError: showErrorAndExit,
|
|
25548
|
-
SyncInTimeoutError: showErrorAndExit,
|
|
25549
|
-
HookTimeoutError: showErrorAndExit,
|
|
25550
|
-
GitSetupTimeoutError: showErrorAndExit,
|
|
25551
|
-
PromptExpansionTimeoutError: showErrorAndExit,
|
|
25552
|
-
CommitCollectionTimeoutError: showErrorAndExit,
|
|
25553
|
-
MergeToHostTimeoutError: showErrorAndExit,
|
|
25554
|
-
SessionCaptureError: showErrorAndExit,
|
|
25555
|
-
CwdError: showErrorAndExit
|
|
25556
|
-
})
|
|
25557
|
-
);
|
|
25488
|
+
// src/NativeSandboxUnavailableError.ts
|
|
25489
|
+
var NativeSandboxUnavailableError2 = NativeSandboxUnavailableError;
|
|
25558
25490
|
/*! Bundled license information:
|
|
25559
25491
|
|
|
25560
25492
|
undici/lib/web/fetch/body.js:
|
|
@@ -25564,6 +25496,6 @@ undici/lib/web/websocket/frame.js:
|
|
|
25564
25496
|
(*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
|
|
25565
25497
|
*/
|
|
25566
25498
|
|
|
25567
|
-
export {
|
|
25568
|
-
//# sourceMappingURL=chunk-
|
|
25569
|
-
//# sourceMappingURL=chunk-
|
|
25499
|
+
export { NativeSandboxUnavailableError2 as NativeSandboxUnavailableError, NodeContext_exports, NodeFileSystem_exports, NodeRuntime_exports };
|
|
25500
|
+
//# sourceMappingURL=chunk-S6UHPTRG.js.map
|
|
25501
|
+
//# sourceMappingURL=chunk-S6UHPTRG.js.map
|