MCPcopy Create free account
hub / github.com/RioArisk/claudecode_api_RemoteControl / executePtyOperations

Function executePtyOperations

lib/interactive-questions.js:157–175  ·  view source on GitHub ↗
(proc, operations)

Source from the content-addressed store, hash-verified

155}
156
157async function executePtyOperations(proc, operations) {
158 if (!proc) throw new Error('Claude is not running');
159 for (const operation of operations) {
160 if (!proc) throw new Error('Claude is not running');
161 if (operation.type === 'delay') {
162 await sleep(operation.ms);
163 continue;
164 }
165 if (operation.type === 'input') {
166 proc.write(operation.data);
167 continue;
168 }
169 if (operation.type === 'text') {
170 proc.write(operation.data);
171 await sleep(CHAT_SUBMIT_DELAY_MS);
172 proc.write('\r');
173 }
174 }
175}
176
177module.exports = {
178 normalizeAskUserQuestionSubmission,

Callers 1

setupWebSocketServerFunction · 0.85

Calls 1

sleepFunction · 0.85

Tested by

no test coverage detected