adhdev 0.8.98 → 0.8.100
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 +257 -46
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +257 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.d.mts +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.d.ts +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.js +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.js.map +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.mjs +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/defaults.mjs.map +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.js +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.js.map +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.mjs +1 -1
- package/vendor/session-host-daemon/node_modules/@adhdev/session-host-core/index.mjs.map +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.d.mts +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.d.ts +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.js +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.js.map +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.mjs +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/defaults.mjs.map +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.js +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.js.map +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.mjs +1 -1
- package/vendor/terminal-mux-cli/node_modules/@adhdev/session-host-core/index.mjs.map +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1259,6 +1259,9 @@ function normalizeProviderSessionId(providerType, providerSessionId) {
|
|
|
1259
1259
|
if (normalizedProviderType === "hermes-cli" && !HERMES_SESSION_ID_RE.test(normalizedId)) {
|
|
1260
1260
|
return "";
|
|
1261
1261
|
}
|
|
1262
|
+
if (normalizedProviderType === "claude-cli" && !CLAUDE_SESSION_ID_RE.test(normalizedId)) {
|
|
1263
|
+
return "";
|
|
1264
|
+
}
|
|
1262
1265
|
return normalizedId;
|
|
1263
1266
|
}
|
|
1264
1267
|
function isLegacyVolatileSessionReadKey(key) {
|
|
@@ -1266,11 +1269,12 @@ function isLegacyVolatileSessionReadKey(key) {
|
|
|
1266
1269
|
if (!normalizedKey) return false;
|
|
1267
1270
|
return normalizedKey.startsWith("provider:codex:vscode-webview://");
|
|
1268
1271
|
}
|
|
1269
|
-
var HERMES_SESSION_ID_RE;
|
|
1272
|
+
var HERMES_SESSION_ID_RE, CLAUDE_SESSION_ID_RE;
|
|
1270
1273
|
var init_provider_session_id = __esm({
|
|
1271
1274
|
"../../oss/packages/daemon-core/src/providers/provider-session-id.ts"() {
|
|
1272
1275
|
"use strict";
|
|
1273
1276
|
HERMES_SESSION_ID_RE = /^\d{8}_\d{6}_[a-z0-9]+$/i;
|
|
1277
|
+
CLAUDE_SESSION_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
1274
1278
|
}
|
|
1275
1279
|
});
|
|
1276
1280
|
|
|
@@ -4677,9 +4681,16 @@ function extractCanonicalHermesMessageTimestamp(message, fallbackTs) {
|
|
|
4677
4681
|
if (Number.isFinite(stringTimestamp) && stringTimestamp > 0) return stringTimestamp;
|
|
4678
4682
|
return fallbackTs;
|
|
4679
4683
|
}
|
|
4680
|
-
function
|
|
4684
|
+
function extractTimestampValue(value) {
|
|
4685
|
+
const numericTimestamp = Number(value || 0);
|
|
4686
|
+
if (Number.isFinite(numericTimestamp) && numericTimestamp > 0) return numericTimestamp;
|
|
4687
|
+
const stringTimestamp = typeof value === "string" ? Date.parse(value) : NaN;
|
|
4688
|
+
if (Number.isFinite(stringTimestamp) && stringTimestamp > 0) return stringTimestamp;
|
|
4689
|
+
return 0;
|
|
4690
|
+
}
|
|
4691
|
+
function readExistingSessionStartRecord(agentType, historySessionId) {
|
|
4681
4692
|
try {
|
|
4682
|
-
const dir = path7.join(HISTORY_DIR,
|
|
4693
|
+
const dir = path7.join(HISTORY_DIR, agentType);
|
|
4683
4694
|
if (!fs3.existsSync(dir)) return null;
|
|
4684
4695
|
const files = listHistoryFiles(dir, historySessionId).sort();
|
|
4685
4696
|
for (const file2 of files) {
|
|
@@ -4700,6 +4711,28 @@ function readExistingHermesSessionStartRecord(historySessionId) {
|
|
|
4700
4711
|
return null;
|
|
4701
4712
|
}
|
|
4702
4713
|
}
|
|
4714
|
+
function rewriteCanonicalSavedHistory(agentType, historySessionId, records) {
|
|
4715
|
+
if (records.length === 0) return false;
|
|
4716
|
+
try {
|
|
4717
|
+
const dir = path7.join(HISTORY_DIR, agentType);
|
|
4718
|
+
fs3.mkdirSync(dir, { recursive: true });
|
|
4719
|
+
const prefix = `${historySessionId.replace(/[^a-zA-Z0-9_-]/g, "_")}_`;
|
|
4720
|
+
for (const file2 of fs3.readdirSync(dir)) {
|
|
4721
|
+
if (file2.startsWith(prefix) && file2.endsWith(".jsonl")) {
|
|
4722
|
+
fs3.unlinkSync(path7.join(dir, file2));
|
|
4723
|
+
}
|
|
4724
|
+
}
|
|
4725
|
+
const targetDate = new Date(records[records.length - 1].receivedAt || Date.now()).toISOString().slice(0, 10);
|
|
4726
|
+
const filePath = path7.join(dir, `${prefix}${targetDate}.jsonl`);
|
|
4727
|
+
fs3.writeFileSync(filePath, `${records.map((record2) => JSON.stringify(record2)).join("\n")}
|
|
4728
|
+
`, "utf-8");
|
|
4729
|
+
invalidatePersistedSavedHistoryIndex(agentType, dir);
|
|
4730
|
+
savedHistorySessionCache.delete(agentType.replace(/[^a-zA-Z0-9_-]/g, "_"));
|
|
4731
|
+
return true;
|
|
4732
|
+
} catch {
|
|
4733
|
+
return false;
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4703
4736
|
function rebuildHermesSavedHistoryFromCanonicalSession(historySessionId) {
|
|
4704
4737
|
const normalizedSessionId = normalizeSavedHistorySessionId("hermes-cli", historySessionId);
|
|
4705
4738
|
if (!normalizedSessionId) return false;
|
|
@@ -4710,7 +4743,7 @@ function rebuildHermesSavedHistoryFromCanonicalSession(historySessionId) {
|
|
|
4710
4743
|
const canonicalMessages = Array.isArray(raw.messages) ? raw.messages : [];
|
|
4711
4744
|
const dir = path7.join(HISTORY_DIR, "hermes-cli");
|
|
4712
4745
|
fs3.mkdirSync(dir, { recursive: true });
|
|
4713
|
-
const existingSessionStart =
|
|
4746
|
+
const existingSessionStart = readExistingSessionStartRecord("hermes-cli", normalizedSessionId);
|
|
4714
4747
|
const records = [];
|
|
4715
4748
|
if (existingSessionStart) {
|
|
4716
4749
|
records.push({
|
|
@@ -4762,20 +4795,167 @@ function rebuildHermesSavedHistoryFromCanonicalSession(historySessionId) {
|
|
|
4762
4795
|
});
|
|
4763
4796
|
}
|
|
4764
4797
|
}
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4798
|
+
return rewriteCanonicalSavedHistory("hermes-cli", normalizedSessionId, records);
|
|
4799
|
+
} catch {
|
|
4800
|
+
return false;
|
|
4801
|
+
}
|
|
4802
|
+
}
|
|
4803
|
+
function resolveClaudeProjectTranscriptPath(historySessionId, workspace) {
|
|
4804
|
+
const claudeProjectsDir = path7.join(os6.homedir(), ".claude", "projects");
|
|
4805
|
+
if (!fs3.existsSync(claudeProjectsDir)) return null;
|
|
4806
|
+
const normalizedWorkspace = typeof workspace === "string" ? workspace.trim() : "";
|
|
4807
|
+
if (normalizedWorkspace) {
|
|
4808
|
+
const directPath = path7.join(claudeProjectsDir, normalizedWorkspace.replace(/[\\/]/g, "-"), `${historySessionId}.jsonl`);
|
|
4809
|
+
if (fs3.existsSync(directPath)) return directPath;
|
|
4810
|
+
}
|
|
4811
|
+
const stack = [claudeProjectsDir];
|
|
4812
|
+
while (stack.length > 0) {
|
|
4813
|
+
const current = stack.pop();
|
|
4814
|
+
if (!current) continue;
|
|
4815
|
+
for (const entry of fs3.readdirSync(current, { withFileTypes: true })) {
|
|
4816
|
+
const entryPath = path7.join(current, entry.name);
|
|
4817
|
+
if (entry.isDirectory()) {
|
|
4818
|
+
stack.push(entryPath);
|
|
4819
|
+
continue;
|
|
4820
|
+
}
|
|
4821
|
+
if (entry.isFile() && entry.name === `${historySessionId}.jsonl`) {
|
|
4822
|
+
return entryPath;
|
|
4770
4823
|
}
|
|
4771
4824
|
}
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
return
|
|
4825
|
+
}
|
|
4826
|
+
return null;
|
|
4827
|
+
}
|
|
4828
|
+
function extractClaudeAssistantContentParts(content) {
|
|
4829
|
+
if (typeof content === "string") {
|
|
4830
|
+
const trimmed = content.trim();
|
|
4831
|
+
return trimmed ? [{ content: trimmed, kind: "standard", role: "assistant" }] : [];
|
|
4832
|
+
}
|
|
4833
|
+
if (!Array.isArray(content)) return [];
|
|
4834
|
+
const parts = [];
|
|
4835
|
+
for (const block of content) {
|
|
4836
|
+
if (!block || typeof block !== "object") continue;
|
|
4837
|
+
const record2 = block;
|
|
4838
|
+
const type = String(record2.type || "").trim();
|
|
4839
|
+
if (type === "text") {
|
|
4840
|
+
const text = String(record2.text || "").trim();
|
|
4841
|
+
if (text) parts.push({ content: text, kind: "standard", role: "assistant" });
|
|
4842
|
+
continue;
|
|
4843
|
+
}
|
|
4844
|
+
if (type === "tool_use") {
|
|
4845
|
+
const name = String(record2.name || "").trim() || "Tool";
|
|
4846
|
+
const input = record2.input && typeof record2.input === "object" ? record2.input : null;
|
|
4847
|
+
const command = input ? String(input.command || "").trim() : "";
|
|
4848
|
+
const summary = command ? `${name}: ${command}` : name;
|
|
4849
|
+
if (summary) parts.push({ content: summary, kind: "tool", senderName: "Tool", role: "assistant" });
|
|
4850
|
+
}
|
|
4851
|
+
}
|
|
4852
|
+
return parts;
|
|
4853
|
+
}
|
|
4854
|
+
function extractClaudeUserContentParts(content) {
|
|
4855
|
+
if (typeof content === "string") {
|
|
4856
|
+
const trimmed = content.trim();
|
|
4857
|
+
return trimmed ? [{ role: "user", content: trimmed, kind: "standard" }] : [];
|
|
4858
|
+
}
|
|
4859
|
+
if (!Array.isArray(content)) return [];
|
|
4860
|
+
const parts = [];
|
|
4861
|
+
for (const block of content) {
|
|
4862
|
+
if (!block || typeof block !== "object") continue;
|
|
4863
|
+
const record2 = block;
|
|
4864
|
+
const type = String(record2.type || "").trim();
|
|
4865
|
+
if (type === "text") {
|
|
4866
|
+
const text = String(record2.text || "").trim();
|
|
4867
|
+
if (text) parts.push({ role: "user", content: text, kind: "standard" });
|
|
4868
|
+
continue;
|
|
4869
|
+
}
|
|
4870
|
+
if (type === "tool_result") {
|
|
4871
|
+
const rawContent = record2.content;
|
|
4872
|
+
const text = typeof rawContent === "string" ? rawContent.trim() : Array.isArray(rawContent) ? rawContent.map((entry) => {
|
|
4873
|
+
if (typeof entry === "string") return entry.trim();
|
|
4874
|
+
if (!entry || typeof entry !== "object") return "";
|
|
4875
|
+
const nested = entry;
|
|
4876
|
+
if (typeof nested.text === "string") return nested.text.trim();
|
|
4877
|
+
if (typeof nested.content === "string") return nested.content.trim();
|
|
4878
|
+
return "";
|
|
4879
|
+
}).filter(Boolean).join("\n") : "";
|
|
4880
|
+
if (text) parts.push({ role: "assistant", content: text, kind: "tool", senderName: "Tool" });
|
|
4881
|
+
}
|
|
4882
|
+
}
|
|
4883
|
+
return parts;
|
|
4884
|
+
}
|
|
4885
|
+
function rebuildClaudeSavedHistoryFromNativeProject(historySessionId, workspace) {
|
|
4886
|
+
const normalizedSessionId = normalizeSavedHistorySessionId("claude-cli", historySessionId);
|
|
4887
|
+
if (!normalizedSessionId) return false;
|
|
4888
|
+
try {
|
|
4889
|
+
const transcriptPath = resolveClaudeProjectTranscriptPath(normalizedSessionId, workspace);
|
|
4890
|
+
if (!transcriptPath) return false;
|
|
4891
|
+
const lines = fs3.readFileSync(transcriptPath, "utf-8").split("\n").filter(Boolean);
|
|
4892
|
+
const records = [];
|
|
4893
|
+
const existingSessionStart = readExistingSessionStartRecord("claude-cli", normalizedSessionId);
|
|
4894
|
+
if (existingSessionStart) {
|
|
4895
|
+
records.push({
|
|
4896
|
+
...existingSessionStart,
|
|
4897
|
+
historySessionId: normalizedSessionId
|
|
4898
|
+
});
|
|
4899
|
+
}
|
|
4900
|
+
let fallbackTs = Date.now();
|
|
4901
|
+
for (const line of lines) {
|
|
4902
|
+
let parsed = null;
|
|
4903
|
+
try {
|
|
4904
|
+
parsed = JSON.parse(line);
|
|
4905
|
+
} catch {
|
|
4906
|
+
parsed = null;
|
|
4907
|
+
}
|
|
4908
|
+
if (!parsed) continue;
|
|
4909
|
+
const parsedSessionId = String(parsed.sessionId || "").trim();
|
|
4910
|
+
if (parsedSessionId && parsedSessionId !== normalizedSessionId) continue;
|
|
4911
|
+
const receivedAt = extractTimestampValue(parsed.timestamp) || fallbackTs;
|
|
4912
|
+
fallbackTs = receivedAt + 1;
|
|
4913
|
+
const parsedWorkspace = String(parsed.cwd || workspace || "").trim();
|
|
4914
|
+
if (records.length === 0 && parsedWorkspace) {
|
|
4915
|
+
records.push({
|
|
4916
|
+
ts: new Date(receivedAt).toISOString(),
|
|
4917
|
+
receivedAt,
|
|
4918
|
+
role: "system",
|
|
4919
|
+
kind: "session_start",
|
|
4920
|
+
content: parsedWorkspace,
|
|
4921
|
+
agent: "claude-cli",
|
|
4922
|
+
historySessionId: normalizedSessionId,
|
|
4923
|
+
workspace: parsedWorkspace
|
|
4924
|
+
});
|
|
4925
|
+
}
|
|
4926
|
+
const type = String(parsed.type || "").trim();
|
|
4927
|
+
const message = parsed.message && typeof parsed.message === "object" ? parsed.message : null;
|
|
4928
|
+
if (type === "user" && message) {
|
|
4929
|
+
for (const part of extractClaudeUserContentParts(message.content)) {
|
|
4930
|
+
records.push({
|
|
4931
|
+
ts: new Date(receivedAt).toISOString(),
|
|
4932
|
+
receivedAt,
|
|
4933
|
+
role: part.role,
|
|
4934
|
+
content: part.content,
|
|
4935
|
+
kind: part.kind,
|
|
4936
|
+
senderName: part.senderName,
|
|
4937
|
+
agent: "claude-cli",
|
|
4938
|
+
historySessionId: normalizedSessionId
|
|
4939
|
+
});
|
|
4940
|
+
}
|
|
4941
|
+
continue;
|
|
4942
|
+
}
|
|
4943
|
+
if (type === "assistant" && message) {
|
|
4944
|
+
for (const part of extractClaudeAssistantContentParts(message.content)) {
|
|
4945
|
+
records.push({
|
|
4946
|
+
ts: new Date(receivedAt).toISOString(),
|
|
4947
|
+
receivedAt,
|
|
4948
|
+
role: "assistant",
|
|
4949
|
+
content: part.content,
|
|
4950
|
+
kind: part.kind,
|
|
4951
|
+
senderName: part.senderName,
|
|
4952
|
+
agent: "claude-cli",
|
|
4953
|
+
historySessionId: normalizedSessionId
|
|
4954
|
+
});
|
|
4955
|
+
}
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
return rewriteCanonicalSavedHistory("claude-cli", normalizedSessionId, records);
|
|
4779
4959
|
} catch {
|
|
4780
4960
|
return false;
|
|
4781
4961
|
}
|
|
@@ -11372,7 +11552,7 @@ var init_dist = __esm({
|
|
|
11372
11552
|
}
|
|
11373
11553
|
};
|
|
11374
11554
|
DEFAULT_SESSION_HOST_COLS = 80;
|
|
11375
|
-
DEFAULT_SESSION_HOST_ROWS =
|
|
11555
|
+
DEFAULT_SESSION_HOST_ROWS = 32;
|
|
11376
11556
|
LIVE_LIFECYCLES2 = /* @__PURE__ */ new Set(["starting", "running", "stopping", "interrupted"]);
|
|
11377
11557
|
SessionHostRegistry = class {
|
|
11378
11558
|
sessions = /* @__PURE__ */ new Map();
|
|
@@ -14657,7 +14837,7 @@ var init_cli_provider_instance = __esm({
|
|
|
14657
14837
|
parsedMessages = historyMessageCount > 0 ? parsedMessages.slice(-historyMessageCount) : [];
|
|
14658
14838
|
}
|
|
14659
14839
|
const mergedMessages = this.mergeConversationMessages(parsedMessages);
|
|
14660
|
-
const
|
|
14840
|
+
const canonicalBackedHistory = this.syncCanonicalSavedHistoryIfNeeded();
|
|
14661
14841
|
const dirName = this.workingDir.split("/").filter(Boolean).pop() || "session";
|
|
14662
14842
|
if (parsedMessages.length > 0) {
|
|
14663
14843
|
const shouldSkipReplayPersist = this.suppressIdleHistoryReplay && adapterStatus.status === "idle" && parsedStatus?.status === "idle";
|
|
@@ -14675,7 +14855,7 @@ var init_cli_provider_instance = __esm({
|
|
|
14675
14855
|
senderName: typeof message.senderName === "string" ? message.senderName : void 0,
|
|
14676
14856
|
receivedAt: typeof message.receivedAt === "number" ? message.receivedAt : message.timestamp
|
|
14677
14857
|
}));
|
|
14678
|
-
if (!
|
|
14858
|
+
if (!canonicalBackedHistory && !shouldSkipReplayPersist && normalizedMessagesToSave.length > 0) {
|
|
14679
14859
|
const incrementalMessages = buildIncrementalHistoryAppendMessages(this.lastPersistedHistoryMessages, normalizedMessagesToSave);
|
|
14680
14860
|
this.historyWriter.appendNewMessages(
|
|
14681
14861
|
this.type,
|
|
@@ -14685,7 +14865,7 @@ var init_cli_provider_instance = __esm({
|
|
|
14685
14865
|
this.providerSessionId
|
|
14686
14866
|
);
|
|
14687
14867
|
}
|
|
14688
|
-
if (!
|
|
14868
|
+
if (!canonicalBackedHistory) {
|
|
14689
14869
|
this.lastPersistedHistoryMessages = normalizedMessagesToSave;
|
|
14690
14870
|
}
|
|
14691
14871
|
}
|
|
@@ -15040,7 +15220,14 @@ ${effect.notification.body || ""}`.trim();
|
|
|
15040
15220
|
return this.provider.name;
|
|
15041
15221
|
}
|
|
15042
15222
|
shouldAutoApprove() {
|
|
15043
|
-
|
|
15223
|
+
if (typeof this.settings.autoApprove === "boolean") {
|
|
15224
|
+
return this.settings.autoApprove;
|
|
15225
|
+
}
|
|
15226
|
+
const providerDefault = this.provider.settings?.autoApprove?.default;
|
|
15227
|
+
if (typeof providerDefault === "boolean") {
|
|
15228
|
+
return providerDefault;
|
|
15229
|
+
}
|
|
15230
|
+
return false;
|
|
15044
15231
|
}
|
|
15045
15232
|
recordAutoApproval(modalMessage, buttonLabel, now = Date.now()) {
|
|
15046
15233
|
this.appendRuntimeSystemMessage(
|
|
@@ -15162,32 +15349,52 @@ ${effect.notification.body || ""}`.trim();
|
|
|
15162
15349
|
});
|
|
15163
15350
|
LOG.info("CLI", `[${this.type}] discovered provider session id: ${nextSessionId}`);
|
|
15164
15351
|
}
|
|
15165
|
-
|
|
15166
|
-
if (
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
|
|
15172
|
-
|
|
15173
|
-
|
|
15174
|
-
|
|
15175
|
-
|
|
15176
|
-
|
|
15177
|
-
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15352
|
+
syncCanonicalSavedHistoryIfNeeded() {
|
|
15353
|
+
if (!this.providerSessionId) return false;
|
|
15354
|
+
if (this.type === "hermes-cli") {
|
|
15355
|
+
try {
|
|
15356
|
+
const canonicalPath = path12.join(os14.homedir(), ".hermes", "sessions", `session_${this.providerSessionId}.json`);
|
|
15357
|
+
if (!fs5.existsSync(canonicalPath)) return false;
|
|
15358
|
+
const stat4 = fs5.statSync(canonicalPath);
|
|
15359
|
+
if (stat4.mtimeMs <= this.lastCanonicalHermesSyncMtimeMs) return true;
|
|
15360
|
+
const rebuilt = rebuildHermesSavedHistoryFromCanonicalSession(this.providerSessionId);
|
|
15361
|
+
if (!rebuilt) return false;
|
|
15362
|
+
this.lastCanonicalHermesSyncMtimeMs = stat4.mtimeMs;
|
|
15363
|
+
const restoredHistory = readChatHistory(this.type, 0, Number.MAX_SAFE_INTEGER, this.providerSessionId);
|
|
15364
|
+
this.lastPersistedHistoryMessages = restoredHistory.messages.map((message) => ({
|
|
15365
|
+
role: message.role,
|
|
15366
|
+
content: message.content,
|
|
15367
|
+
kind: message.kind,
|
|
15368
|
+
senderName: message.senderName,
|
|
15369
|
+
receivedAt: message.receivedAt
|
|
15370
|
+
}));
|
|
15371
|
+
return true;
|
|
15372
|
+
} catch {
|
|
15373
|
+
return false;
|
|
15374
|
+
}
|
|
15186
15375
|
}
|
|
15376
|
+
if (this.type === "claude-cli") {
|
|
15377
|
+
try {
|
|
15378
|
+
const rebuilt = rebuildClaudeSavedHistoryFromNativeProject(this.providerSessionId, this.workingDir);
|
|
15379
|
+
if (!rebuilt) return false;
|
|
15380
|
+
const restoredHistory = readChatHistory(this.type, 0, Number.MAX_SAFE_INTEGER, this.providerSessionId);
|
|
15381
|
+
this.lastPersistedHistoryMessages = restoredHistory.messages.map((message) => ({
|
|
15382
|
+
role: message.role,
|
|
15383
|
+
content: message.content,
|
|
15384
|
+
kind: message.kind,
|
|
15385
|
+
senderName: message.senderName,
|
|
15386
|
+
receivedAt: message.receivedAt
|
|
15387
|
+
}));
|
|
15388
|
+
return true;
|
|
15389
|
+
} catch {
|
|
15390
|
+
return false;
|
|
15391
|
+
}
|
|
15392
|
+
}
|
|
15393
|
+
return false;
|
|
15187
15394
|
}
|
|
15188
15395
|
restorePersistedHistoryFromCurrentSession() {
|
|
15189
15396
|
if (!this.providerSessionId) return;
|
|
15190
|
-
this.
|
|
15397
|
+
this.syncCanonicalSavedHistoryIfNeeded();
|
|
15191
15398
|
this.historyWriter.compactHistorySession(this.type, this.providerSessionId);
|
|
15192
15399
|
const restoredHistory = readChatHistory(this.type, 0, Number.MAX_SAFE_INTEGER, this.providerSessionId);
|
|
15193
15400
|
this.historyWriter.seedSessionHistory(
|
|
@@ -38921,9 +39128,12 @@ function prepareSessionChatTailUpdate(input) {
|
|
|
38921
39128
|
}
|
|
38922
39129
|
function prepareSessionModalUpdate(input) {
|
|
38923
39130
|
const { modalMessage, modalButtons } = normalizeSessionModalFields(input.activeModal);
|
|
39131
|
+
const status = normalizeManagedStatus(input.status, {
|
|
39132
|
+
activeModal: modalButtons.length > 0 ? { buttons: modalButtons } : null
|
|
39133
|
+
});
|
|
38924
39134
|
const deliverySignature = buildSessionModalDeliverySignature({
|
|
38925
39135
|
sessionId: input.sessionId,
|
|
38926
|
-
status
|
|
39136
|
+
status,
|
|
38927
39137
|
...input.title ? { title: input.title } : {},
|
|
38928
39138
|
...modalMessage ? { modalMessage } : {},
|
|
38929
39139
|
...modalButtons.length > 0 ? { modalButtons } : {}
|
|
@@ -38943,7 +39153,7 @@ function prepareSessionModalUpdate(input) {
|
|
|
38943
39153
|
topic: "session.modal",
|
|
38944
39154
|
key: input.key,
|
|
38945
39155
|
sessionId: input.sessionId,
|
|
38946
|
-
status
|
|
39156
|
+
status,
|
|
38947
39157
|
...input.title ? { title: input.title } : {},
|
|
38948
39158
|
...modalMessage ? { modalMessage } : {},
|
|
38949
39159
|
...modalButtons.length > 0 ? { modalButtons } : {},
|
|
@@ -38957,6 +39167,7 @@ var init_subscription_updates = __esm({
|
|
|
38957
39167
|
"../../oss/packages/daemon-core/src/chat/subscription-updates.ts"() {
|
|
38958
39168
|
"use strict";
|
|
38959
39169
|
init_chat_signatures();
|
|
39170
|
+
init_normalize();
|
|
38960
39171
|
}
|
|
38961
39172
|
});
|
|
38962
39173
|
|
|
@@ -86850,7 +87061,7 @@ var init_adhdev_daemon = __esm({
|
|
|
86850
87061
|
init_version();
|
|
86851
87062
|
init_src();
|
|
86852
87063
|
init_runtime_defaults();
|
|
86853
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.
|
|
87064
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.100" });
|
|
86854
87065
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
86855
87066
|
localHttpServer = null;
|
|
86856
87067
|
localWss = null;
|