autopilot-ai 1.19.1 → 1.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16750,6 +16750,30 @@ data: ${JSON.stringify(event.data)}
|
|
|
16750
16750
|
import { execFile as execFile5 } from "child_process";
|
|
16751
16751
|
import { promisify as promisify4 } from "util";
|
|
16752
16752
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
16753
|
+
async function writeCellFileChunked(cell, path, content) {
|
|
16754
|
+
if (Buffer.byteLength(content, "utf8") <= CELL_FILE_WRITE_CHUNK_CHARS) {
|
|
16755
|
+
await cell.writeFile(path, content, { mode: "0600" });
|
|
16756
|
+
return;
|
|
16757
|
+
}
|
|
16758
|
+
const partsDir = `${path}.parts`;
|
|
16759
|
+
const encoded = Buffer.from(content, "utf8").toString("base64");
|
|
16760
|
+
const partPaths = [];
|
|
16761
|
+
await cell.mkdir(partsDir, { parents: true });
|
|
16762
|
+
try {
|
|
16763
|
+
for (let offset = 0, index = 0; offset < encoded.length; offset += CELL_FILE_WRITE_CHUNK_CHARS, index++) {
|
|
16764
|
+
const partPath = `${partsDir}/${String(index).padStart(6, "0")}.b64`;
|
|
16765
|
+
await cell.writeFile(partPath, encoded.slice(offset, offset + CELL_FILE_WRITE_CHUNK_CHARS), { mode: "0600" });
|
|
16766
|
+
partPaths.push(partPath);
|
|
16767
|
+
}
|
|
16768
|
+
const result2 = await cell.exec(
|
|
16769
|
+
`cat ${partPaths.map(shellQuote2).join(" ")} | base64 -d > ${shellQuote2(path)} && chmod 600 ${shellQuote2(path)}`
|
|
16770
|
+
);
|
|
16771
|
+
if (result2.exitCode !== 0) throw new Error("cell_control_failed");
|
|
16772
|
+
} finally {
|
|
16773
|
+
await cell.exec(`rm -rf ${shellQuote2(partsDir)}`).catch(() => {
|
|
16774
|
+
});
|
|
16775
|
+
}
|
|
16776
|
+
}
|
|
16753
16777
|
async function defaultArchiveWorkspace(workspaceRoot) {
|
|
16754
16778
|
const { stdout } = await execFileAsync3("git", ["-C", workspaceRoot, "archive", "--format=tar", "HEAD"], {
|
|
16755
16779
|
encoding: "buffer",
|
|
@@ -16799,7 +16823,7 @@ ${redacted.slice(-half)}`;
|
|
|
16799
16823
|
function sleep4(ms) {
|
|
16800
16824
|
return new Promise((resolve15) => setTimeout(resolve15, ms));
|
|
16801
16825
|
}
|
|
16802
|
-
var execFileAsync3, CELL_WORKSPACE, CELL_STATE_DIR, CHECKPOINT_MESSAGE_FILE, INSTALLED_RUNTIME_PACKAGE, NOTES_FILE, MEMORY_FILE, MEMORY_EXTRACTION_TIMEOUT_MS, LIVENESS_CHECK_MS, ARTIFACTS_DIR, MAX_ARTIFACTS, MAX_ARTIFACT_BYTES, BRANCH_RE, REPOSITORY_RE, GIT, COMMIT_SHA_RE, MAX_TOOL_OUTPUT_CHARS, MAX_TOOL_INPUT_CHARS, MAX_CHECKPOINTS, CELL_CONTROL_DIR, BRIDGE_MARKER, CONTROL_RUNNER, BRIDGE_RUNNER, HEALTH_TIMEOUT_MS, EVENT_POLL_MS, AsterHotcellRuntime, ARTIFACT_MIME_TYPES;
|
|
16826
|
+
var execFileAsync3, CELL_WORKSPACE, CELL_STATE_DIR, CHECKPOINT_MESSAGE_FILE, INSTALLED_RUNTIME_PACKAGE, NOTES_FILE, MEMORY_FILE, MEMORY_EXTRACTION_TIMEOUT_MS, LIVENESS_CHECK_MS, ARTIFACTS_DIR, MAX_ARTIFACTS, MAX_ARTIFACT_BYTES, BRANCH_RE, REPOSITORY_RE, GIT, COMMIT_SHA_RE, MAX_TOOL_OUTPUT_CHARS, MAX_TOOL_INPUT_CHARS, MAX_CHECKPOINTS, CELL_CONTROL_DIR, BRIDGE_MARKER, CONTROL_RUNNER, BRIDGE_RUNNER, HEALTH_TIMEOUT_MS, EVENT_POLL_MS, AsterHotcellRuntime, CELL_FILE_WRITE_CHUNK_CHARS, ARTIFACT_MIME_TYPES;
|
|
16803
16827
|
var init_aster_cell_runtime = __esm({
|
|
16804
16828
|
"src/server/aster-cell-runtime.ts"() {
|
|
16805
16829
|
"use strict";
|
|
@@ -17016,7 +17040,7 @@ var init_aster_cell_runtime = __esm({
|
|
|
17016
17040
|
const cell = await this.provider.getCell(cellId);
|
|
17017
17041
|
if (turn.memory) {
|
|
17018
17042
|
await cell.mkdir(CELL_STATE_DIR, { parents: true });
|
|
17019
|
-
await cell
|
|
17043
|
+
await writeCellFileChunked(cell, MEMORY_FILE, turn.memory.snapshot);
|
|
17020
17044
|
}
|
|
17021
17045
|
const note = [await this.readNotes(cell), turn.memory?.note ?? ""].filter(Boolean).join("\n\n");
|
|
17022
17046
|
const message2 = note ? `${note}
|
|
@@ -17273,7 +17297,7 @@ ${text}` : text, { mode: "0600" });
|
|
|
17273
17297
|
async control(cell, method, path, body) {
|
|
17274
17298
|
const requestId = randomUUID8();
|
|
17275
17299
|
await cell.mkdir(CELL_CONTROL_DIR, { parents: true });
|
|
17276
|
-
await cell
|
|
17300
|
+
await writeCellFileChunked(cell, `${CELL_CONTROL_DIR}/${requestId}.json`, JSON.stringify({ method, path, body }));
|
|
17277
17301
|
const result2 = await cell.exec(`${CONTROL_RUNNER} ${requestId}`);
|
|
17278
17302
|
if (result2.exitCode !== 0) throw new Error("cell_control_failed");
|
|
17279
17303
|
const parsed = JSON.parse(result2.stdout.trim().split("\n").pop() ?? "{}");
|
|
@@ -17285,6 +17309,7 @@ ${text}` : text, { mode: "0600" });
|
|
|
17285
17309
|
return this.control(cell, method, path, body);
|
|
17286
17310
|
}
|
|
17287
17311
|
};
|
|
17312
|
+
CELL_FILE_WRITE_CHUNK_CHARS = 32 * 1024;
|
|
17288
17313
|
ARTIFACT_MIME_TYPES = {
|
|
17289
17314
|
pdf: "application/pdf",
|
|
17290
17315
|
html: "text/html",
|