config.go 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  1. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. package opencode
  3. import (
  4. "context"
  5. "net/http"
  6. "reflect"
  7. "github.com/sst/opencode-sdk-go/internal/apijson"
  8. "github.com/sst/opencode-sdk-go/internal/requestconfig"
  9. "github.com/sst/opencode-sdk-go/option"
  10. "github.com/tidwall/gjson"
  11. )
  12. // ConfigService contains methods and other services that help with interacting
  13. // with the opencode API.
  14. //
  15. // Note, unlike clients, this service does not read variables from the environment
  16. // automatically. You should not instantiate this service directly, and instead use
  17. // the [NewConfigService] method instead.
  18. type ConfigService struct {
  19. Options []option.RequestOption
  20. }
  21. // NewConfigService generates a new service that applies the given options to each
  22. // request. These options are applied after the parent client's options (if there
  23. // is one), and before any request-specific options.
  24. func NewConfigService(opts ...option.RequestOption) (r *ConfigService) {
  25. r = &ConfigService{}
  26. r.Options = opts
  27. return
  28. }
  29. // Get config info
  30. func (r *ConfigService) Get(ctx context.Context, opts ...option.RequestOption) (res *Config, err error) {
  31. opts = append(r.Options[:], opts...)
  32. path := "config"
  33. err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, nil, &res, opts...)
  34. return
  35. }
  36. type Config struct {
  37. // JSON schema reference for configuration validation
  38. Schema string `json:"$schema"`
  39. // Agent configuration, see https://opencode.ai/docs/agent
  40. Agent ConfigAgent `json:"agent"`
  41. // @deprecated Use 'share' field instead. Share newly created sessions
  42. // automatically
  43. Autoshare bool `json:"autoshare"`
  44. // Automatically update to the latest version
  45. Autoupdate bool `json:"autoupdate"`
  46. // Disable providers that are loaded automatically
  47. DisabledProviders []string `json:"disabled_providers"`
  48. Experimental ConfigExperimental `json:"experimental"`
  49. Formatter map[string]ConfigFormatter `json:"formatter"`
  50. // Additional instruction files or patterns to include
  51. Instructions []string `json:"instructions"`
  52. // Custom keybind configurations
  53. Keybinds KeybindsConfig `json:"keybinds"`
  54. // @deprecated Always uses stretch layout.
  55. Layout ConfigLayout `json:"layout"`
  56. Lsp map[string]ConfigLsp `json:"lsp"`
  57. // MCP (Model Context Protocol) server configurations
  58. Mcp map[string]ConfigMcp `json:"mcp"`
  59. // @deprecated Use `agent` field instead.
  60. Mode ConfigMode `json:"mode"`
  61. // Model to use in the format of provider/model, eg anthropic/claude-2
  62. Model string `json:"model"`
  63. Permission ConfigPermission `json:"permission"`
  64. Plugin []string `json:"plugin"`
  65. // Custom provider configurations and model overrides
  66. Provider map[string]ConfigProvider `json:"provider"`
  67. // Control sharing behavior:'manual' allows manual sharing via commands, 'auto'
  68. // enables automatic sharing, 'disabled' disables all sharing
  69. Share ConfigShare `json:"share"`
  70. // Small model to use for tasks like title generation in the format of
  71. // provider/model
  72. SmallModel string `json:"small_model"`
  73. Snapshot bool `json:"snapshot"`
  74. // Theme name to use for the interface
  75. Theme string `json:"theme"`
  76. // Custom username to display in conversations instead of system username
  77. Username string `json:"username"`
  78. JSON configJSON `json:"-"`
  79. }
  80. // configJSON contains the JSON metadata for the struct [Config]
  81. type configJSON struct {
  82. Schema apijson.Field
  83. Agent apijson.Field
  84. Autoshare apijson.Field
  85. Autoupdate apijson.Field
  86. DisabledProviders apijson.Field
  87. Experimental apijson.Field
  88. Formatter apijson.Field
  89. Instructions apijson.Field
  90. Keybinds apijson.Field
  91. Layout apijson.Field
  92. Lsp apijson.Field
  93. Mcp apijson.Field
  94. Mode apijson.Field
  95. Model apijson.Field
  96. Permission apijson.Field
  97. Plugin apijson.Field
  98. Provider apijson.Field
  99. Share apijson.Field
  100. SmallModel apijson.Field
  101. Snapshot apijson.Field
  102. Theme apijson.Field
  103. Username apijson.Field
  104. raw string
  105. ExtraFields map[string]apijson.Field
  106. }
  107. func (r *Config) UnmarshalJSON(data []byte) (err error) {
  108. return apijson.UnmarshalRoot(data, r)
  109. }
  110. func (r configJSON) RawJSON() string {
  111. return r.raw
  112. }
  113. // Agent configuration, see https://opencode.ai/docs/agent
  114. type ConfigAgent struct {
  115. Build ConfigAgentBuild `json:"build"`
  116. General ConfigAgentGeneral `json:"general"`
  117. Plan ConfigAgentPlan `json:"plan"`
  118. ExtraFields map[string]ConfigAgent `json:"-,extras"`
  119. JSON configAgentJSON `json:"-"`
  120. }
  121. // configAgentJSON contains the JSON metadata for the struct [ConfigAgent]
  122. type configAgentJSON struct {
  123. Build apijson.Field
  124. General apijson.Field
  125. Plan apijson.Field
  126. raw string
  127. ExtraFields map[string]apijson.Field
  128. }
  129. func (r *ConfigAgent) UnmarshalJSON(data []byte) (err error) {
  130. return apijson.UnmarshalRoot(data, r)
  131. }
  132. func (r configAgentJSON) RawJSON() string {
  133. return r.raw
  134. }
  135. type ConfigAgentBuild struct {
  136. // Description of when to use the agent
  137. Description string `json:"description"`
  138. Disable bool `json:"disable"`
  139. Mode ConfigAgentBuildMode `json:"mode"`
  140. Model string `json:"model"`
  141. Prompt string `json:"prompt"`
  142. Temperature float64 `json:"temperature"`
  143. Tools map[string]bool `json:"tools"`
  144. TopP float64 `json:"top_p"`
  145. JSON configAgentBuildJSON `json:"-"`
  146. }
  147. // configAgentBuildJSON contains the JSON metadata for the struct
  148. // [ConfigAgentBuild]
  149. type configAgentBuildJSON struct {
  150. Description apijson.Field
  151. Disable apijson.Field
  152. Mode apijson.Field
  153. Model apijson.Field
  154. Prompt apijson.Field
  155. Temperature apijson.Field
  156. Tools apijson.Field
  157. TopP apijson.Field
  158. raw string
  159. ExtraFields map[string]apijson.Field
  160. }
  161. func (r *ConfigAgentBuild) UnmarshalJSON(data []byte) (err error) {
  162. return apijson.UnmarshalRoot(data, r)
  163. }
  164. func (r configAgentBuildJSON) RawJSON() string {
  165. return r.raw
  166. }
  167. type ConfigAgentBuildMode string
  168. const (
  169. ConfigAgentBuildModeSubagent ConfigAgentBuildMode = "subagent"
  170. ConfigAgentBuildModePrimary ConfigAgentBuildMode = "primary"
  171. ConfigAgentBuildModeAll ConfigAgentBuildMode = "all"
  172. )
  173. func (r ConfigAgentBuildMode) IsKnown() bool {
  174. switch r {
  175. case ConfigAgentBuildModeSubagent, ConfigAgentBuildModePrimary, ConfigAgentBuildModeAll:
  176. return true
  177. }
  178. return false
  179. }
  180. type ConfigAgentGeneral struct {
  181. // Description of when to use the agent
  182. Description string `json:"description"`
  183. Disable bool `json:"disable"`
  184. Mode ConfigAgentGeneralMode `json:"mode"`
  185. Model string `json:"model"`
  186. Prompt string `json:"prompt"`
  187. Temperature float64 `json:"temperature"`
  188. Tools map[string]bool `json:"tools"`
  189. TopP float64 `json:"top_p"`
  190. JSON configAgentGeneralJSON `json:"-"`
  191. }
  192. // configAgentGeneralJSON contains the JSON metadata for the struct
  193. // [ConfigAgentGeneral]
  194. type configAgentGeneralJSON struct {
  195. Description apijson.Field
  196. Disable apijson.Field
  197. Mode apijson.Field
  198. Model apijson.Field
  199. Prompt apijson.Field
  200. Temperature apijson.Field
  201. Tools apijson.Field
  202. TopP apijson.Field
  203. raw string
  204. ExtraFields map[string]apijson.Field
  205. }
  206. func (r *ConfigAgentGeneral) UnmarshalJSON(data []byte) (err error) {
  207. return apijson.UnmarshalRoot(data, r)
  208. }
  209. func (r configAgentGeneralJSON) RawJSON() string {
  210. return r.raw
  211. }
  212. type ConfigAgentGeneralMode string
  213. const (
  214. ConfigAgentGeneralModeSubagent ConfigAgentGeneralMode = "subagent"
  215. ConfigAgentGeneralModePrimary ConfigAgentGeneralMode = "primary"
  216. ConfigAgentGeneralModeAll ConfigAgentGeneralMode = "all"
  217. )
  218. func (r ConfigAgentGeneralMode) IsKnown() bool {
  219. switch r {
  220. case ConfigAgentGeneralModeSubagent, ConfigAgentGeneralModePrimary, ConfigAgentGeneralModeAll:
  221. return true
  222. }
  223. return false
  224. }
  225. type ConfigAgentPlan struct {
  226. // Description of when to use the agent
  227. Description string `json:"description"`
  228. Disable bool `json:"disable"`
  229. Mode ConfigAgentPlanMode `json:"mode"`
  230. Model string `json:"model"`
  231. Prompt string `json:"prompt"`
  232. Temperature float64 `json:"temperature"`
  233. Tools map[string]bool `json:"tools"`
  234. TopP float64 `json:"top_p"`
  235. JSON configAgentPlanJSON `json:"-"`
  236. }
  237. // configAgentPlanJSON contains the JSON metadata for the struct [ConfigAgentPlan]
  238. type configAgentPlanJSON struct {
  239. Description apijson.Field
  240. Disable apijson.Field
  241. Mode apijson.Field
  242. Model apijson.Field
  243. Prompt apijson.Field
  244. Temperature apijson.Field
  245. Tools apijson.Field
  246. TopP apijson.Field
  247. raw string
  248. ExtraFields map[string]apijson.Field
  249. }
  250. func (r *ConfigAgentPlan) UnmarshalJSON(data []byte) (err error) {
  251. return apijson.UnmarshalRoot(data, r)
  252. }
  253. func (r configAgentPlanJSON) RawJSON() string {
  254. return r.raw
  255. }
  256. type ConfigAgentPlanMode string
  257. const (
  258. ConfigAgentPlanModeSubagent ConfigAgentPlanMode = "subagent"
  259. ConfigAgentPlanModePrimary ConfigAgentPlanMode = "primary"
  260. ConfigAgentPlanModeAll ConfigAgentPlanMode = "all"
  261. )
  262. func (r ConfigAgentPlanMode) IsKnown() bool {
  263. switch r {
  264. case ConfigAgentPlanModeSubagent, ConfigAgentPlanModePrimary, ConfigAgentPlanModeAll:
  265. return true
  266. }
  267. return false
  268. }
  269. type ConfigExperimental struct {
  270. Hook ConfigExperimentalHook `json:"hook"`
  271. JSON configExperimentalJSON `json:"-"`
  272. }
  273. // configExperimentalJSON contains the JSON metadata for the struct
  274. // [ConfigExperimental]
  275. type configExperimentalJSON struct {
  276. Hook apijson.Field
  277. raw string
  278. ExtraFields map[string]apijson.Field
  279. }
  280. func (r *ConfigExperimental) UnmarshalJSON(data []byte) (err error) {
  281. return apijson.UnmarshalRoot(data, r)
  282. }
  283. func (r configExperimentalJSON) RawJSON() string {
  284. return r.raw
  285. }
  286. type ConfigExperimentalHook struct {
  287. FileEdited map[string][]ConfigExperimentalHookFileEdited `json:"file_edited"`
  288. SessionCompleted []ConfigExperimentalHookSessionCompleted `json:"session_completed"`
  289. JSON configExperimentalHookJSON `json:"-"`
  290. }
  291. // configExperimentalHookJSON contains the JSON metadata for the struct
  292. // [ConfigExperimentalHook]
  293. type configExperimentalHookJSON struct {
  294. FileEdited apijson.Field
  295. SessionCompleted apijson.Field
  296. raw string
  297. ExtraFields map[string]apijson.Field
  298. }
  299. func (r *ConfigExperimentalHook) UnmarshalJSON(data []byte) (err error) {
  300. return apijson.UnmarshalRoot(data, r)
  301. }
  302. func (r configExperimentalHookJSON) RawJSON() string {
  303. return r.raw
  304. }
  305. type ConfigExperimentalHookFileEdited struct {
  306. Command []string `json:"command,required"`
  307. Environment map[string]string `json:"environment"`
  308. JSON configExperimentalHookFileEditedJSON `json:"-"`
  309. }
  310. // configExperimentalHookFileEditedJSON contains the JSON metadata for the struct
  311. // [ConfigExperimentalHookFileEdited]
  312. type configExperimentalHookFileEditedJSON struct {
  313. Command apijson.Field
  314. Environment apijson.Field
  315. raw string
  316. ExtraFields map[string]apijson.Field
  317. }
  318. func (r *ConfigExperimentalHookFileEdited) UnmarshalJSON(data []byte) (err error) {
  319. return apijson.UnmarshalRoot(data, r)
  320. }
  321. func (r configExperimentalHookFileEditedJSON) RawJSON() string {
  322. return r.raw
  323. }
  324. type ConfigExperimentalHookSessionCompleted struct {
  325. Command []string `json:"command,required"`
  326. Environment map[string]string `json:"environment"`
  327. JSON configExperimentalHookSessionCompletedJSON `json:"-"`
  328. }
  329. // configExperimentalHookSessionCompletedJSON contains the JSON metadata for the
  330. // struct [ConfigExperimentalHookSessionCompleted]
  331. type configExperimentalHookSessionCompletedJSON struct {
  332. Command apijson.Field
  333. Environment apijson.Field
  334. raw string
  335. ExtraFields map[string]apijson.Field
  336. }
  337. func (r *ConfigExperimentalHookSessionCompleted) UnmarshalJSON(data []byte) (err error) {
  338. return apijson.UnmarshalRoot(data, r)
  339. }
  340. func (r configExperimentalHookSessionCompletedJSON) RawJSON() string {
  341. return r.raw
  342. }
  343. type ConfigFormatter struct {
  344. Command []string `json:"command"`
  345. Disabled bool `json:"disabled"`
  346. Environment map[string]string `json:"environment"`
  347. Extensions []string `json:"extensions"`
  348. JSON configFormatterJSON `json:"-"`
  349. }
  350. // configFormatterJSON contains the JSON metadata for the struct [ConfigFormatter]
  351. type configFormatterJSON struct {
  352. Command apijson.Field
  353. Disabled apijson.Field
  354. Environment apijson.Field
  355. Extensions apijson.Field
  356. raw string
  357. ExtraFields map[string]apijson.Field
  358. }
  359. func (r *ConfigFormatter) UnmarshalJSON(data []byte) (err error) {
  360. return apijson.UnmarshalRoot(data, r)
  361. }
  362. func (r configFormatterJSON) RawJSON() string {
  363. return r.raw
  364. }
  365. // @deprecated Always uses stretch layout.
  366. type ConfigLayout string
  367. const (
  368. ConfigLayoutAuto ConfigLayout = "auto"
  369. ConfigLayoutStretch ConfigLayout = "stretch"
  370. )
  371. func (r ConfigLayout) IsKnown() bool {
  372. switch r {
  373. case ConfigLayoutAuto, ConfigLayoutStretch:
  374. return true
  375. }
  376. return false
  377. }
  378. type ConfigLsp struct {
  379. // This field can have the runtime type of [[]string].
  380. Command interface{} `json:"command"`
  381. Disabled bool `json:"disabled"`
  382. // This field can have the runtime type of [map[string]string].
  383. Env interface{} `json:"env"`
  384. // This field can have the runtime type of [[]string].
  385. Extensions interface{} `json:"extensions"`
  386. // This field can have the runtime type of [map[string]interface{}].
  387. Initialization interface{} `json:"initialization"`
  388. JSON configLspJSON `json:"-"`
  389. union ConfigLspUnion
  390. }
  391. // configLspJSON contains the JSON metadata for the struct [ConfigLsp]
  392. type configLspJSON struct {
  393. Command apijson.Field
  394. Disabled apijson.Field
  395. Env apijson.Field
  396. Extensions apijson.Field
  397. Initialization apijson.Field
  398. raw string
  399. ExtraFields map[string]apijson.Field
  400. }
  401. func (r configLspJSON) RawJSON() string {
  402. return r.raw
  403. }
  404. func (r *ConfigLsp) UnmarshalJSON(data []byte) (err error) {
  405. *r = ConfigLsp{}
  406. err = apijson.UnmarshalRoot(data, &r.union)
  407. if err != nil {
  408. return err
  409. }
  410. return apijson.Port(r.union, &r)
  411. }
  412. // AsUnion returns a [ConfigLspUnion] interface which you can cast to the specific
  413. // types for more type safety.
  414. //
  415. // Possible runtime types of the union are [ConfigLspDisabled], [ConfigLspObject].
  416. func (r ConfigLsp) AsUnion() ConfigLspUnion {
  417. return r.union
  418. }
  419. // Union satisfied by [ConfigLspDisabled] or [ConfigLspObject].
  420. type ConfigLspUnion interface {
  421. implementsConfigLsp()
  422. }
  423. func init() {
  424. apijson.RegisterUnion(
  425. reflect.TypeOf((*ConfigLspUnion)(nil)).Elem(),
  426. "",
  427. apijson.UnionVariant{
  428. TypeFilter: gjson.JSON,
  429. Type: reflect.TypeOf(ConfigLspDisabled{}),
  430. },
  431. apijson.UnionVariant{
  432. TypeFilter: gjson.JSON,
  433. Type: reflect.TypeOf(ConfigLspObject{}),
  434. },
  435. )
  436. }
  437. type ConfigLspDisabled struct {
  438. Disabled ConfigLspDisabledDisabled `json:"disabled,required"`
  439. JSON configLspDisabledJSON `json:"-"`
  440. }
  441. // configLspDisabledJSON contains the JSON metadata for the struct
  442. // [ConfigLspDisabled]
  443. type configLspDisabledJSON struct {
  444. Disabled apijson.Field
  445. raw string
  446. ExtraFields map[string]apijson.Field
  447. }
  448. func (r *ConfigLspDisabled) UnmarshalJSON(data []byte) (err error) {
  449. return apijson.UnmarshalRoot(data, r)
  450. }
  451. func (r configLspDisabledJSON) RawJSON() string {
  452. return r.raw
  453. }
  454. func (r ConfigLspDisabled) implementsConfigLsp() {}
  455. type ConfigLspDisabledDisabled bool
  456. const (
  457. ConfigLspDisabledDisabledTrue ConfigLspDisabledDisabled = true
  458. )
  459. func (r ConfigLspDisabledDisabled) IsKnown() bool {
  460. switch r {
  461. case ConfigLspDisabledDisabledTrue:
  462. return true
  463. }
  464. return false
  465. }
  466. type ConfigLspObject struct {
  467. Command []string `json:"command,required"`
  468. Disabled bool `json:"disabled"`
  469. Env map[string]string `json:"env"`
  470. Extensions []string `json:"extensions"`
  471. Initialization map[string]interface{} `json:"initialization"`
  472. JSON configLspObjectJSON `json:"-"`
  473. }
  474. // configLspObjectJSON contains the JSON metadata for the struct [ConfigLspObject]
  475. type configLspObjectJSON struct {
  476. Command apijson.Field
  477. Disabled apijson.Field
  478. Env apijson.Field
  479. Extensions apijson.Field
  480. Initialization apijson.Field
  481. raw string
  482. ExtraFields map[string]apijson.Field
  483. }
  484. func (r *ConfigLspObject) UnmarshalJSON(data []byte) (err error) {
  485. return apijson.UnmarshalRoot(data, r)
  486. }
  487. func (r configLspObjectJSON) RawJSON() string {
  488. return r.raw
  489. }
  490. func (r ConfigLspObject) implementsConfigLsp() {}
  491. type ConfigMcp struct {
  492. // Type of MCP server connection
  493. Type ConfigMcpType `json:"type,required"`
  494. // This field can have the runtime type of [[]string].
  495. Command interface{} `json:"command"`
  496. // Enable or disable the MCP server on startup
  497. Enabled bool `json:"enabled"`
  498. // This field can have the runtime type of [map[string]string].
  499. Environment interface{} `json:"environment"`
  500. // This field can have the runtime type of [map[string]string].
  501. Headers interface{} `json:"headers"`
  502. // URL of the remote MCP server
  503. URL string `json:"url"`
  504. JSON configMcpJSON `json:"-"`
  505. union ConfigMcpUnion
  506. }
  507. // configMcpJSON contains the JSON metadata for the struct [ConfigMcp]
  508. type configMcpJSON struct {
  509. Type apijson.Field
  510. Command apijson.Field
  511. Enabled apijson.Field
  512. Environment apijson.Field
  513. Headers apijson.Field
  514. URL apijson.Field
  515. raw string
  516. ExtraFields map[string]apijson.Field
  517. }
  518. func (r configMcpJSON) RawJSON() string {
  519. return r.raw
  520. }
  521. func (r *ConfigMcp) UnmarshalJSON(data []byte) (err error) {
  522. *r = ConfigMcp{}
  523. err = apijson.UnmarshalRoot(data, &r.union)
  524. if err != nil {
  525. return err
  526. }
  527. return apijson.Port(r.union, &r)
  528. }
  529. // AsUnion returns a [ConfigMcpUnion] interface which you can cast to the specific
  530. // types for more type safety.
  531. //
  532. // Possible runtime types of the union are [McpLocalConfig], [McpRemoteConfig].
  533. func (r ConfigMcp) AsUnion() ConfigMcpUnion {
  534. return r.union
  535. }
  536. // Union satisfied by [McpLocalConfig] or [McpRemoteConfig].
  537. type ConfigMcpUnion interface {
  538. implementsConfigMcp()
  539. }
  540. func init() {
  541. apijson.RegisterUnion(
  542. reflect.TypeOf((*ConfigMcpUnion)(nil)).Elem(),
  543. "type",
  544. apijson.UnionVariant{
  545. TypeFilter: gjson.JSON,
  546. Type: reflect.TypeOf(McpLocalConfig{}),
  547. DiscriminatorValue: "local",
  548. },
  549. apijson.UnionVariant{
  550. TypeFilter: gjson.JSON,
  551. Type: reflect.TypeOf(McpRemoteConfig{}),
  552. DiscriminatorValue: "remote",
  553. },
  554. )
  555. }
  556. // Type of MCP server connection
  557. type ConfigMcpType string
  558. const (
  559. ConfigMcpTypeLocal ConfigMcpType = "local"
  560. ConfigMcpTypeRemote ConfigMcpType = "remote"
  561. )
  562. func (r ConfigMcpType) IsKnown() bool {
  563. switch r {
  564. case ConfigMcpTypeLocal, ConfigMcpTypeRemote:
  565. return true
  566. }
  567. return false
  568. }
  569. // @deprecated Use `agent` field instead.
  570. type ConfigMode struct {
  571. Build ConfigModeBuild `json:"build"`
  572. Plan ConfigModePlan `json:"plan"`
  573. ExtraFields map[string]ConfigMode `json:"-,extras"`
  574. JSON configModeJSON `json:"-"`
  575. }
  576. // configModeJSON contains the JSON metadata for the struct [ConfigMode]
  577. type configModeJSON struct {
  578. Build apijson.Field
  579. Plan apijson.Field
  580. raw string
  581. ExtraFields map[string]apijson.Field
  582. }
  583. func (r *ConfigMode) UnmarshalJSON(data []byte) (err error) {
  584. return apijson.UnmarshalRoot(data, r)
  585. }
  586. func (r configModeJSON) RawJSON() string {
  587. return r.raw
  588. }
  589. type ConfigModeBuild struct {
  590. // Description of when to use the agent
  591. Description string `json:"description"`
  592. Disable bool `json:"disable"`
  593. Mode ConfigModeBuildMode `json:"mode"`
  594. Model string `json:"model"`
  595. Prompt string `json:"prompt"`
  596. Temperature float64 `json:"temperature"`
  597. Tools map[string]bool `json:"tools"`
  598. TopP float64 `json:"top_p"`
  599. JSON configModeBuildJSON `json:"-"`
  600. }
  601. // configModeBuildJSON contains the JSON metadata for the struct [ConfigModeBuild]
  602. type configModeBuildJSON struct {
  603. Description apijson.Field
  604. Disable apijson.Field
  605. Mode apijson.Field
  606. Model apijson.Field
  607. Prompt apijson.Field
  608. Temperature apijson.Field
  609. Tools apijson.Field
  610. TopP apijson.Field
  611. raw string
  612. ExtraFields map[string]apijson.Field
  613. }
  614. func (r *ConfigModeBuild) UnmarshalJSON(data []byte) (err error) {
  615. return apijson.UnmarshalRoot(data, r)
  616. }
  617. func (r configModeBuildJSON) RawJSON() string {
  618. return r.raw
  619. }
  620. type ConfigModeBuildMode string
  621. const (
  622. ConfigModeBuildModeSubagent ConfigModeBuildMode = "subagent"
  623. ConfigModeBuildModePrimary ConfigModeBuildMode = "primary"
  624. ConfigModeBuildModeAll ConfigModeBuildMode = "all"
  625. )
  626. func (r ConfigModeBuildMode) IsKnown() bool {
  627. switch r {
  628. case ConfigModeBuildModeSubagent, ConfigModeBuildModePrimary, ConfigModeBuildModeAll:
  629. return true
  630. }
  631. return false
  632. }
  633. type ConfigModePlan struct {
  634. // Description of when to use the agent
  635. Description string `json:"description"`
  636. Disable bool `json:"disable"`
  637. Mode ConfigModePlanMode `json:"mode"`
  638. Model string `json:"model"`
  639. Prompt string `json:"prompt"`
  640. Temperature float64 `json:"temperature"`
  641. Tools map[string]bool `json:"tools"`
  642. TopP float64 `json:"top_p"`
  643. JSON configModePlanJSON `json:"-"`
  644. }
  645. // configModePlanJSON contains the JSON metadata for the struct [ConfigModePlan]
  646. type configModePlanJSON struct {
  647. Description apijson.Field
  648. Disable apijson.Field
  649. Mode apijson.Field
  650. Model apijson.Field
  651. Prompt apijson.Field
  652. Temperature apijson.Field
  653. Tools apijson.Field
  654. TopP apijson.Field
  655. raw string
  656. ExtraFields map[string]apijson.Field
  657. }
  658. func (r *ConfigModePlan) UnmarshalJSON(data []byte) (err error) {
  659. return apijson.UnmarshalRoot(data, r)
  660. }
  661. func (r configModePlanJSON) RawJSON() string {
  662. return r.raw
  663. }
  664. type ConfigModePlanMode string
  665. const (
  666. ConfigModePlanModeSubagent ConfigModePlanMode = "subagent"
  667. ConfigModePlanModePrimary ConfigModePlanMode = "primary"
  668. ConfigModePlanModeAll ConfigModePlanMode = "all"
  669. )
  670. func (r ConfigModePlanMode) IsKnown() bool {
  671. switch r {
  672. case ConfigModePlanModeSubagent, ConfigModePlanModePrimary, ConfigModePlanModeAll:
  673. return true
  674. }
  675. return false
  676. }
  677. type ConfigPermission struct {
  678. Bash ConfigPermissionBashUnion `json:"bash"`
  679. Edit ConfigPermissionEdit `json:"edit"`
  680. Webfetch ConfigPermissionWebfetch `json:"webfetch"`
  681. JSON configPermissionJSON `json:"-"`
  682. }
  683. // configPermissionJSON contains the JSON metadata for the struct
  684. // [ConfigPermission]
  685. type configPermissionJSON struct {
  686. Bash apijson.Field
  687. Edit apijson.Field
  688. Webfetch apijson.Field
  689. raw string
  690. ExtraFields map[string]apijson.Field
  691. }
  692. func (r *ConfigPermission) UnmarshalJSON(data []byte) (err error) {
  693. return apijson.UnmarshalRoot(data, r)
  694. }
  695. func (r configPermissionJSON) RawJSON() string {
  696. return r.raw
  697. }
  698. // Union satisfied by [ConfigPermissionBashString] or [ConfigPermissionBashMap].
  699. type ConfigPermissionBashUnion interface {
  700. implementsConfigPermissionBashUnion()
  701. }
  702. func init() {
  703. apijson.RegisterUnion(
  704. reflect.TypeOf((*ConfigPermissionBashUnion)(nil)).Elem(),
  705. "",
  706. apijson.UnionVariant{
  707. TypeFilter: gjson.String,
  708. Type: reflect.TypeOf(ConfigPermissionBashString("")),
  709. },
  710. apijson.UnionVariant{
  711. TypeFilter: gjson.JSON,
  712. Type: reflect.TypeOf(ConfigPermissionBashMap{}),
  713. },
  714. )
  715. }
  716. type ConfigPermissionBashString string
  717. const (
  718. ConfigPermissionBashStringAsk ConfigPermissionBashString = "ask"
  719. ConfigPermissionBashStringAllow ConfigPermissionBashString = "allow"
  720. ConfigPermissionBashStringDeny ConfigPermissionBashString = "deny"
  721. )
  722. func (r ConfigPermissionBashString) IsKnown() bool {
  723. switch r {
  724. case ConfigPermissionBashStringAsk, ConfigPermissionBashStringAllow, ConfigPermissionBashStringDeny:
  725. return true
  726. }
  727. return false
  728. }
  729. func (r ConfigPermissionBashString) implementsConfigPermissionBashUnion() {}
  730. type ConfigPermissionBashMap map[string]ConfigPermissionBashMapItem
  731. func (r ConfigPermissionBashMap) implementsConfigPermissionBashUnion() {}
  732. type ConfigPermissionBashMapItem string
  733. const (
  734. ConfigPermissionBashMapAsk ConfigPermissionBashMapItem = "ask"
  735. ConfigPermissionBashMapAllow ConfigPermissionBashMapItem = "allow"
  736. ConfigPermissionBashMapDeny ConfigPermissionBashMapItem = "deny"
  737. )
  738. func (r ConfigPermissionBashMapItem) IsKnown() bool {
  739. switch r {
  740. case ConfigPermissionBashMapAsk, ConfigPermissionBashMapAllow, ConfigPermissionBashMapDeny:
  741. return true
  742. }
  743. return false
  744. }
  745. type ConfigPermissionEdit string
  746. const (
  747. ConfigPermissionEditAsk ConfigPermissionEdit = "ask"
  748. ConfigPermissionEditAllow ConfigPermissionEdit = "allow"
  749. ConfigPermissionEditDeny ConfigPermissionEdit = "deny"
  750. )
  751. func (r ConfigPermissionEdit) IsKnown() bool {
  752. switch r {
  753. case ConfigPermissionEditAsk, ConfigPermissionEditAllow, ConfigPermissionEditDeny:
  754. return true
  755. }
  756. return false
  757. }
  758. type ConfigPermissionWebfetch string
  759. const (
  760. ConfigPermissionWebfetchAsk ConfigPermissionWebfetch = "ask"
  761. ConfigPermissionWebfetchAllow ConfigPermissionWebfetch = "allow"
  762. ConfigPermissionWebfetchDeny ConfigPermissionWebfetch = "deny"
  763. )
  764. func (r ConfigPermissionWebfetch) IsKnown() bool {
  765. switch r {
  766. case ConfigPermissionWebfetchAsk, ConfigPermissionWebfetchAllow, ConfigPermissionWebfetchDeny:
  767. return true
  768. }
  769. return false
  770. }
  771. type ConfigProvider struct {
  772. Models map[string]ConfigProviderModel `json:"models,required"`
  773. ID string `json:"id"`
  774. API string `json:"api"`
  775. Env []string `json:"env"`
  776. Name string `json:"name"`
  777. Npm string `json:"npm"`
  778. Options ConfigProviderOptions `json:"options"`
  779. JSON configProviderJSON `json:"-"`
  780. }
  781. // configProviderJSON contains the JSON metadata for the struct [ConfigProvider]
  782. type configProviderJSON struct {
  783. Models apijson.Field
  784. ID apijson.Field
  785. API apijson.Field
  786. Env apijson.Field
  787. Name apijson.Field
  788. Npm apijson.Field
  789. Options apijson.Field
  790. raw string
  791. ExtraFields map[string]apijson.Field
  792. }
  793. func (r *ConfigProvider) UnmarshalJSON(data []byte) (err error) {
  794. return apijson.UnmarshalRoot(data, r)
  795. }
  796. func (r configProviderJSON) RawJSON() string {
  797. return r.raw
  798. }
  799. type ConfigProviderModel struct {
  800. ID string `json:"id"`
  801. Attachment bool `json:"attachment"`
  802. Cost ConfigProviderModelsCost `json:"cost"`
  803. Limit ConfigProviderModelsLimit `json:"limit"`
  804. Name string `json:"name"`
  805. Options map[string]interface{} `json:"options"`
  806. Reasoning bool `json:"reasoning"`
  807. ReleaseDate string `json:"release_date"`
  808. Temperature bool `json:"temperature"`
  809. ToolCall bool `json:"tool_call"`
  810. JSON configProviderModelJSON `json:"-"`
  811. }
  812. // configProviderModelJSON contains the JSON metadata for the struct
  813. // [ConfigProviderModel]
  814. type configProviderModelJSON struct {
  815. ID apijson.Field
  816. Attachment apijson.Field
  817. Cost apijson.Field
  818. Limit apijson.Field
  819. Name apijson.Field
  820. Options apijson.Field
  821. Reasoning apijson.Field
  822. ReleaseDate apijson.Field
  823. Temperature apijson.Field
  824. ToolCall apijson.Field
  825. raw string
  826. ExtraFields map[string]apijson.Field
  827. }
  828. func (r *ConfigProviderModel) UnmarshalJSON(data []byte) (err error) {
  829. return apijson.UnmarshalRoot(data, r)
  830. }
  831. func (r configProviderModelJSON) RawJSON() string {
  832. return r.raw
  833. }
  834. type ConfigProviderModelsCost struct {
  835. Input float64 `json:"input,required"`
  836. Output float64 `json:"output,required"`
  837. CacheRead float64 `json:"cache_read"`
  838. CacheWrite float64 `json:"cache_write"`
  839. JSON configProviderModelsCostJSON `json:"-"`
  840. }
  841. // configProviderModelsCostJSON contains the JSON metadata for the struct
  842. // [ConfigProviderModelsCost]
  843. type configProviderModelsCostJSON struct {
  844. Input apijson.Field
  845. Output apijson.Field
  846. CacheRead apijson.Field
  847. CacheWrite apijson.Field
  848. raw string
  849. ExtraFields map[string]apijson.Field
  850. }
  851. func (r *ConfigProviderModelsCost) UnmarshalJSON(data []byte) (err error) {
  852. return apijson.UnmarshalRoot(data, r)
  853. }
  854. func (r configProviderModelsCostJSON) RawJSON() string {
  855. return r.raw
  856. }
  857. type ConfigProviderModelsLimit struct {
  858. Context float64 `json:"context,required"`
  859. Output float64 `json:"output,required"`
  860. JSON configProviderModelsLimitJSON `json:"-"`
  861. }
  862. // configProviderModelsLimitJSON contains the JSON metadata for the struct
  863. // [ConfigProviderModelsLimit]
  864. type configProviderModelsLimitJSON struct {
  865. Context apijson.Field
  866. Output apijson.Field
  867. raw string
  868. ExtraFields map[string]apijson.Field
  869. }
  870. func (r *ConfigProviderModelsLimit) UnmarshalJSON(data []byte) (err error) {
  871. return apijson.UnmarshalRoot(data, r)
  872. }
  873. func (r configProviderModelsLimitJSON) RawJSON() string {
  874. return r.raw
  875. }
  876. type ConfigProviderOptions struct {
  877. APIKey string `json:"apiKey"`
  878. BaseURL string `json:"baseURL"`
  879. ExtraFields map[string]interface{} `json:"-,extras"`
  880. JSON configProviderOptionsJSON `json:"-"`
  881. }
  882. // configProviderOptionsJSON contains the JSON metadata for the struct
  883. // [ConfigProviderOptions]
  884. type configProviderOptionsJSON struct {
  885. APIKey apijson.Field
  886. BaseURL apijson.Field
  887. raw string
  888. ExtraFields map[string]apijson.Field
  889. }
  890. func (r *ConfigProviderOptions) UnmarshalJSON(data []byte) (err error) {
  891. return apijson.UnmarshalRoot(data, r)
  892. }
  893. func (r configProviderOptionsJSON) RawJSON() string {
  894. return r.raw
  895. }
  896. // Control sharing behavior:'manual' allows manual sharing via commands, 'auto'
  897. // enables automatic sharing, 'disabled' disables all sharing
  898. type ConfigShare string
  899. const (
  900. ConfigShareManual ConfigShare = "manual"
  901. ConfigShareAuto ConfigShare = "auto"
  902. ConfigShareDisabled ConfigShare = "disabled"
  903. )
  904. func (r ConfigShare) IsKnown() bool {
  905. switch r {
  906. case ConfigShareManual, ConfigShareAuto, ConfigShareDisabled:
  907. return true
  908. }
  909. return false
  910. }
  911. type KeybindsConfig struct {
  912. // Exit the application
  913. AppExit string `json:"app_exit,required"`
  914. // Show help dialog
  915. AppHelp string `json:"app_help,required"`
  916. // Open external editor
  917. EditorOpen string `json:"editor_open,required"`
  918. // Close file
  919. FileClose string `json:"file_close,required"`
  920. // Split/unified diff
  921. FileDiffToggle string `json:"file_diff_toggle,required"`
  922. // List files
  923. FileList string `json:"file_list,required"`
  924. // Search file
  925. FileSearch string `json:"file_search,required"`
  926. // Clear input field
  927. InputClear string `json:"input_clear,required"`
  928. // Insert newline in input
  929. InputNewline string `json:"input_newline,required"`
  930. // Paste from clipboard
  931. InputPaste string `json:"input_paste,required"`
  932. // Submit input
  933. InputSubmit string `json:"input_submit,required"`
  934. // Leader key for keybind combinations
  935. Leader string `json:"leader,required"`
  936. // Copy message
  937. MessagesCopy string `json:"messages_copy,required"`
  938. // Navigate to first message
  939. MessagesFirst string `json:"messages_first,required"`
  940. // Scroll messages down by half page
  941. MessagesHalfPageDown string `json:"messages_half_page_down,required"`
  942. // Scroll messages up by half page
  943. MessagesHalfPageUp string `json:"messages_half_page_up,required"`
  944. // Navigate to last message
  945. MessagesLast string `json:"messages_last,required"`
  946. // Toggle layout
  947. MessagesLayoutToggle string `json:"messages_layout_toggle,required"`
  948. // Navigate to next message
  949. MessagesNext string `json:"messages_next,required"`
  950. // Scroll messages down by one page
  951. MessagesPageDown string `json:"messages_page_down,required"`
  952. // Scroll messages up by one page
  953. MessagesPageUp string `json:"messages_page_up,required"`
  954. // Navigate to previous message
  955. MessagesPrevious string `json:"messages_previous,required"`
  956. // Redo message
  957. MessagesRedo string `json:"messages_redo,required"`
  958. // @deprecated use messages_undo. Revert message
  959. MessagesRevert string `json:"messages_revert,required"`
  960. // Undo message
  961. MessagesUndo string `json:"messages_undo,required"`
  962. // List available models
  963. ModelList string `json:"model_list,required"`
  964. // Create/update AGENTS.md
  965. ProjectInit string `json:"project_init,required"`
  966. // Compact the session
  967. SessionCompact string `json:"session_compact,required"`
  968. // Export session to editor
  969. SessionExport string `json:"session_export,required"`
  970. // Interrupt current session
  971. SessionInterrupt string `json:"session_interrupt,required"`
  972. // List all sessions
  973. SessionList string `json:"session_list,required"`
  974. // Create a new session
  975. SessionNew string `json:"session_new,required"`
  976. // Share current session
  977. SessionShare string `json:"session_share,required"`
  978. // Unshare current session
  979. SessionUnshare string `json:"session_unshare,required"`
  980. // Next agent
  981. SwitchAgent string `json:"switch_agent,required"`
  982. // Previous agent
  983. SwitchAgentReverse string `json:"switch_agent_reverse,required"`
  984. // @deprecated use switch_agent. Next mode
  985. SwitchMode string `json:"switch_mode,required"`
  986. // @deprecated use switch_agent_reverse. Previous mode
  987. SwitchModeReverse string `json:"switch_mode_reverse,required"`
  988. // List available themes
  989. ThemeList string `json:"theme_list,required"`
  990. // Toggle tool details
  991. ToolDetails string `json:"tool_details,required"`
  992. JSON keybindsConfigJSON `json:"-"`
  993. }
  994. // keybindsConfigJSON contains the JSON metadata for the struct [KeybindsConfig]
  995. type keybindsConfigJSON struct {
  996. AppExit apijson.Field
  997. AppHelp apijson.Field
  998. EditorOpen apijson.Field
  999. FileClose apijson.Field
  1000. FileDiffToggle apijson.Field
  1001. FileList apijson.Field
  1002. FileSearch apijson.Field
  1003. InputClear apijson.Field
  1004. InputNewline apijson.Field
  1005. InputPaste apijson.Field
  1006. InputSubmit apijson.Field
  1007. Leader apijson.Field
  1008. MessagesCopy apijson.Field
  1009. MessagesFirst apijson.Field
  1010. MessagesHalfPageDown apijson.Field
  1011. MessagesHalfPageUp apijson.Field
  1012. MessagesLast apijson.Field
  1013. MessagesLayoutToggle apijson.Field
  1014. MessagesNext apijson.Field
  1015. MessagesPageDown apijson.Field
  1016. MessagesPageUp apijson.Field
  1017. MessagesPrevious apijson.Field
  1018. MessagesRedo apijson.Field
  1019. MessagesRevert apijson.Field
  1020. MessagesUndo apijson.Field
  1021. ModelList apijson.Field
  1022. ProjectInit apijson.Field
  1023. SessionCompact apijson.Field
  1024. SessionExport apijson.Field
  1025. SessionInterrupt apijson.Field
  1026. SessionList apijson.Field
  1027. SessionNew apijson.Field
  1028. SessionShare apijson.Field
  1029. SessionUnshare apijson.Field
  1030. SwitchAgent apijson.Field
  1031. SwitchAgentReverse apijson.Field
  1032. SwitchMode apijson.Field
  1033. SwitchModeReverse apijson.Field
  1034. ThemeList apijson.Field
  1035. ToolDetails apijson.Field
  1036. raw string
  1037. ExtraFields map[string]apijson.Field
  1038. }
  1039. func (r *KeybindsConfig) UnmarshalJSON(data []byte) (err error) {
  1040. return apijson.UnmarshalRoot(data, r)
  1041. }
  1042. func (r keybindsConfigJSON) RawJSON() string {
  1043. return r.raw
  1044. }
  1045. type McpLocalConfig struct {
  1046. // Command and arguments to run the MCP server
  1047. Command []string `json:"command,required"`
  1048. // Type of MCP server connection
  1049. Type McpLocalConfigType `json:"type,required"`
  1050. // Enable or disable the MCP server on startup
  1051. Enabled bool `json:"enabled"`
  1052. // Environment variables to set when running the MCP server
  1053. Environment map[string]string `json:"environment"`
  1054. JSON mcpLocalConfigJSON `json:"-"`
  1055. }
  1056. // mcpLocalConfigJSON contains the JSON metadata for the struct [McpLocalConfig]
  1057. type mcpLocalConfigJSON struct {
  1058. Command apijson.Field
  1059. Type apijson.Field
  1060. Enabled apijson.Field
  1061. Environment apijson.Field
  1062. raw string
  1063. ExtraFields map[string]apijson.Field
  1064. }
  1065. func (r *McpLocalConfig) UnmarshalJSON(data []byte) (err error) {
  1066. return apijson.UnmarshalRoot(data, r)
  1067. }
  1068. func (r mcpLocalConfigJSON) RawJSON() string {
  1069. return r.raw
  1070. }
  1071. func (r McpLocalConfig) implementsConfigMcp() {}
  1072. // Type of MCP server connection
  1073. type McpLocalConfigType string
  1074. const (
  1075. McpLocalConfigTypeLocal McpLocalConfigType = "local"
  1076. )
  1077. func (r McpLocalConfigType) IsKnown() bool {
  1078. switch r {
  1079. case McpLocalConfigTypeLocal:
  1080. return true
  1081. }
  1082. return false
  1083. }
  1084. type McpRemoteConfig struct {
  1085. // Type of MCP server connection
  1086. Type McpRemoteConfigType `json:"type,required"`
  1087. // URL of the remote MCP server
  1088. URL string `json:"url,required"`
  1089. // Enable or disable the MCP server on startup
  1090. Enabled bool `json:"enabled"`
  1091. // Headers to send with the request
  1092. Headers map[string]string `json:"headers"`
  1093. JSON mcpRemoteConfigJSON `json:"-"`
  1094. }
  1095. // mcpRemoteConfigJSON contains the JSON metadata for the struct [McpRemoteConfig]
  1096. type mcpRemoteConfigJSON struct {
  1097. Type apijson.Field
  1098. URL apijson.Field
  1099. Enabled apijson.Field
  1100. Headers apijson.Field
  1101. raw string
  1102. ExtraFields map[string]apijson.Field
  1103. }
  1104. func (r *McpRemoteConfig) UnmarshalJSON(data []byte) (err error) {
  1105. return apijson.UnmarshalRoot(data, r)
  1106. }
  1107. func (r mcpRemoteConfigJSON) RawJSON() string {
  1108. return r.raw
  1109. }
  1110. func (r McpRemoteConfig) implementsConfigMcp() {}
  1111. // Type of MCP server connection
  1112. type McpRemoteConfigType string
  1113. const (
  1114. McpRemoteConfigTypeRemote McpRemoteConfigType = "remote"
  1115. )
  1116. func (r McpRemoteConfigType) IsKnown() bool {
  1117. switch r {
  1118. case McpRemoteConfigTypeRemote:
  1119. return true
  1120. }
  1121. return false
  1122. }