@agimon-ai/po-cloudflare 0.0.2-alpha.17 → 0.0.2-alpha.18
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/dist/assets/plugins/compositions.json +1 -1
- package/dist/assets/plugins/slots/artifacts.50b639bb-DQlO5IFk.js +1 -0
- package/dist/worker.js +25 -25
- package/package.json +32 -32
- package/dist/assets/plugins/slots/artifacts.84980c32-D-vQ-7Iz.js +0 -1
- /package/dist/assets/plugins/slots/{approval.3e4ea6e4-CqQk6XG_.js → approval.09e72f36-CqQk6XG_.js} +0 -0
- /package/dist/assets/plugins/slots/{autocompact.ec8f713f-B3KTYwW1.js → autocompact.6f428144-B3KTYwW1.js} +0 -0
- /package/dist/assets/plugins/slots/{builtin-tools.16ef5e25-CZRYQVIP.js → builtin-tools.75108f21-CZRYQVIP.js} +0 -0
- /package/dist/assets/plugins/slots/{codemode.5f359b9c-Bzl_K_vt.js → codemode.c58fb583-Bzl_K_vt.js} +0 -0
- /package/dist/assets/plugins/slots/{domain.832848c8-CvnpuKCY.js → domain.753f9f92-CvnpuKCY.js} +0 -0
- /package/dist/assets/plugins/slots/{edit.7c802139-kaxIknZ-.js → edit.804fec90-kaxIknZ-.js} +0 -0
- /package/dist/assets/plugins/slots/{files.364f16c9-wuB8gcQA.js → files.66ffc636-wuB8gcQA.js} +0 -0
- /package/dist/assets/plugins/slots/{grep.d8bf9f57-3FnU8p-d.js → grep.98262cff-3FnU8p-d.js} +0 -0
- /package/dist/assets/plugins/slots/{log.07fd59a4-C0PXQ0O1.js → log.cb964209-C0PXQ0O1.js} +0 -0
- /package/dist/assets/plugins/slots/{mcp.ea8b6aa2-D0CkHnIw.js → mcp.82cc1ff5-D0CkHnIw.js} +0 -0
- /package/dist/assets/plugins/slots/{profile.63bc3ae6-BSY3iYfJ.js → profile.ab16dcec-BSY3iYfJ.js} +0 -0
- /package/dist/assets/plugins/slots/{prompts.9d9b47cc-xdCkNkoA.js → prompts.ae48c07a-xdCkNkoA.js} +0 -0
- /package/dist/assets/plugins/slots/{read.926c024f-qqaxVlEX.js → read.4560591a-qqaxVlEX.js} +0 -0
- /package/dist/assets/plugins/slots/{runner.5393fa6c-DfO2Z9HG.js → runner.6e494d59-DfO2Z9HG.js} +0 -0
- /package/dist/assets/plugins/slots/{skill.56c1cc07-CL_n-l4h.js → skill.62a0a1b3-CL_n-l4h.js} +0 -0
- /package/dist/assets/plugins/slots/{vault.587549ba-DbG3F_on.js → vault.3cbfcdc3-DbG3F_on.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"global":{"id":"
|
|
1
|
+
{"global":{"id":"348d11877aa63b03c065d766bd651aa680a991aca83b62841936a8045a8b0a41","scope":"global","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.09e72f36","/slots/approval.09e72f36-CqQk6XG_.js"],["artifacts.50b639bb","/slots/artifacts.50b639bb-DQlO5IFk.js"],["autocompact.6f428144","/slots/autocompact.6f428144-B3KTYwW1.js"],["builtin-tools.75108f21","/slots/builtin-tools.75108f21-CZRYQVIP.js"],["codemode.c58fb583","/slots/codemode.c58fb583-Bzl_K_vt.js"],["domain.753f9f92","/slots/domain.753f9f92-CvnpuKCY.js"],["edit.804fec90","/slots/edit.804fec90-kaxIknZ-.js"],["files.66ffc636","/slots/files.66ffc636-wuB8gcQA.js"],["grep.98262cff","/slots/grep.98262cff-3FnU8p-d.js"],["log.cb964209","/slots/log.cb964209-C0PXQ0O1.js"],["mcp.82cc1ff5","/slots/mcp.82cc1ff5-D0CkHnIw.js"],["profile.ab16dcec","/slots/profile.ab16dcec-BSY3iYfJ.js"],["prompts.ae48c07a","/slots/prompts.ae48c07a-xdCkNkoA.js"],["read.4560591a","/slots/read.4560591a-qqaxVlEX.js"],["runner.6e494d59","/slots/runner.6e494d59-DfO2Z9HG.js"],["skill.62a0a1b3","/slots/skill.62a0a1b3-CL_n-l4h.js"],["vault.3cbfcdc3","/slots/vault.3cbfcdc3-DbG3F_on.js"]],"assetPaths":["/slots/approval.09e72f36-CqQk6XG_.js","/chunks/po-web-runtime-Czm_C4SJ.js","/assets/base-C3j1WCCq.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.50b639bb-DQlO5IFk.js","/slots/autocompact.6f428144-B3KTYwW1.js","/slots/builtin-tools.75108f21-CZRYQVIP.js","/slots/codemode.c58fb583-Bzl_K_vt.js","/slots/domain.753f9f92-CvnpuKCY.js","/slots/edit.804fec90-kaxIknZ-.js","/slots/files.66ffc636-wuB8gcQA.js","/slots/grep.98262cff-3FnU8p-d.js","/slots/log.cb964209-C0PXQ0O1.js","/slots/mcp.82cc1ff5-D0CkHnIw.js","/slots/profile.ab16dcec-BSY3iYfJ.js","/slots/prompts.ae48c07a-xdCkNkoA.js","/slots/read.4560591a-qqaxVlEX.js","/slots/runner.6e494d59-DfO2Z9HG.js","/slots/skill.62a0a1b3-CL_n-l4h.js","/slots/vault.3cbfcdc3-DbG3F_on.js"],"stylePaths":["/assets/base-C3j1WCCq.css"],"channels":["approval_activity","artifacts","file_edits","runner_runs"],"plugins":["approval.09e72f36","artifacts.50b639bb","autocompact.6f428144","builtin-tools.75108f21","codemode.c58fb583","domain.753f9f92","edit.804fec90","files.66ffc636","grep.98262cff","log.cb964209","mcp.82cc1ff5","profile.ab16dcec","prompts.ae48c07a","read.4560591a","runner.6e494d59","skill.62a0a1b3","vault.3cbfcdc3"]},"workspace":{"id":"348d11877aa63b03c065d766bd651aa680a991aca83b62841936a8045a8b0a41","scope":"workspace","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.09e72f36","/slots/approval.09e72f36-CqQk6XG_.js"],["artifacts.50b639bb","/slots/artifacts.50b639bb-DQlO5IFk.js"],["autocompact.6f428144","/slots/autocompact.6f428144-B3KTYwW1.js"],["builtin-tools.75108f21","/slots/builtin-tools.75108f21-CZRYQVIP.js"],["codemode.c58fb583","/slots/codemode.c58fb583-Bzl_K_vt.js"],["domain.753f9f92","/slots/domain.753f9f92-CvnpuKCY.js"],["edit.804fec90","/slots/edit.804fec90-kaxIknZ-.js"],["files.66ffc636","/slots/files.66ffc636-wuB8gcQA.js"],["grep.98262cff","/slots/grep.98262cff-3FnU8p-d.js"],["log.cb964209","/slots/log.cb964209-C0PXQ0O1.js"],["mcp.82cc1ff5","/slots/mcp.82cc1ff5-D0CkHnIw.js"],["profile.ab16dcec","/slots/profile.ab16dcec-BSY3iYfJ.js"],["prompts.ae48c07a","/slots/prompts.ae48c07a-xdCkNkoA.js"],["read.4560591a","/slots/read.4560591a-qqaxVlEX.js"],["runner.6e494d59","/slots/runner.6e494d59-DfO2Z9HG.js"],["skill.62a0a1b3","/slots/skill.62a0a1b3-CL_n-l4h.js"],["vault.3cbfcdc3","/slots/vault.3cbfcdc3-DbG3F_on.js"]],"assetPaths":["/slots/approval.09e72f36-CqQk6XG_.js","/chunks/po-web-runtime-Czm_C4SJ.js","/assets/base-C3j1WCCq.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.50b639bb-DQlO5IFk.js","/slots/autocompact.6f428144-B3KTYwW1.js","/slots/builtin-tools.75108f21-CZRYQVIP.js","/slots/codemode.c58fb583-Bzl_K_vt.js","/slots/domain.753f9f92-CvnpuKCY.js","/slots/edit.804fec90-kaxIknZ-.js","/slots/files.66ffc636-wuB8gcQA.js","/slots/grep.98262cff-3FnU8p-d.js","/slots/log.cb964209-C0PXQ0O1.js","/slots/mcp.82cc1ff5-D0CkHnIw.js","/slots/profile.ab16dcec-BSY3iYfJ.js","/slots/prompts.ae48c07a-xdCkNkoA.js","/slots/read.4560591a-qqaxVlEX.js","/slots/runner.6e494d59-DfO2Z9HG.js","/slots/skill.62a0a1b3-CL_n-l4h.js","/slots/vault.3cbfcdc3-DbG3F_on.js"],"stylePaths":["/assets/base-C3j1WCCq.css"],"channels":["approval_activity","artifacts","file_edits","runner_runs"],"plugins":["approval.09e72f36","artifacts.50b639bb","autocompact.6f428144","builtin-tools.75108f21","codemode.c58fb583","domain.753f9f92","edit.804fec90","files.66ffc636","grep.98262cff","log.cb964209","mcp.82cc1ff5","profile.ab16dcec","prompts.ae48c07a","read.4560591a","runner.6e494d59","skill.62a0a1b3","vault.3cbfcdc3"]},"session":{"id":"348d11877aa63b03c065d766bd651aa680a991aca83b62841936a8045a8b0a41","scope":"session","revision":1,"manifestUrl":"/plugins/compositions.json","rawAssetBaseUrl":"/plugins","verifiedAssetBaseUrl":"/plugins","pluginEntries":[["approval.09e72f36","/slots/approval.09e72f36-CqQk6XG_.js"],["artifacts.50b639bb","/slots/artifacts.50b639bb-DQlO5IFk.js"],["autocompact.6f428144","/slots/autocompact.6f428144-B3KTYwW1.js"],["builtin-tools.75108f21","/slots/builtin-tools.75108f21-CZRYQVIP.js"],["codemode.c58fb583","/slots/codemode.c58fb583-Bzl_K_vt.js"],["domain.753f9f92","/slots/domain.753f9f92-CvnpuKCY.js"],["edit.804fec90","/slots/edit.804fec90-kaxIknZ-.js"],["files.66ffc636","/slots/files.66ffc636-wuB8gcQA.js"],["grep.98262cff","/slots/grep.98262cff-3FnU8p-d.js"],["log.cb964209","/slots/log.cb964209-C0PXQ0O1.js"],["mcp.82cc1ff5","/slots/mcp.82cc1ff5-D0CkHnIw.js"],["profile.ab16dcec","/slots/profile.ab16dcec-BSY3iYfJ.js"],["prompts.ae48c07a","/slots/prompts.ae48c07a-xdCkNkoA.js"],["read.4560591a","/slots/read.4560591a-qqaxVlEX.js"],["runner.6e494d59","/slots/runner.6e494d59-DfO2Z9HG.js"],["skill.62a0a1b3","/slots/skill.62a0a1b3-CL_n-l4h.js"],["vault.3cbfcdc3","/slots/vault.3cbfcdc3-DbG3F_on.js"]],"assetPaths":["/slots/approval.09e72f36-CqQk6XG_.js","/chunks/po-web-runtime-Czm_C4SJ.js","/assets/base-C3j1WCCq.css","/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2","/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2","/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2","/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2","/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2","/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2","/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2","/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2","/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2","/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2","/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2","/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2","/slots/artifacts.50b639bb-DQlO5IFk.js","/slots/autocompact.6f428144-B3KTYwW1.js","/slots/builtin-tools.75108f21-CZRYQVIP.js","/slots/codemode.c58fb583-Bzl_K_vt.js","/slots/domain.753f9f92-CvnpuKCY.js","/slots/edit.804fec90-kaxIknZ-.js","/slots/files.66ffc636-wuB8gcQA.js","/slots/grep.98262cff-3FnU8p-d.js","/slots/log.cb964209-C0PXQ0O1.js","/slots/mcp.82cc1ff5-D0CkHnIw.js","/slots/profile.ab16dcec-BSY3iYfJ.js","/slots/prompts.ae48c07a-xdCkNkoA.js","/slots/read.4560591a-qqaxVlEX.js","/slots/runner.6e494d59-DfO2Z9HG.js","/slots/skill.62a0a1b3-CL_n-l4h.js","/slots/vault.3cbfcdc3-DbG3F_on.js"],"stylePaths":["/assets/base-C3j1WCCq.css"],"channels":["approval_activity","artifacts","file_edits","runner_runs"],"plugins":["approval.09e72f36","artifacts.50b639bb","autocompact.6f428144","builtin-tools.75108f21","codemode.c58fb583","domain.753f9f92","edit.804fec90","files.66ffc636","grep.98262cff","log.cb964209","mcp.82cc1ff5","profile.ab16dcec","prompts.ae48c07a","read.4560591a","runner.6e494d59","skill.62a0a1b3","vault.3cbfcdc3"]}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$t as e,An as t,At as n,Bn as r,Bt as i,Cn as a,Dn as o,En as s,F as c,Ft as l,Hn as u,Lt as d,Mt as f,Nn as ee,On as p,W as m,a as h,at as te,cn as ne,en as re,f as g,g as _,hn as ie,ht as v,i as y,in as b,kn as x,kt as S,l as C,ln as ae,mn as oe,n as se,nn as ce,o as w,on as T,p as E,pn as le,r as D,rn as O,s as ue,sn as k,tn as de,un as fe,v as A,vn as pe,vt as j,yn as me}from"../chunks/po-web-runtime-Czm_C4SJ.js";var M=`artifacts`,he=26214400;function N(e){return e===`tree`||e===`list`||e===`grid`}function ge(e){return/\.(?:md|markdown)$/iu.test(e)?`Markdown`:/\.(?:png|jpe?g|gif|webp|avif|bmp|svg|ico|tiff?)$/iu.test(e)?`Image`:/\.(?:jsonl?|csv|tsv|ya?ml|xml|toml|parquet|sqlite|db)$/iu.test(e)?`Data`:/\.(?:[cm]?[jt]sx?|html?|css|scss|sass|less|py|sh|bash|go|rs|rb|java|c|cpp|cc|h|hpp|sql|swift|kt|kts|php|vue|svelte)$/iu.test(e)?`Code`:/\.(?:pdf|txt|rtf|docx?|xlsx?|pptx?|odt|ods|odp)$/iu.test(e)?`Document`:`Other`}function _e(e,t,n){let r=(t.query??``).trim().toLowerCase(),i=t.modified??`any`,a=new Date(n);a.setHours(0,0,0,0);let o=i===`today`?a.getTime():n-(i===`7days`?7:30)*864e5;return e.filter(e=>e.path.toLowerCase().includes(r)&&(!t.type||t.type===`any`||ge(e.path)===t.type)&&(i===`any`||e.modifiedAt>=o&&e.modifiedAt<=n))}function ve(e,t,n){return[...e].sort((e,r)=>(t===`name`?P(e.name.toLowerCase(),r.name.toLowerCase()):t===`size`?e.size-r.size:e.modifiedAt-r.modifiedAt)*(n===`asc`?1:-1)||P(e.path,r.path))}function P(e,t){return e<t?-1:+(e>t)}function ye(e,t){let n={path:``,dirs:new Map,files:[],count:0};for(let t of e){let e=n;e.count++;for(let n of t.path.split(`/`).slice(0,-1)){let t=e.dirs.get(n);t||(t={path:e.path?`${e.path}/${n}`:n,dirs:new Map,files:[],count:0},e.dirs.set(n,t)),e=t,e.count++}e.files.push(t)}let r=[],i=(e,n)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>P(e,t))){let e=a,s=o;for(;s.files.length===0&&s.dirs.size===1;){let[[t,n]]=[...s.dirs];e=`${e}/${t}`,s=n}let c=t(s.path);r.push({kind:`dir`,path:s.path,name:e,depth:n,open:c,count:s.count}),c&&i(s,n+1)}for(let t of e.files)r.push({kind:`file`,item:t,depth:n})};return i(n,0),r}function F(e,t){if(t===void 0)return`viewed`;let n=t.seen[e.path];return n===void 0?e.modifiedAt>t.baseline?`new`:`viewed`:e.modifiedAt>n?`edited`:`viewed`}var be={status:`all`,type:`any`,modified:`any`,location:`artifacts`};function I(e,t){let n=Math.floor(Math.max(0,t-e)/6e4);return n<1?`now`:n<60?`${n}m`:n<1440?`${Math.floor(n/60)}h`:n<10080?`${Math.floor(n/1440)}d`:new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function xe(e){return[...e].sort((e,t)=>t.modifiedAt-e.modifiedAt||(e.path<t.path?-1:+(e.path>t.path)))}function L(e,t){return`artifact:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function R(e,t){if(!t||t.startsWith(`/`)||t.includes(`\\`)||/^[a-z][a-z0-9+.-]*:/iu.test(t))throw Error(`Artifact images must use a relative path.`);let n=e.split(`/`).slice(0,-1);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(n.length===0)throw Error(`The image is outside this artifact folder.`);n.pop()}else n.push(e)}if(n.length===0)throw Error(`The image path is empty.`);return n.join(`/`)}function z(e){return/\.(?:png|jpe?g|gif|webp|avif|bmp|svg|ico|mp3|wav|m4a|ogg|m4v|mp4|mov|webm|pdf)$/iu.test(e)?`media`:/\.(?:md|markdown)$/iu.test(e)?`markdown`:/\.html?$/iu.test(e)?`html`:/\.(?:[cm]?[jt]sx?|json|ya?ml|css|scss|py|sh|bash|go|rs|rb|java|c|cpp|h|sql|xml|toml)$/iu.test(e)?`code`:`text`}function B(e){if(typeof e!=`object`||!e||!(`items`in e)||!Array.isArray(e.items)||`error`in e&&e.error!==void 0&&typeof e.error!=`string`)return null;let t=[];for(let n of e.items){if(typeof n!=`object`||!n||typeof n.path!=`string`||!n.path||n.path.startsWith(`/`)||n.path.includes(`\\`)||n.path.split(`/`).some(e=>e===`..`||e===`.`)||typeof n.name!=`string`||!n.name||typeof n.size!=`number`||!Number.isFinite(n.size)||n.size<0||typeof n.modifiedAt!=`number`||!Number.isFinite(n.modifiedAt)||n.modifiedAt<0)return null;t.push({path:n.path,name:n.name,size:n.size,modifiedAt:n.modifiedAt})}return{items:xe(t),...`temporaryRoot`in e&&typeof e.temporaryRoot==`string`?{temporaryRoot:e.temporaryRoot}:{},...`error`in e&&typeof e.error==`string`?{error:e.error}:{}}}var V=ee({items:[],loaded:!1}),H=V.channel({channel:M,parse:B,reduce:(e,t)=>({...t,loaded:!0})}),U=`po.artifacts.layout.v1`;function Se(){try{let e=globalThis.localStorage.getItem(U);return N(e)?e:`tree`}catch{return`tree`}}var Ce=t(Se());function we(e){Ce.update(()=>e);try{globalThis.localStorage.setItem(U,e)}catch{}}var W=`po.artifacts.seen.v1`,G=`po.artifacts.browse.v1`,K=200;function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Te(e,t){try{let n=JSON.parse(globalThis.localStorage.getItem(e)??`{}`);return q(n)?Object.fromEntries(Object.entries(n).flatMap(([e,n])=>{let r=t(n);return r===void 0?[]:[[e,r]]})):{}}catch{return{}}}function Ee(e,t,n){return Object.fromEntries([...Object.entries(e).filter(([e])=>e!==t),[t,n]].slice(-50))}function De(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function Oe(e){if(!q(e)||typeof e.baseline!=`number`||!q(e.seen))return;let t=Object.fromEntries(Object.entries(e.seen).filter(e=>typeof e[1]==`number`));return{baseline:e.baseline,seen:t}}var J=t(Te(W,Oe));function ke(e){let t=V.select(V.store.state,e);if(t.loaded&&t.error===void 0)return{baseline:Math.max(0,...t.items.map(e=>e.modifiedAt)),seen:{}}}function Ae(e,t){let n=J.store.state[e]??ke(e);if(n===void 0)return;let r=t(n);r!==n&&(J.update(t=>Ee(t,e,r)),De(W,J.store.state))}function je(e,t){Ae(e,e=>{if(e.seen[t.path]===t.modifiedAt)return e;let n=[...Object.entries(e.seen).filter(([e])=>e!==t.path),[t.path,t.modifiedAt]].slice(-1e3);return{...e,seen:Object.fromEntries(n)}})}function Me(e,t){Ae(e,()=>({baseline:Math.max(0,...t.map(e=>e.modifiedAt)),seen:{}}))}function Ne(e){if(e===null)return 0;let t=J.store.state[e];return V.select(V.store.state,e).items.filter(e=>F(e,t)!==`viewed`).length}function Pe(){for(let e of Object.keys(V.store.state)){if(J.store.state[e]!==void 0)continue;let t=ke(e);t!==void 0&&Ae(e,()=>t)}}V.store.subscribe(Pe);var Y={filters:be,sort:`modified`,direction:`desc`,expanded:[],query:``,searchOpen:!1};function X(e,t,n){return t.includes(e)?e:n}function Fe(e){if(!q(e))return;let t=q(e.filters)?e.filters:{};return{filters:{status:X(t.status,[`all`,`new`,`edited`,`viewed`],`all`),type:X(t.type,[`any`,`Markdown`,`Image`,`Code`,`Data`,`Document`,`Other`],`any`),modified:X(t.modified,[`any`,`today`,`7days`,`30days`],`any`),location:X(t.location,[`artifacts`,`temporary`],`artifacts`)},sort:X(e.sort,[`name`,`size`,`modified`],`modified`),direction:X(e.direction,[`asc`,`desc`],`desc`),expanded:Array.isArray(e.expanded)?e.expanded.filter(e=>typeof e==`string`).slice(0,K):[],...typeof e.openPath==`string`?{openPath:e.openPath}:{},query:``,searchOpen:!1}}var Z=t(Te(G,Fe));function Ie(e,t){let n=t(Z.store.state[e]??Y);Z.update(t=>Ee(t,e,n)),De(G,Object.fromEntries(Object.entries(Z.store.state).map(([e,t])=>[e,{...t,query:``,searchOpen:!1,expanded:t.expanded.slice(0,K)}])))}var Le=s(H),Q=a({list:{method:`GET`,path:`/`,query:[`scope`],response:void 0},preview:{method:`GET`,path:`/preview`,query:[`path`,`scope`],response:void 0},content:{method:`GET`,path:`/content`,query:[`path`,`scope`],raw:!0}},{scopes:[`session`],basePath:`artifacts`,transport:(e,t)=>se.fetch(e,t),sessionAddress:u});async function Re(e,t){let n=V.select(V.store.state,e);try{let r=await Q.session(e).list({signal:t});if(t.aborted||V.select(V.store.state,e)!==n)return;let i=r.ok?B(r.data):null;V.update(e,()=>i?{...i,loaded:!0}:{...n,loaded:!0,error:r.ok?`The session answered with no artifact list.`:r.error||`Artifacts could not be loaded.`})}catch(r){!t.aborted&&V.select(V.store.state,e)===n&&V.update(e,()=>({...n,loaded:!0,error:r instanceof Error?r.message:String(r)}))}}async function ze(e,t,n=`artifacts`){let r=await Q.session(e).list({...n===`temporary`?{query:{scope:n}}:{},signal:t});if(!r.ok)throw Error(r.error||`Files could not be loaded.`);let i=B(r.data);if(!i)throw Error(`The session returned an invalid file list.`);return i}async function Be(e,t,n,r=`artifacts`){let i=await Q.session(e).preview({query:{path:t,...r===`temporary`?{scope:r}:{}},signal:n});if(!i.ok)throw Error(i.error||`This artifact could not be read.`);let a=i.data;if(!a||typeof a.path!=`string`||typeof a.content!=`string`||typeof a.mimeType!=`string`)throw Error(`The session answered with no artifact.`);return a}async function Ve(e,t,n,r=`artifacts`){let i=Q.session(e),a={path:t,...r===`temporary`?{scope:r}:{}},o=await i.content({query:a,...n?{signal:n}:{}});if(o.ok)return o.response.blob();if(o.status!==413)throw Error(o.error||`This artifact could not be loaded.`);let s=[],c=0,l=1,u,d=``;for(;c<l;){let e=await i.content({query:a,headers:{range:`bytes=${c}-${c+he-1}`,...u?{"if-match":u}:{}},...n?{signal:n}:{}}),t=e.ok?/^bytes (\d+)-(\d+)\/(\d+)$/u.exec(e.response.headers.get(`content-range`)??``):null;if(!e.ok||e.status!==206||!t||Number(t[1])!==c)throw Error(e.ok?`This artifact changed while loading.`:e.error||`This artifact could not be loaded.`);if(l=Number(t[3]),l>134217728)throw Error(`This artifact is too large to load.`);u??=e.response.headers.get(`etag`)??void 0,d||=e.response.headers.get(`content-type`)??``;let r=await e.response.blob();if(r.size!==Number(t[2])-c+1)throw Error(`This artifact changed while loading.`);s.push(r),c+=r.size}return new Blob(s,{type:d})}async function He(e,t,n,r=`artifacts`){let i=R(t,n),a=await Ve(e,i,void 0,r);if(!a.type.startsWith(`image/`))throw Error(`This artifact asset is not an image.`);let o=URL.createObjectURL(a);return{url:o,dispose:()=>URL.revokeObjectURL(o),path:i}}var Ue={slot:`author.open-source`,parse(e){if(typeof e!=`object`||!e)return null;let t=e;return t.watchFocusedPath!==void 0&&typeof t.watchFocusedPath!=`function`?null:t.version===1&&typeof t.createTab==`function`?t:null}};function We(e){return e.sessionId===null?void 0:e.slotData?.(Ue)?.[0]?.data}function Ge({path:e,preview:t,error:n,media:r,loadImage:a,documentPath:o,renderMediaReview:s}){let c=z(e);return w(`div`,{"data-testid":`artifact-preview`,"data-artifact-path":e,className:`flex min-h-0 flex-1 flex-col bg-po-bg text-po-text`,children:[w(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-po-border px-4 py-3`,children:[h(v,{path:e,className:`min-w-0 flex-1`}),h(`span`,{className:`text-sm text-po-dim`,children:`Artifact`})]}),h(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:n?h(`p`,{role:`alert`,className:`text-sm text-po-red`,children:n}):t?c===`media`?r:t.unavailable?h(`p`,{className:`text-sm text-po-dim`,children:t.reason??`This artifact cannot be previewed.`}):c===`markdown`?h(_,{text:t.content,loadImage:a,documentPath:o,renderMediaReview:s}):c===`html`?h(`iframe`,{title:e,sandbox:``,srcDoc:t.content,className:`h-96 w-full rounded-md border border-po-border bg-po-deep`}):c===`code`?h(i,{value:t.content,path:e,readOnly:!0,className:`min-h-64 rounded-md border border-po-border`}):h(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-sm text-po-text`,children:t.content}):h(`p`,{role:`status`,className:`text-sm text-po-dim`,children:`Reading this artifact...`})})]})}function Ke({sessionId:e,path:t,revision:n,scope:r}){let[i,a]=E(),o=`${r}:${e}:${t}:${n}`;C(()=>{let n=new AbortController,i;return Ve(e,t,n.signal,r).then(e=>{n.signal.aborted||(i=URL.createObjectURL(e),a({source:o,url:i,mimeType:e.type}))}).catch(e=>{n.signal.aborted||a({source:o,error:e instanceof Error?e.message:String(e)})}),()=>{n.abort(),i!==void 0&&URL.revokeObjectURL(i)}},[e,t,o,r]);let s=i?.source===o?i:void 0;return s?.url?h(A,{src:s.url,path:t,contentType:s.mimeType}):h(`p`,{role:s?.error?`alert`:`status`,className:s?.error?`text-sm text-po-red`:`text-sm text-po-dim`,children:s?.error??`Loading artifact media...`})}function qe(e,t){return e===`artifacts`?`artifact:${t}`:t}function Je(e){let{path:t,sessionId:n,scope:r=`artifacts`}=e,i=D(V.store,e=>V.select(e,n)),a=i.items.find(e=>e.path===t),o=r===`temporary`?`temporary`:a?`${a.modifiedAt}:${a.size}`:i.loaded?`missing`:`initial`,[s,c]=E();C(()=>{if(n===null||o===`missing`)return;let e=new AbortController;return Be(n,t,e.signal,r).then(r=>{e.signal.aborted||c({sessionId:n,path:t,revision:o,preview:r})}).catch(r=>{e.signal.aborted||c({sessionId:n,path:t,revision:o,error:r instanceof Error?r.message:String(r)})}),()=>e.abort()},[n,t,o,r]);let l=s?.sessionId===n&&s.path===t&&s.revision===o?s:void 0,u=ue(e=>n===null?Promise.reject(Error(`The session is unavailable.`)):He(n,t,e,r).then(e=>({...e,path:qe(r,e.path)})),[n,t,r]);return h(Ge,{path:t,preview:l?.preview,error:n===null?`The session is unavailable.`:o===`missing`?`This artifact no longer exists.`:l?.error,loadImage:u,documentPath:qe(r,t),renderMediaReview:S(e),media:n===null?void 0:h(Ke,{sessionId:n,path:t,revision:o,scope:r})})}function $(e,t,n=`artifacts`){return{id:`${n===`temporary`?`temporary:`:``}${L(e,t)}`,label:t.split(`/`).at(-1)??t,panel:r=>h(Je,{...r,sessionId:e,path:t,scope:n}),...n===`artifacts`?{onOpen:e=>{let n=V.select(V.store.state,e).items.find(e=>e.path===t);n!==void 0&&je(e,n)}}:{}}}function Ye(e,t,r=`artifacts`){if(e.sessionId===null)return;let i=V.select(V.store.state,e.sessionId).items.find(e=>e.path===t);if(r===`temporary`||n(t)===`video`&&(i?.size??0)>26214400){e.openTransientTab($(e.sessionId,t,r));return}let a=We(e);e.openTransientTab(a?.createTab({sessionId:e.sessionId,path:`artifact:${t}`})??$(e.sessionId,t))}function Xe(e,t){let n=D(V.store,t=>V.select(t,e)),[r,i]=E();return C(()=>{if(e===null||!t)return;let n=new AbortController;return(async()=>{try{let t=await ze(e,n.signal,`temporary`);n.signal.aborted||i({...t,sessionId:e})}catch(t){n.signal.aborted||i(n=>({sessionId:e,items:n?.sessionId===e?n.items:[],error:t instanceof Error?t.message:String(t)}))}})(),()=>{n.abort()}},[e,t,n]),r?.sessionId===e?r:void 0}function Ze({sessionId:e,item:t}){let n=g(null),[r,i]=E(),a=`${e}:${t.path}:${t.modifiedAt}:${t.size}`;return C(()=>{let r=n.current;if(!r)return;let o=new AbortController,s,c=()=>{Ve(e,t.path,o.signal).then(e=>{o.signal.aborted||e.size>5242880||!e.type.startsWith(`image/`)||(s=URL.createObjectURL(e),i({revision:a,url:s}))}).catch(()=>{})},l=typeof IntersectionObserver>`u`?void 0:new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(l?.disconnect(),c())});return l?l.observe(r):c(),()=>{l?.disconnect(),o.abort(),s&&URL.revokeObjectURL(s)}},[e,t.path,a]),h(`span`,{ref:n,className:`flex h-full w-full items-center justify-center`,children:r?.revision===a?h(`img`,{src:r.url,alt:``,className:`h-full w-full object-cover`}):h(pe,{"aria-hidden":!0,className:`size-8`})})}var Qe={all:`All`,new:`New`,edited:`Edited`,viewed:`Viewed`},$e=[`any`,`Markdown`,`Image`,`Code`,`Data`,`Document`,`Other`],et={any:`Any time`,today:`Today`,"7days":`Past 7 days`,"30days":`Past 30 days`},tt={artifacts:`Artifacts`,temporary:`Temporary files`},nt={"modified:desc":`Recently changed`,"modified:asc":`Oldest first`,"name:asc":`Name A to Z`,"name:desc":`Name Z to A`,"size:desc":`Largest first`,"size:asc":`Smallest first`};function rt({status:e}){return e===`new`?h(m,{tone:`green`,size:`xs`,className:`shrink-0 bg-po-tint-green`,children:`New`}):e===`edited`?h(m,{tone:`green`,size:`xs`,className:`shrink-0`,children:`Edited`}):e===`viewed`?h(`span`,{className:`sr-only`,children:`, viewed`}):null}function it(t){let{items:n,loading:r,error:i,onRetry:a,now:o,statusOf:s,layout:u,onLayoutChange:ee,query:p,onQueryChange:m,searchOpen:_,onSearchOpenChange:v,filters:x,onFiltersChange:S,sort:se,direction:E,onSortChange:D,expanded:ue,onToggleFolder:A,openPath:M,onOpen:he,onMarkAllViewed:N,renderThumbnail:P,defaultMenuOpen:F}=t,I=g(null),xe=g(void 0),L=new Map(n.map(e=>[e.path,s?.(e)])),R=n.filter(e=>L.get(e.path)===`new`).length,z=n.filter(e=>L.get(e.path)===`edited`).length,B=e=>_e(n,{query:p,type:e.type,modified:e.modified},o).filter(t=>e.status===`all`||L.get(t.path)===e.status),V=e=>h(ne,{className:`pl-4 tabular-nums`,children:B({...x,...e}).length}),H=ve(B(x),se,E),U=p!==``||x.status!==`all`||x.type!==`any`||x.modified!==`any`,Se=u===`tree`?ye(H,e=>U||ue.has(e)):H.map(e=>({kind:`file`,item:e,depth:0}));C(()=>{let e=`${u}:${M}`;if(r||M===void 0||xe.current===e)return;let t=I.current?.querySelector(`[aria-current="true"]`);t!=null&&(t.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`instant`}),xe.current=e)},[u,r,M,Se]);let Ce=e=>H.filter(t=>t.path.startsWith(`${e}/`)&&L.get(t.path)!==`viewed`&&s).length,we=`${se}:${E}`,W=()=>{m(``),S({...be,location:x.location})},G=e=>S({...x,status:x.status===e?`all`:e}),K=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.closest(`[data-testid="artifacts-grid"]`)?.querySelectorAll(`[data-artifact-row]`)??[]],n=t.indexOf(e.currentTarget);n<0||(e.preventDefault(),t[Math.max(0,Math.min(t.length-1,n+(e.key===`ArrowDown`?1:-1)))]?.focus())};return w(`section`,{"data-testid":`artifacts-grid`,"aria-label":`Artifacts`,className:`flex min-h-0 flex-1 flex-col bg-po-rail text-po-text`,children:[w(`div`,{role:`toolbar`,"aria-label":`Artifact view`,className:`flex shrink-0 items-center gap-1 px-3 pt-3 pb-2`,children:[w(re,{defaultOpen:F===`filter`,children:[h(ae,{asChild:!0,children:w(j,{variant:`ghost`,size:`sm`,className:`text-po-text`,children:[h(te,{"aria-hidden":!0,className:`size-3.5`}),`Filter`,x.status!==`all`||x.type!==`any`||x.modified!==`any`||x.location!==`artifacts`?h(e,{tone:`green`,"aria-label":`Filters on`}):null]})}),w(de,{align:`start`,className:`w-56`,children:[s?w(y,{children:[h(O,{children:`Status`}),h(b,{value:x.status,onValueChange:e=>S({...x,status:e}),children:Object.keys(Qe).map(e=>w(T,{value:e,children:[Qe[e],V({status:e})]},e))}),h(k,{})]}):null,h(O,{children:`Type`}),h(b,{value:x.type,onValueChange:e=>S({...x,type:e}),children:$e.map(e=>w(T,{value:e,children:[e===`any`?`All types`:e,V({type:e})]},e))}),h(k,{}),h(O,{children:`Modified`}),h(b,{value:x.modified,onValueChange:e=>S({...x,modified:e}),children:Object.keys(et).map(e=>w(T,{value:e,children:[et[e],V({modified:e})]},e))}),h(k,{}),h(O,{children:`Location`}),h(b,{value:x.location,onValueChange:e=>S({...x,location:e}),children:Object.keys(tt).map(e=>h(T,{value:e,children:tt[e]},e))}),U?w(y,{children:[h(k,{}),h(ce,{onSelect:W,children:`Reset filters`})]}):null]})]}),w(re,{defaultOpen:F===`sort`,children:[h(ae,{asChild:!0,children:w(j,{variant:`ghost`,size:`sm`,className:`text-po-text`,children:[`Sort`,h(f,{"aria-hidden":!0,className:`size-3`})]})}),h(de,{align:`start`,className:`w-48`,children:h(b,{value:we,onValueChange:e=>{let[t,n]=e.split(`:`);D(t,n)},children:Object.keys(nt).map(e=>h(T,{value:e,children:nt[e]},e))})})]}),h(`span`,{className:`flex-1`}),h(`fieldset`,{"aria-label":`Artifact view`,className:`flex shrink-0 gap-0.5`,children:[[`tree`,oe,`Tree view`],[`grid`,ie,`Preview view`]].map(([e,t,n])=>h(`button`,{type:`button`,"aria-label":n,title:n,"aria-pressed":u===e,onClick:()=>ee(e),className:`${l({active:u===e})} focus-visible:ring-2 focus-visible:ring-po-green`,children:h(t,{"aria-hidden":!0,className:`size-4`})},e))}),h(`button`,{type:`button`,"aria-label":`Search artifacts`,title:`Search artifacts`,"aria-expanded":_,onClick:()=>v(!_),className:`${l({active:_||p!==``})} focus-visible:ring-2 focus-visible:ring-po-green`,children:h(c,{"aria-hidden":!0,className:`size-4`})})]}),_?w(`div`,{className:`relative shrink-0 px-3 pb-2`,children:[h(c,{"aria-hidden":!0,className:`absolute top-2 left-5 size-4 text-po-dim`}),h(me,{"aria-label":`Search artifacts`,autoFocus:!0,placeholder:`Search by name or folder`,value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),m(``),v(!1))},className:`w-full pl-8`})]}):null,s&&R+z>0?w(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-po-border-soft px-3 pb-2`,children:[R>0?w(j,{variant:`ghost`,size:`xs`,"aria-pressed":x.status===`new`,onClick:()=>G(`new`),className:x.status===`new`?`bg-po-tint-green text-po-green`:`text-po-text`,children:[R,` new`]}):null,z>0?w(j,{variant:`ghost`,size:`xs`,"aria-pressed":x.status===`edited`,onClick:()=>G(`edited`),className:x.status===`edited`?`bg-po-tint-green text-po-green`:`text-po-text`,children:[z,` edited`]}):null,h(`span`,{className:`flex-1`}),N?h(j,{variant:`ghost`,size:`xs`,onClick:N,className:`text-po-dim`,children:`Mark all viewed`}):null]}):h(`div`,{className:`shrink-0 border-b border-po-border-soft`}),w(`div`,{ref:I,className:`min-h-0 flex-1 overflow-auto`,children:[i?w(`div`,{role:`alert`,className:`flex items-center gap-2 px-4 py-3`,children:[h(`p`,{className:`flex-1 text-sm text-po-red`,children:i}),a?h(j,{variant:`outline`,size:`xs`,onClick:a,children:`Try again`}):null]}):null,r?h(`output`,{className:`block px-4 py-3 text-sm text-po-dim`,children:`Loading files...`}):null,!r&&!i&&n.length===0?h(fe,{title:`Nothing here yet`,description:`Files Po makes in this session show up here.`,className:`px-4 py-8`}):null,!r&&n.length>0&&H.length===0?h(fe,{title:`No files match`,className:`px-4 py-8`,children:h(j,{variant:`ghost`,onClick:W,children:`Clear filters`})}):null,h(`div`,{className:u===`grid`?`grid grid-cols-2 gap-2 p-3`:`flex flex-col py-1`,children:Se.map(e=>{if(e.kind===`dir`){let t=Ce(e.path);return w(`button`,{type:`button`,"data-artifact-row":!0,"aria-expanded":e.open,onClick:()=>A(e.path),onKeyDown:t=>{K(t),(t.key===`ArrowRight`&&!e.open||t.key===`ArrowLeft`&&e.open)&&(t.preventDefault(),A(e.path))},className:`flex min-h-9 items-center gap-2 px-3 py-1.5 text-left hover:bg-po-panel focus-visible:ring-2 focus-visible:ring-po-green focus-visible:ring-inset`,children:[Array.from({length:e.depth},(e,t)=>h(`span`,{className:`w-3 shrink-0`},t)),e.open?h(f,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-po-dim`}):h(d,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-po-dim`}),h(oe,{"aria-hidden":!0,className:`size-4 shrink-0 text-po-dim`}),h(`span`,{className:`min-w-0 flex-1 truncate text-base font-medium`,children:e.name}),t>0?w(`span`,{className:`shrink-0 text-sm font-semibold text-po-green`,children:[t,` unviewed`]}):w(`span`,{className:`shrink-0 text-sm text-po-dim`,children:[e.count,` `,e.count===1?`file`:`files`]})]},e.path)}let t=L.get(e.item.path),n=t===`new`||t===`edited`,r=M===e.item.path,i=ge(e.item.path)===`Image`?pe:le;return w(`button`,{type:`button`,"data-artifact-row":!0,"data-artifact-path":e.item.path,"data-status":t,"aria-current":r?`true`:void 0,title:e.item.path,onClick:()=>he(e.item),onKeyDown:K,className:`${u===`grid`?`flex min-w-0 flex-col gap-1.5 rounded-md border p-2 text-left`:`flex min-h-9 items-center gap-2 border-l-2 px-3 py-1.5 text-left`} ${r?`border-po-green bg-po-panel`:u===`grid`?`border-po-border-soft hover:bg-po-panel`:`border-transparent hover:bg-po-panel`} focus-visible:ring-2 focus-visible:ring-po-green focus-visible:ring-inset`,children:[u===`grid`?w(`span`,{className:`relative flex h-24 w-full items-center justify-center overflow-hidden rounded-sm bg-po-deep text-po-dim`,children:[P?.(e.item)??h(i,{"aria-hidden":!0,className:`size-8`}),h(`span`,{className:`absolute top-1 left-1`,children:h(rt,{status:t})})]}):w(y,{children:[Array.from({length:e.depth},(e,t)=>h(`span`,{className:`w-3 shrink-0`},t)),h(`span`,{className:`w-3.5 shrink-0`}),h(i,{"aria-hidden":!0,className:`size-4 shrink-0 text-po-dim`})]}),w(`span`,{className:`flex w-full min-w-0 flex-1 items-center gap-2`,children:[h(`span`,{className:`min-w-0 flex-1 truncate text-base ${n?`font-semibold text-po-hi`:`text-po-text`}`,children:e.item.name}),u===`grid`?h(`span`,{className:`sr-only`,children:h(rt,{status:t===`viewed`?t:void 0})}):h(rt,{status:t}),h(at,{modifiedAt:e.item.modifiedAt,now:o})]})]},e.item.path)})})]}),w(`footer`,{"data-testid":`artifacts-count`,"aria-live":`polite`,className:`shrink-0 border-t border-po-border-soft px-4 py-2 text-sm text-po-dim`,children:[U?`${H.length} of ${n.length}`:n.length,` `,n.length===1?`file`:`files`]})]})}function at({modifiedAt:e,now:t}){let n=g(null);return C(()=>{let t=setInterval(()=>{let t=n.current?.firstChild;t&&(t.nodeValue=I(e,Date.now()))},6e4);return()=>clearInterval(t)},[e]),h(`time`,{ref:n,dateTime:new Date(e).toISOString(),className:`shrink-0 text-sm text-po-dim`,children:I(e,t)})}var ot=5242880,st=`artifact:`;function ct(e){let{sessionId:t}=e,n=D(V.store,e=>V.select(e,t)),r=D(J.store,e=>t===null?void 0:e[t]),i=D(Z.store,e=>t===null?Y:e[t]??Y),a=D(Ce.store),o=i.filters.location===`temporary`,s=Xe(t,o),[c,l]=E(Date.now);C(()=>{let e=V.store.subscribe(()=>l(Date.now()));return()=>e.unsubscribe()},[]);let u=We(e);C(()=>{if(t!==null)return u?.watchFocusedPath?.(t,e=>{if(typeof e!=`string`||!e.startsWith(st))return;let n=e.slice(9),r=n.split(`/`).slice(0,-1).map((e,t,n)=>n.slice(0,t+1).join(`/`)),i=Z.store.state[t]??Y;if(i.filters.location!==`artifacts`)return;let a=r.filter(e=>!i.expanded.includes(e));(i.openPath!==n||a.length!==0)&&Ie(t,e=>({...e,openPath:n,expanded:[...e.expanded,...a]}))})},[u,t]),C(()=>{if(t===null||n.loaded)return;let e=new AbortController;return Re(t,e.signal),()=>e.abort()},[t,n.loaded]);let d=e=>{t!==null&&Ie(t,t=>({...t,...e}))},f=o?s?.items??[]:n.items;return h(it,{items:f,loading:t!==null&&(o?s===void 0:!n.loaded),error:t===null?`The session is unavailable.`:o?s?.error:n.error,onRetry:t===null||o?void 0:()=>void Re(t,new AbortController().signal),now:c,statusOf:o?void 0:e=>F(e,r),layout:a===`grid`?`grid`:`tree`,onLayoutChange:we,query:i.query,onQueryChange:e=>d({query:e}),searchOpen:i.searchOpen,onSearchOpenChange:e=>d({searchOpen:e}),filters:i.filters,onFiltersChange:e=>{d({filters:e}),l(Date.now())},sort:i.sort,direction:i.direction,onSortChange:(e,t)=>d({sort:e,direction:t}),expanded:new Set(i.expanded),onToggleFolder:e=>d({expanded:i.expanded.includes(e)?i.expanded.filter(t=>t!==e):[...i.expanded,e]}),openPath:i.openPath,onOpen:n=>{if(t===null)return;Ye(e,n.path,i.filters.location),o||je(t,n);let r=n.path.split(`/`).slice(0,-1).map((e,t,n)=>n.slice(0,t+1).join(`/`));d({openPath:n.path,expanded:[...i.expanded,...r.filter(e=>!i.expanded.includes(e))]})},onMarkAllViewed:t===null?void 0:()=>Me(t,n.items),renderThumbnail:e=>t!==null&&ge(e.path)===`Image`&&e.size<=ot?h(Ze,{sessionId:t,item:e},e.path):void 0},t)}var lt=o({id:`artifacts`,label:`Artifacts`,icon:le,order:10,panel:ct,badge:{subscribe(e){let t=V.store.subscribe(e),n=J.store.subscribe(e);return()=>{t.unsubscribe(),n.unsubscribe()}},count:Ne}});function ut(e,t){let n=e.trim(),r;if(n.startsWith(`temporary:`))r=n.slice(10);else{if(!t||!t.startsWith(`/`))return;let e=t.replace(/\/+$/u,``);if(!n.startsWith(`${e}/`))return;r=n.slice(e.length+1)}if(!(!r||r.includes(`\\`)||r.includes(`\0`)||r.split(`/`).some(e=>!e||e===`.`||e===`..`)))return r}var dt=5,ft=p({subscribe(e){let t=V.store.subscribe(e);return()=>t.unsubscribe()},fingerprint:e=>V.select(V.store.state,e).temporaryRoot??``,resolve(e,t){let n=t.trim();if(e===null)return;let r=ut(n,V.select(V.store.state,e).temporaryRoot);if(r)return $(e,r,`temporary`);if(!n.startsWith(`artifact:`))return;let i=n.slice(9);return i===``?void 0:$(e,i)},mentions(e,t){let n=t.toLowerCase();return V.select(V.store.state,e).items.map(e=>`artifact:${e.path}`).filter(e=>e.toLowerCase().includes(n)).slice(0,dt).map(e=>({path:e,detail:`Artifact`}))}}),pt=x({slot:`help.guides`,id:`Artifacts`,order:10,data:{version:1,label:`Artifacts`,guides:[{id:`about`,question:`What are artifacts?`,order:0,answer:`Artifacts are important deliverables saved in this session’s durable artifact folder. Ordinary source edits stay in your project.`},{id:`find`,question:`Where do I find files Po made?`,order:1,answer:`The Artifacts activity section shows the three most recently changed files. Open its heading to see all this session’s artifacts. Previews are read-only.`}]}}),mt=(e,t)=>t===void 0?void 0:{...e,...t},ht=r({id:`artifacts`,session:{get channels(){return[mt({channel:`artifacts`},Le)]},get dockFaces(){return[mt({id:`artifacts`},lt)]},get fileLinks(){return ft},get fills(){return[mt({slot:`help.guides`,id:`artifacts`},pt)]}}});export{ht as webPlugin};
|
package/dist/worker.js
CHANGED
|
@@ -109838,151 +109838,151 @@ var virtual_po_capabilities_default = {
|
|
|
109838
109838
|
"packages": [
|
|
109839
109839
|
{
|
|
109840
109840
|
"name": "@agimon-ai/po-approval",
|
|
109841
|
-
"version": "0.0.0-alpha.
|
|
109841
|
+
"version": "0.0.0-alpha.118",
|
|
109842
109842
|
"contractFingerprint": "2fe2af06dfdf1ea281408f3a86b7599e2409044cac334bcd4060f55dac3d6953",
|
|
109843
109843
|
"operations": []
|
|
109844
109844
|
},
|
|
109845
109845
|
{
|
|
109846
109846
|
"name": "@agimon-ai/po-artifact",
|
|
109847
|
-
"version": "0.0.0-alpha.
|
|
109847
|
+
"version": "0.0.0-alpha.117",
|
|
109848
109848
|
"contractFingerprint": "594fd017f549087206fa296d5b98fe89cccf0942a71674bfbb8dadac4d13cb38",
|
|
109849
109849
|
"operations": []
|
|
109850
109850
|
},
|
|
109851
109851
|
{
|
|
109852
109852
|
"name": "@agimon-ai/po-autocompact",
|
|
109853
|
-
"version": "0.0.0-alpha.
|
|
109853
|
+
"version": "0.0.0-alpha.118",
|
|
109854
109854
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109855
109855
|
"operations": []
|
|
109856
109856
|
},
|
|
109857
109857
|
{
|
|
109858
109858
|
"name": "@agimon-ai/po-autostop",
|
|
109859
|
-
"version": "0.0.0-alpha.
|
|
109859
|
+
"version": "0.0.0-alpha.118",
|
|
109860
109860
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109861
109861
|
"operations": []
|
|
109862
109862
|
},
|
|
109863
109863
|
{
|
|
109864
109864
|
"name": "@agimon-ai/po-cache",
|
|
109865
|
-
"version": "0.0.0-alpha.
|
|
109865
|
+
"version": "0.0.0-alpha.118",
|
|
109866
109866
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109867
109867
|
"operations": []
|
|
109868
109868
|
},
|
|
109869
109869
|
{
|
|
109870
109870
|
"name": "@agimon-ai/po-codemode",
|
|
109871
|
-
"version": "0.0.1-alpha.
|
|
109871
|
+
"version": "0.0.1-alpha.91",
|
|
109872
109872
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109873
109873
|
"operations": []
|
|
109874
109874
|
},
|
|
109875
109875
|
{
|
|
109876
109876
|
"name": "@agimon-ai/po-config",
|
|
109877
|
-
"version": "0.0.0-alpha.
|
|
109877
|
+
"version": "0.0.0-alpha.118",
|
|
109878
109878
|
"contractFingerprint": "305bb8372fccda962a3c7bb747e009f767af4a5b9ae904cfd827e9c402caad42",
|
|
109879
109879
|
"operations": []
|
|
109880
109880
|
},
|
|
109881
109881
|
{
|
|
109882
109882
|
"name": "@agimon-ai/po-db",
|
|
109883
|
-
"version": "0.0.0-alpha.
|
|
109883
|
+
"version": "0.0.0-alpha.118",
|
|
109884
109884
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109885
109885
|
"operations": []
|
|
109886
109886
|
},
|
|
109887
109887
|
{
|
|
109888
109888
|
"name": "@agimon-ai/po-domain",
|
|
109889
|
-
"version": "0.0.0-alpha.
|
|
109889
|
+
"version": "0.0.0-alpha.118",
|
|
109890
109890
|
"contractFingerprint": "c220aecf68c3758ff1f202c702a7e14e93318b2be7c918e49211dd9fce29be0c",
|
|
109891
109891
|
"operations": []
|
|
109892
109892
|
},
|
|
109893
109893
|
{
|
|
109894
109894
|
"name": "@agimon-ai/po-edit",
|
|
109895
|
-
"version": "0.0.0-alpha.
|
|
109895
|
+
"version": "0.0.0-alpha.118",
|
|
109896
109896
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109897
109897
|
"operations": []
|
|
109898
109898
|
},
|
|
109899
109899
|
{
|
|
109900
109900
|
"name": "@agimon-ai/po-file-edit",
|
|
109901
|
-
"version": "0.0.0-alpha.
|
|
109901
|
+
"version": "0.0.0-alpha.118",
|
|
109902
109902
|
"contractFingerprint": "07e1c97e8188721bceb5b6858acf08a3b4dd9c237d17070e92d38a5ee9a5a904",
|
|
109903
109903
|
"operations": []
|
|
109904
109904
|
},
|
|
109905
109905
|
{
|
|
109906
109906
|
"name": "@agimon-ai/po-grep",
|
|
109907
|
-
"version": "0.0.0-alpha.
|
|
109907
|
+
"version": "0.0.0-alpha.118",
|
|
109908
109908
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109909
109909
|
"operations": []
|
|
109910
109910
|
},
|
|
109911
109911
|
{
|
|
109912
109912
|
"name": "@agimon-ai/po-log",
|
|
109913
|
-
"version": "0.0.0-alpha.
|
|
109913
|
+
"version": "0.0.0-alpha.118",
|
|
109914
109914
|
"contractFingerprint": "1187b405bf6fe09e5d7079edbe2c993f22ec6d1ec8bfadd5ad297733dc4457eb",
|
|
109915
109915
|
"operations": []
|
|
109916
109916
|
},
|
|
109917
109917
|
{
|
|
109918
109918
|
"name": "@agimon-ai/po-major-mode",
|
|
109919
|
-
"version": "0.0.0-alpha.
|
|
109919
|
+
"version": "0.0.0-alpha.118",
|
|
109920
109920
|
"contractFingerprint": "d7c10b6c5f808271f9cd1a3ec6803cb0f0f282f1a3ec390643c2b2fee1a081cd",
|
|
109921
109921
|
"operations": []
|
|
109922
109922
|
},
|
|
109923
109923
|
{
|
|
109924
109924
|
"name": "@agimon-ai/po-mcp",
|
|
109925
|
-
"version": "0.0.0-alpha.
|
|
109925
|
+
"version": "0.0.0-alpha.118",
|
|
109926
109926
|
"contractFingerprint": "f1fb4803383ca7ba30b1394794a135662de7316c06c3b46637e167f02d9fba02",
|
|
109927
109927
|
"operations": []
|
|
109928
109928
|
},
|
|
109929
109929
|
{
|
|
109930
109930
|
"name": "@agimon-ai/po-minor-mode",
|
|
109931
|
-
"version": "0.0.0-alpha.
|
|
109931
|
+
"version": "0.0.0-alpha.118",
|
|
109932
109932
|
"contractFingerprint": "9d4d7a4b9c338333a720b9f7fc083970d95b6d4f8be11b5f2920b40b7198c002",
|
|
109933
109933
|
"operations": []
|
|
109934
109934
|
},
|
|
109935
109935
|
{
|
|
109936
109936
|
"name": "@agimon-ai/po-notification",
|
|
109937
|
-
"version": "0.0.0-alpha.
|
|
109937
|
+
"version": "0.0.0-alpha.118",
|
|
109938
109938
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109939
109939
|
"operations": []
|
|
109940
109940
|
},
|
|
109941
109941
|
{
|
|
109942
109942
|
"name": "@agimon-ai/po-profile",
|
|
109943
|
-
"version": "0.0.0-alpha.
|
|
109943
|
+
"version": "0.0.0-alpha.118",
|
|
109944
109944
|
"contractFingerprint": "8684a340a22cccbb87b2455fee65de6c8045e61ee68288511140f03097aeac01",
|
|
109945
109945
|
"operations": []
|
|
109946
109946
|
},
|
|
109947
109947
|
{
|
|
109948
109948
|
"name": "@agimon-ai/po-prompt",
|
|
109949
|
-
"version": "0.0.0-alpha.
|
|
109949
|
+
"version": "0.0.0-alpha.118",
|
|
109950
109950
|
"contractFingerprint": "37a470cef4017ee8ee1bf55ae9567b20ee04cb3ee2baaaed5b409d90d8277e51",
|
|
109951
109951
|
"operations": []
|
|
109952
109952
|
},
|
|
109953
109953
|
{
|
|
109954
109954
|
"name": "@agimon-ai/po-read",
|
|
109955
|
-
"version": "0.0.0-alpha.
|
|
109955
|
+
"version": "0.0.0-alpha.118",
|
|
109956
109956
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109957
109957
|
"operations": []
|
|
109958
109958
|
},
|
|
109959
109959
|
{
|
|
109960
109960
|
"name": "@agimon-ai/po-runner",
|
|
109961
|
-
"version": "0.0.0-alpha.
|
|
109961
|
+
"version": "0.0.0-alpha.118",
|
|
109962
109962
|
"contractFingerprint": "90bdb18b26c2e820b9c55db2c4c563a1b9df2d528844c9e7bb3e86027c57ec18",
|
|
109963
109963
|
"operations": []
|
|
109964
109964
|
},
|
|
109965
109965
|
{
|
|
109966
109966
|
"name": "@agimon-ai/po-session",
|
|
109967
|
-
"version": "0.0.0-alpha.
|
|
109967
|
+
"version": "0.0.0-alpha.118",
|
|
109968
109968
|
"contractFingerprint": "23e1825133c5d10030161590d858cdd4636159973d94ea747500bbf3cd3e60c0",
|
|
109969
109969
|
"operations": []
|
|
109970
109970
|
},
|
|
109971
109971
|
{
|
|
109972
109972
|
"name": "@agimon-ai/po-skill",
|
|
109973
|
-
"version": "0.0.0-alpha.
|
|
109973
|
+
"version": "0.0.0-alpha.118",
|
|
109974
109974
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109975
109975
|
"operations": []
|
|
109976
109976
|
},
|
|
109977
109977
|
{
|
|
109978
109978
|
"name": "@agimon-ai/po-ui",
|
|
109979
|
-
"version": "0.0.0-alpha.
|
|
109979
|
+
"version": "0.0.0-alpha.118",
|
|
109980
109980
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109981
109981
|
"operations": []
|
|
109982
109982
|
},
|
|
109983
109983
|
{
|
|
109984
109984
|
"name": "@agimon-ai/po-vault",
|
|
109985
|
-
"version": "0.0.0-alpha.
|
|
109985
|
+
"version": "0.0.0-alpha.118",
|
|
109986
109986
|
"contractFingerprint": "488617da2873d7b4aac523bb93c7a528caf573c41009d22b47af27765478b33a",
|
|
109987
109987
|
"operations": []
|
|
109988
109988
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-cloudflare",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.18",
|
|
4
4
|
"description": "Cloudflare Workers and Durable Objects host for Po headless sessions. Ships the built Worker and its wrangler config.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
@@ -22,37 +22,37 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@agimon-ai/po-approval": "0.0.0-alpha.
|
|
26
|
-
"@agimon-ai/po-artifact": "0.0.0-alpha.
|
|
27
|
-
"@agimon-ai/po-autocompact": "0.0.0-alpha.
|
|
28
|
-
"@agimon-ai/po-autostop": "0.0.0-alpha.
|
|
29
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
30
|
-
"@agimon-ai/po-cache": "0.0.0-alpha.
|
|
31
|
-
"@agimon-ai/po-calendar": "0.0.1-alpha.
|
|
32
|
-
"@agimon-ai/po-codemode": "0.0.1-alpha.
|
|
33
|
-
"@agimon-ai/po-config": "0.0.0-alpha.
|
|
34
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
35
|
-
"@agimon-ai/po-db": "0.0.0-alpha.
|
|
36
|
-
"@agimon-ai/po-domain": "0.0.0-alpha.
|
|
37
|
-
"@agimon-ai/po-edit": "0.0.0-alpha.
|
|
38
|
-
"@agimon-ai/po-file-edit": "0.0.0-alpha.
|
|
39
|
-
"@agimon-ai/po-grep": "0.0.0-alpha.
|
|
40
|
-
"@agimon-ai/po-identity": "0.0.2-alpha.
|
|
41
|
-
"@agimon-ai/po-log": "0.0.0-alpha.
|
|
42
|
-
"@agimon-ai/po-major-mode": "0.0.0-alpha.
|
|
43
|
-
"@agimon-ai/po-mcp": "0.0.0-alpha.
|
|
44
|
-
"@agimon-ai/po-minor-mode": "0.0.0-alpha.
|
|
45
|
-
"@agimon-ai/po-network": "0.0.2-alpha.
|
|
46
|
-
"@agimon-ai/po-notification": "0.0.0-alpha.
|
|
47
|
-
"@agimon-ai/po-profile": "0.0.0-alpha.
|
|
48
|
-
"@agimon-ai/po-prompt": "0.0.0-alpha.
|
|
49
|
-
"@agimon-ai/po-read": "0.0.0-alpha.
|
|
50
|
-
"@agimon-ai/po-runner": "0.0.0-alpha.
|
|
51
|
-
"@agimon-ai/po-session": "0.0.0-alpha.
|
|
52
|
-
"@agimon-ai/po-skill": "0.0.0-alpha.
|
|
53
|
-
"@agimon-ai/po-ui": "0.0.0-alpha.
|
|
54
|
-
"@agimon-ai/po-vault": "0.0.0-alpha.
|
|
55
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
25
|
+
"@agimon-ai/po-approval": "0.0.0-alpha.118",
|
|
26
|
+
"@agimon-ai/po-artifact": "0.0.0-alpha.117",
|
|
27
|
+
"@agimon-ai/po-autocompact": "0.0.0-alpha.118",
|
|
28
|
+
"@agimon-ai/po-autostop": "0.0.0-alpha.118",
|
|
29
|
+
"@agimon-ai/po-build": "0.0.0-alpha.118",
|
|
30
|
+
"@agimon-ai/po-cache": "0.0.0-alpha.118",
|
|
31
|
+
"@agimon-ai/po-calendar": "0.0.1-alpha.77",
|
|
32
|
+
"@agimon-ai/po-codemode": "0.0.1-alpha.91",
|
|
33
|
+
"@agimon-ai/po-config": "0.0.0-alpha.118",
|
|
34
|
+
"@agimon-ai/po-core": "0.0.0-alpha.118",
|
|
35
|
+
"@agimon-ai/po-db": "0.0.0-alpha.118",
|
|
36
|
+
"@agimon-ai/po-domain": "0.0.0-alpha.118",
|
|
37
|
+
"@agimon-ai/po-edit": "0.0.0-alpha.118",
|
|
38
|
+
"@agimon-ai/po-file-edit": "0.0.0-alpha.118",
|
|
39
|
+
"@agimon-ai/po-grep": "0.0.0-alpha.118",
|
|
40
|
+
"@agimon-ai/po-identity": "0.0.2-alpha.65",
|
|
41
|
+
"@agimon-ai/po-log": "0.0.0-alpha.118",
|
|
42
|
+
"@agimon-ai/po-major-mode": "0.0.0-alpha.118",
|
|
43
|
+
"@agimon-ai/po-mcp": "0.0.0-alpha.118",
|
|
44
|
+
"@agimon-ai/po-minor-mode": "0.0.0-alpha.118",
|
|
45
|
+
"@agimon-ai/po-network": "0.0.2-alpha.65",
|
|
46
|
+
"@agimon-ai/po-notification": "0.0.0-alpha.118",
|
|
47
|
+
"@agimon-ai/po-profile": "0.0.0-alpha.118",
|
|
48
|
+
"@agimon-ai/po-prompt": "0.0.0-alpha.118",
|
|
49
|
+
"@agimon-ai/po-read": "0.0.0-alpha.118",
|
|
50
|
+
"@agimon-ai/po-runner": "0.0.0-alpha.118",
|
|
51
|
+
"@agimon-ai/po-session": "0.0.0-alpha.118",
|
|
52
|
+
"@agimon-ai/po-skill": "0.0.0-alpha.118",
|
|
53
|
+
"@agimon-ai/po-ui": "0.0.0-alpha.118",
|
|
54
|
+
"@agimon-ai/po-vault": "0.0.0-alpha.118",
|
|
55
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.118",
|
|
56
56
|
"@better-auth/sso": "1.7.12",
|
|
57
57
|
"@cloudflare/puppeteer": "1.4.0",
|
|
58
58
|
"@cloudflare/workers-types": "5.20261013.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{$t as e,An as t,Bn as n,Bt as r,Cn as i,Dn as a,En as o,F as s,Ft as c,Hn as l,Lt as u,Mt as d,Nn as f,On as ee,W as p,a as m,at as te,cn as ne,en as re,f as h,g,hn as ie,ht as _,i as ae,in as v,kn as y,kt as b,l as x,ln as oe,mn as se,n as S,nn as ce,o as C,on as w,p as T,pn as le,r as E,rn as D,s as ue,sn as O,tn as de,un as fe,v as pe,vn as me,vt as k,yn as he}from"../chunks/po-web-runtime-Czm_C4SJ.js";var A=`artifacts`,j=26214400;function ge(e){return e===`tree`||e===`list`||e===`grid`}function M(e){return/\.(?:md|markdown)$/iu.test(e)?`Markdown`:/\.(?:png|jpe?g|gif|webp|avif|bmp|svg|ico|tiff?)$/iu.test(e)?`Image`:/\.(?:jsonl?|csv|tsv|ya?ml|xml|toml|parquet|sqlite|db)$/iu.test(e)?`Data`:/\.(?:[cm]?[jt]sx?|html?|css|scss|sass|less|py|sh|bash|go|rs|rb|java|c|cpp|cc|h|hpp|sql|swift|kt|kts|php|vue|svelte)$/iu.test(e)?`Code`:/\.(?:pdf|txt|rtf|docx?|xlsx?|pptx?|odt|ods|odp)$/iu.test(e)?`Document`:`Other`}function _e(e,t,n){let r=(t.query??``).trim().toLowerCase(),i=t.modified??`any`,a=new Date(n);a.setHours(0,0,0,0);let o=i===`today`?a.getTime():n-(i===`7days`?7:30)*864e5;return e.filter(e=>e.path.toLowerCase().includes(r)&&(!t.type||t.type===`any`||M(e.path)===t.type)&&(i===`any`||e.modifiedAt>=o&&e.modifiedAt<=n))}function ve(e,t,n){return[...e].sort((e,r)=>(t===`name`?N(e.name.toLowerCase(),r.name.toLowerCase()):t===`size`?e.size-r.size:e.modifiedAt-r.modifiedAt)*(n===`asc`?1:-1)||N(e.path,r.path))}function N(e,t){return e<t?-1:+(e>t)}function ye(e,t){let n={path:``,dirs:new Map,files:[],count:0};for(let t of e){let e=n;e.count++;for(let n of t.path.split(`/`).slice(0,-1)){let t=e.dirs.get(n);t||(t={path:e.path?`${e.path}/${n}`:n,dirs:new Map,files:[],count:0},e.dirs.set(n,t)),e=t,e.count++}e.files.push(t)}let r=[],i=(e,n)=>{for(let[a,o]of[...e.dirs].sort(([e],[t])=>N(e,t))){let e=a,s=o;for(;s.files.length===0&&s.dirs.size===1;){let[[t,n]]=[...s.dirs];e=`${e}/${t}`,s=n}let c=t(s.path);r.push({kind:`dir`,path:s.path,name:e,depth:n,open:c,count:s.count}),c&&i(s,n+1)}for(let t of e.files)r.push({kind:`file`,item:t,depth:n})};return i(n,0),r}function be(e,t){if(t===void 0)return`viewed`;let n=t.seen[e.path];return n===void 0?e.modifiedAt>t.baseline?`new`:`viewed`:e.modifiedAt>n?`edited`:`viewed`}var xe={status:`all`,type:`any`,modified:`any`,location:`artifacts`};function P(e,t){let n=Math.floor(Math.max(0,t-e)/6e4);return n<1?`now`:n<60?`${n}m`:n<1440?`${Math.floor(n/60)}h`:n<10080?`${Math.floor(n/1440)}d`:new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`})}function Se(e){return[...e].sort((e,t)=>t.modifiedAt-e.modifiedAt||(e.path<t.path?-1:+(e.path>t.path)))}function F(e,t){return`artifact:${encodeURIComponent(e)}:${encodeURIComponent(t)}`}function I(e,t){if(!t||t.startsWith(`/`)||t.includes(`\\`)||/^[a-z][a-z0-9+.-]*:/iu.test(t))throw Error(`Artifact images must use a relative path.`);let n=e.split(`/`).slice(0,-1);for(let e of t.split(`/`))if(e!==``&&e!==`.`){if(e===`..`){if(n.length===0)throw Error(`The image is outside this artifact folder.`);n.pop()}else n.push(e)}if(n.length===0)throw Error(`The image path is empty.`);return n.join(`/`)}function L(e){return/\.(?:png|jpe?g|gif|webp|avif|bmp|svg|ico|mp3|wav|m4a|ogg|mp4|mov|webm|pdf)$/iu.test(e)?`media`:/\.(?:md|markdown)$/iu.test(e)?`markdown`:/\.html?$/iu.test(e)?`html`:/\.(?:[cm]?[jt]sx?|json|ya?ml|css|scss|py|sh|bash|go|rs|rb|java|c|cpp|h|sql|xml|toml)$/iu.test(e)?`code`:`text`}function R(e){if(typeof e!=`object`||!e||!(`items`in e)||!Array.isArray(e.items)||`error`in e&&e.error!==void 0&&typeof e.error!=`string`)return null;let t=[];for(let n of e.items){if(typeof n!=`object`||!n||typeof n.path!=`string`||!n.path||n.path.startsWith(`/`)||n.path.includes(`\\`)||n.path.split(`/`).some(e=>e===`..`||e===`.`)||typeof n.name!=`string`||!n.name||typeof n.size!=`number`||!Number.isFinite(n.size)||n.size<0||typeof n.modifiedAt!=`number`||!Number.isFinite(n.modifiedAt)||n.modifiedAt<0)return null;t.push({path:n.path,name:n.name,size:n.size,modifiedAt:n.modifiedAt})}return{items:Se(t),...`temporaryRoot`in e&&typeof e.temporaryRoot==`string`?{temporaryRoot:e.temporaryRoot}:{},...`error`in e&&typeof e.error==`string`?{error:e.error}:{}}}var z=f({items:[],loaded:!1}),B=z.channel({channel:A,parse:R,reduce:(e,t)=>({...t,loaded:!0})}),V=`po.artifacts.layout.v1`;function H(){try{let e=globalThis.localStorage.getItem(V);return ge(e)?e:`tree`}catch{return`tree`}}var U=t(H());function Ce(e){U.update(()=>e);try{globalThis.localStorage.setItem(V,e)}catch{}}var W=`po.artifacts.seen.v1`,G=`po.artifacts.browse.v1`,K=200;function q(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function we(e,t){try{let n=JSON.parse(globalThis.localStorage.getItem(e)??`{}`);return q(n)?Object.fromEntries(Object.entries(n).flatMap(([e,n])=>{let r=t(n);return r===void 0?[]:[[e,r]]})):{}}catch{return{}}}function Te(e,t,n){return Object.fromEntries([...Object.entries(e).filter(([e])=>e!==t),[t,n]].slice(-50))}function Ee(e,t){try{globalThis.localStorage.setItem(e,JSON.stringify(t))}catch{}}function De(e){if(!q(e)||typeof e.baseline!=`number`||!q(e.seen))return;let t=Object.fromEntries(Object.entries(e.seen).filter(e=>typeof e[1]==`number`));return{baseline:e.baseline,seen:t}}var J=t(we(W,De));function Oe(e){let t=z.select(z.store.state,e);if(t.loaded&&t.error===void 0)return{baseline:Math.max(0,...t.items.map(e=>e.modifiedAt)),seen:{}}}function ke(e,t){let n=J.store.state[e]??Oe(e);if(n===void 0)return;let r=t(n);r!==n&&(J.update(t=>Te(t,e,r)),Ee(W,J.store.state))}function Ae(e,t){ke(e,e=>{if(e.seen[t.path]===t.modifiedAt)return e;let n=[...Object.entries(e.seen).filter(([e])=>e!==t.path),[t.path,t.modifiedAt]].slice(-1e3);return{...e,seen:Object.fromEntries(n)}})}function je(e,t){ke(e,()=>({baseline:Math.max(0,...t.map(e=>e.modifiedAt)),seen:{}}))}function Me(e){if(e===null)return 0;let t=J.store.state[e];return z.select(z.store.state,e).items.filter(e=>be(e,t)!==`viewed`).length}function Ne(){for(let e of Object.keys(z.store.state)){if(J.store.state[e]!==void 0)continue;let t=Oe(e);t!==void 0&&ke(e,()=>t)}}z.store.subscribe(Ne);var Y={filters:xe,sort:`modified`,direction:`desc`,expanded:[],query:``,searchOpen:!1};function X(e,t,n){return t.includes(e)?e:n}function Pe(e){if(!q(e))return;let t=q(e.filters)?e.filters:{};return{filters:{status:X(t.status,[`all`,`new`,`edited`,`viewed`],`all`),type:X(t.type,[`any`,`Markdown`,`Image`,`Code`,`Data`,`Document`,`Other`],`any`),modified:X(t.modified,[`any`,`today`,`7days`,`30days`],`any`),location:X(t.location,[`artifacts`,`temporary`],`artifacts`)},sort:X(e.sort,[`name`,`size`,`modified`],`modified`),direction:X(e.direction,[`asc`,`desc`],`desc`),expanded:Array.isArray(e.expanded)?e.expanded.filter(e=>typeof e==`string`).slice(0,K):[],...typeof e.openPath==`string`?{openPath:e.openPath}:{},query:``,searchOpen:!1}}var Z=t(we(G,Pe));function Fe(e,t){let n=t(Z.store.state[e]??Y);Z.update(t=>Te(t,e,n)),Ee(G,Object.fromEntries(Object.entries(Z.store.state).map(([e,t])=>[e,{...t,query:``,searchOpen:!1,expanded:t.expanded.slice(0,K)}])))}var Ie=o(B),Q=i({list:{method:`GET`,path:`/`,query:[`scope`],response:void 0},preview:{method:`GET`,path:`/preview`,query:[`path`,`scope`],response:void 0},content:{method:`GET`,path:`/content`,query:[`path`,`scope`],raw:!0}},{scopes:[`session`],basePath:`artifacts`,transport:(e,t)=>S.fetch(e,t),sessionAddress:l});async function Le(e,t){let n=z.select(z.store.state,e);try{let r=await Q.session(e).list({signal:t});if(t.aborted||z.select(z.store.state,e)!==n)return;let i=r.ok?R(r.data):null;z.update(e,()=>i?{...i,loaded:!0}:{...n,loaded:!0,error:r.ok?`The session answered with no artifact list.`:r.error||`Artifacts could not be loaded.`})}catch(r){!t.aborted&&z.select(z.store.state,e)===n&&z.update(e,()=>({...n,loaded:!0,error:r instanceof Error?r.message:String(r)}))}}async function Re(e,t,n=`artifacts`){let r=await Q.session(e).list({...n===`temporary`?{query:{scope:n}}:{},signal:t});if(!r.ok)throw Error(r.error||`Files could not be loaded.`);let i=R(r.data);if(!i)throw Error(`The session returned an invalid file list.`);return i}async function ze(e,t,n,r=`artifacts`){let i=await Q.session(e).preview({query:{path:t,...r===`temporary`?{scope:r}:{}},signal:n});if(!i.ok)throw Error(i.error||`This artifact could not be read.`);let a=i.data;if(!a||typeof a.path!=`string`||typeof a.content!=`string`||typeof a.mimeType!=`string`)throw Error(`The session answered with no artifact.`);return a}async function Be(e,t,n,r=`artifacts`){let i=Q.session(e),a={path:t,...r===`temporary`?{scope:r}:{}},o=await i.content({query:a,...n?{signal:n}:{}});if(o.ok)return o.response.blob();if(o.status!==413)throw Error(o.error||`This artifact could not be loaded.`);let s=[],c=0,l=1,u,d=``;for(;c<l;){let e=await i.content({query:a,headers:{range:`bytes=${c}-${c+j-1}`,...u?{"if-match":u}:{}},...n?{signal:n}:{}}),t=e.ok?/^bytes (\d+)-(\d+)\/(\d+)$/u.exec(e.response.headers.get(`content-range`)??``):null;if(!e.ok||e.status!==206||!t||Number(t[1])!==c)throw Error(e.ok?`This artifact changed while loading.`:e.error||`This artifact could not be loaded.`);if(l=Number(t[3]),l>134217728)throw Error(`This artifact is too large to load.`);u??=e.response.headers.get(`etag`)??void 0,d||=e.response.headers.get(`content-type`)??``;let r=await e.response.blob();if(r.size!==Number(t[2])-c+1)throw Error(`This artifact changed while loading.`);s.push(r),c+=r.size}return new Blob(s,{type:d})}async function Ve(e,t,n,r=`artifacts`){let i=I(t,n),a=await Be(e,i,void 0,r);if(!a.type.startsWith(`image/`))throw Error(`This artifact asset is not an image.`);let o=URL.createObjectURL(a);return{url:o,dispose:()=>URL.revokeObjectURL(o),path:i}}var He={slot:`author.open-source`,parse(e){if(typeof e!=`object`||!e)return null;let t=e;return t.watchFocusedPath!==void 0&&typeof t.watchFocusedPath!=`function`?null:t.version===1&&typeof t.createTab==`function`?t:null}};function Ue(e){return e.sessionId===null?void 0:e.slotData?.(He)?.[0]?.data}function We({path:e,preview:t,error:n,media:i,loadImage:a,documentPath:o,renderMediaReview:s}){let c=L(e);return C(`div`,{"data-testid":`artifact-preview`,"data-artifact-path":e,className:`flex min-h-0 flex-1 flex-col bg-po-bg text-po-text`,children:[C(`header`,{className:`flex shrink-0 items-center gap-2 border-b border-po-border px-4 py-3`,children:[m(_,{path:e,className:`min-w-0 flex-1`}),m(`span`,{className:`text-sm text-po-dim`,children:`Artifact`})]}),m(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:n?m(`p`,{role:`alert`,className:`text-sm text-po-red`,children:n}):t?c===`media`?i:t.unavailable?m(`p`,{className:`text-sm text-po-dim`,children:t.reason??`This artifact cannot be previewed.`}):c===`markdown`?m(g,{text:t.content,loadImage:a,documentPath:o,renderMediaReview:s}):c===`html`?m(`iframe`,{title:e,sandbox:``,srcDoc:t.content,className:`h-96 w-full rounded-md border border-po-border bg-po-deep`}):c===`code`?m(r,{value:t.content,path:e,readOnly:!0,className:`min-h-64 rounded-md border border-po-border`}):m(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-sm text-po-text`,children:t.content}):m(`p`,{role:`status`,className:`text-sm text-po-dim`,children:`Reading this artifact...`})})]})}function Ge({sessionId:e,path:t,revision:n,scope:r}){let[i,a]=T(),o=`${r}:${e}:${t}:${n}`;x(()=>{let n=new AbortController,i;return Be(e,t,n.signal,r).then(e=>{n.signal.aborted||(i=URL.createObjectURL(e),a({source:o,url:i,mimeType:e.type}))}).catch(e=>{n.signal.aborted||a({source:o,error:e instanceof Error?e.message:String(e)})}),()=>{n.abort(),i!==void 0&&URL.revokeObjectURL(i)}},[e,t,o,r]);let s=i?.source===o?i:void 0;return s?.url?m(pe,{src:s.url,path:t,contentType:s.mimeType}):m(`p`,{role:s?.error?`alert`:`status`,className:s?.error?`text-sm text-po-red`:`text-sm text-po-dim`,children:s?.error??`Loading artifact media...`})}function Ke(e,t){return e===`artifacts`?`artifact:${t}`:t}function qe(e){let{path:t,sessionId:n,scope:r=`artifacts`}=e,i=E(z.store,e=>z.select(e,n)),a=i.items.find(e=>e.path===t),o=r===`temporary`?`temporary`:a?`${a.modifiedAt}:${a.size}`:i.loaded?`missing`:`initial`,[s,c]=T();x(()=>{if(n===null||o===`missing`)return;let e=new AbortController;return ze(n,t,e.signal,r).then(r=>{e.signal.aborted||c({sessionId:n,path:t,revision:o,preview:r})}).catch(r=>{e.signal.aborted||c({sessionId:n,path:t,revision:o,error:r instanceof Error?r.message:String(r)})}),()=>e.abort()},[n,t,o,r]);let l=s?.sessionId===n&&s.path===t&&s.revision===o?s:void 0,u=ue(e=>n===null?Promise.reject(Error(`The session is unavailable.`)):Ve(n,t,e,r).then(e=>({...e,path:Ke(r,e.path)})),[n,t,r]);return m(We,{path:t,preview:l?.preview,error:n===null?`The session is unavailable.`:o===`missing`?`This artifact no longer exists.`:l?.error,loadImage:u,documentPath:Ke(r,t),renderMediaReview:b(e),media:n===null?void 0:m(Ge,{sessionId:n,path:t,revision:o,scope:r})})}function $(e,t,n=`artifacts`){return{id:`${n===`temporary`?`temporary:`:``}${F(e,t)}`,label:t.split(`/`).at(-1)??t,panel:r=>m(qe,{...r,sessionId:e,path:t,scope:n}),...n===`artifacts`?{onOpen:e=>{let n=z.select(z.store.state,e).items.find(e=>e.path===t);n!==void 0&&Ae(e,n)}}:{}}}function Je(e,t,n=`artifacts`){if(e.sessionId===null)return;if(n===`temporary`){e.openTransientTab($(e.sessionId,t,n));return}let r=Ue(e);e.openTransientTab(r?.createTab({sessionId:e.sessionId,path:`artifact:${t}`})??$(e.sessionId,t))}function Ye(e,t){let n=E(z.store,t=>z.select(t,e)),[r,i]=T();return x(()=>{if(e===null||!t)return;let n=new AbortController;return(async()=>{try{let t=await Re(e,n.signal,`temporary`);n.signal.aborted||i({...t,sessionId:e})}catch(t){n.signal.aborted||i(n=>({sessionId:e,items:n?.sessionId===e?n.items:[],error:t instanceof Error?t.message:String(t)}))}})(),()=>{n.abort()}},[e,t,n]),r?.sessionId===e?r:void 0}function Xe({sessionId:e,item:t}){let n=h(null),[r,i]=T(),a=`${e}:${t.path}:${t.modifiedAt}:${t.size}`;return x(()=>{let r=n.current;if(!r)return;let o=new AbortController,s,c=()=>{Be(e,t.path,o.signal).then(e=>{o.signal.aborted||e.size>5242880||!e.type.startsWith(`image/`)||(s=URL.createObjectURL(e),i({revision:a,url:s}))}).catch(()=>{})},l=typeof IntersectionObserver>`u`?void 0:new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(l?.disconnect(),c())});return l?l.observe(r):c(),()=>{l?.disconnect(),o.abort(),s&&URL.revokeObjectURL(s)}},[e,t.path,a]),m(`span`,{ref:n,className:`flex h-full w-full items-center justify-center`,children:r?.revision===a?m(`img`,{src:r.url,alt:``,className:`h-full w-full object-cover`}):m(me,{"aria-hidden":!0,className:`size-8`})})}var Ze={all:`All`,new:`New`,edited:`Edited`,viewed:`Viewed`},Qe=[`any`,`Markdown`,`Image`,`Code`,`Data`,`Document`,`Other`],$e={any:`Any time`,today:`Today`,"7days":`Past 7 days`,"30days":`Past 30 days`},et={artifacts:`Artifacts`,temporary:`Temporary files`},tt={"modified:desc":`Recently changed`,"modified:asc":`Oldest first`,"name:asc":`Name A to Z`,"name:desc":`Name Z to A`,"size:desc":`Largest first`,"size:asc":`Smallest first`};function nt({status:e}){return e===`new`?m(p,{tone:`green`,size:`xs`,className:`shrink-0 bg-po-tint-green`,children:`New`}):e===`edited`?m(p,{tone:`green`,size:`xs`,className:`shrink-0`,children:`Edited`}):e===`viewed`?m(`span`,{className:`sr-only`,children:`, viewed`}):null}function rt(t){let{items:n,loading:r,error:i,onRetry:a,now:o,statusOf:l,layout:f,onLayoutChange:ee,query:p,onQueryChange:g,searchOpen:_,onSearchOpenChange:y,filters:b,onFiltersChange:S,sort:T,direction:E,onSortChange:ue,expanded:pe,onToggleFolder:A,openPath:j,onOpen:ge,onMarkAllViewed:N,renderThumbnail:be,defaultMenuOpen:P}=t,Se=h(null),F=h(void 0),I=new Map(n.map(e=>[e.path,l?.(e)])),L=n.filter(e=>I.get(e.path)===`new`).length,R=n.filter(e=>I.get(e.path)===`edited`).length,z=e=>_e(n,{query:p,type:e.type,modified:e.modified},o).filter(t=>e.status===`all`||I.get(t.path)===e.status),B=e=>m(ne,{className:`pl-4 tabular-nums`,children:z({...b,...e}).length}),V=ve(z(b),T,E),H=p!==``||b.status!==`all`||b.type!==`any`||b.modified!==`any`,U=f===`tree`?ye(V,e=>H||pe.has(e)):V.map(e=>({kind:`file`,item:e,depth:0}));x(()=>{let e=`${f}:${j}`;if(r||j===void 0||F.current===e)return;let t=Se.current?.querySelector(`[aria-current="true"]`);t!=null&&(t.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`instant`}),F.current=e)},[f,r,j,U]);let Ce=e=>V.filter(t=>t.path.startsWith(`${e}/`)&&I.get(t.path)!==`viewed`&&l).length,W=`${T}:${E}`,G=()=>{g(``),S({...xe,location:b.location})},K=e=>S({...b,status:b.status===e?`all`:e}),q=e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.closest(`[data-testid="artifacts-grid"]`)?.querySelectorAll(`[data-artifact-row]`)??[]],n=t.indexOf(e.currentTarget);n<0||(e.preventDefault(),t[Math.max(0,Math.min(t.length-1,n+(e.key===`ArrowDown`?1:-1)))]?.focus())};return C(`section`,{"data-testid":`artifacts-grid`,"aria-label":`Artifacts`,className:`flex min-h-0 flex-1 flex-col bg-po-rail text-po-text`,children:[C(`div`,{role:`toolbar`,"aria-label":`Artifact view`,className:`flex shrink-0 items-center gap-1 px-3 pt-3 pb-2`,children:[C(re,{defaultOpen:P===`filter`,children:[m(oe,{asChild:!0,children:C(k,{variant:`ghost`,size:`sm`,className:`text-po-text`,children:[m(te,{"aria-hidden":!0,className:`size-3.5`}),`Filter`,b.status!==`all`||b.type!==`any`||b.modified!==`any`||b.location!==`artifacts`?m(e,{tone:`green`,"aria-label":`Filters on`}):null]})}),C(de,{align:`start`,className:`w-56`,children:[l?C(ae,{children:[m(D,{children:`Status`}),m(v,{value:b.status,onValueChange:e=>S({...b,status:e}),children:Object.keys(Ze).map(e=>C(w,{value:e,children:[Ze[e],B({status:e})]},e))}),m(O,{})]}):null,m(D,{children:`Type`}),m(v,{value:b.type,onValueChange:e=>S({...b,type:e}),children:Qe.map(e=>C(w,{value:e,children:[e===`any`?`All types`:e,B({type:e})]},e))}),m(O,{}),m(D,{children:`Modified`}),m(v,{value:b.modified,onValueChange:e=>S({...b,modified:e}),children:Object.keys($e).map(e=>C(w,{value:e,children:[$e[e],B({modified:e})]},e))}),m(O,{}),m(D,{children:`Location`}),m(v,{value:b.location,onValueChange:e=>S({...b,location:e}),children:Object.keys(et).map(e=>m(w,{value:e,children:et[e]},e))}),H?C(ae,{children:[m(O,{}),m(ce,{onSelect:G,children:`Reset filters`})]}):null]})]}),C(re,{defaultOpen:P===`sort`,children:[m(oe,{asChild:!0,children:C(k,{variant:`ghost`,size:`sm`,className:`text-po-text`,children:[`Sort`,m(d,{"aria-hidden":!0,className:`size-3`})]})}),m(de,{align:`start`,className:`w-48`,children:m(v,{value:W,onValueChange:e=>{let[t,n]=e.split(`:`);ue(t,n)},children:Object.keys(tt).map(e=>m(w,{value:e,children:tt[e]},e))})})]}),m(`span`,{className:`flex-1`}),m(`fieldset`,{"aria-label":`Artifact view`,className:`flex shrink-0 gap-0.5`,children:[[`tree`,se,`Tree view`],[`grid`,ie,`Preview view`]].map(([e,t,n])=>m(`button`,{type:`button`,"aria-label":n,title:n,"aria-pressed":f===e,onClick:()=>ee(e),className:`${c({active:f===e})} focus-visible:ring-2 focus-visible:ring-po-green`,children:m(t,{"aria-hidden":!0,className:`size-4`})},e))}),m(`button`,{type:`button`,"aria-label":`Search artifacts`,title:`Search artifacts`,"aria-expanded":_,onClick:()=>y(!_),className:`${c({active:_||p!==``})} focus-visible:ring-2 focus-visible:ring-po-green`,children:m(s,{"aria-hidden":!0,className:`size-4`})})]}),_?C(`div`,{className:`relative shrink-0 px-3 pb-2`,children:[m(s,{"aria-hidden":!0,className:`absolute top-2 left-5 size-4 text-po-dim`}),m(he,{"aria-label":`Search artifacts`,autoFocus:!0,placeholder:`Search by name or folder`,value:p,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),g(``),y(!1))},className:`w-full pl-8`})]}):null,l&&L+R>0?C(`div`,{className:`flex shrink-0 items-center gap-1 border-b border-po-border-soft px-3 pb-2`,children:[L>0?C(k,{variant:`ghost`,size:`xs`,"aria-pressed":b.status===`new`,onClick:()=>K(`new`),className:b.status===`new`?`bg-po-tint-green text-po-green`:`text-po-text`,children:[L,` new`]}):null,R>0?C(k,{variant:`ghost`,size:`xs`,"aria-pressed":b.status===`edited`,onClick:()=>K(`edited`),className:b.status===`edited`?`bg-po-tint-green text-po-green`:`text-po-text`,children:[R,` edited`]}):null,m(`span`,{className:`flex-1`}),N?m(k,{variant:`ghost`,size:`xs`,onClick:N,className:`text-po-dim`,children:`Mark all viewed`}):null]}):m(`div`,{className:`shrink-0 border-b border-po-border-soft`}),C(`div`,{ref:Se,className:`min-h-0 flex-1 overflow-auto`,children:[i?C(`div`,{role:`alert`,className:`flex items-center gap-2 px-4 py-3`,children:[m(`p`,{className:`flex-1 text-sm text-po-red`,children:i}),a?m(k,{variant:`outline`,size:`xs`,onClick:a,children:`Try again`}):null]}):null,r?m(`output`,{className:`block px-4 py-3 text-sm text-po-dim`,children:`Loading files...`}):null,!r&&!i&&n.length===0?m(fe,{title:`Nothing here yet`,description:`Files Po makes in this session show up here.`,className:`px-4 py-8`}):null,!r&&n.length>0&&V.length===0?m(fe,{title:`No files match`,className:`px-4 py-8`,children:m(k,{variant:`ghost`,onClick:G,children:`Clear filters`})}):null,m(`div`,{className:f===`grid`?`grid grid-cols-2 gap-2 p-3`:`flex flex-col py-1`,children:U.map(e=>{if(e.kind===`dir`){let t=Ce(e.path);return C(`button`,{type:`button`,"data-artifact-row":!0,"aria-expanded":e.open,onClick:()=>A(e.path),onKeyDown:t=>{q(t),(t.key===`ArrowRight`&&!e.open||t.key===`ArrowLeft`&&e.open)&&(t.preventDefault(),A(e.path))},className:`flex min-h-9 items-center gap-2 px-3 py-1.5 text-left hover:bg-po-panel focus-visible:ring-2 focus-visible:ring-po-green focus-visible:ring-inset`,children:[Array.from({length:e.depth},(e,t)=>m(`span`,{className:`w-3 shrink-0`},t)),e.open?m(d,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-po-dim`}):m(u,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-po-dim`}),m(se,{"aria-hidden":!0,className:`size-4 shrink-0 text-po-dim`}),m(`span`,{className:`min-w-0 flex-1 truncate text-base font-medium`,children:e.name}),t>0?C(`span`,{className:`shrink-0 text-sm font-semibold text-po-green`,children:[t,` unviewed`]}):C(`span`,{className:`shrink-0 text-sm text-po-dim`,children:[e.count,` `,e.count===1?`file`:`files`]})]},e.path)}let t=I.get(e.item.path),n=t===`new`||t===`edited`,r=j===e.item.path,i=M(e.item.path)===`Image`?me:le;return C(`button`,{type:`button`,"data-artifact-row":!0,"data-artifact-path":e.item.path,"data-status":t,"aria-current":r?`true`:void 0,title:e.item.path,onClick:()=>ge(e.item),onKeyDown:q,className:`${f===`grid`?`flex min-w-0 flex-col gap-1.5 rounded-md border p-2 text-left`:`flex min-h-9 items-center gap-2 border-l-2 px-3 py-1.5 text-left`} ${r?`border-po-green bg-po-panel`:f===`grid`?`border-po-border-soft hover:bg-po-panel`:`border-transparent hover:bg-po-panel`} focus-visible:ring-2 focus-visible:ring-po-green focus-visible:ring-inset`,children:[f===`grid`?C(`span`,{className:`relative flex h-24 w-full items-center justify-center overflow-hidden rounded-sm bg-po-deep text-po-dim`,children:[be?.(e.item)??m(i,{"aria-hidden":!0,className:`size-8`}),m(`span`,{className:`absolute top-1 left-1`,children:m(nt,{status:t})})]}):C(ae,{children:[Array.from({length:e.depth},(e,t)=>m(`span`,{className:`w-3 shrink-0`},t)),m(`span`,{className:`w-3.5 shrink-0`}),m(i,{"aria-hidden":!0,className:`size-4 shrink-0 text-po-dim`})]}),C(`span`,{className:`flex w-full min-w-0 flex-1 items-center gap-2`,children:[m(`span`,{className:`min-w-0 flex-1 truncate text-base ${n?`font-semibold text-po-hi`:`text-po-text`}`,children:e.item.name}),f===`grid`?m(`span`,{className:`sr-only`,children:m(nt,{status:t===`viewed`?t:void 0})}):m(nt,{status:t}),m(it,{modifiedAt:e.item.modifiedAt,now:o})]})]},e.item.path)})})]}),C(`footer`,{"data-testid":`artifacts-count`,"aria-live":`polite`,className:`shrink-0 border-t border-po-border-soft px-4 py-2 text-sm text-po-dim`,children:[H?`${V.length} of ${n.length}`:n.length,` `,n.length===1?`file`:`files`]})]})}function it({modifiedAt:e,now:t}){let n=h(null);return x(()=>{let t=setInterval(()=>{let t=n.current?.firstChild;t&&(t.nodeValue=P(e,Date.now()))},6e4);return()=>clearInterval(t)},[e]),m(`time`,{ref:n,dateTime:new Date(e).toISOString(),className:`shrink-0 text-sm text-po-dim`,children:P(e,t)})}var at=5242880,ot=`artifact:`;function st(e){let{sessionId:t}=e,n=E(z.store,e=>z.select(e,t)),r=E(J.store,e=>t===null?void 0:e[t]),i=E(Z.store,e=>t===null?Y:e[t]??Y),a=E(U.store),o=i.filters.location===`temporary`,s=Ye(t,o),[c,l]=T(Date.now);x(()=>{let e=z.store.subscribe(()=>l(Date.now()));return()=>e.unsubscribe()},[]);let u=Ue(e);x(()=>{if(t!==null)return u?.watchFocusedPath?.(t,e=>{if(typeof e!=`string`||!e.startsWith(ot))return;let n=e.slice(9),r=n.split(`/`).slice(0,-1).map((e,t,n)=>n.slice(0,t+1).join(`/`)),i=Z.store.state[t]??Y;if(i.filters.location!==`artifacts`)return;let a=r.filter(e=>!i.expanded.includes(e));(i.openPath!==n||a.length!==0)&&Fe(t,e=>({...e,openPath:n,expanded:[...e.expanded,...a]}))})},[u,t]),x(()=>{if(t===null||n.loaded)return;let e=new AbortController;return Le(t,e.signal),()=>e.abort()},[t,n.loaded]);let d=e=>{t!==null&&Fe(t,t=>({...t,...e}))},f=o?s?.items??[]:n.items;return m(rt,{items:f,loading:t!==null&&(o?s===void 0:!n.loaded),error:t===null?`The session is unavailable.`:o?s?.error:n.error,onRetry:t===null||o?void 0:()=>void Le(t,new AbortController().signal),now:c,statusOf:o?void 0:e=>be(e,r),layout:a===`grid`?`grid`:`tree`,onLayoutChange:Ce,query:i.query,onQueryChange:e=>d({query:e}),searchOpen:i.searchOpen,onSearchOpenChange:e=>d({searchOpen:e}),filters:i.filters,onFiltersChange:e=>{d({filters:e}),l(Date.now())},sort:i.sort,direction:i.direction,onSortChange:(e,t)=>d({sort:e,direction:t}),expanded:new Set(i.expanded),onToggleFolder:e=>d({expanded:i.expanded.includes(e)?i.expanded.filter(t=>t!==e):[...i.expanded,e]}),openPath:i.openPath,onOpen:n=>{if(t===null)return;Je(e,n.path,i.filters.location),o||Ae(t,n);let r=n.path.split(`/`).slice(0,-1).map((e,t,n)=>n.slice(0,t+1).join(`/`));d({openPath:n.path,expanded:[...i.expanded,...r.filter(e=>!i.expanded.includes(e))]})},onMarkAllViewed:t===null?void 0:()=>je(t,n.items),renderThumbnail:e=>t!==null&&M(e.path)===`Image`&&e.size<=at?m(Xe,{sessionId:t,item:e},e.path):void 0},t)}var ct=a({id:`artifacts`,label:`Artifacts`,icon:le,order:10,panel:st,badge:{subscribe(e){let t=z.store.subscribe(e),n=J.store.subscribe(e);return()=>{t.unsubscribe(),n.unsubscribe()}},count:Me}});function lt(e,t){let n=e.trim(),r;if(n.startsWith(`temporary:`))r=n.slice(10);else{if(!t||!t.startsWith(`/`))return;let e=t.replace(/\/+$/u,``);if(!n.startsWith(`${e}/`))return;r=n.slice(e.length+1)}if(!(!r||r.includes(`\\`)||r.includes(`\0`)||r.split(`/`).some(e=>!e||e===`.`||e===`..`)))return r}var ut=5,dt=ee({subscribe(e){let t=z.store.subscribe(e);return()=>t.unsubscribe()},fingerprint:e=>z.select(z.store.state,e).temporaryRoot??``,resolve(e,t){let n=t.trim();if(e===null)return;let r=lt(n,z.select(z.store.state,e).temporaryRoot);if(r)return $(e,r,`temporary`);if(!n.startsWith(`artifact:`))return;let i=n.slice(9);return i===``?void 0:$(e,i)},mentions(e,t){let n=t.toLowerCase();return z.select(z.store.state,e).items.map(e=>`artifact:${e.path}`).filter(e=>e.toLowerCase().includes(n)).slice(0,ut).map(e=>({path:e,detail:`Artifact`}))}}),ft=y({slot:`help.guides`,id:`Artifacts`,order:10,data:{version:1,label:`Artifacts`,guides:[{id:`about`,question:`What are artifacts?`,order:0,answer:`Artifacts are important deliverables saved in this session’s durable artifact folder. Ordinary source edits stay in your project.`},{id:`find`,question:`Where do I find files Po made?`,order:1,answer:`The Artifacts activity section shows the three most recently changed files. Open its heading to see all this session’s artifacts. Previews are read-only.`}]}}),pt=(e,t)=>t===void 0?void 0:{...e,...t},mt=n({id:`artifacts`,session:{get channels(){return[pt({channel:`artifacts`},Ie)]},get dockFaces(){return[pt({id:`artifacts`},ct)]},get fileLinks(){return dt},get fills(){return[pt({slot:`help.guides`,id:`artifacts`},ft)]}}});export{mt as webPlugin};
|
/package/dist/assets/plugins/slots/{approval.3e4ea6e4-CqQk6XG_.js → approval.09e72f36-CqQk6XG_.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{codemode.5f359b9c-Bzl_K_vt.js → codemode.c58fb583-Bzl_K_vt.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{domain.832848c8-CvnpuKCY.js → domain.753f9f92-CvnpuKCY.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{files.364f16c9-wuB8gcQA.js → files.66ffc636-wuB8gcQA.js}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{profile.63bc3ae6-BSY3iYfJ.js → profile.ab16dcec-BSY3iYfJ.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{prompts.9d9b47cc-xdCkNkoA.js → prompts.ae48c07a-xdCkNkoA.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/assets/plugins/slots/{runner.5393fa6c-DfO2Z9HG.js → runner.6e494d59-DfO2Z9HG.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{skill.56c1cc07-CL_n-l4h.js → skill.62a0a1b3-CL_n-l4h.js}
RENAMED
|
File without changes
|
/package/dist/assets/plugins/slots/{vault.587549ba-DbG3F_on.js → vault.3cbfcdc3-DbG3F_on.js}
RENAMED
|
File without changes
|