adhdev 0.9.29 → 0.9.31
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 +41 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +41 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7693,6 +7693,7 @@ async function handleReadChat(h, args) {
|
|
|
7693
7693
|
return { success: false, error: `${transport} adapter not found` };
|
|
7694
7694
|
}
|
|
7695
7695
|
if (isExtensionTransport(transport)) {
|
|
7696
|
+
let extensionReadChatError = "";
|
|
7696
7697
|
try {
|
|
7697
7698
|
const evalResult = await h.evaluateProviderScript("readChat", void 0, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS);
|
|
7698
7699
|
if (evalResult?.result) {
|
|
@@ -7700,7 +7701,8 @@ async function handleReadChat(h, args) {
|
|
|
7700
7701
|
if (typeof parsed === "string") {
|
|
7701
7702
|
try {
|
|
7702
7703
|
parsed = JSON.parse(parsed);
|
|
7703
|
-
} catch {
|
|
7704
|
+
} catch (e) {
|
|
7705
|
+
extensionReadChatError = `extension read_chat parse failed: ${e?.message || String(e)}`;
|
|
7704
7706
|
}
|
|
7705
7707
|
}
|
|
7706
7708
|
if (parsed && typeof parsed === "object") {
|
|
@@ -7725,8 +7727,14 @@ async function handleReadChat(h, args) {
|
|
|
7725
7727
|
);
|
|
7726
7728
|
return buildReadChatCommandResult(validated, args);
|
|
7727
7729
|
}
|
|
7730
|
+
if (!extensionReadChatError) {
|
|
7731
|
+
extensionReadChatError = "extension read_chat returned a non-object payload";
|
|
7732
|
+
}
|
|
7733
|
+
} else {
|
|
7734
|
+
extensionReadChatError = "extension read_chat returned no payload";
|
|
7728
7735
|
}
|
|
7729
7736
|
} catch (e) {
|
|
7737
|
+
extensionReadChatError = `extension read_chat failed: ${e?.message || String(e)}`;
|
|
7730
7738
|
_log(`Extension error: ${e.message}`);
|
|
7731
7739
|
traceProviderEvent(args, "provider", "extension.read_chat.error", {
|
|
7732
7740
|
h,
|
|
@@ -7740,8 +7748,8 @@ async function handleReadChat(h, args) {
|
|
|
7740
7748
|
const parentSessionId = h.currentSession?.parentSessionId;
|
|
7741
7749
|
if (cdp2 && parentSessionId) {
|
|
7742
7750
|
const stream = await h.agentStream.collectActiveSession(cdp2, parentSessionId);
|
|
7743
|
-
if (stream
|
|
7744
|
-
return
|
|
7751
|
+
if (stream && stream.agentType !== provider?.type) {
|
|
7752
|
+
return { success: false, error: `extension read_chat stream agent mismatch for ${provider?.type || "unknown_extension"}` };
|
|
7745
7753
|
}
|
|
7746
7754
|
if (stream) {
|
|
7747
7755
|
h.historyWriter.appendNewMessages(
|
|
@@ -7759,12 +7767,13 @@ async function handleReadChat(h, args) {
|
|
|
7759
7767
|
}
|
|
7760
7768
|
}
|
|
7761
7769
|
}
|
|
7762
|
-
return
|
|
7770
|
+
return { success: false, error: extensionReadChatError || "extension read_chat unavailable" };
|
|
7763
7771
|
}
|
|
7764
7772
|
const cdp = h.getCdp();
|
|
7765
7773
|
if (!cdp?.isConnected) return { success: false, error: "CDP not connected" };
|
|
7766
7774
|
const webviewScript = h.getProviderScript("webviewReadChat") || h.getProviderScript("webview_read_chat");
|
|
7767
7775
|
if (webviewScript) {
|
|
7776
|
+
let webviewReadChatError = "";
|
|
7768
7777
|
try {
|
|
7769
7778
|
const matchText = provider?.webviewMatchText;
|
|
7770
7779
|
const matchFn = matchText ? (body) => body.includes(matchText) : void 0;
|
|
@@ -7774,7 +7783,8 @@ async function handleReadChat(h, args) {
|
|
|
7774
7783
|
if (typeof parsed === "string") {
|
|
7775
7784
|
try {
|
|
7776
7785
|
parsed = JSON.parse(parsed);
|
|
7777
|
-
} catch {
|
|
7786
|
+
} catch (e) {
|
|
7787
|
+
webviewReadChatError = `webview read_chat parse failed: ${e?.message || String(e)}`;
|
|
7778
7788
|
}
|
|
7779
7789
|
}
|
|
7780
7790
|
if (parsed && typeof parsed === "object") {
|
|
@@ -7789,14 +7799,21 @@ async function handleReadChat(h, args) {
|
|
|
7789
7799
|
);
|
|
7790
7800
|
return buildReadChatCommandResult(validated, args);
|
|
7791
7801
|
}
|
|
7802
|
+
if (!webviewReadChatError) {
|
|
7803
|
+
webviewReadChatError = "webview read_chat returned a non-object payload";
|
|
7804
|
+
}
|
|
7805
|
+
} else {
|
|
7806
|
+
webviewReadChatError = "webview read_chat returned no payload";
|
|
7792
7807
|
}
|
|
7793
7808
|
} catch (e) {
|
|
7809
|
+
webviewReadChatError = `webview read_chat failed: ${e?.message || String(e)}`;
|
|
7794
7810
|
_log(`Webview readChat error: ${e.message}`);
|
|
7795
7811
|
}
|
|
7796
|
-
return
|
|
7812
|
+
return { success: false, error: webviewReadChatError || "webview read_chat unavailable" };
|
|
7797
7813
|
}
|
|
7798
7814
|
const script = h.getProviderScript("readChat") || h.getProviderScript("read_chat");
|
|
7799
7815
|
if (script) {
|
|
7816
|
+
let ideReadChatError = "";
|
|
7800
7817
|
try {
|
|
7801
7818
|
const evalResult = await h.evaluateProviderScript("readChat", void 0, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS);
|
|
7802
7819
|
if (evalResult?.result) {
|
|
@@ -7804,12 +7821,13 @@ async function handleReadChat(h, args) {
|
|
|
7804
7821
|
if (typeof parsed === "string") {
|
|
7805
7822
|
try {
|
|
7806
7823
|
parsed = JSON.parse(parsed);
|
|
7807
|
-
} catch {
|
|
7824
|
+
} catch (e) {
|
|
7825
|
+
ideReadChatError = `ide read_chat parse failed: ${e?.message || String(e)}`;
|
|
7808
7826
|
}
|
|
7809
7827
|
}
|
|
7810
|
-
if (parsed && typeof parsed === "object"
|
|
7828
|
+
if (parsed && typeof parsed === "object") {
|
|
7811
7829
|
const validated = validateReadChatResultPayload(parsed, "ide read_chat");
|
|
7812
|
-
_log(`OK: ${validated.messages?.length} msgs`);
|
|
7830
|
+
_log(`OK: ${validated.messages?.length || 0} msgs`);
|
|
7813
7831
|
traceProviderEvent(args, "provider", "ide.read_chat.success", {
|
|
7814
7832
|
h,
|
|
7815
7833
|
provider,
|
|
@@ -7829,8 +7847,14 @@ async function handleReadChat(h, args) {
|
|
|
7829
7847
|
);
|
|
7830
7848
|
return buildReadChatCommandResult(validated, args);
|
|
7831
7849
|
}
|
|
7850
|
+
if (!ideReadChatError) {
|
|
7851
|
+
ideReadChatError = "ide read_chat returned a non-object payload";
|
|
7852
|
+
}
|
|
7853
|
+
} else {
|
|
7854
|
+
ideReadChatError = "ide read_chat returned no payload";
|
|
7832
7855
|
}
|
|
7833
7856
|
} catch (e) {
|
|
7857
|
+
ideReadChatError = `ide read_chat failed: ${e?.message || String(e)}`;
|
|
7834
7858
|
LOG.info("Command", `[read_chat] Script error: ${e.message}`);
|
|
7835
7859
|
traceProviderEvent(args, "provider", "ide.read_chat.error", {
|
|
7836
7860
|
h,
|
|
@@ -7839,8 +7863,9 @@ async function handleReadChat(h, args) {
|
|
|
7839
7863
|
payload: { method: "evaluate", error: e.message }
|
|
7840
7864
|
});
|
|
7841
7865
|
}
|
|
7866
|
+
return { success: false, error: ideReadChatError || "ide read_chat unavailable" };
|
|
7842
7867
|
}
|
|
7843
|
-
return
|
|
7868
|
+
return { success: false, error: "read_chat unavailable" };
|
|
7844
7869
|
}
|
|
7845
7870
|
async function handleSendChat(h, args) {
|
|
7846
7871
|
const input = getSendChatInputEnvelope(args);
|
|
@@ -36991,7 +37016,11 @@ function buildAvailableProviders(providerLoader) {
|
|
|
36991
37016
|
icon: provider.icon || "\u{1F4BB}",
|
|
36992
37017
|
category: provider.category,
|
|
36993
37018
|
...provider.installed !== void 0 ? { installed: provider.installed } : {},
|
|
36994
|
-
...provider.detectedPath !== void 0 ? { detectedPath: provider.detectedPath } : {}
|
|
37019
|
+
...provider.detectedPath !== void 0 ? { detectedPath: provider.detectedPath } : {},
|
|
37020
|
+
...provider.enabled !== void 0 ? { enabled: provider.enabled } : {},
|
|
37021
|
+
...provider.machineStatus !== void 0 ? { machineStatus: provider.machineStatus } : {},
|
|
37022
|
+
...provider.lastDetection !== void 0 ? { lastDetection: provider.lastDetection } : {},
|
|
37023
|
+
...provider.lastVerification !== void 0 ? { lastVerification: provider.lastVerification } : {}
|
|
36995
37024
|
}));
|
|
36996
37025
|
}
|
|
36997
37026
|
function buildMachineInfo(profile = "full") {
|
|
@@ -56042,7 +56071,7 @@ var init_adhdev_daemon = __esm({
|
|
|
56042
56071
|
init_version();
|
|
56043
56072
|
init_src();
|
|
56044
56073
|
init_runtime_defaults();
|
|
56045
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.
|
|
56074
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.31" });
|
|
56046
56075
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
56047
56076
|
localHttpServer = null;
|
|
56048
56077
|
localWss = null;
|