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

Function readText

src/commands/interaction/runtime/selector-read-shared.ts:75–90  ·  view source on GitHub ↗
(
  runtime: AgentDeviceRuntime,
  capture: CapturedSnapshot,
  node: SnapshotNode,
)

Source from the content-addressed store, hash-verified

73}
74
75export async function readText(
76 runtime: AgentDeviceRuntime,
77 capture: CapturedSnapshot,
78 node: SnapshotNode,
79): Promise<string> {
80 if (runtime.backend.readText) {
81 const result = await runtime.backend.readText(
82 toBackendContext(runtime, {
83 session: capture.sessionName,
84 }),
85 node,
86 );
87 if (result.text.trim()) return result.text;
88 }
89 return extractReadableText(node);
90}
91
92export function resolveRefNode(
93 nodes: SnapshotState['nodes'],

Callers 2

findCommandFunction · 0.90
getCommandFunction · 0.90

Calls 3

toBackendContextFunction · 0.90
extractReadableTextFunction · 0.90
readTextMethod · 0.80

Tested by

no test coverage detected