openapi.json 31 KB

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