| 1582 | } |
| 1583 | |
| 1584 | static size_t cbm_json_mcp_ownership_fields(cbm_json_mcp_schema_t schema, const char *argument, |
| 1585 | cbm_json_like_object_field_t fields[3]) { |
| 1586 | fields[0] = (cbm_json_like_object_field_t){ |
| 1587 | .key = "command", |
| 1588 | .shape = cbm_json_mcp_command_is_array(schema) ? CBM_JSON_LIKE_VALUE_SINGLE_STRING_ARRAY |
| 1589 | : CBM_JSON_LIKE_VALUE_STRING, |
| 1590 | .expected_string = NULL, |
| 1591 | .flags = CBM_JSON_LIKE_FIELD_REQUIRED | CBM_JSON_LIKE_FIELD_CAPTURE_STRING, |
| 1592 | }; |
| 1593 | fields[1] = (cbm_json_like_object_field_t){ |
| 1594 | .key = "args", |
| 1595 | .shape = |
| 1596 | argument ? CBM_JSON_LIKE_VALUE_SINGLE_STRING_ARRAY : CBM_JSON_LIKE_VALUE_EMPTY_ARRAY, |
| 1597 | .expected_string = argument, |
| 1598 | .flags = argument ? CBM_JSON_LIKE_FIELD_REQUIRED : 0U, |
| 1599 | }; |
| 1600 | const char *type = cbm_json_mcp_required_type(schema); |
| 1601 | if (!type) { |
| 1602 | return 2U; |
| 1603 | } |
| 1604 | fields[2] = (cbm_json_like_object_field_t){ |
| 1605 | .key = "type", |
| 1606 | .shape = CBM_JSON_LIKE_VALUE_STRING, |
| 1607 | .expected_string = type, |
| 1608 | .flags = CBM_JSON_LIKE_FIELD_REQUIRED, |
| 1609 | }; |
| 1610 | return 3U; |
| 1611 | } |
| 1612 | |
| 1613 | /* The running executable is trustworthy identity evidence: install/update can |
| 1614 | * replace an exact-shape entry that still names the binary which initiated the |
no test coverage detected