@pasko70/pibo 1.0.0

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 (351) hide show
  1. package/.codex/skills/pi-agent-harness/SKILL.md +319 -0
  2. package/.codex/skills/pi-agent-harness/agents/openai.yaml +4 -0
  3. package/README.md +318 -0
  4. package/context/codex-base-prompt.md +144 -0
  5. package/context/pibo-compaction-prompt.md +100 -0
  6. package/context/pibo-system-prompt.md +17 -0
  7. package/dist/apps/chat/agent-profiles.js +26 -0
  8. package/dist/apps/chat/agent-store.js +336 -0
  9. package/dist/apps/chat/event-log.js +307 -0
  10. package/dist/apps/chat/read-model.js +218 -0
  11. package/dist/apps/chat/rooms.js +321 -0
  12. package/dist/apps/chat/session-metadata.js +14 -0
  13. package/dist/apps/chat/stream.js +122 -0
  14. package/dist/apps/chat/trace.js +1182 -0
  15. package/dist/apps/chat/web-app.js +2569 -0
  16. package/dist/apps/chat-ui/assets/apl-BxEMbctQ.js +1 -0
  17. package/dist/apps/chat-ui/assets/asciiarmor-eFjeGRuZ.js +1 -0
  18. package/dist/apps/chat-ui/assets/asn1-Cfx-0pt9.js +1 -0
  19. package/dist/apps/chat-ui/assets/asterisk-B5BHTsBr.js +1 -0
  20. package/dist/apps/chat-ui/assets/brainfuck-CAA2xofr.js +1 -0
  21. package/dist/apps/chat-ui/assets/clike-BoDCOLzN.js +1 -0
  22. package/dist/apps/chat-ui/assets/clojure-kVFSWX0o.js +1 -0
  23. package/dist/apps/chat-ui/assets/cmake-BUPAhezI.js +1 -0
  24. package/dist/apps/chat-ui/assets/cobol-BfgHZgup.js +1 -0
  25. package/dist/apps/chat-ui/assets/coffeescript-G1Pe_1AZ.js +1 -0
  26. package/dist/apps/chat-ui/assets/commonlisp-B3N0CjHn.js +1 -0
  27. package/dist/apps/chat-ui/assets/crystal-C15ndaGM.js +1 -0
  28. package/dist/apps/chat-ui/assets/css-BqOeyZOV.js +1 -0
  29. package/dist/apps/chat-ui/assets/cypher-KjIKv-wW.js +1 -0
  30. package/dist/apps/chat-ui/assets/d-BlT5AEC-.js +1 -0
  31. package/dist/apps/chat-ui/assets/diff-oF98tbqj.js +1 -0
  32. package/dist/apps/chat-ui/assets/dist--55mTWk3.js +1 -0
  33. package/dist/apps/chat-ui/assets/dist-B5rcjVCj.js +1 -0
  34. package/dist/apps/chat-ui/assets/dist-BPv5MdlL.js +1 -0
  35. package/dist/apps/chat-ui/assets/dist-BZ39rB1W.js +1 -0
  36. package/dist/apps/chat-ui/assets/dist-BsedZGJo.js +1 -0
  37. package/dist/apps/chat-ui/assets/dist-BvO6SpaM.js +9 -0
  38. package/dist/apps/chat-ui/assets/dist-C5YJOwhH.js +1 -0
  39. package/dist/apps/chat-ui/assets/dist-C5oXtFSP.js +1 -0
  40. package/dist/apps/chat-ui/assets/dist-CG_gRSwv.js +23 -0
  41. package/dist/apps/chat-ui/assets/dist-CKM5j-iy.js +1 -0
  42. package/dist/apps/chat-ui/assets/dist-CUp9us2q.js +1 -0
  43. package/dist/apps/chat-ui/assets/dist-CZ9T4Cly.js +1 -0
  44. package/dist/apps/chat-ui/assets/dist-D4HhiFWB.js +6 -0
  45. package/dist/apps/chat-ui/assets/dist-DHE-yBLH.js +1 -0
  46. package/dist/apps/chat-ui/assets/dist-DSKQpPaz.js +1 -0
  47. package/dist/apps/chat-ui/assets/dist-L1B-KWZO.js +1 -0
  48. package/dist/apps/chat-ui/assets/dist-SVPsM5Oi.js +13 -0
  49. package/dist/apps/chat-ui/assets/dist-Zqt9kNG9.js +1 -0
  50. package/dist/apps/chat-ui/assets/dist-_DPv0-QF.js +1 -0
  51. package/dist/apps/chat-ui/assets/dist-_oM7g0eh.js +11 -0
  52. package/dist/apps/chat-ui/assets/dist-laadbMWg.js +1 -0
  53. package/dist/apps/chat-ui/assets/dist-nFui3f-r.js +2 -0
  54. package/dist/apps/chat-ui/assets/dist-tGfufz3b.js +1 -0
  55. package/dist/apps/chat-ui/assets/dockerfile-CUaqzcqp.js +1 -0
  56. package/dist/apps/chat-ui/assets/dtd-VCA9yr61.js +1 -0
  57. package/dist/apps/chat-ui/assets/dylan-O-V5Dw5W.js +1 -0
  58. package/dist/apps/chat-ui/assets/ebnf-SPmdBkvT.js +1 -0
  59. package/dist/apps/chat-ui/assets/ecl-ChfCttfI.js +1 -0
  60. package/dist/apps/chat-ui/assets/eiffel-cB9EbjeN.js +1 -0
  61. package/dist/apps/chat-ui/assets/elm-BTiVflBU.js +1 -0
  62. package/dist/apps/chat-ui/assets/erlang-egf0TXFm.js +1 -0
  63. package/dist/apps/chat-ui/assets/factor-C2tAxNob.js +1 -0
  64. package/dist/apps/chat-ui/assets/fcl-BiCjh1tj.js +1 -0
  65. package/dist/apps/chat-ui/assets/forth-C4kDGW6u.js +1 -0
  66. package/dist/apps/chat-ui/assets/fortran-DzkLaPnd.js +1 -0
  67. package/dist/apps/chat-ui/assets/gas-DMOxskQF.js +1 -0
  68. package/dist/apps/chat-ui/assets/gherkin-BPxBpp-k.js +1 -0
  69. package/dist/apps/chat-ui/assets/groovy-CkEnc0ZY.js +1 -0
  70. package/dist/apps/chat-ui/assets/haskell-Dadpo9-w.js +1 -0
  71. package/dist/apps/chat-ui/assets/haxe-CDNZL9MW.js +1 -0
  72. package/dist/apps/chat-ui/assets/http-jy9Zxxt3.js +1 -0
  73. package/dist/apps/chat-ui/assets/idl-CGSB6iiy.js +1 -0
  74. package/dist/apps/chat-ui/assets/index-BdcqTugD.js +151 -0
  75. package/dist/apps/chat-ui/assets/index-Dk-opWl3.css +1 -0
  76. package/dist/apps/chat-ui/assets/javascript-DSlzRUd8.js +1 -0
  77. package/dist/apps/chat-ui/assets/julia-DTiF9v6R.js +1 -0
  78. package/dist/apps/chat-ui/assets/livescript-Ci8Xxna6.js +1 -0
  79. package/dist/apps/chat-ui/assets/lua-eVxIrt9t.js +1 -0
  80. package/dist/apps/chat-ui/assets/mathematica-Da3grj36.js +1 -0
  81. package/dist/apps/chat-ui/assets/mbox-BWBMSafM.js +1 -0
  82. package/dist/apps/chat-ui/assets/mirc-CtHu9S1B.js +1 -0
  83. package/dist/apps/chat-ui/assets/mllike-wTFlPWXS.js +1 -0
  84. package/dist/apps/chat-ui/assets/modelica-cKbQ0UXu.js +1 -0
  85. package/dist/apps/chat-ui/assets/mscgen-C5pXQCMK.js +1 -0
  86. package/dist/apps/chat-ui/assets/mumps-CKBHkOQq.js +1 -0
  87. package/dist/apps/chat-ui/assets/nginx-B00AiQel.js +1 -0
  88. package/dist/apps/chat-ui/assets/nsis-SMDwKltR.js +1 -0
  89. package/dist/apps/chat-ui/assets/ntriples-B_36EBV0.js +1 -0
  90. package/dist/apps/chat-ui/assets/octave-BXPjzAif.js +1 -0
  91. package/dist/apps/chat-ui/assets/oz-Dedpat1M.js +1 -0
  92. package/dist/apps/chat-ui/assets/pascal-CMcUg72K.js +1 -0
  93. package/dist/apps/chat-ui/assets/perl-DoVTbnzt.js +1 -0
  94. package/dist/apps/chat-ui/assets/pig-CULXT1YV.js +1 -0
  95. package/dist/apps/chat-ui/assets/powershell-Cv5Uhf6b.js +1 -0
  96. package/dist/apps/chat-ui/assets/properties-CQ1C2P-M.js +1 -0
  97. package/dist/apps/chat-ui/assets/protobuf-SRlvzrl6.js +1 -0
  98. package/dist/apps/chat-ui/assets/pug-Bo3wfL-f.js +1 -0
  99. package/dist/apps/chat-ui/assets/puppet-ClSqCGj6.js +1 -0
  100. package/dist/apps/chat-ui/assets/python-C2_X1GpX.js +1 -0
  101. package/dist/apps/chat-ui/assets/q-B_6Gdyzl.js +1 -0
  102. package/dist/apps/chat-ui/assets/r-BD07NGED.js +1 -0
  103. package/dist/apps/chat-ui/assets/rolldown-runtime-S-ySWqyJ.js +1 -0
  104. package/dist/apps/chat-ui/assets/rpm-CRu5Z2Jl.js +1 -0
  105. package/dist/apps/chat-ui/assets/ruby-dZPnOz8h.js +1 -0
  106. package/dist/apps/chat-ui/assets/sas-S2t8_sDI.js +1 -0
  107. package/dist/apps/chat-ui/assets/scheme-WcyFWLW2.js +1 -0
  108. package/dist/apps/chat-ui/assets/shell-DUelnYSh.js +1 -0
  109. package/dist/apps/chat-ui/assets/sieve-jDjlVhNh.js +1 -0
  110. package/dist/apps/chat-ui/assets/simple-mode-CL04yRVp.js +1 -0
  111. package/dist/apps/chat-ui/assets/smalltalk-ddWDYy10.js +1 -0
  112. package/dist/apps/chat-ui/assets/solr-C7rQhLuW.js +1 -0
  113. package/dist/apps/chat-ui/assets/sparql--fPCCgVd.js +1 -0
  114. package/dist/apps/chat-ui/assets/spreadsheet-DjthqD5G.js +1 -0
  115. package/dist/apps/chat-ui/assets/sql-D_dieYbr.js +1 -0
  116. package/dist/apps/chat-ui/assets/stex-rHcFYcA0.js +1 -0
  117. package/dist/apps/chat-ui/assets/stylus-DxF70RNr.js +1 -0
  118. package/dist/apps/chat-ui/assets/swift-T0hDoOb-.js +1 -0
  119. package/dist/apps/chat-ui/assets/tcl-Dlzy1mPk.js +1 -0
  120. package/dist/apps/chat-ui/assets/textile-Dy5rFZe5.js +1 -0
  121. package/dist/apps/chat-ui/assets/tiddlywiki-DQP1OymS.js +1 -0
  122. package/dist/apps/chat-ui/assets/tiki-0vOj3DB2.js +1 -0
  123. package/dist/apps/chat-ui/assets/toml-DEltN0lI.js +1 -0
  124. package/dist/apps/chat-ui/assets/troff-CRbBpEqY.js +1 -0
  125. package/dist/apps/chat-ui/assets/ttcn-M5q1nLKg.js +1 -0
  126. package/dist/apps/chat-ui/assets/ttcn-cfg-Rmw9NWq9.js +1 -0
  127. package/dist/apps/chat-ui/assets/turtle-BCDWhJK0.js +1 -0
  128. package/dist/apps/chat-ui/assets/vb-QQ7LGlOz.js +1 -0
  129. package/dist/apps/chat-ui/assets/vbscript-BiSEdUzz.js +1 -0
  130. package/dist/apps/chat-ui/assets/velocity-CzMg5_6w.js +1 -0
  131. package/dist/apps/chat-ui/assets/verilog-BJOO83gk.js +1 -0
  132. package/dist/apps/chat-ui/assets/vhdl-ed4zAZAA.js +1 -0
  133. package/dist/apps/chat-ui/assets/webidl-Ddy6hbV6.js +1 -0
  134. package/dist/apps/chat-ui/assets/xquery-Bw1zwhh6.js +1 -0
  135. package/dist/apps/chat-ui/assets/yacas-DZdTXy3s.js +1 -0
  136. package/dist/apps/chat-ui/assets/z80-DMG02_YV.js +1 -0
  137. package/dist/apps/chat-ui/index.html +15 -0
  138. package/dist/apps/context-files-ui/assets/apl-14BqhLYK.js +1 -0
  139. package/dist/apps/context-files-ui/assets/asciiarmor-WLvjqI7d.js +1 -0
  140. package/dist/apps/context-files-ui/assets/asn1-Bg4FbdCg.js +1 -0
  141. package/dist/apps/context-files-ui/assets/asterisk-B2MO-X4d.js +1 -0
  142. package/dist/apps/context-files-ui/assets/brainfuck-CV9kufud.js +1 -0
  143. package/dist/apps/context-files-ui/assets/clike-CjmcUpt6.js +1 -0
  144. package/dist/apps/context-files-ui/assets/clojure-De3QGfx6.js +1 -0
  145. package/dist/apps/context-files-ui/assets/cmake-i2VDNaRq.js +1 -0
  146. package/dist/apps/context-files-ui/assets/cobol-BwO6DF08.js +1 -0
  147. package/dist/apps/context-files-ui/assets/coffeescript-BtivDvRz.js +1 -0
  148. package/dist/apps/context-files-ui/assets/commonlisp-DFkEQdLP.js +1 -0
  149. package/dist/apps/context-files-ui/assets/crystal-CU0NkcVL.js +1 -0
  150. package/dist/apps/context-files-ui/assets/css-CbMZAQ1W.js +1 -0
  151. package/dist/apps/context-files-ui/assets/cypher-Dke5QOzv.js +1 -0
  152. package/dist/apps/context-files-ui/assets/d-TPqSVaHM.js +1 -0
  153. package/dist/apps/context-files-ui/assets/diff-B365LSoZ.js +1 -0
  154. package/dist/apps/context-files-ui/assets/dist-B5PTVnox.js +1 -0
  155. package/dist/apps/context-files-ui/assets/dist-B5ZAfwf5.js +1 -0
  156. package/dist/apps/context-files-ui/assets/dist-BJW3917N.js +11 -0
  157. package/dist/apps/context-files-ui/assets/dist-BkUONE3N.js +1 -0
  158. package/dist/apps/context-files-ui/assets/dist-CKQF1zEu.js +1 -0
  159. package/dist/apps/context-files-ui/assets/dist-CwbH_3RN.js +1 -0
  160. package/dist/apps/context-files-ui/assets/dist-CxRLRmMx.js +2 -0
  161. package/dist/apps/context-files-ui/assets/dist-D1KyNDg5.js +13 -0
  162. package/dist/apps/context-files-ui/assets/dist-DFi2YGux.js +1 -0
  163. package/dist/apps/context-files-ui/assets/dist-DKoyMSNr.js +1 -0
  164. package/dist/apps/context-files-ui/assets/dist-DLMjd26T.js +1 -0
  165. package/dist/apps/context-files-ui/assets/dist-DQXzt2Ng.js +1 -0
  166. package/dist/apps/context-files-ui/assets/dist-DotDq_kD.js +1 -0
  167. package/dist/apps/context-files-ui/assets/dist-DyfSeBMu.js +1 -0
  168. package/dist/apps/context-files-ui/assets/dist-MyZgX9K2.js +9 -0
  169. package/dist/apps/context-files-ui/assets/dist-QQuDy4KA.js +1 -0
  170. package/dist/apps/context-files-ui/assets/dist-YwR9dpb-.js +1 -0
  171. package/dist/apps/context-files-ui/assets/dist-dTBsFYAl.js +1 -0
  172. package/dist/apps/context-files-ui/assets/dockerfile-CJb2sekW.js +1 -0
  173. package/dist/apps/context-files-ui/assets/dtd-CBMymJ7O.js +1 -0
  174. package/dist/apps/context-files-ui/assets/dylan-08Azy1NK.js +1 -0
  175. package/dist/apps/context-files-ui/assets/ebnf-Dkum_1J8.js +1 -0
  176. package/dist/apps/context-files-ui/assets/ecl-dhxjHL8y.js +1 -0
  177. package/dist/apps/context-files-ui/assets/eiffel-C446m6dI.js +1 -0
  178. package/dist/apps/context-files-ui/assets/elm-po1E9de0.js +1 -0
  179. package/dist/apps/context-files-ui/assets/erlang-BD5LkVkR.js +1 -0
  180. package/dist/apps/context-files-ui/assets/factor-B2EMQZkP.js +1 -0
  181. package/dist/apps/context-files-ui/assets/fcl-DkEOamHd.js +1 -0
  182. package/dist/apps/context-files-ui/assets/forth-dCg2_HVB.js +1 -0
  183. package/dist/apps/context-files-ui/assets/fortran-3ZpXLFh1.js +1 -0
  184. package/dist/apps/context-files-ui/assets/gas-DMmxLZRI.js +1 -0
  185. package/dist/apps/context-files-ui/assets/gherkin-DUSFg2R6.js +1 -0
  186. package/dist/apps/context-files-ui/assets/groovy-Cmduloe1.js +1 -0
  187. package/dist/apps/context-files-ui/assets/haskell-Cyr255R9.js +1 -0
  188. package/dist/apps/context-files-ui/assets/haxe-BJVKtprM.js +1 -0
  189. package/dist/apps/context-files-ui/assets/http-DszHFpc-.js +1 -0
  190. package/dist/apps/context-files-ui/assets/idl-Cati9Nrv.js +1 -0
  191. package/dist/apps/context-files-ui/assets/index-BwRDoHMC.css +1 -0
  192. package/dist/apps/context-files-ui/assets/index-GwvjXytt.js +202 -0
  193. package/dist/apps/context-files-ui/assets/javascript-C5pDVaoP.js +1 -0
  194. package/dist/apps/context-files-ui/assets/julia-DlqY1cTU.js +1 -0
  195. package/dist/apps/context-files-ui/assets/livescript-C6p8-2W1.js +1 -0
  196. package/dist/apps/context-files-ui/assets/lua-BxuTHaF7.js +1 -0
  197. package/dist/apps/context-files-ui/assets/mathematica-nDHZUMJT.js +1 -0
  198. package/dist/apps/context-files-ui/assets/mbox-DAaR0Hcz.js +1 -0
  199. package/dist/apps/context-files-ui/assets/mirc-CCA0FRfl.js +1 -0
  200. package/dist/apps/context-files-ui/assets/mllike-Cw3Iccsb.js +1 -0
  201. package/dist/apps/context-files-ui/assets/modelica-Czx80fNR.js +1 -0
  202. package/dist/apps/context-files-ui/assets/mscgen-BmfuTbzG.js +1 -0
  203. package/dist/apps/context-files-ui/assets/mumps-Ds_ZaumL.js +1 -0
  204. package/dist/apps/context-files-ui/assets/nginx-D9M2PQ4U.js +1 -0
  205. package/dist/apps/context-files-ui/assets/nsis-DOo3SJmd.js +1 -0
  206. package/dist/apps/context-files-ui/assets/ntriples-DLHGTvHs.js +1 -0
  207. package/dist/apps/context-files-ui/assets/octave-8jj96JiC.js +1 -0
  208. package/dist/apps/context-files-ui/assets/oz-BmMq7iC4.js +1 -0
  209. package/dist/apps/context-files-ui/assets/pascal-BgMr6XpT.js +1 -0
  210. package/dist/apps/context-files-ui/assets/perl-D6YJObi_.js +1 -0
  211. package/dist/apps/context-files-ui/assets/pig-nx7uchs8.js +1 -0
  212. package/dist/apps/context-files-ui/assets/powershell-B4IPkVxR.js +1 -0
  213. package/dist/apps/context-files-ui/assets/properties-CoavQdLC.js +1 -0
  214. package/dist/apps/context-files-ui/assets/protobuf-D5EWhcmc.js +1 -0
  215. package/dist/apps/context-files-ui/assets/pug-QU72BPAa.js +1 -0
  216. package/dist/apps/context-files-ui/assets/puppet-B_0GFuyD.js +1 -0
  217. package/dist/apps/context-files-ui/assets/python-Cs7sNzy_.js +1 -0
  218. package/dist/apps/context-files-ui/assets/q-BIB9pPtI.js +1 -0
  219. package/dist/apps/context-files-ui/assets/r-CN5s4f3o.js +1 -0
  220. package/dist/apps/context-files-ui/assets/rpm-Ct_Ck8mQ.js +1 -0
  221. package/dist/apps/context-files-ui/assets/ruby-BVPradRk.js +1 -0
  222. package/dist/apps/context-files-ui/assets/sas-DN4j74IF.js +1 -0
  223. package/dist/apps/context-files-ui/assets/scheme-CvNgHAnh.js +1 -0
  224. package/dist/apps/context-files-ui/assets/shell-BjiMLAaM.js +1 -0
  225. package/dist/apps/context-files-ui/assets/sieve-C2U1O5Z4.js +1 -0
  226. package/dist/apps/context-files-ui/assets/simple-mode-DnMbQuKW.js +1 -0
  227. package/dist/apps/context-files-ui/assets/smalltalk-DkYwYufV.js +1 -0
  228. package/dist/apps/context-files-ui/assets/solr-BopnSD-v.js +1 -0
  229. package/dist/apps/context-files-ui/assets/sparql-Cpg3YQfd.js +1 -0
  230. package/dist/apps/context-files-ui/assets/spreadsheet-kRxtVt9J.js +1 -0
  231. package/dist/apps/context-files-ui/assets/sql-DYI2GwJR.js +1 -0
  232. package/dist/apps/context-files-ui/assets/stex-BCRT8IJ3.js +1 -0
  233. package/dist/apps/context-files-ui/assets/stylus-CARoeVE9.js +1 -0
  234. package/dist/apps/context-files-ui/assets/swift-DKNaLAK6.js +1 -0
  235. package/dist/apps/context-files-ui/assets/tcl-CQyXkgMH.js +1 -0
  236. package/dist/apps/context-files-ui/assets/textile-Yg_UWn-t.js +1 -0
  237. package/dist/apps/context-files-ui/assets/tiddlywiki-dqVbkfX4.js +1 -0
  238. package/dist/apps/context-files-ui/assets/tiki-CC_ic8g0.js +1 -0
  239. package/dist/apps/context-files-ui/assets/toml-B7gGzVkJ.js +1 -0
  240. package/dist/apps/context-files-ui/assets/troff-Bq3z6oAu.js +1 -0
  241. package/dist/apps/context-files-ui/assets/ttcn-GvRgs2AT.js +1 -0
  242. package/dist/apps/context-files-ui/assets/ttcn-cfg-CGCXz7Vo.js +1 -0
  243. package/dist/apps/context-files-ui/assets/turtle-CwIpz2yy.js +1 -0
  244. package/dist/apps/context-files-ui/assets/vb-BmcHUM2C.js +1 -0
  245. package/dist/apps/context-files-ui/assets/vbscript-Cs9dylre.js +1 -0
  246. package/dist/apps/context-files-ui/assets/velocity-CBWU0VCy.js +1 -0
  247. package/dist/apps/context-files-ui/assets/verilog-DVCHmufx.js +1 -0
  248. package/dist/apps/context-files-ui/assets/vhdl-BGDk4f1d.js +1 -0
  249. package/dist/apps/context-files-ui/assets/webidl-egXQEWlC.js +1 -0
  250. package/dist/apps/context-files-ui/assets/xquery-5f0hn7cg.js +1 -0
  251. package/dist/apps/context-files-ui/assets/yacas-DNs9XkmQ.js +1 -0
  252. package/dist/apps/context-files-ui/assets/z80-B7Dfb4UO.js +1 -0
  253. package/dist/apps/context-files-ui/index.html +14 -0
  254. package/dist/auth/better-auth.js +129 -0
  255. package/dist/auth/types.js +14 -0
  256. package/dist/bin/pibo.js +3 -0
  257. package/dist/channels/types.js +1 -0
  258. package/dist/cli-errors.js +18 -0
  259. package/dist/cli.js +264 -0
  260. package/dist/config/config.js +167 -0
  261. package/dist/core/base-prompt.js +104 -0
  262. package/dist/core/codex-compat.js +44 -0
  263. package/dist/core/compaction-prompt.js +258 -0
  264. package/dist/core/events.js +1 -0
  265. package/dist/core/profiles.js +138 -0
  266. package/dist/core/routed-session.js +538 -0
  267. package/dist/core/runtime.js +323 -0
  268. package/dist/core/session-router.js +437 -0
  269. package/dist/core/system-prompt-template.js +56 -0
  270. package/dist/core/thinking.js +9 -0
  271. package/dist/core/workspace.js +5 -0
  272. package/dist/debug/events.js +92 -0
  273. package/dist/debug/index.js +631 -0
  274. package/dist/debug/session.js +200 -0
  275. package/dist/debug/sql.js +238 -0
  276. package/dist/debug/stores.js +49 -0
  277. package/dist/debug/trace.js +245 -0
  278. package/dist/env.js +32 -0
  279. package/dist/gateway/client.js +200 -0
  280. package/dist/gateway/protocol.js +46 -0
  281. package/dist/gateway/request.js +146 -0
  282. package/dist/gateway/server.js +221 -0
  283. package/dist/gateway/tool.js +69 -0
  284. package/dist/gateway/web.js +80 -0
  285. package/dist/index.js +23 -0
  286. package/dist/local/client.js +77 -0
  287. package/dist/local/extension.js +548 -0
  288. package/dist/local/tui.js +25 -0
  289. package/dist/mcp/agent-context.js +123 -0
  290. package/dist/mcp/client.js +332 -0
  291. package/dist/mcp/commands/call.js +146 -0
  292. package/dist/mcp/commands/grep.js +145 -0
  293. package/dist/mcp/commands/info.js +71 -0
  294. package/dist/mcp/commands/list.js +94 -0
  295. package/dist/mcp/config-command.js +217 -0
  296. package/dist/mcp/config.js +440 -0
  297. package/dist/mcp/daemon-client.js +266 -0
  298. package/dist/mcp/daemon.js +327 -0
  299. package/dist/mcp/errors.js +287 -0
  300. package/dist/mcp/index.js +431 -0
  301. package/dist/mcp/output.js +171 -0
  302. package/dist/mcp/python-runtime.js +131 -0
  303. package/dist/mcp/registry.js +116 -0
  304. package/dist/mcp/version.js +5 -0
  305. package/dist/pi-packages/cli.js +92 -0
  306. package/dist/pi-packages/installer.js +70 -0
  307. package/dist/pi-packages/metadata.js +231 -0
  308. package/dist/pi-packages/runtime.js +61 -0
  309. package/dist/pi-packages/store.js +175 -0
  310. package/dist/pi-packages/types.js +1 -0
  311. package/dist/plugins/better-auth.js +11 -0
  312. package/dist/plugins/builtin.js +249 -0
  313. package/dist/plugins/chat-web.js +11 -0
  314. package/dist/plugins/codex-compat.js +72 -0
  315. package/dist/plugins/context-files-store.js +354 -0
  316. package/dist/plugins/context-files.js +999 -0
  317. package/dist/plugins/core-tools.js +94 -0
  318. package/dist/plugins/example.js +67 -0
  319. package/dist/plugins/registry.js +368 -0
  320. package/dist/plugins/remote-agent.js +9 -0
  321. package/dist/plugins/types.js +1 -0
  322. package/dist/plugins/web.js +11 -0
  323. package/dist/reliability/store.js +759 -0
  324. package/dist/remote/channel.js +176 -0
  325. package/dist/remote/client.js +92 -0
  326. package/dist/remote/examples/tui-controller.js +263 -0
  327. package/dist/remote/protocol.js +55 -0
  328. package/dist/remote/session-client.js +189 -0
  329. package/dist/runs/registry.js +323 -0
  330. package/dist/runs/tools.js +185 -0
  331. package/dist/sessions/bindings.js +41 -0
  332. package/dist/sessions/sqlite-store.js +154 -0
  333. package/dist/sessions/store.js +125 -0
  334. package/dist/shared/trace-order.js +83 -0
  335. package/dist/subagents/tool.js +63 -0
  336. package/dist/tools/browser-use-cdp.js +207 -0
  337. package/dist/tools/browser-use-leases.js +338 -0
  338. package/dist/tools/browser-use-wrapper.js +338 -0
  339. package/dist/tools/codex-compat.js +85 -0
  340. package/dist/tools/desktop-env.js +90 -0
  341. package/dist/tools/guides.js +276 -0
  342. package/dist/tools/index.js +366 -0
  343. package/dist/tools/python-runtime.js +154 -0
  344. package/dist/tools/registry.js +107 -0
  345. package/dist/tools/web-search.js +137 -0
  346. package/dist/web/auth.js +10 -0
  347. package/dist/web/channel.js +151 -0
  348. package/dist/web/http.js +110 -0
  349. package/dist/web/types.js +1 -0
  350. package/package.json +74 -0
  351. package/src/mcp/LICENSE.mcp-cli +21 -0
@@ -0,0 +1,631 @@
1
+ import { resolveDebugStore, resolveDebugStores } from "./stores.js";
2
+ export async function runDebugCli(argv = process.argv) {
3
+ try {
4
+ const args = argv.slice(2);
5
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
6
+ printDebugDiscovery();
7
+ return;
8
+ }
9
+ if (args[0] === "db") {
10
+ await runDebugDb(args.slice(1));
11
+ return;
12
+ }
13
+ if (args[0] === "session") {
14
+ await runDebugSession(args.slice(1));
15
+ return;
16
+ }
17
+ if (args[0] === "trace") {
18
+ await runDebugTrace(args.slice(1));
19
+ return;
20
+ }
21
+ if (args[0] === "events") {
22
+ await runDebugEvents(args.slice(1));
23
+ return;
24
+ }
25
+ if (args[0] === "jobs") {
26
+ await runDebugJobs(args.slice(1));
27
+ return;
28
+ }
29
+ if (args[0] === "runs") {
30
+ await runDebugRuns(args.slice(1));
31
+ return;
32
+ }
33
+ throw new Error(`Unknown pibo debug command "${args[0]}". Run pibo debug --help.`);
34
+ }
35
+ catch (error) {
36
+ console.error(error instanceof Error ? error.message : String(error));
37
+ process.exitCode = 1;
38
+ }
39
+ }
40
+ async function runDebugDb(args) {
41
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
42
+ printDebugDbDiscovery();
43
+ return;
44
+ }
45
+ const command = args[0];
46
+ const options = parseOptions(args.slice(1));
47
+ if (command === "stores") {
48
+ const stores = resolveDebugStores();
49
+ if (options.json) {
50
+ console.log(JSON.stringify({ stores }, null, 2));
51
+ return;
52
+ }
53
+ console.log(["store\tpath\texists\tdescription", ...stores.map((store) => `${store.name}\t${store.defaultPath}\t${store.exists}\t${store.description}`)].join("\n"));
54
+ return;
55
+ }
56
+ const storeName = options.positionals[0];
57
+ if (!storeName)
58
+ throw new Error(`pibo debug db ${command} requires <store>`);
59
+ const store = resolveDebugStore(storeName);
60
+ if (command === "tables") {
61
+ const { formatJson, listTables } = await import("./sql.js");
62
+ const tables = listTables(store);
63
+ if (options.json)
64
+ console.log(formatJson({ store: store.name, path: store.path, tables }));
65
+ else
66
+ console.log(tables.length ? tables.join("\n") : "tables: 0");
67
+ return;
68
+ }
69
+ if (command === "schema") {
70
+ const { formatJson, getStoreSchema } = await import("./sql.js");
71
+ const tables = getStoreSchema(store);
72
+ if (options.json) {
73
+ console.log(formatJson({ store: store.name, path: store.path, tables }));
74
+ return;
75
+ }
76
+ console.log(formatSchemaText(tables));
77
+ return;
78
+ }
79
+ if (command === "query") {
80
+ const { formatJson, formatRows, runReadOnlyQuery } = await import("./sql.js");
81
+ const sql = options.positionals.slice(1).join(" ");
82
+ const result = runReadOnlyQuery(store, sql, { limit: options.limit });
83
+ if (options.json)
84
+ console.log(formatJson(result));
85
+ else
86
+ console.log(formatRows(result.rows, { limited: result.limited }));
87
+ return;
88
+ }
89
+ throw new Error(`Unknown pibo debug db command "${command}". Run pibo debug db --help.`);
90
+ }
91
+ async function runDebugSession(args) {
92
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
93
+ printDebugSessionDiscovery();
94
+ return;
95
+ }
96
+ const options = parseOptions(args);
97
+ const input = options.positionals[0];
98
+ if (!input)
99
+ throw new Error("pibo debug session requires <url-or-pibo-session-id>");
100
+ const { formatJson } = await import("./sql.js");
101
+ const { formatDebugSessionSummary, inspectDebugSession } = await import("./session.js");
102
+ const summary = inspectDebugSession(input, {
103
+ sessions: resolveDebugStore("sessions"),
104
+ chat: resolveDebugStore("chat"),
105
+ }, {
106
+ events: options.events,
107
+ limit: options.limit,
108
+ });
109
+ if (options.json)
110
+ console.log(formatJson(summary));
111
+ else
112
+ console.log(formatDebugSessionSummary(summary));
113
+ }
114
+ async function runDebugTrace(args) {
115
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
116
+ printDebugTraceDiscovery();
117
+ return;
118
+ }
119
+ const options = parseOptions(args);
120
+ const piboSessionId = options.positionals[0];
121
+ if (!piboSessionId)
122
+ throw new Error("pibo debug trace requires <pibo-session-id>");
123
+ const { formatJson } = await import("./sql.js");
124
+ const { formatDebugTrace, inspectDebugTrace } = await import("./trace.js");
125
+ const result = await inspectDebugTrace(piboSessionId, {
126
+ sessions: resolveDebugStore("sessions"),
127
+ chat: resolveDebugStore("chat"),
128
+ }, {
129
+ runningOnly: options.runningOnly,
130
+ check: options.check,
131
+ });
132
+ if (options.json)
133
+ console.log(formatJson(result));
134
+ else
135
+ console.log(formatDebugTrace(result));
136
+ }
137
+ async function runDebugEvents(args) {
138
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
139
+ printDebugEventsDiscovery();
140
+ return;
141
+ }
142
+ if (args[0] === "stream") {
143
+ const options = parseOptions(args.slice(1));
144
+ const { formatJson, formatRows } = await import("./sql.js");
145
+ const { PiboReliabilityStore } = await import("../reliability/store.js");
146
+ const store = resolveDebugStore("reliability");
147
+ if (!store.exists)
148
+ throw new Error(`Debug store "reliability" not found at ${store.defaultPath}`);
149
+ const reliability = new PiboReliabilityStore(store.path);
150
+ try {
151
+ const events = reliability.list({
152
+ topic: options.topic,
153
+ afterStreamId: options.after ? Number(options.after) : undefined,
154
+ limit: options.limit ? Number(options.limit) : undefined,
155
+ });
156
+ if (options.json)
157
+ console.log(formatJson({ events }));
158
+ else
159
+ console.log(formatRows(events.map(compactEventRow)));
160
+ }
161
+ finally {
162
+ reliability.close();
163
+ }
164
+ return;
165
+ }
166
+ if (args[0] === "stats") {
167
+ const options = parseOptions(args.slice(1));
168
+ const { formatJson, formatRows } = await import("./sql.js");
169
+ const { PiboReliabilityStore } = await import("../reliability/store.js");
170
+ const store = resolveDebugStore("reliability");
171
+ if (!store.exists)
172
+ throw new Error(`Debug store "reliability" not found at ${store.defaultPath}`);
173
+ const reliability = new PiboReliabilityStore(store.path);
174
+ try {
175
+ const counts = reliability.countEvents({
176
+ topic: options.topic,
177
+ key: options.key,
178
+ retentionClass: options.retention,
179
+ });
180
+ if (options.json)
181
+ console.log(formatJson({ counts }));
182
+ else
183
+ console.log(formatRows(counts));
184
+ }
185
+ finally {
186
+ reliability.close();
187
+ }
188
+ return;
189
+ }
190
+ if (args[0] === "prune") {
191
+ const options = parseOptions(args.slice(1));
192
+ const { formatJson, formatRows } = await import("./sql.js");
193
+ const { PiboReliabilityStore } = await import("../reliability/store.js");
194
+ const store = resolveDebugStore("reliability");
195
+ if (!store.exists)
196
+ throw new Error(`Debug store "reliability" not found at ${store.defaultPath}`);
197
+ if (!options.topic || !options.retention || !options.before) {
198
+ throw new Error("pibo debug events prune requires --topic, --retention, and --before");
199
+ }
200
+ const reliability = new PiboReliabilityStore(store.path);
201
+ try {
202
+ const deleted = reliability.prune({
203
+ topic: options.topic,
204
+ retentionClass: options.retention,
205
+ before: options.before,
206
+ limit: options.limit ? Number(options.limit) : undefined,
207
+ destructive: options.destructive,
208
+ });
209
+ const result = {
210
+ topic: options.topic,
211
+ retentionClass: options.retention,
212
+ before: options.before,
213
+ destructive: options.destructive,
214
+ deleted,
215
+ };
216
+ if (options.json)
217
+ console.log(formatJson(result));
218
+ else
219
+ console.log(formatRows([result]));
220
+ }
221
+ finally {
222
+ reliability.close();
223
+ }
224
+ return;
225
+ }
226
+ if (args[0] === "consumers") {
227
+ const options = parseOptions(args.slice(1));
228
+ const { formatJson, formatRows } = await import("./sql.js");
229
+ const { PiboReliabilityStore } = await import("../reliability/store.js");
230
+ const store = resolveDebugStore("reliability");
231
+ if (!store.exists)
232
+ throw new Error(`Debug store "reliability" not found at ${store.defaultPath}`);
233
+ const reliability = new PiboReliabilityStore(store.path);
234
+ try {
235
+ const consumers = reliability.listConsumers();
236
+ if (options.json)
237
+ console.log(formatJson({ consumers }));
238
+ else
239
+ console.log(formatRows(consumers));
240
+ }
241
+ finally {
242
+ reliability.close();
243
+ }
244
+ return;
245
+ }
246
+ const options = parseOptions(args);
247
+ const piboSessionId = options.positionals[0];
248
+ if (!piboSessionId)
249
+ throw new Error("pibo debug events requires <pibo-session-id>");
250
+ const { formatJson } = await import("./sql.js");
251
+ const { formatDebugEvents, inspectDebugEvents } = await import("./events.js");
252
+ const result = inspectDebugEvents(piboSessionId, resolveDebugStore("chat"), {
253
+ type: options.type,
254
+ fields: options.fields,
255
+ limit: options.limit,
256
+ });
257
+ if (options.json)
258
+ console.log(formatJson(result));
259
+ else
260
+ console.log(formatDebugEvents(result));
261
+ }
262
+ async function runDebugJobs(args) {
263
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
264
+ printDebugJobsDiscovery();
265
+ return;
266
+ }
267
+ const command = args[0];
268
+ const options = parseOptions(args.slice(1));
269
+ const { formatJson, formatRows } = await import("./sql.js");
270
+ const { PiboReliabilityStore } = await import("../reliability/store.js");
271
+ const store = resolveDebugStore("reliability");
272
+ if (!store.exists)
273
+ throw new Error(`Debug store "reliability" not found at ${store.defaultPath}`);
274
+ const reliability = new PiboReliabilityStore(store.path);
275
+ try {
276
+ if (command === "list") {
277
+ const jobs = reliability.listJobs({ queue: options.queue, limit: options.limit ? Number(options.limit) : undefined });
278
+ if (options.json)
279
+ console.log(formatJson({ jobs }));
280
+ else
281
+ console.log(formatRows(jobs.map(compactJobRow)));
282
+ return;
283
+ }
284
+ if (command === "dead") {
285
+ const jobs = reliability.listDead({ queue: options.queue, limit: options.limit ? Number(options.limit) : undefined });
286
+ if (options.json)
287
+ console.log(formatJson({ jobs }));
288
+ else
289
+ console.log(formatRows(jobs.map(compactDeadJobRow)));
290
+ return;
291
+ }
292
+ if (command === "replay") {
293
+ const jobId = options.positionals[0];
294
+ if (!jobId)
295
+ throw new Error("pibo debug jobs replay requires <job-id>");
296
+ const job = reliability.requeueDead(jobId);
297
+ if (options.json)
298
+ console.log(formatJson({ job }));
299
+ else
300
+ console.log(formatRows([compactJobRow(job)]));
301
+ return;
302
+ }
303
+ throw new Error(`Unknown pibo debug jobs command "${command}". Run pibo debug jobs --help.`);
304
+ }
305
+ finally {
306
+ reliability.close();
307
+ }
308
+ }
309
+ async function runDebugRuns(args) {
310
+ if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
311
+ printDebugRunsDiscovery();
312
+ return;
313
+ }
314
+ const command = args[0];
315
+ const options = parseOptions(args.slice(1));
316
+ const { formatJson, formatRows } = await import("./sql.js");
317
+ const { PiboReliabilityStore } = await import("../reliability/store.js");
318
+ const store = resolveDebugStore("reliability");
319
+ if (!store.exists)
320
+ throw new Error(`Debug store "reliability" not found at ${store.defaultPath}`);
321
+ const reliability = new PiboReliabilityStore(store.path);
322
+ try {
323
+ if (command === "list") {
324
+ const piboSessionId = options.positionals[0];
325
+ if (!piboSessionId)
326
+ throw new Error("pibo debug runs list requires <pibo-session-id>");
327
+ const runs = reliability.listRuns({ ownerPiboSessionId: piboSessionId, includeConsumed: true, includeDetached: true });
328
+ if (options.json)
329
+ console.log(formatJson({ runs }));
330
+ else
331
+ console.log(formatRows(runs.map(compactRunRow)));
332
+ return;
333
+ }
334
+ if (command === "inspect") {
335
+ const runId = options.positionals[0];
336
+ if (!runId)
337
+ throw new Error("pibo debug runs inspect requires <run-id>");
338
+ const run = reliability.getRun(runId);
339
+ if (!run)
340
+ throw new Error(`Unknown run "${runId}"`);
341
+ if (options.json)
342
+ console.log(formatJson({ run }));
343
+ else
344
+ console.log(formatRows([compactRunRow(run)]));
345
+ return;
346
+ }
347
+ throw new Error(`Unknown pibo debug runs command "${command}". Run pibo debug runs --help.`);
348
+ }
349
+ finally {
350
+ reliability.close();
351
+ }
352
+ }
353
+ function parseOptions(args) {
354
+ const parsed = { positionals: [], json: false, events: false, runningOnly: false, check: false, destructive: false };
355
+ for (let index = 0; index < args.length; index += 1) {
356
+ const arg = args[index];
357
+ if (arg === "--json") {
358
+ parsed.json = true;
359
+ continue;
360
+ }
361
+ if (arg === "--events") {
362
+ parsed.events = true;
363
+ continue;
364
+ }
365
+ if (arg === "--running-only") {
366
+ parsed.runningOnly = true;
367
+ continue;
368
+ }
369
+ if (arg === "--check") {
370
+ parsed.check = true;
371
+ continue;
372
+ }
373
+ if (arg === "--children") {
374
+ continue;
375
+ }
376
+ if (arg === "--limit") {
377
+ const value = args[index + 1];
378
+ if (!value)
379
+ throw new Error("--limit requires a value");
380
+ parsed.limit = value;
381
+ index += 1;
382
+ continue;
383
+ }
384
+ if (arg === "--type") {
385
+ const value = args[index + 1];
386
+ if (!value)
387
+ throw new Error("--type requires a value");
388
+ parsed.type = value;
389
+ index += 1;
390
+ continue;
391
+ }
392
+ if (arg === "--fields") {
393
+ const value = args[index + 1];
394
+ if (!value)
395
+ throw new Error("--fields requires a value");
396
+ parsed.fields = value.split(",").map((field) => field.trim()).filter(Boolean);
397
+ index += 1;
398
+ continue;
399
+ }
400
+ if (arg === "--topic") {
401
+ const value = args[index + 1];
402
+ if (!value)
403
+ throw new Error("--topic requires a value");
404
+ parsed.topic = value;
405
+ index += 1;
406
+ continue;
407
+ }
408
+ if (arg === "--key" || arg === "--session") {
409
+ const value = args[index + 1];
410
+ if (!value)
411
+ throw new Error(`${arg} requires a value`);
412
+ parsed.key = value;
413
+ index += 1;
414
+ continue;
415
+ }
416
+ if (arg === "--retention") {
417
+ const value = args[index + 1];
418
+ if (!value)
419
+ throw new Error("--retention requires a value");
420
+ parsed.retention = value;
421
+ index += 1;
422
+ continue;
423
+ }
424
+ if (arg === "--after") {
425
+ const value = args[index + 1];
426
+ if (!value)
427
+ throw new Error("--after requires a value");
428
+ parsed.after = value;
429
+ index += 1;
430
+ continue;
431
+ }
432
+ if (arg === "--before") {
433
+ const value = args[index + 1];
434
+ if (!value)
435
+ throw new Error("--before requires a value");
436
+ parsed.before = value;
437
+ index += 1;
438
+ continue;
439
+ }
440
+ if (arg === "--destructive") {
441
+ parsed.destructive = true;
442
+ continue;
443
+ }
444
+ if (arg === "--queue") {
445
+ const value = args[index + 1];
446
+ if (!value)
447
+ throw new Error("--queue requires a value");
448
+ parsed.queue = value;
449
+ index += 1;
450
+ continue;
451
+ }
452
+ parsed.positionals.push(arg);
453
+ }
454
+ return parsed;
455
+ }
456
+ function compactEventRow(event) {
457
+ return {
458
+ streamId: event.streamId,
459
+ topic: event.topic,
460
+ key: event.key,
461
+ eventId: event.eventId,
462
+ type: payloadType(event.payload),
463
+ createdAt: event.createdAt,
464
+ retentionClass: event.retentionClass,
465
+ };
466
+ }
467
+ function compactJobRow(job) {
468
+ return {
469
+ jobId: job.jobId,
470
+ queue: job.queue,
471
+ state: job.state,
472
+ runAt: job.runAt,
473
+ attempts: `${job.attempts}/${job.maxAttempts}`,
474
+ workerId: job.workerId,
475
+ lastError: job.lastError,
476
+ };
477
+ }
478
+ function compactDeadJobRow(job) {
479
+ return {
480
+ jobId: job.jobId,
481
+ queue: job.queue,
482
+ attempts: `${job.attempts}/${job.maxAttempts}`,
483
+ deadAt: job.deadAt,
484
+ deadReason: job.deadReason,
485
+ lastError: job.lastError,
486
+ };
487
+ }
488
+ function compactRunRow(run) {
489
+ return {
490
+ runId: run.runId,
491
+ piboSessionId: run.ownerPiboSessionId,
492
+ status: run.status,
493
+ toolName: run.toolName,
494
+ policy: run.completionPolicy,
495
+ consumed: run.consumed,
496
+ updatedAt: run.updatedAt,
497
+ summary: run.summary,
498
+ };
499
+ }
500
+ function payloadType(payload) {
501
+ if (!payload || typeof payload !== "object" || Array.isArray(payload))
502
+ return undefined;
503
+ const candidate = payload;
504
+ return typeof candidate.type === "string" ? candidate.type : undefined;
505
+ }
506
+ function printDebugDiscovery() {
507
+ console.log(`pibo debug - inspect local Pibo data
508
+
509
+ Commands:
510
+ db Inspect and query local SQLite stores
511
+ session Inspect one Pibo Session by id or Chat URL
512
+ trace Rebuild the Chat Web trace view for one Pibo Session
513
+ events Inspect compact event payload fields for one Pibo Session
514
+ jobs Inspect durable Pibo jobs and DLQ
515
+ runs Inspect durable yielded runs
516
+
517
+ Next:
518
+ pibo debug db
519
+ pibo debug session <url-or-pibo-session-id>
520
+ pibo debug trace <pibo-session-id> --running-only
521
+ pibo debug events stream --topic pibo.output
522
+ `);
523
+ }
524
+ function printDebugDbDiscovery() {
525
+ console.log(`pibo debug db - inspect local SQLite stores
526
+
527
+ Stores:
528
+ sessions .pibo/pibo-sessions.sqlite
529
+ chat .pibo/web-chat.sqlite
530
+ agents .pibo/chat-agents.sqlite
531
+ auth .pibo/auth.sqlite
532
+ bindings .pibo/session-bindings.sqlite
533
+ reliability .pibo/pibo-events.sqlite
534
+
535
+ Commands:
536
+ stores List known stores and paths
537
+ tables <store> List tables only
538
+ schema <store> List tables and columns
539
+ query <store> <sql> Run read-only SQL
540
+
541
+ Next:
542
+ pibo debug db schema sessions
543
+ pibo debug db query sessions "select id, profile from pibo_sessions limit 5"
544
+ `);
545
+ }
546
+ function printDebugSessionDiscovery() {
547
+ console.log(`pibo debug session - inspect one Pibo Session
548
+
549
+ Usage:
550
+ pibo debug session <url-or-pibo-session-id> [--events] [--limit n] [--json]
551
+
552
+ Inputs:
553
+ ps_...
554
+ /apps/chat/rooms/<roomId>/sessions/<piboSessionId>
555
+ /apps/chat/sessions/<piboSessionId>
556
+
557
+ Next:
558
+ pibo debug session ps_...
559
+ `);
560
+ }
561
+ function printDebugTraceDiscovery() {
562
+ console.log(`pibo debug trace - rebuild one Chat Web trace view
563
+
564
+ Usage:
565
+ pibo debug trace <pibo-session-id> [--running-only] [--check] [--json]
566
+
567
+ Output:
568
+ Compact trace nodes from the same buildTraceView logic used by /api/chat/trace.
569
+ --check adds consistency diagnostics for ids, parents, ordering, and links.
570
+
571
+ Next:
572
+ pibo debug trace ps_... --check
573
+ pibo debug trace ps_... --running-only
574
+ `);
575
+ }
576
+ function printDebugEventsDiscovery() {
577
+ console.log(`pibo debug events - inspect compact event payload fields and Pibo event streams
578
+
579
+ Usage:
580
+ pibo debug events <pibo-session-id> [--type name] [--fields a,b.c] [--limit n] [--json]
581
+ pibo debug events stream [--topic topic] [--after stream_id] [--limit n] [--json]
582
+ pibo debug events stats [--topic topic] [--session pibo-session-id] [--retention class] [--json]
583
+ pibo debug events prune --topic topic --retention class --before iso-date [--limit n] [--destructive] [--json]
584
+ pibo debug events consumers [--json]
585
+
586
+ Examples:
587
+ pibo debug events ps_... --type tool_execution_finished --fields toolName,toolCallId,result.details.status
588
+
589
+ Next:
590
+ pibo debug events ps_... --limit 20
591
+ pibo debug events stats --topic pibo.output --retention live_delta
592
+ pibo debug events stream --topic pibo.output --after 123
593
+ `);
594
+ }
595
+ function printDebugJobsDiscovery() {
596
+ console.log(`pibo debug jobs - inspect durable Pibo jobs
597
+
598
+ Usage:
599
+ pibo debug jobs list [--queue queue] [--limit n] [--json]
600
+ pibo debug jobs dead [--queue queue] [--limit n] [--json]
601
+ pibo debug jobs replay <job-id> [--json]
602
+
603
+ Next:
604
+ pibo debug jobs list --queue runs
605
+ pibo debug jobs dead --queue runs
606
+ `);
607
+ }
608
+ function printDebugRunsDiscovery() {
609
+ console.log(`pibo debug runs - inspect durable yielded runs
610
+
611
+ Usage:
612
+ pibo debug runs list <pibo-session-id> [--json]
613
+ pibo debug runs inspect <run-id> [--json]
614
+
615
+ Next:
616
+ pibo debug runs list ps_...
617
+ `);
618
+ }
619
+ function formatSchemaText(tables) {
620
+ if (tables.length === 0)
621
+ return "tables: 0";
622
+ const lines = [];
623
+ for (const table of tables) {
624
+ lines.push(table.name);
625
+ for (const column of table.columns) {
626
+ const flags = [column.notNull ? "not-null" : "", column.primaryKey ? "pk" : ""].filter(Boolean).join(",");
627
+ lines.push(` ${column.name}\t${column.type}${flags ? `\t${flags}` : ""}`);
628
+ }
629
+ }
630
+ return lines.join("\n");
631
+ }