MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / askUser

Function askUser

src/cli/modes/headless.ts:113–126  ·  view source on GitHub ↗
(prompt: string, options: string[] = ['yes', 'no'])

Source from the content-addressed store, hash-verified

111 }
112
113 let sessionId: string;
114 let initialMessages;
115
116 let resumeCwd: string | undefined;
117 if (opts.resumeSessionId) {
118 const loaded = store.loadSession(opts.resumeSessionId);
119 if (!loaded) {
120 console.error(`Session not found: ${opts.resumeSessionId}`);
121 return 1;
122 }
123 sessionId = opts.resumeSessionId;
124 initialMessages = [...loaded.messages, { role: 'user' as const, content: effectivePrompt }];
125 const { pickWorkingCwd } = await import('../../session/handoff.js');
126 resumeCwd = pickWorkingCwd({ sessionCwd: loaded.meta.cwd, hostCwd: opts.cwd });
127 } else {
128 sessionId = store.createSession(opts.cwd, explicitModelOverride ?? opts.config.defaults.model);
129 }

Callers

nothing calls this directly

Calls 2

errorMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected