deus-machine 0.3.8 → 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 +100442 -22615
- package/dist/cli.js +172 -96
- package/package.json +2 -4
- package/bundles/agent-server.bundled.cjs +0 -25087
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.130.0",
|
|
65
|
-
"@openai/codex-sdk": "0.130.0",
|
|
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
|
|
@@ -151,6 +146,7 @@ import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
|
151
146
|
import { createHash } from "node:crypto";
|
|
152
147
|
import {
|
|
153
148
|
chmodSync,
|
|
149
|
+
constants,
|
|
154
150
|
cpSync,
|
|
155
151
|
existsSync,
|
|
156
152
|
linkSync,
|
|
@@ -159,17 +155,17 @@ import {
|
|
|
159
155
|
readFileSync,
|
|
160
156
|
rmSync,
|
|
161
157
|
statSync,
|
|
158
|
+
symlinkSync,
|
|
162
159
|
writeFileSync
|
|
163
160
|
} from "node:fs";
|
|
164
161
|
import path2 from "node:path";
|
|
165
162
|
import { fileURLToPath } from "node:url";
|
|
163
|
+
import { DEFAULT_PINS } from "@zvada/agent-server/core";
|
|
164
|
+
import { runInstall } from "@zvada/agent-server/server";
|
|
166
165
|
var runtimeDir = path2.dirname(fileURLToPath(import.meta.url));
|
|
167
166
|
var defaultProjectRoot = path2.resolve(runtimeDir, "../..");
|
|
168
167
|
var VERIFY_TIMEOUT_MS = 2e4;
|
|
169
|
-
var MIN_CODEX_APP_SERVER_VERSION = "0.128.0";
|
|
170
168
|
var VERSION_CHECK_ENV_DENYLIST = [
|
|
171
|
-
"AGENT_SERVER_CWD",
|
|
172
|
-
"AGENT_SERVER_ENTRY",
|
|
173
169
|
"AUTH_TOKEN",
|
|
174
170
|
"BUN_OPTIONS",
|
|
175
171
|
"DATABASE_PATH",
|
|
@@ -186,33 +182,39 @@ var VERSION_CHECK_ENV_DENYLIST = [
|
|
|
186
182
|
"NODE_PATH",
|
|
187
183
|
"PORT"
|
|
188
184
|
];
|
|
185
|
+
var CODEX_HELPERS = [
|
|
186
|
+
"codex-runtime/bin/codex-code-mode-host",
|
|
187
|
+
"codex-runtime/codex-resources/zsh/bin/zsh"
|
|
188
|
+
];
|
|
189
|
+
var CODEX_LINUX_HELPER = "codex-runtime/codex-resources/bwrap";
|
|
190
|
+
function bundledTools(runtimeKey) {
|
|
191
|
+
return [
|
|
192
|
+
"codex",
|
|
193
|
+
"claude",
|
|
194
|
+
"rg",
|
|
195
|
+
"agent-browser",
|
|
196
|
+
...CODEX_HELPERS,
|
|
197
|
+
...runtimeKey.startsWith("linux-") ? [CODEX_LINUX_HELPER] : []
|
|
198
|
+
];
|
|
199
|
+
}
|
|
189
200
|
var AGENT_CLI_TARGETS = [
|
|
190
201
|
{
|
|
191
202
|
runtimeKey: "darwin-arm64",
|
|
192
203
|
fileFormat: "Mach-O 64-bit executable",
|
|
193
204
|
fileArch: "arm64",
|
|
194
|
-
agentBrowserEntry: "bin/agent-browser-darwin-arm64"
|
|
195
|
-
codexAliasPackage: "@openai/codex-darwin-arm64",
|
|
196
|
-
codexTriple: "aarch64-apple-darwin",
|
|
197
|
-
claudePackageName: "@anthropic-ai/claude-agent-sdk-darwin-arm64"
|
|
205
|
+
agentBrowserEntry: "bin/agent-browser-darwin-arm64"
|
|
198
206
|
},
|
|
199
207
|
{
|
|
200
208
|
runtimeKey: "darwin-x64",
|
|
201
209
|
fileFormat: "Mach-O 64-bit executable",
|
|
202
210
|
fileArch: "x86_64",
|
|
203
|
-
agentBrowserEntry: "bin/agent-browser-darwin-x64"
|
|
204
|
-
codexAliasPackage: "@openai/codex-darwin-x64",
|
|
205
|
-
codexTriple: "x86_64-apple-darwin",
|
|
206
|
-
claudePackageName: "@anthropic-ai/claude-agent-sdk-darwin-x64"
|
|
211
|
+
agentBrowserEntry: "bin/agent-browser-darwin-x64"
|
|
207
212
|
},
|
|
208
213
|
{
|
|
209
214
|
runtimeKey: "linux-x64",
|
|
210
215
|
fileFormat: "ELF 64-bit",
|
|
211
216
|
fileArch: "x86-64",
|
|
212
|
-
agentBrowserEntry: "bin/agent-browser-linux-x64"
|
|
213
|
-
codexAliasPackage: "@openai/codex-linux-x64",
|
|
214
|
-
codexTriple: "x86_64-unknown-linux-musl",
|
|
215
|
-
claudePackageName: "@anthropic-ai/claude-agent-sdk-linux-x64"
|
|
217
|
+
agentBrowserEntry: "bin/agent-browser-linux-x64"
|
|
216
218
|
}
|
|
217
219
|
];
|
|
218
220
|
function relativeFromProjectRoot(projectRoot, targetPath) {
|
|
@@ -224,28 +226,6 @@ function resolveAgentCliManifestPath(projectRoot) {
|
|
|
224
226
|
function resolveStagedAgentCliPath(projectRoot, runtimeKey, tool) {
|
|
225
227
|
return path2.join(resolveRuntimeStagePaths(projectRoot).electron.root, "bin", runtimeKey, tool);
|
|
226
228
|
}
|
|
227
|
-
function readSemver(version) {
|
|
228
|
-
return version.match(/\d+\.\d+\.\d+/)?.[0] ?? null;
|
|
229
|
-
}
|
|
230
|
-
function isVersionAtLeast(version, minimum) {
|
|
231
|
-
if (!version) return false;
|
|
232
|
-
const currentParts = version.split(".").map(Number);
|
|
233
|
-
const minimumParts = minimum.split(".").map(Number);
|
|
234
|
-
for (let i = 0; i < minimumParts.length; i++) {
|
|
235
|
-
const current = currentParts[i] ?? 0;
|
|
236
|
-
const required = minimumParts[i] ?? 0;
|
|
237
|
-
if (current > required) return true;
|
|
238
|
-
if (current < required) return false;
|
|
239
|
-
}
|
|
240
|
-
return true;
|
|
241
|
-
}
|
|
242
|
-
function assertCodexAppServerCompatible(version, label) {
|
|
243
|
-
const semver = readSemver(version);
|
|
244
|
-
if (isVersionAtLeast(semver, MIN_CODEX_APP_SERVER_VERSION)) return;
|
|
245
|
-
throw new Error(
|
|
246
|
-
`${label} requires @openai/codex >= ${MIN_CODEX_APP_SERVER_VERSION} for the codex app-server harness; found ${version}`
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
229
|
function hashFile(filePath) {
|
|
250
230
|
return createHash("sha256").update(readFileSync(filePath)).digest("hex");
|
|
251
231
|
}
|
|
@@ -382,7 +362,7 @@ function assertExecutable(filePath, label) {
|
|
|
382
362
|
}
|
|
383
363
|
}
|
|
384
364
|
function getExecutableFileOutput(projectRoot, filePath, label, fileFormat, fileArch) {
|
|
385
|
-
const fileOutput = execFileSync("file", [relativeFromProjectRoot(projectRoot, filePath)], {
|
|
365
|
+
const fileOutput = execFileSync("file", ["-L", relativeFromProjectRoot(projectRoot, filePath)], {
|
|
386
366
|
cwd: projectRoot,
|
|
387
367
|
encoding: "utf8",
|
|
388
368
|
timeout: VERIFY_TIMEOUT_MS,
|
|
@@ -411,8 +391,13 @@ function validateStagedAgentClis(options = {}) {
|
|
|
411
391
|
if (!codexEntry) {
|
|
412
392
|
throw new Error(`Agent CLI manifest is missing ${runtimeKey}/codex`);
|
|
413
393
|
}
|
|
414
|
-
|
|
415
|
-
|
|
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
|
+
}
|
|
399
|
+
const tools = bundledTools(runtimeKey);
|
|
400
|
+
for (const tool of tools) {
|
|
416
401
|
const executablePath = resolveStagedAgentCliPath(projectRoot, runtimeKey, tool);
|
|
417
402
|
const inspection = inspectStaticExecutable(
|
|
418
403
|
projectRoot,
|
|
@@ -430,11 +415,20 @@ function validateStagedAgentClis(options = {}) {
|
|
|
430
415
|
inspection
|
|
431
416
|
);
|
|
432
417
|
}
|
|
433
|
-
if (manifestEntries.length !==
|
|
418
|
+
if (manifestEntries.length !== tools.length) {
|
|
434
419
|
throw new Error(
|
|
435
|
-
`Agent CLI manifest expected
|
|
420
|
+
`Agent CLI manifest expected ${tools.length} entries for ${runtimeKey}, found ${manifestEntries.length}`
|
|
436
421
|
);
|
|
437
422
|
}
|
|
423
|
+
if (!existsSync(
|
|
424
|
+
path2.join(
|
|
425
|
+
path2.dirname(resolveStagedAgentCliPath(projectRoot, runtimeKey, "codex")),
|
|
426
|
+
"codex-runtime",
|
|
427
|
+
"codex-package.json"
|
|
428
|
+
)
|
|
429
|
+
)) {
|
|
430
|
+
throw new Error(`Missing Codex package metadata for ${runtimeKey}`);
|
|
431
|
+
}
|
|
438
432
|
if (options.verifyRunnable === true && shouldVerifyRuntimeKey(runtimeKey)) {
|
|
439
433
|
for (const tool of ["codex", "claude"]) {
|
|
440
434
|
const executablePath = resolveStagedAgentCliPath(projectRoot, runtimeKey, tool);
|
|
@@ -485,8 +479,6 @@ var REQUIRED_RUNTIME_ENTITLEMENTS = [
|
|
|
485
479
|
"com.apple.security.cs.disable-library-validation"
|
|
486
480
|
];
|
|
487
481
|
var VERSION_CHECK_ENV_DENYLIST2 = [
|
|
488
|
-
"AGENT_SERVER_CWD",
|
|
489
|
-
"AGENT_SERVER_ENTRY",
|
|
490
482
|
"AUTH_TOKEN",
|
|
491
483
|
"BUN_OPTIONS",
|
|
492
484
|
"DATABASE_PATH",
|
|
@@ -728,7 +720,7 @@ function verifyMacRuntimeEntitlements(filePath) {
|
|
|
728
720
|
}
|
|
729
721
|
}
|
|
730
722
|
function verifyStagedDeusRuntimeVersion(executablePath) {
|
|
731
|
-
const helperPath = path3.join(runtimeDir2, "run-version-check.cjs");
|
|
723
|
+
const helperPath = path3.join(runtimeDir2, "smoke", "run-version-check.cjs");
|
|
732
724
|
const env = { ...process.env };
|
|
733
725
|
for (const key of VERSION_CHECK_ENV_DENYLIST2) {
|
|
734
726
|
delete env[key];
|
|
@@ -951,10 +943,14 @@ function assertStagedGhCli(projectRoot) {
|
|
|
951
943
|
);
|
|
952
944
|
}
|
|
953
945
|
if (manifestEntry.sha256 !== hashFile3(ghPath)) {
|
|
954
|
-
throw createBuildRuntimeError(
|
|
946
|
+
throw createBuildRuntimeError(
|
|
947
|
+
`GitHub CLI manifest hash mismatch for ${target.runtimeKey}/gh`
|
|
948
|
+
);
|
|
955
949
|
}
|
|
956
950
|
if (manifestEntry.size !== statSync3(ghPath).size) {
|
|
957
|
-
throw createBuildRuntimeError(
|
|
951
|
+
throw createBuildRuntimeError(
|
|
952
|
+
`GitHub CLI manifest size mismatch for ${target.runtimeKey}/gh`
|
|
953
|
+
);
|
|
958
954
|
}
|
|
959
955
|
if (manifestEntry.fileOutput !== fileOutput) {
|
|
960
956
|
throw createBuildRuntimeError(
|
|
@@ -1014,8 +1010,7 @@ function buildExpectedManifest(projectRoot) {
|
|
|
1014
1010
|
},
|
|
1015
1011
|
bundles: {
|
|
1016
1012
|
common: {
|
|
1017
|
-
backend: relativeFromProjectRoot3(projectRoot, stagePaths.common.backendBundle)
|
|
1018
|
-
agentServer: relativeFromProjectRoot3(projectRoot, stagePaths.common.agentServerBundle)
|
|
1013
|
+
backend: relativeFromProjectRoot3(projectRoot, stagePaths.common.backendBundle)
|
|
1019
1014
|
}
|
|
1020
1015
|
},
|
|
1021
1016
|
nodeRuntimeDependencies: CLI_RUNTIME_DEPENDENCIES
|
|
@@ -1026,14 +1021,11 @@ function validateRuntimeStage(options = {}) {
|
|
|
1026
1021
|
const projectRoot = options.projectRoot ?? defaultProjectRoot3;
|
|
1027
1022
|
const stagePaths = resolveRuntimeStagePaths(projectRoot);
|
|
1028
1023
|
const sources = {
|
|
1029
|
-
backendBundle: path4.join(projectRoot, "apps", "backend", "dist", "server.bundled.cjs")
|
|
1030
|
-
agentServerBundle: path4.join(projectRoot, "apps", "agent-server", "dist", "index.bundled.cjs")
|
|
1024
|
+
backendBundle: path4.join(projectRoot, "apps", "backend", "dist", "server.bundled.cjs")
|
|
1031
1025
|
};
|
|
1032
1026
|
assertExists(sources.backendBundle, "runtime source bundle (backend)");
|
|
1033
|
-
assertExists(sources.agentServerBundle, "runtime source bundle (agent-server)");
|
|
1034
1027
|
assertExists(stagePaths.manifest, "staged runtime manifest");
|
|
1035
1028
|
assertExists(stagePaths.common.backendBundle, "staged common backend bundle");
|
|
1036
|
-
assertExists(stagePaths.common.agentServerBundle, "staged common agent-server bundle");
|
|
1037
1029
|
const manifest = readManifest(stagePaths.manifest);
|
|
1038
1030
|
const expectedManifest = buildExpectedManifest(projectRoot);
|
|
1039
1031
|
if (JSON.stringify(manifest) !== JSON.stringify(expectedManifest)) {
|
|
@@ -1048,17 +1040,7 @@ function validateRuntimeStage(options = {}) {
|
|
|
1048
1040
|
sources.backendBundle,
|
|
1049
1041
|
"backend source bundle"
|
|
1050
1042
|
);
|
|
1051
|
-
|
|
1052
|
-
projectRoot,
|
|
1053
|
-
stagePaths.common.agentServerBundle,
|
|
1054
|
-
"staged common agent-server bundle",
|
|
1055
|
-
sources.agentServerBundle,
|
|
1056
|
-
"agent-server source bundle"
|
|
1057
|
-
);
|
|
1058
|
-
const latestSourceMtime2 = Math.max(
|
|
1059
|
-
statSync3(sources.backendBundle).mtimeMs,
|
|
1060
|
-
statSync3(sources.agentServerBundle).mtimeMs
|
|
1061
|
-
);
|
|
1043
|
+
const latestSourceMtime2 = statSync3(sources.backendBundle).mtimeMs;
|
|
1062
1044
|
if (statSync3(stagePaths.manifest).mtimeMs < latestSourceMtime2) {
|
|
1063
1045
|
throw createBuildRuntimeError(
|
|
1064
1046
|
`Staged runtime manifest is stale: ${relativeFromProjectRoot3(projectRoot, stagePaths.manifest)} is older than the source bundles`
|
|
@@ -2576,8 +2558,6 @@ async function start(options) {
|
|
|
2576
2558
|
forceElectronRunAsNode: nodeCmd !== process.execPath,
|
|
2577
2559
|
env: {
|
|
2578
2560
|
DATABASE_PATH: dbPath,
|
|
2579
|
-
AGENT_SERVER_ENTRY: paths.agentServer,
|
|
2580
|
-
AGENT_SERVER_CWD: dirname(paths.agentServer),
|
|
2581
2561
|
PORT: "0",
|
|
2582
2562
|
...extraEnv
|
|
2583
2563
|
},
|
|
@@ -2599,7 +2579,6 @@ async function start(options) {
|
|
|
2599
2579
|
writeServerInfo({
|
|
2600
2580
|
pid: process.pid,
|
|
2601
2581
|
backendPort: port,
|
|
2602
|
-
agentServerUrl: "managed-by-backend",
|
|
2603
2582
|
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2604
2583
|
});
|
|
2605
2584
|
blank();
|
|
@@ -2639,21 +2618,15 @@ async function start(options) {
|
|
|
2639
2618
|
function resolveBundlePaths() {
|
|
2640
2619
|
const cliRoot = resolve(__dirname, "..");
|
|
2641
2620
|
const bundledDir = join3(cliRoot, "bundles");
|
|
2642
|
-
if (existsSync6(join3(bundledDir, "
|
|
2643
|
-
return {
|
|
2644
|
-
agentServer: join3(bundledDir, "agent-server.bundled.cjs"),
|
|
2645
|
-
backend: join3(bundledDir, "server.bundled.cjs")
|
|
2646
|
-
};
|
|
2621
|
+
if (existsSync6(join3(bundledDir, "server.bundled.cjs"))) {
|
|
2622
|
+
return { backend: join3(bundledDir, "server.bundled.cjs") };
|
|
2647
2623
|
}
|
|
2648
2624
|
const monorepoRoot = resolve(cliRoot, "../..");
|
|
2649
2625
|
const runtimePaths = resolveRuntimeStagePaths(monorepoRoot);
|
|
2650
2626
|
try {
|
|
2651
2627
|
validateRuntimeStage({ projectRoot: monorepoRoot, log: () => {
|
|
2652
2628
|
} });
|
|
2653
|
-
return {
|
|
2654
|
-
agentServer: runtimePaths.common.agentServerBundle,
|
|
2655
|
-
backend: runtimePaths.common.backendBundle
|
|
2656
|
-
};
|
|
2629
|
+
return { backend: runtimePaths.common.backendBundle };
|
|
2657
2630
|
} catch (error2) {
|
|
2658
2631
|
warn(
|
|
2659
2632
|
`Staged runtime is missing or stale in monorepo mode: ${error2 instanceof Error ? error2.message : String(error2)}`
|
|
@@ -2916,7 +2889,8 @@ function getAssetPattern(os, cpuArch) {
|
|
|
2916
2889
|
case "darwin": {
|
|
2917
2890
|
const archSuffix = cpuArch === "arm64" ? "arm64" : "x64";
|
|
2918
2891
|
return {
|
|
2919
|
-
|
|
2892
|
+
// electron-builder names Intel DMGs without an architecture suffix.
|
|
2893
|
+
matcher: (name) => name.endsWith(".dmg") && (cpuArch === "arm64" ? name.includes("arm64") : !name.includes("arm64")),
|
|
2920
2894
|
description: `macOS DMG (${archSuffix})`
|
|
2921
2895
|
};
|
|
2922
2896
|
}
|
|
@@ -3090,6 +3064,10 @@ async function installForPlatform(os, filePath, s) {
|
|
|
3090
3064
|
}
|
|
3091
3065
|
|
|
3092
3066
|
// src/status.ts
|
|
3067
|
+
var AGENT_NAMES = {
|
|
3068
|
+
"claude-code": "Claude Code",
|
|
3069
|
+
"codex-app-server": "Codex"
|
|
3070
|
+
};
|
|
3093
3071
|
async function showStatus() {
|
|
3094
3072
|
const serverInfo = readServerInfo();
|
|
3095
3073
|
if (!serverInfo) {
|
|
@@ -3102,7 +3080,7 @@ async function showStatus() {
|
|
|
3102
3080
|
const port = serverInfo.backendPort;
|
|
3103
3081
|
const [health, relayStatus, devicesRes, agentAuth] = await Promise.all([
|
|
3104
3082
|
httpGet(port, "/api/health"),
|
|
3105
|
-
httpGet(port, "/api/
|
|
3083
|
+
httpGet(port, "/api/relay/status"),
|
|
3106
3084
|
httpGet(port, "/api/remote-auth/devices"),
|
|
3107
3085
|
httpGet(port, "/api/settings/agent-auth")
|
|
3108
3086
|
]);
|
|
@@ -3136,21 +3114,26 @@ async function showStatus() {
|
|
|
3136
3114
|
console.log(` ${c.green(sym.dot)} ${device.name.padEnd(24)} ${c.dim(age)}`);
|
|
3137
3115
|
}
|
|
3138
3116
|
}
|
|
3139
|
-
if (agentAuth?.
|
|
3117
|
+
if (agentAuth?.auth?.length) {
|
|
3140
3118
|
blank();
|
|
3141
3119
|
divider("AI Agents");
|
|
3142
3120
|
blank();
|
|
3143
|
-
for (const agent of agentAuth.
|
|
3121
|
+
for (const agent of agentAuth.auth) {
|
|
3122
|
+
const cli = agentAuth.clis?.find((candidate) => candidate.harness === agent.harness);
|
|
3144
3123
|
let status;
|
|
3145
|
-
if (
|
|
3124
|
+
if (cli?.state === "installing") {
|
|
3125
|
+
status = c.dim("installing");
|
|
3126
|
+
} else if (cli && cli.state !== "ready" && cli.state !== "unmanaged") {
|
|
3146
3127
|
status = c.dim("not installed");
|
|
3147
|
-
} else if (agent.
|
|
3148
|
-
const
|
|
3149
|
-
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");
|
|
3150
3133
|
} else {
|
|
3151
|
-
status = c.yellow("not
|
|
3134
|
+
status = c.yellow("not signed in");
|
|
3152
3135
|
}
|
|
3153
|
-
kv(agent.
|
|
3136
|
+
kv(AGENT_NAMES[agent.harness] ?? agent.harness, status, 14);
|
|
3154
3137
|
}
|
|
3155
3138
|
}
|
|
3156
3139
|
blank();
|
|
@@ -3158,6 +3141,81 @@ async function showStatus() {
|
|
|
3158
3141
|
blank();
|
|
3159
3142
|
}
|
|
3160
3143
|
|
|
3144
|
+
// src/feedback.ts
|
|
3145
|
+
import { randomUUID } from "node:crypto";
|
|
3146
|
+
var HIVENET_ENDPOINT = "https://hivenet.app/v1/feedback";
|
|
3147
|
+
function buildFeedbackPayload(message, version, opts = {}) {
|
|
3148
|
+
return {
|
|
3149
|
+
v: 1,
|
|
3150
|
+
to: "deus",
|
|
3151
|
+
category: opts.category ?? "cli",
|
|
3152
|
+
feedback: message,
|
|
3153
|
+
...opts.subject ? { subject: opts.subject } : {},
|
|
3154
|
+
thread: { id: opts.threadId ?? randomUUID().replaceAll("-", "") },
|
|
3155
|
+
client: { name: "deus-cli", version },
|
|
3156
|
+
consent: { telemetry: false }
|
|
3157
|
+
};
|
|
3158
|
+
}
|
|
3159
|
+
async function sendFeedback(message, version, opts = {}) {
|
|
3160
|
+
const trimmed = message.trim();
|
|
3161
|
+
if (!trimmed) {
|
|
3162
|
+
error("Feedback message is required.");
|
|
3163
|
+
blank();
|
|
3164
|
+
info("Tell the Deus team what you need \u2014 feature requests, confusing UX, broken flows:");
|
|
3165
|
+
hint(
|
|
3166
|
+
` ${c.cyan('deus feedback "feature request: let me pin a workspace to the top of the sidebar"')}`
|
|
3167
|
+
);
|
|
3168
|
+
hint(
|
|
3169
|
+
` ${c.cyan('deus feedback --subject "deus pair" "the QR code renders off-screen on small terminals"')}`
|
|
3170
|
+
);
|
|
3171
|
+
process.exitCode = 1;
|
|
3172
|
+
return;
|
|
3173
|
+
}
|
|
3174
|
+
const payload = buildFeedbackPayload(trimmed, version, opts);
|
|
3175
|
+
let response;
|
|
3176
|
+
try {
|
|
3177
|
+
response = await fetch(HIVENET_ENDPOINT, {
|
|
3178
|
+
method: "POST",
|
|
3179
|
+
headers: { "content-type": "application/json" },
|
|
3180
|
+
body: JSON.stringify(payload),
|
|
3181
|
+
signal: AbortSignal.timeout(1e4)
|
|
3182
|
+
});
|
|
3183
|
+
} catch {
|
|
3184
|
+
error("Could not reach hivenet.app \u2014 feedback not sent.");
|
|
3185
|
+
process.exitCode = 1;
|
|
3186
|
+
return;
|
|
3187
|
+
}
|
|
3188
|
+
if (!response.ok) {
|
|
3189
|
+
error(`Feedback submission failed (${response.status}).`);
|
|
3190
|
+
process.exitCode = 1;
|
|
3191
|
+
return;
|
|
3192
|
+
}
|
|
3193
|
+
const body = await response.json().catch(() => null) ?? {};
|
|
3194
|
+
success("Feedback sent to the Deus team.");
|
|
3195
|
+
const threadId = safe(body.thread?.id) || payload.thread.id;
|
|
3196
|
+
hint(
|
|
3197
|
+
`Thread: ${c.cyan(threadId)} \u2014 continue with ${c.cyan(`npx --yes hivenet@latest --to deus --resume ${threadId}`)}`
|
|
3198
|
+
);
|
|
3199
|
+
if (body.known_issue?.title) {
|
|
3200
|
+
blank();
|
|
3201
|
+
info(`Known issue: ${safe(body.known_issue.title)}`);
|
|
3202
|
+
if (body.known_issue.note) info(`Deus team: ${safe(body.known_issue.note)}`);
|
|
3203
|
+
}
|
|
3204
|
+
if (body.guidance) {
|
|
3205
|
+
blank();
|
|
3206
|
+
info(`Deus team: ${safe(body.guidance)}`);
|
|
3207
|
+
}
|
|
3208
|
+
if (body.ask?.prompt) {
|
|
3209
|
+
blank();
|
|
3210
|
+
info(`Deus asks: ${safe(body.ask.prompt)}`);
|
|
3211
|
+
if (body.ask.command) hint(`Answer (only if grounded): ${c.cyan(safe(body.ask.command))}`);
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
function safe(value) {
|
|
3215
|
+
if (typeof value !== "string") return "";
|
|
3216
|
+
return value.replace(/[\u0000-\u001f\u007f-\u009f]/g, " ").trim();
|
|
3217
|
+
}
|
|
3218
|
+
|
|
3161
3219
|
// src/args.ts
|
|
3162
3220
|
function getCliCommandIndex(args) {
|
|
3163
3221
|
return args.findIndex((arg) => !arg.startsWith("-"));
|
|
@@ -3179,12 +3237,13 @@ function printHelp(version) {
|
|
|
3179
3237
|
console.log(` ${c.bold("Commands:")}`);
|
|
3180
3238
|
console.log(` ${c.cyan("(none)")} Auto-detect: launch desktop app or start server`);
|
|
3181
3239
|
console.log(
|
|
3182
|
-
` ${c.cyan("start")} Start headless server ${c.dim("(backend + agent
|
|
3240
|
+
` ${c.cyan("start")} Start headless server ${c.dim("(backend + agent engine)")}`
|
|
3183
3241
|
);
|
|
3184
3242
|
console.log(` ${c.cyan("install")} Download and install the desktop app`);
|
|
3185
3243
|
console.log(` ${c.cyan("pair")} Generate a pairing code for remote access`);
|
|
3186
3244
|
console.log(` ${c.cyan("login")} Configure AI agent authentication`);
|
|
3187
3245
|
console.log(` ${c.cyan("status")} Show server info and connected devices`);
|
|
3246
|
+
console.log(` ${c.cyan("feedback")} Send feedback or a feature request to the Deus team`);
|
|
3188
3247
|
blank();
|
|
3189
3248
|
console.log(` ${c.bold("Options")} ${c.dim("(start):")}`);
|
|
3190
3249
|
console.log(` ${c.cyan("--data-dir")} Directory for database and data files`);
|
|
@@ -3223,7 +3282,7 @@ async function main() {
|
|
|
3223
3282
|
printHelp(version);
|
|
3224
3283
|
process.exit(0);
|
|
3225
3284
|
}
|
|
3226
|
-
const quickCommands = ["pair", "status", "login"];
|
|
3285
|
+
const quickCommands = ["pair", "status", "login", "feedback"];
|
|
3227
3286
|
if (!command || !quickCommands.includes(command)) {
|
|
3228
3287
|
await animatedBanner(version);
|
|
3229
3288
|
}
|
|
@@ -3283,6 +3342,23 @@ async function main() {
|
|
|
3283
3342
|
await showStatus();
|
|
3284
3343
|
break;
|
|
3285
3344
|
}
|
|
3345
|
+
// ── Feedback to the Deus team (Hivenet) ────────────────────────
|
|
3346
|
+
case "feedback": {
|
|
3347
|
+
const { values, positionals } = parseArgs({
|
|
3348
|
+
args: commandArgs,
|
|
3349
|
+
options: {
|
|
3350
|
+
subject: { type: "string" },
|
|
3351
|
+
category: { type: "string" }
|
|
3352
|
+
},
|
|
3353
|
+
allowPositionals: true,
|
|
3354
|
+
strict: false
|
|
3355
|
+
});
|
|
3356
|
+
await sendFeedback(positionals.join(" "), version, {
|
|
3357
|
+
subject: values.subject,
|
|
3358
|
+
category: values.category
|
|
3359
|
+
});
|
|
3360
|
+
break;
|
|
3361
|
+
}
|
|
3286
3362
|
default:
|
|
3287
3363
|
error(`Unknown command: ${c.bold(resolvedCommand)}`);
|
|
3288
3364
|
blank();
|
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.130.0",
|
|
46
|
-
"@openai/codex-sdk": "0.130.0",
|
|
47
45
|
"@sentry/node": "^10.40.0",
|
|
48
46
|
"agent-browser": "^0.21.4",
|
|
49
47
|
"better-sqlite3": "^12.4.1",
|