deus-machine 0.3.11 → 0.3.12
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/bundles/server.bundled.cjs +86719 -20189
- package/dist/cli.js +44 -89
- package/package.json +2 -4
- package/bundles/agent-server.bundled.cjs +0 -25567
package/dist/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ var init_package = __esm({
|
|
|
19
19
|
"package.json"() {
|
|
20
20
|
package_default = {
|
|
21
21
|
name: "deus-machine",
|
|
22
|
-
version: "0.3.
|
|
22
|
+
version: "0.3.12",
|
|
23
23
|
description: "Run Deus IDE from the command line \u2014 headless server or desktop installer",
|
|
24
24
|
license: "MIT",
|
|
25
25
|
author: {
|
|
@@ -58,11 +58,9 @@ var init_package = __esm({
|
|
|
58
58
|
build: "bunx tsx build.ts"
|
|
59
59
|
},
|
|
60
60
|
dependencies: {
|
|
61
|
-
"@anthropic-ai/claude-agent-sdk": "0.
|
|
61
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.288",
|
|
62
62
|
"@hono/node-server": "^1.19.9",
|
|
63
63
|
"@napi-rs/canvas": "^0.1.97",
|
|
64
|
-
"@openai/codex": "0.153.4",
|
|
65
|
-
"@openai/codex-sdk": "0.153.4",
|
|
66
64
|
"@sentry/node": "^10.40.0",
|
|
67
65
|
"agent-browser": "^0.21.4",
|
|
68
66
|
"better-sqlite3": "^12.4.1",
|
|
@@ -94,8 +92,6 @@ var CLI_RUNTIME_DEPENDENCIES = [
|
|
|
94
92
|
"@anthropic-ai/claude-agent-sdk",
|
|
95
93
|
"@hono/node-server",
|
|
96
94
|
"@napi-rs/canvas",
|
|
97
|
-
"@openai/codex",
|
|
98
|
-
"@openai/codex-sdk",
|
|
99
95
|
"@sentry/node",
|
|
100
96
|
"agent-browser",
|
|
101
97
|
"better-sqlite3",
|
|
@@ -130,8 +126,7 @@ function resolveRuntimeStagePaths(projectRoot) {
|
|
|
130
126
|
manifest: path.join(runtimeRoot, "manifest.json"),
|
|
131
127
|
common: {
|
|
132
128
|
root: commonRoot,
|
|
133
|
-
backendBundle: path.join(commonRoot, "server.bundled.cjs")
|
|
134
|
-
agentServerBundle: path.join(commonRoot, "agent-server.bundled.cjs")
|
|
129
|
+
backendBundle: path.join(commonRoot, "server.bundled.cjs")
|
|
135
130
|
},
|
|
136
131
|
electron: {
|
|
137
132
|
root: electronRoot
|
|
@@ -165,13 +160,12 @@ import {
|
|
|
165
160
|
} from "node:fs";
|
|
166
161
|
import path2 from "node:path";
|
|
167
162
|
import { fileURLToPath } from "node:url";
|
|
163
|
+
import { DEFAULT_PINS } from "@zvada/agent-server/core";
|
|
164
|
+
import { runInstall } from "@zvada/agent-server/server";
|
|
168
165
|
var runtimeDir = path2.dirname(fileURLToPath(import.meta.url));
|
|
169
166
|
var defaultProjectRoot = path2.resolve(runtimeDir, "../..");
|
|
170
167
|
var VERIFY_TIMEOUT_MS = 2e4;
|
|
171
|
-
var MIN_CODEX_APP_SERVER_VERSION = "0.128.0";
|
|
172
168
|
var VERSION_CHECK_ENV_DENYLIST = [
|
|
173
|
-
"AGENT_SERVER_CWD",
|
|
174
|
-
"AGENT_SERVER_ENTRY",
|
|
175
169
|
"AUTH_TOKEN",
|
|
176
170
|
"BUN_OPTIONS",
|
|
177
171
|
"DATABASE_PATH",
|
|
@@ -208,28 +202,19 @@ var AGENT_CLI_TARGETS = [
|
|
|
208
202
|
runtimeKey: "darwin-arm64",
|
|
209
203
|
fileFormat: "Mach-O 64-bit executable",
|
|
210
204
|
fileArch: "arm64",
|
|
211
|
-
agentBrowserEntry: "bin/agent-browser-darwin-arm64"
|
|
212
|
-
codexAliasPackage: "@openai/codex-darwin-arm64",
|
|
213
|
-
codexTriple: "aarch64-apple-darwin",
|
|
214
|
-
claudePackageName: "@anthropic-ai/claude-agent-sdk-darwin-arm64"
|
|
205
|
+
agentBrowserEntry: "bin/agent-browser-darwin-arm64"
|
|
215
206
|
},
|
|
216
207
|
{
|
|
217
208
|
runtimeKey: "darwin-x64",
|
|
218
209
|
fileFormat: "Mach-O 64-bit executable",
|
|
219
210
|
fileArch: "x86_64",
|
|
220
|
-
agentBrowserEntry: "bin/agent-browser-darwin-x64"
|
|
221
|
-
codexAliasPackage: "@openai/codex-darwin-x64",
|
|
222
|
-
codexTriple: "x86_64-apple-darwin",
|
|
223
|
-
claudePackageName: "@anthropic-ai/claude-agent-sdk-darwin-x64"
|
|
211
|
+
agentBrowserEntry: "bin/agent-browser-darwin-x64"
|
|
224
212
|
},
|
|
225
213
|
{
|
|
226
214
|
runtimeKey: "linux-x64",
|
|
227
215
|
fileFormat: "ELF 64-bit",
|
|
228
216
|
fileArch: "x86-64",
|
|
229
|
-
agentBrowserEntry: "bin/agent-browser-linux-x64"
|
|
230
|
-
codexAliasPackage: "@openai/codex-linux-x64",
|
|
231
|
-
codexTriple: "x86_64-unknown-linux-musl",
|
|
232
|
-
claudePackageName: "@anthropic-ai/claude-agent-sdk-linux-x64"
|
|
217
|
+
agentBrowserEntry: "bin/agent-browser-linux-x64"
|
|
233
218
|
}
|
|
234
219
|
];
|
|
235
220
|
function relativeFromProjectRoot(projectRoot, targetPath) {
|
|
@@ -241,28 +226,6 @@ function resolveAgentCliManifestPath(projectRoot) {
|
|
|
241
226
|
function resolveStagedAgentCliPath(projectRoot, runtimeKey, tool) {
|
|
242
227
|
return path2.join(resolveRuntimeStagePaths(projectRoot).electron.root, "bin", runtimeKey, tool);
|
|
243
228
|
}
|
|
244
|
-
function readSemver(version) {
|
|
245
|
-
return version.match(/\d+\.\d+\.\d+/)?.[0] ?? null;
|
|
246
|
-
}
|
|
247
|
-
function isVersionAtLeast(version, minimum) {
|
|
248
|
-
if (!version) return false;
|
|
249
|
-
const currentParts = version.split(".").map(Number);
|
|
250
|
-
const minimumParts = minimum.split(".").map(Number);
|
|
251
|
-
for (let i = 0; i < minimumParts.length; i++) {
|
|
252
|
-
const current = currentParts[i] ?? 0;
|
|
253
|
-
const required = minimumParts[i] ?? 0;
|
|
254
|
-
if (current > required) return true;
|
|
255
|
-
if (current < required) return false;
|
|
256
|
-
}
|
|
257
|
-
return true;
|
|
258
|
-
}
|
|
259
|
-
function assertCodexAppServerCompatible(version, label) {
|
|
260
|
-
const semver = readSemver(version);
|
|
261
|
-
if (isVersionAtLeast(semver, MIN_CODEX_APP_SERVER_VERSION)) return;
|
|
262
|
-
throw new Error(
|
|
263
|
-
`${label} requires @openai/codex >= ${MIN_CODEX_APP_SERVER_VERSION} for the codex app-server harness; found ${version}`
|
|
264
|
-
);
|
|
265
|
-
}
|
|
266
229
|
function hashFile(filePath) {
|
|
267
230
|
return createHash("sha256").update(readFileSync(filePath)).digest("hex");
|
|
268
231
|
}
|
|
@@ -428,7 +391,11 @@ function validateStagedAgentClis(options = {}) {
|
|
|
428
391
|
if (!codexEntry) {
|
|
429
392
|
throw new Error(`Agent CLI manifest is missing ${runtimeKey}/codex`);
|
|
430
393
|
}
|
|
431
|
-
|
|
394
|
+
if (codexEntry.source.version !== DEFAULT_PINS.codex) {
|
|
395
|
+
throw new Error(
|
|
396
|
+
`${runtimeKey}/codex is ${codexEntry.source.version}, but agent-server runs ${DEFAULT_PINS.codex}: stage the CLIs again`
|
|
397
|
+
);
|
|
398
|
+
}
|
|
432
399
|
const tools = bundledTools(runtimeKey);
|
|
433
400
|
for (const tool of tools) {
|
|
434
401
|
const executablePath = resolveStagedAgentCliPath(projectRoot, runtimeKey, tool);
|
|
@@ -512,8 +479,6 @@ var REQUIRED_RUNTIME_ENTITLEMENTS = [
|
|
|
512
479
|
"com.apple.security.cs.disable-library-validation"
|
|
513
480
|
];
|
|
514
481
|
var VERSION_CHECK_ENV_DENYLIST2 = [
|
|
515
|
-
"AGENT_SERVER_CWD",
|
|
516
|
-
"AGENT_SERVER_ENTRY",
|
|
517
482
|
"AUTH_TOKEN",
|
|
518
483
|
"BUN_OPTIONS",
|
|
519
484
|
"DATABASE_PATH",
|
|
@@ -978,10 +943,14 @@ function assertStagedGhCli(projectRoot) {
|
|
|
978
943
|
);
|
|
979
944
|
}
|
|
980
945
|
if (manifestEntry.sha256 !== hashFile3(ghPath)) {
|
|
981
|
-
throw createBuildRuntimeError(
|
|
946
|
+
throw createBuildRuntimeError(
|
|
947
|
+
`GitHub CLI manifest hash mismatch for ${target.runtimeKey}/gh`
|
|
948
|
+
);
|
|
982
949
|
}
|
|
983
950
|
if (manifestEntry.size !== statSync3(ghPath).size) {
|
|
984
|
-
throw createBuildRuntimeError(
|
|
951
|
+
throw createBuildRuntimeError(
|
|
952
|
+
`GitHub CLI manifest size mismatch for ${target.runtimeKey}/gh`
|
|
953
|
+
);
|
|
985
954
|
}
|
|
986
955
|
if (manifestEntry.fileOutput !== fileOutput) {
|
|
987
956
|
throw createBuildRuntimeError(
|
|
@@ -1041,8 +1010,7 @@ function buildExpectedManifest(projectRoot) {
|
|
|
1041
1010
|
},
|
|
1042
1011
|
bundles: {
|
|
1043
1012
|
common: {
|
|
1044
|
-
backend: relativeFromProjectRoot3(projectRoot, stagePaths.common.backendBundle)
|
|
1045
|
-
agentServer: relativeFromProjectRoot3(projectRoot, stagePaths.common.agentServerBundle)
|
|
1013
|
+
backend: relativeFromProjectRoot3(projectRoot, stagePaths.common.backendBundle)
|
|
1046
1014
|
}
|
|
1047
1015
|
},
|
|
1048
1016
|
nodeRuntimeDependencies: CLI_RUNTIME_DEPENDENCIES
|
|
@@ -1053,14 +1021,11 @@ function validateRuntimeStage(options = {}) {
|
|
|
1053
1021
|
const projectRoot = options.projectRoot ?? defaultProjectRoot3;
|
|
1054
1022
|
const stagePaths = resolveRuntimeStagePaths(projectRoot);
|
|
1055
1023
|
const sources = {
|
|
1056
|
-
backendBundle: path4.join(projectRoot, "apps", "backend", "dist", "server.bundled.cjs")
|
|
1057
|
-
agentServerBundle: path4.join(projectRoot, "apps", "agent-server", "dist", "index.bundled.cjs")
|
|
1024
|
+
backendBundle: path4.join(projectRoot, "apps", "backend", "dist", "server.bundled.cjs")
|
|
1058
1025
|
};
|
|
1059
1026
|
assertExists(sources.backendBundle, "runtime source bundle (backend)");
|
|
1060
|
-
assertExists(sources.agentServerBundle, "runtime source bundle (agent-server)");
|
|
1061
1027
|
assertExists(stagePaths.manifest, "staged runtime manifest");
|
|
1062
1028
|
assertExists(stagePaths.common.backendBundle, "staged common backend bundle");
|
|
1063
|
-
assertExists(stagePaths.common.agentServerBundle, "staged common agent-server bundle");
|
|
1064
1029
|
const manifest = readManifest(stagePaths.manifest);
|
|
1065
1030
|
const expectedManifest = buildExpectedManifest(projectRoot);
|
|
1066
1031
|
if (JSON.stringify(manifest) !== JSON.stringify(expectedManifest)) {
|
|
@@ -1075,17 +1040,7 @@ function validateRuntimeStage(options = {}) {
|
|
|
1075
1040
|
sources.backendBundle,
|
|
1076
1041
|
"backend source bundle"
|
|
1077
1042
|
);
|
|
1078
|
-
|
|
1079
|
-
projectRoot,
|
|
1080
|
-
stagePaths.common.agentServerBundle,
|
|
1081
|
-
"staged common agent-server bundle",
|
|
1082
|
-
sources.agentServerBundle,
|
|
1083
|
-
"agent-server source bundle"
|
|
1084
|
-
);
|
|
1085
|
-
const latestSourceMtime2 = Math.max(
|
|
1086
|
-
statSync3(sources.backendBundle).mtimeMs,
|
|
1087
|
-
statSync3(sources.agentServerBundle).mtimeMs
|
|
1088
|
-
);
|
|
1043
|
+
const latestSourceMtime2 = statSync3(sources.backendBundle).mtimeMs;
|
|
1089
1044
|
if (statSync3(stagePaths.manifest).mtimeMs < latestSourceMtime2) {
|
|
1090
1045
|
throw createBuildRuntimeError(
|
|
1091
1046
|
`Staged runtime manifest is stale: ${relativeFromProjectRoot3(projectRoot, stagePaths.manifest)} is older than the source bundles`
|
|
@@ -2603,8 +2558,6 @@ async function start(options) {
|
|
|
2603
2558
|
forceElectronRunAsNode: nodeCmd !== process.execPath,
|
|
2604
2559
|
env: {
|
|
2605
2560
|
DATABASE_PATH: dbPath,
|
|
2606
|
-
AGENT_SERVER_ENTRY: paths.agentServer,
|
|
2607
|
-
AGENT_SERVER_CWD: dirname(paths.agentServer),
|
|
2608
2561
|
PORT: "0",
|
|
2609
2562
|
...extraEnv
|
|
2610
2563
|
},
|
|
@@ -2626,7 +2579,6 @@ async function start(options) {
|
|
|
2626
2579
|
writeServerInfo({
|
|
2627
2580
|
pid: process.pid,
|
|
2628
2581
|
backendPort: port,
|
|
2629
|
-
agentServerUrl: "managed-by-backend",
|
|
2630
2582
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2631
2583
|
});
|
|
2632
2584
|
blank();
|
|
@@ -2666,21 +2618,15 @@ async function start(options) {
|
|
|
2666
2618
|
function resolveBundlePaths() {
|
|
2667
2619
|
const cliRoot = resolve(__dirname, "..");
|
|
2668
2620
|
const bundledDir = join3(cliRoot, "bundles");
|
|
2669
|
-
if (existsSync6(join3(bundledDir, "
|
|
2670
|
-
return {
|
|
2671
|
-
agentServer: join3(bundledDir, "agent-server.bundled.cjs"),
|
|
2672
|
-
backend: join3(bundledDir, "server.bundled.cjs")
|
|
2673
|
-
};
|
|
2621
|
+
if (existsSync6(join3(bundledDir, "server.bundled.cjs"))) {
|
|
2622
|
+
return { backend: join3(bundledDir, "server.bundled.cjs") };
|
|
2674
2623
|
}
|
|
2675
2624
|
const monorepoRoot = resolve(cliRoot, "../..");
|
|
2676
2625
|
const runtimePaths = resolveRuntimeStagePaths(monorepoRoot);
|
|
2677
2626
|
try {
|
|
2678
2627
|
validateRuntimeStage({ projectRoot: monorepoRoot, log: () => {
|
|
2679
2628
|
} });
|
|
2680
|
-
return {
|
|
2681
|
-
agentServer: runtimePaths.common.agentServerBundle,
|
|
2682
|
-
backend: runtimePaths.common.backendBundle
|
|
2683
|
-
};
|
|
2629
|
+
return { backend: runtimePaths.common.backendBundle };
|
|
2684
2630
|
} catch (error2) {
|
|
2685
2631
|
warn(
|
|
2686
2632
|
`Staged runtime is missing or stale in monorepo mode: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
@@ -3118,6 +3064,10 @@ async function installForPlatform(os, filePath, s) {
|
|
|
3118
3064
|
}
|
|
3119
3065
|
|
|
3120
3066
|
// src/status.ts
|
|
3067
|
+
var AGENT_NAMES = {
|
|
3068
|
+
"claude-code": "Claude Code",
|
|
3069
|
+
"codex-app-server": "Codex"
|
|
3070
|
+
};
|
|
3121
3071
|
async function showStatus() {
|
|
3122
3072
|
const serverInfo = readServerInfo();
|
|
3123
3073
|
if (!serverInfo) {
|
|
@@ -3130,7 +3080,7 @@ async function showStatus() {
|
|
|
3130
3080
|
const port = serverInfo.backendPort;
|
|
3131
3081
|
const [health, relayStatus, devicesRes, agentAuth] = await Promise.all([
|
|
3132
3082
|
httpGet(port, "/api/health"),
|
|
3133
|
-
httpGet(port, "/api/
|
|
3083
|
+
httpGet(port, "/api/relay/status"),
|
|
3134
3084
|
httpGet(port, "/api/remote-auth/devices"),
|
|
3135
3085
|
httpGet(port, "/api/settings/agent-auth")
|
|
3136
3086
|
]);
|
|
@@ -3164,21 +3114,26 @@ async function showStatus() {
|
|
|
3164
3114
|
console.log(` ${c.green(sym.dot)} ${device.name.padEnd(24)} ${c.dim(age)}`);
|
|
3165
3115
|
}
|
|
3166
3116
|
}
|
|
3167
|
-
if (agentAuth?.
|
|
3117
|
+
if (agentAuth?.auth?.length) {
|
|
3168
3118
|
blank();
|
|
3169
3119
|
divider("AI Agents");
|
|
3170
3120
|
blank();
|
|
3171
|
-
for (const agent of agentAuth.
|
|
3121
|
+
for (const agent of agentAuth.auth) {
|
|
3122
|
+
const cli = agentAuth.clis?.find((candidate) => candidate.harness === agent.harness);
|
|
3172
3123
|
let status;
|
|
3173
|
-
if (
|
|
3124
|
+
if (cli?.state === "installing") {
|
|
3125
|
+
status = c.dim("installing");
|
|
3126
|
+
} else if (cli && cli.state !== "ready" && cli.state !== "unmanaged") {
|
|
3174
3127
|
status = c.dim("not installed");
|
|
3175
|
-
} else if (agent.
|
|
3176
|
-
const
|
|
3177
|
-
status = c.green("
|
|
3128
|
+
} else if (agent.state === "signed_in") {
|
|
3129
|
+
const who = [agent.label, agent.email].filter(Boolean).join(" \xB7 ");
|
|
3130
|
+
status = c.green("signed in") + (who ? c.dim(` (${who})`) : "");
|
|
3131
|
+
} else if (agent.state === "unknown") {
|
|
3132
|
+
status = c.dim("status unavailable");
|
|
3178
3133
|
} else {
|
|
3179
|
-
status = c.yellow("not
|
|
3134
|
+
status = c.yellow("not signed in");
|
|
3180
3135
|
}
|
|
3181
|
-
kv(agent.
|
|
3136
|
+
kv(AGENT_NAMES[agent.harness] ?? agent.harness, status, 14);
|
|
3182
3137
|
}
|
|
3183
3138
|
}
|
|
3184
3139
|
blank();
|
|
@@ -3282,7 +3237,7 @@ function printHelp(version) {
|
|
|
3282
3237
|
console.log(` ${c.bold("Commands:")}`);
|
|
3283
3238
|
console.log(` ${c.cyan("(none)")} Auto-detect: launch desktop app or start server`);
|
|
3284
3239
|
console.log(
|
|
3285
|
-
` ${c.cyan("start")} Start headless server ${c.dim("(backend + agent
|
|
3240
|
+
` ${c.cyan("start")} Start headless server ${c.dim("(backend + agent engine)")}`
|
|
3286
3241
|
);
|
|
3287
3242
|
console.log(` ${c.cyan("install")} Download and install the desktop app`);
|
|
3288
3243
|
console.log(` ${c.cyan("pair")} Generate a pairing code for remote access`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "deus-machine",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
4
4
|
"description": "Run Deus IDE from the command line — headless server or desktop installer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -39,11 +39,9 @@
|
|
|
39
39
|
"build": "bunx tsx build.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@anthropic-ai/claude-agent-sdk": "0.
|
|
42
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.288",
|
|
43
43
|
"@hono/node-server": "^1.19.9",
|
|
44
44
|
"@napi-rs/canvas": "^0.1.97",
|
|
45
|
-
"@openai/codex": "0.153.4",
|
|
46
|
-
"@openai/codex-sdk": "0.153.4",
|
|
47
45
|
"@sentry/node": "^10.40.0",
|
|
48
46
|
"agent-browser": "^0.21.4",
|
|
49
47
|
"better-sqlite3": "^12.4.1",
|