musubi-client 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. musubi_client-0.2.0/.github/workflows/ci.yml +76 -0
  2. musubi_client-0.2.0/.github/workflows/release.yml +107 -0
  3. musubi_client-0.2.0/.gitignore +25 -0
  4. musubi_client-0.2.0/CONTRIBUTING.md +152 -0
  5. musubi_client-0.2.0/DESIGN.md +198 -0
  6. musubi_client-0.2.0/GETTING_STARTED.md +340 -0
  7. musubi_client-0.2.0/Makefile +58 -0
  8. musubi_client-0.2.0/PKG-INFO +17 -0
  9. musubi_client-0.2.0/README.md +314 -0
  10. musubi_client-0.2.0/data/hosts.json +82 -0
  11. musubi_client-0.2.0/generator-config.yaml +2 -0
  12. musubi_client-0.2.0/openapi.json +10479 -0
  13. musubi_client-0.2.0/pyproject.toml +62 -0
  14. musubi_client-0.2.0/scripts/extract_openapi.py +33 -0
  15. musubi_client-0.2.0/scripts/fix_openapi_spec.py +70 -0
  16. musubi_client-0.2.0/scripts/install.sh +172 -0
  17. musubi_client-0.2.0/scripts/smoke_test.py +152 -0
  18. musubi_client-0.2.0/src/musubi/__init__.py +43 -0
  19. musubi_client-0.2.0/src/musubi/_base.py +65 -0
  20. musubi_client-0.2.0/src/musubi/_cli_shared.py +39 -0
  21. musubi_client-0.2.0/src/musubi/_generated/__init__.py +0 -0
  22. musubi_client-0.2.0/src/musubi/_generated/policyai/__init__.py +8 -0
  23. musubi_client-0.2.0/src/musubi/_generated/policyai/api/__init__.py +1 -0
  24. musubi_client-0.2.0/src/musubi/_generated/policyai/api/application_information/__init__.py +1 -0
  25. musubi_client-0.2.0/src/musubi/_generated/policyai/api/application_information/get_version_api_version_get.py +125 -0
  26. musubi_client-0.2.0/src/musubi/_generated/policyai/api/decisions/__init__.py +1 -0
  27. musubi_client-0.2.0/src/musubi/_generated/policyai/api/decisions/evaluate_content_against_policy_version_api_v_1_decisions_policies_policy_id_versions_policy_version_id_post.py +197 -0
  28. musubi_client-0.2.0/src/musubi/_generated/policyai/api/decisions/evaluate_content_against_tagged_policy_versions_api_v1_decisions_evaluate_tag_name_post.py +182 -0
  29. musubi_client-0.2.0/src/musubi/_generated/policyai/api/decisions/get_decision_counts_api_v1_decisions_stats_get.py +288 -0
  30. musubi_client-0.2.0/src/musubi/_generated/policyai/api/decisions/get_decisions_api_v1_decisions_get.py +313 -0
  31. musubi_client-0.2.0/src/musubi/_generated/policyai/api/evaluations/__init__.py +1 -0
  32. musubi_client-0.2.0/src/musubi/_generated/policyai/api/evaluations/get_evaluation_groups_api_v1_evaluations_groups_get.py +217 -0
  33. musubi_client-0.2.0/src/musubi/_generated/policyai/api/evaluations/get_evaluation_run_api_v_1_evaluations_run_evaluation_run_id_get.py +161 -0
  34. musubi_client-0.2.0/src/musubi/_generated/policyai/api/evaluations/run_evaluation_api_v1_evaluations_run_post.py +166 -0
  35. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labeling_endpoints_v_2/__init__.py +1 -0
  36. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labeling_endpoints_v_2/create_labeling_endpoint_v2_api_v2_endpoints_post.py +166 -0
  37. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labeling_endpoints_v_2/get_labeling_endpoint_v_2_api_v_2_endpoints_endpoint_id_get.py +161 -0
  38. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labeling_endpoints_v_2/list_labeling_endpoint_v2_api_v2_endpoints_get.py +203 -0
  39. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labeling_endpoints_v_2/update_labeling_endpoint_v_2_api_v_2_endpoints_endpoint_id_patch.py +183 -0
  40. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labels_v_2/__init__.py +1 -0
  41. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labels_v_2/get_v2_label_groups_api_v2_labels_get.py +331 -0
  42. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labels_v_2/label_content_api_v2_labels_post.py +166 -0
  43. musubi_client-0.2.0/src/musubi/_generated/policyai/api/labels_v_2/label_content_by_endpoint_api_v_2_labels_by_endpoint_organization_id_endpoint_name_post.py +197 -0
  44. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/__init__.py +1 -0
  45. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/add_dataset_items_api_v1_datasets_dataset_id_data_post.py +183 -0
  46. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/archive_dataset_api_v1_datasets_dataset_id_delete.py +161 -0
  47. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/bulk_delete_dataset_items_api_v1_datasets_dataset_id_data_delete.py +183 -0
  48. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/create_dataset_api_v1_datasets_post.py +166 -0
  49. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/delete_dataset_item_api_v1_datasets_dataset_id_dataset_item_id_delete.py +175 -0
  50. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/get_dataset_api_v1_datasets_dataset_id_get.py +161 -0
  51. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/get_dataset_data_api_v1_datasets_dataset_id_data_get.py +161 -0
  52. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/get_datasets_api_v1_datasets_get.py +222 -0
  53. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_datasets/update_dataset_item_api_v1_datasets_dataset_id_dataset_item_id_put.py +197 -0
  54. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/__init__.py +1 -0
  55. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/create_policy_api_v1_policies_post.py +168 -0
  56. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/get_policy_api_v_1_policies_policy_id_get.py +163 -0
  57. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/get_policy_list_api_v1_policies_get.py +234 -0
  58. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/get_policy_version_api_v_1_policies_policy_id_versions_version_id_get.py +175 -0
  59. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/update_policy_api_v_1_policies_policy_id_patch.py +185 -0
  60. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies/update_policy_version_api_v_1_policies_policy_id_versions_version_id_patch.py +197 -0
  61. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/__init__.py +1 -0
  62. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/create_draft_v_2_policy_version_api_v_2_policies_by_key_organization_id_policy_key_versions_draft_post.py +203 -0
  63. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/create_new_v_2_policy_version_api_v_2_policies_by_key_organization_id_policy_key_versions_post.py +203 -0
  64. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/create_v2_policy_api_v2_policies_post.py +166 -0
  65. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/finalize_v_2_policy_draft_version_api_v_2_policies_by_key_organization_id_policy_key_versions_draft_finalize_post.py +175 -0
  66. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/get_v2_policy_list_api_v2_policies_get.py +227 -0
  67. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/get_v_2_policy_draft_version_api_v_2_policies_by_key_organization_id_policy_key_versions_draft_get.py +175 -0
  68. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/get_v_2_policy_version_api_v_2_policies_by_key_organization_id_policy_key_versions_version_number_get.py +189 -0
  69. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/update_draft_v_2_policy_version_api_v_2_policies_by_key_organization_id_policy_key_versions_draft_patch.py +203 -0
  70. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policies_v_2/update_v_2_policy_api_v_2_policies_by_key_organization_id_policy_key_patch.py +197 -0
  71. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policy_version_tags/__init__.py +1 -0
  72. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policy_version_tags/create_tag_api_v1_tags_post.py +166 -0
  73. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policy_version_tags/get_tag_api_v_1_tags_tag_id_get.py +161 -0
  74. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policy_version_tags/list_tags_api_v1_tags_get.py +222 -0
  75. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_policy_version_tags/update_tag_api_v1_tags_tag_id_put.py +183 -0
  76. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_prompt_templates/__init__.py +1 -0
  77. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_prompt_templates/create_prompt_template_api_v_1_prompt_templates_post.py +166 -0
  78. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_prompt_templates/get_prompt_template_api_v_1_prompt_templates_prompt_template_id_get.py +161 -0
  79. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_prompt_templates/get_prompt_templates_api_v_1_prompt_templates_get.py +203 -0
  80. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_prompt_templates/update_prompt_template_api_v_1_prompt_templates_prompt_template_id_patch.py +183 -0
  81. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_settings/__init__.py +1 -0
  82. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_settings/get_organization_settings_api_v_1_settings_organizations_organization_id_get.py +161 -0
  83. musubi_client-0.2.0/src/musubi/_generated/policyai/api/manage_settings/get_organization_settings_list_api_v1_settings_organizations_get.py +180 -0
  84. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models/__init__.py +1 -0
  85. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models/get_default_llm_api_v1_models_default_get.py +127 -0
  86. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models/get_default_llm_tier_api_v1_models_tiers_default_get.py +127 -0
  87. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models/get_llm_list_api_v1_models_get.py +173 -0
  88. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models/get_llm_tier_list_api_v1_models_tiers_get.py +127 -0
  89. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models_v_2/__init__.py +1 -0
  90. musubi_client-0.2.0/src/musubi/_generated/policyai/api/models_v_2/get_llm_list_api_v2_models_get.py +133 -0
  91. musubi_client-0.2.0/src/musubi/_generated/policyai/client.py +268 -0
  92. musubi_client-0.2.0/src/musubi/_generated/policyai/errors.py +16 -0
  93. musubi_client-0.2.0/src/musubi/_generated/policyai/models/__init__.py +603 -0
  94. musubi_client-0.2.0/src/musubi/_generated/policyai/models/additional_labeler_output_field_enum.py +11 -0
  95. musubi_client-0.2.0/src/musubi/_generated/policyai/models/assessment_enum.py +9 -0
  96. musubi_client-0.2.0/src/musubi/_generated/policyai/models/assessment_v2_enum.py +9 -0
  97. musubi_client-0.2.0/src/musubi/_generated/policyai/models/attach_policy_to_scope_request_model.py +62 -0
  98. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_model.py +121 -0
  99. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_model_data_type_0.py +8 -0
  100. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_model_format.py +8 -0
  101. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_model_type.py +8 -0
  102. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_response_model.py +193 -0
  103. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_response_model_data_type_0.py +8 -0
  104. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_response_model_format.py +8 -0
  105. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_response_model_messages_item_type_1.py +46 -0
  106. musubi_client-0.2.0/src/musubi/_generated/policyai/models/audio_as_url_content_response_model_type.py +8 -0
  107. musubi_client-0.2.0/src/musubi/_generated/policyai/models/base_64_image_content.py +71 -0
  108. musubi_client-0.2.0/src/musubi/_generated/policyai/models/base_64_image_content_type.py +8 -0
  109. musubi_client-0.2.0/src/musubi/_generated/policyai/models/content_key_model.py +71 -0
  110. musubi_client-0.2.0/src/musubi/_generated/policyai/models/content_type_v2_enum.py +12 -0
  111. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_dataset_item_request_model.py +93 -0
  112. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_dataset_item_request_model_metadata.py +46 -0
  113. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_dataset_items_request_model.py +75 -0
  114. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_dataset_request_model.py +113 -0
  115. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_draft_v2_policy_version_api_v2_policies_by_key_organization_id_policy_key_versions_draft_post_create_policy_v2_version_request_model.py +81 -0
  116. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_evaluation_run_request_model.py +94 -0
  117. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_labeling_endpoint_request_model.py +103 -0
  118. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_new_v2_policy_version_api_v2_policies_by_key_organization_id_policy_key_versions_post_create_policy_v2_version_request_model.py +81 -0
  119. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_organization_settings_request_model.py +144 -0
  120. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_policy_request_model.py +233 -0
  121. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_policy_v2_data_request_model.py +222 -0
  122. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_policy_v2_request_model.py +81 -0
  123. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_policy_v2_version_request_model.py +78 -0
  124. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_policy_version_tag_request_model.py +97 -0
  125. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_prompt_template_request_model.py +86 -0
  126. musubi_client-0.2.0/src/musubi/_generated/policyai/models/create_scope_request_model.py +92 -0
  127. musubi_client-0.2.0/src/musubi/_generated/policyai/models/data_type_enum.py +10 -0
  128. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_envelope_response_model.py +118 -0
  129. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_envelope_response_model_messages_item_type_1.py +46 -0
  130. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_item_envelope_response_model.py +118 -0
  131. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_item_envelope_response_model_messages_item_type_1.py +46 -0
  132. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_item_model.py +105 -0
  133. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_item_model_metadata.py +46 -0
  134. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_items_envelope_response_model.py +118 -0
  135. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_items_envelope_response_model_messages_item_type_1.py +46 -0
  136. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_items_model.py +75 -0
  137. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_response_list_model.py +120 -0
  138. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_response_list_model_messages_item_type_1.py +46 -0
  139. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_response_model.py +199 -0
  140. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_response_model_messages_item_type_1.py +46 -0
  141. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_type_enum.py +9 -0
  142. musubi_client-0.2.0/src/musubi/_generated/policyai/models/dataset_upload_status_enum.py +10 -0
  143. musubi_client-0.2.0/src/musubi/_generated/policyai/models/decision_group_by_enum.py +11 -0
  144. musubi_client-0.2.0/src/musubi/_generated/policyai/models/decision_group_stats_model.py +75 -0
  145. musubi_client-0.2.0/src/musubi/_generated/policyai/models/decision_stats_bin_model.py +90 -0
  146. musubi_client-0.2.0/src/musubi/_generated/policyai/models/decision_stats_model.py +61 -0
  147. musubi_client-0.2.0/src/musubi/_generated/policyai/models/decision_stats_response_model.py +195 -0
  148. musubi_client-0.2.0/src/musubi/_generated/policyai/models/decision_stats_response_model_messages_item_type_1.py +46 -0
  149. musubi_client-0.2.0/src/musubi/_generated/policyai/models/delete_dataset_items_request_model.py +61 -0
  150. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluate_content_request_model.py +113 -0
  151. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_group_response_list_model.py +126 -0
  152. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_group_response_list_model_messages_item_type_1.py +46 -0
  153. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_group_response_model.py +214 -0
  154. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_group_response_model_messages_item_type_1.py +46 -0
  155. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_envelope_response_model.py +118 -0
  156. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_envelope_response_model_messages_item_type_1.py +46 -0
  157. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_item_model.py +174 -0
  158. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_item_model_extra.py +46 -0
  159. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_item_model_itemmetadata.py +46 -0
  160. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_model.py +167 -0
  161. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_model_policysnapshot.py +46 -0
  162. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_response_model.py +215 -0
  163. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_response_model_messages_item_type_1.py +46 -0
  164. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_response_model_policysnapshot.py +46 -0
  165. musubi_client-0.2.0/src/musubi/_generated/policyai/models/evaluation_run_status_enum.py +11 -0
  166. musubi_client-0.2.0/src/musubi/_generated/policyai/models/http_validation_error.py +79 -0
  167. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_request_model.py +106 -0
  168. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_request_model_format.py +8 -0
  169. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_request_model_type.py +8 -0
  170. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_response_model.py +176 -0
  171. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_response_model_format.py +8 -0
  172. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_response_model_messages_item_type_1.py +46 -0
  173. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_base_64_content_response_model_type.py +8 -0
  174. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_model.py +121 -0
  175. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_model_data_type_0.py +8 -0
  176. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_model_format.py +8 -0
  177. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_model_type.py +8 -0
  178. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_response_model.py +193 -0
  179. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_response_model_data_type_0.py +8 -0
  180. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_response_model_format.py +8 -0
  181. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_response_model_messages_item_type_1.py +46 -0
  182. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_as_url_content_response_model_type.py +8 -0
  183. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_url_content.py +71 -0
  184. musubi_client-0.2.0/src/musubi/_generated/policyai/models/image_url_content_type.py +8 -0
  185. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_content_by_endpoint_request_model.py +169 -0
  186. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_content_request_model.py +220 -0
  187. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_group_envelope_response_model.py +118 -0
  188. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_group_envelope_response_model_messages_item_type_1.py +46 -0
  189. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_group_response_list_model.py +126 -0
  190. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_group_response_list_model_messages_item_type_1.py +46 -0
  191. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_group_response_model.py +234 -0
  192. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_response_model.py +188 -0
  193. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_response_model_extra.py +46 -0
  194. musubi_client-0.2.0/src/musubi/_generated/policyai/models/label_status_enum.py +8 -0
  195. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeler_output_integer_field_model.py +167 -0
  196. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeler_output_integer_field_model_type.py +8 -0
  197. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeler_output_model.py +61 -0
  198. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeler_output_string_field_model.py +127 -0
  199. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeler_output_string_field_model_type.py +8 -0
  200. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeling_endpoint_envelope_response_model.py +118 -0
  201. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeling_endpoint_envelope_response_model_messages_item_type_1.py +46 -0
  202. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeling_endpoint_response_list_model.py +126 -0
  203. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeling_endpoint_response_list_model_messages_item_type_1.py +46 -0
  204. musubi_client-0.2.0/src/musubi/_generated/policyai/models/labeling_endpoint_response_model.py +131 -0
  205. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_id_enum.py +26 -0
  206. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_model.py +138 -0
  207. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_response_envelope_model.py +112 -0
  208. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_response_envelope_model_messages_item_type_1.py +46 -0
  209. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_response_list_model.py +120 -0
  210. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_response_list_model_messages_item_type_1.py +46 -0
  211. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_response_model.py +206 -0
  212. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_response_model_messages_item_type_1.py +46 -0
  213. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_status_enum.py +8 -0
  214. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_id_enum.py +9 -0
  215. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_response_envelope_model.py +118 -0
  216. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_response_envelope_model_messages_item_type_1.py +46 -0
  217. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_response_list_model.py +120 -0
  218. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_response_list_model_messages_item_type_1.py +46 -0
  219. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_response_model.py +126 -0
  220. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_tier_response_model_messages_item_type_1.py +46 -0
  221. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_model_response_model.py +240 -0
  222. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_model_response_model_extra.py +46 -0
  223. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_model_response_model_extraparamvalues.py +46 -0
  224. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_model_response_model_messages_item_type_1.py +46 -0
  225. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_model_response_model_paramvalues.py +46 -0
  226. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_response_envelope_model.py +124 -0
  227. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_response_envelope_model_messages_item_type_1.py +46 -0
  228. musubi_client-0.2.0/src/musubi/_generated/policyai/models/llm_v2_status_enum.py +8 -0
  229. musubi_client-0.2.0/src/musubi/_generated/policyai/models/model_param_enum.py +13 -0
  230. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_error_model.py +69 -0
  231. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_envelope_response_model.py +118 -0
  232. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_envelope_response_model_messages_item_type_1.py +46 -0
  233. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_response_list_model.py +126 -0
  234. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_response_list_model_messages_item_type_1.py +46 -0
  235. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_response_model.py +304 -0
  236. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_response_model_extra.py +46 -0
  237. musubi_client-0.2.0/src/musubi/_generated/policyai/models/moderation_results_response_model_messages_item_type_1.py +46 -0
  238. musubi_client-0.2.0/src/musubi/_generated/policyai/models/multiple_decision_results_response_model.py +150 -0
  239. musubi_client-0.2.0/src/musubi/_generated/policyai/models/multiple_decision_results_response_model_messages_item_type_1.py +46 -0
  240. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_content_model.py +139 -0
  241. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_envelope_response_model.py +122 -0
  242. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_envelope_response_model_messages_item_type_1.py +46 -0
  243. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_response_list_model.py +126 -0
  244. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_response_list_model_messages_item_type_1.py +46 -0
  245. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_response_model.py +151 -0
  246. musubi_client-0.2.0/src/musubi/_generated/policyai/models/organization_settings_response_model_messages_item_type_1.py +46 -0
  247. musubi_client-0.2.0/src/musubi/_generated/policyai/models/output_field_source_enum.py +10 -0
  248. musubi_client-0.2.0/src/musubi/_generated/policyai/models/partial_update_policy_request_model.py +113 -0
  249. musubi_client-0.2.0/src/musubi/_generated/policyai/models/partial_update_policy_version_request_model.py +265 -0
  250. musubi_client-0.2.0/src/musubi/_generated/policyai/models/partial_update_prompt_template_request_model.py +113 -0
  251. musubi_client-0.2.0/src/musubi/_generated/policyai/models/partial_update_scope_request_model.py +93 -0
  252. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_model.py +121 -0
  253. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_model_data_type_0.py +8 -0
  254. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_model_format.py +8 -0
  255. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_model_type.py +8 -0
  256. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_response_model.py +193 -0
  257. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_response_model_data_type_0.py +8 -0
  258. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_response_model_format.py +8 -0
  259. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_response_model_messages_item_type_1.py +46 -0
  260. musubi_client-0.2.0/src/musubi/_generated/policyai/models/pdf_as_url_content_response_model_type.py +8 -0
  261. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_label_model.py +71 -0
  262. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_llm_model.py +103 -0
  263. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_llm_model_extraparamvalues.py +46 -0
  264. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_llm_model_paramvalues.py +46 -0
  265. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_prompt_template_response_model.py +171 -0
  266. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_prompt_template_response_model_messages_item_type_1.py +46 -0
  267. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_data_response_model.py +191 -0
  268. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_draft_labeler_config_model.py +150 -0
  269. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_draft_labeler_config_model_extramodelparamvalues.py +46 -0
  270. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_draft_labeler_config_model_modelparamvalues.py +46 -0
  271. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_draft_labeler_config_model_type.py +8 -0
  272. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_envelope_response_model.py +118 -0
  273. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_envelope_response_model_messages_item_type_1.py +46 -0
  274. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_labeler_config_model.py +154 -0
  275. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_labeler_config_model_extramodelparamvalues.py +46 -0
  276. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_labeler_config_model_modelparamvalues.py +46 -0
  277. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_labeler_config_model_type.py +8 -0
  278. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_labeler_internal_metadata_model.py +87 -0
  279. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_labeler_internal_metadata_model_type.py +9 -0
  280. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_list_response_model.py +124 -0
  281. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_list_response_model_messages_item_type_1.py +46 -0
  282. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_response_model.py +173 -0
  283. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_response_model_extra.py +46 -0
  284. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_version_envelope_response_model.py +118 -0
  285. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_version_envelope_response_model_messages_item_type_1.py +46 -0
  286. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_version_metadata_model.py +107 -0
  287. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_version_response_model.py +189 -0
  288. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_version_response_model_extra.py +46 -0
  289. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_v2_version_state_enum.py +9 -0
  290. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_definition_category_model.py +72 -0
  291. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_definition_category_request_model.py +72 -0
  292. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_definition_model.py +86 -0
  293. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_definition_request_model.py +88 -0
  294. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_envelope_response_model.py +118 -0
  295. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_envelope_response_model_messages_item_type_1.py +46 -0
  296. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_examples_category_model_input.py +83 -0
  297. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_examples_category_model_output.py +83 -0
  298. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_examples_model.py +86 -0
  299. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_examples_request_model.py +88 -0
  300. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_metadata_model.py +70 -0
  301. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_model.py +187 -0
  302. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_response_model.py +234 -0
  303. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_response_model_messages_item_type_1.py +46 -0
  304. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_settings_model.py +112 -0
  305. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_tag_envelope_response_model.py +118 -0
  306. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_tag_envelope_response_model_messages_item_type_1.py +46 -0
  307. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_tag_model.py +134 -0
  308. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_tag_response_list_model.py +126 -0
  309. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_version_tag_response_list_model_messages_item_type_1.py +46 -0
  310. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_related_metadata_envelope_response_model.py +122 -0
  311. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_related_metadata_envelope_response_model_messages_item_type_1.py +46 -0
  312. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_related_metadata_response_list_model.py +130 -0
  313. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_related_metadata_response_list_model_messages_item_type_1.py +46 -0
  314. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_related_metadata_response_model.py +215 -0
  315. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_related_metadata_response_model_messages_item_type_1.py +46 -0
  316. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_version_content_model.py +158 -0
  317. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_versions_content_envelope_response_model.py +122 -0
  318. musubi_client-0.2.0/src/musubi/_generated/policyai/models/policy_with_versions_content_envelope_response_model_messages_item_type_1.py +46 -0
  319. musubi_client-0.2.0/src/musubi/_generated/policyai/models/prompt_template_envelope_response_model.py +119 -0
  320. musubi_client-0.2.0/src/musubi/_generated/policyai/models/prompt_template_envelope_response_model_messages_item_type_1.py +46 -0
  321. musubi_client-0.2.0/src/musubi/_generated/policyai/models/prompt_template_list_envelope_response_model.py +129 -0
  322. musubi_client-0.2.0/src/musubi/_generated/policyai/models/prompt_template_list_envelope_response_model_messages_item_type_1.py +46 -0
  323. musubi_client-0.2.0/src/musubi/_generated/policyai/models/request_base_64_image_content.py +71 -0
  324. musubi_client-0.2.0/src/musubi/_generated/policyai/models/request_base_64_image_content_type.py +8 -0
  325. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_attachment_response_list_model.py +126 -0
  326. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_attachment_response_list_model_messages_item_type_1.py +46 -0
  327. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_attachment_response_model.py +161 -0
  328. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_attachment_response_model_messages_item_type_1.py +46 -0
  329. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_model.py +124 -0
  330. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_response_list_model.py +120 -0
  331. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_response_list_model_messages_item_type_1.py +46 -0
  332. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_response_model.py +171 -0
  333. musubi_client-0.2.0/src/musubi/_generated/policyai/models/scope_response_model_messages_item_type_1.py +46 -0
  334. musubi_client-0.2.0/src/musubi/_generated/policyai/models/severity_enum.py +11 -0
  335. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content.py +71 -0
  336. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_model.py +105 -0
  337. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_model_format.py +8 -0
  338. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_model_type.py +8 -0
  339. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_response_model.py +175 -0
  340. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_response_model_format.py +8 -0
  341. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_response_model_messages_item_type_1.py +46 -0
  342. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_response_model_type.py +8 -0
  343. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_content_type.py +8 -0
  344. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_example_model.py +80 -0
  345. musubi_client-0.2.0/src/musubi/_generated/policyai/models/text_example_model_type.py +8 -0
  346. musubi_client-0.2.0/src/musubi/_generated/policyai/models/time_bin_enum.py +10 -0
  347. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_dataset_item_request_model.py +135 -0
  348. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_dataset_item_request_model_metadata_type_0.py +46 -0
  349. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_draft_v2_policy_version_api_v2_policies_by_key_organization_id_policy_key_versions_draft_patch_update_policy_v2_version_request_model.py +114 -0
  350. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_labeling_endpoint_request_model.py +138 -0
  351. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_organization_settings_request_model.py +133 -0
  352. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_policy_v2_request_model.py +113 -0
  353. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_policy_v2_version_request_model.py +111 -0
  354. musubi_client-0.2.0/src/musubi/_generated/policyai/models/update_policy_version_tag_request_model.py +172 -0
  355. musubi_client-0.2.0/src/musubi/_generated/policyai/models/validation_error.py +90 -0
  356. musubi_client-0.2.0/src/musubi/_generated/policyai/models/version_response_model.py +110 -0
  357. musubi_client-0.2.0/src/musubi/_generated/policyai/models/version_response_model_messages_item_type_1.py +46 -0
  358. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_model.py +121 -0
  359. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_model_data_type_0.py +8 -0
  360. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_model_format.py +8 -0
  361. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_model_type.py +8 -0
  362. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_response_model.py +193 -0
  363. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_response_model_data_type_0.py +8 -0
  364. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_response_model_format.py +8 -0
  365. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_response_model_messages_item_type_1.py +46 -0
  366. musubi_client-0.2.0/src/musubi/_generated/policyai/models/video_as_url_content_response_model_type.py +8 -0
  367. musubi_client-0.2.0/src/musubi/_generated/policyai/py.typed +1 -0
  368. musubi_client-0.2.0/src/musubi/_generated/policyai/types.py +54 -0
  369. musubi_client-0.2.0/src/musubi/auth/__init__.py +0 -0
  370. musubi_client-0.2.0/src/musubi/auth/config.py +670 -0
  371. musubi_client-0.2.0/src/musubi/auth/device_flow.py +264 -0
  372. musubi_client-0.2.0/src/musubi/auth/iam.py +231 -0
  373. musubi_client-0.2.0/src/musubi/bulk.py +376 -0
  374. musubi_client-0.2.0/src/musubi/cli.py +920 -0
  375. musubi_client-0.2.0/src/musubi/client.py +216 -0
  376. musubi_client-0.2.0/src/musubi/commands/__init__.py +0 -0
  377. musubi_client-0.2.0/src/musubi/commands/compare.py +49 -0
  378. musubi_client-0.2.0/src/musubi/commands/dataset.py +224 -0
  379. musubi_client-0.2.0/src/musubi/commands/doctor.py +178 -0
  380. musubi_client-0.2.0/src/musubi/commands/install_skills.py +239 -0
  381. musubi_client-0.2.0/src/musubi/commands/label_dataset.py +208 -0
  382. musubi_client-0.2.0/src/musubi/commands/login.py +431 -0
  383. musubi_client-0.2.0/src/musubi/commands/logout.py +63 -0
  384. musubi_client-0.2.0/src/musubi/commands/mcp_install.py +184 -0
  385. musubi_client-0.2.0/src/musubi/commands/profiles.py +111 -0
  386. musubi_client-0.2.0/src/musubi/commands/project_init.py +106 -0
  387. musubi_client-0.2.0/src/musubi/commands/switch.py +57 -0
  388. musubi_client-0.2.0/src/musubi/commands/uninstall.py +177 -0
  389. musubi_client-0.2.0/src/musubi/commands/upgrade.py +95 -0
  390. musubi_client-0.2.0/src/musubi/data/hosts.json +82 -0
  391. musubi_client-0.2.0/src/musubi/datasets_workflow.py +1037 -0
  392. musubi_client-0.2.0/src/musubi/exceptions.py +64 -0
  393. musubi_client-0.2.0/src/musubi/labeling.py +330 -0
  394. musubi_client-0.2.0/src/musubi/mcp_hosts.py +474 -0
  395. musubi_client-0.2.0/src/musubi/mcp_server.py +1195 -0
  396. musubi_client-0.2.0/src/musubi/policy_diff.py +366 -0
  397. musubi_client-0.2.0/src/musubi/policy_helpers.py +106 -0
  398. musubi_client-0.2.0/src/musubi/prompts.py +113 -0
  399. musubi_client-0.2.0/src/musubi/resources/__init__.py +0 -0
  400. musubi_client-0.2.0/src/musubi/resources/datasets/__init__.py +5 -0
  401. musubi_client-0.2.0/src/musubi/resources/datasets/dataset.py +552 -0
  402. musubi_client-0.2.0/src/musubi/resources/iam/__init__.py +10 -0
  403. musubi_client-0.2.0/src/musubi/resources/iam/iam.py +126 -0
  404. musubi_client-0.2.0/src/musubi/resources/policyai/__init__.py +0 -0
  405. musubi_client-0.2.0/src/musubi/resources/policyai/endpoints.py +84 -0
  406. musubi_client-0.2.0/src/musubi/resources/policyai/labels.py +92 -0
  407. musubi_client-0.2.0/src/musubi/resources/policyai/models.py +22 -0
  408. musubi_client-0.2.0/src/musubi/resources/policyai/policies.py +116 -0
  409. musubi_client-0.2.0/tests/__init__.py +0 -0
  410. musubi_client-0.2.0/tests/test_auth_config.py +572 -0
  411. musubi_client-0.2.0/tests/test_bulk.py +627 -0
  412. musubi_client-0.2.0/tests/test_cli.py +514 -0
  413. musubi_client-0.2.0/tests/test_cli_shared.py +47 -0
  414. musubi_client-0.2.0/tests/test_client.py +283 -0
  415. musubi_client-0.2.0/tests/test_datasets_workflow.py +572 -0
  416. musubi_client-0.2.0/tests/test_device_flow.py +152 -0
  417. musubi_client-0.2.0/tests/test_install_skills.py +187 -0
  418. musubi_client-0.2.0/tests/test_integration.py +373 -0
  419. musubi_client-0.2.0/tests/test_labeling.py +310 -0
  420. musubi_client-0.2.0/tests/test_login.py +268 -0
  421. musubi_client-0.2.0/tests/test_mcp_hosts.py +415 -0
  422. musubi_client-0.2.0/tests/test_policy_diff.py +288 -0
  423. musubi_client-0.2.0/tests/test_uninstall_command.py +111 -0
@@ -0,0 +1,76 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, sdk-and-mcp-server]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ['3.11', '3.12', '3.13']
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Set up uv
19
+ uses: astral-sh/setup-uv@v3
20
+ with:
21
+ enable-cache: true
22
+ # uv.lock is gitignored (this is a published library, not an app),
23
+ # so key the cache on pyproject.toml instead of the default
24
+ # **/uv.lock glob — which errors when no lockfile is checked in.
25
+ cache-dependency-glob: pyproject.toml
26
+
27
+ - name: Set up Python ${{ matrix.python-version }}
28
+ run: uv python install ${{ matrix.python-version }}
29
+
30
+ - name: Install
31
+ run: |
32
+ uv venv --python ${{ matrix.python-version }}
33
+ uv pip install -e ".[dev]"
34
+
35
+ - name: Lint
36
+ run: uv run ruff check .
37
+
38
+ - name: Test
39
+ # Deselects one pre-existing concurrency-ordering flake in batch-label;
40
+ # tracked separately. All other tests must pass.
41
+ run: |
42
+ uv run pytest \
43
+ --deselect tests/test_bulk.py::TestBatchLabelFile::test_runs_gt_1_adds_variability_columns
44
+
45
+ build:
46
+ runs-on: ubuntu-latest
47
+ needs: test
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+
51
+ - name: Set up uv
52
+ uses: astral-sh/setup-uv@v3
53
+
54
+ - name: Build wheel
55
+ run: |
56
+ uv venv --python 3.12
57
+ uv pip install build
58
+ uv run python -m build --wheel
59
+
60
+ - name: Verify wheel contents
61
+ run: |
62
+ # Negative check: NO skills/ in the wheel.
63
+ if unzip -l dist/musubi_client-*.whl | grep -q "^.*skills/"; then
64
+ echo "ERROR: skills/ leaked into the wheel" >&2
65
+ exit 1
66
+ fi
67
+ # Positive check: data/hosts.json IS bundled.
68
+ if ! unzip -l dist/musubi_client-*.whl | grep -q "musubi/data/hosts.json"; then
69
+ echo "ERROR: musubi/data/hosts.json missing from wheel" >&2
70
+ exit 1
71
+ fi
72
+
73
+ - uses: actions/upload-artifact@v4
74
+ with:
75
+ name: wheel
76
+ path: dist/*.whl
@@ -0,0 +1,107 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ['v*']
6
+
7
+ jobs:
8
+ publish-to-pypi:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ # Specifying `permissions:` sets every UNLISTED scope to `none`, so we
13
+ # must grant `contents: read` explicitly — otherwise actions/checkout
14
+ # gets no repo access and fails with a misleading "Repository not found".
15
+ contents: read
16
+ # Required for PyPI trusted publishing (no API token in repo secrets).
17
+ id-token: write
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up uv
22
+ uses: astral-sh/setup-uv@v3
23
+
24
+ - name: Build wheel + sdist
25
+ run: |
26
+ uv venv --python 3.12
27
+ uv pip install build
28
+ uv run python -m build
29
+
30
+ - name: Sanity-check wheel
31
+ run: |
32
+ # Match the CI checks — refuse to publish a wheel that leaked skills
33
+ # or is missing the bundled hosts.json fallback.
34
+ if unzip -l dist/musubi_client-*.whl | grep -q "^.*skills/"; then
35
+ echo "ERROR: skills/ leaked into the wheel" >&2
36
+ exit 1
37
+ fi
38
+ if ! unzip -l dist/musubi_client-*.whl | grep -q "musubi/data/hosts.json"; then
39
+ echo "ERROR: musubi/data/hosts.json missing from wheel" >&2
40
+ exit 1
41
+ fi
42
+
43
+ - name: Publish to PyPI (trusted publishing)
44
+ uses: pypa/gh-action-pypi-publish@release/v1
45
+
46
+ cross-repo-pr:
47
+ name: Sync install.sh + hosts.json into policy-ai-frontend
48
+ runs-on: ubuntu-latest
49
+ needs: publish-to-pypi
50
+ steps:
51
+ - name: Checkout musubi-client
52
+ uses: actions/checkout@v4
53
+ with:
54
+ path: musubi-client
55
+
56
+ - name: Checkout policy-ai-frontend
57
+ uses: actions/checkout@v4
58
+ with:
59
+ repository: musubi-labs/policy-ai-frontend
60
+ path: policy-ai-frontend
61
+ token: ${{ secrets.CROSS_REPO_PR_TOKEN }}
62
+
63
+ - name: Sync artifacts
64
+ run: |
65
+ set -eu
66
+ # Skills are NOT synced from here — they live natively in
67
+ # policy-ai-frontend/src/lib/skills (the frontend is the source of
68
+ # truth). musubi-client only owns install.sh and hosts.json.
69
+ # install.sh: copy single file.
70
+ cp musubi-client/scripts/install.sh policy-ai-frontend/static/install.sh
71
+ # hosts.json: copy single file.
72
+ mkdir -p policy-ai-frontend/static/cli
73
+ cp musubi-client/data/hosts.json policy-ai-frontend/static/cli/hosts.json
74
+
75
+ - name: Open PR
76
+ env:
77
+ # `gh` ships pre-installed on GitHub-hosted runners. It reads
78
+ # GH_TOKEN (or GITHUB_TOKEN) from env for auth — no `gh auth login`
79
+ # call needed in CI. We use a custom token (CROSS_REPO_PR_TOKEN)
80
+ # rather than the workflow's automatic GITHUB_TOKEN because the
81
+ # latter scopes to musubi-client only; we need write access to a
82
+ # different repo (policy-ai-frontend).
83
+ GH_TOKEN: ${{ secrets.CROSS_REPO_PR_TOKEN }}
84
+ run: |
85
+ set -eu
86
+ # Sanity: confirm `gh` is on PATH on this runner.
87
+ command -v gh >/dev/null 2>&1 || { echo "gh CLI not found" >&2; exit 1; }
88
+ cd policy-ai-frontend
89
+ BRANCH="musubi-client-sync-${GITHUB_REF_NAME}"
90
+ git config user.email "ci@musubilabs.ai"
91
+ git config user.name "musubi-client release bot"
92
+ git checkout -b "$BRANCH"
93
+ # `git diff --quiet` returns 0 when there are no changes — early exit
94
+ # so we don't open an empty PR (e.g. tagging a release that didn't
95
+ # touch skills / install.sh / hosts.json).
96
+ if git diff --quiet && git diff --cached --quiet; then
97
+ echo "No artifact changes to sync; skipping PR."
98
+ exit 0
99
+ fi
100
+ git add static/install.sh static/cli/hosts.json
101
+ git commit -m "Sync musubi-client artifacts (${GITHUB_REF_NAME})"
102
+ git push -u origin "$BRANCH"
103
+ gh pr create \
104
+ --title "Sync musubi-client artifacts (${GITHUB_REF_NAME})" \
105
+ --body "Auto-generated by musubi-client release ${GITHUB_REF_NAME}. Updates install.sh and hosts.json. (Skills live natively in the frontend's src/lib/skills.) Frontend deploy will serve them." \
106
+ --base main \
107
+ --head "$BRANCH"
@@ -0,0 +1,25 @@
1
+ # Build artifacts
2
+ /dist/
3
+ /build/
4
+ *.egg-info/
5
+ __pycache__/
6
+ *.pyc
7
+
8
+ # Virtualenvs
9
+ /.venv/
10
+ /venv/
11
+
12
+ # Editor / OS
13
+ .DS_Store
14
+ .idea/
15
+ .vscode/
16
+
17
+ # Test artifacts
18
+ .pytest_cache/
19
+ .ruff_cache/
20
+ .coverage
21
+ htmlcov/
22
+
23
+ # Codegen scratch
24
+ /musubi-generated/
25
+ uv.lock
@@ -0,0 +1,152 @@
1
+ # Contributing & Maintenance
2
+
3
+ Development guide for working on the Musubi SDK and MCP server.
4
+
5
+ ## Initial setup
6
+
7
+ From a checkout of this (`musubi-client`) repo:
8
+
9
+ ```bash
10
+ uv venv .venv
11
+ uv pip install -e ".[dev]" --python .venv/bin/python
12
+ ```
13
+
14
+ `mcp` is a hard dependency (no separate extra); `.[dev]` adds the test/lint
15
+ toolchain.
16
+
17
+ ## Running tests
18
+
19
+ ```bash
20
+ # Unit tests (no API access needed, fast)
21
+ .venv/bin/pytest tests/test_client.py -v
22
+
23
+ # Integration tests (requires env vars, hits live API, creates/cleans up resources)
24
+ .venv/bin/pytest tests/test_integration.py -v -s
25
+
26
+ # All tests
27
+ .venv/bin/pytest -v
28
+ ```
29
+
30
+ Integration tests read `MUSUBI_API_KEY` / `MUSUBI_ORG_ID` from the environment
31
+ and are skipped when unset.
32
+
33
+ ## Linting and formatting
34
+
35
+ ```bash
36
+ # Check
37
+ uv run --with ruff ruff check src/ tests/
38
+
39
+ # Auto-fix and format
40
+ uv run --with ruff ruff check --fix src/ tests/
41
+ uv run --with ruff ruff format src/ tests/
42
+ ```
43
+
44
+ Or via Makefile: `make lint`, `make format`, `make test`, `make install`.
45
+
46
+ ## Regenerating the generated client
47
+
48
+ Do this when the PolicyAI API changes (new endpoints, changed models). The
49
+ Makefile drives the whole pipeline (fetch/extract spec → fix spec → generate →
50
+ copy into `src/musubi/_generated/`):
51
+
52
+ ```bash
53
+ make generate # fetch the spec from a deployed URL
54
+ make generate-from-monorepo # extract the spec from a local policy-ai checkout
55
+ make test # verify nothing broke
56
+ ```
57
+
58
+ `make generate` chains `fetch-spec → fix-spec → generate-client →
59
+ copy-generated`. The `-from-monorepo` variant swaps the first step for
60
+ `extract-spec`, which boots the FastAPI app from an adjacent `policy-ai`
61
+ checkout. See the `Makefile` for the exact commands and overridable variables.
62
+
63
+ **What the fix script does:** Pydantic v2 generates separate Input/Output
64
+ schema variants with dashes in the name (`FooModel-Input`). The generator
65
+ chokes on these. The fix script renames them and updates titles to be unique.
66
+ It also strips `application/yaml` content types that the generator doesn't
67
+ support.
68
+
69
+ ## Smoke testing against the live API
70
+
71
+ Quick sanity check that the SDK can talk to the API (reads `MUSUBI_API_KEY` /
72
+ `MUSUBI_ORG_ID` from the environment):
73
+
74
+ ```bash
75
+ .venv/bin/python scripts/smoke_test.py
76
+ ```
77
+
78
+ This tests basic operations (list policies, list models, evaluate content) and
79
+ reports pass/fail for each.
80
+
81
+ ## Testing the MCP server locally
82
+
83
+ ```bash
84
+ .venv/bin/python -c "
85
+ from musubi.mcp_server import mcp
86
+ tools = mcp._tool_manager.list_tools()
87
+ print(f'{len(tools)} tools loaded')
88
+ for t in sorted(tools, key=lambda x: x.name):
89
+ print(f' {t.name}')
90
+ "
91
+ ```
92
+
93
+ To test in read-only mode, add `MUSUBI_READ_ONLY=true` to the command.
94
+
95
+ ## Adding a new API endpoint to the SDK
96
+
97
+ 1. Regenerate the base client (see above) — the new endpoint will appear in
98
+ `_generated/`
99
+ 2. Add a method to the appropriate resource class in `src/musubi/resources/`
100
+ (both sync and async variants)
101
+ 3. Add a tool in `mcp_server.py` — use `@mcp.tool` for read-only,
102
+ `@_tool` for mutations (with `_require_writes` check)
103
+ 4. Add unit test(s) in `test_client.py`
104
+ 5. Add integration test(s) in `test_integration.py`
105
+ 6. Update the README if the new resource changes the public API surface
106
+
107
+ ## Adding a new v2 resource that replaces a v1 resource
108
+
109
+ 1. Add the v2 resource class
110
+ 2. Wire it into `MusubiClient` and `AsyncMusubiClient`
111
+ 3. Remove the old v1 resource class file
112
+ 4. Remove v1 imports and attributes from `client.py`
113
+ 5. Update the supersession map in `client.py`'s module docstring
114
+ 6. Remove v1 MCP tools and add v2 ones
115
+ 7. Update tests
116
+
117
+ ## OpenAPI spec extraction
118
+
119
+ The SDK includes scripts to extract the OpenAPI spec from the FastAPI app:
120
+
121
+ - `scripts/extract_openapi.py` — boots the app with `DOCS_VIEW=deployed` to
122
+ get the customer-facing spec (filtered endpoints, Musubi-Api-Key auth)
123
+ - `scripts/fix_openapi_spec.py` — fixes two issues the generator can't handle:
124
+ 1. Pydantic v2's `-Input`/`-Output` schema name suffixes cause duplicate
125
+ class names. The script renames them and updates titles.
126
+ 2. `application/yaml` content type on v2 policy endpoints is stripped (the
127
+ generator only supports JSON).
128
+
129
+ ## Testing strategy
130
+
131
+ **Unit tests** (`test_client.py`): Mock HTTP with `respx`. Test every resource,
132
+ error handling, auth headers, envelope unwrapping. Fast (~0.1s). Run always.
133
+
134
+ **Integration tests** (`test_integration.py`): Hit the live API. Create real
135
+ resources, test every SDK method, clean up afterwards. Skipped when env vars
136
+ aren't set. Cover the full CRUD lifecycle for each resource plus the complete
137
+ v2 labeling flow (create policy → create version → create endpoint → label
138
+ content).
139
+
140
+ The MCP server itself is tested indirectly through the SDK — the tools are
141
+ thin wrappers over SDK methods, so SDK test coverage implies MCP coverage.
142
+ The server's tool registration and mode filtering are verified via the
143
+ `_tool_manager.list_tools()` introspection in the smoke tests.
144
+
145
+ ## Key files to understand
146
+
147
+ | File | Purpose |
148
+ |------|---------|
149
+ | `src/musubi/client.py` | Client classes + supersession policy doc |
150
+ | `src/musubi/_base.py` | `_request` / `_request_data` (envelope unwrapping) |
151
+ | `src/musubi/mcp_server.py` | All MCP tools, write gate, defaults |
152
+ | `scripts/fix_openapi_spec.py` | OpenAPI spec preprocessing |
@@ -0,0 +1,198 @@
1
+ # SDK & MCP Server Design Decisions
2
+
3
+ This document explains the design choices behind the Musubi Python SDK and MCP
4
+ server. Read this before making changes to understand why things are the way
5
+ they are.
6
+
7
+ ## SDK Architecture
8
+
9
+ ### Hybrid generation approach
10
+
11
+ The SDK uses `openapi-python-client` to generate a base HTTP client from the
12
+ OpenAPI spec, then wraps it with a hand-written ergonomic layer. The generated
13
+ code lives in `src/musubi/_generated/` and should never be edited manually.
14
+
15
+ **Why not pure generated?** The generated client has several usability issues:
16
+ - camelCase field names (from the API's JSON convention) instead of Pythonic snake_case
17
+ - Envelope wrapping (`{"data": ..., "messages": [...]}`) not unwrapped
18
+ - Auth requires manual header configuration
19
+ - Uses `attrs` classes instead of plain dicts — unfamiliar to most users
20
+
21
+ **Why not fully hand-written?** The API has 37 endpoints and 154 schemas. Hand-
22
+ writing HTTP calls for all of them is error-prone and hard to keep in sync.
23
+
24
+ **The hybrid approach** gives us the best of both: the generated layer handles
25
+ all the HTTP/serialization plumbing, and the wrapper provides a clean public
26
+ API. If the generator breaks or we outgrow it, we can swap it out — the wrapper
27
+ layer stays the same.
28
+
29
+ ### Envelope unwrapping
30
+
31
+ The PolicyAI API wraps every response in `{"data": ..., "messages": [...]}`.
32
+ The SDK's `_base.py` has `_request_data()` which automatically extracts the
33
+ `data` field. This means SDK users never see the envelope. The `messages` field
34
+ (used for deprecation warnings etc.) is currently discarded — we can surface it
35
+ later via logging if needed.
36
+
37
+ One exception: `datasets.get_items()` returns `{"items": [...]}` inside the
38
+ envelope, so it does an extra unwrap to return a flat list.
39
+
40
+ ### v2 only (with exceptions)
41
+
42
+ The SDK only exposes v2 API surfaces. Superseded v1 endpoints are intentionally
43
+ excluded to avoid confusing customers with two ways to do the same thing. The
44
+ full supersession map is documented in `client.py`'s module docstring.
45
+
46
+ Two v1 resources are kept because they have no v2 equivalent:
47
+ - **Datasets** — test/evaluation dataset management
48
+ - ~~Evaluations~~ — removed; operates on v1 policy UUIDs only
49
+
50
+ When v2 equivalents ship for these, remove the v1 versions rather than
51
+ maintaining both.
52
+
53
+ ### No Pydantic models in the public API
54
+
55
+ The SDK returns plain dicts, not typed Pydantic models. This was deliberate:
56
+ - The API uses camelCase and the response shapes vary between endpoints
57
+ - Wrapping every response in a Pydantic model would mean maintaining ~50 model
58
+ classes that mirror the server's models
59
+ - Dicts are simpler for LLM tool outputs (the primary consumer via MCP)
60
+ - If customers need typed models, they can use the generated client directly
61
+ from `musubi._generated`
62
+
63
+ ### Sync + async
64
+
65
+ Both `MusubiClient` (sync) and `AsyncMusubiClient` (async) are provided. They
66
+ share the same resource classes — `SyncResource` and `AsyncResource` in
67
+ `_base.py` have identical method signatures, just sync vs async. This avoids
68
+ forcing customers into async when they don't need it.
69
+
70
+ ## MCP Server Design
71
+
72
+ ### One tool per SDK method
73
+
74
+ Each SDK method maps to exactly one MCP tool. No multi-action tools with a
75
+ "mode" parameter. This follows MCP best practices — granular tools compose
76
+ better and LLMs make fewer mistakes when each tool does one thing.
77
+
78
+ ### Tool naming: `musubi_{resource}_{action}`
79
+
80
+ All tools are prefixed with `musubi_` to avoid collisions with other MCP
81
+ servers. The resource name comes next, then the action. This groups related
82
+ tools together in alphabetical listings.
83
+
84
+ ### Write gate (two layers)
85
+
86
+ **Problem:** LLMs can accidentally mutate production data. MCP doesn't have a
87
+ native permissions system — it relies on the client (Claude Code) to prompt
88
+ before tool calls. But users can configure auto-approve, bypassing that check.
89
+
90
+ **Solution: two layers of protection.**
91
+
92
+ 1. **Soft gate (default):** All tools are registered, but mutation tools check
93
+ an in-memory `_writes_enabled` flag. It starts `False`. The LLM must call
94
+ `musubi_enable_writes` first, which Claude Code prompts the user to approve.
95
+ This is the confirmation step for normal usage.
96
+
97
+ 2. **Hard read-only (`MUSUBI_READ_ONLY=true`):** Mutation tools are not
98
+ registered at all — they don't exist in the server's tool schema. This is
99
+ for production orgs where you want zero risk regardless of client settings.
100
+ The `_tool()` decorator wrapper checks the flag and returns a no-op
101
+ decorator for non-read-only tools.
102
+
103
+ The gate tools (`musubi_enable_writes`, `musubi_disable_writes`) are always
104
+ registered via `@mcp.tool` (not `@_tool`) so they can explain the current
105
+ state even in hard read-only mode.
106
+
107
+ `musubi_server_info` is always read-only and shows the current mode.
108
+
109
+ ### Label operations are read-only
110
+
111
+ Labeling (evaluate) calls are POST requests that create records in the API, but
112
+ from the user's perspective they're read operations — "tell me how this content
113
+ would be classified." They don't modify policies, endpoints, or datasets. So
114
+ they're marked `readOnlyHint: True` and work without `musubi_enable_writes`,
115
+ including in hard read-only mode.
116
+
117
+ ### Smart defaults for policy creation
118
+
119
+ `musubi_create_policy_version` and `musubi_create_policy_draft` accept
120
+ high-level parameters (`labels`, `policy_text`) and fill in sensible defaults:
121
+ - Model: mango (id 104) with `reasoningEffort: "none"`
122
+ - Output fields: `["analysis", "riskScore"]`
123
+ - Prompt template: standard moderation system prompt with `{{ policy_text }}`
124
+ - Content keys: `[{"type": "TEXT", "key": "content"}]`
125
+
126
+ This means the LLM only needs to provide the two things that actually vary
127
+ between policies (the labels and the policy text). The raw `policy_data` dict
128
+ is still accepted for full control.
129
+
130
+ `additionalOutputFields` is exposed as a first-class parameter instead of
131
+ being buried inside `policy_data`. This avoids the common mistake of trying
132
+ to use `outputFieldDefinitions` directly (which requires the full field schema
133
+ instead of just preset names).
134
+
135
+ ### Batch labeling and consistency testing
136
+
137
+ `musubi_batch_label` runs multiple items through a policy in parallel using
138
+ `ThreadPoolExecutor`. Default parallelism is 15. Results are returned in input
139
+ order with the index preserved. Each thread catches all exceptions so one
140
+ failure doesn't crash the batch.
141
+
142
+ `musubi_consistency_test` runs the same text N times (default 3) and adds a
143
+ summary with label counts and agreement rate. Returns all individual results
144
+ plus the summary — the LLM can analyze the raw results if the summary isn't
145
+ enough.
146
+
147
+ Both tools share `_run_parallel_labels()` and `_label_one()` to avoid code
148
+ duplication.
149
+
150
+ ### Error handling
151
+
152
+ API errors are caught and returned as JSON `{"error": "..."}` strings rather
153
+ than raising exceptions. MCP tools must return text — uncaught exceptions would
154
+ crash the server process.
155
+
156
+ The 409 archive conflict error gets special treatment: when you try to archive
157
+ a policy that's referenced by endpoints, the error includes a `hint` field
158
+ explaining the workaround (repoint or archive the endpoints first, with the
159
+ specific tool names to use).
160
+
161
+ ## File Layout
162
+
163
+ ```
164
+ musubi-client/
165
+ ├── pyproject.toml # Package config, deps, ruff/pytest config
166
+ ├── Makefile # generate, test, lint, format, clean
167
+ ├── README.md # Installation and usage reference
168
+ ├── GETTING_STARTED.md # Onboarding guide
169
+ ├── DESIGN.md # This file
170
+ ├── CONTRIBUTING.md # Development, testing, and maintenance guide
171
+ ├── generator-config.yaml # openapi-python-client config
172
+ ├── scripts/
173
+ │ ├── extract_openapi.py # Extract spec from FastAPI app
174
+ │ ├── fix_openapi_spec.py # Fix spec issues for generator
175
+ │ └── smoke_test.py # Quick live API smoke test
176
+ │ # NOTE: no skills/ here — skills live in policy-ai-frontend/src/lib/skills
177
+ │ # (source of truth), served via /cli/skills. `install-skills --from-dir`
178
+ │ # installs from a local folder for testing.
179
+ ├── src/musubi/
180
+ │ ├── __init__.py # Public exports
181
+ │ ├── client.py # MusubiClient / AsyncMusubiClient + service wiring
182
+ │ ├── _base.py # SyncResource / AsyncResource (envelope unwrap)
183
+ │ ├── _cli_shared.py # Leaf CLI helpers (parse_kv_pairs, short_id)
184
+ │ ├── exceptions.py # Typed exception hierarchy
185
+ │ ├── cli.py # Click CLI root
186
+ │ ├── commands/ # CLI subcommands (login, dataset, doctor, ...)
187
+ │ ├── mcp_server.py # MCP server (35 tools)
188
+ │ ├── mcp_hosts.py # MCP host catalog + register/unregister
189
+ │ ├── datasets_workflow.py # Path A / Path B dataset workflows
190
+ │ ├── bulk.py / labeling.py / policy_diff.py / policy_helpers.py / prompts.py
191
+ │ ├── auth/ # config (creds/deployment), iam, device_flow
192
+ │ ├── _generated/ # Auto-generated PolicyAI client (do not edit)
193
+ │ └── resources/ # Per-service SDK surface
194
+ │ ├── policyai/ # labels, endpoints, policies, models
195
+ │ ├── iam/ # users, organizations
196
+ │ └── datasets/ # dataset (schema-first columnar service)
197
+ └── tests/ # Unit + integration (live API) tests
198
+ ```