(session: SessionState, entry: RecordActionEntry)
| 13 | }; |
| 14 | |
| 15 | export function recordActionEntry(session: SessionState, entry: RecordActionEntry): void { |
| 16 | if (entry.flags?.noRecord) return; |
| 17 | if (entry.flags?.saveScript) { |
| 18 | session.recordSession = true; |
| 19 | if (typeof entry.flags.saveScript === 'string') { |
| 20 | session.saveScriptPath = expandSessionPath(entry.flags.saveScript); |
| 21 | } |
| 22 | } |
| 23 | session.actions.push({ |
| 24 | ts: Date.now(), |
| 25 | command: entry.command, |
| 26 | positionals: entry.positionals, |
| 27 | runtime: entry.runtime, |
| 28 | flags: sanitizeFlags(entry.flags), |
| 29 | result: entry.result, |
| 30 | }); |
| 31 | emitDiagnostic({ |
| 32 | level: 'debug', |
| 33 | phase: 'record_action', |
| 34 | data: { |
| 35 | command: entry.command, |
| 36 | session: session.name, |
| 37 | }, |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | const SANITIZED_FLAG_KEYS = [ |
| 42 | 'platform', |
no test coverage detected