adhdev 0.8.82 → 0.8.83
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 +81 -32
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +81 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/session-host-daemon/index.js +13 -1
- package/vendor/session-host-daemon/index.js.map +1 -1
- package/vendor/session-host-daemon/index.mjs +14 -3
- package/vendor/session-host-daemon/index.mjs.map +1 -1
package/dist/index.js
CHANGED
|
@@ -1236,9 +1236,15 @@ function classifyHotChatSessionsForSubscriptionFlush(sessions, previousHotSessio
|
|
|
1236
1236
|
continue;
|
|
1237
1237
|
}
|
|
1238
1238
|
const status = String(session?.status || "").toLowerCase();
|
|
1239
|
+
const unread = session?.unread === true;
|
|
1240
|
+
const inboxBucket = String(session?.inboxBucket || "").toLowerCase();
|
|
1241
|
+
const runtimeSurfaceKind = String(session?.runtimeSurfaceKind || "").toLowerCase();
|
|
1242
|
+
const runtimeLifecycle = String(session?.runtimeLifecycle || "").toLowerCase();
|
|
1243
|
+
const isLiveRuntime = runtimeSurfaceKind === "live_runtime" || LIVE_RUNTIME_LIFECYCLES.has(runtimeLifecycle);
|
|
1239
1244
|
const lastMessageAt = parseMessageTimestamp(session?.lastMessageAt);
|
|
1240
1245
|
const recentlyUpdated = lastMessageAt > 0 && now - lastMessageAt <= recentMessageGraceMs;
|
|
1241
|
-
|
|
1246
|
+
const shouldKeepRecentTailHot = recentlyUpdated && (unread || inboxBucket === "task_complete" || inboxBucket === "needs_attention" || isLiveRuntime || activeStatuses.has(status));
|
|
1247
|
+
if (activeStatuses.has(status) || shouldKeepRecentTailHot) {
|
|
1242
1248
|
active.add(sessionId);
|
|
1243
1249
|
}
|
|
1244
1250
|
}
|
|
@@ -10291,10 +10297,12 @@ function logTerminalBackendSelection(preference, ghosttyAvailable, backendKind)
|
|
|
10291
10297
|
if (loggedTerminalBackends.has(key)) return;
|
|
10292
10298
|
loggedTerminalBackends.add(key);
|
|
10293
10299
|
if (backendKind === "xterm" && preference !== "xterm" && !ghosttyAvailable) {
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10300
|
+
const message = `[terminal-screen] ghostty-vt unavailable; using xterm fallback (preference=${preference})`;
|
|
10301
|
+
if (preference === "auto") {
|
|
10302
|
+
LOG.info("Terminal", message);
|
|
10303
|
+
} else {
|
|
10304
|
+
LOG.warn("Terminal", message);
|
|
10305
|
+
}
|
|
10298
10306
|
return;
|
|
10299
10307
|
}
|
|
10300
10308
|
LOG.info(
|
|
@@ -11147,6 +11155,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
11147
11155
|
"use strict";
|
|
11148
11156
|
os12 = __toESM(require("os"));
|
|
11149
11157
|
init_logger();
|
|
11158
|
+
init_debug_config();
|
|
11150
11159
|
init_terminal_screen();
|
|
11151
11160
|
init_pty_transport();
|
|
11152
11161
|
init_provider_cli_shared();
|
|
@@ -11180,7 +11189,15 @@ var init_provider_cli_adapter = __esm({
|
|
|
11180
11189
|
`[${this.cliType}] Provider resolution: providerDir=${this.providerResolutionMeta.providerDir || "-"} scriptDir=${this.providerResolutionMeta.scriptDir || "-"} scriptsPath=${this.providerResolutionMeta.scriptsPath || "-"} source=${this.providerResolutionMeta.scriptsSource || "-"} version=${this.providerResolutionMeta.resolvedVersion || "-"}`
|
|
11181
11190
|
);
|
|
11182
11191
|
} else {
|
|
11183
|
-
|
|
11192
|
+
const resolutionSummary = `providerDir=${this.providerResolutionMeta.providerDir || "-"} scriptDir=${this.providerResolutionMeta.scriptDir || "-"} scriptsPath=${this.providerResolutionMeta.scriptsPath || "-"} source=${this.providerResolutionMeta.scriptsSource || "-"} version=${this.providerResolutionMeta.resolvedVersion || "-"}`;
|
|
11193
|
+
const hasResolvedProviderScripts = Boolean(
|
|
11194
|
+
this.providerResolutionMeta.providerDir || this.providerResolutionMeta.scriptDir || this.providerResolutionMeta.scriptsPath || this.providerResolutionMeta.scriptsSource || this.providerResolutionMeta.resolvedVersion
|
|
11195
|
+
);
|
|
11196
|
+
if (hasResolvedProviderScripts) {
|
|
11197
|
+
LOG.warn("CLI", `[${this.cliType}] \u26A0 No CLI scripts loaded! Provider needs scripts/{version}/scripts.js (${resolutionSummary})`);
|
|
11198
|
+
} else {
|
|
11199
|
+
LOG.info("CLI", `[${this.cliType}] CLI scripts not yet resolved (${resolutionSummary})`);
|
|
11200
|
+
}
|
|
11184
11201
|
}
|
|
11185
11202
|
}
|
|
11186
11203
|
cliType;
|
|
@@ -11259,7 +11276,8 @@ var init_provider_cli_adapter = __esm({
|
|
|
11259
11276
|
currentTurnScope = null;
|
|
11260
11277
|
traceEntries = [];
|
|
11261
11278
|
traceSeq = 0;
|
|
11262
|
-
traceSessionId =
|
|
11279
|
+
traceSessionId = "";
|
|
11280
|
+
parsedStatusCache = null;
|
|
11263
11281
|
static MAX_TRACE_ENTRIES = 250;
|
|
11264
11282
|
providerResolutionMeta;
|
|
11265
11283
|
static FINISH_RETRY_DELAY_MS = 300;
|
|
@@ -11500,7 +11518,8 @@ var init_provider_cli_adapter = __esm({
|
|
|
11500
11518
|
this.terminalScreen.write(rawData);
|
|
11501
11519
|
const cleanData = sanitizeTerminalText(rawData);
|
|
11502
11520
|
const now = Date.now();
|
|
11503
|
-
const
|
|
11521
|
+
const screenText = this.terminalScreen.getText();
|
|
11522
|
+
const normalizedScreenSnapshot = normalizeScreenSnapshot(screenText);
|
|
11504
11523
|
this.lastOutputAt = now;
|
|
11505
11524
|
if (cleanData.trim()) this.lastNonEmptyOutputAt = now;
|
|
11506
11525
|
if (normalizedScreenSnapshot !== this.lastScreenSnapshot) {
|
|
@@ -11513,13 +11532,14 @@ var init_provider_cli_adapter = __esm({
|
|
|
11513
11532
|
if (this.idleFinishCandidate && (rawData.length > 0 || cleanData.length > 0)) {
|
|
11514
11533
|
this.clearIdleFinishCandidate("new_output");
|
|
11515
11534
|
}
|
|
11516
|
-
|
|
11517
|
-
|
|
11518
|
-
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11535
|
+
if (getDebugRuntimeConfig().collectDebugTrace) {
|
|
11536
|
+
this.recordTrace("output", {
|
|
11537
|
+
rawLength: rawData.length,
|
|
11538
|
+
cleanLength: cleanData.length,
|
|
11539
|
+
rawPreview: summarizeCliTraceText(rawData, 300),
|
|
11540
|
+
cleanPreview: summarizeCliTraceText(cleanData, 300)
|
|
11541
|
+
});
|
|
11542
|
+
}
|
|
11523
11543
|
if (this.startupParseGate) {
|
|
11524
11544
|
this.scheduleStartupSettleCheck();
|
|
11525
11545
|
}
|
|
@@ -12221,12 +12241,19 @@ var init_provider_cli_adapter = __esm({
|
|
|
12221
12241
|
* Called by command handler / dashboard for rich content rendering.
|
|
12222
12242
|
*/
|
|
12223
12243
|
getScriptParsedStatus() {
|
|
12244
|
+
const screenText = this.terminalScreen.getText();
|
|
12245
|
+
const cached2 = this.parsedStatusCache;
|
|
12246
|
+
if (cached2 && cached2.committedMessagesRef === this.committedMessages && cached2.responseBuffer === this.responseBuffer && cached2.currentTurnScope === this.currentTurnScope && cached2.recentOutputBuffer === this.recentOutputBuffer && cached2.accumulatedBuffer === this.accumulatedBuffer && cached2.accumulatedRawBuffer === this.accumulatedRawBuffer && cached2.screenText === screenText && cached2.currentStatus === this.currentStatus && cached2.activeModal === this.activeModal && cached2.cliName === this.cliName && cached2.lastOutputAt === this.lastOutputAt) {
|
|
12247
|
+
return cached2.result;
|
|
12248
|
+
}
|
|
12224
12249
|
const parsed = this.parseCurrentTranscript(
|
|
12225
12250
|
this.committedMessages,
|
|
12226
12251
|
this.responseBuffer,
|
|
12227
|
-
this.currentTurnScope
|
|
12252
|
+
this.currentTurnScope,
|
|
12253
|
+
screenText
|
|
12228
12254
|
);
|
|
12229
12255
|
const shouldPreferCommittedMessages = !this.currentTurnScope && this.currentStatus === "idle" && !this.activeModal;
|
|
12256
|
+
let result;
|
|
12230
12257
|
if (parsed && Array.isArray(parsed.messages)) {
|
|
12231
12258
|
const hydratedMessages = shouldPreferCommittedMessages ? this.committedMessages.map((message, index) => buildChatMessage({
|
|
12232
12259
|
...message,
|
|
@@ -12238,7 +12265,7 @@ var init_provider_cli_adapter = __esm({
|
|
|
12238
12265
|
scope: this.currentTurnScope,
|
|
12239
12266
|
lastOutputAt: this.lastOutputAt
|
|
12240
12267
|
});
|
|
12241
|
-
|
|
12268
|
+
result = {
|
|
12242
12269
|
id: parsed.id || "cli_session",
|
|
12243
12270
|
status: parsed.status || this.currentStatus,
|
|
12244
12271
|
title: parsed.title || this.cliName,
|
|
@@ -12246,20 +12273,36 @@ var init_provider_cli_adapter = __esm({
|
|
|
12246
12273
|
activeModal: parsed.activeModal ?? this.activeModal,
|
|
12247
12274
|
providerSessionId: typeof parsed.providerSessionId === "string" ? parsed.providerSessionId : void 0
|
|
12248
12275
|
};
|
|
12276
|
+
} else {
|
|
12277
|
+
const messages = [...this.committedMessages];
|
|
12278
|
+
result = {
|
|
12279
|
+
id: "cli_session",
|
|
12280
|
+
status: this.currentStatus,
|
|
12281
|
+
title: this.cliName,
|
|
12282
|
+
messages: messages.map((message, index) => buildChatMessage({
|
|
12283
|
+
...message,
|
|
12284
|
+
id: message.id || `msg_${index}`,
|
|
12285
|
+
index: typeof message.index === "number" ? message.index : index,
|
|
12286
|
+
receivedAt: typeof message.receivedAt === "number" ? message.receivedAt : message.timestamp
|
|
12287
|
+
})),
|
|
12288
|
+
activeModal: this.activeModal
|
|
12289
|
+
};
|
|
12249
12290
|
}
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
|
|
12253
|
-
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12291
|
+
this.parsedStatusCache = {
|
|
12292
|
+
committedMessagesRef: this.committedMessages,
|
|
12293
|
+
responseBuffer: this.responseBuffer,
|
|
12294
|
+
currentTurnScope: this.currentTurnScope,
|
|
12295
|
+
recentOutputBuffer: this.recentOutputBuffer,
|
|
12296
|
+
accumulatedBuffer: this.accumulatedBuffer,
|
|
12297
|
+
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
12298
|
+
screenText,
|
|
12299
|
+
currentStatus: this.currentStatus,
|
|
12300
|
+
activeModal: this.activeModal,
|
|
12301
|
+
cliName: this.cliName,
|
|
12302
|
+
lastOutputAt: this.lastOutputAt,
|
|
12303
|
+
result
|
|
12262
12304
|
};
|
|
12305
|
+
return result;
|
|
12263
12306
|
}
|
|
12264
12307
|
async invokeScript(scriptName, args) {
|
|
12265
12308
|
const fn = this.cliScripts?.[scriptName];
|
|
@@ -12282,17 +12325,18 @@ var init_provider_cli_adapter = __esm({
|
|
|
12282
12325
|
args: args && typeof args === "object" ? { ...args } : {}
|
|
12283
12326
|
}));
|
|
12284
12327
|
}
|
|
12285
|
-
parseCurrentTranscript(baseMessages, partialResponse, scope) {
|
|
12328
|
+
parseCurrentTranscript(baseMessages, partialResponse, scope, screenTextOverride) {
|
|
12286
12329
|
if (!this.cliScripts?.parseOutput) {
|
|
12287
12330
|
this.parseErrorMessage = null;
|
|
12288
12331
|
return null;
|
|
12289
12332
|
}
|
|
12290
12333
|
try {
|
|
12334
|
+
const screenText = typeof screenTextOverride === "string" ? screenTextOverride : this.terminalScreen.getText();
|
|
12291
12335
|
const input = buildCliParseInput({
|
|
12292
12336
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
12293
12337
|
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
12294
12338
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
12295
|
-
terminalScreenText:
|
|
12339
|
+
terminalScreenText: screenText,
|
|
12296
12340
|
baseMessages,
|
|
12297
12341
|
partialResponse,
|
|
12298
12342
|
isWaitingForResponse: this.isWaitingForResponse,
|
|
@@ -13062,6 +13106,7 @@ var init_cli_provider_instance = __esm({
|
|
|
13062
13106
|
}
|
|
13063
13107
|
async onTick() {
|
|
13064
13108
|
if (this.providerSessionId) return;
|
|
13109
|
+
if (this.type === "hermes-cli" && this.launchMode === "new") return;
|
|
13065
13110
|
let probedSessionId = null;
|
|
13066
13111
|
const probeConfig = this.provider.sessionProbe;
|
|
13067
13112
|
if (probeConfig) {
|
|
@@ -35840,6 +35885,8 @@ function buildStatusSnapshot(options) {
|
|
|
35840
35885
|
session.lastSeenAt = lastSeenAt;
|
|
35841
35886
|
session.unread = overlayUnread;
|
|
35842
35887
|
session.inboxBucket = overlayInboxBucket;
|
|
35888
|
+
session.completionMarker = completionMarker;
|
|
35889
|
+
session.seenCompletionMarker = seenCompletionMarker;
|
|
35843
35890
|
if (READ_DEBUG_ENABLED && (session.unread || session.inboxBucket !== "idle" || session.providerType.includes("codex"))) {
|
|
35844
35891
|
const recentReadSnapshot = {
|
|
35845
35892
|
sessionId: session.id,
|
|
@@ -45333,6 +45380,8 @@ var init_server_connection = __esm({
|
|
|
45333
45380
|
if (misses >= 3 && this.ws) {
|
|
45334
45381
|
LOG.warn("Server", `[ServerConn] Pong timeout (${misses}x) \u2014 closing stale WS`);
|
|
45335
45382
|
this.ws.terminate();
|
|
45383
|
+
} else if (misses === 1) {
|
|
45384
|
+
LOG.info("Server", `[ServerConn] Pong timeout (${misses}x) \u2014 keeping WS open and retrying`);
|
|
45336
45385
|
} else {
|
|
45337
45386
|
LOG.warn("Server", `[ServerConn] Pong timeout (${misses}x) \u2014 keeping WS open and retrying`);
|
|
45338
45387
|
}
|
|
@@ -54355,7 +54404,7 @@ var init_adhdev_daemon = __esm({
|
|
|
54355
54404
|
init_source2();
|
|
54356
54405
|
init_version();
|
|
54357
54406
|
init_src();
|
|
54358
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.
|
|
54407
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.83" });
|
|
54359
54408
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
54360
54409
|
localHttpServer = null;
|
|
54361
54410
|
localWss = null;
|