@agimon-ai/po-cloudflare 0.0.2-alpha.7 → 0.0.2-alpha.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (355) hide show
  1. package/README.md +64 -241
  2. package/container/Dockerfile +27 -0
  3. package/dist/{BrowserWebSocketTransport-C2SC2VeJ.js → BrowserWebSocketTransport-B4heNdrp.js} +1 -1
  4. package/dist/{NodeWebSocketTransport-CKilJesa.js → NodeWebSocketTransport-BCiOXUEz.js} +2 -2
  5. package/dist/{abort-signals-Bkmp_euQ.js → abort-signals-C8CttjsR.js} +1 -1
  6. package/dist/agent-CEqvgRl6.js +3878 -0
  7. package/dist/{anthropic-messages-CkYm8M3V.js → anthropic-messages-DCLLLNuM.js} +292 -64
  8. package/dist/apiContracts-DaOpUHnu.js +1719 -0
  9. package/dist/{approval-CQ3ZuoTy.js → approval-DXPV7Vm5.js} +15 -2
  10. package/dist/{approvalPrompt-CylV3C84.js → approvalPrompt-CBaxjb_g.js} +1 -2
  11. package/dist/approvalSession-C9bg7tPo.js +132 -0
  12. package/dist/artifactFiles-5KwXIxYf.js +1 -0
  13. package/dist/artifactsApi-bg2wMYWg.js +200 -0
  14. package/dist/assets/assets/{CodeEditorView-D4q94XH-.js → CodeEditorView-CfrVwzvL.js} +2 -2
  15. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-C85p4OYZ.js → abnfDiagram-WEYOIA3C-B80H4Cm4.js} +2 -2
  16. package/dist/assets/assets/{architecture-WOLXFQ4H-Bt_NOdwE.js → architecture-WOLXFQ4H-Dr4hXaql.js} +1 -1
  17. package/dist/assets/assets/{architectureDiagram-ZHVYKT53-DzH1GKMm.js → architectureDiagram-ZHVYKT53-DWyt7oXu.js} +2 -2
  18. package/dist/assets/assets/{blockDiagram-RJAE7QA3-BmWU34j3.js → blockDiagram-RJAE7QA3-OxNTLdmi.js} +2 -2
  19. package/dist/assets/assets/{c4Diagram-XDPPPE54-BpGOdOuo.js → c4Diagram-XDPPPE54-B4YtcH0s.js} +2 -2
  20. package/dist/assets/assets/channel-bXj00dGj.js +2 -0
  21. package/dist/assets/assets/{chunk-2E7WHVMD-AycP1cXU.js → chunk-2E7WHVMD-CD6FFMOX.js} +2 -2
  22. package/dist/assets/assets/{chunk-4EMNKR2T-DX-DrZzc.js → chunk-4EMNKR2T-CEIoX5oo.js} +2 -2
  23. package/dist/assets/assets/{chunk-55XCU76K-BdwnLWzI.js → chunk-55XCU76K-CD3t0IJi.js} +2 -2
  24. package/dist/assets/assets/{chunk-7S6XSTFO-D-RBAwAn.js → chunk-7S6XSTFO-Cyt75UCF.js} +2 -2
  25. package/dist/assets/assets/{chunk-AQDTSKZB-CCxNNhKs.js → chunk-AQDTSKZB-DRtqYBj9.js} +2 -2
  26. package/dist/assets/assets/{chunk-DSNLSHJZ-D2hGwWm1.js → chunk-DSNLSHJZ-C8Fx2F8s.js} +2 -2
  27. package/dist/assets/assets/{chunk-HAGFOTED-BPi-cqGh.js → chunk-HAGFOTED-wOLWRRnd.js} +2 -2
  28. package/dist/assets/assets/{chunk-HNE4Q36P-D-r1ChHT.js → chunk-HNE4Q36P-CurJg4Hf.js} +2 -2
  29. package/dist/assets/assets/{chunk-NQOKRVIF-RgmZCAdn.js → chunk-NQOKRVIF-Dzcc5nOG.js} +2 -2
  30. package/dist/assets/assets/{chunk-UHW7PFBP-B-Hul-rZ.js → chunk-UHW7PFBP-B_ULFf2h.js} +2 -2
  31. package/dist/assets/assets/{chunk-VQ5W62QI-D1zlXCt8.js → chunk-VQ5W62QI-DH0VY4_p.js} +2 -2
  32. package/dist/assets/assets/{chunk-WQQL4CDK-CtjIbVJn.js → chunk-WQQL4CDK-DNxfLyXM.js} +2 -2
  33. package/dist/assets/assets/chunk-XXDRQBXY-B2bMWgN9.js +2 -0
  34. package/dist/assets/assets/{chunk-YZO67HFG-BQOgXG99.js → chunk-YZO67HFG-COuMUh9U.js} +2 -2
  35. package/dist/assets/assets/{chunk-ZAUX2LTX-CsDDxmqv.js → chunk-ZAUX2LTX-BJrCnubF.js} +2 -2
  36. package/dist/assets/assets/{chunk-ZCHMQSOR-deyEYMjx.js → chunk-ZCHMQSOR-D1lFKPtk.js} +2 -2
  37. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-DVJHeFlq.js → classDiagram-v2-4MYWR3UA-DfZIbyVL.js} +2 -2
  38. package/dist/assets/assets/{cose-bilkent-JH36ORCC-ipcN28Fw.js → cose-bilkent-JH36ORCC-CpGhv9_S.js} +2 -2
  39. package/dist/assets/assets/{cynefin-EF2NZ3EQ-s9ZkPF55.js → cynefin-EF2NZ3EQ-Cxdc6nQl.js} +1 -1
  40. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-Ksr2qjsS.js → cynefinDiagram-WF24UDRP-qoj0w3lp.js} +2 -2
  41. package/dist/assets/assets/{dagre-NK4GIZVX-2_Wl-XEW.js → dagre-NK4GIZVX-DL6QbNDS.js} +2 -2
  42. package/dist/assets/assets/{diagram-CBK3MWTC-C7PeyT7l.js → diagram-CBK3MWTC-CJB3jq1_.js} +2 -2
  43. package/dist/assets/assets/{diagram-I5XIIV2D-DPYzeKdj.js → diagram-I5XIIV2D-4cPOxCxF.js} +2 -2
  44. package/dist/assets/assets/{diagram-ODIL2UCW-DHw1cAmn.js → diagram-ODIL2UCW-BG3-jAxE.js} +2 -2
  45. package/dist/assets/assets/{diagram-PFBEJUXE-C2wA8i-1.js → diagram-PFBEJUXE-Bx8dFaXj.js} +2 -2
  46. package/dist/assets/assets/{diagram-RJA3I4VV-tM3moCIs.js → diagram-RJA3I4VV-CUUHND91.js} +2 -2
  47. package/dist/assets/assets/{diagram-TYUNFSNR-CInyJxF7.js → diagram-TYUNFSNR-BDMoN-kr.js} +2 -2
  48. package/dist/assets/assets/{dist-BDqjNLTC.js → dist-5AxNm-uy.js} +2 -2
  49. package/dist/assets/assets/{dist-hpZIQBl4.js → dist-9_Rmyj2I.js} +2 -2
  50. package/dist/assets/assets/{dist-DSLprmec.js → dist-BE3CLKv4.js} +2 -2
  51. package/dist/assets/assets/{dist-BASEd5LC.js → dist-BfNCu-7x.js} +2 -2
  52. package/dist/assets/assets/{dist-BuYBvf4F.js → dist-BjI0b36Z.js} +2 -2
  53. package/dist/assets/assets/{dist-DUS0U_ge.js → dist-CM7b5P9a.js} +2 -2
  54. package/dist/assets/assets/{dist-CeOy6PjJ.js → dist-Ccxb9U1G.js} +2 -2
  55. package/dist/assets/assets/{dist-ChXoRSS6.js → dist-CjCWP21A.js} +2 -2
  56. package/dist/assets/assets/{dist-07dRlnp1.js → dist-DSTAktnR.js} +2 -2
  57. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-4nZgqaSt.js → ebnfDiagram-V4P3TTPT-BivOMXZb.js} +2 -2
  58. package/dist/assets/assets/{elk-QONTBCTQ-nFh54c1Q.js → elk-QONTBCTQ-CrJ1Qpy_.js} +2 -2
  59. package/dist/assets/assets/{erDiagram-KYQIGQAA-CIQ0_IgZ.js → erDiagram-KYQIGQAA-w9Bqp4sV.js} +2 -2
  60. package/dist/assets/assets/{eventmodeling-K75KTNOO-Cw4BlbYP.js → eventmodeling-K75KTNOO-CBjFM3kV.js} +1 -1
  61. package/dist/assets/assets/flowDiagram-IUGLLWBU-C6Fnfgm0.js +1 -0
  62. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-C97qoUpX.js → ganttDiagram-R7GPNTJY-CsWtGaqD.js} +2 -2
  63. package/dist/assets/assets/{gitGraph-VSP46ZUC-B8HWVkEX.js → gitGraph-VSP46ZUC-DsBSV9_h.js} +1 -1
  64. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-B4Js56_8.js → gitGraphDiagram-PDYL7XHY-D5GxuYHW.js} +2 -2
  65. package/dist/assets/assets/index-CNDyKUDF.css +1 -0
  66. package/dist/assets/assets/index-DWDYnZsq.js +256 -0
  67. package/dist/assets/assets/{info-OHQRW6UA-A4qythhA.js → info-OHQRW6UA-C7x5dSJu.js} +1 -1
  68. package/dist/assets/assets/{infoDiagram-MVDRKAX5-BSNwG9yI.js → infoDiagram-MVDRKAX5-CwpI-uAa.js} +2 -2
  69. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-D4gU-3RA.js → ishikawaDiagram-HPEHV2GE-DAa7J5G6.js} +2 -2
  70. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-CxxDrw7o.js → journeyDiagram-BOSHW7O7-BmiZnxE_.js} +2 -2
  71. package/dist/assets/assets/{kanban-definition-FNSA4HC5-DUxQv3v0.js → kanban-definition-FNSA4HC5-DUR_mA3L.js} +2 -2
  72. package/dist/assets/assets/{line-BKODXUmk.js → line-DHY49wSg.js} +2 -2
  73. package/dist/assets/assets/{linear-Cm5uyUun.js → linear-pTo-a9xT.js} +2 -2
  74. package/dist/assets/assets/{mermaid-parser.core-CYst2kCg.js → mermaid-parser.core-DMg3hN3T.js} +4 -4
  75. package/dist/assets/assets/{mermaid.core-B4Qq8SMa.js → mermaid.core-DKtPCltA.js} +5 -5
  76. package/dist/assets/assets/{mindmap-definition-6OY57UG3-CZFvUTIM.js → mindmap-definition-6OY57UG3-DwTkFbnV.js} +2 -2
  77. package/dist/assets/assets/{packet-JDAUHWVQ-DZMlaiuy.js → packet-JDAUHWVQ-Tu9TrQ1x.js} +1 -1
  78. package/dist/assets/assets/{pegDiagram-ECIUJNBX-BjM668dT.js → pegDiagram-ECIUJNBX-B7My4tsz.js} +2 -2
  79. package/dist/assets/assets/{pie-XZMESJXO-CmpJ6vb8.js → pie-XZMESJXO-QPQm5Gdx.js} +1 -1
  80. package/dist/assets/assets/{pieDiagram-GNMPY74T-BCA9DCDe.js → pieDiagram-GNMPY74T-Bv-zAD_z.js} +2 -2
  81. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-CUnpC-Rl.js → quadrantDiagram-D57K4MC3-HTjoGQPd.js} +2 -2
  82. package/dist/assets/assets/{radar-ABXABTNO-C9x42-KP.js → radar-ABXABTNO-LDBlEoFo.js} +1 -1
  83. package/dist/assets/assets/{railroad-I3PHUGI6-CLvHKrsC.js → railroad-I3PHUGI6-Dy3_ymgZ.js} +1 -1
  84. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-B0LGF3gx.js → railroad-abnf-LNEFI6M7-QLVvYs6e.js} +1 -1
  85. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-SKnYapAj.js → railroad-ebnf-DWYD2UWJ-CFRlv9a8.js} +1 -1
  86. package/dist/assets/assets/{railroad-peg-JR7BVNR7-wsUpPloN.js → railroad-peg-JR7BVNR7-BOlq3d9c.js} +1 -1
  87. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-BYJtosKO.js → railroadDiagram-Y72NRBL7-Chg32HoU.js} +2 -2
  88. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-YYdoWMnl.js → requirementDiagram-EQYSW5RA-VenIs_eg.js} +2 -2
  89. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-DtZyCTdM.js → sankeyDiagram-SY24JHO5-BdByqMKF.js} +2 -2
  90. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-BPE8f413.js → sequenceDiagram-BLEHNHQU-D3Do4GJE.js} +2 -2
  91. package/dist/assets/assets/{src-BNTOLq2G.js → src-DmfN-DA-.js} +2 -2
  92. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-9f8Ow4Fl.js → stateDiagram-v2-A6IESKWZ-CZkRbPlf.js} +2 -2
  93. package/dist/assets/assets/{swimlanes-B3ENRKFQ-DdAEbxGp.js → swimlanes-B3ENRKFQ-DRTdF9AF.js} +2 -2
  94. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-BYr_4JUb.js +9 -0
  95. package/dist/assets/assets/{timeline-definition-JXYKGLGB-DJNGd2mU.js → timeline-definition-JXYKGLGB-BVcuws_M.js} +2 -2
  96. package/dist/assets/assets/{treeView-D4JQ5SDB-BHONoCCw.js → treeView-D4JQ5SDB-BLtOJGqO.js} +1 -1
  97. package/dist/assets/assets/{treemap-SAJKECNS-pOaYkxq7.js → treemap-SAJKECNS-Dn3BWJ4v.js} +1 -1
  98. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-C3eDYL9v.js → usecaseDiagram-WPOLBNNX-CBExIKDY.js} +2 -2
  99. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-CJi1xfsR.js → vennDiagram-Q3Y3IDCW-C6FIx2L4.js} +2 -2
  100. package/dist/assets/assets/{wardley-7MLQ67FV-CEy4w7Ir.js → wardley-7MLQ67FV-Cjj2xSBp.js} +1 -1
  101. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-DfdLMMpN.js → wardleyDiagram-IVAIDKWA-sQPCBCFK.js} +2 -2
  102. package/dist/assets/assets/{webpack-v8XGbQTa.js → webpack-DDCA0aDL.js} +2 -2
  103. package/dist/assets/assets/{xychartDiagram-4URNHDU4-Aw-Ix4uC.js → xychartDiagram-4URNHDU4-bZ4rifSw.js} +2 -2
  104. package/dist/assets/bundle-asset-policy.json +1 -1
  105. package/dist/assets/index.html +8 -2
  106. package/dist/assets/mascot/cta-provider.png +0 -0
  107. package/dist/assets/mascot/cta-sign-in.png +0 -0
  108. package/dist/assets/plugins/assets/base-GzIOAd-t.css +2 -0
  109. package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
  110. package/dist/assets/plugins/assets/day-bottom-left-5um-x02r-5um-x02r.webp +0 -0
  111. package/dist/assets/plugins/assets/day-grain-CvEuNhlI-CvEuNhlI.webp +0 -0
  112. package/dist/assets/plugins/assets/day-right-C9W-XtjV-C9W-XtjV.webp +0 -0
  113. package/dist/assets/plugins/assets/day-top-left-B544Eq9J-B544Eq9J.webp +0 -0
  114. package/dist/assets/plugins/assets/night-bottom-left-N03ST5Uz-N03ST5Uz.webp +0 -0
  115. package/dist/assets/plugins/assets/night-grain-BY9q-tNN-BY9q-tNN.webp +0 -0
  116. package/dist/assets/plugins/assets/night-right-C6Denrqj-C6Denrqj.webp +0 -0
  117. package/dist/assets/plugins/assets/night-top-left-KOou6UxY-KOou6UxY.webp +0 -0
  118. package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
  119. package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
  120. package/dist/assets/plugins/chunks/po-web-runtime-D8FIos2q.js +1 -0
  121. package/dist/assets/plugins/chunks/schemas-DVQ8BvvP.js +55 -0
  122. package/dist/assets/plugins/compositions.json +1 -1
  123. package/dist/assets/plugins/slots/approval.09e72f36-DxS_uibk.js +2 -0
  124. package/dist/assets/plugins/slots/artifacts.50b639bb-Cp37TAkd.js +1 -0
  125. package/dist/assets/plugins/slots/author.ea449ace-Ds9Y-tjN.js +93 -0
  126. package/dist/assets/plugins/slots/autocompact.6f428144-CDZpN7I7.js +1 -0
  127. package/dist/assets/plugins/slots/backdrop-bamboo.6e4c928d-qbifuMc6.js +1 -0
  128. package/dist/assets/plugins/slots/browse.fa1f1a50-CVYvo1M5.js +1 -0
  129. package/dist/assets/plugins/slots/builtin-tools.75108f21-Cq1ljoL-.js +7 -0
  130. package/dist/assets/plugins/slots/calendar.d8b70190-BBjpOs1v.js +2 -0
  131. package/dist/assets/plugins/slots/codemode.c58fb583-DOR6OR7R.js +11 -0
  132. package/dist/assets/plugins/slots/domain.753f9f92-CJrXxig9.js +1 -0
  133. package/dist/assets/plugins/slots/edit.804fec90-BFF7_xN9.js +7 -0
  134. package/dist/assets/plugins/slots/files.66ffc636-CzOlZrRm.js +2 -0
  135. package/dist/assets/plugins/slots/goal.45dffa01-BtQBp3sw.js +1 -0
  136. package/dist/assets/plugins/slots/grep.98262cff-9bUDfjyT.js +1 -0
  137. package/dist/assets/plugins/slots/help.5fbd20f7-B4-y6gYK.js +3 -0
  138. package/dist/assets/plugins/slots/log.cb964209-BRPa3cVs.js +4 -0
  139. package/dist/assets/plugins/slots/mcp.82cc1ff5-CFtzPkPC.js +55 -0
  140. package/dist/assets/plugins/slots/plan.3852ba52-CH59Ff49.js +3 -0
  141. package/dist/assets/plugins/slots/profile.ab16dcec-0e9fWWyE.js +1 -0
  142. package/dist/assets/plugins/slots/prompts.ae48c07a-BTqYnBX5.js +38 -0
  143. package/dist/assets/plugins/slots/read.4560591a-C7fMXDEH.js +1 -0
  144. package/dist/assets/plugins/slots/runner.6e494d59-CqrpqhW9.js +9 -0
  145. package/dist/assets/plugins/slots/scaffold.d87a6ee0-9qY5gkYW.js +1 -0
  146. package/dist/assets/plugins/slots/session-mcp.2be84084-Cf0cqopp.js +2 -0
  147. package/dist/assets/plugins/slots/sessions.6f47cb4c-B1_eqPJQ.js +1 -0
  148. package/dist/assets/plugins/slots/skill.62a0a1b3-D-SKX8iw.js +4 -0
  149. package/dist/assets/plugins/slots/space.65a27e5a-fbLHc-DX.js +1 -0
  150. package/dist/assets/plugins/slots/subagents.8bb9992c-Cm_YMEnn.js +7 -0
  151. package/dist/assets/plugins/slots/template-advanced.59f3f98a-L0WOM4JT.js +1 -0
  152. package/dist/assets/plugins/slots/template-desktop.0f0b8491-By9BZlaL.js +7 -0
  153. package/dist/assets/plugins/slots/template-elegant.0e3b0acf-El05x7HK.js +1 -0
  154. package/dist/assets/plugins/slots/vault.3cbfcdc3-DpU_65Wy.js +1 -0
  155. package/dist/assets/plugins/slots/voice.a952113d-CvcuL__m.js +1 -0
  156. package/dist/assets/plugins/slots/web-search.65013836-NVh9fdvE.js +1 -0
  157. package/dist/assets/plugins/slots/workflows.cbc5c5c0-OLKSY9PE.js +16 -0
  158. package/dist/assets/pwa/pwa.js +12 -12
  159. package/dist/assets/pwa/sw.js +58 -4
  160. package/dist/{atomicJson-wczZBXQP.js → atomicJson-XYtxz032.js} +2 -3
  161. package/dist/{azure-openai-config-DHMgdIa-.js → azure-openai-config-S-quxzTC.js} +2 -2
  162. package/dist/{azure-openai-responses-CTgRdQ4m.js → azure-openai-responses-DdpV5zh7.js} +13 -13
  163. package/dist/backgroundWork-Bv0ib_lY.js +49 -0
  164. package/dist/{layeredConfig-xmTHGrw8.js → browser-DwY5dXHX.js} +21 -983
  165. package/dist/{browser-EJ5_ffnN.js → browser-IsHIcvFg.js} +1 -1
  166. package/dist/browser-ks_k-6KA.js +36 -0
  167. package/dist/calendarSetup-CI3AACVo.js +3892 -0
  168. package/dist/childProcess-Cv8rJuUf.js +32 -0
  169. package/dist/childSession-BrDCrNtL.js +25 -0
  170. package/dist/{classifier-shared-jXm-plIK.js → classifier-shared-DFprgrML.js} +5 -5
  171. package/dist/{cloudflare-workers-ai-system-one-B0wH6HU5.js → cloudflare-workers-ai-system-one-B0MD19yZ.js} +3 -3
  172. package/dist/{codemode-CFVDmyGm.js → codemode-LpcMFMYM.js} +1 -1
  173. package/dist/coerce-DM9YrILC.js +13 -0
  174. package/dist/config-DeWkdjj7.js +1372 -0
  175. package/dist/contextContributions-C1bsEJef.js +13 -0
  176. package/dist/contracts-CW8o6Xyi.js +19 -0
  177. package/dist/contracts-WRa9e98H.js +40 -0
  178. package/dist/cordisHost-_-jtkneB.js +25 -0
  179. package/dist/delegation-B2rBgv8A.js +100 -0
  180. package/dist/{diagnostics-DPTP-yrt.js → diagnostics-BY5LXbHJ.js} +2 -2
  181. package/dist/{dist-BVBi6VMV.js → dist-B2ArMqge.js} +1 -1
  182. package/dist/{server-Cg07O2W6.js → dist-C6IqjC-m.js} +1 -546
  183. package/dist/{dist-PDDFdqDX.js → dist-CDz5dYMj.js} +1 -1
  184. package/dist/{dist-Dvx5mlIR.js → dist-kgi2Ix1y.js} +16 -3
  185. package/dist/{emscripten-module.cloudflare-D4Bc9Ykz.js → emscripten-module.cloudflare-B4fhfquU.js} +1 -1
  186. package/dist/{env-api-keys-CAnjjnsR.js → env-api-keys-BgCPpU9t.js} +1 -1
  187. package/dist/{error-body-DQZRsyL5.js → error-body-CeumezyR.js} +26 -4
  188. package/dist/esm-BKJy3O9-.js +1553 -0
  189. package/dist/{remoteMcp-DqE2xFWS.js → exports-BEEgtkya.js} +1588 -714
  190. package/dist/{exports-LjvSY7Y6.js → exports-CBp_9dVk.js} +47 -28
  191. package/dist/exports-CRjRvvX0.js +34 -0
  192. package/dist/exports-Cg0wxflf.js +1 -0
  193. package/dist/exports-Ct56PRB9.js +46 -0
  194. package/dist/extensionFile-B940JOEn.js +121 -0
  195. package/dist/{factory-Cs8iaUtc.js → factory-BU0cZY0I.js} +1 -1
  196. package/dist/{github-copilot-headers-DpQQAh-s.js → github-copilot-headers-Cq9pnpl2.js} +1 -1
  197. package/dist/{google-generative-ai-BTTOo5RQ.js → google-generative-ai-DmbUlCGv.js} +9 -9
  198. package/dist/{google-shared-S7bqOccz.js → google-shared-Diz2uk39.js} +6 -6
  199. package/dist/{google-vertex-BcMU_DMb.js → google-vertex-CGCpI9Po.js} +10 -10
  200. package/dist/{domains-B6Ae4swm.js → harnessState-Df--jB5z.js} +162 -42
  201. package/dist/{harnessStore-Ccbia9_u.js → harnessStore-DInwiLYb.js} +4 -5
  202. package/dist/{hash-B3RRpLS2.js → hash-IQBoLxOB.js} +1 -1
  203. package/dist/{headers-BEuxFxDI.js → headers-Dkgiqogr.js} +1 -1
  204. package/dist/help-C9UGKetC.js +100 -0
  205. package/dist/home-kwZFHqOx.js +60 -0
  206. package/dist/http-BekstF5S.js +64 -0
  207. package/dist/hubChannel-Dldv3EEb.js +32 -0
  208. package/dist/hubRevisions-BPoC6quI.js +364 -0
  209. package/dist/{identity-BIeAyilV.js → identity-BzB1N-Sn.js} +3 -3
  210. package/dist/index.edge-BiVQ9LoZ.js +198 -0
  211. package/dist/index.edge-CSGx6QOL.js +56 -0
  212. package/dist/index.edge-ClLTmPFz.js +191 -0
  213. package/dist/index.edge-CzoLWbyl.js +238 -0
  214. package/dist/index.edge-D1biKw71.js +946 -0
  215. package/dist/index.edge-D2RirEwK.js +14 -0
  216. package/dist/iso-BGFmgtky.js +27 -0
  217. package/dist/{kysely-adapter-D51abb3q.js → kysely-adapter-D8KUrWxm.js} +1 -1
  218. package/dist/liquid.browser-1BcykmIN.js +4596 -0
  219. package/dist/manualTranscription-DN56fzgj.js +96 -0
  220. package/dist/{mcpProjection-BXiECnW0.js → mcpProjection-D2U50Pel.js} +1 -2
  221. package/dist/meta-CVgfTHQP.js +1030 -0
  222. package/dist/migrations-DJBPDwSR.js +32 -0
  223. package/dist/{mistral-conversations-DN8VSERk.js → mistral-conversations-Bv_m1MRF.js} +12 -12
  224. package/dist/modeDefinition-Di95_IiU.js +44 -0
  225. package/dist/{models-D6d73jcW.js → models-D50yN8Ag.js} +41 -46
  226. package/dist/{node-UuMT2C3q.js → node-B4kSjHeD.js} +2 -2
  227. package/dist/{node-DytJOfYf.js → node-CBLSc-YH.js} +1 -1
  228. package/dist/notification-DjxbNoMR.js +143 -0
  229. package/dist/{openai-bt3ZRBZv.js → openai-D6Q-l6hT.js} +187 -187
  230. package/dist/{openai-codex-responses-cL36x0ml.js → openai-codex-responses-BnoiTqYV.js} +21 -25
  231. package/dist/{openai-completions-BWsTNYyT.js → openai-completions-C68qs5rI.js} +26 -19
  232. package/dist/{openai-decisions-Dfn_KgQd.js → openai-decisions-BSxU_aoV.js} +3 -3
  233. package/dist/{openai-responses-aa0LoyCJ.js → openai-responses-D6hXen-k.js} +17 -15
  234. package/dist/{openai-responses-shared-H-jH5SlM.js → openai-responses-shared-BD8K7FAC.js} +7 -7
  235. package/dist/{openrouter-cost-D99Qqcs6.js → openrouter-cost-BPam8wyW.js} +1 -1
  236. package/dist/{openrouter-images-BpwVpALC.js → openrouter-images-DylXiHy7.js} +7 -7
  237. package/dist/{hubChannel-Dn5NMpvu.js → packageApi-DYkaxP59.js} +33 -42
  238. package/dist/photon_rs_bg.wasm +0 -0
  239. package/dist/{pi-messages-BHAIkYBj.js → pi-messages-DaIlYYlO.js} +6 -6
  240. package/dist/piConfig-5tRPD0ov.js +126 -0
  241. package/dist/piSettings-ekBG5OeF.js +1 -0
  242. package/dist/platform-CQahdzpG.js +138 -0
  243. package/dist/pluginCatalog-BAALyedS.js +30 -0
  244. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  245. package/dist/pluginProtocol-7_gVUeM9.js +1 -0
  246. package/dist/pluginProtocol-DVIfJnav.js +135 -0
  247. package/dist/portableConfig-0tnk9anb.js +49 -0
  248. package/dist/presetConfig-n-oiNd3h.js +541 -0
  249. package/dist/profileSources-D1rymC97.js +537 -0
  250. package/dist/{protocol-DUeE0Q8z.js → protocol-Cri0GpZR.js} +1 -2
  251. package/dist/{provider-env-DgfpjgTa.js → provider-env-DJb40UF7.js} +2 -2
  252. package/dist/{provider-retry-ChD-K2Gv.js → provider-retry-jpvs7ixx.js} +1 -1
  253. package/dist/{puppeteer-cloudflare-B-GHrPGO.js → puppeteer-cloudflare-D4l8smMS.js} +3 -3
  254. package/dist/{server-BWJmxCrm.js → readiness-Ydw5zrKy.js} +4 -169
  255. package/dist/{rolldown-runtime-B-lAHAz2.js → rolldown-runtime-DbVrKiKs.js} +1 -1
  256. package/dist/{sanitize-unicode-Dl4ROF7y.js → sanitize-unicode-B1ZFaEtf.js} +1 -1
  257. package/dist/scaffoldRegistry-CeFe3Pf0.js +1240 -0
  258. package/dist/{schemas-Vj8-rCR4.js → schemas-D2dRon18.js} +1901 -53
  259. package/dist/server-AKM07WcM.js +466 -0
  260. package/dist/server-B0tM5Ygf.js +1300 -0
  261. package/dist/server-B8-vStCx.js +1116 -0
  262. package/dist/server-BAbdiL38.js +15108 -0
  263. package/dist/server-BCZ_R3kX.js +3326 -0
  264. package/dist/server-BGKAeB3M.js +492 -0
  265. package/dist/server-BIQhg1jS.js +26985 -0
  266. package/dist/server-BcPD_6a2.js +1533 -0
  267. package/dist/server-BeoA0QB-.js +580 -0
  268. package/dist/server-BsgvOpBF.js +24 -0
  269. package/dist/server-BtnOqSB5.js +156 -0
  270. package/dist/server-C-HBjWRo.js +2800 -0
  271. package/dist/{server-CWg0m_wq.js → server-C0Lt6nTt.js} +269 -1062
  272. package/dist/server-C8NPfG1H.js +148 -0
  273. package/dist/server-CKkaxOc0.js +978 -0
  274. package/dist/server-CMaWF5UA.js +1379 -0
  275. package/dist/server-CQPI6jIa.js +295 -0
  276. package/dist/{server-BhYE7Vqk.js → server-CQmb0lYL.js} +114 -176
  277. package/dist/server-CWR34Vx6.js +1884 -0
  278. package/dist/server-CZiAy2v5.js +641 -0
  279. package/dist/server-Cjtr0oVJ.js +584 -0
  280. package/dist/server-CkJQJ3Oo.js +571 -0
  281. package/dist/server-ClQQGtsI.js +679 -0
  282. package/dist/server-Cy2FhGBm.js +1744 -0
  283. package/dist/server-D8yEblCB.js +24 -0
  284. package/dist/server-DF0YIUeI.js +9603 -0
  285. package/dist/server-DRFESCq1.js +1527 -0
  286. package/dist/{server-zkcrP99W.js → server-Df1defzp.js} +89 -87
  287. package/dist/server-DgZd_TuT.js +189 -0
  288. package/dist/server-Dkc9Kth2.js +1830 -0
  289. package/dist/server-DlRePYOB.js +343 -0
  290. package/dist/{server-BpPEzRes.js → server-_HZm8wEC.js} +654 -745
  291. package/dist/{server-yABhJa2K.js → server-_jWkMESg.js} +60 -39
  292. package/dist/server-lgV6liTt.js +140 -0
  293. package/dist/server-nHPXbRDA.js +742 -0
  294. package/dist/server-p7qANgrf.js +877 -0
  295. package/dist/server-vhmQi3co.js +112 -0
  296. package/dist/{server-SA0dsIJ2.js → server-w1aKMZOs.js} +3 -10
  297. package/dist/serverPlugin-4nI5J6Zt.js +39622 -0
  298. package/dist/session-resources-BvR3cwiH.js +10 -0
  299. package/dist/{sessionConfig-DgnPcGBu.js → sessionConfig-UMlgu98q.js} +926 -844
  300. package/dist/{simple-options-DWrW31_K.js → simple-options-Cp5p46f9.js} +13 -6
  301. package/dist/space-C3Wnli1l.js +92 -0
  302. package/dist/sse-XlzXs1es.js +151 -0
  303. package/dist/{streaming-json-t4rzNHEp.js → streaming-json-CZyrX_Ux.js} +6 -6
  304. package/dist/{system-one-shared-DLVLdzYL.js → system-one-shared-Du6bka0h.js} +3 -3
  305. package/dist/{notification-valMY1zH.js → telemetry-CrTcxeA5.js} +2 -93
  306. package/dist/{transform-messages-CjTSwW9q.js → transform-messages-CBj9g2mx.js} +3 -16
  307. package/dist/truncate-M3KbFyVj.js +89 -0
  308. package/dist/{server-BXjfQYeU.js → type-DppaYz6F.js} +955 -1187
  309. package/dist/type-yokaDI_F.js +7 -0
  310. package/dist/{typesafe-system-one-DBVcjcUQ.js → typesafe-system-one-C7YFgvrX.js} +3 -3
  311. package/dist/{uuid-mkNGilLv.js → uuid-BVI0BZsx.js} +1 -1
  312. package/dist/{validation-BLnxgJU_.js → validation-QWuk6kwJ.js} +79 -74
  313. package/dist/vaultSettings-Bq8wkbDv.js +292 -0
  314. package/dist/voiceTools-BdJyfzwB.js +246 -0
  315. package/dist/web-B2sdV-F2.js +4 -0
  316. package/dist/worker.js +97821 -72579
  317. package/dist/workflow-DTCt4n6k.js +171 -0
  318. package/dist/workflowServices-RlswfHWp.js +300 -0
  319. package/package.json +55 -25
  320. package/wrangler.jsonc +16 -3
  321. package/dist/apiContracts-sG5b90Qa.js +0 -4451
  322. package/dist/assets/assets/channel-BOT7In0s.js +0 -2
  323. package/dist/assets/assets/chunk-XXDRQBXY-Dp9-QbR6.js +0 -2
  324. package/dist/assets/assets/flowDiagram-IUGLLWBU-B9D9uWwn.js +0 -1
  325. package/dist/assets/assets/index-BlPEYpuN.css +0 -1
  326. package/dist/assets/assets/index-DS9w_Q1B.js +0 -155
  327. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-CyUKtW7v.js +0 -9
  328. package/dist/assets/plugins/assets/base-DyDpY0zD.css +0 -2
  329. package/dist/assets/plugins/chunks/po-web-runtime-4JiBsb_c.js +0 -1
  330. package/dist/assets/plugins/slots/approval.09e72f36-DwFz-UMh.js +0 -2
  331. package/dist/assets/plugins/slots/artifacts.50b639bb-CUtFC806.js +0 -1
  332. package/dist/assets/plugins/slots/builtin-tools.75108f21-B69GLfY_.js +0 -7
  333. package/dist/assets/plugins/slots/codemode.c58fb583-C0Gmb7_s.js +0 -9
  334. package/dist/assets/plugins/slots/domain.753f9f92-BTBYRLkE.js +0 -1
  335. package/dist/assets/plugins/slots/mcp.82cc1ff5-Ecacjn0a.js +0 -109
  336. package/dist/assets/plugins/slots/profile.ab16dcec-DIVXNHmh.js +0 -1
  337. package/dist/assets/plugins/slots/skill.62a0a1b3-BNr7DmPH.js +0 -4
  338. package/dist/backgroundWork-CSpsJ-Rg.js +0 -25
  339. package/dist/contextProjection-DDIQRgN4.js +0 -188
  340. package/dist/extensionFile-CacKVegY.js +0 -409
  341. package/dist/harnessState-gmzJcPGt.js +0 -88
  342. package/dist/harnessStore-Ch6hdYYe.js +0 -1
  343. package/dist/index.edge-BgSx_gRO.js +0 -45
  344. package/dist/majorModes-CCnwAjfF.js +0 -333
  345. package/dist/majorModes-DNQbxkpt.js +0 -1
  346. package/dist/piSettings-B6fsgIBA.js +0 -1
  347. package/dist/platform-Bs2_X_dK.js +0 -16
  348. package/dist/platformFiles-CCGujP9o.js +0 -39
  349. package/dist/server-5hLs7M43.js +0 -656
  350. package/dist/server-B3iqBHOP.js +0 -118
  351. package/dist/server-Dv0EKLwc.js +0 -108
  352. package/dist/server-Y5A21sJf.js +0 -591
  353. package/dist/server-a1K226XK.js +0 -279
  354. package/dist/serverPlugin-DUc4gGep.js +0 -7279
  355. package/dist/value-Bd477RDX.js +0 -2247
@@ -0,0 +1,1719 @@
1
+ import { $t as Boolean, Gt as Record, Jt as String, Kt as Tuple, L as definePoContract, Qt as Integer, Ut as Partial, Wt as Omit, Xt as Null, Yt as Number$1, Zt as Literal, an as _Array_, en as Intersect, in as Optional$3, nn as Unknown, qt as Union, rn as _Object_, tn as Unsafe } from "./serverPlugin-4nI5J6Zt.js";
2
+ import { n as PoPluginWireCallSchema, t as PO_WIRE_HOST_SCOPE } from "./pluginProtocol-DVIfJnav.js";
3
+ import "./pluginCatalog-BAALyedS.js";
4
+ const Schema = Unsafe(Union([Boolean(), Record(String(), Unknown())]));
5
+ const Scope = Union([
6
+ Literal("host"),
7
+ Literal("workspace"),
8
+ Literal("session")
9
+ ]);
10
+ const Named = String({ minLength: 1 });
11
+ const ResponseSchema = _Object_({
12
+ description: Named,
13
+ contentType: Optional$3(Named),
14
+ schema: Optional$3(Schema),
15
+ events: Optional$3(Record(Named, Schema))
16
+ });
17
+ _Object_({
18
+ version: Literal(1),
19
+ protocols: Optional$3(Record(Named, Named)),
20
+ schemas: Optional$3(Record(Named, Schema)),
21
+ http: _Array_(_Object_({
22
+ id: Named,
23
+ scope: Scope,
24
+ /** Omit for host-owned absolute routes. */
25
+ basePath: Optional$3(String({ pattern: "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" })),
26
+ path: String({ pattern: "^/" }),
27
+ method: Union([
28
+ Literal("GET"),
29
+ Literal("POST"),
30
+ Literal("PUT"),
31
+ Literal("PATCH"),
32
+ Literal("DELETE"),
33
+ Literal("HEAD"),
34
+ Literal("OPTIONS")
35
+ ]),
36
+ description: Named,
37
+ availability: Optional$3(Named),
38
+ authentication: Union([
39
+ Literal("none"),
40
+ Literal("owner"),
41
+ Literal("device")
42
+ ]),
43
+ parameters: Optional$3(_Array_(_Object_({
44
+ name: Named,
45
+ in: Union([
46
+ Literal("path"),
47
+ Literal("query"),
48
+ Literal("header")
49
+ ]),
50
+ required: Boolean(),
51
+ schema: Schema
52
+ }))),
53
+ body: Optional$3(_Object_({
54
+ contentType: Named,
55
+ contentTypes: Optional$3(_Array_(Named, { minItems: 1 })),
56
+ required: Boolean(),
57
+ schema: Schema
58
+ })),
59
+ responses: Record(String({ pattern: "^(?:[1-5][0-9]{2}|default)$" }), ResponseSchema, { minProperties: 1 })
60
+ })),
61
+ sockets: _Array_(_Object_({
62
+ id: Named,
63
+ scope: Scope,
64
+ description: Named,
65
+ availability: Optional$3(Named),
66
+ service: Named,
67
+ member: Named,
68
+ direction: Union([Literal("client-to-server"), Literal("server-to-client")]),
69
+ kind: Union([
70
+ Literal("method"),
71
+ Literal("state"),
72
+ Literal("channel")
73
+ ]),
74
+ input: Schema,
75
+ output: Optional$3(Schema),
76
+ errors: Optional$3(Schema)
77
+ })),
78
+ /** Explicitly enumerate dynamic values whose shape is supplied at runtime. */
79
+ dynamic: _Array_(String({ minLength: 1 })),
80
+ gaps: Optional$3(_Array_(Named))
81
+ });
82
+ function defineApiContract(contract) {
83
+ return contract;
84
+ }
85
+ //#endregion
86
+ //#region ../../core/po-core/src/constants/contextApi.ts
87
+ /**
88
+ * What one entry in the composition actually is, for a reader who clicked it.
89
+ *
90
+ * The projection prices the composition and stops there: names, owners, and
91
+ * integer counts, small enough to republish whenever the composition changes.
92
+ * The prose and the schema behind a figure are an order of magnitude larger and
93
+ * are wanted one row at a time, so they travel on request instead. This module
94
+ * is the contract both ends of that request share, and it is deliberately free
95
+ * of Node imports so a browser can hold it too.
96
+ */
97
+ /** Where a host mounts this package's API; the segment after /api/plugins/. */
98
+ const API_BASE_PATH = "context";
99
+ const ITEM_ROUTE = "/item";
100
+ const CURRENT_ROUTE = "/current";
101
+ //#endregion
102
+ //#region ../../core/po-core/src/schemas/httpApiContracts.ts
103
+ const Text$3 = String();
104
+ const Optional$2 = Optional$3;
105
+ const Strings$1 = _Array_(Text$3);
106
+ const Flag$2 = Boolean();
107
+ const NumberValue$2 = Number$1();
108
+ const ApiErrorSchema = _Object_({
109
+ error: Text$3,
110
+ hash: Optional$2(Text$3)
111
+ });
112
+ const ApiOkSchema = _Object_({ ok: Literal(true) });
113
+ const Json$4 = Unknown({ description: "Value whose schema is supplied by the selected runtime contribution." });
114
+ /** Common JSON response construction; status and payload remain explicit at the declaration. */
115
+ function jsonApiResponses(schema, status = 200) {
116
+ return {
117
+ [status]: {
118
+ description: "Successful response",
119
+ contentType: "application/json",
120
+ schema
121
+ },
122
+ "400": {
123
+ description: "Invalid request",
124
+ schema: ApiErrorSchema
125
+ },
126
+ "401": {
127
+ description: "Authentication required",
128
+ schema: ApiErrorSchema
129
+ },
130
+ "403": {
131
+ description: "Request is not authorized",
132
+ schema: ApiErrorSchema
133
+ },
134
+ "404": {
135
+ description: "Resource or capability unavailable",
136
+ schema: ApiErrorSchema
137
+ },
138
+ "409": {
139
+ description: "Conflicting state",
140
+ schema: ApiErrorSchema
141
+ },
142
+ "422": {
143
+ description: "Invalid operation",
144
+ schema: ApiErrorSchema
145
+ },
146
+ "500": {
147
+ description: "Host operation failed",
148
+ schema: ApiErrorSchema
149
+ },
150
+ "502": {
151
+ description: "Provider failed",
152
+ schema: ApiErrorSchema
153
+ },
154
+ "503": {
155
+ description: "Service unavailable",
156
+ schema: ApiErrorSchema
157
+ }
158
+ };
159
+ }
160
+ const WebCompositionSchema = _Object_({
161
+ id: Text$3,
162
+ scope: Union([
163
+ Literal(PO_WIRE_HOST_SCOPE),
164
+ Literal("workspace"),
165
+ Literal("session")
166
+ ]),
167
+ revision: NumberValue$2,
168
+ manifestUrl: Text$3,
169
+ rawAssetBaseUrl: Text$3,
170
+ verifiedAssetBaseUrl: Text$3,
171
+ pluginEntries: _Array_(Tuple([Text$3, Text$3])),
172
+ assetPaths: Strings$1,
173
+ stylePaths: Strings$1,
174
+ channels: Strings$1
175
+ });
176
+ const NativeCompositionSchema = _Object_({
177
+ id: Text$3,
178
+ scope: Union([
179
+ Literal(PO_WIRE_HOST_SCOPE),
180
+ Literal("workspace"),
181
+ Literal("session")
182
+ ]),
183
+ revision: NumberValue$2,
184
+ manifestUrl: Text$3,
185
+ rawAssetBaseUrl: Text$3,
186
+ pluginEntries: _Array_(Tuple([Text$3, Text$3])),
187
+ uiEntry: Optional$2(Text$3),
188
+ channels: Strings$1,
189
+ plugins: Strings$1
190
+ });
191
+ /** A configured template id and the mount whose compositions offer it. */
192
+ const TemplateDecisionSchema = _Object_({
193
+ id: Optional$2(Text$3),
194
+ mount: Union([_Object_({ scope: Literal(PO_WIRE_HOST_SCOPE) }), _Object_({
195
+ scope: Literal("workspace"),
196
+ workspaceId: Text$3
197
+ })])
198
+ });
199
+ const SessionSummarySchema = _Object_({
200
+ id: Text$3,
201
+ workspaceId: Optional$2(Text$3),
202
+ webComposition: Optional$2(WebCompositionSchema),
203
+ nativeComposition: Optional$2(NativeCompositionSchema),
204
+ name: Text$3,
205
+ cwd: Text$3,
206
+ createdAt: Text$3,
207
+ updatedAt: Text$3,
208
+ phase: Union([
209
+ Literal("idle"),
210
+ Literal("turn"),
211
+ Literal("compaction"),
212
+ Literal("retry")
213
+ ]),
214
+ phaseSince: Text$3,
215
+ attach: Literal("attached"),
216
+ pendingMessageCount: NumberValue$2,
217
+ everPrompted: Flag$2,
218
+ awaitingInput: Flag$2,
219
+ lastSettledAt: Optional$2(Text$3),
220
+ git: Optional$2(_Object_({
221
+ branch: Text$3,
222
+ dirty: Flag$2
223
+ })),
224
+ profile: Optional$2(_Object_({
225
+ name: Text$3,
226
+ displayName: Optional$2(Text$3),
227
+ iconVersion: Optional$2(Text$3)
228
+ })),
229
+ parentSessionId: Optional$2(Text$3),
230
+ sessionProvenance: Optional$2(Text$3),
231
+ interaction: Optional$2(Union([Literal("interactive"), Literal("unattended")])),
232
+ /** The line the session's extension published about background work it runs. */
233
+ activity: Optional$2(_Object_({
234
+ label: Text$3,
235
+ attention: Optional$2(Flag$2),
236
+ since: Optional$2(Text$3)
237
+ })),
238
+ /** Tool calls waiting for the person's approval. */
239
+ pendingApprovalCount: Optional$2(Integer({ minimum: 1 })),
240
+ pendingSetups: Optional$2(_Array_(_Object_({
241
+ id: Text$3,
242
+ name: Text$3,
243
+ createdAt: Text$3,
244
+ cwd: Optional$2(Text$3),
245
+ setupKind: Optional$2(Union([Literal("managed-worktree"), Literal("existing-directory")])),
246
+ status: Optional$2(Union([
247
+ Literal("provisioning"),
248
+ Literal("failed"),
249
+ Literal("interrupted")
250
+ ])),
251
+ errorCode: Optional$2(Union([Literal("SESSION_WORKTREE_PROVISION_FAILED"), Literal("SESSION_UNAVAILABLE")]))
252
+ }))),
253
+ groups: Optional$2(Strings$1),
254
+ backgroundWorkActive: Optional$2(Flag$2),
255
+ /** Present and true for a recorded session the server has not reopened yet. */
256
+ dormant: Optional$2(Flag$2)
257
+ });
258
+ const WorkspaceSchema = _Object_({
259
+ kind: Optional$2(Literal("session")),
260
+ instructions: Optional$2(Text$3),
261
+ id: Text$3,
262
+ root: Text$3,
263
+ name: Optional$2(Text$3),
264
+ available: Optional$2(Flag$2),
265
+ sandbox: Optional$2(Text$3),
266
+ /**
267
+ * The sandbox's state, live: `starting` while it starts or sessions move in, `running` once the host is linked,
268
+ * `stopping` while it is switched off, `failed` when a start or a switch failed, `unavailable` when its provider
269
+ * cannot run it. On a workspace without `sandbox`, `unavailable` means the sandbox provider cannot run it now, so
270
+ * it cannot be switched on; absent means nothing stands in the way.
271
+ */
272
+ sandboxState: Optional$2(Union([
273
+ Literal("starting"),
274
+ Literal("running"),
275
+ Literal("stopping"),
276
+ Literal("unavailable"),
277
+ Literal("failed")
278
+ ])),
279
+ /** A plain sentence for `failed` or `unavailable`, such as 'Docker is not running.'. */
280
+ sandboxReason: Optional$2(Text$3)
281
+ });
282
+ const SavedSession = _Object_({
283
+ id: Text$3,
284
+ name: Optional$2(Text$3),
285
+ firstMessage: Text$3,
286
+ createdAt: Text$3,
287
+ updatedAt: Text$3
288
+ });
289
+ const query = (name, schema = Text$3, required = false) => ({
290
+ name,
291
+ in: "query",
292
+ required,
293
+ schema
294
+ });
295
+ const body = (schema) => ({
296
+ contentType: "application/json",
297
+ required: true,
298
+ schema
299
+ });
300
+ const host = (id, path, method, result, extra = {}) => ({
301
+ id,
302
+ path,
303
+ method,
304
+ scope: "host",
305
+ authentication: "owner",
306
+ description: id,
307
+ responses: jsonApiResponses(result),
308
+ ...extra
309
+ });
310
+ const Principal = _Object_({
311
+ issuer: Text$3,
312
+ subject: Text$3
313
+ });
314
+ const ProviderGrant = _Object_({
315
+ tag: Literal("po/grant/v1"),
316
+ signature: Text$3,
317
+ payload: _Object_({
318
+ issuer: Text$3,
319
+ subject: Text$3,
320
+ grantId: Text$3,
321
+ deviceKeyId: Text$3,
322
+ networkId: Text$3,
323
+ workspaceId: Text$3,
324
+ callingHostId: Text$3,
325
+ targetHostId: Text$3,
326
+ operations: Strings$1,
327
+ constraints: Record(Text$3, Union([
328
+ Text$3,
329
+ NumberValue$2,
330
+ Flag$2,
331
+ Null()
332
+ ])),
333
+ issuedAt: NumberValue$2,
334
+ notBefore: NumberValue$2,
335
+ expiresAt: NumberValue$2,
336
+ redelegable: Literal(false),
337
+ revocationEpoch: Optional$2(NumberValue$2)
338
+ })
339
+ });
340
+ const ProviderConsent = _Object_({
341
+ workspaceId: Text$3,
342
+ providerHostId: Text$3,
343
+ packageName: Text$3,
344
+ owner: Principal,
345
+ grants: _Array_(ProviderGrant, {
346
+ minItems: 2,
347
+ maxItems: 2
348
+ }),
349
+ createdAt: NumberValue$2,
350
+ expiresAt: NumberValue$2
351
+ });
352
+ const ConsentCandidate = _Object_({
353
+ hostId: Text$3,
354
+ packageName: Text$3,
355
+ version: Text$3,
356
+ operations: Strings$1,
357
+ manifestExpiresAt: NumberValue$2
358
+ });
359
+ const ConsentWorkspaceParameter = {
360
+ name: "workspaceId",
361
+ in: "path",
362
+ required: true,
363
+ schema: Text$3
364
+ };
365
+ const Binary = String({ contentEncoding: "binary" });
366
+ const headlessHttpContracts = [
367
+ host("health", "/api/health", "GET", _Object_({
368
+ ok: Literal(true),
369
+ role: Literal("hub"),
370
+ protocol: Literal(1),
371
+ sessions: NumberValue$2
372
+ }), { authentication: "none" }),
373
+ host("telemetry.browser", "/api/telemetry/browser", "POST", ApiOkSchema, { body: body(_Object_({
374
+ v: Literal(1),
375
+ events: _Array_(_Object_({
376
+ name: String({ pattern: "^web\\.browser\\.[a-z_]{1,40}$" }),
377
+ duration_ms: Optional$2(NumberValue$2),
378
+ count: Optional$2(NumberValue$2),
379
+ level: Optional$2(Literal("warn")),
380
+ attributes: Optional$2(Record(String({ pattern: "^[a-z_]{1,32}$" }), Union([String({ maxLength: 256 }), NumberValue$2]), { maxProperties: 12 }))
381
+ }), { maxItems: 10 })
382
+ })) }),
383
+ host("compositions", "/api/compositions", "GET", _Object_({
384
+ network: Optional$2(_Object_({
385
+ hostId: Text$3,
386
+ networkId: Text$3,
387
+ enrollmentGeneration: Optional$2(NumberValue$2)
388
+ })),
389
+ /** The computer's own name, which phones show instead of a tunnel address. */
390
+ displayName: Optional$2(Text$3),
391
+ host: Optional$2(WebCompositionSchema),
392
+ nativeHost: Optional$2(NativeCompositionSchema),
393
+ publicKey: Optional$2(Text$3),
394
+ shell: Optional$2(_Object_({
395
+ publicKey: Text$3,
396
+ revision: NumberValue$2
397
+ })),
398
+ template: Optional$2(TemplateDecisionSchema),
399
+ /** The phone app's `native.template` choice, resolved the same way. */
400
+ nativeTemplate: Optional$2(TemplateDecisionSchema),
401
+ workspaces: _Array_(_Object_({
402
+ id: Text$3,
403
+ root: Text$3,
404
+ /** `null` for a sandboxed workspace: its plugins run in its sandbox, the host has none for it. */
405
+ webComposition: Optional$2(Union([WebCompositionSchema, Null()])),
406
+ nativeComposition: Optional$2(Union([NativeCompositionSchema, Null()])),
407
+ providers: Optional$2(_Array_(_Object_({
408
+ hostId: Text$3,
409
+ packageName: Text$3,
410
+ version: Text$3,
411
+ operations: _Array_(_Object_({
412
+ scope: Union([
413
+ Literal(PO_WIRE_HOST_SCOPE),
414
+ Literal("workspace"),
415
+ Literal("session")
416
+ ]),
417
+ names: Strings$1
418
+ })),
419
+ provenance: Union([
420
+ Literal("local"),
421
+ Literal("own"),
422
+ Literal("consented")
423
+ ]),
424
+ status: Union([Literal("available"), Literal("unavailable")]),
425
+ reason: Optional$2(Union([
426
+ Literal("manifest-missing"),
427
+ Literal("manifest-expired"),
428
+ Literal("roster-stale"),
429
+ Literal("host-removed"),
430
+ Literal("consent-expired")
431
+ ])),
432
+ expiresAt: Optional$2(NumberValue$2)
433
+ })))
434
+ }))
435
+ })),
436
+ host("compositions.remote", "/api/compositions/remote", "GET", _Object_({
437
+ workspace: WebCompositionSchema,
438
+ session: WebCompositionSchema
439
+ }), {
440
+ parameters: [query("plugins", Text$3, true)],
441
+ availability: "Host has published a web build"
442
+ }),
443
+ host("network.voters.propose", "/api/network/voters", "POST", Json$4, { body: body(_Object_({
444
+ change: Union([_Object_({
445
+ network: Text$3,
446
+ epoch: NumberValue$2,
447
+ kind: Literal("add"),
448
+ added: Text$3,
449
+ addedKey: Text$3
450
+ }), _Object_({
451
+ network: Text$3,
452
+ epoch: NumberValue$2,
453
+ kind: Literal("evict"),
454
+ removed: Text$3
455
+ })]),
456
+ authorization: Text$3
457
+ })) }),
458
+ host("network.consents.list", "/api/network/workspaces/{workspaceId}/consents", "GET", _Object_({
459
+ consents: _Array_(ProviderConsent),
460
+ candidates: _Array_(ConsentCandidate)
461
+ }), { parameters: [ConsentWorkspaceParameter] }),
462
+ host("network.consents.approve", "/api/network/workspaces/{workspaceId}/consents", "POST", ProviderConsent, {
463
+ parameters: [ConsentWorkspaceParameter],
464
+ body: body(_Object_({
465
+ providerHostId: Text$3,
466
+ packageName: Text$3,
467
+ grants: _Array_(ProviderGrant, {
468
+ minItems: 2,
469
+ maxItems: 2
470
+ })
471
+ })),
472
+ responses: jsonApiResponses(ProviderConsent, 201)
473
+ }),
474
+ host("network.consents.revoke", "/api/network/workspaces/{workspaceId}/consents/{providerHostId}/{packageName}", "DELETE", Null(), {
475
+ parameters: [
476
+ ConsentWorkspaceParameter,
477
+ {
478
+ name: "providerHostId",
479
+ in: "path",
480
+ required: true,
481
+ schema: Text$3
482
+ },
483
+ {
484
+ name: "packageName",
485
+ in: "path",
486
+ required: true,
487
+ schema: Text$3
488
+ }
489
+ ],
490
+ responses: { "204": { description: "Provider consent revoked" } }
491
+ }),
492
+ host("directories", "/api/directories", "GET", _Object_({ directories: Strings$1 }), { parameters: [query("q")] }),
493
+ host("directories.children", "/api/directories/children", "GET", _Object_({
494
+ path: Text$3,
495
+ parent: Optional$2(Text$3),
496
+ directories: Strings$1
497
+ }), { parameters: [query("path")] }),
498
+ host("directories.workspaces", "/api/directories/workspaces", "GET", _Object_({
499
+ root: Text$3,
500
+ declarations: _Array_(_Object_({
501
+ name: Text$3,
502
+ instructions: Optional$2(Text$3),
503
+ workspaceId: Optional$2(Text$3)
504
+ }))
505
+ }), {
506
+ parameters: [query("path")],
507
+ availability: "Host provides declaredWorkspaces"
508
+ }),
509
+ host("directories.po", "/api/directories/po", "GET", _Object_({ directories: Strings$1 })),
510
+ host("sessions.list", "/api/workspaces/{workspaceId}/sessions", "GET", _Object_({ sessions: _Array_(SessionSummarySchema) })),
511
+ host("sessions.create", "/api/workspaces/{workspaceId}/sessions", "POST", _Object_({ sessionId: Text$3 }), {
512
+ body: body(_Object_({ name: Optional$2(Text$3) })),
513
+ responses: jsonApiResponses(_Object_({ sessionId: Text$3 }), 201)
514
+ }),
515
+ host("sessions.createGeneral", "/api/sessions", "POST", _Object_({
516
+ sessionId: Text$3,
517
+ workspace: Optional$2(WorkspaceSchema),
518
+ session: Optional$2(SessionSummarySchema)
519
+ }), {
520
+ body: body(_Object_({
521
+ name: Optional$2(Text$3),
522
+ cwd: Optional$2(String({ minLength: 1 }))
523
+ })),
524
+ availability: "Host provides createGeneralSession when cwd is omitted; explicit cwd remains supported for compatibility",
525
+ responses: jsonApiResponses(_Object_({
526
+ sessionId: Text$3,
527
+ workspace: Optional$2(WorkspaceSchema),
528
+ session: Optional$2(SessionSummarySchema)
529
+ }), 201)
530
+ }),
531
+ host("coordinators.home", "/api/coordinators/home", "POST", _Object_({
532
+ sessionId: Text$3,
533
+ created: Boolean()
534
+ }), {
535
+ body: body(_Object_({
536
+ profile: String({ minLength: 1 }),
537
+ model: Optional$2(String({ minLength: 1 })),
538
+ name: String({ minLength: 1 })
539
+ }, { additionalProperties: false })),
540
+ availability: "Host provides ensureHomeCoordinator; otherwise 501"
541
+ }),
542
+ host("coordinators.add", "/api/coordinators", "POST", _Object_({
543
+ sessionId: Text$3,
544
+ created: Boolean()
545
+ }), {
546
+ body: body(_Object_({
547
+ workspaceId: Optional$2(String({ minLength: 1 })),
548
+ profile: Optional$2(String({
549
+ minLength: 1,
550
+ pattern: "\\S"
551
+ }))
552
+ }, { additionalProperties: false })),
553
+ responses: {
554
+ ...jsonApiResponses(_Object_({
555
+ sessionId: Text$3,
556
+ created: Boolean()
557
+ })),
558
+ "422": {
559
+ description: "Profile required or invalid operation",
560
+ schema: Union([_Object_({
561
+ profileRequired: Literal(true),
562
+ error: Text$3
563
+ }), ApiErrorSchema])
564
+ }
565
+ },
566
+ availability: "Host provides addCoordinator; otherwise 501"
567
+ }),
568
+ host("sessions.get", "/api/workspaces/{workspaceId}/sessions/{sessionId}", "GET", SessionSummarySchema),
569
+ host("sessions.delete", "/api/workspaces/{workspaceId}/sessions/{sessionId}", "DELETE", ApiOkSchema),
570
+ host("sessions.history", "/api/workspaces/{workspaceId}/sessions/{sessionId}/history", "GET", _Object_({ sessions: _Array_(SavedSession) }), { availability: "Host provides sessionHistory" }),
571
+ host("sessions.restart", "/api/workspaces/{workspaceId}/sessions/{sessionId}/restart", "POST", ApiOkSchema, { availability: "Host provides restartSession" }),
572
+ host("sessions.move", "/api/workspaces/{workspaceId}/sessions/{sessionId}/move", "POST", ApiOkSchema, {
573
+ body: body(_Object_({ workspaceId: String({
574
+ minLength: 1,
575
+ pattern: "\\S"
576
+ }) }, { additionalProperties: false })),
577
+ availability: "Host provides moveSession; otherwise 501",
578
+ responses: {
579
+ ...jsonApiResponses(ApiOkSchema),
580
+ "501": {
581
+ description: "Host does not support session moves",
582
+ schema: ApiErrorSchema
583
+ }
584
+ }
585
+ }),
586
+ host("sessions.role", "/api/workspaces/{workspaceId}/sessions/{sessionId}/role", "POST", ApiOkSchema, {
587
+ body: body(_Object_({ coordinator: Boolean() }, { additionalProperties: false })),
588
+ availability: "Host provides setSessionRole"
589
+ }),
590
+ host("sessions.revive", "/api/workspaces/{workspaceId}/sessions/{sessionId}/revive", "POST", ApiOkSchema, { availability: "Host provides reviveSession" }),
591
+ host("sessions.resume", "/api/workspaces/{workspaceId}/sessions/{sessionId}/resume", "POST", _Object_({ sessionId: Text$3 }), {
592
+ availability: "Host provides resumeSession",
593
+ body: body(_Object_({ targetSessionId: String({ pattern: "^[A-Za-z0-9_-]+$" }) }))
594
+ }),
595
+ host("sessions.file", "/api/workspaces/{workspaceId}/sessions/{sessionId}/file", "GET", Binary, {
596
+ parameters: [query("path", Text$3, true)],
597
+ responses: {
598
+ ...jsonApiResponses(Binary),
599
+ "200": {
600
+ description: "File bytes, MIME type follows the file extension",
601
+ contentType: "*/*",
602
+ schema: Binary
603
+ }
604
+ }
605
+ }),
606
+ host("workspaces.list", "/api/workspaces", "GET", _Object_({ workspaces: _Array_(WorkspaceSchema) })),
607
+ host("workspaces.admit", "/api/workspaces", "POST", _Object_({ workspace: WorkspaceSchema }), {
608
+ body: body(_Object_({
609
+ root: Optional$2(Text$3),
610
+ name: Optional$2(Text$3),
611
+ declaration: Optional$2(Text$3),
612
+ instructions: Optional$2(Text$3)
613
+ })),
614
+ responses: jsonApiResponses(_Object_({ workspace: WorkspaceSchema }), 201)
615
+ }),
616
+ host("workspaces.get", "/api/workspaces/{workspaceId}", "GET", _Object_({ workspace: WorkspaceSchema })),
617
+ host("workspaces.history", "/api/workspaces/{workspaceId}/history", "GET", _Object_({ sessions: _Array_(SavedSession) }), { availability: "Host provides workspaceHistory" }),
618
+ host("workspaces.resume", "/api/workspaces/{workspaceId}/resume", "POST", _Object_({ sessionId: Text$3 }), {
619
+ availability: "Host provides resumeWorkspaceSession",
620
+ body: body(_Object_({ targetSessionId: String({ pattern: "^[A-Za-z0-9_-]+$" }) }))
621
+ }),
622
+ host("workspaces.removed", "/api/workspaces/{workspaceId}/removed", "GET", _Object_({ sessions: _Array_(Intersect([SavedSession, _Object_({
623
+ removedAt: Text$3,
624
+ purgeAt: Text$3
625
+ })])) }), { availability: "Host provides removedSessions" }),
626
+ host("workspaces.restoreRemoved", "/api/workspaces/{workspaceId}/removed/{sessionId}/restore", "POST", ApiOkSchema, { availability: "Host provides restoreRemovedSession" }),
627
+ host("workspaces.setSandbox", "/api/workspaces/{workspaceId}", "PATCH", _Object_({ workspace: WorkspaceSchema }), {
628
+ availability: "Host provides setWorkspaceSandbox or setWorkspaceInstructions",
629
+ body: body(Union([_Object_({ sandbox: Union([Text$3, Null()]) }, { additionalProperties: false }), _Object_({ instructions: Text$3 }, { additionalProperties: false })]))
630
+ }),
631
+ host("workspaces.remove", "/api/workspaces/{workspaceId}", "DELETE", ApiOkSchema)
632
+ ];
633
+ const AuthType = Union([Literal("api_key"), Literal("oauth")]);
634
+ const Provider = _Object_({
635
+ id: Text$3,
636
+ name: Text$3,
637
+ methods: _Array_(_Object_({
638
+ type: AuthType,
639
+ label: Text$3
640
+ })),
641
+ authenticated: Optional$2(_Object_({
642
+ type: AuthType,
643
+ source: Optional$2(Text$3)
644
+ }))
645
+ });
646
+ const LoginEvent = Union([
647
+ _Object_({
648
+ type: Literal("info"),
649
+ message: Text$3,
650
+ links: Optional$2(_Array_(_Object_({
651
+ url: Text$3,
652
+ label: Optional$2(Text$3)
653
+ })))
654
+ }),
655
+ _Object_({
656
+ type: Literal("auth_url"),
657
+ url: Text$3,
658
+ instructions: Optional$2(Text$3)
659
+ }),
660
+ _Object_({
661
+ type: Literal("device_code"),
662
+ userCode: Text$3,
663
+ verificationUri: Text$3,
664
+ intervalSeconds: Optional$2(NumberValue$2),
665
+ expiresInSeconds: Optional$2(NumberValue$2)
666
+ }),
667
+ _Object_({
668
+ type: Literal("progress"),
669
+ message: Text$3
670
+ })
671
+ ]);
672
+ const LoginFlowSchema = _Object_({
673
+ id: Text$3,
674
+ providerId: Text$3,
675
+ providerName: Text$3,
676
+ type: AuthType,
677
+ status: Union([
678
+ Literal("running"),
679
+ Literal("succeeded"),
680
+ Literal("failed"),
681
+ Literal("cancelled")
682
+ ]),
683
+ events: _Array_(LoginEvent),
684
+ prompt: Optional$2(_Object_({
685
+ id: Text$3,
686
+ type: Union([
687
+ Literal("text"),
688
+ Literal("secret"),
689
+ Literal("select"),
690
+ Literal("manual_code")
691
+ ]),
692
+ message: Text$3,
693
+ placeholder: Optional$2(Text$3),
694
+ options: Optional$2(_Array_(_Object_({
695
+ id: Text$3,
696
+ label: Text$3,
697
+ description: Optional$2(Text$3)
698
+ })))
699
+ })),
700
+ remote: Optional$2(Flag$2),
701
+ error: Optional$2(Text$3)
702
+ });
703
+ const Flow = _Object_({ flow: LoginFlowSchema });
704
+ const machineHttpContracts = [
705
+ host("providers.list", "/providers", "GET", _Object_({ providers: _Array_(Provider) })),
706
+ host("models.list", "/models", "GET", _Object_({ models: _Array_(_Object_({
707
+ value: Text$3,
708
+ label: Text$3,
709
+ group: Text$3
710
+ })) })),
711
+ host("providers.logout", "/providers/{providerId}", "DELETE", ApiOkSchema),
712
+ host("logins.create", "/logins", "POST", Flow, {
713
+ body: body(_Object_({
714
+ providerId: Text$3,
715
+ type: AuthType
716
+ })),
717
+ responses: jsonApiResponses(Flow, 201)
718
+ }),
719
+ host("logins.get", "/logins/{flowId}", "GET", Flow),
720
+ host("logins.cancel", "/logins/{flowId}", "DELETE", Flow),
721
+ host("logins.answer", "/logins/{flowId}/answer", "POST", Flow, { body: body(_Object_({
722
+ promptId: Text$3,
723
+ value: Text$3
724
+ })) })
725
+ ].map((route) => ({
726
+ ...route,
727
+ basePath: "po"
728
+ }));
729
+ const Source = Union([
730
+ Literal("extension"),
731
+ Literal("mcp"),
732
+ Literal("plugin"),
733
+ Literal("core")
734
+ ]);
735
+ const Detail = Union([
736
+ _Object_({
737
+ itemKind: Literal("tool"),
738
+ name: Text$3,
739
+ owner: Text$3,
740
+ source: Source,
741
+ active: Flag$2,
742
+ tokens: _Object_({
743
+ schemaTokens: NumberValue$2,
744
+ promptTokens: NumberValue$2,
745
+ totalTokens: NumberValue$2
746
+ }),
747
+ description: Optional$2(Text$3),
748
+ promptSnippet: Optional$2(Text$3),
749
+ promptGuidelines: Optional$2(Strings$1),
750
+ parameters: Optional$2(Json$4)
751
+ }),
752
+ _Object_({
753
+ itemKind: Literal("skill"),
754
+ name: Text$3,
755
+ owner: Text$3,
756
+ source: Source,
757
+ active: Literal(true),
758
+ tokens: NumberValue$2,
759
+ description: Text$3,
760
+ filePath: Optional$2(Text$3),
761
+ modelInvocable: Flag$2
762
+ }),
763
+ _Object_({
764
+ itemKind: Literal("prompt"),
765
+ name: Literal("system"),
766
+ tokens: NumberValue$2,
767
+ stage: Union([Literal("base"), Literal("effective")]),
768
+ text: Text$3
769
+ })
770
+ ]);
771
+ const sessionHttpContracts = [
772
+ {
773
+ ...host("context.current", CURRENT_ROUTE, "GET", _Object_({
774
+ version: Literal(1),
775
+ revision: NumberValue$2,
776
+ selection: _Object_({
777
+ preset: Text$3,
778
+ domains: Strings$1,
779
+ profile: Optional$2(Text$3)
780
+ }),
781
+ groups: _Array_(_Object_({
782
+ id: Text$3,
783
+ label: Text$3,
784
+ kind: Union([
785
+ Literal("preset"),
786
+ Literal("mode"),
787
+ Literal("domain"),
788
+ Literal("shared"),
789
+ Literal("core")
790
+ ]),
791
+ items: _Array_(_Object_({
792
+ name: Text$3,
793
+ itemKind: Union([Literal("tool"), Literal("skill")]),
794
+ source: Source,
795
+ owner: Text$3,
796
+ tokens: NumberValue$2,
797
+ active: Flag$2
798
+ })),
799
+ tokens: NumberValue$2,
800
+ inactiveTokens: NumberValue$2
801
+ })),
802
+ totalTokens: NumberValue$2,
803
+ inactiveTokens: NumberValue$2,
804
+ systemPrompt: Optional$2(_Object_({
805
+ tokens: NumberValue$2,
806
+ stage: Union([Literal("base"), Literal("effective")])
807
+ })),
808
+ estimator: Literal("gpt-tokenizer")
809
+ })),
810
+ scope: "session",
811
+ basePath: API_BASE_PATH
812
+ },
813
+ {
814
+ ...host("context.item", ITEM_ROUTE, "GET", _Object_({
815
+ revision: NumberValue$2,
816
+ item: Detail
817
+ }), { parameters: [query("kind", Union([
818
+ Literal("tool"),
819
+ Literal("skill"),
820
+ Literal("prompt")
821
+ ]), true), query("name", Text$3, true)] }),
822
+ scope: "session",
823
+ basePath: API_BASE_PATH
824
+ },
825
+ {
826
+ ...host("files.complete", "/", "GET", _Object_({ files: Strings$1 }), { parameters: [query("q", String({ maxLength: 256 }))] }),
827
+ scope: "session",
828
+ basePath: "files"
829
+ }
830
+ ];
831
+ //#endregion
832
+ //#region ../../core/po-core/src/schemas/pluginMarketplace.ts
833
+ const PluginInstallRequestSchema = _Object_({
834
+ layer: String({ minLength: 1 }),
835
+ scope: String({ pattern: "^(host|workspace:[^/]+)$" }),
836
+ name: String(),
837
+ expectedHash: String()
838
+ }, { additionalProperties: false });
839
+ const PluginInstallOperationSchema = _Object_({
840
+ id: String(),
841
+ layer: String(),
842
+ state: Union([
843
+ Literal("queued"),
844
+ Literal("installing"),
845
+ Literal("verifying"),
846
+ Literal("committing"),
847
+ Literal("reconciling"),
848
+ Literal("succeeded"),
849
+ Literal("failed"),
850
+ Literal("cancelled")
851
+ ]),
852
+ membershipCommitted: Boolean(),
853
+ error: Optional$3(String()),
854
+ conflict: Optional$3(Literal(true)),
855
+ clash: Optional$3(_Object_({
856
+ preset: String(),
857
+ installedVersion: String(),
858
+ wantedVersion: String()
859
+ })),
860
+ rollbackError: Optional$3(String())
861
+ });
862
+ const pluginMarketplaceHttpContracts = [
863
+ {
864
+ id: "marketplace.catalog",
865
+ scope: "host",
866
+ basePath: "marketplace",
867
+ path: "/catalog",
868
+ method: "GET",
869
+ description: "Read curated layers and runtime availability without exposing install targets.",
870
+ authentication: "owner",
871
+ responses: jsonApiResponses(_Object_({
872
+ supportedScopes: Optional$3(_Array_(Union([Literal("host"), Literal("workspace")]))),
873
+ layers: _Array_(_Object_({
874
+ id: String(),
875
+ name: String(),
876
+ description: String(),
877
+ category: String(),
878
+ icon: String(),
879
+ logo: Optional$3(String()),
880
+ publisher: String(),
881
+ tier: Union([
882
+ Literal("core"),
883
+ Literal("foundation"),
884
+ Literal("default"),
885
+ Literal("mode"),
886
+ Literal("plugin")
887
+ ]),
888
+ packages: _Array_(String()),
889
+ installable: Boolean(),
890
+ installed: Boolean(),
891
+ version: Optional$3(String())
892
+ }))
893
+ }))
894
+ },
895
+ {
896
+ id: "marketplace.install",
897
+ scope: "host",
898
+ basePath: "marketplace",
899
+ path: "/installs",
900
+ method: "POST",
901
+ description: "Install a server-curated layer and commit its preset membership.",
902
+ authentication: "owner",
903
+ body: {
904
+ contentType: "application/json",
905
+ required: true,
906
+ schema: PluginInstallRequestSchema
907
+ },
908
+ responses: jsonApiResponses(PluginInstallOperationSchema, 202)
909
+ },
910
+ ...["GET", "DELETE"].map((method) => ({
911
+ id: method === "GET" ? "marketplace.status" : "marketplace.cancel",
912
+ scope: "host",
913
+ basePath: "marketplace",
914
+ path: "/installs/{id}",
915
+ method,
916
+ authentication: "owner",
917
+ description: method === "GET" ? "Read an install result." : "Cancel before membership is committed.",
918
+ parameters: [{
919
+ name: "id",
920
+ in: "path",
921
+ required: true,
922
+ schema: String()
923
+ }],
924
+ responses: jsonApiResponses(PluginInstallOperationSchema)
925
+ }))
926
+ ];
927
+ //#endregion
928
+ //#region ../../core/po-core/src/schemas/remoteApiContracts.ts
929
+ const Text$2 = String();
930
+ const NumberValue$1 = Number$1();
931
+ const Optional$1 = Optional$3;
932
+ const Flag$1 = Boolean();
933
+ const JsonObject = Record(Text$2, Unknown({ description: "WebAuthn ceremony fields supplied and verified by the installed WebAuthn implementation." }));
934
+ const Tunnel = Union([_Object_({ kind: Literal("quick") }), _Object_({
935
+ kind: Literal("named"),
936
+ hostname: Text$2,
937
+ name: Optional$1(Text$2),
938
+ tokenFile: Optional$1(Text$2),
939
+ configFile: Optional$1(Text$2)
940
+ })]);
941
+ const Settings = _Object_({
942
+ autoCloseEnabled: Flag$1,
943
+ autoCloseMinutes: NumberValue$1,
944
+ sessionExpiryEnabled: Flag$1,
945
+ idleMinutes: NumberValue$1,
946
+ absoluteHours: NumberValue$1,
947
+ tunnel: Tunnel
948
+ });
949
+ const State = _Object_({
950
+ status: Union([
951
+ Literal("off"),
952
+ Literal("starting"),
953
+ Literal("on"),
954
+ Literal("failed")
955
+ ]),
956
+ publicUrl: Optional$1(Text$2),
957
+ startedAt: Optional$1(Text$2),
958
+ closesAt: Optional$1(Text$2),
959
+ error: Optional$1(Text$2),
960
+ devices: _Array_(_Object_({
961
+ id: Text$2,
962
+ label: Text$2,
963
+ userAgent: Text$2,
964
+ createdAt: Text$2,
965
+ lastSeenAt: Text$2,
966
+ self: Flag$1
967
+ })),
968
+ pending: _Array_(_Object_({
969
+ id: Text$2,
970
+ userAgent: Text$2,
971
+ edgeIp: Text$2,
972
+ createdAt: Text$2,
973
+ expiresAt: Text$2
974
+ })),
975
+ trustedDevices: _Array_(_Object_({
976
+ id: Text$2,
977
+ label: Text$2,
978
+ platform: Union([Literal("ios"), Literal("android")]),
979
+ createdAt: Text$2,
980
+ lastSeenAt: Text$2,
981
+ self: Flag$1
982
+ })),
983
+ settings: Settings
984
+ });
985
+ const StateResponse = _Object_({ state: State });
986
+ const Trust = _Object_({
987
+ publicKey: Text$2,
988
+ fingerprint: Text$2,
989
+ revision: NumberValue$1
990
+ });
991
+ const Begun = _Object_({
992
+ ceremonyId: Text$2,
993
+ options: JsonObject
994
+ });
995
+ const DeviceKeyBegun = _Object_({
996
+ ceremonyId: Text$2,
997
+ challenge: Text$2,
998
+ kind: Literal("device-key")
999
+ });
1000
+ const ChannelKeys = _Object_({
1001
+ session: Text$2,
1002
+ protocol: Text$2,
1003
+ http: Text$2
1004
+ });
1005
+ const Finish = _Object_({
1006
+ ceremonyId: Text$2,
1007
+ response: JsonObject
1008
+ });
1009
+ const SealedEnvelopeSchema = _Object_({
1010
+ v: Literal(1),
1011
+ n: Text$2,
1012
+ c: Text$2
1013
+ });
1014
+ _Object_({
1015
+ v: Literal(1),
1016
+ method: Text$2,
1017
+ target: Text$2,
1018
+ headers: _Array_(Tuple([Text$2, Text$2])),
1019
+ body: Optional$1(Text$2)
1020
+ });
1021
+ _Object_({
1022
+ v: Literal(1),
1023
+ status: NumberValue$1,
1024
+ headers: _Array_(Tuple([Text$2, Text$2])),
1025
+ body: Text$2
1026
+ });
1027
+ const route = (id, path, method, result, input, extra = {}) => ({
1028
+ id: `remote.${id}`,
1029
+ path: `/api/remote${path}`,
1030
+ method,
1031
+ scope: "host",
1032
+ authentication: "owner",
1033
+ description: `Remote Control ${id}.`,
1034
+ availability: "Global host provides Remote Control. Tunnel routes additionally enforce device, origin and step-up policy.",
1035
+ responses: {
1036
+ ...jsonApiResponses(result),
1037
+ "429": {
1038
+ description: "Rate limit exceeded",
1039
+ schema: ApiErrorSchema
1040
+ }
1041
+ },
1042
+ ...input ? { body: {
1043
+ contentType: "application/json",
1044
+ required: true,
1045
+ schema: input
1046
+ } } : {},
1047
+ ...extra
1048
+ });
1049
+ const direct = [
1050
+ route("state", "", "GET", StateResponse),
1051
+ route("enable", "/enable", "POST", StateResponse),
1052
+ route("disable", "/disable", "POST", StateResponse, void 0, { responses: {
1053
+ ...jsonApiResponses(StateResponse),
1054
+ "202": {
1055
+ description: "Tunnel closing",
1056
+ schema: _Object_({ status: Literal("closing") })
1057
+ }
1058
+ } }),
1059
+ route("codes", "/codes", "POST", _Object_({
1060
+ ...Trust.properties,
1061
+ code: Text$2,
1062
+ manualCode: Text$2,
1063
+ pairUrl: Text$2,
1064
+ expiresAt: Text$2
1065
+ }), void 0, { responses: jsonApiResponses(_Object_({
1066
+ ...Trust.properties,
1067
+ code: Text$2,
1068
+ manualCode: Text$2,
1069
+ pairUrl: Text$2,
1070
+ expiresAt: Text$2
1071
+ }), 201) }),
1072
+ route("approve", "/pairing/{id}/approve", "POST", StateResponse),
1073
+ route("deny", "/pairing/{id}/deny", "POST", StateResponse),
1074
+ route("revoke", "/devices/{id}", "DELETE", StateResponse),
1075
+ route("settings", "/settings", "PUT", _Object_({ settings: Settings }), Partial(Settings)),
1076
+ route("passkeys", "/passkeys", "GET", _Object_({
1077
+ support: Union([_Object_({
1078
+ supported: Literal(true),
1079
+ rpId: Text$2
1080
+ }), _Object_({
1081
+ supported: Literal(false),
1082
+ reason: Text$2
1083
+ })]),
1084
+ credentials: _Array_(_Object_({
1085
+ id: Text$2,
1086
+ label: Text$2,
1087
+ createdAt: Text$2,
1088
+ lastUsedAt: Text$2
1089
+ }))
1090
+ })),
1091
+ route("passkeys.remove", "/passkeys/{id}", "DELETE", ApiOkSchema),
1092
+ route("register.begin", "/passkeys/register/begin", "POST", Begun, void 0, { authentication: "device" }),
1093
+ route("register.finish", "/passkeys/register/finish", "POST", _Object_({ id: Text$2 }), Finish, { authentication: "device" }),
1094
+ route("authenticate.begin", "/passkeys/authenticate/begin", "POST", Begun, void 0, { authentication: "none" }),
1095
+ route("authenticate.finish", "/passkeys/authenticate/finish", "POST", _Object_({
1096
+ ok: Literal(true),
1097
+ hostPublicKey: Text$2
1098
+ }), Finish, { authentication: "none" }),
1099
+ route("challenge", "/challenge", "POST", Union([Begun, DeviceKeyBegun]), _Object_({ action: Text$2 }), { authentication: "device" }),
1100
+ route("trusted-devices.register", "/trusted-devices", "POST", _Object_({ trustedDeviceId: Text$2 }), _Object_({
1101
+ identityPublicKey: Text$2,
1102
+ stepUpPublicKey: Text$2,
1103
+ label: Text$2,
1104
+ platform: Union([Literal("ios"), Literal("android")]),
1105
+ identityProof: Text$2,
1106
+ stepUpProof: Text$2
1107
+ }), {
1108
+ authentication: "device",
1109
+ description: "Registers a native device from a sealed, QR-approved pairing session.",
1110
+ responses: jsonApiResponses(_Object_({ trustedDeviceId: Text$2 }), 201)
1111
+ }),
1112
+ route("trusted-devices.revoke", "/trusted-devices/{id}", "DELETE", StateResponse, void 0, { description: "Revokes a trusted native device. Local callers, or sealed callers with verified step-up." }),
1113
+ route("device-auth.challenge", "/device-auth/challenge", "POST", _Object_({
1114
+ challengeId: Text$2,
1115
+ challenge: Text$2,
1116
+ hostPublicKey: Text$2,
1117
+ attestation: Text$2
1118
+ }), _Object_({
1119
+ trustedDeviceId: Text$2,
1120
+ nonce: Text$2
1121
+ }), { authentication: "none" }),
1122
+ route("device-auth.authenticate", "/device-auth/authenticate", "POST", _Object_({ ok: Literal(true) }), _Object_({
1123
+ challengeId: Text$2,
1124
+ trustedDeviceId: Text$2,
1125
+ signature: Text$2,
1126
+ channels: ChannelKeys
1127
+ }), { authentication: "none" }),
1128
+ route("channel", "/channel", "POST", ApiOkSchema, _Object_({
1129
+ clientPublicKey: Text$2,
1130
+ scope: Union([
1131
+ Literal("session"),
1132
+ Literal("protocol"),
1133
+ Literal("http")
1134
+ ])
1135
+ }), { authentication: "device" }),
1136
+ route("request", "/request", "POST", SealedEnvelopeSchema, SealedEnvelopeSchema, {
1137
+ authentication: "device",
1138
+ description: "Sealed HTTP gateway. Decrypted requests/responses use the SealedHttpRequest and SealedHttpResponse envelopes."
1139
+ }),
1140
+ route("pair", "/pair", "POST", _Object_({
1141
+ requestId: Text$2,
1142
+ status: Literal("pending")
1143
+ }), _Object_({ code: String({ minLength: 1 }) }), {
1144
+ authentication: "none",
1145
+ responses: {
1146
+ ...jsonApiResponses(_Object_({
1147
+ requestId: Text$2,
1148
+ status: Literal("pending")
1149
+ }), 202),
1150
+ "410": {
1151
+ description: "Pairing code is no longer valid",
1152
+ schema: ApiErrorSchema
1153
+ }
1154
+ }
1155
+ }),
1156
+ route("pair.status", "/pair/status", "GET", _Object_({
1157
+ status: Union([
1158
+ Literal("pending"),
1159
+ Literal("approved"),
1160
+ Literal("denied"),
1161
+ Literal("expired"),
1162
+ Literal("consumed")
1163
+ ]),
1164
+ bundleTrust: Optional$1(Trust),
1165
+ hostPublicKey: Optional$1(Text$2)
1166
+ }), void 0, {
1167
+ authentication: "none",
1168
+ parameters: [{
1169
+ name: "request",
1170
+ in: "query",
1171
+ required: true,
1172
+ schema: Text$2
1173
+ }]
1174
+ })
1175
+ ];
1176
+ const remoteHttpContracts = [
1177
+ route("frontend", "/frontend", "POST", ApiOkSchema, _Object_({ origin: Text$2 }), {
1178
+ authentication: "owner",
1179
+ availability: "Internal loopback frontend registration; blocked by the browser proxy.",
1180
+ parameters: [{
1181
+ name: "x-po-web-registration",
1182
+ in: "header",
1183
+ required: true,
1184
+ schema: Text$2
1185
+ }]
1186
+ }),
1187
+ ...direct,
1188
+ ...direct.map((operation) => ({
1189
+ ...operation,
1190
+ id: `${operation.id}.plugin`,
1191
+ basePath: "remote",
1192
+ path: operation.path.slice(11) || "/",
1193
+ authentication: "owner",
1194
+ availability: "Global Remote Control plugin mount, reached through the authenticated headless listener."
1195
+ })),
1196
+ {
1197
+ id: "remote.pair.page",
1198
+ scope: "host",
1199
+ path: "/pair",
1200
+ method: "GET",
1201
+ authentication: "none",
1202
+ availability: "Remote listener only",
1203
+ description: "Pairing and passkey bootstrap page.",
1204
+ responses: { "200": {
1205
+ description: "Pairing page",
1206
+ contentType: "text/html",
1207
+ schema: Text$2
1208
+ } }
1209
+ }
1210
+ ];
1211
+ const Asset = _Object_({
1212
+ path: Text$2,
1213
+ sha256: String({ pattern: "^[a-f0-9]{64}$" }),
1214
+ byteLength: Integer({ minimum: 0 }),
1215
+ contentType: Text$2
1216
+ });
1217
+ const Signed = _Object_({
1218
+ manifest: _Object_({
1219
+ version: Literal(2),
1220
+ revision: Integer({ minimum: 1 }),
1221
+ builtAt: NumberValue$1,
1222
+ assets: _Array_(Asset)
1223
+ }),
1224
+ signature: Text$2,
1225
+ publicKey: Text$2
1226
+ });
1227
+ const bundleHttpContracts = [...["/bundle-manifest.json", "/api/web-plugins/{id}/{revision}/manifest"].flatMap((path) => ["GET", "HEAD"].map((method) => ({
1228
+ id: `bundle.${path}.${method}`,
1229
+ scope: "host",
1230
+ path,
1231
+ method,
1232
+ authentication: "owner",
1233
+ availability: "Host publishes a web bundle",
1234
+ description: "Read an immutable signed browser bundle manifest.",
1235
+ responses: method === "HEAD" ? {
1236
+ "200": { description: "Manifest response headers" },
1237
+ "404": { description: "Bundle not published" }
1238
+ } : jsonApiResponses(Signed)
1239
+ }))), ...["/bundle-assets/{revision}/{assetPath}", "/api/web-plugins/{id}/{revision}/assets/{assetPath}"].flatMap((path) => ["GET", "HEAD"].map((method) => ({
1240
+ id: `asset.${path}.${method}`,
1241
+ scope: "host",
1242
+ path,
1243
+ method,
1244
+ authentication: "owner",
1245
+ availability: "Host publishes a web bundle",
1246
+ description: "Read an asset from the signed manifest. assetPath may contain multiple path segments.",
1247
+ responses: {
1248
+ "200": {
1249
+ description: "Manifest-listed asset, original MIME type",
1250
+ ...method === "GET" ? {
1251
+ contentType: "*/*",
1252
+ schema: String({ contentEncoding: "binary" })
1253
+ } : {}
1254
+ },
1255
+ "404": { description: "Asset not published" }
1256
+ }
1257
+ })))];
1258
+ //#endregion
1259
+ //#region ../../core/po-core/src/schemas/protocolChannelsContract.ts
1260
+ const Json$3 = Unsafe({});
1261
+ const ChannelFrameSchema = _Object_({
1262
+ type: String({ minLength: 1 }),
1263
+ payload: Json$3
1264
+ });
1265
+ /** Latest payload per extension channel frame type. */
1266
+ const PoChannelsStateSchema = Record(String(), Json$3);
1267
+ /** A session's extension channels as seen by one connection. */
1268
+ const PoChannelsContract = definePoContract("po.channels", {
1269
+ version: 1,
1270
+ params: { sessionId: String({ minLength: 1 }) },
1271
+ state: { latest: PoChannelsStateSchema },
1272
+ methods: { receive: { args: ChannelFrameSchema } }
1273
+ });
1274
+ //#endregion
1275
+ //#region ../../core/po-core/src/schemas/protocolHubContract.ts
1276
+ const Text$1 = String();
1277
+ const Json$2 = Unsafe({});
1278
+ /** A live session frame every hub client needs (notification entries and agent dialogs) until it is acknowledged. */
1279
+ const HubNoticeSchema = _Object_({
1280
+ id: Text$1,
1281
+ sessionId: Text$1,
1282
+ frame: Record(Text$1, Json$2)
1283
+ });
1284
+ /** Native UI delivery metadata is HTTP-only; adding it must not refuse existing po.hub@1 clients. */
1285
+ const HubSessionSchema = _Object_({
1286
+ ...SessionSummarySchema.properties,
1287
+ nativeComposition: Optional$3(Omit(NativeCompositionSchema, ["uiEntry"]))
1288
+ });
1289
+ /** Instructions are HTTP-only so existing po.hub@1 clients keep the same wire contract. */
1290
+ const HubWorkspaceSchema = Omit(WorkspaceSchema, ["instructions"]);
1291
+ /** Per shared mount (`global`, `workspace:<id>`), a counter that rises when its plugin composition changes. */
1292
+ const HubCompositionsSchema = Record(Text$1, Integer({ minimum: 0 }));
1293
+ const HubState = {
1294
+ sessions: Record(Text$1, HubSessionSchema),
1295
+ workspaces: Record(Text$1, HubWorkspaceSchema),
1296
+ pending: _Array_(HubNoticeSchema),
1297
+ compositions: HubCompositionsSchema
1298
+ };
1299
+ const PoHubStateSchema = _Object_(HubState);
1300
+ /** What one connection may see: its sessions, its workspaces, and the notices it has not acknowledged. */
1301
+ const PoHubContract = definePoContract("po.hub", {
1302
+ version: 1,
1303
+ params: {},
1304
+ state: HubState,
1305
+ methods: {
1306
+ readHome: {
1307
+ args: _Object_({
1308
+ offset: Optional$3(Integer({ minimum: 0 })),
1309
+ limit: Optional$3(Integer({ minimum: 1 })),
1310
+ source: Optional$3(Text$1),
1311
+ workspaceId: Optional$3(Text$1)
1312
+ }),
1313
+ result: Unsafe({})
1314
+ },
1315
+ invoke: {
1316
+ args: PoPluginWireCallSchema,
1317
+ result: Json$2
1318
+ },
1319
+ ackNotice: { args: _Object_({ id: Text$1 }) }
1320
+ }
1321
+ });
1322
+ /**
1323
+ * Per topic (`global:<name>` on the wire for the host, `workspace:<id>:<name>`), a counter the host raises when that data changes, so a
1324
+ * client fetches it again instead of polling. A separate contract: a host without it leaves clients on
1325
+ * fetch-on-open rather than refusing the whole hub as out of date.
1326
+ */
1327
+ const HubRevisionsSchema = Record(Text$1, Integer({ minimum: 0 }));
1328
+ const PoHubRevisionsContract = definePoContract("po.hub.revisions", {
1329
+ version: 1,
1330
+ params: {},
1331
+ state: { revisions: HubRevisionsSchema },
1332
+ methods: {}
1333
+ });
1334
+ /** Caller-specific UI permissions. Separate so existing po.hub@1 schemas remain unchanged. */
1335
+ const PoHubAccessContract = definePoContract("po.hub.access", {
1336
+ version: 1,
1337
+ params: {},
1338
+ state: { interact: Record(Text$1, Boolean()) },
1339
+ methods: {}
1340
+ });
1341
+ //#endregion
1342
+ //#region ../../core/po-core/src/schemas/protocolThreadContract.ts
1343
+ /** The thread's latest frame: `transcript_state` while its child runs, `transcript_ready` once it has finished. */
1344
+ const PoThreadFrameSchema = Union([Null(), Intersect([_Object_({ type: String() }), Record(String(), Unsafe({}))])]);
1345
+ /** One child thread of a session, followed only while someone holds it. */
1346
+ const PoThreadContract = definePoContract("po.thread", {
1347
+ version: 1,
1348
+ params: {
1349
+ sessionId: String({ minLength: 1 }),
1350
+ threadId: String({ minLength: 1 })
1351
+ },
1352
+ state: { frame: PoThreadFrameSchema },
1353
+ methods: {}
1354
+ });
1355
+ //#endregion
1356
+ //#region ../../core/po-core/src/schemas/sessionApiContracts.ts
1357
+ const Text = String();
1358
+ const NumberValue = Number$1();
1359
+ const Flag = Boolean();
1360
+ const Json$1 = Unsafe(Unknown({ description: "Strict JSON application value supplied by the active tool, journal entry, or extension; validated by the Pi codec." }));
1361
+ const Optional = Optional$3;
1362
+ const Strings = _Array_(Text);
1363
+ const Model = _Object_({
1364
+ provider: Text,
1365
+ id: Text
1366
+ });
1367
+ const Thinking = Union([
1368
+ Literal("off"),
1369
+ Literal("minimal"),
1370
+ Literal("low"),
1371
+ Literal("medium"),
1372
+ Literal("high"),
1373
+ Literal("max"),
1374
+ Literal("xhigh")
1375
+ ]);
1376
+ const Phase = Union([
1377
+ Literal("idle"),
1378
+ Literal("turn"),
1379
+ Literal("compaction"),
1380
+ Literal("retry")
1381
+ ]);
1382
+ const Image = _Object_({
1383
+ type: Literal("image"),
1384
+ data: Text,
1385
+ mimeType: Text
1386
+ });
1387
+ const TextPart = _Object_({
1388
+ type: Literal("text"),
1389
+ text: Text
1390
+ });
1391
+ const ThinkingPart = _Object_({
1392
+ type: Literal("thinking"),
1393
+ thinking: Text,
1394
+ redacted: Optional(Literal(true))
1395
+ });
1396
+ const Content = Union([Image, TextPart]);
1397
+ const Usage = _Object_({
1398
+ input: NumberValue,
1399
+ output: NumberValue,
1400
+ cacheRead: NumberValue,
1401
+ cacheWrite: NumberValue,
1402
+ total: NumberValue
1403
+ });
1404
+ /** `timeZone` is the sender's device IANA zone; additive and optional so older clients and hosts still agree. */
1405
+ const Message = _Object_({
1406
+ text: Text,
1407
+ images: Optional(_Array_(Image)),
1408
+ timeZone: Optional(Text)
1409
+ });
1410
+ const Lifecycle = _Object_({
1411
+ revision: NumberValue,
1412
+ operation: Union([Null(), _Object_({
1413
+ id: Text,
1414
+ kind: Union([
1415
+ Literal("run"),
1416
+ Literal("compaction"),
1417
+ Literal("navigation")
1418
+ ]),
1419
+ status: Union([Literal("open"), Literal("aborting")])
1420
+ })]),
1421
+ paused: Flag,
1422
+ queue: _Array_(_Object_({
1423
+ id: Text,
1424
+ text: Text,
1425
+ images: Optional(_Array_(Image)),
1426
+ delivery: Union([
1427
+ Literal("steer"),
1428
+ Literal("followUp"),
1429
+ Literal("nextRun")
1430
+ ]),
1431
+ scheduling: Union([Literal("automatic"), Literal("held")]),
1432
+ disposition: Union([Literal("pending"), Literal("handoff")])
1433
+ }))
1434
+ });
1435
+ const Frame = Intersect([_Object_({ type: Text }), Record(Text, Json$1)], { description: "Discriminated extension presentation frame; selected channel schemas describe package payloads." });
1436
+ const ProtocolEvent = _Object_({
1437
+ sequence: NumberValue,
1438
+ frame: Frame
1439
+ });
1440
+ const SessionServiceStateSchema = _Object_({
1441
+ snapshot: _Object_({
1442
+ fastMode: Flag,
1443
+ locked: Flag,
1444
+ lifecycle: Optional(Lifecycle)
1445
+ }),
1446
+ presentation: Optional(_Object_({
1447
+ revision: NumberValue,
1448
+ dropped: NumberValue,
1449
+ resetRevision: Optional(NumberValue),
1450
+ events: _Array_(ProtocolEvent),
1451
+ projections: _Array_(ProtocolEvent)
1452
+ })),
1453
+ live: Optional(_Object_({
1454
+ phase: Phase,
1455
+ message: Optional(_Object_({
1456
+ role: Literal("assistant"),
1457
+ content: _Array_(Union([TextPart, ThinkingPart])),
1458
+ model: Text,
1459
+ timestamp: NumberValue
1460
+ })),
1461
+ tools: Record(Text, _Object_({
1462
+ toolCallId: Text,
1463
+ toolName: Text,
1464
+ args: Json$1,
1465
+ partialResult: Optional(_Object_({
1466
+ content: _Array_(Content),
1467
+ details: Optional(Json$1)
1468
+ }))
1469
+ }))
1470
+ }))
1471
+ });
1472
+ /** Argument and result schemas of the `po.session` methods; the protocol contract and the API docs both read them. */
1473
+ const SessionMethodSchemas = {
1474
+ readTranscriptPage: {
1475
+ args: _Object_({
1476
+ cursor: Optional(Text),
1477
+ direction: Optional(Union([Literal("older"), Literal("newer")])),
1478
+ limit: Optional(NumberValue),
1479
+ threadId: Optional(Text),
1480
+ entryId: Optional(Text)
1481
+ }),
1482
+ result: _Object_({
1483
+ entries: _Array_(Json$1),
1484
+ startCursor: Union([Text, Null()]),
1485
+ endCursor: Union([Text, Null()]),
1486
+ olderCursor: Union([Text, Null()]),
1487
+ newerCursor: Union([Text, Null()]),
1488
+ generation: NumberValue,
1489
+ revision: NumberValue,
1490
+ context: _Array_(Json$1)
1491
+ })
1492
+ },
1493
+ prompt: { args: Union([Text, _Object_({
1494
+ ...Message.properties,
1495
+ waitFor: Optional(Union([Literal("accepted"), Literal("settled")]))
1496
+ })]) },
1497
+ steer: { args: Union([Text, Message]) },
1498
+ abort: {},
1499
+ abortOperation: { args: _Object_({ operationId: Text }) },
1500
+ setModel: { args: Model },
1501
+ setThinking: { args: Thinking },
1502
+ setFastMode: { args: Flag },
1503
+ setAgentLock: { args: Flag },
1504
+ followUp: { args: Message },
1505
+ enqueueAutomatic: {
1506
+ args: Message,
1507
+ result: _Object_({ id: Text })
1508
+ },
1509
+ removeQueued: {
1510
+ args: _Object_({ id: Text }),
1511
+ result: Union([
1512
+ Literal("removed"),
1513
+ Literal("in_flight"),
1514
+ Literal("already_consumed"),
1515
+ Literal("not_found")
1516
+ ])
1517
+ },
1518
+ promoteQueued: {
1519
+ args: _Object_({
1520
+ id: Text,
1521
+ operationId: Optional(Text)
1522
+ }),
1523
+ result: Union([
1524
+ Literal("promoted"),
1525
+ Literal("in_flight"),
1526
+ Literal("target_changed"),
1527
+ Literal("not_found")
1528
+ ])
1529
+ },
1530
+ resumeQueue: {},
1531
+ clearQueue: { result: _Object_({
1532
+ steering: Strings,
1533
+ followUp: Strings
1534
+ }) },
1535
+ rewind: {
1536
+ args: _Object_({
1537
+ itemId: Text,
1538
+ summarize: Optional(Flag),
1539
+ customInstructions: Optional(Text),
1540
+ replaceInstructions: Optional(Flag),
1541
+ label: Optional(Text)
1542
+ }),
1543
+ result: _Object_({
1544
+ editorText: Optional(Text),
1545
+ cancelled: Flag,
1546
+ aborted: Optional(Flag),
1547
+ summaryEntry: Optional(_Object_({
1548
+ id: Text,
1549
+ parentId: Union([Text, Null()]),
1550
+ timestamp: Text,
1551
+ fromId: Text,
1552
+ summary: Text,
1553
+ details: Optional(Json$1),
1554
+ usage: Optional(Usage),
1555
+ fromHook: Optional(Flag)
1556
+ }))
1557
+ })
1558
+ },
1559
+ extensionUiResponse: { args: Union([
1560
+ _Object_({
1561
+ id: Text,
1562
+ value: Text
1563
+ }),
1564
+ _Object_({
1565
+ id: Text,
1566
+ confirmed: Flag
1567
+ }),
1568
+ _Object_({
1569
+ id: Text,
1570
+ cancelled: Literal(true)
1571
+ })
1572
+ ]) },
1573
+ getState: { result: _Object_({
1574
+ model: Optional(Model),
1575
+ thinkingLevel: Thinking,
1576
+ fastMode: Flag,
1577
+ agentLocked: Optional(Flag),
1578
+ isStreaming: Flag,
1579
+ isCompacting: Flag,
1580
+ steeringMode: Union([Literal("all"), Literal("one-at-a-time")]),
1581
+ followUpMode: Union([Literal("all"), Literal("one-at-a-time")]),
1582
+ sessionId: Text,
1583
+ sessionName: Optional(Text),
1584
+ autoCompactionEnabled: Flag,
1585
+ messageCount: NumberValue,
1586
+ pendingMessageCount: NumberValue,
1587
+ operationId: Optional(Text),
1588
+ executionStatus: Optional(Union([Literal("open"), Literal("aborting")])),
1589
+ queuePaused: Optional(Flag),
1590
+ queueRevision: Optional(NumberValue)
1591
+ }) },
1592
+ getSessionStats: { result: _Object_({
1593
+ sessionId: Text,
1594
+ totalMessages: NumberValue,
1595
+ tokens: Usage,
1596
+ cost: NumberValue,
1597
+ contextUsage: Optional(_Object_({
1598
+ tokens: Union([NumberValue, Null()]),
1599
+ contextWindow: NumberValue,
1600
+ percent: Union([NumberValue, Null()])
1601
+ }))
1602
+ }) },
1603
+ getCommands: { result: _Array_(_Object_({
1604
+ name: Text,
1605
+ description: Optional(Text),
1606
+ source: Union([
1607
+ Literal("extension"),
1608
+ Literal("prompt"),
1609
+ Literal("skill")
1610
+ ]),
1611
+ sourceInfo: Optional(_Object_({
1612
+ path: Text,
1613
+ source: Text,
1614
+ scope: Union([
1615
+ Literal("user"),
1616
+ Literal("project"),
1617
+ Literal("temporary")
1618
+ ]),
1619
+ origin: Union([Literal("package"), Literal("top-level")]),
1620
+ baseDir: Optional(Text)
1621
+ }))
1622
+ })) },
1623
+ getAvailableModels: { result: _Array_(Model) },
1624
+ getAvailableThinkingLevels: { result: _Array_(Thinking) },
1625
+ compact: {
1626
+ args: _Object_({
1627
+ customInstructions: Optional(Text),
1628
+ clear: Optional(Flag)
1629
+ }),
1630
+ result: Json$1
1631
+ },
1632
+ setName: { args: Text },
1633
+ setGroups: { args: _Array_(Text) }
1634
+ };
1635
+ const ErrorSchema = _Object_({
1636
+ code: Text,
1637
+ message: Text
1638
+ });
1639
+ const documented = (id, service, member, direction, input, description) => ({
1640
+ id,
1641
+ scope: service === "po.hub" ? "host" : "session",
1642
+ service,
1643
+ member,
1644
+ direction,
1645
+ kind: direction === "server-to-client" ? "state" : "method",
1646
+ input,
1647
+ ...direction === "server-to-client" ? {} : { errors: ErrorSchema },
1648
+ description
1649
+ });
1650
+ const sessionSocketContracts = [
1651
+ ...Object.entries(SessionMethodSchemas).map(([member, { args, result }]) => ({
1652
+ id: `session.${member}`,
1653
+ scope: "session",
1654
+ service: "po.session",
1655
+ member,
1656
+ direction: "client-to-server",
1657
+ kind: "method",
1658
+ description: `Session ${member}. The protocol call carries the argument; a void result is null.`,
1659
+ input: Tuple(args === void 0 ? [] : [args]),
1660
+ ...result === void 0 ? {} : { output: result },
1661
+ errors: ErrorSchema
1662
+ })),
1663
+ documented("session.state", "po.session", "state", "server-to-client", SessionServiceStateSchema, "The `state` member of `po.session`, as the Po protocol client follows it."),
1664
+ documented("hub.state", "po.hub", "state", "server-to-client", PoHubStateSchema, "Sessions and workspaces this connection may see, and notices it has not acknowledged."),
1665
+ documented("thread.frame", "po.thread", "frame", "server-to-client", PoThreadFrameSchema, "The latest frame of one child thread: transcript_state while it runs, transcript_ready once finished."),
1666
+ documented("channels.latest", "po.channels", "latest", "server-to-client", PoChannelsStateSchema, "The latest payload of each extension channel frame type for one session."),
1667
+ documented("channels.receive", "po.channels", "receive", "client-to-server", Tuple([ChannelFrameSchema]), "Send one extension channel frame to the session.")
1668
+ ];
1669
+ const Json = Unknown({ description: "JSON value; its application shape is defined by the addressed contract member." });
1670
+ const WireError = _Object_({
1671
+ code: String(),
1672
+ message: String(),
1673
+ reason: Optional$3(String())
1674
+ });
1675
+ const ProtocolMessage = _Array_(Unknown(), { description: `A Chord 1.5 link message: one JSON array per text message. Its format is Chord's.` });
1676
+ const transportSocketContracts = [
1677
+ {
1678
+ id: "chord.client",
1679
+ scope: "host",
1680
+ service: "$chord",
1681
+ member: "client",
1682
+ direction: "client-to-server",
1683
+ kind: "channel",
1684
+ input: ProtocolMessage,
1685
+ description: "Protocol message from a client, sealed for remote delivery. Hold `po.hub` ({}) and `po.session` ({ sessionId }) through the Po protocol client."
1686
+ },
1687
+ {
1688
+ id: "chord.server",
1689
+ scope: "host",
1690
+ service: "$chord",
1691
+ member: "server",
1692
+ direction: "server-to-client",
1693
+ kind: "channel",
1694
+ input: ProtocolMessage,
1695
+ description: "Protocol message from the server."
1696
+ },
1697
+ {
1698
+ id: "plugin.invoke",
1699
+ scope: "host",
1700
+ service: "po.hub",
1701
+ member: "invoke",
1702
+ direction: "client-to-server",
1703
+ kind: "method",
1704
+ input: PoPluginWireCallSchema,
1705
+ output: Json,
1706
+ errors: WireError,
1707
+ description: "Invoke the selected scoped plugin method. Its declaration supplies input and output shapes."
1708
+ }
1709
+ ];
1710
+ [
1711
+ ...headlessHttpContracts,
1712
+ ...pluginMarketplaceHttpContracts,
1713
+ ...machineHttpContracts,
1714
+ ...sessionHttpContracts,
1715
+ ...remoteHttpContracts,
1716
+ ...bundleHttpContracts
1717
+ ], [...sessionSocketContracts, ...transportSocketContracts];
1718
+ //#endregion
1719
+ export { PoHubContract as a, PluginInstallRequestSchema as c, PoHubAccessContract as i, jsonApiResponses as l, SessionServiceStateSchema as n, PoHubRevisionsContract as o, PoThreadContract as r, PoChannelsContract as s, SessionMethodSchemas as t, defineApiContract as u };