| 1834 | } |
| 1835 | |
| 1836 | static size_t cbm_json_mcp_ownership_fields(cbm_json_mcp_schema_t schema, const char *argument, |
| 1837 | cbm_json_like_object_field_t fields[3]) { |
| 1838 | fields[0] = (cbm_json_like_object_field_t){ |
| 1839 | .key = "command", |
| 1840 | .shape = cbm_json_mcp_command_is_array(schema) ? CBM_JSON_LIKE_VALUE_SINGLE_STRING_ARRAY |
| 1841 | : CBM_JSON_LIKE_VALUE_STRING, |
| 1842 | .expected_string = NULL, |
| 1843 | .flags = CBM_JSON_LIKE_FIELD_REQUIRED | CBM_JSON_LIKE_FIELD_CAPTURE_STRING, |
| 1844 | }; |
| 1845 | fields[1] = (cbm_json_like_object_field_t){ |
| 1846 | .key = "args", |
| 1847 | .shape = |
| 1848 | argument ? CBM_JSON_LIKE_VALUE_SINGLE_STRING_ARRAY : CBM_JSON_LIKE_VALUE_EMPTY_ARRAY, |
| 1849 | .expected_string = argument, |
| 1850 | .flags = argument ? CBM_JSON_LIKE_FIELD_REQUIRED : 0U, |
| 1851 | }; |
| 1852 | const char *type = cbm_json_mcp_required_type(schema); |
| 1853 | if (!type) { |
| 1854 | return 2U; |
| 1855 | } |
| 1856 | fields[2] = (cbm_json_like_object_field_t){ |
| 1857 | .key = "type", |
| 1858 | .shape = CBM_JSON_LIKE_VALUE_STRING, |
| 1859 | .expected_string = type, |
| 1860 | .flags = CBM_JSON_LIKE_FIELD_REQUIRED, |
| 1861 | }; |
| 1862 | return 3U; |
| 1863 | } |
| 1864 | |
| 1865 | /* The running executable is trustworthy identity evidence: install/update can |
| 1866 | * replace an exact-shape entry that still names the binary which initiated the |
no test coverage detected