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

Function dispatchSnapshotViaRuntime

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

Source from the content-addressed store, hash-verified

20import { summarizeSnapshotDiagnostics } from '../snapshot-diagnostics.ts';
21
22export 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
53export async function dispatchSnapshotDiffViaRuntime(params: {
54 req: DaemonRequest;

Callers 1

snapshot.tsFile · 0.90

Calls 2

snapshotMethod · 0.80

Tested by

no test coverage detected