openapi.json 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414
  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. },
  787. "required": [
  788. "input",
  789. "output",
  790. "reasoning"
  791. ]
  792. }
  793. },
  794. "required": [
  795. "system",
  796. "modelID",
  797. "providerID",
  798. "path",
  799. "cost",
  800. "tokens"
  801. ]
  802. }
  803. },
  804. "required": [
  805. "time",
  806. "sessionID",
  807. "tool"
  808. ]
  809. }
  810. },
  811. "required": [
  812. "id",
  813. "role",
  814. "parts",
  815. "metadata"
  816. ]
  817. },
  818. "Message.Part": {
  819. "oneOf": [
  820. {
  821. "$ref": "#/components/schemas/Message.Part.Text"
  822. },
  823. {
  824. "$ref": "#/components/schemas/Message.Part.Reasoning"
  825. },
  826. {
  827. "$ref": "#/components/schemas/Message.Part.ToolInvocation"
  828. },
  829. {
  830. "$ref": "#/components/schemas/Message.Part.SourceUrl"
  831. },
  832. {
  833. "$ref": "#/components/schemas/Message.Part.File"
  834. },
  835. {
  836. "$ref": "#/components/schemas/Message.Part.StepStart"
  837. }
  838. ],
  839. "discriminator": {
  840. "propertyName": "type",
  841. "mapping": {
  842. "text": "#/components/schemas/Message.Part.Text",
  843. "reasoning": "#/components/schemas/Message.Part.Reasoning",
  844. "tool-invocation": "#/components/schemas/Message.Part.ToolInvocation",
  845. "source-url": "#/components/schemas/Message.Part.SourceUrl",
  846. "file": "#/components/schemas/Message.Part.File",
  847. "step-start": "#/components/schemas/Message.Part.StepStart"
  848. }
  849. }
  850. },
  851. "Message.Part.Text": {
  852. "type": "object",
  853. "properties": {
  854. "type": {
  855. "type": "string",
  856. "const": "text"
  857. },
  858. "text": {
  859. "type": "string"
  860. }
  861. },
  862. "required": [
  863. "type",
  864. "text"
  865. ]
  866. },
  867. "Message.Part.Reasoning": {
  868. "type": "object",
  869. "properties": {
  870. "type": {
  871. "type": "string",
  872. "const": "reasoning"
  873. },
  874. "text": {
  875. "type": "string"
  876. },
  877. "providerMetadata": {
  878. "type": "object",
  879. "additionalProperties": {}
  880. }
  881. },
  882. "required": [
  883. "type",
  884. "text"
  885. ]
  886. },
  887. "Message.Part.ToolInvocation": {
  888. "type": "object",
  889. "properties": {
  890. "type": {
  891. "type": "string",
  892. "const": "tool-invocation"
  893. },
  894. "toolInvocation": {
  895. "$ref": "#/components/schemas/Message.ToolInvocation"
  896. }
  897. },
  898. "required": [
  899. "type",
  900. "toolInvocation"
  901. ]
  902. },
  903. "Message.ToolInvocation": {
  904. "oneOf": [
  905. {
  906. "$ref": "#/components/schemas/Message.ToolInvocation.ToolCall"
  907. },
  908. {
  909. "$ref": "#/components/schemas/Message.ToolInvocation.ToolPartialCall"
  910. },
  911. {
  912. "$ref": "#/components/schemas/Message.ToolInvocation.ToolResult"
  913. }
  914. ],
  915. "discriminator": {
  916. "propertyName": "state",
  917. "mapping": {
  918. "call": "#/components/schemas/Message.ToolInvocation.ToolCall",
  919. "partial-call": "#/components/schemas/Message.ToolInvocation.ToolPartialCall",
  920. "result": "#/components/schemas/Message.ToolInvocation.ToolResult"
  921. }
  922. }
  923. },
  924. "Message.ToolInvocation.ToolCall": {
  925. "type": "object",
  926. "properties": {
  927. "state": {
  928. "type": "string",
  929. "const": "call"
  930. },
  931. "step": {
  932. "type": "number"
  933. },
  934. "toolCallId": {
  935. "type": "string"
  936. },
  937. "toolName": {
  938. "type": "string"
  939. },
  940. "args": {}
  941. },
  942. "required": [
  943. "state",
  944. "toolCallId",
  945. "toolName"
  946. ]
  947. },
  948. "Message.ToolInvocation.ToolPartialCall": {
  949. "type": "object",
  950. "properties": {
  951. "state": {
  952. "type": "string",
  953. "const": "partial-call"
  954. },
  955. "step": {
  956. "type": "number"
  957. },
  958. "toolCallId": {
  959. "type": "string"
  960. },
  961. "toolName": {
  962. "type": "string"
  963. },
  964. "args": {}
  965. },
  966. "required": [
  967. "state",
  968. "toolCallId",
  969. "toolName"
  970. ]
  971. },
  972. "Message.ToolInvocation.ToolResult": {
  973. "type": "object",
  974. "properties": {
  975. "state": {
  976. "type": "string",
  977. "const": "result"
  978. },
  979. "step": {
  980. "type": "number"
  981. },
  982. "toolCallId": {
  983. "type": "string"
  984. },
  985. "toolName": {
  986. "type": "string"
  987. },
  988. "args": {},
  989. "result": {
  990. "type": "string"
  991. }
  992. },
  993. "required": [
  994. "state",
  995. "toolCallId",
  996. "toolName",
  997. "result"
  998. ]
  999. },
  1000. "Message.Part.SourceUrl": {
  1001. "type": "object",
  1002. "properties": {
  1003. "type": {
  1004. "type": "string",
  1005. "const": "source-url"
  1006. },
  1007. "sourceId": {
  1008. "type": "string"
  1009. },
  1010. "url": {
  1011. "type": "string"
  1012. },
  1013. "title": {
  1014. "type": "string"
  1015. },
  1016. "providerMetadata": {
  1017. "type": "object",
  1018. "additionalProperties": {}
  1019. }
  1020. },
  1021. "required": [
  1022. "type",
  1023. "sourceId",
  1024. "url"
  1025. ]
  1026. },
  1027. "Message.Part.File": {
  1028. "type": "object",
  1029. "properties": {
  1030. "type": {
  1031. "type": "string",
  1032. "const": "file"
  1033. },
  1034. "mediaType": {
  1035. "type": "string"
  1036. },
  1037. "filename": {
  1038. "type": "string"
  1039. },
  1040. "url": {
  1041. "type": "string"
  1042. }
  1043. },
  1044. "required": [
  1045. "type",
  1046. "mediaType",
  1047. "url"
  1048. ]
  1049. },
  1050. "Message.Part.StepStart": {
  1051. "type": "object",
  1052. "properties": {
  1053. "type": {
  1054. "type": "string",
  1055. "const": "step-start"
  1056. }
  1057. },
  1058. "required": [
  1059. "type"
  1060. ]
  1061. },
  1062. "ProviderAuthError": {
  1063. "type": "object",
  1064. "properties": {
  1065. "name": {
  1066. "type": "string",
  1067. "const": "ProviderAuthError"
  1068. },
  1069. "data": {
  1070. "type": "object",
  1071. "properties": {
  1072. "providerID": {
  1073. "type": "string"
  1074. },
  1075. "message": {
  1076. "type": "string"
  1077. }
  1078. },
  1079. "required": [
  1080. "providerID",
  1081. "message"
  1082. ]
  1083. }
  1084. },
  1085. "required": [
  1086. "name",
  1087. "data"
  1088. ]
  1089. },
  1090. "UnknownError": {
  1091. "type": "object",
  1092. "properties": {
  1093. "name": {
  1094. "type": "string",
  1095. "const": "UnknownError"
  1096. },
  1097. "data": {
  1098. "type": "object",
  1099. "properties": {
  1100. "message": {
  1101. "type": "string"
  1102. }
  1103. },
  1104. "required": [
  1105. "message"
  1106. ]
  1107. }
  1108. },
  1109. "required": [
  1110. "name",
  1111. "data"
  1112. ]
  1113. },
  1114. "Event.message.part.updated": {
  1115. "type": "object",
  1116. "properties": {
  1117. "type": {
  1118. "type": "string",
  1119. "const": "message.part.updated"
  1120. },
  1121. "properties": {
  1122. "type": "object",
  1123. "properties": {
  1124. "part": {
  1125. "$ref": "#/components/schemas/Message.Part"
  1126. },
  1127. "sessionID": {
  1128. "type": "string"
  1129. },
  1130. "messageID": {
  1131. "type": "string"
  1132. }
  1133. },
  1134. "required": [
  1135. "part",
  1136. "sessionID",
  1137. "messageID"
  1138. ]
  1139. }
  1140. },
  1141. "required": [
  1142. "type",
  1143. "properties"
  1144. ]
  1145. },
  1146. "Event.session.updated": {
  1147. "type": "object",
  1148. "properties": {
  1149. "type": {
  1150. "type": "string",
  1151. "const": "session.updated"
  1152. },
  1153. "properties": {
  1154. "type": "object",
  1155. "properties": {
  1156. "info": {
  1157. "$ref": "#/components/schemas/session.info"
  1158. }
  1159. },
  1160. "required": [
  1161. "info"
  1162. ]
  1163. }
  1164. },
  1165. "required": [
  1166. "type",
  1167. "properties"
  1168. ]
  1169. },
  1170. "session.info": {
  1171. "type": "object",
  1172. "properties": {
  1173. "id": {
  1174. "type": "string",
  1175. "pattern": "^ses"
  1176. },
  1177. "parentID": {
  1178. "type": "string",
  1179. "pattern": "^ses"
  1180. },
  1181. "share": {
  1182. "type": "object",
  1183. "properties": {
  1184. "secret": {
  1185. "type": "string"
  1186. },
  1187. "url": {
  1188. "type": "string"
  1189. }
  1190. },
  1191. "required": [
  1192. "secret",
  1193. "url"
  1194. ]
  1195. },
  1196. "title": {
  1197. "type": "string"
  1198. },
  1199. "time": {
  1200. "type": "object",
  1201. "properties": {
  1202. "created": {
  1203. "type": "number"
  1204. },
  1205. "updated": {
  1206. "type": "number"
  1207. }
  1208. },
  1209. "required": [
  1210. "created",
  1211. "updated"
  1212. ]
  1213. }
  1214. },
  1215. "required": [
  1216. "id",
  1217. "title",
  1218. "time"
  1219. ]
  1220. },
  1221. "Event.session.error": {
  1222. "type": "object",
  1223. "properties": {
  1224. "type": {
  1225. "type": "string",
  1226. "const": "session.error"
  1227. },
  1228. "properties": {
  1229. "type": "object",
  1230. "properties": {
  1231. "error": {
  1232. "oneOf": [
  1233. {
  1234. "$ref": "#/components/schemas/ProviderAuthError"
  1235. },
  1236. {
  1237. "$ref": "#/components/schemas/UnknownError"
  1238. }
  1239. ],
  1240. "discriminator": {
  1241. "propertyName": "name",
  1242. "mapping": {
  1243. "ProviderAuthError": "#/components/schemas/ProviderAuthError",
  1244. "UnknownError": "#/components/schemas/UnknownError"
  1245. }
  1246. }
  1247. }
  1248. }
  1249. }
  1250. },
  1251. "required": [
  1252. "type",
  1253. "properties"
  1254. ]
  1255. },
  1256. "App.Info": {
  1257. "type": "object",
  1258. "properties": {
  1259. "user": {
  1260. "type": "string"
  1261. },
  1262. "git": {
  1263. "type": "boolean"
  1264. },
  1265. "path": {
  1266. "type": "object",
  1267. "properties": {
  1268. "config": {
  1269. "type": "string"
  1270. },
  1271. "data": {
  1272. "type": "string"
  1273. },
  1274. "root": {
  1275. "type": "string"
  1276. },
  1277. "cwd": {
  1278. "type": "string"
  1279. }
  1280. },
  1281. "required": [
  1282. "config",
  1283. "data",
  1284. "root",
  1285. "cwd"
  1286. ]
  1287. },
  1288. "time": {
  1289. "type": "object",
  1290. "properties": {
  1291. "initialized": {
  1292. "type": "number"
  1293. }
  1294. }
  1295. }
  1296. },
  1297. "required": [
  1298. "user",
  1299. "git",
  1300. "path",
  1301. "time"
  1302. ]
  1303. },
  1304. "Error": {
  1305. "type": "object",
  1306. "properties": {
  1307. "data": {
  1308. "type": "object",
  1309. "additionalProperties": {}
  1310. }
  1311. },
  1312. "required": [
  1313. "data"
  1314. ]
  1315. },
  1316. "Provider.Info": {
  1317. "type": "object",
  1318. "properties": {
  1319. "name": {
  1320. "type": "string"
  1321. },
  1322. "env": {
  1323. "type": "array",
  1324. "items": {
  1325. "type": "string"
  1326. }
  1327. },
  1328. "id": {
  1329. "type": "string"
  1330. },
  1331. "models": {
  1332. "type": "object",
  1333. "additionalProperties": {
  1334. "$ref": "#/components/schemas/Model.Info"
  1335. }
  1336. }
  1337. },
  1338. "required": [
  1339. "name",
  1340. "env",
  1341. "id",
  1342. "models"
  1343. ]
  1344. },
  1345. "Model.Info": {
  1346. "type": "object",
  1347. "properties": {
  1348. "name": {
  1349. "type": "string"
  1350. },
  1351. "attachment": {
  1352. "type": "boolean"
  1353. },
  1354. "reasoning": {
  1355. "type": "boolean"
  1356. },
  1357. "temperature": {
  1358. "type": "boolean"
  1359. },
  1360. "cost": {
  1361. "type": "object",
  1362. "properties": {
  1363. "input": {
  1364. "type": "number"
  1365. },
  1366. "output": {
  1367. "type": "number"
  1368. },
  1369. "inputCached": {
  1370. "type": "number"
  1371. },
  1372. "outputCached": {
  1373. "type": "number"
  1374. }
  1375. },
  1376. "required": [
  1377. "input",
  1378. "output",
  1379. "inputCached",
  1380. "outputCached"
  1381. ]
  1382. },
  1383. "limit": {
  1384. "type": "object",
  1385. "properties": {
  1386. "context": {
  1387. "type": "number"
  1388. },
  1389. "output": {
  1390. "type": "number"
  1391. }
  1392. },
  1393. "required": [
  1394. "context",
  1395. "output"
  1396. ]
  1397. },
  1398. "id": {
  1399. "type": "string"
  1400. }
  1401. },
  1402. "required": [
  1403. "name",
  1404. "attachment",
  1405. "reasoning",
  1406. "temperature",
  1407. "cost",
  1408. "limit",
  1409. "id"
  1410. ]
  1411. }
  1412. }
  1413. }
  1414. }