diff options
| author | Dax <[email protected]> | 2025-09-15 03:12:07 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-15 03:12:07 -0400 |
| commit | c1b4e1f19dd45eeea791354cb041c520f55e1cdb (patch) | |
| tree | cc238910a99092592bc4baf926d5c5509128f29f /packages/sdk/go/config.go | |
| parent | 89d820b1c44028e673f2b4317a2104abb2be2e67 (diff) | |
| download | opencode-c1b4e1f19dd45eeea791354cb041c520f55e1cdb.tar.gz opencode-c1b4e1f19dd45eeea791354cb041c520f55e1cdb.zip | |
Upgrade to Zod v4 (#2605)
Co-authored-by: GitHub Action <[email protected]>
Diffstat (limited to 'packages/sdk/go/config.go')
| -rw-r--r-- | packages/sdk/go/config.go | 133 |
1 files changed, 67 insertions, 66 deletions
diff --git a/packages/sdk/go/config.go b/packages/sdk/go/config.go index b79bcb2ef..d469bdff1 100644 --- a/packages/sdk/go/config.go +++ b/packages/sdk/go/config.go @@ -676,6 +676,7 @@ type ConfigCommand struct { Agent string `json:"agent"` Description string `json:"description"` Model string `json:"model"` + Subtask bool `json:"subtask"` JSON configCommandJSON `json:"-"` } @@ -685,6 +686,7 @@ type configCommandJSON struct { Agent apijson.Field Description apijson.Field Model apijson.Field + Subtask apijson.Field raw string ExtraFields map[string]apijson.Field } @@ -698,18 +700,18 @@ func (r configCommandJSON) RawJSON() string { } type ConfigExperimental struct { - Hook ConfigExperimentalHook `json:"hook"` DisablePasteSummary bool `json:"disable_paste_summary"` + Hook ConfigExperimentalHook `json:"hook"` JSON configExperimentalJSON `json:"-"` } // configExperimentalJSON contains the JSON metadata for the struct // [ConfigExperimental] type configExperimentalJSON struct { - Hook apijson.Field - SummarizePaste apijson.Field - raw string - ExtraFields map[string]apijson.Field + DisablePasteSummary apijson.Field + Hook apijson.Field + raw string + ExtraFields map[string]apijson.Field } func (r *ConfigExperimental) UnmarshalJSON(data []byte) (err error) { @@ -1022,16 +1024,14 @@ type ConfigMcpUnion interface { func init() { apijson.RegisterUnion( reflect.TypeOf((*ConfigMcpUnion)(nil)).Elem(), - "type", + "", apijson.UnionVariant{ - TypeFilter: gjson.JSON, - Type: reflect.TypeOf(McpLocalConfig{}), - DiscriminatorValue: "local", + TypeFilter: gjson.JSON, + Type: reflect.TypeOf(McpLocalConfig{}), }, apijson.UnionVariant{ - TypeFilter: gjson.JSON, - Type: reflect.TypeOf(McpRemoteConfig{}), - DiscriminatorValue: "remote", + TypeFilter: gjson.JSON, + Type: reflect.TypeOf(McpRemoteConfig{}), }, ) } @@ -1753,15 +1753,15 @@ func (r ConfigShare) IsKnown() bool { // TUI specific settings type ConfigTui struct { // TUI scroll speed - ScrollSpeed float64 `json:"scroll_speed,required"` - JSON configTuiJSON `json:"-"` + ScrollSpeed float64 `json:"scroll_speed"` + JSON configTuiJSON `json:"-"` } // configTuiJSON contains the JSON metadata for the struct [ConfigTui] type configTuiJSON struct { - ScrollSpeed apijson.Field - raw string - ExtraFields map[string]apijson.Field + ScrollSpeed apijson.Field + raw string + ExtraFields map[string]apijson.Field } func (r *ConfigTui) UnmarshalJSON(data []byte) (err error) { @@ -1772,105 +1772,106 @@ func (r configTuiJSON) RawJSON() string { return r.raw } +// Custom keybind configurations type KeybindsConfig struct { // Next agent - AgentCycle string `json:"agent_cycle,required"` + AgentCycle string `json:"agent_cycle"` // Previous agent - AgentCycleReverse string `json:"agent_cycle_reverse,required"` + AgentCycleReverse string `json:"agent_cycle_reverse"` // List agents - AgentList string `json:"agent_list,required"` + AgentList string `json:"agent_list"` // Exit the application - AppExit string `json:"app_exit,required"` + AppExit string `json:"app_exit"` // Show help dialog - AppHelp string `json:"app_help,required"` + AppHelp string `json:"app_help"` // Open external editor - EditorOpen string `json:"editor_open,required"` + EditorOpen string `json:"editor_open"` // @deprecated Close file - FileClose string `json:"file_close,required"` + FileClose string `json:"file_close"` // @deprecated Split/unified diff - FileDiffToggle string `json:"file_diff_toggle,required"` + FileDiffToggle string `json:"file_diff_toggle"` // @deprecated Currently not available. List files - FileList string `json:"file_list,required"` + FileList string `json:"file_list"` // @deprecated Search file - FileSearch string `json:"file_search,required"` + FileSearch string `json:"file_search"` // Clear input field - InputClear string `json:"input_clear,required"` + InputClear string `json:"input_clear"` // Insert newline in input - InputNewline string `json:"input_newline,required"` + InputNewline string `json:"input_newline"` // Paste from clipboard - InputPaste string `json:"input_paste,required"` + InputPaste string `json:"input_paste"` // Submit input - InputSubmit string `json:"input_submit,required"` + InputSubmit string `json:"input_submit"` // Leader key for keybind combinations - Leader string `json:"leader,required"` + Leader string `json:"leader"` // Copy message - MessagesCopy string `json:"messages_copy,required"` + MessagesCopy string `json:"messages_copy"` // Navigate to first message - MessagesFirst string `json:"messages_first,required"` + MessagesFirst string `json:"messages_first"` // Scroll messages down by half page - MessagesHalfPageDown string `json:"messages_half_page_down,required"` + MessagesHalfPageDown string `json:"messages_half_page_down"` // Scroll messages up by half page - MessagesHalfPageUp string `json:"messages_half_page_up,required"` + MessagesHalfPageUp string `json:"messages_half_page_up"` // Navigate to last message - MessagesLast string `json:"messages_last,required"` + MessagesLast string `json:"messages_last"` // @deprecated Toggle layout - MessagesLayoutToggle string `json:"messages_layout_toggle,required"` + MessagesLayoutToggle string `json:"messages_layout_toggle"` // @deprecated Navigate to next message - MessagesNext string `json:"messages_next,required"` + MessagesNext string `json:"messages_next"` // Scroll messages down by one page - MessagesPageDown string `json:"messages_page_down,required"` + MessagesPageDown string `json:"messages_page_down"` // Scroll messages up by one page - MessagesPageUp string `json:"messages_page_up,required"` + MessagesPageUp string `json:"messages_page_up"` // @deprecated Navigate to previous message - MessagesPrevious string `json:"messages_previous,required"` + MessagesPrevious string `json:"messages_previous"` // Redo message - MessagesRedo string `json:"messages_redo,required"` + MessagesRedo string `json:"messages_redo"` // @deprecated use messages_undo. Revert message - MessagesRevert string `json:"messages_revert,required"` + MessagesRevert string `json:"messages_revert"` // Undo message - MessagesUndo string `json:"messages_undo,required"` + MessagesUndo string `json:"messages_undo"` // Next recent model - ModelCycleRecent string `json:"model_cycle_recent,required"` + ModelCycleRecent string `json:"model_cycle_recent"` // Previous recent model - ModelCycleRecentReverse string `json:"model_cycle_recent_reverse,required"` + ModelCycleRecentReverse string `json:"model_cycle_recent_reverse"` // List available models - ModelList string `json:"model_list,required"` + ModelList string `json:"model_list"` // Create/update AGENTS.md - ProjectInit string `json:"project_init,required"` + ProjectInit string `json:"project_init"` // Cycle to next child session - SessionChildCycle string `json:"session_child_cycle,required"` + SessionChildCycle string `json:"session_child_cycle"` // Cycle to previous child session - SessionChildCycleReverse string `json:"session_child_cycle_reverse,required"` + SessionChildCycleReverse string `json:"session_child_cycle_reverse"` // Compact the session - SessionCompact string `json:"session_compact,required"` + SessionCompact string `json:"session_compact"` // Export session to editor - SessionExport string `json:"session_export,required"` + SessionExport string `json:"session_export"` // Interrupt current session - SessionInterrupt string `json:"session_interrupt,required"` + SessionInterrupt string `json:"session_interrupt"` // List all sessions - SessionList string `json:"session_list,required"` + SessionList string `json:"session_list"` // Create a new session - SessionNew string `json:"session_new,required"` + SessionNew string `json:"session_new"` // Share current session - SessionShare string `json:"session_share,required"` + SessionShare string `json:"session_share"` // Show session timeline - SessionTimeline string `json:"session_timeline,required"` + SessionTimeline string `json:"session_timeline"` // Unshare current session - SessionUnshare string `json:"session_unshare,required"` + SessionUnshare string `json:"session_unshare"` // @deprecated use agent_cycle. Next agent - SwitchAgent string `json:"switch_agent,required"` + SwitchAgent string `json:"switch_agent"` // @deprecated use agent_cycle_reverse. Previous agent - SwitchAgentReverse string `json:"switch_agent_reverse,required"` + SwitchAgentReverse string `json:"switch_agent_reverse"` // @deprecated use agent_cycle. Next mode - SwitchMode string `json:"switch_mode,required"` + SwitchMode string `json:"switch_mode"` // @deprecated use agent_cycle_reverse. Previous mode - SwitchModeReverse string `json:"switch_mode_reverse,required"` + SwitchModeReverse string `json:"switch_mode_reverse"` // List available themes - ThemeList string `json:"theme_list,required"` + ThemeList string `json:"theme_list"` // Toggle thinking blocks - ThinkingBlocks string `json:"thinking_blocks,required"` + ThinkingBlocks string `json:"thinking_blocks"` // Toggle tool details - ToolDetails string `json:"tool_details,required"` + ToolDetails string `json:"tool_details"` JSON keybindsConfigJSON `json:"-"` } |
