openapi.json 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430
  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. },
  483. "components": {
  484. "schemas": {
  485. "Event": {
  486. "oneOf": [
  487. {
  488. "$ref": "#/components/schemas/Event.storage.write"
  489. },
  490. {
  491. "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
  492. },
  493. {
  494. "$ref": "#/components/schemas/Event.permission.updated"
  495. },
  496. {
  497. "$ref": "#/components/schemas/Event.message.updated"
  498. },
  499. {
  500. "$ref": "#/components/schemas/Event.message.part.updated"
  501. },
  502. {
  503. "$ref": "#/components/schemas/Event.session.updated"
  504. },
  505. {
  506. "$ref": "#/components/schemas/Event.session.error"
  507. }
  508. ],
  509. "discriminator": {
  510. "propertyName": "type",
  511. "mapping": {
  512. "storage.write": "#/components/schemas/Event.storage.write",
  513. "lsp.client.diagnostics": "#/components/schemas/Event.lsp.client.diagnostics",
  514. "permission.updated": "#/components/schemas/Event.permission.updated",
  515. "message.updated": "#/components/schemas/Event.message.updated",
  516. "message.part.updated": "#/components/schemas/Event.message.part.updated",
  517. "session.updated": "#/components/schemas/Event.session.updated",
  518. "session.error": "#/components/schemas/Event.session.error"
  519. }
  520. }
  521. },
  522. "Event.storage.write": {
  523. "type": "object",
  524. "properties": {
  525. "type": {
  526. "type": "string",
  527. "const": "storage.write"
  528. },
  529. "properties": {
  530. "type": "object",
  531. "properties": {
  532. "key": {
  533. "type": "string"
  534. },
  535. "content": {}
  536. },
  537. "required": [
  538. "key"
  539. ]
  540. }
  541. },
  542. "required": [
  543. "type",
  544. "properties"
  545. ]
  546. },
  547. "Event.lsp.client.diagnostics": {
  548. "type": "object",
  549. "properties": {
  550. "type": {
  551. "type": "string",
  552. "const": "lsp.client.diagnostics"
  553. },
  554. "properties": {
  555. "type": "object",
  556. "properties": {
  557. "serverID": {
  558. "type": "string"
  559. },
  560. "path": {
  561. "type": "string"
  562. }
  563. },
  564. "required": [
  565. "serverID",
  566. "path"
  567. ]
  568. }
  569. },
  570. "required": [
  571. "type",
  572. "properties"
  573. ]
  574. },
  575. "Event.permission.updated": {
  576. "type": "object",
  577. "properties": {
  578. "type": {
  579. "type": "string",
  580. "const": "permission.updated"
  581. },
  582. "properties": {
  583. "$ref": "#/components/schemas/permission.info"
  584. }
  585. },
  586. "required": [
  587. "type",
  588. "properties"
  589. ]
  590. },
  591. "permission.info": {
  592. "type": "object",
  593. "properties": {
  594. "id": {
  595. "type": "string"
  596. },
  597. "sessionID": {
  598. "type": "string"
  599. },
  600. "title": {
  601. "type": "string"
  602. },
  603. "metadata": {
  604. "type": "object",
  605. "additionalProperties": {}
  606. },
  607. "time": {
  608. "type": "object",
  609. "properties": {
  610. "created": {
  611. "type": "number"
  612. }
  613. },
  614. "required": [
  615. "created"
  616. ]
  617. }
  618. },
  619. "required": [
  620. "id",
  621. "sessionID",
  622. "title",
  623. "metadata",
  624. "time"
  625. ]
  626. },
  627. "Event.message.updated": {
  628. "type": "object",
  629. "properties": {
  630. "type": {
  631. "type": "string",
  632. "const": "message.updated"
  633. },
  634. "properties": {
  635. "type": "object",
  636. "properties": {
  637. "info": {
  638. "$ref": "#/components/schemas/Message.Info"
  639. }
  640. },
  641. "required": [
  642. "info"
  643. ]
  644. }
  645. },
  646. "required": [
  647. "type",
  648. "properties"
  649. ]
  650. },
  651. "Message.Info": {
  652. "type": "object",
  653. "properties": {
  654. "id": {
  655. "type": "string"
  656. },
  657. "role": {
  658. "type": "string",
  659. "enum": [
  660. "user",
  661. "assistant"
  662. ]
  663. },
  664. "parts": {
  665. "type": "array",
  666. "items": {
  667. "$ref": "#/components/schemas/Message.Part"
  668. }
  669. },
  670. "metadata": {
  671. "type": "object",
  672. "properties": {
  673. "time": {
  674. "type": "object",
  675. "properties": {
  676. "created": {
  677. "type": "number"
  678. },
  679. "completed": {
  680. "type": "number"
  681. }
  682. },
  683. "required": [
  684. "created"
  685. ]
  686. },
  687. "error": {
  688. "oneOf": [
  689. {
  690. "$ref": "#/components/schemas/ProviderAuthError"
  691. },
  692. {
  693. "$ref": "#/components/schemas/UnknownError"
  694. }
  695. ],
  696. "discriminator": {
  697. "propertyName": "name",
  698. "mapping": {
  699. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  700. "UnknownError": "#/components/schemas/UnknownError"
  701. }
  702. }
  703. },
  704. "sessionID": {
  705. "type": "string"
  706. },
  707. "tool": {
  708. "type": "object",
  709. "additionalProperties": {
  710. "type": "object",
  711. "properties": {
  712. "title": {
  713. "type": "string"
  714. },
  715. "time": {
  716. "type": "object",
  717. "properties": {
  718. "start": {
  719. "type": "number"
  720. },
  721. "end": {
  722. "type": "number"
  723. }
  724. },
  725. "required": [
  726. "start",
  727. "end"
  728. ]
  729. }
  730. },
  731. "required": [
  732. "title",
  733. "time"
  734. ],
  735. "additionalProperties": {}
  736. }
  737. },
  738. "assistant": {
  739. "type": "object",
  740. "properties": {
  741. "system": {
  742. "type": "array",
  743. "items": {
  744. "type": "string"
  745. }
  746. },
  747. "modelID": {
  748. "type": "string"
  749. },
  750. "providerID": {
  751. "type": "string"
  752. },
  753. "path": {
  754. "type": "object",
  755. "properties": {
  756. "cwd": {
  757. "type": "string"
  758. },
  759. "root": {
  760. "type": "string"
  761. }
  762. },
  763. "required": [
  764. "cwd",
  765. "root"
  766. ]
  767. },
  768. "cost": {
  769. "type": "number"
  770. },
  771. "summary": {
  772. "type": "boolean"
  773. },
  774. "tokens": {
  775. "type": "object",
  776. "properties": {
  777. "input": {
  778. "type": "number"
  779. },
  780. "output": {
  781. "type": "number"
  782. },
  783. "reasoning": {
  784. "type": "number"
  785. },
  786. "cache": {
  787. "type": "object",
  788. "properties": {
  789. "read": {
  790. "type": "number"
  791. },
  792. "write": {
  793. "type": "number"
  794. }
  795. },
  796. "required": [
  797. "read",
  798. "write"
  799. ]
  800. }
  801. },
  802. "required": [
  803. "input",
  804. "output",
  805. "reasoning",
  806. "cache"
  807. ]
  808. }
  809. },
  810. "required": [
  811. "system",
  812. "modelID",
  813. "providerID",
  814. "path",
  815. "cost",
  816. "tokens"
  817. ]
  818. }
  819. },
  820. "required": [
  821. "time",
  822. "sessionID",
  823. "tool"
  824. ]
  825. }
  826. },
  827. "required": [
  828. "id",
  829. "role",
  830. "parts",
  831. "metadata"
  832. ]
  833. },
  834. "Message.Part": {
  835. "oneOf": [
  836. {
  837. "$ref": "#/components/schemas/Message.Part.Text"
  838. },
  839. {
  840. "$ref": "#/components/schemas/Message.Part.Reasoning"
  841. },
  842. {
  843. "$ref": "#/components/schemas/Message.Part.ToolInvocation"
  844. },
  845. {
  846. "$ref": "#/components/schemas/Message.Part.SourceUrl"
  847. },
  848. {
  849. "$ref": "#/components/schemas/Message.Part.File"
  850. },
  851. {
  852. "$ref": "#/components/schemas/Message.Part.StepStart"
  853. }
  854. ],
  855. "discriminator": {
  856. "propertyName": "type",
  857. "mapping": {
  858. "text": "#/components/schemas/Message.Part.Text",
  859. "reasoning": "#/components/schemas/Message.Part.Reasoning",
  860. "tool-invocation": "#/components/schemas/Message.Part.ToolInvocation",
  861. "source-url": "#/components/schemas/Message.Part.SourceUrl",
  862. "file": "#/components/schemas/Message.Part.File",
  863. "step-start": "#/components/schemas/Message.Part.StepStart"
  864. }
  865. }
  866. },
  867. "Message.Part.Text": {
  868. "type": "object",
  869. "properties": {
  870. "type": {
  871. "type": "string",
  872. "const": "text"
  873. },
  874. "text": {
  875. "type": "string"
  876. }
  877. },
  878. "required": [
  879. "type",
  880. "text"
  881. ]
  882. },
  883. "Message.Part.Reasoning": {
  884. "type": "object",
  885. "properties": {
  886. "type": {
  887. "type": "string",
  888. "const": "reasoning"
  889. },
  890. "text": {
  891. "type": "string"
  892. },
  893. "providerMetadata": {
  894. "type": "object",
  895. "additionalProperties": {}
  896. }
  897. },
  898. "required": [
  899. "type",
  900. "text"
  901. ]
  902. },
  903. "Message.Part.ToolInvocation": {
  904. "type": "object",
  905. "properties": {
  906. "type": {
  907. "type": "string",
  908. "const": "tool-invocation"
  909. },
  910. "toolInvocation": {
  911. "$ref": "#/components/schemas/Message.ToolInvocation"
  912. }
  913. },
  914. "required": [
  915. "type",
  916. "toolInvocation"
  917. ]
  918. },
  919. "Message.ToolInvocation": {
  920. "oneOf": [
  921. {
  922. "$ref": "#/components/schemas/Message.ToolInvocation.ToolCall"
  923. },
  924. {
  925. "$ref": "#/components/schemas/Message.ToolInvocation.ToolPartialCall"
  926. },
  927. {
  928. "$ref": "#/components/schemas/Message.ToolInvocation.ToolResult"
  929. }
  930. ],
  931. "discriminator": {
  932. "propertyName": "state",
  933. "mapping": {
  934. "call": "#/components/schemas/Message.ToolInvocation.ToolCall",
  935. "partial-call": "#/components/schemas/Message.ToolInvocation.ToolPartialCall",
  936. "result": "#/components/schemas/Message.ToolInvocation.ToolResult"
  937. }
  938. }
  939. },
  940. "Message.ToolInvocation.ToolCall": {
  941. "type": "object",
  942. "properties": {
  943. "state": {
  944. "type": "string",
  945. "const": "call"
  946. },
  947. "step": {
  948. "type": "number"
  949. },
  950. "toolCallId": {
  951. "type": "string"
  952. },
  953. "toolName": {
  954. "type": "string"
  955. },
  956. "args": {}
  957. },
  958. "required": [
  959. "state",
  960. "toolCallId",
  961. "toolName"
  962. ]
  963. },
  964. "Message.ToolInvocation.ToolPartialCall": {
  965. "type": "object",
  966. "properties": {
  967. "state": {
  968. "type": "string",
  969. "const": "partial-call"
  970. },
  971. "step": {
  972. "type": "number"
  973. },
  974. "toolCallId": {
  975. "type": "string"
  976. },
  977. "toolName": {
  978. "type": "string"
  979. },
  980. "args": {}
  981. },
  982. "required": [
  983. "state",
  984. "toolCallId",
  985. "toolName"
  986. ]
  987. },
  988. "Message.ToolInvocation.ToolResult": {
  989. "type": "object",
  990. "properties": {
  991. "state": {
  992. "type": "string",
  993. "const": "result"
  994. },
  995. "step": {
  996. "type": "number"
  997. },
  998. "toolCallId": {
  999. "type": "string"
  1000. },
  1001. "toolName": {
  1002. "type": "string"
  1003. },
  1004. "args": {},
  1005. "result": {
  1006. "type": "string"
  1007. }
  1008. },
  1009. "required": [
  1010. "state",
  1011. "toolCallId",
  1012. "toolName",
  1013. "result"
  1014. ]
  1015. },
  1016. "Message.Part.SourceUrl": {
  1017. "type": "object",
  1018. "properties": {
  1019. "type": {
  1020. "type": "string",
  1021. "const": "source-url"
  1022. },
  1023. "sourceId": {
  1024. "type": "string"
  1025. },
  1026. "url": {
  1027. "type": "string"
  1028. },
  1029. "title": {
  1030. "type": "string"
  1031. },
  1032. "providerMetadata": {
  1033. "type": "object",
  1034. "additionalProperties": {}
  1035. }
  1036. },
  1037. "required": [
  1038. "type",
  1039. "sourceId",
  1040. "url"
  1041. ]
  1042. },
  1043. "Message.Part.File": {
  1044. "type": "object",
  1045. "properties": {
  1046. "type": {
  1047. "type": "string",
  1048. "const": "file"
  1049. },
  1050. "mediaType": {
  1051. "type": "string"
  1052. },
  1053. "filename": {
  1054. "type": "string"
  1055. },
  1056. "url": {
  1057. "type": "string"
  1058. }
  1059. },
  1060. "required": [
  1061. "type",
  1062. "mediaType",
  1063. "url"
  1064. ]
  1065. },
  1066. "Message.Part.StepStart": {
  1067. "type": "object",
  1068. "properties": {
  1069. "type": {
  1070. "type": "string",
  1071. "const": "step-start"
  1072. }
  1073. },
  1074. "required": [
  1075. "type"
  1076. ]
  1077. },
  1078. "ProviderAuthError": {
  1079. "type": "object",
  1080. "properties": {
  1081. "name": {
  1082. "type": "string",
  1083. "const": "ProviderAuthError"
  1084. },
  1085. "data": {
  1086. "type": "object",
  1087. "properties": {
  1088. "providerID": {
  1089. "type": "string"
  1090. },
  1091. "message": {
  1092. "type": "string"
  1093. }
  1094. },
  1095. "required": [
  1096. "providerID",
  1097. "message"
  1098. ]
  1099. }
  1100. },
  1101. "required": [
  1102. "name",
  1103. "data"
  1104. ]
  1105. },
  1106. "UnknownError": {
  1107. "type": "object",
  1108. "properties": {
  1109. "name": {
  1110. "type": "string",
  1111. "const": "UnknownError"
  1112. },
  1113. "data": {
  1114. "type": "object",
  1115. "properties": {
  1116. "message": {
  1117. "type": "string"
  1118. }
  1119. },
  1120. "required": [
  1121. "message"
  1122. ]
  1123. }
  1124. },
  1125. "required": [
  1126. "name",
  1127. "data"
  1128. ]
  1129. },
  1130. "Event.message.part.updated": {
  1131. "type": "object",
  1132. "properties": {
  1133. "type": {
  1134. "type": "string",
  1135. "const": "message.part.updated"
  1136. },
  1137. "properties": {
  1138. "type": "object",
  1139. "properties": {
  1140. "part": {
  1141. "$ref": "#/components/schemas/Message.Part"
  1142. },
  1143. "sessionID": {
  1144. "type": "string"
  1145. },
  1146. "messageID": {
  1147. "type": "string"
  1148. }
  1149. },
  1150. "required": [
  1151. "part",
  1152. "sessionID",
  1153. "messageID"
  1154. ]
  1155. }
  1156. },
  1157. "required": [
  1158. "type",
  1159. "properties"
  1160. ]
  1161. },
  1162. "Event.session.updated": {
  1163. "type": "object",
  1164. "properties": {
  1165. "type": {
  1166. "type": "string",
  1167. "const": "session.updated"
  1168. },
  1169. "properties": {
  1170. "type": "object",
  1171. "properties": {
  1172. "info": {
  1173. "$ref": "#/components/schemas/session.info"
  1174. }
  1175. },
  1176. "required": [
  1177. "info"
  1178. ]
  1179. }
  1180. },
  1181. "required": [
  1182. "type",
  1183. "properties"
  1184. ]
  1185. },
  1186. "session.info": {
  1187. "type": "object",
  1188. "properties": {
  1189. "id": {
  1190. "type": "string",
  1191. "pattern": "^ses"
  1192. },
  1193. "parentID": {
  1194. "type": "string",
  1195. "pattern": "^ses"
  1196. },
  1197. "share": {
  1198. "type": "object",
  1199. "properties": {
  1200. "secret": {
  1201. "type": "string"
  1202. },
  1203. "url": {
  1204. "type": "string"
  1205. }
  1206. },
  1207. "required": [
  1208. "secret",
  1209. "url"
  1210. ]
  1211. },
  1212. "title": {
  1213. "type": "string"
  1214. },
  1215. "time": {
  1216. "type": "object",
  1217. "properties": {
  1218. "created": {
  1219. "type": "number"
  1220. },
  1221. "updated": {
  1222. "type": "number"
  1223. }
  1224. },
  1225. "required": [
  1226. "created",
  1227. "updated"
  1228. ]
  1229. }
  1230. },
  1231. "required": [
  1232. "id",
  1233. "title",
  1234. "time"
  1235. ]
  1236. },
  1237. "Event.session.error": {
  1238. "type": "object",
  1239. "properties": {
  1240. "type": {
  1241. "type": "string",
  1242. "const": "session.error"
  1243. },
  1244. "properties": {
  1245. "type": "object",
  1246. "properties": {
  1247. "error": {
  1248. "oneOf": [
  1249. {
  1250. "$ref": "#/components/schemas/ProviderAuthError"
  1251. },
  1252. {
  1253. "$ref": "#/components/schemas/UnknownError"
  1254. }
  1255. ],
  1256. "discriminator": {
  1257. "propertyName": "name",
  1258. "mapping": {
  1259. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  1260. "UnknownError": "#/components/schemas/UnknownError"
  1261. }
  1262. }
  1263. }
  1264. }
  1265. }
  1266. },
  1267. "required": [
  1268. "type",
  1269. "properties"
  1270. ]
  1271. },
  1272. "App.Info": {
  1273. "type": "object",
  1274. "properties": {
  1275. "user": {
  1276. "type": "string"
  1277. },
  1278. "git": {
  1279. "type": "boolean"
  1280. },
  1281. "path": {
  1282. "type": "object",
  1283. "properties": {
  1284. "config": {
  1285. "type": "string"
  1286. },
  1287. "data": {
  1288. "type": "string"
  1289. },
  1290. "root": {
  1291. "type": "string"
  1292. },
  1293. "cwd": {
  1294. "type": "string"
  1295. }
  1296. },
  1297. "required": [
  1298. "config",
  1299. "data",
  1300. "root",
  1301. "cwd"
  1302. ]
  1303. },
  1304. "time": {
  1305. "type": "object",
  1306. "properties": {
  1307. "initialized": {
  1308. "type": "number"
  1309. }
  1310. }
  1311. }
  1312. },
  1313. "required": [
  1314. "user",
  1315. "git",
  1316. "path",
  1317. "time"
  1318. ]
  1319. },
  1320. "Error": {
  1321. "type": "object",
  1322. "properties": {
  1323. "data": {
  1324. "type": "object",
  1325. "additionalProperties": {}
  1326. }
  1327. },
  1328. "required": [
  1329. "data"
  1330. ]
  1331. },
  1332. "Provider.Info": {
  1333. "type": "object",
  1334. "properties": {
  1335. "name": {
  1336. "type": "string"
  1337. },
  1338. "env": {
  1339. "type": "array",
  1340. "items": {
  1341. "type": "string"
  1342. }
  1343. },
  1344. "id": {
  1345. "type": "string"
  1346. },
  1347. "models": {
  1348. "type": "object",
  1349. "additionalProperties": {
  1350. "$ref": "#/components/schemas/Model.Info"
  1351. }
  1352. }
  1353. },
  1354. "required": [
  1355. "name",
  1356. "env",
  1357. "id",
  1358. "models"
  1359. ]
  1360. },
  1361. "Model.Info": {
  1362. "type": "object",
  1363. "properties": {
  1364. "name": {
  1365. "type": "string"
  1366. },
  1367. "attachment": {
  1368. "type": "boolean"
  1369. },
  1370. "reasoning": {
  1371. "type": "boolean"
  1372. },
  1373. "temperature": {
  1374. "type": "boolean"
  1375. },
  1376. "cost": {
  1377. "type": "object",
  1378. "properties": {
  1379. "input": {
  1380. "type": "number"
  1381. },
  1382. "output": {
  1383. "type": "number"
  1384. },
  1385. "inputCached": {
  1386. "type": "number"
  1387. },
  1388. "outputCached": {
  1389. "type": "number"
  1390. }
  1391. },
  1392. "required": [
  1393. "input",
  1394. "output",
  1395. "inputCached",
  1396. "outputCached"
  1397. ]
  1398. },
  1399. "limit": {
  1400. "type": "object",
  1401. "properties": {
  1402. "context": {
  1403. "type": "number"
  1404. },
  1405. "output": {
  1406. "type": "number"
  1407. }
  1408. },
  1409. "required": [
  1410. "context",
  1411. "output"
  1412. ]
  1413. },
  1414. "id": {
  1415. "type": "string"
  1416. }
  1417. },
  1418. "required": [
  1419. "name",
  1420. "attachment",
  1421. "reasoning",
  1422. "temperature",
  1423. "cost",
  1424. "limit",
  1425. "id"
  1426. ]
  1427. }
  1428. }
  1429. }
  1430. }