* Normalize agent output keys for update_project. * * Agents sometimes emit camelCase keys even when the schema documents snake_case. * We accept a small set of aliases for backward compatibility and resilience. * * @param {any} value * @returns {any}
(value)
| 29 | * @returns {any} |
| 30 | */ |
| 31 | function normalizeUpdateProjectOutput(value) { |
| 32 | if (!value || typeof value !== "object") return value; |
| 33 | |
| 34 | const output = { ...value }; |
| 35 | |
| 36 | if (output.content_type === undefined && output.contentType !== undefined) output.content_type = output.contentType; |
| 37 | if (output.content_number === undefined && output.contentNumber !== undefined) output.content_number = output.contentNumber; |
| 38 | if (output.target_repo === undefined && output.targetRepo !== undefined) output.target_repo = output.targetRepo; |
| 39 | |
| 40 | if (output.draft_title === undefined && output.draftTitle !== undefined) output.draft_title = output.draftTitle; |
| 41 | if (output.draft_body === undefined && output.draftBody !== undefined) output.draft_body = output.draftBody; |
| 42 | if (output.draft_issue_id === undefined && output.draftIssueId !== undefined) output.draft_issue_id = output.draftIssueId; |
| 43 | if (output.temporary_id === undefined && output.temporaryId !== undefined) output.temporary_id = output.temporaryId; |
| 44 | |
| 45 | if (output.field_definitions === undefined && output.fieldDefinitions !== undefined) output.field_definitions = output.fieldDefinitions; |
| 46 | |
| 47 | return output; |
| 48 | } |
| 49 | /** |
| 50 | * Parse project number from URL |
| 51 | * @param {unknown} projectUrl - Project URL |
no outgoing calls
no test coverage detected