MCPcopy Create free account
hub / github.com/tiann/hapi / extractTextItems

Method extractTextItems

cli/src/codex/codexRemoteLauncher.ts:448–457  ·  view source on GitHub ↗
(input: unknown)

Source from the content-addressed store, hash-verified

446 };
447
448 const extractTextItems = (input: unknown): string[] => {
449 const record = asRecord(input);
450 if (!record || !Array.isArray(record.items)) return [];
451 return record.items
452 .map((item) => {
453 const itemRecord = asRecord(item);
454 return asString(itemRecord?.text);
455 })
456 .filter((text): text is string => Boolean(text));
457 };
458
459 const extractAgentPrompt = (input: unknown): string | null => {
460 const record = asRecord(input);

Callers

nothing calls this directly

Calls 2

asRecordFunction · 0.70
asStringFunction · 0.50

Tested by

no test coverage detected