opencode_client 1.0.0
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +102 -0
- data/README.md +423 -0
- data/Rakefile +10 -0
- data/docs/APIError.md +20 -0
- data/docs/APIErrorData.md +28 -0
- data/docs/Agent.md +46 -0
- data/docs/AgentConfig.md +38 -0
- data/docs/AgentConfigPermission.md +28 -0
- data/docs/AgentConfigPermissionBash.md +15 -0
- data/docs/AgentPart.md +28 -0
- data/docs/AgentPartInput.md +24 -0
- data/docs/AgentPartSource.md +22 -0
- data/docs/AgentPermission.md +28 -0
- data/docs/ApiAuth.md +20 -0
- data/docs/AppLogRequest.md +24 -0
- data/docs/AssistantMessage.md +46 -0
- data/docs/AssistantMessageError.md +20 -0
- data/docs/AssistantMessagePath.md +20 -0
- data/docs/AssistantMessageTime.md +20 -0
- data/docs/AssistantMessageTokens.md +24 -0
- data/docs/AssistantMessageTokensCache.md +20 -0
- data/docs/Auth.md +30 -0
- data/docs/BadRequestError.md +22 -0
- data/docs/Command.md +28 -0
- data/docs/CompactionPart.md +26 -0
- data/docs/Config.md +82 -0
- data/docs/ConfigAgent.md +30 -0
- data/docs/ConfigAutoupdate.md +15 -0
- data/docs/ConfigCommandValue.md +26 -0
- data/docs/ConfigCompaction.md +20 -0
- data/docs/ConfigEnterprise.md +18 -0
- data/docs/ConfigExperimental.md +30 -0
- data/docs/ConfigExperimentalHook.md +20 -0
- data/docs/ConfigExperimentalHookFileEditedValueInner.md +20 -0
- data/docs/ConfigFormatter.md +15 -0
- data/docs/ConfigFormatterAnyOfValue.md +24 -0
- data/docs/ConfigLsp.md +15 -0
- data/docs/ConfigLspAnyOfValue.md +26 -0
- data/docs/ConfigLspAnyOfValueAnyOf.md +18 -0
- data/docs/ConfigLspAnyOfValueAnyOf1.md +26 -0
- data/docs/ConfigMode.md +20 -0
- data/docs/ConfigProviders200Response.md +20 -0
- data/docs/ConfigTui.md +22 -0
- data/docs/ConfigTuiScrollAcceleration.md +18 -0
- data/docs/ConfigWatcher.md +18 -0
- data/docs/DefaultApi.md +5641 -0
- data/docs/Event.md +20 -0
- data/docs/EventCommandExecuted.md +20 -0
- data/docs/EventCommandExecutedProperties.md +24 -0
- data/docs/EventFileEdited.md +20 -0
- data/docs/EventFileEditedProperties.md +18 -0
- data/docs/EventFileWatcherUpdated.md +20 -0
- data/docs/EventFileWatcherUpdatedProperties.md +20 -0
- data/docs/EventGlobalDisposed.md +20 -0
- data/docs/EventInstallationUpdateAvailable.md +20 -0
- data/docs/EventInstallationUpdated.md +20 -0
- data/docs/EventInstallationUpdatedProperties.md +18 -0
- data/docs/EventLspClientDiagnostics.md +20 -0
- data/docs/EventLspClientDiagnosticsProperties.md +20 -0
- data/docs/EventLspUpdated.md +20 -0
- data/docs/EventMcpToolsChanged.md +20 -0
- data/docs/EventMcpToolsChangedProperties.md +18 -0
- data/docs/EventMessagePartRemoved.md +20 -0
- data/docs/EventMessagePartRemovedProperties.md +22 -0
- data/docs/EventMessagePartUpdated.md +20 -0
- data/docs/EventMessagePartUpdatedProperties.md +20 -0
- data/docs/EventMessageRemoved.md +20 -0
- data/docs/EventMessageRemovedProperties.md +20 -0
- data/docs/EventMessageUpdated.md +20 -0
- data/docs/EventMessageUpdatedProperties.md +18 -0
- data/docs/EventPermissionReplied.md +20 -0
- data/docs/EventPermissionRepliedProperties.md +22 -0
- data/docs/EventPermissionUpdated.md +20 -0
- data/docs/EventProjectUpdated.md +20 -0
- data/docs/EventPtyCreated.md +20 -0
- data/docs/EventPtyCreatedProperties.md +18 -0
- data/docs/EventPtyDeleted.md +20 -0
- data/docs/EventPtyDeletedProperties.md +18 -0
- data/docs/EventPtyExited.md +20 -0
- data/docs/EventPtyExitedProperties.md +20 -0
- data/docs/EventPtyUpdated.md +20 -0
- data/docs/EventServerConnected.md +20 -0
- data/docs/EventServerInstanceDisposed.md +20 -0
- data/docs/EventServerInstanceDisposedProperties.md +18 -0
- data/docs/EventSessionCompacted.md +20 -0
- data/docs/EventSessionCreated.md +20 -0
- data/docs/EventSessionCreatedProperties.md +18 -0
- data/docs/EventSessionDeleted.md +20 -0
- data/docs/EventSessionDiff.md +20 -0
- data/docs/EventSessionDiffProperties.md +20 -0
- data/docs/EventSessionError.md +20 -0
- data/docs/EventSessionErrorProperties.md +20 -0
- data/docs/EventSessionIdle.md +20 -0
- data/docs/EventSessionIdleProperties.md +18 -0
- data/docs/EventSessionStatus.md +20 -0
- data/docs/EventSessionStatusProperties.md +20 -0
- data/docs/EventSessionUpdated.md +20 -0
- data/docs/EventTodoUpdated.md +20 -0
- data/docs/EventTodoUpdatedProperties.md +20 -0
- data/docs/EventTuiCommandExecute.md +20 -0
- data/docs/EventTuiCommandExecuteProperties.md +18 -0
- data/docs/EventTuiCommandExecutePropertiesCommand.md +15 -0
- data/docs/EventTuiPromptAppend.md +20 -0
- data/docs/EventTuiToastShow.md +20 -0
- data/docs/EventVcsBranchUpdated.md +20 -0
- data/docs/EventVcsBranchUpdatedProperties.md +18 -0
- data/docs/File.md +24 -0
- data/docs/FileContent.md +28 -0
- data/docs/FileContentPatch.md +28 -0
- data/docs/FileContentPatchHunksInner.md +26 -0
- data/docs/FileDiff.md +26 -0
- data/docs/FileNode.md +26 -0
- data/docs/FilePart.md +32 -0
- data/docs/FilePartInput.md +28 -0
- data/docs/FilePartSource.md +28 -0
- data/docs/FilePartSourceText.md +22 -0
- data/docs/FileSource.md +22 -0
- data/docs/FindText200ResponseInner.md +26 -0
- data/docs/FindText200ResponseInnerPath.md +18 -0
- data/docs/FindText200ResponseInnerSubmatchesInner.md +22 -0
- data/docs/FormatterStatus.md +22 -0
- data/docs/GlobalEvent.md +20 -0
- data/docs/GlobalHealth200Response.md +20 -0
- data/docs/KeybindsConfig.md +188 -0
- data/docs/LSPStatus.md +24 -0
- data/docs/LayoutConfig.md +15 -0
- data/docs/LogLevel.md +15 -0
- data/docs/MCPStatus.md +20 -0
- data/docs/MCPStatusConnected.md +18 -0
- data/docs/MCPStatusDisabled.md +18 -0
- data/docs/MCPStatusFailed.md +20 -0
- data/docs/MCPStatusNeedsAuth.md +18 -0
- data/docs/MCPStatusNeedsClientRegistration.md +20 -0
- data/docs/McpAddRequest.md +20 -0
- data/docs/McpAddRequestConfig.md +32 -0
- data/docs/McpAuthCallbackRequest.md +18 -0
- data/docs/McpAuthRemove200Response.md +18 -0
- data/docs/McpAuthStart200Response.md +18 -0
- data/docs/McpLocalConfig.md +26 -0
- data/docs/McpOAuthConfig.md +22 -0
- data/docs/McpRemoteConfig.md +28 -0
- data/docs/McpRemoteConfigOauth.md +22 -0
- data/docs/Message.md +52 -0
- data/docs/MessageAbortedError.md +20 -0
- data/docs/MessageOutputLengthError.md +20 -0
- data/docs/Model.md +40 -0
- data/docs/ModelApi.md +22 -0
- data/docs/ModelCapabilities.md +30 -0
- data/docs/ModelCapabilitiesInput.md +26 -0
- data/docs/ModelCapabilitiesInterleaved.md +18 -0
- data/docs/ModelCapabilitiesInterleavedAnyOf.md +18 -0
- data/docs/ModelCost.md +24 -0
- data/docs/ModelCostExperimentalOver200K.md +22 -0
- data/docs/NotFoundError.md +20 -0
- data/docs/OAuth.md +26 -0
- data/docs/Part.md +76 -0
- data/docs/PartAnyOf.md +32 -0
- data/docs/PatchPart.md +28 -0
- data/docs/Path.md +26 -0
- data/docs/Permission.md +34 -0
- data/docs/PermissionPattern.md +15 -0
- data/docs/PermissionRespondRequest.md +18 -0
- data/docs/Project.md +28 -0
- data/docs/ProjectTime.md +22 -0
- data/docs/ProjectUpdateRequest.md +20 -0
- data/docs/ProjectUpdateRequestIcon.md +20 -0
- data/docs/Provider.md +30 -0
- data/docs/ProviderAuthAuthorization.md +22 -0
- data/docs/ProviderAuthError.md +20 -0
- data/docs/ProviderAuthErrorData.md +20 -0
- data/docs/ProviderAuthMethod.md +20 -0
- data/docs/ProviderConfig.md +34 -0
- data/docs/ProviderConfigModelsValue.md +50 -0
- data/docs/ProviderConfigModelsValueInterleaved.md +18 -0
- data/docs/ProviderConfigModelsValueInterleavedAnyOf.md +18 -0
- data/docs/ProviderConfigOptions.md +26 -0
- data/docs/ProviderConfigOptionsTimeout.md +15 -0
- data/docs/ProviderList200Response.md +22 -0
- data/docs/ProviderList200ResponseAllInner.md +28 -0
- data/docs/ProviderList200ResponseAllInnerModelsValue.md +50 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueCost.md +26 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueCostContextOver200k.md +24 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueInterleaved.md +18 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueInterleavedAnyOf.md +18 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueLimit.md +20 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueModalities.md +20 -0
- data/docs/ProviderList200ResponseAllInnerModelsValueProvider.md +18 -0
- data/docs/ProviderOauthAuthorizeRequest.md +18 -0
- data/docs/ProviderOauthCallbackRequest.md +20 -0
- data/docs/Pty.md +30 -0
- data/docs/PtyCreateRequest.md +26 -0
- data/docs/PtyUpdateRequest.md +20 -0
- data/docs/PtyUpdateRequestSize.md +20 -0
- data/docs/Range.md +20 -0
- data/docs/RangeStart.md +20 -0
- data/docs/ReasoningPart.md +30 -0
- data/docs/RetryPart.md +30 -0
- data/docs/ServerConfig.md +22 -0
- data/docs/Session.md +36 -0
- data/docs/SessionApi.md +145 -0
- data/docs/SessionCommandRequest.md +26 -0
- data/docs/SessionCreateRequest.md +20 -0
- data/docs/SessionForkRequest.md +18 -0
- data/docs/SessionInitRequest.md +22 -0
- data/docs/SessionMessages200ResponseInner.md +20 -0
- data/docs/SessionPrompt200Response.md +20 -0
- data/docs/SessionPromptRequest.md +30 -0
- data/docs/SessionPromptRequestModel.md +20 -0
- data/docs/SessionPromptRequestPartsInner.md +48 -0
- data/docs/SessionRevert.md +24 -0
- data/docs/SessionRevertRequest.md +20 -0
- data/docs/SessionShare.md +18 -0
- data/docs/SessionShellRequest.md +22 -0
- data/docs/SessionStatus.md +24 -0
- data/docs/SessionStatusAnyOf.md +18 -0
- data/docs/SessionStatusAnyOf1.md +24 -0
- data/docs/SessionStatusAnyOf2.md +18 -0
- data/docs/SessionSummarizeRequest.md +22 -0
- data/docs/SessionSummary.md +24 -0
- data/docs/SessionTime.md +24 -0
- data/docs/SessionUpdateRequest.md +20 -0
- data/docs/SessionUpdateRequestTime.md +18 -0
- data/docs/SnapshotPart.md +26 -0
- data/docs/StepFinishPart.md +32 -0
- data/docs/StepStartPart.md +26 -0
- data/docs/SubtaskPartInput.md +28 -0
- data/docs/Symbol.md +22 -0
- data/docs/SymbolLocation.md +20 -0
- data/docs/SymbolSource.md +28 -0
- data/docs/TextPart.md +34 -0
- data/docs/TextPartInput.md +30 -0
- data/docs/TextPartTime.md +20 -0
- data/docs/Todo.md +24 -0
- data/docs/ToolListItem.md +22 -0
- data/docs/ToolPart.md +32 -0
- data/docs/ToolState.md +34 -0
- data/docs/ToolStateCompleted.md +30 -0
- data/docs/ToolStateCompletedTime.md +22 -0
- data/docs/ToolStateError.md +26 -0
- data/docs/ToolStateErrorTime.md +20 -0
- data/docs/ToolStatePending.md +22 -0
- data/docs/ToolStateRunning.md +26 -0
- data/docs/ToolStateRunningTime.md +18 -0
- data/docs/TuiControlNext200Response.md +20 -0
- data/docs/TuiExecuteCommandRequest.md +18 -0
- data/docs/TuiPublishRequest.md +20 -0
- data/docs/TuiShowToastRequest.md +24 -0
- data/docs/UnknownError.md +20 -0
- data/docs/UnknownErrorData.md +18 -0
- data/docs/UserMessage.md +34 -0
- data/docs/UserMessageSummary.md +22 -0
- data/docs/UserMessageTime.md +18 -0
- data/docs/VcsInfo.md +18 -0
- data/docs/WellKnownAuth.md +22 -0
- data/git_push.sh +57 -0
- data/lib/opencode_client/api/default_api.rb +5442 -0
- data/lib/opencode_client/api/session_api.rb +164 -0
- data/lib/opencode_client/api_client.rb +374 -0
- data/lib/opencode_client/api_error.rb +58 -0
- data/lib/opencode_client/api_model_base.rb +88 -0
- data/lib/opencode_client/configuration.rb +288 -0
- data/lib/opencode_client/models/agent.rb +405 -0
- data/lib/opencode_client/models/agent_config.rb +316 -0
- data/lib/opencode_client/models/agent_config_permission.rb +262 -0
- data/lib/opencode_client/models/agent_config_permission_bash.rb +103 -0
- data/lib/opencode_client/models/agent_part.rb +301 -0
- data/lib/opencode_client/models/agent_part_input.rb +232 -0
- data/lib/opencode_client/models/agent_part_source.rb +252 -0
- data/lib/opencode_client/models/agent_permission.rb +287 -0
- data/lib/opencode_client/models/api_auth.rb +214 -0
- data/lib/opencode_client/models/api_error.rb +214 -0
- data/lib/opencode_client/models/api_error_data.rb +230 -0
- data/lib/opencode_client/models/app_log_request.rb +255 -0
- data/lib/opencode_client/models/assistant_message.rb +501 -0
- data/lib/opencode_client/models/assistant_message_error.rb +106 -0
- data/lib/opencode_client/models/assistant_message_path.rb +190 -0
- data/lib/opencode_client/models/assistant_message_time.rb +173 -0
- data/lib/opencode_client/models/assistant_message_tokens.rb +242 -0
- data/lib/opencode_client/models/assistant_message_tokens_cache.rb +190 -0
- data/lib/opencode_client/models/auth.rb +104 -0
- data/lib/opencode_client/models/bad_request_error.rb +228 -0
- data/lib/opencode_client/models/command.rb +226 -0
- data/lib/opencode_client/models/compaction_part.rb +292 -0
- data/lib/opencode_client/models/config.rb +500 -0
- data/lib/opencode_client/models/config_agent.rb +202 -0
- data/lib/opencode_client/models/config_autoupdate.rb +104 -0
- data/lib/opencode_client/models/config_command_value.rb +200 -0
- data/lib/opencode_client/models/config_compaction.rb +158 -0
- data/lib/opencode_client/models/config_enterprise.rb +148 -0
- data/lib/opencode_client/models/config_experimental.rb +208 -0
- data/lib/opencode_client/models/config_experimental_hook.rb +160 -0
- data/lib/opencode_client/models/config_experimental_hook_file_edited_value_inner.rb +177 -0
- data/lib/opencode_client/models/config_formatter.rb +103 -0
- data/lib/opencode_client/models/config_formatter_any_of_value.rb +180 -0
- data/lib/opencode_client/models/config_lsp.rb +103 -0
- data/lib/opencode_client/models/config_lsp_any_of_value.rb +103 -0
- data/lib/opencode_client/models/config_lsp_any_of_value_any_of.rb +188 -0
- data/lib/opencode_client/models/config_lsp_any_of_value_any_of1.rb +208 -0
- data/lib/opencode_client/models/config_mode.rb +157 -0
- data/lib/opencode_client/models/config_providers200_response.rb +194 -0
- data/lib/opencode_client/models/config_tui.rb +221 -0
- data/lib/opencode_client/models/config_tui_scroll_acceleration.rb +166 -0
- data/lib/opencode_client/models/config_watcher.rb +149 -0
- data/lib/opencode_client/models/event.rb +136 -0
- data/lib/opencode_client/models/event_command_executed.rb +214 -0
- data/lib/opencode_client/models/event_command_executed_properties.rb +264 -0
- data/lib/opencode_client/models/event_file_edited.rb +214 -0
- data/lib/opencode_client/models/event_file_edited_properties.rb +164 -0
- data/lib/opencode_client/models/event_file_watcher_updated.rb +214 -0
- data/lib/opencode_client/models/event_file_watcher_updated_properties.rb +214 -0
- data/lib/opencode_client/models/event_global_disposed.rb +214 -0
- data/lib/opencode_client/models/event_installation_update_available.rb +214 -0
- data/lib/opencode_client/models/event_installation_updated.rb +214 -0
- data/lib/opencode_client/models/event_installation_updated_properties.rb +164 -0
- data/lib/opencode_client/models/event_lsp_client_diagnostics.rb +214 -0
- data/lib/opencode_client/models/event_lsp_client_diagnostics_properties.rb +190 -0
- data/lib/opencode_client/models/event_lsp_updated.rb +214 -0
- data/lib/opencode_client/models/event_mcp_tools_changed.rb +214 -0
- data/lib/opencode_client/models/event_mcp_tools_changed_properties.rb +164 -0
- data/lib/opencode_client/models/event_message_part_removed.rb +214 -0
- data/lib/opencode_client/models/event_message_part_removed_properties.rb +216 -0
- data/lib/opencode_client/models/event_message_part_updated.rb +214 -0
- data/lib/opencode_client/models/event_message_part_updated_properties.rb +173 -0
- data/lib/opencode_client/models/event_message_removed.rb +214 -0
- data/lib/opencode_client/models/event_message_removed_properties.rb +190 -0
- data/lib/opencode_client/models/event_message_updated.rb +214 -0
- data/lib/opencode_client/models/event_message_updated_properties.rb +164 -0
- data/lib/opencode_client/models/event_permission_replied.rb +214 -0
- data/lib/opencode_client/models/event_permission_replied_properties.rb +216 -0
- data/lib/opencode_client/models/event_permission_updated.rb +214 -0
- data/lib/opencode_client/models/event_project_updated.rb +214 -0
- data/lib/opencode_client/models/event_pty_created.rb +214 -0
- data/lib/opencode_client/models/event_pty_created_properties.rb +164 -0
- data/lib/opencode_client/models/event_pty_deleted.rb +214 -0
- data/lib/opencode_client/models/event_pty_deleted_properties.rb +175 -0
- data/lib/opencode_client/models/event_pty_exited.rb +214 -0
- data/lib/opencode_client/models/event_pty_exited_properties.rb +201 -0
- data/lib/opencode_client/models/event_pty_updated.rb +214 -0
- data/lib/opencode_client/models/event_server_connected.rb +214 -0
- data/lib/opencode_client/models/event_server_instance_disposed.rb +214 -0
- data/lib/opencode_client/models/event_server_instance_disposed_properties.rb +164 -0
- data/lib/opencode_client/models/event_session_compacted.rb +214 -0
- data/lib/opencode_client/models/event_session_created.rb +214 -0
- data/lib/opencode_client/models/event_session_created_properties.rb +164 -0
- data/lib/opencode_client/models/event_session_deleted.rb +214 -0
- data/lib/opencode_client/models/event_session_diff.rb +214 -0
- data/lib/opencode_client/models/event_session_diff_properties.rb +192 -0
- data/lib/opencode_client/models/event_session_error.rb +214 -0
- data/lib/opencode_client/models/event_session_error_properties.rb +156 -0
- data/lib/opencode_client/models/event_session_idle.rb +214 -0
- data/lib/opencode_client/models/event_session_idle_properties.rb +164 -0
- data/lib/opencode_client/models/event_session_status.rb +214 -0
- data/lib/opencode_client/models/event_session_status_properties.rb +190 -0
- data/lib/opencode_client/models/event_session_updated.rb +214 -0
- data/lib/opencode_client/models/event_todo_updated.rb +214 -0
- data/lib/opencode_client/models/event_todo_updated_properties.rb +192 -0
- data/lib/opencode_client/models/event_tui_command_execute.rb +214 -0
- data/lib/opencode_client/models/event_tui_command_execute_properties.rb +164 -0
- data/lib/opencode_client/models/event_tui_command_execute_properties_command.rb +102 -0
- data/lib/opencode_client/models/event_tui_prompt_append.rb +214 -0
- data/lib/opencode_client/models/event_tui_toast_show.rb +214 -0
- data/lib/opencode_client/models/event_vcs_branch_updated.rb +214 -0
- data/lib/opencode_client/models/event_vcs_branch_updated_properties.rb +147 -0
- data/lib/opencode_client/models/file.rb +302 -0
- data/lib/opencode_client/models/file_content.rb +262 -0
- data/lib/opencode_client/models/file_content_patch.rb +245 -0
- data/lib/opencode_client/models/file_content_patch_hunks_inner.rb +270 -0
- data/lib/opencode_client/models/file_diff.rb +268 -0
- data/lib/opencode_client/models/file_node.rb +292 -0
- data/lib/opencode_client/models/file_part.rb +336 -0
- data/lib/opencode_client/models/file_part_input.rb +267 -0
- data/lib/opencode_client/models/file_part_source.rb +103 -0
- data/lib/opencode_client/models/file_part_source_text.rb +252 -0
- data/lib/opencode_client/models/file_source.rb +240 -0
- data/lib/opencode_client/models/find_text200_response_inner.rb +270 -0
- data/lib/opencode_client/models/find_text200_response_inner_path.rb +164 -0
- data/lib/opencode_client/models/find_text200_response_inner_submatches_inner.rb +216 -0
- data/lib/opencode_client/models/formatter_status.rb +218 -0
- data/lib/opencode_client/models/global_event.rb +190 -0
- data/lib/opencode_client/models/global_health200_response.rb +214 -0
- data/lib/opencode_client/models/keybinds_config.rb +1171 -0
- data/lib/opencode_client/models/layout_config.rb +40 -0
- data/lib/opencode_client/models/log_level.rb +42 -0
- data/lib/opencode_client/models/lsp_status.rb +266 -0
- data/lib/opencode_client/models/mcp_add_request.rb +190 -0
- data/lib/opencode_client/models/mcp_add_request_config.rb +103 -0
- data/lib/opencode_client/models/mcp_auth_callback_request.rb +165 -0
- data/lib/opencode_client/models/mcp_auth_remove200_response.rb +188 -0
- data/lib/opencode_client/models/mcp_auth_start200_response.rb +165 -0
- data/lib/opencode_client/models/mcp_local_config.rb +269 -0
- data/lib/opencode_client/models/mcp_o_auth_config.rb +168 -0
- data/lib/opencode_client/models/mcp_remote_config.rb +276 -0
- data/lib/opencode_client/models/mcp_remote_config_oauth.rb +104 -0
- data/lib/opencode_client/models/mcp_status.rb +106 -0
- data/lib/opencode_client/models/mcp_status_connected.rb +188 -0
- data/lib/opencode_client/models/mcp_status_disabled.rb +188 -0
- data/lib/opencode_client/models/mcp_status_failed.rb +214 -0
- data/lib/opencode_client/models/mcp_status_needs_auth.rb +188 -0
- data/lib/opencode_client/models/mcp_status_needs_client_registration.rb +214 -0
- data/lib/opencode_client/models/message.rb +103 -0
- data/lib/opencode_client/models/message_aborted_error.rb +214 -0
- data/lib/opencode_client/models/message_output_length_error.rb +214 -0
- data/lib/opencode_client/models/model.rb +461 -0
- data/lib/opencode_client/models/model_api.rb +216 -0
- data/lib/opencode_client/models/model_capabilities.rb +320 -0
- data/lib/opencode_client/models/model_capabilities_input.rb +268 -0
- data/lib/opencode_client/models/model_capabilities_interleaved.rb +103 -0
- data/lib/opencode_client/models/model_capabilities_interleaved_any_of.rb +188 -0
- data/lib/opencode_client/models/model_cost.rb +225 -0
- data/lib/opencode_client/models/model_cost_experimental_over200_k.rb +216 -0
- data/lib/opencode_client/models/not_found_error.rb +214 -0
- data/lib/opencode_client/models/o_auth.rb +275 -0
- data/lib/opencode_client/models/part.rb +113 -0
- data/lib/opencode_client/models/part_any_of.rb +353 -0
- data/lib/opencode_client/models/patch_part.rb +320 -0
- data/lib/opencode_client/models/path.rb +268 -0
- data/lib/opencode_client/models/permission.rb +340 -0
- data/lib/opencode_client/models/permission_pattern.rb +103 -0
- data/lib/opencode_client/models/permission_respond_request.rb +188 -0
- data/lib/opencode_client/models/project.rb +277 -0
- data/lib/opencode_client/models/project_time.rb +199 -0
- data/lib/opencode_client/models/project_update_request.rb +156 -0
- data/lib/opencode_client/models/project_update_request_icon.rb +156 -0
- data/lib/opencode_client/models/provider.rb +333 -0
- data/lib/opencode_client/models/provider_auth_authorization.rb +240 -0
- data/lib/opencode_client/models/provider_auth_error.rb +214 -0
- data/lib/opencode_client/models/provider_auth_error_data.rb +190 -0
- data/lib/opencode_client/models/provider_auth_method.rb +214 -0
- data/lib/opencode_client/models/provider_config.rb +227 -0
- data/lib/opencode_client/models/provider_config_models_value.rb +329 -0
- data/lib/opencode_client/models/provider_config_models_value_interleaved.rb +103 -0
- data/lib/opencode_client/models/provider_config_models_value_interleaved_any_of.rb +188 -0
- data/lib/opencode_client/models/provider_config_options.rb +185 -0
- data/lib/opencode_client/models/provider_config_options_timeout.rb +104 -0
- data/lib/opencode_client/models/provider_list200_response.rb +222 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner.rb +264 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value.rb +482 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_cost.rb +217 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_cost_context_over200k.rb +208 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_interleaved.rb +103 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_interleaved_any_of.rb +188 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_limit.rb +190 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_modalities.rb +196 -0
- data/lib/opencode_client/models/provider_list200_response_all_inner_models_value_provider.rb +164 -0
- data/lib/opencode_client/models/provider_oauth_authorize_request.rb +165 -0
- data/lib/opencode_client/models/provider_oauth_callback_request.rb +175 -0
- data/lib/opencode_client/models/pty.rb +357 -0
- data/lib/opencode_client/models/pty_create_request.rb +187 -0
- data/lib/opencode_client/models/pty_update_request.rb +156 -0
- data/lib/opencode_client/models/pty_update_request_size.rb +190 -0
- data/lib/opencode_client/models/range.rb +190 -0
- data/lib/opencode_client/models/range_start.rb +190 -0
- data/lib/opencode_client/models/reasoning_part.rb +329 -0
- data/lib/opencode_client/models/retry_part.rb +344 -0
- data/lib/opencode_client/models/server_config.rb +188 -0
- data/lib/opencode_client/models/session.rb +362 -0
- data/lib/opencode_client/models/session_command_request.rb +238 -0
- data/lib/opencode_client/models/session_create_request.rb +177 -0
- data/lib/opencode_client/models/session_fork_request.rb +168 -0
- data/lib/opencode_client/models/session_init_request.rb +227 -0
- data/lib/opencode_client/models/session_messages200_response_inner.rb +192 -0
- data/lib/opencode_client/models/session_prompt200_response.rb +192 -0
- data/lib/opencode_client/models/session_prompt_request.rb +243 -0
- data/lib/opencode_client/models/session_prompt_request_model.rb +190 -0
- data/lib/opencode_client/models/session_prompt_request_parts_inner.rb +105 -0
- data/lib/opencode_client/models/session_revert.rb +191 -0
- data/lib/opencode_client/models/session_revert_request.rb +205 -0
- data/lib/opencode_client/models/session_share.rb +164 -0
- data/lib/opencode_client/models/session_shell_request.rb +199 -0
- data/lib/opencode_client/models/session_status.rb +104 -0
- data/lib/opencode_client/models/session_status_any_of.rb +188 -0
- data/lib/opencode_client/models/session_status_any_of1.rb +266 -0
- data/lib/opencode_client/models/session_status_any_of2.rb +188 -0
- data/lib/opencode_client/models/session_summarize_request.rb +201 -0
- data/lib/opencode_client/models/session_summary.rb +227 -0
- data/lib/opencode_client/models/session_time.rb +208 -0
- data/lib/opencode_client/models/session_update_request.rb +156 -0
- data/lib/opencode_client/models/session_update_request_time.rb +147 -0
- data/lib/opencode_client/models/snapshot_part.rb +292 -0
- data/lib/opencode_client/models/step_finish_part.rb +353 -0
- data/lib/opencode_client/models/step_start_part.rb +275 -0
- data/lib/opencode_client/models/subtask_part_input.rb +284 -0
- data/lib/opencode_client/models/symbol.rb +216 -0
- data/lib/opencode_client/models/symbol_location.rb +190 -0
- data/lib/opencode_client/models/symbol_source.rb +336 -0
- data/lib/opencode_client/models/text_part.rb +330 -0
- data/lib/opencode_client/models/text_part_input.rb +261 -0
- data/lib/opencode_client/models/text_part_time.rb +173 -0
- data/lib/opencode_client/models/todo.rb +246 -0
- data/lib/opencode_client/models/tool_list_item.rb +202 -0
- data/lib/opencode_client/models/tool_part.rb +355 -0
- data/lib/opencode_client/models/tool_state.rb +105 -0
- data/lib/opencode_client/models/tool_state_completed.rb +333 -0
- data/lib/opencode_client/models/tool_state_completed_time.rb +199 -0
- data/lib/opencode_client/models/tool_state_error.rb +279 -0
- data/lib/opencode_client/models/tool_state_error_time.rb +190 -0
- data/lib/opencode_client/models/tool_state_pending.rb +242 -0
- data/lib/opencode_client/models/tool_state_running.rb +262 -0
- data/lib/opencode_client/models/tool_state_running_time.rb +164 -0
- data/lib/opencode_client/models/tui_control_next200_response.rb +176 -0
- data/lib/opencode_client/models/tui_execute_command_request.rb +164 -0
- data/lib/opencode_client/models/tui_publish_request.rb +104 -0
- data/lib/opencode_client/models/tui_show_toast_request.rb +235 -0
- data/lib/opencode_client/models/unknown_error.rb +214 -0
- data/lib/opencode_client/models/unknown_error_data.rb +164 -0
- data/lib/opencode_client/models/user_message.rb +347 -0
- data/lib/opencode_client/models/user_message_summary.rb +184 -0
- data/lib/opencode_client/models/user_message_time.rb +164 -0
- data/lib/opencode_client/models/vcs_info.rb +164 -0
- data/lib/opencode_client/models/well_known_auth.rb +240 -0
- data/lib/opencode_client/version.rb +15 -0
- data/lib/opencode_client.rb +291 -0
- data/opencode_client.gemspec +39 -0
- data/pkg/opencode_client-1.0.0.gem +0 -0
- data/spec/api/default_api_spec.rb +1090 -0
- data/spec/api/session_api_spec.rb +61 -0
- data/spec/models/agent_config_permission_bash_spec.rb +21 -0
- data/spec/models/agent_config_permission_spec.rb +82 -0
- data/spec/models/agent_config_spec.rb +100 -0
- data/spec/models/agent_part_input_spec.rb +58 -0
- data/spec/models/agent_part_source_spec.rb +48 -0
- data/spec/models/agent_part_spec.rb +70 -0
- data/spec/models/agent_permission_spec.rb +90 -0
- data/spec/models/agent_spec.rb +124 -0
- data/spec/models/api_auth_spec.rb +46 -0
- data/spec/models/api_error_data_spec.rb +66 -0
- data/spec/models/api_error_spec.rb +46 -0
- data/spec/models/app_log_request_spec.rb +58 -0
- data/spec/models/assistant_message_error_spec.rb +21 -0
- data/spec/models/assistant_message_path_spec.rb +42 -0
- data/spec/models/assistant_message_spec.rb +124 -0
- data/spec/models/assistant_message_time_spec.rb +42 -0
- data/spec/models/assistant_message_tokens_cache_spec.rb +42 -0
- data/spec/models/assistant_message_tokens_spec.rb +54 -0
- data/spec/models/auth_spec.rb +21 -0
- data/spec/models/bad_request_error_spec.rb +52 -0
- data/spec/models/command_spec.rb +66 -0
- data/spec/models/compaction_part_spec.rb +64 -0
- data/spec/models/config_agent_spec.rb +72 -0
- data/spec/models/config_autoupdate_spec.rb +21 -0
- data/spec/models/config_command_value_spec.rb +60 -0
- data/spec/models/config_compaction_spec.rb +42 -0
- data/spec/models/config_enterprise_spec.rb +36 -0
- data/spec/models/config_experimental_hook_file_edited_value_inner_spec.rb +42 -0
- data/spec/models/config_experimental_hook_spec.rb +42 -0
- data/spec/models/config_experimental_spec.rb +72 -0
- data/spec/models/config_formatter_any_of_value_spec.rb +54 -0
- data/spec/models/config_formatter_spec.rb +21 -0
- data/spec/models/config_lsp_any_of_value_any_of1_spec.rb +60 -0
- data/spec/models/config_lsp_any_of_value_any_of_spec.rb +40 -0
- data/spec/models/config_lsp_any_of_value_spec.rb +21 -0
- data/spec/models/config_lsp_spec.rb +21 -0
- data/spec/models/config_mode_spec.rb +42 -0
- data/spec/models/config_providers200_response_spec.rb +42 -0
- data/spec/models/config_spec.rb +232 -0
- data/spec/models/config_tui_scroll_acceleration_spec.rb +36 -0
- data/spec/models/config_tui_spec.rb +52 -0
- data/spec/models/config_watcher_spec.rb +36 -0
- data/spec/models/event_command_executed_properties_spec.rb +54 -0
- data/spec/models/event_command_executed_spec.rb +46 -0
- data/spec/models/event_file_edited_properties_spec.rb +36 -0
- data/spec/models/event_file_edited_spec.rb +46 -0
- data/spec/models/event_file_watcher_updated_properties_spec.rb +46 -0
- data/spec/models/event_file_watcher_updated_spec.rb +46 -0
- data/spec/models/event_global_disposed_spec.rb +46 -0
- data/spec/models/event_installation_update_available_spec.rb +46 -0
- data/spec/models/event_installation_updated_properties_spec.rb +36 -0
- data/spec/models/event_installation_updated_spec.rb +46 -0
- data/spec/models/event_lsp_client_diagnostics_properties_spec.rb +42 -0
- data/spec/models/event_lsp_client_diagnostics_spec.rb +46 -0
- data/spec/models/event_lsp_updated_spec.rb +46 -0
- data/spec/models/event_mcp_tools_changed_properties_spec.rb +36 -0
- data/spec/models/event_mcp_tools_changed_spec.rb +46 -0
- data/spec/models/event_message_part_removed_properties_spec.rb +48 -0
- data/spec/models/event_message_part_removed_spec.rb +46 -0
- data/spec/models/event_message_part_updated_properties_spec.rb +42 -0
- data/spec/models/event_message_part_updated_spec.rb +46 -0
- data/spec/models/event_message_removed_properties_spec.rb +42 -0
- data/spec/models/event_message_removed_spec.rb +46 -0
- data/spec/models/event_message_updated_properties_spec.rb +36 -0
- data/spec/models/event_message_updated_spec.rb +46 -0
- data/spec/models/event_permission_replied_properties_spec.rb +48 -0
- data/spec/models/event_permission_replied_spec.rb +46 -0
- data/spec/models/event_permission_updated_spec.rb +46 -0
- data/spec/models/event_project_updated_spec.rb +46 -0
- data/spec/models/event_pty_created_properties_spec.rb +36 -0
- data/spec/models/event_pty_created_spec.rb +46 -0
- data/spec/models/event_pty_deleted_properties_spec.rb +36 -0
- data/spec/models/event_pty_deleted_spec.rb +46 -0
- data/spec/models/event_pty_exited_properties_spec.rb +42 -0
- data/spec/models/event_pty_exited_spec.rb +46 -0
- data/spec/models/event_pty_updated_spec.rb +46 -0
- data/spec/models/event_server_connected_spec.rb +46 -0
- data/spec/models/event_server_instance_disposed_properties_spec.rb +36 -0
- data/spec/models/event_server_instance_disposed_spec.rb +46 -0
- data/spec/models/event_session_compacted_spec.rb +46 -0
- data/spec/models/event_session_created_properties_spec.rb +36 -0
- data/spec/models/event_session_created_spec.rb +46 -0
- data/spec/models/event_session_deleted_spec.rb +46 -0
- data/spec/models/event_session_diff_properties_spec.rb +42 -0
- data/spec/models/event_session_diff_spec.rb +46 -0
- data/spec/models/event_session_error_properties_spec.rb +42 -0
- data/spec/models/event_session_error_spec.rb +46 -0
- data/spec/models/event_session_idle_properties_spec.rb +36 -0
- data/spec/models/event_session_idle_spec.rb +46 -0
- data/spec/models/event_session_status_properties_spec.rb +42 -0
- data/spec/models/event_session_status_spec.rb +46 -0
- data/spec/models/event_session_updated_spec.rb +46 -0
- data/spec/models/event_spec.rb +21 -0
- data/spec/models/event_todo_updated_properties_spec.rb +42 -0
- data/spec/models/event_todo_updated_spec.rb +46 -0
- data/spec/models/event_tui_command_execute_properties_command_spec.rb +21 -0
- data/spec/models/event_tui_command_execute_properties_spec.rb +36 -0
- data/spec/models/event_tui_command_execute_spec.rb +46 -0
- data/spec/models/event_tui_prompt_append_spec.rb +46 -0
- data/spec/models/event_tui_toast_show_spec.rb +46 -0
- data/spec/models/event_vcs_branch_updated_properties_spec.rb +36 -0
- data/spec/models/event_vcs_branch_updated_spec.rb +46 -0
- data/spec/models/file_content_patch_hunks_inner_spec.rb +60 -0
- data/spec/models/file_content_patch_spec.rb +66 -0
- data/spec/models/file_content_spec.rb +74 -0
- data/spec/models/file_diff_spec.rb +60 -0
- data/spec/models/file_node_spec.rb +64 -0
- data/spec/models/file_part_input_spec.rb +70 -0
- data/spec/models/file_part_source_spec.rb +21 -0
- data/spec/models/file_part_source_text_spec.rb +48 -0
- data/spec/models/file_part_spec.rb +82 -0
- data/spec/models/file_source_spec.rb +52 -0
- data/spec/models/file_spec.rb +58 -0
- data/spec/models/find_text200_response_inner_path_spec.rb +36 -0
- data/spec/models/find_text200_response_inner_spec.rb +60 -0
- data/spec/models/find_text200_response_inner_submatches_inner_spec.rb +48 -0
- data/spec/models/formatter_status_spec.rb +48 -0
- data/spec/models/global_event_spec.rb +42 -0
- data/spec/models/global_health200_response_spec.rb +46 -0
- data/spec/models/keybinds_config_spec.rb +546 -0
- data/spec/models/layout_config_spec.rb +30 -0
- data/spec/models/log_level_spec.rb +30 -0
- data/spec/models/lsp_status_spec.rb +58 -0
- data/spec/models/mcp_add_request_config_spec.rb +21 -0
- data/spec/models/mcp_add_request_spec.rb +42 -0
- data/spec/models/mcp_auth_callback_request_spec.rb +36 -0
- data/spec/models/mcp_auth_remove200_response_spec.rb +40 -0
- data/spec/models/mcp_auth_start200_response_spec.rb +36 -0
- data/spec/models/mcp_local_config_spec.rb +64 -0
- data/spec/models/mcp_o_auth_config_spec.rb +48 -0
- data/spec/models/mcp_remote_config_oauth_spec.rb +21 -0
- data/spec/models/mcp_remote_config_spec.rb +70 -0
- data/spec/models/mcp_status_connected_spec.rb +40 -0
- data/spec/models/mcp_status_disabled_spec.rb +40 -0
- data/spec/models/mcp_status_failed_spec.rb +46 -0
- data/spec/models/mcp_status_needs_auth_spec.rb +40 -0
- data/spec/models/mcp_status_needs_client_registration_spec.rb +46 -0
- data/spec/models/mcp_status_spec.rb +21 -0
- data/spec/models/message_aborted_error_spec.rb +46 -0
- data/spec/models/message_output_length_error_spec.rb +46 -0
- data/spec/models/message_spec.rb +21 -0
- data/spec/models/model_api_spec.rb +48 -0
- data/spec/models/model_capabilities_input_spec.rb +60 -0
- data/spec/models/model_capabilities_interleaved_any_of_spec.rb +40 -0
- data/spec/models/model_capabilities_interleaved_spec.rb +21 -0
- data/spec/models/model_capabilities_spec.rb +72 -0
- data/spec/models/model_cost_experimental_over200_k_spec.rb +48 -0
- data/spec/models/model_cost_spec.rb +54 -0
- data/spec/models/model_spec.rb +106 -0
- data/spec/models/not_found_error_spec.rb +46 -0
- data/spec/models/o_auth_spec.rb +64 -0
- data/spec/models/part_any_of_spec.rb +82 -0
- data/spec/models/part_spec.rb +21 -0
- data/spec/models/patch_part_spec.rb +70 -0
- data/spec/models/path_spec.rb +60 -0
- data/spec/models/permission_pattern_spec.rb +21 -0
- data/spec/models/permission_respond_request_spec.rb +40 -0
- data/spec/models/permission_spec.rb +84 -0
- data/spec/models/project_spec.rb +70 -0
- data/spec/models/project_time_spec.rb +48 -0
- data/spec/models/project_update_request_icon_spec.rb +42 -0
- data/spec/models/project_update_request_spec.rb +42 -0
- data/spec/models/provider_auth_authorization_spec.rb +52 -0
- data/spec/models/provider_auth_error_data_spec.rb +42 -0
- data/spec/models/provider_auth_error_spec.rb +46 -0
- data/spec/models/provider_auth_method_spec.rb +46 -0
- data/spec/models/provider_config_models_value_interleaved_any_of_spec.rb +40 -0
- data/spec/models/provider_config_models_value_interleaved_spec.rb +21 -0
- data/spec/models/provider_config_models_value_spec.rb +136 -0
- data/spec/models/provider_config_options_spec.rb +60 -0
- data/spec/models/provider_config_options_timeout_spec.rb +21 -0
- data/spec/models/provider_config_spec.rb +84 -0
- data/spec/models/provider_list200_response_all_inner_models_value_cost_context_over200k_spec.rb +54 -0
- data/spec/models/provider_list200_response_all_inner_models_value_cost_spec.rb +60 -0
- data/spec/models/provider_list200_response_all_inner_models_value_interleaved_any_of_spec.rb +40 -0
- data/spec/models/provider_list200_response_all_inner_models_value_interleaved_spec.rb +21 -0
- data/spec/models/provider_list200_response_all_inner_models_value_limit_spec.rb +42 -0
- data/spec/models/provider_list200_response_all_inner_models_value_modalities_spec.rb +50 -0
- data/spec/models/provider_list200_response_all_inner_models_value_provider_spec.rb +36 -0
- data/spec/models/provider_list200_response_all_inner_models_value_spec.rb +136 -0
- data/spec/models/provider_list200_response_all_inner_spec.rb +66 -0
- data/spec/models/provider_list200_response_spec.rb +48 -0
- data/spec/models/provider_oauth_authorize_request_spec.rb +36 -0
- data/spec/models/provider_oauth_callback_request_spec.rb +42 -0
- data/spec/models/provider_spec.rb +76 -0
- data/spec/models/pty_create_request_spec.rb +60 -0
- data/spec/models/pty_spec.rb +76 -0
- data/spec/models/pty_update_request_size_spec.rb +42 -0
- data/spec/models/pty_update_request_spec.rb +42 -0
- data/spec/models/range_spec.rb +42 -0
- data/spec/models/range_start_spec.rb +42 -0
- data/spec/models/reasoning_part_spec.rb +76 -0
- data/spec/models/retry_part_spec.rb +76 -0
- data/spec/models/server_config_spec.rb +48 -0
- data/spec/models/session_command_request_spec.rb +60 -0
- data/spec/models/session_create_request_spec.rb +42 -0
- data/spec/models/session_fork_request_spec.rb +36 -0
- data/spec/models/session_init_request_spec.rb +48 -0
- data/spec/models/session_messages200_response_inner_spec.rb +42 -0
- data/spec/models/session_prompt200_response_spec.rb +42 -0
- data/spec/models/session_prompt_request_model_spec.rb +42 -0
- data/spec/models/session_prompt_request_parts_inner_spec.rb +21 -0
- data/spec/models/session_prompt_request_spec.rb +72 -0
- data/spec/models/session_revert_request_spec.rb +42 -0
- data/spec/models/session_revert_spec.rb +54 -0
- data/spec/models/session_share_spec.rb +36 -0
- data/spec/models/session_shell_request_spec.rb +48 -0
- data/spec/models/session_spec.rb +90 -0
- data/spec/models/session_status_any_of1_spec.rb +58 -0
- data/spec/models/session_status_any_of2_spec.rb +40 -0
- data/spec/models/session_status_any_of_spec.rb +40 -0
- data/spec/models/session_status_spec.rb +21 -0
- data/spec/models/session_summarize_request_spec.rb +48 -0
- data/spec/models/session_summary_spec.rb +54 -0
- data/spec/models/session_time_spec.rb +54 -0
- data/spec/models/session_update_request_spec.rb +42 -0
- data/spec/models/session_update_request_time_spec.rb +36 -0
- data/spec/models/snapshot_part_spec.rb +64 -0
- data/spec/models/step_finish_part_spec.rb +82 -0
- data/spec/models/step_start_part_spec.rb +64 -0
- data/spec/models/subtask_part_input_spec.rb +70 -0
- data/spec/models/symbol_location_spec.rb +42 -0
- data/spec/models/symbol_source_spec.rb +70 -0
- data/spec/models/symbol_spec.rb +48 -0
- data/spec/models/text_part_input_spec.rb +76 -0
- data/spec/models/text_part_spec.rb +88 -0
- data/spec/models/text_part_time_spec.rb +42 -0
- data/spec/models/todo_spec.rb +54 -0
- data/spec/models/tool_list_item_spec.rb +48 -0
- data/spec/models/tool_part_spec.rb +82 -0
- data/spec/models/tool_state_completed_spec.rb +76 -0
- data/spec/models/tool_state_completed_time_spec.rb +48 -0
- data/spec/models/tool_state_error_spec.rb +64 -0
- data/spec/models/tool_state_error_time_spec.rb +42 -0
- data/spec/models/tool_state_pending_spec.rb +52 -0
- data/spec/models/tool_state_running_spec.rb +64 -0
- data/spec/models/tool_state_running_time_spec.rb +36 -0
- data/spec/models/tool_state_spec.rb +21 -0
- data/spec/models/tui_control_next200_response_spec.rb +42 -0
- data/spec/models/tui_execute_command_request_spec.rb +36 -0
- data/spec/models/tui_publish_request_spec.rb +21 -0
- data/spec/models/tui_show_toast_request_spec.rb +58 -0
- data/spec/models/unknown_error_data_spec.rb +36 -0
- data/spec/models/unknown_error_spec.rb +46 -0
- data/spec/models/user_message_spec.rb +88 -0
- data/spec/models/user_message_summary_spec.rb +48 -0
- data/spec/models/user_message_time_spec.rb +36 -0
- data/spec/models/vcs_info_spec.rb +36 -0
- data/spec/models/well_known_auth_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +1099 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#opencode
|
|
3
|
+
|
|
4
|
+
#opencode api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OpencodeClient
|
|
17
|
+
class ConfigExperimental < ApiModelBase
|
|
18
|
+
attr_accessor :hook
|
|
19
|
+
|
|
20
|
+
# Number of retries for chat completions on failure
|
|
21
|
+
attr_accessor :chat_max_retries
|
|
22
|
+
|
|
23
|
+
attr_accessor :disable_paste_summary
|
|
24
|
+
|
|
25
|
+
# Enable the batch tool
|
|
26
|
+
attr_accessor :batch_tool
|
|
27
|
+
|
|
28
|
+
# Enable OpenTelemetry spans for AI SDK calls (using the 'experimental_telemetry' flag)
|
|
29
|
+
attr_accessor :open_telemetry
|
|
30
|
+
|
|
31
|
+
# Tools that should only be available to primary agents.
|
|
32
|
+
attr_accessor :primary_tools
|
|
33
|
+
|
|
34
|
+
# Continue the agent loop when a tool call is denied
|
|
35
|
+
attr_accessor :continue_loop_on_deny
|
|
36
|
+
|
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
|
+
def self.attribute_map
|
|
39
|
+
{
|
|
40
|
+
:'hook' => :'hook',
|
|
41
|
+
:'chat_max_retries' => :'chatMaxRetries',
|
|
42
|
+
:'disable_paste_summary' => :'disable_paste_summary',
|
|
43
|
+
:'batch_tool' => :'batch_tool',
|
|
44
|
+
:'open_telemetry' => :'openTelemetry',
|
|
45
|
+
:'primary_tools' => :'primary_tools',
|
|
46
|
+
:'continue_loop_on_deny' => :'continue_loop_on_deny'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns attribute mapping this model knows about
|
|
51
|
+
def self.acceptable_attribute_map
|
|
52
|
+
attribute_map
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns all the JSON keys this model knows about
|
|
56
|
+
def self.acceptable_attributes
|
|
57
|
+
acceptable_attribute_map.values
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.openapi_types
|
|
62
|
+
{
|
|
63
|
+
:'hook' => :'ConfigExperimentalHook',
|
|
64
|
+
:'chat_max_retries' => :'Float',
|
|
65
|
+
:'disable_paste_summary' => :'Boolean',
|
|
66
|
+
:'batch_tool' => :'Boolean',
|
|
67
|
+
:'open_telemetry' => :'Boolean',
|
|
68
|
+
:'primary_tools' => :'Array<String>',
|
|
69
|
+
:'continue_loop_on_deny' => :'Boolean'
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# List of attributes with nullable: true
|
|
74
|
+
def self.openapi_nullable
|
|
75
|
+
Set.new([
|
|
76
|
+
])
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Initializes the object
|
|
80
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
|
+
def initialize(attributes = {})
|
|
82
|
+
if (!attributes.is_a?(Hash))
|
|
83
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpencodeClient::ConfigExperimental` initialize method"
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
87
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
88
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
89
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
90
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpencodeClient::ConfigExperimental`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
91
|
+
end
|
|
92
|
+
h[k.to_sym] = v
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'hook')
|
|
96
|
+
self.hook = attributes[:'hook']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'chat_max_retries')
|
|
100
|
+
self.chat_max_retries = attributes[:'chat_max_retries']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'disable_paste_summary')
|
|
104
|
+
self.disable_paste_summary = attributes[:'disable_paste_summary']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'batch_tool')
|
|
108
|
+
self.batch_tool = attributes[:'batch_tool']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'open_telemetry')
|
|
112
|
+
self.open_telemetry = attributes[:'open_telemetry']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'primary_tools')
|
|
116
|
+
if (value = attributes[:'primary_tools']).is_a?(Array)
|
|
117
|
+
self.primary_tools = value
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'continue_loop_on_deny')
|
|
122
|
+
self.continue_loop_on_deny = attributes[:'continue_loop_on_deny']
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
invalid_properties
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Check to see if the all the properties in the model are valid
|
|
135
|
+
# @return true if the model is valid
|
|
136
|
+
def valid?
|
|
137
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
138
|
+
true
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Checks equality by comparing each attribute.
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def ==(o)
|
|
144
|
+
return true if self.equal?(o)
|
|
145
|
+
self.class == o.class &&
|
|
146
|
+
hook == o.hook &&
|
|
147
|
+
chat_max_retries == o.chat_max_retries &&
|
|
148
|
+
disable_paste_summary == o.disable_paste_summary &&
|
|
149
|
+
batch_tool == o.batch_tool &&
|
|
150
|
+
open_telemetry == o.open_telemetry &&
|
|
151
|
+
primary_tools == o.primary_tools &&
|
|
152
|
+
continue_loop_on_deny == o.continue_loop_on_deny
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# @see the `==` method
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def eql?(o)
|
|
158
|
+
self == o
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Calculates hash code according to all attributes.
|
|
162
|
+
# @return [Integer] Hash code
|
|
163
|
+
def hash
|
|
164
|
+
[hook, chat_max_retries, disable_paste_summary, batch_tool, open_telemetry, primary_tools, continue_loop_on_deny].hash
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
# Builds the object from hash
|
|
168
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
169
|
+
# @return [Object] Returns the model itself
|
|
170
|
+
def self.build_from_hash(attributes)
|
|
171
|
+
return nil unless attributes.is_a?(Hash)
|
|
172
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
173
|
+
transformed_hash = {}
|
|
174
|
+
openapi_types.each_pair do |key, type|
|
|
175
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
176
|
+
transformed_hash["#{key}"] = nil
|
|
177
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
178
|
+
# check to ensure the input is an array given that the attribute
|
|
179
|
+
# is documented as an array but the input is not
|
|
180
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
181
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
182
|
+
end
|
|
183
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
new(transformed_hash)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the object in the form of hash
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_hash
|
|
193
|
+
hash = {}
|
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
if value.nil?
|
|
197
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
198
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
hash[param] = _to_hash(value)
|
|
202
|
+
end
|
|
203
|
+
hash
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
end
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#opencode
|
|
3
|
+
|
|
4
|
+
#opencode api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OpencodeClient
|
|
17
|
+
class ConfigExperimentalHook < ApiModelBase
|
|
18
|
+
attr_accessor :file_edited
|
|
19
|
+
|
|
20
|
+
attr_accessor :session_completed
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'file_edited' => :'file_edited',
|
|
26
|
+
:'session_completed' => :'session_completed'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'file_edited' => :'Hash<String, Array<ConfigExperimentalHookFileEditedValueInner>>',
|
|
44
|
+
:'session_completed' => :'Array<ConfigExperimentalHookFileEditedValueInner>'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpencodeClient::ConfigExperimentalHook` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpencodeClient::ConfigExperimentalHook`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'file_edited')
|
|
71
|
+
if (value = attributes[:'file_edited']).is_a?(Hash)
|
|
72
|
+
self.file_edited = value
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'session_completed')
|
|
77
|
+
if (value = attributes[:'session_completed']).is_a?(Array)
|
|
78
|
+
self.session_completed = value
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
invalid_properties
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Check to see if the all the properties in the model are valid
|
|
92
|
+
# @return true if the model is valid
|
|
93
|
+
def valid?
|
|
94
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
95
|
+
true
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Checks equality by comparing each attribute.
|
|
99
|
+
# @param [Object] Object to be compared
|
|
100
|
+
def ==(o)
|
|
101
|
+
return true if self.equal?(o)
|
|
102
|
+
self.class == o.class &&
|
|
103
|
+
file_edited == o.file_edited &&
|
|
104
|
+
session_completed == o.session_completed
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# @see the `==` method
|
|
108
|
+
# @param [Object] Object to be compared
|
|
109
|
+
def eql?(o)
|
|
110
|
+
self == o
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Calculates hash code according to all attributes.
|
|
114
|
+
# @return [Integer] Hash code
|
|
115
|
+
def hash
|
|
116
|
+
[file_edited, session_completed].hash
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Builds the object from hash
|
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
121
|
+
# @return [Object] Returns the model itself
|
|
122
|
+
def self.build_from_hash(attributes)
|
|
123
|
+
return nil unless attributes.is_a?(Hash)
|
|
124
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
125
|
+
transformed_hash = {}
|
|
126
|
+
openapi_types.each_pair do |key, type|
|
|
127
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
128
|
+
transformed_hash["#{key}"] = nil
|
|
129
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
130
|
+
# check to ensure the input is an array given that the attribute
|
|
131
|
+
# is documented as an array but the input is not
|
|
132
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
133
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
134
|
+
end
|
|
135
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
136
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
new(transformed_hash)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Returns the object in the form of hash
|
|
143
|
+
# @return [Hash] Returns the object in the form of hash
|
|
144
|
+
def to_hash
|
|
145
|
+
hash = {}
|
|
146
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
147
|
+
value = self.send(attr)
|
|
148
|
+
if value.nil?
|
|
149
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
150
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
hash[param] = _to_hash(value)
|
|
154
|
+
end
|
|
155
|
+
hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
end
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#opencode
|
|
3
|
+
|
|
4
|
+
#opencode api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OpencodeClient
|
|
17
|
+
class ConfigExperimentalHookFileEditedValueInner < ApiModelBase
|
|
18
|
+
attr_accessor :command
|
|
19
|
+
|
|
20
|
+
attr_accessor :environment
|
|
21
|
+
|
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
23
|
+
def self.attribute_map
|
|
24
|
+
{
|
|
25
|
+
:'command' => :'command',
|
|
26
|
+
:'environment' => :'environment'
|
|
27
|
+
}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Returns attribute mapping this model knows about
|
|
31
|
+
def self.acceptable_attribute_map
|
|
32
|
+
attribute_map
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Returns all the JSON keys this model knows about
|
|
36
|
+
def self.acceptable_attributes
|
|
37
|
+
acceptable_attribute_map.values
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Attribute type mapping.
|
|
41
|
+
def self.openapi_types
|
|
42
|
+
{
|
|
43
|
+
:'command' => :'Array<String>',
|
|
44
|
+
:'environment' => :'Hash<String, String>'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List of attributes with nullable: true
|
|
49
|
+
def self.openapi_nullable
|
|
50
|
+
Set.new([
|
|
51
|
+
])
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Initializes the object
|
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
56
|
+
def initialize(attributes = {})
|
|
57
|
+
if (!attributes.is_a?(Hash))
|
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OpencodeClient::ConfigExperimentalHookFileEditedValueInner` initialize method"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
62
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
63
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
64
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
65
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OpencodeClient::ConfigExperimentalHookFileEditedValueInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
66
|
+
end
|
|
67
|
+
h[k.to_sym] = v
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'command')
|
|
71
|
+
if (value = attributes[:'command']).is_a?(Array)
|
|
72
|
+
self.command = value
|
|
73
|
+
end
|
|
74
|
+
else
|
|
75
|
+
self.command = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'environment')
|
|
79
|
+
if (value = attributes[:'environment']).is_a?(Hash)
|
|
80
|
+
self.environment = value
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
86
|
+
# @return Array for valid properties with the reasons
|
|
87
|
+
def list_invalid_properties
|
|
88
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
89
|
+
invalid_properties = Array.new
|
|
90
|
+
if @command.nil?
|
|
91
|
+
invalid_properties.push('invalid value for "command", command cannot be nil.')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
invalid_properties
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Check to see if the all the properties in the model are valid
|
|
98
|
+
# @return true if the model is valid
|
|
99
|
+
def valid?
|
|
100
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
101
|
+
return false if @command.nil?
|
|
102
|
+
true
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Custom attribute writer method with validation
|
|
106
|
+
# @param [Object] command Value to be assigned
|
|
107
|
+
def command=(command)
|
|
108
|
+
if command.nil?
|
|
109
|
+
fail ArgumentError, 'command cannot be nil'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
@command = command
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Checks equality by comparing each attribute.
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def ==(o)
|
|
118
|
+
return true if self.equal?(o)
|
|
119
|
+
self.class == o.class &&
|
|
120
|
+
command == o.command &&
|
|
121
|
+
environment == o.environment
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# @see the `==` method
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def eql?(o)
|
|
127
|
+
self == o
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# Calculates hash code according to all attributes.
|
|
131
|
+
# @return [Integer] Hash code
|
|
132
|
+
def hash
|
|
133
|
+
[command, environment].hash
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Builds the object from hash
|
|
137
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
138
|
+
# @return [Object] Returns the model itself
|
|
139
|
+
def self.build_from_hash(attributes)
|
|
140
|
+
return nil unless attributes.is_a?(Hash)
|
|
141
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
142
|
+
transformed_hash = {}
|
|
143
|
+
openapi_types.each_pair do |key, type|
|
|
144
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
145
|
+
transformed_hash["#{key}"] = nil
|
|
146
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
147
|
+
# check to ensure the input is an array given that the attribute
|
|
148
|
+
# is documented as an array but the input is not
|
|
149
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
150
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
151
|
+
end
|
|
152
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
153
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
new(transformed_hash)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Returns the object in the form of hash
|
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
|
161
|
+
def to_hash
|
|
162
|
+
hash = {}
|
|
163
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
164
|
+
value = self.send(attr)
|
|
165
|
+
if value.nil?
|
|
166
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
167
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
hash[param] = _to_hash(value)
|
|
171
|
+
end
|
|
172
|
+
hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#opencode
|
|
3
|
+
|
|
4
|
+
#opencode api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.18.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module OpencodeClient
|
|
17
|
+
module ConfigFormatter
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in anyOf (OpenAPI v3)
|
|
20
|
+
def openapi_any_of
|
|
21
|
+
[
|
|
22
|
+
:'Boolean',
|
|
23
|
+
:'Hash<String, ConfigFormatterAnyOfValue>'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of anyOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of anyOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_any_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
return find_and_cast_into_type(klass, data)
|
|
41
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
openapi_any_of.include?(:AnyType) ? data : nil
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
51
|
+
|
|
52
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
53
|
+
def find_and_cast_into_type(klass, data)
|
|
54
|
+
return if data.nil?
|
|
55
|
+
|
|
56
|
+
case klass.to_s
|
|
57
|
+
when 'Boolean'
|
|
58
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
59
|
+
when 'Float'
|
|
60
|
+
return data if data.instance_of?(Float)
|
|
61
|
+
when 'Integer'
|
|
62
|
+
return data if data.instance_of?(Integer)
|
|
63
|
+
when 'Time'
|
|
64
|
+
return Time.parse(data)
|
|
65
|
+
when 'Date'
|
|
66
|
+
return Date.iso8601(data)
|
|
67
|
+
when 'String'
|
|
68
|
+
return data if data.instance_of?(String)
|
|
69
|
+
when 'Object' # "type: object"
|
|
70
|
+
return data if data.instance_of?(Hash)
|
|
71
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
72
|
+
if data.instance_of?(Array)
|
|
73
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
74
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
75
|
+
end
|
|
76
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
77
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
78
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
79
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
80
|
+
end
|
|
81
|
+
else # model
|
|
82
|
+
const = OpencodeClient.const_get(klass)
|
|
83
|
+
if const
|
|
84
|
+
if const.respond_to?(:openapi_any_of) # nested anyOf model
|
|
85
|
+
model = const.build(data)
|
|
86
|
+
return model if model
|
|
87
|
+
else
|
|
88
|
+
# raise if data contains keys that are not known to the model
|
|
89
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
90
|
+
model = const.build_from_hash(data)
|
|
91
|
+
return model if model
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
raise # if no match by now, raise
|
|
97
|
+
rescue
|
|
98
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
end
|