runtype 0.1.0 → 0.2.1

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 (209) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -0
  3. data/README.md +92 -6
  4. data/generated/lib/runtype/agent_aliases/client.rb +320 -0
  5. data/generated/lib/runtype/agent_aliases/types/delete_v1agents_id_aliases_alias_request.rb +17 -0
  6. data/generated/lib/runtype/agent_aliases/types/delete_v1agents_id_aliases_alias_response.rb +17 -0
  7. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_alias_request.rb +15 -0
  8. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_alias_response.rb +29 -0
  9. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_request.rb +17 -0
  10. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_response.rb +13 -0
  11. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_aliases_response_data_item.rb +29 -0
  12. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_deployments_request.rb +17 -0
  13. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_deployments_response.rb +13 -0
  14. data/generated/lib/runtype/agent_aliases/types/get_v1agents_id_deployments_response_data_item.rb +29 -0
  15. data/generated/lib/runtype/agent_aliases/types/post_v1agents_id_aliases_alias_rollback_request.rb +21 -0
  16. data/generated/lib/runtype/agent_aliases/types/post_v1agents_id_aliases_alias_rollback_response.rb +21 -0
  17. data/generated/lib/runtype/agent_aliases/types/put_v1agents_id_aliases_alias_request.rb +21 -0
  18. data/generated/lib/runtype/agent_aliases/types/put_v1agents_id_aliases_alias_response.rb +21 -0
  19. data/generated/lib/runtype/agents/client.rb +14 -2
  20. data/generated/lib/runtype/agents/types/get_v1agents_id_executions_execution_id_response.rb +6 -0
  21. data/generated/lib/runtype/agents/types/get_v1agents_id_executions_execution_id_response_agent_target_resolution.rb +15 -0
  22. data/generated/lib/runtype/agents/types/get_v1agents_id_executions_execution_id_response_agent_version.rb +17 -0
  23. data/generated/lib/runtype/agents/types/get_v1agents_id_executions_response_data_item.rb +6 -0
  24. data/generated/lib/runtype/agents/types/get_v1agents_id_executions_response_data_item_agent_target_resolution.rb +15 -0
  25. data/generated/lib/runtype/agents/types/get_v1agents_id_executions_response_data_item_agent_version.rb +17 -0
  26. data/generated/lib/runtype/agents/types/get_v1agents_id_response.rb +2 -0
  27. data/generated/lib/runtype/agents/types/get_v1agents_id_response_sandbox_capability_issues_item.rb +19 -0
  28. data/generated/lib/runtype/agents/types/get_v1agents_id_response_sandbox_capability_issues_item_code.rb +13 -0
  29. data/generated/lib/runtype/agents/types/get_v1agents_request.rb +2 -0
  30. data/generated/lib/runtype/agents/types/get_v1agents_request_managed_in_code.rb +14 -0
  31. data/generated/lib/runtype/agents/types/get_v1agents_response_data_item.rb +4 -0
  32. data/generated/lib/runtype/agents/types/get_v1agents_response_data_item_sandbox_capability_issues_item.rb +19 -0
  33. data/generated/lib/runtype/agents/types/get_v1agents_response_data_item_sandbox_capability_issues_item_code.rb +13 -0
  34. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request.rb +4 -0
  35. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config.rb +2 -0
  36. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_context_management.rb +13 -0
  37. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_context_management_compaction.rb +23 -0
  38. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_context_management_compaction_strategy.rb +15 -0
  39. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_context_management_tool_results.rb +15 -0
  40. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_context_management_tool_results_prune_mode.rb +14 -0
  41. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice.rb +8 -0
  42. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_endpointing.rb +13 -0
  43. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_endpointing_strategy.rb +16 -0
  44. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_speech.rb +15 -0
  45. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_speech_mode.rb +15 -0
  46. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_speech_synthesizer.rb +17 -0
  47. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_speech_synthesizer_settings.rb +13 -0
  48. data/generated/lib/runtype/agents/types/post_v1agents_ensure_request_definition_config_voice_speech_transcriber.rb +13 -0
  49. data/generated/lib/runtype/agents/types/post_v1agents_request_config.rb +2 -0
  50. data/generated/lib/runtype/agents/types/post_v1agents_request_config_context_management.rb +13 -0
  51. data/generated/lib/runtype/agents/types/post_v1agents_request_config_context_management_compaction.rb +23 -0
  52. data/generated/lib/runtype/agents/types/post_v1agents_request_config_context_management_compaction_strategy.rb +15 -0
  53. data/generated/lib/runtype/agents/types/post_v1agents_request_config_context_management_tool_results.rb +15 -0
  54. data/generated/lib/runtype/agents/types/post_v1agents_request_config_context_management_tool_results_prune_mode.rb +14 -0
  55. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice.rb +8 -0
  56. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_endpointing.rb +13 -0
  57. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_endpointing_strategy.rb +16 -0
  58. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_speech.rb +15 -0
  59. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_speech_mode.rb +15 -0
  60. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_speech_synthesizer.rb +17 -0
  61. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_speech_synthesizer_settings.rb +13 -0
  62. data/generated/lib/runtype/agents/types/post_v1agents_request_config_voice_speech_transcriber.rb +13 -0
  63. data/generated/lib/runtype/agents/types/post_v1agents_response.rb +2 -0
  64. data/generated/lib/runtype/agents/types/post_v1agents_response_sandbox_capability_issues_item.rb +19 -0
  65. data/generated/lib/runtype/agents/types/post_v1agents_response_sandbox_capability_issues_item_code.rb +13 -0
  66. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config.rb +2 -0
  67. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_context_management.rb +13 -0
  68. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_context_management_compaction.rb +23 -0
  69. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_context_management_compaction_strategy.rb +15 -0
  70. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_context_management_tool_results.rb +15 -0
  71. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_context_management_tool_results_prune_mode.rb +14 -0
  72. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice.rb +8 -0
  73. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_endpointing.rb +13 -0
  74. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_endpointing_strategy.rb +16 -0
  75. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_speech.rb +15 -0
  76. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_speech_mode.rb +15 -0
  77. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_speech_synthesizer.rb +17 -0
  78. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_speech_synthesizer_settings.rb +13 -0
  79. data/generated/lib/runtype/agents/types/put_v1agents_id_request_config_voice_speech_transcriber.rb +13 -0
  80. data/generated/lib/runtype/agents/types/put_v1agents_id_response.rb +2 -0
  81. data/generated/lib/runtype/agents/types/put_v1agents_id_response_sandbox_capability_issues_item.rb +19 -0
  82. data/generated/lib/runtype/agents/types/put_v1agents_id_response_sandbox_capability_issues_item_code.rb +13 -0
  83. data/generated/lib/runtype/analytics/types/get_v1analytics_record_results_response_data_data_results_item.rb +4 -0
  84. data/generated/lib/runtype/client.rb +5 -0
  85. data/generated/lib/runtype/dispatch/client.rb +11 -4
  86. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent.rb +6 -0
  87. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_durability.rb +15 -0
  88. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_durability_forced.rb +14 -0
  89. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice.rb +8 -0
  90. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_endpointing.rb +13 -0
  91. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_endpointing_strategy.rb +16 -0
  92. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_speech.rb +15 -0
  93. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_speech_mode.rb +15 -0
  94. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_speech_synthesizer.rb +17 -0
  95. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_speech_synthesizer_settings.rb +13 -0
  96. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_one_agent_voice_speech_transcriber.rb +13 -0
  97. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent.rb +6 -0
  98. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_durability.rb +15 -0
  99. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_durability_forced.rb +14 -0
  100. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice.rb +8 -0
  101. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_endpointing.rb +13 -0
  102. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_endpointing_strategy.rb +16 -0
  103. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_speech.rb +15 -0
  104. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_speech_mode.rb +15 -0
  105. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_speech_synthesizer.rb +17 -0
  106. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_speech_synthesizer_settings.rb +13 -0
  107. data/generated/lib/runtype/dispatch/types/post_v1dispatch_request_zero_agent_voice_speech_transcriber.rb +13 -0
  108. data/generated/lib/runtype/evals/types/get_v1eval_id_results_response.rb +2 -0
  109. data/generated/lib/runtype/evals/types/get_v1eval_id_results_response_case_errors_item.rb +15 -0
  110. data/generated/lib/runtype/executions/client.rb +53 -0
  111. data/generated/lib/runtype/executions/types/get_v1executions_execution_id_events_request.rb +15 -0
  112. data/generated/lib/runtype/executions/types/get_v1executions_execution_id_status_response.rb +6 -0
  113. data/generated/lib/runtype/executions/types/get_v1executions_execution_id_status_response_agent_target_resolution.rb +15 -0
  114. data/generated/lib/runtype/executions/types/get_v1executions_execution_id_status_response_agent_version.rb +16 -0
  115. data/generated/lib/runtype/flows/client.rb +2 -1
  116. data/generated/lib/runtype/flows/types/post_v1flows_ensure_request.rb +2 -0
  117. data/generated/lib/runtype/model_configs/types/post_v1model_configs_request_settings_custom_model.rb +2 -0
  118. data/generated/lib/runtype/model_configs/types/post_v1model_configs_request_settings_custom_model_reasoning.rb +13 -0
  119. data/generated/lib/runtype/model_configs/types/put_v1model_configs_id_request_settings_custom_model.rb +2 -0
  120. data/generated/lib/runtype/model_configs/types/put_v1model_configs_id_request_settings_custom_model_reasoning.rb +13 -0
  121. data/generated/lib/runtype/provider_keys/types/post_v1provider_keys_id_sync_models_request_models_item.rb +2 -0
  122. data/generated/lib/runtype/provider_keys/types/post_v1provider_keys_id_sync_models_request_models_item_reasoning.rb +13 -0
  123. data/generated/lib/runtype/records/types/get_v1records_id_results_response_data_item.rb +4 -0
  124. data/generated/lib/runtype/tools/client.rb +11 -11
  125. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request.rb +29 -0
  126. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request_language.rb +15 -0
  127. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request_retention.rb +16 -0
  128. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request_sleep_policy.rb +17 -0
  129. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request_sleep_policy_idle.rb +11 -0
  130. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request_sleep_policy_idle_after.rb +16 -0
  131. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_request_sleep_policy_never.rb +9 -0
  132. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response.rb +2 -0
  133. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy.rb +23 -0
  134. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_metering.rb +14 -0
  135. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_origin.rb +14 -0
  136. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_retention.rb +16 -0
  137. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_sleep_policy.rb +17 -0
  138. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_sleep_policy_idle.rb +11 -0
  139. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_sleep_policy_idle_after.rb +16 -0
  140. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_cf_sandbox_deploy_response_effective_policy_sleep_policy_never.rb +9 -0
  141. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request.rb +35 -0
  142. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request_language.rb +15 -0
  143. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request_retention.rb +16 -0
  144. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request_sleep_policy.rb +17 -0
  145. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request_sleep_policy_idle.rb +11 -0
  146. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request_sleep_policy_idle_after.rb +16 -0
  147. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_request_sleep_policy_never.rb +9 -0
  148. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response.rb +2 -0
  149. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy.rb +23 -0
  150. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_metering.rb +14 -0
  151. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_origin.rb +14 -0
  152. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_retention.rb +16 -0
  153. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_sleep_policy.rb +17 -0
  154. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_sleep_policy_idle.rb +11 -0
  155. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_sleep_policy_idle_after.rb +16 -0
  156. data/generated/lib/runtype/tools/types/post_v1tools_sandbox_deploy_response_effective_policy_sleep_policy_never.rb +9 -0
  157. data/generated/lib/runtype/types/agent_ensure_bad_request.rb +11 -0
  158. data/generated/lib/runtype/types/agent_ensure_bad_request_code.rb +11 -0
  159. data/generated/lib/runtype/types/agent_ensure_deploy_target.rb +15 -0
  160. data/generated/lib/runtype/types/agent_ensure_deployment.rb +20 -0
  161. data/generated/lib/runtype/types/agent_ensure_response_changed_keys.rb +2 -0
  162. data/generated/lib/runtype/types/agent_ensure_response_changed_keys_deployment.rb +20 -0
  163. data/generated/lib/runtype/types/agent_ensure_response_version_id.rb +4 -0
  164. data/generated/lib/runtype/types/agent_ensure_server_error.rb +13 -0
  165. data/generated/lib/runtype/types/agent_ensure_server_error_code.rb +11 -0
  166. data/generated/lib/runtype/types/agent_pull_response_definition_config.rb +2 -0
  167. data/generated/lib/runtype/types/agent_pull_response_definition_config_context_management.rb +11 -0
  168. data/generated/lib/runtype/types/agent_pull_response_definition_config_context_management_compaction.rb +21 -0
  169. data/generated/lib/runtype/types/agent_pull_response_definition_config_context_management_compaction_strategy.rb +13 -0
  170. data/generated/lib/runtype/types/agent_pull_response_definition_config_context_management_tool_results.rb +13 -0
  171. data/generated/lib/runtype/types/agent_pull_response_definition_config_context_management_tool_results_prune_mode.rb +12 -0
  172. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice.rb +8 -0
  173. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_endpointing.rb +11 -0
  174. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_endpointing_strategy.rb +14 -0
  175. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_speech.rb +13 -0
  176. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_speech_mode.rb +13 -0
  177. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_speech_synthesizer.rb +15 -0
  178. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_speech_synthesizer_settings.rb +11 -0
  179. data/generated/lib/runtype/types/agent_pull_response_definition_config_voice_speech_transcriber.rb +11 -0
  180. data/generated/lib/runtype/types/dispatch_continuation_json_response.rb +2 -0
  181. data/generated/lib/runtype/types/dispatch_detached_tool_output_json_response.rb +13 -0
  182. data/generated/lib/runtype/types/dispatch_detached_tool_output_json_response_pause_kind.rb +12 -0
  183. data/generated/lib/runtype/types/dispatch_detached_tool_output_json_response_status.rb +11 -0
  184. data/generated/lib/runtype/types/dispatch_resume_json_response.rb +13 -0
  185. data/generated/lib/runtype/types/ensure_version_metadata.rb +13 -0
  186. data/generated/lib/runtype/types/eval_run_scores_response_cases_item.rb +2 -0
  187. data/generated/lib/runtype/types/execution_stream_event.rb +2 -0
  188. data/generated/lib/runtype/types/execution_stream_event_context_notice.rb +29 -0
  189. data/generated/lib/runtype/types/execution_stream_event_context_notice_kind.rb +11 -0
  190. data/generated/lib/runtype/types/execution_stream_event_context_notice_outcome.rb +14 -0
  191. data/generated/lib/runtype/types/execution_stream_event_context_notice_phase.rb +12 -0
  192. data/generated/lib/runtype/types/execution_stream_event_context_notice_reason.rb +15 -0
  193. data/generated/lib/runtype/types/execution_stream_event_context_notice_strategy.rb +12 -0
  194. data/generated/lib/runtype/types/not_found_error_body_code.rb +11 -0
  195. data/generated/lib/runtype/types/precondition_failed_error_body.rb +17 -0
  196. data/generated/lib/runtype/types/precondition_failed_error_body_code.rb +11 -0
  197. data/generated/lib/runtype/types/run_eval_response_cases_item.rb +2 -0
  198. data/generated/lib/runtype.rb +157 -5
  199. data/lib/runtype/agent_definition.rb +331 -0
  200. data/lib/runtype/agent_ensure.rb +110 -0
  201. data/lib/runtype/canonical_json.rb +89 -0
  202. data/lib/runtype/client.rb +86 -30
  203. data/lib/runtype/detached_follow.rb +136 -0
  204. data/lib/runtype/errors.rb +91 -1
  205. data/lib/runtype/local_tool_runner.rb +222 -0
  206. data/lib/runtype/local_tools.rb +258 -0
  207. data/lib/runtype/sdk_version.rb +1 -1
  208. data/lib/runtype.rb +7 -1
  209. metadata +160 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88d76ad46808e8a8a0c06eb80f6b2ff0c61065f12d9762884af36689151f7e37
4
- data.tar.gz: ac201871d379ec67b60e7cb6d34b1df429c4723a26b2a5843225ed8d6bbe9ea5
3
+ metadata.gz: d383187521d3ec144df17ea5d0d8c64f349774acb0af763e75e457aa63d09252
4
+ data.tar.gz: 961b1325dfacd79d7a799f247a1a5f19bf93e8b129230e61a20d2c8f66f38861
5
5
  SHA512:
6
- metadata.gz: 74823bde1a17d632a6a7cb59499e3233452401c157c736f5a5408bd45b37977d2962637841ce2cfa6cffcc8d4b1cc56568235d2db860c780130c9f8a9c9842b3
7
- data.tar.gz: 02d0a9123404ebea9d4350e4ed019a96f37db67f9d741b63d7c4d53da6ffc92cc2b89c3247f700aa9a735985fd15a31d98a72e2bd1f37dfcf2e6d3ce36d4fbc7
6
+ metadata.gz: 6942ecf790ca77a26005334afb280abfb3b190ad5b797e6a65434cdfd29ef4dbe8fa178ebf76d503fdb233c9c5dd495b21b89549c39d512f2690d95009a0fd52
7
+ data.tar.gz: a1db354c934aced2d3055e770b20ae6d4a4878e9f9fbc5b71abd2c6fd8e7780e08853a031669146e4217f50b8b29b78f1fca3384ef3cc58eec6b8e8080783656
data/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  All notable changes to the Runtype Ruby SDK are documented here.
4
4
 
5
+ ## 0.2.1
6
+
7
+ - `Runtype::Client#run_with_local_tools` follows a run that detached from its
8
+ request. A saved-agent dispatch on the platform's durable lane answers a
9
+ buffered resume with `{ executionId, pauseKind, status: "running" }` and closes
10
+ a streamed resume on an `await` whose `awaitReason` is `detached`; the loop
11
+ used to return that acknowledgement as if it were the turn, with no result.
12
+ Both loops now read the rest of the turn through the execution events alias,
13
+ from the last event already consumed, and keep answering local-tool pauses
14
+ until the terminal frame (runtypelabs/core#8240 follow-up). The JSON loop
15
+ returns the buffered continuation envelope (`executionId`, `events[]`,
16
+ `status`, `error`) for a followed turn.
17
+ - `Runtype::Client#execution_events_stream(execution_id, after:, conversation_id:)`:
18
+ the events alias (`GET /v1/executions/{executionId}/events`) as a
19
+ `Runtype::Streaming::EventStream`, the reattach handle for any execution.
20
+
21
+ ## 0.2.0
22
+
23
+ - Agents as code: `Runtype.define_agent` builds a validated, immutable
24
+ `Runtype::AgentDefinition` (snake_case or wire camelCase top-level fields, nested
25
+ config passed through untouched, account-scoped `tool_…`/`agent_…`/`flow_…` refs
26
+ rejected). `Runtype::Client#ensure_agent` converges it via `POST /v1/agents/ensure`
27
+ with the hash-first probe, per-client memo of the server hash, `dry_run:`,
28
+ `expect_no_changes:` (raises `Runtype::DriftError`), `on_conflict:`, `release:` and
29
+ `expected_remote_hash:`; `#pull_agent` reads the platform's definition back.
30
+ - `Runtype::AgentDefinition.content_hash_for` computes the platform's canonical
31
+ content hash: object keys ordered as `JSON.stringify` emits them and numbers
32
+ rendered as JavaScript renders them, so the hash matches byte for byte (asserted
33
+ against the shared parity corpus). `ensure_agent` also accepts the wire-shaped
34
+ definition `pull_agent` returns.
35
+ - `Runtype::Client#run_with_local_tools`: the local-tool pause/resume loop. Executes
36
+ every paused tool in a batch concurrently and answers them in one resume keyed by
37
+ the server's per-call id, in JSON or streaming mode, and returns a pause this
38
+ process does not own (approval, elicitation, detached) untouched. `Runtype::LocalTool` pairs a handler with its schema; `scope: :turn`
39
+ ships those schemas as `clientTools[]`.
40
+ - Curated errors: `Runtype::ConflictError` (409), `Runtype::EnsureConflictError`,
41
+ `Runtype::DriftError`, `Runtype::LocalToolError`.
42
+ - The README's dispatch examples now show the wire shape, `agent: { agentId: }` with
43
+ real `agent_…` ids (the previous `agent: { id: "agt_…" }` examples never referenced
44
+ a saved agent), and the missing-target error names it.
45
+
5
46
  ## 0.1.0
6
47
 
7
48
  Initial release.
data/README.md CHANGED
@@ -25,7 +25,7 @@ client = Runtype::Client.new(api_key: ENV["RUNTYPE_API_KEY"])
25
25
 
26
26
  # Stream an agent turn
27
27
  client.dispatch_stream(
28
- agent: { id: "agt_abc123" },
28
+ agent: { agentId: "agent_abc123" },
29
29
  messages: [{ role: "user", content: "Summarize last quarter" }]
30
30
  ) do |event|
31
31
  print event["delta"] if event.type == "text_delta"
@@ -33,16 +33,71 @@ end
33
33
 
34
34
  # Or wait for the finished result
35
35
  result = client.dispatch(
36
- agent: { id: "agt_abc123" },
36
+ agent: { agentId: "agent_abc123" },
37
37
  messages: [{ role: "user", content: "Summarize last quarter" }]
38
38
  )
39
39
  puts result["executionId"]
40
40
 
41
41
  # Every documented endpoint is a resource group on the client
42
42
  flows = client.flows.list_flows
43
- agent = client.agents.get_agent_details(id: "agt_abc123")
43
+ agent = client.agents.get_agent_details(id: "agent_abc123")
44
44
  ```
45
45
 
46
+ The dispatch `agent:` object is an agent definition. Reference a saved agent with
47
+ `agentId:`, or run an inline one with `name:`, `model:`, `systemPrompt:` and the rest
48
+ of the runtime config — nothing is persisted for inline agents.
49
+
50
+ ## Agents as code
51
+
52
+ Keep the agent's definition in your repo and converge it onto the platform at boot or
53
+ deploy time. `Runtype.define_agent` is pure and local; `ensure_agent` is idempotent
54
+ and non-executing: it probes with a content hash, ships the full definition only when
55
+ the platform reports a miss, appends an immutable version on every change, and never
56
+ deletes. Identity is the agent's name within the API key's account scope.
57
+
58
+ ```ruby
59
+ assistant = Runtype.define_agent(
60
+ name: "Pricing Assistant",
61
+ model: "claude-sonnet-4-6",
62
+ system_prompt: render_prompt(pricing_data),
63
+ loop_config: { maxTurns: 1 },
64
+ tools: {
65
+ toolIds: ["builtin:web_search", "tool:Price List"], # portable refs only
66
+ runtimeTools: [
67
+ { name: "save_quote", toolType: "local", description: "Save a quote",
68
+ parametersSchema: { type: "object", properties: { total: { type: "number" } } } }
69
+ ]
70
+ }
71
+ )
72
+
73
+ result = client.ensure_agent(assistant, on_conflict: "overwrite", release: "publish")
74
+ result["result"] # "unchanged" | "created" | "updated"
75
+ result["agentId"] # dispatch with agent: { agentId: result["agentId"] }
76
+
77
+ # CI drift gate: raises Runtype::DriftError unless the platform already matches
78
+ client.ensure_agent(assistant, expect_no_changes: true)
79
+
80
+ # Absorb a dashboard edit back into the repo
81
+ pulled = client.pull_agent("Pricing Assistant")
82
+ pulled["definition"] # the canonical wire definition; ensure_agent accepts it as-is
83
+ pulled["lastModifiedSource"]
84
+ ```
85
+
86
+ Top-level fields take snake_case or the wire's camelCase; nested config (`tools`,
87
+ `loop_config`, ...) is passed through in wire shape untouched, because its keys can be
88
+ tool names. Definitions must be environment-portable: raw `tool_…`, `agent_…` and
89
+ `flow_…` ids are rejected in favour of `builtin:`, `platform:`, `mcp:` and
90
+ `tool:<name>` / `agent:<name>` / `flow:<name>` references, so the same definition
91
+ converges staging and production.
92
+
93
+ `ensure_agent` raises `Runtype::EnsureConflictError` (a 409) when the agent's last
94
+ write came from the dashboard, the API or MCP (`#code == "external_modification"`;
95
+ pass `on_conflict: "overwrite"` to converge over it) or when an
96
+ `expected_remote_hash:` no longer matches (`#code == "remote_changed"`).
97
+ `Runtype::AgentDefinition.content_hash_for(definition)` computes the same SHA-256 the
98
+ platform does, over the canonical normalized form (keys ordered as `JSON.stringify`
99
+ emits them, numbers rendered as JavaScript renders them).
100
+
46
101
  ## Authentication
47
102
 
48
103
  Pass `api_key:`, or leave it out and the client reads `RUNTYPE_API_KEY`. The base URL
@@ -67,7 +122,7 @@ events. Passing a block iterates it and closes the socket for you; the closed st
67
122
  comes back so the reconnect handle is still readable.
68
123
 
69
124
  ```ruby
70
- stream = client.dispatch_stream(agent: { id: "agt_abc123" }, messages: messages) do |event|
125
+ stream = client.dispatch_stream(agent: { agentId: "agent_abc123" }, messages: messages) do |event|
71
126
  case event.type
72
127
  when "text_delta" then print event["delta"]
73
128
  when "tool_start" then puts "calling #{event["toolName"]}"
@@ -109,7 +164,7 @@ from where you left off.
109
164
  ```ruby
110
165
  detached = false
111
166
 
112
- stream = client.dispatch_stream(agent: { id: "agt_abc123" }, messages: messages) do |event|
167
+ stream = client.dispatch_stream(agent: { agentId: "agent_abc123" }, messages: messages) do |event|
113
168
  detached ||= event.detached?
114
169
  handle(event)
115
170
  end
@@ -130,6 +185,33 @@ client.resume_stream(
130
185
 
131
186
  `resume` is the non-streaming equivalent. Neither counts against execution limits.
132
187
 
188
+ `run_with_local_tools` runs that loop for you. Give it a map of tool name to handler;
189
+ every time the execution pauses on one of them it executes the handler and resumes
190
+ with the output, running all of a turn's parallel calls concurrently and answering
191
+ them in one resume, until the execution ends or pauses on something this process does
192
+ not own (an approval or an elicitation, say), which is returned as-is. Without a block it returns the final JSON body; with a block
193
+ it streams every event of every leg and returns the last leg's stream.
194
+
195
+ ```ruby
196
+ save_goals = Runtype::LocalTool.new(
197
+ description: "Save the patient's stated goals",
198
+ parameters_schema: { type: "object", properties: { goals: { type: "array", items: { type: "string" } } } }
199
+ ) { |args| Goals.save(args["goals"]); { ok: true } }
200
+
201
+ result = client.run_with_local_tools(
202
+ { "save_goals" => save_goals, "lookup_order" => ->(args) { Orders.find(args["id"]) } },
203
+ agent: { agentId: "agent_abc123" },
204
+ messages: [{ role: "user", content: "I want to sleep better" }]
205
+ )
206
+ result["status"] # "completed", or "paused" on a pause you do not own
207
+ ```
208
+
209
+ A bare callable is enough when the saved agent already declares the tool as a
210
+ `toolType: "local"` runtime tool. Pass `scope: :turn` to also ship every
211
+ `Runtype::LocalTool`'s schema as `clientTools[]` for that one dispatch, for tools
212
+ the saved agent does not declare. A missing handler, a handler that raises, or a
213
+ loop that exceeds `max_rounds:` raises `Runtype::LocalToolError`.
214
+
133
215
  ## Errors
134
216
 
135
217
  Everything the client raises descends from `Runtype::Error`.
@@ -139,18 +221,22 @@ Everything the client raises descends from `Runtype::Error`.
139
221
  | `Runtype::AuthenticationError` | 401, or no API key at construction |
140
222
  | `Runtype::PermissionDeniedError` | 403 |
141
223
  | `Runtype::NotFoundError` | 404 |
224
+ | `Runtype::ConflictError` | 409 |
225
+ | `Runtype::EnsureConflictError` | 409 from `ensure_agent`, exposes `#code` |
142
226
  | `Runtype::UnprocessableEntityError` | 422 |
143
227
  | `Runtype::RateLimitError` | 429, exposes `#retry_after` |
144
228
  | `Runtype::APIStatusError` | any other non-2xx |
145
229
  | `Runtype::APITimeoutError` | the request timed out |
146
230
  | `Runtype::APIConnectionError` | the request never reached the API |
231
+ | `Runtype::DriftError` | `ensure_agent(..., expect_no_changes: true)` found drift, exposes `#plan` |
232
+ | `Runtype::LocalToolError` | `run_with_local_tools` could not run a tool, exposes `#tool_name` and `#cause` |
147
233
 
148
234
  Status errors carry `#status_code`, `#body` (parsed when the response was JSON), and
149
235
  `#headers`.
150
236
 
151
237
  ```ruby
152
238
  begin
153
- client.dispatch(agent: { id: "agt_abc123" }, messages: messages)
239
+ client.dispatch(agent: { agentId: "agent_abc123" }, messages: messages)
154
240
  rescue Runtype::RateLimitError => e
155
241
  sleep(e.retry_after || 5)
156
242
  retry
@@ -0,0 +1,320 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ class Client
6
+ # @param client [Runtype::Internal::Http::RawClient]
7
+ #
8
+ # @return [void]
9
+ def initialize(client:)
10
+ @client = client
11
+ end
12
+
13
+ # List the named pointers that select which immutable version of this agent runs. `live` sorts first, then the
14
+ # preview aliases by name. Archived aliases are omitted unless `includeArchived=true`. Omitting `limit` returns
15
+ # every pointer; supplying it pages through the same order with `cursor`.
16
+ #
17
+ # @param request_options [Hash]
18
+ # @param params [Hash]
19
+ # @option request_options [String] :base_url
20
+ # @option request_options [Hash{String => Object}] :additional_headers
21
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
22
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
23
+ # @option request_options [Integer] :timeout_in_seconds
24
+ # @option params [String] :id
25
+ # @option params [String, nil] :include_archived
26
+ # @option params [String, nil] :limit
27
+ # @option params [String, nil] :cursor
28
+ #
29
+ # @example
30
+ # client.agent_aliases.list_release_aliases_for_an_agent(id: "id")
31
+ #
32
+ # @return [Runtype::AgentAliases::Types::GetV1AgentsIDAliasesResponse]
33
+ def list_release_aliases_for_an_agent(request_options: {}, **params)
34
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
35
+ query_params = {}
36
+ query_params["includeArchived"] = params[:include_archived] if params.key?(:include_archived)
37
+ query_params["limit"] = params[:limit] if params.key?(:limit)
38
+ query_params["cursor"] = params[:cursor] if params.key?(:cursor)
39
+
40
+ request = Runtype::Internal::JSON::Request.new(
41
+ base_url: request_options[:base_url],
42
+ method: "GET",
43
+ path: "v1/agents/#{URI.encode_uri_component(params[:id].to_s)}/aliases",
44
+ query: query_params,
45
+ request_options: request_options
46
+ )
47
+ begin
48
+ response = @client.send(request)
49
+ rescue Net::HTTPRequestTimeout
50
+ raise Runtype::Errors::TimeoutError
51
+ end
52
+ code = response.code.to_i
53
+ if code.between?(200, 299)
54
+ Runtype::AgentAliases::Types::GetV1AgentsIDAliasesResponse.load(response.body)
55
+ else
56
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
57
+ raise error_class.new(response.body, code: code)
58
+ end
59
+ end
60
+
61
+ # Read one pointer. A missing or archived alias answers a structured 404 naming the alias; it never falls back to
62
+ # live.
63
+ #
64
+ # @param request_options [Hash]
65
+ # @param params [Hash]
66
+ # @option request_options [String] :base_url
67
+ # @option request_options [Hash{String => Object}] :additional_headers
68
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
69
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
70
+ # @option request_options [Integer] :timeout_in_seconds
71
+ # @option params [String] :id
72
+ # @option params [String] :alias_
73
+ # @option params [String, nil] :include_archived
74
+ #
75
+ # @example
76
+ # client.agent_aliases.get_one_release_alias(
77
+ # id: "id",
78
+ # alias_: "alias"
79
+ # )
80
+ #
81
+ # @return [Runtype::AgentAliases::Types::GetV1AgentsIDAliasesAliasResponse]
82
+ def get_one_release_alias(request_options: {}, **params)
83
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
84
+ query_params = {}
85
+ query_params["includeArchived"] = params[:include_archived] if params.key?(:include_archived)
86
+
87
+ request = Runtype::Internal::JSON::Request.new(
88
+ base_url: request_options[:base_url],
89
+ method: "GET",
90
+ path: "v1/agents/#{URI.encode_uri_component(params[:id].to_s)}/aliases/#{URI.encode_uri_component(params[:alias_].to_s)}",
91
+ query: query_params,
92
+ request_options: request_options
93
+ )
94
+ begin
95
+ response = @client.send(request)
96
+ rescue Net::HTTPRequestTimeout
97
+ raise Runtype::Errors::TimeoutError
98
+ end
99
+ code = response.code.to_i
100
+ if code.between?(200, 299)
101
+ Runtype::AgentAliases::Types::GetV1AgentsIDAliasesAliasResponse.load(response.body)
102
+ else
103
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
104
+ raise error_class.new(response.body, code: code)
105
+ end
106
+ end
107
+
108
+ # Aim one alias at one immutable version of the same agent, appending a deployment receipt in the same
109
+ # transaction. Moving an existing `live` pointer requires the AGENTS:DEPLOY:LIVE scope and an `If-Match` revision;
110
+ # preview aliases require AGENTS:DEPLOY:PREVIEW. Dependency references the version names are fingerprinted first,
111
+ # and an unresolvable reference refuses the activation.
112
+ #
113
+ # @param request_options [Hash]
114
+ # @param params [Runtype::AgentAliases::Types::PutV1AgentsIDAliasesAliasRequest]
115
+ # @option request_options [String] :base_url
116
+ # @option request_options [Hash{String => Object}] :additional_headers
117
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
118
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
119
+ # @option request_options [Integer] :timeout_in_seconds
120
+ # @option params [String] :id
121
+ # @option params [String] :alias_
122
+ # @option params [String, nil] :if_match
123
+ # @option params [String, nil] :idempotency_key
124
+ #
125
+ # @example
126
+ # client.agent_aliases.activate_a_version_at_a_release_alias(
127
+ # id: "id",
128
+ # alias_: "alias",
129
+ # version_id: "versionId"
130
+ # )
131
+ #
132
+ # @return [Runtype::AgentAliases::Types::PutV1AgentsIDAliasesAliasResponse]
133
+ def activate_a_version_at_a_release_alias(request_options: {}, **params)
134
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
135
+ request_data = Runtype::AgentAliases::Types::PutV1AgentsIDAliasesAliasRequest.new(params).to_h
136
+ non_body_param_names = %w[id alias if-match idempotency-key]
137
+ body = request_data.except(*non_body_param_names)
138
+
139
+ headers = {}
140
+ headers["if-match"] = params[:if_match] if params[:if_match]
141
+ headers["idempotency-key"] = params[:idempotency_key] if params[:idempotency_key]
142
+
143
+ request = Runtype::Internal::JSON::Request.new(
144
+ base_url: request_options[:base_url],
145
+ method: "PUT",
146
+ path: "v1/agents/#{URI.encode_uri_component(params[:id].to_s)}/aliases/#{URI.encode_uri_component(params[:alias_].to_s)}",
147
+ headers: headers,
148
+ body: body,
149
+ request_options: request_options
150
+ )
151
+ begin
152
+ response = @client.send(request)
153
+ rescue Net::HTTPRequestTimeout
154
+ raise Runtype::Errors::TimeoutError
155
+ end
156
+ code = response.code.to_i
157
+ if code.between?(200, 299)
158
+ Runtype::AgentAliases::Types::PutV1AgentsIDAliasesAliasResponse.load(response.body)
159
+ else
160
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
161
+ raise error_class.new(response.body, code: code)
162
+ end
163
+ end
164
+
165
+ # Archive a preview alias: it stops resolving for new executions, keeps its deployment history, and does not
166
+ # interrupt admitted runs. The row is never deleted, so a later activation revives the same pointer. `live` cannot
167
+ # be archived.
168
+ #
169
+ # @param request_options [Hash]
170
+ # @param params [Hash]
171
+ # @option request_options [String] :base_url
172
+ # @option request_options [Hash{String => Object}] :additional_headers
173
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
174
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
175
+ # @option request_options [Integer] :timeout_in_seconds
176
+ # @option params [String] :id
177
+ # @option params [String] :alias_
178
+ # @option params [String, nil] :if_match
179
+ # @option params [String, nil] :idempotency_key
180
+ #
181
+ # @example
182
+ # client.agent_aliases.archive_a_release_alias(
183
+ # id: "id",
184
+ # alias_: "alias"
185
+ # )
186
+ #
187
+ # @return [Runtype::AgentAliases::Types::DeleteV1AgentsIDAliasesAliasResponse]
188
+ def archive_a_release_alias(request_options: {}, **params)
189
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
190
+ headers = {}
191
+ headers["if-match"] = params[:if_match] if params[:if_match]
192
+ headers["idempotency-key"] = params[:idempotency_key] if params[:idempotency_key]
193
+
194
+ request = Runtype::Internal::JSON::Request.new(
195
+ base_url: request_options[:base_url],
196
+ method: "DELETE",
197
+ path: "v1/agents/#{URI.encode_uri_component(params[:id].to_s)}/aliases/#{URI.encode_uri_component(params[:alias_].to_s)}",
198
+ headers: headers,
199
+ request_options: request_options
200
+ )
201
+ begin
202
+ response = @client.send(request)
203
+ rescue Net::HTTPRequestTimeout
204
+ raise Runtype::Errors::TimeoutError
205
+ end
206
+ code = response.code.to_i
207
+ if code.between?(200, 299)
208
+ Runtype::AgentAliases::Types::DeleteV1AgentsIDAliasesAliasResponse.load(response.body)
209
+ else
210
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
211
+ raise error_class.new(response.body, code: code)
212
+ end
213
+ end
214
+
215
+ # Re-aim an alias at the version recorded as `previousVersionId` on its most recent pointer-moving receipt,
216
+ # walking `steps` receipts back. Writes a `rollback` receipt. Rolling back `live` follows the same scope and
217
+ # `If-Match` rules as activation, and restores configuration only: external data and side effects are not rolled
218
+ # back.
219
+ #
220
+ # @param request_options [Hash]
221
+ # @param params [Runtype::AgentAliases::Types::PostV1AgentsIDAliasesAliasRollbackRequest]
222
+ # @option request_options [String] :base_url
223
+ # @option request_options [Hash{String => Object}] :additional_headers
224
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
225
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
226
+ # @option request_options [Integer] :timeout_in_seconds
227
+ # @option params [String] :id
228
+ # @option params [String] :alias_
229
+ # @option params [String, nil] :if_match
230
+ # @option params [String, nil] :idempotency_key
231
+ #
232
+ # @example
233
+ # client.agent_aliases.roll_a_release_alias_back_to_its_previous_version(
234
+ # id: "id",
235
+ # alias_: "alias"
236
+ # )
237
+ #
238
+ # @return [Runtype::AgentAliases::Types::PostV1AgentsIDAliasesAliasRollbackResponse]
239
+ def roll_a_release_alias_back_to_its_previous_version(request_options: {}, **params)
240
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
241
+ request_data = Runtype::AgentAliases::Types::PostV1AgentsIDAliasesAliasRollbackRequest.new(params).to_h
242
+ non_body_param_names = %w[id alias if-match idempotency-key]
243
+ body = request_data.except(*non_body_param_names)
244
+
245
+ headers = {}
246
+ headers["if-match"] = params[:if_match] if params[:if_match]
247
+ headers["idempotency-key"] = params[:idempotency_key] if params[:idempotency_key]
248
+
249
+ request = Runtype::Internal::JSON::Request.new(
250
+ base_url: request_options[:base_url],
251
+ method: "POST",
252
+ path: "v1/agents/#{URI.encode_uri_component(params[:id].to_s)}/aliases/#{URI.encode_uri_component(params[:alias_].to_s)}/rollback",
253
+ headers: headers,
254
+ body: body,
255
+ request_options: request_options
256
+ )
257
+ begin
258
+ response = @client.send(request)
259
+ rescue Net::HTTPRequestTimeout
260
+ raise Runtype::Errors::TimeoutError
261
+ end
262
+ code = response.code.to_i
263
+ if code.between?(200, 299)
264
+ Runtype::AgentAliases::Types::PostV1AgentsIDAliasesAliasRollbackResponse.load(response.body)
265
+ else
266
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
267
+ raise error_class.new(response.body, code: code)
268
+ end
269
+ end
270
+
271
+ # The append-only deployment history of this agent, newest first, cursor-paginated. Each receipt records the
272
+ # pointer, the previous and new versions, the alias revision, the actor, provenance and the dependency
273
+ # fingerprints checked at activation.
274
+ #
275
+ # @param request_options [Hash]
276
+ # @param params [Hash]
277
+ # @option request_options [String] :base_url
278
+ # @option request_options [Hash{String => Object}] :additional_headers
279
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
280
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
281
+ # @option request_options [Integer] :timeout_in_seconds
282
+ # @option params [String] :id
283
+ # @option params [String, nil] :alias_
284
+ # @option params [String, nil] :limit
285
+ # @option params [String, nil] :cursor
286
+ #
287
+ # @example
288
+ # client.agent_aliases.list_deployment_receipts_for_an_agent(id: "id")
289
+ #
290
+ # @return [Runtype::AgentAliases::Types::GetV1AgentsIDDeploymentsResponse]
291
+ def list_deployment_receipts_for_an_agent(request_options: {}, **params)
292
+ params = Runtype::Internal::Types::Utils.normalize_keys(params)
293
+ query_params = {}
294
+ query_params["alias"] = params[:alias_] if params.key?(:alias_)
295
+ query_params["limit"] = params[:limit] if params.key?(:limit)
296
+ query_params["cursor"] = params[:cursor] if params.key?(:cursor)
297
+
298
+ request = Runtype::Internal::JSON::Request.new(
299
+ base_url: request_options[:base_url],
300
+ method: "GET",
301
+ path: "v1/agents/#{URI.encode_uri_component(params[:id].to_s)}/deployments",
302
+ query: query_params,
303
+ request_options: request_options
304
+ )
305
+ begin
306
+ response = @client.send(request)
307
+ rescue Net::HTTPRequestTimeout
308
+ raise Runtype::Errors::TimeoutError
309
+ end
310
+ code = response.code.to_i
311
+ if code.between?(200, 299)
312
+ Runtype::AgentAliases::Types::GetV1AgentsIDDeploymentsResponse.load(response.body)
313
+ else
314
+ error_class = Runtype::Errors::ResponseError.subclass_for_code(code)
315
+ raise error_class.new(response.body, code: code)
316
+ end
317
+ end
318
+ end
319
+ end
320
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ module Types
6
+ class DeleteV1AgentsIDAliasesAliasRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :alias_, -> { String }, optional: false, nullable: false, api_name: "alias"
10
+
11
+ field :if_match, -> { String }, optional: true, nullable: false, api_name: "if-match"
12
+
13
+ field :idempotency_key, -> { String }, optional: true, nullable: false, api_name: "idempotency-key"
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ module Types
6
+ class DeleteV1AgentsIDAliasesAliasResponse < Internal::Types::Model
7
+ field :alias_, -> { String }, optional: false, nullable: false, api_name: "alias"
8
+
9
+ field :archived, -> { Internal::Types::Boolean }, optional: false, nullable: false
10
+
11
+ field :receipt_id, -> { String }, optional: false, nullable: false, api_name: "receiptId"
12
+
13
+ field :revision, -> { Integer }, optional: false, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ module Types
6
+ class GetV1AgentsIDAliasesAliasRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :alias_, -> { String }, optional: false, nullable: false, api_name: "alias"
10
+
11
+ field :include_archived, -> { String }, optional: true, nullable: false, api_name: "includeArchived"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ module Types
6
+ class GetV1AgentsIDAliasesAliasResponse < Internal::Types::Model
7
+ field :alias_, -> { String }, optional: false, nullable: false, api_name: "alias"
8
+
9
+ field :archived_at, -> { String }, optional: false, nullable: true, api_name: "archivedAt"
10
+
11
+ field :content_hash, -> { String }, optional: false, nullable: true, api_name: "contentHash"
12
+
13
+ field :created_at, -> { String }, optional: false, nullable: false, api_name: "createdAt"
14
+
15
+ field :expires_at, -> { String }, optional: false, nullable: true, api_name: "expiresAt"
16
+
17
+ field :label, -> { String }, optional: false, nullable: true
18
+
19
+ field :revision, -> { Integer }, optional: false, nullable: false
20
+
21
+ field :updated_at, -> { String }, optional: false, nullable: false, api_name: "updatedAt"
22
+
23
+ field :version_id, -> { String }, optional: false, nullable: false, api_name: "versionId"
24
+
25
+ field :version_number, -> { Integer }, optional: false, nullable: true, api_name: "versionNumber"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ module Types
6
+ class GetV1AgentsIDAliasesRequest < Internal::Types::Model
7
+ field :id, -> { String }, optional: false, nullable: false
8
+
9
+ field :include_archived, -> { String }, optional: true, nullable: false, api_name: "includeArchived"
10
+
11
+ field :limit, -> { String }, optional: true, nullable: false
12
+
13
+ field :cursor, -> { String }, optional: true, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Runtype
4
+ module AgentAliases
5
+ module Types
6
+ class GetV1AgentsIDAliasesResponse < Internal::Types::Model
7
+ field :data, -> { Internal::Types::Array[Runtype::AgentAliases::Types::GetV1AgentsIDAliasesResponseDataItem] }, optional: false, nullable: false
8
+
9
+ field :next_cursor, -> { String }, optional: false, nullable: true, api_name: "nextCursor"
10
+ end
11
+ end
12
+ end
13
+ end