MCPcopy Create free account
hub / github.com/0xcaff/codex-web / parsePickFilesRequest

Function parsePickFilesRequest

src/browser/files.ts:160–179  ·  view source on GitHub ↗
(message: CodexFetchMessage)

Source from the content-addressed store, hash-verified

158}
159
160function parsePickFilesRequest(message: CodexFetchMessage): PickFilesRequest {
161 if (!message.body) {
162 return {};
163 }
164
165 try {
166 const parsed = JSON.parse(message.body) as unknown;
167 if (!isRecord(parsed)) {
168 return {};
169 }
170 return {
171 imagesOnly:
172 typeof parsed.imagesOnly === "boolean" ? parsed.imagesOnly : undefined,
173 pickerTitle:
174 typeof parsed.pickerTitle === "string" ? parsed.pickerTitle : undefined,
175 };
176 } catch {
177 return {};
178 }
179}
180
181function sendFetchResponse(
182 message: CodexFetchMessage,

Callers 1

Calls 1

isRecordFunction · 0.90

Tested by

no test coverage detected