@pasko70/pibo 1.9.7 → 1.9.9

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 (705) hide show
  1. package/README.md +183 -183
  2. package/context/codex-base-prompt.md +148 -148
  3. package/context/compute-worker.md +23 -23
  4. package/context/pibo-compaction-prompt.md +100 -100
  5. package/context/pibo-native-tooling.md +18 -18
  6. package/context/pibo-system-prompt.md +77 -77
  7. package/docs/README.md +23 -23
  8. package/docs/ops/install-developer-host.md +112 -112
  9. package/docs/ops/install-user-host.md +96 -96
  10. package/docs/ops/upgrade-user-to-developer-host.md +69 -69
  11. package/docs/ops/vscode-extension-release.md +160 -160
  12. package/package.json +95 -95
  13. package/skills/builtin/graphify/SKILL.md +52 -52
  14. package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
  15. package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
  16. package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
  17. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
  18. package/skills/builtin/prd/SKILL.md +143 -143
  19. package/skills/builtin/ralph-loop/SKILL.md +359 -359
  20. package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
  21. package/skills/builtin/skill-creator/LICENSE.txt +201 -201
  22. package/skills/builtin/skill-creator/SKILL.md +513 -513
  23. package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
  24. package/skills/builtin/skill-creator/agents/comparator.md +202 -202
  25. package/skills/builtin/skill-creator/agents/grader.md +223 -223
  26. package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
  27. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
  28. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
  29. package/skills/builtin/skill-creator/references/schemas.md +430 -430
  30. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
  31. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
  32. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
  33. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
  34. package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
  35. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
  36. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
  37. package/skills/builtin/skill-creator/scripts/utils.py +47 -47
  38. package/skills/builtin/web-annotations/SKILL.md +93 -93
  39. package/src/mcp/LICENSE.mcp-cli +21 -21
  40. package/dist/api/simple-agent-api.js +0 -136
  41. package/dist/app-context.js +0 -4
  42. package/dist/apps/chat/agent-profiles.js +0 -70
  43. package/dist/apps/chat/agent-store.js +0 -669
  44. package/dist/apps/chat/chat-api-routes.js +0 -325
  45. package/dist/apps/chat/chat-capability-routes.js +0 -90
  46. package/dist/apps/chat/chat-files.js +0 -178
  47. package/dist/apps/chat/chat-request-normalizers.js +0 -681
  48. package/dist/apps/chat/chat-settings-routes.js +0 -98
  49. package/dist/apps/chat/chat-trace-helpers.js +0 -139
  50. package/dist/apps/chat/chat-user-skill-routes.js +0 -178
  51. package/dist/apps/chat/cron-api.js +0 -213
  52. package/dist/apps/chat/data/chat-data-mappers.js +0 -82
  53. package/dist/apps/chat/data/event-command-service.js +0 -75
  54. package/dist/apps/chat/data/navigation-query-service.js +0 -11
  55. package/dist/apps/chat/data/project-service.js +0 -877
  56. package/dist/apps/chat/data/read-state-service.js +0 -42
  57. package/dist/apps/chat/data/room-service.js +0 -52
  58. package/dist/apps/chat/data/session-query-service.js +0 -126
  59. package/dist/apps/chat/data/timeline-query-service.js +0 -102
  60. package/dist/apps/chat/event-log.js +0 -1
  61. package/dist/apps/chat/model-catalog.js +0 -53
  62. package/dist/apps/chat/output-compactor.js +0 -126
  63. package/dist/apps/chat/output-event-policy.js +0 -17
  64. package/dist/apps/chat/project-workflow-human-actions.js +0 -347
  65. package/dist/apps/chat/project-workflow-sessions.js +0 -260
  66. package/dist/apps/chat/provider-auth-actions.js +0 -43
  67. package/dist/apps/chat/ralph-api.js +0 -156
  68. package/dist/apps/chat/read-model.js +0 -1
  69. package/dist/apps/chat/rooms.js +0 -1
  70. package/dist/apps/chat/session-metadata.js +0 -14
  71. package/dist/apps/chat/static-assets.js +0 -997
  72. package/dist/apps/chat/stream.js +0 -145
  73. package/dist/apps/chat/telemetry-retention-service.js +0 -69
  74. package/dist/apps/chat/trace-v2.js +0 -307
  75. package/dist/apps/chat/trace.js +0 -572
  76. package/dist/apps/chat/types/event-store.js +0 -1
  77. package/dist/apps/chat/types/read-model.js +0 -1
  78. package/dist/apps/chat/types/rooms.js +0 -36
  79. package/dist/apps/chat/web-app.js +0 -4605
  80. package/dist/apps/chat/workflow-catalog.js +0 -572
  81. package/dist/apps/chat/workflow-edge-compatibility.js +0 -51
  82. package/dist/apps/chat/workflow-json-schema-validation.js +0 -335
  83. package/dist/apps/chat/workflow-manual-trigger-runtime.js +0 -232
  84. package/dist/apps/chat/workflow-persistence-model.js +0 -140
  85. package/dist/apps/chat/workflow-persistence.js +0 -633
  86. package/dist/apps/chat/workflow-registered-ref-params.js +0 -130
  87. package/dist/apps/chat/workflow-registered-ref-pickers.js +0 -179
  88. package/dist/apps/chat/workflow-registered-ref-validation.js +0 -210
  89. package/dist/apps/chat/workflow-v2-security-validation.js +0 -93
  90. package/dist/apps/chat/workflow-validation-helpers.js +0 -114
  91. package/dist/apps/chat-ui/assets/apl-BxEMbctQ.js +0 -1
  92. package/dist/apps/chat-ui/assets/asciiarmor-eFjeGRuZ.js +0 -1
  93. package/dist/apps/chat-ui/assets/asn1-Cfx-0pt9.js +0 -1
  94. package/dist/apps/chat-ui/assets/asterisk-B5BHTsBr.js +0 -1
  95. package/dist/apps/chat-ui/assets/brainfuck-CAA2xofr.js +0 -1
  96. package/dist/apps/chat-ui/assets/clike-BoDCOLzN.js +0 -1
  97. package/dist/apps/chat-ui/assets/clojure-kVFSWX0o.js +0 -1
  98. package/dist/apps/chat-ui/assets/cmake-BUPAhezI.js +0 -1
  99. package/dist/apps/chat-ui/assets/cobol-BfgHZgup.js +0 -1
  100. package/dist/apps/chat-ui/assets/coffeescript-G1Pe_1AZ.js +0 -1
  101. package/dist/apps/chat-ui/assets/commonlisp-B3N0CjHn.js +0 -1
  102. package/dist/apps/chat-ui/assets/crystal-C15ndaGM.js +0 -1
  103. package/dist/apps/chat-ui/assets/css-BqOeyZOV.js +0 -1
  104. package/dist/apps/chat-ui/assets/cypher-KjIKv-wW.js +0 -1
  105. package/dist/apps/chat-ui/assets/d-BlT5AEC-.js +0 -1
  106. package/dist/apps/chat-ui/assets/diff-oF98tbqj.js +0 -1
  107. package/dist/apps/chat-ui/assets/dist--55mTWk3.js +0 -1
  108. package/dist/apps/chat-ui/assets/dist-BDiYR_k0.js +0 -2
  109. package/dist/apps/chat-ui/assets/dist-BYMYH5s9.js +0 -11
  110. package/dist/apps/chat-ui/assets/dist-BZ39rB1W.js +0 -1
  111. package/dist/apps/chat-ui/assets/dist-BsedZGJo.js +0 -1
  112. package/dist/apps/chat-ui/assets/dist-BtZRJHYc.js +0 -1
  113. package/dist/apps/chat-ui/assets/dist-C5YJOwhH.js +0 -1
  114. package/dist/apps/chat-ui/assets/dist-C5oXtFSP.js +0 -1
  115. package/dist/apps/chat-ui/assets/dist-CKM5j-iy.js +0 -1
  116. package/dist/apps/chat-ui/assets/dist-CTqkBO4D.js +0 -1
  117. package/dist/apps/chat-ui/assets/dist-CUp9us2q.js +0 -1
  118. package/dist/apps/chat-ui/assets/dist-CZ9T4Cly.js +0 -1
  119. package/dist/apps/chat-ui/assets/dist-Ca0Nv2Sb.js +0 -1
  120. package/dist/apps/chat-ui/assets/dist-D75qd42l.js +0 -1
  121. package/dist/apps/chat-ui/assets/dist-DALz2b8B.js +0 -1
  122. package/dist/apps/chat-ui/assets/dist-DSKQpPaz.js +0 -1
  123. package/dist/apps/chat-ui/assets/dist-Hmv_Gd0d.js +0 -6
  124. package/dist/apps/chat-ui/assets/dist-JsdMHbep.js +0 -23
  125. package/dist/apps/chat-ui/assets/dist-MvkOuMpO.js +0 -1
  126. package/dist/apps/chat-ui/assets/dist-SVPsM5Oi.js +0 -13
  127. package/dist/apps/chat-ui/assets/dist-WDi-12_5.js +0 -9
  128. package/dist/apps/chat-ui/assets/dist-Zqt9kNG9.js +0 -1
  129. package/dist/apps/chat-ui/assets/dist-tGfufz3b.js +0 -1
  130. package/dist/apps/chat-ui/assets/dockerfile-CUaqzcqp.js +0 -1
  131. package/dist/apps/chat-ui/assets/dtd-VCA9yr61.js +0 -1
  132. package/dist/apps/chat-ui/assets/dylan-O-V5Dw5W.js +0 -1
  133. package/dist/apps/chat-ui/assets/ebnf-SPmdBkvT.js +0 -1
  134. package/dist/apps/chat-ui/assets/ecl-ChfCttfI.js +0 -1
  135. package/dist/apps/chat-ui/assets/eiffel-cB9EbjeN.js +0 -1
  136. package/dist/apps/chat-ui/assets/elm-BTiVflBU.js +0 -1
  137. package/dist/apps/chat-ui/assets/erlang-egf0TXFm.js +0 -1
  138. package/dist/apps/chat-ui/assets/factor-C2tAxNob.js +0 -1
  139. package/dist/apps/chat-ui/assets/fcl-BiCjh1tj.js +0 -1
  140. package/dist/apps/chat-ui/assets/forth-C4kDGW6u.js +0 -1
  141. package/dist/apps/chat-ui/assets/fortran-DzkLaPnd.js +0 -1
  142. package/dist/apps/chat-ui/assets/gas-DMOxskQF.js +0 -1
  143. package/dist/apps/chat-ui/assets/gherkin-BPxBpp-k.js +0 -1
  144. package/dist/apps/chat-ui/assets/groovy-CkEnc0ZY.js +0 -1
  145. package/dist/apps/chat-ui/assets/haskell-Dadpo9-w.js +0 -1
  146. package/dist/apps/chat-ui/assets/haxe-CDNZL9MW.js +0 -1
  147. package/dist/apps/chat-ui/assets/http-jy9Zxxt3.js +0 -1
  148. package/dist/apps/chat-ui/assets/idl-CGSB6iiy.js +0 -1
  149. package/dist/apps/chat-ui/assets/index-BUlHJWKP.js +0 -173
  150. package/dist/apps/chat-ui/assets/index-C0x9nEcf.css +0 -1
  151. package/dist/apps/chat-ui/assets/javascript-DSlzRUd8.js +0 -1
  152. package/dist/apps/chat-ui/assets/julia-DTiF9v6R.js +0 -1
  153. package/dist/apps/chat-ui/assets/livescript-Ci8Xxna6.js +0 -1
  154. package/dist/apps/chat-ui/assets/lua-eVxIrt9t.js +0 -1
  155. package/dist/apps/chat-ui/assets/mathematica-Da3grj36.js +0 -1
  156. package/dist/apps/chat-ui/assets/mbox-BWBMSafM.js +0 -1
  157. package/dist/apps/chat-ui/assets/mirc-CtHu9S1B.js +0 -1
  158. package/dist/apps/chat-ui/assets/mllike-wTFlPWXS.js +0 -1
  159. package/dist/apps/chat-ui/assets/modelica-cKbQ0UXu.js +0 -1
  160. package/dist/apps/chat-ui/assets/mscgen-C5pXQCMK.js +0 -1
  161. package/dist/apps/chat-ui/assets/mumps-CKBHkOQq.js +0 -1
  162. package/dist/apps/chat-ui/assets/nginx-B00AiQel.js +0 -1
  163. package/dist/apps/chat-ui/assets/nsis-SMDwKltR.js +0 -1
  164. package/dist/apps/chat-ui/assets/ntriples-B_36EBV0.js +0 -1
  165. package/dist/apps/chat-ui/assets/octave-BXPjzAif.js +0 -1
  166. package/dist/apps/chat-ui/assets/oz-Dedpat1M.js +0 -1
  167. package/dist/apps/chat-ui/assets/pascal-CMcUg72K.js +0 -1
  168. package/dist/apps/chat-ui/assets/perl-DoVTbnzt.js +0 -1
  169. package/dist/apps/chat-ui/assets/pig-CULXT1YV.js +0 -1
  170. package/dist/apps/chat-ui/assets/powershell-Cv5Uhf6b.js +0 -1
  171. package/dist/apps/chat-ui/assets/properties-CQ1C2P-M.js +0 -1
  172. package/dist/apps/chat-ui/assets/protobuf-SRlvzrl6.js +0 -1
  173. package/dist/apps/chat-ui/assets/pug-Bo3wfL-f.js +0 -1
  174. package/dist/apps/chat-ui/assets/puppet-ClSqCGj6.js +0 -1
  175. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-144x144.png +0 -0
  176. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-192x192.png +0 -0
  177. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-48x48.png +0 -0
  178. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-512x512.png +0 -0
  179. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-72x72.png +0 -0
  180. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-96x96.png +0 -0
  181. package/dist/apps/chat-ui/assets/pwa-images/ios/100.png +0 -0
  182. package/dist/apps/chat-ui/assets/pwa-images/ios/1024.png +0 -0
  183. package/dist/apps/chat-ui/assets/pwa-images/ios/114.png +0 -0
  184. package/dist/apps/chat-ui/assets/pwa-images/ios/120.png +0 -0
  185. package/dist/apps/chat-ui/assets/pwa-images/ios/128.png +0 -0
  186. package/dist/apps/chat-ui/assets/pwa-images/ios/144.png +0 -0
  187. package/dist/apps/chat-ui/assets/pwa-images/ios/152.png +0 -0
  188. package/dist/apps/chat-ui/assets/pwa-images/ios/16.png +0 -0
  189. package/dist/apps/chat-ui/assets/pwa-images/ios/167.png +0 -0
  190. package/dist/apps/chat-ui/assets/pwa-images/ios/180.png +0 -0
  191. package/dist/apps/chat-ui/assets/pwa-images/ios/192.png +0 -0
  192. package/dist/apps/chat-ui/assets/pwa-images/ios/20.png +0 -0
  193. package/dist/apps/chat-ui/assets/pwa-images/ios/256.png +0 -0
  194. package/dist/apps/chat-ui/assets/pwa-images/ios/29.png +0 -0
  195. package/dist/apps/chat-ui/assets/pwa-images/ios/32.png +0 -0
  196. package/dist/apps/chat-ui/assets/pwa-images/ios/40.png +0 -0
  197. package/dist/apps/chat-ui/assets/pwa-images/ios/50.png +0 -0
  198. package/dist/apps/chat-ui/assets/pwa-images/ios/512.png +0 -0
  199. package/dist/apps/chat-ui/assets/pwa-images/ios/57.png +0 -0
  200. package/dist/apps/chat-ui/assets/pwa-images/ios/58.png +0 -0
  201. package/dist/apps/chat-ui/assets/pwa-images/ios/60.png +0 -0
  202. package/dist/apps/chat-ui/assets/pwa-images/ios/64.png +0 -0
  203. package/dist/apps/chat-ui/assets/pwa-images/ios/72.png +0 -0
  204. package/dist/apps/chat-ui/assets/pwa-images/ios/76.png +0 -0
  205. package/dist/apps/chat-ui/assets/pwa-images/ios/80.png +0 -0
  206. package/dist/apps/chat-ui/assets/pwa-images/ios/87.png +0 -0
  207. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-100.png +0 -0
  208. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-125.png +0 -0
  209. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-150.png +0 -0
  210. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-200.png +0 -0
  211. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-400.png +0 -0
  212. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-100.png +0 -0
  213. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-125.png +0 -0
  214. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-150.png +0 -0
  215. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-200.png +0 -0
  216. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-400.png +0 -0
  217. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-100.png +0 -0
  218. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-125.png +0 -0
  219. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-150.png +0 -0
  220. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-200.png +0 -0
  221. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-400.png +0 -0
  222. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-100.png +0 -0
  223. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-125.png +0 -0
  224. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-150.png +0 -0
  225. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-200.png +0 -0
  226. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-400.png +0 -0
  227. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-16.png +0 -0
  228. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-20.png +0 -0
  229. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-24.png +0 -0
  230. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-256.png +0 -0
  231. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-30.png +0 -0
  232. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-32.png +0 -0
  233. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-36.png +0 -0
  234. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-40.png +0 -0
  235. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-44.png +0 -0
  236. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-48.png +0 -0
  237. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-60.png +0 -0
  238. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-64.png +0 -0
  239. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-72.png +0 -0
  240. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-80.png +0 -0
  241. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-96.png +0 -0
  242. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-16.png +0 -0
  243. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-20.png +0 -0
  244. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-24.png +0 -0
  245. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-256.png +0 -0
  246. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-30.png +0 -0
  247. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-32.png +0 -0
  248. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-36.png +0 -0
  249. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-40.png +0 -0
  250. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-44.png +0 -0
  251. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-48.png +0 -0
  252. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-60.png +0 -0
  253. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-64.png +0 -0
  254. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-72.png +0 -0
  255. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-80.png +0 -0
  256. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-96.png +0 -0
  257. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-100.png +0 -0
  258. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-125.png +0 -0
  259. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-150.png +0 -0
  260. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-200.png +0 -0
  261. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-400.png +0 -0
  262. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-16.png +0 -0
  263. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-20.png +0 -0
  264. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-24.png +0 -0
  265. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-256.png +0 -0
  266. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-30.png +0 -0
  267. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-32.png +0 -0
  268. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-36.png +0 -0
  269. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-40.png +0 -0
  270. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-44.png +0 -0
  271. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-48.png +0 -0
  272. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-60.png +0 -0
  273. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-64.png +0 -0
  274. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-72.png +0 -0
  275. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-80.png +0 -0
  276. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-96.png +0 -0
  277. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-100.png +0 -0
  278. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-125.png +0 -0
  279. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-150.png +0 -0
  280. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-200.png +0 -0
  281. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-400.png +0 -0
  282. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-100.png +0 -0
  283. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-125.png +0 -0
  284. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-150.png +0 -0
  285. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-200.png +0 -0
  286. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-400.png +0 -0
  287. package/dist/apps/chat-ui/assets/python-C2_X1GpX.js +0 -1
  288. package/dist/apps/chat-ui/assets/q-B_6Gdyzl.js +0 -1
  289. package/dist/apps/chat-ui/assets/r-BD07NGED.js +0 -1
  290. package/dist/apps/chat-ui/assets/rolldown-runtime-S-ySWqyJ.js +0 -1
  291. package/dist/apps/chat-ui/assets/rpm-CRu5Z2Jl.js +0 -1
  292. package/dist/apps/chat-ui/assets/ruby-dZPnOz8h.js +0 -1
  293. package/dist/apps/chat-ui/assets/sas-S2t8_sDI.js +0 -1
  294. package/dist/apps/chat-ui/assets/scheme-WcyFWLW2.js +0 -1
  295. package/dist/apps/chat-ui/assets/shell-DUelnYSh.js +0 -1
  296. package/dist/apps/chat-ui/assets/sieve-jDjlVhNh.js +0 -1
  297. package/dist/apps/chat-ui/assets/simple-mode-CL04yRVp.js +0 -1
  298. package/dist/apps/chat-ui/assets/smalltalk-ddWDYy10.js +0 -1
  299. package/dist/apps/chat-ui/assets/solr-C7rQhLuW.js +0 -1
  300. package/dist/apps/chat-ui/assets/sparql--fPCCgVd.js +0 -1
  301. package/dist/apps/chat-ui/assets/spreadsheet-DjthqD5G.js +0 -1
  302. package/dist/apps/chat-ui/assets/sql-D_dieYbr.js +0 -1
  303. package/dist/apps/chat-ui/assets/stex-rHcFYcA0.js +0 -1
  304. package/dist/apps/chat-ui/assets/stylus-DxF70RNr.js +0 -1
  305. package/dist/apps/chat-ui/assets/swift-T0hDoOb-.js +0 -1
  306. package/dist/apps/chat-ui/assets/tcl-Dlzy1mPk.js +0 -1
  307. package/dist/apps/chat-ui/assets/textile-Dy5rFZe5.js +0 -1
  308. package/dist/apps/chat-ui/assets/tiddlywiki-DQP1OymS.js +0 -1
  309. package/dist/apps/chat-ui/assets/tiki-0vOj3DB2.js +0 -1
  310. package/dist/apps/chat-ui/assets/toml-DEltN0lI.js +0 -1
  311. package/dist/apps/chat-ui/assets/troff-CRbBpEqY.js +0 -1
  312. package/dist/apps/chat-ui/assets/ttcn-M5q1nLKg.js +0 -1
  313. package/dist/apps/chat-ui/assets/ttcn-cfg-Rmw9NWq9.js +0 -1
  314. package/dist/apps/chat-ui/assets/turtle-BCDWhJK0.js +0 -1
  315. package/dist/apps/chat-ui/assets/vb-QQ7LGlOz.js +0 -1
  316. package/dist/apps/chat-ui/assets/vbscript-BiSEdUzz.js +0 -1
  317. package/dist/apps/chat-ui/assets/velocity-CzMg5_6w.js +0 -1
  318. package/dist/apps/chat-ui/assets/verilog-BJOO83gk.js +0 -1
  319. package/dist/apps/chat-ui/assets/vhdl-ed4zAZAA.js +0 -1
  320. package/dist/apps/chat-ui/assets/webidl-Ddy6hbV6.js +0 -1
  321. package/dist/apps/chat-ui/assets/xquery-Bw1zwhh6.js +0 -1
  322. package/dist/apps/chat-ui/assets/yacas-DZdTXy3s.js +0 -1
  323. package/dist/apps/chat-ui/assets/z80-DMG02_YV.js +0 -1
  324. package/dist/apps/chat-ui/index.html +0 -20
  325. package/dist/apps/chat-ui/manifest.webmanifest +0 -25
  326. package/dist/apps/chat-ui/sw.js +0 -47
  327. package/dist/apps/chat-vscode-web/assets/index-B5QK07zO.css +0 -2
  328. package/dist/apps/chat-vscode-web/assets/index-BAMxIaI_.js +0 -41
  329. package/dist/apps/chat-vscode-web/index.html +0 -14
  330. package/dist/apps/cli-ui/InkSessionApp.js +0 -1218
  331. package/dist/apps/cli-ui/InkTerminalLine.js +0 -53
  332. package/dist/apps/cli-ui/InkTerminalRow.js +0 -304
  333. package/dist/apps/cli-ui/InkTerminalView.js +0 -25
  334. package/dist/apps/cli-ui/cliSessionsCommand.js +0 -232
  335. package/dist/apps/cli-ui/index.js +0 -8
  336. package/dist/apps/cli-ui/inkColors.js +0 -67
  337. package/dist/apps/cli-ui/inkJson.js +0 -244
  338. package/dist/apps/cli-ui/inkMarkdown.js +0 -127
  339. package/dist/apps/cli-ui/inkSyntaxHighlighter.js +0 -166
  340. package/dist/apps/context-files-ui/assets/apl-14BqhLYK.js +0 -1
  341. package/dist/apps/context-files-ui/assets/asciiarmor-WLvjqI7d.js +0 -1
  342. package/dist/apps/context-files-ui/assets/asn1-Bg4FbdCg.js +0 -1
  343. package/dist/apps/context-files-ui/assets/asterisk-B2MO-X4d.js +0 -1
  344. package/dist/apps/context-files-ui/assets/brainfuck-CV9kufud.js +0 -1
  345. package/dist/apps/context-files-ui/assets/clike-CjmcUpt6.js +0 -1
  346. package/dist/apps/context-files-ui/assets/clojure-De3QGfx6.js +0 -1
  347. package/dist/apps/context-files-ui/assets/cmake-i2VDNaRq.js +0 -1
  348. package/dist/apps/context-files-ui/assets/cobol-BwO6DF08.js +0 -1
  349. package/dist/apps/context-files-ui/assets/coffeescript-BtivDvRz.js +0 -1
  350. package/dist/apps/context-files-ui/assets/commonlisp-DFkEQdLP.js +0 -1
  351. package/dist/apps/context-files-ui/assets/crystal-CU0NkcVL.js +0 -1
  352. package/dist/apps/context-files-ui/assets/css-CbMZAQ1W.js +0 -1
  353. package/dist/apps/context-files-ui/assets/cypher-Dke5QOzv.js +0 -1
  354. package/dist/apps/context-files-ui/assets/d-TPqSVaHM.js +0 -1
  355. package/dist/apps/context-files-ui/assets/diff-B365LSoZ.js +0 -1
  356. package/dist/apps/context-files-ui/assets/dist-B5PTVnox.js +0 -1
  357. package/dist/apps/context-files-ui/assets/dist-B5ZAfwf5.js +0 -1
  358. package/dist/apps/context-files-ui/assets/dist-BOiGdrG-.js +0 -1
  359. package/dist/apps/context-files-ui/assets/dist-BkUONE3N.js +0 -1
  360. package/dist/apps/context-files-ui/assets/dist-D1KyNDg5.js +0 -13
  361. package/dist/apps/context-files-ui/assets/dist-DK01b7x4.js +0 -1
  362. package/dist/apps/context-files-ui/assets/dist-DKoyMSNr.js +0 -1
  363. package/dist/apps/context-files-ui/assets/dist-DLMjd26T.js +0 -1
  364. package/dist/apps/context-files-ui/assets/dist-DPG9jOQ-.js +0 -1
  365. package/dist/apps/context-files-ui/assets/dist-DotDq_kD.js +0 -1
  366. package/dist/apps/context-files-ui/assets/dist-Dp5AH00p.js +0 -1
  367. package/dist/apps/context-files-ui/assets/dist-DqYw0LH7.js +0 -2
  368. package/dist/apps/context-files-ui/assets/dist-QQuDy4KA.js +0 -1
  369. package/dist/apps/context-files-ui/assets/dist-TF5iO5ML.js +0 -9
  370. package/dist/apps/context-files-ui/assets/dist-TbjAhles.js +0 -1
  371. package/dist/apps/context-files-ui/assets/dist-ZsBbt0uY.js +0 -1
  372. package/dist/apps/context-files-ui/assets/dist-kmsvtHkH.js +0 -1
  373. package/dist/apps/context-files-ui/assets/dist-vnd7PMu3.js +0 -11
  374. package/dist/apps/context-files-ui/assets/dockerfile-CJb2sekW.js +0 -1
  375. package/dist/apps/context-files-ui/assets/dtd-CBMymJ7O.js +0 -1
  376. package/dist/apps/context-files-ui/assets/dylan-08Azy1NK.js +0 -1
  377. package/dist/apps/context-files-ui/assets/ebnf-Dkum_1J8.js +0 -1
  378. package/dist/apps/context-files-ui/assets/ecl-dhxjHL8y.js +0 -1
  379. package/dist/apps/context-files-ui/assets/eiffel-C446m6dI.js +0 -1
  380. package/dist/apps/context-files-ui/assets/elm-po1E9de0.js +0 -1
  381. package/dist/apps/context-files-ui/assets/erlang-BD5LkVkR.js +0 -1
  382. package/dist/apps/context-files-ui/assets/factor-B2EMQZkP.js +0 -1
  383. package/dist/apps/context-files-ui/assets/fcl-DkEOamHd.js +0 -1
  384. package/dist/apps/context-files-ui/assets/forth-dCg2_HVB.js +0 -1
  385. package/dist/apps/context-files-ui/assets/fortran-3ZpXLFh1.js +0 -1
  386. package/dist/apps/context-files-ui/assets/gas-DMmxLZRI.js +0 -1
  387. package/dist/apps/context-files-ui/assets/gherkin-DUSFg2R6.js +0 -1
  388. package/dist/apps/context-files-ui/assets/groovy-Cmduloe1.js +0 -1
  389. package/dist/apps/context-files-ui/assets/haskell-Cyr255R9.js +0 -1
  390. package/dist/apps/context-files-ui/assets/haxe-BJVKtprM.js +0 -1
  391. package/dist/apps/context-files-ui/assets/http-DszHFpc-.js +0 -1
  392. package/dist/apps/context-files-ui/assets/idl-Cati9Nrv.js +0 -1
  393. package/dist/apps/context-files-ui/assets/index-B92tL3Pp.css +0 -1
  394. package/dist/apps/context-files-ui/assets/index-BhAWD3dv.js +0 -202
  395. package/dist/apps/context-files-ui/assets/javascript-C5pDVaoP.js +0 -1
  396. package/dist/apps/context-files-ui/assets/julia-DlqY1cTU.js +0 -1
  397. package/dist/apps/context-files-ui/assets/livescript-C6p8-2W1.js +0 -1
  398. package/dist/apps/context-files-ui/assets/lua-BxuTHaF7.js +0 -1
  399. package/dist/apps/context-files-ui/assets/mathematica-nDHZUMJT.js +0 -1
  400. package/dist/apps/context-files-ui/assets/mbox-DAaR0Hcz.js +0 -1
  401. package/dist/apps/context-files-ui/assets/mirc-CCA0FRfl.js +0 -1
  402. package/dist/apps/context-files-ui/assets/mllike-Cw3Iccsb.js +0 -1
  403. package/dist/apps/context-files-ui/assets/modelica-Czx80fNR.js +0 -1
  404. package/dist/apps/context-files-ui/assets/mscgen-BmfuTbzG.js +0 -1
  405. package/dist/apps/context-files-ui/assets/mumps-Ds_ZaumL.js +0 -1
  406. package/dist/apps/context-files-ui/assets/nginx-D9M2PQ4U.js +0 -1
  407. package/dist/apps/context-files-ui/assets/nsis-DOo3SJmd.js +0 -1
  408. package/dist/apps/context-files-ui/assets/ntriples-DLHGTvHs.js +0 -1
  409. package/dist/apps/context-files-ui/assets/octave-8jj96JiC.js +0 -1
  410. package/dist/apps/context-files-ui/assets/oz-BmMq7iC4.js +0 -1
  411. package/dist/apps/context-files-ui/assets/pascal-BgMr6XpT.js +0 -1
  412. package/dist/apps/context-files-ui/assets/perl-D6YJObi_.js +0 -1
  413. package/dist/apps/context-files-ui/assets/pig-nx7uchs8.js +0 -1
  414. package/dist/apps/context-files-ui/assets/powershell-B4IPkVxR.js +0 -1
  415. package/dist/apps/context-files-ui/assets/properties-CoavQdLC.js +0 -1
  416. package/dist/apps/context-files-ui/assets/protobuf-D5EWhcmc.js +0 -1
  417. package/dist/apps/context-files-ui/assets/pug-QU72BPAa.js +0 -1
  418. package/dist/apps/context-files-ui/assets/puppet-B_0GFuyD.js +0 -1
  419. package/dist/apps/context-files-ui/assets/python-Cs7sNzy_.js +0 -1
  420. package/dist/apps/context-files-ui/assets/q-BIB9pPtI.js +0 -1
  421. package/dist/apps/context-files-ui/assets/r-CN5s4f3o.js +0 -1
  422. package/dist/apps/context-files-ui/assets/rpm-Ct_Ck8mQ.js +0 -1
  423. package/dist/apps/context-files-ui/assets/ruby-BVPradRk.js +0 -1
  424. package/dist/apps/context-files-ui/assets/sas-DN4j74IF.js +0 -1
  425. package/dist/apps/context-files-ui/assets/scheme-CvNgHAnh.js +0 -1
  426. package/dist/apps/context-files-ui/assets/shell-BjiMLAaM.js +0 -1
  427. package/dist/apps/context-files-ui/assets/sieve-C2U1O5Z4.js +0 -1
  428. package/dist/apps/context-files-ui/assets/simple-mode-DnMbQuKW.js +0 -1
  429. package/dist/apps/context-files-ui/assets/smalltalk-DkYwYufV.js +0 -1
  430. package/dist/apps/context-files-ui/assets/solr-BopnSD-v.js +0 -1
  431. package/dist/apps/context-files-ui/assets/sparql-Cpg3YQfd.js +0 -1
  432. package/dist/apps/context-files-ui/assets/spreadsheet-kRxtVt9J.js +0 -1
  433. package/dist/apps/context-files-ui/assets/sql-DYI2GwJR.js +0 -1
  434. package/dist/apps/context-files-ui/assets/stex-BCRT8IJ3.js +0 -1
  435. package/dist/apps/context-files-ui/assets/stylus-CARoeVE9.js +0 -1
  436. package/dist/apps/context-files-ui/assets/swift-DKNaLAK6.js +0 -1
  437. package/dist/apps/context-files-ui/assets/tcl-CQyXkgMH.js +0 -1
  438. package/dist/apps/context-files-ui/assets/textile-Yg_UWn-t.js +0 -1
  439. package/dist/apps/context-files-ui/assets/tiddlywiki-dqVbkfX4.js +0 -1
  440. package/dist/apps/context-files-ui/assets/tiki-CC_ic8g0.js +0 -1
  441. package/dist/apps/context-files-ui/assets/toml-B7gGzVkJ.js +0 -1
  442. package/dist/apps/context-files-ui/assets/troff-Bq3z6oAu.js +0 -1
  443. package/dist/apps/context-files-ui/assets/ttcn-GvRgs2AT.js +0 -1
  444. package/dist/apps/context-files-ui/assets/ttcn-cfg-CGCXz7Vo.js +0 -1
  445. package/dist/apps/context-files-ui/assets/turtle-CwIpz2yy.js +0 -1
  446. package/dist/apps/context-files-ui/assets/vb-BmcHUM2C.js +0 -1
  447. package/dist/apps/context-files-ui/assets/vbscript-Cs9dylre.js +0 -1
  448. package/dist/apps/context-files-ui/assets/velocity-CBWU0VCy.js +0 -1
  449. package/dist/apps/context-files-ui/assets/verilog-DVCHmufx.js +0 -1
  450. package/dist/apps/context-files-ui/assets/vhdl-BGDk4f1d.js +0 -1
  451. package/dist/apps/context-files-ui/assets/webidl-egXQEWlC.js +0 -1
  452. package/dist/apps/context-files-ui/assets/xquery-5f0hn7cg.js +0 -1
  453. package/dist/apps/context-files-ui/assets/yacas-DNs9XkmQ.js +0 -1
  454. package/dist/apps/context-files-ui/assets/z80-B7Dfb4UO.js +0 -1
  455. package/dist/apps/context-files-ui/index.html +0 -14
  456. package/dist/auth/better-auth.js +0 -130
  457. package/dist/auth/login-actions.js +0 -251
  458. package/dist/auth/openai-codex-usage.js +0 -147
  459. package/dist/auth/types.js +0 -14
  460. package/dist/bin/pibo.js +0 -3
  461. package/dist/bin/rg.js +0 -15
  462. package/dist/channels/types.js +0 -1
  463. package/dist/cli-errors.js +0 -18
  464. package/dist/cli-session/fakeSessionSource.js +0 -804
  465. package/dist/cli-session/index.js +0 -3
  466. package/dist/cli-session/localSessionSource.js +0 -1144
  467. package/dist/cli-session/sessionSource.js +0 -13
  468. package/dist/cli.js +0 -491
  469. package/dist/compute/cli.js +0 -415
  470. package/dist/compute/docker.js +0 -835
  471. package/dist/compute/resource-health.js +0 -334
  472. package/dist/compute/resource-policy.js +0 -98
  473. package/dist/config/config.js +0 -180
  474. package/dist/core/base-prompt.js +0 -104
  475. package/dist/core/codex-compat.js +0 -44
  476. package/dist/core/compaction-prompt.js +0 -293
  477. package/dist/core/context-build.js +0 -711
  478. package/dist/core/context-guard.js +0 -293
  479. package/dist/core/events.js +0 -1
  480. package/dist/core/gateway-resource-guard.js +0 -215
  481. package/dist/core/model-defaults.js +0 -95
  482. package/dist/core/pibo-home.js +0 -8
  483. package/dist/core/profiles.js +0 -210
  484. package/dist/core/provider-recovery.js +0 -64
  485. package/dist/core/provider-telemetry.js +0 -353
  486. package/dist/core/routed-session.js +0 -1179
  487. package/dist/core/runtime-telemetry.js +0 -1059
  488. package/dist/core/runtime.js +0 -529
  489. package/dist/core/session-errors.js +0 -76
  490. package/dist/core/session-model.js +0 -39
  491. package/dist/core/session-router.js +0 -850
  492. package/dist/core/skill-expansion.js +0 -43
  493. package/dist/core/system-prompt-template.js +0 -56
  494. package/dist/core/telemetry-retention-settings.js +0 -34
  495. package/dist/core/telemetry-staleness.js +0 -128
  496. package/dist/core/test-output-compaction.js +0 -145
  497. package/dist/core/thinking.js +0 -9
  498. package/dist/core/user-settings.js +0 -84
  499. package/dist/core/workspace.js +0 -5
  500. package/dist/core/wsl.js +0 -100
  501. package/dist/cron/channel.js +0 -28
  502. package/dist/cron/cli.js +0 -230
  503. package/dist/cron/plugin.js +0 -11
  504. package/dist/cron/schedule.js +0 -214
  505. package/dist/cron/service.js +0 -177
  506. package/dist/cron/store.js +0 -349
  507. package/dist/cron/types.js +0 -1
  508. package/dist/data/cli.js +0 -184
  509. package/dist/data/event-log.js +0 -106
  510. package/dist/data/ingest-service.js +0 -389
  511. package/dist/data/message-store.js +0 -62
  512. package/dist/data/navigation-store.js +0 -75
  513. package/dist/data/observation-store.js +0 -46
  514. package/dist/data/payload-store.js +0 -153
  515. package/dist/data/pibo-store.js +0 -59
  516. package/dist/data/schema.js +0 -436
  517. package/dist/data/session-store.js +0 -63
  518. package/dist/data/sqlite-schema.js +0 -12
  519. package/dist/data/telemetry-preview.js +0 -65
  520. package/dist/data/telemetry-queries.js +0 -212
  521. package/dist/data/telemetry-retention.js +0 -50
  522. package/dist/data/telemetry-rows.js +0 -158
  523. package/dist/data/telemetry-writer.js +0 -114
  524. package/dist/data/telemetry.js +0 -471
  525. package/dist/debug/delta-compaction.js +0 -99
  526. package/dist/debug/detail-format.js +0 -86
  527. package/dist/debug/events.js +0 -212
  528. package/dist/debug/failures.js +0 -162
  529. package/dist/debug/index.js +0 -1296
  530. package/dist/debug/messages.js +0 -185
  531. package/dist/debug/next-commands.js +0 -6
  532. package/dist/debug/payloads.js +0 -123
  533. package/dist/debug/pty.js +0 -924
  534. package/dist/debug/session.js +0 -230
  535. package/dist/debug/sql.js +0 -238
  536. package/dist/debug/stores.js +0 -54
  537. package/dist/debug/summary.js +0 -72
  538. package/dist/debug/telemetry.js +0 -649
  539. package/dist/debug/tools.js +0 -168
  540. package/dist/debug/trace-render-check.js +0 -151
  541. package/dist/debug/trace.js +0 -370
  542. package/dist/debug/web-artifacts.js +0 -63
  543. package/dist/debug/web-options.js +0 -313
  544. package/dist/debug/web-render-analysis.js +0 -310
  545. package/dist/debug/web-snapshot-browser-scripts.js +0 -303
  546. package/dist/debug/web-streaming-benchmark-analysis.js +0 -605
  547. package/dist/debug/web-streaming-browser-library.js +0 -928
  548. package/dist/debug/web-streaming-browser-scripts.js +0 -242
  549. package/dist/debug/web-streaming-provider-telemetry.js +0 -194
  550. package/dist/debug/web-streaming-report.js +0 -493
  551. package/dist/debug/web-streaming-types.js +0 -1
  552. package/dist/debug/web.js +0 -574
  553. package/dist/gateway/backup.js +0 -83
  554. package/dist/gateway/cli.js +0 -632
  555. package/dist/gateway/client.js +0 -200
  556. package/dist/gateway/fallback.js +0 -155
  557. package/dist/gateway/pidfile.js +0 -130
  558. package/dist/gateway/protocol.js +0 -62
  559. package/dist/gateway/request.js +0 -155
  560. package/dist/gateway/server.js +0 -397
  561. package/dist/gateway/tool.js +0 -72
  562. package/dist/gateway/web.js +0 -224
  563. package/dist/index.js +0 -25
  564. package/dist/local/client.js +0 -77
  565. package/dist/local/extension.js +0 -551
  566. package/dist/local/tui.js +0 -25
  567. package/dist/mcp/agent-context.js +0 -127
  568. package/dist/mcp/client.js +0 -332
  569. package/dist/mcp/commands/call.js +0 -146
  570. package/dist/mcp/commands/grep.js +0 -145
  571. package/dist/mcp/commands/info.js +0 -83
  572. package/dist/mcp/commands/list.js +0 -94
  573. package/dist/mcp/config-command.js +0 -217
  574. package/dist/mcp/config.js +0 -473
  575. package/dist/mcp/daemon-client.js +0 -266
  576. package/dist/mcp/daemon.js +0 -327
  577. package/dist/mcp/errors.js +0 -287
  578. package/dist/mcp/index.js +0 -431
  579. package/dist/mcp/output.js +0 -226
  580. package/dist/mcp/python-runtime.js +0 -131
  581. package/dist/mcp/registry.js +0 -116
  582. package/dist/mcp/version.js +0 -5
  583. package/dist/pi-packages/cli.js +0 -92
  584. package/dist/pi-packages/installer.js +0 -70
  585. package/dist/pi-packages/metadata.js +0 -231
  586. package/dist/pi-packages/runtime.js +0 -61
  587. package/dist/pi-packages/store.js +0 -175
  588. package/dist/pi-packages/types.js +0 -1
  589. package/dist/plugins/better-auth.js +0 -11
  590. package/dist/plugins/builtin.js +0 -478
  591. package/dist/plugins/chat-custom-agents.js +0 -20
  592. package/dist/plugins/chat-user-skills.js +0 -41
  593. package/dist/plugins/chat-vscode-web.js +0 -28
  594. package/dist/plugins/chat-web.js +0 -11
  595. package/dist/plugins/codex-compat.js +0 -33
  596. package/dist/plugins/context-files-store.js +0 -354
  597. package/dist/plugins/context-files.js +0 -1081
  598. package/dist/plugins/dev-auth.js +0 -202
  599. package/dist/plugins/native-tooling.js +0 -15
  600. package/dist/plugins/registry.js +0 -436
  601. package/dist/plugins/types.js +0 -1
  602. package/dist/plugins/web-annotations.js +0 -27
  603. package/dist/plugins/web.js +0 -11
  604. package/dist/providers/glm.js +0 -59
  605. package/dist/providers/minimax.js +0 -70
  606. package/dist/providers/openai-compat.js +0 -48
  607. package/dist/providers/openai-gpt56.js +0 -153
  608. package/dist/ralph/channel.js +0 -8
  609. package/dist/ralph/cli.js +0 -197
  610. package/dist/ralph/plugin.js +0 -14
  611. package/dist/ralph/service.js +0 -317
  612. package/dist/ralph/stopping.js +0 -151
  613. package/dist/ralph/store.js +0 -450
  614. package/dist/ralph/templates.js +0 -200
  615. package/dist/ralph/types.js +0 -1
  616. package/dist/reliability/store.js +0 -775
  617. package/dist/resources/cli.js +0 -135
  618. package/dist/resources/lifecycle.js +0 -353
  619. package/dist/resources/reaper-state.js +0 -94
  620. package/dist/resources/reaper.js +0 -145
  621. package/dist/runs/registry.js +0 -360
  622. package/dist/runs/tools.js +0 -185
  623. package/dist/session-ui/commandCatalog.js +0 -193
  624. package/dist/session-ui/commandResults.js +0 -95
  625. package/dist/session-ui/delegation.js +0 -89
  626. package/dist/session-ui/index.js +0 -8
  627. package/dist/session-ui/roomSessionViewModel.js +0 -69
  628. package/dist/session-ui/sessionActivity.js +0 -30
  629. package/dist/session-ui/statusViewModel.js +0 -127
  630. package/dist/session-ui/terminalCards.js +0 -210
  631. package/dist/session-ui/terminalRows.js +0 -1163
  632. package/dist/session-ui/terminalValue.js +0 -45
  633. package/dist/sessions/pibo-data-store.js +0 -178
  634. package/dist/sessions/sqlite-store.js +0 -220
  635. package/dist/sessions/store.js +0 -132
  636. package/dist/sessions/workflow-session-kind.js +0 -20
  637. package/dist/setup/cli.js +0 -619
  638. package/dist/shared/trace-async-agent-runs.js +0 -127
  639. package/dist/shared/trace-engine.js +0 -97
  640. package/dist/shared/trace-event-projection.js +0 -789
  641. package/dist/shared/trace-live-reducer.js +0 -191
  642. package/dist/shared/trace-nodes.js +0 -88
  643. package/dist/shared/trace-order.js +0 -84
  644. package/dist/shared/trace-page-merge.js +0 -40
  645. package/dist/shared/trace-patch-nodes.js +0 -83
  646. package/dist/shared/trace-run-notifications.js +0 -69
  647. package/dist/shared/trace-subagent-links.js +0 -46
  648. package/dist/shared/trace-transcript.js +0 -371
  649. package/dist/shared/trace-types.js +0 -1
  650. package/dist/signals/aggregate.js +0 -65
  651. package/dist/signals/events.js +0 -1
  652. package/dist/signals/projector.js +0 -205
  653. package/dist/signals/registry.js +0 -554
  654. package/dist/signals/store.js +0 -1
  655. package/dist/signals/types.js +0 -1
  656. package/dist/skills/cli.js +0 -151
  657. package/dist/subagents/tool.js +0 -63
  658. package/dist/tools/agent-browser-leases.js +0 -219
  659. package/dist/tools/agent-browser-wrapper.js +0 -99
  660. package/dist/tools/browser-pool.js +0 -623
  661. package/dist/tools/browser-use-cdp.js +0 -259
  662. package/dist/tools/browser-use-leases.js +0 -516
  663. package/dist/tools/browser-use-wrapper.js +0 -781
  664. package/dist/tools/cdp-client.js +0 -189
  665. package/dist/tools/codex-compat.js +0 -85
  666. package/dist/tools/codex-image-generation.js +0 -272
  667. package/dist/tools/desktop-env.js +0 -99
  668. package/dist/tools/guides.js +0 -563
  669. package/dist/tools/index.js +0 -1020
  670. package/dist/tools/linux-virtual-display.js +0 -58
  671. package/dist/tools/npm-runtime.js +0 -136
  672. package/dist/tools/python-runtime.js +0 -183
  673. package/dist/tools/registry.js +0 -237
  674. package/dist/tools/runtime/index.js +0 -3
  675. package/dist/tools/runtime/node-backend.js +0 -225
  676. package/dist/tools/runtime/node-worker-source.js +0 -206
  677. package/dist/tools/runtime/python-backend.js +0 -227
  678. package/dist/tools/runtime/python-worker-source.js +0 -178
  679. package/dist/tools/runtime/registry.js +0 -255
  680. package/dist/tools/runtime/tool.js +0 -168
  681. package/dist/tools/runtime/types.js +0 -1
  682. package/dist/tools/web-search.js +0 -138
  683. package/dist/user-skills/installer.js +0 -214
  684. package/dist/user-skills/manager.js +0 -133
  685. package/dist/user-skills/store.js +0 -267
  686. package/dist/user-skills/types.js +0 -1
  687. package/dist/vscode/cli.js +0 -90
  688. package/dist/vscode/code-cli.js +0 -119
  689. package/dist/vscode/install.js +0 -177
  690. package/dist/vscode/status.js +0 -80
  691. package/dist/vscode/types.js +0 -14
  692. package/dist/vscode/uninstall.js +0 -49
  693. package/dist/vscode/vsix-fetcher.js +0 -131
  694. package/dist/web/auth.js +0 -14
  695. package/dist/web/channel.js +0 -288
  696. package/dist/web/http.js +0 -195
  697. package/dist/web/types.js +0 -1
  698. package/dist/web-annotations/api.js +0 -348
  699. package/dist/web-annotations/attachments.js +0 -201
  700. package/dist/web-annotations/cdp.js +0 -1107
  701. package/dist/web-annotations/index.js +0 -7
  702. package/dist/web-annotations/store.js +0 -407
  703. package/dist/web-annotations/tools.js +0 -350
  704. package/dist/web-annotations/types.js +0 -34
  705. package/dist/web-annotations/validation.js +0 -288
@@ -1,928 +0,0 @@
1
- export function browserStreamingBenchmarkLibrary() {
2
- return String.raw `
3
- const ASSISTANT_SELECTOR = '[data-pibo-component="MarkdownRendererHost"][data-pibo-markdown-kind="assistant-message"]';
4
- function nowIso() { return new Date().toISOString(); }
5
- function cloneDebugSnapshot(value) {
6
- if (!value || typeof value !== 'object') return undefined;
7
- try { return JSON.parse(JSON.stringify(value)); } catch { return undefined; }
8
- }
9
- function numericDelta(before, after, keys) {
10
- const delta = {};
11
- for (const key of keys) {
12
- const left = before && typeof before[key] === 'number' ? before[key] : 0;
13
- const right = after && typeof after[key] === 'number' ? after[key] : 0;
14
- delta[key] = right - left;
15
- }
16
- return delta;
17
- }
18
- function stats(values) {
19
- const nums = values.filter((value) => Number.isFinite(value)).slice().sort((a, b) => a - b);
20
- if (!nums.length) return { count: 0 };
21
- const pick = (q) => nums[Math.min(nums.length - 1, Math.max(0, Math.floor((nums.length - 1) * q)))];
22
- const avg = nums.reduce((sum, value) => sum + value, 0) / nums.length;
23
- return {
24
- count: nums.length,
25
- min: Math.round(nums[0] * 1000) / 1000,
26
- p50: Math.round(pick(0.50) * 1000) / 1000,
27
- p90: Math.round(pick(0.90) * 1000) / 1000,
28
- p99: Math.round(pick(0.99) * 1000) / 1000,
29
- max: Math.round(nums[nums.length - 1] * 1000) / 1000,
30
- avg: Math.round(avg * 1000) / 1000,
31
- };
32
- }
33
- function fetchWithTimeout(url, init, timeoutMs) {
34
- if (typeof AbortController === 'undefined') return fetch(url, init);
35
- const controller = new AbortController();
36
- const timer = setTimeout(() => controller.abort(), timeoutMs);
37
- return fetch(url, { ...init, signal: controller.signal }).finally(() => clearTimeout(timer));
38
- }
39
- function installOverlayDropSimulation(enabled) {
40
- if (!enabled) {
41
- delete window.__piboStreamingBenchmarkShouldDropOverlayEvent;
42
- delete window.__piboStreamingBenchmarkOverlayDrop;
43
- return undefined;
44
- }
45
- const state = {
46
- requested: true,
47
- installed: true,
48
- dropTypes: ['TEXT_MESSAGE_CONTENT', 'REASONING_MESSAGE_CONTENT'],
49
- droppedCount: 0,
50
- passedCount: 0,
51
- };
52
- window.__piboStreamingBenchmarkOverlayDrop = state;
53
- window.__piboStreamingBenchmarkShouldDropOverlayEvent = (event) => {
54
- const type = event && typeof event.type === 'string' ? event.type : '';
55
- if (state.dropTypes.includes(type)) {
56
- state.droppedCount += 1;
57
- state.lastDroppedType = type;
58
- return true;
59
- }
60
- state.passedCount += 1;
61
- return false;
62
- };
63
- return state;
64
- }
65
- function numberArray(value) {
66
- return Array.isArray(value) ? value.filter((item) => typeof item === 'number' && Number.isFinite(item)) : [];
67
- }
68
- function scheduleGaps(scheduleMs) {
69
- const gaps = [];
70
- let previous = 0;
71
- for (const delay of scheduleMs) {
72
- gaps.push(delay - previous);
73
- previous = delay;
74
- }
75
- return gaps;
76
- }
77
- function createSseProbe(piboSessionId, startedAt) {
78
- const result = {
79
- requested: true,
80
- installed: false,
81
- url: '/api/chat/events?piboSessionId=' + encodeURIComponent(piboSessionId) + '&mode=live&probe=streaming-benchmark-' + Date.now(),
82
- headers: {},
83
- aborted: false,
84
- errors: [],
85
- chunkCount: 0,
86
- chunkBytes: { count: 0 },
87
- chunkGapsMs: { count: 0 },
88
- textEventsPerChunk: { count: 0 },
89
- eventCount: 0,
90
- textEventCount: 0,
91
- reasoningEventCount: 0,
92
- textDeltaBytes: { count: 0 },
93
- textEventGapsMs: { count: 0 },
94
- idCount: 0,
95
- transientIdCount: 0,
96
- durableIdCount: 0,
97
- otherIdCount: 0,
98
- };
99
- const chunkBytes = [];
100
- const chunkGaps = [];
101
- const textEventsPerChunk = [];
102
- const textDeltaBytes = [];
103
- const textEventGaps = [];
104
- const ids = [];
105
- let lastChunkAt;
106
- let lastTextAt;
107
- let buffer = '';
108
- let stopped = false;
109
- let finished = false;
110
- const controller = typeof AbortController === 'undefined' ? undefined : new AbortController();
111
- const decoder = typeof TextDecoder === 'undefined' ? undefined : new TextDecoder();
112
- const encoder = typeof TextEncoder === 'undefined' ? undefined : new TextEncoder();
113
- const byteLength = (text) => encoder ? encoder.encode(text).length : String(text || '').length;
114
- const finalize = () => {
115
- result.chunkCount = chunkBytes.length;
116
- result.chunkBytes = stats(chunkBytes);
117
- result.chunkGapsMs = stats(chunkGaps);
118
- result.textEventsPerChunk = stats(textEventsPerChunk);
119
- result.textDeltaBytes = stats(textDeltaBytes);
120
- result.textEventGapsMs = stats(textEventGaps);
121
- result.idCount = ids.length;
122
- result.transientIdCount = ids.filter((id) => /^live:\d+$/.test(id)).length;
123
- result.durableIdCount = ids.filter((id) => /^\d+:\d+$/.test(id)).length;
124
- result.otherIdCount = ids.filter((id) => !/^live:\d+$/.test(id) && !/^\d+:\d+$/.test(id)).length;
125
- result.lastEventId = ids.at(-1);
126
- return result;
127
- };
128
- const elapsed = (t) => Math.round((t - startedAt) * 1000) / 1000;
129
- const consumeBlock = (block, t) => {
130
- if (!block.trim()) return 0;
131
- let eventName = '';
132
- let id = '';
133
- const data = [];
134
- for (const line of block.split(/\r?\n/)) {
135
- if (line.startsWith('event:')) eventName = line.slice(6).trim();
136
- else if (line.startsWith('id:')) id = line.slice(3).trim();
137
- else if (line.startsWith('data:')) data.push(line.slice(5).replace(/^ /, ''));
138
- }
139
- if (id) ids.push(id);
140
- if (eventName && eventName !== 'pibo') return 0;
141
- result.eventCount += 1;
142
- result.firstEventMs ??= elapsed(t);
143
- let payload;
144
- try { payload = data.length ? JSON.parse(data.join('\n')) : undefined; } catch (error) { result.errors.push('parse: ' + String(error && error.message ? error.message : error)); }
145
- if (!payload || typeof payload.type !== 'string') return 0;
146
- if (payload.type === 'TEXT_MESSAGE_CONTENT') {
147
- result.textEventCount += 1;
148
- result.firstTextEventMs ??= elapsed(t);
149
- const delta = typeof payload.delta === 'string' ? payload.delta : '';
150
- textDeltaBytes.push(byteLength(delta));
151
- if (lastTextAt !== undefined) textEventGaps.push(t - lastTextAt);
152
- lastTextAt = t;
153
- return 1;
154
- }
155
- if (payload.type === 'REASONING_MESSAGE_CONTENT') {
156
- result.reasoningEventCount += 1;
157
- result.firstReasoningEventMs ??= elapsed(t);
158
- }
159
- return 0;
160
- };
161
- if (typeof fetch !== 'function' || !decoder) {
162
- result.errors.push('fetch streaming unavailable');
163
- return { result: finalize(), stop: async () => finalize() };
164
- }
165
- const done = (async () => {
166
- try {
167
- const response = await fetch(result.url, { headers: { accept: 'text/event-stream' }, signal: controller && controller.signal });
168
- result.status = response.status;
169
- response.headers.forEach((value, key) => { result.headers[key] = value; });
170
- if (!response.body || typeof response.body.getReader !== 'function') throw new Error('ReadableStream unavailable');
171
- result.installed = true;
172
- const reader = response.body.getReader();
173
- while (true) {
174
- const next = await reader.read();
175
- if (next.done) break;
176
- const t = performance.now();
177
- result.firstChunkMs ??= elapsed(t);
178
- if (lastChunkAt !== undefined) chunkGaps.push(t - lastChunkAt);
179
- lastChunkAt = t;
180
- const value = next.value || new Uint8Array();
181
- chunkBytes.push(value.byteLength || value.length || 0);
182
- buffer += decoder.decode(value, { stream: true });
183
- let chunkTextEvents = 0;
184
- while (true) {
185
- const index = buffer.search(/\r?\n\r?\n/);
186
- if (index < 0) break;
187
- const separatorLength = buffer[index] === '\r' ? 4 : 2;
188
- const block = buffer.slice(0, index);
189
- buffer = buffer.slice(index + separatorLength);
190
- chunkTextEvents += consumeBlock(block, t);
191
- }
192
- textEventsPerChunk.push(chunkTextEvents);
193
- }
194
- buffer += decoder.decode();
195
- if (buffer.trim()) consumeBlock(buffer, performance.now());
196
- } catch (error) {
197
- if (stopped || (error && error.name === 'AbortError')) result.aborted = true;
198
- else result.errors.push(String(error && error.message ? error.message : error));
199
- } finally {
200
- finished = true;
201
- finalize();
202
- }
203
- })();
204
- return {
205
- result,
206
- stop: async () => {
207
- stopped = true;
208
- if (controller) controller.abort();
209
- await Promise.race([done.catch(() => {}), new Promise((resolve) => setTimeout(resolve, 2500))]);
210
- if (!finished) {
211
- result.aborted = true;
212
- result.errors.push('stop timeout after abort');
213
- }
214
- return finalize();
215
- },
216
- };
217
- }
218
- async function waitForSseProbeReady(probe, timeoutMs) {
219
- const started = performance.now();
220
- while (performance.now() - started < timeoutMs) {
221
- if (!probe || probe.installed || probe.status || (probe.errors && probe.errors.length)) return;
222
- await new Promise((resolve) => setTimeout(resolve, 25));
223
- }
224
- }
225
- function createTraceProbe(piboSessionId, startedAt, intervalMs) {
226
- const result = {
227
- requested: true,
228
- installed: true,
229
- piboSessionId,
230
- intervalMs,
231
- sampleCount: 0,
232
- fetchCount: 0,
233
- failedFetchCount: 0,
234
- liveVersionCount: 0,
235
- maxAssistantOutputLength: 0,
236
- samples: [],
237
- };
238
- let sampling = false;
239
- const sample = async () => {
240
- if (sampling) return;
241
- sampling = true;
242
- try {
243
- const t = Math.round(performance.now() - startedAt);
244
- const response = await fetchWithTimeout('/api/chat/trace?piboSessionId=' + encodeURIComponent(piboSessionId) + '&includeRawEvents=true&rawEventsLimit=80', {}, 2500);
245
- if (!response.ok) throw new Error(response.status + ' ' + response.statusText);
246
- const trace = await response.json();
247
- result.fetchCount += 1;
248
- const version = typeof trace.version === 'string' ? trace.version : undefined;
249
- const rawEvents = Array.isArray(trace.rawEvents) ? trace.rawEvents : [];
250
- const assistantOutputLength = maxTraceAssistantOutputLength(trace);
251
- const liveVersion = Boolean(version && version.includes(':live:'));
252
- const sampleResult = {
253
- t,
254
- version,
255
- eventCount: typeof trace.eventCount === 'number' ? trace.eventCount : undefined,
256
- rawEventCount: rawEvents.length,
257
- assistantOutputLength,
258
- liveVersion,
259
- rawEventTypes: countRawTraceEventTypes(rawEvents),
260
- };
261
- result.samples.push(sampleResult);
262
- if (result.samples.length > 80) result.samples.shift();
263
- result.sampleCount = result.samples.length;
264
- result.maxAssistantOutputLength = Math.max(result.maxAssistantOutputLength, assistantOutputLength);
265
- result.finalAssistantOutputLength = assistantOutputLength;
266
- if (typeof sampleResult.eventCount === 'number') {
267
- result.durableEventCountStart ??= sampleResult.eventCount;
268
- result.durableEventCountEnd = sampleResult.eventCount;
269
- }
270
- if (liveVersion) {
271
- result.liveVersionCount += 1;
272
- result.firstLiveVersionMs ??= t;
273
- }
274
- } catch {
275
- result.failedFetchCount += 1;
276
- } finally {
277
- sampling = false;
278
- }
279
- };
280
- const timer = setInterval(() => { sample().catch(() => {}); }, intervalMs);
281
- return { result, sample, stop: () => clearInterval(timer) };
282
- }
283
- function countRawTraceEventTypes(rawEvents) {
284
- const counts = {};
285
- for (const event of rawEvents) {
286
- const type = typeof event?.type === 'string' ? event.type : (typeof event?.payload?.type === 'string' ? event.payload.type : 'unknown');
287
- counts[type] = (counts[type] || 0) + 1;
288
- }
289
- return counts;
290
- }
291
- function maxTraceAssistantOutputLength(trace) {
292
- let max = 0;
293
- const visit = (node) => {
294
- if (!node || typeof node !== 'object') return;
295
- if (node.type === 'assistant.message' && typeof node.output === 'string') max = Math.max(max, node.output.length);
296
- if (Array.isArray(node.children)) node.children.forEach(visit);
297
- };
298
- if (Array.isArray(trace?.nodes)) trace.nodes.forEach(visit);
299
- return max;
300
- }
301
- function summarizeEventSourceProbe(startedAt, requested, forcedReconnectAtMs, textDropRequested, textDropDurationMs) {
302
- const probe = window.__piboStreamingBenchmarkEventSourceProbe;
303
- if (!requested) return undefined;
304
- if (!probe) {
305
- return {
306
- requested,
307
- installed: false,
308
- forcedReconnectAtMs,
309
- openCount: 0,
310
- openCountAfterStart: 0,
311
- errorCount: 0,
312
- errorCountAfterStart: 0,
313
- closeCount: 0,
314
- forcedCloseCount: 0,
315
- forcedCloseCountAfterStart: 0,
316
- eventCount: 0,
317
- eventCountAfterStart: 0,
318
- textEventCount: 0,
319
- textEventCountAfterStart: 0,
320
- reasoningEventCount: 0,
321
- reasoningEventCountAfterStart: 0,
322
- transientIdCount: 0,
323
- uniqueTransientIdCount: 0,
324
- transientIdCountAfterStart: 0,
325
- uniqueTransientIdCountAfterStart: 0,
326
- durableIdCount: 0,
327
- otherIdCount: 0,
328
- transientIdResetObserved: false,
329
- reconnectObserved: false,
330
- textDropRequested: Boolean(textDropRequested),
331
- textDropDurationMs,
332
- textDropCount: 0,
333
- textDropTextEventCount: 0,
334
- streams: [],
335
- };
336
- }
337
- const streamEvents = (Array.isArray(probe.events) ? probe.events : []).filter((event) => String(event.url || '').includes('/api/chat/events'));
338
- const afterStartStreamEvents = streamEvents.filter((event) => typeof event.t === 'number' && event.t >= startedAt);
339
- const afterStartConnections = (Array.isArray(probe.connections) ? probe.connections : []).filter((event) => typeof event.t === 'number' && event.t >= startedAt && String(event.url || '').includes('/api/chat/events'));
340
- const ids = streamEvents.map((event) => event.lastEventId).filter(Boolean);
341
- const afterStartIds = afterStartStreamEvents.map((event) => event.lastEventId).filter(Boolean);
342
- const transientIds = ids.filter((id) => /^live:\d+$/.test(id));
343
- const afterStartTransientIds = afterStartIds.filter((id) => /^live:\d+$/.test(id));
344
- const durableIds = ids.filter((id) => /^\d+:\d+$/.test(id));
345
- const otherIds = ids.filter((id) => !/^live:\d+$/.test(id) && !/^\d+:\d+$/.test(id));
346
- const firstEventMsAfterStart = firstProbeEventMs(afterStartStreamEvents, startedAt);
347
- const firstTextEventMsAfterStart = firstProbeEventMs(afterStartStreamEvents, startedAt, 'TEXT_MESSAGE_CONTENT');
348
- const firstReasoningEventMsAfterStart = firstProbeEventMs(afterStartStreamEvents, startedAt, 'REASONING_MESSAGE_CONTENT');
349
- const forcedCloseCountAfterStart = afterStartConnections.filter((event) => event.kind === 'close' && event.forced).length;
350
- const openCountAfterStart = afterStartConnections.filter((event) => event.kind === 'open').length;
351
- const streams = summarizeEventSourceStreams(streamEvents, afterStartConnections, startedAt);
352
- return {
353
- requested,
354
- installed: true,
355
- forcedReconnectAtMs,
356
- openCount: Number(probe.openCount || 0),
357
- openCountAfterStart,
358
- errorCount: Number(probe.errorCount || 0),
359
- errorCountAfterStart: afterStartConnections.filter((event) => event.kind === 'error').length,
360
- closeCount: Number(probe.closeCount || 0),
361
- forcedCloseCount: Number(probe.forcedCloseCount || 0),
362
- forcedCloseCountAfterStart,
363
- eventCount: streamEvents.length,
364
- eventCountAfterStart: afterStartStreamEvents.length,
365
- textEventCount: streamEvents.filter((event) => event.type === 'TEXT_MESSAGE_CONTENT').length,
366
- textEventCountAfterStart: afterStartStreamEvents.filter((event) => event.type === 'TEXT_MESSAGE_CONTENT').length,
367
- reasoningEventCount: streamEvents.filter((event) => event.type === 'REASONING_MESSAGE_CONTENT').length,
368
- reasoningEventCountAfterStart: afterStartStreamEvents.filter((event) => event.type === 'REASONING_MESSAGE_CONTENT').length,
369
- transientIdCount: transientIds.length,
370
- uniqueTransientIdCount: new Set(transientIds).size,
371
- transientIdCountAfterStart: afterStartTransientIds.length,
372
- uniqueTransientIdCountAfterStart: new Set(afterStartTransientIds).size,
373
- durableIdCount: durableIds.length,
374
- otherIdCount: otherIds.length,
375
- lastEventId: ids.at(-1),
376
- firstTransientId: transientIds[0],
377
- firstEventMsAfterStart,
378
- firstTextEventMsAfterStart,
379
- firstReasoningEventMsAfterStart,
380
- lastTransientId: transientIds.at(-1),
381
- transientIdResetObserved: new Set(transientIds).size < transientIds.length,
382
- reconnectObserved: forcedCloseCountAfterStart > 0 && openCountAfterStart > 0,
383
- textDropRequested: Boolean(textDropRequested),
384
- textDropDurationMs: textDropRequested ? Number(probe.textDropDurationMs || textDropDurationMs || 0) || undefined : undefined,
385
- textDropCount: textDropRequested ? Number(probe.textDropCount || 0) : 0,
386
- textDropTextEventCount: textDropRequested ? Number(probe.textDropTextEventCount || 0) : 0,
387
- streams,
388
- };
389
- }
390
- function firstProbeEventMs(events, startedAt, type) {
391
- const event = events.find((item) => typeof item.t === 'number' && (type === undefined || item.type === type));
392
- return event ? Math.round((event.t - startedAt) * 1000) / 1000 : undefined;
393
- }
394
- function summarizeEventSourceStreams(streamEvents, afterStartConnections, startedAt) {
395
- const groups = new Map();
396
- const ensureGroup = (rawUrl) => {
397
- const parsed = parseChatEventsProbeUrl(rawUrl);
398
- const key = [parsed.role, parsed.piboSessionId || '', parsed.roomId || '', parsed.mode || '', parsed.url].join('|');
399
- let group = groups.get(key);
400
- if (!group) {
401
- group = {
402
- url: parsed.url,
403
- mode: parsed.mode,
404
- role: parsed.role,
405
- piboSessionId: parsed.piboSessionId,
406
- roomId: parsed.roomId,
407
- sinceValues: [],
408
- liveSinceValues: [],
409
- openCountAfterStart: 0,
410
- errorCountAfterStart: 0,
411
- closeCountAfterStart: 0,
412
- forcedCloseCountAfterStart: 0,
413
- events: [],
414
- };
415
- groups.set(key, group);
416
- }
417
- if (parsed.since && !group.sinceValues.includes(parsed.since)) group.sinceValues.push(parsed.since);
418
- if (parsed.liveSince && !group.liveSinceValues.includes(parsed.liveSince)) group.liveSinceValues.push(parsed.liveSince);
419
- return group;
420
- };
421
- for (const event of streamEvents) ensureGroup(event.url).events.push(event);
422
- for (const connection of afterStartConnections) {
423
- const group = ensureGroup(connection.url);
424
- if (connection.kind === 'open') group.openCountAfterStart += 1;
425
- else if (connection.kind === 'error') group.errorCountAfterStart += 1;
426
- else if (connection.kind === 'close') {
427
- group.closeCountAfterStart += 1;
428
- if (connection.forced) group.forcedCloseCountAfterStart += 1;
429
- }
430
- }
431
- return Array.from(groups.values()).map((group) => {
432
- const events = group.events;
433
- const afterStartEvents = events.filter((event) => typeof event.t === 'number' && event.t >= startedAt);
434
- const ids = events.map((event) => event.lastEventId).filter(Boolean);
435
- const afterStartIds = afterStartEvents.map((event) => event.lastEventId).filter(Boolean);
436
- const transientIds = ids.filter((id) => /^live:\d+$/.test(id));
437
- const afterStartTransientIds = afterStartIds.filter((id) => /^live:\d+$/.test(id));
438
- const liveReplayReplayedCount = events.reduce((total, event) => total + (typeof event.liveReplayReplayed === 'number' && Number.isFinite(event.liveReplayReplayed) ? event.liveReplayReplayed : 0), 0);
439
- const liveReplayReplayedCountAfterStart = afterStartEvents.reduce((total, event) => total + (typeof event.liveReplayReplayed === 'number' && Number.isFinite(event.liveReplayReplayed) ? event.liveReplayReplayed : 0), 0);
440
- const liveReplayMisses = events.filter((event) => event.liveReplayMissed === true);
441
- const afterStartLiveReplayMisses = afterStartEvents.filter((event) => event.liveReplayMissed === true);
442
- const liveReplayDuplicateCount = countLiveReplayDuplicateIds(events);
443
- const liveReplayDuplicateCountAfterStart = countLiveReplayDuplicateIds(events, startedAt);
444
- const liveReplayEvictedBeforeValues = events.map((event) => event.liveReplayEvictedBefore).filter((value) => typeof value === 'number' && Number.isFinite(value));
445
- const liveReplayCursorLagValues = events.map((event) => typeof event.liveReplayRequestedAfter === 'number' && Number.isFinite(event.liveReplayRequestedAfter) && typeof event.liveReplayNewestAvailable === 'number' && Number.isFinite(event.liveReplayNewestAvailable) ? Math.max(0, event.liveReplayNewestAvailable - event.liveReplayRequestedAfter) : undefined).filter((value) => typeof value === 'number' && Number.isFinite(value));
446
- const afterStartLiveReplayCursorLagValues = afterStartEvents.map((event) => typeof event.liveReplayRequestedAfter === 'number' && Number.isFinite(event.liveReplayRequestedAfter) && typeof event.liveReplayNewestAvailable === 'number' && Number.isFinite(event.liveReplayNewestAvailable) ? Math.max(0, event.liveReplayNewestAvailable - event.liveReplayRequestedAfter) : undefined).filter((value) => typeof value === 'number' && Number.isFinite(value));
447
- const firstEventMsAfterStart = firstProbeEventMs(afterStartEvents, startedAt);
448
- const firstTextEventMsAfterStart = firstProbeEventMs(afterStartEvents, startedAt, 'TEXT_MESSAGE_CONTENT');
449
- const firstReasoningEventMsAfterStart = firstProbeEventMs(afterStartEvents, startedAt, 'REASONING_MESSAGE_CONTENT');
450
- const durableIds = ids.filter((id) => /^\d+:\d+$/.test(id));
451
- const otherIds = ids.filter((id) => !/^live:\d+$/.test(id) && !/^\d+:\d+$/.test(id));
452
- return {
453
- url: group.url,
454
- mode: group.mode,
455
- role: group.role,
456
- piboSessionId: group.piboSessionId,
457
- roomId: group.roomId,
458
- sinceValues: group.sinceValues,
459
- liveSinceValues: group.liveSinceValues,
460
- openCountAfterStart: group.openCountAfterStart,
461
- errorCountAfterStart: group.errorCountAfterStart,
462
- closeCountAfterStart: group.closeCountAfterStart,
463
- forcedCloseCountAfterStart: group.forcedCloseCountAfterStart,
464
- eventCount: events.length,
465
- eventCountAfterStart: afterStartEvents.length,
466
- textEventCount: events.filter((event) => event.type === 'TEXT_MESSAGE_CONTENT').length,
467
- textEventCountAfterStart: afterStartEvents.filter((event) => event.type === 'TEXT_MESSAGE_CONTENT').length,
468
- reasoningEventCount: events.filter((event) => event.type === 'REASONING_MESSAGE_CONTENT').length,
469
- reasoningEventCountAfterStart: afterStartEvents.filter((event) => event.type === 'REASONING_MESSAGE_CONTENT').length,
470
- transientIdCount: transientIds.length,
471
- uniqueTransientIdCount: new Set(transientIds).size,
472
- transientIdCountAfterStart: afterStartTransientIds.length,
473
- uniqueTransientIdCountAfterStart: new Set(afterStartTransientIds).size,
474
- durableIdCount: durableIds.length,
475
- otherIdCount: otherIds.length,
476
- liveReplayEventCount: liveReplayReplayedCount,
477
- liveReplayEventCountAfterStart: liveReplayReplayedCountAfterStart,
478
- liveReplayMissedCount: liveReplayMisses.length,
479
- liveReplayMissedCountAfterStart: afterStartLiveReplayMisses.length,
480
- liveReplayDuplicateCount,
481
- liveReplayDuplicateCountAfterStart,
482
- liveReplayEvictedBeforeMax: liveReplayEvictedBeforeValues.length ? Math.max(...liveReplayEvictedBeforeValues) : undefined,
483
- liveReplayCursorLagMax: liveReplayCursorLagValues.length ? Math.max(...liveReplayCursorLagValues) : undefined,
484
- liveReplayCursorLagMaxAfterStart: afterStartLiveReplayCursorLagValues.length ? Math.max(...afterStartLiveReplayCursorLagValues) : undefined,
485
- lastEventId: ids.at(-1),
486
- firstEventMsAfterStart,
487
- firstTextEventMsAfterStart,
488
- firstReasoningEventMsAfterStart,
489
- };
490
- }).sort((left, right) => roleSort(left.role) - roleSort(right.role) || left.url.localeCompare(right.url));
491
- }
492
- function countLiveReplayDuplicateIds(events, startedAt) {
493
- const seen = new Set();
494
- let duplicateCount = 0;
495
- const ordered = events.slice().sort((left, right) => Number(left.t || 0) - Number(right.t || 0));
496
- for (const event of ordered) {
497
- const requestedAfter = typeof event.liveReplayRequestedAfter === 'number' && Number.isFinite(event.liveReplayRequestedAfter) ? event.liveReplayRequestedAfter : undefined;
498
- const newestAvailable = typeof event.liveReplayNewestAvailable === 'number' && Number.isFinite(event.liveReplayNewestAvailable) ? event.liveReplayNewestAvailable : undefined;
499
- const replayed = typeof event.liveReplayReplayed === 'number' && Number.isFinite(event.liveReplayReplayed) ? event.liveReplayReplayed : 0;
500
- const countThisStatus = startedAt === undefined || (typeof event.t === 'number' && event.t >= startedAt);
501
- if (countThisStatus && replayed > 0 && requestedAfter !== undefined && newestAvailable !== undefined) {
502
- for (const replayId of seen) {
503
- if (replayId > requestedAfter && replayId <= newestAvailable) duplicateCount += 1;
504
- }
505
- }
506
- if (typeof event.liveReplayId === 'number' && Number.isFinite(event.liveReplayId)) seen.add(event.liveReplayId);
507
- }
508
- return duplicateCount;
509
- }
510
- function parseChatEventsProbeUrl(rawUrl) {
511
- let parsed;
512
- try { parsed = new URL(String(rawUrl || ''), location.href); } catch { parsed = new URL('/api/chat/events', location.href); }
513
- const params = parsed.searchParams;
514
- const mode = params.get('mode') || undefined;
515
- const piboSessionId = params.get('piboSessionId') || undefined;
516
- const roomId = params.get('roomId') || undefined;
517
- const role = mode === 'summary' || (roomId && !piboSessionId) ? 'room-summary' : (mode === 'live' || piboSessionId ? 'selected-live' : 'chat-events');
518
- const withoutResume = new URL(parsed.href);
519
- withoutResume.searchParams.delete('since');
520
- withoutResume.searchParams.delete('liveSince');
521
- return {
522
- url: withoutResume.pathname + (withoutResume.search ? withoutResume.search : ''),
523
- mode,
524
- role,
525
- piboSessionId,
526
- roomId,
527
- since: params.get('since') || undefined,
528
- liveSince: params.get('liveSince') || undefined,
529
- };
530
- }
531
- function roleSort(role) {
532
- if (role === 'selected-live') return 0;
533
- if (role === 'room-summary') return 1;
534
- return 2;
535
- }
536
- function streamingBenchmarkRegressions(result) {
537
- const failures = [];
538
- const fixture = result.fixture;
539
- const expectedDeltas = fixture && typeof fixture.deltaCount === 'number' ? fixture.deltaCount : undefined;
540
- const expectedReasoningDeltas = fixture && typeof fixture.reasoningDeltaCount === 'number' ? fixture.reasoningDeltaCount : undefined;
541
- const cadenceMs = fixture && typeof fixture.cadenceMs === 'number' ? fixture.cadenceMs : 100;
542
- const textDeltas = result.debugDelta && typeof result.debugDelta.textDeltaCount === 'number' ? result.debugDelta.textDeltaCount : 0;
543
- const reasoningDeltas = result.debugDelta && typeof result.debugDelta.reasoningDeltaCount === 'number' ? result.debugDelta.reasoningDeltaCount : 0;
544
- const domPositive = result.dom.positiveUpdateCount || 0;
545
- const domGapP90 = result.dom.gapsMs && typeof result.dom.gapsMs.p90 === 'number' ? result.dom.gapsMs.p90 : undefined;
546
- const domJumpMax = result.dom.positiveCharJumps && typeof result.dom.positiveCharJumps.max === 'number' ? result.dom.positiveCharJumps.max : undefined;
547
- const firstPositiveMs = typeof result.dom.firstPositiveUpdateMs === 'number' ? result.dom.firstPositiveUpdateMs : undefined;
548
- const longTaskMax = result.longTasks.length ? Math.max(...result.longTasks) : 0;
549
- const traceCatchupRequested = Boolean(result.eventSource && result.eventSource.textDropRequested);
550
- const reconnectRequested = Boolean(result.eventSource && typeof result.eventSource.forcedReconnectAtMs === 'number');
551
- if (!result.debugAfter) failures.push('debug counters unavailable');
552
- if (fixture) {
553
- if (!fixture.available) failures.push('fixture unavailable');
554
- if (!fixture.started) failures.push('fixture did not start');
555
- if (fixture.error) failures.push('fixture error: ' + fixture.error);
556
- if (!traceCatchupRequested && expectedDeltas !== undefined && textDeltas < expectedDeltas) failures.push('text deltas ' + textDeltas + ' < fixture deltas ' + expectedDeltas);
557
- if (!traceCatchupRequested && expectedReasoningDeltas !== undefined && reasoningDeltas < expectedReasoningDeltas) failures.push('reasoning deltas ' + reasoningDeltas + ' < fixture reasoning deltas ' + expectedReasoningDeltas);
558
- if (!traceCatchupRequested && expectedDeltas !== undefined && domPositive < Math.max(1, expectedDeltas - 2)) failures.push('positive DOM updates ' + domPositive + ' < ' + Math.max(1, expectedDeltas - 2));
559
- if (!traceCatchupRequested && domGapP90 !== undefined && domGapP90 > Math.max(300, cadenceMs * 3)) failures.push('DOM p90 gap ' + domGapP90 + 'ms exceeds gate');
560
- if (!traceCatchupRequested && domJumpMax !== undefined && domJumpMax > 4) failures.push('DOM max jump ' + domJumpMax + ' chars exceeds gate');
561
- if (!traceCatchupRequested && firstPositiveMs !== undefined && firstPositiveMs > 500) failures.push('first visible update ' + firstPositiveMs + 'ms exceeds gate');
562
- if (traceCatchupRequested) {
563
- const traceRefreshes = result.debugDelta && typeof result.debugDelta.traceRefreshCompletedCount === 'number' ? result.debugDelta.traceRefreshCompletedCount : 0;
564
- if (traceRefreshes < 1) failures.push('trace catch-up did not complete a trace refresh');
565
- const maxVisibleLength = result.dom && typeof result.dom.lengthMax === 'number' ? result.dom.lengthMax : result.dom && result.dom.lengthEnd;
566
- if (!result.dom || !(maxVisibleLength > result.dom.lengthStart)) failures.push('trace catch-up did not advance visible DOM output');
567
- if (expectedDeltas !== undefined && textDeltas > Math.max(1, expectedDeltas - 2)) failures.push('trace catch-up did not suppress live text deltas before recovery');
568
- if (!result.trace) failures.push('trace catch-up trace probe unavailable');
569
- else {
570
- if (result.trace.sampleCount < 1 || result.trace.fetchCount < 1) failures.push('trace catch-up trace probe did not fetch samples');
571
- if (result.trace.liveVersionCount < 1) failures.push('trace catch-up trace probe did not observe live snapshot version');
572
- if (result.trace.maxAssistantOutputLength < 1) failures.push('trace catch-up trace probe did not observe assistant output');
573
- }
574
- }
575
- }
576
- if (result.eventSource && result.eventSource.requested) {
577
- if (!result.eventSource.installed) failures.push('EventSource probe unavailable');
578
- const selectedLiveStreams = Array.isArray(result.eventSource.streams) ? result.eventSource.streams.filter((stream) => stream.role === 'selected-live') : [];
579
- const selectedLive = selectedLiveStreams.length > 1
580
- ? selectedLiveStreams.reduce((total, stream) => ({
581
- textEventCountAfterStart: total.textEventCountAfterStart + (stream.textEventCountAfterStart || 0),
582
- reasoningEventCountAfterStart: total.reasoningEventCountAfterStart + (stream.reasoningEventCountAfterStart || 0),
583
- liveReplayEventCountAfterStart: total.liveReplayEventCountAfterStart + (stream.liveReplayEventCountAfterStart || 0),
584
- liveReplayMissedCountAfterStart: total.liveReplayMissedCountAfterStart + (stream.liveReplayMissedCountAfterStart || 0),
585
- liveReplayDuplicateCountAfterStart: total.liveReplayDuplicateCountAfterStart + (stream.liveReplayDuplicateCountAfterStart || 0),
586
- liveSinceValues: Array.from(new Set(total.liveSinceValues.concat(stream.liveSinceValues || []))),
587
- }), { textEventCountAfterStart: 0, reasoningEventCountAfterStart: 0, liveReplayEventCountAfterStart: 0, liveReplayMissedCountAfterStart: 0, liveReplayDuplicateCountAfterStart: 0, liveSinceValues: [] })
588
- : selectedLiveStreams[0];
589
- if (!selectedLive) failures.push('EventSource selected-live stream was not observed');
590
- if (!traceCatchupRequested && selectedLive && expectedDeltas !== undefined && selectedLive.textEventCountAfterStart < expectedDeltas) failures.push('selected-live text events after start ' + selectedLive.textEventCountAfterStart + ' < fixture deltas ' + expectedDeltas);
591
- if (!traceCatchupRequested && selectedLive && expectedReasoningDeltas !== undefined && selectedLive.reasoningEventCountAfterStart < expectedReasoningDeltas) failures.push('selected-live reasoning events after start ' + selectedLive.reasoningEventCountAfterStart + ' < fixture reasoning deltas ' + expectedReasoningDeltas);
592
- if (traceCatchupRequested) {
593
- if (selectedLive && selectedLive.textEventCountAfterStart > Math.max(1, (expectedDeltas || 0) - 2)) failures.push('trace catch-up selected-live text was not suppressed');
594
- } else {
595
- if (reconnectRequested && result.eventSource.forcedCloseCountAfterStart < 1) failures.push('EventSource forced close was not observed');
596
- if (reconnectRequested && result.eventSource.openCountAfterStart < 1) failures.push('EventSource reconnect open was not observed');
597
- if (reconnectRequested && selectedLive && (selectedLive.liveReplayMissedCountAfterStart || 0) > 0) failures.push('selected-live transient replay missed buffered events');
598
- if (reconnectRequested && selectedLive && (selectedLive.liveReplayDuplicateCountAfterStart || 0) > 0) failures.push('selected-live transient replay duplicated already observed frames');
599
- if (reconnectRequested && selectedLive && (selectedLive.liveSinceValues || []).length > 0 && (selectedLive.liveReplayEventCountAfterStart || 0) < 1) failures.push('selected-live transient replay cursor did not replay buffered events');
600
- if (result.eventSource.transientIdCountAfterStart < 1) failures.push('EventSource transient live ids were not observed');
601
- }
602
- }
603
- if (result.sse && result.sse.requested) {
604
- if (!result.sse.installed) failures.push('SSE fetch probe unavailable');
605
- if (result.sse.status && result.sse.status !== 200) failures.push('SSE fetch status ' + result.sse.status);
606
- if (result.sse.headers && String(result.sse.headers['x-accel-buffering'] || '').toLowerCase() !== 'no') failures.push('SSE X-Accel-Buffering header is not no');
607
- if (result.sse.errors && result.sse.errors.length) failures.push('SSE fetch errors: ' + result.sse.errors.slice(0, 2).join('; '));
608
- if (!traceCatchupRequested && expectedDeltas !== undefined && result.sse.textEventCount < expectedDeltas) failures.push('SSE text events ' + result.sse.textEventCount + ' < fixture deltas ' + expectedDeltas);
609
- if (!traceCatchupRequested && expectedReasoningDeltas !== undefined && result.sse.reasoningEventCount < expectedReasoningDeltas) failures.push('SSE reasoning events ' + result.sse.reasoningEventCount + ' < fixture reasoning deltas ' + expectedReasoningDeltas);
610
- if (!traceCatchupRequested && expectedDeltas !== undefined && result.sse.transientIdCount < expectedDeltas) failures.push('SSE transient live ids ' + result.sse.transientIdCount + ' < fixture deltas ' + expectedDeltas);
611
- const sseGapGate = Math.max(300, cadenceMs * 3);
612
- const sseChunkGapP90 = result.sse.chunkGapsMs && typeof result.sse.chunkGapsMs.p90 === 'number' ? result.sse.chunkGapsMs.p90 : undefined;
613
- const sseTextGapP90 = result.sse.textEventGapsMs && typeof result.sse.textEventGapsMs.p90 === 'number' ? result.sse.textEventGapsMs.p90 : undefined;
614
- const sseTextPerChunkP90 = result.sse.textEventsPerChunk && typeof result.sse.textEventsPerChunk.p90 === 'number' ? result.sse.textEventsPerChunk.p90 : undefined;
615
- if (!traceCatchupRequested && sseChunkGapP90 !== undefined && sseChunkGapP90 > sseGapGate) failures.push('SSE chunk p90 gap ' + sseChunkGapP90 + 'ms exceeds gate');
616
- if (!traceCatchupRequested && sseTextGapP90 !== undefined && sseTextGapP90 > sseGapGate) failures.push('SSE text p90 gap ' + sseTextGapP90 + 'ms exceeds gate');
617
- if (!traceCatchupRequested && sseTextPerChunkP90 !== undefined && sseTextPerChunkP90 > 2) failures.push('SSE text events per chunk p90 ' + sseTextPerChunkP90 + ' exceeds gate');
618
- }
619
- if (longTaskMax > 50) failures.push('long task max ' + Math.round(longTaskMax * 1000) / 1000 + 'ms exceeds 50ms');
620
- return failures;
621
- }
622
- function assistantTargets() {
623
- return Array.from(document.querySelectorAll(ASSISTANT_SELECTOR));
624
- }
625
- function selectedAssistantText(initialTargets, ignorePreludeTargets) {
626
- const targets = assistantTargets();
627
- const texts = [];
628
- for (const target of targets) {
629
- if (initialTargets && initialTargets.has(target)) continue;
630
- const text = target.innerText || target.textContent || '';
631
- if (ignorePreludeTargets && /\bprelude\b/i.test(text)) continue;
632
- texts.push(text);
633
- }
634
- return texts.join('\n');
635
- }
636
- async function waitForAssistantDomSettle(timeoutMs) {
637
- const deadline = performance.now() + timeoutMs;
638
- let lastText = selectedAssistantText();
639
- let stableSamples = 0;
640
- while (performance.now() < deadline) {
641
- await new Promise((resolve) => setTimeout(resolve, 100));
642
- const text = selectedAssistantText();
643
- if (text === lastText) {
644
- stableSamples += 1;
645
- if (stableSamples >= 5) return;
646
- } else {
647
- stableSamples = 0;
648
- lastText = text;
649
- }
650
- }
651
- }
652
- async function runStreamingBenchmark(options) {
653
- const warnings = [];
654
- const selectedSessionId = () => document.querySelector('[data-pibo-debug="chat-shell"]')?.getAttribute('data-pibo-session-id')
655
- || document.querySelector('[data-pibo-selected-session-id]')?.getAttribute('data-pibo-selected-session-id')
656
- || undefined;
657
- let reset = false;
658
- let backendPreludeError;
659
- let backendPreludeConfig;
660
- try { localStorage.setItem('pibo.chat.debugStreaming', '1'); } catch (error) { warnings.push('failed to set debugStreaming localStorage: ' + String(error)); }
661
- if (options.startBackendFixture && options.fixturePreludeMessages > 0) {
662
- const piboSessionId = selectedSessionId();
663
- if (!piboSessionId) {
664
- backendPreludeError = 'selected Chat session not found in DOM';
665
- warnings.push('backend streaming fixture prelude was requested but selected Chat session was not found');
666
- } else {
667
- try {
668
- const response = await fetchWithTimeout('/api/chat/debug/streaming-fixture', {
669
- method: 'POST',
670
- headers: { 'content-type': 'application/json' },
671
- body: JSON.stringify({ piboSessionId, preludeOnly: true, preludeMessages: options.fixturePreludeMessages }),
672
- }, 10000);
673
- const payload = await response.json().catch(() => ({}));
674
- if (!response.ok) throw new Error(payload && payload.error ? payload.error : response.status + ' ' + response.statusText);
675
- backendPreludeConfig = payload.fixture || payload;
676
- await new Promise((resolve) => setTimeout(resolve, Math.min(8000, Math.max(1000, options.fixturePreludeMessages * 5))));
677
- await waitForAssistantDomSettle(Math.min(8000, Math.max(1000, options.fixturePreludeMessages * 5)));
678
- } catch (error) {
679
- backendPreludeError = String(error && error.message ? error.message : error);
680
- warnings.push('failed to start backend streaming fixture prelude: ' + backendPreludeError);
681
- }
682
- }
683
- }
684
- const fixtureDomInitialTargets = options.startBackendFixture ? new WeakSet(assistantTargets()) : undefined;
685
- const ignorePreludeDomTargets = Boolean(options.startBackendFixture && options.fixturePreludeMessages > 0);
686
- const startedAt = performance.now();
687
- const debugStateBeforeReset = cloneDebugSnapshot(window.__piboStreamingDebug);
688
- if (typeof window.__piboStreamingDebugReset === 'function') {
689
- try { window.__piboStreamingDebugReset(); reset = true; } catch (error) { warnings.push('failed to reset __piboStreamingDebug: ' + String(error)); }
690
- }
691
- const overlayDrop = installOverlayDropSimulation(Boolean(options.simulateOverlayDrop));
692
-
693
- const debugBefore = cloneDebugSnapshot(window.__piboStreamingDebug);
694
- const initialText = selectedAssistantText(fixtureDomInitialTargets, ignorePreludeDomTargets);
695
- const targetCountStart = assistantTargets().length;
696
- const updates = [];
697
- const positiveJumps = [];
698
- let currentLength = initialText.length;
699
- let maxLength = initialText.length;
700
- let lastPositiveAt;
701
- let firstPositiveUpdateMs;
702
- const sample = () => {
703
- const text = selectedAssistantText(fixtureDomInitialTargets, ignorePreludeDomTargets);
704
- const length = text.length;
705
- if (length === currentLength) return;
706
- maxLength = Math.max(maxLength, length);
707
- const t = performance.now() - startedAt;
708
- const delta = length - currentLength;
709
- updates.push({ t, length, delta });
710
- if (delta > 0) {
711
- positiveJumps.push(delta);
712
- firstPositiveUpdateMs ??= t;
713
- lastPositiveAt = t;
714
- }
715
- currentLength = length;
716
- };
717
- const observer = new MutationObserver(sample);
718
- observer.observe(document.body, { childList: true, subtree: true, characterData: true });
719
-
720
- const rafGaps = [];
721
- let rafCount = 0;
722
- let lastRaf;
723
- let rafHandle;
724
- const onRaf = (t) => {
725
- rafCount += 1;
726
- if (lastRaf !== undefined) rafGaps.push(t - lastRaf);
727
- lastRaf = t;
728
- rafHandle = requestAnimationFrame(onRaf);
729
- };
730
- rafHandle = requestAnimationFrame(onRaf);
731
-
732
- const longTasks = [];
733
- let perfObserver;
734
- if (typeof PerformanceObserver !== 'undefined') {
735
- try {
736
- perfObserver = new PerformanceObserver((list) => {
737
- for (const entry of list.getEntries()) longTasks.push(entry.duration || 0);
738
- });
739
- perfObserver.observe({ entryTypes: ['longtask'] });
740
- } catch {
741
- warnings.push('longtask PerformanceObserver unavailable');
742
- }
743
- } else {
744
- warnings.push('PerformanceObserver unavailable');
745
- }
746
-
747
- let fixtureStarted = false;
748
- let fixtureConfig;
749
- let backendFixtureError;
750
- let traceProbe;
751
- let sseProbe;
752
- if (options.startFixture) {
753
- if (typeof window.__piboStreamingFixtureStart === 'function') {
754
- try { fixtureConfig = window.__piboStreamingFixtureStart(); fixtureStarted = true; } catch (error) { warnings.push('failed to start streaming fixture: ' + String(error)); }
755
- } else {
756
- warnings.push('streaming fixture was requested but window.__piboStreamingFixtureStart is unavailable');
757
- }
758
- } else if (options.startBackendFixture) {
759
- if (options.simulateReconnect && typeof window.__piboStreamingBenchmarkForceReconnect === 'function') {
760
- setTimeout(() => {
761
- try { window.__piboStreamingBenchmarkForceReconnect(); } catch (error) { warnings.push('failed to force EventSource reconnect: ' + String(error)); }
762
- }, options.reconnectAtMs || 325);
763
- } else if (options.simulateReconnect) {
764
- warnings.push('EventSource reconnect simulation was requested but the probe is unavailable');
765
- }
766
- if (options.simulateTraceCatchup && typeof window.__piboStreamingBenchmarkMarkTextDropRequested === 'function') {
767
- try { window.__piboStreamingBenchmarkMarkTextDropRequested(options.traceCatchupDropMs || 1300); } catch (error) { warnings.push('failed to mark EventSource text drop request: ' + String(error)); }
768
- } else if (options.simulateTraceCatchup) {
769
- warnings.push('trace catch-up simulation was requested but the EventSource probe is unavailable');
770
- }
771
- const piboSessionId = selectedSessionId();
772
- if (options.simulateTraceCatchup && piboSessionId) {
773
- traceProbe = createTraceProbe(piboSessionId, startedAt, 250);
774
- await traceProbe.sample();
775
- }
776
- if (!piboSessionId) {
777
- backendFixtureError = 'selected Chat session not found in DOM';
778
- warnings.push('backend streaming fixture was requested but selected Chat session was not found');
779
- } else {
780
- sseProbe = createSseProbe(piboSessionId, startedAt);
781
- await waitForSseProbeReady(sseProbe.result, 500);
782
- try {
783
- const response = await fetchWithTimeout('/api/chat/debug/streaming-fixture', {
784
- method: 'POST',
785
- headers: { 'content-type': 'application/json' },
786
- body: JSON.stringify({ piboSessionId, profile: options.fixtureProfile, mix: options.fixtureMix, ...((options.simulateReconnect || options.simulateTraceCatchup) ? { cadenceMs: 150 } : {}), ...(options.simulateTraceCatchup ? { traceSnapshots: true, suppressLiveDeltas: true } : {}) }),
787
- }, options.simulateTraceCatchup ? 15000 : 5000);
788
- const payload = await response.json().catch(() => ({}));
789
- if (!response.ok) throw new Error(payload && payload.error ? payload.error : response.status + ' ' + response.statusText);
790
- fixtureConfig = payload.fixture || payload;
791
- fixtureStarted = true;
792
- } catch (error) {
793
- backendFixtureError = String(error && error.message ? error.message : error);
794
- warnings.push('failed to start backend streaming fixture: ' + backendFixtureError);
795
- }
796
- }
797
- }
798
-
799
- await new Promise((resolve) => setTimeout(resolve, options.durationMs));
800
- sample();
801
- if (traceProbe) {
802
- await traceProbe.sample();
803
- traceProbe.stop();
804
- }
805
- const sseSummary = sseProbe ? await sseProbe.stop() : undefined;
806
- observer.disconnect();
807
- if (rafHandle !== undefined) cancelAnimationFrame(rafHandle);
808
- try { perfObserver && perfObserver.disconnect(); } catch {}
809
-
810
- const debugAfter = cloneDebugSnapshot(window.__piboStreamingDebug);
811
- const overlayDropSummary = overlayDrop ? cloneDebugSnapshot(window.__piboStreamingBenchmarkOverlayDrop) : undefined;
812
- installOverlayDropSimulation(false);
813
- if (!debugAfter) warnings.push('window.__piboStreamingDebug was absent; run with ?debugStreaming=1 or start a fresh stream after this command enables localStorage');
814
- const positiveUpdates = updates.filter((update) => update.delta > 0);
815
- const positiveGaps = [];
816
- for (let i = 1; i < positiveUpdates.length; i++) positiveGaps.push(positiveUpdates[i].t - positiveUpdates[i - 1].t);
817
- const debugDelta = numericDelta(debugBefore, debugAfter, [
818
- 'liveOpenCount',
819
- 'liveErrorCount',
820
- 'eventCount',
821
- 'textDeltaCount',
822
- 'textDeltaBytes',
823
- 'reasoningDeltaCount',
824
- 'reasoningDeltaBytes',
825
- 'enqueueCount',
826
- 'flushCount',
827
- 'flushedEventCount',
828
- 'overlayUpdateCount',
829
- 'liveTraceComputeCount',
830
- 'liveTraceComputeDurationMsTotal',
831
- 'markdownRenderCount',
832
- 'markdownRenderPlainCount',
833
- 'markdownRenderFullCount',
834
- 'markdownRenderCommonMarkCount',
835
- 'markdownRenderGfmCount',
836
- 'markdownRenderGfmFastCount',
837
- 'markdownRenderDurationMsTotal',
838
- 'markdownRenderCommonMarkDurationMsTotal',
839
- 'markdownRenderGfmDurationMsTotal',
840
- 'markdownRenderGfmFastDurationMsTotal',
841
- 'traceRefreshStartedCount',
842
- 'traceRefreshCompletedCount',
843
- 'traceRefreshFailedCount',
844
- 'traceBaseUpdateCount',
845
- ]);
846
- const domGaps = stats(positiveGaps);
847
- const domJumps = stats(positiveJumps);
848
- const fixtureScheduleMs = numberArray(fixtureConfig && fixtureConfig.scheduleMs);
849
- const fixtureReasoningScheduleMs = numberArray(fixtureConfig && fixtureConfig.reasoningScheduleMs);
850
- const fixtureSummary = (options.startFixture || options.startBackendFixture) ? {
851
- requested: true,
852
- mode: options.startBackendFixture ? 'backend' : 'browser',
853
- profile: fixtureConfig && typeof fixtureConfig.profile === 'string' ? fixtureConfig.profile : options.fixtureProfile,
854
- mix: fixtureConfig && typeof fixtureConfig.mix === 'string' ? fixtureConfig.mix : options.fixtureMix,
855
- simulation: options.simulateTraceCatchup ? 'trace-catchup' : (options.simulateReconnect ? 'reconnect' : (options.simulateOverlayDrop ? 'overlay-drop' : undefined)),
856
- available: options.startBackendFixture ? !backendFixtureError : typeof window.__piboStreamingFixtureStart === 'function',
857
- started: fixtureStarted,
858
- deltaCount: fixtureConfig && typeof fixtureConfig.deltaCount === 'number' ? fixtureConfig.deltaCount : undefined,
859
- reasoningDeltaCount: fixtureConfig && typeof fixtureConfig.reasoningDeltaCount === 'number' ? fixtureConfig.reasoningDeltaCount : undefined,
860
- cadenceMs: fixtureConfig && typeof fixtureConfig.cadenceMs === 'number' ? fixtureConfig.cadenceMs : undefined,
861
- scheduleMs: fixtureScheduleMs.length ? fixtureScheduleMs : undefined,
862
- scheduleGapsMs: fixtureScheduleMs.length ? stats(scheduleGaps(fixtureScheduleMs)) : undefined,
863
- reasoningScheduleMs: fixtureReasoningScheduleMs.length ? fixtureReasoningScheduleMs : undefined,
864
- reasoningScheduleGapsMs: fixtureReasoningScheduleMs.length ? stats(scheduleGaps(fixtureReasoningScheduleMs)) : undefined,
865
- textBytes: fixtureConfig && typeof fixtureConfig.textBytes === 'number' ? fixtureConfig.textBytes : undefined,
866
- reasoningBytes: fixtureConfig && typeof fixtureConfig.reasoningBytes === 'number' ? fixtureConfig.reasoningBytes : undefined,
867
- piboSessionId: fixtureConfig && typeof fixtureConfig.piboSessionId === 'string' ? fixtureConfig.piboSessionId : undefined,
868
- preludeMessages: backendPreludeConfig && typeof backendPreludeConfig.preludeMessages === 'number' ? backendPreludeConfig.preludeMessages : (options.fixturePreludeMessages || undefined),
869
- error: backendPreludeError || backendFixtureError,
870
- } : undefined;
871
- const eventSourceSummary = summarizeEventSourceProbe(startedAt, Boolean(options.startBackendFixture), options.reconnectAtMs, Boolean(options.simulateTraceCatchup), options.traceCatchupDropMs);
872
- const traceSummary = traceProbe && traceProbe.result;
873
- const regressions = streamingBenchmarkRegressions({
874
- debugAfter,
875
- debugDelta,
876
- fixture: fixtureSummary,
877
- eventSource: eventSourceSummary,
878
- sse: sseSummary,
879
- trace: traceSummary,
880
- dom: { lengthStart: initialText.length, lengthEnd: currentLength, lengthMax: maxLength, positiveUpdateCount: positiveUpdates.length, gapsMs: domGaps, positiveCharJumps: domJumps, firstPositiveUpdateMs },
881
- longTasks,
882
- });
883
- return {
884
- kind: 'streaming-benchmark',
885
- createdAt: nowIso(),
886
- url: location.href,
887
- title: document.title,
888
- durationMs: options.durationMs,
889
- debug: {
890
- enabledRequested: true,
891
- available: Boolean(debugAfter),
892
- reset,
893
- before: debugBefore,
894
- stateBeforeReset: debugStateBeforeReset,
895
- after: debugAfter,
896
- delta: debugDelta,
897
- },
898
- dom: {
899
- selector: ASSISTANT_SELECTOR,
900
- targetCountStart,
901
- targetCountEnd: assistantTargets().length,
902
- lengthStart: initialText.length,
903
- lengthEnd: currentLength,
904
- lengthMax: maxLength,
905
- updateCount: updates.length,
906
- positiveUpdateCount: positiveUpdates.length,
907
- firstPositiveUpdateMs: firstPositiveUpdateMs === undefined ? undefined : Math.round(firstPositiveUpdateMs),
908
- lastPositiveUpdateMs: lastPositiveAt === undefined ? undefined : Math.round(lastPositiveAt),
909
- gapsMs: domGaps,
910
- positiveCharJumps: domJumps,
911
- },
912
- raf: { count: rafCount, gapsMs: stats(rafGaps) },
913
- longTasks: {
914
- count: longTasks.length,
915
- totalMs: Math.round(longTasks.reduce((sum, value) => sum + value, 0) * 1000) / 1000,
916
- maxMs: Math.round((longTasks.length ? Math.max(...longTasks) : 0) * 1000) / 1000,
917
- },
918
- fixture: fixtureSummary,
919
- eventSource: eventSourceSummary,
920
- sse: sseSummary,
921
- trace: traceSummary,
922
- overlayDrop: overlayDropSummary,
923
- regressions,
924
- warnings,
925
- };
926
- }
927
- `;
928
- }