| 640 | } |
| 641 | |
| 642 | char *cbm_render_graph_profile(cbm_graph_profile_dialect_t dialect, cbm_graph_tier_t tier, |
| 643 | cbm_graph_access_t access, const char *binary_path) { |
| 644 | if (!dialect_valid(dialect) || !tier_valid(tier) || !access_valid(access) || |
| 645 | (access == CBM_GRAPH_ACCESS_DIRECT && !cbm_graph_dialect_direct_capable(dialect))) { |
| 646 | return NULL; |
| 647 | } |
| 648 | char *prompt = cbm_render_graph_prompt(tier, access); |
| 649 | if (!prompt) { |
| 650 | return NULL; |
| 651 | } |
| 652 | if (dialect == CBM_GRAPH_DIALECT_KIRO) { |
| 653 | char *result = render_kiro_profile(tier, access, binary_path, prompt); |
| 654 | free(prompt); |
| 655 | return result; |
| 656 | } |
| 657 | profile_buffer_t buffer; |
| 658 | profile_buffer_init(&buffer); |
| 659 | bool ok = render_profile_text(&buffer, dialect, tier, access, binary_path, prompt); |
| 660 | free(prompt); |
| 661 | if (!ok) { |
| 662 | profile_buffer_discard(&buffer); |
| 663 | return NULL; |
| 664 | } |
| 665 | return profile_buffer_finish(&buffer); |
| 666 | } |
| 667 | |
| 668 | char *cbm_render_graph_profile_codex_rc1(cbm_graph_tier_t tier) { |
| 669 | if (!tier_valid(tier)) { |
no test coverage detected