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

Function parseArguments

cli/src/codex/utils/codexEventConverter.ts:82–97  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

80}
81
82function parseArguments(value: unknown): unknown {
83 if (typeof value !== 'string') {
84 return value;
85 }
86
87 const trimmed = value.trim();
88 if (trimmed.startsWith('{') || trimmed.startsWith('[')) {
89 try {
90 return JSON.parse(trimmed);
91 } catch (error) {
92 logger.debug('[codexEventConverter] Failed to parse function_call arguments as JSON:', error);
93 }
94 }
95
96 return value;
97}
98
99function extractCallId(payload: Record<string, unknown>): string | null {
100 const candidates = [

Callers 1

convertCodexEventFunction · 0.85

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected