@heycys/gallery 0.2.2 → 0.2.4
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/README.md +1 -1
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/assets/preview/runtime.js +156 -0
- package/assets/preview/shell.html +107 -0
- package/assets/writing-preferences.md +1 -1
- package/browser/editor/components/divider/index.mjs +1 -1
- package/browser/editor/page/annotate/card.mjs +6 -0
- package/browser/editor/page/annotate/index.mjs +22 -2
- package/browser/editor/page/columns/index.mjs +1 -1
- package/browser/editor/page/conflicts.mjs +1 -1
- package/browser/editor/page/drag/index.mjs +1 -1
- package/browser/editor/page/editor.mjs +43 -5
- package/browser/editor/page/focus.mjs +104 -0
- package/browser/editor/page/handle/index.mjs +14 -2
- package/browser/editor/page/links/index.mjs +2 -2
- package/browser/editor/page/quiet.mjs +3 -3
- package/browser/editor/page/resize/index.mjs +1 -1
- package/browser/editor/page/session.mjs +4 -1
- package/browser/editor/page/ui.mjs +1 -1
- package/browser/shared/annotations.mjs +22 -3
- package/browser/shared/block-packs.mjs +13 -4
- package/browser/shared/document-look.mjs +14 -0
- package/browser/shared/drafts.mjs +1 -1
- package/browser/shared/extension-manifest.mjs +40 -12
- package/browser/shared/favorite-merge.mjs +17 -0
- package/browser/shared/favorites.mjs +77 -0
- package/browser/shared/i18n/en.mjs +123 -24
- package/browser/shared/outline-ops.mjs +109 -0
- package/browser/shared/outline.mjs +6 -0
- package/browser/shared/pages.mjs +20 -8
- package/browser/shared/paths.mjs +5 -2
- package/browser/shared/preference-documents.mjs +137 -0
- package/browser/shared/presence.mjs +94 -0
- package/browser/shared/preview-server.mjs +8 -5
- package/browser/shared/qa-levels.mjs +9 -1
- package/browser/shared/session.mjs +4 -0
- package/browser/shared/shipped-blocks.mjs +22 -4
- package/browser/shared/startup.mjs +101 -0
- package/browser/shared/workspace-address.mjs +3 -0
- package/browser/shared/workspace-columns.mjs +1 -1
- package/browser/shared/workspace-look.mjs +21 -8
- package/browser/shared/workspace-registry.mjs +6 -3
- package/browser/shared/workspace.mjs +37 -10
- package/browser/shared/writing-preferences.mjs +2 -42
- package/dist/chunk-25LYSMAE.mjs +2 -0
- package/dist/chunk-2I6ZVC5O.mjs +2 -0
- package/dist/{chunk-M4NRDYI5.mjs → chunk-2MYTOOP6.mjs} +1 -1
- package/dist/chunk-2VNENLER.mjs +2 -0
- package/dist/chunk-3FERXZF5.mjs +4 -0
- package/dist/chunk-3M6SBBGU.mjs +2 -0
- package/dist/chunk-3VCAAF34.mjs +2 -0
- package/dist/{chunk-JXXHAXYH.mjs → chunk-3ZTRLGSA.mjs} +1 -1
- package/dist/chunk-4FRA5AUE.mjs +2 -0
- package/dist/chunk-4LR2QEC2.mjs +4 -0
- package/dist/chunk-56SVJENP.mjs +966 -0
- package/dist/chunk-5CQISL2G.mjs +4 -0
- package/dist/{chunk-RRKJMHNX.mjs → chunk-5I5ZDDWC.mjs} +5 -5
- package/dist/chunk-5IHDLEB4.mjs +10 -0
- package/dist/chunk-5LRDMV7O.mjs +2 -0
- package/dist/chunk-5MVUYRKG.mjs +5 -0
- package/dist/chunk-5TLLIZT7.mjs +2 -0
- package/dist/chunk-6ILJWFYW.mjs +4 -0
- package/dist/chunk-6N25CJ6Y.mjs +3 -0
- package/dist/{chunk-SQ6Y2ZMA.mjs → chunk-7DTINW6U.mjs} +2 -2
- package/dist/chunk-7KWAGKIK.mjs +2 -0
- package/dist/chunk-7WNUOAFK.mjs +2 -0
- package/dist/chunk-7XCRW5RC.mjs +2 -0
- package/dist/{chunk-ERE2BXYV.mjs → chunk-7XSDTILF.mjs} +1 -1
- package/dist/chunk-ABKYFOVR.mjs +2 -0
- package/dist/chunk-AMUF7PUN.mjs +2 -0
- package/dist/{chunk-PLB7L22J.mjs → chunk-B2EIMERT.mjs} +2 -2
- package/dist/{chunk-QNECWMGR.mjs → chunk-B45IAAU6.mjs} +1 -1
- package/dist/chunk-B6RAGF4R.mjs +2 -0
- package/dist/chunk-BSJKFE7I.mjs +4 -0
- package/dist/chunk-C72EEVLK.mjs +2 -0
- package/dist/chunk-CRAUKZ23.mjs +4 -0
- package/dist/chunk-F4CT35KL.mjs +2 -0
- package/dist/chunk-F63BNJLG.mjs +2 -0
- package/dist/chunk-FBKUPS44.mjs +2 -0
- package/dist/chunk-FL52ZL5Z.mjs +15 -0
- package/dist/chunk-FOZCU4VW.mjs +2 -0
- package/dist/chunk-G5HV7BC3.mjs +2 -0
- package/dist/{chunk-ERLAIBOA.mjs → chunk-GB5SOYQJ.mjs} +2 -2
- package/dist/chunk-GN3SG3IF.mjs +2 -0
- package/dist/{chunk-6QWQXHAV.mjs → chunk-HFTBVEZK.mjs} +1 -1
- package/dist/chunk-IOW5HLRK.mjs +2 -0
- package/dist/chunk-IQ3GJNTI.mjs +6 -0
- package/dist/chunk-K6SPFBUJ.mjs +2 -0
- package/dist/chunk-K7Y7SPTS.mjs +2 -0
- package/dist/chunk-L2IJCEUH.mjs +2 -0
- package/dist/{chunk-GPIWQ4X4.mjs → chunk-L3VT6LM4.mjs} +1 -1
- package/dist/chunk-L4WLQYFC.mjs +5 -0
- package/dist/{chunk-FFV733MA.mjs → chunk-LAMCAGK6.mjs} +1 -1
- package/dist/chunk-LHGKPMTI.mjs +2 -0
- package/dist/chunk-LJZIYVNA.mjs +3 -0
- package/dist/chunk-LSVCTLS2.mjs +2 -0
- package/dist/chunk-LZY74XTP.mjs +2 -0
- package/dist/chunk-MC4LRSVH.mjs +2 -0
- package/dist/chunk-MCEXN4G5.mjs +2 -0
- package/dist/chunk-MTLAOCFF.mjs +181 -0
- package/dist/chunk-MZ66LN3B.mjs +2 -0
- package/dist/chunk-N5QWJRRI.mjs +2 -0
- package/dist/chunk-NF4MMOUB.mjs +2 -0
- package/dist/chunk-NHJYAJ73.mjs +3 -0
- package/dist/chunk-NRSD7SVY.mjs +2 -0
- package/dist/chunk-NT23I4XW.mjs +2 -0
- package/dist/chunk-NUALABIS.mjs +3 -0
- package/dist/chunk-NW6LAU22.mjs +2 -0
- package/dist/chunk-NWWHDGKF.mjs +5 -0
- package/dist/chunk-OFRCVMSJ.mjs +2 -0
- package/dist/chunk-OKVQQ3CX.mjs +4 -0
- package/dist/chunk-OM24O4KR.mjs +8 -0
- package/dist/{chunk-4B2TB5K2.mjs → chunk-PBMOC7KA.mjs} +2 -2
- package/dist/chunk-PVTCP43W.mjs +2 -0
- package/dist/chunk-Q62HZAJS.mjs +2 -0
- package/dist/chunk-QBJWIR3Q.mjs +2 -0
- package/dist/chunk-QDSEZX7Z.mjs +6 -0
- package/dist/chunk-QR4V4A2Z.mjs +15 -0
- package/dist/{chunk-QVGOPHOF.mjs → chunk-QRLVVZ3R.mjs} +1 -1
- package/dist/chunk-QW3QG67J.mjs +2 -0
- package/dist/chunk-R2T2EVWY.mjs +8 -0
- package/dist/{chunk-GJJRBGMY.mjs → chunk-R5RERE6G.mjs} +1 -1
- package/dist/chunk-RFHEWT3Y.mjs +5 -0
- package/dist/chunk-RS2Z2JQP.mjs +2 -0
- package/dist/chunk-S6YEC4GE.mjs +16 -0
- package/dist/chunk-SHZLMGGW.mjs +2 -0
- package/dist/chunk-TALJQM2O.mjs +2 -0
- package/dist/chunk-TLNJWEFY.mjs +22 -0
- package/dist/{chunk-6Q7ASAXJ.mjs → chunk-TQZU7D7C.mjs} +1 -1
- package/dist/chunk-UTKNWYBA.mjs +2 -0
- package/dist/chunk-V3TM3TEN.mjs +2 -0
- package/dist/chunk-V3XROSP5.mjs +7 -0
- package/dist/{chunk-6QBHU4DF.mjs → chunk-V5JTW2LH.mjs} +1 -1
- package/dist/chunk-VAXLSISW.mjs +4 -0
- package/dist/chunk-VBHI3RG6.mjs +2 -0
- package/dist/{chunk-6L6V7YR2.mjs → chunk-VKZJRGDR.mjs} +1 -1
- package/dist/chunk-VZXZM7NS.mjs +2 -0
- package/dist/chunk-WDS6HEPE.mjs +2 -0
- package/dist/chunk-WHGANNEY.mjs +13 -0
- package/dist/chunk-WMJWC4QY.mjs +56 -0
- package/dist/{chunk-VZ2RQ3AM.mjs → chunk-WWONJJQS.mjs} +1 -1
- package/dist/chunk-X4WNLFIK.mjs +2 -0
- package/dist/chunk-XNNCQROX.mjs +11 -0
- package/dist/chunk-XRYECF23.mjs +170 -0
- package/dist/{chunk-K3JKPFL5.mjs → chunk-Z4NEXXFK.mjs} +1 -1
- package/dist/{chunk-236JJXWY.mjs → chunk-ZFVF2YPV.mjs} +2 -2
- package/dist/chunk-ZM2IX3R2.mjs +2 -0
- package/dist/chunk-ZNGGDUZI.mjs +2 -0
- package/dist/chunk-ZOEJQOKT.mjs +2 -0
- package/dist/cli.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/update-fetch.mjs +1 -1
- package/dist/worker.mjs +1 -1
- package/kit/runtime.js +1 -0
- package/package.json +1 -1
- package/release.json +4 -4
- package/skill/SKILL.md +54 -148
- package/skill/references/building-blocks.md +4 -4
- package/skill/references/charts-and-figures.md +73 -0
- package/skill/references/extensions.md +47 -4
- package/skill/references/pages-and-data.md +22 -3
- package/skill/references/preference-files.md +7 -0
- package/skill/references/previews.md +17 -0
- package/skill/references/writing-html.md +21 -82
- package/web/assets/index-B4uUluLM.js +15 -0
- package/web/assets/index-C3vHT8sH.css +1 -0
- package/web/index.html +2 -2
- package/dist/chunk-2KAVXMKG.mjs +0 -4
- package/dist/chunk-2T4PZQEP.mjs +0 -2
- package/dist/chunk-3SKOU6OZ.mjs +0 -10
- package/dist/chunk-3XZOA7AH.mjs +0 -170
- package/dist/chunk-4KUO7R2M.mjs +0 -16
- package/dist/chunk-4OZWXZE5.mjs +0 -5
- package/dist/chunk-4SNV4HA5.mjs +0 -2
- package/dist/chunk-53XDTHTG.mjs +0 -4
- package/dist/chunk-5XV3YYLG.mjs +0 -2
- package/dist/chunk-65NTKF4N.mjs +0 -6
- package/dist/chunk-6GV3CBB2.mjs +0 -2
- package/dist/chunk-6NLXUKAY.mjs +0 -4
- package/dist/chunk-6XD6U3QA.mjs +0 -5
- package/dist/chunk-7EFHNQ5B.mjs +0 -3
- package/dist/chunk-7ISBBDJR.mjs +0 -2
- package/dist/chunk-7M2BQQGZ.mjs +0 -2
- package/dist/chunk-7UZUQQ7Q.mjs +0 -554
- package/dist/chunk-ALZ6ZENZ.mjs +0 -3
- package/dist/chunk-BLNQUR5R.mjs +0 -168
- package/dist/chunk-BMX3VUHY.mjs +0 -2
- package/dist/chunk-BN7M3IN7.mjs +0 -8
- package/dist/chunk-C257H6IA.mjs +0 -2
- package/dist/chunk-CHQU37CA.mjs +0 -2
- package/dist/chunk-DR73Y2UJ.mjs +0 -3
- package/dist/chunk-E4IHAIJ7.mjs +0 -2
- package/dist/chunk-EURLTOTZ.mjs +0 -4
- package/dist/chunk-F4ZA6JRZ.mjs +0 -3
- package/dist/chunk-GKOBB6DH.mjs +0 -2
- package/dist/chunk-GMJD7ID3.mjs +0 -2
- package/dist/chunk-IA2SIEJQ.mjs +0 -2
- package/dist/chunk-JEUK3ZO7.mjs +0 -2
- package/dist/chunk-JPG2LBQM.mjs +0 -11
- package/dist/chunk-KLQP46Y3.mjs +0 -4
- package/dist/chunk-LMUZQK5O.mjs +0 -2
- package/dist/chunk-MKIBJTJZ.mjs +0 -6
- package/dist/chunk-MNWJ4EZY.mjs +0 -2
- package/dist/chunk-NHP66IWR.mjs +0 -5
- package/dist/chunk-OEIJLMPI.mjs +0 -2
- package/dist/chunk-PDZR3L3C.mjs +0 -2
- package/dist/chunk-PUOQ65NC.mjs +0 -2
- package/dist/chunk-Q4MS6OFC.mjs +0 -2
- package/dist/chunk-Q7P3Q5YX.mjs +0 -13
- package/dist/chunk-QP7BOHE4.mjs +0 -2
- package/dist/chunk-S3SX3COT.mjs +0 -20
- package/dist/chunk-TANZRINB.mjs +0 -2
- package/dist/chunk-UGWMMEJ5.mjs +0 -15
- package/dist/chunk-ULXSPX5H.mjs +0 -5
- package/dist/chunk-USIHBCSW.mjs +0 -15
- package/dist/chunk-VPMRP2TL.mjs +0 -2
- package/dist/chunk-WFGPMCTZ.mjs +0 -4
- package/dist/chunk-XZCFPKGO.mjs +0 -2
- package/dist/chunk-ZFGMJVJC.mjs +0 -2
- package/web/assets/index-FLb9jCfl.css +0 -1
- package/web/assets/index-czjrXVjf.js +0 -15
- /package/dist/{chunk-PAREWQGB.mjs → chunk-NOGQX56R.mjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-G5HV7BC3.mjs";import"./chunk-5TLLIZT7.mjs";import"./chunk-TLNJWEFY.mjs";import"./chunk-ZOEJQOKT.mjs";import"./chunk-IA4PSIMD.mjs";import"./chunk-B2EIMERT.mjs";import"./chunk-6N25CJ6Y.mjs";import"./chunk-F4CT35KL.mjs";import"./chunk-6ILJWFYW.mjs";import"./chunk-VRPVVMRB.mjs";import"./chunk-HYMEEXKN.mjs";import"./chunk-L4WLQYFC.mjs";import"./chunk-UMHUSOPJ.mjs";import"./chunk-W5NPH5UA.mjs";import"./chunk-ECZBLQKK.mjs";import"./chunk-E7656LR7.mjs";import"./chunk-TKWEX4FD.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";export{e as blockSaid,d as countsSaid,f as documentOf,h as failed,c as kindName,a as localTime,g as rereadLine,i as run,b as shortOf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
-
import{a as y,b as C}from"./chunk-Q4UEPUWF.mjs";import{a as A}from"./chunk-
|
|
2
|
+
import{a as y,b as C}from"./chunk-Q4UEPUWF.mjs";import{a as A}from"./chunk-LAMCAGK6.mjs";import{c as P,d as W}from"./chunk-VAXLSISW.mjs";import"./chunk-56SVJENP.mjs";import"./chunk-PBMOC7KA.mjs";import"./chunk-BSJKFE7I.mjs";import{b as j,f as M}from"./chunk-L4WLQYFC.mjs";import"./chunk-E7656LR7.mjs";import"./chunk-TKWEX4FD.mjs";import"./chunk-A55HN5OK.mjs";import"./chunk-5L7RYZCL.mjs";import{randomBytes as R}from"node:crypto";import{existsSync as X,readdirSync as G,readFileSync as Y,statSync as _}from"node:fs";import c from"node:fs/promises";import q from"node:os";import i from"node:path";import{release as J,reportsDirectory as V,skillDirectory as H}from"../browser/shared/paths.mjs";import{copyOldDocuments as Q,ensureWorkspace as Z,layoutOf as z,oldStateOf as K}from"../browser/shared/workspace.mjs";var S=o=>_(o,{throwIfNoEntry:!1})?.isDirectory()??!1;function ee({agent:o=null,project:e=!1,dir:r=null,cwd:t=process.cwd(),env:s=process.env}={}){if(r)return[{agent:null,target:i.resolve(t,r),skills:null}];let a=o?[o]:Object.keys(y),u=d=>e?i.join(i.resolve(t),y[d].project):i.resolve(y[d].home(s)),p=a.filter(d=>S(u(d)));return(o||p.length?o?a:p:["claude"]).map(d=>{let h=i.join(u(d),"skills");return{agent:d,target:i.join(h,"gallery"),skills:h}})}function te(o){try{return C(Y(i.join(o,"SKILL.md"),"utf8"))}catch{return null}}function T(o){let e=_(o,{throwIfNoEntry:!1});if(!e)return{kind:"absent"};if(!e.isDirectory())return{kind:"other",why:"it is a file"};let r=G(o);if(r.length===0)return{kind:"absent"};if(r.includes(".git"))return{kind:"other",why:"it is a git checkout"};let t=te(o),s=u=>r.includes(u);return(s("package.json")&&s("src")||s("reports"))&&(t==="gallery"||t==="html-report-studio")?{kind:"fat",name:t}:t==="gallery"&&!s("package.json")&&!s("src")&&!s("reports")?{kind:"thin"}:{kind:"other",why:t?`its SKILL.md is the skill "${t}"`:"it holds no Gallery skill"}}function oe(o){return S(o)?G(o,{withFileTypes:!0}).filter(e=>e.isDirectory()&&!e.name.startsWith(".")).map(e=>i.join(o,e.name)).filter(e=>T(e).kind==="fat"):[]}function re(o){let e=i.join(K(o),"servers");return S(e)?G(e).filter(r=>r.endsWith(".json")).flatMap(r=>{try{let{pid:t,port:s}=JSON.parse(Y(i.join(e,r),"utf8"));return!Number.isInteger(t)||t<=0||t===process.pid?[]:(process.kill(t,0),[{pid:t,port:s}])}catch(t){return t.code==="EPERM"?[{pid:Number.NaN,port:null}]:[]}}):[]}async function O(o){let e=0,r=0,t=async s=>{for(let a of await c.readdir(s,{withFileTypes:!0})){let u=i.join(s,a.name);a.isDirectory()?await t(u):(e++,r+=(await c.lstat(u)).size)}};return await t(o).catch(()=>{}),{files:e,bytes:r}}var B=o=>`${(o/1024/1024).toFixed(1)} MB`,se=(o,e)=>`${o} ${e}${o===1?"":"s"}`;async function v(o,e){for(let r=0;;r++)try{return await c.rename(o,e)}catch(t){if(process.platform!=="win32"||r>=10||!["EPERM","EBUSY","EACCES"].includes(t.code))throw t;await new Promise(s=>setTimeout(s,100*(r+1)))}}function ne(o,e=new Date){let r=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,t=i.join(z(o).gallery,`old-skill-${r}`);for(let s=1;;s++){let a=s===1?t:`${t}-${s}`;if(!X(a))return a}}async function ie(o,e){await c.mkdir(i.dirname(e),{recursive:!0});try{return await v(o,e),null}catch(s){if(s.code!=="EXDEV")return`${s.code??s.message}`}let r=await O(o);await c.cp(o,e,{recursive:!0,preserveTimestamps:!0,verbatimSymlinks:!0,errorOnExist:!0,force:!1});let t=await O(e);return t.files!==r.files||t.bytes!==r.bytes?`the copy holds ${t.files} files, ${t.bytes} bytes, of ${r.files}, ${r.bytes}: the old folder was left as it was`:(await c.rm(o,{recursive:!0,force:!0}),null)}async function U(o){let e=[],r=async t=>{for(let s of await c.readdir(t,{withFileTypes:!0})){let a=i.join(t,s.name);s.isDirectory()?await r(a):e.push([i.relative(o,a).split(i.sep).join("/"),await c.readFile(a)])}};return await r(o),e.sort(([t],[s])=>t<s?-1:t>s?1:0)}var le=(o,e)=>o.length===e.length&&o.every(([r,t],s)=>r===e[s][0]&&t.equals(e[s][1]));async function ae(o,e,r){if(r==="thin"&&le(await U(o),await U(e)))return"same";let t=i.dirname(e);await c.mkdir(t,{recursive:!0});let s=R(4).toString("hex"),a=i.join(t,`.gallery-skill-new-${s}`);if(await c.cp(o,a,{recursive:!0}),r==="absent")return X(e)&&await c.rmdir(e),await v(a,e),"new";let u=i.join(t,`.gallery-skill-old-${s}`);await v(e,u);try{await v(a,e)}catch(p){throw await v(u,e).catch(()=>{}),await c.rm(a,{recursive:!0,force:!0}),p}return await c.rm(u,{recursive:!0,force:!0}),"updated"}async function $e(o,{version:e}){let{positional:r,options:t,values:s}=M({options:["--project"],values:["--agent","--dir"],argv:o});if(r[0]!=="install")throw new j(r.length?`No such skill command: ${r[0]} (install).`:"Say what to do: gallery skill install.");if(r.length>1)throw new j(`gallery skill install takes no other argument: ${r[1]}`);let a=s.get("--agent")??null;if(a!==null&&!Object.hasOwn(y,a))throw new j(`--agent is claude or codex, not ${a}.`);let u=s.get("--dir")??null;if(u!==null&&(a!==null||t.has("--project")))throw new j("--dir names the skill's folder itself: not with --agent or --project.");let p=ee({agent:a,project:t.has("--project"),dir:u}),d=[],h=p.map(n=>({...n,...T(n.target)}));for(let{target:n,kind:l,why:f}of h)l==="other"&&d.push(`${n} holds something that is not a Gallery skill (${f}): move it away, or pass --dir <another folder>.`);let N=[...new Set(h.flatMap(({target:n,kind:l,skills:f})=>[...l==="fat"?[n]:[],...f?oe(f):[]]))];for(let n of N)for(let{pid:l,port:f}of re(n))d.push(Number.isNaN(l)?`The older Gallery skill ${n} has a preview server running that this user cannot see: stop it first.`:`The older Gallery skill ${n} has its preview server running (pid ${l}${f?`, port ${f}`:""}): stop it first (close the window that runs it, or end process ${l}), then run gallery skill install again.`);if(d.length){for(let n of d)console.error(n);console.error("Nothing was changed."),process.exit(1)}if(N.length){let n=V;try{let{ours:l,reads:f}=await Z(n);l||(console.error(W(n,f)),process.exit(1))}catch(l){if(!l.code)throw l;console.error(P(n,l.code)),process.exit(1)}console.log(`\u5DE5\u4F5C\u533A\uFF1A${n}`);for(let l of N){console.log(`An older Gallery skill (the whole tools) is in ${l}: its documents go into the workspace, then it moves out of the skills folder.`);let f=i.join(l,"reports");if(S(f)){let m=await Q({from:f,to:n,state:K(l)});for(let w of A(m,f,n))console.log(` ${w}`)}else console.log(" It holds no documents (no reports/ folder).");let g=i.join(l,"exports");if(S(g)){let m=z(n).exports;await c.mkdir(m,{recursive:!0});let w=[],I=[];for(let E of(await c.readdir(g)).filter(x=>x.endsWith(".html")).sort())try{await c.copyFile(i.join(g,E),i.join(m,E),c.constants.COPYFILE_EXCL),w.push(E)}catch(x){if(x.code!=="EEXIST")throw x;I.push(E)}w.length&&console.log(` Exports: copied ${se(w.length,"file")} into ${m}: ${w.join(", ")}`),I.length&&console.log(` Exports not copied (the name is taken in ${m}; they stay in the moved folder's exports/): ${I.join(", ")}`)}let{bytes:k}=await O(l),$=await O(i.join(l,"node_modules")),D=ne(n),L=await ie(l,D);L&&(console.error(`Could not move ${l} to ${D} (${L}). Its documents are copied; move the folder out of the skills folder yourself (it is never needed in it again), then run gallery skill install again.`),process.exit(1)),console.log(` Moved the old skill to ${D} (${B(k)}${$.files?`; its node_modules/, ${B($.bytes)}, may be deleted: nothing reads it any more`:""}).`)}}let F=H,b=null;if(!J){let{buildSkill:n}=await import("./chunk-FL52ZL5Z.mjs");b=await c.mkdtemp(i.join(q.tmpdir(),"gallery-skill-")),F=i.join(b,"gallery"),n(F,{version:e})}try{let n=!1;for(let{agent:l,target:f}of h){let g=T(f).kind,k=await ae(F,f,g),$=l?` for ${y[l].name}`:"";console.log(k==="same"?`The Gallery skill ${e}${$} is installed already, unchanged: ${f}`:`${k==="updated"?"Updated":"Installed"} the Gallery skill ${e}${$}: ${f}`),n||=k!=="same"}n&&console.log("\u4E0B\u4E00\u6B65\uFF1Aopen a new Agent session to use it.")}finally{b&&await c.rm(b,{recursive:!0,force:!0})}}export{y as AGENTS,T as kindOf,$e as run,ee as targetsOf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-LHGKPMTI.mjs";import"./chunk-5L7RYZCL.mjs";export{g as CLOSING,a as PAPERS,n as chartPictures,k as closeSharedBrowser,h as closed,b as findBrowser,f as keepViolations,d as lookingArguments,e as ownMessage,m as pdfOf,c as sandboxArguments,l as settle,i as startBrowser,j as startChromium};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
|
|
2
|
+
import{a as h,b as E,e as k}from"./chunk-Q4UEPUWF.mjs";import{spawn as I}from"node:child_process";import{existsSync as A,mkdirSync as C,readFileSync as g,renameSync as D,rmSync as b,writeFileSync as G}from"node:fs";import u from"node:fs/promises";import S from"node:os";import a from"node:path";import{fileURLToPath as _}from"node:url";import{userDirectory as Y}from"../browser/shared/user-directory.mjs";import{compareVersions as j,RELEASED as O}from"../browser/shared/versions.mjs";var m="@heycys/gallery",U="\u6280\u80FD\uFF1A",H="\u65B0\u7248\u672C\uFF1A",v="update-check.json",X=1440*60*1e3,K=3600*1e3,W=5e3,J="https://registry.npmjs.org/",V=m.split("/")[0],L="\uFF08\u4E4B\u540E\u65B0\u5F00\u7684 Agent \u4F1A\u8BDD\u624D\u8BFB\u5230\u65B0\u6280\u80FD\uFF09",x=e=>!["","0","false",void 0].includes(e),N=(e=process.env)=>x(e.GALLERY_NO_UPDATE_CHECK)||x(e.CI)||x(e.NO_UPDATE_NOTIFIER),M=(e=_(import.meta.url))=>/[\\/]_npx[\\/]/.test(e),B=(e={})=>Y("cache",e);function q(e,t=process.env){let n=c=>c.replace(/(?<!\\)\$\{([^${}?]+)(\?)?\}/g,(s,l,i)=>t[l]??(i?"":s)),o={},r=!1;for(let c of e.replace(/^\uFEFF/,"").split(/\r?\n/)){let s=c.trim();if(!s||/^[;#]/.test(s))continue;if(/^\[.*\]$/.test(s)){r=!0;continue}let l=s.indexOf("=");if(r||l<1)continue;let i=s.slice(l+1).trim();/^(".*"|'.*')$/.test(i)?i=i.slice(1,-1):i=i.split(/(?<!\\)[;#]/)[0].replace(/\\([;#])/g,"$1").trim(),o[n(s.slice(0,l).trim())]=n(i)}return o}function $({env:e=process.env,home:t=e.HOME||S.homedir(),platform:n=process.platform,execPath:o=process.execPath}={}){let r={};for(let[p,f]of Object.entries(e)){if(!/^npm_config_/i.test(p)||!f)continue;let y=p.slice(11);r[y.startsWith("//")?y:y.replace(/(?!^)_/g,"-").toLowerCase()]=f}let c=p=>{try{return q(g(p,"utf8"),e)}catch{return{}}},s=p=>a.resolve(/^~[\\/]/.test(p)?a.join(t,p.slice(2)):p),l=n==="win32"?a.dirname(o):a.dirname(a.dirname(o)),i=[],d=[()=>r,()=>c(s(r.userconfig||a.join(t,".npmrc"))),()=>{let p=i[3]??=d[3](),f=r.prefix||i[1].prefix||p.prefix||e.PREFIX||l;return c(s(r.globalconfig||a.join(s(f),"etc","npmrc")))},()=>c(n==="win32"?a.join(l,"node_modules","npm","npmrc"):a.join(l,"lib","node_modules","npm","npmrc"))];return p=>{for(let f=0;f<d.length;f++)if(i[f]??=d[f](),i[f][p])return i[f][p]}}function z(e=process.env,t=$({env:e})){let n=e.GALLERY_REGISTRY||t(`${V}:registry`)||t("registry")||J;return n.endsWith("/")?n:`${n}/`}function Q(e=process.env,t=$({env:e})){let n={...e,NODE_USE_ENV_PROXY:"1"},o=(s,l)=>{for(let i of Object.keys(n))s.test(i)&&delete n[i];Object.assign(n,l)},r=t("https-proxy")||t("proxy");r&&o(/^https?_proxy$/i,{HTTPS_PROXY:r,HTTP_PROXY:r});let c=t("noproxy");return c&&o(/^no_proxy$/i,{NO_PROXY:c}),n}var Z=e=>`${e}${m.replace("/","%2f")}/latest`;function R(e){try{let t=JSON.parse(g(e,"utf8"));return t&&typeof t=="object"?t:null}catch{return null}}function ee(e,t,n=Date.now()){if(!e||!Number.isFinite(e.checked)||e.registry!==t)return!0;let o=n-e.checked;return o<0||o>=(e.failed?K:X)}var w=(e,t)=>e?.registry===t&&typeof e.latest=="string"&&O.test(e.latest)?e.latest:null;function te(e,t,n,o=Date.now()){let r=`${e}.${process.pid}.tmp`;try{return C(a.dirname(e),{recursive:!0}),G(r,`${JSON.stringify({checked:o,registry:t,latest:w(n,t),failed:!0,checking:!0})}
|
|
3
|
+
`),D(r,e),!0}catch{return!1}finally{try{b(r,{force:!0})}catch{}}}async function he(e,t,{timeout:n=W,now:o=Date.now}={}){let r=null;try{let l=await fetch(Z(t),{signal:AbortSignal.timeout(n),headers:{Accept:"application/json"}});if(l.ok){let{version:i}=await l.json();typeof i=="string"&&O.test(i)&&(r=i)}}catch{}let c=r?{checked:o(),registry:t,latest:r}:{checked:o(),registry:t,latest:w(R(e),t),failed:!0};await u.mkdir(a.dirname(e),{recursive:!0});let s=`${e}.${process.pid}.tmp`;try{await u.writeFile(s,`${JSON.stringify(c)}
|
|
4
|
+
`),await u.rename(s,e)}finally{await u.rm(s,{force:!0}).catch(()=>{})}return c}function re(e,t,{env:n=process.env}={}){try{let o=I(process.execPath,[_(new URL("./update-fetch.mjs",import.meta.url)),e,t],{cwd:S.homedir(),env:n,detached:!0,stdio:"ignore",windowsHide:!0});return o.on("error",()=>{}),o.unref(),!0}catch{return!1}}function ne({env:e=process.env,cwd:t=process.cwd()}={}){let n=[...Object.values(h).map(r=>({folder:a.join(a.resolve(r.home(e)),"skills","gallery"),project:!1})),...Object.values(h).map(r=>({folder:a.join(a.resolve(t),r.project,"skills","gallery"),project:!0}))],o=r=>process.platform==="win32"?r.toLowerCase():r;return n.filter(({folder:r},c)=>n.findIndex(s=>o(s.folder)===o(r))===c)}var P=(e,t,n)=>n?`npx -y ${m}@^${t} ${e}`:`gallery ${e}`,oe=(e,t,n,o,r=!1)=>`${U}${e} \u662F${t?` Gallery ${t} `:"\u65E7\u7248 Gallery\uFF08\u6CA1\u5199\u7248\u672C\uFF09"}\u7684\uFF0C\u6BD4\u8FD9\u4E2A gallery ${n} \u65E7\uFF1B\u95EE\u8FC7\u7528\u6237\u540E\u8FD0\u884C ${P(`skill install${o?" --project":""}`,n,r)}${L}`,se=(e,t,n=!1)=>`${H}npm \u4E0A\u6709 Gallery ${e}\uFF0C\u8FD9\u4E2A gallery \u662F ${t}\uFF1B\u95EE\u8FC7\u7528\u6237\u540E\u8FD0\u884C ${n?P("skill install",e,!0):`npm i -g ${m}@^${e}\uFF0C\u518D\u8FD0\u884C gallery skill install`}${L}`;function T(e,{env:t=process.env,cwd:n=process.cwd()}={}){let o=[];for(let{folder:r,project:c}of ne({env:t,cwd:n})){let s;try{s=g(a.join(r,"SKILL.md"),"utf8")}catch{continue}if(!["gallery","html-report-studio"].includes(E(s))||A(a.join(r,".git")))continue;let l=k(s);o.push({folder:r,project:c,made:l,older:!l||j(l,e)<0})}return o}function ce(e,{env:t=process.env,cwd:n=process.cwd(),npx:o=!1}={}){return T(e,{env:t,cwd:n}).filter(({older:r})=>r).map(({folder:r,made:c,project:s})=>oe(r,c,e,s,o))}function F(e,{env:t=process.env,now:n=Date.now(),refresh:o=!1}={}){if(N(t))return{off:!0,latest:null,newer:!1,checking:!1};try{let r=$({env:t}),c=z(t,r),s=a.join(B({env:t}),v),l=R(s);o&&ee(l,c,n)&&te(s,c,l,n)&&re(s,c,{env:Q(t,r)});let i=w(l,c);return{off:!1,latest:i,newer:!!i&&j(i,e)>0,checking:i===null}}catch{return{off:!1,latest:null,newer:!1,checking:!0}}}function xe(e,{env:t=process.env,cwd:n=process.cwd()}={}){if(N(t))return[];let o=[];try{T(e,{env:t,cwd:n}).some(({older:c})=>c)&&o.push("\u88C5\u4E86\u7684\u6280\u80FD\u6BD4\u8FD9\u4E2A gallery \u65E7")}catch{}let r=F(e,{env:t});return r.newer&&o.push(`npm \u4E0A\u6709\u65B0\u7248 Gallery ${r.latest}`),o}function ge(e,{env:t=process.env,cwd:n=process.cwd(),now:o=Date.now(),npx:r=M()}={}){let c=[];try{c.push(...ce(e,{env:t,cwd:n,npx:r}))}catch{}let s=F(e,{env:t,now:o,refresh:!0});return s.newer&&c.push(se(s.latest,e,r)),c}export{m as a,U as b,H as c,v as d,X as e,K as f,W as g,N as h,M as i,B as j,q as k,$ as l,z as m,Q as n,Z as o,R as p,ee as q,te as r,he as s,re as t,ne as u,P as v,oe as w,se as x,T as y,ce as z,F as A,xe as B,ge as C};
|