@usine/executor 0.6.1-next.571.g33bab87.1.1 → 0.6.1-next.577.gce404bf.1.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/README.md +5 -5
- package/dist/supervisor/confine.d.ts +9 -0
- package/dist/supervisor/confine.d.ts.map +1 -0
- package/dist/supervisor/confine.js +41 -0
- package/dist/supervisor/confine.js.map +1 -0
- package/dist/supervisor/container.d.ts +20 -21
- package/dist/supervisor/container.d.ts.map +1 -1
- package/dist/supervisor/container.js +263 -204
- package/dist/supervisor/container.js.map +1 -1
- package/dist/supervisor/detect.d.ts +15 -0
- package/dist/supervisor/detect.d.ts.map +1 -0
- package/dist/supervisor/detect.js +69 -0
- package/dist/supervisor/detect.js.map +1 -0
- package/dist/supervisor/homes/file.d.ts +10 -0
- package/dist/supervisor/homes/file.d.ts.map +1 -0
- package/dist/supervisor/homes/file.js +44 -0
- package/dist/supervisor/homes/file.js.map +1 -0
- package/dist/supervisor/homes/homes.d.ts +25 -0
- package/dist/supervisor/homes/homes.d.ts.map +1 -0
- package/dist/supervisor/homes/homes.js +13 -0
- package/dist/supervisor/homes/homes.js.map +1 -0
- package/dist/supervisor/homes/memory.d.ts +5 -0
- package/dist/supervisor/homes/memory.d.ts.map +1 -0
- package/dist/supervisor/homes/memory.js +19 -0
- package/dist/supervisor/homes/memory.js.map +1 -0
- package/dist/supervisor/names.d.ts +6 -0
- package/dist/supervisor/names.d.ts.map +1 -1
- package/dist/supervisor/names.js +4 -0
- package/dist/supervisor/names.js.map +1 -1
- package/dist/supervisor/privileges.d.ts +6 -0
- package/dist/supervisor/privileges.d.ts.map +1 -0
- package/dist/supervisor/privileges.js +10 -0
- package/dist/supervisor/privileges.js.map +1 -0
- package/dist/supervisor/storage.d.ts +44 -7
- package/dist/supervisor/storage.d.ts.map +1 -1
- package/dist/supervisor/storage.js +152 -116
- package/dist/supervisor/storage.js.map +1 -1
- package/dist/supervisor/supervisor.d.ts +4 -1
- package/dist/supervisor/supervisor.d.ts.map +1 -1
- package/dist/supervisor/supervisor.js +4 -1
- package/dist/supervisor/supervisor.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,124 +1,160 @@
|
|
|
1
1
|
import { SupervisorUnavailable } from "@usine/agents/supervisor";
|
|
2
|
-
import { Effect, Fiber, FileSystem,
|
|
3
|
-
import { ChildProcess
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import { Effect, Fiber, FileSystem, Option, Result, Stream } from "effect";
|
|
3
|
+
import { ChildProcess } from "effect/process";
|
|
4
|
+
/** How long one copy of a home into or out of a sandbox may take. */
|
|
5
|
+
const TRANSFER_TIMEOUT = "2 minutes";
|
|
6
|
+
const MIB = 1024 ** 2;
|
|
7
|
+
/** The first non-blank line of `text`, which names the cause in tar and runtime errors. */
|
|
8
|
+
const firstLine = (text) => text
|
|
9
|
+
.split("\n")
|
|
10
|
+
.map((line) => line.trim())
|
|
11
|
+
.find((line) => line !== "") ?? "";
|
|
12
|
+
/**
|
|
13
|
+
* Returns why `limits` leave the harness too little memory, or `None`. The home and `/tmp` are
|
|
14
|
+
* in-memory filesystems, so their files count against the container's memory limit; together
|
|
15
|
+
* they may take at most half of it.
|
|
16
|
+
*/
|
|
17
|
+
export const memoryShortfall = (limits) => (limits.conversationSizeMib + limits.tmpfsSizeMib) * 2 > limits.memoryMib
|
|
18
|
+
? Option.some(`supervisor_limits.conversation_size_mib (${limits.conversationSizeMib}) plus tmpfs_size_mib (${limits.tmpfsSizeMib}) must be at most half of memory_mib (${limits.memoryMib}), because the files in a turn's home and /tmp count against its memory`)
|
|
19
|
+
: Option.none();
|
|
20
|
+
/** Passes `stream` on until it exceeds `limit` bytes, and then fails with `exceeded()`. */
|
|
21
|
+
export const capBytes = (limit, exceeded) => (stream) => Stream.suspend(() => {
|
|
22
|
+
let bytes = 0;
|
|
23
|
+
return stream.pipe(Stream.mapEffect((chunk) => {
|
|
24
|
+
bytes += chunk.byteLength;
|
|
25
|
+
return bytes > limit ? Effect.fail(exceeded()) : Effect.succeed(chunk);
|
|
26
|
+
}));
|
|
27
|
+
});
|
|
28
|
+
/** The bytes in the regular files under `path`, without following links; 0 when it is absent. */
|
|
29
|
+
const directoryBytes = Effect.fn("SupervisorStorage.directoryBytes")(function* (fs, path) {
|
|
30
|
+
if (!(yield* fs.exists(path)))
|
|
31
|
+
return 0;
|
|
32
|
+
let bytes = 0;
|
|
33
|
+
for (const entry of yield* fs.readDirectory(path, { recursive: true })) {
|
|
34
|
+
const info = yield* fs.lstat(`${path}/${entry}`);
|
|
35
|
+
if (info.type === "File")
|
|
36
|
+
bytes += Number(info.size);
|
|
20
37
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
return bytes;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Fails when the files that the orchestrator's own harness process wrote in the conversation's
|
|
42
|
+
* working directory exceed `conversation_size_mib`.
|
|
43
|
+
*/
|
|
44
|
+
export const checkWorkspaceSize = Effect.fn("SupervisorStorage.checkWorkspaceSize")(function* (fs, workspace, limits) {
|
|
45
|
+
const bytes = yield* directoryBytes(fs, workspace).pipe(Effect.mapError((error) => SupervisorUnavailable.make({
|
|
46
|
+
message: `Can't measure the conversation's saved sessions: ${error.message}`,
|
|
47
|
+
})));
|
|
48
|
+
if (bytes <= limits.conversationSizeMib * MIB)
|
|
49
|
+
return bytes;
|
|
50
|
+
yield* Effect.logWarning("A supervisor conversation's saved sessions exceed their limit", {
|
|
51
|
+
workspace,
|
|
52
|
+
bytes,
|
|
53
|
+
limitMib: limits.conversationSizeMib,
|
|
54
|
+
});
|
|
55
|
+
return yield* SupervisorUnavailable.make({
|
|
56
|
+
message: `The conversation's saved sessions use ${Math.ceil(bytes / MIB)} MiB, more than supervisor_limits.conversation_size_mib (${limits.conversationSizeMib} MiB). Start a new conversation, or raise the limit and restart usine.`,
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* Removes the FUSE storage of earlier versions: each conversation image in `disks`, and each
|
|
61
|
+
* directory in `conversations`, which those versions mounted the images at and turns could write
|
|
62
|
+
* to. Logs each removal. Earlier versions created `disks` before any conversation directory, and
|
|
63
|
+
* this version never creates it, so `disks` marks that layout; it is removed last, so that a
|
|
64
|
+
* startup after a failed removal tries again. A conversation without saved state starts a new
|
|
65
|
+
* harness session at its next turn.
|
|
66
|
+
*/
|
|
67
|
+
export const removeFuseStorage = Effect.fn("SupervisorStorage.removeFuseStorage")(function* (root) {
|
|
68
|
+
const fs = yield* FileSystem.FileSystem;
|
|
69
|
+
const disks = `${root}/disks`;
|
|
70
|
+
if (!(yield* fs.exists(disks)))
|
|
71
|
+
return;
|
|
72
|
+
const conversations = `${root}/conversations`;
|
|
73
|
+
const directories = (yield* fs.exists(conversations))
|
|
74
|
+
? (yield* fs.readDirectory(conversations)).map((name) => `${conversations}/${name}`)
|
|
75
|
+
: [];
|
|
76
|
+
const images = (yield* fs.readDirectory(disks)).map((name) => `${disks}/${name}`);
|
|
77
|
+
let failed = 0;
|
|
78
|
+
for (const path of [...directories, ...images]) {
|
|
79
|
+
const removed = yield* fs.remove(path, { recursive: true, force: true }).pipe(Effect.result);
|
|
80
|
+
if (Result.isSuccess(removed))
|
|
81
|
+
yield* Effect.logInfo("Removed supervisor storage from an earlier version", { path });
|
|
82
|
+
else {
|
|
83
|
+
failed += 1;
|
|
84
|
+
yield* Effect.logWarning("Could not remove supervisor storage from an earlier version", {
|
|
85
|
+
path,
|
|
86
|
+
message: removed.failure.message,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
41
89
|
}
|
|
42
|
-
|
|
43
|
-
|
|
90
|
+
if (failed === 0)
|
|
91
|
+
yield* fs.remove(disks, { recursive: true });
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Runs `args` in `container` with `<runtime> exec`, feeding `stdin` to it, and returns its stdout
|
|
95
|
+
* as text. Fails with the command's first stderr line when it exits with another code than 0, and
|
|
96
|
+
* otherwise with the error of `stdin`.
|
|
97
|
+
*/
|
|
98
|
+
const execIn = (spawner, container, action, args, stdin) => Effect.gen(function* () {
|
|
99
|
+
const handle = yield* spawner.spawn(ChildProcess.make(container.runtime, ["exec", ...(Option.isSome(stdin) ? ["--interactive"] : []), container.name, ...args], { forceKillAfter: "2 seconds" }));
|
|
100
|
+
const fed = yield* Option.match(stdin, {
|
|
101
|
+
onNone: () => Effect.void,
|
|
102
|
+
onSome: (input) => Stream.run(input, handle.stdin),
|
|
103
|
+
}).pipe(Effect.result, Effect.forkScoped);
|
|
104
|
+
const [stdout, stderr, exitCode] = yield* Effect.all([
|
|
105
|
+
handle.stdout.pipe(Stream.decodeText(), Stream.mkString),
|
|
106
|
+
handle.stderr.pipe(Stream.decodeText(), Stream.mkString),
|
|
107
|
+
handle.exitCode,
|
|
108
|
+
], { concurrency: "unbounded" });
|
|
109
|
+
if (exitCode !== 0)
|
|
44
110
|
return yield* SupervisorUnavailable.make({
|
|
45
|
-
message:
|
|
111
|
+
message: `Can't ${action}: ${firstLine(stderr) || `${args[0]} exited with code ${exitCode}`}`,
|
|
46
112
|
});
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
yield* Effect.logWarning("Repaired a supervisor conversation filesystem", { directory });
|
|
50
|
-
const mountedProcess = yield* spawner.spawn(ChildProcess.make("fuse2fs", ["-f", "-o", "rw,nosuid,nodev,allow_other", image, directory], {
|
|
51
|
-
detached: false,
|
|
52
|
-
forceKillAfter: "2 seconds",
|
|
53
|
-
}));
|
|
54
|
-
const diagnostics = yield* Ref.make("");
|
|
55
|
-
const diagnosticsReader = yield* Stream.merge(mountedProcess.stdout, mountedProcess.stderr).pipe(Stream.decodeText(), Stream.runForEach((text) => Ref.update(diagnostics, (tail) => (tail + text).slice(-8192))), Effect.catch((error) => Effect.logWarning("Supervisor filesystem diagnostics stopped", {
|
|
56
|
-
directory,
|
|
57
|
-
message: error.message,
|
|
58
|
-
})), Effect.forkScoped);
|
|
59
|
-
yield* Effect.addFinalizer(() => run("fusermount", ["-u", directory]).pipe(Effect.retry({ times: 2, schedule: Schedule.spaced("200 millis") }), Effect.catch((error) => Effect.logError("Could not unmount a supervisor filesystem", {
|
|
60
|
-
directory,
|
|
61
|
-
message: error.message,
|
|
62
|
-
}))));
|
|
63
|
-
yield* run("mountpoint", ["-q", directory]).pipe(Effect.retry({ schedule: Schedule.spaced("100 millis") }), Effect.timeout("10 seconds"), Effect.raceFirst(mountedProcess.exitCode.pipe(Effect.flatMap((code) => Effect.gen(function* () {
|
|
64
|
-
yield* Fiber.join(diagnosticsReader).pipe(Effect.timeoutOrElse({
|
|
65
|
-
duration: "1 second",
|
|
66
|
-
orElse: () => Effect.logWarning("Supervisor filesystem diagnostics did not close after exit", {
|
|
67
|
-
directory,
|
|
68
|
-
}),
|
|
69
|
-
}));
|
|
70
|
-
const detail = yield* Ref.get(diagnostics);
|
|
113
|
+
const input = yield* Fiber.join(fed);
|
|
114
|
+
if (Result.isFailure(input))
|
|
71
115
|
return yield* SupervisorUnavailable.make({
|
|
72
|
-
message: `
|
|
116
|
+
message: `Can't ${action}: ${input.failure.message}`,
|
|
73
117
|
});
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
message: `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
["
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
message: `Cannot unmount a previous supervisor filesystem: ${unmounted.stderr.trim()}`,
|
|
117
|
-
});
|
|
118
|
-
yield* Effect.logInfo("Unmounted a previous supervisor filesystem", { directory });
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}, (effect) => effect.pipe(Effect.timeout("15 seconds"), Effect.mapError((error) => SupervisorUnavailable.make({
|
|
122
|
-
message: `Supervisor storage requires fuse2fs, fusermount, e2fsprogs and fallocate: ${error.message}`,
|
|
123
|
-
}))));
|
|
118
|
+
return stdout;
|
|
119
|
+
}).pipe(Effect.scoped, Effect.timeout(TRANSFER_TIMEOUT), Effect.mapError((error) => error._tag === "SupervisorUnavailable"
|
|
120
|
+
? error
|
|
121
|
+
: SupervisorUnavailable.make({ message: `Can't ${action}: ${error.message}` })));
|
|
122
|
+
/**
|
|
123
|
+
* Prepares the home of a turn in `container`: extracts `archive`, the saved home, into `root`,
|
|
124
|
+
* creates `home` when there is none, and writes `files` into it, replacing any entry at their
|
|
125
|
+
* paths. `root` is the turn's in-memory filesystem.
|
|
126
|
+
*/
|
|
127
|
+
export const restoreHome = Effect.fn("SupervisorStorage.restoreHome")(function* (spawner, container, root, archive, files) {
|
|
128
|
+
if (Option.isSome(archive))
|
|
129
|
+
yield* execIn(spawner, container, "restore the conversation's saved home", ["tar", "-x", "-f", "-", "-C", root], archive);
|
|
130
|
+
yield* execIn(spawner, container, "create the conversation's home", ["mkdir", "-p", "--", `${root}/home`], Option.none());
|
|
131
|
+
const encoder = new TextEncoder();
|
|
132
|
+
for (const [path, contents] of files)
|
|
133
|
+
yield* execIn(spawner, container, "write the harness's model settings", ["sh", "-c", 'mkdir -p -- "${1%/*}" && rm -rf -- "$1" && cat > "$1"', "sh", path], Option.some(Stream.make(encoder.encode(contents))));
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* The tar archive of `root/home` in `container`, which fails once it exceeds `limitMib` MiB, and at
|
|
137
|
+
* its end when tar fails.
|
|
138
|
+
*/
|
|
139
|
+
export const archiveHome = (spawner, container, root, limitMib) => Stream.unwrap(Effect.gen(function* () {
|
|
140
|
+
const handle = yield* spawner.spawn(ChildProcess.make(container.runtime, ["exec", container.name, "tar", "-c", "-f", "-", "-C", root, "home"], { forceKillAfter: "2 seconds" }));
|
|
141
|
+
const stderr = yield* handle.stderr.pipe(Stream.decodeText(), Stream.runFold(() => "", (head, text) => (head + text).slice(0, 8192)), Effect.forkScoped);
|
|
142
|
+
const ended = Effect.gen(function* () {
|
|
143
|
+
const exitCode = yield* handle.exitCode;
|
|
144
|
+
if (exitCode === 0)
|
|
145
|
+
return;
|
|
146
|
+
const output = yield* Fiber.join(stderr);
|
|
147
|
+
const detail = firstLine(output);
|
|
148
|
+
return yield* SupervisorUnavailable.make({
|
|
149
|
+
message: `Can't save the conversation's home: ${detail || `tar exited with code ${exitCode}`}`,
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
return handle.stdout.pipe(capBytes(limitMib * MIB, () => SupervisorUnavailable.make({
|
|
153
|
+
message: `The conversation's home is larger than supervisor_limits.conversation_size_mib (${limitMib} MiB), so usine kept the state that the previous turn saved`,
|
|
154
|
+
})), Stream.concat(Stream.drain(Stream.fromEffect(ended))));
|
|
155
|
+
})).pipe(Stream.mapError((error) => error._tag === "SupervisorUnavailable"
|
|
156
|
+
? error
|
|
157
|
+
: SupervisorUnavailable.make({
|
|
158
|
+
message: `Can't save the conversation's home: ${error.message}`,
|
|
159
|
+
})));
|
|
124
160
|
//# sourceMappingURL=storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/supervisor/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/supervisor/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,YAAY,EAA4B,MAAM,gBAAgB,CAAC;AASxE,qEAAqE;AACrE,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAErC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC;AAEtB,2FAA2F;AAC3F,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CACjC,IAAI;KACD,KAAK,CAAC,IAAI,CAAC;KACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;KAC1B,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAwB,EAAyB,EAAE,CACjF,CAAC,MAAM,CAAC,mBAAmB,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,SAAS;IACvE,CAAC,CAAC,MAAM,CAAC,IAAI,CACT,4CAA4C,MAAM,CAAC,mBAAmB,0BAA0B,MAAM,CAAC,Y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B,OAAO,EAAE,uCAAuC,KAAK,CAAC,OAAO,EAAE;KAChE,CAAC,CACP,CACF,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { containerSandboxLayer, type ContainerSandboxOptions,
|
|
1
|
+
export { containerSandboxLayer, type ContainerSandboxOptions, MODEL_RELAY_PORT, } from "./container.ts";
|
|
2
|
+
export { detectSandboxRuntime, type SandboxRuntime } from "./detect.ts";
|
|
2
3
|
export { makeSupervisorSources, type SourceOrigin, type SupervisorSources } from "./sources.ts";
|
|
4
|
+
export { fileHomesLayer } from "./homes/file.ts";
|
|
5
|
+
export { ConversationHomes, HomeStoreError } from "./homes/homes.ts";
|
|
3
6
|
//# sourceMappingURL=supervisor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../src/supervisor/supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../../src/supervisor/supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export { containerSandboxLayer,
|
|
1
|
+
export { containerSandboxLayer, MODEL_RELAY_PORT, } from "./container.js";
|
|
2
|
+
export { detectSandboxRuntime } from "./detect.js";
|
|
2
3
|
export { makeSupervisorSources } from "./sources.js";
|
|
4
|
+
export { fileHomesLayer } from "./homes/file.js";
|
|
5
|
+
export { ConversationHomes, HomeStoreError } from "./homes/homes.js";
|
|
3
6
|
//# sourceMappingURL=supervisor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supervisor.js","sourceRoot":"","sources":["../../src/supervisor/supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,
|
|
1
|
+
{"version":3,"file":"supervisor.js","sourceRoot":"","sources":["../../src/supervisor/supervisor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EAErB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAuB,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAA6C,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usine/executor",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.577.gce404bf.1.1",
|
|
4
4
|
"description": "The usine scoped Worker contract with local, exe.dev, SSH, and Cloudflare adapters.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -51,11 +51,11 @@
|
|
|
51
51
|
"@bufbuild/protobuf": "2.17.0",
|
|
52
52
|
"@connectrpc/connect": "2.3.0",
|
|
53
53
|
"@connectrpc/connect-node": "2.3.0",
|
|
54
|
-
"@usine/
|
|
55
|
-
"@usine/
|
|
56
|
-
"@usine/
|
|
57
|
-
"@usine/
|
|
58
|
-
"@usine/durable": "0.3.1-next.
|
|
54
|
+
"@usine/cloudflare": "0.2.1-next.577.gce404bf.1.1",
|
|
55
|
+
"@usine/core": "0.7.1-next.577.gce404bf.1.1",
|
|
56
|
+
"@usine/gateway": "0.3.1-next.577.gce404bf.1.1",
|
|
57
|
+
"@usine/agents": "0.7.1-next.577.gce404bf.1.1",
|
|
58
|
+
"@usine/durable": "0.3.1-next.577.gce404bf.1.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@bufbuild/buf": "1.71.0",
|