(params: {
req: DaemonRequest;
sessionName: string;
logPath: string;
sessionStore: SessionStore;
})
| 20 | import { summarizeSnapshotDiagnostics } from '../snapshot-diagnostics.ts'; |
| 21 | |
| 22 | export async function dispatchSnapshotViaRuntime(params: { |
| 23 | req: DaemonRequest; |
| 24 | sessionName: string; |
| 25 | logPath: string; |
| 26 | sessionStore: SessionStore; |
| 27 | }): Promise<DaemonResponse> { |
| 28 | return await dispatchSnapshotRuntimeCommand({ |
| 29 | ...params, |
| 30 | command: 'snapshot', |
| 31 | unsupportedMessage: 'snapshot is not supported on this device', |
| 32 | execute: async ({ runtime, sessionName, req, snapshotScope }) => { |
| 33 | const result = await runtime.capture.snapshot({ |
| 34 | session: sessionName, |
| 35 | interactiveOnly: req.flags?.snapshotInteractiveOnly, |
| 36 | depth: req.flags?.snapshotDepth, |
| 37 | scope: snapshotScope, |
| 38 | raw: req.flags?.snapshotRaw, |
| 39 | forceFull: req.flags?.snapshotForceFull, |
| 40 | }); |
| 41 | return { |
| 42 | data: result, |
| 43 | record: { |
| 44 | kind: 'snapshot', |
| 45 | nodes: result.nodes.length, |
| 46 | truncated: result.truncated, |
| 47 | }, |
| 48 | }; |
| 49 | }, |
| 50 | }); |
| 51 | } |
| 52 | |
| 53 | export async function dispatchSnapshotDiffViaRuntime(params: { |
| 54 | req: DaemonRequest; |
no test coverage detected