before_tool_search reproduces the v0.10.8 rendering: #1933 (v0.11.0) added * the tool_search / tool_search_regex permissions, and install/uninstall * must still recognise the older bytes as ours (#2264). */
| 502 | * the tool_search / tool_search_regex permissions, and install/uninstall |
| 503 | * must still recognise the older bytes as ours (#2264). */ |
| 504 | static bool append_opencode_profile(profile_buffer_t *buffer, cbm_graph_tier_t tier, |
| 505 | cbm_graph_access_t access, const char *prompt, |
| 506 | bool before_tool_search) { |
| 507 | return profile_buffer_append(buffer, "---\ndescription: ") && |
| 508 | profile_buffer_append(buffer, profile_description(tier, access)) && |
| 509 | profile_buffer_append(buffer, "\nmode: subagent\npermission:\n \"*\": deny\n read: " |
| 510 | "allow\n grep: allow\n glob: allow\n") && |
| 511 | (before_tool_search || |
| 512 | profile_buffer_append(buffer, " tool_search: allow\n tool_search_regex: allow\n")) && |
| 513 | (access != CBM_GRAPH_ACCESS_DIRECT || |
| 514 | append_permission_mcp_tools(buffer, CBM_GRAPH_DIALECT_OPENCODE, tier)) && |
| 515 | profile_buffer_append(buffer, "---\n") && profile_buffer_append(buffer, prompt); |
| 516 | } |
| 517 | |
| 518 | static bool render_profile_text(profile_buffer_t *buffer, cbm_graph_profile_dialect_t dialect, |
| 519 | cbm_graph_tier_t tier, cbm_graph_access_t access, |
no test coverage detected