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/cli/index.js
CHANGED
|
@@ -8213,6 +8213,7 @@ async function handleReadChat(h, args) {
|
|
|
8213
8213
|
return { success: false, error: `${transport} adapter not found` };
|
|
8214
8214
|
}
|
|
8215
8215
|
if (isExtensionTransport(transport)) {
|
|
8216
|
+
let extensionReadChatError = "";
|
|
8216
8217
|
try {
|
|
8217
8218
|
const evalResult = await h.evaluateProviderScript("readChat", void 0, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS);
|
|
8218
8219
|
if (evalResult?.result) {
|
|
@@ -8220,7 +8221,8 @@ async function handleReadChat(h, args) {
|
|
|
8220
8221
|
if (typeof parsed === "string") {
|
|
8221
8222
|
try {
|
|
8222
8223
|
parsed = JSON.parse(parsed);
|
|
8223
|
-
} catch {
|
|
8224
|
+
} catch (e) {
|
|
8225
|
+
extensionReadChatError = `extension read_chat parse failed: ${e?.message || String(e)}`;
|
|
8224
8226
|
}
|
|
8225
8227
|
}
|
|
8226
8228
|
if (parsed && typeof parsed === "object") {
|
|
@@ -8245,8 +8247,14 @@ async function handleReadChat(h, args) {
|
|
|
8245
8247
|
);
|
|
8246
8248
|
return buildReadChatCommandResult(validated, args);
|
|
8247
8249
|
}
|
|
8250
|
+
if (!extensionReadChatError) {
|
|
8251
|
+
extensionReadChatError = "extension read_chat returned a non-object payload";
|
|
8252
|
+
}
|
|
8253
|
+
} else {
|
|
8254
|
+
extensionReadChatError = "extension read_chat returned no payload";
|
|
8248
8255
|
}
|
|
8249
8256
|
} catch (e) {
|
|
8257
|
+
extensionReadChatError = `extension read_chat failed: ${e?.message || String(e)}`;
|
|
8250
8258
|
_log(`Extension error: ${e.message}`);
|
|
8251
8259
|
traceProviderEvent(args, "provider", "extension.read_chat.error", {
|
|
8252
8260
|
h,
|
|
@@ -8260,8 +8268,8 @@ async function handleReadChat(h, args) {
|
|
|
8260
8268
|
const parentSessionId = h.currentSession?.parentSessionId;
|
|
8261
8269
|
if (cdp2 && parentSessionId) {
|
|
8262
8270
|
const stream = await h.agentStream.collectActiveSession(cdp2, parentSessionId);
|
|
8263
|
-
if (stream
|
|
8264
|
-
return
|
|
8271
|
+
if (stream && stream.agentType !== provider?.type) {
|
|
8272
|
+
return { success: false, error: `extension read_chat stream agent mismatch for ${provider?.type || "unknown_extension"}` };
|
|
8265
8273
|
}
|
|
8266
8274
|
if (stream) {
|
|
8267
8275
|
h.historyWriter.appendNewMessages(
|
|
@@ -8279,12 +8287,13 @@ async function handleReadChat(h, args) {
|
|
|
8279
8287
|
}
|
|
8280
8288
|
}
|
|
8281
8289
|
}
|
|
8282
|
-
return
|
|
8290
|
+
return { success: false, error: extensionReadChatError || "extension read_chat unavailable" };
|
|
8283
8291
|
}
|
|
8284
8292
|
const cdp = h.getCdp();
|
|
8285
8293
|
if (!cdp?.isConnected) return { success: false, error: "CDP not connected" };
|
|
8286
8294
|
const webviewScript = h.getProviderScript("webviewReadChat") || h.getProviderScript("webview_read_chat");
|
|
8287
8295
|
if (webviewScript) {
|
|
8296
|
+
let webviewReadChatError = "";
|
|
8288
8297
|
try {
|
|
8289
8298
|
const matchText = provider?.webviewMatchText;
|
|
8290
8299
|
const matchFn = matchText ? (body) => body.includes(matchText) : void 0;
|
|
@@ -8294,7 +8303,8 @@ async function handleReadChat(h, args) {
|
|
|
8294
8303
|
if (typeof parsed === "string") {
|
|
8295
8304
|
try {
|
|
8296
8305
|
parsed = JSON.parse(parsed);
|
|
8297
|
-
} catch {
|
|
8306
|
+
} catch (e) {
|
|
8307
|
+
webviewReadChatError = `webview read_chat parse failed: ${e?.message || String(e)}`;
|
|
8298
8308
|
}
|
|
8299
8309
|
}
|
|
8300
8310
|
if (parsed && typeof parsed === "object") {
|
|
@@ -8309,14 +8319,21 @@ async function handleReadChat(h, args) {
|
|
|
8309
8319
|
);
|
|
8310
8320
|
return buildReadChatCommandResult(validated, args);
|
|
8311
8321
|
}
|
|
8322
|
+
if (!webviewReadChatError) {
|
|
8323
|
+
webviewReadChatError = "webview read_chat returned a non-object payload";
|
|
8324
|
+
}
|
|
8325
|
+
} else {
|
|
8326
|
+
webviewReadChatError = "webview read_chat returned no payload";
|
|
8312
8327
|
}
|
|
8313
8328
|
} catch (e) {
|
|
8329
|
+
webviewReadChatError = `webview read_chat failed: ${e?.message || String(e)}`;
|
|
8314
8330
|
_log(`Webview readChat error: ${e.message}`);
|
|
8315
8331
|
}
|
|
8316
|
-
return
|
|
8332
|
+
return { success: false, error: webviewReadChatError || "webview read_chat unavailable" };
|
|
8317
8333
|
}
|
|
8318
8334
|
const script = h.getProviderScript("readChat") || h.getProviderScript("read_chat");
|
|
8319
8335
|
if (script) {
|
|
8336
|
+
let ideReadChatError = "";
|
|
8320
8337
|
try {
|
|
8321
8338
|
const evalResult = await h.evaluateProviderScript("readChat", void 0, READ_CHAT_PROVIDER_EVAL_TIMEOUT_MS);
|
|
8322
8339
|
if (evalResult?.result) {
|
|
@@ -8324,12 +8341,13 @@ async function handleReadChat(h, args) {
|
|
|
8324
8341
|
if (typeof parsed === "string") {
|
|
8325
8342
|
try {
|
|
8326
8343
|
parsed = JSON.parse(parsed);
|
|
8327
|
-
} catch {
|
|
8344
|
+
} catch (e) {
|
|
8345
|
+
ideReadChatError = `ide read_chat parse failed: ${e?.message || String(e)}`;
|
|
8328
8346
|
}
|
|
8329
8347
|
}
|
|
8330
|
-
if (parsed && typeof parsed === "object"
|
|
8348
|
+
if (parsed && typeof parsed === "object") {
|
|
8331
8349
|
const validated = validateReadChatResultPayload(parsed, "ide read_chat");
|
|
8332
|
-
_log(`OK: ${validated.messages?.length} msgs`);
|
|
8350
|
+
_log(`OK: ${validated.messages?.length || 0} msgs`);
|
|
8333
8351
|
traceProviderEvent(args, "provider", "ide.read_chat.success", {
|
|
8334
8352
|
h,
|
|
8335
8353
|
provider,
|
|
@@ -8349,8 +8367,14 @@ async function handleReadChat(h, args) {
|
|
|
8349
8367
|
);
|
|
8350
8368
|
return buildReadChatCommandResult(validated, args);
|
|
8351
8369
|
}
|
|
8370
|
+
if (!ideReadChatError) {
|
|
8371
|
+
ideReadChatError = "ide read_chat returned a non-object payload";
|
|
8372
|
+
}
|
|
8373
|
+
} else {
|
|
8374
|
+
ideReadChatError = "ide read_chat returned no payload";
|
|
8352
8375
|
}
|
|
8353
8376
|
} catch (e) {
|
|
8377
|
+
ideReadChatError = `ide read_chat failed: ${e?.message || String(e)}`;
|
|
8354
8378
|
LOG.info("Command", `[read_chat] Script error: ${e.message}`);
|
|
8355
8379
|
traceProviderEvent(args, "provider", "ide.read_chat.error", {
|
|
8356
8380
|
h,
|
|
@@ -8359,8 +8383,9 @@ async function handleReadChat(h, args) {
|
|
|
8359
8383
|
payload: { method: "evaluate", error: e.message }
|
|
8360
8384
|
});
|
|
8361
8385
|
}
|
|
8386
|
+
return { success: false, error: ideReadChatError || "ide read_chat unavailable" };
|
|
8362
8387
|
}
|
|
8363
|
-
return
|
|
8388
|
+
return { success: false, error: "read_chat unavailable" };
|
|
8364
8389
|
}
|
|
8365
8390
|
async function handleSendChat(h, args) {
|
|
8366
8391
|
const input = getSendChatInputEnvelope(args);
|
|
@@ -37947,7 +37972,11 @@ function buildAvailableProviders(providerLoader) {
|
|
|
37947
37972
|
icon: provider.icon || "\u{1F4BB}",
|
|
37948
37973
|
category: provider.category,
|
|
37949
37974
|
...provider.installed !== void 0 ? { installed: provider.installed } : {},
|
|
37950
|
-
...provider.detectedPath !== void 0 ? { detectedPath: provider.detectedPath } : {}
|
|
37975
|
+
...provider.detectedPath !== void 0 ? { detectedPath: provider.detectedPath } : {},
|
|
37976
|
+
...provider.enabled !== void 0 ? { enabled: provider.enabled } : {},
|
|
37977
|
+
...provider.machineStatus !== void 0 ? { machineStatus: provider.machineStatus } : {},
|
|
37978
|
+
...provider.lastDetection !== void 0 ? { lastDetection: provider.lastDetection } : {},
|
|
37979
|
+
...provider.lastVerification !== void 0 ? { lastVerification: provider.lastVerification } : {}
|
|
37951
37980
|
}));
|
|
37952
37981
|
}
|
|
37953
37982
|
function buildMachineInfo(profile = "full") {
|
|
@@ -87762,7 +87791,7 @@ var init_adhdev_daemon = __esm({
|
|
|
87762
87791
|
init_version();
|
|
87763
87792
|
init_src();
|
|
87764
87793
|
init_runtime_defaults();
|
|
87765
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.
|
|
87794
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.31" });
|
|
87766
87795
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
87767
87796
|
localHttpServer = null;
|
|
87768
87797
|
localWss = null;
|