@adhdev/daemon-standalone 1.0.28-rc.27 → 1.0.28-rc.28
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 +311 -73
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7389,7 +7389,7 @@ var require_fast_uri = __commonJS({
|
|
|
7389
7389
|
query: void 0,
|
|
7390
7390
|
fragment: void 0
|
|
7391
7391
|
};
|
|
7392
|
-
let
|
|
7392
|
+
let isIP2 = false;
|
|
7393
7393
|
if (options.reference === "suffix") {
|
|
7394
7394
|
if (options.scheme) {
|
|
7395
7395
|
uri = options.scheme + ":" + uri;
|
|
@@ -7414,9 +7414,9 @@ var require_fast_uri = __commonJS({
|
|
|
7414
7414
|
if (ipv4result === false) {
|
|
7415
7415
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
7416
7416
|
parsed.host = ipv6result.host.toLowerCase();
|
|
7417
|
-
|
|
7417
|
+
isIP2 = ipv6result.isIPV6;
|
|
7418
7418
|
} else {
|
|
7419
|
-
|
|
7419
|
+
isIP2 = true;
|
|
7420
7420
|
}
|
|
7421
7421
|
}
|
|
7422
7422
|
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
|
|
@@ -7433,7 +7433,7 @@ var require_fast_uri = __commonJS({
|
|
|
7433
7433
|
}
|
|
7434
7434
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
7435
7435
|
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
7436
|
-
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) &&
|
|
7436
|
+
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP2 === false && nonSimpleDomain(parsed.host)) {
|
|
7437
7437
|
try {
|
|
7438
7438
|
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
7439
7439
|
} catch (e) {
|
|
@@ -33311,10 +33311,10 @@ var require_dist3 = __commonJS({
|
|
|
33311
33311
|
}
|
|
33312
33312
|
function getDaemonBuildInfo() {
|
|
33313
33313
|
if (cached2) return cached2;
|
|
33314
|
-
const commit = readInjected(true ? "
|
|
33315
|
-
const commitShort = readInjected(true ? "
|
|
33316
|
-
const version2 = readInjected(true ? "1.0.28-rc.
|
|
33317
|
-
const builtAt = readInjected(true ? "2026-07-
|
|
33314
|
+
const commit = readInjected(true ? "04f74b18eaa379f3614a702bd4bfbd063a34f0aa" : void 0) ?? "unknown";
|
|
33315
|
+
const commitShort = readInjected(true ? "04f74b18" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
33316
|
+
const version2 = readInjected(true ? "1.0.28-rc.28" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
33317
|
+
const builtAt = readInjected(true ? "2026-07-29T20:27:06.105Z" : void 0);
|
|
33318
33318
|
cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
|
|
33319
33319
|
return cached2;
|
|
33320
33320
|
}
|
|
@@ -86389,27 +86389,33 @@ ${body}
|
|
|
86389
86389
|
var fs21 = __toESM2(require("fs"));
|
|
86390
86390
|
init_logger();
|
|
86391
86391
|
var EMPTY = { active: false, count: 0, ids: [] };
|
|
86392
|
+
var TRACKED_AGENT_TYPES = /* @__PURE__ */ new Set(["claude-cli", "kimi"]);
|
|
86392
86393
|
var TAIL_BYTES = 512 * 1024;
|
|
86393
86394
|
function detectBackgroundTaskActive(cfg, input) {
|
|
86394
|
-
|
|
86395
|
-
if (!
|
|
86395
|
+
const agentType = (input.agentType ?? "").trim();
|
|
86396
|
+
if (!TRACKED_AGENT_TYPES.has(agentType)) return { ...EMPTY, support: "unknown" };
|
|
86397
|
+
if (!cfg?.source || cfg.source.kind !== "jsonl") return { ...EMPTY, support: "tracked" };
|
|
86396
86398
|
let sourcePath;
|
|
86397
86399
|
try {
|
|
86398
86400
|
sourcePath = resolveJsonlSourcePath(cfg.source, input);
|
|
86399
86401
|
} catch {
|
|
86400
|
-
return EMPTY;
|
|
86402
|
+
return { ...EMPTY, support: "tracked" };
|
|
86401
86403
|
}
|
|
86402
|
-
if (!sourcePath) return EMPTY;
|
|
86404
|
+
if (!sourcePath) return { ...EMPTY, support: "tracked" };
|
|
86403
86405
|
let lines;
|
|
86404
86406
|
try {
|
|
86405
86407
|
lines = readTailJsonlLines(sourcePath, TAIL_BYTES);
|
|
86406
86408
|
} catch {
|
|
86407
|
-
return EMPTY;
|
|
86409
|
+
return { ...EMPTY, support: "tracked" };
|
|
86408
86410
|
}
|
|
86409
|
-
if (lines.length === 0) return EMPTY;
|
|
86410
|
-
return detectFromRecords(lines);
|
|
86411
|
+
if (lines.length === 0) return { ...EMPTY, support: "tracked" };
|
|
86412
|
+
return detectFromRecords(lines, agentType);
|
|
86411
86413
|
}
|
|
86412
|
-
function detectFromRecords(records) {
|
|
86414
|
+
function detectFromRecords(records, agentType = "claude-cli") {
|
|
86415
|
+
if (agentType === "kimi") return detectKimiFromRecords(records);
|
|
86416
|
+
return detectClaudeFromRecords(records);
|
|
86417
|
+
}
|
|
86418
|
+
function detectClaudeFromRecords(records) {
|
|
86413
86419
|
const launched = /* @__PURE__ */ new Map();
|
|
86414
86420
|
for (const rec of records) {
|
|
86415
86421
|
if (!rec || typeof rec !== "object") continue;
|
|
@@ -86443,9 +86449,143 @@ ${body}
|
|
|
86443
86449
|
}
|
|
86444
86450
|
}
|
|
86445
86451
|
const unresolved = [...launched.entries()].filter(([, resolved]) => !resolved).map(([id]) => id);
|
|
86446
|
-
if (unresolved.length === 0) return EMPTY;
|
|
86452
|
+
if (unresolved.length === 0) return { ...EMPTY, support: "tracked" };
|
|
86447
86453
|
LOG2.debug("BackgroundTask", `claude-cli unresolved background bash: count=${unresolved.length} ids=${unresolved.join(",")}`);
|
|
86448
|
-
return { active: true, count: unresolved.length, ids: unresolved };
|
|
86454
|
+
return { active: true, count: unresolved.length, ids: unresolved, support: "tracked" };
|
|
86455
|
+
}
|
|
86456
|
+
function detectKimiFromRecords(records) {
|
|
86457
|
+
const launches = /* @__PURE__ */ new Map();
|
|
86458
|
+
const pendingLaunchByCallId = /* @__PURE__ */ new Map();
|
|
86459
|
+
let lastPromptIdx = -1;
|
|
86460
|
+
let lastAssistantTextIdx = -1;
|
|
86461
|
+
for (let i = 0; i < records.length; i++) {
|
|
86462
|
+
const rec = records[i];
|
|
86463
|
+
if (!rec || typeof rec !== "object") continue;
|
|
86464
|
+
const record2 = rec;
|
|
86465
|
+
const type2 = String(record2.type ?? "").trim();
|
|
86466
|
+
if (type2 === "turn.prompt") {
|
|
86467
|
+
lastPromptIdx = i;
|
|
86468
|
+
continue;
|
|
86469
|
+
}
|
|
86470
|
+
const event = record2.event && typeof record2.event === "object" ? record2.event : null;
|
|
86471
|
+
if (event) {
|
|
86472
|
+
const eventType = String(event.type ?? "").trim();
|
|
86473
|
+
if (eventType === "content.part") {
|
|
86474
|
+
const part = event.part && typeof event.part === "object" ? event.part : null;
|
|
86475
|
+
if (part && String(part.type ?? "") === "text" && String(part.text ?? "").trim().length > 0) {
|
|
86476
|
+
lastAssistantTextIdx = i;
|
|
86477
|
+
}
|
|
86478
|
+
} else if (eventType === "tool.call") {
|
|
86479
|
+
const args = event.args && typeof event.args === "object" ? event.args : null;
|
|
86480
|
+
if (args && args.run_in_background === true) {
|
|
86481
|
+
const callId = String(event.toolCallId ?? "").trim();
|
|
86482
|
+
if (callId) pendingLaunchByCallId.set(callId, i);
|
|
86483
|
+
}
|
|
86484
|
+
} else if (eventType === "tool.result") {
|
|
86485
|
+
const output = kimiResultOutputText(event);
|
|
86486
|
+
const callId = String(event.toolCallId ?? "").trim();
|
|
86487
|
+
if (callId && pendingLaunchByCallId.has(callId)) {
|
|
86488
|
+
const taskId2 = parseKimiTaskField(output, "task_id");
|
|
86489
|
+
if (taskId2) {
|
|
86490
|
+
launches.set(taskId2, { callIdx: pendingLaunchByCallId.get(callId), resolvedIdx: -1 });
|
|
86491
|
+
} else if (parseKimiTaskField(output, "status") === "running") {
|
|
86492
|
+
launches.set(`call:${callId}`, { callIdx: pendingLaunchByCallId.get(callId), resolvedIdx: -1 });
|
|
86493
|
+
}
|
|
86494
|
+
pendingLaunchByCallId.delete(callId);
|
|
86495
|
+
continue;
|
|
86496
|
+
}
|
|
86497
|
+
const taskId = parseKimiTaskField(output, "task_id");
|
|
86498
|
+
const status = parseKimiTaskField(output, "status");
|
|
86499
|
+
if (taskId && status && KIMI_TERMINAL_TASK_STATUSES.has(status)) {
|
|
86500
|
+
markKimiResolved(launches, taskId, i);
|
|
86501
|
+
}
|
|
86502
|
+
}
|
|
86503
|
+
continue;
|
|
86504
|
+
}
|
|
86505
|
+
if (type2 === "turn.steer" || type2 === "context.append_message") {
|
|
86506
|
+
for (const text of kimiRecordTextParts(record2)) {
|
|
86507
|
+
for (const match of text.matchAll(/<notification\b[^>]*>/g)) {
|
|
86508
|
+
const attrs = parseNotificationAttrs(match[0]);
|
|
86509
|
+
if (attrs.get("category") !== "task") continue;
|
|
86510
|
+
const sourceId = attrs.get("source_id") ?? "";
|
|
86511
|
+
const notifType = (attrs.get("type") ?? "").replace(/^task\./, "");
|
|
86512
|
+
if (sourceId && KIMI_TERMINAL_TASK_STATUSES.has(notifType)) {
|
|
86513
|
+
markKimiResolved(launches, sourceId, i);
|
|
86514
|
+
}
|
|
86515
|
+
}
|
|
86516
|
+
}
|
|
86517
|
+
}
|
|
86518
|
+
}
|
|
86519
|
+
for (const [callId, callIdx] of pendingLaunchByCallId) {
|
|
86520
|
+
launches.set(`call:${callId}`, { callIdx, resolvedIdx: -1 });
|
|
86521
|
+
}
|
|
86522
|
+
const inScope = [...launches.entries()].filter(([, v]) => v.callIdx > lastPromptIdx);
|
|
86523
|
+
const unresolved = inScope.filter(([, v]) => v.resolvedIdx < 0).map(([id]) => id);
|
|
86524
|
+
const consumedBoundary = Math.max(lastPromptIdx, lastAssistantTextIdx);
|
|
86525
|
+
const pendingConsumption = inScope.some(([, v]) => v.resolvedIdx >= 0 && v.resolvedIdx > consumedBoundary);
|
|
86526
|
+
if (unresolved.length === 0 && !pendingConsumption) return { ...EMPTY, support: "tracked" };
|
|
86527
|
+
if (unresolved.length > 0) {
|
|
86528
|
+
LOG2.debug("BackgroundTask", `kimi unresolved background tool: count=${unresolved.length} ids=${unresolved.join(",")}`);
|
|
86529
|
+
} else {
|
|
86530
|
+
LOG2.debug("BackgroundTask", "kimi background tool resolved but result not yet consumed into a final assistant response");
|
|
86531
|
+
}
|
|
86532
|
+
return {
|
|
86533
|
+
active: true,
|
|
86534
|
+
count: unresolved.length,
|
|
86535
|
+
ids: unresolved,
|
|
86536
|
+
pendingConsumption: unresolved.length === 0 ? true : void 0,
|
|
86537
|
+
support: "tracked"
|
|
86538
|
+
};
|
|
86539
|
+
}
|
|
86540
|
+
var KIMI_TERMINAL_TASK_STATUSES = /* @__PURE__ */ new Set([
|
|
86541
|
+
"completed",
|
|
86542
|
+
"failed",
|
|
86543
|
+
"killed",
|
|
86544
|
+
"timed_out",
|
|
86545
|
+
"lost",
|
|
86546
|
+
"stopped",
|
|
86547
|
+
"cancelled"
|
|
86548
|
+
]);
|
|
86549
|
+
function markKimiResolved(launches, taskId, idx) {
|
|
86550
|
+
const entry = launches.get(taskId);
|
|
86551
|
+
if (entry && entry.resolvedIdx < 0) entry.resolvedIdx = idx;
|
|
86552
|
+
}
|
|
86553
|
+
function kimiResultOutputText(event) {
|
|
86554
|
+
const result = event.result && typeof event.result === "object" ? event.result : null;
|
|
86555
|
+
const output = result ? result.output : void 0;
|
|
86556
|
+
if (typeof output === "string") return output;
|
|
86557
|
+
if (output === void 0 || output === null) return "";
|
|
86558
|
+
try {
|
|
86559
|
+
return JSON.stringify(output);
|
|
86560
|
+
} catch {
|
|
86561
|
+
return String(output);
|
|
86562
|
+
}
|
|
86563
|
+
}
|
|
86564
|
+
function parseKimiTaskField(output, key2) {
|
|
86565
|
+
const match = output.match(new RegExp(`(?:^|\\n)\\s*${key2}:\\s*(\\S+)`));
|
|
86566
|
+
return match ? match[1].trim() : "";
|
|
86567
|
+
}
|
|
86568
|
+
function kimiRecordTextParts(record2) {
|
|
86569
|
+
const out = [];
|
|
86570
|
+
const collect = (parts) => {
|
|
86571
|
+
if (!Array.isArray(parts)) return;
|
|
86572
|
+
for (const part of parts) {
|
|
86573
|
+
if (!part || typeof part !== "object") continue;
|
|
86574
|
+
const text = part.text;
|
|
86575
|
+
if (typeof text === "string" && text) out.push(text);
|
|
86576
|
+
}
|
|
86577
|
+
};
|
|
86578
|
+
collect(record2.input);
|
|
86579
|
+
const message = record2.message && typeof record2.message === "object" ? record2.message : null;
|
|
86580
|
+
if (message) collect(message.content);
|
|
86581
|
+
return out;
|
|
86582
|
+
}
|
|
86583
|
+
function parseNotificationAttrs(tag) {
|
|
86584
|
+
const attrs = /* @__PURE__ */ new Map();
|
|
86585
|
+
for (const match of tag.matchAll(/([\w-]+)="([^"]*)"/g)) {
|
|
86586
|
+
attrs.set(match[1], match[2]);
|
|
86587
|
+
}
|
|
86588
|
+
return attrs;
|
|
86449
86589
|
}
|
|
86450
86590
|
function readTailJsonlLines(filePath, maxBytes) {
|
|
86451
86591
|
const stat2 = fs21.statSync(filePath);
|
|
@@ -86638,12 +86778,14 @@ ${body}
|
|
|
86638
86778
|
...status,
|
|
86639
86779
|
messages: this.readClaudeScreenAssistantMessages(),
|
|
86640
86780
|
...this.providerSessionId ? { providerSessionId: this.providerSessionId } : {},
|
|
86781
|
+
backgroundTaskSupport: bg.support ?? "unknown",
|
|
86641
86782
|
...bg.active ? { backgroundTaskActive: true, backgroundTaskCount: bg.count, backgroundTaskIds: bg.ids } : {}
|
|
86642
86783
|
};
|
|
86643
86784
|
}
|
|
86644
86785
|
detectBackgroundTask() {
|
|
86645
|
-
if (this.
|
|
86646
|
-
|
|
86786
|
+
if (!this.spec.native_history?.source) {
|
|
86787
|
+
return { active: false, count: 0, ids: [], support: this.cliType === "claude-cli" || this.cliType === "kimi" ? "tracked" : "unknown" };
|
|
86788
|
+
}
|
|
86647
86789
|
try {
|
|
86648
86790
|
return detectBackgroundTaskActive(this.spec.native_history, {
|
|
86649
86791
|
agentType: this.cliType,
|
|
@@ -86653,7 +86795,7 @@ ${body}
|
|
|
86653
86795
|
workspace: this.workingDir
|
|
86654
86796
|
});
|
|
86655
86797
|
} catch {
|
|
86656
|
-
return { active: false, count: 0, ids: [] };
|
|
86798
|
+
return { active: false, count: 0, ids: [], support: "unknown" };
|
|
86657
86799
|
}
|
|
86658
86800
|
}
|
|
86659
86801
|
getPartialResponse() {
|
|
@@ -116853,6 +116995,135 @@ function saveStandalonePreferences(filePath, value) {
|
|
|
116853
116995
|
return next;
|
|
116854
116996
|
}
|
|
116855
116997
|
|
|
116998
|
+
// src/standalone-cli-args.ts
|
|
116999
|
+
var import_net = require("net");
|
|
117000
|
+
var StandaloneCliArgsError = class extends Error {
|
|
117001
|
+
constructor(message) {
|
|
117002
|
+
super(message);
|
|
117003
|
+
this.name = "StandaloneCliArgsError";
|
|
117004
|
+
}
|
|
117005
|
+
};
|
|
117006
|
+
var STANDALONE_HELP_TEXT = `
|
|
117007
|
+
Usage: adhdev-standalone [options]
|
|
117008
|
+
adhdev-standalone list [--all]
|
|
117009
|
+
adhdev-standalone attach <sessionId> [--read-only|--takeover]
|
|
117010
|
+
|
|
117011
|
+
Options:
|
|
117012
|
+
--port, -p <port> Port to run the standalone server on (default: 3847)
|
|
117013
|
+
--host, -H <address> Bind to an explicit address: an IPv4 address, an IPv6
|
|
117014
|
+
address, or "localhost". Default: 127.0.0.1 (loopback
|
|
117015
|
+
only). Use --host 0.0.0.0 to opt into public/LAN
|
|
117016
|
+
binding \u2014 a warning is printed when no auth is set.
|
|
117017
|
+
--token <token> Set an authentication token for the dashboard UI
|
|
117018
|
+
--dev Enable DevConsole to debug and test providers
|
|
117019
|
+
--public <path> Custom path to the web dashboard distribution
|
|
117020
|
+
--no-open Do not automatically open the browser on startup
|
|
117021
|
+
|
|
117022
|
+
Environment:
|
|
117023
|
+
ADHDEV_SESSION_HOST_NAME Override session host namespace (default: adhdev-standalone)
|
|
117024
|
+
--help, -h Show this help message
|
|
117025
|
+
|
|
117026
|
+
Runtime commands:
|
|
117027
|
+
list, runtimes Show hosted CLI runtimes
|
|
117028
|
+
attach Attach local terminal to a runtime
|
|
117029
|
+
open Open a local terminal window running adhmux for a runtime
|
|
117030
|
+
`;
|
|
117031
|
+
var PUBLIC_ANY_ADDRESSES = /* @__PURE__ */ new Set(["0.0.0.0", "::"]);
|
|
117032
|
+
function normalizeStandaloneHostAddress(raw) {
|
|
117033
|
+
const value = String(raw ?? "").trim();
|
|
117034
|
+
if (!value) {
|
|
117035
|
+
throw new StandaloneCliArgsError('Missing value for --host. Expected an IPv4 address, an IPv6 address, or "localhost".');
|
|
117036
|
+
}
|
|
117037
|
+
if (value.toLowerCase() === "localhost") return "localhost";
|
|
117038
|
+
if ((0, import_net.isIP)(value) !== 0) return value;
|
|
117039
|
+
throw new StandaloneCliArgsError(
|
|
117040
|
+
`Invalid --host address "${value}". Expected an IPv4 address (e.g. 127.0.0.1 or 0.0.0.0), an IPv6 address (e.g. ::1), or "localhost".`
|
|
117041
|
+
);
|
|
117042
|
+
}
|
|
117043
|
+
function normalizeStandalonePort(raw) {
|
|
117044
|
+
const value = String(raw ?? "").trim();
|
|
117045
|
+
const port = Number(value);
|
|
117046
|
+
if (!/^\d+$/.test(value) || !Number.isInteger(port) || port < 1 || port > 65535) {
|
|
117047
|
+
throw new StandaloneCliArgsError(`Invalid --port value "${value}". Expected an integer between 1 and 65535.`);
|
|
117048
|
+
}
|
|
117049
|
+
return port;
|
|
117050
|
+
}
|
|
117051
|
+
var FLAG_SPECS = [
|
|
117052
|
+
{ names: ["--port", "-p"], takesValue: true },
|
|
117053
|
+
{ names: ["--host", "-H"], takesValue: true },
|
|
117054
|
+
{ names: ["--token"], takesValue: true },
|
|
117055
|
+
{ names: ["--public"], takesValue: true },
|
|
117056
|
+
{ names: ["--no-open"], takesValue: false },
|
|
117057
|
+
{ names: ["--dev"], takesValue: false },
|
|
117058
|
+
{ names: ["--help", "-h"], takesValue: false }
|
|
117059
|
+
];
|
|
117060
|
+
function isKnownFlag(token) {
|
|
117061
|
+
const name = token.includes("=") ? token.slice(0, token.indexOf("=")) : token;
|
|
117062
|
+
return FLAG_SPECS.some((spec) => spec.names.includes(name));
|
|
117063
|
+
}
|
|
117064
|
+
function parseStandaloneCliArgs(args) {
|
|
117065
|
+
const options = {};
|
|
117066
|
+
let hostExplicit = false;
|
|
117067
|
+
let showHelp = false;
|
|
117068
|
+
const readValue = (flag, inlineValue, index) => {
|
|
117069
|
+
if (inlineValue !== void 0) return { value: inlineValue, consumedNext: false };
|
|
117070
|
+
const next = args[index + 1];
|
|
117071
|
+
if (next === void 0 || next.startsWith("-")) {
|
|
117072
|
+
throw new StandaloneCliArgsError(`Missing value for ${flag}.`);
|
|
117073
|
+
}
|
|
117074
|
+
return { value: next, consumedNext: true };
|
|
117075
|
+
};
|
|
117076
|
+
for (let i = 0; i < args.length; i++) {
|
|
117077
|
+
const token = args[i];
|
|
117078
|
+
const eq = token.startsWith("--") ? token.indexOf("=") : -1;
|
|
117079
|
+
const name = eq === -1 ? token : token.slice(0, eq);
|
|
117080
|
+
const inlineValue = eq === -1 ? void 0 : token.slice(eq + 1);
|
|
117081
|
+
if (name === "--port" || name === "-p") {
|
|
117082
|
+
const { value, consumedNext } = readValue(name, inlineValue, i);
|
|
117083
|
+
options.port = normalizeStandalonePort(value);
|
|
117084
|
+
if (consumedNext) i++;
|
|
117085
|
+
continue;
|
|
117086
|
+
}
|
|
117087
|
+
if (name === "--host" || name === "-H") {
|
|
117088
|
+
const { value, consumedNext } = readValue(name, inlineValue, i);
|
|
117089
|
+
options.host = normalizeStandaloneHostAddress(value);
|
|
117090
|
+
hostExplicit = true;
|
|
117091
|
+
if (consumedNext) i++;
|
|
117092
|
+
continue;
|
|
117093
|
+
}
|
|
117094
|
+
if (name === "--token") {
|
|
117095
|
+
const { value, consumedNext } = readValue(name, inlineValue, i);
|
|
117096
|
+
if (!value.trim()) throw new StandaloneCliArgsError("Missing value for --token.");
|
|
117097
|
+
options.token = value;
|
|
117098
|
+
if (consumedNext) i++;
|
|
117099
|
+
continue;
|
|
117100
|
+
}
|
|
117101
|
+
if (name === "--public") {
|
|
117102
|
+
const { value, consumedNext } = readValue(name, inlineValue, i);
|
|
117103
|
+
if (!value.trim()) throw new StandaloneCliArgsError("Missing value for --public.");
|
|
117104
|
+
options.publicDir = value;
|
|
117105
|
+
if (consumedNext) i++;
|
|
117106
|
+
continue;
|
|
117107
|
+
}
|
|
117108
|
+
if (name === "--no-open") {
|
|
117109
|
+
options.open = false;
|
|
117110
|
+
continue;
|
|
117111
|
+
}
|
|
117112
|
+
if (name === "--dev") {
|
|
117113
|
+
options.dev = true;
|
|
117114
|
+
continue;
|
|
117115
|
+
}
|
|
117116
|
+
if (name === "--help" || name === "-h") {
|
|
117117
|
+
showHelp = true;
|
|
117118
|
+
continue;
|
|
117119
|
+
}
|
|
117120
|
+
if (token.startsWith("-") && !isKnownFlag(token)) {
|
|
117121
|
+
throw new StandaloneCliArgsError(`Unknown option "${token}". Run with --help to see usage.`);
|
|
117122
|
+
}
|
|
117123
|
+
}
|
|
117124
|
+
return { options, hostExplicit, showHelp };
|
|
117125
|
+
}
|
|
117126
|
+
|
|
116856
117127
|
// src/index.ts
|
|
116857
117128
|
var import_daemon_core2 = __toESM(require_dist3());
|
|
116858
117129
|
var import_daemon_core3 = __toESM(require_dist3());
|
|
@@ -117222,7 +117493,7 @@ function getWorkspaceControlEndpoint(name) {
|
|
|
117222
117493
|
}
|
|
117223
117494
|
|
|
117224
117495
|
// ../terminal-mux-control/dist/chunk-6KLXG536.mjs
|
|
117225
|
-
var
|
|
117496
|
+
var import_net2 = __toESM(require("net"), 1);
|
|
117226
117497
|
function serializeEnvelope2(envelope) {
|
|
117227
117498
|
return `${JSON.stringify(envelope)}
|
|
117228
117499
|
`;
|
|
@@ -117252,7 +117523,7 @@ var AdhMuxControlClient = class {
|
|
|
117252
117523
|
}
|
|
117253
117524
|
async connect() {
|
|
117254
117525
|
if (this.socket && !this.socket.destroyed) return;
|
|
117255
|
-
const socket =
|
|
117526
|
+
const socket = import_net2.default.createConnection(this.endpoint.path);
|
|
117256
117527
|
this.socket = socket;
|
|
117257
117528
|
socket.on("data", createControlLineParser((envelope) => {
|
|
117258
117529
|
if (envelope.kind === "response") {
|
|
@@ -117626,7 +117897,7 @@ function clearStandalonePasswordConfig(filePath = getStandalonePasswordConfigPat
|
|
|
117626
117897
|
}
|
|
117627
117898
|
}
|
|
117628
117899
|
function shouldWarnForPublicUnauthenticatedHost(input) {
|
|
117629
|
-
return input.host
|
|
117900
|
+
return PUBLIC_ANY_ADDRESSES.has(input.host) && !input.hasTokenAuth && !input.hasPasswordAuth;
|
|
117630
117901
|
}
|
|
117631
117902
|
function parseCookies(cookieHeader) {
|
|
117632
117903
|
if (!cookieHeader) return {};
|
|
@@ -119608,57 +119879,24 @@ async function main() {
|
|
|
119608
119879
|
const exitCode = await proxySessionHostList(showAll);
|
|
119609
119880
|
process.exit(exitCode);
|
|
119610
119881
|
}
|
|
119611
|
-
|
|
119612
|
-
|
|
119613
|
-
|
|
119614
|
-
|
|
119615
|
-
|
|
119616
|
-
|
|
119617
|
-
|
|
119618
|
-
|
|
119619
|
-
|
|
119620
|
-
hostExplicit = true;
|
|
119621
|
-
}
|
|
119622
|
-
if (args[i] === "--public" && args[i + 1]) {
|
|
119623
|
-
options.publicDir = args[i + 1];
|
|
119624
|
-
i++;
|
|
119625
|
-
}
|
|
119626
|
-
if (args[i] === "--no-open") {
|
|
119627
|
-
options.open = false;
|
|
119628
|
-
}
|
|
119629
|
-
if (args[i] === "--dev") {
|
|
119630
|
-
options.dev = true;
|
|
119631
|
-
}
|
|
119632
|
-
if (args[i] === "--token" && args[i + 1]) {
|
|
119633
|
-
options.token = args[i + 1];
|
|
119634
|
-
i++;
|
|
119635
|
-
}
|
|
119636
|
-
if (args[i] === "--help" || args[i] === "-h") {
|
|
119637
|
-
console.log(`
|
|
119638
|
-
Usage: adhdev-standalone [options]
|
|
119639
|
-
adhdev-standalone list [--all]
|
|
119640
|
-
adhdev-standalone attach <sessionId> [--read-only|--takeover]
|
|
119641
|
-
|
|
119642
|
-
Options:
|
|
119643
|
-
--port, -p <port> Port to run the standalone server on (default: 3847)
|
|
119644
|
-
--host, -H Allow external network connections (binds to 0.0.0.0)
|
|
119645
|
-
--token <token> Set an authentication token for the dashboard UI
|
|
119646
|
-
--dev Enable DevConsole to debug and test providers
|
|
119647
|
-
--public <path> Custom path to the web dashboard distribution
|
|
119648
|
-
--no-open Do not automatically open the browser on startup
|
|
119649
|
-
|
|
119650
|
-
Environment:
|
|
119651
|
-
ADHDEV_SESSION_HOST_NAME Override session host namespace (default: adhdev-standalone)
|
|
119652
|
-
--help, -h Show this help message
|
|
119653
|
-
|
|
119654
|
-
Runtime commands:
|
|
119655
|
-
list, runtimes Show hosted CLI runtimes
|
|
119656
|
-
attach Attach local terminal to a runtime
|
|
119657
|
-
open Open a local terminal window running adhmux for a runtime
|
|
119658
|
-
`);
|
|
119659
|
-
process.exit(0);
|
|
119882
|
+
let parsed;
|
|
119883
|
+
try {
|
|
119884
|
+
parsed = parseStandaloneCliArgs(args);
|
|
119885
|
+
} catch (error48) {
|
|
119886
|
+
if (error48 instanceof StandaloneCliArgsError) {
|
|
119887
|
+
console.error(`
|
|
119888
|
+
\u2717 ${error48.message}`);
|
|
119889
|
+
console.error(" Run with --help to see usage.\n");
|
|
119890
|
+
process.exit(1);
|
|
119660
119891
|
}
|
|
119892
|
+
throw error48;
|
|
119893
|
+
}
|
|
119894
|
+
if (parsed.showHelp) {
|
|
119895
|
+
console.log(STANDALONE_HELP_TEXT);
|
|
119896
|
+
process.exit(0);
|
|
119661
119897
|
}
|
|
119898
|
+
const options = parsed.options;
|
|
119899
|
+
const hostExplicit = parsed.hostExplicit;
|
|
119662
119900
|
if (!hostExplicit) {
|
|
119663
119901
|
options.host = loadStandaloneBindHostPreference();
|
|
119664
119902
|
}
|