@pasko70/pibo 1.0.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/README.md +106 -250
  2. package/context/codex-base-prompt.md +4 -0
  3. package/context/compute-worker.md +23 -0
  4. package/context/pibo-native-tooling.md +18 -0
  5. package/context/pibo-system-prompt.md +69 -8
  6. package/dist/api/simple-agent-api.js +136 -0
  7. package/dist/app-context.js +4 -0
  8. package/dist/apps/chat/agent-profiles.js +42 -5
  9. package/dist/apps/chat/agent-store.js +113 -16
  10. package/dist/apps/chat/chat-api-routes.js +311 -0
  11. package/dist/apps/chat/chat-capability-routes.js +90 -0
  12. package/dist/apps/chat/chat-files.js +178 -0
  13. package/dist/apps/chat/chat-request-normalizers.js +681 -0
  14. package/dist/apps/chat/chat-settings-routes.js +75 -0
  15. package/dist/apps/chat/chat-trace-helpers.js +94 -0
  16. package/dist/apps/chat/chat-user-skill-routes.js +149 -0
  17. package/dist/apps/chat/cron-api.js +213 -0
  18. package/dist/apps/chat/data/chat-data-mappers.js +74 -0
  19. package/dist/apps/chat/data/event-command-service.js +75 -0
  20. package/dist/apps/chat/data/navigation-query-service.js +11 -0
  21. package/dist/apps/chat/data/project-service.js +844 -0
  22. package/dist/apps/chat/data/read-state-service.js +42 -0
  23. package/dist/apps/chat/data/room-service.js +52 -0
  24. package/dist/apps/chat/data/session-query-service.js +63 -0
  25. package/dist/apps/chat/data/timeline-query-service.js +96 -0
  26. package/dist/apps/chat/event-log.js +1 -307
  27. package/dist/apps/chat/model-catalog.js +47 -0
  28. package/dist/apps/chat/output-compactor.js +126 -0
  29. package/dist/apps/chat/output-event-policy.js +17 -0
  30. package/dist/apps/chat/project-workflow-human-actions.js +347 -0
  31. package/dist/apps/chat/project-workflow-sessions.js +260 -0
  32. package/dist/apps/chat/provider-auth-actions.js +43 -0
  33. package/dist/apps/chat/ralph-api.js +156 -0
  34. package/dist/apps/chat/read-model.js +1 -218
  35. package/dist/apps/chat/rooms.js +1 -321
  36. package/dist/apps/chat/static-assets.js +996 -0
  37. package/dist/apps/chat/stream.js +29 -6
  38. package/dist/apps/chat/trace.js +179 -1003
  39. package/dist/apps/chat/types/event-store.js +1 -0
  40. package/dist/apps/chat/types/read-model.js +1 -0
  41. package/dist/apps/chat/types/rooms.js +36 -0
  42. package/dist/apps/chat/web-app.js +3168 -1811
  43. package/dist/apps/chat/workflow-catalog.js +572 -0
  44. package/dist/apps/chat/workflow-edge-compatibility.js +51 -0
  45. package/dist/apps/chat/workflow-json-schema-validation.js +335 -0
  46. package/dist/apps/chat/workflow-persistence-model.js +140 -0
  47. package/dist/apps/chat/workflow-persistence.js +633 -0
  48. package/dist/apps/chat/workflow-registered-ref-params.js +130 -0
  49. package/dist/apps/chat/workflow-registered-ref-pickers.js +179 -0
  50. package/dist/apps/chat/workflow-registered-ref-validation.js +210 -0
  51. package/dist/apps/chat/workflow-v2-security-validation.js +93 -0
  52. package/dist/apps/chat/workflow-validation-helpers.js +114 -0
  53. package/dist/apps/chat-ui/assets/{dist-CI0Xj2Cp.js → dist-B4lw9z4F.js} +1 -1
  54. package/dist/apps/chat-ui/assets/{dist-aMr2VYOu.js → dist-BbTaHWON.js} +1 -1
  55. package/dist/apps/chat-ui/assets/{dist-u2OzzOTm.js → dist-BcT_c1EJ.js} +1 -1
  56. package/dist/apps/chat-ui/assets/{dist-Di1ScJ22.js → dist-CGINd7XU.js} +1 -1
  57. package/dist/apps/chat-ui/assets/{dist-wiRpAHIv.js → dist-CrBzZkUp.js} +1 -1
  58. package/dist/apps/chat-ui/assets/{dist-CaNOvqMY.js → dist-CyyISotB.js} +1 -1
  59. package/dist/apps/chat-ui/assets/{dist-zgYUl2B-.js → dist-DFbnFNpX.js} +1 -1
  60. package/dist/apps/chat-ui/assets/{dist-CNlhGq5i.js → dist-DGLWQLX8.js} +1 -1
  61. package/dist/apps/chat-ui/assets/{dist-BGxHKHPX.js → dist-DfcIkFSN.js} +1 -1
  62. package/dist/apps/chat-ui/assets/{dist-DrM-H3e1.js → dist-sKDHTwaT.js} +1 -1
  63. package/dist/apps/chat-ui/assets/{dist-DpmEro5R.js → dist-y9D6la48.js} +1 -1
  64. package/dist/apps/chat-ui/assets/index-C25VYnyb.css +1 -0
  65. package/dist/apps/chat-ui/assets/index-CUkuvI3v.js +165 -0
  66. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-144x144.png +0 -0
  67. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-192x192.png +0 -0
  68. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-48x48.png +0 -0
  69. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-512x512.png +0 -0
  70. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-72x72.png +0 -0
  71. package/dist/apps/chat-ui/assets/pwa-images/android/launchericon-96x96.png +0 -0
  72. package/dist/apps/chat-ui/assets/pwa-images/ios/100.png +0 -0
  73. package/dist/apps/chat-ui/assets/pwa-images/ios/1024.png +0 -0
  74. package/dist/apps/chat-ui/assets/pwa-images/ios/114.png +0 -0
  75. package/dist/apps/chat-ui/assets/pwa-images/ios/120.png +0 -0
  76. package/dist/apps/chat-ui/assets/pwa-images/ios/128.png +0 -0
  77. package/dist/apps/chat-ui/assets/pwa-images/ios/144.png +0 -0
  78. package/dist/apps/chat-ui/assets/pwa-images/ios/152.png +0 -0
  79. package/dist/apps/chat-ui/assets/pwa-images/ios/16.png +0 -0
  80. package/dist/apps/chat-ui/assets/pwa-images/ios/167.png +0 -0
  81. package/dist/apps/chat-ui/assets/pwa-images/ios/180.png +0 -0
  82. package/dist/apps/chat-ui/assets/pwa-images/ios/192.png +0 -0
  83. package/dist/apps/chat-ui/assets/pwa-images/ios/20.png +0 -0
  84. package/dist/apps/chat-ui/assets/pwa-images/ios/256.png +0 -0
  85. package/dist/apps/chat-ui/assets/pwa-images/ios/29.png +0 -0
  86. package/dist/apps/chat-ui/assets/pwa-images/ios/32.png +0 -0
  87. package/dist/apps/chat-ui/assets/pwa-images/ios/40.png +0 -0
  88. package/dist/apps/chat-ui/assets/pwa-images/ios/50.png +0 -0
  89. package/dist/apps/chat-ui/assets/pwa-images/ios/512.png +0 -0
  90. package/dist/apps/chat-ui/assets/pwa-images/ios/57.png +0 -0
  91. package/dist/apps/chat-ui/assets/pwa-images/ios/58.png +0 -0
  92. package/dist/apps/chat-ui/assets/pwa-images/ios/60.png +0 -0
  93. package/dist/apps/chat-ui/assets/pwa-images/ios/64.png +0 -0
  94. package/dist/apps/chat-ui/assets/pwa-images/ios/72.png +0 -0
  95. package/dist/apps/chat-ui/assets/pwa-images/ios/76.png +0 -0
  96. package/dist/apps/chat-ui/assets/pwa-images/ios/80.png +0 -0
  97. package/dist/apps/chat-ui/assets/pwa-images/ios/87.png +0 -0
  98. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-100.png +0 -0
  99. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-125.png +0 -0
  100. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-150.png +0 -0
  101. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-200.png +0 -0
  102. package/dist/apps/chat-ui/assets/pwa-images/windows/LargeTile.scale-400.png +0 -0
  103. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-100.png +0 -0
  104. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-125.png +0 -0
  105. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-150.png +0 -0
  106. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-200.png +0 -0
  107. package/dist/apps/chat-ui/assets/pwa-images/windows/SmallTile.scale-400.png +0 -0
  108. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-100.png +0 -0
  109. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-125.png +0 -0
  110. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-150.png +0 -0
  111. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-200.png +0 -0
  112. package/dist/apps/chat-ui/assets/pwa-images/windows/SplashScreen.scale-400.png +0 -0
  113. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-100.png +0 -0
  114. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-125.png +0 -0
  115. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-150.png +0 -0
  116. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-200.png +0 -0
  117. package/dist/apps/chat-ui/assets/pwa-images/windows/Square150x150Logo.scale-400.png +0 -0
  118. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-16.png +0 -0
  119. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-20.png +0 -0
  120. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-24.png +0 -0
  121. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-256.png +0 -0
  122. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-30.png +0 -0
  123. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-32.png +0 -0
  124. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-36.png +0 -0
  125. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-40.png +0 -0
  126. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-44.png +0 -0
  127. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-48.png +0 -0
  128. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-60.png +0 -0
  129. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-64.png +0 -0
  130. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-72.png +0 -0
  131. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-80.png +0 -0
  132. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-lightunplated_targetsize-96.png +0 -0
  133. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-16.png +0 -0
  134. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-20.png +0 -0
  135. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-24.png +0 -0
  136. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-256.png +0 -0
  137. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-30.png +0 -0
  138. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-32.png +0 -0
  139. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-36.png +0 -0
  140. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-40.png +0 -0
  141. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-44.png +0 -0
  142. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-48.png +0 -0
  143. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-60.png +0 -0
  144. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-64.png +0 -0
  145. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-72.png +0 -0
  146. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-80.png +0 -0
  147. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.altform-unplated_targetsize-96.png +0 -0
  148. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-100.png +0 -0
  149. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-125.png +0 -0
  150. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-150.png +0 -0
  151. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-200.png +0 -0
  152. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.scale-400.png +0 -0
  153. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-16.png +0 -0
  154. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-20.png +0 -0
  155. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-24.png +0 -0
  156. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-256.png +0 -0
  157. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-30.png +0 -0
  158. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-32.png +0 -0
  159. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-36.png +0 -0
  160. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-40.png +0 -0
  161. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-44.png +0 -0
  162. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-48.png +0 -0
  163. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-60.png +0 -0
  164. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-64.png +0 -0
  165. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-72.png +0 -0
  166. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-80.png +0 -0
  167. package/dist/apps/chat-ui/assets/pwa-images/windows/Square44x44Logo.targetsize-96.png +0 -0
  168. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-100.png +0 -0
  169. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-125.png +0 -0
  170. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-150.png +0 -0
  171. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-200.png +0 -0
  172. package/dist/apps/chat-ui/assets/pwa-images/windows/StoreLogo.scale-400.png +0 -0
  173. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-100.png +0 -0
  174. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-125.png +0 -0
  175. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-150.png +0 -0
  176. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-200.png +0 -0
  177. package/dist/apps/chat-ui/assets/pwa-images/windows/Wide310x150Logo.scale-400.png +0 -0
  178. package/dist/apps/chat-ui/index.html +8 -3
  179. package/dist/apps/chat-ui/manifest.webmanifest +25 -0
  180. package/dist/apps/chat-ui/sw.js +41 -0
  181. package/dist/apps/cli-ui/InkSessionApp.js +1218 -0
  182. package/dist/apps/cli-ui/InkTerminalLine.js +53 -0
  183. package/dist/apps/cli-ui/InkTerminalRow.js +304 -0
  184. package/dist/apps/cli-ui/InkTerminalView.js +25 -0
  185. package/dist/apps/cli-ui/cliSessionsCommand.js +232 -0
  186. package/dist/apps/cli-ui/index.js +8 -0
  187. package/dist/apps/cli-ui/inkColors.js +67 -0
  188. package/dist/apps/cli-ui/inkJson.js +244 -0
  189. package/dist/apps/cli-ui/inkMarkdown.js +122 -0
  190. package/dist/apps/context-files-ui/assets/{dist-DFi2YGux.js → dist-BOiGdrG-.js} +1 -1
  191. package/dist/apps/context-files-ui/assets/{dist-DyfSeBMu.js → dist-DK01b7x4.js} +1 -1
  192. package/dist/apps/context-files-ui/assets/{dist-CwbH_3RN.js → dist-DPG9jOQ-.js} +1 -1
  193. package/dist/apps/context-files-ui/assets/{dist-dTBsFYAl.js → dist-Dp5AH00p.js} +1 -1
  194. package/dist/apps/context-files-ui/assets/{dist-CxRLRmMx.js → dist-DqYw0LH7.js} +1 -1
  195. package/dist/apps/context-files-ui/assets/{dist-MyZgX9K2.js → dist-TF5iO5ML.js} +1 -1
  196. package/dist/apps/context-files-ui/assets/{dist-DQXzt2Ng.js → dist-TbjAhles.js} +1 -1
  197. package/dist/apps/context-files-ui/assets/{dist-YwR9dpb-.js → dist-ZsBbt0uY.js} +1 -1
  198. package/dist/apps/context-files-ui/assets/{dist-CKQF1zEu.js → dist-kmsvtHkH.js} +1 -1
  199. package/dist/apps/context-files-ui/assets/{dist-BJW3917N.js → dist-vnd7PMu3.js} +1 -1
  200. package/dist/apps/context-files-ui/assets/{index-BwRDoHMC.css → index-B92tL3Pp.css} +1 -1
  201. package/dist/apps/context-files-ui/assets/{index-GwvjXytt.js → index-BhAWD3dv.js} +2 -2
  202. package/dist/apps/context-files-ui/index.html +2 -2
  203. package/dist/auth/better-auth.js +2 -1
  204. package/dist/auth/login-actions.js +251 -0
  205. package/dist/auth/openai-codex-usage.js +147 -0
  206. package/dist/bin/pibo.js +0 -0
  207. package/dist/bin/rg.js +15 -0
  208. package/dist/cli-session/fakeSessionSource.js +804 -0
  209. package/dist/cli-session/index.js +3 -0
  210. package/dist/cli-session/localSessionSource.js +1144 -0
  211. package/dist/cli-session/sessionSource.js +13 -0
  212. package/dist/cli.js +142 -14
  213. package/dist/compute/cli.js +415 -0
  214. package/dist/compute/docker.js +827 -0
  215. package/dist/compute/resource-health.js +333 -0
  216. package/dist/compute/resource-policy.js +98 -0
  217. package/dist/config/config.js +9 -5
  218. package/dist/core/context-build.js +677 -0
  219. package/dist/core/model-defaults.js +51 -9
  220. package/dist/core/pibo-home.js +8 -0
  221. package/dist/core/profiles.js +48 -0
  222. package/dist/core/provider-telemetry.js +222 -0
  223. package/dist/core/routed-session.js +441 -47
  224. package/dist/core/runtime-telemetry.js +853 -0
  225. package/dist/core/runtime.js +103 -15
  226. package/dist/core/session-errors.js +47 -0
  227. package/dist/core/session-model.js +39 -0
  228. package/dist/core/session-router.js +292 -62
  229. package/dist/core/shared-app.js +17 -0
  230. package/dist/core/skill-expansion.js +43 -0
  231. package/dist/core/system-prompt-template.js +9 -9
  232. package/dist/core/telemetry-staleness.js +128 -0
  233. package/dist/core/test-output-compaction.js +145 -0
  234. package/dist/core/user-settings.js +73 -0
  235. package/dist/cron/channel.js +28 -0
  236. package/dist/cron/cli.js +230 -0
  237. package/dist/cron/plugin.js +11 -0
  238. package/dist/cron/schedule.js +214 -0
  239. package/dist/cron/service.js +177 -0
  240. package/dist/cron/store.js +349 -0
  241. package/dist/cron/types.js +1 -0
  242. package/dist/data/cli.js +184 -0
  243. package/dist/data/event-log.js +106 -0
  244. package/dist/data/final-app-space-cutover-migration.js +728 -0
  245. package/dist/data/ingest-service.js +389 -0
  246. package/dist/data/message-store.js +62 -0
  247. package/dist/data/navigation-store.js +75 -0
  248. package/dist/data/observation-store.js +46 -0
  249. package/dist/data/payload-store.js +144 -0
  250. package/dist/data/pibo-store.js +59 -0
  251. package/dist/data/schema.js +434 -0
  252. package/dist/data/session-store.js +63 -0
  253. package/dist/data/shared-app-migration.js +757 -0
  254. package/dist/data/sqlite-schema.js +12 -0
  255. package/dist/data/telemetry-preview.js +65 -0
  256. package/dist/data/telemetry-queries.js +212 -0
  257. package/dist/data/telemetry-retention.js +50 -0
  258. package/dist/data/telemetry-rows.js +158 -0
  259. package/dist/data/telemetry.js +357 -0
  260. package/dist/debug/delta-compaction.js +99 -0
  261. package/dist/debug/detail-format.js +86 -0
  262. package/dist/debug/events.js +149 -29
  263. package/dist/debug/failures.js +162 -0
  264. package/dist/debug/index.js +655 -30
  265. package/dist/debug/messages.js +185 -0
  266. package/dist/debug/next-commands.js +6 -0
  267. package/dist/debug/payloads.js +123 -0
  268. package/dist/debug/pty.js +924 -0
  269. package/dist/debug/session.js +45 -15
  270. package/dist/debug/sql.js +1 -1
  271. package/dist/debug/stores.js +18 -13
  272. package/dist/debug/summary.js +72 -0
  273. package/dist/debug/telemetry.js +649 -0
  274. package/dist/debug/tools.js +168 -0
  275. package/dist/debug/trace-render-check.js +151 -0
  276. package/dist/debug/trace.js +152 -27
  277. package/dist/debug/web-artifacts.js +63 -0
  278. package/dist/debug/web-options.js +313 -0
  279. package/dist/debug/web-render-analysis.js +310 -0
  280. package/dist/debug/web-snapshot-browser-scripts.js +303 -0
  281. package/dist/debug/web-streaming-benchmark-analysis.js +605 -0
  282. package/dist/debug/web-streaming-browser-library.js +928 -0
  283. package/dist/debug/web-streaming-browser-scripts.js +242 -0
  284. package/dist/debug/web-streaming-provider-telemetry.js +194 -0
  285. package/dist/debug/web-streaming-report.js +493 -0
  286. package/dist/debug/web-streaming-types.js +1 -0
  287. package/dist/debug/web.js +574 -0
  288. package/dist/gateway/backup.js +83 -0
  289. package/dist/gateway/cli.js +511 -0
  290. package/dist/gateway/fallback.js +155 -0
  291. package/dist/gateway/pidfile.js +84 -0
  292. package/dist/gateway/protocol.js +16 -0
  293. package/dist/gateway/server.js +174 -17
  294. package/dist/gateway/tool.js +54 -51
  295. package/dist/gateway/web.js +74 -2
  296. package/dist/index.js +3 -1
  297. package/dist/local/client.js +3 -3
  298. package/dist/local/extension.js +8 -5
  299. package/dist/plugins/builtin.js +252 -49
  300. package/dist/plugins/chat-vscode-web.js +28 -0
  301. package/dist/plugins/codex-compat.js +0 -41
  302. package/dist/plugins/context-files.js +98 -18
  303. package/dist/plugins/dev-auth.js +124 -0
  304. package/dist/plugins/native-tooling.js +15 -0
  305. package/dist/plugins/registry.js +66 -2
  306. package/dist/plugins/web-annotations.js +27 -0
  307. package/dist/providers/minimax.js +70 -0
  308. package/dist/providers/openai-compat.js +48 -0
  309. package/dist/ralph/channel.js +8 -0
  310. package/dist/ralph/cli.js +152 -0
  311. package/dist/ralph/plugin.js +14 -0
  312. package/dist/ralph/service.js +271 -0
  313. package/dist/ralph/stopping.js +151 -0
  314. package/dist/ralph/store.js +450 -0
  315. package/dist/ralph/templates.js +200 -0
  316. package/dist/ralph/types.js +1 -0
  317. package/dist/reliability/store.js +42 -26
  318. package/dist/runs/registry.js +72 -35
  319. package/dist/session-ui/commandCatalog.js +193 -0
  320. package/dist/session-ui/commandResults.js +95 -0
  321. package/dist/session-ui/index.js +7 -0
  322. package/dist/session-ui/ownerViewModel.js +27 -0
  323. package/dist/session-ui/roomSessionViewModel.js +69 -0
  324. package/dist/session-ui/statusViewModel.js +127 -0
  325. package/dist/session-ui/terminalCards.js +210 -0
  326. package/dist/session-ui/terminalRows.js +937 -0
  327. package/dist/session-ui/terminalValue.js +45 -0
  328. package/dist/sessions/pibo-data-store.js +178 -0
  329. package/dist/sessions/sqlite-store.js +78 -12
  330. package/dist/sessions/store.js +11 -4
  331. package/dist/sessions/workflow-session-kind.js +20 -0
  332. package/dist/setup/cli.js +567 -0
  333. package/dist/shared/trace-async-agent-runs.js +127 -0
  334. package/dist/shared/trace-engine.js +96 -0
  335. package/dist/shared/trace-event-projection.js +679 -0
  336. package/dist/shared/trace-live-reducer.js +191 -0
  337. package/dist/shared/trace-nodes.js +76 -0
  338. package/dist/shared/trace-order.js +11 -10
  339. package/dist/shared/trace-patch-nodes.js +83 -0
  340. package/dist/shared/trace-run-notifications.js +69 -0
  341. package/dist/shared/trace-subagent-links.js +46 -0
  342. package/dist/shared/trace-transcript.js +303 -0
  343. package/dist/shared/trace-types.js +1 -0
  344. package/dist/shared-app.js +4 -0
  345. package/dist/signals/aggregate.js +65 -0
  346. package/dist/signals/events.js +1 -0
  347. package/dist/signals/projector.js +158 -0
  348. package/dist/signals/registry.js +513 -0
  349. package/dist/signals/store.js +1 -0
  350. package/dist/signals/types.js +1 -0
  351. package/dist/skills/cli.js +117 -0
  352. package/dist/tools/agent-browser-leases.js +219 -0
  353. package/dist/tools/agent-browser-wrapper.js +99 -0
  354. package/dist/tools/browser-pool.js +623 -0
  355. package/dist/tools/browser-use-cdp.js +56 -4
  356. package/dist/tools/browser-use-leases.js +215 -37
  357. package/dist/tools/browser-use-wrapper.js +508 -65
  358. package/dist/tools/cdp-client.js +189 -0
  359. package/dist/tools/guides.js +203 -4
  360. package/dist/tools/index.js +666 -16
  361. package/dist/tools/npm-runtime.js +136 -0
  362. package/dist/tools/registry.js +107 -8
  363. package/dist/tools/runtime/index.js +3 -0
  364. package/dist/tools/runtime/node-backend.js +225 -0
  365. package/dist/tools/runtime/node-worker-source.js +206 -0
  366. package/dist/tools/runtime/python-backend.js +227 -0
  367. package/dist/tools/runtime/python-worker-source.js +178 -0
  368. package/dist/tools/runtime/registry.js +255 -0
  369. package/dist/tools/runtime/tool.js +168 -0
  370. package/dist/tools/runtime/types.js +1 -0
  371. package/dist/tools/web-search.js +2 -1
  372. package/dist/user-skills/installer.js +214 -0
  373. package/dist/user-skills/manager.js +35 -0
  374. package/dist/user-skills/store.js +267 -0
  375. package/dist/user-skills/types.js +1 -0
  376. package/dist/web/auth.js +5 -1
  377. package/dist/web/channel.js +86 -0
  378. package/dist/web/http.js +79 -14
  379. package/dist/web-annotations/api.js +348 -0
  380. package/dist/web-annotations/attachments.js +201 -0
  381. package/dist/web-annotations/cdp.js +1107 -0
  382. package/dist/web-annotations/index.js +7 -0
  383. package/dist/web-annotations/store.js +407 -0
  384. package/dist/web-annotations/tools.js +350 -0
  385. package/dist/web-annotations/types.js +34 -0
  386. package/dist/web-annotations/validation.js +288 -0
  387. package/docs/README.md +23 -0
  388. package/docs/ops/install-developer-host.md +112 -0
  389. package/docs/ops/install-user-host.md +76 -0
  390. package/docs/ops/upgrade-user-to-developer-host.md +69 -0
  391. package/package.json +24 -10
  392. package/{.codex/skills → skills/builtin}/pi-agent-harness/SKILL.md +24 -24
  393. package/skills/builtin/pibo-docker-system/SKILL.md +170 -0
  394. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -0
  395. package/skills/builtin/prd/SKILL.md +143 -0
  396. package/skills/builtin/ralph-loop/SKILL.md +359 -0
  397. package/skills/builtin/ralph-prd-json/SKILL.md +123 -0
  398. package/skills/builtin/skill-creator/LICENSE.txt +202 -0
  399. package/skills/builtin/skill-creator/SKILL.md +513 -0
  400. package/skills/builtin/skill-creator/agents/analyzer.md +274 -0
  401. package/skills/builtin/skill-creator/agents/comparator.md +202 -0
  402. package/skills/builtin/skill-creator/agents/grader.md +223 -0
  403. package/skills/builtin/skill-creator/assets/eval_review.html +146 -0
  404. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -0
  405. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -0
  406. package/skills/builtin/skill-creator/references/schemas.md +430 -0
  407. package/skills/builtin/skill-creator/scripts/__init__.py +0 -0
  408. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -0
  409. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -0
  410. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -0
  411. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -0
  412. package/skills/builtin/skill-creator/scripts/quick_validate.py +103 -0
  413. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -0
  414. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -0
  415. package/skills/builtin/skill-creator/scripts/utils.py +47 -0
  416. package/skills/builtin/web-annotations/SKILL.md +93 -0
  417. package/dist/apps/chat-ui/assets/index-B_E935fP.js +0 -151
  418. package/dist/apps/chat-ui/assets/index-Dk-opWl3.css +0 -1
  419. package/dist/env.js +0 -32
  420. package/dist/plugins/core-tools.js +0 -94
  421. package/dist/plugins/example.js +0 -67
  422. package/dist/plugins/remote-agent.js +0 -9
  423. package/dist/remote/channel.js +0 -176
  424. package/dist/remote/client.js +0 -92
  425. package/dist/remote/examples/tui-controller.js +0 -263
  426. package/dist/remote/protocol.js +0 -55
  427. package/dist/remote/session-client.js +0 -189
  428. package/dist/sessions/bindings.js +0 -41
  429. /package/{.codex/skills → skills/builtin}/pi-agent-harness/agents/openai.yaml +0 -0
package/README.md CHANGED
@@ -1,318 +1,174 @@
1
1
  # pibo
2
2
 
3
- Pibo turns Pi Coding Agent into an agent-native runtime with discoverable CLI tools, plugins, channels, and local gateways.
3
+ Pibo is a thin product boundary around Pi Coding Agent. Pi remains the inner engine for model turns, tools, streaming, sessions, and compaction. Pibo adds profiles, plugins, channels, local gateways, web auth, and operator tooling.
4
4
 
5
- Pi remains the inner engine for model turns, tools, streaming, sessions, and compaction. Pibo owns the outer product boundary: profiles, plugin registration, channels, routing, Pibo Sessions, auth, policy, and transport-specific adapters.
5
+ The default posture is intentionally powerful: Pibo is built for agentic coding and server operation, not for a restrictive sandbox. Install and run it as the Linux user that should own its state and credentials.
6
6
 
7
7
  ## Install
8
8
 
9
- Pibo V1 targets Node.js 24+.
9
+ Pibo is distributed as an npm package:
10
10
 
11
11
  ```bash
12
12
  npm install -g @pasko70/pibo
13
13
  pibo --help
14
14
  ```
15
15
 
16
- For local development from source:
16
+ The current package declares Node.js 24+. Some Linux distributions still ship Node 22 through `apt`, so install a recent Node release first when needed. A user-local Node/npm setup through `nvm`, `fnm`, or a user-writable npm prefix works well.
17
+
18
+ For a user-local global npm prefix:
17
19
 
18
20
  ```bash
19
- npm install
20
- npm run build
21
- npm run start -- --help
21
+ mkdir -p ~/.local
22
+ npm config set prefix ~/.local
23
+ export PATH="$HOME/.local/bin:$PATH"
24
+ npm install -g @pasko70/pibo
22
25
  ```
23
26
 
24
- ## Docs
25
-
26
- - `docs/architecture.md` describes the current runtime architecture and boundaries.
27
- - `docs/mcp.md` documents the MCP CLI and registry.
28
- - `docs/tools.md` documents curated external CLI tools.
29
- - `docs/pi-packages.md` documents registered Pi Coding Agent packages and per-agent selection.
30
- - `docs/agent-run-yield-spec.md` documents yielded agent runs and run-control tools.
31
- - `docs/chat-rooms-event-log.md` documents Chat Web rooms, default-room startup, durable chat events, unread cursors, SSE cursors, and idempotent sends.
32
- - `docs/codex-compact-terminal-design.md` documents the compact Codex-style Chat session view.
33
- - `docs/progress.md` is the short implementation status snapshot.
34
-
35
- ## Scripts
36
-
37
- - `npm run dev` runs the TypeScript entrypoint with `tsx`.
38
- - `npm run profile` prints the selected profile with loaded skills, tools, and context files.
39
- - `npm run profile -- gateway-producer` prints the parked gateway producer profile.
40
- - `npm run profile -- run-yield-qa` prints the yielded-run QA profile with subagents.
41
- - `npm run tui` starts the Pi TUI through the pibo wrapper.
42
- - `npm run tui:gateway` starts the Pi TUI with the gateway producer profile.
43
- - `npm run gateway` starts the local pibo gateway daemon.
44
- - `npm run gateway:web` starts the local gateway with Better Auth, the same-origin web host, and the chat app.
45
- - `npm run client -- <piboSessionId>` starts a console client connected to the gateway.
46
- - `npm run dev -- mcp` lists configured MCP servers and tools.
47
- - `npm run dev -- tools` lists curated external CLI tools.
48
- - `npm run dev -- pi-packages` lists registered Pi Coding Agent packages.
49
- - `npm run dev -- debug` inspects local Pibo SQLite stores.
50
- - `npm run dev -- config keys` lists supported local config keys.
51
- - `npm run build` compiles to `dist/`.
52
- - `npm run start` runs the compiled entrypoint.
53
- - `npm test` builds and runs the test suite.
54
- - `npm run typecheck` checks TypeScript without emitting files.
55
- - `npm run clean` removes `dist/`.
56
-
57
- ## Philosophy
58
-
59
- Keep the wrapper thin. Pi Coding Agent should remain the inner engine; pibo adds only the product boundary we actually need: profiles, plugins, channels, auth, policy, routing, and opt-in operator tooling.
60
-
61
- Optional integrations stay outside the core package until the user installs them. MCP servers, Python virtual environments, and third-party CLIs are configured on demand through `pibo mcp` and `pibo tools`, not bundled into pibo itself.
62
-
63
- ## Plugin Layer
64
-
65
- `src/plugins/` contains the minimal static plugin layer. Built-in plugins register tools, subagents, skills, context files, profiles, gateway actions, event listeners, channels, auth services, and web apps through `PiboPluginRegistry`.
66
-
67
- This is an extension boundary, not a marketplace. Plugins are internal and statically loaded for now, which keeps the runtime simple while supporting web auth, web apps, new tools, new skills, subagents, and future transports.
68
-
69
- The gateway producer plugin is parked outside the default plugin registry. It remains available for explicit local gateway experiments through the `gateway-producer` profile.
70
-
71
- ## Channels And Pibo Sessions
72
-
73
- Plugins can register channels through `api.registerChannel(...)`. A channel maps an external transport into pibo events and maps pibo output events back to that transport.
74
-
75
- The channel context exposes only the pibo boundary:
76
-
77
- - `emit(event)` sends a `PiboInputEvent` to the session router.
78
- - `subscribe(listener)` receives normalized `PiboOutputEvent` values.
79
- - `getSession(id)`, `createSession(...)`, `updateSession(...)`, `deleteSession(...)`, and `findSessions(...)` work with first-class Pibo Session records.
80
- - `getGatewayActions()` exposes discoverable execution actions for channel UIs.
81
-
82
- Pibo Sessions are stored in SQLite by default at `.pibo/pibo-sessions.sqlite`. A Pibo Session keeps product identity (`id`), technical Pi identity (`piSessionId`), channel, kind, profile, owner scope, optional parent/origin relationships, optional workspace, title, and plugin metadata.
83
-
84
- In the Chat Web App, personal sessions can be archived before deletion. Permanent deletion is available only for archived sessions and requires typing `Delete this session`; it removes the selected Pibo Session, child sessions, and their Chat Web read-model/event-log rows.
85
-
86
- The Chat Web App also has Pibo Rooms. Each user gets a locked `Personal Chat` room automatically. The personal room is shown separately from user-created rooms and cannot be renamed, archived, or deleted. User-created rooms can be archived first, then permanently deleted after typing the room name. Archived rooms remain inspectable and show their contained sessions, but they are read-only: no new sessions, messages, or execution actions can be started in that room. Permanent room deletion removes the room subtree, contained sessions, subagent session descendants, and Chat Web read-model/event-log rows.
87
-
88
- Within the Sessions area, the Chat Web App now has an internal session-view registry. The existing nested trace renderer remains the default `Trace` view, and the same `PiboSessionTraceView` data can also be rendered through a compact Codex-style `Terminal` view selected by `?view=trace|terminal` or by browser-local preference.
89
-
90
- Managed context files are now a first-class product capability. The `pibo.context-files` plugin exposes editable global and agent-scoped markdown context files through `/api/context-files`, stores managed-file metadata and revisions in `.pibo/context-files/context-files.sqlite`, and emits product events when managed files are created, changed, removed, or updated on disk. Plugin-shipped context files remain immutable source files; the product can create linked managed copies from them, track source hashes and link state, diff the managed copy against its source, reset back to source, restore older revisions, or adopt a changed source as the new managed baseline.
91
-
92
- The main source folders are:
93
-
94
- - `src/core/` for runtime, events, profiles, and session routing
95
- - `src/plugins/` for the static plugin registry and built-in plugins
96
- - `src/channels/` for channel contracts
97
- - `src/sessions/` for Pibo Session storage
98
- - `src/gateway/` for the local TCP gateway transport
99
- - `src/runs/` for yielded run tracking and run-control tools
100
- - `src/auth/`, `src/web/`, and `src/apps/` for Better Auth, the same-origin web host, and web apps
101
-
102
- ## Agent Designer
103
-
104
- The Chat Web App includes an Agent Designer in the Agents area. It creates custom agents, persists them in `.pibo/chat-agents.sqlite`, and registers each saved agent as a dynamic profile for routed sessions.
105
-
106
- The Agents area uses one sidebar for both editable custom agents and read-only plugin profiles. Plugin profiles can be inspected with their registered tools, skills, context files, subagents, built-in tool mode, and run-control package state, then copied into a custom agent when changes are needed.
107
-
108
- Custom agent names are profile names. They must be lowercase kebab-case, such as `test-agent`, and are used consistently in the UI, session records, and backend profile registry. Legacy `custom-agent:agent_*` names remain aliases for existing agents.
109
-
110
- Custom agents can be archived before deletion. Archived custom agents are removed from the active profile catalog, cannot start new sessions, and become read-only until restored. Permanent deletion is available only for archived agents and requires typing the agent profile name; it deletes the custom agent and Chat sessions using that profile.
111
-
112
- The designer configures native Pibo agent capabilities only: plugin-registered tools, skills, context files, subagents, automatic local context-file loading, built-in Pi tool visibility, and capability packages such as `pibo-run-control`. Curated external CLI tools from `pibo tools` remain global operator tooling and are not selected per agent.
113
-
114
- The Chat Web App now also has a dedicated Context area at `/apps/chat/context`. It reuses the managed context-file APIs inside the main Chat UI shell so operators can create, edit, relocate, and remove managed context files without leaving the authenticated Chat Web App. Plugin context files are shown there as read-only sources, and both the Context area and Agent Designer can create linked managed copies when a user wants to customize shipped content safely.
115
-
116
- The Context area also exposes the Pibo Base Prompt. The library prompt lives at `context/pibo-system-prompt.md`; the Chat Web App can switch between that read-only library prompt and a persisted custom prompt stored under `.pibo/base-prompt.md`. Runtime prompt templates replace `{{availableTools}}` and `{{guidelines}}` from the active Pi/Pibo tool surface before project context and skills are appended.
117
-
118
- The Context area also exposes the Pibo Compaction Prompt. The library prompt lives at `context/pibo-compaction-prompt.md`; the Chat Web App can switch between that read-only library prompt and a persisted custom prompt stored under `.pibo/compaction-prompt.md`. At runtime Pibo handles Pi's `session_before_compact` hook and uses the active compaction prompt sections for summary creation, update-summary creation, and split-turn prefix summaries.
119
-
120
- ## Profiles
121
-
122
- The default profile is registered by the core plugin. It loads the local `pi-agent-harness` skill and uses Pi Coding Agent's built-in tools for normal coding work.
123
-
124
- The `codex` alias resolves to the `codex-compat-openai-web` profile. It keeps the Pibo runtime boundary while exposing Codex-like coding affordances: Pi/Pibo `read`, `edit`, and `write`; Pibo run-control `bash`; native `web_search`; `apply_patch` and `view_image`; generated `pibo_subagent_default`, `pibo_subagent_explorer`, and `pibo_subagent_worker`; and the `pibo_run_*` lifecycle tools. `web_search` is a normal Pibo native tool with a provider adapter; the default adapter injects OpenAI Responses hosted `web_search` into the model request instead of using a local DuckDuckGo function tool. It intentionally does not expose Pi's separate `grep`, `find`, or `ls` tools by default; codebase search remains Codex-style through `bash` and commands such as `rg`.
125
-
126
- Profiles can opt into registered subagents. Pibo exposes enabled subagents to Pi as generated tools named `pibo_subagent_<name>`, routed through normal pibo sessions. Generated subagent tools are always parallel-capable; agents sequence subagent work by waiting for a direct result before issuing a later call or by using `pibo_run_start` for yielded work.
27
+ ## State and user paths
127
28
 
128
- Subagent sessions use `parentId` for hierarchy and inherit the parent session's `metadata.chatRoomId` when the parent belongs to a Chat Web room, so room-scoped session views and room deletion include subagent work.
129
-
130
- The `run-yield-qa` profile adds two simple QA subagents. Profiles with yieldable tools can expose generated run-control tools through the `pibo-run-control` capability package:
29
+ Pibo stores product-wide state under:
131
30
 
132
31
  ```text
133
- pibo_run_start
134
- pibo_run_list
135
- pibo_run_status
136
- pibo_run_wait
137
- pibo_run_read
138
- pibo_run_cancel
139
- pibo_run_ack
32
+ ${PIBO_HOME:-~/.pibo}
140
33
  ```
141
34
 
142
- Try the QA profile through the routed runtime:
35
+ That means the executing Linux user owns the installation state:
143
36
 
144
- ```bash
145
- npm run profile -- run-yield-qa
146
- npm run tui:routed -- run-yield-qa
37
+ ```text
38
+ alice -> /home/alice/.pibo
39
+ pibo -> /home/pibo/.pibo
40
+ root -> /root/.pibo
147
41
  ```
148
42
 
149
- Subagent profiles require the routed runtime. Do not use direct `npm run tui -- run-yield-qa` for this profile.
150
-
151
- ## Gateway
152
-
153
- The gateway is the current local transport boundary. It owns the session router, accepts newline-delimited JSON frames over TCP, routes messages by Pibo Session ID, and broadcasts normalized session events back to connected clients.
154
-
155
- The parked gateway producer profile adds `pibo_gateway_send`, a tool that sends a message into a target gateway session and returns the correlated assistant reply. See `examples/gateway/README.md` for the two supported manual flows.
156
-
157
- ## MCP CLI
158
-
159
- Pibo includes an MCP helper CLI under `pibo mcp`. It reads MCP server definitions from `mcp_servers.json`, starts stdio or HTTP MCP servers, lists their tools, shows schemas, searches by glob, and calls tools from shell-friendly JSON input. See `docs/mcp.md` for the full guide.
160
-
161
- ```bash
162
- npm run dev -- mcp
163
- npm run dev -- mcp info filesystem
164
- npm run dev -- mcp grep "*file*"
165
- npm run dev -- mcp call filesystem read_file '{"path":"README.md"}'
166
- ```
43
+ There is no requirement to run as `root`. If you SSH as root and run Pibo, state naturally lands in `/root/.pibo`. If you create or use a dedicated user, state lands in that user's home. This is the preferred way to keep SSH keys, config, logs, and sessions separated.
167
44
 
168
- The config file is created automatically as `mcp_servers.json` when needed. Manage it with:
45
+ Workspace-scoped files are separate and live under the active workspace:
169
46
 
170
- ```bash
171
- npm run dev -- mcp config init
172
- npm run dev -- mcp config help
173
- npm run dev -- mcp config path
174
- npm run dev -- mcp config paths
175
- npm run dev -- mcp config schema
176
- npm run dev -- mcp config add filesystem '{"command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","."]}'
177
- npm run dev -- mcp config add deepwiki '{"url":"https://mcp.deepwiki.com/mcp"}'
178
- npm run dev -- mcp config remove filesystem
47
+ ```text
48
+ <workspace>/.pibo
179
49
  ```
180
50
 
181
- Pibo also ships a small MCP registry for common optional servers. Presets are not active by default; install one when you want it:
182
-
183
- ```bash
184
- npm run dev -- mcp registry list
185
- npm run dev -- mcp registry show <name>
186
- npm run dev -- mcp registry doctor <name>
187
- npm run dev -- mcp registry install <name>
188
- npm run dev -- mcp registry remove <name>
189
- ```
51
+ Examples include custom prompts and Pi package registrations.
190
52
 
191
- The registry currently has no bundled presets. The command surface remains in place so curated external MCP servers can be added later without changing the config model.
53
+ ## Server notes
192
54
 
193
- Config lookup order is `-c/--config`, `MCP_CONFIG_PATH`, `./mcp_servers.json`, `~/.mcp_servers.json`, then `~/.config/mcp/mcp_servers.json`. Use `MCP_NO_DAEMON=1` to force fresh MCP connections instead of using the short-lived connection cache.
55
+ A fresh server install usually needs only three decisions:
194
56
 
195
- ## CLI Tools
57
+ 1. Choose the Linux user that should own Pibo.
58
+ 2. Install Node.js 24+ for that user or system-wide.
59
+ 3. Install Pibo through npm.
196
60
 
197
- Pibo includes a separate `pibo tools` registry for curated external CLI tools. These tools are not MCP servers and their guides are not loaded into every agent profile. Agents can discover them on demand:
61
+ Use the setup planner to keep the first run simple:
198
62
 
199
63
  ```bash
200
- npm run dev -- tools list
201
- npm run dev -- tools installed
202
- npm run dev -- tools show browser-use
203
- npm run dev -- tools install browser-use
204
- npm run dev -- tools remove browser-use
205
- npm run dev -- tools doctor browser-use
206
- npm run dev -- tools guides browser-use
207
- npm run dev -- tools guide browser-use browser-use
208
- npm run dev -- tools guide browser-use remote-browser
209
- npm run dev -- tools path browser-use
210
- npm run dev -- tools env browser-use
211
- npm run dev -- tools browser-use
212
- npm run dev -- tools browser-use targets
213
- npm run dev -- tools browser-use attach-chat
214
- npm run dev -- tools browser-use lease acquire
64
+ pibo setup doctor --domain pibo.example.com --expected-ip <server-ip>
65
+ pibo setup user-host --domain pibo.example.com --print-files
66
+ pibo setup user-host --domain pibo.example.com --write-to /tmp/pibo-setup
215
67
  ```
216
68
 
217
- The first curated tool is `browser-use`, pinned to `browser-use[cli]==0.12.6` so the CLI surface stays aligned with the bundled guides. It is installed into an isolated runtime under `~/.pibo/tools/browser-use` and uses `~/.pibo/tools/browser-use/home` as its tool home. See `docs/tools.md`.
69
+ This is the normal user path: one gateway, one `PIBO_HOME`, no required Docker, no dev gateway, and no GitHub App setup. After reviewing staged files, use `--apply --yes` to write the generated systemd/Caddy files.
218
70
 
219
- When using Browser Use from this repo, initialize its shell environment once in a persistent terminal with `eval "$(npm run --silent dev -- tools env browser-use)"`, then run later `browser-use` commands directly in that same terminal.
220
-
221
- For Chat Web debugging, start by reusing the browser that already exists: `npm run dev -- tools browser-use targets` lists Chrome CDP targets with Chat auth/composer hints, and `npm run dev -- tools browser-use attach-chat` exports the best authenticated Chat target for direct CDP inspection.
222
-
223
- ## Debug CLI
224
-
225
- Pibo includes a local operator CLI under `pibo debug` for targeted SQLite diagnostics. It is not an agent profile tool and does not load Pi transcripts or full Chat Web payloads automatically.
71
+ Developer hosts are opt-in and add production/dev separation plus Docker compute workers:
226
72
 
227
73
  ```bash
228
- npm run dev -- debug db stores
229
- npm run dev -- debug db schema sessions
230
- npm run dev -- debug db query sessions "select id, profile from pibo_sessions limit 5"
231
- npm run dev -- debug session /apps/chat/rooms/<roomId>/sessions/<piboSessionId>
232
- npm run dev -- debug trace <piboSessionId> --running-only
233
- npm run dev -- debug trace <piboSessionId> --check
234
- npm run dev -- debug events <piboSessionId> --type tool_execution_finished --fields toolName,toolCallId,result.details.status
235
- npm run dev -- debug events stats --topic pibo.output --session <piboSessionId> --retention live_delta
236
- npm run dev -- debug events prune --topic pibo.output --retention live_delta --before 2026-05-01T00:00:00.000Z
237
- ```
238
-
239
- `pibo debug db query` opens known stores read-only, accepts only one read-only SQL statement, applies a default row limit when the query has no `limit`, and supports `--json` for machine-readable output. `pibo debug trace` rebuilds the same Chat Web trace view as `/api/chat/trace`; `--check` adds trace consistency diagnostics for ids, parents, stable order metadata, and source/stable-key coverage. `pibo debug events` extracts selected payload fields without dumping full event payloads, can summarize retained event counts by topic/session/retention class, and can prune old `live_delta` rows once replay consumers no longer need them.
74
+ pibo setup developer-host \
75
+ --origin git@github.com:<your-fork>/pibo.git \
76
+ --prod-domain pibo.example.com \
77
+ --dev-domain dev.pibo.example.com \
78
+ --print-files
240
79
 
241
- ## Web Auth
80
+ pibo setup developer-host \
81
+ --origin git@github.com:<your-fork>/pibo.git \
82
+ --prod-domain pibo.example.com \
83
+ --dev-domain dev.pibo.example.com \
84
+ --write-to /tmp/pibo-setup
85
+ ```
242
86
 
243
- `npm run gateway:web` starts three separate pieces on the same origin:
87
+ See `docs/ops/install-user-host.md`, `docs/ops/install-developer-host.md`, and `docs/ops/upgrade-user-to-developer-host.md`. Developer-host services are source-pinned so production and dev do not fight over one global `pibo` symlink. Docker and swap are developer-host prerequisites only; verify them with `pibo setup doctor --require-docker --min-swap-gb 8`.
244
88
 
245
- - `pibo.better-auth` registers the Better Auth service and owns `/api/auth/*`.
246
- - `pibo.web-host` owns the HTTP server and dispatches same-origin web apps.
247
- - `pibo.chat-web` registers the chat app under `/apps/chat` and `/api/chat/*`.
89
+ If the agent should be able to perform server administration, give that Linux user the required sudo or Docker permissions explicitly. Pibo does not need a special onboarding user to work correctly; normal Unix ownership is enough.
248
90
 
249
- V1 uses Better Auth with Google OAuth, the Better Auth bearer plugin, and SQLite at `.pibo/auth.sqlite`. Add the exact Google OAuth redirect URI for your instance. For local QA with `auth.baseURL` set to `http://localhost:4788`, use:
91
+ ## Docker notes
250
92
 
251
- ```text
252
- http://localhost:4788/api/auth/callback/google
253
- ```
254
-
255
- For a deployed instance, replace the host with that instance's public HTTPS origin:
93
+ Docker is optional. If you run Pibo in a container, avoid hard-coding `/root` unless the container is intentionally root-owned. Prefer mapping the host user's state into the container user's home:
256
94
 
257
95
  ```text
258
- https://pibo.example.com/api/auth/callback/google
96
+ $HOME/.pibo -> /home/pibo/.pibo
97
+ $HOME/code -> /workspace/code
259
98
  ```
260
99
 
261
- LAN development through an sslip.io host is also supported when a local reverse proxy exposes Pibo on port 80:
100
+ Set `HOME` and `PIBO_HOME` consistently inside the container so the same path rule applies:
262
101
 
263
102
  ```text
264
- http://4788.192.168.0.204.sslip.io/api/auth/callback/google
103
+ HOME=/home/pibo
104
+ PIBO_HOME=/home/pibo/.pibo
265
105
  ```
266
106
 
267
- Google OAuth redirect URIs are exact per instance. Wildcard or "all deployments" redirects are not supported for this web-server flow, so each self-hosted deployment needs its own Google OAuth client or an explicitly configured redirect URI.
107
+ ## Web gateway auth
268
108
 
269
- Required config values:
109
+ `pibo gateway:web` starts the authenticated web runtime. It requires Better Auth configuration before production use. This step is intentionally not automated because you must create/select the Google OAuth client and allowed user list:
270
110
 
271
111
  ```bash
272
- npm run dev -- config set auth.baseURL http://localhost:4788
273
- npm run dev -- config set auth.secret <32+ character secret>
274
- npm run dev -- config set auth.googleClientId <google oauth client id>
275
- npm run dev -- config set auth.googleClientSecret <google oauth client secret>
276
- npm run dev -- config set auth.allowedEmails you@example.com,friend@example.com
112
+ pibo config set auth.baseURL https://your-host.example
113
+ pibo config set auth.secret <at-least-32-characters>
114
+ pibo config set auth.googleClientId <google-client-id>
115
+ pibo config set auth.googleClientSecret <google-client-secret>
116
+ pibo config set auth.allowedEmails you@example.com
277
117
  ```
278
118
 
279
- For LAN access from another device, set the public origin as both the Better Auth base URL and a trusted origin:
280
-
281
- ```bash
282
- npm run dev -- config set auth.baseURL http://4788.192.168.0.204.sslip.io
283
- npm run dev -- config set auth.trustedOrigins http://4788.192.168.0.204.sslip.io
284
- ```
119
+ For local loopback testing, `auth.baseURL` can be `http://localhost:4788`.
285
120
 
286
- The web host binds to `127.0.0.1` when `auth.baseURL` is loopback. When `auth.baseURL` is a non-loopback host, `npm run gateway:web` binds the HTTP web host to `0.0.0.0` by default. The internal TCP gateway remains on loopback.
121
+ ## Development from source
287
122
 
288
- When running behind a local nginx sslip.io proxy, preserve the original browser origin:
123
+ Use source installs for development, not normal usage:
289
124
 
290
- ```nginx
291
- proxy_set_header Host 127.0.0.1:$target_port;
292
- proxy_set_header X-Forwarded-Proto $scheme;
293
- proxy_set_header X-Forwarded-Host $host;
294
- proxy_pass http://127.0.0.1:$target_port;
125
+ ```bash
126
+ git clone git@github.com:Pascapone-server/pibo.git
127
+ cd pibo
128
+ npm install
129
+ npm run build
130
+ npm run start -- --help
295
131
  ```
296
132
 
297
- Pibo trusts `X-Forwarded-Host` and `X-Forwarded-Proto` only from loopback proxy connections. Chat mutation routes still require JSON and same-origin `Origin` headers.
298
-
299
- `auth.secret` must be at least 32 characters. `auth.allowedEmails` must contain at least one email; pibo fails closed if the allowlist is missing or empty. Authenticated Google users whose email is not listed receive `403` from the pibo web API. Unauthenticated pibo API requests receive `401`.
133
+ Useful scripts:
300
134
 
301
- All web chat API requests require Better Auth, including localhost.
135
+ ```bash
136
+ npm run dev -- --help
137
+ npm run profile -- codex
138
+ npm run tui:routed -- codex
139
+ npm run gateway
140
+ npm run gateway:web
141
+ npm test
142
+ npm run typecheck
143
+ ```
302
144
 
303
- The Google provider requests `prompt=select_account`, so signing out of pibo and signing in again lets the user choose a different Google account. Pibo signout clears the Better Auth session; it does not sign the user out of Google globally.
145
+ ## Main CLI areas
304
146
 
305
- ## Config CLI
147
+ ```bash
148
+ pibo config # local config under ${PIBO_HOME:-~/.pibo}/config.json
149
+ pibo mcp # discover and call configured MCP servers
150
+ pibo tools # install and inspect curated external CLI tools
151
+ pibo pi-packages # register Pi Coding Agent packages
152
+ pibo debug # inspect local Pibo data stores
153
+ pibo setup # plan user-host installs and developer-host upgrades
154
+ pibo profile # inspect runtime profiles
155
+ pibo tui # start the direct Pi TUI
156
+ pibo tui:routed # start the routed Pibo TUI
157
+ pibo gateway # local gateway runtime
158
+ pibo gateway:web # authenticated web gateway runtime
159
+ ```
160
+
161
+ ## Further docs
162
+
163
+ - `docs/architecture.md` describes runtime architecture and boundaries.
164
+ - `docs/mcp.md` documents MCP configuration and commands.
165
+ - `docs/tools.md` documents curated external CLI tools.
166
+ - `docs/pi-packages.md` documents Pi package registration.
167
+ - `docs/chat-rooms-event-log.md` documents Chat Web rooms and durable event storage.
168
+ - `docs/progress.md` is the short implementation status snapshot.
306
169
 
307
- Pibo reads local config from `.pibo/config.json`. The current CLI is intentionally small:
170
+ ## Philosophy
308
171
 
309
- ```bash
310
- npm run dev -- config set auth.allowedEmails you@example.com,friend@example.com
311
- npm run dev -- config get auth.allowedEmails
312
- npm run dev -- config del auth.allowedEmails
313
- npm run dev -- config keys
314
- npm run dev -- config show
315
- ```
172
+ Keep Pibo thin. Pi Coding Agent should remain the inner engine; Pibo owns only the product boundary: profiles, plugins, channels, routing, auth, policy, and operator tooling.
316
173
 
317
- Supported V1 keys are `auth.baseURL`, `auth.secret`, `auth.googleClientId`, `auth.googleClientSecret`, `auth.allowedEmails`, `auth.trustedOrigins`, and `auth.databasePath`.
318
- Secret keys such as `auth.secret` and `auth.googleClientSecret` are stored in full but redacted in `config get` and `config show` output.
174
+ Optional integrations should stay outside the core package until installed. MCP servers, Python virtual environments, external CLIs, and user skills are configured on demand rather than bundled into every runtime.
@@ -99,6 +99,10 @@ In those cases, it is bad to output your proposed solution in a message. You sho
99
99
 
100
100
  If you encounter challenges or blockers, you should attempt to resolve them yourself.
101
101
 
102
+ ## Gateway Daemon
103
+
104
+ Pibo can run as a persistent local gateway daemon (`pibo gateway`). If the gateway needs to be restarted (for example, after installing a package update), use `pibo gateway restart` for a graceful restart. The command sends SIGTERM, waits for the port to become free, spawns a new detached process, and waits until it is reachable again. Use `pibo gateway status` to check whether it is running.
105
+
102
106
  ## 7. Final Answer Instructions
103
107
 
104
108
  Always favor conciseness in your final answer. Usually avoid long-winded explanations and focus only on the most important details. For casual chit-chat, just chat.
@@ -0,0 +1,23 @@
1
+ # Pibo Compute Worker
2
+
3
+ When you need an isolated environment to work in (e.g. to restart the gateway without interrupting the main session, or to run tasks in parallel):
4
+
5
+ 1. Run `pibo compute spawn`.
6
+ 2. You will receive a JSON response with `id`, `gatewayHost` and `gatewayPort`.
7
+ 3. Connect to the worker:
8
+ - Shell access: `docker exec -it <id> bash`
9
+ - Gateway access: connect to `gatewayHost:gatewayPort`
10
+ 4. Do your work inside the worker.
11
+ 5. When finished, run `pibo compute release <id>` to clean up.
12
+
13
+ If you are unsure which workers are running, use `pibo compute list`.
14
+
15
+ If you have recently changed code and need a fresh build, run `pibo compute rebuild` before `spawn`.
16
+
17
+ After worker validation, deploy host-level Chat Web changes to dev first:
18
+
19
+ ```bash
20
+ ./scripts/deploy-web-dev.sh
21
+ ```
22
+
23
+ Use `./scripts/deploy-web.sh` only after dev testing succeeds and production deployment is approved.
@@ -0,0 +1,18 @@
1
+ # Pibo Native Tooling
2
+
3
+ Start with `pibo debug --help`.
4
+
5
+ Use Pibo-owned operator/debug CLI capabilities before ad hoc scripts:
6
+ - `pibo debug session <ps_...>` for session metadata and event summaries.
7
+ - `pibo debug trace <ps_...> --check` for Chat Web trace reconstruction.
8
+ - `pibo debug events <ps_...>` for compact event payload inspection.
9
+ - `pibo debug signals tree <ps_...>` for live session signal state.
10
+ - `pibo debug web ...` for CDP render snapshots, diffs, watch timelines, and Chat Web render scenarios.
11
+ - `pibo debug pty ...` for real PTY-backed CLI/TUI smoke tests, scripted input, assertions, and raw/clean artifacts.
12
+
13
+ For browser access, prefer `pibo tools agent-browser` for fast ref-based browser automation, Browser Use leases for existing Browser Use workflows, and `pibo debug web targets` for render-state analysis. Start with `pibo tools show agent-browser` and `pibo tools guide agent-browser agent-browser`.
14
+ For interactive terminal debugging, start with `pibo debug pty --help`; prefer mocked/deterministic scenarios by default and use `--real-provider` only with bounded `--max-iterations`.
15
+
16
+ Use `pibo skills --help` to manage user skills. This CLI covers user-installed skills only, not built-in or plugin-provided skills. Prefer `pibo skills list --json` when another agent will parse the result.
17
+
18
+ Keep discovery in the CLI: run each command with `--help` before using deeper options.
@@ -1,17 +1,78 @@
1
+ # Agent System
2
+
1
3
  You are an expert coding assistant operating inside pi, a coding agent harness. You help users by reading files, executing commands, editing code, and writing new files.
2
4
 
5
+ ## Tools
6
+
3
7
  Available tools:
4
8
  {{availableTools}}
5
9
 
6
10
  In addition to the tools above, you may have access to other custom tools depending on the project.
7
11
 
8
- Guidelines:
12
+ ## Guidelines
13
+
9
14
  {{guidelines}}
10
15
 
11
- Pi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI):
12
- - Main documentation: /home/pibo/code/pi-mono/packages/coding-agent/README.md
13
- - Additional docs: /home/pibo/code/pi-mono/packages/coding-agent/docs
14
- - Examples: /home/pibo/code/pi-mono/packages/coding-agent/examples (extensions, custom tools, SDK)
15
- - When asked about: extensions (docs/extensions.md, examples/extensions/), themes (docs/themes.md), skills (docs/skills.md), prompt templates (docs/prompt-templates.md), TUI components (docs/tui.md), keybindings (docs/keybindings.md), SDK integrations (docs/sdk.md), custom providers (docs/custom-provider.md), adding models (docs/models.md), pi packages (docs/packages.md)
16
- - When working on pi topics, read the docs and examples, and follow .md cross-references before implementing
17
- - Always read pi .md files completely and follow links to related docs (e.g., tui.md for TUI API details)
16
+ Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
17
+
18
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
19
+
20
+ ## 1. Think Before Coding
21
+
22
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
23
+
24
+ Before implementing:
25
+ - State your assumptions explicitly. If uncertain, ask.
26
+ - If multiple interpretations exist, present them - don't pick silently.
27
+ - If a simpler approach exists, say so. Push back when warranted.
28
+ - If something is unclear, stop. Name what's confusing. Ask.
29
+
30
+ ## 2. Simplicity First
31
+
32
+ **Minimum code that solves the problem. Nothing speculative.**
33
+
34
+ - No features beyond what was asked.
35
+ - No abstractions for single-use code.
36
+ - No "flexibility" or "configurability" that wasn't requested.
37
+ - No error handling for impossible scenarios.
38
+ - If you write 200 lines and it could be 50, rewrite it.
39
+
40
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
41
+
42
+ ## 3. Surgical Changes
43
+
44
+ **Touch only what you must. Clean up only your own mess.**
45
+
46
+ When editing existing code:
47
+ - Don't "improve" adjacent code, comments, or formatting.
48
+ - Don't refactor things that aren't broken.
49
+ - Match existing style, even if you'd do it differently.
50
+ - If you notice unrelated dead code, mention it - don't delete it.
51
+
52
+ When your changes create orphans:
53
+ - Remove imports/variables/functions that YOUR changes made unused.
54
+ - Don't remove pre-existing dead code unless asked.
55
+
56
+ The test: Every changed line should trace directly to the user's request.
57
+
58
+ ## 4. Goal-Driven Execution
59
+
60
+ **Define success criteria. Loop until verified.**
61
+
62
+ Transform tasks into verifiable goals:
63
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
64
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
65
+ - "Refactor X" → "Ensure tests pass before and after"
66
+
67
+ For multi-step tasks, state a brief plan:
68
+ ```
69
+ 1. [Step] → verify: [check]
70
+ 2. [Step] → verify: [check]
71
+ 3. [Step] → verify: [check]
72
+ ```
73
+
74
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
75
+
76
+ ---
77
+
78
+ **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.