| 394 | // so callers can skip the registry write without erroring (Kiro's promptSubmit |
| 395 | // and hosts that pass no stdin simply don't mark — fail-open by design). |
| 396 | function _extractHookSessionId(input) { |
| 397 | if (!input || typeof input !== 'object') return ''; |
| 398 | const raw = input.session_id ?? input.sessionId ?? input.sessionID; |
| 399 | return typeof raw === 'string' ? raw.trim() : ''; |
| 400 | } |
| 401 | |
| 402 | // Append one mark record to the registry. Best-effort and idempotent enough for |
| 403 | // the exporter's needs: the exporter dedupes into a Set, so a session marked on |