@seqyuan/annovibe 0.8.12 → 0.8.14
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.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +8 -5
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/react-loadable-manifest.json +6 -6
- package/.next/required-server-files.js +1 -1
- package/.next/required-server-files.json +1 -1
- package/.next/routes-manifest.json +18 -0
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agent/[id]/events/route.js +2 -2
- package/.next/server/app/api/agent/[id]/route.js +1 -1
- package/.next/server/app/api/agent/new/route.js +1 -1
- package/.next/server/app/api/auth/all-providers/route.js +1 -1
- package/.next/server/app/api/auth/api-key/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/login/[provider]/route.js +2 -2
- package/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/server/app/api/auth/logout/[provider]/route.js +1 -1
- package/.next/server/app/api/auth/providers/route.js +1 -1
- package/.next/server/app/api/auth/status/route.js +1 -1
- package/.next/server/app/api/default-cwd/route.js +1 -1
- package/.next/server/app/api/files/[...path]/route.js +2 -2
- package/.next/server/app/api/harness/route.js +1 -1
- package/.next/server/app/api/home/route.js +1 -1
- package/.next/server/app/api/internal/runtime/route.js +1 -0
- package/.next/server/app/api/internal/runtime/route.js.nft.json +1 -0
- package/.next/server/app/api/internal/runtime/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/models/route.js +1 -1
- package/.next/server/app/api/models-config/discover/route.js +1 -1
- package/.next/server/app/api/models-config/route.js +1 -1
- package/.next/server/app/api/models-config/test/route.js +1 -1
- package/.next/server/app/api/plot-kernels/route.js +1 -1
- package/.next/server/app/api/plot-kernels/status/route.js +1 -1
- package/.next/server/app/api/plot-kernels/stop/route.js +1 -1
- package/.next/server/app/api/projects/browse/route.js +1 -0
- package/.next/server/app/api/projects/browse/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/browse/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/projects/route.js +3 -0
- package/.next/server/app/api/projects/route.js.nft.json +1 -0
- package/.next/server/app/api/projects/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/reports/[id]/route.js +7 -4
- package/.next/server/app/api/search/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/context/route.js +2 -2
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/new/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +2 -2
- package/.next/server/app/api/settings/route.js +1 -1
- package/.next/server/app/api/skills/install/route.js +1 -1
- package/.next/server/app/api/skills/route.js +2 -2
- package/.next/server/app/api/skills/search/route.js +1 -1
- package/.next/server/app/api/soul/route.js +1 -1
- package/.next/server/app/api/version/route.js +1 -1
- package/.next/server/app/favicon.ico/route.js +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +3 -3
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/page.js +13 -13
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +8 -5
- package/.next/server/chunks/1688.js +45 -0
- package/.next/server/chunks/7601.js +54 -12
- package/.next/server/chunks/static/media/pdf.worker.min.c476e1a0.mjs +6 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/QvZYZknhDLA2wQJwpT60o/_buildManifest.js +1 -0
- package/.next/static/chunks/51fb665c.9f0b013f33bf4f6d.js +45 -0
- package/.next/static/chunks/8771-3e14b6810486df1f.js +1 -0
- package/.next/static/chunks/app/_global-error/page-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/events/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/agent/[id]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/agent/new/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/all-providers/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/login/[provider]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/providers/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/auth/status/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/default-cwd/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/files/[...path]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/harness/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/home/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/internal/runtime/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models-config/discover/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models-config/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/models-config/test/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/status/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/plot-kernels/stop/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/projects/browse/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/projects/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/reports/[id]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/search/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/new/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/settings/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/skills/install/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/skills/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/skills/search/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/soul/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/api/version/route-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/app/page-e0ad11ee7003214a.js +270 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-7222ee8be0d45596.js +1 -0
- package/.next/static/chunks/{webpack-5e677f60fa366b60.js → webpack-c223a77d0c5e1b9e.js} +1 -1
- package/.next/static/css/8026433d69e690e2.css +3 -0
- package/.next/static/media/pdf.worker.min.29aaf158.mjs +6 -0
- package/.next/trace +75 -74
- package/.next/trace-build +1 -1
- package/.next/types/app/api/internal/runtime/route.ts +351 -0
- package/.next/types/app/api/projects/browse/route.ts +351 -0
- package/.next/types/app/api/projects/route.ts +351 -0
- package/.next/types/routes.d.ts +4 -1
- package/.next/types/validator.ts +27 -0
- package/README.md +2 -0
- package/bin/pi-web.js +293 -16
- package/package.json +1 -1
- package/.next/server/chunks/7270.js +0 -45
- package/.next/server/chunks/static/media/pdf.worker.min.9df6854a.mjs +0 -6
- package/.next/static/chunks/7355-29eaa714eb390050.js +0 -1
- package/.next/static/chunks/9b0008ae.2918095672924572.js +0 -45
- package/.next/static/chunks/app/_global-error/page-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/events/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/agent/[id]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/agent/new/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/all-providers/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/api-key/[provider]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/login/[provider]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/logout/[provider]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/providers/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/auth/status/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/default-cwd/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/files/[...path]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/harness/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/home/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models-config/discover/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models-config/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/models-config/test/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/status/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/plot-kernels/stop/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/reports/[id]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/search/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/new/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/settings/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/skills/install/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/skills/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/skills/search/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/soul/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/api/version/route-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/app/page-dc03bbb33a1d438c.js +0 -270
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-3edd3886076a73cb.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-3edd3886076a73cb.js +0 -1
- package/.next/static/css/d830cdea1c9a03c6.css +0 -3
- package/.next/static/ixA4-CDguO8ne_SD2W8sd/_buildManifest.js +0 -1
- package/.next/static/media/pdf.worker.min.5f98222a.mjs +0 -6
- /package/.next/static/{ixA4-CDguO8ne_SD2W8sd → QvZYZknhDLA2wQJwpT60o}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
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
|
|
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}
|
|
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\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.
|
|
@@ -96,17 +97,42 @@ if (window.Chart) init();
|
|
|
96
97
|
${h.content}
|
|
97
98
|
</widget-guidelines>`;return g?`${g}
|
|
98
99
|
|
|
99
|
-
${j}`:j}},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
100
|
-
|
|
101
|
-
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},
|
|
100
|
+
${j}`:j}},40402:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$M:()=>e.getAgentDir,BR:()=>l,DK:()=>m,O8:()=>k,Uv:()=>n,dQ:()=>h,os:()=>j});var e=c(75430),f=c(12039),g=a([e]);async function h(){let a=await e.SessionManager.listAll(),b=new Map;for(let c of a)b.set(c.path,c.id);let c=i();return a.map(a=>(c.set(a.id,a.path),{path:a.path,id:a.id,cwd:a.cwd,name:a.name,created:a.created instanceof Date?a.created.toISOString():String(a.created),modified:a.modified instanceof Date?a.modified.toISOString():String(a.modified),messageCount:a.messageCount,firstMessage:a.firstMessage||"(no messages)",parentSessionId:a.parentSessionPath?b.get(a.parentSessionPath):void 0}))}function i(){return globalThis.__piSessionPathCache||(globalThis.__piSessionPathCache=new Map),globalThis.__piSessionPathCache}async function j(a){let b=i().get(a);return b||(await h(),i().get(a)??null)}function k(a,b){i().set(a,b)}function l(a){i().delete(a)}function m(a){return e.SessionManager.open(a).getEntries()}function n(a,b){let c,d,g,h=new Map;for(let b of a)h.set(b.id,b);let i=(0,e.buildSessionContext)(a,b,h);if(null===b||(b&&(c=h.get(b)),c||(c=a[a.length-1]),!c))return{messages:[],entryIds:[],thinkingLevel:i.thinkingLevel,model:i.model};let j=[],k=c;for(;k;)j.unshift(k),k=k.parentId?h.get(k.parentId):void 0;for(let a of j)"compaction"===a.type&&(d=a.id,g=a.firstKeptEntryId);let l=[];if(d){l.push(d);let a=j.findIndex(a=>a.id===d),b=g?j.findIndex((b,c)=>c<a&&b.id===g):-1,c=b>=0?b:a;for(let b=c;b<a;b++)"message"===j[b].type&&l.push(j[b].id);for(let b=a+1;b<j.length;b++)"message"===j[b].type&&l.push(j[b].id)}else for(let a of j)"message"===a.type&&l.push(a.id);return{messages:i.messages.map(a=>"compactionSummary"===a.role?{role:"user",content:`*The conversation history before this point was compacted into the following summary:*
|
|
101
|
+
|
|
102
|
+
${a.summary??""}`,timestamp:a.timestamp}:(0,f.B)(a)),entryIds:l,thinkingLevel:i.thinkingLevel,model:i.model}}e=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},44036:(a,b,c)=>{"use strict";c.d(b,{FJ:()=>g,R4:()=>h,X8:()=>f});let d=`<plot-mode-guidelines>
|
|
103
|
+
AnnoVibe Plot mode is active. Use it for reproducible R/Python analysis plots and data visualizations.
|
|
104
|
+
|
|
105
|
+
Tool routing:
|
|
106
|
+
- Prefer \`kernel_plot_run\` for R/Python plotting, figure regeneration, image previews, and iterative data inspection that benefits from a warm kernel.
|
|
107
|
+
- Use \`runtime: "kernel-lite"\` when variables or loaded data should persist across turns.
|
|
108
|
+
- Use \`runtime: "worker"\` for one-shot scripts that should be isolated and reproducible.
|
|
109
|
+
- Use shell tools only for file operations, package checks, or non-plot commands. Do not run Rscript/python plotting through \`bash\` unless the plot kernel is unavailable or unsuitable.
|
|
110
|
+
|
|
111
|
+
Plot artifact rules:
|
|
112
|
+
- Save every output under \`WARMPLOT_OUTPUT_DIR\` or \`PI_KERNEL_PLOT_OUTPUT_DIR\`.
|
|
113
|
+
- Create a primary PNG/JPEG/WebP preview for chat display whenever a figure is produced, not PDF-only output. Keep the preview reasonably sized so it can be embedded inline.
|
|
114
|
+
- If a publication-quality PDF/SVG is needed, save it in addition to the preview image.
|
|
115
|
+
- Name the primary preview clearly, for example \`00_preview.png\`, so it is easy to identify.
|
|
116
|
+
|
|
117
|
+
Chat display rules:
|
|
118
|
+
- The web chat renders returned image artifacts inline. Do not say that images cannot be displayed.
|
|
119
|
+
- Do not use \`open\`, \`xdg-open\`, or desktop viewers to show plots.
|
|
120
|
+
- After generating any plot, make the chat response displayable by including the PNG/JPEG/WebP preview path in the final answer or by returning it as a tool image artifact. Do not mention only PDF paths when an image preview exists.
|
|
121
|
+
- When using shell tools for plotting, still save a PNG/JPEG/WebP preview and include that preview path in the final answer; avoid a final answer that only says a desktop window was opened.
|
|
122
|
+
- When the user asks to show an existing PNG/JPEG/WebP file, use \`read\` on that image path; the UI will display the image even if the model cannot inspect pixels.
|
|
123
|
+
- If only a PDF exists and the user asks to see it in chat, generate a PNG preview with \`kernel_plot_run\` or report the PDF path only if conversion is not practical.
|
|
124
|
+
- After a successful plot, summarize the result briefly and include both preview image paths and any publication-quality PDF/SVG paths.
|
|
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()}
|
|
126
|
+
|
|
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;class x{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":{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,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:w}=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>
|
|
102
128
|
${a}
|
|
103
|
-
</soul>`)}catch{}let
|
|
129
|
+
</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>
|
|
104
130
|
${a}
|
|
105
|
-
</harness>`)}catch{}let
|
|
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>
|
|
106
132
|
${a}
|
|
107
|
-
</project_memory>`)}catch{}if(
|
|
133
|
+
</project_memory>`)}catch{}if(z.length>0){let a=w.agent.state?.systemPrompt??"",b=z.join("\n\n");q(w,`${b}
|
|
108
134
|
|
|
109
|
-
${a}`}
|
|
135
|
+
${a}`)}q(w,s({systemPrompt:p(w),generativeUI:y.generativeUI,plotMode:(0,l.R4)(j??w.getActiveToolNames())})),j&&j.length>0&&(w.setActiveToolsByName(j),q(w,s({systemPrompt:p(w),generativeUI:y.generativeUI,plotMode:(0,l.R4)(j)}))),j?.length===0&&q(w,"");let D=new x(w,{systemPromptDisabled:j?.length===0});D.start();let E=w.sessionId,F=w.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>
|
|
110
136
|
AnnoVibe has a persistent Analysis Report tab. It is for curated analysis deliverables, not a transcript summary.
|
|
111
137
|
|
|
112
138
|
When working on scientific or bioinformatics analysis, keep report-worthy content concise and structured:
|
|
@@ -114,13 +140,29 @@ When working on scientific or bioinformatics analysis, keep report-worthy conten
|
|
|
114
140
|
- Do not include ordinary chat, reasoning traces, failed-debug logs, transient guesses, or results superseded by later parameter changes.
|
|
115
141
|
- When an upstream input, threshold, parameter, or method changes, explicitly state which downstream results or interpretations are outdated and need refresh.
|
|
116
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.
|
|
117
145
|
|
|
118
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.
|
|
119
147
|
|
|
120
|
-
|
|
148
|
+
Emit an update only after a stable, reusable analysis milestone:
|
|
149
|
+
- A method or parameter choice is finalized.
|
|
150
|
+
- A QC/result/interpretation has been confirmed from generated evidence.
|
|
151
|
+
- A durable output file, figure, table, or script has been created and should be tracked.
|
|
152
|
+
- A prior result is invalidated by a changed input, threshold, or method.
|
|
153
|
+
|
|
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.
|
|
155
|
+
|
|
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:
|
|
121
163
|
|
|
122
164
|
\`\`\`analysis-report-update
|
|
123
|
-
{"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."}
|
|
124
166
|
\`\`\`
|
|
125
167
|
|
|
126
168
|
Only use this fence for durable analysis summaries, not for chat narration or raw logs.
|