@adhdev/daemon-core 0.8.11 → 0.8.13

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.
@@ -325,6 +325,8 @@ export interface ProviderModule {
325
325
  };
326
326
  cleanOutput?: (raw: string, lastUserInput?: string) => string;
327
327
  resume?: ProviderResumeCapability;
328
+ /** Session ID probe config — auto-discovers provider session ID from local SQLite DB */
329
+ sessionProbe?: ProviderSessionProbe;
328
330
 
329
331
  // ─── CDP scripts (ide/extension category) ───
330
332
  scripts?: ProviderScripts;
@@ -398,12 +400,49 @@ export interface ProviderResumeCapability {
398
400
  stopStrategy?: 'command' | 'ctrl_c';
399
401
  stopCommand?: string;
400
402
  shutdownGraceMs?: number;
403
+ /** Delay (ms) between Ctrl+C interrupt and stop command (default 500ms) */
404
+ interruptGraceMs?: number;
401
405
  resumeArgs?: string[];
402
406
  resumeSessionArgs?: string[];
403
407
  newSessionArgs?: string[];
404
408
  sessionIdFormat?: 'uuid' | 'string';
405
409
  }
406
410
 
411
+ /**
412
+ * Declarative session ID probe config for CLI providers.
413
+ * Instead of hardcoded probe functions, providers declare their SQLite schema.
414
+ *
415
+ * Example (OpenCode):
416
+ * ```
417
+ * sessionProbe: {
418
+ * dbPath: '~/.local/share/opencode/opencode.db',
419
+ * query: 'SELECT id FROM session WHERE directory IN ({dirs}) AND time_created >= ? AND time_archived IS NULL ORDER BY time_updated DESC LIMIT 1',
420
+ * timestampFormat: 'unix_ms',
421
+ * }
422
+ * ```
423
+ */
424
+ export interface ProviderSessionProbe {
425
+ /**
426
+ * Path to SQLite database. Supports ~ for home directory.
427
+ * Supports platform-specific paths via {platform} placeholder.
428
+ */
429
+ dbPath: string;
430
+ /**
431
+ * SQL query to find the session ID.
432
+ * Use {dirs} placeholder for the directory IN-clause parameters.
433
+ * The query must SELECT a column named 'id'.
434
+ * A '?' placeholder after {dirs} receives the min-created-at timestamp.
435
+ */
436
+ query: string;
437
+ /**
438
+ * How the provider stores timestamps.
439
+ * - 'unix_ms': milliseconds since epoch (default)
440
+ * - 'unix_s': seconds since epoch
441
+ * - 'iso': ISO 8601 string (YYYY-MM-DD HH:MM:SS)
442
+ */
443
+ timestampFormat?: 'unix_ms' | 'unix_s' | 'iso';
444
+ }
445
+
407
446
  // ─── ACP Auth Types ─────────────────────────────────
408
447
 
409
448
  /** ACP auth method — based on ACP official spec */