@adhdev/daemon-core 0.9.23 → 0.9.25
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/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/dist/shared-types.d.ts +1 -0
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +5 -1
- package/src/cli-adapters/session-host-transport.ts +2 -2
- package/src/commands/handler.ts +1 -0
- package/src/commands/router.ts +6 -0
- package/src/shared-types.ts +1 -0
package/dist/shared-types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -2414,8 +2414,12 @@ export class ProviderCliAdapter implements CliAdapter {
|
|
|
2414
2414
|
if (buttonIndex in this.approvalKeys) {
|
|
2415
2415
|
this.ptyProcess.write(this.approvalKeys[buttonIndex]);
|
|
2416
2416
|
} else {
|
|
2417
|
+
const buttonCount = Array.isArray(modal?.buttons) ? modal.buttons.length : 0;
|
|
2418
|
+
const clampedIndex = buttonCount > 0
|
|
2419
|
+
? Math.min(Math.max(0, buttonIndex), buttonCount - 1)
|
|
2420
|
+
: Math.max(0, buttonIndex);
|
|
2417
2421
|
const DOWN = '\x1B[B';
|
|
2418
|
-
const keys = DOWN.repeat(
|
|
2422
|
+
const keys = DOWN.repeat(clampedIndex) + '\r';
|
|
2419
2423
|
this.ptyProcess.write(keys);
|
|
2420
2424
|
}
|
|
2421
2425
|
}
|
|
@@ -423,8 +423,8 @@ class SessionHostRuntimeTransport implements PtyRuntimeTransport {
|
|
|
423
423
|
} catch { /* noop */ }
|
|
424
424
|
try {
|
|
425
425
|
await this.client.close();
|
|
426
|
-
} catch {
|
|
427
|
-
if (destroy) throw new Error(`Failed to close session host client: ${this.options.runtimeId}`);
|
|
426
|
+
} catch (err) {
|
|
427
|
+
if (destroy) throw err instanceof Error ? err : new Error(`Failed to close session host client: ${this.options.runtimeId}`);
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
}
|
package/src/commands/handler.ts
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -356,6 +356,12 @@ export class DaemonCommandRouter {
|
|
|
356
356
|
if (logs.length > 0) {
|
|
357
357
|
return { success: true, logs, totalBuffered: logs.length };
|
|
358
358
|
}
|
|
359
|
+
// Incremental polling must not fall back to unfiltered file text: the file
|
|
360
|
+
// format is not timestamp-filterable, and returning its tail makes the UI
|
|
361
|
+
// replace structured logs with old raw fallback lines when nothing new exists.
|
|
362
|
+
if (sinceTs > 0) {
|
|
363
|
+
return { success: true, logs: [], totalBuffered: 0 };
|
|
364
|
+
}
|
|
359
365
|
// Priority 2: file fallback
|
|
360
366
|
if (fs.existsSync(LOG_PATH)) {
|
|
361
367
|
const content = fs.readFileSync(LOG_PATH, 'utf-8');
|