MCPcopy Index your code
hub / github.com/callstack/agent-device / dispatchSnapshotDiffViaRuntime

Function dispatchSnapshotDiffViaRuntime

src/daemon/snapshot-runtime.ts:53–82  ·  view source on GitHub ↗
(params: {
  req: DaemonRequest;
  sessionName: string;
  logPath: string;
  sessionStore: SessionStore;
})

Source from the content-addressed store, hash-verified

51}
52
53export async function dispatchSnapshotDiffViaRuntime(params: {
54 req: DaemonRequest;
55 sessionName: string;
56 logPath: string;
57 sessionStore: SessionStore;
58}): Promise<DaemonResponse> {
59 return await dispatchSnapshotRuntimeCommand({
60 ...params,
61 command: 'diff',
62 unsupportedMessage: 'diff is not supported on this device',
63 execute: async ({ runtime, sessionName, req, snapshotScope }) => {
64 const result = await runtime.capture.diffSnapshot({
65 session: sessionName,
66 interactiveOnly: req.flags?.snapshotInteractiveOnly,
67 depth: req.flags?.snapshotDepth,
68 scope: snapshotScope,
69 raw: req.flags?.snapshotRaw,
70 });
71 return {
72 data: result,
73 record: {
74 kind: 'diff',
75 mode: 'snapshot',
76 baselineInitialized: result.baselineInitialized,
77 summary: result.summary,
78 },
79 };
80 },
81 });
82}
83
84type SnapshotRuntimeCommandParams = {
85 req: DaemonRequest;

Callers 1

snapshot.tsFile · 0.90

Calls 1

Tested by

no test coverage detected