openapi.json 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "title": "opencode",
  5. "description": "opencode api",
  6. "version": "1.0.0"
  7. },
  8. "paths": {
  9. "/event": {
  10. "get": {
  11. "responses": {
  12. "200": {
  13. "description": "Event stream",
  14. "content": {
  15. "application/json": {
  16. "schema": {
  17. "$ref": "#/components/schemas/Event"
  18. }
  19. }
  20. }
  21. }
  22. },
  23. "operationId": "getEvent",
  24. "parameters": [],
  25. "description": "Get events"
  26. }
  27. },
  28. "/app_info": {
  29. "post": {
  30. "responses": {
  31. "200": {
  32. "description": "200",
  33. "content": {
  34. "application/json": {
  35. "schema": {
  36. "$ref": "#/components/schemas/App.Info"
  37. }
  38. }
  39. }
  40. }
  41. },
  42. "operationId": "postApp_info",
  43. "parameters": [],
  44. "description": "Get app info"
  45. }
  46. },
  47. "/config_get": {
  48. "post": {
  49. "responses": {
  50. "200": {
  51. "description": "Get config info",
  52. "content": {
  53. "application/json": {
  54. "schema": {
  55. "$ref": "#/components/schemas/Config.Info"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "operationId": "postConfig_get",
  62. "parameters": [],
  63. "description": "Get config info"
  64. }
  65. },
  66. "/app_initialize": {
  67. "post": {
  68. "responses": {
  69. "200": {
  70. "description": "Initialize the app",
  71. "content": {
  72. "application/json": {
  73. "schema": {
  74. "type": "boolean"
  75. }
  76. }
  77. }
  78. }
  79. },
  80. "operationId": "postApp_initialize",
  81. "parameters": [],
  82. "description": "Initialize the app"
  83. }
  84. },
  85. "/session_initialize": {
  86. "post": {
  87. "responses": {
  88. "200": {
  89. "description": "200",
  90. "content": {
  91. "application/json": {
  92. "schema": {
  93. "type": "boolean"
  94. }
  95. }
  96. }
  97. }
  98. },
  99. "operationId": "postSession_initialize",
  100. "parameters": [],
  101. "description": "Analyze the app and create an AGENTS.md file",
  102. "requestBody": {
  103. "content": {
  104. "application/json": {
  105. "schema": {
  106. "type": "object",
  107. "properties": {
  108. "sessionID": {
  109. "type": "string"
  110. },
  111. "providerID": {
  112. "type": "string"
  113. },
  114. "modelID": {
  115. "type": "string"
  116. }
  117. },
  118. "required": [
  119. "sessionID",
  120. "providerID",
  121. "modelID"
  122. ]
  123. }
  124. }
  125. }
  126. }
  127. }
  128. },
  129. "/path_get": {
  130. "post": {
  131. "responses": {
  132. "200": {
  133. "description": "200",
  134. "content": {
  135. "application/json": {
  136. "schema": {
  137. "type": "object",
  138. "properties": {
  139. "root": {
  140. "type": "string"
  141. },
  142. "data": {
  143. "type": "string"
  144. },
  145. "cwd": {
  146. "type": "string"
  147. },
  148. "config": {
  149. "type": "string"
  150. }
  151. },
  152. "required": [
  153. "root",
  154. "data",
  155. "cwd",
  156. "config"
  157. ]
  158. }
  159. }
  160. }
  161. }
  162. },
  163. "operationId": "postPath_get",
  164. "parameters": [],
  165. "description": "Get paths"
  166. }
  167. },
  168. "/session_create": {
  169. "post": {
  170. "responses": {
  171. "200": {
  172. "description": "Successfully created session",
  173. "content": {
  174. "application/json": {
  175. "schema": {
  176. "$ref": "#/components/schemas/session.info"
  177. }
  178. }
  179. }
  180. },
  181. "400": {
  182. "description": "Bad request",
  183. "content": {
  184. "application/json": {
  185. "schema": {
  186. "$ref": "#/components/schemas/Error"
  187. }
  188. }
  189. }
  190. }
  191. },
  192. "operationId": "postSession_create",
  193. "parameters": [],
  194. "description": "Create a new session"
  195. }
  196. },
  197. "/session_share": {
  198. "post": {
  199. "responses": {
  200. "200": {
  201. "description": "Successfully shared session",
  202. "content": {
  203. "application/json": {
  204. "schema": {
  205. "$ref": "#/components/schemas/session.info"
  206. }
  207. }
  208. }
  209. }
  210. },
  211. "operationId": "postSession_share",
  212. "parameters": [],
  213. "description": "Share the session",
  214. "requestBody": {
  215. "content": {
  216. "application/json": {
  217. "schema": {
  218. "type": "object",
  219. "properties": {
  220. "sessionID": {
  221. "type": "string"
  222. }
  223. },
  224. "required": [
  225. "sessionID"
  226. ]
  227. }
  228. }
  229. }
  230. }
  231. }
  232. },
  233. "/session_messages": {
  234. "post": {
  235. "responses": {
  236. "200": {
  237. "description": "Successfully created session",
  238. "content": {
  239. "application/json": {
  240. "schema": {
  241. "type": "array",
  242. "items": {
  243. "$ref": "#/components/schemas/Message.Info"
  244. }
  245. }
  246. }
  247. }
  248. }
  249. },
  250. "operationId": "postSession_messages",
  251. "parameters": [],
  252. "description": "Get messages for a session",
  253. "requestBody": {
  254. "content": {
  255. "application/json": {
  256. "schema": {
  257. "type": "object",
  258. "properties": {
  259. "sessionID": {
  260. "type": "string"
  261. }
  262. },
  263. "required": [
  264. "sessionID"
  265. ]
  266. }
  267. }
  268. }
  269. }
  270. }
  271. },
  272. "/session_list": {
  273. "post": {
  274. "responses": {
  275. "200": {
  276. "description": "List of sessions",
  277. "content": {
  278. "application/json": {
  279. "schema": {
  280. "type": "array",
  281. "items": {
  282. "$ref": "#/components/schemas/session.info"
  283. }
  284. }
  285. }
  286. }
  287. }
  288. },
  289. "operationId": "postSession_list",
  290. "parameters": [],
  291. "description": "List all sessions"
  292. }
  293. },
  294. "/session_abort": {
  295. "post": {
  296. "responses": {
  297. "200": {
  298. "description": "Aborted session",
  299. "content": {
  300. "application/json": {
  301. "schema": {
  302. "type": "boolean"
  303. }
  304. }
  305. }
  306. }
  307. },
  308. "operationId": "postSession_abort",
  309. "parameters": [],
  310. "description": "Abort a session",
  311. "requestBody": {
  312. "content": {
  313. "application/json": {
  314. "schema": {
  315. "type": "object",
  316. "properties": {
  317. "sessionID": {
  318. "type": "string"
  319. }
  320. },
  321. "required": [
  322. "sessionID"
  323. ]
  324. }
  325. }
  326. }
  327. }
  328. }
  329. },
  330. "/session_summarize": {
  331. "post": {
  332. "responses": {
  333. "200": {
  334. "description": "Summarize the session",
  335. "content": {
  336. "application/json": {
  337. "schema": {
  338. "type": "boolean"
  339. }
  340. }
  341. }
  342. }
  343. },
  344. "operationId": "postSession_summarize",
  345. "parameters": [],
  346. "description": "Summarize the session",
  347. "requestBody": {
  348. "content": {
  349. "application/json": {
  350. "schema": {
  351. "type": "object",
  352. "properties": {
  353. "sessionID": {
  354. "type": "string"
  355. },
  356. "providerID": {
  357. "type": "string"
  358. },
  359. "modelID": {
  360. "type": "string"
  361. }
  362. },
  363. "required": [
  364. "sessionID",
  365. "providerID",
  366. "modelID"
  367. ]
  368. }
  369. }
  370. }
  371. }
  372. }
  373. },
  374. "/session_chat": {
  375. "post": {
  376. "responses": {
  377. "200": {
  378. "description": "Chat with a model",
  379. "content": {
  380. "application/json": {
  381. "schema": {
  382. "$ref": "#/components/schemas/Message.Info"
  383. }
  384. }
  385. }
  386. }
  387. },
  388. "operationId": "postSession_chat",
  389. "parameters": [],
  390. "description": "Chat with a model",
  391. "requestBody": {
  392. "content": {
  393. "application/json": {
  394. "schema": {
  395. "type": "object",
  396. "properties": {
  397. "sessionID": {
  398. "type": "string"
  399. },
  400. "providerID": {
  401. "type": "string"
  402. },
  403. "modelID": {
  404. "type": "string"
  405. },
  406. "parts": {
  407. "type": "array",
  408. "items": {
  409. "$ref": "#/components/schemas/Message.Part"
  410. }
  411. }
  412. },
  413. "required": [
  414. "sessionID",
  415. "providerID",
  416. "modelID",
  417. "parts"
  418. ]
  419. }
  420. }
  421. }
  422. }
  423. }
  424. },
  425. "/provider_list": {
  426. "post": {
  427. "responses": {
  428. "200": {
  429. "description": "List of providers",
  430. "content": {
  431. "application/json": {
  432. "schema": {
  433. "type": "object",
  434. "properties": {
  435. "providers": {
  436. "type": "array",
  437. "items": {
  438. "$ref": "#/components/schemas/Provider.Info"
  439. }
  440. },
  441. "default": {
  442. "type": "object",
  443. "additionalProperties": {
  444. "type": "string"
  445. }
  446. }
  447. },
  448. "required": [
  449. "providers",
  450. "default"
  451. ]
  452. }
  453. }
  454. }
  455. }
  456. },
  457. "operationId": "postProvider_list",
  458. "parameters": [],
  459. "description": "List all providers"
  460. }
  461. },
  462. "/file_search": {
  463. "post": {
  464. "responses": {
  465. "200": {
  466. "description": "Search for files",
  467. "content": {
  468. "application/json": {
  469. "schema": {
  470. "type": "array",
  471. "items": {
  472. "type": "string"
  473. }
  474. }
  475. }
  476. }
  477. }
  478. },
  479. "operationId": "postFile_search",
  480. "parameters": [],
  481. "description": "Search for files",
  482. "requestBody": {
  483. "content": {
  484. "application/json": {
  485. "schema": {
  486. "type": "object",
  487. "properties": {
  488. "query": {
  489. "type": "string"
  490. }
  491. },
  492. "required": [
  493. "query"
  494. ]
  495. }
  496. }
  497. }
  498. }
  499. }
  500. },
  501. "/installation_info": {
  502. "post": {
  503. "responses": {
  504. "200": {
  505. "description": "Get installation info",
  506. "content": {
  507. "application/json": {
  508. "schema": {
  509. "$ref": "#/components/schemas/InstallationInfo"
  510. }
  511. }
  512. }
  513. }
  514. },
  515. "operationId": "postInstallation_info",
  516. "parameters": [],
  517. "description": "Get installation info"
  518. }
  519. }
  520. },
  521. "components": {
  522. "schemas": {
  523. "Event": {
  524. "oneOf": [
  525. {
  526. "$ref": "#/components/schemas/Event.storage.write"
  527. },
  528. {
  529. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  530. },
  531. {
  532. "$ref": "#/components/schemas/Event.permission.updated"
  533. },
  534. {
  535. "$ref": "#/components/schemas/Event.message.updated"
  536. },
  537. {
  538. "$ref": "#/components/schemas/Event.message.part.updated"
  539. },
  540. {
  541. "$ref": "#/components/schemas/Event.installation.updated"
  542. },
  543. {
  544. "$ref": "#/components/schemas/Event.session.updated"
  545. },
  546. {
  547. "$ref": "#/components/schemas/Event.session.error"
  548. }
  549. ],
  550. "discriminator": {
  551. "propertyName": "type",
  552. "mapping": {
  553. "storage.write": "#/components/schemas/Event.storage.write",
  554. "lsp.client.diagnostics": "#/components/schemas/Event.lsp.client.diagnostics",
  555. "permission.updated": "#/components/schemas/Event.permission.updated",
  556. "message.updated": "#/components/schemas/Event.message.updated",
  557. "message.part.updated": "#/components/schemas/Event.message.part.updated",
  558. "installation.updated": "#/components/schemas/Event.installation.updated",
  559. "session.updated": "#/components/schemas/Event.session.updated",
  560. "session.error": "#/components/schemas/Event.session.error"
  561. }
  562. }
  563. },
  564. "Event.storage.write": {
  565. "type": "object",
  566. "properties": {
  567. "type": {
  568. "type": "string",
  569. "const": "storage.write"
  570. },
  571. "properties": {
  572. "type": "object",
  573. "properties": {
  574. "key": {
  575. "type": "string"
  576. },
  577. "content": {}
  578. },
  579. "required": [
  580. "key"
  581. ]
  582. }
  583. },
  584. "required": [
  585. "type",
  586. "properties"
  587. ]
  588. },
  589. "Event.lsp.client.diagnostics": {
  590. "type": "object",
  591. "properties": {
  592. "type": {
  593. "type": "string",
  594. "const": "lsp.client.diagnostics"
  595. },
  596. "properties": {
  597. "type": "object",
  598. "properties": {
  599. "serverID": {
  600. "type": "string"
  601. },
  602. "path": {
  603. "type": "string"
  604. }
  605. },
  606. "required": [
  607. "serverID",
  608. "path"
  609. ]
  610. }
  611. },
  612. "required": [
  613. "type",
  614. "properties"
  615. ]
  616. },
  617. "Event.permission.updated": {
  618. "type": "object",
  619. "properties": {
  620. "type": {
  621. "type": "string",
  622. "const": "permission.updated"
  623. },
  624. "properties": {
  625. "$ref": "#/components/schemas/permission.info"
  626. }
  627. },
  628. "required": [
  629. "type",
  630. "properties"
  631. ]
  632. },
  633. "permission.info": {
  634. "type": "object",
  635. "properties": {
  636. "id": {
  637. "type": "string"
  638. },
  639. "sessionID": {
  640. "type": "string"
  641. },
  642. "title": {
  643. "type": "string"
  644. },
  645. "metadata": {
  646. "type": "object",
  647. "additionalProperties": {}
  648. },
  649. "time": {
  650. "type": "object",
  651. "properties": {
  652. "created": {
  653. "type": "number"
  654. }
  655. },
  656. "required": [
  657. "created"
  658. ]
  659. }
  660. },
  661. "required": [
  662. "id",
  663. "sessionID",
  664. "title",
  665. "metadata",
  666. "time"
  667. ]
  668. },
  669. "Event.message.updated": {
  670. "type": "object",
  671. "properties": {
  672. "type": {
  673. "type": "string",
  674. "const": "message.updated"
  675. },
  676. "properties": {
  677. "type": "object",
  678. "properties": {
  679. "info": {
  680. "$ref": "#/components/schemas/Message.Info"
  681. }
  682. },
  683. "required": [
  684. "info"
  685. ]
  686. }
  687. },
  688. "required": [
  689. "type",
  690. "properties"
  691. ]
  692. },
  693. "Message.Info": {
  694. "type": "object",
  695. "properties": {
  696. "id": {
  697. "type": "string"
  698. },
  699. "role": {
  700. "type": "string",
  701. "enum": [
  702. "user",
  703. "assistant"
  704. ]
  705. },
  706. "parts": {
  707. "type": "array",
  708. "items": {
  709. "$ref": "#/components/schemas/Message.Part"
  710. }
  711. },
  712. "metadata": {
  713. "type": "object",
  714. "properties": {
  715. "time": {
  716. "type": "object",
  717. "properties": {
  718. "created": {
  719. "type": "number"
  720. },
  721. "completed": {
  722. "type": "number"
  723. }
  724. },
  725. "required": [
  726. "created"
  727. ]
  728. },
  729. "error": {
  730. "oneOf": [
  731. {
  732. "$ref": "#/components/schemas/ProviderAuthError"
  733. },
  734. {
  735. "$ref": "#/components/schemas/UnknownError"
  736. }
  737. ],
  738. "discriminator": {
  739. "propertyName": "name",
  740. "mapping": {
  741. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  742. "UnknownError": "#/components/schemas/UnknownError"
  743. }
  744. }
  745. },
  746. "sessionID": {
  747. "type": "string"
  748. },
  749. "tool": {
  750. "type": "object",
  751. "additionalProperties": {
  752. "type": "object",
  753. "properties": {
  754. "title": {
  755. "type": "string"
  756. },
  757. "time": {
  758. "type": "object",
  759. "properties": {
  760. "start": {
  761. "type": "number"
  762. },
  763. "end": {
  764. "type": "number"
  765. }
  766. },
  767. "required": [
  768. "start",
  769. "end"
  770. ]
  771. }
  772. },
  773. "required": [
  774. "title",
  775. "time"
  776. ],
  777. "additionalProperties": {}
  778. }
  779. },
  780. "assistant": {
  781. "type": "object",
  782. "properties": {
  783. "system": {
  784. "type": "array",
  785. "items": {
  786. "type": "string"
  787. }
  788. },
  789. "modelID": {
  790. "type": "string"
  791. },
  792. "providerID": {
  793. "type": "string"
  794. },
  795. "path": {
  796. "type": "object",
  797. "properties": {
  798. "cwd": {
  799. "type": "string"
  800. },
  801. "root": {
  802. "type": "string"
  803. }
  804. },
  805. "required": [
  806. "cwd",
  807. "root"
  808. ]
  809. },
  810. "cost": {
  811. "type": "number"
  812. },
  813. "summary": {
  814. "type": "boolean"
  815. },
  816. "tokens": {
  817. "type": "object",
  818. "properties": {
  819. "input": {
  820. "type": "number"
  821. },
  822. "output": {
  823. "type": "number"
  824. },
  825. "reasoning": {
  826. "type": "number"
  827. },
  828. "cache": {
  829. "type": "object",
  830. "properties": {
  831. "read": {
  832. "type": "number"
  833. },
  834. "write": {
  835. "type": "number"
  836. }
  837. },
  838. "required": [
  839. "read",
  840. "write"
  841. ]
  842. }
  843. },
  844. "required": [
  845. "input",
  846. "output",
  847. "reasoning",
  848. "cache"
  849. ]
  850. }
  851. },
  852. "required": [
  853. "system",
  854. "modelID",
  855. "providerID",
  856. "path",
  857. "cost",
  858. "tokens"
  859. ]
  860. }
  861. },
  862. "required": [
  863. "time",
  864. "sessionID",
  865. "tool"
  866. ]
  867. }
  868. },
  869. "required": [
  870. "id",
  871. "role",
  872. "parts",
  873. "metadata"
  874. ]
  875. },
  876. "Message.Part": {
  877. "oneOf": [
  878. {
  879. "$ref": "#/components/schemas/Message.Part.Text"
  880. },
  881. {
  882. "$ref": "#/components/schemas/Message.Part.Reasoning"
  883. },
  884. {
  885. "$ref": "#/components/schemas/Message.Part.ToolInvocation"
  886. },
  887. {
  888. "$ref": "#/components/schemas/Message.Part.SourceUrl"
  889. },
  890. {
  891. "$ref": "#/components/schemas/Message.Part.File"
  892. },
  893. {
  894. "$ref": "#/components/schemas/Message.Part.StepStart"
  895. }
  896. ],
  897. "discriminator": {
  898. "propertyName": "type",
  899. "mapping": {
  900. "text": "#/components/schemas/Message.Part.Text",
  901. "reasoning": "#/components/schemas/Message.Part.Reasoning",
  902. "tool-invocation": "#/components/schemas/Message.Part.ToolInvocation",
  903. "source-url": "#/components/schemas/Message.Part.SourceUrl",
  904. "file": "#/components/schemas/Message.Part.File",
  905. "step-start": "#/components/schemas/Message.Part.StepStart"
  906. }
  907. }
  908. },
  909. "Message.Part.Text": {
  910. "type": "object",
  911. "properties": {
  912. "type": {
  913. "type": "string",
  914. "const": "text"
  915. },
  916. "text": {
  917. "type": "string"
  918. }
  919. },
  920. "required": [
  921. "type",
  922. "text"
  923. ]
  924. },
  925. "Message.Part.Reasoning": {
  926. "type": "object",
  927. "properties": {
  928. "type": {
  929. "type": "string",
  930. "const": "reasoning"
  931. },
  932. "text": {
  933. "type": "string"
  934. },
  935. "providerMetadata": {
  936. "type": "object",
  937. "additionalProperties": {}
  938. }
  939. },
  940. "required": [
  941. "type",
  942. "text"
  943. ]
  944. },
  945. "Message.Part.ToolInvocation": {
  946. "type": "object",
  947. "properties": {
  948. "type": {
  949. "type": "string",
  950. "const": "tool-invocation"
  951. },
  952. "toolInvocation": {
  953. "$ref": "#/components/schemas/Message.ToolInvocation"
  954. }
  955. },
  956. "required": [
  957. "type",
  958. "toolInvocation"
  959. ]
  960. },
  961. "Message.ToolInvocation": {
  962. "oneOf": [
  963. {
  964. "$ref": "#/components/schemas/Message.ToolInvocation.ToolCall"
  965. },
  966. {
  967. "$ref": "#/components/schemas/Message.ToolInvocation.ToolPartialCall"
  968. },
  969. {
  970. "$ref": "#/components/schemas/Message.ToolInvocation.ToolResult"
  971. }
  972. ],
  973. "discriminator": {
  974. "propertyName": "state",
  975. "mapping": {
  976. "call": "#/components/schemas/Message.ToolInvocation.ToolCall",
  977. "partial-call": "#/components/schemas/Message.ToolInvocation.ToolPartialCall",
  978. "result": "#/components/schemas/Message.ToolInvocation.ToolResult"
  979. }
  980. }
  981. },
  982. "Message.ToolInvocation.ToolCall": {
  983. "type": "object",
  984. "properties": {
  985. "state": {
  986. "type": "string",
  987. "const": "call"
  988. },
  989. "step": {
  990. "type": "number"
  991. },
  992. "toolCallId": {
  993. "type": "string"
  994. },
  995. "toolName": {
  996. "type": "string"
  997. },
  998. "args": {}
  999. },
  1000. "required": [
  1001. "state",
  1002. "toolCallId",
  1003. "toolName"
  1004. ]
  1005. },
  1006. "Message.ToolInvocation.ToolPartialCall": {
  1007. "type": "object",
  1008. "properties": {
  1009. "state": {
  1010. "type": "string",
  1011. "const": "partial-call"
  1012. },
  1013. "step": {
  1014. "type": "number"
  1015. },
  1016. "toolCallId": {
  1017. "type": "string"
  1018. },
  1019. "toolName": {
  1020. "type": "string"
  1021. },
  1022. "args": {}
  1023. },
  1024. "required": [
  1025. "state",
  1026. "toolCallId",
  1027. "toolName"
  1028. ]
  1029. },
  1030. "Message.ToolInvocation.ToolResult": {
  1031. "type": "object",
  1032. "properties": {
  1033. "state": {
  1034. "type": "string",
  1035. "const": "result"
  1036. },
  1037. "step": {
  1038. "type": "number"
  1039. },
  1040. "toolCallId": {
  1041. "type": "string"
  1042. },
  1043. "toolName": {
  1044. "type": "string"
  1045. },
  1046. "args": {},
  1047. "result": {
  1048. "type": "string"
  1049. }
  1050. },
  1051. "required": [
  1052. "state",
  1053. "toolCallId",
  1054. "toolName",
  1055. "result"
  1056. ]
  1057. },
  1058. "Message.Part.SourceUrl": {
  1059. "type": "object",
  1060. "properties": {
  1061. "type": {
  1062. "type": "string",
  1063. "const": "source-url"
  1064. },
  1065. "sourceId": {
  1066. "type": "string"
  1067. },
  1068. "url": {
  1069. "type": "string"
  1070. },
  1071. "title": {
  1072. "type": "string"
  1073. },
  1074. "providerMetadata": {
  1075. "type": "object",
  1076. "additionalProperties": {}
  1077. }
  1078. },
  1079. "required": [
  1080. "type",
  1081. "sourceId",
  1082. "url"
  1083. ]
  1084. },
  1085. "Message.Part.File": {
  1086. "type": "object",
  1087. "properties": {
  1088. "type": {
  1089. "type": "string",
  1090. "const": "file"
  1091. },
  1092. "mediaType": {
  1093. "type": "string"
  1094. },
  1095. "filename": {
  1096. "type": "string"
  1097. },
  1098. "url": {
  1099. "type": "string"
  1100. }
  1101. },
  1102. "required": [
  1103. "type",
  1104. "mediaType",
  1105. "url"
  1106. ]
  1107. },
  1108. "Message.Part.StepStart": {
  1109. "type": "object",
  1110. "properties": {
  1111. "type": {
  1112. "type": "string",
  1113. "const": "step-start"
  1114. }
  1115. },
  1116. "required": [
  1117. "type"
  1118. ]
  1119. },
  1120. "ProviderAuthError": {
  1121. "type": "object",
  1122. "properties": {
  1123. "name": {
  1124. "type": "string",
  1125. "const": "ProviderAuthError"
  1126. },
  1127. "data": {
  1128. "type": "object",
  1129. "properties": {
  1130. "providerID": {
  1131. "type": "string"
  1132. },
  1133. "message": {
  1134. "type": "string"
  1135. }
  1136. },
  1137. "required": [
  1138. "providerID",
  1139. "message"
  1140. ]
  1141. }
  1142. },
  1143. "required": [
  1144. "name",
  1145. "data"
  1146. ]
  1147. },
  1148. "UnknownError": {
  1149. "type": "object",
  1150. "properties": {
  1151. "name": {
  1152. "type": "string",
  1153. "const": "UnknownError"
  1154. },
  1155. "data": {
  1156. "type": "object",
  1157. "properties": {
  1158. "message": {
  1159. "type": "string"
  1160. }
  1161. },
  1162. "required": [
  1163. "message"
  1164. ]
  1165. }
  1166. },
  1167. "required": [
  1168. "name",
  1169. "data"
  1170. ]
  1171. },
  1172. "Event.message.part.updated": {
  1173. "type": "object",
  1174. "properties": {
  1175. "type": {
  1176. "type": "string",
  1177. "const": "message.part.updated"
  1178. },
  1179. "properties": {
  1180. "type": "object",
  1181. "properties": {
  1182. "part": {
  1183. "$ref": "#/components/schemas/Message.Part"
  1184. },
  1185. "sessionID": {
  1186. "type": "string"
  1187. },
  1188. "messageID": {
  1189. "type": "string"
  1190. }
  1191. },
  1192. "required": [
  1193. "part",
  1194. "sessionID",
  1195. "messageID"
  1196. ]
  1197. }
  1198. },
  1199. "required": [
  1200. "type",
  1201. "properties"
  1202. ]
  1203. },
  1204. "Event.installation.updated": {
  1205. "type": "object",
  1206. "properties": {
  1207. "type": {
  1208. "type": "string",
  1209. "const": "installation.updated"
  1210. },
  1211. "properties": {
  1212. "type": "object",
  1213. "properties": {
  1214. "version": {
  1215. "type": "string"
  1216. }
  1217. },
  1218. "required": [
  1219. "version"
  1220. ]
  1221. }
  1222. },
  1223. "required": [
  1224. "type",
  1225. "properties"
  1226. ]
  1227. },
  1228. "Event.session.updated": {
  1229. "type": "object",
  1230. "properties": {
  1231. "type": {
  1232. "type": "string",
  1233. "const": "session.updated"
  1234. },
  1235. "properties": {
  1236. "type": "object",
  1237. "properties": {
  1238. "info": {
  1239. "$ref": "#/components/schemas/session.info"
  1240. }
  1241. },
  1242. "required": [
  1243. "info"
  1244. ]
  1245. }
  1246. },
  1247. "required": [
  1248. "type",
  1249. "properties"
  1250. ]
  1251. },
  1252. "session.info": {
  1253. "type": "object",
  1254. "properties": {
  1255. "id": {
  1256. "type": "string",
  1257. "pattern": "^ses"
  1258. },
  1259. "parentID": {
  1260. "type": "string",
  1261. "pattern": "^ses"
  1262. },
  1263. "share": {
  1264. "type": "object",
  1265. "properties": {
  1266. "url": {
  1267. "type": "string"
  1268. }
  1269. },
  1270. "required": [
  1271. "url"
  1272. ]
  1273. },
  1274. "title": {
  1275. "type": "string"
  1276. },
  1277. "version": {
  1278. "type": "string"
  1279. },
  1280. "time": {
  1281. "type": "object",
  1282. "properties": {
  1283. "created": {
  1284. "type": "number"
  1285. },
  1286. "updated": {
  1287. "type": "number"
  1288. }
  1289. },
  1290. "required": [
  1291. "created",
  1292. "updated"
  1293. ]
  1294. }
  1295. },
  1296. "required": [
  1297. "id",
  1298. "title",
  1299. "version",
  1300. "time"
  1301. ]
  1302. },
  1303. "Event.session.error": {
  1304. "type": "object",
  1305. "properties": {
  1306. "type": {
  1307. "type": "string",
  1308. "const": "session.error"
  1309. },
  1310. "properties": {
  1311. "type": "object",
  1312. "properties": {
  1313. "error": {
  1314. "oneOf": [
  1315. {
  1316. "$ref": "#/components/schemas/ProviderAuthError"
  1317. },
  1318. {
  1319. "$ref": "#/components/schemas/UnknownError"
  1320. }
  1321. ],
  1322. "discriminator": {
  1323. "propertyName": "name",
  1324. "mapping": {
  1325. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  1326. "UnknownError": "#/components/schemas/UnknownError"
  1327. }
  1328. }
  1329. }
  1330. }
  1331. }
  1332. },
  1333. "required": [
  1334. "type",
  1335. "properties"
  1336. ]
  1337. },
  1338. "App.Info": {
  1339. "type": "object",
  1340. "properties": {
  1341. "user": {
  1342. "type": "string"
  1343. },
  1344. "git": {
  1345. "type": "boolean"
  1346. },
  1347. "path": {
  1348. "type": "object",
  1349. "properties": {
  1350. "config": {
  1351. "type": "string"
  1352. },
  1353. "data": {
  1354. "type": "string"
  1355. },
  1356. "root": {
  1357. "type": "string"
  1358. },
  1359. "cwd": {
  1360. "type": "string"
  1361. },
  1362. "state": {
  1363. "type": "string"
  1364. }
  1365. },
  1366. "required": [
  1367. "config",
  1368. "data",
  1369. "root",
  1370. "cwd",
  1371. "state"
  1372. ]
  1373. },
  1374. "time": {
  1375. "type": "object",
  1376. "properties": {
  1377. "initialized": {
  1378. "type": "number"
  1379. }
  1380. }
  1381. }
  1382. },
  1383. "required": [
  1384. "user",
  1385. "git",
  1386. "path",
  1387. "time"
  1388. ]
  1389. },
  1390. "Config.Info": {
  1391. "type": "object",
  1392. "properties": {
  1393. "$schema": {
  1394. "type": "string"
  1395. },
  1396. "theme": {
  1397. "type": "string"
  1398. },
  1399. "keybinds": {
  1400. "$ref": "#/components/schemas/Config.Keybinds"
  1401. },
  1402. "autoshare": {
  1403. "type": "boolean",
  1404. "description": "Share newly created sessions automatically"
  1405. },
  1406. "autoupdate": {
  1407. "type": "boolean",
  1408. "description": "Automatically update to the latest version"
  1409. },
  1410. "disabled_providers": {
  1411. "type": "array",
  1412. "items": {
  1413. "type": "string"
  1414. },
  1415. "description": "Disable providers that are loaded automatically"
  1416. },
  1417. "model": {
  1418. "type": "string",
  1419. "description": "Model to use in the format of provider/model, eg anthropic/claude-2"
  1420. },
  1421. "provider": {
  1422. "type": "object",
  1423. "additionalProperties": {
  1424. "type": "object",
  1425. "properties": {
  1426. "api": {
  1427. "type": "string"
  1428. },
  1429. "name": {
  1430. "type": "string"
  1431. },
  1432. "env": {
  1433. "type": "array",
  1434. "items": {
  1435. "type": "string"
  1436. }
  1437. },
  1438. "id": {
  1439. "type": "string"
  1440. },
  1441. "npm": {
  1442. "type": "string"
  1443. },
  1444. "models": {
  1445. "type": "object",
  1446. "additionalProperties": {
  1447. "type": "object",
  1448. "properties": {
  1449. "name": {
  1450. "type": "string"
  1451. },
  1452. "attachment": {
  1453. "type": "boolean"
  1454. },
  1455. "reasoning": {
  1456. "type": "boolean"
  1457. },
  1458. "temperature": {
  1459. "type": "boolean"
  1460. },
  1461. "cost": {
  1462. "type": "object",
  1463. "properties": {
  1464. "input": {
  1465. "type": "number"
  1466. },
  1467. "output": {
  1468. "type": "number"
  1469. },
  1470. "cache_read": {
  1471. "type": "number"
  1472. },
  1473. "cache_write": {
  1474. "type": "number"
  1475. }
  1476. },
  1477. "required": [
  1478. "input",
  1479. "output"
  1480. ]
  1481. },
  1482. "limit": {
  1483. "type": "object",
  1484. "properties": {
  1485. "context": {
  1486. "type": "number"
  1487. },
  1488. "output": {
  1489. "type": "number"
  1490. }
  1491. },
  1492. "required": [
  1493. "context",
  1494. "output"
  1495. ]
  1496. },
  1497. "id": {
  1498. "type": "string"
  1499. }
  1500. }
  1501. }
  1502. },
  1503. "options": {
  1504. "type": "object",
  1505. "additionalProperties": {}
  1506. }
  1507. },
  1508. "required": [
  1509. "models"
  1510. ]
  1511. }
  1512. },
  1513. "mcp": {
  1514. "type": "object",
  1515. "additionalProperties": {
  1516. "oneOf": [
  1517. {
  1518. "$ref": "#/components/schemas/Config.McpLocal"
  1519. },
  1520. {
  1521. "$ref": "#/components/schemas/Config.McpRemote"
  1522. }
  1523. ],
  1524. "discriminator": {
  1525. "propertyName": "type",
  1526. "mapping": {
  1527. "local": "#/components/schemas/Config.McpLocal",
  1528. "remote": "#/components/schemas/Config.McpRemote"
  1529. }
  1530. }
  1531. }
  1532. }
  1533. }
  1534. },
  1535. "Config.Keybinds": {
  1536. "type": "object",
  1537. "properties": {
  1538. "leader": {
  1539. "type": "string"
  1540. },
  1541. "help": {
  1542. "type": "string"
  1543. },
  1544. "editor_open": {
  1545. "type": "string"
  1546. },
  1547. "session_new": {
  1548. "type": "string"
  1549. },
  1550. "session_list": {
  1551. "type": "string"
  1552. },
  1553. "session_share": {
  1554. "type": "string"
  1555. },
  1556. "session_interrupt": {
  1557. "type": "string"
  1558. },
  1559. "session_compact": {
  1560. "type": "string"
  1561. },
  1562. "tool_details": {
  1563. "type": "string"
  1564. },
  1565. "model_list": {
  1566. "type": "string"
  1567. },
  1568. "theme_list": {
  1569. "type": "string"
  1570. },
  1571. "project_init": {
  1572. "type": "string"
  1573. },
  1574. "input_clear": {
  1575. "type": "string"
  1576. },
  1577. "input_paste": {
  1578. "type": "string"
  1579. },
  1580. "input_submit": {
  1581. "type": "string"
  1582. },
  1583. "input_newline": {
  1584. "type": "string"
  1585. },
  1586. "history_previous": {
  1587. "type": "string"
  1588. },
  1589. "history_next": {
  1590. "type": "string"
  1591. },
  1592. "messages_page_up": {
  1593. "type": "string"
  1594. },
  1595. "messages_page_down": {
  1596. "type": "string"
  1597. },
  1598. "messages_half_page_up": {
  1599. "type": "string"
  1600. },
  1601. "messages_half_page_down": {
  1602. "type": "string"
  1603. },
  1604. "messages_previous": {
  1605. "type": "string"
  1606. },
  1607. "messages_next": {
  1608. "type": "string"
  1609. },
  1610. "messages_first": {
  1611. "type": "string"
  1612. },
  1613. "messages_last": {
  1614. "type": "string"
  1615. },
  1616. "app_exit": {
  1617. "type": "string"
  1618. }
  1619. }
  1620. },
  1621. "Provider.Info": {
  1622. "type": "object",
  1623. "properties": {
  1624. "api": {
  1625. "type": "string"
  1626. },
  1627. "name": {
  1628. "type": "string"
  1629. },
  1630. "env": {
  1631. "type": "array",
  1632. "items": {
  1633. "type": "string"
  1634. }
  1635. },
  1636. "id": {
  1637. "type": "string"
  1638. },
  1639. "npm": {
  1640. "type": "string"
  1641. },
  1642. "models": {
  1643. "type": "object",
  1644. "additionalProperties": {
  1645. "$ref": "#/components/schemas/Model.Info"
  1646. }
  1647. }
  1648. },
  1649. "required": [
  1650. "name",
  1651. "env",
  1652. "id",
  1653. "models"
  1654. ]
  1655. },
  1656. "Model.Info": {
  1657. "type": "object",
  1658. "properties": {
  1659. "name": {
  1660. "type": "string"
  1661. },
  1662. "attachment": {
  1663. "type": "boolean"
  1664. },
  1665. "reasoning": {
  1666. "type": "boolean"
  1667. },
  1668. "temperature": {
  1669. "type": "boolean"
  1670. },
  1671. "cost": {
  1672. "type": "object",
  1673. "properties": {
  1674. "input": {
  1675. "type": "number"
  1676. },
  1677. "output": {
  1678. "type": "number"
  1679. },
  1680. "cache_read": {
  1681. "type": "number"
  1682. },
  1683. "cache_write": {
  1684. "type": "number"
  1685. }
  1686. },
  1687. "required": [
  1688. "input",
  1689. "output"
  1690. ]
  1691. },
  1692. "limit": {
  1693. "type": "object",
  1694. "properties": {
  1695. "context": {
  1696. "type": "number"
  1697. },
  1698. "output": {
  1699. "type": "number"
  1700. }
  1701. },
  1702. "required": [
  1703. "context",
  1704. "output"
  1705. ]
  1706. },
  1707. "id": {
  1708. "type": "string"
  1709. }
  1710. },
  1711. "required": [
  1712. "name",
  1713. "attachment",
  1714. "reasoning",
  1715. "temperature",
  1716. "cost",
  1717. "limit",
  1718. "id"
  1719. ]
  1720. },
  1721. "Config.McpLocal": {
  1722. "type": "object",
  1723. "properties": {
  1724. "type": {
  1725. "type": "string",
  1726. "const": "local"
  1727. },
  1728. "command": {
  1729. "type": "array",
  1730. "items": {
  1731. "type": "string"
  1732. }
  1733. },
  1734. "environment": {
  1735. "type": "object",
  1736. "additionalProperties": {
  1737. "type": "string"
  1738. }
  1739. }
  1740. },
  1741. "required": [
  1742. "type",
  1743. "command"
  1744. ]
  1745. },
  1746. "Config.McpRemote": {
  1747. "type": "object",
  1748. "properties": {
  1749. "type": {
  1750. "type": "string",
  1751. "const": "remote"
  1752. },
  1753. "url": {
  1754. "type": "string"
  1755. }
  1756. },
  1757. "required": [
  1758. "type",
  1759. "url"
  1760. ]
  1761. },
  1762. "Error": {
  1763. "type": "object",
  1764. "properties": {
  1765. "data": {
  1766. "type": "object",
  1767. "additionalProperties": {}
  1768. }
  1769. },
  1770. "required": [
  1771. "data"
  1772. ]
  1773. },
  1774. "InstallationInfo": {
  1775. "type": "object",
  1776. "properties": {
  1777. "version": {
  1778. "type": "string"
  1779. },
  1780. "latest": {
  1781. "type": "string"
  1782. }
  1783. },
  1784. "required": [
  1785. "version",
  1786. "latest"
  1787. ]
  1788. }
  1789. }
  1790. }
  1791. }