openapi.json 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499
  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. "/app_initialize": {
  48. "post": {
  49. "responses": {
  50. "200": {
  51. "description": "Initialize the app",
  52. "content": {
  53. "application/json": {
  54. "schema": {
  55. "type": "boolean"
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "operationId": "postApp_initialize",
  62. "parameters": [],
  63. "description": "Initialize the app"
  64. }
  65. },
  66. "/session_initialize": {
  67. "post": {
  68. "responses": {
  69. "200": {
  70. "description": "200",
  71. "content": {
  72. "application/json": {
  73. "schema": {
  74. "type": "boolean"
  75. }
  76. }
  77. }
  78. }
  79. },
  80. "operationId": "postSession_initialize",
  81. "parameters": [],
  82. "description": "Analyze the app and create an AGENTS.md file",
  83. "requestBody": {
  84. "content": {
  85. "application/json": {
  86. "schema": {
  87. "type": "object",
  88. "properties": {
  89. "sessionID": {
  90. "type": "string"
  91. },
  92. "providerID": {
  93. "type": "string"
  94. },
  95. "modelID": {
  96. "type": "string"
  97. }
  98. },
  99. "required": [
  100. "sessionID",
  101. "providerID",
  102. "modelID"
  103. ]
  104. }
  105. }
  106. }
  107. }
  108. }
  109. },
  110. "/path_get": {
  111. "post": {
  112. "responses": {
  113. "200": {
  114. "description": "200",
  115. "content": {
  116. "application/json": {
  117. "schema": {
  118. "type": "object",
  119. "properties": {
  120. "root": {
  121. "type": "string"
  122. },
  123. "data": {
  124. "type": "string"
  125. },
  126. "cwd": {
  127. "type": "string"
  128. },
  129. "config": {
  130. "type": "string"
  131. }
  132. },
  133. "required": [
  134. "root",
  135. "data",
  136. "cwd",
  137. "config"
  138. ]
  139. }
  140. }
  141. }
  142. }
  143. },
  144. "operationId": "postPath_get",
  145. "parameters": [],
  146. "description": "Get paths"
  147. }
  148. },
  149. "/session_create": {
  150. "post": {
  151. "responses": {
  152. "200": {
  153. "description": "Successfully created session",
  154. "content": {
  155. "application/json": {
  156. "schema": {
  157. "$ref": "#/components/schemas/session.info"
  158. }
  159. }
  160. }
  161. },
  162. "400": {
  163. "description": "Bad request",
  164. "content": {
  165. "application/json": {
  166. "schema": {
  167. "$ref": "#/components/schemas/Error"
  168. }
  169. }
  170. }
  171. }
  172. },
  173. "operationId": "postSession_create",
  174. "parameters": [],
  175. "description": "Create a new session"
  176. }
  177. },
  178. "/session_share": {
  179. "post": {
  180. "responses": {
  181. "200": {
  182. "description": "Successfully shared session",
  183. "content": {
  184. "application/json": {
  185. "schema": {
  186. "$ref": "#/components/schemas/session.info"
  187. }
  188. }
  189. }
  190. }
  191. },
  192. "operationId": "postSession_share",
  193. "parameters": [],
  194. "description": "Share the session",
  195. "requestBody": {
  196. "content": {
  197. "application/json": {
  198. "schema": {
  199. "type": "object",
  200. "properties": {
  201. "sessionID": {
  202. "type": "string"
  203. }
  204. },
  205. "required": [
  206. "sessionID"
  207. ]
  208. }
  209. }
  210. }
  211. }
  212. }
  213. },
  214. "/session_messages": {
  215. "post": {
  216. "responses": {
  217. "200": {
  218. "description": "Successfully created session",
  219. "content": {
  220. "application/json": {
  221. "schema": {
  222. "type": "array",
  223. "items": {
  224. "$ref": "#/components/schemas/Message.Info"
  225. }
  226. }
  227. }
  228. }
  229. }
  230. },
  231. "operationId": "postSession_messages",
  232. "parameters": [],
  233. "description": "Get messages for a session",
  234. "requestBody": {
  235. "content": {
  236. "application/json": {
  237. "schema": {
  238. "type": "object",
  239. "properties": {
  240. "sessionID": {
  241. "type": "string"
  242. }
  243. },
  244. "required": [
  245. "sessionID"
  246. ]
  247. }
  248. }
  249. }
  250. }
  251. }
  252. },
  253. "/session_list": {
  254. "post": {
  255. "responses": {
  256. "200": {
  257. "description": "List of sessions",
  258. "content": {
  259. "application/json": {
  260. "schema": {
  261. "type": "array",
  262. "items": {
  263. "$ref": "#/components/schemas/session.info"
  264. }
  265. }
  266. }
  267. }
  268. }
  269. },
  270. "operationId": "postSession_list",
  271. "parameters": [],
  272. "description": "List all sessions"
  273. }
  274. },
  275. "/session_abort": {
  276. "post": {
  277. "responses": {
  278. "200": {
  279. "description": "Aborted session",
  280. "content": {
  281. "application/json": {
  282. "schema": {
  283. "type": "boolean"
  284. }
  285. }
  286. }
  287. }
  288. },
  289. "operationId": "postSession_abort",
  290. "parameters": [],
  291. "description": "Abort a session",
  292. "requestBody": {
  293. "content": {
  294. "application/json": {
  295. "schema": {
  296. "type": "object",
  297. "properties": {
  298. "sessionID": {
  299. "type": "string"
  300. }
  301. },
  302. "required": [
  303. "sessionID"
  304. ]
  305. }
  306. }
  307. }
  308. }
  309. }
  310. },
  311. "/session_summarize": {
  312. "post": {
  313. "responses": {
  314. "200": {
  315. "description": "Summarize the session",
  316. "content": {
  317. "application/json": {
  318. "schema": {
  319. "type": "boolean"
  320. }
  321. }
  322. }
  323. }
  324. },
  325. "operationId": "postSession_summarize",
  326. "parameters": [],
  327. "description": "Summarize the session",
  328. "requestBody": {
  329. "content": {
  330. "application/json": {
  331. "schema": {
  332. "type": "object",
  333. "properties": {
  334. "sessionID": {
  335. "type": "string"
  336. },
  337. "providerID": {
  338. "type": "string"
  339. },
  340. "modelID": {
  341. "type": "string"
  342. }
  343. },
  344. "required": [
  345. "sessionID",
  346. "providerID",
  347. "modelID"
  348. ]
  349. }
  350. }
  351. }
  352. }
  353. }
  354. },
  355. "/session_chat": {
  356. "post": {
  357. "responses": {
  358. "200": {
  359. "description": "Chat with a model",
  360. "content": {
  361. "application/json": {
  362. "schema": {
  363. "$ref": "#/components/schemas/Message.Info"
  364. }
  365. }
  366. }
  367. }
  368. },
  369. "operationId": "postSession_chat",
  370. "parameters": [],
  371. "description": "Chat with a model",
  372. "requestBody": {
  373. "content": {
  374. "application/json": {
  375. "schema": {
  376. "type": "object",
  377. "properties": {
  378. "sessionID": {
  379. "type": "string"
  380. },
  381. "providerID": {
  382. "type": "string"
  383. },
  384. "modelID": {
  385. "type": "string"
  386. },
  387. "parts": {
  388. "type": "array",
  389. "items": {
  390. "$ref": "#/components/schemas/Message.Part"
  391. }
  392. }
  393. },
  394. "required": [
  395. "sessionID",
  396. "providerID",
  397. "modelID",
  398. "parts"
  399. ]
  400. }
  401. }
  402. }
  403. }
  404. }
  405. },
  406. "/provider_list": {
  407. "post": {
  408. "responses": {
  409. "200": {
  410. "description": "List of providers",
  411. "content": {
  412. "application/json": {
  413. "schema": {
  414. "type": "object",
  415. "properties": {
  416. "providers": {
  417. "type": "array",
  418. "items": {
  419. "$ref": "#/components/schemas/Provider.Info"
  420. }
  421. },
  422. "default": {
  423. "type": "object",
  424. "additionalProperties": {
  425. "type": "string"
  426. }
  427. }
  428. },
  429. "required": [
  430. "providers",
  431. "default"
  432. ]
  433. }
  434. }
  435. }
  436. }
  437. },
  438. "operationId": "postProvider_list",
  439. "parameters": [],
  440. "description": "List all providers"
  441. }
  442. },
  443. "/file_search": {
  444. "post": {
  445. "responses": {
  446. "200": {
  447. "description": "Search for files",
  448. "content": {
  449. "application/json": {
  450. "schema": {
  451. "type": "array",
  452. "items": {
  453. "type": "string"
  454. }
  455. }
  456. }
  457. }
  458. }
  459. },
  460. "operationId": "postFile_search",
  461. "parameters": [],
  462. "description": "Search for files",
  463. "requestBody": {
  464. "content": {
  465. "application/json": {
  466. "schema": {
  467. "type": "object",
  468. "properties": {
  469. "query": {
  470. "type": "string"
  471. }
  472. },
  473. "required": [
  474. "query"
  475. ]
  476. }
  477. }
  478. }
  479. }
  480. }
  481. },
  482. "/installation_info": {
  483. "post": {
  484. "responses": {
  485. "200": {
  486. "description": "Get installation info",
  487. "content": {
  488. "application/json": {
  489. "schema": {
  490. "$ref": "#/components/schemas/InstallationInfo"
  491. }
  492. }
  493. }
  494. }
  495. },
  496. "operationId": "postInstallation_info",
  497. "parameters": [],
  498. "description": "Get installation info"
  499. }
  500. }
  501. },
  502. "components": {
  503. "schemas": {
  504. "Event": {
  505. "oneOf": [
  506. {
  507. "$ref": "#/components/schemas/Event.storage.write"
  508. },
  509. {
  510. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  511. },
  512. {
  513. "$ref": "#/components/schemas/Event.permission.updated"
  514. },
  515. {
  516. "$ref": "#/components/schemas/Event.message.updated"
  517. },
  518. {
  519. "$ref": "#/components/schemas/Event.message.part.updated"
  520. },
  521. {
  522. "$ref": "#/components/schemas/Event.session.updated"
  523. },
  524. {
  525. "$ref": "#/components/schemas/Event.session.error"
  526. },
  527. {
  528. "$ref": "#/components/schemas/Event.installation.updated"
  529. }
  530. ],
  531. "discriminator": {
  532. "propertyName": "type",
  533. "mapping": {
  534. "storage.write": "#/components/schemas/Event.storage.write",
  535. "lsp.client.diagnostics": "#/components/schemas/Event.lsp.client.diagnostics",
  536. "permission.updated": "#/components/schemas/Event.permission.updated",
  537. "message.updated": "#/components/schemas/Event.message.updated",
  538. "message.part.updated": "#/components/schemas/Event.message.part.updated",
  539. "session.updated": "#/components/schemas/Event.session.updated",
  540. "session.error": "#/components/schemas/Event.session.error",
  541. "installation.updated": "#/components/schemas/Event.installation.updated"
  542. }
  543. }
  544. },
  545. "Event.storage.write": {
  546. "type": "object",
  547. "properties": {
  548. "type": {
  549. "type": "string",
  550. "const": "storage.write"
  551. },
  552. "properties": {
  553. "type": "object",
  554. "properties": {
  555. "key": {
  556. "type": "string"
  557. },
  558. "content": {}
  559. },
  560. "required": [
  561. "key"
  562. ]
  563. }
  564. },
  565. "required": [
  566. "type",
  567. "properties"
  568. ]
  569. },
  570. "Event.lsp.client.diagnostics": {
  571. "type": "object",
  572. "properties": {
  573. "type": {
  574. "type": "string",
  575. "const": "lsp.client.diagnostics"
  576. },
  577. "properties": {
  578. "type": "object",
  579. "properties": {
  580. "serverID": {
  581. "type": "string"
  582. },
  583. "path": {
  584. "type": "string"
  585. }
  586. },
  587. "required": [
  588. "serverID",
  589. "path"
  590. ]
  591. }
  592. },
  593. "required": [
  594. "type",
  595. "properties"
  596. ]
  597. },
  598. "Event.permission.updated": {
  599. "type": "object",
  600. "properties": {
  601. "type": {
  602. "type": "string",
  603. "const": "permission.updated"
  604. },
  605. "properties": {
  606. "$ref": "#/components/schemas/permission.info"
  607. }
  608. },
  609. "required": [
  610. "type",
  611. "properties"
  612. ]
  613. },
  614. "permission.info": {
  615. "type": "object",
  616. "properties": {
  617. "id": {
  618. "type": "string"
  619. },
  620. "sessionID": {
  621. "type": "string"
  622. },
  623. "title": {
  624. "type": "string"
  625. },
  626. "metadata": {
  627. "type": "object",
  628. "additionalProperties": {}
  629. },
  630. "time": {
  631. "type": "object",
  632. "properties": {
  633. "created": {
  634. "type": "number"
  635. }
  636. },
  637. "required": [
  638. "created"
  639. ]
  640. }
  641. },
  642. "required": [
  643. "id",
  644. "sessionID",
  645. "title",
  646. "metadata",
  647. "time"
  648. ]
  649. },
  650. "Event.message.updated": {
  651. "type": "object",
  652. "properties": {
  653. "type": {
  654. "type": "string",
  655. "const": "message.updated"
  656. },
  657. "properties": {
  658. "type": "object",
  659. "properties": {
  660. "info": {
  661. "$ref": "#/components/schemas/Message.Info"
  662. }
  663. },
  664. "required": [
  665. "info"
  666. ]
  667. }
  668. },
  669. "required": [
  670. "type",
  671. "properties"
  672. ]
  673. },
  674. "Message.Info": {
  675. "type": "object",
  676. "properties": {
  677. "id": {
  678. "type": "string"
  679. },
  680. "role": {
  681. "type": "string",
  682. "enum": [
  683. "user",
  684. "assistant"
  685. ]
  686. },
  687. "parts": {
  688. "type": "array",
  689. "items": {
  690. "$ref": "#/components/schemas/Message.Part"
  691. }
  692. },
  693. "metadata": {
  694. "type": "object",
  695. "properties": {
  696. "time": {
  697. "type": "object",
  698. "properties": {
  699. "created": {
  700. "type": "number"
  701. },
  702. "completed": {
  703. "type": "number"
  704. }
  705. },
  706. "required": [
  707. "created"
  708. ]
  709. },
  710. "error": {
  711. "oneOf": [
  712. {
  713. "$ref": "#/components/schemas/ProviderAuthError"
  714. },
  715. {
  716. "$ref": "#/components/schemas/UnknownError"
  717. }
  718. ],
  719. "discriminator": {
  720. "propertyName": "name",
  721. "mapping": {
  722. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  723. "UnknownError": "#/components/schemas/UnknownError"
  724. }
  725. }
  726. },
  727. "sessionID": {
  728. "type": "string"
  729. },
  730. "tool": {
  731. "type": "object",
  732. "additionalProperties": {
  733. "type": "object",
  734. "properties": {
  735. "title": {
  736. "type": "string"
  737. },
  738. "time": {
  739. "type": "object",
  740. "properties": {
  741. "start": {
  742. "type": "number"
  743. },
  744. "end": {
  745. "type": "number"
  746. }
  747. },
  748. "required": [
  749. "start",
  750. "end"
  751. ]
  752. }
  753. },
  754. "required": [
  755. "title",
  756. "time"
  757. ],
  758. "additionalProperties": {}
  759. }
  760. },
  761. "assistant": {
  762. "type": "object",
  763. "properties": {
  764. "system": {
  765. "type": "array",
  766. "items": {
  767. "type": "string"
  768. }
  769. },
  770. "modelID": {
  771. "type": "string"
  772. },
  773. "providerID": {
  774. "type": "string"
  775. },
  776. "path": {
  777. "type": "object",
  778. "properties": {
  779. "cwd": {
  780. "type": "string"
  781. },
  782. "root": {
  783. "type": "string"
  784. }
  785. },
  786. "required": [
  787. "cwd",
  788. "root"
  789. ]
  790. },
  791. "cost": {
  792. "type": "number"
  793. },
  794. "summary": {
  795. "type": "boolean"
  796. },
  797. "tokens": {
  798. "type": "object",
  799. "properties": {
  800. "input": {
  801. "type": "number"
  802. },
  803. "output": {
  804. "type": "number"
  805. },
  806. "reasoning": {
  807. "type": "number"
  808. },
  809. "cache": {
  810. "type": "object",
  811. "properties": {
  812. "read": {
  813. "type": "number"
  814. },
  815. "write": {
  816. "type": "number"
  817. }
  818. },
  819. "required": [
  820. "read",
  821. "write"
  822. ]
  823. }
  824. },
  825. "required": [
  826. "input",
  827. "output",
  828. "reasoning",
  829. "cache"
  830. ]
  831. }
  832. },
  833. "required": [
  834. "system",
  835. "modelID",
  836. "providerID",
  837. "path",
  838. "cost",
  839. "tokens"
  840. ]
  841. }
  842. },
  843. "required": [
  844. "time",
  845. "sessionID",
  846. "tool"
  847. ]
  848. }
  849. },
  850. "required": [
  851. "id",
  852. "role",
  853. "parts",
  854. "metadata"
  855. ]
  856. },
  857. "Message.Part": {
  858. "oneOf": [
  859. {
  860. "$ref": "#/components/schemas/Message.Part.Text"
  861. },
  862. {
  863. "$ref": "#/components/schemas/Message.Part.Reasoning"
  864. },
  865. {
  866. "$ref": "#/components/schemas/Message.Part.ToolInvocation"
  867. },
  868. {
  869. "$ref": "#/components/schemas/Message.Part.SourceUrl"
  870. },
  871. {
  872. "$ref": "#/components/schemas/Message.Part.File"
  873. },
  874. {
  875. "$ref": "#/components/schemas/Message.Part.StepStart"
  876. }
  877. ],
  878. "discriminator": {
  879. "propertyName": "type",
  880. "mapping": {
  881. "text": "#/components/schemas/Message.Part.Text",
  882. "reasoning": "#/components/schemas/Message.Part.Reasoning",
  883. "tool-invocation": "#/components/schemas/Message.Part.ToolInvocation",
  884. "source-url": "#/components/schemas/Message.Part.SourceUrl",
  885. "file": "#/components/schemas/Message.Part.File",
  886. "step-start": "#/components/schemas/Message.Part.StepStart"
  887. }
  888. }
  889. },
  890. "Message.Part.Text": {
  891. "type": "object",
  892. "properties": {
  893. "type": {
  894. "type": "string",
  895. "const": "text"
  896. },
  897. "text": {
  898. "type": "string"
  899. }
  900. },
  901. "required": [
  902. "type",
  903. "text"
  904. ]
  905. },
  906. "Message.Part.Reasoning": {
  907. "type": "object",
  908. "properties": {
  909. "type": {
  910. "type": "string",
  911. "const": "reasoning"
  912. },
  913. "text": {
  914. "type": "string"
  915. },
  916. "providerMetadata": {
  917. "type": "object",
  918. "additionalProperties": {}
  919. }
  920. },
  921. "required": [
  922. "type",
  923. "text"
  924. ]
  925. },
  926. "Message.Part.ToolInvocation": {
  927. "type": "object",
  928. "properties": {
  929. "type": {
  930. "type": "string",
  931. "const": "tool-invocation"
  932. },
  933. "toolInvocation": {
  934. "$ref": "#/components/schemas/Message.ToolInvocation"
  935. }
  936. },
  937. "required": [
  938. "type",
  939. "toolInvocation"
  940. ]
  941. },
  942. "Message.ToolInvocation": {
  943. "oneOf": [
  944. {
  945. "$ref": "#/components/schemas/Message.ToolInvocation.ToolCall"
  946. },
  947. {
  948. "$ref": "#/components/schemas/Message.ToolInvocation.ToolPartialCall"
  949. },
  950. {
  951. "$ref": "#/components/schemas/Message.ToolInvocation.ToolResult"
  952. }
  953. ],
  954. "discriminator": {
  955. "propertyName": "state",
  956. "mapping": {
  957. "call": "#/components/schemas/Message.ToolInvocation.ToolCall",
  958. "partial-call": "#/components/schemas/Message.ToolInvocation.ToolPartialCall",
  959. "result": "#/components/schemas/Message.ToolInvocation.ToolResult"
  960. }
  961. }
  962. },
  963. "Message.ToolInvocation.ToolCall": {
  964. "type": "object",
  965. "properties": {
  966. "state": {
  967. "type": "string",
  968. "const": "call"
  969. },
  970. "step": {
  971. "type": "number"
  972. },
  973. "toolCallId": {
  974. "type": "string"
  975. },
  976. "toolName": {
  977. "type": "string"
  978. },
  979. "args": {}
  980. },
  981. "required": [
  982. "state",
  983. "toolCallId",
  984. "toolName"
  985. ]
  986. },
  987. "Message.ToolInvocation.ToolPartialCall": {
  988. "type": "object",
  989. "properties": {
  990. "state": {
  991. "type": "string",
  992. "const": "partial-call"
  993. },
  994. "step": {
  995. "type": "number"
  996. },
  997. "toolCallId": {
  998. "type": "string"
  999. },
  1000. "toolName": {
  1001. "type": "string"
  1002. },
  1003. "args": {}
  1004. },
  1005. "required": [
  1006. "state",
  1007. "toolCallId",
  1008. "toolName"
  1009. ]
  1010. },
  1011. "Message.ToolInvocation.ToolResult": {
  1012. "type": "object",
  1013. "properties": {
  1014. "state": {
  1015. "type": "string",
  1016. "const": "result"
  1017. },
  1018. "step": {
  1019. "type": "number"
  1020. },
  1021. "toolCallId": {
  1022. "type": "string"
  1023. },
  1024. "toolName": {
  1025. "type": "string"
  1026. },
  1027. "args": {},
  1028. "result": {
  1029. "type": "string"
  1030. }
  1031. },
  1032. "required": [
  1033. "state",
  1034. "toolCallId",
  1035. "toolName",
  1036. "result"
  1037. ]
  1038. },
  1039. "Message.Part.SourceUrl": {
  1040. "type": "object",
  1041. "properties": {
  1042. "type": {
  1043. "type": "string",
  1044. "const": "source-url"
  1045. },
  1046. "sourceId": {
  1047. "type": "string"
  1048. },
  1049. "url": {
  1050. "type": "string"
  1051. },
  1052. "title": {
  1053. "type": "string"
  1054. },
  1055. "providerMetadata": {
  1056. "type": "object",
  1057. "additionalProperties": {}
  1058. }
  1059. },
  1060. "required": [
  1061. "type",
  1062. "sourceId",
  1063. "url"
  1064. ]
  1065. },
  1066. "Message.Part.File": {
  1067. "type": "object",
  1068. "properties": {
  1069. "type": {
  1070. "type": "string",
  1071. "const": "file"
  1072. },
  1073. "mediaType": {
  1074. "type": "string"
  1075. },
  1076. "filename": {
  1077. "type": "string"
  1078. },
  1079. "url": {
  1080. "type": "string"
  1081. }
  1082. },
  1083. "required": [
  1084. "type",
  1085. "mediaType",
  1086. "url"
  1087. ]
  1088. },
  1089. "Message.Part.StepStart": {
  1090. "type": "object",
  1091. "properties": {
  1092. "type": {
  1093. "type": "string",
  1094. "const": "step-start"
  1095. }
  1096. },
  1097. "required": [
  1098. "type"
  1099. ]
  1100. },
  1101. "ProviderAuthError": {
  1102. "type": "object",
  1103. "properties": {
  1104. "name": {
  1105. "type": "string",
  1106. "const": "ProviderAuthError"
  1107. },
  1108. "data": {
  1109. "type": "object",
  1110. "properties": {
  1111. "providerID": {
  1112. "type": "string"
  1113. },
  1114. "message": {
  1115. "type": "string"
  1116. }
  1117. },
  1118. "required": [
  1119. "providerID",
  1120. "message"
  1121. ]
  1122. }
  1123. },
  1124. "required": [
  1125. "name",
  1126. "data"
  1127. ]
  1128. },
  1129. "UnknownError": {
  1130. "type": "object",
  1131. "properties": {
  1132. "name": {
  1133. "type": "string",
  1134. "const": "UnknownError"
  1135. },
  1136. "data": {
  1137. "type": "object",
  1138. "properties": {
  1139. "message": {
  1140. "type": "string"
  1141. }
  1142. },
  1143. "required": [
  1144. "message"
  1145. ]
  1146. }
  1147. },
  1148. "required": [
  1149. "name",
  1150. "data"
  1151. ]
  1152. },
  1153. "Event.message.part.updated": {
  1154. "type": "object",
  1155. "properties": {
  1156. "type": {
  1157. "type": "string",
  1158. "const": "message.part.updated"
  1159. },
  1160. "properties": {
  1161. "type": "object",
  1162. "properties": {
  1163. "part": {
  1164. "$ref": "#/components/schemas/Message.Part"
  1165. },
  1166. "sessionID": {
  1167. "type": "string"
  1168. },
  1169. "messageID": {
  1170. "type": "string"
  1171. }
  1172. },
  1173. "required": [
  1174. "part",
  1175. "sessionID",
  1176. "messageID"
  1177. ]
  1178. }
  1179. },
  1180. "required": [
  1181. "type",
  1182. "properties"
  1183. ]
  1184. },
  1185. "Event.session.updated": {
  1186. "type": "object",
  1187. "properties": {
  1188. "type": {
  1189. "type": "string",
  1190. "const": "session.updated"
  1191. },
  1192. "properties": {
  1193. "type": "object",
  1194. "properties": {
  1195. "info": {
  1196. "$ref": "#/components/schemas/session.info"
  1197. }
  1198. },
  1199. "required": [
  1200. "info"
  1201. ]
  1202. }
  1203. },
  1204. "required": [
  1205. "type",
  1206. "properties"
  1207. ]
  1208. },
  1209. "session.info": {
  1210. "type": "object",
  1211. "properties": {
  1212. "id": {
  1213. "type": "string",
  1214. "pattern": "^ses"
  1215. },
  1216. "parentID": {
  1217. "type": "string",
  1218. "pattern": "^ses"
  1219. },
  1220. "share": {
  1221. "type": "object",
  1222. "properties": {
  1223. "secret": {
  1224. "type": "string"
  1225. },
  1226. "url": {
  1227. "type": "string"
  1228. }
  1229. },
  1230. "required": [
  1231. "secret",
  1232. "url"
  1233. ]
  1234. },
  1235. "title": {
  1236. "type": "string"
  1237. },
  1238. "time": {
  1239. "type": "object",
  1240. "properties": {
  1241. "created": {
  1242. "type": "number"
  1243. },
  1244. "updated": {
  1245. "type": "number"
  1246. }
  1247. },
  1248. "required": [
  1249. "created",
  1250. "updated"
  1251. ]
  1252. }
  1253. },
  1254. "required": [
  1255. "id",
  1256. "title",
  1257. "time"
  1258. ]
  1259. },
  1260. "Event.session.error": {
  1261. "type": "object",
  1262. "properties": {
  1263. "type": {
  1264. "type": "string",
  1265. "const": "session.error"
  1266. },
  1267. "properties": {
  1268. "type": "object",
  1269. "properties": {
  1270. "error": {
  1271. "oneOf": [
  1272. {
  1273. "$ref": "#/components/schemas/ProviderAuthError"
  1274. },
  1275. {
  1276. "$ref": "#/components/schemas/UnknownError"
  1277. }
  1278. ],
  1279. "discriminator": {
  1280. "propertyName": "name",
  1281. "mapping": {
  1282. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  1283. "UnknownError": "#/components/schemas/UnknownError"
  1284. }
  1285. }
  1286. }
  1287. }
  1288. }
  1289. },
  1290. "required": [
  1291. "type",
  1292. "properties"
  1293. ]
  1294. },
  1295. "Event.installation.updated": {
  1296. "type": "object",
  1297. "properties": {
  1298. "type": {
  1299. "type": "string",
  1300. "const": "installation.updated"
  1301. },
  1302. "properties": {
  1303. "type": "object",
  1304. "properties": {
  1305. "version": {
  1306. "type": "string"
  1307. }
  1308. },
  1309. "required": [
  1310. "version"
  1311. ]
  1312. }
  1313. },
  1314. "required": [
  1315. "type",
  1316. "properties"
  1317. ]
  1318. },
  1319. "App.Info": {
  1320. "type": "object",
  1321. "properties": {
  1322. "user": {
  1323. "type": "string"
  1324. },
  1325. "git": {
  1326. "type": "boolean"
  1327. },
  1328. "path": {
  1329. "type": "object",
  1330. "properties": {
  1331. "config": {
  1332. "type": "string"
  1333. },
  1334. "data": {
  1335. "type": "string"
  1336. },
  1337. "root": {
  1338. "type": "string"
  1339. },
  1340. "cwd": {
  1341. "type": "string"
  1342. },
  1343. "state": {
  1344. "type": "string"
  1345. }
  1346. },
  1347. "required": [
  1348. "config",
  1349. "data",
  1350. "root",
  1351. "cwd",
  1352. "state"
  1353. ]
  1354. },
  1355. "time": {
  1356. "type": "object",
  1357. "properties": {
  1358. "initialized": {
  1359. "type": "number"
  1360. }
  1361. }
  1362. }
  1363. },
  1364. "required": [
  1365. "user",
  1366. "git",
  1367. "path",
  1368. "time"
  1369. ]
  1370. },
  1371. "Error": {
  1372. "type": "object",
  1373. "properties": {
  1374. "data": {
  1375. "type": "object",
  1376. "additionalProperties": {}
  1377. }
  1378. },
  1379. "required": [
  1380. "data"
  1381. ]
  1382. },
  1383. "Provider.Info": {
  1384. "type": "object",
  1385. "properties": {
  1386. "name": {
  1387. "type": "string"
  1388. },
  1389. "env": {
  1390. "type": "array",
  1391. "items": {
  1392. "type": "string"
  1393. }
  1394. },
  1395. "id": {
  1396. "type": "string"
  1397. },
  1398. "npm": {
  1399. "type": "string"
  1400. },
  1401. "models": {
  1402. "type": "object",
  1403. "additionalProperties": {
  1404. "$ref": "#/components/schemas/Model.Info"
  1405. }
  1406. }
  1407. },
  1408. "required": [
  1409. "name",
  1410. "env",
  1411. "id",
  1412. "models"
  1413. ]
  1414. },
  1415. "Model.Info": {
  1416. "type": "object",
  1417. "properties": {
  1418. "name": {
  1419. "type": "string"
  1420. },
  1421. "attachment": {
  1422. "type": "boolean"
  1423. },
  1424. "reasoning": {
  1425. "type": "boolean"
  1426. },
  1427. "temperature": {
  1428. "type": "boolean"
  1429. },
  1430. "cost": {
  1431. "type": "object",
  1432. "properties": {
  1433. "input": {
  1434. "type": "number"
  1435. },
  1436. "output": {
  1437. "type": "number"
  1438. },
  1439. "inputCached": {
  1440. "type": "number"
  1441. },
  1442. "outputCached": {
  1443. "type": "number"
  1444. }
  1445. },
  1446. "required": [
  1447. "input",
  1448. "output",
  1449. "inputCached",
  1450. "outputCached"
  1451. ]
  1452. },
  1453. "limit": {
  1454. "type": "object",
  1455. "properties": {
  1456. "context": {
  1457. "type": "number"
  1458. },
  1459. "output": {
  1460. "type": "number"
  1461. }
  1462. },
  1463. "required": [
  1464. "context",
  1465. "output"
  1466. ]
  1467. },
  1468. "id": {
  1469. "type": "string"
  1470. }
  1471. },
  1472. "required": [
  1473. "name",
  1474. "attachment",
  1475. "reasoning",
  1476. "temperature",
  1477. "cost",
  1478. "limit",
  1479. "id"
  1480. ]
  1481. },
  1482. "InstallationInfo": {
  1483. "type": "object",
  1484. "properties": {
  1485. "version": {
  1486. "type": "string"
  1487. },
  1488. "latest": {
  1489. "type": "string"
  1490. }
  1491. },
  1492. "required": [
  1493. "version",
  1494. "latest"
  1495. ]
  1496. }
  1497. }
  1498. }
  1499. }