totemlayer 0.1.63 → 0.1.67
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 +34 -4
- package/bin/agent-runner.mjs +91 -1
- package/bin/agent-setup.mjs +7 -1
- package/bin/automatic-runtime.mjs +30 -123
- package/bin/connected-agent-service.mjs +1 -1
- package/bin/installation.mjs +12 -8
- package/bin/managed-mcp.mjs +68 -0
- package/bin/native/darwin-lifetime +0 -0
- package/bin/native/darwin-lifetime.json +1 -0
- package/bin/network-runtime.mjs +1 -0
- package/bin/process-isolation.mjs +53 -9
- package/bin/runtime-archive.mjs +131 -0
- package/bin/runtime-diagnostics.mjs +3 -0
- package/bin/runtime-installation.mjs +91 -13
- package/bin/runtime-lock.mjs +118 -0
- package/bin/runtime-update.mjs +345 -0
- package/bin/sdk/inspector.js +1 -1
- package/bin/startup-diagnostics.mjs +13 -0
- package/bin/totem.mjs +11 -5
- package/bin/update-health.mjs +10 -0
- package/bin/update-trust.mjs +7 -0
- package/bin/worker-core/adapters.mjs +27 -6
- package/bin/worker-core/errors.mjs +4 -0
- package/package.json +3 -2
- package/scripts/build-native.mjs +60 -0
- package/scripts/prepare.mjs +1 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const source = new URL("../native/darwin-lifetime.c", import.meta.url);
|
|
7
|
+
const binary = new URL("../bin/native/darwin-lifetime", import.meta.url);
|
|
8
|
+
const manifest = new URL("../bin/native/darwin-lifetime.json", import.meta.url);
|
|
9
|
+
const digest = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
10
|
+
const sourceSha256 = digest(await readFile(source));
|
|
11
|
+
|
|
12
|
+
if (process.platform === "win32")
|
|
13
|
+
throw new Error(
|
|
14
|
+
"Build the universal CLI tarball on macOS or Linux to preserve the native executable mode; Windows can install that tarball.",
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
if (process.platform === "darwin") {
|
|
18
|
+
await mkdir(new URL("../bin/native/", import.meta.url), { recursive: true });
|
|
19
|
+
const temporary = `${fileURLToPath(binary)}.${process.pid}.tmp`;
|
|
20
|
+
try {
|
|
21
|
+
execFileSync(
|
|
22
|
+
"/usr/bin/clang",
|
|
23
|
+
[
|
|
24
|
+
"-std=c11",
|
|
25
|
+
"-D_DARWIN_C_SOURCE",
|
|
26
|
+
"-Wall",
|
|
27
|
+
"-Wextra",
|
|
28
|
+
"-Werror",
|
|
29
|
+
"-O2",
|
|
30
|
+
"-arch",
|
|
31
|
+
"arm64",
|
|
32
|
+
"-arch",
|
|
33
|
+
"x86_64",
|
|
34
|
+
"-mmacosx-version-min=13.0",
|
|
35
|
+
fileURLToPath(source),
|
|
36
|
+
"-o",
|
|
37
|
+
temporary,
|
|
38
|
+
],
|
|
39
|
+
{ stdio: "inherit", timeout: 60_000 },
|
|
40
|
+
);
|
|
41
|
+
await rename(temporary, binary);
|
|
42
|
+
await writeFile(
|
|
43
|
+
manifest,
|
|
44
|
+
JSON.stringify({
|
|
45
|
+
sourceSha256,
|
|
46
|
+
binarySha256: digest(await readFile(binary)),
|
|
47
|
+
architectures: ["arm64", "x86_64"],
|
|
48
|
+
minimumMacOS: "13.0",
|
|
49
|
+
}) + "\n",
|
|
50
|
+
);
|
|
51
|
+
} finally {
|
|
52
|
+
await rm(temporary, { force: true });
|
|
53
|
+
}
|
|
54
|
+
} else {
|
|
55
|
+
// Every published tarball supports both Mac architectures. Build this small
|
|
56
|
+
// artifact on macOS before packing elsewhere; never ship a stale or missing one.
|
|
57
|
+
const built = JSON.parse(await readFile(manifest, "utf8"));
|
|
58
|
+
if (built.sourceSha256 !== sourceSha256 || built.binarySha256 !== digest(await readFile(binary)))
|
|
59
|
+
throw new Error("Build the current macOS lifetime supervisor on macOS before packing.");
|
|
60
|
+
}
|
package/scripts/prepare.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { access, readdir, readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import { transform } from "esbuild";
|
|
3
|
+
import "./build-native.mjs";
|
|
3
4
|
import { generateNetworkContract } from "../../../scripts/generate-network-contract.mjs";
|
|
4
5
|
await generateNetworkContract();
|
|
5
6
|
// This candidate rebases coordination on the immutable published 0.1.21 bundle.
|