@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.
- package/dist/cli-adapters/spawn-env.d.ts +8 -0
- package/dist/cli-adapters/terminal-screen.d.ts +5 -3
- package/dist/detection/cli-detector.d.ts +1 -1
- package/dist/index.js +305 -187
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +307 -186
- package/dist/index.mjs.map +1 -1
- package/dist/providers/cli-provider-instance.d.ts +5 -3
- package/dist/providers/contracts.d.ts +38 -0
- package/node_modules/@adhdev/session-host-core/dist/index.d.mts +30 -1
- package/node_modules/@adhdev/session-host-core/dist/index.d.ts +30 -1
- package/node_modules/@adhdev/session-host-core/dist/index.js +73 -6
- package/node_modules/@adhdev/session-host-core/dist/index.js.map +1 -1
- package/node_modules/@adhdev/session-host-core/dist/index.mjs +77 -6
- package/node_modules/@adhdev/session-host-core/dist/index.mjs.map +1 -1
- package/node_modules/@adhdev/session-host-core/package.json +1 -1
- package/package.json +1 -1
- package/src/cli-adapters/provider-cli-adapter.ts +27 -48
- package/src/cli-adapters/pty-transport.ts +14 -2
- package/src/cli-adapters/spawn-env.ts +12 -0
- package/src/cli-adapters/terminal-screen.ts +12 -3
- package/src/commands/cdp-commands.ts +45 -8
- package/src/commands/cli-manager.ts +13 -2
- package/src/detection/cli-detector.ts +36 -2
- package/src/providers/cli-provider-instance.ts +62 -36
- package/src/providers/contracts.ts +39 -0
|
@@ -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 */
|