MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / mapThreadGoal

Function mapThreadGoal

packages/codex-native-api/src/codex_app_client.ts:2590–2608  ·  view source on GitHub ↗
(raw: any)

Source from the content-addressed store, hash-verified

2588}
2589
2590function mapThreadGoal(raw: any): ProviderThreadGoal | null {
2591 if (!raw || typeof raw !== 'object') {
2592 return null;
2593 }
2594 const objective = typeof raw.objective === 'string' ? raw.objective.trim() : '';
2595 if (!objective) {
2596 return null;
2597 }
2598 return {
2599 threadId: String(raw.threadId ?? raw.thread_id ?? ''),
2600 objective,
2601 status: typeof raw.status === 'string' ? raw.status : 'active',
2602 tokenBudget: Number.isFinite(raw.tokenBudget) ? Number(raw.tokenBudget) : null,
2603 tokensUsed: Number.isFinite(raw.tokensUsed) ? Number(raw.tokensUsed) : null,
2604 timeUsedSeconds: Number.isFinite(raw.timeUsedSeconds) ? Number(raw.timeUsedSeconds) : null,
2605 createdAt: typeof raw.createdAt === 'string' ? raw.createdAt : null,
2606 updatedAt: typeof raw.updatedAt === 'string' ? raw.updatedAt : null,
2607 };
2608}
2609
2610function summarizeTurnSnapshot(turn: any) {
2611 if (!turn) {

Callers 3

getThreadGoalMethod · 0.70
setThreadGoalMethod · 0.70
summarizeRpcResultFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected