adhdev 0.8.76 → 0.8.79
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/cli/index.js +160 -113
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +130 -78
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1546,6 +1546,67 @@ var init_host_memory = __esm({
|
|
|
1546
1546
|
}
|
|
1547
1547
|
});
|
|
1548
1548
|
|
|
1549
|
+
// ../../oss/packages/daemon-core/src/session-host/runtime-surface.ts
|
|
1550
|
+
function isSessionHostLiveRuntime(record2) {
|
|
1551
|
+
const lifecycle = String(record2?.lifecycle || "").trim();
|
|
1552
|
+
return LIVE_LIFECYCLES.has(lifecycle);
|
|
1553
|
+
}
|
|
1554
|
+
function getSessionHostRecoveryLabel(meta3) {
|
|
1555
|
+
const recoveryState = typeof meta3?.runtimeRecoveryState === "string" ? String(meta3.runtimeRecoveryState).trim() : "";
|
|
1556
|
+
if (!recoveryState) return null;
|
|
1557
|
+
if (recoveryState === "auto_resumed") return "restored after restart";
|
|
1558
|
+
if (recoveryState === "resume_failed") return "restore failed";
|
|
1559
|
+
if (recoveryState === "host_restart_interrupted") return "host restart interrupted";
|
|
1560
|
+
if (recoveryState === "orphan_snapshot") return "snapshot recovered";
|
|
1561
|
+
return recoveryState.replace(/_/g, " ");
|
|
1562
|
+
}
|
|
1563
|
+
function isSessionHostRecoverySnapshot(record2) {
|
|
1564
|
+
if (!record2) return false;
|
|
1565
|
+
if (isSessionHostLiveRuntime(record2)) return false;
|
|
1566
|
+
const lifecycle = String(record2.lifecycle || "").trim();
|
|
1567
|
+
if (lifecycle && lifecycle !== "stopped" && lifecycle !== "failed") {
|
|
1568
|
+
return false;
|
|
1569
|
+
}
|
|
1570
|
+
const meta3 = record2.meta || void 0;
|
|
1571
|
+
if (meta3?.restoredFromStorage === true) return true;
|
|
1572
|
+
return getSessionHostRecoveryLabel(meta3) !== null;
|
|
1573
|
+
}
|
|
1574
|
+
function getSessionHostSurfaceKind(record2) {
|
|
1575
|
+
if (isSessionHostLiveRuntime(record2)) return "live_runtime";
|
|
1576
|
+
if (isSessionHostRecoverySnapshot(record2)) return "recovery_snapshot";
|
|
1577
|
+
return "inactive_record";
|
|
1578
|
+
}
|
|
1579
|
+
function partitionSessionHostRecords(records) {
|
|
1580
|
+
const liveRuntimes = [];
|
|
1581
|
+
const recoverySnapshots = [];
|
|
1582
|
+
const inactiveRecords = [];
|
|
1583
|
+
for (const record2 of records) {
|
|
1584
|
+
const kind = getSessionHostSurfaceKind(record2);
|
|
1585
|
+
if (kind === "live_runtime") {
|
|
1586
|
+
liveRuntimes.push(record2);
|
|
1587
|
+
} else if (kind === "recovery_snapshot") {
|
|
1588
|
+
recoverySnapshots.push(record2);
|
|
1589
|
+
} else {
|
|
1590
|
+
inactiveRecords.push(record2);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
return {
|
|
1594
|
+
liveRuntimes,
|
|
1595
|
+
recoverySnapshots,
|
|
1596
|
+
inactiveRecords
|
|
1597
|
+
};
|
|
1598
|
+
}
|
|
1599
|
+
function partitionSessionHostDiagnosticsSessions(records) {
|
|
1600
|
+
return partitionSessionHostRecords(records || []);
|
|
1601
|
+
}
|
|
1602
|
+
var LIVE_LIFECYCLES;
|
|
1603
|
+
var init_runtime_surface = __esm({
|
|
1604
|
+
"../../oss/packages/daemon-core/src/session-host/runtime-surface.ts"() {
|
|
1605
|
+
"use strict";
|
|
1606
|
+
LIVE_LIFECYCLES = /* @__PURE__ */ new Set(["starting", "running", "stopping", "interrupted"]);
|
|
1607
|
+
}
|
|
1608
|
+
});
|
|
1609
|
+
|
|
1549
1610
|
// ../../oss/packages/daemon-core/src/status/chat-tail-hot-sessions.ts
|
|
1550
1611
|
function parseMessageTimestamp(value) {
|
|
1551
1612
|
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
@@ -1555,6 +1616,23 @@ function parseMessageTimestamp(value) {
|
|
|
1555
1616
|
}
|
|
1556
1617
|
return 0;
|
|
1557
1618
|
}
|
|
1619
|
+
function isDefinitelyNonLiveRuntimeSession(session) {
|
|
1620
|
+
const surfaceKind = String(session?.runtimeSurfaceKind || "").trim();
|
|
1621
|
+
if (surfaceKind === "live_runtime") return false;
|
|
1622
|
+
if (surfaceKind === "recovery_snapshot") return true;
|
|
1623
|
+
if (surfaceKind === "inactive_record") return false;
|
|
1624
|
+
const lifecycle = String(session?.runtimeLifecycle || "").trim();
|
|
1625
|
+
if (lifecycle && LIVE_RUNTIME_LIFECYCLES.has(lifecycle)) return false;
|
|
1626
|
+
const inferredSurfaceKind = getSessionHostSurfaceKind({
|
|
1627
|
+
lifecycle: lifecycle || null,
|
|
1628
|
+
meta: {
|
|
1629
|
+
restoredFromStorage: session?.runtimeRestoredFromStorage === true,
|
|
1630
|
+
...session?.runtimeRecoveryState ? { runtimeRecoveryState: session.runtimeRecoveryState } : {}
|
|
1631
|
+
}
|
|
1632
|
+
});
|
|
1633
|
+
if (inferredSurfaceKind === "recovery_snapshot") return true;
|
|
1634
|
+
return false;
|
|
1635
|
+
}
|
|
1558
1636
|
function classifyHotChatSessionsForSubscriptionFlush(sessions, previousHotSessionIds, options = {}) {
|
|
1559
1637
|
const now = options.now ?? Date.now();
|
|
1560
1638
|
const recentMessageGraceMs = Math.max(
|
|
@@ -1563,9 +1641,14 @@ function classifyHotChatSessionsForSubscriptionFlush(sessions, previousHotSessio
|
|
|
1563
1641
|
);
|
|
1564
1642
|
const activeStatuses = options.activeStatuses ?? DEFAULT_ACTIVE_CHAT_POLL_STATUSES;
|
|
1565
1643
|
const active = /* @__PURE__ */ new Set();
|
|
1644
|
+
const excluded = /* @__PURE__ */ new Set();
|
|
1566
1645
|
for (const session of sessions) {
|
|
1567
1646
|
const sessionId = typeof session?.id === "string" ? session.id : "";
|
|
1568
1647
|
if (!sessionId) continue;
|
|
1648
|
+
if (isDefinitelyNonLiveRuntimeSession(session)) {
|
|
1649
|
+
excluded.add(sessionId);
|
|
1650
|
+
continue;
|
|
1651
|
+
}
|
|
1569
1652
|
const status = String(session?.status || "").toLowerCase();
|
|
1570
1653
|
const lastMessageAt = parseMessageTimestamp(session?.lastMessageAt);
|
|
1571
1654
|
const recentlyUpdated = lastMessageAt > 0 && now - lastMessageAt <= recentMessageGraceMs;
|
|
@@ -1574,20 +1657,22 @@ function classifyHotChatSessionsForSubscriptionFlush(sessions, previousHotSessio
|
|
|
1574
1657
|
}
|
|
1575
1658
|
}
|
|
1576
1659
|
const finalizing = new Set(
|
|
1577
|
-
Array.from(previousHotSessionIds).filter((sessionId) => !active.has(sessionId))
|
|
1660
|
+
Array.from(previousHotSessionIds).filter((sessionId) => !active.has(sessionId) && !excluded.has(sessionId))
|
|
1578
1661
|
);
|
|
1579
1662
|
return { active, finalizing };
|
|
1580
1663
|
}
|
|
1581
|
-
var DEFAULT_ACTIVE_CHAT_POLL_STATUSES, DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS;
|
|
1664
|
+
var DEFAULT_ACTIVE_CHAT_POLL_STATUSES, DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS, LIVE_RUNTIME_LIFECYCLES;
|
|
1582
1665
|
var init_chat_tail_hot_sessions = __esm({
|
|
1583
1666
|
"../../oss/packages/daemon-core/src/status/chat-tail-hot-sessions.ts"() {
|
|
1584
1667
|
"use strict";
|
|
1668
|
+
init_runtime_surface();
|
|
1585
1669
|
DEFAULT_ACTIVE_CHAT_POLL_STATUSES = /* @__PURE__ */ new Set([
|
|
1586
1670
|
"generating",
|
|
1587
1671
|
"waiting_approval",
|
|
1588
1672
|
"starting"
|
|
1589
1673
|
]);
|
|
1590
1674
|
DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS = 8e3;
|
|
1675
|
+
LIVE_RUNTIME_LIFECYCLES = /* @__PURE__ */ new Set(["starting", "running", "stopping", "interrupted"]);
|
|
1591
1676
|
}
|
|
1592
1677
|
});
|
|
1593
1678
|
|
|
@@ -6651,7 +6736,7 @@ function shouldIncludeSessionMetadata(profile) {
|
|
|
6651
6736
|
return profile !== "live";
|
|
6652
6737
|
}
|
|
6653
6738
|
function shouldIncludeRuntimeMetadata(profile) {
|
|
6654
|
-
return
|
|
6739
|
+
return true;
|
|
6655
6740
|
}
|
|
6656
6741
|
function findCdpManager(cdpManagers, key) {
|
|
6657
6742
|
const exact = cdpManagers.get(key);
|
|
@@ -6783,8 +6868,12 @@ function buildCliSession(state, options) {
|
|
|
6783
6868
|
runtimeKey: state.runtime?.runtimeKey,
|
|
6784
6869
|
runtimeDisplayName: state.runtime?.displayName,
|
|
6785
6870
|
runtimeWorkspaceLabel: state.runtime?.workspaceLabel,
|
|
6871
|
+
runtimeLifecycle: state.runtime?.lifecycle ?? null,
|
|
6872
|
+
runtimeSurfaceKind: state.runtime?.surfaceKind,
|
|
6786
6873
|
runtimeWriteOwner: state.runtime?.writeOwner || null,
|
|
6787
|
-
runtimeAttachedClients: state.runtime?.attachedClients || []
|
|
6874
|
+
runtimeAttachedClients: state.runtime?.attachedClients || [],
|
|
6875
|
+
runtimeRestoredFromStorage: state.runtime?.restoredFromStorage === true,
|
|
6876
|
+
runtimeRecoveryState: state.runtime?.recoveryState ?? null
|
|
6788
6877
|
},
|
|
6789
6878
|
mode: state.mode,
|
|
6790
6879
|
resume: state.resume,
|
|
@@ -10694,11 +10783,11 @@ __export(dist_exports, {
|
|
|
10694
10783
|
ensureNodePtySpawnHelperPermissions: () => ensureNodePtySpawnHelperPermissions,
|
|
10695
10784
|
formatRuntimeOwner: () => formatRuntimeOwner,
|
|
10696
10785
|
getDefaultSessionHostEndpoint: () => getDefaultSessionHostEndpoint,
|
|
10697
|
-
getSessionHostRecoveryLabel: () =>
|
|
10698
|
-
getSessionHostSurfaceKind: () =>
|
|
10786
|
+
getSessionHostRecoveryLabel: () => getSessionHostRecoveryLabel2,
|
|
10787
|
+
getSessionHostSurfaceKind: () => getSessionHostSurfaceKind2,
|
|
10699
10788
|
getWorkspaceLabel: () => getWorkspaceLabel,
|
|
10700
|
-
isSessionHostLiveRuntime: () =>
|
|
10701
|
-
isSessionHostRecoverySnapshot: () =>
|
|
10789
|
+
isSessionHostLiveRuntime: () => isSessionHostLiveRuntime2,
|
|
10790
|
+
isSessionHostRecoverySnapshot: () => isSessionHostRecoverySnapshot2,
|
|
10702
10791
|
resolveAttachableRuntimeRecord: () => resolveAttachableRuntimeRecord,
|
|
10703
10792
|
resolveRuntimeRecord: () => resolveRuntimeRecord,
|
|
10704
10793
|
sanitizeSpawnEnv: () => sanitizeSpawnEnv,
|
|
@@ -10738,14 +10827,14 @@ function buildRuntimeKey(payload, existingKeys) {
|
|
|
10738
10827
|
}
|
|
10739
10828
|
return candidate;
|
|
10740
10829
|
}
|
|
10741
|
-
function
|
|
10830
|
+
function isSessionHostLiveRuntime2(record2) {
|
|
10742
10831
|
if (!record2) return false;
|
|
10743
10832
|
if (record2.surfaceKind === "live_runtime") return true;
|
|
10744
10833
|
if (record2.surfaceKind === "recovery_snapshot" || record2.surfaceKind === "inactive_record") return false;
|
|
10745
10834
|
const lifecycle = String(record2.lifecycle || "").trim();
|
|
10746
|
-
return
|
|
10835
|
+
return LIVE_LIFECYCLES2.has(lifecycle);
|
|
10747
10836
|
}
|
|
10748
|
-
function
|
|
10837
|
+
function getSessionHostRecoveryLabel2(meta3) {
|
|
10749
10838
|
const recoveryState = typeof meta3?.runtimeRecoveryState === "string" ? String(meta3.runtimeRecoveryState).trim() : "";
|
|
10750
10839
|
if (!recoveryState) return null;
|
|
10751
10840
|
if (recoveryState === "auto_resumed") return "restored after restart";
|
|
@@ -10754,30 +10843,30 @@ function getSessionHostRecoveryLabel(meta3) {
|
|
|
10754
10843
|
if (recoveryState === "orphan_snapshot") return "snapshot recovered";
|
|
10755
10844
|
return recoveryState.replace(/_/g, " ");
|
|
10756
10845
|
}
|
|
10757
|
-
function
|
|
10846
|
+
function isSessionHostRecoverySnapshot2(record2) {
|
|
10758
10847
|
if (!record2) return false;
|
|
10759
10848
|
if (record2.surfaceKind === "recovery_snapshot") return true;
|
|
10760
10849
|
if (record2.surfaceKind === "live_runtime" || record2.surfaceKind === "inactive_record") return false;
|
|
10761
|
-
if (
|
|
10850
|
+
if (isSessionHostLiveRuntime2(record2)) return false;
|
|
10762
10851
|
const lifecycle = String(record2.lifecycle || "").trim();
|
|
10763
10852
|
if (lifecycle && lifecycle !== "stopped" && lifecycle !== "failed") {
|
|
10764
10853
|
return false;
|
|
10765
10854
|
}
|
|
10766
10855
|
const meta3 = record2.meta || void 0;
|
|
10767
10856
|
if (meta3?.restoredFromStorage === true) return true;
|
|
10768
|
-
return
|
|
10857
|
+
return getSessionHostRecoveryLabel2(meta3) !== null;
|
|
10769
10858
|
}
|
|
10770
|
-
function
|
|
10859
|
+
function getSessionHostSurfaceKind2(record2) {
|
|
10771
10860
|
if (record2?.surfaceKind === "live_runtime" || record2?.surfaceKind === "recovery_snapshot" || record2?.surfaceKind === "inactive_record") {
|
|
10772
10861
|
return record2.surfaceKind;
|
|
10773
10862
|
}
|
|
10774
|
-
if (
|
|
10775
|
-
if (
|
|
10863
|
+
if (isSessionHostLiveRuntime2(record2)) return "live_runtime";
|
|
10864
|
+
if (isSessionHostRecoverySnapshot2(record2)) return "recovery_snapshot";
|
|
10776
10865
|
return "inactive_record";
|
|
10777
10866
|
}
|
|
10778
10867
|
function resolveAttachableRuntimeRecord(records, identifier) {
|
|
10779
10868
|
const record2 = resolveRuntimeRecord(records, identifier);
|
|
10780
|
-
const surfaceKind =
|
|
10869
|
+
const surfaceKind = getSessionHostSurfaceKind2(record2);
|
|
10781
10870
|
if (surfaceKind === "live_runtime") {
|
|
10782
10871
|
return record2;
|
|
10783
10872
|
}
|
|
@@ -10900,7 +10989,7 @@ function ensureNodePtySpawnHelperPermissions(logFn) {
|
|
|
10900
10989
|
} catch {
|
|
10901
10990
|
}
|
|
10902
10991
|
}
|
|
10903
|
-
var import_crypto3, path9, os9, path22, net, import_crypto4, os22, path32, __require, SessionRingBuffer,
|
|
10992
|
+
var import_crypto3, path9, os9, path22, net, import_crypto4, os22, path32, __require, SessionRingBuffer, LIVE_LIFECYCLES2, SessionHostRegistry, SessionHostClient;
|
|
10904
10993
|
var init_dist = __esm({
|
|
10905
10994
|
"../../oss/packages/session-host-core/dist/index.mjs"() {
|
|
10906
10995
|
"use strict";
|
|
@@ -10978,7 +11067,7 @@ var init_dist = __esm({
|
|
|
10978
11067
|
}
|
|
10979
11068
|
}
|
|
10980
11069
|
};
|
|
10981
|
-
|
|
11070
|
+
LIVE_LIFECYCLES2 = /* @__PURE__ */ new Set(["starting", "running", "stopping", "interrupted"]);
|
|
10982
11071
|
SessionHostRegistry = class {
|
|
10983
11072
|
sessions = /* @__PURE__ */ new Map();
|
|
10984
11073
|
createSession(payload) {
|
|
@@ -13919,8 +14008,12 @@ var init_cli_provider_instance = __esm({
|
|
|
13919
14008
|
runtimeKey: runtime.runtimeKey,
|
|
13920
14009
|
displayName: runtime.displayName,
|
|
13921
14010
|
workspaceLabel: runtime.workspaceLabel,
|
|
14011
|
+
lifecycle: runtime.lifecycle ?? null,
|
|
14012
|
+
surfaceKind: runtime.surfaceKind,
|
|
13922
14013
|
writeOwner: runtime.writeOwner || null,
|
|
13923
|
-
attachedClients: runtime.attachedClients || []
|
|
14014
|
+
attachedClients: runtime.attachedClients || [],
|
|
14015
|
+
restoredFromStorage: runtime.restoredFromStorage === true,
|
|
14016
|
+
recoveryState: runtime.recoveryState ?? null
|
|
13924
14017
|
} : void 0,
|
|
13925
14018
|
resume: this.provider.resume,
|
|
13926
14019
|
controlValues: surface.controlValues,
|
|
@@ -36248,8 +36341,11 @@ function checkSize() {
|
|
|
36248
36341
|
} catch {
|
|
36249
36342
|
}
|
|
36250
36343
|
}
|
|
36344
|
+
function shouldLogCommand(cmd) {
|
|
36345
|
+
return !SKIP_COMMANDS.has(cmd);
|
|
36346
|
+
}
|
|
36251
36347
|
function logCommand(entry) {
|
|
36252
|
-
if (
|
|
36348
|
+
if (!shouldLogCommand(entry.cmd)) return;
|
|
36253
36349
|
try {
|
|
36254
36350
|
if (++writeCount2 % 500 === 0) {
|
|
36255
36351
|
checkRotation();
|
|
@@ -36325,73 +36421,14 @@ var init_command_log = __esm({
|
|
|
36325
36421
|
writeCount2 = 0;
|
|
36326
36422
|
SKIP_COMMANDS = /* @__PURE__ */ new Set([
|
|
36327
36423
|
"heartbeat",
|
|
36328
|
-
"status_report"
|
|
36424
|
+
"status_report",
|
|
36425
|
+
"read_chat",
|
|
36426
|
+
"mark_session_seen"
|
|
36329
36427
|
]);
|
|
36330
36428
|
cleanOldFiles();
|
|
36331
36429
|
}
|
|
36332
36430
|
});
|
|
36333
36431
|
|
|
36334
|
-
// ../../oss/packages/daemon-core/src/session-host/runtime-surface.ts
|
|
36335
|
-
function isSessionHostLiveRuntime2(record2) {
|
|
36336
|
-
const lifecycle = String(record2?.lifecycle || "").trim();
|
|
36337
|
-
return LIVE_LIFECYCLES2.has(lifecycle);
|
|
36338
|
-
}
|
|
36339
|
-
function getSessionHostRecoveryLabel2(meta3) {
|
|
36340
|
-
const recoveryState = typeof meta3?.runtimeRecoveryState === "string" ? String(meta3.runtimeRecoveryState).trim() : "";
|
|
36341
|
-
if (!recoveryState) return null;
|
|
36342
|
-
if (recoveryState === "auto_resumed") return "restored after restart";
|
|
36343
|
-
if (recoveryState === "resume_failed") return "restore failed";
|
|
36344
|
-
if (recoveryState === "host_restart_interrupted") return "host restart interrupted";
|
|
36345
|
-
if (recoveryState === "orphan_snapshot") return "snapshot recovered";
|
|
36346
|
-
return recoveryState.replace(/_/g, " ");
|
|
36347
|
-
}
|
|
36348
|
-
function isSessionHostRecoverySnapshot2(record2) {
|
|
36349
|
-
if (!record2) return false;
|
|
36350
|
-
if (isSessionHostLiveRuntime2(record2)) return false;
|
|
36351
|
-
const lifecycle = String(record2.lifecycle || "").trim();
|
|
36352
|
-
if (lifecycle && lifecycle !== "stopped" && lifecycle !== "failed") {
|
|
36353
|
-
return false;
|
|
36354
|
-
}
|
|
36355
|
-
const meta3 = record2.meta || void 0;
|
|
36356
|
-
if (meta3?.restoredFromStorage === true) return true;
|
|
36357
|
-
return getSessionHostRecoveryLabel2(meta3) !== null;
|
|
36358
|
-
}
|
|
36359
|
-
function getSessionHostSurfaceKind2(record2) {
|
|
36360
|
-
if (isSessionHostLiveRuntime2(record2)) return "live_runtime";
|
|
36361
|
-
if (isSessionHostRecoverySnapshot2(record2)) return "recovery_snapshot";
|
|
36362
|
-
return "inactive_record";
|
|
36363
|
-
}
|
|
36364
|
-
function partitionSessionHostRecords(records) {
|
|
36365
|
-
const liveRuntimes = [];
|
|
36366
|
-
const recoverySnapshots = [];
|
|
36367
|
-
const inactiveRecords = [];
|
|
36368
|
-
for (const record2 of records) {
|
|
36369
|
-
const kind = getSessionHostSurfaceKind2(record2);
|
|
36370
|
-
if (kind === "live_runtime") {
|
|
36371
|
-
liveRuntimes.push(record2);
|
|
36372
|
-
} else if (kind === "recovery_snapshot") {
|
|
36373
|
-
recoverySnapshots.push(record2);
|
|
36374
|
-
} else {
|
|
36375
|
-
inactiveRecords.push(record2);
|
|
36376
|
-
}
|
|
36377
|
-
}
|
|
36378
|
-
return {
|
|
36379
|
-
liveRuntimes,
|
|
36380
|
-
recoverySnapshots,
|
|
36381
|
-
inactiveRecords
|
|
36382
|
-
};
|
|
36383
|
-
}
|
|
36384
|
-
function partitionSessionHostDiagnosticsSessions(records) {
|
|
36385
|
-
return partitionSessionHostRecords(records || []);
|
|
36386
|
-
}
|
|
36387
|
-
var LIVE_LIFECYCLES2;
|
|
36388
|
-
var init_runtime_surface = __esm({
|
|
36389
|
-
"../../oss/packages/daemon-core/src/session-host/runtime-surface.ts"() {
|
|
36390
|
-
"use strict";
|
|
36391
|
-
LIVE_LIFECYCLES2 = /* @__PURE__ */ new Set(["starting", "running", "stopping", "interrupted"]);
|
|
36392
|
-
}
|
|
36393
|
-
});
|
|
36394
|
-
|
|
36395
36432
|
// ../../oss/packages/daemon-core/src/status/snapshot.ts
|
|
36396
36433
|
function buildRecentReadDebugSignature(snapshot) {
|
|
36397
36434
|
return [
|
|
@@ -36927,7 +36964,7 @@ function summarizeSessionHostRecord(result) {
|
|
|
36927
36964
|
return {
|
|
36928
36965
|
runtimeKey: typeof record2.runtimeKey === "string" ? record2.runtimeKey : void 0,
|
|
36929
36966
|
lifecycle: typeof record2.lifecycle === "string" ? record2.lifecycle : void 0,
|
|
36930
|
-
surfaceKind:
|
|
36967
|
+
surfaceKind: getSessionHostSurfaceKind(record2),
|
|
36931
36968
|
attachedClientCount: Array.isArray(record2.attachedClients) ? record2.attachedClients.length : void 0,
|
|
36932
36969
|
hasWriteOwner: !!record2.writeOwner,
|
|
36933
36970
|
writeOwnerClientId: typeof record2.writeOwner?.clientId === "string" ? record2.writeOwner.clientId : void 0
|
|
@@ -44922,6 +44959,8 @@ var init_session_host_transport = __esm({
|
|
|
44922
44959
|
runtimeKey: record2.runtimeKey,
|
|
44923
44960
|
displayName: record2.displayName,
|
|
44924
44961
|
workspaceLabel: record2.workspaceLabel,
|
|
44962
|
+
lifecycle: typeof record2.lifecycle === "string" ? record2.lifecycle : null,
|
|
44963
|
+
surfaceKind: record2.surfaceKind,
|
|
44925
44964
|
writeOwner: record2.writeOwner ? {
|
|
44926
44965
|
clientId: record2.writeOwner.clientId,
|
|
44927
44966
|
ownerType: record2.writeOwner.ownerType
|
|
@@ -44973,20 +45012,32 @@ var init_session_host_transport = __esm({
|
|
|
44973
45012
|
});
|
|
44974
45013
|
|
|
44975
45014
|
// ../../oss/packages/daemon-core/src/session-host/app-name.ts
|
|
44976
|
-
function
|
|
44977
|
-
|
|
44978
|
-
throw new Error(
|
|
44979
|
-
`Standalone session-host namespace '${DEFAULT_SESSION_HOST_APP_NAME}' is reserved for the global daemon. Use '${DEFAULT_STANDALONE_SESSION_HOST_APP_NAME}' or another non-default namespace.`
|
|
44980
|
-
);
|
|
45015
|
+
function getReservedStandaloneNamespaceWarning() {
|
|
45016
|
+
return `Standalone session-host namespace '${DEFAULT_SESSION_HOST_APP_NAME}' is reserved for the global daemon. Falling back to '${DEFAULT_STANDALONE_SESSION_HOST_APP_NAME}' for this standalone run.`;
|
|
44981
45017
|
}
|
|
44982
|
-
function
|
|
45018
|
+
function resolveSessionHostAppNameResolution(options = {}) {
|
|
44983
45019
|
const env3 = options.env || process.env;
|
|
44984
45020
|
const explicit = typeof env3.ADHDEV_SESSION_HOST_NAME === "string" ? env3.ADHDEV_SESSION_HOST_NAME.trim() : "";
|
|
44985
45021
|
if (explicit) {
|
|
44986
|
-
if (options.standalone
|
|
44987
|
-
|
|
45022
|
+
if (options.standalone && explicit === DEFAULT_SESSION_HOST_APP_NAME) {
|
|
45023
|
+
return {
|
|
45024
|
+
appName: DEFAULT_STANDALONE_SESSION_HOST_APP_NAME,
|
|
45025
|
+
warning: getReservedStandaloneNamespaceWarning(),
|
|
45026
|
+
source: "reserved-standalone-fallback"
|
|
45027
|
+
};
|
|
45028
|
+
}
|
|
45029
|
+
return {
|
|
45030
|
+
appName: explicit,
|
|
45031
|
+
source: "explicit"
|
|
45032
|
+
};
|
|
44988
45033
|
}
|
|
44989
|
-
return
|
|
45034
|
+
return {
|
|
45035
|
+
appName: options.standalone ? DEFAULT_STANDALONE_SESSION_HOST_APP_NAME : DEFAULT_SESSION_HOST_APP_NAME,
|
|
45036
|
+
source: "default"
|
|
45037
|
+
};
|
|
45038
|
+
}
|
|
45039
|
+
function resolveSessionHostAppName(options = {}) {
|
|
45040
|
+
return resolveSessionHostAppNameResolution(options).appName;
|
|
44990
45041
|
}
|
|
44991
45042
|
var DEFAULT_SESSION_HOST_APP_NAME, DEFAULT_STANDALONE_SESSION_HOST_APP_NAME;
|
|
44992
45043
|
var init_app_name = __esm({
|
|
@@ -45649,8 +45700,8 @@ __export(src_exports, {
|
|
|
45649
45700
|
getRecentDebugTrace: () => getRecentDebugTrace,
|
|
45650
45701
|
getRecentLogs: () => getRecentLogs,
|
|
45651
45702
|
getSavedProviderSessions: () => getSavedProviderSessions,
|
|
45652
|
-
getSessionHostRecoveryLabel: () =>
|
|
45653
|
-
getSessionHostSurfaceKind: () =>
|
|
45703
|
+
getSessionHostRecoveryLabel: () => getSessionHostRecoveryLabel,
|
|
45704
|
+
getSessionHostSurfaceKind: () => getSessionHostSurfaceKind,
|
|
45654
45705
|
getWorkspaceState: () => getWorkspaceState,
|
|
45655
45706
|
hasCdpManager: () => hasCdpManager,
|
|
45656
45707
|
hashSignatureParts: () => hashSignatureParts,
|
|
@@ -45663,8 +45714,8 @@ __export(src_exports, {
|
|
|
45663
45714
|
isIdeRunning: () => isIdeRunning,
|
|
45664
45715
|
isManagedStatusWaiting: () => isManagedStatusWaiting,
|
|
45665
45716
|
isManagedStatusWorking: () => isManagedStatusWorking,
|
|
45666
|
-
isSessionHostLiveRuntime: () =>
|
|
45667
|
-
isSessionHostRecoverySnapshot: () =>
|
|
45717
|
+
isSessionHostLiveRuntime: () => isSessionHostLiveRuntime,
|
|
45718
|
+
isSessionHostRecoverySnapshot: () => isSessionHostRecoverySnapshot,
|
|
45668
45719
|
isSetupComplete: () => isSetupComplete,
|
|
45669
45720
|
killIdeProcess: () => killIdeProcess,
|
|
45670
45721
|
launchIDE: () => launchIDE,
|
|
@@ -45699,6 +45750,7 @@ __export(src_exports, {
|
|
|
45699
45750
|
resolveChatMessageKind: () => resolveChatMessageKind,
|
|
45700
45751
|
resolveDebugRuntimeConfig: () => resolveDebugRuntimeConfig,
|
|
45701
45752
|
resolveSessionHostAppName: () => resolveSessionHostAppName,
|
|
45753
|
+
resolveSessionHostAppNameResolution: () => resolveSessionHostAppNameResolution,
|
|
45702
45754
|
runAsyncBatch: () => runAsyncBatch,
|
|
45703
45755
|
saveConfig: () => saveConfig,
|
|
45704
45756
|
saveState: () => saveState,
|
|
@@ -85815,7 +85867,7 @@ var init_adhdev_daemon = __esm({
|
|
|
85815
85867
|
init_source();
|
|
85816
85868
|
init_version();
|
|
85817
85869
|
init_src();
|
|
85818
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.
|
|
85870
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.79" });
|
|
85819
85871
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
85820
85872
|
localHttpServer = null;
|
|
85821
85873
|
localWss = null;
|
|
@@ -87284,7 +87336,7 @@ async function buildRuntimeTargetResolutionTrace(records, target, options) {
|
|
|
87284
87336
|
runtimeKey: record2.runtimeKey,
|
|
87285
87337
|
displayName: record2.displayName,
|
|
87286
87338
|
lifecycle: record2.lifecycle,
|
|
87287
|
-
surfaceKind:
|
|
87339
|
+
surfaceKind: getSessionHostSurfaceKind2(record2),
|
|
87288
87340
|
attachedClientCount: Array.isArray(record2.attachedClients) ? record2.attachedClients.length : 0,
|
|
87289
87341
|
writeOwnerClientId: record2.writeOwner?.clientId
|
|
87290
87342
|
};
|
|
@@ -89543,7 +89595,7 @@ function registerDaemonCommands(program2, pkgVersion3) {
|
|
|
89543
89595
|
});
|
|
89544
89596
|
program2.command("standalone").description("\u{1F5A5}\uFE0F Start ADHDev Standalone Server (Local Dashboard & Embedded Daemon)").option("-p, --port <port>", "Local HTTP/WS server port", "3847").option("--host <host>", "Bind to specific host (use 0.0.0.0 for LAN access)").option("--no-open", "Prevent opening browser automatically").option("--token <token>", "Require token authentication").option("--dev", "Enable Dev Mode").action(async (options) => {
|
|
89545
89597
|
const { spawn: spawn6, execSync: execSync8 } = await import("child_process");
|
|
89546
|
-
const { DEFAULT_STANDALONE_SESSION_HOST_APP_NAME: DEFAULT_STANDALONE_SESSION_HOST_APP_NAME2,
|
|
89598
|
+
const { DEFAULT_STANDALONE_SESSION_HOST_APP_NAME: DEFAULT_STANDALONE_SESSION_HOST_APP_NAME2, resolveSessionHostAppNameResolution: resolveSessionHostAppNameResolution2 } = await Promise.resolve().then(() => (init_src(), src_exports));
|
|
89547
89599
|
console.log(source_default.cyan("\n Starting ADHDev Standalone Server..."));
|
|
89548
89600
|
const args = [];
|
|
89549
89601
|
if (options.port) args.push("--port", options.port);
|
|
@@ -89551,19 +89603,11 @@ function registerDaemonCommands(program2, pkgVersion3) {
|
|
|
89551
89603
|
if (options.open === false) args.push("--no-open");
|
|
89552
89604
|
if (options.token) args.push("--token", options.token);
|
|
89553
89605
|
if (options.dev) args.push("--dev");
|
|
89554
|
-
|
|
89555
|
-
|
|
89556
|
-
sessionHostName = resolveSessionHostAppName2({ standalone: true, env: process.env });
|
|
89557
|
-
} catch (error48) {
|
|
89558
|
-
console.error(source_default.red(`
|
|
89559
|
-
\u2717 ${error48 instanceof Error ? error48.message : String(error48)}
|
|
89560
|
-
`));
|
|
89561
|
-
process.exitCode = 1;
|
|
89562
|
-
return;
|
|
89563
|
-
}
|
|
89606
|
+
const sessionHostResolution = resolveSessionHostAppNameResolution2({ standalone: true, env: process.env });
|
|
89607
|
+
const sessionHostName = sessionHostResolution.appName;
|
|
89564
89608
|
const standaloneEnv = {
|
|
89565
89609
|
...process.env,
|
|
89566
|
-
ADHDEV_SESSION_HOST_NAME:
|
|
89610
|
+
ADHDEV_SESSION_HOST_NAME: sessionHostName
|
|
89567
89611
|
};
|
|
89568
89612
|
let bin = "npx";
|
|
89569
89613
|
const npxArgs = ["-y", "@adhdev/daemon-standalone@latest", ...args];
|
|
@@ -89574,7 +89618,10 @@ function registerDaemonCommands(program2, pkgVersion3) {
|
|
|
89574
89618
|
console.log(source_default.gray(" Standalone server package not found locally."));
|
|
89575
89619
|
console.log(source_default.gray(" Downloading and running via npx (this may take a moment)..."));
|
|
89576
89620
|
}
|
|
89577
|
-
|
|
89621
|
+
if (sessionHostResolution.warning) {
|
|
89622
|
+
console.log(source_default.yellow(` \u26A0 ${sessionHostResolution.warning}`));
|
|
89623
|
+
}
|
|
89624
|
+
console.log(source_default.gray(` Session host namespace: ${sessionHostName}${sessionHostResolution.source === "default" ? " (default isolated standalone namespace)" : sessionHostResolution.source === "explicit" ? " (from ADHDEV_SESSION_HOST_NAME)" : " (auto-corrected for standalone isolation)"}`));
|
|
89578
89625
|
const spawnArgs = bin === "npx" ? npxArgs : args;
|
|
89579
89626
|
const child = spawn6(bin, spawnArgs, {
|
|
89580
89627
|
stdio: "inherit",
|