MCPcopy Create free account
hub / github.com/callstack/agent-device / keyboardCommand

Function keyboardCommand

src/commands/system/runtime/system.ts:193–214  ·  view source on GitHub ↗
(runtime, options = {})

Source from the content-addressed store, hash-verified

191 SystemKeyboardCommandOptions | undefined,
192 SystemKeyboardCommandResult
193> = async (runtime, options = {}): Promise<SystemKeyboardCommandResult> => {
194 if (!runtime.backend.setKeyboard) {
195 throw new AppError('UNSUPPORTED_OPERATION', 'system.keyboard is not supported by this backend');
196 }
197 const action = options.action ?? 'status';
198 if (!isKeyboardAction(action)) {
199 throw new AppError(
200 'INVALID_ARGS',
201 'system.keyboard action must be status, get, dismiss, enter, or return',
202 );
203 }
204 const state = await runtime.backend.setKeyboard(toBackendContext(runtime, options), { action });
205 const formattedBackendResult = toBackendResult(state);
206 const keyboardState = isKeyboardResult(state) ? state : {};
207 if (action === 'enter' || action === 'return') {
208 return normalizeKeyboardEnterResult(keyboardState, formattedBackendResult);
209 }
210 if (action === 'dismiss') {
211 return normalizeKeyboardDismissResult(action, keyboardState, formattedBackendResult);
212 }
213 return normalizeKeyboardStateResult(action, keyboardState, formattedBackendResult);
214};
215
216export const clipboardCommand: RuntimeCommand<
217 SystemClipboardCommandOptions,

Callers

nothing calls this directly

Calls 7

isKeyboardActionFunction · 0.90
toBackendContextFunction · 0.90
toBackendResultFunction · 0.90
isKeyboardResultFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…