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

Function handleDirectElementSelectorFill

src/core/dispatch-interactions.ts:127–147  ·  view source on GitHub ↗
(
  interactor: Interactor,
  selector: NonNullable<DispatchContext['directElementSelector']>,
  positionals: string[],
  context: DispatchContext,
)

Source from the content-addressed store, hash-verified

125}
126
127async function handleDirectElementSelectorFill(
128 interactor: Interactor,
129 selector: NonNullable<DispatchContext['directElementSelector']>,
130 positionals: string[],
131 context: DispatchContext,
132): Promise<Record<string, unknown>> {
133 if (!interactor.fillElementSelector) {
134 throw new AppError('UNSUPPORTED_OPERATION', 'direct element selector fill is not supported');
135 }
136 const text = positionals.join(' ');
137 if (!text) throw new AppError('INVALID_ARGS', 'fill requires text');
138 const delayMs = requireIntInRange(context.delayMs ?? 0, 'delay-ms', 0, 10_000);
139 const result = await interactor.fillElementSelector(selector, text, delayMs);
140 return {
141 selector: selector.raw,
142 text,
143 delayMs,
144 ...(result ?? {}),
145 ...successText(formatTextLengthMessage('Filled', text)),
146 };
147}
148
149export async function handlePressCommand(
150 device: DeviceInfo,

Callers 1

handleFillCommandFunction · 0.85

Calls 3

requireIntInRangeFunction · 0.90
successTextFunction · 0.90
formatTextLengthMessageFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…