@prismshadow/penguin-server 0.2.13 → 0.2.15

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 (428) hide show
  1. package/dist/api/types.d.ts +2722 -159
  2. package/dist/api/types.js +3 -1
  3. package/dist/auth-token.d.ts +22 -1
  4. package/dist/auth-token.js +2 -2
  5. package/dist/auth-token.js.map +1 -1
  6. package/dist/benchmark-package.d.ts +39 -0
  7. package/dist/benchmark-package.js +97 -0
  8. package/dist/benchmark-package.js.map +1 -0
  9. package/dist/chunk-54E64LWB.js +63 -0
  10. package/dist/chunk-54E64LWB.js.map +1 -0
  11. package/dist/{chunk-3I2XOPJB.js → chunk-5Z4UCHDB.js} +95 -78
  12. package/dist/chunk-5Z4UCHDB.js.map +1 -0
  13. package/dist/chunk-HX3WBUYX.js +18 -0
  14. package/dist/chunk-HX3WBUYX.js.map +1 -0
  15. package/dist/chunk-JKJXQTHH.js +19 -0
  16. package/dist/chunk-JKJXQTHH.js.map +1 -0
  17. package/dist/{chunk-A3QANMU5.js → chunk-NVWAYYRX.js} +279 -9
  18. package/dist/chunk-NVWAYYRX.js.map +1 -0
  19. package/dist/chunk-Q4ON2L6E.js +52 -0
  20. package/dist/chunk-Q4ON2L6E.js.map +1 -0
  21. package/dist/chunk-QFV3ERQO.js +20 -0
  22. package/dist/chunk-QFV3ERQO.js.map +1 -0
  23. package/dist/index.js +69394 -36621
  24. package/dist/index.js.map +1 -1
  25. package/dist/install.ps1 +16 -6
  26. package/dist/install.sh +24 -10
  27. package/dist/machine-status.js +1 -1
  28. package/dist/plugin/index.d.ts +1061 -272
  29. package/dist/reset-admin-password.js +3 -2
  30. package/dist/reset-admin-password.js.map +1 -1
  31. package/dist/secret-file.js +3 -14
  32. package/dist/secret-file.js.map +1 -1
  33. package/dist/version-report.d.ts +3 -0
  34. package/dist/version-report.js +1 -1
  35. package/package.json +12 -6
  36. package/web-dist/assets/KaTeX_Size3-Regular-gV2CO0n9.woff2 +0 -0
  37. package/web-dist/assets/abnfDiagram-VCTEODGH-CKWh4hoA.js +1 -0
  38. package/web-dist/assets/{addon-clipboard-DrZY90Ks.js → addon-clipboard-DxLqat7q.js} +1 -1
  39. package/web-dist/assets/{addon-fit-CtEAdAax.js → addon-fit-B8oPGPkW.js} +1 -1
  40. package/web-dist/assets/{addon-web-links-DJL13cYY.js → addon-web-links-C0W5TcK0.js} +1 -1
  41. package/web-dist/assets/arc-Dp9EkaAH.js +1 -0
  42. package/web-dist/assets/architectureDiagram-5GKGNRK7-BQ3LUcle.js +36 -0
  43. package/web-dist/assets/blockDiagram-I7D4REHJ-CZzyU0Jj.js +129 -0
  44. package/web-dist/assets/c4Diagram-7LVT6UL2-Qps3jeAu.js +38 -0
  45. package/web-dist/assets/channel--PblgLlC.js +1 -0
  46. package/web-dist/assets/chunk-2Q5K7J3B-CQMntzuX.js +1 -0
  47. package/web-dist/assets/chunk-5VM5RSS4-2H2ZJAte.js +15 -0
  48. package/web-dist/assets/chunk-F27PBJKO-B30xCNBv.js +1 -0
  49. package/web-dist/assets/chunk-IMKFNOWR-Cyfx4zDs.js +231 -0
  50. package/web-dist/assets/chunk-JWPE2WC7-DADUytTh.js +1 -0
  51. package/web-dist/assets/chunk-POPQ4Y6H-9bjsAxLS.js +1 -0
  52. package/web-dist/assets/chunk-SVP7TREG-B9xO1VpN.js +88 -0
  53. package/web-dist/assets/chunk-TICWLB2K-B6oDkrep.js +206 -0
  54. package/web-dist/assets/chunk-XXDRQBXY-BbU8DR4B.js +1 -0
  55. package/web-dist/assets/classDiagram-ZZMXUADV-mn8tbuqa.js +1 -0
  56. package/web-dist/assets/classDiagram-v2-VYDZK3BY-mn8tbuqa.js +1 -0
  57. package/web-dist/assets/cose-bilkent-JH36ORCC-pkbuyec-.js +1 -0
  58. package/web-dist/assets/cynefin-OW5HDTMX-DU9YQQnc.js +166 -0
  59. package/web-dist/assets/cynefinDiagram-5FMLGOSQ-3a3XuhQq.js +62 -0
  60. package/web-dist/assets/cytoscape.esm-BB4DxJjf.js +321 -0
  61. package/web-dist/assets/dagre-GXQ25YYZ-BfZ9C5CZ.js +4 -0
  62. package/web-dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  63. package/web-dist/assets/diagram-S7CK7UJ4-BoGhVBMn.js +30 -0
  64. package/web-dist/assets/diagram-UQ7AKVKN-zE67quty.js +41 -0
  65. package/web-dist/assets/diagram-VSXAHHWV-NihoXeXm.js +3 -0
  66. package/web-dist/assets/diagram-VX7I27RA-1627np0S.js +24 -0
  67. package/web-dist/assets/diagram-Z3DM3KII-Ddg_bUan.js +24 -0
  68. package/web-dist/assets/ebnfDiagram-PWID7BFC-CmPUOM4j.js +1 -0
  69. package/web-dist/assets/erDiagram-RLTQ6QDP-DiTnEK72.js +99 -0
  70. package/web-dist/assets/flowDiagram-HODETNUW-mGQ38tRM.js +168 -0
  71. package/web-dist/assets/ganttDiagram-EL5Y4UJY-DU7MlzpW.js +292 -0
  72. package/web-dist/assets/gitGraphDiagram-WWUBYQGX-CRE_3vjl.js +106 -0
  73. package/web-dist/assets/highlighter-CzfXQ6yd.js +2 -0
  74. package/web-dist/assets/{highlighter-core-CrBdruEx.js → highlighter-core-B5CvXcEK.js} +7 -7
  75. package/web-dist/assets/{highlighter.worker-CL6f9Fzw.js → highlighter.worker-D6D9fPma.js} +9 -9
  76. package/web-dist/assets/ibm-plex-sans-condensed-latin-600-normal-CRd5VyFf.woff2 +0 -0
  77. package/web-dist/assets/ibm-plex-sans-condensed-latin-ext-600-normal-CBdNZ9Ci.woff2 +0 -0
  78. package/web-dist/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  79. package/web-dist/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  80. package/web-dist/assets/index-BdG4qRyI.js +1275 -0
  81. package/web-dist/assets/index-W-xYFoIm.css +1 -0
  82. package/web-dist/assets/infoDiagram-27XIBGKW-Cdo6Ar-a.js +2 -0
  83. package/web-dist/assets/init-Gi6I4Gst.js +1 -0
  84. package/web-dist/assets/ishikawaDiagram-5VMMS53U-C27pgect.js +70 -0
  85. package/web-dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  86. package/web-dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  87. package/web-dist/assets/journeyDiagram-3NMN7TZE-CVxtKpLG.js +139 -0
  88. package/web-dist/assets/kanban-definition-UXKFOSKX-DWA31Da7.js +89 -0
  89. package/web-dist/assets/layout-DWKCU9PO.js +1 -0
  90. package/web-dist/assets/linear-BwCthj_k.js +1 -0
  91. package/web-dist/assets/mermaid.core-BcTrmPOv.js +310 -0
  92. package/web-dist/assets/mindmap-definition-YA3MSWOX-BLEDhbn1.js +96 -0
  93. package/web-dist/assets/misans-400-100-DHkMCix2.woff2 +0 -0
  94. package/web-dist/assets/misans-400-101-CwgSLsmc.woff2 +0 -0
  95. package/web-dist/assets/misans-400-102-BQgefHPQ.woff2 +0 -0
  96. package/web-dist/assets/misans-400-103-CP58Mc_T.woff2 +0 -0
  97. package/web-dist/assets/misans-400-104-Ta_Xu1gd.woff2 +0 -0
  98. package/web-dist/assets/misans-400-105-CDop11AR.woff2 +0 -0
  99. package/web-dist/assets/misans-400-106-Dv8y0ubk.woff2 +0 -0
  100. package/web-dist/assets/misans-400-107-CjnHtp9E.woff2 +0 -0
  101. package/web-dist/assets/misans-400-108-BA8nQUBw.woff2 +0 -0
  102. package/web-dist/assets/misans-400-109-B6uEN0pG.woff2 +0 -0
  103. package/web-dist/assets/misans-400-110-BQqnShrY.woff2 +0 -0
  104. package/web-dist/assets/misans-400-111-CHB-Jj5X.woff2 +0 -0
  105. package/web-dist/assets/misans-400-112-D1dh4Cjx.woff2 +0 -0
  106. package/web-dist/assets/misans-400-113-Bw_wNCFp.woff2 +0 -0
  107. package/web-dist/assets/misans-400-114-CUb-5IzE.woff2 +0 -0
  108. package/web-dist/assets/misans-400-115-BICOatsO.woff2 +0 -0
  109. package/web-dist/assets/misans-400-116-B3_gmYW6.woff2 +0 -0
  110. package/web-dist/assets/misans-400-117-B8k_y3cv.woff2 +0 -0
  111. package/web-dist/assets/misans-400-118-C-2Cf5C6.woff2 +0 -0
  112. package/web-dist/assets/misans-400-119-CmLP7xnX.woff2 +0 -0
  113. package/web-dist/assets/misans-400-21-DsSSD_Zj.woff2 +0 -0
  114. package/web-dist/assets/misans-400-22-rtkxWOv4.woff2 +0 -0
  115. package/web-dist/assets/misans-400-23-CDDB4M1H.woff2 +0 -0
  116. package/web-dist/assets/misans-400-24-Dqf_XeOL.woff2 +0 -0
  117. package/web-dist/assets/misans-400-25-C4U1tJ5J.woff2 +0 -0
  118. package/web-dist/assets/misans-400-26-CEXOK-nT.woff2 +0 -0
  119. package/web-dist/assets/misans-400-27-BrNOAScF.woff2 +0 -0
  120. package/web-dist/assets/misans-400-28-CPpEnCkG.woff2 +0 -0
  121. package/web-dist/assets/misans-400-29-C9JMVw8g.woff2 +0 -0
  122. package/web-dist/assets/misans-400-30-CD-QimXa.woff2 +0 -0
  123. package/web-dist/assets/misans-400-31-S4k06NbS.woff2 +0 -0
  124. package/web-dist/assets/misans-400-32-zRMBDkz6.woff2 +0 -0
  125. package/web-dist/assets/misans-400-33-sQ_tNZSM.woff2 +0 -0
  126. package/web-dist/assets/misans-400-34-8LEGljja.woff2 +0 -0
  127. package/web-dist/assets/misans-400-35-CxSPyuiU.woff2 +0 -0
  128. package/web-dist/assets/misans-400-36-BY1i4WtO.woff2 +0 -0
  129. package/web-dist/assets/misans-400-37-C0oF42pu.woff2 +0 -0
  130. package/web-dist/assets/misans-400-38-y7xcB90w.woff2 +0 -0
  131. package/web-dist/assets/misans-400-39-C307YgZx.woff2 +0 -0
  132. package/web-dist/assets/misans-400-40-ByZr736f.woff2 +0 -0
  133. package/web-dist/assets/misans-400-41-ChKEw5zV.woff2 +0 -0
  134. package/web-dist/assets/misans-400-42-CD__zJu5.woff2 +0 -0
  135. package/web-dist/assets/misans-400-43-CqNV6_TG.woff2 +0 -0
  136. package/web-dist/assets/misans-400-44-zE-akmW8.woff2 +0 -0
  137. package/web-dist/assets/misans-400-45-Du98otwc.woff2 +0 -0
  138. package/web-dist/assets/misans-400-46-B6JXbEy2.woff2 +0 -0
  139. package/web-dist/assets/misans-400-47-DpqW0kSq.woff2 +0 -0
  140. package/web-dist/assets/misans-400-48-BprON5Q_.woff2 +0 -0
  141. package/web-dist/assets/misans-400-49-N-ct3sN6.woff2 +0 -0
  142. package/web-dist/assets/misans-400-5-ton_4jCN.woff2 +0 -0
  143. package/web-dist/assets/misans-400-50-JgU49P0U.woff2 +0 -0
  144. package/web-dist/assets/misans-400-51-DSS3Moge.woff2 +0 -0
  145. package/web-dist/assets/misans-400-52-BMoXFmwE.woff2 +0 -0
  146. package/web-dist/assets/misans-400-53-BaLMGl4z.woff2 +0 -0
  147. package/web-dist/assets/misans-400-54-CaeSn3OR.woff2 +0 -0
  148. package/web-dist/assets/misans-400-55-BBqrtLxN.woff2 +0 -0
  149. package/web-dist/assets/misans-400-56-DAZ5BnbO.woff2 +0 -0
  150. package/web-dist/assets/misans-400-57-F-n3b0gI.woff2 +0 -0
  151. package/web-dist/assets/misans-400-58-DEUuPQAq.woff2 +0 -0
  152. package/web-dist/assets/misans-400-59-DXP5rhCL.woff2 +0 -0
  153. package/web-dist/assets/misans-400-6-DWCCUO_c.woff2 +0 -0
  154. package/web-dist/assets/misans-400-60-BE6IO6zJ.woff2 +0 -0
  155. package/web-dist/assets/misans-400-61-5Qb1gaxK.woff2 +0 -0
  156. package/web-dist/assets/misans-400-62-D_tJKNAj.woff2 +0 -0
  157. package/web-dist/assets/misans-400-63-hwmne8yB.woff2 +0 -0
  158. package/web-dist/assets/misans-400-64-BGedxReM.woff2 +0 -0
  159. package/web-dist/assets/misans-400-65-BaKPsugb.woff2 +0 -0
  160. package/web-dist/assets/misans-400-66-IdaOMzCz.woff2 +0 -0
  161. package/web-dist/assets/misans-400-67-BdWyS83H.woff2 +0 -0
  162. package/web-dist/assets/misans-400-68-DrZ_1swq.woff2 +0 -0
  163. package/web-dist/assets/misans-400-69-B3jsSD92.woff2 +0 -0
  164. package/web-dist/assets/misans-400-70-D6UZI2Ua.woff2 +0 -0
  165. package/web-dist/assets/misans-400-71-HFxyMCYg.woff2 +0 -0
  166. package/web-dist/assets/misans-400-72-CP5A-yQP.woff2 +0 -0
  167. package/web-dist/assets/misans-400-73-BoD_bu6s.woff2 +0 -0
  168. package/web-dist/assets/misans-400-74-CbJlhZlZ.woff2 +0 -0
  169. package/web-dist/assets/misans-400-75-BsbWuELX.woff2 +0 -0
  170. package/web-dist/assets/misans-400-76-DkwiQhof.woff2 +0 -0
  171. package/web-dist/assets/misans-400-77-6pVHXHnF.woff2 +0 -0
  172. package/web-dist/assets/misans-400-78-CfUF6pih.woff2 +0 -0
  173. package/web-dist/assets/misans-400-79-BCS3Dx4e.woff2 +0 -0
  174. package/web-dist/assets/misans-400-80-BEYSdQ_N.woff2 +0 -0
  175. package/web-dist/assets/misans-400-81-BzL-Gncx.woff2 +0 -0
  176. package/web-dist/assets/misans-400-82-CaENmdUU.woff2 +0 -0
  177. package/web-dist/assets/misans-400-83-Bvq1eBcA.woff2 +0 -0
  178. package/web-dist/assets/misans-400-84-Ctd90hiP.woff2 +0 -0
  179. package/web-dist/assets/misans-400-85-DWuOxfL1.woff2 +0 -0
  180. package/web-dist/assets/misans-400-86-D5niZS5c.woff2 +0 -0
  181. package/web-dist/assets/misans-400-87-DkOIADQJ.woff2 +0 -0
  182. package/web-dist/assets/misans-400-88-CGY4WTcC.woff2 +0 -0
  183. package/web-dist/assets/misans-400-89-CA3eoMTt.woff2 +0 -0
  184. package/web-dist/assets/misans-400-90-CzxR9MYb.woff2 +0 -0
  185. package/web-dist/assets/misans-400-91-Dyr85txc.woff2 +0 -0
  186. package/web-dist/assets/misans-400-97-qEZrCUNe.woff2 +0 -0
  187. package/web-dist/assets/misans-400-cyrillic--hFcG0Xp.woff2 +0 -0
  188. package/web-dist/assets/misans-400-extra-ZRI9n2Hu.woff2 +0 -0
  189. package/web-dist/assets/misans-400-latin-BRDR1WaL.woff2 +0 -0
  190. package/web-dist/assets/misans-400-latin-ext-6xS-MvHW.woff2 +0 -0
  191. package/web-dist/assets/misans-400-vietnamese-D7xD7kBB.woff2 +0 -0
  192. package/web-dist/assets/misans-500-100-BHuGA96E.woff2 +0 -0
  193. package/web-dist/assets/misans-500-101-CDMYUz0c.woff2 +0 -0
  194. package/web-dist/assets/misans-500-102-CWcqYYCV.woff2 +0 -0
  195. package/web-dist/assets/misans-500-103-BE1QSEzY.woff2 +0 -0
  196. package/web-dist/assets/misans-500-104-CDp743BV.woff2 +0 -0
  197. package/web-dist/assets/misans-500-105-y7dY6Foi.woff2 +0 -0
  198. package/web-dist/assets/misans-500-106-CP-kGZ6j.woff2 +0 -0
  199. package/web-dist/assets/misans-500-107-CUc8Hvle.woff2 +0 -0
  200. package/web-dist/assets/misans-500-108-ItN_x8jX.woff2 +0 -0
  201. package/web-dist/assets/misans-500-109-CEtf3R4D.woff2 +0 -0
  202. package/web-dist/assets/misans-500-110-BSZSHYRL.woff2 +0 -0
  203. package/web-dist/assets/misans-500-111-DfdArrjn.woff2 +0 -0
  204. package/web-dist/assets/misans-500-112-DRtNyrQw.woff2 +0 -0
  205. package/web-dist/assets/misans-500-113-CDT7tKuB.woff2 +0 -0
  206. package/web-dist/assets/misans-500-114-CCh4jwL8.woff2 +0 -0
  207. package/web-dist/assets/misans-500-115-DplUgPp0.woff2 +0 -0
  208. package/web-dist/assets/misans-500-116-C7eCklyK.woff2 +0 -0
  209. package/web-dist/assets/misans-500-117-BA0KabyT.woff2 +0 -0
  210. package/web-dist/assets/misans-500-118-V_M0eu2q.woff2 +0 -0
  211. package/web-dist/assets/misans-500-119-Cgf3Hszt.woff2 +0 -0
  212. package/web-dist/assets/misans-500-21-Di6DyR6O.woff2 +0 -0
  213. package/web-dist/assets/misans-500-22-CSnXvtL-.woff2 +0 -0
  214. package/web-dist/assets/misans-500-23-A06Hm9a6.woff2 +0 -0
  215. package/web-dist/assets/misans-500-24-Df97RCik.woff2 +0 -0
  216. package/web-dist/assets/misans-500-25-bOSJ6YXH.woff2 +0 -0
  217. package/web-dist/assets/misans-500-26-C65icgBb.woff2 +0 -0
  218. package/web-dist/assets/misans-500-27-C_GRm0va.woff2 +0 -0
  219. package/web-dist/assets/misans-500-28-CzZkqO0l.woff2 +0 -0
  220. package/web-dist/assets/misans-500-29-BReyeRyX.woff2 +0 -0
  221. package/web-dist/assets/misans-500-30-DzfjlROz.woff2 +0 -0
  222. package/web-dist/assets/misans-500-31-B2nLpgdU.woff2 +0 -0
  223. package/web-dist/assets/misans-500-32-Bz3rHm8X.woff2 +0 -0
  224. package/web-dist/assets/misans-500-33-AU3lZ1vY.woff2 +0 -0
  225. package/web-dist/assets/misans-500-34-CBAWkH-I.woff2 +0 -0
  226. package/web-dist/assets/misans-500-35-VgnGd14P.woff2 +0 -0
  227. package/web-dist/assets/misans-500-36-B2kfXv6A.woff2 +0 -0
  228. package/web-dist/assets/misans-500-37-DhKo8ykb.woff2 +0 -0
  229. package/web-dist/assets/misans-500-38-D8tTxFuc.woff2 +0 -0
  230. package/web-dist/assets/misans-500-39-DTm3aqJQ.woff2 +0 -0
  231. package/web-dist/assets/misans-500-40-C_akwj8_.woff2 +0 -0
  232. package/web-dist/assets/misans-500-41-RVM1JHQW.woff2 +0 -0
  233. package/web-dist/assets/misans-500-42-MVWIN_il.woff2 +0 -0
  234. package/web-dist/assets/misans-500-43-BtLZYNyD.woff2 +0 -0
  235. package/web-dist/assets/misans-500-44-D0QHMl6G.woff2 +0 -0
  236. package/web-dist/assets/misans-500-45-DRlclX7-.woff2 +0 -0
  237. package/web-dist/assets/misans-500-46-BEWswL4N.woff2 +0 -0
  238. package/web-dist/assets/misans-500-47-COSoxWaW.woff2 +0 -0
  239. package/web-dist/assets/misans-500-48-DZAISq3n.woff2 +0 -0
  240. package/web-dist/assets/misans-500-49-KSfi7MW0.woff2 +0 -0
  241. package/web-dist/assets/misans-500-5-h1SBcwuW.woff2 +0 -0
  242. package/web-dist/assets/misans-500-50-CIVMfG11.woff2 +0 -0
  243. package/web-dist/assets/misans-500-51-BdeNBhBL.woff2 +0 -0
  244. package/web-dist/assets/misans-500-52-CEW4e7ex.woff2 +0 -0
  245. package/web-dist/assets/misans-500-53-lmPCsEnt.woff2 +0 -0
  246. package/web-dist/assets/misans-500-54-B_7AqKQW.woff2 +0 -0
  247. package/web-dist/assets/misans-500-55-B-3RtUnH.woff2 +0 -0
  248. package/web-dist/assets/misans-500-56-g6D0e0cW.woff2 +0 -0
  249. package/web-dist/assets/misans-500-57-D5hp5Yqr.woff2 +0 -0
  250. package/web-dist/assets/misans-500-58-ilnDgEKt.woff2 +0 -0
  251. package/web-dist/assets/misans-500-59-DJYXz8tr.woff2 +0 -0
  252. package/web-dist/assets/misans-500-6-uCdpdDQy.woff2 +0 -0
  253. package/web-dist/assets/misans-500-60-B3Iaqx0p.woff2 +0 -0
  254. package/web-dist/assets/misans-500-61-CMxqg5hc.woff2 +0 -0
  255. package/web-dist/assets/misans-500-62-7FY8O2NQ.woff2 +0 -0
  256. package/web-dist/assets/misans-500-63-JP6vEuJf.woff2 +0 -0
  257. package/web-dist/assets/misans-500-64-Cdub62jh.woff2 +0 -0
  258. package/web-dist/assets/misans-500-65-DVHk_mlC.woff2 +0 -0
  259. package/web-dist/assets/misans-500-66-BX39wRtF.woff2 +0 -0
  260. package/web-dist/assets/misans-500-67-BcsepI3X.woff2 +0 -0
  261. package/web-dist/assets/misans-500-68-etUIUjrh.woff2 +0 -0
  262. package/web-dist/assets/misans-500-69-DfhVmnuA.woff2 +0 -0
  263. package/web-dist/assets/misans-500-70-D6dgy6-B.woff2 +0 -0
  264. package/web-dist/assets/misans-500-71-PkeKjcVn.woff2 +0 -0
  265. package/web-dist/assets/misans-500-72-D66Fnb30.woff2 +0 -0
  266. package/web-dist/assets/misans-500-73-jr9z9870.woff2 +0 -0
  267. package/web-dist/assets/misans-500-74-DsCkPKwe.woff2 +0 -0
  268. package/web-dist/assets/misans-500-75-Dkooq6KM.woff2 +0 -0
  269. package/web-dist/assets/misans-500-76-B0sfieHl.woff2 +0 -0
  270. package/web-dist/assets/misans-500-77-8tflq1ji.woff2 +0 -0
  271. package/web-dist/assets/misans-500-78-COKdMbdp.woff2 +0 -0
  272. package/web-dist/assets/misans-500-79-Bm0rBjSF.woff2 +0 -0
  273. package/web-dist/assets/misans-500-80-B9OoAnyy.woff2 +0 -0
  274. package/web-dist/assets/misans-500-81-DsQ9tpfX.woff2 +0 -0
  275. package/web-dist/assets/misans-500-82-VKsL2Tk2.woff2 +0 -0
  276. package/web-dist/assets/misans-500-83-Ce6mfHYD.woff2 +0 -0
  277. package/web-dist/assets/misans-500-84-D7kPSZLm.woff2 +0 -0
  278. package/web-dist/assets/misans-500-85-W5L0cEfd.woff2 +0 -0
  279. package/web-dist/assets/misans-500-86-DukGOEET.woff2 +0 -0
  280. package/web-dist/assets/misans-500-87-BJ_Lok6j.woff2 +0 -0
  281. package/web-dist/assets/misans-500-88-DbJ11zcA.woff2 +0 -0
  282. package/web-dist/assets/misans-500-89-LNKcEq6M.woff2 +0 -0
  283. package/web-dist/assets/misans-500-90-DNDDgSCd.woff2 +0 -0
  284. package/web-dist/assets/misans-500-91-rT8Q0evu.woff2 +0 -0
  285. package/web-dist/assets/misans-500-97-c8zW_WRq.woff2 +0 -0
  286. package/web-dist/assets/misans-500-cyrillic-CLHOGwgx.woff2 +0 -0
  287. package/web-dist/assets/misans-500-extra-CTAMEQ59.woff2 +0 -0
  288. package/web-dist/assets/misans-500-latin-Be606ott.woff2 +0 -0
  289. package/web-dist/assets/misans-500-latin-ext-BzDyL4sU.woff2 +0 -0
  290. package/web-dist/assets/misans-500-vietnamese-DBOLOqZH.woff2 +0 -0
  291. package/web-dist/assets/mona-sans-latin-ext-wght-normal-BqSk0Z3x.woff2 +0 -0
  292. package/web-dist/assets/mona-sans-latin-wght-normal-Pz49MTQZ.woff2 +0 -0
  293. package/web-dist/assets/noto-sans-sc-100-wght-normal-DrqXJETY.woff2 +0 -0
  294. package/web-dist/assets/noto-sans-sc-101-wght-normal-c94LAl5p.woff2 +0 -0
  295. package/web-dist/assets/noto-sans-sc-102-wght-normal-C1RtbCZr.woff2 +0 -0
  296. package/web-dist/assets/noto-sans-sc-103-wght-normal-DGHo20nu.woff2 +0 -0
  297. package/web-dist/assets/noto-sans-sc-104-wght-normal-CJT2ioDJ.woff2 +0 -0
  298. package/web-dist/assets/noto-sans-sc-105-wght-normal-BFoiJwz2.woff2 +0 -0
  299. package/web-dist/assets/noto-sans-sc-106-wght-normal-D6uUHw3w.woff2 +0 -0
  300. package/web-dist/assets/noto-sans-sc-107-wght-normal-kFQzJDLH.woff2 +0 -0
  301. package/web-dist/assets/noto-sans-sc-108-wght-normal-7aXvqIa2.woff2 +0 -0
  302. package/web-dist/assets/noto-sans-sc-109-wght-normal-CnjNbNmw.woff2 +0 -0
  303. package/web-dist/assets/noto-sans-sc-110-wght-normal-D2JBr045.woff2 +0 -0
  304. package/web-dist/assets/noto-sans-sc-111-wght-normal-ClFr5QXM.woff2 +0 -0
  305. package/web-dist/assets/noto-sans-sc-112-wght-normal-CiZxJMyY.woff2 +0 -0
  306. package/web-dist/assets/noto-sans-sc-113-wght-normal-OgQXOX6x.woff2 +0 -0
  307. package/web-dist/assets/noto-sans-sc-114-wght-normal-CRH9SDZu.woff2 +0 -0
  308. package/web-dist/assets/noto-sans-sc-115-wght-normal-BN__2iBG.woff2 +0 -0
  309. package/web-dist/assets/noto-sans-sc-116-wght-normal-vdFVzbO2.woff2 +0 -0
  310. package/web-dist/assets/noto-sans-sc-117-wght-normal-Dsz3vkzU.woff2 +0 -0
  311. package/web-dist/assets/noto-sans-sc-118-wght-normal-BPEb0gM9.woff2 +0 -0
  312. package/web-dist/assets/noto-sans-sc-119-wght-normal-BfzSEbFz.woff2 +0 -0
  313. package/web-dist/assets/noto-sans-sc-21-wght-normal-DIu_1ZBI.woff2 +0 -0
  314. package/web-dist/assets/noto-sans-sc-22-wght-normal-VXjdYcT-.woff2 +0 -0
  315. package/web-dist/assets/noto-sans-sc-23-wght-normal-4HrHKhpL.woff2 +0 -0
  316. package/web-dist/assets/noto-sans-sc-24-wght-normal-B58DWgHS.woff2 +0 -0
  317. package/web-dist/assets/noto-sans-sc-25-wght-normal-C3Jm6l7O.woff2 +0 -0
  318. package/web-dist/assets/noto-sans-sc-26-wght-normal-YNOygvr_.woff2 +0 -0
  319. package/web-dist/assets/noto-sans-sc-27-wght-normal-BP2pEGQH.woff2 +0 -0
  320. package/web-dist/assets/noto-sans-sc-28-wght-normal-BWPKDbtH.woff2 +0 -0
  321. package/web-dist/assets/noto-sans-sc-29-wght-normal-45aVmHn_.woff2 +0 -0
  322. package/web-dist/assets/noto-sans-sc-30-wght-normal-B8_s30jZ.woff2 +0 -0
  323. package/web-dist/assets/noto-sans-sc-31-wght-normal-DW0t445S.woff2 +0 -0
  324. package/web-dist/assets/noto-sans-sc-32-wght-normal-ShbWPcei.woff2 +0 -0
  325. package/web-dist/assets/noto-sans-sc-33-wght-normal-BOTZYTjM.woff2 +0 -0
  326. package/web-dist/assets/noto-sans-sc-34-wght-normal-BF1rqDSt.woff2 +0 -0
  327. package/web-dist/assets/noto-sans-sc-35-wght-normal-Bosspiyr.woff2 +0 -0
  328. package/web-dist/assets/noto-sans-sc-36-wght-normal-CtU9CyKw.woff2 +0 -0
  329. package/web-dist/assets/noto-sans-sc-37-wght-normal-ghDiyiuv.woff2 +0 -0
  330. package/web-dist/assets/noto-sans-sc-38-wght-normal-4Nz8k_dt.woff2 +0 -0
  331. package/web-dist/assets/noto-sans-sc-39-wght-normal-Ddtm1XVC.woff2 +0 -0
  332. package/web-dist/assets/noto-sans-sc-4-wght-normal-BRbPMj-C.woff2 +0 -0
  333. package/web-dist/assets/noto-sans-sc-40-wght-normal-BVn4-kgX.woff2 +0 -0
  334. package/web-dist/assets/noto-sans-sc-41-wght-normal-CZqajZnl.woff2 +0 -0
  335. package/web-dist/assets/noto-sans-sc-42-wght-normal-CQ4lY28u.woff2 +0 -0
  336. package/web-dist/assets/noto-sans-sc-43-wght-normal-psppu0d8.woff2 +0 -0
  337. package/web-dist/assets/noto-sans-sc-44-wght-normal-cbKJlTUe.woff2 +0 -0
  338. package/web-dist/assets/noto-sans-sc-45-wght-normal-MKIEVRIC.woff2 +0 -0
  339. package/web-dist/assets/noto-sans-sc-46-wght-normal-CErGc6Mt.woff2 +0 -0
  340. package/web-dist/assets/noto-sans-sc-47-wght-normal-C5Kgg1_m.woff2 +0 -0
  341. package/web-dist/assets/noto-sans-sc-48-wght-normal-DFMjDDY6.woff2 +0 -0
  342. package/web-dist/assets/noto-sans-sc-49-wght-normal-B7l_3BZr.woff2 +0 -0
  343. package/web-dist/assets/noto-sans-sc-5-wght-normal-DI846rD9.woff2 +0 -0
  344. package/web-dist/assets/noto-sans-sc-50-wght-normal-C5KfAmFp.woff2 +0 -0
  345. package/web-dist/assets/noto-sans-sc-51-wght-normal-C2bq6hC8.woff2 +0 -0
  346. package/web-dist/assets/noto-sans-sc-52-wght-normal-P18e_Y0j.woff2 +0 -0
  347. package/web-dist/assets/noto-sans-sc-53-wght-normal-Bgkuo2tF.woff2 +0 -0
  348. package/web-dist/assets/noto-sans-sc-54-wght-normal-DL5lmlUd.woff2 +0 -0
  349. package/web-dist/assets/noto-sans-sc-55-wght-normal-BV_Oy6IF.woff2 +0 -0
  350. package/web-dist/assets/noto-sans-sc-56-wght-normal-B4L7Hj8f.woff2 +0 -0
  351. package/web-dist/assets/noto-sans-sc-57-wght-normal-DU8YBsDj.woff2 +0 -0
  352. package/web-dist/assets/noto-sans-sc-58-wght-normal-CE0BKS9u.woff2 +0 -0
  353. package/web-dist/assets/noto-sans-sc-59-wght-normal-Azv2Ku9_.woff2 +0 -0
  354. package/web-dist/assets/noto-sans-sc-6-wght-normal-ozUCEY9O.woff2 +0 -0
  355. package/web-dist/assets/noto-sans-sc-60-wght-normal-C1lngC61.woff2 +0 -0
  356. package/web-dist/assets/noto-sans-sc-61-wght-normal-BxWkGF5M.woff2 +0 -0
  357. package/web-dist/assets/noto-sans-sc-62-wght-normal-CXXMAq-5.woff2 +0 -0
  358. package/web-dist/assets/noto-sans-sc-63-wght-normal-4La5uKvS.woff2 +0 -0
  359. package/web-dist/assets/noto-sans-sc-64-wght-normal-CbIuD2Eg.woff2 +0 -0
  360. package/web-dist/assets/noto-sans-sc-65-wght-normal-BGqvKda2.woff2 +0 -0
  361. package/web-dist/assets/noto-sans-sc-66-wght-normal-BvNozWOY.woff2 +0 -0
  362. package/web-dist/assets/noto-sans-sc-67-wght-normal-CC-WRBV-.woff2 +0 -0
  363. package/web-dist/assets/noto-sans-sc-68-wght-normal-c0FjfUaj.woff2 +0 -0
  364. package/web-dist/assets/noto-sans-sc-69-wght-normal-D596Jjl2.woff2 +0 -0
  365. package/web-dist/assets/noto-sans-sc-70-wght-normal-ColEcmtJ.woff2 +0 -0
  366. package/web-dist/assets/noto-sans-sc-71-wght-normal-ChZfXpdg.woff2 +0 -0
  367. package/web-dist/assets/noto-sans-sc-72-wght-normal-D1VyfEG3.woff2 +0 -0
  368. package/web-dist/assets/noto-sans-sc-73-wght-normal-DwSJRYPJ.woff2 +0 -0
  369. package/web-dist/assets/noto-sans-sc-74-wght-normal-Cte7o1QG.woff2 +0 -0
  370. package/web-dist/assets/noto-sans-sc-75-wght-normal-B0qL41rF.woff2 +0 -0
  371. package/web-dist/assets/noto-sans-sc-76-wght-normal-BPLMO_2x.woff2 +0 -0
  372. package/web-dist/assets/noto-sans-sc-77-wght-normal-Dkbi3pye.woff2 +0 -0
  373. package/web-dist/assets/noto-sans-sc-78-wght-normal-BFUXeSw6.woff2 +0 -0
  374. package/web-dist/assets/noto-sans-sc-79-wght-normal-DoJG4UTB.woff2 +0 -0
  375. package/web-dist/assets/noto-sans-sc-80-wght-normal-BEFypWOO.woff2 +0 -0
  376. package/web-dist/assets/noto-sans-sc-81-wght-normal-ed_TZlfo.woff2 +0 -0
  377. package/web-dist/assets/noto-sans-sc-82-wght-normal-DcxfR5OJ.woff2 +0 -0
  378. package/web-dist/assets/noto-sans-sc-83-wght-normal-C9UjAcMM.woff2 +0 -0
  379. package/web-dist/assets/noto-sans-sc-84-wght-normal-C7NxT478.woff2 +0 -0
  380. package/web-dist/assets/noto-sans-sc-85-wght-normal-DBcDBu1n.woff2 +0 -0
  381. package/web-dist/assets/noto-sans-sc-86-wght-normal-CLJIoPpl.woff2 +0 -0
  382. package/web-dist/assets/noto-sans-sc-87-wght-normal-DYfJ-vGE.woff2 +0 -0
  383. package/web-dist/assets/noto-sans-sc-88-wght-normal-ClNDOCGW.woff2 +0 -0
  384. package/web-dist/assets/noto-sans-sc-89-wght-normal-IQU_KQA8.woff2 +0 -0
  385. package/web-dist/assets/noto-sans-sc-90-wght-normal-BWcrRNoG.woff2 +0 -0
  386. package/web-dist/assets/noto-sans-sc-91-wght-normal-CGekvDdH.woff2 +0 -0
  387. package/web-dist/assets/noto-sans-sc-97-wght-normal-BsBHkXi3.woff2 +0 -0
  388. package/web-dist/assets/noto-sans-sc-98-wght-normal-BZqSA1r_.woff2 +0 -0
  389. package/web-dist/assets/noto-sans-sc-99-wght-normal-Q_IptJM5.woff2 +0 -0
  390. package/web-dist/assets/noto-sans-sc-cyrillic-wght-normal-CRA5_Pf1.woff2 +0 -0
  391. package/web-dist/assets/noto-sans-sc-latin-ext-wght-normal-CqPqLCfe.woff2 +0 -0
  392. package/web-dist/assets/noto-sans-sc-latin-wght-normal-DYAKOyvl.woff2 +0 -0
  393. package/web-dist/assets/noto-sans-sc-vietnamese-wght-normal-y5SU35Rl.woff2 +0 -0
  394. package/web-dist/assets/ordinal-Cboi1Yqb.js +1 -0
  395. package/web-dist/assets/pegDiagram-XKGWAZYB-CLEM1SDU.js +1 -0
  396. package/web-dist/assets/pieDiagram-E7YTZNPT-B__g6eF0.js +39 -0
  397. package/web-dist/assets/quadrantDiagram-AXDQQJYC-C7VQ2LMY.js +7 -0
  398. package/web-dist/assets/railroadDiagram-O6MQD6OU-eWNnzjwS.js +1 -0
  399. package/web-dist/assets/requirementDiagram-BXWQKSXE-Bi5qeD4b.js +84 -0
  400. package/web-dist/assets/sankeyDiagram-P5KCCOFB-DG1VOpXX.js +40 -0
  401. package/web-dist/assets/sequenceDiagram-WJ2MYXX4-Fhkw73Th.js +162 -0
  402. package/web-dist/assets/sizeCapture-INFHLROL-D9E_17SF.js +1 -0
  403. package/web-dist/assets/stateDiagram-D77RDMKH-Cs5Y0xhW.js +1 -0
  404. package/web-dist/assets/stateDiagram-v2-MP3YSRHH-CEM51fAf.js +1 -0
  405. package/web-dist/assets/swimlanes-42K2YHIH-t-EocvKZ.js +1 -0
  406. package/web-dist/assets/swimlanesDiagram-VR7AAH4N-BrR66vrK.js +8 -0
  407. package/web-dist/assets/timeline-definition-24CTP7MA-CozGCxuA.js +120 -0
  408. package/web-dist/assets/vennDiagram-4TSXK5OY-ewU8ycSa.js +34 -0
  409. package/web-dist/assets/wardleyDiagram-VM6X3IG4-DuAhDu-0.js +78 -0
  410. package/web-dist/assets/{xterm-B2oS8Mg8.js → xterm-v5e56GC9.js} +1 -1
  411. package/web-dist/assets/xychartDiagram-S5SC5T6Z-BxGuZO23.js +7 -0
  412. package/web-dist/fonts-licenses/ibm-plex-sans-condensed.txt +93 -0
  413. package/web-dist/fonts-licenses/ibm-plex-sans.txt +93 -0
  414. package/web-dist/fonts-licenses/jetbrains-mono.txt +93 -0
  415. package/web-dist/fonts-licenses/misans.txt +119 -0
  416. package/web-dist/fonts-licenses/mona-sans.txt +93 -0
  417. package/web-dist/fonts-licenses/noto-sans-sc.txt +93 -0
  418. package/web-dist/index.html +18 -4
  419. package/web-dist/workflow-ui.css +261 -0
  420. package/dist/chunk-3I2XOPJB.js.map +0 -1
  421. package/dist/chunk-A3QANMU5.js.map +0 -1
  422. package/dist/chunk-L2H3K4DT.js +0 -7
  423. package/dist/chunk-L2H3K4DT.js.map +0 -1
  424. package/dist/chunk-S3BI6R7I.js +0 -14
  425. package/dist/chunk-S3BI6R7I.js.map +0 -1
  426. package/web-dist/assets/highlighter-CUb4XKtQ.js +0 -2
  427. package/web-dist/assets/index-CmfumtXy.js +0 -570
  428. package/web-dist/assets/index-Ywc2uM5u.css +0 -1
@@ -1,6 +1,96 @@
1
- import { OmniMessage, ToolCallPayload, CompactionMode } from '@prismshadow/penguin-core/omnimessage';
1
+ import { SessionSource, OmniMessage, ToolCallPayload, CompactionMode } from '@prismshadow/penguin-core/omnimessage';
2
+ export { SessionSource } from '@prismshadow/penguin-core/omnimessage';
2
3
  import { ThinkingLevelName, ToolDefinitionConfig, MCPServerConfig } from '@prismshadow/penguin-core/interfaces';
3
- import { VersionReport } from '@prismshadow/penguin-core';
4
+ import { HarnessHistory, VersionReport } from '@prismshadow/penguin-core';
5
+ export { HarnessHistoryEntry, IfacesSummary } from '@prismshadow/penguin-core';
6
+ import { IfacesDiff } from '@prismshadow/penguin-hmr';
7
+ export { IfaceChange, IfacesDiff, MemberChange, ModuleChange } from '@prismshadow/penguin-hmr';
8
+
9
+ /** A request the workflow's handler receives (the HTTP shape, minus the transport). */
10
+ interface WorkflowRequest {
11
+ method: string;
12
+ /** Path below the workflow's `api/` mount, always starting with `/`. */
13
+ path: string;
14
+ query: Record<string, string>;
15
+ /** Request headers, names lower-cased. The app's own credentials (`cookie`, `authorization`) are withheld. */
16
+ headers: Record<string, string>;
17
+ /** The parsed body of a JSON request; `null` otherwise (GET/HEAD, no body, another content type). */
18
+ body: unknown;
19
+ /** The body as sent, when there is one and it is not JSON: a form, an upload, plain text. */
20
+ bytes?: Uint8Array;
21
+ }
22
+ interface WorkflowResponse {
23
+ /** HTTP status; 200 when absent. */
24
+ status?: number;
25
+ /**
26
+ * Response headers. Naming a `content-type` is what makes the response something other than
27
+ * JSON; `location` with a 3xx status redirects. `set-cookie` is dropped — a workflow does not
28
+ * write the app's cookies.
29
+ */
30
+ headers?: Record<string, string>;
31
+ /** JSON by default (`null` when absent); with a `content-type` header, a string sent as written. */
32
+ body?: unknown;
33
+ /** A binary body (an image, a font, a download); wins over `body`. */
34
+ bytes?: Uint8Array;
35
+ /**
36
+ * A body sent as it is produced — server-sent events, a model's answer token by token, a
37
+ * large download — each chunk written to the client when the iterator yields it; wins over
38
+ * `bytes` and `body`. A client that goes away ends the iteration: `return()` is called, so
39
+ * a `finally` in the generator is where an upstream request is aborted — but a generator
40
+ * suspended inside an `await` receives it only once that await settles, so a relay whose
41
+ * upstream can hang should carry its own deadline rather than rely on the disconnect.
42
+ */
43
+ stream?: AsyncIterable<Uint8Array | string>;
44
+ }
45
+ /** How the Web App draws a contributed tab: a page of the workflow, or a renderer it carries. */
46
+ type WorkflowTabRenderer = {
47
+ iframe: {
48
+ src: string;
49
+ };
50
+ } | {
51
+ builtin: string;
52
+ };
53
+ /**
54
+ * One tab beside Chat, as the workflow contributed it (`WebModule.sessionTabs`). In a
55
+ * manifest `renderer.iframe.src` is a path inside the workflow folder, under `ui/`; in a
56
+ * `WorkflowInfo` it is the URL that file is served from.
57
+ */
58
+ interface WorkflowTab {
59
+ id: string;
60
+ /** Unique within the workflow; the tab's stable name (it appears in the full-page URL). */
61
+ key: string;
62
+ title: string;
63
+ titleZh?: string;
64
+ renderer: WorkflowTabRenderer;
65
+ }
66
+ interface WorkflowInfo {
67
+ id: string;
68
+ name: string;
69
+ version: string | null;
70
+ /** Content revision of the whole folder (what history records). */
71
+ revision: string;
72
+ /** Content revision of `ui/`: the cache key of the workflow's pages. Null when it has no `ui/`. */
73
+ uiRev: string | null;
74
+ /** The tabs of the instance that is SERVING — the previous one's while `error` is set. */
75
+ tabs: WorkflowTab[];
76
+ loadedAt: string;
77
+ /** The boot error when the current files do not load (the previous instance, if any, keeps serving). */
78
+ error: string | null;
79
+ /**
80
+ * What loaded but is probably not what its author meant, each with the edit that settles it
81
+ * — pages under `ui/` that no tab shows, say. Never a failure: `error` is that.
82
+ */
83
+ hints: string[];
84
+ }
85
+ interface WorkflowVersion {
86
+ revision: string;
87
+ savedAt: string;
88
+ name: string;
89
+ version: string | null;
90
+ uiRev: string | null;
91
+ /** The files of that version (relative paths), for display. */
92
+ files: string[];
93
+ }
4
94
 
5
95
  /**
6
96
  * Web API DTO contract — request/response types shared between server routes and the
@@ -18,19 +108,26 @@ import { VersionReport } from '@prismshadow/penguin-core';
18
108
  * public route/SSE reference for this contract — keep it in sync when changing DTOs.
19
109
  */
20
110
 
21
- /** Unified error response body; `code` is a machine-readable error code, `message` is a Chinese user-facing message. */
111
+ /**
112
+ * Unified error response body: `code` is a machine-readable error code, `message` an English
113
+ * user-facing message, and `details`, on the errors that have them, the facts a client acts on
114
+ * beside the code (the Benchmark id a 409 `benchmark_exists` is about, say) — read from there,
115
+ * never parsed out of the message.
116
+ */
22
117
  interface ErrorBody {
23
118
  error: {
24
119
  code: string;
25
120
  message: string;
121
+ details?: ErrorDetails;
26
122
  };
27
123
  }
124
+ /** An error's structured facts, by name; each code that carries them documents its own. */
125
+ type ErrorDetails = Readonly<Record<string, string>>;
28
126
  /** Session approval mode (reuses the CLI enum). */
29
127
  type ApprovalMode = "allow-all" | "deny-all" | "read-only" | "always-ask";
30
128
  /** Session run status: idle / Task in progress / compacting. */
31
129
  type SessionStatus = "idle" | "running" | "compacting";
32
- /** Session source marker (default = user-created): triggered by Schedule / registered as a subagent session / created by a Benchmark evaluation or optimization. */
33
- type SessionSource = "schedule" | "subagent" | "benchmark";
130
+
34
131
  interface UserInfo {
35
132
  /** Semantic id, i.e. login name: `^[a-z][a-z0-9_-]{1,31}$`, immutable after creation. */
36
133
  userId: string;
@@ -220,6 +317,19 @@ interface ServerSettings {
220
317
  * reports it so clients hide the mode switch. Organizations on disk are untouched.
221
318
  */
222
319
  companyMode: boolean;
320
+ /**
321
+ * Whether users may drive their own Chrome through the PenguinHarness Browser extension
322
+ * (default on). Off closes every connected extension (close code 4009), refuses new
323
+ * connections, and makes the chrome backend unavailable (`extension_disabled`); pairings are
324
+ * kept, so turning it on again lets the extensions reconnect.
325
+ */
326
+ browserExtensionsEnabled: boolean;
327
+ /**
328
+ * Whether external programs may talk to Agents through the Agent API (default on). Off answers
329
+ * every `/api/amsp/v1` request 403 `agent_api_disabled` (a CORS preflight excepted); every
330
+ * Agent's API switch, approval mode and keys are kept, so turning it on again restores them.
331
+ */
332
+ agentApiEnabled: boolean;
223
333
  }
224
334
  interface ServerSettingsResponse {
225
335
  settings: ServerSettings;
@@ -230,6 +340,10 @@ interface ServerSettingsUpdateRequest {
230
340
  proxyForAgent?: boolean;
231
341
  /** Company mode master switch; see `ServerSettings.companyMode`. */
232
342
  companyMode?: boolean;
343
+ /** Chrome extension switch; see `ServerSettings.browserExtensionsEnabled`. */
344
+ browserExtensionsEnabled?: boolean;
345
+ /** Agent API switch; see `ServerSettings.agentApiEnabled`. */
346
+ agentApiEnabled?: boolean;
233
347
  /**
234
348
  * New proxy address. Accepted forms: any proxy URL undici's dispatcher takes —
235
349
  * `http://`, `https://`, `socks5://` / `socks://`, credentials allowed — or bare
@@ -311,6 +425,19 @@ interface DraftShortcut {
311
425
  title: string;
312
426
  prompt: string;
313
427
  }
428
+ /**
429
+ * The account's keyboard shortcut overrides, one section per platform (the Web App's `Mod` token
430
+ * is ⌘ on macOS and Ctrl elsewhere, so a deliberate macOS-only binding must not leak to Windows).
431
+ * Each section maps a command id to a chord string ("Mod+Shift+KeyW") or null (explicitly
432
+ * unbound); only rows that differ from the Web App's default are present. Bounded on write by
433
+ * services/keybindings.ts.
434
+ */
435
+ interface StoredKeybindings {
436
+ v: 1;
437
+ mac?: Record<string, string | null>;
438
+ windows?: Record<string, string | null>;
439
+ linux?: Record<string, string | null>;
440
+ }
314
441
  /** User UI preferences (SQLite ui_prefs, free-form JSON; known keys declared here). */
315
442
  interface UiPrefs {
316
443
  theme?: "light" | "dark";
@@ -334,14 +461,29 @@ interface UiPrefs {
334
461
  * known key holding user-authored text rather than a flag or an id.
335
462
  */
336
463
  draftShortcuts?: DraftShortcut[];
464
+ /** Keyboard shortcut overrides, replaced whole on every write and validated by services/keybindings.ts. */
465
+ keybindings?: StoredKeybindings;
337
466
  /** Personal company-mode switch (default on): off only hides this user's mode switch; organizations keep running. */
338
467
  companyMode?: boolean;
339
468
  /** The work mode the user last chose in the shell: development (default) or company. */
340
469
  workMode?: "dev" | "company";
341
470
  /** The organization last opened in company mode, as `<projectId>/<orgId>`. */
342
471
  lastOrgKey?: string;
472
+ /** The one group balance shown beside the user name (pinned on the models page); null when unpinned. */
473
+ pinnedBalance?: PinnedBalance | null;
474
+ /**
475
+ * The browser this user's agents drive. Written only through PUT /api/builtin-browser/backend
476
+ * (PUT /api/me/prefs refuses it): absent means built-in for an admin on the desktop, chrome
477
+ * everywhere else.
478
+ */
479
+ browserBackend?: BrowserBackend;
343
480
  [key: string]: unknown;
344
481
  }
482
+ /** A group balance pinned beside the user name: which Project's key reads which group's balance. */
483
+ interface PinnedBalance {
484
+ projectId: string;
485
+ provider: string;
486
+ }
345
487
  interface PrefsResponse {
346
488
  prefs: UiPrefs;
347
489
  }
@@ -395,7 +537,7 @@ interface MemberAddResponse {
395
537
  }
396
538
  /**
397
539
  * Model reference DTO: `(provider, modelId)` pair.
398
- * `modelId` is the upstream request id, sent to AgentHub as-is — `<provider>/<id>` string
540
+ * `modelId` is the upstream request id, sent to MMSP as-is — `<provider>/<id>` string
399
541
  * concatenation is forbidden throughout the pipeline.
400
542
  */
401
543
  interface ModelRefDto {
@@ -408,6 +550,37 @@ interface ModelPricingDto {
408
550
  cacheWrite: number;
409
551
  output: number;
410
552
  }
553
+ /**
554
+ * One group's `[providers.<id>]` connection as the page reads it: the values the GROUP stores
555
+ * (never the catalog's), the key masked. An absent field is unset: a row with no value of its
556
+ * own then gets the client's default.
557
+ */
558
+ interface ProviderConnectionDto {
559
+ baseUrl?: string;
560
+ clientType?: string;
561
+ apiKeyMasked?: string;
562
+ /** When the group key was written (ISO 8601). */
563
+ createdAt?: string;
564
+ }
565
+ /** Where an effective connection value comes from: the row itself, its group, or nowhere (the client's default). */
566
+ type ConnectionSourceDto = "model" | "provider" | "none";
567
+ /**
568
+ * What a row is actually used with, after core's effectiveConnection (row -> group -> none,
569
+ * per field; the file's values only — the catalog is not consulted), and where each value
570
+ * came from. The group's key counts only where it reaches the row (core's groupKeyReaches).
571
+ * The row's own values stay in `clientType` / `credential` (what the form edits); this is for
572
+ * display.
573
+ */
574
+ interface ModelEffectiveConnection {
575
+ baseUrl?: string;
576
+ baseUrlSource: ConnectionSourceDto;
577
+ clientType?: string;
578
+ clientTypeSource: ConnectionSourceDto;
579
+ /** `env` = no row or group key, and the environment lends one on the effective endpoint (modelEnvFallback). */
580
+ apiKeySource: "model" | "provider" | "env" | "none";
581
+ /** Mask of the key the row would use, whichever source; absent when none. */
582
+ apiKeyMasked?: string;
583
+ }
411
584
  /** Read-only credential display: masked key and creation time; plaintext is never sent. */
412
585
  interface CredentialInfo {
413
586
  apiKeyMasked?: string;
@@ -417,7 +590,7 @@ interface CredentialInfo {
417
590
  interface ModelInfo {
418
591
  /** Provider group id (anthropic / openai / …, see core's MODEL_PROVIDERS; custom models use `custom`). */
419
592
  provider: string;
420
- /** Upstream model id (the request id actually sent to AgentHub); paired with `provider` forms the entry's unique key. */
593
+ /** Upstream model id (the request id actually sent to MMSP); paired with `provider` forms the entry's unique key. */
421
594
  modelId: string;
422
595
  /**
423
596
  * Display name: explicit TOML field (user-edited) takes priority, then the built-in catalog;
@@ -427,12 +600,15 @@ interface ModelInfo {
427
600
  */
428
601
  displayName?: string;
429
602
  contextWindow?: number;
430
- /** AgentHub client protocol (`openai-chat`, `openai-responses`, etc.); defaults to AgentHub inferring it from modelId. */
603
+ /**
604
+ * The row's OWN MMSP client type (`openai-chat`, `openai-responses`, etc.) — an override of
605
+ * its group's; absent = the row follows its group (see `effective`).
606
+ */
431
607
  clientType?: string;
432
608
  /**
433
- * Whether image input (vision/multimodal) is supported: the TOML `vision` annotation takes
434
- * priority, falling back to the built-in catalog annotation; if neither exists, defaults to
435
- * unset (= treated as supported).
609
+ * Whether image input (vision/multimodal) is supported: the TOML `vision` annotation only
610
+ * (a new Project writes `false` where the catalog says so); absent = unset, treated as
611
+ * supported. The catalog is not consulted.
436
612
  */
437
613
  vision?: boolean;
438
614
  /**
@@ -445,22 +621,36 @@ interface ModelInfo {
445
621
  /**
446
622
  * Per-model fast mode (TOML `fast_mode` annotation; user-only, never preset by the
447
623
  * built-in catalog): when true, session requests opt into the provider's faster serving
448
- * tier at premium pricing (AgentHub UniConfig `fast_mode`). Only `true` is reported;
624
+ * tier at premium pricing (MMSP UniConfig `fast_mode`). Only `true` is reported;
449
625
  * unset = off. Models without a fast tier reject requests carrying it.
450
626
  */
451
627
  fastMode?: boolean;
452
628
  pricing?: ModelPricingDto;
453
- /** Environment variable name to fall back to when api_key is empty (e.g. ANTHROPIC_API_KEY); unset if no known fallback. */
629
+ /** Running promotion for this row — a fraction in (0, 1) off `pricing`, which is the list price — read from web.db. Absent when the row has none. */
630
+ discount?: number;
631
+ /**
632
+ * Environment variable name the entry falls back to when api_key is empty (e.g.
633
+ * ANTHROPIC_API_KEY); unset when it gets no fallback — an id nothing routes, or an entry
634
+ * whose base URL is not the vendor's own official endpoint (a gateway preset, a custom /
635
+ * vLLM / user-created row with its own endpoint, a vendor row re-pointed at a proxy).
636
+ */
454
637
  envKey?: string;
455
638
  /**
456
639
  * Masked preview (same rule as `credential.apiKeyMasked`) of the value the server process
457
- * currently holds for `envKey` — the plaintext is never serialized. Reported only for
458
- * first-party official entries (vendor group, catalog shape unmodified); gateway, custom
459
- * and user-defined groups never carry it. Absent = the variable is unset or empty, or the
460
- * entry is not first-party.
640
+ * currently holds for `envKey` — the plaintext is never serialized. Reported only where the
641
+ * fallback may be presented as covering the entry (core's modelEnvPreviewKey): a row whose
642
+ * effective base URL is a vendor endpoint (or the Penguin Go relay), or a row with no base URL
643
+ * in a built-in group other than custom, on the client its id's family names. Gateway rows
644
+ * never carry it, and neither do custom / vLLM / user-defined rows with no base URL,
645
+ * although those do fall back. Absent = the variable is unset or empty, or the entry is not
646
+ * previewable. Computed on the effective shape, and only when no row or group key reaches
647
+ * the row.
461
648
  */
462
649
  envKeyMasked?: string;
650
+ /** The row's OWN key (masked) and base URL — overrides of its group's; see `effective`. */
463
651
  credential?: CredentialInfo;
652
+ /** The connection the row is actually used with, and where each value comes from. */
653
+ effective: ModelEffectiveConnection;
464
654
  isDefault: boolean;
465
655
  }
466
656
  interface ModelsResponse {
@@ -475,13 +665,32 @@ interface ModelsResponse {
475
665
  * (the key was fixed since). Absent when the Project has no config file yet.
476
666
  */
477
667
  updatedAt?: string;
668
+ /** Every group's stored connection (`[providers.<id>]`), keyed by provider id; a group with none is absent. */
669
+ providers: Record<string, ProviderConnectionDto>;
478
670
  models: ModelInfo[];
479
671
  }
672
+ /**
673
+ * A change to one group's connection (`PUT /models/providers/:provider`, or a member of
674
+ * `ModelsUpdateRequest.providers`). Omitted fields are kept.
675
+ */
676
+ interface ProviderConnectionUpdate {
677
+ /** `null` clears it; omitted keeps it. */
678
+ baseUrl?: string | null;
679
+ /**
680
+ * `null` or `""` clears it; omitted keeps it. Any group takes one: a row that stores its own
681
+ * protocol keeps it.
682
+ */
683
+ clientType?: string | null;
684
+ /** A non-empty key; sets `createdAt`. Rows with their own key keep it. */
685
+ apiKey?: string;
686
+ /** When true, clears the group key (rows with their own key keep it). */
687
+ clearApiKey?: boolean;
688
+ }
480
689
  /** PUT full-table replace semantics: models not present are deleted; omitting apiKey = keep existing value. Key = (provider, modelId). */
481
690
  interface ModelUpdateEntry {
482
691
  /** Provider group (an independent entry field, always submitted with the request). */
483
692
  provider: string;
484
- /** Upstream model id (sent to AgentHub as-is). */
693
+ /** Upstream model id (sent to MMSP as-is). */
485
694
  modelId: string;
486
695
  /**
487
696
  * Display name; the server does not persist it when it matches the built-in catalog (keeps
@@ -497,7 +706,10 @@ interface ModelUpdateEntry {
497
706
  */
498
707
  renamedFrom?: ModelRefDto;
499
708
  contextWindow?: number;
500
- /** Empty string/omitted = unspecified (AgentHub infers it from modelId). */
709
+ /**
710
+ * Empty string/omitted = the row stores none: it follows its group's protocol, else MMSP
711
+ * routes by the vendor family the modelId begins with.
712
+ */
501
713
  clientType?: string;
502
714
  /** Whether image input (vision/multimodal) is supported; omitted = supported (not persisted). */
503
715
  vision?: boolean;
@@ -506,6 +718,12 @@ interface ModelUpdateEntry {
506
718
  /** Per-model fast mode: only `true` is persisted; omitted or `false` clears the annotation (absent = off). */
507
719
  fastMode?: boolean;
508
720
  pricing?: ModelPricingDto;
721
+ /**
722
+ * Promotion to store for this row, a fraction in (0, 1) off `pricing`; `null` clears it. Omitted
723
+ * keeps the stored promotion — unless this entry renames the row or changes its pricing, which
724
+ * clears it.
725
+ */
726
+ discount?: number | null;
509
727
  /** Providing it overwrites and updates createdAt; omitting it keeps the existing value. */
510
728
  apiKey?: string;
511
729
  /** When true, clears the stored api_key. */
@@ -518,8 +736,29 @@ interface ModelsUpdateRequest {
518
736
  defaultModel?: ModelRefDto;
519
737
  /** Vision model used as a proxy reader for read_file: must be included in models and not annotated vision=false; omitted keeps the existing value. */
520
738
  visionModel?: ModelRefDto;
739
+ /** Group connection changes, merged per provider; a provider absent here keeps its table. */
740
+ providers?: Record<string, ProviderConnectionUpdate>;
521
741
  models: ModelUpdateEntry[];
522
742
  }
743
+ /**
744
+ * `POST /models/sync-presets` (owner): `add` adds the catalog's presets the Project lacks
745
+ * (retired rows never), as a new Project stores them, writes the catalog's
746
+ * `[providers.<id>]` table for a group that has neither rows nor a table yet, and seeds the
747
+ * added rows' promotions, touching nothing else; `restore` puts every built-in row and
748
+ * built-in group table back to the catalog (facts reset, base URLs and protocols set on models
749
+ * or groups return to the catalog's, keys and the user's own rows and groups kept, promotions
750
+ * reset, deleted presets added back).
751
+ */
752
+ type PresetSyncMode = "add" | "restore";
753
+ interface PresetSyncRequest {
754
+ mode: PresetSyncMode;
755
+ }
756
+ interface PresetSyncResponse extends ModelsResponse {
757
+ /** Preset rows added (both modes). */
758
+ added: number;
759
+ /** Built-in rows reset to the catalog (`restore`; 0 for `add`). */
760
+ restored: number;
761
+ }
523
762
  /**
524
763
  * Connectivity test (POST /api/projects/:p/models/test): the model reference is submitted as
525
764
  * a pair in the request body; the rest are optional overrides (for trying out an unsaved
@@ -529,7 +768,7 @@ interface ModelsUpdateRequest {
529
768
  interface ModelTestRequest {
530
769
  /** Provider group of the model under test (paired with modelId). */
531
770
  provider: string;
532
- /** Upstream id of the model under test (sent to AgentHub as-is). */
771
+ /** Upstream id of the model under test (sent to MMSP as-is). */
533
772
  modelId: string;
534
773
  /** Newly entered API key (plaintext); used for the test if provided. */
535
774
  apiKey?: string;
@@ -543,7 +782,7 @@ interface ModelTestRequest {
543
782
  * `undefined` means fall back to the stored value only when not provided.
544
783
  */
545
784
  baseUrl?: string | null;
546
- /** AgentHub client protocol; required for unsaved custom models (otherwise the id can't be auto-routed). */
785
+ /** MMSP client type; required for an unsaved custom model whose id begins with no known vendor family (otherwise it can't be routed). */
547
786
  clientType?: string;
548
787
  /**
549
788
  * Test with fast mode (the frontend always sends the form's current value, so an unsaved
@@ -606,7 +845,7 @@ interface ModelTestResponse {
606
845
  }
607
846
  /**
608
847
  * Protocol auto-detection (POST /api/projects/:p/models/detect, owner): probes which of
609
- * AgentHub's generic protocol clients a custom base URL serves — `openai-responses` first,
848
+ * MMSP's generic protocol clients a custom base URL serves — `openai-responses` first,
610
849
  * then `ant-messages`, then `openai-chat` — and reports the first hit. Used by the custom
611
850
  * model dialog to fill `clientType` from the endpoint itself; costs no tokens (each probe
612
851
  * is a minimal invalid request whose error reveals the protocol shape).
@@ -618,7 +857,12 @@ interface ModelProtocolDetectRequest {
618
857
  apiKey?: string;
619
858
  /** "Clear saved API key" is checked: do not fall back to the stored key (probe the current draft). */
620
859
  clearApiKey?: boolean;
621
- /** Optional paired reference: when it names a stored entry and no apiKey is given, that entry's saved key backs the probes (mirrors the connectivity test). */
860
+ /**
861
+ * Optional paired reference: when it names a stored entry and no apiKey is given, that
862
+ * entry's saved key backs the probes (mirrors the connectivity test), else its group's.
863
+ * `provider` may be sent without `modelId` (the group settings dialog has no model): the
864
+ * group key backs the probes.
865
+ */
622
866
  provider?: string;
623
867
  modelId?: string;
624
868
  }
@@ -632,7 +876,7 @@ interface ModelProtocolDetectRequest {
632
876
  type ProtocolProbeOutcome = "served" | "route_missing" | "server_error" | "junk" | "timeout" | "network_error";
633
877
  /** One probe, for debugging display: the probed URL derives from baseUrl only (never contains the key). */
634
878
  interface ModelProtocolProbeDto {
635
- /** AgentHub client type this probe stands for (`openai-responses` / `ant-messages` / `openai-chat`). */
879
+ /** MMSP client type this probe stands for (`openai-responses` / `ant-messages` / `openai-chat`). */
636
880
  clientType: string;
637
881
  /** Full URL probed (base URL + the protocol's path). */
638
882
  url: string;
@@ -646,7 +890,7 @@ interface ModelProtocolProbeDto {
646
890
  * ones actually run, in order.
647
891
  */
648
892
  interface ModelProtocolDetectResponse {
649
- /** The first protocol an endpoint serves (an AgentHub client type); absent when none of the three matched. */
893
+ /** The first protocol an endpoint serves (an MMSP client type); absent when none of the three matched. */
650
894
  detected?: string;
651
895
  /**
652
896
  * The base URL the detected protocol answered at — the typed URL normalized (endpoint
@@ -660,14 +904,14 @@ interface ModelProtocolDetectResponse {
660
904
  }
661
905
  /**
662
906
  * Endpoint model listing (POST /api/projects/:p/models/list, owner): given a base URL and
663
- * the protocol `/detect` reported, returns every model id the endpoint serves (AgentHub's
907
+ * the protocol `/detect` reported, returns every model id the endpoint serves (MMSP's
664
908
  * `listModels()` on the routed client). Used by the add-group dialog to import a provider's
665
909
  * whole listing in one go; the ids come back in the endpoint's own order.
666
910
  */
667
911
  interface EndpointModelListRequest {
668
912
  /** Endpoint base URL (as typed in the add-group dialog). */
669
913
  baseUrl: string;
670
- /** AgentHub client type to speak (normally a detected generic protocol; whole-endpoint listings need one). */
914
+ /** MMSP client type to speak (normally a detected generic protocol; whole-endpoint listings need one). */
671
915
  clientType: string;
672
916
  /** Newly entered API key (plaintext); omitted = the SDK's environment fallback for the protocol. */
673
917
  apiKey?: string;
@@ -677,7 +921,7 @@ interface EndpointModelListResponse {
677
921
  ok: boolean;
678
922
  /** The model ids the endpoint serves, in the order the endpoint returned them (ok only). */
679
923
  models?: string[];
680
- /** The routed client has no models endpoint (AgentHub UnsupportedOperationError) — callers offer the manual path. */
924
+ /** The routed client has no models endpoint (MMSP UnsupportedOperationError) — callers offer the manual path. */
681
925
  unsupported?: boolean;
682
926
  message?: string;
683
927
  }
@@ -695,6 +939,54 @@ interface DefaultModelUpdateRequest {
695
939
  interface DefaultModelResponse {
696
940
  defaultModel: ModelRefDto;
697
941
  }
942
+ /** One balance in one currency. */
943
+ interface ModelBalanceAmount {
944
+ /** Decimal string in `currency`'s major unit, as the vendor states it (TokenDance's micro-yuan are converted to yuan). */
945
+ amount: string;
946
+ /** ISO 4217 code: `CNY`, `USD`, … */
947
+ currency: string;
948
+ }
949
+ /**
950
+ * Why a group's balance could not be read:
951
+ * - `unsupported`: the group publishes no balance endpoint (no `balance` descriptor in the catalog);
952
+ * - `no_key`: the group has no API key to ask with — none stored, and no environment variable
953
+ * the credential rule lends its rows for the balance endpoint's host;
954
+ * - `upstream_failed`: the vendor could not be reached in time, refused the request, or answered
955
+ * without a readable balance.
956
+ */
957
+ type ModelBalanceErrorCode = "unsupported" | "no_key" | "upstream_failed";
958
+ /**
959
+ * GET /api/projects/:p/models/balance?provider=<group>[&force=1] (Project member): the account
960
+ * balance behind the group's API key — the stored one, or else the environment key its rows
961
+ * fall back to under the credential rule (DeepSeek's DEEPSEEK_API_KEY) — read server-side from
962
+ * the endpoint the catalog's `balance` descriptor names. The key never reaches the browser, and
963
+ * neither does the vendor's own text. Like the connectivity test, a balance that cannot be read is an answer
964
+ * (`ok: false` with a code), not a failed request. Readings and vendor failures are cached for
965
+ * 60 s per Project and group, for as long as the group's key is the same; `force=1` skips the
966
+ * cache and refreshes it.
967
+ */
968
+ type ModelBalanceResponse = ModelBalanceReading | ModelBalanceFailure;
969
+ interface ModelBalanceReading extends ModelBalanceAmount {
970
+ ok: true;
971
+ provider: string;
972
+ /** Whether the account can make requests right now (DeepSeek's `is_available`); absent when the vendor does not say. */
973
+ available?: boolean;
974
+ /** Further currencies the account holds, after the one in `amount` / `currency`; absent when there is only one. */
975
+ others?: ModelBalanceAmount[];
976
+ /** When the server read it from the vendor (ISO 8601); a cached answer keeps its original time. */
977
+ fetchedAt: string;
978
+ }
979
+ interface ModelBalanceFailure {
980
+ ok: false;
981
+ provider: string;
982
+ error: ModelBalanceErrorCode;
983
+ /** The vendor's HTTP status, when it answered with an error. */
984
+ status?: number;
985
+ /** English detail for logs and bug reports; the Web App words each code itself. */
986
+ message: string;
987
+ /** When the answer was settled (ISO 8601). */
988
+ fetchedAt: string;
989
+ }
698
990
  /**
699
991
  * How the authorization code travels back. `callback` sends the browser to a harness URL
700
992
  * the provider redirects to; `manual` asks the provider for a one-time code the user copies
@@ -749,6 +1041,33 @@ interface ModelOAuthCodeResponse {
749
1041
  applied?: number;
750
1042
  error?: ModelOAuthErrorCode;
751
1043
  }
1044
+ interface PlatformAuthStartResponse {
1045
+ flowId: string;
1046
+ authorizeUrl: string;
1047
+ expiresAt: string;
1048
+ }
1049
+ type PlatformAuthFlowErrorCode = "unreachable" | "upstream_failed" | "invalid_key" | "expired" | "locked" | "already_delivered" | "apply_failed";
1050
+ interface PlatformAuthFlowStatusResponse {
1051
+ status: "pending" | "applying" | "completed" | "cancelled" | "apply_failed" | "error";
1052
+ error?: PlatformAuthFlowErrorCode;
1053
+ applied?: number;
1054
+ }
1055
+ /** Result of refreshing Penguin Go's catalog with the Project's stored platform key. */
1056
+ interface PlatformModelSyncResponse extends ModelsResponse {
1057
+ added: number;
1058
+ updated: number;
1059
+ }
1060
+ /**
1061
+ * The wire shapes are Penguin Go's, deliberately: both flows create a request, poll it, and
1062
+ * report the same six states and the same seven failure codes, so the App drives both with one
1063
+ * dialog. They are aliases rather than a second declaration because a copy would be the same
1064
+ * fields with the same meaning, and a shape that drifted apart in one of the two would be a
1065
+ * bug rather than a distinction. The endpoints stay separate regardless — a flow id issued by
1066
+ * one is not accepted by the other.
1067
+ */
1068
+ type ModelScopeAuthStartResponse = PlatformAuthStartResponse;
1069
+ type ModelScopeAuthFlowErrorCode = PlatformAuthFlowErrorCode;
1070
+ type ModelScopeAuthFlowStatusResponse = PlatformAuthFlowStatusResponse;
752
1071
  /**
753
1072
  * Per-Project new-chat defaults: prefill for the chat draft page. Every key is optional —
754
1073
  * an absent key means "not set" (the pre-existing behavior). Serves as the GET response,
@@ -770,6 +1089,11 @@ interface ChatDefaultsDto {
770
1089
  * "none" — only the selectable tiers.
771
1090
  */
772
1091
  thinkingLevel?: Exclude<ThinkingLevelName, "none">;
1092
+ /**
1093
+ * Read-only, GET only: the sandbox policy a new Session starts with — the server's Sandbox
1094
+ * settings. Not part of the Project's block; PUT ignores it.
1095
+ */
1096
+ sandbox?: SessionSandbox;
773
1097
  }
774
1098
  /**
775
1099
  * One deny rule of the sandbox command policy — plain project-editable data. The factory
@@ -820,11 +1144,15 @@ interface VaultEntryUpdate {
820
1144
  interface VaultUpdateRequest {
821
1145
  entries: VaultEntryUpdate[];
822
1146
  }
823
- /** One installed plugin (a skill or a hook package) the library carries a higher version of (see {@link AgentSummary.pluginUpdates}). */
1147
+ /** One library plugin an Agent's installed copy is behind on — one of its skills or its hook package carries an older dated version than the library's same part (see {@link AgentSummary.pluginUpdates}). */
824
1148
  interface PluginUpdateRef {
825
1149
  /** Plugin name — what `POST …/plugins` reinstalls to bring the Agent up to date. */
826
1150
  name: string;
827
- /** The LIBRARY's version (`YYYY.MM.DD.N`), i.e. what installing again would bring, not what is on disk. */
1151
+ /**
1152
+ * The LIBRARY's content version: the newest dated version (`YYYY.MM.DD.N`) among the plugin's
1153
+ * parts, i.e. the date of what installing again would bring, not what is on disk. A label —
1154
+ * it moves whenever any part changes, so a dismissed update comes back for the next one.
1155
+ */
828
1156
  version: string;
829
1157
  }
830
1158
  interface AgentSummary {
@@ -856,15 +1184,35 @@ interface AgentSummary {
856
1184
  hookCount: number;
857
1185
  /**
858
1186
  * Installed plugins the built-in library has moved past — a skill or a hook package whose
859
- * on-disk version is behind the library plugin that ships it — each with the library version
860
- * on offer: the plugin-library update gate, riding along on the Agent list so a badge over
861
- * that page costs no request of its own. Empty when nothing is behind. Skills the library
862
- * does not carry (installed from a zip or a picked directory) are never listed: there is no
863
- * library version for them to be behind.
1187
+ * on-disk dated version is behind the library's same part (compared part by part, never
1188
+ * against the plugin's npm version) — each with the library's content version on offer: the
1189
+ * plugin-library update gate, riding along on the Agent list so a badge over that page costs
1190
+ * no request of its own. Empty when nothing is behind. Skills the library does not carry
1191
+ * (installed from a zip or a picked directory) are never listed: there is no library version
1192
+ * for them to be behind.
864
1193
  */
865
1194
  pluginUpdates: PluginUpdateRef[];
866
1195
  /** Memory count (topic files summed over the scope directories under agent_state/memory/, independent of the memory switch). */
867
1196
  memoryCount: number;
1197
+ /** Whether the Agent's API tab switch is on (this server's web.db, see AgentApiSettings.enabled): the list card's API mark. */
1198
+ apiEnabled: boolean;
1199
+ /**
1200
+ * The organizations of this Project that employ the Agent, one entry per organization:
1201
+ * every organization directory the Project holds, paused ones included, plus the CEO id of
1202
+ * an organization whose chart does not parse. Absent or empty = not an employee. An
1203
+ * employed Agent cannot be deleted (`DELETE` answers 409 `agent_employed`) until it leaves
1204
+ * every one of them; development mode lists employees in a section of their own.
1205
+ */
1206
+ employments?: Employment[];
1207
+ }
1208
+ /** One organization employing an Agent, as the Agent list carries it (see {@link AgentSummary.employments}). */
1209
+ interface Employment {
1210
+ orgId: string;
1211
+ /** The organization's display name (`org_config.toml`), the id when the config does not parse. */
1212
+ orgName: string;
1213
+ /** The Agent's title in that organization's chart; "CEO" for the CEO of a chart that does not parse. */
1214
+ title: string;
1215
+ status: OrgStatus;
868
1216
  }
869
1217
  interface AgentsResponse {
870
1218
  agents: AgentSummary[];
@@ -1012,13 +1360,20 @@ interface AgentKernelUpdateResponse {
1012
1360
  /** The kernel stamp written (the current defaults generation). */
1013
1361
  kernelVersion: string;
1014
1362
  }
1015
- /** POST …/config/mcp-test result: reachability of one MCP Server entry. */
1363
+ /**
1364
+ * POST …/config/mcp-test result: reachability of one MCP Server entry. Its `${KEY}` references
1365
+ * are filled in from the Agent's vault only when the entry is saved on the Agent exactly as
1366
+ * tested (same name, same config — the user's rule); a new or changed entry that references the
1367
+ * vault is not filled in and not contacted (`saveFirst`).
1368
+ */
1016
1369
  interface McpServerTestResponse {
1017
1370
  ok: boolean;
1018
1371
  /** Discovered tool names (`mcp__<server>__<tool>`), present on success. */
1019
1372
  tools?: string[];
1020
- /** Failure detail (connect error, timeout, server stderr tail), present on failure. */
1373
+ /** Failure detail (connect error, timeout, server stderr tail; "needs setup: …" naming a vault key a saved entry references and the vault lacks, with nothing contacted), present on failure. */
1021
1374
  error?: string;
1375
+ /** The entry references the vault and is not saved as it is: nothing was filled in or contacted — save it, then test (`error` says so in English). */
1376
+ saveFirst?: boolean;
1022
1377
  /** Connect + discovery wall time (both outcomes) — the models test reports latency, this matches. */
1023
1378
  latencyMs?: number;
1024
1379
  }
@@ -1054,6 +1409,61 @@ interface AgentConfigUpdateRequest {
1054
1409
  mcpServers?: MCPServerConfig[];
1055
1410
  };
1056
1411
  }
1412
+ /** One API key of an Agent, as listed: the secret itself is shown once, at creation, and never again. */
1413
+ interface AgentApiKeyInfo {
1414
+ keyId: string;
1415
+ /** 1-64 characters, given by whoever created it. */
1416
+ name: string;
1417
+ /** The key's first 16 characters (`penguin_` + 8), enough to tell keys apart. */
1418
+ prefix: string;
1419
+ /** user_id of the Project owner who created it. */
1420
+ createdBy: string;
1421
+ createdAt: string;
1422
+ /** Last run request that authenticated with it; null = never used. */
1423
+ lastUsedAt: string | null;
1424
+ }
1425
+ /**
1426
+ * One Agent's public API settings — this server's, kept in web.db, never in the Agent State or
1427
+ * the Project file, so the Agent cannot expose itself or loosen its own approvals. An Agent
1428
+ * never configured reads as disabled, keyed, allow-all, with no keys.
1429
+ */
1430
+ interface AgentApiSettings {
1431
+ /** The API tab's switch; off = every AMSP request for this Agent is 404 `agent_not_found`. */
1432
+ enabled: boolean;
1433
+ /** Keyless access: a request without `Authorization` is accepted; off = 401 `unauthorized`. */
1434
+ open: boolean;
1435
+ /**
1436
+ * The approval mode an API Session is created with. It is copied onto each API Session when
1437
+ * that Session is created, and the Session's own mode is what every decision reads, so a
1438
+ * change here applies to API Sessions created afterwards.
1439
+ */
1440
+ approvalMode: ApprovalMode;
1441
+ keys: AgentApiKeyInfo[];
1442
+ }
1443
+ interface AgentApiResponse {
1444
+ api: AgentApiSettings;
1445
+ /**
1446
+ * The admin's server-wide switch (`ServerSettings.agentApiEnabled`), which only an admin can
1447
+ * read through /api/admin/settings: off, every Agent's API is refused (403) whatever `api` says.
1448
+ */
1449
+ serverEnabled: boolean;
1450
+ }
1451
+ /** PUT body (owner only): every field optional, omitted fields keep their current value. */
1452
+ interface AgentApiUpdateRequest {
1453
+ enabled?: boolean;
1454
+ open?: boolean;
1455
+ approvalMode?: ApprovalMode;
1456
+ }
1457
+ /** POST …/api/keys body (owner only). */
1458
+ interface AgentApiKeyCreateRequest {
1459
+ /** 1-64 characters. */
1460
+ name: string;
1461
+ }
1462
+ /** The one response that carries the secret (`penguin_` + 43 base64url characters); only its hash is stored. */
1463
+ interface AgentApiKeyCreateResponse {
1464
+ key: AgentApiKeyInfo;
1465
+ secret: string;
1466
+ }
1057
1467
  /** One Memory scope directory: `agent_state/memory/user/` or `agent_state/memory/<workspaceKey>/`. */
1058
1468
  interface MemoryScopeInfo {
1059
1469
  /** Directory name under `memory/`: `user`, or a Workspace's `<safe-basename>-<hash>` key. */
@@ -1163,16 +1573,119 @@ interface MemoryImportResponse {
1163
1573
  /** Whether the scope's `MEMORY.md` was written or extended. */
1164
1574
  indexWritten: boolean;
1165
1575
  }
1576
+ /** How far a Session's commands may reach the filesystem (the sandbox's confinement mode). */
1577
+ type SessionSandboxMode = "read-only" | "workspace-write" | "danger-full-access";
1578
+ /**
1579
+ * The part of a Session's sandbox policy a person picks from the composer: the filesystem
1580
+ * mode and the network level. The Session keeps its own copy — taken from the server's
1581
+ * Sandbox settings when it was created — so editing those settings only changes what NEW
1582
+ * Sessions start with.
1583
+ */
1584
+ interface SessionSandbox {
1585
+ mode: SessionSandboxMode;
1586
+ /** `open` = unrestricted, `local` = only the host's localhost, `none` = no network. */
1587
+ network: SessionSandboxNetwork;
1588
+ /**
1589
+ * Response only, ignored in requests: whether a sandbox backend on this server can enforce
1590
+ * the `read-only` and `workspace-write` modes. False on a deployment with no backend
1591
+ * installed, where either mode would refuse every command: the composer shows them greyed
1592
+ * out, saying no backend is installed.
1593
+ */
1594
+ confinementSupported?: boolean;
1595
+ /** Response only, ignored in requests: the same for the `none` network level. */
1596
+ noNetworkSupported?: boolean;
1597
+ /**
1598
+ * Response only, ignored in requests: whether a sandbox backend on this server can enforce
1599
+ * the `local` level. When false the composer shows it greyed out, and picking it is refused
1600
+ * (400 `sandbox_unsupported`).
1601
+ */
1602
+ localNetworkSupported?: boolean;
1603
+ /** Response only, ignored in requests: whether a backend here can enforce `masksPaths`. */
1604
+ maskPathsSupported?: boolean;
1605
+ /**
1606
+ * Response only, ignored in requests: true when this policy hides paths (the Sandbox card's
1607
+ * masked paths, kept by every pick). Where `maskPathsSupported` is false, every level then
1608
+ * refuses every command, and the composer says so.
1609
+ */
1610
+ masksPaths?: boolean;
1611
+ /**
1612
+ * Response only, ignored in requests: the names of the sandbox backends in use here, which the
1613
+ * composer names when a level is beyond what they enforce. Absent with none in use.
1614
+ */
1615
+ backendsInUse?: string[];
1616
+ /**
1617
+ * Response only, ignored in requests: the sandbox backends that are enabled here but failed
1618
+ * to load or failed their check (a WSL distro not set up, a wrong program path), each with
1619
+ * why. A backend for another platform is not listed. With none mounted and one listed, the
1620
+ * composer marks the confining levels unavailable and gives the first one's reason.
1621
+ */
1622
+ unavailableBackends?: UnavailableSandboxBackend[];
1623
+ /**
1624
+ * Response only, ignored in requests: the server's sandbox presets (the Sandbox card's table),
1625
+ * in table order, disabled rows included. The composer lists the enabled ones and names the
1626
+ * Session's level by the first row matching its mode, network and approval mode. A server
1627
+ * that does not report it gets the composer's built-in table.
1628
+ */
1629
+ presets?: SessionSandboxPreset[];
1630
+ /**
1631
+ * Response only, ignored in requests: true when this Session's policy holds something the
1632
+ * presets do not show — masked paths, or the temp directory not writable.
1633
+ */
1634
+ advanced?: boolean;
1635
+ /**
1636
+ * Response only, chat defaults only: the approval mode a new Session starts with when its
1637
+ * request names none — the Sandbox card's default preset's, while the switch is on. Absent:
1638
+ * the server's own fallback (`allow-all`).
1639
+ */
1640
+ defaultApprovalMode?: ApprovalMode;
1641
+ /**
1642
+ * Response only, ignored in requests: the Sandbox card's switch on this server — whether new
1643
+ * Sessions start confined. Off, the composer offers the approval modes alone (a Session keeps
1644
+ * its own policy either way). A server that does not report it is read as on.
1645
+ */
1646
+ switchOn?: boolean;
1647
+ }
1648
+ /** One sandbox preset: a named mode, network level and approval mode. */
1649
+ interface SessionSandboxPreset {
1650
+ id: string;
1651
+ /** The name an administrator gave it, or its declared English name. */
1652
+ name: string;
1653
+ /** Its declared Chinese name, while it has not been renamed. */
1654
+ nameZh?: string;
1655
+ /** Whether the composer's menu lists it. */
1656
+ enabled: boolean;
1657
+ mode: SessionSandboxMode;
1658
+ network: SessionSandboxNetwork;
1659
+ approvalMode: ApprovalMode;
1660
+ /**
1661
+ * Response-only: its file mode or network is wider than the server's sandbox settings (the
1662
+ * ceiling for non-admins), so a non-admin's pick of it is refused with `403 sandbox_forbidden`.
1663
+ * The same comparison as that refusal; absent when it is within them.
1664
+ */
1665
+ aboveCeiling?: true;
1666
+ }
1667
+ /** An enabled sandbox backend that is not in use on this server, and why. */
1668
+ interface UnavailableSandboxBackend {
1669
+ name: string;
1670
+ reason: string;
1671
+ }
1672
+ /** The network levels, widest first. */
1673
+ type SessionSandboxNetwork = "open" | "local" | "none";
1166
1674
  interface SessionInfo {
1167
1675
  sessionId: string;
1168
1676
  projectId: string;
1169
1677
  agentId: string;
1170
- /** Provider group of the session's model (paired with `modelId` to form a model reference). */
1678
+ /**
1679
+ * Provider group of the session's **current** model (paired with `modelId` to form a model
1680
+ * reference). It moves with each in-session switch (`POST /api/sessions/:id/switch-model`).
1681
+ */
1171
1682
  provider: string;
1172
- /** Upstream model_id of the session's model (the request id sent to AgentHub). */
1683
+ /** Upstream model_id of the session's current model (the request id sent to MMSP). */
1173
1684
  modelId: string;
1174
1685
  workspace: string;
1175
1686
  approvalMode: ApprovalMode;
1687
+ /** The Session's own sandbox policy (see {@link SessionSandbox}). */
1688
+ sandbox: SessionSandbox;
1176
1689
  /**
1177
1690
  * Thinking level pinned for this Session (set via PATCH; the Web App's in-chat picker).
1178
1691
  * Unset = never pinned: each model context the Session opens reads the Agent config's
@@ -1185,7 +1698,18 @@ interface SessionInfo {
1185
1698
  thinkingLevel?: ThinkingLevelName;
1186
1699
  /** Short title auto-generated by the model after the first turn; unset until generated (frontend shows "New Chat"). */
1187
1700
  title?: string;
1188
- /** Session source (for list badges/folders), derived from core session_meta — the single source of truth (not stored in the DB); unset for user-created sessions. */
1701
+ /**
1702
+ * What kind of conversation this is, read from core session_meta — the single source of
1703
+ * truth (the DB stores no source). With the user's marks it decides where the Session is
1704
+ * listed (`archived`): a `user` Session is in the sidebar until archived; an `api`,
1705
+ * `schedule` or `cli` Session is archived until the user keeps it, and in the sidebar marked
1706
+ * with its source once kept; a `subagent` or `company` Session is in no list — its parent's
1707
+ * Agent panel and company mode's own views open them. A Trace head that records no source
1708
+ * (written before it was required) reads as `company` for a row the organization runtime
1709
+ * opened (`client: "org"`), else as `user`; so does such a row before its first run. Absent
1710
+ * only while any other row is not yet classified (its Trace head has not been read yet),
1711
+ * which renders as `user`.
1712
+ */
1189
1713
  source?: SessionSource;
1190
1714
  createdAt: string;
1191
1715
  /**
@@ -1211,7 +1735,13 @@ interface SessionInfo {
1211
1735
  pendingFollowUpCount: number;
1212
1736
  /** Whether a Trace record exists (a Task has been started). */
1213
1737
  hasTrace: boolean;
1214
- /** Whether archived (hidden from the default list, grouped under "Archived"). */
1738
+ /**
1739
+ * Whether the Session is archived — the listing rule's answer, never the bare mark: the user
1740
+ * archived it, or a program opened it (source `api`, `schedule` or `cli`) and the user has
1741
+ * not kept it. An archived Session is left out of the sidebar and listed on the archive page
1742
+ * (`/api/me/archived-sessions`). Always false for a `subagent` or `company` Session, which is
1743
+ * in no list.
1744
+ */
1215
1745
  archived: boolean;
1216
1746
  /**
1217
1747
  * Absolute path of the session's latest Trace file (the current context shard); absent
@@ -1226,22 +1756,23 @@ interface SessionInfo {
1226
1756
  /**
1227
1757
  * Company mode: the organization that owns this Session — a desk session of one of its
1228
1758
  * employees, or a session contributing to one of its tickets — read from the organization
1229
- * caches. Absent for every ordinary Session. Development mode's list and its time buckets
1230
- * hide every row that carries it (only while company mode is available to that user: it is
1231
- * stamped either way, and company mode is what lists these Sessions instead), and the
1232
- * company sidebar's 工位 / 工单会话 groups are where they are listed.
1759
+ * caches. Absent for every ordinary Session. Development mode's list asks the server to
1760
+ * leave every such row out (`excludeOrg=1` on the list route — page and totals alike) and
1761
+ * still drops one that reaches it by another door; the company sidebar's 工位 group and the
1762
+ * tickets are where these Sessions are reached instead.
1233
1763
  */
1234
1764
  orgId?: string;
1235
1765
  /**
1236
1766
  * Which client opened the Session, as stored on the index row: "cli" from the CLI (a
1237
1767
  * Session adopted from a legacy CLI-direct Trace included), "org" from the organization
1238
- * runtime (a desk or a ticket session), "web" otherwise. Absent only on a row that
1239
- * predates the column, which reads as "web". Unlike {@link SessionInfo.orgId} — projected
1240
- * from the organization caches, so it disappears with the organization and is not read
1241
- * while company mode is off — this is a durable stamp on the row: development mode's list
1242
- * hides an "org" Session either way.
1768
+ * runtime (a desk or a ticket session, and every sub-session one of those spawns), "api"
1769
+ * from an Agent API run (the only Sessions the API may continue), "web" otherwise. Absent
1770
+ * only on a row that predates the column, which reads as "web". Unlike
1771
+ * {@link SessionInfo.orgId} — projected from the organization caches, so it disappears with
1772
+ * the organization and is not read while company mode is off — this is a durable stamp on
1773
+ * the row: development mode's list hides an "org" Session either way.
1243
1774
  */
1244
- client?: "web" | "cli" | "org";
1775
+ client?: "web" | "cli" | "org" | "api";
1245
1776
  /**
1246
1777
  * Background work the Session's loaded runtime still owns: command sessions running past
1247
1778
  * their yield window (`exec_command` promotions and `run_in_background` launches) and
@@ -1261,45 +1792,241 @@ interface SessionBackgroundTasks {
1261
1792
  subagents: number;
1262
1793
  }
1263
1794
  /**
1264
- * Session list category, the sidebar's five-way split applied server-side: archived wins
1265
- * regardless of origin (archiving is an explicit user action), then the origin's bucket,
1266
- * and a Session with no (or an unknown) source is `active` — user-created rows.
1795
+ * Session list category, the listing rule applied server-side: `archived` when the user
1796
+ * archived the Session, or when a program opened it (source `api`, `schedule` or `cli`) and the
1797
+ * user has not kept it — unarchiving keeps it; otherwise `active`. A `subagent` or `company`
1798
+ * Session belongs to neither, whatever its marks: the list leaves it out of every category and
1799
+ * every total (a parent's Agent panel and company mode's own views open them).
1267
1800
  */
1268
- type SessionCategory = "active" | SessionSource | "archived";
1801
+ type SessionCategory = "active" | "archived";
1269
1802
  /** Per-category totals across an Agent's whole Session list (returned when the list is requested with counts). */
1270
1803
  type SessionCategoryCounts = Record<SessionCategory, number>;
1804
+ /**
1805
+ * GET /api/projects/:projectId/agents/:agentId/sessions. Every query parameter is optional:
1806
+ *
1807
+ * - `order`: `created` (the default) lists newest creation first; `activity` lists most recent
1808
+ * `lastActiveAt` first, ties broken by `sessionId` descending, both compared as plain strings
1809
+ * (code points, never locale collation) so a client can compute the same order.
1810
+ * - `limit` (1–1000) with `offset` (≥ 0): an offset page, in either order. Offsets suit only the
1811
+ * `created` order, which activity never reshuffles.
1812
+ * - `before=<lastActiveAt>,<sessionId>` with `limit`: under `order=activity` only, the rows
1813
+ * strictly below that cursor — the key of the last row the client holds. A row that becomes
1814
+ * active between pages moves above the cursor and is not served again, and no other row is
1815
+ * skipped (`session_state` tells the client about the moved one). 400 without
1816
+ * `order=activity`, beside `offset`, without `limit`, or when not a parseable stamp and a
1817
+ * valid id split at the first comma.
1818
+ * - `category`, `workspaceGroup`, `excludeOrg=1` filter before paging; `counts=1` adds the
1819
+ * whole-list totals below, which no cursor or offset narrows. A request with `category`,
1820
+ * `workspaceGroup` or `counts=1` leaves every `subagent` and `company` Session out of the page
1821
+ * and the totals (they are in no category); one with none of them serves every row.
1822
+ */
1271
1823
  interface SessionsResponse {
1824
+ /**
1825
+ * The page. With `excludeOrg=1` on the request, the rows an organization owns — its desk
1826
+ * and ticket sessions and the sub-sessions they spawned — are left out of it and of every
1827
+ * total below, so a caller drawing the user's own conversations is never handed a total
1828
+ * for rows it will not be handed. Without the flag every row is served, whichever client
1829
+ * created it.
1830
+ */
1272
1831
  sessions: SessionInfo[];
1273
1832
  /** Present when the request asked for counts (`counts=1`): totals per category over the full list, not just the returned page. */
1274
1833
  counts?: SessionCategoryCounts;
1275
1834
  /**
1276
1835
  * Present with `counts`: the same totals broken down by Workspace path (only paths
1277
1836
  * with at least one Session appear). The sidebar's workspace grouping decides each
1278
- * group's folders and "More" from its own share, so a group never advertises
1837
+ * group's existence and "More" from its own active share, so a group never advertises
1279
1838
  * content that lives in other Workspaces.
1280
1839
  */
1281
1840
  workspaceCounts?: Record<string, SessionCategoryCounts>;
1282
1841
  /**
1283
1842
  * Present with `counts`: each Workspace path's newest Session (any category), as its
1284
- * `createdAt`. With `workspaceCounts` this is what lets the sidebar list every Workspace
1285
- * that holds Sessions and place the groups by recency before — or without — loading any
1286
- * of their rows.
1843
+ * `createdAt` — the Workspace picker's "recently used", which counts every Session that
1844
+ * worked there.
1287
1845
  */
1288
1846
  workspaceLatest?: Record<string, string>;
1847
+ /**
1848
+ * Present with `counts`: each Workspace path's newest `active` Session, as its `createdAt`
1849
+ * (a path holding none is absent). With `workspaceCounts` this is what lets the sidebar list
1850
+ * every Workspace that holds conversations and place the groups by recency before — or
1851
+ * without — loading any of their rows; an archived Session does not move a group it is not
1852
+ * shown in.
1853
+ */
1854
+ workspaceLatestActive?: Record<string, string>;
1855
+ }
1856
+ /**
1857
+ * The archive page's source filter: `user` is a conversation the user archived by hand (source
1858
+ * `user`, or a row whose Trace has not been read yet); the other three are what a program
1859
+ * opened. `subagent` and `company` Sessions are never archived, so never listed.
1860
+ */
1861
+ type ArchivedSessionSource = "user" | "api" | "schedule" | "cli";
1862
+ /** Query of GET /api/me/archived-sessions/groups, and the part every archive query shares. */
1863
+ interface ArchivedSessionsQuery {
1864
+ /** Case-insensitive substring of the title (the DB title, else the Trace's first-prompt title); at most 200 characters. */
1865
+ q?: string;
1866
+ source?: ArchivedSessionSource;
1867
+ /** One Project the user can open (404 `project_not_found` otherwise); absent = every Project they own or are a member of. */
1868
+ projectId?: string;
1869
+ }
1870
+ /** One group of the archive page: one Workspace of one Project. */
1871
+ interface ArchivedSessionGroup {
1872
+ projectId: string;
1873
+ projectName: string;
1874
+ /** The Workspace path, as the sidebar groups it; `temp` for the merged temporary Workspaces. */
1875
+ workspace: string;
1876
+ /** Archived Sessions in the group matching the query. */
1877
+ count: number;
1878
+ /** The newest `lastActiveAt` in the group — the order the groups come in, newest first. */
1879
+ latest: string;
1880
+ }
1881
+ /** GET /api/me/archived-sessions/groups. */
1882
+ interface ArchivedSessionGroupsResponse {
1883
+ groups: ArchivedSessionGroup[];
1884
+ /** Sum of the groups' counts. */
1885
+ total: number;
1886
+ /**
1887
+ * The server's time when these counts were taken (ISO). A group's batch passes it as its
1888
+ * filter's `until`, so it acts on the Sessions the count saw and on none that came after.
1889
+ */
1890
+ asOf: string;
1891
+ }
1892
+ /** Query of GET /api/me/archived-sessions: one group's page, newest activity first. */
1893
+ interface ArchivedSessionsRowsQuery extends ArchivedSessionsQuery {
1894
+ projectId: string;
1895
+ /** The group's `workspace` (a path, or `temp`). */
1896
+ workspace: string;
1897
+ /** 1–100. */
1898
+ limit: number;
1899
+ /** `<lastActiveAt>,<sessionId>` of the last row held, as the Session list's cursor. */
1900
+ before?: string;
1901
+ }
1902
+ /** GET /api/me/archived-sessions. */
1903
+ interface ArchivedSessionsResponse {
1904
+ /** `title` falls back to the Trace's first-prompt title when the row has none. */
1905
+ sessions: SessionInfo[];
1906
+ hasMore: boolean;
1907
+ }
1908
+ /** What an archive-page batch acts on: explicit ids (1–500), or every archived row a filter matches. */
1909
+ type ArchivedSessionsBatch = {
1910
+ sessionIds: string[];
1911
+ } | {
1912
+ filter: ArchivedSessionsBatchFilter;
1913
+ };
1914
+ /** A batch's filter: the archive query, one group's Workspace, and the snapshot it was counted at. */
1915
+ interface ArchivedSessionsBatchFilter extends ArchivedSessionsQuery {
1916
+ workspace?: string;
1917
+ /**
1918
+ * The groups response's `asOf` the user acted on (ISO): only Sessions archived by then and
1919
+ * not active since are acted on, so one archived or run after the count is left alone.
1920
+ */
1921
+ until?: string;
1922
+ /** Sessions left out although the filter matches them — rows unticked after Select all (1–500). */
1923
+ exclude?: string[];
1924
+ }
1925
+ /** POST /api/me/archived-sessions/unarchive and /delete. */
1926
+ interface ArchivedSessionsBatchResponse {
1927
+ /**
1928
+ * Sessions acted on. Unarchive counts only the ones that were archived. Delete counts every
1929
+ * named one; a filter's delete leaves a running Session alone (it is not aborted) and does not
1930
+ * count it.
1931
+ */
1932
+ done: number;
1933
+ /** Ids that name nothing the user can open (the ids form only; a filter never reports any). */
1934
+ missing: string[];
1935
+ }
1936
+ /**
1937
+ * One page request inside POST /api/projects/:p/sessions/batch — the same knobs the
1938
+ * Agent-level list takes, carried per entry so one call can stand in for a whole sidebar
1939
+ * reload (one first page per Agent, plus every other page pair already open).
1940
+ */
1941
+ interface SessionBatchPageRequest {
1942
+ agentId: string;
1943
+ /** Rows per page, 1–1000. */
1944
+ limit: number;
1945
+ /** `activity`: last activity first — the sidebar's order. Omitted: creation order. */
1946
+ order?: "created" | "activity";
1947
+ /** Rows to skip from the top (default 0). Not beside `before`. */
1948
+ offset?: number;
1949
+ /**
1950
+ * Activity order only: rows strictly below this cursor — the last row of the previous page
1951
+ * (`lastActiveAt` + `sessionId`, the pair the list endpoint's `before` param carries).
1952
+ */
1953
+ before?: {
1954
+ lastActiveAt: string;
1955
+ sessionId: string;
1956
+ };
1957
+ category?: SessionCategory;
1958
+ workspaceGroup?: string;
1959
+ /**
1960
+ * Totals per category over the Agent's whole list, with the per-Workspace counts and newest
1961
+ * stamps beside them (`counts=1` on the Agent-level list).
1962
+ */
1963
+ withCounts?: boolean;
1964
+ /** The user's own rows only: leave an organization's own sessions out of page and totals. */
1965
+ excludeOrg?: boolean;
1966
+ }
1967
+ /**
1968
+ * One entry's answer. `ok: false` is a real answer about THAT Agent, never about the batch:
1969
+ * `absent` is an Agent this server does not host (its rows come from the machine that does),
1970
+ * `error` is a failure to answer at all — which the caller must not read as "no rows".
1971
+ */
1972
+ type SessionBatchResult = ({
1973
+ agentId: string;
1974
+ ok: true;
1975
+ } & SessionsResponse) | {
1976
+ agentId: string;
1977
+ ok: false;
1978
+ reason: "absent" | "error";
1979
+ };
1980
+ interface SessionsBatchRequest {
1981
+ requests: SessionBatchPageRequest[];
1289
1982
  }
1290
- /** Server directory browsing (advanced new-Workspace picker): starts from the home directory by default, can navigate up to the root. */
1983
+ interface SessionsBatchResponse {
1984
+ /** One entry per requested page, in request order (repeated Agent ids stay repeated). */
1985
+ results: SessionBatchResult[];
1986
+ }
1987
+ /** Server directory browsing (the Workspace picker): starts from the home directory by default, can navigate up to the root. */
1291
1988
  interface DirEntryInfo {
1292
1989
  name: string;
1293
- /** Absolute path of this subdirectory (can be submitted directly as a Workspace). */
1990
+ /** Absolute path of this entry (a folder's can be submitted directly as a Workspace). */
1991
+ path: string;
1992
+ /**
1993
+ * `file` for anything that is not a folder (a symlink counts as what it points to). Absent
1994
+ * means a folder: a machine listed over ssh reports folders only.
1995
+ */
1996
+ kind?: "dir" | "file";
1997
+ /** Last modification, epoch milliseconds; absent when unknown (listings over ssh, an entry stat could not reach). */
1998
+ mtime?: number;
1999
+ /** Hidden by the machine's own rules beyond the dot-name convention (Windows hidden/system attribute). */
2000
+ hidden?: true;
2001
+ }
2002
+ /** A storage location the machine offers beside its folders: a Windows drive, a macOS volume, a Linux root or mount. */
2003
+ interface DirLocation {
2004
+ /** Absolute path it opens (`C:\`, `/`, `/Volumes/USB`, `/media/me/USB`, `/mnt/c`). */
1294
2005
  path: string;
2006
+ kind: "drive" | "removable" | "network" | "optical" | "volume" | "root";
2007
+ /** The machine's own name for it (volume label, volume name, share `\\nas\media`, WSL `C:`); absent when none. */
2008
+ label?: string;
2009
+ }
2010
+ /** The platform's standard folders as that machine resolves them; only those that exist. */
2011
+ interface DirStandardFolders {
2012
+ desktop?: string;
2013
+ documents?: string;
2014
+ downloads?: string;
2015
+ pictures?: string;
1295
2016
  }
1296
2017
  interface DirListResponse {
1297
2018
  /** Absolute path of the current directory (realpath). */
1298
2019
  path: string;
1299
2020
  /** Absolute path of the parent directory; null when already at the root. */
1300
2021
  parent: string | null;
1301
- /** Subdirectory list (sorted by name, files excluded). */
2022
+ /** Entries sorted by name, hidden ones included (the picker drops them). */
1302
2023
  entries: DirEntryInfo[];
2024
+ /** The listed machine's `process.platform`; absent for a machine listed over ssh. */
2025
+ platform?: string;
2026
+ /** Home request with `places=1` only. */
2027
+ standardFolders?: DirStandardFolders;
2028
+ /** Home request with `places=1` only, in the order the sidebar lists them. */
2029
+ locations?: DirLocation[];
1303
2030
  }
1304
2031
  /** One Skill found in a picked directory: metadata plus which of the two layouts it came from. */
1305
2032
  interface DirectorySkillItem extends SkillMetadataItem {
@@ -1325,6 +2052,11 @@ interface SessionCreateRequest {
1325
2052
  workspace?: string;
1326
2053
  /** Defaults to allow-all. */
1327
2054
  approvalMode?: ApprovalMode;
2055
+ /**
2056
+ * The Session's sandbox policy; either half omitted takes the server's Sandbox settings.
2057
+ * A non-admin may not pick anything looser than those settings (403 `sandbox_forbidden`).
2058
+ */
2059
+ sandbox?: Partial<SessionSandbox>;
1328
2060
  /**
1329
2061
  * Creating-client hint stored on the Session row: "cli" when the CLI creates the
1330
2062
  * Session through the API, "org" when the organization runtime opened it (a desk or a
@@ -1332,16 +2064,17 @@ interface SessionCreateRequest {
1332
2064
  * not the organization still exists); defaults to "web". A REQUEST may send only "web" or
1333
2065
  * "cli": the runtime writes "org" by calling the service directly, so no caller can claim
1334
2066
  * an organization's provenance for its own Session. Lists serve every row regardless of
1335
- * client; only development mode's session list filters on it.
2067
+ * client unless asked for the user's own rows only (`excludeOrg=1`), which is what
2068
+ * development mode's session list asks for.
1336
2069
  */
1337
2070
  client?: "web" | "cli" | "org";
1338
2071
  /**
1339
- * Marks the Session as created by a Benchmark evaluation or optimization (the Evaluation
1340
- * Center's Use flows, and the Test Sessions agent-evaluation launches through the CLI). Only
1341
- * this value is accepted from a client: `subagent` and `schedule` are written by the server
1342
- * itself. The Web App files such Sessions into the Evaluations folder of the session list.
2072
+ * The Session's source, when it is not a person's conversation: only `cli` is accepted from
2073
+ * a client (`penguin run` sends it); every other source is the server's own to write, and
2074
+ * absent means `user`. The retired `benchmark` is still accepted, as `cli`, until 0.3.0, for
2075
+ * an older CLI or Web App that still sends it.
1343
2076
  */
1344
- source?: "benchmark";
2077
+ source?: "cli";
1345
2078
  }
1346
2079
  interface SessionCreateResponse {
1347
2080
  session: SessionInfo;
@@ -1369,6 +2102,11 @@ interface SessionResponse {
1369
2102
  }
1370
2103
  interface SessionPatchRequest {
1371
2104
  approvalMode?: ApprovalMode;
2105
+ /**
2106
+ * Change this Session's sandbox policy; applies from its next command. A non-admin may not
2107
+ * pick anything looser than the server's Sandbox settings (403 `sandbox_forbidden`).
2108
+ */
2109
+ sandbox?: Partial<SessionSandbox>;
1372
2110
  /**
1373
2111
  * Pin this Session's thinking level (`none | low | medium | high | xhigh | max`, anything else
1374
2112
  * is a 400). It replaces the Agent-config fallback for this Session and applies from the
@@ -1377,7 +2115,11 @@ interface SessionPatchRequest {
1377
2115
  * is no unpin: the picker only offers concrete levels.
1378
2116
  */
1379
2117
  thinkingLevel?: ThinkingLevelName;
1380
- /** Archive / unarchive (default list hides archived). */
2118
+ /**
2119
+ * `true` archives (clears the keep mark); `false` unarchives and writes the keep mark, so a
2120
+ * background Session stays in the sidebar through later runs. Announced as `session_archived`.
2121
+ * 409 `session_not_listed` on a `subagent` or `company` Session, which is in no list.
2122
+ */
1381
2123
  archived?: boolean;
1382
2124
  /** Manual rename; non-empty string, overrides the auto-generated title. */
1383
2125
  title?: string;
@@ -1413,7 +2155,10 @@ interface MessagesLiveTail {
1413
2155
  * only; the parameterless full read never carries it). A window is a run of whole
1414
2156
  * message-bearing units — one unit = one Task in the Web reducer's sense, opened by a
1415
2157
  * main-session user prompt — cut so that no pairing (tool_call/output), compaction span
1416
- * or steering group ever splits across windows.
2158
+ * or steering group ever splits across windows. Besides the unit count, a window stops
2159
+ * before the unit that would take its serialized messages past 4 MiB, but always holds at
2160
+ * least one unit; such a window carries `before` like any other, with fewer units than
2161
+ * asked for.
1417
2162
  */
1418
2163
  interface MessagesPageInfo {
1419
2164
  /**
@@ -1449,9 +2194,26 @@ interface MessagesPageInfo {
1449
2194
  sessionTokens: number;
1450
2195
  contextTokens: number;
1451
2196
  };
2197
+ /**
2198
+ * The model of the context this window starts in — what the `session_meta` heading that
2199
+ * context's Trace file names. A Session can switch models between contexts, and a window
2200
+ * that starts partway into one does not hold that record: the client seeds it, so the Tasks
2201
+ * ahead of the window's first `session_meta` have their model, and a switch further down the
2202
+ * window is told from a plain rotation. Absent when the Session has no Trace yet.
2203
+ */
2204
+ contextModel?: ModelRefDto;
1452
2205
  }
1453
2206
  /** Message history: the full messages and events from concatenating all of this Session's Trace files in order (excludes partial_*). */
1454
2207
  interface MessagesResponse {
2208
+ /**
2209
+ * On windowed requests, images are served by reference: in every record that carries a
2210
+ * `tracePosition`, an inline PNG / JPEG / GIF / WebP `data:` URL — a user `image_url`, or
2211
+ * an entry of a tool output's `images` — is replaced by
2212
+ * `/api/sessions/<sessionId>/trace-image?file=<fileIndex>&ordinal=<ordinal>[&i=<k>]`
2213
+ * (`i` = the index into `images`), an immutable, access-checked image response. Expanded
2214
+ * subagent messages, held inputs not yet in the Trace, other image types and the
2215
+ * parameterless full read keep their data URLs.
2216
+ */
1455
2217
  messages: HistoryMessage[];
1456
2218
  /**
1457
2219
  * Present only while the Session is running/compacting: the in-progress stream tail
@@ -1534,6 +2296,32 @@ interface GoalResponse {
1534
2296
  /** The Session's most recent goal run; null if it never ran one. */
1535
2297
  goal: GoalStateView | null;
1536
2298
  }
2299
+ /**
2300
+ * `POST /api/sessions/:sessionId/switch-model`: switch this Session to another model in place.
2301
+ * The running context is closed on the model it ran on, then the next one opens on the target.
2302
+ *
2303
+ * - **202** {@link TaskCreateResponse} — the switch streams, the Session status `compacting`.
2304
+ * A context with a completed turn is closed by an ordinary `manual` compaction pair (always
2305
+ * summarize); one without — just compacted, or its first request never finished — has
2306
+ * nothing to summarize and streams no pair. Then come the new context's opener records
2307
+ * and, last, its `session_meta`: its `provider` / `model_id` name the model the Session now
2308
+ * runs on, the Session reads report that pair from this record on, and `task_state` turns
2309
+ * idle after it.
2310
+ * A compaction that ends other than `completed` means no switch — no `session_meta` follows
2311
+ * and the Session keeps its model.
2312
+ * - **200** {@link SessionResponse} — a Session that never ran has no context to close: it
2313
+ * switched inside the request, and nothing is streamed.
2314
+ * - **409**, one code per refusal, before any event: `task_in_progress` / `compacting` (busy),
2315
+ * `same_model`, `model_not_configured` (the target is not in the Project config),
2316
+ * `model_unavailable` (its client cannot be constructed, e.g. no credential), and
2317
+ * `compaction_not_configured`.
2318
+ */
2319
+ interface SessionSwitchModelRequest {
2320
+ /** Provider group of the target model. */
2321
+ provider: string;
2322
+ /** Upstream model_id of the target model. */
2323
+ modelId: string;
2324
+ }
1537
2325
  interface TaskCreateResponse {
1538
2326
  /** Current actual session_id: a Trace-less invalid Session self-heals and returns a new id; the frontend updates its route accordingly. */
1539
2327
  sessionId: string;
@@ -1735,6 +2523,20 @@ interface MessagingRuntimeStatus {
1735
2523
  at: string;
1736
2524
  detail: string;
1737
2525
  };
2526
+ /**
2527
+ * Since when (ISO 8601) the bot has been HOLDING replies it could not deliver yet, to send
2528
+ * them with the chat's next inbound message; absent while nothing is held. WeChat only: the
2529
+ * platform accepts a bot's messages only for a while after the user's last one, and only
2530
+ * about ten per message, so a long run or a quiet user leaves replies waiting rather than
2531
+ * lost.
2532
+ *
2533
+ * Not a failure, and deliberately not `lastDeliveryError`: nothing is broken and nobody has
2534
+ * to act beyond what the panel says — message the bot in WeChat and the held replies arrive
2535
+ * first. Cleared the moment they have been delivered. Unlike the fields above it is not
2536
+ * scoped to one connection: held replies are stored, so a backlog from before a restart is
2537
+ * reported again as soon as the connection opens.
2538
+ */
2539
+ heldReplySince?: string;
1738
2540
  }
1739
2541
  /**
1740
2542
  * What a messaging binding carries whatever channel it is: the connection intent, the three
@@ -2228,11 +3030,17 @@ type ServerEvent =
2228
3030
  * that has now run from one that never has — a first run would otherwise settle back into the
2229
3031
  * blank "never ran" row the client still believes in.
2230
3032
  *
3033
+ * `projectId` names the Session's Project: a list showing one Project ignores another's flips
3034
+ * without a request, and a flip for a Session of its own Project that it holds no row for is a
3035
+ * row it is missing — one that became active below its activity cursor (see SessionsResponse) —
3036
+ * which it fetches by id.
3037
+ *
2231
3038
  * Published only to the user channels of the Project's owner and members.
2232
3039
  */
2233
3040
  | {
2234
3041
  type: "session_state";
2235
3042
  sessionId: string;
3043
+ projectId: string;
2236
3044
  state: SessionStatus;
2237
3045
  lastActiveAt: string;
2238
3046
  hasTrace: boolean;
@@ -2250,6 +3058,19 @@ type ServerEvent =
2250
3058
  processes: number;
2251
3059
  subagents: number;
2252
3060
  }
3061
+ /**
3062
+ * A Session's count of tool calls waiting for a person's approval changed: a call was
3063
+ * escalated (every call under always-ask, rw/unknown calls under read-only), answered, or
3064
+ * denied by an interrupt. The count is the row's `pendingApprovalCount` as it stands after
3065
+ * the change, zeros included, so a list moves its mark without refetching; the calls
3066
+ * themselves are on the Session's own stream (`approval_request`, replayed on subscribe).
3067
+ * Published to the user channels of the Project's owner and members, like `session_state`.
3068
+ */
3069
+ | {
3070
+ type: "session_approvals";
3071
+ sessionId: string;
3072
+ count: number;
3073
+ }
2253
3074
  /** Last-Event-ID has been evicted from the buffer: the frontend should re-fetch the history endpoint before continuing to consume this connection. */
2254
3075
  | {
2255
3076
  type: "resync_required";
@@ -2273,21 +3094,74 @@ type ServerEvent =
2273
3094
  type: "web_updated";
2274
3095
  rev: string;
2275
3096
  }
2276
- /** New session registered (pushed over the parent session's channel for subagent sessions): frontend refreshes the list in place. */
3097
+ /**
3098
+ * A Session now exists. On the user channel for every creation — the CLI, another tab,
3099
+ * a schedule, an agent spawning a child — so the list learns about rows it did not make;
3100
+ * and on the parent Session's channel for a subagent, which no list shows. `source` is what
3101
+ * the new Session's meta records, and it tells a client which list, if any, the row joins.
3102
+ */
2277
3103
  | {
2278
3104
  type: "session_created";
2279
3105
  projectId: string;
2280
3106
  agentId: string;
2281
3107
  sessionId: string;
2282
3108
  source: SessionSource;
2283
- } | ScheduleServerEvent | GoalServerEvent | CompanyServerEvent;
2284
- /** Goal-mode progress on the session channel (the chat page drives its goal banner from these). */
2285
- type GoalServerEvent =
2286
- /** A goal run began (published before the first round). */
2287
- {
2288
- type: "goal_started";
2289
- sessionId: string;
2290
- objective: string;
3109
+ }
3110
+ /**
3111
+ * The user's listing decision on one Session changed (PATCH `archived`, the archive page's
3112
+ * batch unarchive): an archived row leaves the sidebar, an unarchived one joins it. One per
3113
+ * Session, to the Project's users.
3114
+ */
3115
+ | {
3116
+ type: "session_archived";
3117
+ sessionId: string;
3118
+ projectId: string;
3119
+ agentId: string;
3120
+ archived: boolean;
3121
+ }
3122
+ /**
3123
+ * A Session was deleted (DELETE, the subagent children deleted with it, the archive page's
3124
+ * batch delete): every client drops the row. One per Session, to the Project's users.
3125
+ */
3126
+ | {
3127
+ type: "session_deleted";
3128
+ sessionId: string;
3129
+ projectId: string;
3130
+ } | ScheduleServerEvent | GoalServerEvent | CompanyServerEvent | BuiltinBrowserServerEvent | MachineServerEvent;
3131
+ /**
3132
+ * The machines' two events on the user channel, published to admins only — the Machines page,
3133
+ * and the `/server/<id>` proxy everything else about a machine goes through, are admin-only.
3134
+ */
3135
+ type MachineServerEvent =
3136
+ /**
3137
+ * Something the machines list reports changed — a job queued, started, moved to its next
3138
+ * step, logged a line or ended; a connection was held or dropped; a reconnect began, failed
3139
+ * or succeeded; a machine joined or left a Project; a checkout's install image started or
3140
+ * finished building. No payload: a page re-reads `GET …/machines`, which is its one account
3141
+ * of every machine. Coalesced, so a burst of log lines costs a few reads, not one per line.
3142
+ */
3143
+ {
3144
+ type: "machines_changed";
3145
+ }
3146
+ /**
3147
+ * One of a connected machine's own user-channel events, relayed by this server from that
3148
+ * machine's `GET /api/events` (machines/event-relay.ts). The page holds one event stream to
3149
+ * this server whatever the number of machines: a stream per machine made five connected
3150
+ * machines take the browser's whole HTTP/1.1 allowance of six connections to one origin, and
3151
+ * every other request of the page then waited behind them for good.
3152
+ */
3153
+ | {
3154
+ type: "machine_event";
3155
+ machineId: string;
3156
+ event: ServerEvent;
3157
+ };
3158
+ /** Goal-mode progress on the session channel (the chat page drives its goal banner from these). */
3159
+ type GoalServerEvent =
3160
+ /** A goal run began (published before the first round). */
3161
+ {
3162
+ type: "goal_started";
3163
+ sessionId: string;
3164
+ objective: string;
2291
3165
  budget: number;
2292
3166
  }
2293
3167
  /** A round is starting; `used` is the runner's accounting up to this point. */
@@ -2323,6 +3197,20 @@ type ScheduleServerEvent =
2323
3197
  agentId: string;
2324
3198
  name: string;
2325
3199
  sessionId: string;
3200
+ }
3201
+ /** A workflow of the Agent was (re)loaded — its folder changed, a reload was requested, or a version was restored. */
3202
+ | {
3203
+ type: "workflow_updated";
3204
+ projectId: string;
3205
+ agentId: string;
3206
+ workflow: WorkflowInfo;
3207
+ }
3208
+ /** A workflow's folder is gone — removed from the Web App or deleted on disk. */
3209
+ | {
3210
+ type: "workflow_removed";
3211
+ projectId: string;
3212
+ agentId: string;
3213
+ workflowId: string;
2326
3214
  };
2327
3215
  interface TraceFileInfo {
2328
3216
  /** Trace file index (one file corresponds to one complete model context). */
@@ -2405,7 +3293,10 @@ interface TraceEventsResponse {
2405
3293
  events: OmniMessage[];
2406
3294
  offset: number;
2407
3295
  limit: number;
2408
- /** Total line count of the file (basis for pagination). */
3296
+ /**
3297
+ * Record count of the file (basis for pagination), in the ordinals `tracePosition` and the
3298
+ * analysis' `messageFrom` / `messageTo` use: malformed lines are not records.
3299
+ */
2409
3300
  total: number;
2410
3301
  }
2411
3302
  /** Duration span of a single LLM Request (request_begin/request_end paired by proximity). */
@@ -2557,7 +3448,11 @@ interface WorkspaceFilesResponse {
2557
3448
  path: string;
2558
3449
  entries: WorkspaceFileEntry[];
2559
3450
  }
2560
- /** Write one Workspace file whole (the Upload button, a drop, and the Files panel's editor). */
3451
+ /**
3452
+ * Write one Workspace file whole (the Upload button, a drop, and the Files panel's editor). A
3453
+ * write answers 204 with the written file's version in `ETag` — the marker the next conditional
3454
+ * write of the same file carries, so an editor can keep editing after a save.
3455
+ */
2561
3456
  interface FilesWriteRequest {
2562
3457
  /** The entire file, base64-encoded (≤14MB decoded). */
2563
3458
  dataBase64: string;
@@ -2572,7 +3467,7 @@ interface FilesWriteRequest {
2572
3467
  */
2573
3468
  ifVersion?: string;
2574
3469
  }
2575
- /** Move or rename one Workspace file (the Files panel's context menu). */
3470
+ /** Move or rename one Workspace file or folder (the Files panel's context menu). */
2576
3471
  interface FilesMoveRequest {
2577
3472
  /** Source path, relative to the Workspace root. */
2578
3473
  from: string;
@@ -2585,12 +3480,23 @@ interface FilesMoveRequest {
2585
3480
  * has none, because the caller never read it, which is why an occupied destination is
2586
3481
  * refused with 409 `target_exists` rather than overwritten.
2587
3482
  *
2588
- * A directory `from` is a 400 whatever this field says: a directory carries no single
2589
- * version marker, so the precondition that protects this operation cannot be expressed for
2590
- * one, and silently moving a tree without that protection is worse than refusing to move it.
3483
+ * A directory `from` takes none, and one sent with it is a 400: a directory carries no
3484
+ * single version marker, so no precondition can be stated for it. A folder moves whole and
3485
+ * unconditionally — nothing is lost that way, since whatever the Agent wrote into it meanwhile
3486
+ * moves with it — and is refused only when the destination is occupied or lies inside it.
2591
3487
  */
2592
3488
  ifVersion?: string;
2593
3489
  }
3490
+ /**
3491
+ * Create one empty text file or one folder in a Workspace (the Files panel's New menu). Missing
3492
+ * parent directories are created as a write creates them. Anything already at `path` — a file,
3493
+ * a folder or a link — is refused with 409 `target_exists` and nothing is written.
3494
+ */
3495
+ interface FilesCreateRequest {
3496
+ /** The new entry's path, relative to the Workspace root. */
3497
+ path: string;
3498
+ kind: "file" | "dir";
3499
+ }
2594
3500
  /**
2595
3501
  * One Workspace search match. `kind`, `sizeBytes` and `mtime` are named and typed exactly as
2596
3502
  * {@link WorkspaceFileEntry} names them: a hit is drawn by the same row renderer as a tree
@@ -2701,6 +3607,19 @@ interface TraceAnalysisResponse {
2701
3607
  * scope every total here shares). Absent exactly when the turns carry no `cost`.
2702
3608
  */
2703
3609
  cost?: number;
3610
+ /**
3611
+ * `cost` split by pricing bucket: every Request's Tokens at the rates and tier its share of
3612
+ * `cost` was priced at, summed per bucket over the file. Present exactly when `cost` is; the
3613
+ * turns carry no split.
3614
+ */
3615
+ costParts?: CostParts;
3616
+ /**
3617
+ * The model's context window as the file's head `session_meta` records it
3618
+ * (`model_context_window`), for the context ring. The panel no longer reads every event, so the
3619
+ * analysis carries it; absent when the head records none (an older server, or a file without
3620
+ * one), and the panel then falls back as it always has.
3621
+ */
3622
+ modelContextWindow?: number | string;
2704
3623
  requests: RequestSpan[];
2705
3624
  /** Token / duration aggregated per Task (used directly by the Trace page's context ring and per-turn TPS). */
2706
3625
  tasks: TraceTaskStats[];
@@ -2793,6 +3712,17 @@ interface TraceImportResponse {
2793
3712
  date: string;
2794
3713
  }
2795
3714
  type UsageGroupBy = "date" | "agent" | "model" | "session";
3715
+ /**
3716
+ * A cost split by the three pricing buckets, in USD: cached input (`cacheRead`), uncached input
3717
+ * (`cacheWrite`, input Tokens on a cache miss) and output. Each part is its bucket's Tokens at the
3718
+ * rate the whole cost was priced at, so the three sum to the cost they accompany (up to
3719
+ * floating-point rounding).
3720
+ */
3721
+ interface CostParts {
3722
+ cacheRead: number;
3723
+ cacheWrite: number;
3724
+ output: number;
3725
+ }
2796
3726
  interface UsageBucket {
2797
3727
  total: number;
2798
3728
  requests: number;
@@ -2812,6 +3742,12 @@ interface UsageGroupRow {
2812
3742
  total: number;
2813
3743
  requests: number;
2814
3744
  cost: number | null;
3745
+ /**
3746
+ * `cost` split by pricing bucket, each record at the same rates, tier and promotion that
3747
+ * priced it in `cost`. Present exactly when `cost` is not null; a row's unpriced usage is in
3748
+ * neither.
3749
+ */
3750
+ costParts?: CostParts;
2815
3751
  hasUncosted: boolean;
2816
3752
  }
2817
3753
  /** Time-series precision for the usage series (`granularity` query parameter). `minute` requires the `fromTs`/`toTs` window bounds. */
@@ -2886,13 +3822,22 @@ interface UsageErrorCount {
2886
3822
  kind: string;
2887
3823
  count: number;
2888
3824
  }
2889
- /** A single error summary (one row in the stats center's error panel table). */
3825
+ /**
3826
+ * One row of the stats center's error panel table: the records of one calendar day that share
3827
+ * a source, code, kind and message. The day is the viewer's when the request carried
3828
+ * `utcOffsetMinutes`, and the server's own otherwise.
3829
+ */
2890
3830
  interface UsageErrorItem {
3831
+ /** The latest of the records this row stands for. */
2891
3832
  ts: string;
2892
3833
  source: string;
2893
3834
  code: string;
2894
3835
  kind: string;
2895
3836
  message: string;
3837
+ /** How many records this row stands for (the panel's "×N"). */
3838
+ count: number;
3839
+ /** The earliest of them; equal to `ts` for a single record. */
3840
+ firstTs: string;
2896
3841
  }
2897
3842
  /**
2898
3843
  * Server-side error capture stats: not affected by the model
@@ -2903,14 +3848,16 @@ interface UsageErrorItem {
2903
3848
  * items.
2904
3849
  */
2905
3850
  interface UsageErrors {
2906
- /** Filtered row count — also what a clear of the same filter takes (see {@link UsageErrorsClearResponse}). */
3851
+ /** Filtered record count — also what a clear of the same filter takes (see {@link UsageErrorsClearResponse}). */
2907
3852
  total: number;
2908
3853
  /** Count of unexpected ones (500 / runtime exceptions) among them — the part the frontend highlights. */
2909
3854
  unexpected: number;
2910
3855
  /** The most frequent source · code (null when there are no errors). */
2911
3856
  topCode: UsageErrorCount | null;
2912
- /** Most recent N items (reverse chronological) — the first page; older ones come from `GET /usage/errors`. */
3857
+ /** Most recent N rows (reverse chronological) — the first page; older ones come from `GET /usage/errors`. */
2913
3858
  recent: UsageErrorItem[];
3859
+ /** How many rows the table has for this filter (records folded per {@link UsageErrorItem}) — what the pager counts. */
3860
+ rows: number;
2914
3861
  }
2915
3862
  /**
2916
3863
  * GET /api/projects/:projectId/usage/errors — one page of the error detail table, newest
@@ -2920,12 +3867,15 @@ interface UsageErrors {
2920
3867
  * or neither), so a page never widens what the summary counted, plus an optional `kind`
2921
3868
  * ({@link UsageErrorKind}) narrowing to one of the two categories — which
2922
3869
  * is how the cost-center badge asks "are there unexpected errors, and how new is the newest"
2923
- * with `limit=1` instead of pulling the whole dashboard aggregate.
3870
+ * with `limit=1` instead of pulling the whole dashboard aggregate. `utcOffsetMinutes` (minutes
3871
+ * east of UTC, the dashboard takes it too) says whose calendar day a row's records share.
2924
3872
  */
2925
3873
  interface UsageErrorsPage {
2926
3874
  items: UsageErrorItem[];
2927
- /** Filtered row count, so the caller knows when it has reached the end. */
3875
+ /** Filtered record count — the occurrences, which is what the cost-center badge counts. */
2928
3876
  total: number;
3877
+ /** Filtered row count (records folded per {@link UsageErrorItem}), so the caller knows when it has reached the end. */
3878
+ rows: number;
2929
3879
  }
2930
3880
  /**
2931
3881
  * DELETE /api/projects/:projectId/usage/errors — empties the error table for the filter the
@@ -3016,6 +3966,23 @@ interface SchedulesResponse {
3016
3966
  error: string;
3017
3967
  }>;
3018
3968
  }
3969
+ /**
3970
+ * One task in the Project-wide listing (GET /api/projects/:projectId/schedules): the agent's
3971
+ * item plus the agent whose schedule directory holds it, since the list spans every agent.
3972
+ */
3973
+ interface ProjectScheduleItem extends ScheduleItem {
3974
+ agentId: string;
3975
+ }
3976
+ interface ProjectSchedulesResponse {
3977
+ /** Every agent's tasks: agents in id order, each agent's tasks in the order its own listing returns them. */
3978
+ schedules: ProjectScheduleItem[];
3979
+ /** Files that failed to parse (skipped from scheduling and logged as errors), with the agent that holds each. */
3980
+ invalidFiles: Array<{
3981
+ agentId: string;
3982
+ name: string;
3983
+ error: string;
3984
+ }>;
3985
+ }
3019
3986
  interface ScheduleUpsertRequest {
3020
3987
  prompt: string;
3021
3988
  enabled: boolean;
@@ -3095,13 +4062,43 @@ interface BenchmarkEvaluation {
3095
4062
  * `BenchmarkSummary.status`.
3096
4063
  */
3097
4064
  type BenchmarkStatus = "draft" | "published" | "failed";
4065
+ /**
4066
+ * Where a Benchmark's copy came from: `builtin` (seeded when the Project was created), `manual`
4067
+ * (the create form), `agent` (the benchmark-design Skill wrote it), `git` (an Agent imported a
4068
+ * repository folder), `zip` (an uploaded package).
4069
+ */
4070
+ type BenchmarkOriginKind = "builtin" | "manual" | "agent" | "git" | "zip";
4071
+ /**
4072
+ * Why a Benchmark's manifest cannot be read: the code of core's `BenchmarkManifestError`
4073
+ * (`benchmark_id_mismatch` for an `id` that is not the directory's, `benchmark_manifest_invalid`
4074
+ * for a file that is not TOML or a `version` or `[origin]` out of shape) and its message, which
4075
+ * names the key or the file.
4076
+ */
4077
+ interface BenchmarkManifestProblem {
4078
+ code: string;
4079
+ message: string;
4080
+ }
4081
+ /** The `[origin]` table of a Benchmark's benchmark_config.toml. */
4082
+ interface BenchmarkOrigin {
4083
+ kind: BenchmarkOriginKind;
4084
+ /** git: the folder link as the user gave it (a GitHub tree URL). Always an http(s) URL. */
4085
+ url?: string;
4086
+ /** git: the 40-hex commit the import resolved the link to. */
4087
+ ref?: string;
4088
+ /** git: the folder inside the repository. */
4089
+ path?: string;
4090
+ /** git / zip: when this copy was written (ISO 8601; `imported_at` in the file). */
4091
+ importedAt?: string;
4092
+ }
3098
4093
  interface BenchmarkSummary {
3099
4094
  /** Directory name is the identifier (semantic naming, e.g. swe-bench-v1). */
3100
4095
  id: string;
3101
- /** Title from benchmark_config.toml; falls back to the directory name if unset. */
4096
+ /** Title from benchmark_config.toml; the directory name when it gives none or the manifest cannot be read. */
3102
4097
  title: string;
3103
4098
  description?: string;
3104
- /** Number of runs per case (the `runs` field in benchmark_config.toml, ≥1; defaults to 1). */
4099
+ /** The description in Chinese (`description_zh` in benchmark_config.toml), when the manifest gives one. */
4100
+ descriptionZh?: string;
4101
+ /** Number of runs per case (the `runs` key in benchmark_config.toml, an integer ≥ 1); absent when it gives none or the manifest cannot be read, which reads as 1. */
3105
4102
  runs?: number;
3106
4103
  /**
3107
4104
  * `draft` while the Skill that builds the Benchmark is still writing its cases and
@@ -3109,10 +4106,29 @@ interface BenchmarkSummary {
3109
4106
  * Benchmark is frozen and its Formal Baseline recorded; `failed` when calibration ended
3110
4107
  * without a Pilot result that could be frozen, which leaves the Benchmark unusable — the Web
3111
4108
  * App masks it too and says it has to be deleted and created again. benchmark_config.toml is
3112
- * read literally: only `draft` is a draft and only `failed` is a failure, so a missing field,
3113
- * or any other value, reads as published.
4109
+ * read literally: only `draft` is a draft and only `failed` is a failure, so a missing key, or
4110
+ * any other value, reads as published. A Benchmark whose manifest cannot be read lists as
4111
+ * failed, with `manifestError`.
3114
4112
  */
3115
4113
  status: BenchmarkStatus;
4114
+ /**
4115
+ * The manifest's date version, `YYYY.MM.DD.N`: the revision of the Benchmark's content. Absent
4116
+ * when the manifest has none (one written before versions is unversioned), when it cannot be
4117
+ * read, and from a machine whose server predates versions.
4118
+ */
4119
+ version?: string;
4120
+ /**
4121
+ * Where this copy came from, the manifest's `[origin]`. Absent when the manifest has none (where
4122
+ * a copy written before origins came from is unknown), when it cannot be read, and from a
4123
+ * machine whose server predates origins.
4124
+ */
4125
+ origin?: BenchmarkOrigin;
4126
+ /**
4127
+ * Set when the manifest cannot be read. Such a Benchmark lists under its directory name, as
4128
+ * `failed`, with no version or origin, and nothing may use or export it until the file is
4129
+ * fixed; the Web App masks it with this reason.
4130
+ */
4131
+ manifestError?: BenchmarkManifestProblem;
3116
4132
  /** Case count (number of case subfolders). */
3117
4133
  caseCount: number;
3118
4134
  /** Time-ordered evaluation records (the evaluations[] in scoreboard.yaml). */
@@ -3139,10 +4155,11 @@ interface BenchmarkCasesResponse {
3139
4155
  }
3140
4156
  /**
3141
4157
  * POST /api/projects/:p/benchmarks (owner only): create a Benchmark by hand. The
3142
- * server writes the on-disk layout the evaluation Skills read — `benchmark_config.toml`, a
3143
- * `scoreboard.yaml` holding `evaluations: []`, and one `<case id>/` per case with
3144
- * `statement/README.md` and `rubric/README.md`. 409 `benchmark_exists` when the directory is
3145
- * already there; nothing is merged into an existing Benchmark.
4158
+ * server writes the on-disk layout the evaluation Skills read — `benchmark_config.toml`
4159
+ * (published, the day's first version, origin `manual`), a `scoreboard.yaml` holding
4160
+ * `evaluations: []`, and one `<case id>/` per case with `statement/README.md` and
4161
+ * `rubric/README.md`. 409 `benchmark_exists` when the directory is already there; nothing is
4162
+ * merged into an existing Benchmark.
3146
4163
  */
3147
4164
  interface BenchmarkCreateRequest {
3148
4165
  /** Directory name, which is the identifier: letters, digits, `_` and `-` only. */
@@ -3167,6 +4184,49 @@ interface BenchmarkCreateCase {
3167
4184
  interface BenchmarkCreateResponse {
3168
4185
  benchmark: BenchmarkSummary;
3169
4186
  }
4187
+ /**
4188
+ * POST /api/projects/:p/benchmarks/archive (any Project member): import a Benchmark package from
4189
+ * a zip. The zip holds `benchmark_config.toml` and the `CASE-*` directories, at its root (where the
4190
+ * manifest must name its `id`) or inside exactly one top-level directory named by the Benchmark's
4191
+ * id — the shape `GET …/benchmarks/:benchmarkId/archive` exports. A zip carrying
4192
+ * `scoreboard.yaml`, `.jobs/` or anything else at its top level, a link, a manifest past the
4193
+ * create form's limits, a package that is not `published` or a case without both READMEs is
4194
+ * refused (400); so is a zip past the caps (413 `benchmark_too_large`: 14MB
4195
+ * zipped, 1000 files, 5MB a file, 20MB inflated). The copy is written with origin `zip` and an
4196
+ * empty scoreboard — or origin `git`, when the request says the package is a repository folder
4197
+ * fetched at a commit. An id already taken is 409 `benchmark_exists` (`details.benchmarkId` names
4198
+ * it) unless `overwrite`.
4199
+ */
4200
+ interface BenchmarkArchiveImportRequest {
4201
+ /** The zip, base64-encoded. */
4202
+ dataBase64: string;
4203
+ /**
4204
+ * Replace the Benchmark of the same id whole — its evaluation records and `.jobs/` included.
4205
+ * Refused with 409 `benchmark_busy` while an evaluation of it is still running a trial there.
4206
+ */
4207
+ overwrite?: boolean;
4208
+ /**
4209
+ * The repository folder the package was fetched from, at one commit: what
4210
+ * `penguin benchmark import --origin-url … --origin-ref … --origin-path …` sends for an Agent's
4211
+ * import of a folder link. The copy's origin is then `git` with these fields and the time of the
4212
+ * import, instead of `zip`.
4213
+ */
4214
+ origin?: BenchmarkArchiveGitOrigin;
4215
+ }
4216
+ /** Where a package fetched from a git repository came from. */
4217
+ interface BenchmarkArchiveGitOrigin {
4218
+ kind: "git";
4219
+ /** The folder link as the user gave it: an http(s) URL, at most 2048 characters. */
4220
+ url: string;
4221
+ /** The 40-character commit the link was resolved to. */
4222
+ ref: string;
4223
+ /** The folder inside the repository, at most 1024 characters. */
4224
+ path: string;
4225
+ }
4226
+ interface BenchmarkArchiveImportResponse {
4227
+ /** The imported Benchmark, as the list now reads it. */
4228
+ benchmark: BenchmarkSummary;
4229
+ }
3170
4230
  interface SkillMetadataItem {
3171
4231
  /** Skill directory name (the identity key for install / uninstall / Prompt addressing). */
3172
4232
  name: string;
@@ -3181,7 +4241,7 @@ interface SkillMetadataItem {
3181
4241
  * which the plugin item carries once. Absent, the frontend draws the book glyph.
3182
4242
  */
3183
4243
  icon?: string;
3184
- /** Version (`YYYY.MM.DD.N`, frontmatter version; a copy installed before that spelling still carries `YYYY-MM-DD.N`); an empty string when the frontmatter carries none or a malformed one. */
4244
+ /** The skill's own dated version (`YYYY.MM.DD.N`, frontmatter version; a copy installed before that spelling still carries `YYYY-MM-DD.N`); an empty string when the frontmatter carries none or a malformed one. */
3185
4245
  version: string;
3186
4246
  }
3187
4247
  /** One installed hook package (`agent_state/hooks/<name>/`): its manifest, without the scripts. */
@@ -3197,21 +4257,77 @@ interface HookItem {
3197
4257
  /** The plugin's raw icon.svg, written beside the manifest at install time; absent when the plugin ships none (the frontend draws the hook glyph). */
3198
4258
  icon?: string;
3199
4259
  }
3200
- /** One library plugin as the listing describes it: the manifest fields plus what it ships (skill bodies and scripts are never sent). */
4260
+ /**
4261
+ * One library plugin as the listing describes it: the manifest fields (its package.json — npm's
4262
+ * fields and the `penguin` block) plus what it ships (skill bodies and scripts are never sent).
4263
+ * Every field but the identity, the version and the contents is optional: a field the package
4264
+ * does not carry is missing here, and the page says so rather than inventing one.
4265
+ */
3201
4266
  interface PluginItem {
3202
4267
  name: string;
4268
+ /** Display name (`penguin.title`, `title_zh`); absent → the page shows `name`. */
4269
+ title?: string;
4270
+ titleZh?: string;
4271
+ /** English one-liner (package.json `description`); "" when the package carries none. */
3203
4272
  description: string;
3204
4273
  descriptionZh?: string;
3205
4274
  shortDescription?: string;
3206
4275
  shortDescriptionZh?: string;
3207
- /** `YYYY.MM.DD.N`. */
4276
+ /** The plugin's npm version (its package.json, following the release) — what the card shows. Installed copies are compared part by part instead: each skill's `version`, and {@link hookVersion}. */
3208
4277
  version: string;
3209
- /** The plugin's skills (metadata only). */
4278
+ /** The npm package the plugin is, e.g. `@penguinharness/a2ui` — what Delete and a server module's row name it by. */
4279
+ package: string;
4280
+ /** Where the plugin comes from: `builtin` — a package this build ships; `installed` — one an admin installed on the server (by name, link or zip). */
4281
+ source: "builtin" | "installed";
4282
+ /** The package's npm `author` (a name), `license`, `homepage` and `repository` URL, for the detail dialog. */
4283
+ author?: string;
4284
+ license?: string;
4285
+ homepage?: string;
4286
+ repository?: string;
4287
+ /** The plugin's skills (metadata only), each with its own dated `version`. */
3210
4288
  skills: SkillMetadataItem[];
3211
4289
  /** The hook points the plugin's hook package answers at (`[]` without one). */
3212
4290
  hooks: string[];
3213
- /** The plugin's raw icon.svg (beside plugin.json — every built-in plugin ships one), the icon of everything it ships; the frontend draws the puzzle-piece plugin glyph without it. */
4291
+ /** The hook package's own dated version (`penguin.hooks.version`, `YYYY.MM.DD.N`); absent without a hook package. */
4292
+ hookVersion?: string;
4293
+ /** The plugin's raw icon SVG (`icon.svg` at the package root, or `penguin.icon` — every built-in plugin ships one; an unsafe one is never sent), the icon of everything it ships; the frontend draws the puzzle-piece plugin glyph without it. */
3214
4294
  icon?: string;
4295
+ /** The demo the Plugins page's quick start pre-fills (`penguin.quick_start`); absent = pre-select its first skill. */
4296
+ quickStart?: QuickStartItem;
4297
+ /** The MCP servers the plugin installs into an Agent's `tools.mcpServers` (`penguin.mcp_servers`); `[]` without any. */
4298
+ mcpServers: PluginMcpServerItem[];
4299
+ }
4300
+ /** An MCP transport, as an entry resolves it (`transport`, else inferred from `command` / `url`). */
4301
+ type McpTransport = "stdio" | "http" | "sse";
4302
+ /** One vault key a plugin's MCP server needs before it can connect: declared in the manifest, or only referenced (then the key is all there is to show). */
4303
+ interface PluginSetupKeyItem {
4304
+ key: string;
4305
+ label?: string;
4306
+ labelZh?: string;
4307
+ /** Where to get the value (a URL), or one sentence. */
4308
+ help?: string;
4309
+ }
4310
+ /** A plugin's MCP server as the library lists it: identity and target only — no header, env or oauth value. */
4311
+ interface PluginMcpServerItem {
4312
+ name: string;
4313
+ transport: McpTransport;
4314
+ /** The URL (http/sse), or `command args…` (stdio), as written: `${PLUGIN_ROOT}` and `${KEY}` references unresolved. */
4315
+ target: string;
4316
+ /** Every vault key the server's config references, declared ones first. */
4317
+ setup: PluginSetupKeyItem[];
4318
+ /** The server offers OAuth sign-in (`config.oauth`). */
4319
+ oauth: boolean;
4320
+ /** It needs that sign-in — OAuth and no `Authorization` header of its own — which this version cannot do: an Agent skips it. */
4321
+ signIn: boolean;
4322
+ }
4323
+ /** A quick start: a prompt pre-filled into a new-chat draft — never sent by the page. */
4324
+ interface QuickStartItem {
4325
+ prompt: string;
4326
+ promptZh?: string;
4327
+ /** Skills to pre-select (a library plugin's own). */
4328
+ skills?: string[];
4329
+ /** Open the draft in goal mode. */
4330
+ goal?: boolean;
3215
4331
  }
3216
4332
  interface PluginGroupItem {
3217
4333
  id: string;
@@ -3245,6 +4361,28 @@ interface PluginInstallRequest {
3245
4361
  interface AgentPluginsInstallResponse {
3246
4362
  skills: SkillMetadataItem[];
3247
4363
  hooks: HookItem[];
4364
+ /** The Agent's MCP servers after the install (a plugin's servers join its `tools.mcpServers`). A server name the Agent already has from someone else is 409 `mcp_server_name_taken`, nothing installed. */
4365
+ mcpServers: AgentMcpServerItem[];
4366
+ }
4367
+ /**
4368
+ * One `tools.mcpServers` entry of an Agent, as the Plugins page and the Agent settings read it:
4369
+ * identity, target and what keeps it from connecting — never a header, env or oauth value.
4370
+ */
4371
+ interface AgentMcpServerItem {
4372
+ name: string;
4373
+ transport: McpTransport;
4374
+ /** The URL (http/sse), or `command args…` (stdio): `${PLUGIN_ROOT}` already resolved at install, `${KEY}` references left as written. */
4375
+ target: string;
4376
+ /** The plugin that installed it; absent for an entry the user added. */
4377
+ plugin?: string;
4378
+ /** `${KEY}` references of its config that the Agent's vault does not hold (names only); empty = nothing to set up. */
4379
+ missingKeys: string[];
4380
+ /** It needs an OAuth sign-in, which this version cannot do: skipped at connect time. */
4381
+ signIn: boolean;
4382
+ }
4383
+ /** GET /api/projects/:p/agents/:a/mcp-servers: the Agent's MCP servers in config order; DELETE …/mcp-servers/:name removes one (204, 404 `unknown_mcp_server`). */
4384
+ interface AgentMcpServersResponse {
4385
+ servers: AgentMcpServerItem[];
3248
4386
  }
3249
4387
  /** GET /api/projects/:p/agents/:a/skills: Skills installed on this Agent. */
3250
4388
  interface AgentSkillsResponse {
@@ -3280,6 +4418,92 @@ interface SkillArchiveInstallRequest {
3280
4418
  /** Replace an already-installed Skill of the same name (deletes its directory first). */
3281
4419
  overwrite?: boolean;
3282
4420
  }
4421
+ /**
4422
+ * One published version of a plugin — the index entry format every plugin registry
4423
+ * speaks (modeled on the typst/packages `index.json` schema: a flat array of
4424
+ * per-version entries; a plugin published at several versions appears once per
4425
+ * version). Installation is out of scope here: an entry's `name` is the package
4426
+ * specifier a Project's plugin list names.
4427
+ */
4428
+ interface PluginIndexEntry {
4429
+ /** Package specifier — the string a Project's plugin list names. */
4430
+ name: string;
4431
+ /** Semantic version of this entry. */
4432
+ version: string;
4433
+ description: string;
4434
+ /** Chinese description (optional; the UI picks per language, English without it). */
4435
+ descriptionZh?: string;
4436
+ /** One-line descriptions for the card (optional; the card falls back to `description`). */
4437
+ shortDescription?: string;
4438
+ shortDescriptionZh?: string;
4439
+ /**
4440
+ * The plugin's raw icon SVG (optional; the card draws the puzzle piece without it). The
4441
+ * listing fills these display fields from the package's own package.json (its `penguin`
4442
+ * block) and icon when the package is on this server, over whatever the index row says.
4443
+ */
4444
+ icon?: string;
4445
+ authors: string[];
4446
+ /** SPDX license identifier. */
4447
+ license: string;
4448
+ /** Source repository URL. */
4449
+ repository?: string;
4450
+ homepage?: string;
4451
+ /** Free-form searchable terms; the Web App renders them as chips (e.g. the target OS). */
4452
+ keywords?: string[];
4453
+ /** Capability floor(s) the plugin provides on (e.g. "sandbox"). */
4454
+ categories?: string[];
4455
+ /** Unix timestamp (seconds) of the entry's last update. */
4456
+ updatedAt?: number;
4457
+ }
4458
+ /** GET /api/plugins/registry: the merged index of every configured registry (currently the builtin one). */
4459
+ interface PluginIndexResponse {
4460
+ plugins: PluginIndexEntry[];
4461
+ /**
4462
+ * Sources that could not be read, by `source` and reason. Present and empty when every
4463
+ * source answered. A remote index that is down shortens the listing rather than emptying
4464
+ * it, so the page needs to be able to say so instead of silently showing less.
4465
+ */
4466
+ failures: {
4467
+ source: string;
4468
+ error: string;
4469
+ }[];
4470
+ /**
4471
+ * Sources the server was still reading when it answered, by `source`. Present and empty when
4472
+ * every source answered. The listing does not wait long for a published index, so one on a slow
4473
+ * or unreachable network is named here and its entries are missing; a later read lists them
4474
+ * once they have arrived, or names the source under `failures` once it has failed.
4475
+ */
4476
+ pending: string[];
4477
+ }
4478
+ /**
4479
+ * A plugin's long-form docs: the README.md at its package root, as npm ships it.
4480
+ * GET /api/plugins/registry/readme?name= answers for an index entry, with `readme` null when
4481
+ * the package is not on this server or has none; GET /api/plugins/:plugin/readme answers for a
4482
+ * library plugin, 404 when it ships none.
4483
+ */
4484
+ interface PluginReadmeResponse {
4485
+ name: string;
4486
+ /** Markdown, rendered by the Web App. Null when this entry has no readme. */
4487
+ readme: string | null;
4488
+ }
4489
+ /**
4490
+ * One language a plugin contributes, as the listing reports it. The grammar itself is not
4491
+ * here: it is tens to hundreds of kilobytes, and only the languages a conversation actually
4492
+ * shows are worth fetching (`GET /api/languages/:id/grammar`).
4493
+ */
4494
+ interface LanguageSummary {
4495
+ /** Canonical id: the fence info string, and the id both endpoints address. */
4496
+ id: string;
4497
+ displayName: string;
4498
+ /** Alternative fence info strings, needed BEFORE the grammar loads (it is what decides to load it). */
4499
+ aliases?: string[];
4500
+ /** File extensions without the dot, for the Workspace file viewer. */
4501
+ extensions?: string[];
4502
+ }
4503
+ /** GET /api/languages: every language this App's plugins contributed, by id. */
4504
+ interface LanguageIndexResponse {
4505
+ languages: LanguageSummary[];
4506
+ }
3283
4507
  /**
3284
4508
  * GET /api/version: the running build's identity plus this root's pushed harness, verbatim
3285
4509
  * from `versionReport()` — the same record `penguin version --json` prints, so the two
@@ -3289,6 +4513,17 @@ interface SkillArchiveInstallRequest {
3289
4513
  * predating the stamping — v0.1.2 and earlier — where the UI shows the version alone).
3290
4514
  */
3291
4515
  type VersionResponse = VersionReport;
4516
+
4517
+ /** GET /api/version/history: the harness versions this data root has committed, newest first. */
4518
+ type VersionHistoryResponse = HarnessHistory;
4519
+ /** POST /api/version/history/rollback `{ id }`: the push back has started; the swap follows. */
4520
+ interface VersionRollbackResponse {
4521
+ started: true;
4522
+ id: string;
4523
+ }
4524
+ /** GET /api/version/history/diff?from=&to=: what changed between two stored interface tables. */
4525
+ type VersionHistoryDiffResponse = IfacesDiff;
4526
+
3292
4527
  /**
3293
4528
  * GET /api/version/update-check: newest published release vs the running version.
3294
4529
  * Always HTTP 200 (fail-soft): a lookup failure sets `error` and leaves `latestVersion`
@@ -3407,6 +4642,44 @@ interface DesktopTrayCommandMessage {
3407
4642
  showTrayIcon?: boolean;
3408
4643
  locale?: DesktopTrayLocale;
3409
4644
  }
4645
+ /** What the shell's read of one folder came to. */
4646
+ interface DesktopFolderAccessResult {
4647
+ /** The folder could be read. Always true off macOS, where the shell reads nothing. */
4648
+ granted: boolean;
4649
+ /** The failed read's errno code (`EPERM`, `EACCES`, `ENOENT`, …); `EINVAL` for a path that is not absolute. */
4650
+ code?: string;
4651
+ /**
4652
+ * Whether the app is a packaged build (Electron's `app.isPackaged`). An unpackaged one is a
4653
+ * development instance started from a terminal, and macOS holds that terminal responsible
4654
+ * for its reads rather than the app.
4655
+ */
4656
+ packaged: boolean;
4657
+ }
4658
+ /** Server → shell request over the utilityProcess message channel (relayed from POST /api/projects/:projectId/dirs/access). */
4659
+ interface DesktopFolderAccessMessage {
4660
+ type: "desktop-folder-access";
4661
+ /** Pairs the reply with its request. */
4662
+ id: string;
4663
+ /** The folder to read, as an absolute path. */
4664
+ path: string;
4665
+ }
4666
+ /** Shell → server reply to one {@link DesktopFolderAccessMessage}, carrying its `id`. */
4667
+ interface DesktopFolderAccessResultMessage extends DesktopFolderAccessResult {
4668
+ type: "desktop-folder-access-result";
4669
+ id: string;
4670
+ }
4671
+ /** POST /api/projects/:projectId/dirs/access: the shell's answer, for the picker to act on. */
4672
+ interface DirAccessResponse {
4673
+ granted: boolean;
4674
+ packaged: boolean;
4675
+ }
4676
+ /** The Privacy & Security panes the page may open: Files and Folders, and Full Disk Access. */
4677
+ type DesktopPrivacyPane = "files" | "fullDisk";
4678
+ /** Server → shell command over the utilityProcess message channel (relayed from POST /api/desktop/privacy-settings). No reply. */
4679
+ interface DesktopOpenPrivacySettingsMessage {
4680
+ type: "desktop-open-privacy-settings";
4681
+ pane: DesktopPrivacyPane;
4682
+ }
3410
4683
  /**
3411
4684
  * The outcome of one self-update run (`penguin update --yes` on the server host), carried
3412
4685
  * by {@link UpdateJobStatus.result}. `unsupported` covers both a server not launched via
@@ -3497,6 +4770,16 @@ interface MachineInfo {
3497
4770
  version: string;
3498
4771
  at: string;
3499
4772
  };
4773
+ /** This server signs in to the machine with a password it stores for the alias, not a key. */
4774
+ passwordSaved?: true;
4775
+ /**
4776
+ * In this Project's list: the Machines page shows a card for it. A machine joins the list when
4777
+ * it is added (`POST …/machines/add`, which installs nothing) or when an install or a use for
4778
+ * this Project runs on it, and leaves it with stop-using or release. Absent for a host that is
4779
+ * only in the ssh config, or only in another Project's list; never set on `local`, which is
4780
+ * always shown.
4781
+ */
4782
+ member?: true;
3500
4783
  /**
3501
4784
  * The machine's OWN id — 16 base64url characters minted by the server that runs there,
3502
4785
  * stable across renames, re-aliasing and reinstalls. Null until a server has started on
@@ -3521,6 +4804,19 @@ interface MachineInfo {
3521
4804
  connection: {
3522
4805
  pid: number;
3523
4806
  } | null;
4807
+ /**
4808
+ * Present while this server is bringing a machine it keeps connected back — the connection
4809
+ * dropped, its server stopped or restarted, or this server itself just started — and absent
4810
+ * otherwise. A machine is kept connected from the moment it is enabled until it is stopped
4811
+ * (`POST …/stop`) or deleted (`POST …/stop-using`); see machines/service.ts's supervision.
4812
+ */
4813
+ reconnect?: MachineReconnect;
4814
+ /**
4815
+ * This server keeps a connection to it: it was enabled, or started, and has not been stopped
4816
+ * or deleted since. Absent otherwise — a machine only added, one whose server was stopped
4817
+ * here, one that never got as far as a connection.
4818
+ */
4819
+ keepConnected?: true;
3524
4820
  /**
3525
4821
  * The machine's API as last seen by this server's proxy — stamped by traffic passing
3526
4822
  * through, never by a probe of its own. `answeredAt` when the last forwarded request got
@@ -3536,6 +4832,12 @@ interface MachineInfo {
3536
4832
  failedAt: string;
3537
4833
  detail: string;
3538
4834
  } | null;
4835
+ /**
4836
+ * What the last time this server handed it the Project config came to: at a connect, a Sync
4837
+ * config job, or an automatic sync after a config edit here. Absent until the first one since
4838
+ * this server started; kept in memory only.
4839
+ */
4840
+ configSync?: MachineConfigSync;
3539
4841
  /**
3540
4842
  * What the last probe found over there, or null when none has been taken. Never filled in
3541
4843
  * at list time: a probe costs an ssh round trip per machine, so the list reports the last
@@ -3543,6 +4845,80 @@ interface MachineInfo {
3543
4845
  * since each probe is an ssh round trip while the list is only the config's text.
3544
4846
  */
3545
4847
  status: MachineServerStatus | null;
4848
+ /**
4849
+ * The data root the server there runs on (`PENGUIN_HOME`). This instance's PROFILE decides
4850
+ * it — a dev instance names the machine's dev root and never the release one beside it
4851
+ * (machines/layout.ts) — which is exactly what a reader looking at two instances of this
4852
+ * page needs to tell them apart. Written in that machine's own spelling once its platform
4853
+ * is known, and in the POSIX one before that; for `local` it is this process's own root,
4854
+ * already resolved to an absolute path.
4855
+ */
4856
+ root: string;
4857
+ }
4858
+ /**
4859
+ * One config sync to a machine: when it ended, whether every part of it reached the machine for
4860
+ * every Project using it, and what did not, in the far side's words.
4861
+ */
4862
+ interface MachineConfigSync {
4863
+ /** ISO timestamp the sync ended. */
4864
+ at: string;
4865
+ ok: boolean;
4866
+ /** The parts that did not go through, one per line; absent when `ok`. */
4867
+ detail?: string;
4868
+ /**
4869
+ * The values the Project's models take from this server's environment variables rather than
4870
+ * its config (an API key, or a base URL), which no sync can carry: one row per variable. On
4871
+ * the list answered for a Project, that Project's rows only.
4872
+ */
4873
+ envOnly: MachineEnvOnly[];
4874
+ /**
4875
+ * The model entries the machine refused by name — a hand-added model in a group that takes
4876
+ * only its built-in ones there — left out while the rest of the table went. On the list
4877
+ * answered for a Project, that Project's rows only.
4878
+ */
4879
+ skipped: MachineSkippedModel[];
4880
+ }
4881
+ /** A model entry a machine would not take: its error code and its own words for why. */
4882
+ interface MachineSkippedModel {
4883
+ projectId: string;
4884
+ provider: string;
4885
+ modelId: string;
4886
+ /** The far side's error code (`model_not_addable`, `model_not_routable`). */
4887
+ code: string;
4888
+ reason: string;
4889
+ }
4890
+ /** A model entry that takes `variable` from this server's environment. */
4891
+ interface MachineEnvOnly {
4892
+ projectId: string;
4893
+ provider: string;
4894
+ modelId: string;
4895
+ variable: string;
4896
+ }
4897
+ /**
4898
+ * A machine this server keeps connected, while it is being brought back. Attempts back off
4899
+ * from 5 s, doubling to a 5-minute cap, so a machine that is down for a day costs a probe every
4900
+ * five minutes; after three failures in a row the connection check runs on its own, and its
4901
+ * answer is what the page shows as the explanation.
4902
+ */
4903
+ interface MachineReconnect {
4904
+ /** When this streak began: the moment the machine was found not connected. */
4905
+ since: string;
4906
+ /** Attempts that failed in this streak; 0 while the first is still to run or running. */
4907
+ attempts: number;
4908
+ /** When the next attempt runs; null while one is running. */
4909
+ nextAt: string | null;
4910
+ /** The last attempt's failure in the far side's words; null before the first one fails. */
4911
+ lastError: string | null;
4912
+ /** Why ssh refused, when the last failure was ssh's own — for the page to say in its language. */
4913
+ sshReason?: MachineSshFailure;
4914
+ /** The connection check run after three failures in a row; null until then. */
4915
+ diagnosis: MachineDiagnosis | null;
4916
+ /**
4917
+ * The password stored for the machine was refused, or its host takes none (`sshReason`
4918
+ * says which): no attempt runs until a password is saved for it again or removed, since
4919
+ * retrying could lock the account. `nextAt` is null meanwhile.
4920
+ */
4921
+ waitsForPassword?: true;
3546
4922
  }
3547
4923
  /**
3548
4924
  * One machine's server state. There is deliberately no separate "ssh" status: ssh is the
@@ -3565,11 +4941,38 @@ interface MachineServerStatus {
3565
4941
  * refused key or an unusable Node than a paraphrase would.
3566
4942
  */
3567
4943
  interface MachineJob {
3568
- kind: "install" | "connect" | "restart";
4944
+ /**
4945
+ * `use` is the whole pipeline — install if needed, hand over, connect, sync — as one job;
4946
+ * `connect` is what the page calls Start service; `stop` stops the machine's server and stops
4947
+ * keeping it connected; `uninstall` stops it and removes the program, and the data directory
4948
+ * when asked; `sync` hands a connected machine the Project config.
4949
+ */
4950
+ kind: "install" | "connect" | "restart" | "use" | "stop" | "uninstall" | "sync";
3569
4951
  machineId: string;
3570
4952
  alias: string;
4953
+ /** Waiting its turn: a few machines are worked on at once, and a batch queues the rest. */
4954
+ queued: boolean;
3571
4955
  running: boolean;
4956
+ /**
4957
+ * The steps this job goes through, in order — what the page draws as its stepper. Fixed when
4958
+ * the job is queued; a step the job turns out not to need is passed over, never revisited.
4959
+ */
4960
+ steps: MachinePhase[];
4961
+ /**
4962
+ * Which of `steps` the job is on. Only moves forward. Null until the first step is named; a
4963
+ * finished job keeps its last phase.
4964
+ */
4965
+ phase: MachinePhase | null;
3572
4966
  log: string[];
4967
+ /**
4968
+ * The connection check run after the job failed at a step it can explain — checking,
4969
+ * installing, connecting: running, then its answer. Absent for every other job.
4970
+ */
4971
+ diagnosis?: {
4972
+ state: "running";
4973
+ } | ({
4974
+ state: "done";
4975
+ } & MachineDiagnosis);
3573
4976
  result: null | {
3574
4977
  ok: true;
3575
4978
  installed: "installed" | "already-installed";
@@ -3577,75 +4980,314 @@ interface MachineJob {
3577
4980
  } | {
3578
4981
  ok: true;
3579
4982
  connected: true;
4983
+ }
4984
+ /** The machine's server is stopped and stays so until it is started again. */
4985
+ | {
4986
+ ok: true;
4987
+ stopped: true;
4988
+ }
4989
+ /** The program is gone from the machine; `dataRemoved` says whether its data root went too. */
4990
+ | {
4991
+ ok: true;
4992
+ uninstalled: true;
4993
+ dataRemoved: boolean;
4994
+ }
4995
+ /** Every part of the Project config reached the machine (its `configSync` says the same). */
4996
+ | {
4997
+ ok: true;
4998
+ synced: true;
3580
4999
  } | {
3581
5000
  ok: false;
3582
5001
  step: string;
3583
5002
  message: string;
3584
5003
  /**
3585
5004
  * The failure has a next step this side can take, and it needs saying yes to:
3586
- * installing the PROGRAM over there and restarting it. Set when a hot update could
3587
- * not be handed over — the machine's store holds no CLI this server can talk to, and
3588
- * installing is what replicates one. Offered rather than done, because it restarts a
3589
- * server this Project does not own alone.
5005
+ * installing the PROGRAM over there and restarting it. Every failed install or
5006
+ * connect offers it — a failure that leaves no next step leaves a person stuck —
5007
+ * except a run that was itself that install, and one this server could not act on
5008
+ * (no build of its own to send), which says `false`. Offered rather than done,
5009
+ * because it restarts a server this Project does not own alone.
5010
+ */
5011
+ canReplaceProgram?: boolean;
5012
+ /**
5013
+ * Why ssh refused, when the failure is ssh's own (a host key, a key, a host name, a
5014
+ * route), for the page to say in its language; `message` says it in English, with
5015
+ * ssh's own words after `(ssh: …)`.
3590
5016
  */
3591
- canReplaceProgram?: true;
5017
+ sshReason?: MachineSshFailure;
3592
5018
  };
3593
5019
  }
5020
+ /**
5021
+ * A source checkout's install image (machines/checkout-image.ts), built from the checkout
5022
+ * again at each install or use: not built yet, building, built, or failed with the build's
5023
+ * own last words.
5024
+ */
5025
+ type MachinesCheckoutImage = {
5026
+ state: "unbuilt";
5027
+ } | {
5028
+ state: "building";
5029
+ } | {
5030
+ state: "built";
5031
+ } | {
5032
+ state: "failed";
5033
+ detail: string;
5034
+ };
3594
5035
  /** GET /api/machines, and the 202 body of POST /api/machines/:machineId/install. */
3595
5036
  interface MachinesResponse {
3596
5037
  machines: MachineInfo[];
3597
5038
  /**
3598
5039
  * The version an install would leave on the remote — the base release, plus a `+hmr.<sha>`
3599
- * suffix when this server carries a pushed version to replicate. Null for a development
3600
- * checkout, which stands on no release the remote could download.
5040
+ * suffix when this server carries a pushed version to replicate. A source checkout answers
5041
+ * with the image it last built, and null before its first build (see `checkoutImage`).
5042
+ * Null otherwise only for a server that carries no image and builds none.
3601
5043
  */
3602
5044
  imageVersion: string | null;
5045
+ /**
5046
+ * Present only when this server runs from a source checkout: it builds its install image
5047
+ * from the checkout at each install or use, so no image yet is not a reason to refuse one.
5048
+ */
5049
+ checkoutImage?: MachinesCheckoutImage;
5050
+ /** The most recently started job, running or finished. */
3603
5051
  job: MachineJob | null;
5052
+ /**
5053
+ * Every job worth showing this generation: the queued ones, the running one, and the last
5054
+ * finished one per machine — so a batch reads as a list of rows each saying where it is.
5055
+ */
5056
+ jobs: MachineJob[];
3604
5057
  }
3605
5058
  /**
3606
- * Organization status: `paused` stops every automatic trigger; humans can still talk to any
3607
- * desk. These two values are the whole lifecycle — no route deletes an organization, so a
3608
- * paused one keeps its conversations, employees, desks and tickets.
5059
+ * Every step a job may name, in the order they can occur. A job lists its own subset as
5060
+ * `MachineJob.steps`: a source checkout's enable starts by building its install image
5061
+ * (`build`); a stop is `check`, `stop`; an uninstall `check`, `stop`, `remove`; a config sync
5062
+ * `check`, `sync`.
3609
5063
  */
3610
- type OrgStatus = "active" | "paused";
3611
- /** Approval mode for desk and ticket sessions; unattended runs never get always-ask. */
3612
- type OrgApprovalMode = "allow-all" | "read-only" | "deny-all";
3613
- /** The five kanban columns, each a directory under `tickets/<yyyy-mm>/`. */
3614
- type OrgTicketStatus = "proposed" | "in_progress" | "review" | "done" | "rejected";
3615
- type OrgTicketPriority = "P0" | "P1" | "P2";
3616
- /** Live employee state: running when the desk or any ticket session has a Task in progress; paused when budget-paused. */
3617
- type OrgEmployeeState = "running" | "idle" | "paused";
5064
+ declare const MACHINE_PHASES: readonly ["build", "check", "install", "handover", "restart", "connect", "sync", "stop", "remove"];
5065
+ type MachinePhase = (typeof MACHINE_PHASES)[number];
5066
+ /** `POST /api/projects/:projectId/machines/:machineId/uninstall`. */
5067
+ interface MachineUninstallRequest {
5068
+ /** Remove the machine's data root too — its Sessions, Agents and config there. Default false. */
5069
+ removeData?: boolean;
5070
+ }
3618
5071
  /**
3619
- * The trigger kinds an `[org_trigger]` block carries. `ticket_notice` is read-only: a ticket
3620
- * change starts no run of its own, so nothing writes that kind any more, and it stays in the
3621
- * union because Traces recorded while it did still carry it.
5072
+ * `POST /api/projects/:projectId/machines/ssh-hosts`: append a host block to this server's
5073
+ * `~/.ssh/config`. Answers the machines list (201), or 400 `ssh_host_invalid` naming the
5074
+ * field, or 409 `ssh_host_exists`.
3622
5075
  */
3623
- type OrgTriggerKind = "init" | "event" | "mention" | "ticket_notice" | "ticket_work";
3624
- /** The ticket changes an employee is told about, listed in the body of its next calendar sweep. */
3625
- type OrgTicketChange = "assigned" | "blocked" | "blocker_closed" | "done" | "rejected";
3626
- /** What the last evaluation of a calendar event did. */
3627
- type OrgCalendarOutcome = "fired" | "queued" | "paused" | "missed" | "error";
5076
+ interface SshHostRequest {
5077
+ /** The alias — what `ssh <alias>` will take, and the machine's name everywhere here. */
5078
+ alias: string;
5079
+ hostName: string;
5080
+ user?: string;
5081
+ port?: number;
5082
+ identityFile?: string;
5083
+ /**
5084
+ * Sign in with this password instead of a key: stored on this server in a 0600 file under its
5085
+ * data root, never in the ssh config, and never sent back. On a PUT, `null` deletes the stored
5086
+ * one (back to key sign-in) and leaving it out keeps it. A PUT on a block written by hand may
5087
+ * set it when the other fields are the block as it stands. 400 `ssh_password_invalid` for an
5088
+ * empty or multi-line one; 409 `ssh_password_unsupported` (`details.ssh`: what `ssh -V` said)
5089
+ * when this computer's ssh cannot be handed a password.
5090
+ */
5091
+ password?: string | null;
5092
+ }
3628
5093
  /**
3629
- * The organization's working language: the language its handbook, its CEO's initialization
3630
- * run, every employee brief and every desk and ticket run are written in. Detected from the
3631
- * mission at creation (CJK text → `zh`, anything else → `en`) unless the request names one.
5094
+ * `GET /api/projects/:projectId/machines/ssh-hosts/:alias`: a host's block read back, and
5095
+ * whether this app wrote it. Only a block this app wrote may be rewritten
5096
+ * (`PUT …/ssh-hosts/:alias`, the same fields less the alias): a hand-written one may carry
5097
+ * options this app does not know, and rewriting it would drop them.
3632
5098
  */
3633
- type OrgLanguage = "zh" | "en";
3634
- /** The organization's settings as `org_config.toml` records them. */
3635
- interface OrganizationSettings {
3636
- name: string;
3637
- mission: string;
3638
- status: OrgStatus;
3639
- /** IANA timezone: budget periods (natural months) and chat day files follow it. */
3640
- timezone: string;
3641
- approvalMode: OrgApprovalMode;
3642
- /** Chat @-chain limit: a message whose hop reaches it records its mentions without triggering anyone. */
3643
- mentionChainLimit: number;
3644
- budgetWarnRatio: number;
3645
- budgetPauseRatio: number;
3646
- createdBy: string;
3647
- /** The shared workspace root when it is not the organization's own `workspace/` (absolute path). */
3648
- workspace?: string;
5099
+ interface SshHostResponse extends Omit<SshHostRequest, "password"> {
5100
+ editable: boolean;
5101
+ /** A password is stored for this host, which then signs in with it rather than with a key. */
5102
+ passwordSaved?: true;
5103
+ }
5104
+ /**
5105
+ * `GET /api/projects/:projectId/machines/ssh-hosts`: every host this server's ssh config declares,
5106
+ * its included files' too, with what each one's own block says about reaching it — the literal
5107
+ * lines, not what ssh resolves (no `ssh -G`): a `Host *` default or a `Match` block is not
5108
+ * applied. For the add dialog's rows; an option the block leaves out is absent.
5109
+ */
5110
+ interface SshHostSummary {
5111
+ alias: string;
5112
+ hostName?: string;
5113
+ user?: string;
5114
+ port?: number;
5115
+ }
5116
+ interface SshHostsResponse {
5117
+ hosts: SshHostSummary[];
5118
+ }
5119
+ /**
5120
+ * `POST /api/projects/:projectId/machines/add`: put these machines in this Project's list without
5121
+ * installing anything there — each then has a card whose one thing to do is enabling it. Answers
5122
+ * like `…/use`, refusals by id (`unknown-machine`, `self`).
5123
+ */
5124
+ interface MachinesAddRequest {
5125
+ machines: string[];
5126
+ }
5127
+ /** `POST /api/projects/:projectId/machines/use`: bring these machines into use, as one queued batch. */
5128
+ interface MachinesUseRequest {
5129
+ /** Machine ids (`ssh:<alias>`). Every one is queued; refusals come back by id. */
5130
+ machines: string[];
5131
+ /** Install the program even where its version matches, and restart there — the answer to a job that asked for it. */
5132
+ replaceProgram?: boolean;
5133
+ }
5134
+ /** Why one machine of a batch was not queued; the rest were. */
5135
+ type MachineUseRefusal = "unknown-machine" | "self" | "no-image";
5136
+ /**
5137
+ * Why ssh could not get a session to a machine, read from its own diagnostic
5138
+ * (machines/ssh-failure.ts); `other` when it printed none of the ones with a fixed meaning.
5139
+ */
5140
+ type MachineSshFailure = "host-key-unknown" | "host-key-changed" | "key-file" | "auth" | "password-rejected" | "password-not-offered" | "host-not-found" | "refused" | "timeout" | "closed" | "ssh-config" | "other";
5141
+ /** Whether a machine reaches one release source: the package is there, the source answered without it, or no answer. */
5142
+ type MachineSourceReach = "ok" | "missing" | "unreachable";
5143
+ /**
5144
+ * One check of a machine (machines/diagnose.ts), as facts for the page to word. `pass` is
5145
+ * fine, `warn` works with a caveat, `fail` stops an install or a connect, `skip` could not be
5146
+ * asked (an earlier check failed, or it does not apply).
5147
+ */
5148
+ type MachineCheck =
5149
+ /** A session came up (keys, or the stored password), as this account on that host. */
5150
+ {
5151
+ id: "ssh";
5152
+ state: "pass";
5153
+ user: string;
5154
+ host: string;
5155
+ }
5156
+ /** It did not; `said` is ssh's own words, led by what they mean. */
5157
+ | {
5158
+ id: "ssh";
5159
+ state: "fail";
5160
+ reason: MachineSshFailure;
5161
+ said: string;
5162
+ }
5163
+ /**
5164
+ * `warn` for Windows (installable, not connectable yet), and for a Linux whose glibc runs the
5165
+ * release but is older than `terminalsNeed`, the one its terminal binding loads on.
5166
+ */
5167
+ | {
5168
+ id: "platform";
5169
+ state: "pass" | "warn";
5170
+ os: string;
5171
+ arch: string;
5172
+ glibc?: string;
5173
+ terminalsNeed?: string;
5174
+ }
5175
+ /**
5176
+ * What the release's Node cannot run on: an OS or architecture no release is published for
5177
+ * (`unsupported`, `said` what the machine answered), a glibc older than `need` (`glibc`), or
5178
+ * a musl libc such as Alpine's (`musl`).
5179
+ */
5180
+ | {
5181
+ id: "platform";
5182
+ state: "fail";
5183
+ reason: "unsupported" | "glibc" | "musl";
5184
+ os?: string;
5185
+ arch?: string;
5186
+ glibc?: string;
5187
+ need?: string;
5188
+ said?: string;
5189
+ }
5190
+ /**
5191
+ * What the release installer needs and the machine lacks. `warn` when curl alone is missing:
5192
+ * the release is then sent over ssh rather than downloaded there.
5193
+ */
5194
+ | {
5195
+ id: "tools";
5196
+ state: "pass" | "warn" | "fail";
5197
+ missing: string[];
5198
+ }
5199
+ /**
5200
+ * Whether the machine itself reaches release `version` for its platform. `warn`: out of
5201
+ * reach, so an install cannot download it there; `fail`: both sources answered and neither
5202
+ * has it (not published).
5203
+ */
5204
+ | {
5205
+ id: "download";
5206
+ state: "pass" | "warn" | "fail";
5207
+ version: string;
5208
+ github: MachineSourceReach;
5209
+ oss: MachineSourceReach;
5210
+ }
5211
+ /** Free space in the machine's home against what an install needs, in MB. */
5212
+ | {
5213
+ id: "disk";
5214
+ state: "pass" | "warn" | "fail";
5215
+ freeMb: number;
5216
+ needMb: number;
5217
+ }
5218
+ /** The port its server would start on: free, already its PenguinHarness server's, or taken by something else. */
5219
+ | {
5220
+ id: "port";
5221
+ state: "pass" | "fail";
5222
+ port: number;
5223
+ holder: "free" | "penguin" | "other";
5224
+ } | {
5225
+ id: "platform" | "tools" | "download" | "disk" | "port";
5226
+ state: "skip";
5227
+ };
5228
+ /**
5229
+ * `POST /api/projects/:projectId/machines/:machineId/diagnose`: the checks, in order. Nothing
5230
+ * is written on the machine; 409 `job_running` while a job works on it.
5231
+ */
5232
+ interface MachineDiagnosis {
5233
+ machineId: string;
5234
+ checkedAt: string;
5235
+ checks: MachineCheck[];
5236
+ }
5237
+ interface MachinesUseResponse extends MachinesResponse {
5238
+ refused: {
5239
+ machineId: string;
5240
+ why: MachineUseRefusal;
5241
+ }[];
5242
+ }
5243
+ /** `POST /api/projects/:projectId/machines/stop-using`: let go of these machines — connection dropped, Project membership released; the install stays. */
5244
+ interface MachinesStopUsingRequest {
5245
+ machines: string[];
5246
+ }
5247
+ /**
5248
+ * Organization status: `paused` stops every automatic trigger; humans can still talk to any
5249
+ * desk. These two values are the whole lifecycle — no route deletes an organization, so a
5250
+ * paused one keeps its conversations, employees, desks and tickets.
5251
+ */
5252
+ type OrgStatus = "active" | "paused";
5253
+ /** Approval mode for desk and ticket sessions; unattended runs never get always-ask. */
5254
+ type OrgApprovalMode = "allow-all" | "read-only" | "deny-all";
5255
+ /** The five kanban columns, each a directory under `tickets/<yyyy-mm>/`. */
5256
+ type OrgTicketStatus = "proposed" | "in_progress" | "review" | "done" | "rejected";
5257
+ type OrgTicketPriority = "P0" | "P1" | "P2";
5258
+ /** Live employee state: running when the desk or any ticket session has a Task in progress; paused when budget-paused. */
5259
+ type OrgEmployeeState = "running" | "idle" | "paused";
5260
+ /**
5261
+ * The trigger kinds an `[org_trigger]` block carries. `ticket_notice` is read-only: a ticket
5262
+ * change starts no run of its own, so nothing writes that kind any more, and it stays in the
5263
+ * union because Traces recorded while it did still carry it.
5264
+ */
5265
+ type OrgTriggerKind = "init" | "event" | "mention" | "ticket_notice" | "ticket_work";
5266
+ /** The ticket changes an employee is told about, listed in the body of its next calendar sweep. */
5267
+ type OrgTicketChange = "assigned" | "blocked" | "blocker_closed" | "done" | "rejected";
5268
+ /** What the last evaluation of a calendar event did. */
5269
+ type OrgCalendarOutcome = "fired" | "queued" | "paused" | "missed" | "error";
5270
+ /**
5271
+ * The organization's working language: the language its handbook, its CEO's initialization
5272
+ * run, every employee brief and every desk and ticket run are written in. Detected from the
5273
+ * mission at creation (CJK text → `zh`, anything else → `en`) unless the request names one.
5274
+ */
5275
+ type OrgLanguage = "zh" | "en";
5276
+ /** The organization's settings as `org_config.toml` records them. */
5277
+ interface OrganizationSettings {
5278
+ name: string;
5279
+ mission: string;
5280
+ status: OrgStatus;
5281
+ /** IANA timezone: budget periods (natural months) and chat day files follow it. */
5282
+ timezone: string;
5283
+ approvalMode: OrgApprovalMode;
5284
+ /** Chat @-chain limit: a message whose hop reaches it records its mentions without triggering anyone. */
5285
+ mentionChainLimit: number;
5286
+ budgetWarnRatio: number;
5287
+ budgetPauseRatio: number;
5288
+ createdBy: string;
5289
+ /** The shared workspace root when it is not the organization's own `workspace/` (absolute path). */
5290
+ workspace?: string;
3649
5291
  /** The model desks and ticket sessions run on when the employee names none; absent = the Project default. */
3650
5292
  model?: {
3651
5293
  provider: string;
@@ -3685,8 +5327,20 @@ interface OrganizationsResponse {
3685
5327
  }
3686
5328
  interface OrgEmployeeItem {
3687
5329
  agentId: string;
3688
- /** Agent display name (system_config.yaml); falls back to the id. */
5330
+ /**
5331
+ * What this employee goes by in the organization, unique across it: the chart's `name`, else
5332
+ * the Agent's display name, else the id — with the id noted (`name (id)`) when the name is
5333
+ * not this employee's alone. It is what every surface shows and what works after `@`.
5334
+ */
3689
5335
  name: string;
5336
+ /** The `name` as written in the chart, for editing; absent when the entry has none. */
5337
+ givenName?: string;
5338
+ /**
5339
+ * Present when the employee has an avatar: the content revision of the image served at
5340
+ * `GET …/employees/:agentId/avatar` (append it as `?rev=` — the image is cached for good).
5341
+ * Absent, surfaces draw the letter tile.
5342
+ */
5343
+ avatarRev?: string;
3690
5344
  title: string;
3691
5345
  /** null for the CEO (the root). */
3692
5346
  reportsTo: string | null;
@@ -3702,6 +5356,11 @@ interface OrgEmployeeItem {
3702
5356
  modelId: string;
3703
5357
  };
3704
5358
  state: OrgEmployeeState;
5359
+ /**
5360
+ * The employee's current desk. Absent while the ledger names none, and while the Session
5361
+ * it names no longer exists (deleted by hand, or with its Agent): a desk is listed only
5362
+ * once it can be opened, and the reconcile pass re-opens a missing one when it can.
5363
+ */
3705
5364
  desk?: {
3706
5365
  sessionId: string;
3707
5366
  workspace: string;
@@ -3715,6 +5374,12 @@ interface OrgEmployeeItem {
3715
5374
  };
3716
5375
  /** Why the entry cannot be triggered (missing Agent, missing workspace directory). */
3717
5376
  invalid?: string;
5377
+ /**
5378
+ * The entry's Agent no longer exists (`invalid` carries the sentence). Its desk cannot be
5379
+ * opened; the entry stays until a person makes the employee leave, or until an Agent with
5380
+ * the same id is created again (which is how a deleted CEO is restored).
5381
+ */
5382
+ agentMissing?: true;
3718
5383
  }
3719
5384
  interface OrgChartResponse {
3720
5385
  ceoAgentId: string;
@@ -3977,8 +5642,15 @@ interface OrgDeskItem {
3977
5642
  status: SessionStatus;
3978
5643
  workspace: string;
3979
5644
  lastActiveAt?: string;
5645
+ /**
5646
+ * Present when the desk session has an ENABLED messaging binding: its channel, read as
5647
+ * `SessionInfo.messagingChannel` is (the company sidebar's desk row draws the same mark as a
5648
+ * development row, and the development list never holds a desk).
5649
+ */
5650
+ messagingChannel?: MessagingChannel;
3980
5651
  }
3981
5652
  interface OrgSessionsResponse {
5653
+ /** One per employee whose current desk Session exists; a desk the ledger names but the server no longer has is left out. */
3982
5654
  desks: OrgDeskItem[];
3983
5655
  tickets: Array<{
3984
5656
  ticketId: string;
@@ -4069,19 +5741,30 @@ interface OrganizationPatchRequest {
4069
5741
  language?: OrgLanguage;
4070
5742
  }
4071
5743
  /**
4072
- * A semantic id proposed for a display name — the organization and channel dialogs let the
4073
- * user name the thing first and derive the id from that name. The server asks the Project's
4074
- * default model for a short English snake_case id (a Chinese name has no mechanical
5744
+ * What a proposed semantic id names. Each kind has its own shape — organization and channel
5745
+ * ids carry a `co_` / `ch_` prefix, a non-admin's Project id its owner's `<username>-`, a
5746
+ * Benchmark id is kebab-case — and its own set of ids to avoid.
5747
+ */
5748
+ type SemanticIdKind = "org" | "channel" | "project" | "agent" | "benchmark";
5749
+ /**
5750
+ * A semantic id proposed for a display name — every create dialog that names an object with a
5751
+ * semantic id (a Project, an Agent, a Benchmark, an organization, a channel) lets the user name
5752
+ * the thing first and derive the id from that name. The server asks the Project's default
5753
+ * model for a short English id in the kind's spelling (a Chinese name has no mechanical
4075
5754
  * transliteration), falling back to an ASCII slug of the name when the model is unavailable,
4076
5755
  * and to a dated placeholder when neither can name it. The request never fails for a name it
4077
5756
  * cannot translate: a dialog that asked for an id always gets one back.
4078
5757
  */
4079
5758
  interface SemanticIdSuggestRequest {
4080
- /** The display name typed so far (or the mission, when nothing else names the thing). */
5759
+ /** The display name typed so far (or the mission / description, when nothing else names the thing). */
4081
5760
  name: string;
4082
- /** What the id is for: decides the prompt's examples and the fallback's prefix. */
4083
- kind: "org" | "channel";
4084
- /** Ids already in use in the target scope; the proposal avoids them. */
5761
+ /** What the id is for: decides the id's shape, the prompt's examples and the ids avoided. */
5762
+ kind: SemanticIdKind;
5763
+ /**
5764
+ * Ids already in use in the target scope; the proposal avoids them. For a Project, an Agent or
5765
+ * a Benchmark, the server also avoids, on its own, every id that kind's create route refuses
5766
+ * as taken, a leftover folder no list shows included.
5767
+ */
4085
5768
  taken?: string[];
4086
5769
  }
4087
5770
  /**
@@ -4093,7 +5776,10 @@ interface SemanticIdSuggestRequest {
4093
5776
  */
4094
5777
  type SemanticIdSuggestReason = "no_default_model" | "model_failed" | "unusable_answer" | "no_ascii";
4095
5778
  interface SemanticIdSuggestResponse {
4096
- /** A valid semantic id (`^[a-z][a-z0-9_]{1,63}$`), not in `taken`. */
5779
+ /**
5780
+ * An id the kind's create route accepts, not in `taken`: `^[a-z][a-z0-9_]{1,63}$` for most
5781
+ * kinds, `<username>-<suffix>` for a non-admin's Project, kebab-case for a Benchmark.
5782
+ */
4097
5783
  id: string;
4098
5784
  /** Who produced it: the model, the ASCII fallback, or the dated placeholder that names nothing. */
4099
5785
  source: "model" | "fallback" | "placeholder";
@@ -4110,6 +5796,11 @@ interface OrgHireRequest {
4110
5796
  description?: string;
4111
5797
  plugins?: string[];
4112
5798
  };
5799
+ /**
5800
+ * What the organization calls the employee (any script, one line, no `@`, ≤ 64 characters).
5801
+ * Omitted, a new Agent's `name` is used; with neither, the Agent's display name stands in.
5802
+ */
5803
+ name?: string;
4113
5804
  title: string;
4114
5805
  reportsTo: string;
4115
5806
  workspace?: string;
@@ -4121,6 +5812,8 @@ interface OrgHireRequest {
4121
5812
  };
4122
5813
  }
4123
5814
  interface OrgEmployeePatchRequest {
5815
+ /** null (or an empty string) clears the name: back to the Agent's display name. */
5816
+ name?: string | null;
4124
5817
  title?: string;
4125
5818
  reportsTo?: string;
4126
5819
  workspace?: string;
@@ -4321,5 +6014,875 @@ interface ContributionsResponse {
4321
6014
  agentTabs: WebContribution[];
4322
6015
  sessionTabs: WebContribution[];
4323
6016
  }
6017
+ /**
6018
+ * One field of a settings group a module declares (its `PluginConfigProvider.groups`
6019
+ * contribution's `properties.<name>`): what the Settings dialog draws for it. `secret` is
6020
+ * drawn as a password field and masked on the way out; `enum` is a choice among `options`;
6021
+ * `list` is a list of strings, drawn one per line; `table` is a fixed set of `rows`, each a
6022
+ * value per one of its `columns`, drawn as a table.
6023
+ */
6024
+ interface PluginConfigField {
6025
+ type: "string" | "secret" | "boolean" | "number" | "enum" | "list" | "table";
6026
+ title: string;
6027
+ titleZh?: string;
6028
+ /** What the field means: disclosed behind a "?" beside its title. */
6029
+ description?: string;
6030
+ descriptionZh?: string;
6031
+ /**
6032
+ * The shape a value must take ("one absolute path per line"): shown under the field at all
6033
+ * times, since it is read while typing.
6034
+ */
6035
+ hint?: string;
6036
+ hintZh?: string;
6037
+ placeholder?: string;
6038
+ /** The value a package with nothing stored reads; also what an empty field falls back to. */
6039
+ default?: string | number | boolean | string[];
6040
+ /**
6041
+ * Drawn in the card's Advanced fold, collapsed by default, rather than among the basic
6042
+ * fields. Presentation only: it is stored, validated and read like any other field.
6043
+ */
6044
+ advanced?: boolean;
6045
+ /** A save that would leave this field empty is refused. */
6046
+ required?: boolean;
6047
+ /** `enum` only: the values it may take, in display order. */
6048
+ options?: PluginConfigOption[];
6049
+ /** `list` only: the most entries a save may leave (after trimming and de-duplicating). */
6050
+ maxItems?: number;
6051
+ /** `number` only: the smallest and largest value a save may store. */
6052
+ minimum?: number;
6053
+ maximum?: number;
6054
+ /** `string` / `list` only: a regular expression every value (every line) must match. */
6055
+ pattern?: string;
6056
+ /** What a save refused by `pattern` says, after the field's name (e.g. "must be an absolute path"). */
6057
+ patternErrorMessage?: string;
6058
+ /**
6059
+ * `table` only: its columns, in display order, and its rows, in display order. The table
6060
+ * has no `default`: the rows' declared cells are its defaults, and what is stored is only
6061
+ * the cells that differ from them — `{ [row id]: { [column]: value } }`.
6062
+ */
6063
+ columns?: PluginConfigTableColumn[];
6064
+ rows?: PluginConfigTableRow[];
6065
+ /**
6066
+ * `table` only: a single choice of one row — the sandbox's default preset. The choice is
6067
+ * stored in `field`, an `enum` field of the same group whose options are the row ids (plus,
6068
+ * in an `extensible` table, the ids of the rows added to it); the page draws that field only
6069
+ * as its title in brackets after the chosen row's name ("(Default)"), and picks it from a
6070
+ * row's "…" menu.
6071
+ */
6072
+ rowChoice?: PluginConfigRowChoice;
6073
+ /**
6074
+ * `table` only: rows may be added (and only those deleted, from the row's "…" menu) and every
6075
+ * row reordered. A new row
6076
+ * starts from these values. What is stored, beside the declared rows' changed cells, is the
6077
+ * added rows under `"$added"` (`{ [row id]: { [column]: value } }`, every column present) and
6078
+ * the row order under `"$order"` (row ids); neither key can be a row id. A save sends either
6079
+ * key whole; a document without them reads as the declared rows in declared order.
6080
+ */
6081
+ extensible?: PluginConfigNewRow;
6082
+ /**
6083
+ * `table` only: a header drawn over adjacent columns that belong together (the sandbox's
6084
+ * Pin, under "Action"). `columns` names them. When the group ends the columns, the row's drag
6085
+ * handle and "…" menu join it.
6086
+ */
6087
+ columnGroup?: PluginConfigColumnGroup;
6088
+ /**
6089
+ * `table` only: a `boolean` column drawn as a pin toggle rather than a switch — a row pinned
6090
+ * to a list (the sandbox presets in the composer's menu). The texts are its tooltip in each
6091
+ * state. Declared on the table, not the column, so every column keeps one shape.
6092
+ */
6093
+ pin?: PluginConfigPinColumn;
6094
+ }
6095
+ /** A table's pin column: which boolean column, and its tooltip pinned and not. */
6096
+ interface PluginConfigPinColumn {
6097
+ column: string;
6098
+ on: string;
6099
+ onZh?: string;
6100
+ off: string;
6101
+ offZh?: string;
6102
+ }
6103
+ /**
6104
+ * A table's single choice of a row: the `enum` field it stores into, and its title, drawn in
6105
+ * brackets after the chosen row's name. The choice may name no row (nothing stored, and the
6106
+ * group's `derive` gives none): no row is marked and a save is not refused for it. A save that
6107
+ * leaves it naming a row the table no longer has is refused.
6108
+ */
6109
+ interface PluginConfigRowChoice {
6110
+ field: string;
6111
+ title: string;
6112
+ titleZh?: string;
6113
+ }
6114
+ /** One column of a `table` field: a scalar field type (`string`, `boolean`, or an `enum` with `options`). */
6115
+ interface PluginConfigTableColumn {
6116
+ name: string;
6117
+ type: "string" | "boolean" | "enum";
6118
+ title: string;
6119
+ titleZh?: string;
6120
+ /** What the column means: disclosed behind a "?" beside its header. */
6121
+ description?: string;
6122
+ descriptionZh?: string;
6123
+ options?: PluginConfigOption[];
6124
+ }
6125
+ /** One row of a `table` field: its id and its declared cells. */
6126
+ interface PluginConfigTableRow {
6127
+ id: string;
6128
+ /** Every column's declared value. */
6129
+ values: Record<string, string | boolean>;
6130
+ /** A string cell's declared value in Chinese, shown until a save changes the cell. */
6131
+ valuesZh?: Record<string, string>;
6132
+ /** Columns whose cell in this row a save may not change. */
6133
+ locked?: string[];
6134
+ /** A row added to an `extensible` table (not declared): the only kind that may be deleted. */
6135
+ added?: boolean;
6136
+ /**
6137
+ * What the row is for, disclosed behind a "?" beside its name while its `enum` cells hold
6138
+ * their declared values. A row without one, or whose choices changed, gets a "?" listing its
6139
+ * `enum` cells' values and what each does (the options' `description`s).
6140
+ */
6141
+ description?: string;
6142
+ descriptionZh?: string;
6143
+ }
6144
+ /** A header over adjacent table columns, with its own "?". */
6145
+ interface PluginConfigColumnGroup {
6146
+ title: string;
6147
+ titleZh?: string;
6148
+ description?: string;
6149
+ descriptionZh?: string;
6150
+ columns: string[];
6151
+ }
6152
+ /** The values a row added to an `extensible` table starts from. */
6153
+ interface PluginConfigNewRow {
6154
+ /** The add button's text ("Add preset"). */
6155
+ add?: string;
6156
+ addZh?: string;
6157
+ values: Record<string, string | boolean>;
6158
+ /** A string column's starting text in Chinese. */
6159
+ valuesZh?: Record<string, string>;
6160
+ }
6161
+ /** One choice of an `enum` field. */
6162
+ interface PluginConfigOption {
6163
+ value: string;
6164
+ title: string;
6165
+ titleZh?: string;
6166
+ /** What picking it does: listed, for a table column's option, in a row's "?" (see the row's `description`). */
6167
+ description?: string;
6168
+ descriptionZh?: string;
6169
+ }
6170
+ /** A declared configuration: a titled group of fields, in declaration order. */
6171
+ interface PluginConfiguration {
6172
+ title?: string;
6173
+ titleZh?: string;
6174
+ description?: string;
6175
+ descriptionZh?: string;
6176
+ /**
6177
+ * A `boolean` field that turns the group on (the sandbox's `enabled`). While it is off, as
6178
+ * drafted, the card draws that field alone: no other field, notice or action, and none of the
6179
+ * groups drawn inside it. Turning it on in a group that reports a `backend` it lacks offers
6180
+ * to install one.
6181
+ */
6182
+ switch?: string;
6183
+ properties: Record<string, PluginConfigField>;
6184
+ }
6185
+ /** A line of live status a contributed group reports beside its fields (e.g. that nothing can enforce it). */
6186
+ interface PluginConfigNotice {
6187
+ /**
6188
+ * `progress` = work the group started is still running (an install, a download): the page
6189
+ * reads the groups again every few seconds while any notice says so, and the text is the
6190
+ * step it is on.
6191
+ */
6192
+ tone: "attention" | "muted" | "progress";
6193
+ text: string;
6194
+ textZh?: string;
6195
+ /** More about the notice, disclosed under it on request; lines separated by `\n`. */
6196
+ details?: string;
6197
+ detailsZh?: string;
6198
+ }
6199
+ /** One settings group (GET /api/admin/plugin-config): its schema and its values, secrets masked. */
6200
+ interface PluginConfigEntry {
6201
+ /** The group's name — the id of the contribution that declared it; also the store key. */
6202
+ name: string;
6203
+ configuration: PluginConfiguration;
6204
+ /** Stored values merged onto the defaults; a secret arrives masked (`first4…last4` or `***`), never in the clear. */
6205
+ values: Record<string, unknown>;
6206
+ /** Drawn inside that entry's card and saved with it (a sandbox backend's options inside the sandbox's). */
6207
+ parent?: string;
6208
+ /** Live status beside the fields; absent when there is none. */
6209
+ notices?: PluginConfigNotice[];
6210
+ /** What this group can DO once, on the machine, drawn as buttons beneath its notices. */
6211
+ actions?: PluginConfigActionDecl[];
6212
+ /** Enum options this machine cannot honour now: drawn greyed out with the reason; a save choosing one is refused. */
6213
+ unavailable?: PluginConfigUnavailableDecl[];
6214
+ /**
6215
+ * For a group whose settings a backend plugin enforces (the sandbox): whether one that
6216
+ * applies to this machine's OS is installed, and which packages this OS defaults to. The card
6217
+ * offers to install `recommended` when the group's switch is turned on and none is installed.
6218
+ * Asked per read, like the notices; the client never guesses the OS.
6219
+ */
6220
+ backend?: PluginConfigBackend;
6221
+ }
6222
+ /** Whether a backend that applies to this machine is installed, and this OS's default ones. */
6223
+ interface PluginConfigBackend {
6224
+ /** A backend for this OS is installed: loaded, or installed and failing its check. */
6225
+ installed: boolean;
6226
+ /**
6227
+ * The npm packages this OS defaults to, installed together; absent on an OS with no default
6228
+ * backend. Linux names two: bubblewrap, and sandbox-dsh, which confines files through
6229
+ * Landlock where bubblewrap is refused.
6230
+ */
6231
+ recommended?: string[];
6232
+ }
6233
+ /** One enum option (or boolean position) a settings group cannot honour on this machine, and why. */
6234
+ interface PluginConfigUnavailableDecl {
6235
+ field: string;
6236
+ /** A `table` field's column: the option is unavailable in every cell of that column. */
6237
+ column?: string;
6238
+ /** An enum option, or a boolean field's position: "true" or "false". */
6239
+ value: string;
6240
+ reason: string;
6241
+ reasonZh?: string;
6242
+ }
6243
+ /** One button under a settings group: what it is called, and what pressing it will do. */
6244
+ interface PluginConfigActionDecl {
6245
+ id: string;
6246
+ title: string;
6247
+ titleZh?: string;
6248
+ description?: string;
6249
+ descriptionZh?: string;
6250
+ }
6251
+ /** POST /api/admin/plugin-config/action — what running one reported. */
6252
+ interface PluginConfigActionResponse {
6253
+ ok: boolean;
6254
+ message: string;
6255
+ messageZh?: string;
6256
+ /** The groups as they stand after it ran: a setup that worked changes what the page says. */
6257
+ plugins: PluginConfigEntry[];
6258
+ }
6259
+ interface PluginConfigResponse {
6260
+ plugins: PluginConfigEntry[];
6261
+ }
6262
+ /**
6263
+ * PUT /api/admin/plugin-config — one group's update. Every named field is validated
6264
+ * against its type; an omitted field keeps its stored value; a secret sent as the masked
6265
+ * value keeps the stored one, and `null` or `""` clears any field. 400 `plugin_config_invalid`
6266
+ * (with `field`) on a value that does not fit or a required field left empty; 404
6267
+ * `plugin_config_unknown` for a name no group answers to.
6268
+ */
6269
+ interface PluginConfigUpdateRequest {
6270
+ name: string;
6271
+ values: Record<string, unknown>;
6272
+ }
6273
+ /**
6274
+ * An installed plugin the running build cannot fully run (plugin/unsatisfied.ts): it
6275
+ * contributes to a slot, or wires to a module or interface, that this build does not have.
6276
+ * Also what a refused push names (`plugins_unsatisfied`) and a confirmed one reports.
6277
+ */
6278
+ interface UnsatisfiedPlugin {
6279
+ /** The package specifier, as the installed-plugins list spells it. */
6280
+ specifier: string;
6281
+ /** True when the whole plugin is left out of this generation; false when only the contributions this build has no slot for were dropped and the rest of it runs. */
6282
+ disabled: boolean;
6283
+ /** What this build lacks, in the platform's own words. */
6284
+ reason: string;
6285
+ }
6286
+ /** One plugin a Project lists (GET /api/projects/:projectId/plugins/installed). */
6287
+ interface InstalledPlugin {
6288
+ /** The package specifier as written in the file. */
6289
+ specifier: string;
6290
+ /** Whether the running process holds this package — its modules are in the tree. */
6291
+ active: boolean;
6292
+ /**
6293
+ * Where the package came from: shipped with the build (a hot push's assets, or the
6294
+ * installation's own `plugins/`) rather than fetched from npm. A tag on an installed
6295
+ * plugin — being shipped is not being installed.
6296
+ */
6297
+ builtin: boolean;
6298
+ /** Module names the package declares it adds. */
6299
+ modules: string[];
6300
+ /** Node names the package declares it stands in for. */
6301
+ replaces: string[];
6302
+ /**
6303
+ * Why the package is not running: unresolvable, or a load that
6304
+ * failed (an import that threw, a module name another plugin already took). Only ever
6305
+ * reported for a plugin this server is asked to run (`here`).
6306
+ */
6307
+ error?: string;
6308
+ /**
6309
+ * Present when this build cannot fully run the package (see {@link UnsatisfiedPlugin}).
6310
+ * With `disabled`, `active` is false and a restart would not load it; without, the package
6311
+ * runs minus the contributions this build has no slot for. Only reported for a plugin this
6312
+ * server is asked to run (`here`).
6313
+ */
6314
+ unsatisfied?: Pick<UnsatisfiedPlugin, "disabled" | "reason">;
6315
+ /** Listed in the shared `[plugins]` table: every machine runs it. */
6316
+ everywhere: boolean;
6317
+ /** The machines whose own `[plugins.<machineId>]` table lists it, by machine id. */
6318
+ machines: string[];
6319
+ /**
6320
+ * Whether THIS server is asked to run it — shared, or listed for this server's own id. A
6321
+ * plugin listed only for other machines is neither installed nor loaded here, so `active`
6322
+ * is false and no `error` is reported for it.
6323
+ */
6324
+ here: boolean;
6325
+ }
6326
+ /** What an install put on this server (POST …/plugins/installed and …/installed/archive). */
6327
+ interface PluginInstallOutcome {
6328
+ /** The package name npm installed — for a link, the name its package.json carries. */
6329
+ name: string;
6330
+ version: string | null;
6331
+ /** It carries skills, a hook package or MCP servers: the library lists it, and nothing loads it. */
6332
+ library: boolean;
6333
+ /** It carries server modules: the Project's list loads it. */
6334
+ modules: boolean;
6335
+ /** The zip held the version already installed: nothing was installed. */
6336
+ unchanged?: boolean;
6337
+ }
6338
+ /** POST /api/projects/:projectId/plugins/installed/archive (admin): a plugin package zip, base64. */
6339
+ interface PluginArchiveImportRequest {
6340
+ dataBase64: string;
6341
+ /** Replace another installed version of the package (the 409 `plugin_exists` question). */
6342
+ overwrite?: boolean;
6343
+ }
6344
+ interface InstalledPluginsResponse {
6345
+ plugins: InstalledPlugin[];
6346
+ /** After an install: what landed on this server. */
6347
+ installed?: PluginInstallOutcome;
6348
+ /**
6349
+ * Specifiers this build SHIPS (the hot push's assets, or the installation's own
6350
+ * `plugins/`): installable without a download, and not installed until listed.
6351
+ */
6352
+ shipped: string[];
6353
+ /** The file the list lives in, named for the page that explains where to edit it by hand. */
6354
+ file: string;
6355
+ /** This server's own machine id — the key of its `[plugins.<machineId>]` table. */
6356
+ machineId: string;
6357
+ /** A listed plugin neither runs, nor failed to load, nor is one this build cannot run: the App could not be re-assembled around it (the previous one was restored), so a restart is what applies it. */
6358
+ restartPending: boolean;
6359
+ }
6360
+ /** The browser an agent drives: the desktop's built-in one, or the user's own Chrome. */
6361
+ type BrowserBackend = "builtin" | "chrome";
6362
+ /**
6363
+ * What a backend's link can do. The shell cannot create tabs (the Web App's <webview> does) and
6364
+ * throttles and measures its guests; the extension creates, closes and focuses tabs itself and
6365
+ * has no cookie store the server may touch.
6366
+ */
6367
+ interface BrowserLinkCapabilities {
6368
+ /** `open-tab`, `close-tab` and `activate-tab` are answered (chrome). */
6369
+ createsTabs: boolean;
6370
+ /** `throttle` and the `metrics` events (builtin). */
6371
+ throttles: boolean;
6372
+ /** `set-cookies` and `clear-data` (builtin). */
6373
+ cookieStore: boolean;
6374
+ }
6375
+ /**
6376
+ * One tab of the agent browser. Built-in: a guest page, `id` its webContents id. Chrome: a tab
6377
+ * the extension drives (one it created in the Penguin tab group, or one the user added), `id`
6378
+ * Chrome's tab id; `canGoBack`/`canGoForward` are always false there (the tabs API cannot read
6379
+ * them).
6380
+ */
6381
+ interface BuiltinBrowserTab {
6382
+ id: number;
6383
+ url: string;
6384
+ title: string;
6385
+ loading: boolean;
6386
+ canGoBack: boolean;
6387
+ canGoForward: boolean;
6388
+ favicon?: string;
6389
+ /**
6390
+ * Present while the page's renderer is gone, with Electron's reason (`crashed`, `oom`,
6391
+ * `killed`, …): the panel shows the crash until the page is reloaded, and an agent action on
6392
+ * the tab answers 409 `tab_crashed`.
6393
+ */
6394
+ crashed?: string;
6395
+ }
6396
+ /**
6397
+ * Why the agent browser cannot be driven. Built-in: not under the desktop shell, a shell too old
6398
+ * to host it, or no app window to host a new tab. Chrome: this user has no paired extension, it
6399
+ * is paired but not connected now, or an admin switched Chrome connections off server-wide.
6400
+ */
6401
+ type BuiltinBrowserUnavailableReason = "not_desktop" | "shell_unsupported" | "no_window" | "extension_not_paired" | "extension_disconnected" | "extension_disabled";
6402
+ /** One backend as GET /status lists it for the caller. */
6403
+ interface BrowserBackendInfo {
6404
+ backend: BrowserBackend;
6405
+ available: boolean;
6406
+ reason?: BuiltinBrowserUnavailableReason;
6407
+ /** chrome: the caller's connected extension, else the one seen most recently; absent when none is paired. */
6408
+ extension?: {
6409
+ id: string;
6410
+ name: string;
6411
+ version: string;
6412
+ connected: boolean;
6413
+ lastSeenAt: string | null;
6414
+ };
6415
+ }
6416
+ /**
6417
+ * GET /api/builtin-browser/status: the caller's effective backend (`backend`) — whether it can
6418
+ * be driven now, its tabs — and every backend this server offers the caller (`backends`).
6419
+ */
6420
+ interface BuiltinBrowserStatus {
6421
+ /** Whether the effective backend can be driven now. */
6422
+ available: boolean;
6423
+ reason?: BuiltinBrowserUnavailableReason;
6424
+ backend: BrowserBackend;
6425
+ backends: BrowserBackendInfo[];
6426
+ tabs: BuiltinBrowserTab[];
6427
+ activeTabId: number | null;
6428
+ /** The shell's latest measurement of the built-in browser's load; absent before its first one, and on chrome. */
6429
+ metrics?: BuiltinBrowserMetrics;
6430
+ }
6431
+ /** GET / PUT /api/builtin-browser/backend: the caller's backend and the ones they may choose. */
6432
+ interface BrowserBackendResponse {
6433
+ backend: BrowserBackend;
6434
+ choices: BrowserBackend[];
6435
+ }
6436
+ /** One Chrome paired to the caller's account (a row of `browser_extensions`). */
6437
+ interface BrowserExtensionRecord {
6438
+ id: string;
6439
+ /** As the extension names itself, e.g. "Chrome 130 on macOS". */
6440
+ name: string;
6441
+ version: string;
6442
+ createdAt: string;
6443
+ lastSeenAt: string | null;
6444
+ /** Whether this one holds the caller's connection now (one at a time per user). */
6445
+ connected: boolean;
6446
+ }
6447
+ /** GET /api/builtin-browser/extension. */
6448
+ interface BrowserExtensionsResponse {
6449
+ paired: BrowserExtensionRecord[];
6450
+ /** The id of the connected one, when one is. */
6451
+ connected?: string;
6452
+ /** The admin's server-wide switch (`ServerSettings.browserExtensionsEnabled`). */
6453
+ enabled: boolean;
6454
+ }
6455
+ /**
6456
+ * POST /api/builtin-browser/extension/pairings: a one-time code for the signed-in user, valid
6457
+ * for ten minutes, used once; the dialog shows it beside the server address.
6458
+ */
6459
+ interface BrowserExtensionPairingResponse {
6460
+ /** 43 base64url characters. */
6461
+ code: string;
6462
+ /** ISO time the code stops working. */
6463
+ expiresAt: string;
6464
+ /** The request's Origin, when it carried one: the address the browser reaches this server at. */
6465
+ origin: string | null;
6466
+ }
6467
+ /** POST /api/builtin-browser/extension/pair (no cookie: the extension's own request). */
6468
+ interface BrowserExtensionPairRequest {
6469
+ code: string;
6470
+ /** How the extension names this Chrome, e.g. "Chrome 130 on macOS" (1–80 characters). */
6471
+ name: string;
6472
+ /** The extension's own version (manifest.version). */
6473
+ version: string;
6474
+ }
6475
+ /** What /extension/pair answers: the long-lived token, shown once and stored only hashed here. */
6476
+ interface BrowserExtensionPairResponse {
6477
+ extensionId: string;
6478
+ /** Rides the WebSocket's subprotocol list as `token.<token>`; never a URL. */
6479
+ token: string;
6480
+ /** This server's install id (a stable name for the data root); null when it is unknown. */
6481
+ installId: string | null;
6482
+ user: {
6483
+ userId: string;
6484
+ displayName: string | null;
6485
+ };
6486
+ serverVersion: string;
6487
+ }
6488
+ /**
6489
+ * The extension WebSocket's close codes (`/api/builtin-browser/extension/ws`). Besides these the
6490
+ * server closes with 1012 when it restarts or hot-swaps (reconnect with the usual backoff).
6491
+ *
6492
+ * - 4001 replaced: another extension of the same user connected (last connected wins); do not
6493
+ * auto-retry.
6494
+ * - 4003 revoked: the pairing was revoked (or the token was); forget this server.
6495
+ * - 4005 protocol_mismatch: no `penguin-browser.1` subprotocol, or a hello the server does not
6496
+ * speak; the extension needs updating.
6497
+ * - 4008 ping_timeout: two pings (or the hello) went unanswered.
6498
+ * - 4009 disabled: an admin switched Chrome connections off; retry hourly.
6499
+ */
6500
+ type BrowserExtensionCloseCode = 4001 | 4003 | 4005 | 4008 | 4009;
6501
+ /** One tab's share of the built-in browser's load, as the shell last measured it. */
6502
+ interface BuiltinBrowserTabMetrics {
6503
+ tabId: number;
6504
+ /** The memory held by the processes behind the page (its own and its cross-site frames'), KB. */
6505
+ memoryKB: number;
6506
+ /** Their CPU use since the previous measurement, in percent of one core. */
6507
+ cpuPercent: number;
6508
+ }
6509
+ /** Why the built-in browser should be lighter. */
6510
+ type BuiltinBrowserLoadWarning =
6511
+ /** Its pages together hold more memory than they should. */
6512
+ "memory"
6513
+ /** This computer is running out of memory. */
6514
+ | "low_system_memory"
6515
+ /** More tabs are open than the browser should hold. */
6516
+ | "many_tabs";
6517
+ /**
6518
+ * The built-in browser's load: GET /status's `metrics`, and the `builtin_browser_metrics` event
6519
+ * after each of the shell's measurements (every ~10 s while tabs are open, and soon after one
6520
+ * closes). The thresholds are the server's; the UI and the CLI only word what it concluded.
6521
+ */
6522
+ interface BuiltinBrowserMetrics {
6523
+ /** When the server received the measurement (epoch ms). */
6524
+ at: number;
6525
+ tabs: BuiltinBrowserTabMetrics[];
6526
+ /** All the pages' memory, a process two tabs share counted once, KB. */
6527
+ totalKB: number;
6528
+ /**
6529
+ * This computer's memory, KB. Absent on macOS, whose free count leaves out the memory it would
6530
+ * readily hand back, so that "free" there reads as nearly none on a healthy machine.
6531
+ */
6532
+ system?: {
6533
+ freeKB: number;
6534
+ totalKB: number;
6535
+ };
6536
+ /** What to warn about now; empty when all is well. */
6537
+ warnings: BuiltinBrowserLoadWarning[];
6538
+ /** While a memory warning stands: the tabs holding the most memory, heaviest first. */
6539
+ heavyTabIds: number[];
6540
+ }
6541
+ /** GET /api/builtin-browser/tabs. */
6542
+ interface BuiltinBrowserTabsResponse {
6543
+ tabs: BuiltinBrowserTab[];
6544
+ activeTabId: number | null;
6545
+ }
6546
+ /** POST /api/builtin-browser/tabs/:tab/scan — GenericAgent's web_scan. */
6547
+ interface BuiltinBrowserScanResult {
6548
+ tab: BuiltinBrowserTab;
6549
+ tabs: BuiltinBrowserTab[];
6550
+ activeTabId: number | null;
6551
+ /** Simplified HTML, or plain text with `textOnly`. */
6552
+ content?: string;
6553
+ truncated?: boolean;
6554
+ }
6555
+ /** POST /api/builtin-browser/tabs/:tab/exec (and click / type) — GenericAgent's web_execute_js. */
6556
+ interface BuiltinBrowserExecResult {
6557
+ status: "success" | "failed";
6558
+ tabId: number;
6559
+ /** The script's JSON-safe return value. */
6560
+ value?: unknown;
6561
+ error?: string;
6562
+ /** The page navigated or reloaded while the script ran. */
6563
+ reloaded?: boolean;
6564
+ /** Tabs opened while the call ran (popups, target=_blank). */
6565
+ newTabs?: {
6566
+ id: number;
6567
+ url: string;
6568
+ }[];
6569
+ /** Text that appeared during the call and may be gone again (toasts, flashes). */
6570
+ transients?: string[];
6571
+ diff?: {
6572
+ changed: number;
6573
+ topChange?: string;
6574
+ };
6575
+ suggestion?: string;
6576
+ /** click only: where the trusted click landed. */
6577
+ clicked?: {
6578
+ x: number;
6579
+ y: number;
6580
+ tag?: string;
6581
+ text?: string;
6582
+ };
6583
+ /** The page's dialogs the call answered, in order (see BuiltinBrowserDialog). */
6584
+ dialogs?: BuiltinBrowserDialog[];
6585
+ }
6586
+ /**
6587
+ * A dialog the page opened during an exec, click or type, which the call answered so the page
6588
+ * would not block: an alert is accepted, and a confirm, prompt or leave-page dialog dismissed
6589
+ * unless the request said `acceptDialogs`.
6590
+ */
6591
+ interface BuiltinBrowserDialog {
6592
+ type: "alert" | "confirm" | "prompt" | "beforeunload";
6593
+ message: string;
6594
+ accepted: boolean;
6595
+ }
6596
+ /** POST /api/builtin-browser/tabs/:tab/screenshot. */
6597
+ interface BuiltinBrowserScreenshot {
6598
+ mime: "image/png";
6599
+ /** Base64. */
6600
+ data: string;
6601
+ }
6602
+ type BuiltinBrowserImportBrowser = "chrome" | "edge" | "brave" | "chromium" | "vivaldi" | "opera" | "arc" | "firefox";
6603
+ /** One profile of a system browser that can be imported from. */
6604
+ interface BuiltinBrowserImportSource {
6605
+ /** `<browser>:<profile dir>`, e.g. `chrome:Default`. */
6606
+ id: string;
6607
+ browser: BuiltinBrowserImportBrowser;
6608
+ browserName: string;
6609
+ /** The profile's directory name. */
6610
+ profile: string;
6611
+ /** The profile's display name. */
6612
+ profileName: string;
6613
+ hasCookies: boolean;
6614
+ hasHistory: boolean;
6615
+ }
6616
+ interface BuiltinBrowserImportSourcesResponse {
6617
+ sources: BuiltinBrowserImportSource[];
6618
+ }
6619
+ /** POST /api/builtin-browser/import. */
6620
+ interface BuiltinBrowserImportRequest {
6621
+ sourceId: string;
6622
+ cookies?: boolean;
6623
+ history?: boolean;
6624
+ /** Only cookies of these sites (a domain matches itself and its subdomains). */
6625
+ domains?: string[];
6626
+ }
6627
+ interface BuiltinBrowserImportResult {
6628
+ sourceId: string;
6629
+ cookies?: {
6630
+ found: number;
6631
+ imported: number;
6632
+ skipped: number;
6633
+ failed: number;
6634
+ };
6635
+ history?: {
6636
+ found: number;
6637
+ imported: number;
6638
+ };
6639
+ warnings: string[];
6640
+ }
6641
+ interface BuiltinBrowserHistoryEntry {
6642
+ url: string;
6643
+ title: string;
6644
+ visitCount: number;
6645
+ /** Epoch ms. */
6646
+ lastVisitAt: number;
6647
+ /** `builtin` for pages visited in the built-in browser, else the browser it was imported from. */
6648
+ source: string;
6649
+ }
6650
+ interface BuiltinBrowserHistoryResponse {
6651
+ entries: BuiltinBrowserHistoryEntry[];
6652
+ }
6653
+ /**
6654
+ * GET / PUT /api/builtin-browser/settings: the browser's own settings, a file of the server's
6655
+ * that is read and written without the desktop shell. PUT takes the whole object.
6656
+ */
6657
+ interface BuiltinBrowserSettings {
6658
+ /**
6659
+ * The page a new tab opens when it is given no address — the panel's "+", an agent's new tab
6660
+ * — and the toolbar's Home button goes to: an http(s) address, or null for none (a new tab is
6661
+ * then blank). PUT takes a bare host too and answers the address as stored.
6662
+ */
6663
+ homepage: string | null;
6664
+ }
6665
+ type BuiltinBrowserAction = "navigate" | "scan" | "exec" | "click" | "type" | "screenshot" | "cdp";
6666
+ /**
6667
+ * User-channel events of the agent browser. The built-in backend's go to every admin; a chrome
6668
+ * backend's go to the user whose Chrome it is, as do `builtin_browser_backend` and
6669
+ * `builtin_browser_extension`.
6670
+ */
6671
+ type BuiltinBrowserServerEvent =
6672
+ /**
6673
+ * A backend's whole tab list. `backend` names whose: a desktop admin hears both the built-in
6674
+ * browser's and their own Chrome's, and the two lists must not overwrite each other.
6675
+ */
6676
+ {
6677
+ type: "builtin_browser_tabs";
6678
+ tabs: BuiltinBrowserTab[];
6679
+ activeTabId: number | null;
6680
+ backend: BrowserBackend;
6681
+ }
6682
+ /** Create a guest for `url`, then POST /tabs/claim with `requestId` once it has a webContents id. */
6683
+ | {
6684
+ type: "builtin_browser_open";
6685
+ requestId: string;
6686
+ url: string;
6687
+ activate: boolean;
6688
+ openerTabId?: number;
6689
+ sessionId?: string;
6690
+ } | {
6691
+ type: "builtin_browser_close";
6692
+ tabId: number;
6693
+ } | {
6694
+ type: "builtin_browser_activity";
6695
+ tabId: number;
6696
+ busy: boolean;
6697
+ action: BuiltinBrowserAction;
6698
+ sessionId?: string;
6699
+ }
6700
+ /** The shell measured the browser's load (see BuiltinBrowserMetrics). */
6701
+ | {
6702
+ type: "builtin_browser_metrics";
6703
+ metrics: BuiltinBrowserMetrics;
6704
+ }
6705
+ /** The user switched backend (PUT /backend); every window of theirs follows. */
6706
+ | {
6707
+ type: "builtin_browser_backend";
6708
+ backend: BrowserBackend;
6709
+ }
6710
+ /** The user's Chrome connected, went away, was replaced by another Chrome of theirs, or was revoked. */
6711
+ | {
6712
+ type: "builtin_browser_extension";
6713
+ state: "connected" | "disconnected" | "replaced" | "revoked";
6714
+ extension?: BrowserExtensionRecord;
6715
+ };
6716
+ /** A cookie as the shell writes it (Electron's CookiesSetDetails). */
6717
+ interface DesktopBrowserCookie {
6718
+ url: string;
6719
+ name: string;
6720
+ value: string;
6721
+ domain?: string;
6722
+ path?: string;
6723
+ secure?: boolean;
6724
+ httpOnly?: boolean;
6725
+ /** Unix seconds; absent = session cookie. */
6726
+ expirationDate?: number;
6727
+ sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
6728
+ }
6729
+ /**
6730
+ * Server → browser link: what the shell (built-in) or the extension (chrome) does with its tabs.
6731
+ * Mechanism only — the product logic stays on the server. The names are historical: the same
6732
+ * envelopes travel the extension's WebSocket as JSON text frames.
6733
+ */
6734
+ type DesktopBrowserCommand =
6735
+ /** Reply: a BrowserHello. An older shell never answers. */
6736
+ {
6737
+ op: "hello";
6738
+ }
6739
+ /** Reply: `{ tabs: BuiltinBrowserTab[] }`. */
6740
+ | {
6741
+ op: "tabs";
6742
+ }
6743
+ /**
6744
+ * Reply: the CDP method's result object. `events` names the tab's CDP events the shell relays
6745
+ * from then on, as `cdp-event`s: it replaces the list before (empty relays none), and is set
6746
+ * before the command runs, so an event the command itself causes is not missed. Without it
6747
+ * the list stays as it is.
6748
+ */
6749
+ | {
6750
+ op: "cdp";
6751
+ tabId: number;
6752
+ method: string;
6753
+ params?: Record<string, unknown>;
6754
+ events?: string[];
6755
+ }
6756
+ /** Reply: `{ set: number; failed: number; errors: string[] }` (at most 10 errors). */
6757
+ | {
6758
+ op: "set-cookies";
6759
+ cookies: DesktopBrowserCookie[];
6760
+ }
6761
+ /** Reply: `{}`. */
6762
+ | {
6763
+ op: "clear-data";
6764
+ storages: ("cookies" | "cache" | "storage")[];
6765
+ }
6766
+ /**
6767
+ * Reply: `{}`. The tabs whose pages may be throttled while out of sight (Electron's background
6768
+ * throttling, applied at once); every other tab runs at full speed. It replaces the list
6769
+ * before. A tab is unthrottled until a command lists it, so a server that never sends one
6770
+ * changes nothing. A shell older than this command answers `unknown_op`.
6771
+ */
6772
+ | {
6773
+ op: "throttle";
6774
+ tabIds: number[];
6775
+ }
6776
+ /**
6777
+ * Chrome only (the shell answers `unknown_op`). Reply: `{ tab: BuiltinBrowserTab }`. A tab at
6778
+ * `url` (http(s) or about:blank, checked by the server) in the extension's Penguin tab group;
6779
+ * `activate` asks for it to be the selected tab of its window.
6780
+ */
6781
+ | {
6782
+ op: "open-tab";
6783
+ url: string;
6784
+ activate: boolean;
6785
+ }
6786
+ /** Chrome only. Reply: `{}`. Closes a tab the extension drives. */
6787
+ | {
6788
+ op: "close-tab";
6789
+ tabId: number;
6790
+ }
6791
+ /** Chrome only. Reply: `{}`. Shows the tab in the user's Chrome (selects it, focuses its window). */
6792
+ | {
6793
+ op: "activate-tab";
6794
+ tabId: number;
6795
+ }
6796
+ /** Chrome only. Reply: `{}`. Sent every 20 s; the traffic keeps the MV3 service worker alive. */
6797
+ | {
6798
+ op: "ping";
6799
+ };
6800
+ /**
6801
+ * The `hello` reply. Built-in: `{ version: 1, partition }` (an older shell sends no `backend`).
6802
+ * Chrome: `{ version: 1, backend: "chrome", extension }`; any other version is closed 4005.
6803
+ */
6804
+ interface BrowserHello {
6805
+ version: 1;
6806
+ backend?: BrowserBackend;
6807
+ partition?: string;
6808
+ extension?: {
6809
+ version: string;
6810
+ chrome: string;
6811
+ name: string;
6812
+ };
6813
+ }
6814
+ interface DesktopBrowserCommandMessage {
6815
+ type: "desktop-browser-command";
6816
+ id: string;
6817
+ command: DesktopBrowserCommand;
6818
+ }
6819
+ interface DesktopBrowserReplyMessage {
6820
+ type: "desktop-browser-reply";
6821
+ id: string;
6822
+ ok: boolean;
6823
+ result?: unknown;
6824
+ error?: string;
6825
+ }
6826
+ type DesktopBrowserEvent = {
6827
+ kind: "tab";
6828
+ tab: BuiltinBrowserTab;
6829
+ } | {
6830
+ kind: "tab-closed";
6831
+ tabId: number;
6832
+ }
6833
+ /**
6834
+ * window.open / target=_blank inside a guest (the shell denied it and asks for a tab instead),
6835
+ * or the context menu's "Open link in new tab". `background`: the tab should open behind the
6836
+ * current one, as a middle-click or that menu entry does in Chrome.
6837
+ */
6838
+ | {
6839
+ kind: "open-request";
6840
+ url: string;
6841
+ openerTabId: number;
6842
+ background?: boolean;
6843
+ }
6844
+ /** One of the tab's CDP events a `cdp` command's `events` asked for. */
6845
+ | {
6846
+ kind: "cdp-event";
6847
+ tabId: number;
6848
+ method: string;
6849
+ params: Record<string, unknown>;
6850
+ }
6851
+ /**
6852
+ * The tab's renderer went away (Electron's render-process-gone reason and exit code). The tab
6853
+ * stays; its `tab` events carry `crashed` until the page is reloaded, and the shell refuses
6854
+ * CDP commands for it meanwhile (`tab_crashed`).
6855
+ */
6856
+ | {
6857
+ kind: "tab-crashed";
6858
+ tabId: number;
6859
+ reason: string;
6860
+ exitCode: number;
6861
+ }
6862
+ /**
6863
+ * The shell's measurement of its guests (every ~10 s while there are any, and once more
6864
+ * shortly after one closes, empty after the last): each tab's memory and CPU, and the pages'
6865
+ * memory together, a process shared by two tabs counted once.
6866
+ */
6867
+ | {
6868
+ kind: "metrics";
6869
+ tabs: BuiltinBrowserTabMetrics[];
6870
+ totalKB: number;
6871
+ }
6872
+ /**
6873
+ * Chrome only: the tab still exists in Chrome but the agent may no longer drive it — the user
6874
+ * pressed Cancel on Chrome's debugging bar (`user`), the debugger went away otherwise
6875
+ * (`detached`), or the page is one Chrome lets no extension attach to (`restricted`). The
6876
+ * extension fails that tab's pending commands with the error `tab_released`.
6877
+ */
6878
+ | {
6879
+ kind: "tab-released";
6880
+ tabId: number;
6881
+ reason: "user" | "detached" | "restricted";
6882
+ };
6883
+ interface DesktopBrowserEventMessage {
6884
+ type: "desktop-browser-event";
6885
+ event: DesktopBrowserEvent;
6886
+ }
4324
6887
 
4325
- export { type AdminPasswordResetRequest, type AdminUserCreateRequest, type AdminUserCreateResponse, type AdminUsersResponse, type AgentCompactionConfigDto, type AgentConfigDto, type AgentConfigResponse, type AgentConfigUpdateRequest, type AgentCreateRequest, type AgentCreateResponse, type AgentHooksConfigDto, type AgentHooksResponse, type AgentImportRequest, type AgentImportResponse, type AgentKernelUpdateResponse, type AgentMemoryConfigDto, type AgentModelConfigDto, type AgentPluginsInstallResponse, type AgentSchedulesConfigDto, type AgentSkillsConfigDto, type AgentSkillsResponse, type AgentSummary, type AgentTraceDateGroup, type AgentTraceFileRef, type AgentTraceSessionEntry, type AgentTraceSessionFile, type AgentTraceSessionGroup, type AgentTracesResponse, type AgentVaultConfigDto, type AgentsResponse, type ApprovalDecisionRequest, type ApprovalMode, type AuthLoginRequest, type AuthResponse, type BenchmarkCaseScore, type BenchmarkCaseSummary, type BenchmarkCasesResponse, type BenchmarkCreateCase, type BenchmarkCreateRequest, type BenchmarkCreateResponse, type BenchmarkEvaluation, type BenchmarkRunScore, type BenchmarkStatus, type BenchmarkSummary, type BenchmarksResponse, type CaseMaterial, type ChatDefaultsDto, type CommandPolicyDto, type CommandPolicyRuleDto, type CompanyServerEvent, type ContextFileShare, type ContextToolShare, type ContributionsResponse, type CredentialInfo, type DefaultModelResponse, type DefaultModelUpdateRequest, type DesktopTrayCommandMessage, type DesktopTrayLocale, type DesktopTrayPatch, type DesktopTrayStatus, type DesktopTrayStatusMessage, type DesktopTrayStatusResponse, type DesktopUpdateStatus, type DesktopUpdateStatusResponse, type DesktopUpdaterCommandMessage, type DesktopUpdaterStatusMessage, type DirEntryInfo, type DirListResponse, type DirectorySkillItem, type DirectorySkillsResponse, type DraftShortcut, type EndpointModelListRequest, type EndpointModelListResponse, type ErrorBody, type FeishuBindingInfo, type FeishuBindingPutRequest, type FeishuBindingResponse, type FeishuTestRequest, type FeishuTestResponse, type FilesMoveRequest, type FilesStatRequest, type FilesStatResponse, type FilesWriteRequest, type GoalResponse, type GoalServerEvent, type GoalStateView, type HistoryMessage, type HookArchiveInstallRequest, type HookItem, type InstallResponse, type MachineInfo, type MachineJob, type MachineServerStatus, type MachinesResponse, type McpServerTestResponse, type MeResponse, type MemberAddRequest, type MemberAddResponse, type MemberInfo, type MembersResponse, type MemoryFileInfo, type MemoryFileResponse, type MemoryFilesResponse, type MemoryImportMode, type MemoryImportRequest, type MemoryImportResponse, type MemoryOverviewResponse, type MemoryScopeExport, type MemoryScopeInfo, type MemoryTransferFile, type MessagesLiveTail, type MessagesPageInfo, type MessagesResponse, type MessagingBindingCommon, type MessagingBindingInfo, type MessagingBindingStateRequest, type MessagingBindingsResponse, type MessagingChannel, type MessagingChannelState, type MessagingDeliveryError, type MessagingDeliveryPatch, type MessagingRuntimeState, type MessagingRuntimeStatus, type MessagingTestMessageResponse, type ModelInfo, type ModelOAuthCodeRequest, type ModelOAuthCodeResponse, type ModelOAuthErrorCode, type ModelOAuthMode, type ModelOAuthStartRequest, type ModelOAuthStartResponse, type ModelOAuthStatusResponse, type ModelPricingDto, type ModelProtocolDetectRequest, type ModelProtocolDetectResponse, type ModelProtocolProbeDto, type ModelRefDto, type ModelTestRequest, type ModelTestResponse, type ModelUpdateEntry, type ModelVisionDetectRequest, type ModelVisionDetectResponse, type ModelVisionOutcome, type ModelsResponse, type ModelsUpdateRequest, type OrgApprovalMode, type OrgBudgetAlert, type OrgCalendarItem, type OrgCalendarOutcome, type OrgCalendarResponse, type OrgCalendarUpsertRequest, type OrgCalendarWriteResponse, type OrgChannelCreateRequest, type OrgChannelDetail, type OrgChannelItem, type OrgChannelMember, type OrgChannelMemberRequest, type OrgChannelMessage, type OrgChannelMessageSendRequest, type OrgChannelMessagesResponse, type OrgChannelNotice, type OrgChannelNoticeKind, type OrgChannelPatchRequest, type OrgChannelReadRequest, type OrgChannelsResponse, type OrgChartResponse, type OrgDeskItem, type OrgDeskResponse, type OrgEmployeeItem, type OrgEmployeePatchRequest, type OrgEmployeeState, type OrgFinanceEmployee, type OrgFinanceResponse, type OrgFinanceTicket, type OrgHandbookFile, type OrgHandbookFileResponse, type OrgHandbookFileWriteRequest, type OrgHandbookFilesResponse, type OrgHandbookResponse, type OrgHireRequest, type OrgInbox, type OrgLanguage, type OrgSessionsResponse, type OrgSpendSummary, type OrgStatus, type OrgTicketAttachRequest, type OrgTicketBlockRequest, type OrgTicketChange, type OrgTicketCreateRequest, type OrgTicketDetail, type OrgTicketHistoryAction, type OrgTicketHistoryEntry, type OrgTicketItem, type OrgTicketMoveRequest, type OrgTicketPriority, type OrgTicketProgressRequest, type OrgTicketSessionItem, type OrgTicketStartRequest, type OrgTicketStartResponse, type OrgTicketStatus, type OrgTicketUpdateRequest, type OrgTicketsResponse, type OrgTriggerKind, type OrganizationCreateRequest, type OrganizationDetail, type OrganizationPatchRequest, type OrganizationSettings, type OrganizationSummary, type OrganizationsResponse, type PasswordChangeRequest, type PendingFollowUpInfo, type PendingSteeringInfo, type PluginFilesResponse, type PluginGroupItem, type PluginInstallRequest, type PluginItem, type PluginLibraryResponse, type PluginUpdateRef, type PrefsResponse, type ProjectCreateRequest, type ProjectCreateResponse, type ProjectRole, type ProjectSummary, type ProjectUpdateRequest, type ProjectUpdateResponse, type ProjectsResponse, type ProtocolProbeOutcome, type ProxyProbeDto, type ProxyProbeOutcome, type ProxyProbeProvider, type ProxyProbeResponse, type ProxyProbeTargetDto, type ProxyProbeTargetsResponse, type QQBindingInfo, type QQBindingPutRequest, type QQBindingResponse, type QQScanPollResponse, type QQScanStartResponse, type QQTestRequest, type QQTestResponse, type RecalledMessageResponse, type RendererRef, type RequestSpan, type RestartResponse, type RetryNowResponse, type ScheduleItem, type ScheduleServerEvent, type ScheduleStatus, type ScheduleUpsertRequest, type SchedulesResponse, type SemanticIdSuggestReason, type SemanticIdSuggestRequest, type SemanticIdSuggestResponse, type ServerEvent, type ServerSettings, type ServerSettingsResponse, type ServerSettingsUpdateRequest, type SessionBackgroundTasks, type SessionCategory, type SessionCategoryCounts, type SessionContextParts, type SessionContextResponse, type SessionCreateRequest, type SessionCreateResponse, type SessionForkRequest, type SessionForkResponse, type SessionInfo, type SessionPatchRequest, type SessionProcessInfo, type SessionProcessesResponse, type SessionResponse, type SessionSource, type SessionStatus, type SessionTracesResponse, type SessionsResponse, type SkillArchiveInstallRequest, type SkillMetadataItem, type SteerRequest, type SubagentMessageResponse, type SubagentRuntimeInfo, TICKET_SLUG_PATTERN, type TaskCreateRequest, type TaskCreateResponse, type TaskInputPart, type TelegramBindingInfo, type TelegramBindingPutRequest, type TelegramBindingResponse, type TelegramTestRequest, type TelegramTestResponse, type ToolCallSpan, type TraceAnalysisResponse, type TraceEventsResponse, type TraceFileInfo, type TraceImportRequest, type TraceImportResponse, type TraceModelSegment, type TraceOtherSpan, type TracePosition, type TraceTaskStats, type TraceToolSpan, type UiPrefs, type UpdateCheckResponse, type UpdateJobPhase, type UpdateJobStatus, type UpdateProfileRequest, type UpdateProfileResponse, type UpdateRunResponse, type UploadLimits, type UsageAgentSeries, type UsageBucket, type UsageEntitySeriesCounts, type UsageErrorCount, type UsageErrorItem, type UsageErrorKind, type UsageErrors, type UsageErrorsClearResponse, type UsageErrorsPage, type UsageGranularity, type UsageGroupBy, type UsageGroupRow, type UsageModelSeries, type UsageModelTotal, type UsageModelTotals, type UsageResponse, type UsageSeriesPoint, type UsageTrendPointInTrace, type UserInfo, type VaultEntryInfo, type VaultEntryUpdate, type VaultResponse, type VaultUpdateRequest, type VersionResponse, type WeChatBindingInfo, type WeChatBindingPutRequest, type WeChatBindingResponse, type WeChatScanPollResponse, type WeChatScanStartResponse, type WeChatScanStatus, type WeChatScanVerifyRequest, type WeChatTestResponse, type WebContribution, type WorkspaceFileEntry, type WorkspaceFilesResponse, type WorkspaceSearchHit, type WorkspaceSearchResponse };
6888
+ export { type AdminPasswordResetRequest, type AdminUserCreateRequest, type AdminUserCreateResponse, type AdminUsersResponse, type AgentApiKeyCreateRequest, type AgentApiKeyCreateResponse, type AgentApiKeyInfo, type AgentApiResponse, type AgentApiSettings, type AgentApiUpdateRequest, type AgentCompactionConfigDto, type AgentConfigDto, type AgentConfigResponse, type AgentConfigUpdateRequest, type AgentCreateRequest, type AgentCreateResponse, type AgentHooksConfigDto, type AgentHooksResponse, type AgentImportRequest, type AgentImportResponse, type AgentKernelUpdateResponse, type AgentMcpServerItem, type AgentMcpServersResponse, type AgentMemoryConfigDto, type AgentModelConfigDto, type AgentPluginsInstallResponse, type AgentSchedulesConfigDto, type AgentSkillsConfigDto, type AgentSkillsResponse, type AgentSummary, type AgentTraceDateGroup, type AgentTraceFileRef, type AgentTraceSessionEntry, type AgentTraceSessionFile, type AgentTraceSessionGroup, type AgentTracesResponse, type AgentVaultConfigDto, type AgentsResponse, type ApprovalDecisionRequest, type ApprovalMode, type ArchivedSessionGroup, type ArchivedSessionGroupsResponse, type ArchivedSessionSource, type ArchivedSessionsBatch, type ArchivedSessionsBatchFilter, type ArchivedSessionsBatchResponse, type ArchivedSessionsQuery, type ArchivedSessionsResponse, type ArchivedSessionsRowsQuery, type AuthLoginRequest, type AuthResponse, type BenchmarkArchiveGitOrigin, type BenchmarkArchiveImportRequest, type BenchmarkArchiveImportResponse, type BenchmarkCaseScore, type BenchmarkCaseSummary, type BenchmarkCasesResponse, type BenchmarkCreateCase, type BenchmarkCreateRequest, type BenchmarkCreateResponse, type BenchmarkEvaluation, type BenchmarkManifestProblem, type BenchmarkOrigin, type BenchmarkOriginKind, type BenchmarkRunScore, type BenchmarkStatus, type BenchmarkSummary, type BenchmarksResponse, type BrowserBackend, type BrowserBackendInfo, type BrowserBackendResponse, type BrowserExtensionCloseCode, type BrowserExtensionPairRequest, type BrowserExtensionPairResponse, type BrowserExtensionPairingResponse, type BrowserExtensionRecord, type BrowserExtensionsResponse, type BrowserHello, type BrowserLinkCapabilities, type BuiltinBrowserAction, type BuiltinBrowserDialog, type BuiltinBrowserExecResult, type BuiltinBrowserHistoryEntry, type BuiltinBrowserHistoryResponse, type BuiltinBrowserImportBrowser, type BuiltinBrowserImportRequest, type BuiltinBrowserImportResult, type BuiltinBrowserImportSource, type BuiltinBrowserImportSourcesResponse, type BuiltinBrowserLoadWarning, type BuiltinBrowserMetrics, type BuiltinBrowserScanResult, type BuiltinBrowserScreenshot, type BuiltinBrowserServerEvent, type BuiltinBrowserSettings, type BuiltinBrowserStatus, type BuiltinBrowserTab, type BuiltinBrowserTabMetrics, type BuiltinBrowserTabsResponse, type BuiltinBrowserUnavailableReason, type CaseMaterial, type ChatDefaultsDto, type CommandPolicyDto, type CommandPolicyRuleDto, type CompanyServerEvent, type ConnectionSourceDto, type ContextFileShare, type ContextToolShare, type ContributionsResponse, type CostParts, type CredentialInfo, type DefaultModelResponse, type DefaultModelUpdateRequest, type DesktopBrowserCommand, type DesktopBrowserCommandMessage, type DesktopBrowserCookie, type DesktopBrowserEvent, type DesktopBrowserEventMessage, type DesktopBrowserReplyMessage, type DesktopFolderAccessMessage, type DesktopFolderAccessResult, type DesktopFolderAccessResultMessage, type DesktopOpenPrivacySettingsMessage, type DesktopPrivacyPane, type DesktopTrayCommandMessage, type DesktopTrayLocale, type DesktopTrayPatch, type DesktopTrayStatus, type DesktopTrayStatusMessage, type DesktopTrayStatusResponse, type DesktopUpdateStatus, type DesktopUpdateStatusResponse, type DesktopUpdaterCommandMessage, type DesktopUpdaterStatusMessage, type DirAccessResponse, type DirEntryInfo, type DirListResponse, type DirLocation, type DirStandardFolders, type DirectorySkillItem, type DirectorySkillsResponse, type DraftShortcut, type Employment, type EndpointModelListRequest, type EndpointModelListResponse, type ErrorBody, type ErrorDetails, type FeishuBindingInfo, type FeishuBindingPutRequest, type FeishuBindingResponse, type FeishuTestRequest, type FeishuTestResponse, type FilesCreateRequest, type FilesMoveRequest, type FilesStatRequest, type FilesStatResponse, type FilesWriteRequest, type GoalResponse, type GoalServerEvent, type GoalStateView, type HistoryMessage, type HookArchiveInstallRequest, type HookItem, type InstallResponse, type InstalledPlugin, type InstalledPluginsResponse, type LanguageIndexResponse, type LanguageSummary, MACHINE_PHASES, type MachineCheck, type MachineConfigSync, type MachineDiagnosis, type MachineEnvOnly, type MachineInfo, type MachineJob, type MachinePhase, type MachineReconnect, type MachineServerEvent, type MachineServerStatus, type MachineSkippedModel, type MachineSourceReach, type MachineSshFailure, type MachineUninstallRequest, type MachineUseRefusal, type MachinesAddRequest, type MachinesCheckoutImage, type MachinesResponse, type MachinesStopUsingRequest, type MachinesUseRequest, type MachinesUseResponse, type McpServerTestResponse, type McpTransport, type MeResponse, type MemberAddRequest, type MemberAddResponse, type MemberInfo, type MembersResponse, type MemoryFileInfo, type MemoryFileResponse, type MemoryFilesResponse, type MemoryImportMode, type MemoryImportRequest, type MemoryImportResponse, type MemoryOverviewResponse, type MemoryScopeExport, type MemoryScopeInfo, type MemoryTransferFile, type MessagesLiveTail, type MessagesPageInfo, type MessagesResponse, type MessagingBindingCommon, type MessagingBindingInfo, type MessagingBindingStateRequest, type MessagingBindingsResponse, type MessagingChannel, type MessagingChannelState, type MessagingDeliveryError, type MessagingDeliveryPatch, type MessagingRuntimeState, type MessagingRuntimeStatus, type MessagingTestMessageResponse, type ModelBalanceAmount, type ModelBalanceErrorCode, type ModelBalanceFailure, type ModelBalanceReading, type ModelBalanceResponse, type ModelEffectiveConnection, type ModelInfo, type ModelOAuthCodeRequest, type ModelOAuthCodeResponse, type ModelOAuthErrorCode, type ModelOAuthMode, type ModelOAuthStartRequest, type ModelOAuthStartResponse, type ModelOAuthStatusResponse, type ModelPricingDto, type ModelProtocolDetectRequest, type ModelProtocolDetectResponse, type ModelProtocolProbeDto, type ModelRefDto, type ModelScopeAuthFlowErrorCode, type ModelScopeAuthFlowStatusResponse, type ModelScopeAuthStartResponse, type ModelTestRequest, type ModelTestResponse, type ModelUpdateEntry, type ModelVisionDetectRequest, type ModelVisionDetectResponse, type ModelVisionOutcome, type ModelsResponse, type ModelsUpdateRequest, type OrgApprovalMode, type OrgBudgetAlert, type OrgCalendarItem, type OrgCalendarOutcome, type OrgCalendarResponse, type OrgCalendarUpsertRequest, type OrgCalendarWriteResponse, type OrgChannelCreateRequest, type OrgChannelDetail, type OrgChannelItem, type OrgChannelMember, type OrgChannelMemberRequest, type OrgChannelMessage, type OrgChannelMessageSendRequest, type OrgChannelMessagesResponse, type OrgChannelNotice, type OrgChannelNoticeKind, type OrgChannelPatchRequest, type OrgChannelReadRequest, type OrgChannelsResponse, type OrgChartResponse, type OrgDeskItem, type OrgDeskResponse, type OrgEmployeeItem, type OrgEmployeePatchRequest, type OrgEmployeeState, type OrgFinanceEmployee, type OrgFinanceResponse, type OrgFinanceTicket, type OrgHandbookFile, type OrgHandbookFileResponse, type OrgHandbookFileWriteRequest, type OrgHandbookFilesResponse, type OrgHandbookResponse, type OrgHireRequest, type OrgInbox, type OrgLanguage, type OrgSessionsResponse, type OrgSpendSummary, type OrgStatus, type OrgTicketAttachRequest, type OrgTicketBlockRequest, type OrgTicketChange, type OrgTicketCreateRequest, type OrgTicketDetail, type OrgTicketHistoryAction, type OrgTicketHistoryEntry, type OrgTicketItem, type OrgTicketMoveRequest, type OrgTicketPriority, type OrgTicketProgressRequest, type OrgTicketSessionItem, type OrgTicketStartRequest, type OrgTicketStartResponse, type OrgTicketStatus, type OrgTicketUpdateRequest, type OrgTicketsResponse, type OrgTriggerKind, type OrganizationCreateRequest, type OrganizationDetail, type OrganizationPatchRequest, type OrganizationSettings, type OrganizationSummary, type OrganizationsResponse, type PasswordChangeRequest, type PendingFollowUpInfo, type PendingSteeringInfo, type PinnedBalance, type PlatformAuthFlowErrorCode, type PlatformAuthFlowStatusResponse, type PlatformAuthStartResponse, type PlatformModelSyncResponse, type PluginArchiveImportRequest, type PluginConfigActionDecl, type PluginConfigActionResponse, type PluginConfigBackend, type PluginConfigColumnGroup, type PluginConfigEntry, type PluginConfigField, type PluginConfigNewRow, type PluginConfigNotice, type PluginConfigOption, type PluginConfigPinColumn, type PluginConfigResponse, type PluginConfigRowChoice, type PluginConfigTableColumn, type PluginConfigTableRow, type PluginConfigUnavailableDecl, type PluginConfigUpdateRequest, type PluginConfiguration, type PluginFilesResponse, type PluginGroupItem, type PluginIndexEntry, type PluginIndexResponse, type PluginInstallOutcome, type PluginInstallRequest, type PluginItem, type PluginLibraryResponse, type PluginMcpServerItem, type PluginReadmeResponse, type PluginSetupKeyItem, type PluginUpdateRef, type PrefsResponse, type PresetSyncMode, type PresetSyncRequest, type PresetSyncResponse, type ProjectCreateRequest, type ProjectCreateResponse, type ProjectRole, type ProjectScheduleItem, type ProjectSchedulesResponse, type ProjectSummary, type ProjectUpdateRequest, type ProjectUpdateResponse, type ProjectsResponse, type ProtocolProbeOutcome, type ProviderConnectionDto, type ProviderConnectionUpdate, type ProxyProbeDto, type ProxyProbeOutcome, type ProxyProbeProvider, type ProxyProbeResponse, type ProxyProbeTargetDto, type ProxyProbeTargetsResponse, type QQBindingInfo, type QQBindingPutRequest, type QQBindingResponse, type QQScanPollResponse, type QQScanStartResponse, type QQTestRequest, type QQTestResponse, type QuickStartItem, type RecalledMessageResponse, type RendererRef, type RequestSpan, type RestartResponse, type RetryNowResponse, type ScheduleItem, type ScheduleServerEvent, type ScheduleStatus, type ScheduleUpsertRequest, type SchedulesResponse, type SemanticIdKind, type SemanticIdSuggestReason, type SemanticIdSuggestRequest, type SemanticIdSuggestResponse, type ServerEvent, type ServerSettings, type ServerSettingsResponse, type ServerSettingsUpdateRequest, type SessionBackgroundTasks, type SessionBatchPageRequest, type SessionBatchResult, type SessionCategory, type SessionCategoryCounts, type SessionContextParts, type SessionContextResponse, type SessionCreateRequest, type SessionCreateResponse, type SessionForkRequest, type SessionForkResponse, type SessionInfo, type SessionPatchRequest, type SessionProcessInfo, type SessionProcessesResponse, type SessionResponse, type SessionSandbox, type SessionSandboxMode, type SessionSandboxNetwork, type SessionSandboxPreset, type SessionStatus, type SessionSwitchModelRequest, type SessionTracesResponse, type SessionsBatchRequest, type SessionsBatchResponse, type SessionsResponse, type SkillArchiveInstallRequest, type SkillMetadataItem, type SshHostRequest, type SshHostResponse, type SshHostSummary, type SshHostsResponse, type SteerRequest, type StoredKeybindings, type SubagentMessageResponse, type SubagentRuntimeInfo, TICKET_SLUG_PATTERN, type TaskCreateRequest, type TaskCreateResponse, type TaskInputPart, type TelegramBindingInfo, type TelegramBindingPutRequest, type TelegramBindingResponse, type TelegramTestRequest, type TelegramTestResponse, type ToolCallSpan, type TraceAnalysisResponse, type TraceEventsResponse, type TraceFileInfo, type TraceImportRequest, type TraceImportResponse, type TraceModelSegment, type TraceOtherSpan, type TracePosition, type TraceTaskStats, type TraceToolSpan, type UiPrefs, type UnavailableSandboxBackend, type UnsatisfiedPlugin, type UpdateCheckResponse, type UpdateJobPhase, type UpdateJobStatus, type UpdateProfileRequest, type UpdateProfileResponse, type UpdateRunResponse, type UploadLimits, type UsageAgentSeries, type UsageBucket, type UsageEntitySeriesCounts, type UsageErrorCount, type UsageErrorItem, type UsageErrorKind, type UsageErrors, type UsageErrorsClearResponse, type UsageErrorsPage, type UsageGranularity, type UsageGroupBy, type UsageGroupRow, type UsageModelSeries, type UsageModelTotal, type UsageModelTotals, type UsageResponse, type UsageSeriesPoint, type UsageTrendPointInTrace, type UserInfo, type VaultEntryInfo, type VaultEntryUpdate, type VaultResponse, type VaultUpdateRequest, type VersionHistoryDiffResponse, type VersionHistoryResponse, type VersionResponse, type VersionRollbackResponse, type WeChatBindingInfo, type WeChatBindingPutRequest, type WeChatBindingResponse, type WeChatScanPollResponse, type WeChatScanStartResponse, type WeChatScanStatus, type WeChatScanVerifyRequest, type WeChatTestResponse, type WebContribution, type WorkflowInfo, type WorkflowRequest, type WorkflowResponse, type WorkflowVersion, type WorkspaceFileEntry, type WorkspaceFilesResponse, type WorkspaceSearchHit, type WorkspaceSearchResponse };