@seqyuan/annovibe 0.8.13 → 0.8.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -4
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/react-loadable-manifest.json +6 -6
  6. package/.next/required-server-files.js +1 -1
  7. package/.next/required-server-files.json +1 -1
  8. package/.next/routes-manifest.json +6 -0
  9. package/.next/server/app/_global-error/page.js +3 -3
  10. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/_global-error.html +1 -1
  12. package/.next/server/app/_global-error.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  17. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  18. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  19. package/.next/server/app/_not-found/page.js +2 -2
  20. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/_not-found.html +1 -1
  22. package/.next/server/app/_not-found.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  26. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  28. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  29. package/.next/server/app/api/agent/[id]/events/route.js +2 -2
  30. package/.next/server/app/api/agent/[id]/route.js +1 -1
  31. package/.next/server/app/api/agent/new/route.js +1 -1
  32. package/.next/server/app/api/auth/all-providers/route.js +1 -1
  33. package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
  34. package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
  35. package/.next/server/app/api/auth/login/route.js +1 -1
  36. package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
  37. package/.next/server/app/api/auth/providers/route.js +1 -1
  38. package/.next/server/app/api/auth/status/route.js +1 -1
  39. package/.next/server/app/api/default-cwd/route.js +1 -1
  40. package/.next/server/app/api/files/[...path]/route.js +2 -2
  41. package/.next/server/app/api/harness/route.js +1 -1
  42. package/.next/server/app/api/home/route.js +1 -1
  43. package/.next/server/app/api/internal/runtime/route.js +1 -0
  44. package/.next/server/app/api/internal/runtime/route.js.nft.json +1 -0
  45. package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +1 -0
  46. package/.next/server/app/api/models/route.js +1 -1
  47. package/.next/server/app/api/models-config/discover/route.js +1 -1
  48. package/.next/server/app/api/models-config/route.js +1 -1
  49. package/.next/server/app/api/models-config/test/route.js +1 -1
  50. package/.next/server/app/api/plot-kernels/route.js +1 -1
  51. package/.next/server/app/api/plot-kernels/status/route.js +1 -1
  52. package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
  53. package/.next/server/app/api/projects/browse/route.js +1 -1
  54. package/.next/server/app/api/projects/route.js +2 -2
  55. package/.next/server/app/api/reports/[id]/route.js +7 -4
  56. package/.next/server/app/api/search/route.js +1 -1
  57. package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
  58. package/.next/server/app/api/sessions/[id]/route.js +1 -1
  59. package/.next/server/app/api/sessions/new/route.js +1 -1
  60. package/.next/server/app/api/sessions/route.js +2 -2
  61. package/.next/server/app/api/settings/route.js +1 -1
  62. package/.next/server/app/api/skills/install/route.js +1 -1
  63. package/.next/server/app/api/skills/route.js +2 -2
  64. package/.next/server/app/api/skills/search/route.js +1 -1
  65. package/.next/server/app/api/soul/route.js +1 -1
  66. package/.next/server/app/api/version/route.js +1 -1
  67. package/.next/server/app/favicon.ico/route.js +1 -1
  68. package/.next/server/app/index.html +1 -1
  69. package/.next/server/app/index.rsc +2 -2
  70. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  71. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  72. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  73. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  74. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  75. package/.next/server/app/login/page.js +2 -2
  76. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/login.html +1 -1
  78. package/.next/server/app/login.rsc +1 -1
  79. package/.next/server/app/login.segments/_full.segment.rsc +1 -1
  80. package/.next/server/app/login.segments/_head.segment.rsc +1 -1
  81. package/.next/server/app/login.segments/_index.segment.rsc +1 -1
  82. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  83. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  84. package/.next/server/app/login.segments/login.segment.rsc +1 -1
  85. package/.next/server/app/page.js +13 -13
  86. package/.next/server/app/page.js.nft.json +1 -1
  87. package/.next/server/app/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app-paths-manifest.json +5 -4
  89. package/.next/server/chunks/1688.js +45 -0
  90. package/.next/server/chunks/7601.js +18 -9
  91. package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +6 -0
  92. package/.next/server/middleware-build-manifest.js +1 -1
  93. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  94. package/.next/server/pages/404.html +1 -1
  95. package/.next/server/pages/500.html +1 -1
  96. package/.next/server/server-reference-manifest.json +1 -1
  97. package/.next/static/chunks/51fb665c.9f0b013f33bf4f6d.js +45 -0
  98. package/.next/static/chunks/8771-3e14b6810486df1f.js +1 -0
  99. package/.next/static/chunks/app/_global-error/page-7222ee8be0d45596.js +1 -0
  100. package/.next/static/chunks/app/api/agent/[id]/events/route-7222ee8be0d45596.js +1 -0
  101. package/.next/static/chunks/app/api/agent/[id]/route-7222ee8be0d45596.js +1 -0
  102. package/.next/static/chunks/app/api/agent/new/route-7222ee8be0d45596.js +1 -0
  103. package/.next/static/chunks/app/api/auth/all-providers/route-7222ee8be0d45596.js +1 -0
  104. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-7222ee8be0d45596.js +1 -0
  105. package/.next/static/chunks/app/api/auth/login/[provider]/route-7222ee8be0d45596.js +1 -0
  106. package/.next/static/chunks/app/api/auth/login/route-7222ee8be0d45596.js +1 -0
  107. package/.next/static/chunks/app/api/auth/logout/[provider]/route-7222ee8be0d45596.js +1 -0
  108. package/.next/static/chunks/app/api/auth/providers/route-7222ee8be0d45596.js +1 -0
  109. package/.next/static/chunks/app/api/auth/status/route-7222ee8be0d45596.js +1 -0
  110. package/.next/static/chunks/app/api/default-cwd/route-7222ee8be0d45596.js +1 -0
  111. package/.next/static/chunks/app/api/files/[...path]/route-7222ee8be0d45596.js +1 -0
  112. package/.next/static/chunks/app/api/harness/route-7222ee8be0d45596.js +1 -0
  113. package/.next/static/chunks/app/api/home/route-7222ee8be0d45596.js +1 -0
  114. package/.next/static/chunks/app/api/internal/runtime/route-7222ee8be0d45596.js +1 -0
  115. package/.next/static/chunks/app/api/models/route-7222ee8be0d45596.js +1 -0
  116. package/.next/static/chunks/app/api/models-config/discover/route-7222ee8be0d45596.js +1 -0
  117. package/.next/static/chunks/app/api/models-config/route-7222ee8be0d45596.js +1 -0
  118. package/.next/static/chunks/app/api/models-config/test/route-7222ee8be0d45596.js +1 -0
  119. package/.next/static/chunks/app/api/plot-kernels/route-7222ee8be0d45596.js +1 -0
  120. package/.next/static/chunks/app/api/plot-kernels/status/route-7222ee8be0d45596.js +1 -0
  121. package/.next/static/chunks/app/api/plot-kernels/stop/route-7222ee8be0d45596.js +1 -0
  122. package/.next/static/chunks/app/api/projects/browse/route-7222ee8be0d45596.js +1 -0
  123. package/.next/static/chunks/app/api/projects/route-7222ee8be0d45596.js +1 -0
  124. package/.next/static/chunks/app/api/reports/[id]/route-7222ee8be0d45596.js +1 -0
  125. package/.next/static/chunks/app/api/search/route-7222ee8be0d45596.js +1 -0
  126. package/.next/static/chunks/app/api/sessions/[id]/context/route-7222ee8be0d45596.js +1 -0
  127. package/.next/static/chunks/app/api/sessions/[id]/route-7222ee8be0d45596.js +1 -0
  128. package/.next/static/chunks/app/api/sessions/new/route-7222ee8be0d45596.js +1 -0
  129. package/.next/static/chunks/app/api/sessions/route-7222ee8be0d45596.js +1 -0
  130. package/.next/static/chunks/app/api/settings/route-7222ee8be0d45596.js +1 -0
  131. package/.next/static/chunks/app/api/skills/install/route-7222ee8be0d45596.js +1 -0
  132. package/.next/static/chunks/app/api/skills/route-7222ee8be0d45596.js +1 -0
  133. package/.next/static/chunks/app/api/skills/search/route-7222ee8be0d45596.js +1 -0
  134. package/.next/static/chunks/app/api/soul/route-7222ee8be0d45596.js +1 -0
  135. package/.next/static/chunks/app/api/version/route-7222ee8be0d45596.js +1 -0
  136. package/.next/static/chunks/app/page-2b9d326c910bfdb1.js +270 -0
  137. package/.next/static/chunks/next/dist/client/components/builtin/app-error-7222ee8be0d45596.js +1 -0
  138. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-7222ee8be0d45596.js +1 -0
  139. package/.next/static/chunks/next/dist/client/components/builtin/not-found-7222ee8be0d45596.js +1 -0
  140. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-7222ee8be0d45596.js +1 -0
  141. package/.next/static/chunks/{webpack-5e677f60fa366b60.js → webpack-c223a77d0c5e1b9e.js} +1 -1
  142. package/.next/static/media/pdf.worker.min.29aaf158.mjs +6 -0
  143. package/.next/static/sll--ryodjD6y3JTZNo1d/_buildManifest.js +1 -0
  144. package/.next/trace +75 -74
  145. package/.next/trace-build +1 -1
  146. package/.next/types/app/api/internal/runtime/route.ts +351 -0
  147. package/.next/types/routes.d.ts +2 -1
  148. package/.next/types/validator.ts +9 -0
  149. package/README.md +2 -0
  150. package/bin/pi-web.js +293 -16
  151. package/package.json +1 -1
  152. package/.next/server/chunks/7270.js +0 -45
  153. package/.next/server/chunks/static/media/pdf.worker.min.9df6854a.mjs +0 -6
  154. package/.next/static/Vs4orkHEELAXCLtGxeeGM/_buildManifest.js +0 -1
  155. package/.next/static/chunks/7355-29eaa714eb390050.js +0 -1
  156. package/.next/static/chunks/9b0008ae.2918095672924572.js +0 -45
  157. package/.next/static/chunks/app/_global-error/page-be3bd0fd0e2e6ad6.js +0 -1
  158. package/.next/static/chunks/app/api/agent/[id]/events/route-be3bd0fd0e2e6ad6.js +0 -1
  159. package/.next/static/chunks/app/api/agent/[id]/route-be3bd0fd0e2e6ad6.js +0 -1
  160. package/.next/static/chunks/app/api/agent/new/route-be3bd0fd0e2e6ad6.js +0 -1
  161. package/.next/static/chunks/app/api/auth/all-providers/route-be3bd0fd0e2e6ad6.js +0 -1
  162. package/.next/static/chunks/app/api/auth/api-key/[provider]/route-be3bd0fd0e2e6ad6.js +0 -1
  163. package/.next/static/chunks/app/api/auth/login/[provider]/route-be3bd0fd0e2e6ad6.js +0 -1
  164. package/.next/static/chunks/app/api/auth/login/route-be3bd0fd0e2e6ad6.js +0 -1
  165. package/.next/static/chunks/app/api/auth/logout/[provider]/route-be3bd0fd0e2e6ad6.js +0 -1
  166. package/.next/static/chunks/app/api/auth/providers/route-be3bd0fd0e2e6ad6.js +0 -1
  167. package/.next/static/chunks/app/api/auth/status/route-be3bd0fd0e2e6ad6.js +0 -1
  168. package/.next/static/chunks/app/api/default-cwd/route-be3bd0fd0e2e6ad6.js +0 -1
  169. package/.next/static/chunks/app/api/files/[...path]/route-be3bd0fd0e2e6ad6.js +0 -1
  170. package/.next/static/chunks/app/api/harness/route-be3bd0fd0e2e6ad6.js +0 -1
  171. package/.next/static/chunks/app/api/home/route-be3bd0fd0e2e6ad6.js +0 -1
  172. package/.next/static/chunks/app/api/models/route-be3bd0fd0e2e6ad6.js +0 -1
  173. package/.next/static/chunks/app/api/models-config/discover/route-be3bd0fd0e2e6ad6.js +0 -1
  174. package/.next/static/chunks/app/api/models-config/route-be3bd0fd0e2e6ad6.js +0 -1
  175. package/.next/static/chunks/app/api/models-config/test/route-be3bd0fd0e2e6ad6.js +0 -1
  176. package/.next/static/chunks/app/api/plot-kernels/route-be3bd0fd0e2e6ad6.js +0 -1
  177. package/.next/static/chunks/app/api/plot-kernels/status/route-be3bd0fd0e2e6ad6.js +0 -1
  178. package/.next/static/chunks/app/api/plot-kernels/stop/route-be3bd0fd0e2e6ad6.js +0 -1
  179. package/.next/static/chunks/app/api/projects/browse/route-be3bd0fd0e2e6ad6.js +0 -1
  180. package/.next/static/chunks/app/api/projects/route-be3bd0fd0e2e6ad6.js +0 -1
  181. package/.next/static/chunks/app/api/reports/[id]/route-be3bd0fd0e2e6ad6.js +0 -1
  182. package/.next/static/chunks/app/api/search/route-be3bd0fd0e2e6ad6.js +0 -1
  183. package/.next/static/chunks/app/api/sessions/[id]/context/route-be3bd0fd0e2e6ad6.js +0 -1
  184. package/.next/static/chunks/app/api/sessions/[id]/route-be3bd0fd0e2e6ad6.js +0 -1
  185. package/.next/static/chunks/app/api/sessions/new/route-be3bd0fd0e2e6ad6.js +0 -1
  186. package/.next/static/chunks/app/api/sessions/route-be3bd0fd0e2e6ad6.js +0 -1
  187. package/.next/static/chunks/app/api/settings/route-be3bd0fd0e2e6ad6.js +0 -1
  188. package/.next/static/chunks/app/api/skills/install/route-be3bd0fd0e2e6ad6.js +0 -1
  189. package/.next/static/chunks/app/api/skills/route-be3bd0fd0e2e6ad6.js +0 -1
  190. package/.next/static/chunks/app/api/skills/search/route-be3bd0fd0e2e6ad6.js +0 -1
  191. package/.next/static/chunks/app/api/soul/route-be3bd0fd0e2e6ad6.js +0 -1
  192. package/.next/static/chunks/app/api/version/route-be3bd0fd0e2e6ad6.js +0 -1
  193. package/.next/static/chunks/app/page-7d26edc81d575249.js +0 -270
  194. package/.next/static/chunks/next/dist/client/components/builtin/app-error-be3bd0fd0e2e6ad6.js +0 -1
  195. package/.next/static/chunks/next/dist/client/components/builtin/forbidden-be3bd0fd0e2e6ad6.js +0 -1
  196. package/.next/static/chunks/next/dist/client/components/builtin/not-found-be3bd0fd0e2e6ad6.js +0 -1
  197. package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-be3bd0fd0e2e6ad6.js +0 -1
  198. package/.next/static/media/pdf.worker.min.5f98222a.mjs +0 -6
  199. /package/.next/static/{Vs4orkHEELAXCLtGxeeGM → sll--ryodjD6y3JTZNo1d}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
1
  exports.id=7601,exports.ids=[7601],exports.modules={3867:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{H:()=>p});var e=c(28802),f=c(75430),g=c(15193),h=c(79748),i=c(9774),j=a([e,f,i]);[e,f,i]=j.then?(await j)():j;let q=["Use kernel_plot_run for iterative R/Python plotting when data should stay in memory across turns.",'Use kernel_plot_run with runtime: "worker" for one-shot reproducible scripts.',"In kernel_plot_run code, save every output under WARMPLOT_OUTPUT_DIR.","Do not rely on notebook display; explicitly save PNG/JPEG/WebP previews plus any SVG, PDF, HTML, CSV, TSV, or JSON files.","When an image artifact is produced, the web chat renders the returned image inline; do not claim images cannot be displayed.","Do not use open, xdg-open, or other desktop viewers to show plots; return or reference the saved preview image path instead.","If a plot also has a PDF/SVG version, include the PNG/JPEG/WebP preview path in the final answer, not only the PDF/SVG path.","After a failed kernel_plot_run, inspect stderr and rerun only the minimal corrected code.","Use kernel_plot_stop when the user is done with a large object or asks to free memory."],r=null,s=null;function k(){let a=(0,i.cV)().plotIdleTimeoutMs;if(r&&s===a)return r;let b=r;return s=a,r=Promise.resolve((0,g.n6)({policy:{idleTimeoutMs:a}})),b?.then(a=>a.dispose()).catch(()=>{}),r}function l(a){return a.sessionManager.getSessionId()}function m(a,b=4e3){let c=a??"";return c.length<=b?c:`${c.slice(0,b)}
2
- [truncated ${c.length-b} chars]`}function n(a){return 0===a.length?["artifacts: none"]:["artifacts:",...a.map(a=>`- ${a.path}`)]}async function o(a){let b=a.find(a=>"image"===a.kind&&("image/png"===a.mimeType||"image/jpeg"===a.mimeType||"image/webp"===a.mimeType));if(b)try{let a=await (0,h.stat)(b.path);if(!a.isFile()||a.size>2097152)return;let c=await (0,h.readFile)(b.path);return{type:"image",data:c.toString("base64"),mimeType:b.mimeType}}catch{return}}function p(a){a.registerTool((0,f.defineTool)({name:"kernel_plot_run",label:"Kernel Plot Run",description:"Execute short R or Python plotting code in a warm kernel-lite runtime or one-shot worker and archive generated artifacts.",promptSnippet:"Run short R/Python plotting code in a warm kernel and save artifacts to disk.",promptGuidelines:q,executionMode:"sequential",parameters:e.Type.Object({language:e.Type.Union([e.Type.Literal("python"),e.Type.Literal("r")],{description:"Runtime language for the plotting code."}),code:e.Type.String({description:"R or Python code. Save files under WARMPLOT_OUTPUT_DIR or PI_KERNEL_PLOT_OUTPUT_DIR."}),runtime:e.Type.Optional(e.Type.Union([e.Type.Literal("kernel-lite"),e.Type.Literal("worker")],{description:"kernel-lite keeps language state warm; worker runs a one-shot script."})),title:e.Type.Optional(e.Type.String({description:"Short title for the run."})),timeoutMs:e.Type.Optional(e.Type.Number({description:"Execution timeout in milliseconds."}))}),async execute(a,b,c,d,e){let f,g,h,i=await k(),j=await i.run({cwd:e.cwd,ownerId:l(e),language:b.language,runtime:b.runtime,code:b.code,title:b.title,timeoutMs:b.timeoutMs,signal:c}),p=[{type:"text",text:(f=[`kernel_plot_run ${j.status}`,`run_id: ${j.runId}`,`runtime: ${j.runtime}`,`script: ${j.scriptPath}`,`stdout: ${j.stdoutPath}`,`stderr: ${j.stderrPath}`],g=m(j.stdout,1200).trim(),h=m(j.stderr,1200).trim(),g&&f.push("stdout:",g),h&&f.push("stderr:",h),j.error&&f.push(`error: ${j.error}`),f.push(...n(j.artifacts)),f.join("\n"))}],q=await o(j.artifacts);return q&&p.push(q),{content:p,details:{schema:"kernel-plot.result.v1",kind:"run",run:{runId:j.runId,status:j.status,language:j.language,runtime:j.runtime,title:j.title,stdoutPath:j.stdoutPath,stderrPath:j.stderrPath,scriptPath:j.scriptPath,outputDir:j.outputDir,stdoutPreview:m(j.stdout),stderrPreview:m(j.stderr),error:j.error},artifacts:j.artifacts,nextAction:"succeeded"===j.status?"Inspect the artifact paths or continue iterating with kernel_plot_run.":"Inspect stderr and rerun only the minimal corrected code."}}}})),a.registerTool((0,f.defineTool)({name:"kernel_plot_stop",label:"Kernel Plot Stop",description:"Stop the current Pi session's warm plotting kernel for one language or all languages.",promptSnippet:"Stop warm R/Python plotting kernels and release their memory.",promptGuidelines:q,executionMode:"sequential",parameters:e.Type.Object({language:e.Type.Optional(e.Type.Union([e.Type.Literal("python"),e.Type.Literal("r")]))}),async execute(a,b,c,d,e){let f=await k(),g=l(e);return await f.stopSession({ownerId:g,language:b.language}),{content:[{type:"text",text:`kernel_plot_stop stopped ${b.language??"all languages"}`}],details:{schema:"kernel-plot.result.v1",kind:"stop",stopped:{ownerId:g,language:b.language},artifacts:[],nextAction:"Use kernel_plot_run to start a fresh warm kernel when needed."}}}})),a.registerTool((0,f.defineTool)({name:"kernel_plot_artifacts",label:"Kernel Plot Artifacts",description:"List recent archived plotting artifacts for the current Pi session.",promptSnippet:"List recent R/Python plotting artifact paths for this session.",promptGuidelines:q,parameters:e.Type.Object({limit:e.Type.Optional(e.Type.Number({description:"Maximum number of recent artifacts to list."}))}),async execute(a,b,c,d,e){let f=await k(),g=l(e),h=await f.listArtifacts({cwd:e.cwd,ownerId:g,limit:b.limit});return{content:[{type:"text",text:["kernel_plot_artifacts",...n(h)].join("\n")}],details:{schema:"kernel-plot.result.v1",kind:"artifacts",ownerId:g,artifacts:h,nextAction:"Open or inspect the listed artifact paths, or continue plotting with kernel_plot_run."}}}})),a.on("session_shutdown",async(a,b)=>{let c=await k();await c.stopSession({ownerId:l(b)}).catch(a=>{b.ui.notify(`kernel plot cleanup failed: ${a instanceof Error?a.message:String(a)}`,"warning")})})}d()}catch(a){d(a)}})},9774:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{cV:()=>k,p6:()=>l});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let m={generativeUI:!0,plotIdleTimeoutMs:1728e5};function i(){return(0,f.join)((0,g.getAgentDir)(),"annovibe-settings.json")}function j(a){if(!a||"object"!=typeof a)return{...m};let b="number"==typeof a.plotIdleTimeoutMs&&Number.isFinite(a.plotIdleTimeoutMs)&&a.plotIdleTimeoutMs>=0?Math.min(Math.round(a.plotIdleTimeoutMs),2592e6):m.plotIdleTimeoutMs;return{generativeUI:"boolean"==typeof a.generativeUI?a.generativeUI:m.generativeUI,plotIdleTimeoutMs:b}}function k(){let a=i(),b=(0,e.existsSync)(a)?a:(0,f.join)((0,g.getAgentDir)(),"pidex-settings.json");if(!(0,e.existsSync)(b))return{...m};try{return j(JSON.parse((0,e.readFileSync)(b,"utf8")))}catch{return{...m}}}function l(a){let b=j({...k(),...a}),c=i(),d=(0,f.dirname)(c);return(0,e.existsSync)(d)||(0,e.mkdirSync)(d,{recursive:!0}),(0,e.writeFileSync)(c,JSON.stringify(b,null,2),"utf8"),b}d()}catch(a){d(a)}})},9805:(a,b,c)=>{"use strict";c.d(b,{FE:()=>i,J:()=>h,zN:()=>j});let d='<widget-capability>\nYou can create interactive visualizations using the `show-widget` code fence.\n\nUse `show-widget` by default when visual output is the primary answer. This includes charts, diagrams, flowcharts, dashboards, UI prototypes, mockups, SVG illustrations, icons, logos, infographics, timelines, hierarchies, comparison views, and visual explanations.\n\nFormat:\n```show-widget\n{"title":"Human-readable title","widget_code":"<raw HTML/SVG string>"}\n```\n\nDetailed specs:\nWhen a `<widget-guidelines>` block is present, follow it. It contains the module-specific design rules for the current request.\n\nRequired rules:\n1. `widget_code` is a JSON string: escape quotes and newlines. Always close the JSON object and fence.\n2. Do not include DOCTYPE, html, head, body, iframe, object, embed, form, link, base, or meta tags.\n3. Keep outer backgrounds transparent. The host supplies theme variables.\n4. Use a single concise widget per fence. For multiple widgets, interleave prose and use a separate `show-widget` fence for each widget.\n5. Streaming order: SVG puts `<defs>` before visible shapes; HTML uses `<style>`, then visible markup, then `<script>` last.\n6. Prefer responsive SVG for static visuals and small HTML widgets for controls.\n7. SVG widgets use `<svg width="100%" viewBox="0 0 680 H">` and keep all content inside the viewBox.\n8. Interactive controls must visibly update the output. For Chart.js, call `chart.update()` after changes.\n9. Clickable drill-down actions call `window.__widgetSendMessage("short request")`.\n10. Cross-widget filters publish with `window.__widgetPublish("topic", { key: "value" })`; other widgets listen for `widget-filter`.\n11. Allowed CDN hosts: `cdnjs.cloudflare.com`, `cdn.jsdelivr.net`, `unpkg.com`, `esm.sh`.\n12. CDN scripts must use an `onload` initializer plus an `if (window.Lib) init();` fallback.\n13. Use `min-height` instead of fixed outer `height` to prevent clipping.\n14. Title should be human-readable in the user\'s language.\n15. Put explanatory prose outside the code fence.\n16. Do not output raw ```svg, ```html, or plain Mermaid for visual answers unless the user explicitly asks for source code, raw Markdown, raw Mermaid, or a saved file.\n</widget-capability>',e=/\n?\s*<widget-capability>[\s\S]*?<\/widget-capability>\s*/g,f=/\n?\s*<visualization_harness>[\s\S]*?<\/visualization_harness>\s*/g,g=/\n?\s*<widget-guidelines\b[^>]*>[\s\S]*?<\/widget-guidelines>\s*/g;function h(a){let b=a.toLowerCase();return b.includes("show-widget")&&(b.includes("# visualization harness")||b.includes("## when to visualize")||b.includes("widget format"))}function i(a){return a.replace(e,"\n").replace(f,"\n").replace(g,"\n").replace(/\n{3,}/g,"\n\n").trim()}function j(a){return a.includes("<widget-capability>")?a:a.trim()?`${d}
2
+ [truncated ${c.length-b} chars]`}function n(a){return 0===a.length?["artifacts: none"]:["artifacts:",...a.map(a=>`- ${a.path}`)]}async function o(a){let b=a.find(a=>"image"===a.kind&&("image/png"===a.mimeType||"image/jpeg"===a.mimeType||"image/webp"===a.mimeType));if(b)try{let a=await (0,h.stat)(b.path);if(!a.isFile()||a.size>2097152)return;let c=await (0,h.readFile)(b.path);return{type:"image",data:c.toString("base64"),mimeType:b.mimeType}}catch{return}}function p(a){a.registerTool((0,f.defineTool)({name:"kernel_plot_run",label:"Kernel Plot Run",description:"Execute short R or Python plotting code in a warm kernel-lite runtime or one-shot worker and archive generated artifacts.",promptSnippet:"Run short R/Python plotting code in a warm kernel and save artifacts to disk.",promptGuidelines:q,executionMode:"sequential",parameters:e.Type.Object({language:e.Type.Union([e.Type.Literal("python"),e.Type.Literal("r")],{description:"Runtime language for the plotting code."}),code:e.Type.String({description:"R or Python code. Save files under WARMPLOT_OUTPUT_DIR or PI_KERNEL_PLOT_OUTPUT_DIR."}),runtime:e.Type.Optional(e.Type.Union([e.Type.Literal("kernel-lite"),e.Type.Literal("worker")],{description:"kernel-lite keeps language state warm; worker runs a one-shot script."})),title:e.Type.Optional(e.Type.String({description:"Short title for the run."})),timeoutMs:e.Type.Optional(e.Type.Number({description:"Execution timeout in milliseconds."}))}),async execute(a,b,c,d,e){let f,g,h,i=await k(),j=await i.run({cwd:e.cwd,ownerId:l(e),language:b.language,runtime:b.runtime,code:b.code,title:b.title,timeoutMs:b.timeoutMs,signal:c}),p=[{type:"text",text:(f=[`kernel_plot_run ${j.status}`,`run_id: ${j.runId}`,`runtime: ${j.runtime}`,`script: ${j.scriptPath}`,`stdout: ${j.stdoutPath}`,`stderr: ${j.stderrPath}`],g=m(j.stdout,1200).trim(),h=m(j.stderr,1200).trim(),g&&f.push("stdout:",g),h&&f.push("stderr:",h),j.error&&f.push(`error: ${j.error}`),f.push(...n(j.artifacts)),f.join("\n"))}],q=await o(j.artifacts);return q&&p.push(q),{content:p,details:{schema:"kernel-plot.result.v1",kind:"run",run:{runId:j.runId,status:j.status,language:j.language,runtime:j.runtime,title:j.title,stdoutPath:j.stdoutPath,stderrPath:j.stderrPath,scriptPath:j.scriptPath,outputDir:j.outputDir,stdoutPreview:m(j.stdout),stderrPreview:m(j.stderr),error:j.error},artifacts:j.artifacts,nextAction:"succeeded"===j.status?"Inspect the artifact paths or continue iterating with kernel_plot_run.":"Inspect stderr and rerun only the minimal corrected code."}}}})),a.registerTool((0,f.defineTool)({name:"kernel_plot_stop",label:"Kernel Plot Stop",description:"Stop the current Pi session's warm plotting kernel for one language or all languages.",promptSnippet:"Stop warm R/Python plotting kernels and release their memory.",promptGuidelines:q,executionMode:"sequential",parameters:e.Type.Object({language:e.Type.Optional(e.Type.Union([e.Type.Literal("python"),e.Type.Literal("r")]))}),async execute(a,b,c,d,e){let f=await k(),g=l(e);return await f.stopSession({ownerId:g,language:b.language}),{content:[{type:"text",text:`kernel_plot_stop stopped ${b.language??"all languages"}`}],details:{schema:"kernel-plot.result.v1",kind:"stop",stopped:{ownerId:g,language:b.language},artifacts:[],nextAction:"Use kernel_plot_run to start a fresh warm kernel when needed."}}}})),a.registerTool((0,f.defineTool)({name:"kernel_plot_artifacts",label:"Kernel Plot Artifacts",description:"List recent archived plotting artifacts for the current Pi session.",promptSnippet:"List recent R/Python plotting artifact paths for this session.",promptGuidelines:q,parameters:e.Type.Object({limit:e.Type.Optional(e.Type.Number({description:"Maximum number of recent artifacts to list."}))}),async execute(a,b,c,d,e){let f=await k(),g=l(e),h=await f.listArtifacts({cwd:e.cwd,ownerId:g,limit:b.limit});return{content:[{type:"text",text:["kernel_plot_artifacts",...n(h)].join("\n")}],details:{schema:"kernel-plot.result.v1",kind:"artifacts",ownerId:g,artifacts:h,nextAction:"Open or inspect the listed artifact paths, or continue plotting with kernel_plot_run."}}}})),a.on("session_shutdown",async(a,b)=>{let c=await k();await c.stopSession({ownerId:l(b)}).catch(a=>{b.ui.notify(`kernel plot cleanup failed: ${a instanceof Error?a.message:String(a)}`,"warning")})})}d()}catch(a){d(a)}})},9774:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{cV:()=>k,p6:()=>l});var e=c(29021),f=c(33873),g=c(75430),h=a([g]);g=(h.then?(await h)():h)[0];let m={generativeUI:!0,plotIdleTimeoutMs:1728e5};function i(){return(0,f.join)((0,g.getAgentDir)(),"annovibe-settings.json")}function j(a){if(!a||"object"!=typeof a)return{...m};let b="number"==typeof a.plotIdleTimeoutMs&&Number.isFinite(a.plotIdleTimeoutMs)&&a.plotIdleTimeoutMs>=0?Math.min(Math.round(a.plotIdleTimeoutMs),2592e6):m.plotIdleTimeoutMs;return{generativeUI:"boolean"==typeof a.generativeUI?a.generativeUI:m.generativeUI,plotIdleTimeoutMs:b}}function k(){let a=i(),b=(0,e.existsSync)(a)?a:(0,f.join)((0,g.getAgentDir)(),"pidex-settings.json");if(!(0,e.existsSync)(b))return{...m};try{return j(JSON.parse((0,e.readFileSync)(b,"utf8")))}catch{return{...m}}}function l(a){let b=j({...k(),...a}),c=i(),d=(0,f.dirname)(c);return(0,e.existsSync)(d)||(0,e.mkdirSync)(d,{recursive:!0}),(0,e.writeFileSync)(c,JSON.stringify(b,null,2),"utf8"),b}d()}catch(a){d(a)}})},9805:(a,b,c)=>{"use strict";c.d(b,{FE:()=>i,J:()=>h,zN:()=>j});let d='<widget-capability>\nYou can create interactive visualizations using the `show-widget` code fence.\n\nUse `show-widget` by default when visual output is the primary answer. This includes charts, diagrams, flowcharts, dashboards, UI prototypes, mockups, SVG illustrations, icons, logos, infographics, timelines, hierarchies, comparison views, and visual explanations.\n\nFor diagrams, flowcharts, architecture maps, sequence-style explanations, and Markdown-to-diagram requests, prefer `show-widget` with SVG/HTML over Mermaid. Widgets stream more reliably in this UI. Use Mermaid only when the user explicitly asks for Mermaid source, raw Mermaid, raw Markdown, or a saved Mermaid/Markdown file.\n\nFormat:\n```show-widget\n{"title":"Human-readable title","widget_code":"<raw HTML/SVG string>"}\n```\n\nDetailed specs:\nWhen a `<widget-guidelines>` block is present, follow it. It contains the module-specific design rules for the current request.\n\nRequired rules:\n1. `widget_code` is a JSON string: escape quotes and newlines. Always close the JSON object and fence.\n2. Do not include DOCTYPE, html, head, body, iframe, object, embed, form, link, base, or meta tags.\n3. Keep outer backgrounds transparent. The host supplies theme variables.\n4. Use a single concise widget per fence. For multiple widgets, interleave prose and use a separate `show-widget` fence for each widget.\n5. Streaming order: SVG puts `<defs>` before visible shapes; HTML uses `<style>`, then visible markup, then `<script>` last.\n6. Prefer responsive SVG for static visuals and small HTML widgets for controls.\n7. SVG widgets use `<svg width="100%" viewBox="0 0 680 H">` and keep all content inside the viewBox.\n8. Interactive controls must visibly update the output. For Chart.js, call `chart.update()` after changes.\n9. Clickable drill-down actions call `window.__widgetSendMessage("short request")`.\n10. Cross-widget filters publish with `window.__widgetPublish("topic", { key: "value" })`; other widgets listen for `widget-filter`.\n11. Allowed CDN hosts: `cdnjs.cloudflare.com`, `cdn.jsdelivr.net`, `unpkg.com`, `esm.sh`.\n12. CDN scripts must use an `onload` initializer plus an `if (window.Lib) init();` fallback.\n13. Use `min-height` instead of fixed outer `height` to prevent clipping.\n14. Title should be human-readable in the user\'s language.\n15. Put explanatory prose outside the code fence.\n16. Do not output raw ```svg, ```html, or plain Mermaid for visual answers unless the user explicitly asks for source code, raw Markdown, raw Mermaid, or a saved file.\n17. Do not convert Markdown outlines into Mermaid by default. Render them as a `show-widget` diagram unless Mermaid/source text is explicitly requested.\n</widget-capability>',e=/\n?\s*<widget-capability>[\s\S]*?<\/widget-capability>\s*/g,f=/\n?\s*<visualization_harness>[\s\S]*?<\/visualization_harness>\s*/g,g=/\n?\s*<widget-guidelines\b[^>]*>[\s\S]*?<\/widget-guidelines>\s*/g;function h(a){let b=a.toLowerCase();return b.includes("show-widget")&&(b.includes("# visualization harness")||b.includes("## when to visualize")||b.includes("widget format"))}function i(a){return a.replace(e,"\n").replace(f,"\n").replace(g,"\n").replace(/\n{3,}/g,"\n\n").trim()}function j(a){return a.includes("<widget-capability>")?a:a.trim()?`${d}
3
3
 
4
- ${a}`:d}},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},27348:(a,b,c)=>{"use strict";c.d(b,{WO:()=>B});let d=["interactive","chart","mockup","art","diagram"],e=/\n?\s*<widget-guidelines\b[^>]*>[\s\S]*?<\/widget-guidelines>\s*/g,f="## Core design system\n\n### When to use widgets\n- Use `show-widget` by default when visual output is the primary answer.\n- This includes charts, diagrams, flowcharts, timelines, dashboards, UI prototypes, mockups, SVG illustrations, icons, logos, infographics, hierarchy views, comparisons, and visual explanations.\n- Do not output raw ```svg, ```html, or plain Mermaid for visual answers unless the user explicitly asks for source code, raw Markdown, raw Mermaid, or a saved file.\n- Put explanatory prose outside the code fence. The fence contains exactly one JSON object.\n\n### Format rules\n- `widget_code` is a JSON string: escape quotes and newlines, close the JSON object, then close the fence.\n- Do not include DOCTYPE, html, head, body, iframe, object, embed, form, link, base, or meta tags.\n- Keep outer backgrounds transparent. Use host variables: `--bg`, `--bg-panel`, `--bg-hover`, `--bg-selected`, `--border`, `--text`, `--text-muted`, `--text-dim`, `--accent`, `--accent-hover`.\n- CodePilot-compatible variables are also available: `--color-background-primary`, `--color-background-secondary`, `--color-background-tertiary`, `--color-text-primary`, `--color-text-secondary`, `--color-text-tertiary`, `--color-border-tertiary`, `--color-border-secondary`, `--color-border-primary`, `--font-sans`, `--font-mono`.\n- HTML widgets should stream in this order: `<style>`, visible markup, `<script>`. SVG widgets should put `<defs>` before visible shapes.\n- Use `min-height` instead of fixed outer `height`; avoid bottom clipping at chat widths.\n- Use readable text: no font smaller than 11px, no negative letter spacing, no text overlap.\n\n### Visual style\n- The widget should feel native to chat, not like a foreign embed.\n- Use flat, solid fills with clear borders. Avoid decorative gradients, shadows, blur, glow, neon, and busy backgrounds.\n- Use 2-3 color ramps per widget and gray/slate for structure.\n- Prefer the visualization type that best fits the content. Do not default to one type for every request.\n- Title should be human-readable in the user's language.",g=`## Color and layout
4
+ ${a}`:d}},12039:(a,b,c)=>{"use strict";function d(a){if("assistant"!==a.role)return a;let b=a.content;if(!Array.isArray(b))return a;let c=b.map(a=>("object"!=typeof a||null===a||Array.isArray(a)||"toolCall"!==a.type?null:{type:"toolCall",toolCallId:"string"==typeof a.toolCallId?a.toolCallId:"string"==typeof a.id?a.id:"",toolName:"string"==typeof a.toolName?a.toolName:"string"==typeof a.name?a.name:"",input:"object"!=typeof a.input||null===a.input||Array.isArray(a.input)?"object"!=typeof a.arguments||null===a.arguments||Array.isArray(a.arguments)?{}:a.arguments:a.input})??a);return{...a,content:c}}c.d(b,{B:()=>d})},27348:(a,b,c)=>{"use strict";c.d(b,{WO:()=>B});let d=["interactive","chart","mockup","art","diagram"],e=/\n?\s*<widget-guidelines\b[^>]*>[\s\S]*?<\/widget-guidelines>\s*/g,f="## Core design system\n\n### When to use widgets\n- Use `show-widget` by default when visual output is the primary answer.\n- This includes charts, diagrams, flowcharts, timelines, dashboards, UI prototypes, mockups, SVG illustrations, icons, logos, infographics, hierarchy views, comparisons, and visual explanations.\n- Do not output raw ```svg, ```html, or plain Mermaid for visual answers unless the user explicitly asks for source code, raw Markdown, raw Mermaid, or a saved file.\n- For diagrams, flowcharts, architecture maps, sequence-style explanations, and Markdown-to-diagram requests, prefer `show-widget` with SVG/HTML over Mermaid because widgets stream more reliably in this UI.\n- Put explanatory prose outside the code fence. The fence contains exactly one JSON object.\n\n### Format rules\n- `widget_code` is a JSON string: escape quotes and newlines, close the JSON object, then close the fence.\n- Do not include DOCTYPE, html, head, body, iframe, object, embed, form, link, base, or meta tags.\n- Keep outer backgrounds transparent. Use host variables: `--bg`, `--bg-panel`, `--bg-hover`, `--bg-selected`, `--border`, `--text`, `--text-muted`, `--text-dim`, `--accent`, `--accent-hover`.\n- CodePilot-compatible variables are also available: `--color-background-primary`, `--color-background-secondary`, `--color-background-tertiary`, `--color-text-primary`, `--color-text-secondary`, `--color-text-tertiary`, `--color-border-tertiary`, `--color-border-secondary`, `--color-border-primary`, `--font-sans`, `--font-mono`.\n- HTML widgets should stream in this order: `<style>`, visible markup, `<script>`. SVG widgets should put `<defs>` before visible shapes.\n- Use `min-height` instead of fixed outer `height`; avoid bottom clipping at chat widths.\n- Use readable text: no font smaller than 11px, no negative letter spacing, no text overlap.\n\n### Visual style\n- The widget should feel native to chat, not like a foreign embed.\n- Use flat, solid fills with clear borders. Avoid decorative gradients, shadows, blur, glow, neon, and busy backgrounds.\n- Use 2-3 color ramps per widget and gray/slate for structure.\n- Prefer the visualization type that best fits the content. Do not default to one type for every request.\n- Title should be human-readable in the user's language.",g=`## Color and layout
5
5
 
6
6
  - Palette ramps:
7
7
  - Indigo: \`#EEF2FF/#C7D2FE/#818CF8/#4F46E5/#3730A3\`
@@ -74,6 +74,7 @@ if (window.Chart) init();
74
74
  - Do not include explanatory help text inside the mockup unless the user asked for onboarding copy.`,i],art:[f,g,k,j],diagram:[f,g,k,j,`## Diagrams
75
75
 
76
76
  - Use SVG for flowcharts, architecture diagrams, timelines, dependency maps, sequence-style explanations, hierarchies, cycles, and process views.
77
+ - Prefer SVG/HTML in \`show-widget\` over Mermaid for generated diagrams. Use Mermaid only when the user explicitly asks for Mermaid source, raw Mermaid, raw Markdown, or a saved Mermaid/Markdown file.
77
78
  - Recommended setup: \`<svg width="100%" viewBox="0 0 680 H"><defs><marker id="arrow" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse"><path d="M2 1L8 5L2 9" fill="none" stroke="context-stroke" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></marker></defs>...\`.
78
79
  - Flowchart: left-to-right or top-to-bottom, straight arrows, no more than 4 nodes per row, decision nodes visually distinct.
79
80
  - Timeline: axis line with event markers, staggered labels, dates aligned and readable.
@@ -123,15 +124,15 @@ Chat display rules:
123
124
  - After a successful plot, summarize the result briefly and include both preview image paths and any publication-quality PDF/SVG paths.
124
125
  </plot-mode-guidelines>`,e=/\n?\s*<plot-mode-guidelines>[\s\S]*?<\/plot-mode-guidelines>\s*/g;function f(a){return a.replace(e,"\n").replace(/\n{3,}/g,"\n\n").trim()}function g(a){return a.includes("<plot-mode-guidelines>")?a:a.trim()?`${a.trimEnd()}
125
126
 
126
- ${d}`:d}function h(a){for(let b of a)if("kernel_plot_run"===b)return!0;return!1}},56429:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A4:()=>u,OF:()=>v});var e=c(75430),f=c(40402),g=c(9774),h=c(3867),i=c(9805),j=c(27348),k=c(71887),l=c(44036),m=c(29021),n=c(33873),o=a([e,f,g,h]);[e,f,g,h]=o.then?(await o)():o;class w{constructor(a,b={}){this.inner=a,this.options=b,this.listeners=[],this.unsubscribe=null,this.idleTimer=null,this.onDestroyCallback=null,this._alive=!0}get sessionId(){return this.inner.sessionId}get sessionFile(){return this.inner.sessionFile??""}isAlive(){return this._alive}start(){this.unsubscribe=this.inner.subscribe(a=>{for(let b of(this.resetIdleTimer(),this.listeners))b(a)}),this.resetIdleTimer()}resetIdleTimer(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>this.destroy(),6e5)}onEvent(a){return this.listeners.push(a),()=>{let b=this.listeners.indexOf(a);-1!==b&&this.listeners.splice(b,1)}}onDestroy(a){this.onDestroyCallback=a}async send(a){this.resetIdleTimer();let b=a.type;switch(b){case"prompt":{this.preparePromptContext(a.message);let b=a.images;return this.inner.prompt(a.message,b?.length?{images:b}:void 0).catch(()=>{}),null}case"abort":return await this.inner.abort(),null;case"get_state":{let a=this.inner.model,b=this.inner.getContextUsage();this.applyRuntimePrompts();let c=this.inner.agent.state?.systemPrompt??"",d=(0,g.cV)();return{sessionId:this.inner.sessionId,sessionFile:this.inner.sessionFile??"",isStreaming:this.inner.isStreaming,isCompacting:this.inner.isCompacting,autoCompactionEnabled:this.inner.autoCompactionEnabled,autoRetryEnabled:this.inner.autoRetryEnabled,model:a?{id:a.id,provider:a.provider}:void 0,messageCount:0,pendingMessageCount:0,contextUsage:b?{percent:b.percent,contextWindow:b.contextWindow,tokens:b.tokens}:null,systemPrompt:d.generativeUI?c:(0,i.FE)(c),thinkingLevel:this.inner.agent.state?.thinkingLevel??"off"}}case"set_model":{let{provider:b,modelId:c}=a,d=this.inner.modelRegistry.find(b,c);if(!d)throw Error(`Model not found: ${b}/${c}`);return await this.inner.setModel(d),{id:d.id,provider:d.provider}}case"fork":{let b,c=a.entryId,d=this.inner.sessionManager,g=this.inner.sessionFile;if(!d.isPersisted())return{cancelled:!0};if(!g)throw Error("Persisted session is missing a session file");let h=d.getEntry(c);if(!h)throw Error("Invalid entry ID for forking");let i=d.getSessionDir();if(h.parentId){let a=e.SessionManager.open(g,i).createBranchedSession(h.parentId);if(!a)throw Error("Failed to create forked session");b=a}else{let a=e.SessionManager.create(d.getCwd(),i);a.newSession({parentSession:g}),b=a.getSessionFile()}let j=e.SessionManager.open(b,i).getSessionId();return(0,f.O8)(j,b),this.destroy(),{cancelled:!1,newSessionId:j}}case"navigate_tree":return{cancelled:(await this.inner.navigateTree(a.targetId,{})).cancelled};case"set_thinking_level":{let b=a.level;return this.inner.setThinkingLevel(b),"xhigh"===b&&this.inner.model?.compat?.thinkingFormat==="deepseek"&&this.inner.agent?.state&&(this.inner.agent.state.thinkingLevel="xhigh"),null}case"compact":{let{findCutPoint:b,DEFAULT_COMPACTION_SETTINGS:d}=await Promise.resolve().then(c.bind(c,75430)),e=this.inner.sessionManager.getBranch(),f={...d,...this.inner.settingsManager.getCompactionSettings()},g=-1;for(let a=e.length-1;a>=0;a--)if("compaction"===e[a].type){g=a;break}let h=g+1,i=b(e,h,e.length,f.keepRecentTokens);if((i.isSplitTurn?i.turnStartIndex:i.firstKeptEntryIndex)<=h)throw Error("Conversation too short to compact");return await this.inner.compact(a.customInstructions)}case"set_auto_compaction":return this.inner.setAutoCompactionEnabled(a.enabled),null;case"steer":{this.preparePromptContext(a.message);let b=a.images;return await this.inner.steer(a.message,b?.length?b:void 0),null}case"follow_up":{this.preparePromptContext(a.message);let b=a.images;return await this.inner.followUp(a.message,b?.length?b:void 0),null}case"get_tools":{let a=this.inner.getAllTools(),b=new Set(this.inner.getActiveToolNames());return a.map(a=>({name:a.name,description:a.description,active:b.has(a.name)}))}case"set_tools":{let b=Array.isArray(a.toolNames)?a.toolNames.filter(a=>"string"==typeof a):[];return this.inner.setActiveToolsByName(b),this.applyRuntimePrompts(),null}case"abort_compaction":return this.inner.abortCompaction(),null;case"set_auto_retry":return this.inner.setAutoRetryEnabled(a.enabled),null;default:throw Error(`Unsupported command: ${b}`)}}destroy(){this._alive&&(this._alive=!1,this.idleTimer&&clearTimeout(this.idleTimer),this.unsubscribe?.(),this.onDestroyCallback?.())}preparePromptContext(a){this.applyRuntimePrompts(a)}applyRuntimePrompts(a){if(!this.inner.agent.state||this.options.systemPromptDisabled)return;let b=(0,g.cV)(),c=this.inner.getActiveToolNames(),d=(0,l.R4)(c);if(!b.generativeUI){let a=(0,l.X8)((0,k.NP)((0,i.FE)(p(this.inner))));q(this.inner,r((0,k.zY)(a),d));return}let e=(0,l.X8)((0,k.NP)((0,i.FE)(p(this.inner)))),f=(0,i.zN)(e),h=(0,k.zY)(f),m=r(h,d),n=a?(0,j.WO)(m,a,{force:function(a){try{return a.getBranch().some(a=>!!a&&"object"==typeof a&&"message"===a.type&&!!a.message&&JSON.stringify(a.message).includes("show-widget"))}catch{return!1}}(this.inner.sessionManager)}):m;q(this.inner,n)}}function p(a){return"string"==typeof a._baseSystemPrompt?a._baseSystemPrompt:a.agent.state?.systemPrompt??""}function q(a,b){"string"==typeof a._baseSystemPrompt&&(a._baseSystemPrompt=b),a.agent.state&&(a.agent.state.systemPrompt=b)}function r(a,b){let c=(0,l.X8)(a);return b?(0,l.FJ)(c):c}function s(a){let b=(0,l.X8)((0,k.NP)((0,i.FE)(a.systemPrompt))),c=a.generativeUI?(0,k.zY)((0,i.zN)(b)):(0,k.zY)(b);return r(c,a.plotMode)}function t(){if(!globalThis.__piSessions){globalThis.__piSessions=new Map;let a=()=>globalThis.__piSessions?.forEach(a=>a.destroy());process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piSessions}function u(a){return t().get(a)}async function v(a,b,d,j){let k=t(),o=(globalThis.__piStartLocks||(globalThis.__piStartLocks=new Map),globalThis.__piStartLocks),r=k.get(a);if(r?.isAlive())return{session:r,realSessionId:a};let u=o.get(a);if(u)return u;let v=(async()=>{let a,o=(0,e.getAgentDir)(),r=b?e.SessionManager.open(b,void 0):e.SessionManager.create(d,void 0);void 0!==j&&(a=0===j.length?[]:["read","bash","edit","write","grep","find","ls"]);let t=e.SettingsManager.create(d,o),u=function(a){try{let b=c(83026).resolve(`${a}/package.json`);return(0,n.dirname)(b)}catch{if(!(process.env.ANNOVIBE_PACKAGE_ROOT??process.env.PIDEX_PACKAGE_ROOT))return null;try{let b=(void 0).resolve(`${a}/package.json`);return(0,n.dirname)(b)}catch{return null}}}("@seqyuan/pi-kernel-plot"),v=new e.DefaultResourceLoader({cwd:d,agentDir:o,settingsManager:t,additionalSkillPaths:u?[(0,n.join)(u,"skills")]:[],extensionFactories:[h.H]});await v.reload();let{session:x}=await (0,e.createAgentSession)({cwd:d,agentDir:o,sessionManager:r,settingsManager:t,resourceLoader:v,...void 0!==a?{tools:a}:{}}),y=(0,g.cV)(),z=[],A=(0,n.join)(o,"soul.md");if((0,m.existsSync)(A))try{let a=(0,m.readFileSync)(A,"utf-8").trim();a&&z.push(`<soul>
127
+ ${d}`:d}function h(a){for(let b of a)if("kernel_plot_run"===b)return!0;return!1}},56429:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A4:()=>u,Bj:()=>v,OF:()=>w});var e=c(75430),f=c(40402),g=c(9774),h=c(3867),i=c(9805),j=c(27348),k=c(71887),l=c(44036),m=c(29021),n=c(33873),o=a([e,f,g,h]);[e,f,g,h]=o.then?(await o)():o;let x=["bash","read","edit","write","grep","find","ls"];class y{constructor(a,b={}){this.inner=a,this.options=b,this.listeners=[],this.unsubscribe=null,this.idleTimer=null,this.onDestroyCallback=null,this.busyOperations=new Set,this._alive=!0}get sessionId(){return this.inner.sessionId}get sessionFile(){return this.inner.sessionFile??""}isAlive(){return this._alive}isBusy(){return this.busyOperations.size>0||this.inner.isStreaming||this.inner.isCompacting}getRuntimeStatus(){return{sessionId:this.sessionId,sessionFile:this.sessionFile,busy:this.isBusy(),operations:[...this.busyOperations],isStreaming:this.inner.isStreaming,isCompacting:this.inner.isCompacting}}start(){this.unsubscribe=this.inner.subscribe(a=>{for(let b of(this.resetIdleTimer(),this.listeners))b(a)}),this.resetIdleTimer()}resetIdleTimer(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{this.isBusy()?this.resetIdleTimer():this.destroy()},6e5)}onEvent(a){return this.listeners.push(a),()=>{let b=this.listeners.indexOf(a);-1!==b&&this.listeners.splice(b,1)}}onDestroy(a){this.onDestroyCallback=a}async send(a){this.resetIdleTimer();let b=a.type;switch(b){case"prompt":{if(Array.isArray(a.toolNames)){let b=a.toolNames.filter(a=>"string"==typeof a);this.inner.setActiveToolsByName(b)}this.preparePromptContext(a.message);let b=a.images;return this.trackBusy("prompt",this.inner.prompt(a.message,b?.length?{images:b}:void 0)).catch(()=>{}),null}case"abort":return await this.inner.abort(),null;case"get_state":{let a=this.inner.model,b=this.inner.getContextUsage();this.applyRuntimePrompts();let c=this.inner.agent.state?.systemPrompt??"",d=(0,g.cV)();return{sessionId:this.inner.sessionId,sessionFile:this.inner.sessionFile??"",isStreaming:this.inner.isStreaming,isCompacting:this.inner.isCompacting,autoCompactionEnabled:this.inner.autoCompactionEnabled,autoRetryEnabled:this.inner.autoRetryEnabled,model:a?{id:a.id,provider:a.provider}:void 0,messageCount:0,pendingMessageCount:0,contextUsage:b?{percent:b.percent,contextWindow:b.contextWindow,tokens:b.tokens}:null,systemPrompt:d.generativeUI?c:(0,i.FE)(c),thinkingLevel:this.inner.agent.state?.thinkingLevel??"off"}}case"set_model":{let{provider:b,modelId:c}=a,d=this.inner.modelRegistry.find(b,c);if(!d)throw Error(`Model not found: ${b}/${c}`);return await this.inner.setModel(d),{id:d.id,provider:d.provider}}case"fork":{let b,c=a.entryId,d=this.inner.sessionManager,g=this.inner.sessionFile;if(!d.isPersisted())return{cancelled:!0};if(!g)throw Error("Persisted session is missing a session file");let h=d.getEntry(c);if(!h)throw Error("Invalid entry ID for forking");let i=d.getSessionDir();if(h.parentId){let a=e.SessionManager.open(g,i).createBranchedSession(h.parentId);if(!a)throw Error("Failed to create forked session");b=a}else{let a=e.SessionManager.create(d.getCwd(),i);a.newSession({parentSession:g}),b=a.getSessionFile()}let j=e.SessionManager.open(b,i).getSessionId();return(0,f.O8)(j,b),this.destroy(),{cancelled:!1,newSessionId:j}}case"navigate_tree":return{cancelled:(await this.inner.navigateTree(a.targetId,{})).cancelled};case"set_thinking_level":{let b=a.level;return this.inner.setThinkingLevel(b),"xhigh"===b&&this.inner.model?.compat?.thinkingFormat==="deepseek"&&this.inner.agent?.state&&(this.inner.agent.state.thinkingLevel="xhigh"),null}case"compact":{let{findCutPoint:b,DEFAULT_COMPACTION_SETTINGS:d}=await Promise.resolve().then(c.bind(c,75430)),e=this.inner.sessionManager.getBranch(),f={...d,...this.inner.settingsManager.getCompactionSettings()},g=-1;for(let a=e.length-1;a>=0;a--)if("compaction"===e[a].type){g=a;break}let h=g+1,i=b(e,h,e.length,f.keepRecentTokens);if((i.isSplitTurn?i.turnStartIndex:i.firstKeptEntryIndex)<=h)throw Error("Conversation too short to compact");return await this.trackBusy("compact",this.inner.compact(a.customInstructions))}case"set_auto_compaction":return this.inner.setAutoCompactionEnabled(a.enabled),null;case"steer":{this.preparePromptContext(a.message);let b=a.images;return await this.trackBusy("steer",this.inner.steer(a.message,b?.length?b:void 0)),null}case"follow_up":{this.preparePromptContext(a.message);let b=a.images;return await this.trackBusy("follow_up",this.inner.followUp(a.message,b?.length?b:void 0)),null}case"get_tools":{let a=this.inner.getAllTools(),b=new Set(this.inner.getActiveToolNames());return a.map(a=>({name:a.name,description:a.description,active:b.has(a.name)}))}case"set_tools":{let b=Array.isArray(a.toolNames)?a.toolNames.filter(a=>"string"==typeof a):[];return this.inner.setActiveToolsByName(b),this.applyRuntimePrompts(),null}case"abort_compaction":return this.inner.abortCompaction(),null;case"set_auto_retry":return this.inner.setAutoRetryEnabled(a.enabled),null;default:throw Error(`Unsupported command: ${b}`)}}destroy(){this._alive&&(this._alive=!1,this.idleTimer&&clearTimeout(this.idleTimer),this.unsubscribe?.(),this.onDestroyCallback?.())}preparePromptContext(a){this.applyRuntimePrompts(a)}async trackBusy(a,b){this.busyOperations.add(a),this.resetIdleTimer();try{return await b}finally{this.busyOperations.delete(a),this.resetIdleTimer()}}applyRuntimePrompts(a){if(!this.inner.agent.state||this.options.systemPromptDisabled)return;let b=(0,g.cV)(),c=this.inner.getActiveToolNames(),d=(0,l.R4)(c);if(!b.generativeUI){let a=(0,l.X8)((0,k.NP)((0,i.FE)(p(this.inner))));q(this.inner,r((0,k.zY)(a),d));return}let e=(0,l.X8)((0,k.NP)((0,i.FE)(p(this.inner)))),f=(0,i.zN)(e),h=(0,k.zY)(f),m=r(h,d),n=a?(0,j.WO)(m,a,{force:function(a){try{return a.getBranch().some(a=>!!a&&"object"==typeof a&&"message"===a.type&&!!a.message&&JSON.stringify(a.message).includes("show-widget"))}catch{return!1}}(this.inner.sessionManager)}):m;q(this.inner,n)}}function p(a){return"string"==typeof a._baseSystemPrompt?a._baseSystemPrompt:a.agent.state?.systemPrompt??""}function q(a,b){"string"==typeof a._baseSystemPrompt&&(a._baseSystemPrompt=b),a.agent.state&&(a.agent.state.systemPrompt=b)}function r(a,b){let c=(0,l.X8)(a);return b?(0,l.FJ)(c):c}function s(a){let b=(0,l.X8)((0,k.NP)((0,i.FE)(a.systemPrompt))),c=a.generativeUI?(0,k.zY)((0,i.zN)(b)):(0,k.zY)(b);return r(c,a.plotMode)}function t(){if(!globalThis.__piSessions){globalThis.__piSessions=new Map;let a=()=>globalThis.__piSessions?.forEach(a=>a.destroy());process.once("exit",a),process.once("SIGINT",a),process.once("SIGTERM",a)}return globalThis.__piSessions}function u(a){return t().get(a)}function v(){let a=[...t().values()].filter(a=>a.isAlive()).map(a=>a.getRuntimeStatus()),b=a.filter(a=>a.busy);return{busy:b.length>0,activeSessions:a.length,busySessions:b,sessions:a}}async function w(a,b,d,j){let k=t(),o=(globalThis.__piStartLocks||(globalThis.__piStartLocks=new Map),globalThis.__piStartLocks),r=k.get(a);if(r?.isAlive())return{session:r,realSessionId:a};let u=o.get(a);if(u)return u;let v=(async()=>{let a=(0,e.getAgentDir)(),o=b?e.SessionManager.open(b,void 0):e.SessionManager.create(d,void 0),r=e.SettingsManager.create(d,a),t=function(a){try{let b=c(83026).resolve(`${a}/package.json`);return(0,n.dirname)(b)}catch{if(!(process.env.ANNOVIBE_PACKAGE_ROOT??process.env.PIDEX_PACKAGE_ROOT))return null;try{let b=(void 0).resolve(`${a}/package.json`);return(0,n.dirname)(b)}catch{return null}}}("@seqyuan/pi-kernel-plot"),u=new e.DefaultResourceLoader({cwd:d,agentDir:a,settingsManager:r,additionalSkillPaths:t?[(0,n.join)(t,"skills")]:[],extensionFactories:[h.H]});await u.reload();let{session:v}=await (0,e.createAgentSession)({cwd:d,agentDir:a,sessionManager:o,settingsManager:r,resourceLoader:u,tools:j??x}),w=(0,g.cV)(),z=[],A=(0,n.join)(a,"soul.md");if((0,m.existsSync)(A))try{let a=(0,m.readFileSync)(A,"utf-8").trim();a&&z.push(`<soul>
127
128
  ${a}
128
- </soul>`)}catch{}let B=(0,n.join)(o,"harness.md");if((0,m.existsSync)(B))try{let a=(0,m.readFileSync)(B,"utf-8").trim();a&&!(0,i.J)(a)&&z.push(`<harness>
129
+ </soul>`)}catch{}let B=(0,n.join)(a,"harness.md");if((0,m.existsSync)(B))try{let a=(0,m.readFileSync)(B,"utf-8").trim();a&&!(0,i.J)(a)&&z.push(`<harness>
129
130
  ${a}
130
131
  </harness>`)}catch{}let C=(0,n.join)(d,"memory.md");if((0,m.existsSync)(C))try{let a=(0,m.readFileSync)(C,"utf-8").trim();a&&z.push(`<project_memory>
131
132
  ${a}
132
- </project_memory>`)}catch{}if(z.length>0){let a=x.agent.state?.systemPrompt??"",b=z.join("\n\n");q(x,`${b}
133
+ </project_memory>`)}catch{}if(z.length>0){let a=v.agent.state?.systemPrompt??"",b=z.join("\n\n");q(v,`${b}
133
134
 
134
- ${a}`)}q(x,s({systemPrompt:p(x),generativeUI:y.generativeUI,plotMode:(0,l.R4)(j??x.getActiveToolNames())})),j&&j.length>0&&(x.setActiveToolsByName(j),q(x,s({systemPrompt:p(x),generativeUI:y.generativeUI,plotMode:(0,l.R4)(j)}))),j?.length===0&&q(x,"");let D=new w(x,{systemPromptDisabled:j?.length===0});D.start();let E=x.sessionId,F=x.sessionFile;return F&&(0,f.O8)(E,F),D.onDestroy(()=>k.delete(E)),k.set(E,D),{session:D,realSessionId:E}})().finally(()=>o.delete(a));return o.set(a,v),v}d()}catch(a){d(a)}})},71887:(a,b,c)=>{"use strict";c.d(b,{NP:()=>f,zY:()=>g});let d=`<analysis-report-guidelines>
135
+ ${a}`)}q(v,s({systemPrompt:p(v),generativeUI:w.generativeUI,plotMode:(0,l.R4)(j??v.getActiveToolNames())})),j&&j.length>0&&(v.setActiveToolsByName(j),q(v,s({systemPrompt:p(v),generativeUI:w.generativeUI,plotMode:(0,l.R4)(j)}))),j?.length===0&&q(v,"");let D=new y(v,{systemPromptDisabled:j?.length===0});D.start();let E=v.sessionId,F=v.sessionFile;return F&&(0,f.O8)(E,F),D.onDestroy(()=>k.delete(E)),k.set(E,D),{session:D,realSessionId:E}})().finally(()=>o.delete(a));return o.set(a,v),v}d()}catch(a){d(a)}})},71887:(a,b,c)=>{"use strict";c.d(b,{NP:()=>f,zY:()=>g});let d=`<analysis-report-guidelines>
135
136
  AnnoVibe has a persistent Analysis Report tab. It is for curated analysis deliverables, not a transcript summary.
136
137
 
137
138
  When working on scientific or bioinformatics analysis, keep report-worthy content concise and structured:
@@ -139,6 +140,8 @@ When working on scientific or bioinformatics analysis, keep report-worthy conten
139
140
  - Do not include ordinary chat, reasoning traces, failed-debug logs, transient guesses, or results superseded by later parameter changes.
140
141
  - When an upstream input, threshold, parameter, or method changes, explicitly state which downstream results or interpretations are outdated and need refresh.
141
142
  - Prefer evidence-backed statements that cite generated files, tables, figures, scripts, or command outputs.
143
+ - If you ran tools for a bioinformatics/scientific analysis or created result directories, tables, figures, scripts, or reports, you MUST emit an analysis report update before finishing the response.
144
+ - If the analysis produces many PDFs or figure files, do not expand them all in chat. Summarize them in the report by topic, output directory, counts, representative files, and the biological meaning of the figures.
142
145
 
143
146
  If you mention report updates in chat, describe only the analysis-level change. Do not dump the full report unless the user asks for it.
144
147
 
@@ -148,12 +151,18 @@ Emit an update only after a stable, reusable analysis milestone:
148
151
  - A durable output file, figure, table, or script has been created and should be tracked.
149
152
  - A prior result is invalidated by a changed input, threshold, or method.
150
153
 
151
- Do not emit updates for ordinary chat, brief status messages, failed attempts, transient debugging, file paths alone, or speculative interpretations.
154
+ Do not emit updates for ordinary chat, brief status messages, failed attempts, transient debugging, file paths alone, or speculative interpretations. This exception does not apply to completed bioinformatics analyses: if the only final chat content would be a file/directory inventory, convert that inventory into the report outputs section with concise context.
152
155
 
153
- When you have a compact report-worthy update, you may emit one fenced JSON block:
156
+ Topic handling:
157
+ - Use the \`topic\` field to distinguish separate analysis questions within the same chat session or branch.
158
+ - Keep using the same \`topic\` when refining or rerunning the same analysis.
159
+ - Start a new \`topic\` when the user switches to a different biological question, cell type, comparison, dataset, or branch of analysis.
160
+ - The report update should summarize only the current topic/branch unless you are explicitly revising a previous topic.
161
+
162
+ When you have a compact report-worthy update, emit one or more fenced JSON blocks:
154
163
 
155
164
  \`\`\`analysis-report-update
156
- {"section":"methods|quality_control|results|interpretation|outputs|reproducibility","action":"append","status":"draft|verified|needs_review|outdated","markdown":"Concise Markdown for the report section.","sources":["results/file.csv"],"invalidates":["results"],"note":"Short change note."}
165
+ {"topic":"Short current analysis topic","section":"objective|input_data|methods|quality_control|results|interpretation|outputs|reproducibility","action":"append|replace","status":"draft|verified|needs_review|outdated","markdown":"Concise Markdown for the report section.","sources":["results/file.csv","HSPCs/"],"invalidates":["results"],"note":"Short change note."}
157
166
  \`\`\`
158
167
 
159
168
  Only use this fence for durable analysis summaries, not for chat narration or raw logs.